authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-24 03:40:54+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-25 11:24:18+01:00
log37706cc1d98025c5ebff52d35cb6929ea1562dd7
tree9e196aab70771af856dbcfd6f8c3776b1c3529b4
parent1cc388d5263058f9e9eecc410eea825a9a58e143

libc: Update Linux headers to 6.13.4.


212 files changed, 8820 insertions(+), 611 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+7-1
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21 * HWCAP flags - for AT_HWCAP21 * HWCAP flags - for AT_HWCAP
22 *22 *
23 * Bits 62 and 63 are reserved for use by libc.23 * Bits 62 and 63 are reserved for use by libc.
24 * Bits 32-61 are unallocated for potential use by libc.24 * Bits 33-61 are unallocated for potential use by libc.
25 */25 */
26#define HWCAP_FP (1 << 0)26#define HWCAP_FP (1 << 0)
27#define HWCAP_ASIMD (1 << 1)27#define HWCAP_ASIMD (1 << 1)
...@@ -55,6 +55,7 @@...@@ -55,6 +55,7 @@
55#define HWCAP_SB (1 << 29)55#define HWCAP_SB (1 << 29)
56#define HWCAP_PACA (1 << 30)56#define HWCAP_PACA (1 << 30)
57#define HWCAP_PACG (1UL << 31)57#define HWCAP_PACG (1UL << 31)
58#define HWCAP_GCS (1UL << 32)
5859
59/*60/*
60 * HWCAP2 flags - for AT_HWCAP261 * HWCAP2 flags - for AT_HWCAP2
...@@ -122,5 +123,10 @@...@@ -122,5 +123,10 @@
122#define HWCAP2_SME_SF8FMA (1UL << 60)123#define HWCAP2_SME_SF8FMA (1UL << 60)
123#define HWCAP2_SME_SF8DP4 (1UL << 61)124#define HWCAP2_SME_SF8DP4 (1UL << 61)
124#define HWCAP2_SME_SF8DP2 (1UL << 62)125#define HWCAP2_SME_SF8DP2 (1UL << 62)
126#define HWCAP2_POE (1UL << 63)
127
128/*
129 * HWCAP3 flags - for AT_HWCAP3
130 */
125131
126#endif /* __ASM_HWCAP_H */132#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h+6
...@@ -473,6 +473,12 @@ enum {...@@ -473,6 +473,12 @@ enum {
473 */473 */
474#define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0)474#define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0)
475475
476/*
477 * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call.
478 * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN.
479 */
480#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2 (1ULL << 0)
481
476/* run->fail_entry.hardware_entry_failure_reason codes. */482/* run->fail_entry.hardware_entry_failure_reason codes. */
477#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)483#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
478484
lib/libc/include/aarch64-linux-any/asm/mman.h+9
...@@ -7,4 +7,13 @@...@@ -7,4 +7,13 @@
7#define PROT_BTI 0x10 /* BTI guarded page */7#define PROT_BTI 0x10 /* BTI guarded page */
8#define PROT_MTE 0x20 /* Normal Tagged mapping */8#define PROT_MTE 0x20 /* Normal Tagged mapping */
99
10/* Override any generic PKEY permission defines */
11#define PKEY_DISABLE_EXECUTE 0x4
12#define PKEY_DISABLE_READ 0x8
13#undef PKEY_ACCESS_MASK
14#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
15 PKEY_DISABLE_WRITE |\
16 PKEY_DISABLE_READ |\
17 PKEY_DISABLE_EXECUTE)
18
10#endif /* ! _UAPI__ASM_MMAN_H */19#endif /* ! _UAPI__ASM_MMAN_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/ptrace.h+8
...@@ -324,6 +324,14 @@ struct user_za_header {...@@ -324,6 +324,14 @@ struct user_za_header {
324#define ZA_PT_SIZE(vq) \324#define ZA_PT_SIZE(vq) \
325 (ZA_PT_ZA_OFFSET + ZA_PT_ZA_SIZE(vq))325 (ZA_PT_ZA_OFFSET + ZA_PT_ZA_SIZE(vq))
326326
327/* GCS state (NT_ARM_GCS) */
328
329struct user_gcs {
330 __u64 features_enabled;
331 __u64 features_locked;
332 __u64 gcspr_el0;
333};
334
327#endif /* __ASSEMBLY__ */335#endif /* __ASSEMBLY__ */
328336
329#endif /* __ASM_PTRACE_H */337#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/sigcontext.h+19-3
...@@ -98,6 +98,13 @@ struct esr_context {...@@ -98,6 +98,13 @@ struct esr_context {
98 __u64 esr;98 __u64 esr;
99};99};
100100
101#define POE_MAGIC 0x504f4530
102
103struct poe_context {
104 struct _aarch64_ctx head;
105 __u64 por_el0;
106};
107
101/*108/*
102 * extra_context: describes extra space in the signal frame for109 * extra_context: describes extra space in the signal frame for
103 * additional structures that don't fit in sigcontext.__reserved[].110 * additional structures that don't fit in sigcontext.__reserved[].
...@@ -176,6 +183,15 @@ struct zt_context {...@@ -176,6 +183,15 @@ struct zt_context {
176 __u16 __reserved[3];183 __u16 __reserved[3];
177};184};
178185
186#define GCS_MAGIC 0x47435300
187
188struct gcs_context {
189 struct _aarch64_ctx head;
190 __u64 gcspr;
191 __u64 features_enabled;
192 __u64 reserved;
193};
194
179#endif /* !__ASSEMBLY__ */195#endif /* !__ASSEMBLY__ */
180196
181#include <asm/sve_context.h>197#include <asm/sve_context.h>
...@@ -320,10 +336,10 @@ struct zt_context {...@@ -320,10 +336,10 @@ struct zt_context {
320 ((sizeof(struct za_context) + (__SVE_VQ_BYTES - 1)) \336 ((sizeof(struct za_context) + (__SVE_VQ_BYTES - 1)) \
321 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)337 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
322338
323#define ZA_SIG_REGS_SIZE(vq) ((vq * __SVE_VQ_BYTES) * (vq * __SVE_VQ_BYTES))339#define ZA_SIG_REGS_SIZE(vq) (((vq) * __SVE_VQ_BYTES) * ((vq) * __SVE_VQ_BYTES))
324340
325#define ZA_SIG_ZAV_OFFSET(vq, n) (ZA_SIG_REGS_OFFSET + \341#define ZA_SIG_ZAV_OFFSET(vq, n) (ZA_SIG_REGS_OFFSET + \
326 (SVE_SIG_ZREG_SIZE(vq) * n))342 (SVE_SIG_ZREG_SIZE(vq) * (n)))
327343
328#define ZA_SIG_CONTEXT_SIZE(vq) \344#define ZA_SIG_CONTEXT_SIZE(vq) \
329 (ZA_SIG_REGS_OFFSET + ZA_SIG_REGS_SIZE(vq))345 (ZA_SIG_REGS_OFFSET + ZA_SIG_REGS_SIZE(vq))
...@@ -334,7 +350,7 @@ struct zt_context {...@@ -334,7 +350,7 @@ struct zt_context {
334350
335#define ZT_SIG_REGS_OFFSET sizeof(struct zt_context)351#define ZT_SIG_REGS_OFFSET sizeof(struct zt_context)
336352
337#define ZT_SIG_REGS_SIZE(n) (ZT_SIG_REG_BYTES * n)353#define ZT_SIG_REGS_SIZE(n) (ZT_SIG_REG_BYTES * (n))
338354
339#define ZT_SIG_CONTEXT_SIZE(n) \355#define ZT_SIG_CONTEXT_SIZE(n) \
340 (sizeof(struct zt_context) + ZT_SIG_REGS_SIZE(n))356 (sizeof(struct zt_context) + ZT_SIG_REGS_SIZE(n))
lib/libc/include/aarch64-linux-any/asm/unistd.h+1-24
...@@ -1,25 +1,2 @@...@@ -1,25 +1,2 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#define __ARCH_WANT_RENAMEAT
19#define __ARCH_WANT_NEW_STAT
20#define __ARCH_WANT_SET_GET_RLIMIT
21#define __ARCH_WANT_TIME32_SYSCALLS
22#define __ARCH_WANT_SYS_CLONE3
23#define __ARCH_WANT_MEMFD_SECRET
24
25#include <asm-generic/unistd.h>
\ No newline at end of file
2#include <asm/unistd_64.h>
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/unistd_64.h created+328
...@@ -0,0 +1,328 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_renameat 38
43#define __NR_umount2 39
44#define __NR_mount 40
45#define __NR_pivot_root 41
46#define __NR_nfsservctl 42
47#define __NR_statfs 43
48#define __NR_fstatfs 44
49#define __NR_truncate 45
50#define __NR_ftruncate 46
51#define __NR_fallocate 47
52#define __NR_faccessat 48
53#define __NR_chdir 49
54#define __NR_fchdir 50
55#define __NR_chroot 51
56#define __NR_fchmod 52
57#define __NR_fchmodat 53
58#define __NR_fchownat 54
59#define __NR_fchown 55
60#define __NR_openat 56
61#define __NR_close 57
62#define __NR_vhangup 58
63#define __NR_pipe2 59
64#define __NR_quotactl 60
65#define __NR_getdents64 61
66#define __NR_lseek 62
67#define __NR_read 63
68#define __NR_write 64
69#define __NR_readv 65
70#define __NR_writev 66
71#define __NR_pread64 67
72#define __NR_pwrite64 68
73#define __NR_preadv 69
74#define __NR_pwritev 70
75#define __NR_sendfile 71
76#define __NR_pselect6 72
77#define __NR_ppoll 73
78#define __NR_signalfd4 74
79#define __NR_vmsplice 75
80#define __NR_splice 76
81#define __NR_tee 77
82#define __NR_readlinkat 78
83#define __NR_newfstatat 79
84#define __NR_fstat 80
85#define __NR_sync 81
86#define __NR_fsync 82
87#define __NR_fdatasync 83
88#define __NR_sync_file_range 84
89#define __NR_timerfd_create 85
90#define __NR_timerfd_settime 86
91#define __NR_timerfd_gettime 87
92#define __NR_utimensat 88
93#define __NR_acct 89
94#define __NR_capget 90
95#define __NR_capset 91
96#define __NR_personality 92
97#define __NR_exit 93
98#define __NR_exit_group 94
99#define __NR_waitid 95
100#define __NR_set_tid_address 96
101#define __NR_unshare 97
102#define __NR_futex 98
103#define __NR_set_robust_list 99
104#define __NR_get_robust_list 100
105#define __NR_nanosleep 101
106#define __NR_getitimer 102
107#define __NR_setitimer 103
108#define __NR_kexec_load 104
109#define __NR_init_module 105
110#define __NR_delete_module 106
111#define __NR_timer_create 107
112#define __NR_timer_gettime 108
113#define __NR_timer_getoverrun 109
114#define __NR_timer_settime 110
115#define __NR_timer_delete 111
116#define __NR_clock_settime 112
117#define __NR_clock_gettime 113
118#define __NR_clock_getres 114
119#define __NR_clock_nanosleep 115
120#define __NR_syslog 116
121#define __NR_ptrace 117
122#define __NR_sched_setparam 118
123#define __NR_sched_setscheduler 119
124#define __NR_sched_getscheduler 120
125#define __NR_sched_getparam 121
126#define __NR_sched_setaffinity 122
127#define __NR_sched_getaffinity 123
128#define __NR_sched_yield 124
129#define __NR_sched_get_priority_max 125
130#define __NR_sched_get_priority_min 126
131#define __NR_sched_rr_get_interval 127
132#define __NR_restart_syscall 128
133#define __NR_kill 129
134#define __NR_tkill 130
135#define __NR_tgkill 131
136#define __NR_sigaltstack 132
137#define __NR_rt_sigsuspend 133
138#define __NR_rt_sigaction 134
139#define __NR_rt_sigprocmask 135
140#define __NR_rt_sigpending 136
141#define __NR_rt_sigtimedwait 137
142#define __NR_rt_sigqueueinfo 138
143#define __NR_rt_sigreturn 139
144#define __NR_setpriority 140
145#define __NR_getpriority 141
146#define __NR_reboot 142
147#define __NR_setregid 143
148#define __NR_setgid 144
149#define __NR_setreuid 145
150#define __NR_setuid 146
151#define __NR_setresuid 147
152#define __NR_getresuid 148
153#define __NR_setresgid 149
154#define __NR_getresgid 150
155#define __NR_setfsuid 151
156#define __NR_setfsgid 152
157#define __NR_times 153
158#define __NR_setpgid 154
159#define __NR_getpgid 155
160#define __NR_getsid 156
161#define __NR_setsid 157
162#define __NR_getgroups 158
163#define __NR_setgroups 159
164#define __NR_uname 160
165#define __NR_sethostname 161
166#define __NR_setdomainname 162
167#define __NR_getrlimit 163
168#define __NR_setrlimit 164
169#define __NR_getrusage 165
170#define __NR_umask 166
171#define __NR_prctl 167
172#define __NR_getcpu 168
173#define __NR_gettimeofday 169
174#define __NR_settimeofday 170
175#define __NR_adjtimex 171
176#define __NR_getpid 172
177#define __NR_getppid 173
178#define __NR_getuid 174
179#define __NR_geteuid 175
180#define __NR_getgid 176
181#define __NR_getegid 177
182#define __NR_gettid 178
183#define __NR_sysinfo 179
184#define __NR_mq_open 180
185#define __NR_mq_unlink 181
186#define __NR_mq_timedsend 182
187#define __NR_mq_timedreceive 183
188#define __NR_mq_notify 184
189#define __NR_mq_getsetattr 185
190#define __NR_msgget 186
191#define __NR_msgctl 187
192#define __NR_msgrcv 188
193#define __NR_msgsnd 189
194#define __NR_semget 190
195#define __NR_semctl 191
196#define __NR_semtimedop 192
197#define __NR_semop 193
198#define __NR_shmget 194
199#define __NR_shmctl 195
200#define __NR_shmat 196
201#define __NR_shmdt 197
202#define __NR_socket 198
203#define __NR_socketpair 199
204#define __NR_bind 200
205#define __NR_listen 201
206#define __NR_accept 202
207#define __NR_connect 203
208#define __NR_getsockname 204
209#define __NR_getpeername 205
210#define __NR_sendto 206
211#define __NR_recvfrom 207
212#define __NR_setsockopt 208
213#define __NR_getsockopt 209
214#define __NR_shutdown 210
215#define __NR_sendmsg 211
216#define __NR_recvmsg 212
217#define __NR_readahead 213
218#define __NR_brk 214
219#define __NR_munmap 215
220#define __NR_mremap 216
221#define __NR_add_key 217
222#define __NR_request_key 218
223#define __NR_keyctl 219
224#define __NR_clone 220
225#define __NR_execve 221
226#define __NR_mmap 222
227#define __NR_fadvise64 223
228#define __NR_swapon 224
229#define __NR_swapoff 225
230#define __NR_mprotect 226
231#define __NR_msync 227
232#define __NR_mlock 228
233#define __NR_munlock 229
234#define __NR_mlockall 230
235#define __NR_munlockall 231
236#define __NR_mincore 232
237#define __NR_madvise 233
238#define __NR_remap_file_pages 234
239#define __NR_mbind 235
240#define __NR_get_mempolicy 236
241#define __NR_set_mempolicy 237
242#define __NR_migrate_pages 238
243#define __NR_move_pages 239
244#define __NR_rt_tgsigqueueinfo 240
245#define __NR_perf_event_open 241
246#define __NR_accept4 242
247#define __NR_recvmmsg 243
248#define __NR_wait4 260
249#define __NR_prlimit64 261
250#define __NR_fanotify_init 262
251#define __NR_fanotify_mark 263
252#define __NR_name_to_handle_at 264
253#define __NR_open_by_handle_at 265
254#define __NR_clock_adjtime 266
255#define __NR_syncfs 267
256#define __NR_setns 268
257#define __NR_sendmmsg 269
258#define __NR_process_vm_readv 270
259#define __NR_process_vm_writev 271
260#define __NR_kcmp 272
261#define __NR_finit_module 273
262#define __NR_sched_setattr 274
263#define __NR_sched_getattr 275
264#define __NR_renameat2 276
265#define __NR_seccomp 277
266#define __NR_getrandom 278
267#define __NR_memfd_create 279
268#define __NR_bpf 280
269#define __NR_execveat 281
270#define __NR_userfaultfd 282
271#define __NR_membarrier 283
272#define __NR_mlock2 284
273#define __NR_copy_file_range 285
274#define __NR_preadv2 286
275#define __NR_pwritev2 287
276#define __NR_pkey_mprotect 288
277#define __NR_pkey_alloc 289
278#define __NR_pkey_free 290
279#define __NR_statx 291
280#define __NR_io_pgetevents 292
281#define __NR_rseq 293
282#define __NR_kexec_file_load 294
283#define __NR_pidfd_send_signal 424
284#define __NR_io_uring_setup 425
285#define __NR_io_uring_enter 426
286#define __NR_io_uring_register 427
287#define __NR_open_tree 428
288#define __NR_move_mount 429
289#define __NR_fsopen 430
290#define __NR_fsconfig 431
291#define __NR_fsmount 432
292#define __NR_fspick 433
293#define __NR_pidfd_open 434
294#define __NR_clone3 435
295#define __NR_close_range 436
296#define __NR_openat2 437
297#define __NR_pidfd_getfd 438
298#define __NR_faccessat2 439
299#define __NR_process_madvise 440
300#define __NR_epoll_pwait2 441
301#define __NR_mount_setattr 442
302#define __NR_quotactl_fd 443
303#define __NR_landlock_create_ruleset 444
304#define __NR_landlock_add_rule 445
305#define __NR_landlock_restrict_self 446
306#define __NR_memfd_secret 447
307#define __NR_process_mrelease 448
308#define __NR_futex_waitv 449
309#define __NR_set_mempolicy_home_node 450
310#define __NR_cachestat 451
311#define __NR_fchmodat2 452
312#define __NR_map_shadow_stack 453
313#define __NR_futex_wake 454
314#define __NR_futex_wait 455
315#define __NR_futex_requeue 456
316#define __NR_statmount 457
317#define __NR_listmount 458
318#define __NR_lsm_get_self_attr 459
319#define __NR_lsm_set_self_attr 460
320#define __NR_lsm_list_modules 461
321#define __NR_mseal 462
322#define __NR_setxattrat 463
323#define __NR_getxattrat 464
324#define __NR_listxattrat 465
325#define __NR_removexattrat 466
326
327
328#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/ioctl.h+7-7
...@@ -80,13 +80,13 @@...@@ -80,13 +80,13 @@
80 * NOTE: _IOW means userland is writing and kernel is reading. _IOR80 * NOTE: _IOW means userland is writing and kernel is reading. _IOR
81 * means userland is reading and kernel is writing.81 * means userland is reading and kernel is writing.
82 */82 */
83#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)83#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
84#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))84#define _IOR(type,nr,argtype) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(argtype)))
85#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))85#define _IOW(type,nr,argtype) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(argtype)))
86#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))86#define _IOWR(type,nr,argtype) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(argtype)))
87#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))87#define _IOR_BAD(type,nr,argtype) _IOC(_IOC_READ,(type),(nr),sizeof(argtype))
88#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))88#define _IOW_BAD(type,nr,argtype) _IOC(_IOC_WRITE,(type),(nr),sizeof(argtype))
89#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))89#define _IOWR_BAD(type,nr,argtype) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(argtype))
9090
91/* used to decode ioctl numbers.. */91/* used to decode ioctl numbers.. */
92#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)92#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
lib/libc/include/any-linux-any/asm-generic/mman-common.h+3
...@@ -79,6 +79,9 @@...@@ -79,6 +79,9 @@
7979
80#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */80#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
8181
82#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */
83#define MADV_GUARD_REMOVE 103 /* unguard range */
84
82/* compatibility flags */85/* compatibility flags */
83#define MAP_FILE 086#define MAP_FILE 0
8487
lib/libc/include/any-linux-any/asm-generic/mman.h+4
...@@ -19,4 +19,8 @@...@@ -19,4 +19,8 @@
19#define MCL_FUTURE 2 /* lock all future mappings */19#define MCL_FUTURE 2 /* lock all future mappings */
20#define MCL_ONFAULT 4 /* lock all pages that are faulted in */20#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
2121
22#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */
23#define SHADOW_STACK_SET_MARKER (1ULL << 1) /* Set up a top of stack marker in the shadow stack */
24
25
22#endif /* __ASM_GENERIC_MMAN_H */26#endif /* __ASM_GENERIC_MMAN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/siginfo.h+1-1
...@@ -46,7 +46,7 @@ union __sifields {...@@ -46,7 +46,7 @@ union __sifields {
46 __kernel_timer_t _tid; /* timer id */46 __kernel_timer_t _tid; /* timer id */
47 int _overrun; /* overrun count */47 int _overrun; /* overrun count */
48 sigval_t _sigval; /* same as below */48 sigval_t _sigval; /* same as below */
49 int _sys_private; /* not to be passed to user */49 int _sys_private; /* Not used by the kernel. Historic leftover. Always 0. */
50 } _timer;50 } _timer;
5151
52 /* POSIX.1b signals */52 /* POSIX.1b signals */
lib/libc/include/any-linux-any/asm-generic/socket.h+8
...@@ -135,6 +135,14 @@...@@ -135,6 +135,14 @@
135#define SO_PASSPIDFD 76135#define SO_PASSPIDFD 76
136#define SO_PEERPIDFD 77136#define SO_PEERPIDFD 77
137137
138#define SO_DEVMEM_LINEAR 78
139#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
140#define SO_DEVMEM_DMABUF 79
141#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
142#define SO_DEVMEM_DONTNEED 80
143
144#define SCM_TS_OPT_ID 81
145
138146
139#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))147#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
140/* on 64-bit and x32, avoid the ?: operator */148/* on 64-bit and x32, avoid the ?: operator */
lib/libc/include/any-linux-any/asm-generic/unistd.h+10-5
...@@ -776,12 +776,8 @@ __SYSCALL(__NR_fsmount, sys_fsmount)...@@ -776,12 +776,8 @@ __SYSCALL(__NR_fsmount, sys_fsmount)
776__SYSCALL(__NR_fspick, sys_fspick)776__SYSCALL(__NR_fspick, sys_fspick)
777#define __NR_pidfd_open 434777#define __NR_pidfd_open 434
778__SYSCALL(__NR_pidfd_open, sys_pidfd_open)778__SYSCALL(__NR_pidfd_open, sys_pidfd_open)
779
780#ifdef __ARCH_WANT_SYS_CLONE3
781#define __NR_clone3 435779#define __NR_clone3 435
782__SYSCALL(__NR_clone3, sys_clone3)780__SYSCALL(__NR_clone3, sys_clone3)
783#endif
784
785#define __NR_close_range 436781#define __NR_close_range 436
786__SYSCALL(__NR_close_range, sys_close_range)782__SYSCALL(__NR_close_range, sys_close_range)
787#define __NR_openat2 437783#define __NR_openat2 437
...@@ -845,8 +841,17 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)...@@ -845,8 +841,17 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
845#define __NR_mseal 462841#define __NR_mseal 462
846__SYSCALL(__NR_mseal, sys_mseal)842__SYSCALL(__NR_mseal, sys_mseal)
847843
844#define __NR_setxattrat 463
845__SYSCALL(__NR_setxattrat, sys_setxattrat)
846#define __NR_getxattrat 464
847__SYSCALL(__NR_getxattrat, sys_getxattrat)
848#define __NR_listxattrat 465
849__SYSCALL(__NR_listxattrat, sys_listxattrat)
850#define __NR_removexattrat 466
851__SYSCALL(__NR_removexattrat, sys_removexattrat)
852
848#undef __NR_syscalls853#undef __NR_syscalls
849#define __NR_syscalls 463854#define __NR_syscalls 467
850855
851/*856/*
852 * 32 bit systems traditionally used different857 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+31-1
...@@ -171,6 +171,8 @@ extern "C" {...@@ -171,6 +171,8 @@ extern "C" {
171 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.171 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
172 */172 */
173#define AMDGPU_GEM_CREATE_EXT_COHERENT (1 << 15)173#define AMDGPU_GEM_CREATE_EXT_COHERENT (1 << 15)
174/* Set PTE.D and recompress during GTT->VRAM moves according to TILING flags. */
175#define AMDGPU_GEM_CREATE_GFX12_DCC (1 << 16)
174176
175struct drm_amdgpu_gem_create_in {177struct drm_amdgpu_gem_create_in {
176 /** the requested memory size */178 /** the requested memory size */
...@@ -392,7 +394,7 @@ struct drm_amdgpu_gem_userptr {...@@ -392,7 +394,7 @@ struct drm_amdgpu_gem_userptr {
392#define AMDGPU_TILING_NUM_BANKS_SHIFT 21394#define AMDGPU_TILING_NUM_BANKS_SHIFT 21
393#define AMDGPU_TILING_NUM_BANKS_MASK 0x3395#define AMDGPU_TILING_NUM_BANKS_MASK 0x3
394396
395/* GFX9 and later: */397/* GFX9 - GFX11: */
396#define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0398#define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0
397#define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f399#define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f
398#define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5400#define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5
...@@ -406,6 +408,24 @@ struct drm_amdgpu_gem_userptr {...@@ -406,6 +408,24 @@ struct drm_amdgpu_gem_userptr {
406#define AMDGPU_TILING_SCANOUT_SHIFT 63408#define AMDGPU_TILING_SCANOUT_SHIFT 63
407#define AMDGPU_TILING_SCANOUT_MASK 0x1409#define AMDGPU_TILING_SCANOUT_MASK 0x1
408410
411/* GFX12 and later: */
412#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_SHIFT 0
413#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_MASK 0x7
414/* These are DCC recompression settings for memory management: */
415#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_SHIFT 3
416#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 /* 0:64B, 1:128B, 2:256B */
417#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_SHIFT 5
418#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_MASK 0x7 /* CB_COLOR0_INFO.NUMBER_TYPE */
419#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_SHIFT 8
420#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_MASK 0x3f /* [0:4]:CB_COLOR0_INFO.FORMAT, [5]:MM */
421/* When clearing the buffer or moving it from VRAM to GTT, don't compress and set DCC metadata
422 * to uncompressed. Set when parts of an allocation bypass DCC and read raw data. */
423#define AMDGPU_TILING_GFX12_DCC_WRITE_COMPRESS_DISABLE_SHIFT 14
424#define AMDGPU_TILING_GFX12_DCC_WRITE_COMPRESS_DISABLE_MASK 0x1
425/* bit gap */
426#define AMDGPU_TILING_GFX12_SCANOUT_SHIFT 63
427#define AMDGPU_TILING_GFX12_SCANOUT_MASK 0x1
428
409/* Set/Get helpers for tiling flags. */429/* Set/Get helpers for tiling flags. */
410#define AMDGPU_TILING_SET(field, value) \430#define AMDGPU_TILING_SET(field, value) \
411 (((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT)431 (((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT)
...@@ -1268,6 +1288,16 @@ struct drm_amdgpu_info_gpuvm_fault {...@@ -1268,6 +1288,16 @@ struct drm_amdgpu_info_gpuvm_fault {
1268#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */1288#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */
1269#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */1289#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */
1270#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */1290#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
1291#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
1292
1293/* FIXME wrong namespace! */
1294struct drm_color_ctm_3x4 {
1295 /*
1296 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
1297 * (not two's complement!) format.
1298 */
1299 __u64 matrix[12];
1300};
12711301
1272#if defined(__cplusplus)1302#if defined(__cplusplus)
1273}1303}
lib/libc/include/any-linux-any/drm/drm.h+17
...@@ -1018,6 +1018,13 @@ struct drm_crtc_queue_sequence {...@@ -1018,6 +1018,13 @@ struct drm_crtc_queue_sequence {
1018 __u64 user_data; /* user data passed to event */1018 __u64 user_data; /* user data passed to event */
1019};1019};
10201020
1021#define DRM_CLIENT_NAME_MAX_LEN 64
1022struct drm_set_client_name {
1023 __u64 name_len;
1024 __u64 name;
1025};
1026
1027
1021#if defined(__cplusplus)1028#if defined(__cplusplus)
1022}1029}
1023#endif1030#endif
...@@ -1282,6 +1289,16 @@ extern "C" {...@@ -1282,6 +1289,16 @@ extern "C" {
1282 */1289 */
1283#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)1290#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)
12841291
1292/**
1293 * DRM_IOCTL_SET_CLIENT_NAME - Attach a name to a drm_file
1294 *
1295 * Having a name allows for easier tracking and debugging.
1296 * The length of the name (without null ending char) must be
1297 * <= DRM_CLIENT_NAME_MAX_LEN.
1298 * The call will fail if the name contains whitespaces or non-printable chars.
1299 */
1300#define DRM_IOCTL_SET_CLIENT_NAME DRM_IOWR(0xD1, struct drm_set_client_name)
1301
1285/*1302/*
1286 * Device specific ioctls should only be in their respective headers1303 * Device specific ioctls should only be in their respective headers
1287 * The device specific ioctl range is from 0x40 to 0x9f.1304 * The device specific ioctl range is from 0x40 to 0x9f.
lib/libc/include/any-linux-any/drm/drm_fourcc.h+44
...@@ -702,6 +702,31 @@ extern "C" {...@@ -702,6 +702,31 @@ extern "C" {
702 */702 */
703#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)703#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
704704
705/*
706 * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression
707 * on integrated graphics
708 *
709 * The main surface is Tile 4 and at plane index 0. For semi-planar formats
710 * like NV12, the Y and UV planes are Tile 4 and are located at plane indices
711 * 0 and 1, respectively. The CCS for all planes are stored outside of the
712 * GEM object in a reserved memory area dedicated for the storage of the
713 * CCS data for all compressible GEM objects.
714 */
715#define I915_FORMAT_MOD_4_TILED_LNL_CCS fourcc_mod_code(INTEL, 16)
716
717/*
718 * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression
719 * on discrete graphics
720 *
721 * The main surface is Tile 4 and at plane index 0. For semi-planar formats
722 * like NV12, the Y and UV planes are Tile 4 and are located at plane indices
723 * 0 and 1, respectively. The CCS for all planes are stored outside of the
724 * GEM object in a reserved memory area dedicated for the storage of the
725 * CCS data for all compressible GEM objects. The GEM object must be stored in
726 * contiguous memory with a size aligned to 64KB
727 */
728#define I915_FORMAT_MOD_4_TILED_BMG_CCS fourcc_mod_code(INTEL, 17)
729
705/*730/*
706 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks731 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
707 *732 *
...@@ -1476,6 +1501,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)...@@ -1476,6 +1501,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
1476#define AMD_FMT_MOD_TILE_VER_GFX10 21501#define AMD_FMT_MOD_TILE_VER_GFX10 2
1477#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 31502#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
1478#define AMD_FMT_MOD_TILE_VER_GFX11 41503#define AMD_FMT_MOD_TILE_VER_GFX11 4
1504#define AMD_FMT_MOD_TILE_VER_GFX12 5
14791505
1480/*1506/*
1481 * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical1507 * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
...@@ -1486,13 +1512,31 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)...@@ -1486,13 +1512,31 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
1486/*1512/*
1487 * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has1513 * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has
1488 * GFX9 as canonical version.1514 * GFX9 as canonical version.
1515 *
1516 * 64K_D_2D on GFX12 is identical to 64K_D on GFX11.
1489 */1517 */
1490#define AMD_FMT_MOD_TILE_GFX9_64K_D 101518#define AMD_FMT_MOD_TILE_GFX9_64K_D 10
1519#define AMD_FMT_MOD_TILE_GFX9_4K_D_X 22
1491#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 251520#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
1492#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 261521#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
1493#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 271522#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
1494#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 311523#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31
14951524
1525/* Gfx12 swizzle modes:
1526 * 0 - LINEAR
1527 * 1 - 256B_2D - 2D block dimensions
1528 * 2 - 4KB_2D
1529 * 3 - 64KB_2D
1530 * 4 - 256KB_2D
1531 * 5 - 4KB_3D - 3D block dimensions
1532 * 6 - 64KB_3D
1533 * 7 - 256KB_3D
1534 */
1535#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1
1536#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2
1537#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3
1538#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4
1539
1496#define AMD_FMT_MOD_DCC_BLOCK_64B 01540#define AMD_FMT_MOD_DCC_BLOCK_64B 0
1497#define AMD_FMT_MOD_DCC_BLOCK_128B 11541#define AMD_FMT_MOD_DCC_BLOCK_128B 1
1498#define AMD_FMT_MOD_DCC_BLOCK_256B 21542#define AMD_FMT_MOD_DCC_BLOCK_256B 2
lib/libc/include/any-linux-any/drm/drm_mode.h+2-8
...@@ -846,14 +846,6 @@ struct drm_color_ctm {...@@ -846,14 +846,6 @@ struct drm_color_ctm {
846 __u64 matrix[9];846 __u64 matrix[9];
847};847};
848848
849struct drm_color_ctm_3x4 {
850 /*
851 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
852 * (not two's complement!) format.
853 */
854 __u64 matrix[12];
855};
856
857struct drm_color_lut {849struct drm_color_lut {
858 /*850 /*
859 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and851 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
...@@ -867,6 +859,8 @@ struct drm_color_lut {...@@ -867,6 +859,8 @@ struct drm_color_lut {
867859
868/**860/**
869 * struct drm_plane_size_hint - Plane size hints861 * struct drm_plane_size_hint - Plane size hints
862 * @width: The width of the plane in pixel
863 * @height: The height of the plane in pixel
870 *864 *
871 * The plane SIZE_HINTS property blob contains an865 * The plane SIZE_HINTS property blob contains an
872 * array of struct drm_plane_size_hint.866 * array of struct drm_plane_size_hint.
lib/libc/include/any-linux-any/drm/i915_drm.h+27
...@@ -2163,6 +2163,15 @@ struct drm_i915_gem_context_param {...@@ -2163,6 +2163,15 @@ struct drm_i915_gem_context_param {
2163 * supports this per context flag.2163 * supports this per context flag.
2164 */2164 */
2165#define I915_CONTEXT_PARAM_LOW_LATENCY 0xe2165#define I915_CONTEXT_PARAM_LOW_LATENCY 0xe
2166
2167/*
2168 * I915_CONTEXT_PARAM_CONTEXT_IMAGE:
2169 *
2170 * Allows userspace to provide own context images.
2171 *
2172 * Note that this is a debug API not available on production kernel builds.
2173 */
2174#define I915_CONTEXT_PARAM_CONTEXT_IMAGE 0xf
2166/* Must be kept compact -- no holes and well documented */2175/* Must be kept compact -- no holes and well documented */
21672176
2168 /** @value: Context parameter value to be set or queried */2177 /** @value: Context parameter value to be set or queried */
...@@ -2564,6 +2573,24 @@ struct i915_context_param_engines {...@@ -2564,6 +2573,24 @@ struct i915_context_param_engines {
2564 struct i915_engine_class_instance engines[N__]; \2573 struct i915_engine_class_instance engines[N__]; \
2565} __attribute__((packed)) name__2574} __attribute__((packed)) name__
25662575
2576struct i915_gem_context_param_context_image {
2577 /** @engine: Engine class & instance to be configured. */
2578 struct i915_engine_class_instance engine;
2579
2580 /** @flags: One of the supported flags or zero. */
2581 __u32 flags;
2582#define I915_CONTEXT_IMAGE_FLAG_ENGINE_INDEX (1u << 0)
2583
2584 /** @size: Size of the image blob pointed to by @image. */
2585 __u32 size;
2586
2587 /** @mbz: Must be zero. */
2588 __u32 mbz;
2589
2590 /** @image: Userspace memory containing the context image. */
2591 __u64 image;
2592} __attribute__((packed));
2593
2567/**2594/**
2568 * struct drm_i915_gem_context_create_ext_setparam - Context parameter2595 * struct drm_i915_gem_context_create_ext_setparam - Context parameter
2569 * to set or query during context creation.2596 * to set or query during context creation.
lib/libc/include/any-linux-any/drm/ivpu_accel.h+69-9
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*2/*
3 * Copyright (C) 2020-2023 Intel Corporation3 * Copyright (C) 2020-2024 Intel Corporation
4 */4 */
55
6#ifndef __UAPI_IVPU_DRM_H__6#ifndef __UAPI_IVPU_DRM_H__
...@@ -12,15 +12,16 @@...@@ -12,15 +12,16 @@
12extern "C" {12extern "C" {
13#endif13#endif
1414
15#define DRM_IVPU_DRIVER_MAJOR 1
16#define DRM_IVPU_DRIVER_MINOR 0
17
18#define DRM_IVPU_GET_PARAM 0x0015#define DRM_IVPU_GET_PARAM 0x00
19#define DRM_IVPU_SET_PARAM 0x0116#define DRM_IVPU_SET_PARAM 0x01
20#define DRM_IVPU_BO_CREATE 0x0217#define DRM_IVPU_BO_CREATE 0x02
21#define DRM_IVPU_BO_INFO 0x0318#define DRM_IVPU_BO_INFO 0x03
22#define DRM_IVPU_SUBMIT 0x0519#define DRM_IVPU_SUBMIT 0x05
23#define DRM_IVPU_BO_WAIT 0x0620#define DRM_IVPU_BO_WAIT 0x06
21#define DRM_IVPU_METRIC_STREAMER_START 0x07
22#define DRM_IVPU_METRIC_STREAMER_STOP 0x08
23#define DRM_IVPU_METRIC_STREAMER_GET_DATA 0x09
24#define DRM_IVPU_METRIC_STREAMER_GET_INFO 0x0a
2425
25#define DRM_IOCTL_IVPU_GET_PARAM \26#define DRM_IOCTL_IVPU_GET_PARAM \
26 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)27 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
...@@ -40,6 +41,22 @@ extern "C" {...@@ -40,6 +41,22 @@ extern "C" {
40#define DRM_IOCTL_IVPU_BO_WAIT \41#define DRM_IOCTL_IVPU_BO_WAIT \
41 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)42 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)
4243
44#define DRM_IOCTL_IVPU_METRIC_STREAMER_START \
45 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_METRIC_STREAMER_START, \
46 struct drm_ivpu_metric_streamer_start)
47
48#define DRM_IOCTL_IVPU_METRIC_STREAMER_STOP \
49 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_METRIC_STREAMER_STOP, \
50 struct drm_ivpu_metric_streamer_stop)
51
52#define DRM_IOCTL_IVPU_METRIC_STREAMER_GET_DATA \
53 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_METRIC_STREAMER_GET_DATA, \
54 struct drm_ivpu_metric_streamer_get_data)
55
56#define DRM_IOCTL_IVPU_METRIC_STREAMER_GET_INFO \
57 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_METRIC_STREAMER_GET_INFO, \
58 struct drm_ivpu_metric_streamer_get_data)
59
43/**60/**
44 * DOC: contexts61 * DOC: contexts
45 *62 *
...@@ -241,7 +258,7 @@ struct drm_ivpu_bo_info {...@@ -241,7 +258,7 @@ struct drm_ivpu_bo_info {
241258
242/* drm_ivpu_submit engines */259/* drm_ivpu_submit engines */
243#define DRM_IVPU_ENGINE_COMPUTE 0260#define DRM_IVPU_ENGINE_COMPUTE 0
244#define DRM_IVPU_ENGINE_COPY 1261#define DRM_IVPU_ENGINE_COPY 1 /* Deprecated */
245262
246/**263/**
247 * struct drm_ivpu_submit - Submit commands to the VPU264 * struct drm_ivpu_submit - Submit commands to the VPU
...@@ -272,10 +289,6 @@ struct drm_ivpu_submit {...@@ -272,10 +289,6 @@ struct drm_ivpu_submit {
272 * %DRM_IVPU_ENGINE_COMPUTE:289 * %DRM_IVPU_ENGINE_COMPUTE:
273 *290 *
274 * Performs Deep Learning Neural Compute Inference Operations291 * Performs Deep Learning Neural Compute Inference Operations
275 *
276 * %DRM_IVPU_ENGINE_COPY:
277 *
278 * Performs memory copy operations to/from system memory allocated for VPU
279 */292 */
280 __u32 engine;293 __u32 engine;
281294
...@@ -336,6 +349,53 @@ struct drm_ivpu_bo_wait {...@@ -336,6 +349,53 @@ struct drm_ivpu_bo_wait {
336 __u32 pad;349 __u32 pad;
337};350};
338351
352/**
353 * struct drm_ivpu_metric_streamer_start - Start collecting metric data
354 */
355struct drm_ivpu_metric_streamer_start {
356 /** @metric_group_mask: Indicates metric streamer instance */
357 __u64 metric_group_mask;
358 /** @sampling_period_ns: Sampling period in nanoseconds */
359 __u64 sampling_period_ns;
360 /**
361 * @read_period_samples:
362 *
363 * Number of samples after which user space will try to read the data.
364 * Reading the data after significantly longer period may cause data loss.
365 */
366 __u32 read_period_samples;
367 /** @sample_size: Returned size of a single sample in bytes */
368 __u32 sample_size;
369 /** @max_data_size: Returned max @data_size from %DRM_IOCTL_IVPU_METRIC_STREAMER_GET_DATA */
370 __u32 max_data_size;
371};
372
373/**
374 * struct drm_ivpu_metric_streamer_get_data - Copy collected metric data
375 */
376struct drm_ivpu_metric_streamer_get_data {
377 /** @metric_group_mask: Indicates metric streamer instance */
378 __u64 metric_group_mask;
379 /** @buffer_ptr: A pointer to a destination for the copied data */
380 __u64 buffer_ptr;
381 /** @buffer_size: Size of the destination buffer */
382 __u64 buffer_size;
383 /**
384 * @data_size: Returned size of copied metric data
385 *
386 * If the @buffer_size is zero, returns the amount of data ready to be copied.
387 */
388 __u64 data_size;
389};
390
391/**
392 * struct drm_ivpu_metric_streamer_stop - Stop collecting metric data
393 */
394struct drm_ivpu_metric_streamer_stop {
395 /** @metric_group_mask: Indicates metric streamer instance */
396 __u64 metric_group_mask;
397};
398
339#if defined(__cplusplus)399#if defined(__cplusplus)
340}400}
341#endif401#endif
lib/libc/include/any-linux-any/drm/msm_drm.h+7-1
...@@ -87,6 +87,9 @@ struct drm_msm_timespec {...@@ -87,6 +87,9 @@ struct drm_msm_timespec {
87#define MSM_PARAM_VA_START 0x0e /* RO: start of valid GPU iova range */87#define MSM_PARAM_VA_START 0x0e /* RO: start of valid GPU iova range */
88#define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */88#define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */
89#define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */89#define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */
90#define MSM_PARAM_RAYTRACING 0x11 /* RO */
91#define MSM_PARAM_UBWC_SWIZZLE 0x12 /* RO */
92#define MSM_PARAM_MACROTILE_MODE 0x13 /* RO */
9093
91/* For backwards compat. The original support for preemption was based on94/* For backwards compat. The original support for preemption was based on
92 * a single ring per priority level so # of priority levels equals the #95 * a single ring per priority level so # of priority levels equals the #
...@@ -344,7 +347,10 @@ struct drm_msm_gem_madvise {...@@ -344,7 +347,10 @@ struct drm_msm_gem_madvise {
344 * backwards compatibility as a "default" submitqueue347 * backwards compatibility as a "default" submitqueue
345 */348 */
346349
347#define MSM_SUBMITQUEUE_FLAGS (0)350#define MSM_SUBMITQUEUE_ALLOW_PREEMPT 0x00000001
351#define MSM_SUBMITQUEUE_FLAGS ( \
352 MSM_SUBMITQUEUE_ALLOW_PREEMPT | \
353 0)
348354
349/*355/*
350 * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,356 * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,
lib/libc/include/any-linux-any/drm/panfrost_drm.h+3
...@@ -40,6 +40,7 @@ extern "C" {...@@ -40,6 +40,7 @@ extern "C" {
40#define DRM_IOCTL_PANFROST_PERFCNT_DUMP DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_DUMP, struct drm_panfrost_perfcnt_dump)40#define DRM_IOCTL_PANFROST_PERFCNT_DUMP DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_DUMP, struct drm_panfrost_perfcnt_dump)
4141
42#define PANFROST_JD_REQ_FS (1 << 0)42#define PANFROST_JD_REQ_FS (1 << 0)
43#define PANFROST_JD_REQ_CYCLE_COUNT (1 << 1)
43/**44/**
44 * struct drm_panfrost_submit - ioctl argument for submitting commands to the 3D45 * struct drm_panfrost_submit - ioctl argument for submitting commands to the 3D
45 * engine.46 * engine.
...@@ -172,6 +173,8 @@ enum drm_panfrost_param {...@@ -172,6 +173,8 @@ enum drm_panfrost_param {
172 DRM_PANFROST_PARAM_NR_CORE_GROUPS,173 DRM_PANFROST_PARAM_NR_CORE_GROUPS,
173 DRM_PANFROST_PARAM_THREAD_TLS_ALLOC,174 DRM_PANFROST_PARAM_THREAD_TLS_ALLOC,
174 DRM_PANFROST_PARAM_AFBC_FEATURES,175 DRM_PANFROST_PARAM_AFBC_FEATURES,
176 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,
177 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,
175};178};
176179
177struct drm_panfrost_get_param {180struct drm_panfrost_get_param {
lib/libc/include/any-linux-any/drm/panthor_drm.h+56-1
...@@ -260,6 +260,14 @@ enum drm_panthor_dev_query_type {...@@ -260,6 +260,14 @@ enum drm_panthor_dev_query_type {
260260
261 /** @DRM_PANTHOR_DEV_QUERY_CSIF_INFO: Query command-stream interface information. */261 /** @DRM_PANTHOR_DEV_QUERY_CSIF_INFO: Query command-stream interface information. */
262 DRM_PANTHOR_DEV_QUERY_CSIF_INFO,262 DRM_PANTHOR_DEV_QUERY_CSIF_INFO,
263
264 /** @DRM_PANTHOR_DEV_QUERY_TIMESTAMP_INFO: Query timestamp information. */
265 DRM_PANTHOR_DEV_QUERY_TIMESTAMP_INFO,
266
267 /**
268 * @DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO: Query allowed group priorities information.
269 */
270 DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO,
263};271};
264272
265/**273/**
...@@ -377,6 +385,42 @@ struct drm_panthor_csif_info {...@@ -377,6 +385,42 @@ struct drm_panthor_csif_info {
377 __u32 pad;385 __u32 pad;
378};386};
379387
388/**
389 * struct drm_panthor_timestamp_info - Timestamp information
390 *
391 * Structure grouping all queryable information relating to the GPU timestamp.
392 */
393struct drm_panthor_timestamp_info {
394 /**
395 * @timestamp_frequency: The frequency of the timestamp timer or 0 if
396 * unknown.
397 */
398 __u64 timestamp_frequency;
399
400 /** @current_timestamp: The current timestamp. */
401 __u64 current_timestamp;
402
403 /** @timestamp_offset: The offset of the timestamp timer. */
404 __u64 timestamp_offset;
405};
406
407/**
408 * struct drm_panthor_group_priorities_info - Group priorities information
409 *
410 * Structure grouping all queryable information relating to the allowed group priorities.
411 */
412struct drm_panthor_group_priorities_info {
413 /**
414 * @allowed_mask: Bitmask of the allowed group priorities.
415 *
416 * Each bit represents a variant of the enum drm_panthor_group_priority.
417 */
418 __u8 allowed_mask;
419
420 /** @pad: Padding fields, MBZ. */
421 __u8 pad[3];
422};
423
380/**424/**
381 * struct drm_panthor_dev_query - Arguments passed to DRM_PANTHOR_IOCTL_DEV_QUERY425 * struct drm_panthor_dev_query - Arguments passed to DRM_PANTHOR_IOCTL_DEV_QUERY
382 */426 */
...@@ -692,8 +736,19 @@ enum drm_panthor_group_priority {...@@ -692,8 +736,19 @@ enum drm_panthor_group_priority {
692 /** @PANTHOR_GROUP_PRIORITY_MEDIUM: Medium priority group. */736 /** @PANTHOR_GROUP_PRIORITY_MEDIUM: Medium priority group. */
693 PANTHOR_GROUP_PRIORITY_MEDIUM,737 PANTHOR_GROUP_PRIORITY_MEDIUM,
694738
695 /** @PANTHOR_GROUP_PRIORITY_HIGH: High priority group. */739 /**
740 * @PANTHOR_GROUP_PRIORITY_HIGH: High priority group.
741 *
742 * Requires CAP_SYS_NICE or DRM_MASTER.
743 */
696 PANTHOR_GROUP_PRIORITY_HIGH,744 PANTHOR_GROUP_PRIORITY_HIGH,
745
746 /**
747 * @PANTHOR_GROUP_PRIORITY_REALTIME: Realtime priority group.
748 *
749 * Requires CAP_SYS_NICE or DRM_MASTER.
750 */
751 PANTHOR_GROUP_PRIORITY_REALTIME,
697};752};
698753
699/**754/**
lib/libc/include/any-linux-any/drm/v3d_drm.h+49
...@@ -42,6 +42,7 @@ extern "C" {...@@ -42,6 +42,7 @@ extern "C" {
42#define DRM_V3D_PERFMON_DESTROY 0x0942#define DRM_V3D_PERFMON_DESTROY 0x09
43#define DRM_V3D_PERFMON_GET_VALUES 0x0a43#define DRM_V3D_PERFMON_GET_VALUES 0x0a
44#define DRM_V3D_SUBMIT_CPU 0x0b44#define DRM_V3D_SUBMIT_CPU 0x0b
45#define DRM_V3D_PERFMON_GET_COUNTER 0x0c
4546
46#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)47#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
47#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)48#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
...@@ -58,6 +59,8 @@ extern "C" {...@@ -58,6 +59,8 @@ extern "C" {
58#define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, \59#define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, \
59 struct drm_v3d_perfmon_get_values)60 struct drm_v3d_perfmon_get_values)
60#define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)61#define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)
62#define DRM_IOCTL_V3D_PERFMON_GET_COUNTER DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_COUNTER, \
63 struct drm_v3d_perfmon_get_counter)
6164
62#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x0165#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
63#define DRM_V3D_SUBMIT_EXTENSION 0x0266#define DRM_V3D_SUBMIT_EXTENSION 0x02
...@@ -286,6 +289,8 @@ enum drm_v3d_param {...@@ -286,6 +289,8 @@ enum drm_v3d_param {
286 DRM_V3D_PARAM_SUPPORTS_PERFMON,289 DRM_V3D_PARAM_SUPPORTS_PERFMON,
287 DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,290 DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
288 DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,291 DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
292 DRM_V3D_PARAM_MAX_PERF_COUNTERS,
293 DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES,
289};294};
290295
291struct drm_v3d_get_param {296struct drm_v3d_get_param {
...@@ -599,6 +604,16 @@ struct drm_v3d_submit_cpu {...@@ -599,6 +604,16 @@ struct drm_v3d_submit_cpu {
599 __u64 extensions;604 __u64 extensions;
600};605};
601606
607/* The performance counters index represented by this enum are deprecated and
608 * must no longer be used. These counters are only valid for V3D 4.2.
609 *
610 * In order to check for performance counter information,
611 * use DRM_IOCTL_V3D_PERFMON_GET_COUNTER.
612 *
613 * Don't use V3D_PERFCNT_NUM to retrieve the maximum number of performance
614 * counters. You should use DRM_IOCTL_V3D_GET_PARAM with the following
615 * parameter: DRM_V3D_PARAM_MAX_PERF_COUNTERS.
616 */
602enum {617enum {
603 V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS,618 V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS,
604 V3D_PERFCNT_FEP_VALID_PRIMS,619 V3D_PERFCNT_FEP_VALID_PRIMS,
...@@ -717,6 +732,40 @@ struct drm_v3d_perfmon_get_values {...@@ -717,6 +732,40 @@ struct drm_v3d_perfmon_get_values {
717 __u64 values_ptr;732 __u64 values_ptr;
718};733};
719734
735#define DRM_V3D_PERFCNT_MAX_NAME 64
736#define DRM_V3D_PERFCNT_MAX_CATEGORY 32
737#define DRM_V3D_PERFCNT_MAX_DESCRIPTION 256
738
739/**
740 * struct drm_v3d_perfmon_get_counter - ioctl to get the description of a
741 * performance counter
742 *
743 * As userspace needs to retrieve information about the performance counters
744 * available, this IOCTL allows users to get information about a performance
745 * counter (name, category and description).
746 */
747struct drm_v3d_perfmon_get_counter {
748 /*
749 * Counter ID
750 *
751 * Must be smaller than the maximum number of performance counters, which
752 * can be retrieve through DRM_V3D_PARAM_MAX_PERF_COUNTERS.
753 */
754 __u8 counter;
755
756 /* Name of the counter */
757 __u8 name[DRM_V3D_PERFCNT_MAX_NAME];
758
759 /* Category of the counter */
760 __u8 category[DRM_V3D_PERFCNT_MAX_CATEGORY];
761
762 /* Description of the counter */
763 __u8 description[DRM_V3D_PERFCNT_MAX_DESCRIPTION];
764
765 /* mbz */
766 __u8 reserved[7];
767};
768
720#if defined(__cplusplus)769#if defined(__cplusplus)
721}770}
722#endif771#endif
lib/libc/include/any-linux-any/drm/xe_drm.h+363-2
...@@ -80,6 +80,7 @@ extern "C" {...@@ -80,6 +80,7 @@ extern "C" {
80 * - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY80 * - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY
81 * - &DRM_IOCTL_XE_EXEC81 * - &DRM_IOCTL_XE_EXEC
82 * - &DRM_IOCTL_XE_WAIT_USER_FENCE82 * - &DRM_IOCTL_XE_WAIT_USER_FENCE
83 * - &DRM_IOCTL_XE_OBSERVATION
83 */84 */
8485
85/*86/*
...@@ -100,6 +101,8 @@ extern "C" {...@@ -100,6 +101,8 @@ extern "C" {
100#define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08101#define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08
101#define DRM_XE_EXEC 0x09102#define DRM_XE_EXEC 0x09
102#define DRM_XE_WAIT_USER_FENCE 0x0a103#define DRM_XE_WAIT_USER_FENCE 0x0a
104#define DRM_XE_OBSERVATION 0x0b
105
103/* Must be kept compact -- no holes */106/* Must be kept compact -- no holes */
104107
105#define DRM_IOCTL_XE_DEVICE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEVICE_QUERY, struct drm_xe_device_query)108#define DRM_IOCTL_XE_DEVICE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEVICE_QUERY, struct drm_xe_device_query)
...@@ -113,6 +116,7 @@ extern "C" {...@@ -113,6 +116,7 @@ extern "C" {
113#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)116#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)
114#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)117#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)
115#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)118#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
119#define DRM_IOCTL_XE_OBSERVATION DRM_IOW(DRM_COMMAND_BASE + DRM_XE_OBSERVATION, struct drm_xe_observation_param)
116120
117/**121/**
118 * DOC: Xe IOCTL Extensions122 * DOC: Xe IOCTL Extensions
...@@ -508,11 +512,21 @@ struct drm_xe_query_gt_list {...@@ -508,11 +512,21 @@ struct drm_xe_query_gt_list {
508 * containing the following in mask:512 * containing the following in mask:
509 * ``DSS_COMPUTE ff ff ff ff 00 00 00 00``513 * ``DSS_COMPUTE ff ff ff ff 00 00 00 00``
510 * means 32 DSS are available for compute.514 * means 32 DSS are available for compute.
515 * - %DRM_XE_TOPO_L3_BANK - To query the mask of enabled L3 banks. This type
516 * may be omitted if the driver is unable to query the mask from the
517 * hardware.
511 * - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)518 * - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)
512 * available per Dual Sub Slices (DSS). For example a query response519 * available per Dual Sub Slices (DSS). For example a query response
513 * containing the following in mask:520 * containing the following in mask:
514 * ``EU_PER_DSS ff ff 00 00 00 00 00 00``521 * ``EU_PER_DSS ff ff 00 00 00 00 00 00``
515 * means each DSS has 16 EU.522 * means each DSS has 16 SIMD8 EUs. This type may be omitted if device
523 * doesn't have SIMD8 EUs.
524 * - %DRM_XE_TOPO_SIMD16_EU_PER_DSS - To query the mask of SIMD16 Execution
525 * Units (EU) available per Dual Sub Slices (DSS). For example a query
526 * response containing the following in mask:
527 * ``SIMD16_EU_PER_DSS ff ff 00 00 00 00 00 00``
528 * means each DSS has 16 SIMD16 EUs. This type may be omitted if device
529 * doesn't have SIMD16 EUs.
516 */530 */
517struct drm_xe_query_topology_mask {531struct drm_xe_query_topology_mask {
518 /** @gt_id: GT ID the mask is associated with */532 /** @gt_id: GT ID the mask is associated with */
...@@ -520,7 +534,9 @@ struct drm_xe_query_topology_mask {...@@ -520,7 +534,9 @@ struct drm_xe_query_topology_mask {
520534
521#define DRM_XE_TOPO_DSS_GEOMETRY 1535#define DRM_XE_TOPO_DSS_GEOMETRY 1
522#define DRM_XE_TOPO_DSS_COMPUTE 2536#define DRM_XE_TOPO_DSS_COMPUTE 2
537#define DRM_XE_TOPO_L3_BANK 3
523#define DRM_XE_TOPO_EU_PER_DSS 4538#define DRM_XE_TOPO_EU_PER_DSS 4
539#define DRM_XE_TOPO_SIMD16_EU_PER_DSS 5
524 /** @type: type of mask */540 /** @type: type of mask */
525 __u16 type;541 __u16 type;
526542
...@@ -683,6 +699,7 @@ struct drm_xe_device_query {...@@ -683,6 +699,7 @@ struct drm_xe_device_query {
683#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5699#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5
684#define DRM_XE_DEVICE_QUERY_ENGINE_CYCLES 6700#define DRM_XE_DEVICE_QUERY_ENGINE_CYCLES 6
685#define DRM_XE_DEVICE_QUERY_UC_FW_VERSION 7701#define DRM_XE_DEVICE_QUERY_UC_FW_VERSION 7
702#define DRM_XE_DEVICE_QUERY_OA_UNITS 8
686 /** @query: The type of data to query */703 /** @query: The type of data to query */
687 __u32 query;704 __u32 query;
688705
...@@ -776,7 +793,13 @@ struct drm_xe_gem_create {...@@ -776,7 +793,13 @@ struct drm_xe_gem_create {
776#define DRM_XE_GEM_CPU_CACHING_WC 2793#define DRM_XE_GEM_CPU_CACHING_WC 2
777 /**794 /**
778 * @cpu_caching: The CPU caching mode to select for this object. If795 * @cpu_caching: The CPU caching mode to select for this object. If
779 * mmaping the object the mode selected here will also be used.796 * mmaping the object the mode selected here will also be used. The
797 * exception is when mapping system memory (including data evicted
798 * to system) on discrete GPUs. The caching mode selected will
799 * then be overridden to DRM_XE_GEM_CPU_CACHING_WB, and coherency
800 * between GPU- and CPU is guaranteed. The caching mode of
801 * existing CPU-mappings will be updated transparently to
802 * user-space clients.
780 */803 */
781 __u16 cpu_caching;804 __u16 cpu_caching;
782 /** @pad: MBZ */805 /** @pad: MBZ */
...@@ -1368,6 +1391,344 @@ struct drm_xe_wait_user_fence {...@@ -1368,6 +1391,344 @@ struct drm_xe_wait_user_fence {
1368 __u64 reserved[2];1391 __u64 reserved[2];
1369};1392};
13701393
1394/**
1395 * enum drm_xe_observation_type - Observation stream types
1396 */
1397enum drm_xe_observation_type {
1398 /** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
1399 DRM_XE_OBSERVATION_TYPE_OA,
1400};
1401
1402/**
1403 * enum drm_xe_observation_op - Observation stream ops
1404 */
1405enum drm_xe_observation_op {
1406 /** @DRM_XE_OBSERVATION_OP_STREAM_OPEN: Open an observation stream */
1407 DRM_XE_OBSERVATION_OP_STREAM_OPEN,
1408
1409 /** @DRM_XE_OBSERVATION_OP_ADD_CONFIG: Add observation stream config */
1410 DRM_XE_OBSERVATION_OP_ADD_CONFIG,
1411
1412 /** @DRM_XE_OBSERVATION_OP_REMOVE_CONFIG: Remove observation stream config */
1413 DRM_XE_OBSERVATION_OP_REMOVE_CONFIG,
1414};
1415
1416/**
1417 * struct drm_xe_observation_param - Input of &DRM_XE_OBSERVATION
1418 *
1419 * The observation layer enables multiplexing observation streams of
1420 * multiple types. The actual params for a particular stream operation are
1421 * supplied via the @param pointer (use __copy_from_user to get these
1422 * params).
1423 */
1424struct drm_xe_observation_param {
1425 /** @extensions: Pointer to the first extension struct, if any */
1426 __u64 extensions;
1427 /** @observation_type: observation stream type, of enum @drm_xe_observation_type */
1428 __u64 observation_type;
1429 /** @observation_op: observation stream op, of enum @drm_xe_observation_op */
1430 __u64 observation_op;
1431 /** @param: Pointer to actual stream params */
1432 __u64 param;
1433};
1434
1435/**
1436 * enum drm_xe_observation_ioctls - Observation stream fd ioctl's
1437 *
1438 * Information exchanged between userspace and kernel for observation fd
1439 * ioctl's is stream type specific
1440 */
1441enum drm_xe_observation_ioctls {
1442 /** @DRM_XE_OBSERVATION_IOCTL_ENABLE: Enable data capture for an observation stream */
1443 DRM_XE_OBSERVATION_IOCTL_ENABLE = _IO('i', 0x0),
1444
1445 /** @DRM_XE_OBSERVATION_IOCTL_DISABLE: Disable data capture for a observation stream */
1446 DRM_XE_OBSERVATION_IOCTL_DISABLE = _IO('i', 0x1),
1447
1448 /** @DRM_XE_OBSERVATION_IOCTL_CONFIG: Change observation stream configuration */
1449 DRM_XE_OBSERVATION_IOCTL_CONFIG = _IO('i', 0x2),
1450
1451 /** @DRM_XE_OBSERVATION_IOCTL_STATUS: Return observation stream status */
1452 DRM_XE_OBSERVATION_IOCTL_STATUS = _IO('i', 0x3),
1453
1454 /** @DRM_XE_OBSERVATION_IOCTL_INFO: Return observation stream info */
1455 DRM_XE_OBSERVATION_IOCTL_INFO = _IO('i', 0x4),
1456};
1457
1458/**
1459 * enum drm_xe_oa_unit_type - OA unit types
1460 */
1461enum drm_xe_oa_unit_type {
1462 /**
1463 * @DRM_XE_OA_UNIT_TYPE_OAG: OAG OA unit. OAR/OAC are considered
1464 * sub-types of OAG. For OAR/OAC, use OAG.
1465 */
1466 DRM_XE_OA_UNIT_TYPE_OAG,
1467
1468 /** @DRM_XE_OA_UNIT_TYPE_OAM: OAM OA unit */
1469 DRM_XE_OA_UNIT_TYPE_OAM,
1470};
1471
1472/**
1473 * struct drm_xe_oa_unit - describe OA unit
1474 */
1475struct drm_xe_oa_unit {
1476 /** @extensions: Pointer to the first extension struct, if any */
1477 __u64 extensions;
1478
1479 /** @oa_unit_id: OA unit ID */
1480 __u32 oa_unit_id;
1481
1482 /** @oa_unit_type: OA unit type of @drm_xe_oa_unit_type */
1483 __u32 oa_unit_type;
1484
1485 /** @capabilities: OA capabilities bit-mask */
1486 __u64 capabilities;
1487#define DRM_XE_OA_CAPS_BASE (1 << 0)
1488#define DRM_XE_OA_CAPS_SYNCS (1 << 1)
1489#define DRM_XE_OA_CAPS_OA_BUFFER_SIZE (1 << 2)
1490#define DRM_XE_OA_CAPS_WAIT_NUM_REPORTS (1 << 3)
1491
1492 /** @oa_timestamp_freq: OA timestamp freq */
1493 __u64 oa_timestamp_freq;
1494
1495 /** @reserved: MBZ */
1496 __u64 reserved[4];
1497
1498 /** @num_engines: number of engines in @eci array */
1499 __u64 num_engines;
1500
1501 /** @eci: engines attached to this OA unit */
1502 struct drm_xe_engine_class_instance eci[];
1503};
1504
1505/**
1506 * struct drm_xe_query_oa_units - describe OA units
1507 *
1508 * If a query is made with a struct drm_xe_device_query where .query
1509 * is equal to DRM_XE_DEVICE_QUERY_OA_UNITS, then the reply uses struct
1510 * drm_xe_query_oa_units in .data.
1511 *
1512 * OA unit properties for all OA units can be accessed using a code block
1513 * such as the one below:
1514 *
1515 * .. code-block:: C
1516 *
1517 * struct drm_xe_query_oa_units *qoa;
1518 * struct drm_xe_oa_unit *oau;
1519 * u8 *poau;
1520 *
1521 * // malloc qoa and issue DRM_XE_DEVICE_QUERY_OA_UNITS. Then:
1522 * poau = (u8 *)&qoa->oa_units[0];
1523 * for (int i = 0; i < qoa->num_oa_units; i++) {
1524 * oau = (struct drm_xe_oa_unit *)poau;
1525 * // Access 'struct drm_xe_oa_unit' fields here
1526 * poau += sizeof(*oau) + oau->num_engines * sizeof(oau->eci[0]);
1527 * }
1528 */
1529struct drm_xe_query_oa_units {
1530 /** @extensions: Pointer to the first extension struct, if any */
1531 __u64 extensions;
1532 /** @num_oa_units: number of OA units returned in oau[] */
1533 __u32 num_oa_units;
1534 /** @pad: MBZ */
1535 __u32 pad;
1536 /**
1537 * @oa_units: struct @drm_xe_oa_unit array returned for this device.
1538 * Written below as a u64 array to avoid problems with nested flexible
1539 * arrays with some compilers
1540 */
1541 __u64 oa_units[];
1542};
1543
1544/**
1545 * enum drm_xe_oa_format_type - OA format types as specified in PRM/Bspec
1546 * 52198/60942
1547 */
1548enum drm_xe_oa_format_type {
1549 /** @DRM_XE_OA_FMT_TYPE_OAG: OAG report format */
1550 DRM_XE_OA_FMT_TYPE_OAG,
1551 /** @DRM_XE_OA_FMT_TYPE_OAR: OAR report format */
1552 DRM_XE_OA_FMT_TYPE_OAR,
1553 /** @DRM_XE_OA_FMT_TYPE_OAM: OAM report format */
1554 DRM_XE_OA_FMT_TYPE_OAM,
1555 /** @DRM_XE_OA_FMT_TYPE_OAC: OAC report format */
1556 DRM_XE_OA_FMT_TYPE_OAC,
1557 /** @DRM_XE_OA_FMT_TYPE_OAM_MPEC: OAM SAMEDIA or OAM MPEC report format */
1558 DRM_XE_OA_FMT_TYPE_OAM_MPEC,
1559 /** @DRM_XE_OA_FMT_TYPE_PEC: PEC report format */
1560 DRM_XE_OA_FMT_TYPE_PEC,
1561};
1562
1563/**
1564 * enum drm_xe_oa_property_id - OA stream property id's
1565 *
1566 * Stream params are specified as a chain of @drm_xe_ext_set_property
1567 * struct's, with @property values from enum @drm_xe_oa_property_id and
1568 * @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY.
1569 * @param field in struct @drm_xe_observation_param points to the first
1570 * @drm_xe_ext_set_property struct.
1571 *
1572 * Exactly the same mechanism is also used for stream reconfiguration using the
1573 * @DRM_XE_OBSERVATION_IOCTL_CONFIG observation stream fd ioctl, though only a
1574 * subset of properties below can be specified for stream reconfiguration.
1575 */
1576enum drm_xe_oa_property_id {
1577#define DRM_XE_OA_EXTENSION_SET_PROPERTY 0
1578 /**
1579 * @DRM_XE_OA_PROPERTY_OA_UNIT_ID: ID of the OA unit on which to open
1580 * the OA stream, see @oa_unit_id in 'struct
1581 * drm_xe_query_oa_units'. Defaults to 0 if not provided.
1582 */
1583 DRM_XE_OA_PROPERTY_OA_UNIT_ID = 1,
1584
1585 /**
1586 * @DRM_XE_OA_PROPERTY_SAMPLE_OA: A value of 1 requests inclusion of raw
1587 * OA unit reports or stream samples in a global buffer attached to an
1588 * OA unit.
1589 */
1590 DRM_XE_OA_PROPERTY_SAMPLE_OA,
1591
1592 /**
1593 * @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA
1594 * reports, previously added via @DRM_XE_OBSERVATION_OP_ADD_CONFIG.
1595 */
1596 DRM_XE_OA_PROPERTY_OA_METRIC_SET,
1597
1598 /** @DRM_XE_OA_PROPERTY_OA_FORMAT: OA counter report format */
1599 DRM_XE_OA_PROPERTY_OA_FORMAT,
1600 /*
1601 * OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942,
1602 * in terms of the following quantities: a. enum @drm_xe_oa_format_type
1603 * b. Counter select c. Counter size and d. BC report. Also refer to the
1604 * oa_formats array in drivers/gpu/drm/xe/xe_oa.c.
1605 */
1606#define DRM_XE_OA_FORMAT_MASK_FMT_TYPE (0xffu << 0)
1607#define DRM_XE_OA_FORMAT_MASK_COUNTER_SEL (0xffu << 8)
1608#define DRM_XE_OA_FORMAT_MASK_COUNTER_SIZE (0xffu << 16)
1609#define DRM_XE_OA_FORMAT_MASK_BC_REPORT (0xffu << 24)
1610
1611 /**
1612 * @DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT: Requests periodic OA unit
1613 * sampling with sampling frequency proportional to 2^(period_exponent + 1)
1614 */
1615 DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT,
1616
1617 /**
1618 * @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA
1619 * stream in a DISABLED state (see @DRM_XE_OBSERVATION_IOCTL_ENABLE).
1620 */
1621 DRM_XE_OA_PROPERTY_OA_DISABLED,
1622
1623 /**
1624 * @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific
1625 * @exec_queue_id. OA queries can be executed on this exec queue.
1626 */
1627 DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID,
1628
1629 /**
1630 * @DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE: Optional engine instance to
1631 * pass along with @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID or will default to 0.
1632 */
1633 DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE,
1634
1635 /**
1636 * @DRM_XE_OA_PROPERTY_NO_PREEMPT: Allow preemption and timeslicing
1637 * to be disabled for the stream exec queue.
1638 */
1639 DRM_XE_OA_PROPERTY_NO_PREEMPT,
1640
1641 /**
1642 * @DRM_XE_OA_PROPERTY_NUM_SYNCS: Number of syncs in the sync array
1643 * specified in @DRM_XE_OA_PROPERTY_SYNCS
1644 */
1645 DRM_XE_OA_PROPERTY_NUM_SYNCS,
1646
1647 /**
1648 * @DRM_XE_OA_PROPERTY_SYNCS: Pointer to struct @drm_xe_sync array
1649 * with array size specified via @DRM_XE_OA_PROPERTY_NUM_SYNCS. OA
1650 * configuration will wait till input fences signal. Output fences
1651 * will signal after the new OA configuration takes effect. For
1652 * @DRM_XE_SYNC_TYPE_USER_FENCE, @addr is a user pointer, similar
1653 * to the VM bind case.
1654 */
1655 DRM_XE_OA_PROPERTY_SYNCS,
1656
1657 /**
1658 * @DRM_XE_OA_PROPERTY_OA_BUFFER_SIZE: Size of OA buffer to be
1659 * allocated by the driver in bytes. Supported sizes are powers of
1660 * 2 from 128 KiB to 128 MiB. When not specified, a 16 MiB OA
1661 * buffer is allocated by default.
1662 */
1663 DRM_XE_OA_PROPERTY_OA_BUFFER_SIZE,
1664
1665 /**
1666 * @DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS: Number of reports to wait
1667 * for before unblocking poll or read
1668 */
1669 DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS,
1670};
1671
1672/**
1673 * struct drm_xe_oa_config - OA metric configuration
1674 *
1675 * Multiple OA configs can be added using @DRM_XE_OBSERVATION_OP_ADD_CONFIG. A
1676 * particular config can be specified when opening an OA stream using
1677 * @DRM_XE_OA_PROPERTY_OA_METRIC_SET property.
1678 */
1679struct drm_xe_oa_config {
1680 /** @extensions: Pointer to the first extension struct, if any */
1681 __u64 extensions;
1682
1683 /** @uuid: String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x" */
1684 char uuid[36];
1685
1686 /** @n_regs: Number of regs in @regs_ptr */
1687 __u32 n_regs;
1688
1689 /**
1690 * @regs_ptr: Pointer to (register address, value) pairs for OA config
1691 * registers. Expected length of buffer is: (2 * sizeof(u32) * @n_regs).
1692 */
1693 __u64 regs_ptr;
1694};
1695
1696/**
1697 * struct drm_xe_oa_stream_status - OA stream status returned from
1698 * @DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl. Userspace can
1699 * call the ioctl to query stream status in response to EIO errno from
1700 * observation fd read().
1701 */
1702struct drm_xe_oa_stream_status {
1703 /** @extensions: Pointer to the first extension struct, if any */
1704 __u64 extensions;
1705
1706 /** @oa_status: OA stream status (see Bspec 46717/61226) */
1707 __u64 oa_status;
1708#define DRM_XE_OASTATUS_MMIO_TRG_Q_FULL (1 << 3)
1709#define DRM_XE_OASTATUS_COUNTER_OVERFLOW (1 << 2)
1710#define DRM_XE_OASTATUS_BUFFER_OVERFLOW (1 << 1)
1711#define DRM_XE_OASTATUS_REPORT_LOST (1 << 0)
1712
1713 /** @reserved: reserved for future use */
1714 __u64 reserved[3];
1715};
1716
1717/**
1718 * struct drm_xe_oa_stream_info - OA stream info returned from
1719 * @DRM_XE_OBSERVATION_IOCTL_INFO observation stream fd ioctl
1720 */
1721struct drm_xe_oa_stream_info {
1722 /** @extensions: Pointer to the first extension struct, if any */
1723 __u64 extensions;
1724
1725 /** @oa_buf_size: OA buffer size */
1726 __u64 oa_buf_size;
1727
1728 /** @reserved: reserved for future use */
1729 __u64 reserved[3];
1730};
1731
1371#if defined(__cplusplus)1732#if defined(__cplusplus)
1372}1733}
1373#endif1734#endif
lib/libc/include/any-linux-any/linux/android/binder.h+36
...@@ -236,6 +236,12 @@ struct binder_frozen_status_info {...@@ -236,6 +236,12 @@ struct binder_frozen_status_info {
236 __u32 async_recv;236 __u32 async_recv;
237};237};
238238
239struct binder_frozen_state_info {
240 binder_uintptr_t cookie;
241 __u32 is_frozen;
242 __u32 reserved;
243};
244
239/* struct binder_extened_error - extended error information245/* struct binder_extened_error - extended error information
240 * @id: identifier for the failed operation246 * @id: identifier for the failed operation
241 * @command: command as defined by binder_driver_return_protocol247 * @command: command as defined by binder_driver_return_protocol
...@@ -467,6 +473,17 @@ enum binder_driver_return_protocol {...@@ -467,6 +473,17 @@ enum binder_driver_return_protocol {
467 /*473 /*
468 * The target of the last async transaction is frozen. No parameters.474 * The target of the last async transaction is frozen. No parameters.
469 */475 */
476
477 BR_FROZEN_BINDER = _IOR('r', 21, struct binder_frozen_state_info),
478 /*
479 * The cookie and a boolean (is_frozen) that indicates whether the process
480 * transitioned into a frozen or an unfrozen state.
481 */
482
483 BR_CLEAR_FREEZE_NOTIFICATION_DONE = _IOR('r', 22, binder_uintptr_t),
484 /*
485 * void *: cookie
486 */
470};487};
471488
472enum binder_driver_command_protocol {489enum binder_driver_command_protocol {
...@@ -550,6 +567,25 @@ enum binder_driver_command_protocol {...@@ -550,6 +567,25 @@ enum binder_driver_command_protocol {
550 /*567 /*
551 * binder_transaction_data_sg: the sent command.568 * binder_transaction_data_sg: the sent command.
552 */569 */
570
571 BC_REQUEST_FREEZE_NOTIFICATION =
572 _IOW('c', 19, struct binder_handle_cookie),
573 /*
574 * int: handle
575 * void *: cookie
576 */
577
578 BC_CLEAR_FREEZE_NOTIFICATION = _IOW('c', 20,
579 struct binder_handle_cookie),
580 /*
581 * int: handle
582 * void *: cookie
583 */
584
585 BC_FREEZE_NOTIFICATION_DONE = _IOW('c', 21, binder_uintptr_t),
586 /*
587 * void *: cookie
588 */
553};589};
554590
555#endif /* _LINUX_BINDER_H */591#endif /* _LINUX_BINDER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/audit.h+3
...@@ -143,6 +143,9 @@...@@ -143,6 +143,9 @@
143#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */143#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */
144#define AUDIT_MAC_CALIPSO_ADD 1418 /* NetLabel: add CALIPSO DOI entry */144#define AUDIT_MAC_CALIPSO_ADD 1418 /* NetLabel: add CALIPSO DOI entry */
145#define AUDIT_MAC_CALIPSO_DEL 1419 /* NetLabel: del CALIPSO DOI entry */145#define AUDIT_MAC_CALIPSO_DEL 1419 /* NetLabel: del CALIPSO DOI entry */
146#define AUDIT_IPE_ACCESS 1420 /* IPE denial or grant */
147#define AUDIT_IPE_CONFIG_CHANGE 1421 /* IPE config change */
148#define AUDIT_IPE_POLICY_LOAD 1422 /* IPE policy load */
146149
147#define AUDIT_FIRST_KERN_ANOM_MSG 1700150#define AUDIT_FIRST_KERN_ANOM_MSG 1700
148#define AUDIT_LAST_KERN_ANOM_MSG 1799151#define AUDIT_LAST_KERN_ANOM_MSG 1799
lib/libc/include/any-linux-any/linux/auto_fs.h+1-1
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21#define AUTOFS_MIN_PROTO_VERSION 321#define AUTOFS_MIN_PROTO_VERSION 3
22#define AUTOFS_MAX_PROTO_VERSION 522#define AUTOFS_MAX_PROTO_VERSION 5
2323
24#define AUTOFS_PROTO_SUBVERSION 524#define AUTOFS_PROTO_SUBVERSION 6
2525
26/*26/*
27 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed27 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
lib/libc/include/any-linux-any/linux/batadv_packet.h+16-13
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
99
10#include <asm/byteorder.h>10#include <asm/byteorder.h>
11#include <linux/if_ether.h>11#include <linux/if_ether.h>
12#include <linux/stddef.h>
12#include <linux/types.h>13#include <linux/types.h>
1314
14/**15/**
...@@ -592,19 +593,6 @@ struct batadv_tvlv_gateway_data {...@@ -592,19 +593,6 @@ struct batadv_tvlv_gateway_data {
592 __be32 bandwidth_up;593 __be32 bandwidth_up;
593};594};
594595
595/**
596 * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container
597 * @flags: translation table flags (see batadv_tt_data_flags)
598 * @ttvn: translation table version number
599 * @num_vlan: number of announced VLANs. In the TVLV this struct is followed by
600 * one batadv_tvlv_tt_vlan_data object per announced vlan
601 */
602struct batadv_tvlv_tt_data {
603 __u8 flags;
604 __u8 ttvn;
605 __be16 num_vlan;
606};
607
608/**596/**
609 * struct batadv_tvlv_tt_vlan_data - vlan specific tt data propagated through597 * struct batadv_tvlv_tt_vlan_data - vlan specific tt data propagated through
610 * the tt tvlv container598 * the tt tvlv container
...@@ -618,6 +606,21 @@ struct batadv_tvlv_tt_vlan_data {...@@ -618,6 +606,21 @@ struct batadv_tvlv_tt_vlan_data {
618 __u16 reserved;606 __u16 reserved;
619};607};
620608
609/**
610 * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container
611 * @flags: translation table flags (see batadv_tt_data_flags)
612 * @ttvn: translation table version number
613 * @num_vlan: number of announced VLANs. In the TVLV this struct is followed by
614 * one batadv_tvlv_tt_vlan_data object per announced vlan
615 * @vlan_data: array of batadv_tvlv_tt_vlan_data objects
616 */
617struct batadv_tvlv_tt_data {
618 __u8 flags;
619 __u8 ttvn;
620 __be16 num_vlan;
621 struct batadv_tvlv_tt_vlan_data vlan_data[] __counted_by_be(num_vlan);
622};
623
621/**624/**
622 * struct batadv_tvlv_tt_change - translation table diff data625 * struct batadv_tvlv_tt_change - translation table diff data
623 * @flags: status indicators concerning the non-mesh client (see626 * @flags: status indicators concerning the non-mesh client (see
lib/libc/include/any-linux-any/linux/bits.h+3
...@@ -12,4 +12,7 @@...@@ -12,4 +12,7 @@
12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
1414
15#define __GENMASK_U128(h, l) \
16 ((_BIT128((h)) << 1) - (_BIT128(l)))
17
15#endif /* _LINUX_BITS_H */18#endif /* _LINUX_BITS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blkdev.h created+14
...@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_BLKDEV_H
3#define _LINUX_BLKDEV_H
4
5#include <linux/ioctl.h>
6#include <linux/types.h>
7
8/*
9 * io_uring block file commands, see IORING_OP_URING_CMD.
10 * It's a different number space from ioctl(), reuse the block's code 0x12.
11 */
12#define BLOCK_URING_CMD_DISCARD _IO(0x12, 0)
13
14#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bpf.h+40-23
...@@ -1116,11 +1116,15 @@ enum bpf_attach_type {...@@ -1116,11 +1116,15 @@ enum bpf_attach_type {
1116 BPF_NETKIT_PRIMARY,1116 BPF_NETKIT_PRIMARY,
1117 BPF_NETKIT_PEER,1117 BPF_NETKIT_PEER,
1118 BPF_TRACE_KPROBE_SESSION,1118 BPF_TRACE_KPROBE_SESSION,
1119 BPF_TRACE_UPROBE_SESSION,
1119 __MAX_BPF_ATTACH_TYPE1120 __MAX_BPF_ATTACH_TYPE
1120};1121};
11211122
1122#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE1123#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
11231124
1125/* Add BPF_LINK_TYPE(type, name) in bpf_types.h to keep bpf_link_type_strs[]
1126 * in sync with the definitions below.
1127 */
1124enum bpf_link_type {1128enum bpf_link_type {
1125 BPF_LINK_TYPE_UNSPEC = 0,1129 BPF_LINK_TYPE_UNSPEC = 0,
1126 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,1130 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
...@@ -1425,6 +1429,8 @@ enum {...@@ -1425,6 +1429,8 @@ enum {
1425#define BPF_F_TEST_RUN_ON_CPU (1U << 0)1429#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
1426/* If set, XDP frames will be transmitted after processing */1430/* If set, XDP frames will be transmitted after processing */
1427#define BPF_F_TEST_XDP_LIVE_FRAMES (1U << 1)1431#define BPF_F_TEST_XDP_LIVE_FRAMES (1U << 1)
1432/* If set, apply CHECKSUM_COMPLETE to skb and validate the checksum */
1433#define BPF_F_TEST_SKB_CHECKSUM_COMPLETE (1U << 2)
14281434
1429/* type for BPF_ENABLE_STATS */1435/* type for BPF_ENABLE_STATS */
1430enum bpf_stats_type {1436enum bpf_stats_type {
...@@ -1968,6 +1974,8 @@ union bpf_attr {...@@ -1968,6 +1974,8 @@ union bpf_attr {
1968 * program.1974 * program.
1969 * Return1975 * Return
1970 * The SMP id of the processor running the program.1976 * The SMP id of the processor running the program.
1977 * Attributes
1978 * __bpf_fastcall
1971 *1979 *
1972 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)1980 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
1973 * Description1981 * Description
...@@ -2849,7 +2857,7 @@ union bpf_attr {...@@ -2849,7 +2857,7 @@ union bpf_attr {
2849 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,2857 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
2850 * **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,2858 * **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
2851 * **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,2859 * **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
2852 * **TCP_BPF_RTO_MIN**.2860 * **TCP_BPF_RTO_MIN**, **TCP_BPF_SOCK_OPS_CB_FLAGS**.
2853 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.2861 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2854 * * **IPPROTO_IPV6**, which supports the following *optname*\ s:2862 * * **IPPROTO_IPV6**, which supports the following *optname*\ s:
2855 * **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.2863 * **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
...@@ -3099,10 +3107,6 @@ union bpf_attr {...@@ -3099,10 +3107,6 @@ union bpf_attr {
3099 * with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration3107 * with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration
3100 * option, and in this case it only works on functions tagged with3108 * option, and in this case it only works on functions tagged with
3101 * **ALLOW_ERROR_INJECTION** in the kernel code.3109 * **ALLOW_ERROR_INJECTION** in the kernel code.
3102 *
3103 * Also, the helper is only available for the architectures having
3104 * the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
3105 * x86 architecture is the only one to support this feature.
3106 * Return3110 * Return
3107 * 03111 * 0
3108 *3112 *
...@@ -5367,7 +5371,7 @@ union bpf_attr {...@@ -5367,7 +5371,7 @@ union bpf_attr {
5367 * Currently, the **flags** must be 0. Currently, nr_loops is5371 * Currently, the **flags** must be 0. Currently, nr_loops is
5368 * limited to 1 << 23 (~8 million) loops.5372 * limited to 1 << 23 (~8 million) loops.
5369 *5373 *
5370 * long (\*callback_fn)(u32 index, void \*ctx);5374 * long (\*callback_fn)(u64 index, void \*ctx);
5371 *5375 *
5372 * where **index** is the current index in the loop. The index5376 * where **index** is the current index in the loop. The index
5373 * is zero-indexed.5377 * is zero-indexed.
...@@ -5517,11 +5521,12 @@ union bpf_attr {...@@ -5517,11 +5521,12 @@ union bpf_attr {
5517 * **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if5521 * **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
5518 * invalid arguments are passed.5522 * invalid arguments are passed.
5519 *5523 *
5520 * void *bpf_kptr_xchg(void *map_value, void *ptr)5524 * void *bpf_kptr_xchg(void *dst, void *ptr)
5521 * Description5525 * Description
5522 * Exchange kptr at pointer *map_value* with *ptr*, and return the5526 * Exchange kptr at pointer *dst* with *ptr*, and return the old value.
5523 * old value. *ptr* can be NULL, otherwise it must be a referenced5527 * *dst* can be map value or local kptr. *ptr* can be NULL, otherwise
5524 * pointer which will be released when this helper is called.5528 * it must be a referenced pointer which will be released when this helper
5529 * is called.
5525 * Return5530 * Return
5526 * The old value of kptr (which can be NULL). The returned pointer5531 * The old value of kptr (which can be NULL). The returned pointer
5527 * if not NULL, is a reference which must be released using its5532 * if not NULL, is a reference which must be released using its
...@@ -6044,11 +6049,6 @@ enum {...@@ -6044,11 +6049,6 @@ enum {
6044 BPF_F_MARK_ENFORCE = (1ULL << 6),6049 BPF_F_MARK_ENFORCE = (1ULL << 6),
6045};6050};
60466051
6047/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
6048enum {
6049 BPF_F_INGRESS = (1ULL << 0),
6050};
6051
6052/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */6052/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
6053enum {6053enum {
6054 BPF_F_TUNINFO_IPV6 = (1ULL << 0),6054 BPF_F_TUNINFO_IPV6 = (1ULL << 0),
...@@ -6195,10 +6195,12 @@ enum {...@@ -6195,10 +6195,12 @@ enum {
6195 BPF_F_BPRM_SECUREEXEC = (1ULL << 0),6195 BPF_F_BPRM_SECUREEXEC = (1ULL << 0),
6196};6196};
61976197
6198/* Flags for bpf_redirect_map helper */6198/* Flags for bpf_redirect and bpf_redirect_map helpers */
6199enum {6199enum {
6200 BPF_F_BROADCAST = (1ULL << 3),6200 BPF_F_INGRESS = (1ULL << 0), /* used for skb path */
6201 BPF_F_EXCLUDE_INGRESS = (1ULL << 4),6201 BPF_F_BROADCAST = (1ULL << 3), /* used for XDP path */
6202 BPF_F_EXCLUDE_INGRESS = (1ULL << 4), /* used for XDP path */
6203#define BPF_F_REDIRECT_FLAGS (BPF_F_INGRESS | BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS)
6202};6204};
62036205
6204#define __bpf_md_ptr(type, name) \6206#define __bpf_md_ptr(type, name) \
...@@ -6207,12 +6209,17 @@ union { \...@@ -6207,12 +6209,17 @@ union { \
6207 __u64 :64; \6209 __u64 :64; \
6208} __attribute__((aligned(8)))6210} __attribute__((aligned(8)))
62096211
6212/* The enum used in skb->tstamp_type. It specifies the clock type
6213 * of the time stored in the skb->tstamp.
6214 */
6210enum {6215enum {
6211 BPF_SKB_TSTAMP_UNSPEC,6216 BPF_SKB_TSTAMP_UNSPEC = 0, /* DEPRECATED */
6212 BPF_SKB_TSTAMP_DELIVERY_MONO, /* tstamp has mono delivery time */6217 BPF_SKB_TSTAMP_DELIVERY_MONO = 1, /* DEPRECATED */
6213 /* For any BPF_SKB_TSTAMP_* that the bpf prog cannot handle,6218 BPF_SKB_CLOCK_REALTIME = 0,
6214 * the bpf prog should handle it like BPF_SKB_TSTAMP_UNSPEC6219 BPF_SKB_CLOCK_MONOTONIC = 1,
6215 * and try to deduce it by ingress, egress or skb->sk->sk_clockid.6220 BPF_SKB_CLOCK_TAI = 2,
6221 /* For any future BPF_SKB_CLOCK_* that the bpf prog cannot handle,
6222 * the bpf prog can try to deduce it by ingress/egress/skb->sk->sk_clockid.
6216 */6223 */
6217};6224};
62186225
...@@ -7073,6 +7080,7 @@ enum {...@@ -7073,6 +7080,7 @@ enum {
7073 TCP_BPF_SYN = 1005, /* Copy the TCP header */7080 TCP_BPF_SYN = 1005, /* Copy the TCP header */
7074 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */7081 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
7075 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */7082 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
7083 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7076};7084};
70777085
7078enum {7086enum {
...@@ -7505,4 +7513,13 @@ struct bpf_iter_num {...@@ -7505,4 +7513,13 @@ struct bpf_iter_num {
7505 __u64 __opaque[1];7513 __u64 __opaque[1];
7506} __attribute__((aligned(8)));7514} __attribute__((aligned(8)));
75077515
7516/*
7517 * Flags to control BPF kfunc behaviour.
7518 * - BPF_F_PAD_ZEROS: Pad destination buffer with zeros. (See the respective
7519 * helper documentation for details.)
7520 */
7521enum bpf_kfunc_flags {
7522 BPF_F_PAD_ZEROS = (1ULL << 0),
7523};
7524
7508#endif /* __LINUX_BPF_H__ */7525#endif /* __LINUX_BPF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs.h+25
...@@ -1047,6 +1047,29 @@ struct btrfs_ioctl_encoded_io_args {...@@ -1047,6 +1047,29 @@ struct btrfs_ioctl_encoded_io_args {
1047#define BTRFS_ENCODED_IO_ENCRYPTION_NONE 01047#define BTRFS_ENCODED_IO_ENCRYPTION_NONE 0
1048#define BTRFS_ENCODED_IO_ENCRYPTION_TYPES 11048#define BTRFS_ENCODED_IO_ENCRYPTION_TYPES 1
10491049
1050/*
1051 * Wait for subvolume cleaning process. This queries the kernel queue and it
1052 * can change between the calls.
1053 *
1054 * - FOR_ONE - specify the subvolid
1055 * - FOR_QUEUED - wait for all currently queued
1056 * - COUNT - count number of queued
1057 * - PEEK_FIRST - read which is the first in the queue (to be cleaned or being
1058 * cleaned already), or 0 if the queue is empty
1059 * - PEEK_LAST - read the last subvolid in the queue, or 0 if the queue is empty
1060 */
1061struct btrfs_ioctl_subvol_wait {
1062 __u64 subvolid;
1063 __u32 mode;
1064 __u32 count;
1065};
1066
1067#define BTRFS_SUBVOL_SYNC_WAIT_FOR_ONE (0)
1068#define BTRFS_SUBVOL_SYNC_WAIT_FOR_QUEUED (1)
1069#define BTRFS_SUBVOL_SYNC_COUNT (2)
1070#define BTRFS_SUBVOL_SYNC_PEEK_FIRST (3)
1071#define BTRFS_SUBVOL_SYNC_PEEK_LAST (4)
1072
1050/* Error codes as returned by the kernel */1073/* Error codes as returned by the kernel */
1051enum btrfs_err_code {1074enum btrfs_err_code {
1052 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,1075 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,
...@@ -1179,6 +1202,8 @@ enum btrfs_err_code {...@@ -1179,6 +1202,8 @@ enum btrfs_err_code {
1179 struct btrfs_ioctl_encoded_io_args)1202 struct btrfs_ioctl_encoded_io_args)
1180#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \1203#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \
1181 struct btrfs_ioctl_encoded_io_args)1204 struct btrfs_ioctl_encoded_io_args)
1205#define BTRFS_IOC_SUBVOL_SYNC_WAIT _IOW(BTRFS_IOCTL_MAGIC, 65, \
1206 struct btrfs_ioctl_subvol_wait)
11821207
1183#ifdef __cplusplus1208#ifdef __cplusplus
1184}1209}
lib/libc/include/any-linux-any/linux/btrfs_tree.h+9-13
...@@ -743,21 +743,9 @@ struct btrfs_raid_stride {...@@ -743,21 +743,9 @@ struct btrfs_raid_stride {
743 __le64 physical;743 __le64 physical;
744} __attribute__ ((__packed__));744} __attribute__ ((__packed__));
745745
746/* The stripe_extent::encoding, 1:1 mapping of enum btrfs_raid_types. */
747#define BTRFS_STRIPE_RAID0 1
748#define BTRFS_STRIPE_RAID1 2
749#define BTRFS_STRIPE_DUP 3
750#define BTRFS_STRIPE_RAID10 4
751#define BTRFS_STRIPE_RAID5 5
752#define BTRFS_STRIPE_RAID6 6
753#define BTRFS_STRIPE_RAID1C3 7
754#define BTRFS_STRIPE_RAID1C4 8
755
756struct btrfs_stripe_extent {746struct btrfs_stripe_extent {
757 __u8 encoding;
758 __u8 reserved[7];
759 /* An array of raid strides this stripe is composed of. */747 /* An array of raid strides this stripe is composed of. */
760 struct btrfs_raid_stride strides[];748 __DECLARE_FLEX_ARRAY(struct btrfs_raid_stride, strides);
761} __attribute__ ((__packed__));749} __attribute__ ((__packed__));
762750
763#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)751#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)
...@@ -773,6 +761,14 @@ struct btrfs_stripe_extent {...@@ -773,6 +761,14 @@ struct btrfs_stripe_extent {
773#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)761#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
774#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)762#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)
775763
764/*
765 * Those are temporaray flags utilized by btrfs-progs to do offline conversion.
766 * They are rejected by kernel.
767 * But still keep them all here to avoid conflicts.
768 */
769#define BTRFS_SUPER_FLAG_CHANGING_BG_TREE (1ULL << 38)
770#define BTRFS_SUPER_FLAG_CHANGING_DATA_CSUM (1ULL << 39)
771#define BTRFS_SUPER_FLAG_CHANGING_META_CSUM (1ULL << 40)
776772
777/*773/*
778 * items in the extent btree are used to record the objectid of the774 * items in the extent btree are used to record the objectid of the
lib/libc/include/any-linux-any/linux/can/isotp.h+1-1
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2/*2/*
3 * linux/can/isotp.h3 * linux/can/isotp.h
4 *4 *
5 * Definitions for isotp CAN sockets (ISO 15765-2:2016)5 * Definitions for ISO 15765-2 CAN transport protocol sockets
6 *6 *
7 * Copyright (c) 2020 Volkswagen Group Electronic Research7 * Copyright (c) 2020 Volkswagen Group Electronic Research
8 * All rights reserved.8 * All rights reserved.
lib/libc/include/any-linux-any/linux/cec.h+8-1
...@@ -132,6 +132,8 @@ static __inline__ void cec_msg_init(struct cec_msg *msg,...@@ -132,6 +132,8 @@ static __inline__ void cec_msg_init(struct cec_msg *msg,
132 * Set the msg destination to the orig initiator and the msg initiator to the132 * Set the msg destination to the orig initiator and the msg initiator to the
133 * orig destination. Note that msg and orig may be the same pointer, in which133 * orig destination. Note that msg and orig may be the same pointer, in which
134 * case the change is done in place.134 * case the change is done in place.
135 *
136 * It also zeroes the reply, timeout and flags fields.
135 */137 */
136static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,138static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
137 struct cec_msg *orig)139 struct cec_msg *orig)
...@@ -139,7 +141,9 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,...@@ -139,7 +141,9 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
139 /* The destination becomes the initiator and vice versa */141 /* The destination becomes the initiator and vice versa */
140 msg->msg[0] = (cec_msg_destination(orig) << 4) |142 msg->msg[0] = (cec_msg_destination(orig) << 4) |
141 cec_msg_initiator(orig);143 cec_msg_initiator(orig);
142 msg->reply = msg->timeout = 0;144 msg->reply = 0;
145 msg->timeout = 0;
146 msg->flags = 0;
143}147}
144148
145/**149/**
...@@ -165,6 +169,7 @@ static __inline__ int cec_msg_recv_is_rx_result(const struct cec_msg *msg)...@@ -165,6 +169,7 @@ static __inline__ int cec_msg_recv_is_rx_result(const struct cec_msg *msg)
165/* cec_msg flags field */169/* cec_msg flags field */
166#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)170#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
167#define CEC_MSG_FL_RAW (1 << 1)171#define CEC_MSG_FL_RAW (1 << 1)
172#define CEC_MSG_FL_REPLY_VENDOR_ID (1 << 2)
168173
169/* cec_msg tx/rx_status field */174/* cec_msg tx/rx_status field */
170#define CEC_TX_STATUS_OK (1 << 0)175#define CEC_TX_STATUS_OK (1 << 0)
...@@ -339,6 +344,8 @@ static __inline__ int cec_is_unconfigured(__u16 log_addr_mask)...@@ -339,6 +344,8 @@ static __inline__ int cec_is_unconfigured(__u16 log_addr_mask)
339#define CEC_CAP_MONITOR_PIN (1 << 7)344#define CEC_CAP_MONITOR_PIN (1 << 7)
340/* CEC_ADAP_G_CONNECTOR_INFO is available */345/* CEC_ADAP_G_CONNECTOR_INFO is available */
341#define CEC_CAP_CONNECTOR_INFO (1 << 8)346#define CEC_CAP_CONNECTOR_INFO (1 << 8)
347/* CEC_MSG_FL_REPLY_VENDOR_ID is available */
348#define CEC_CAP_REPLY_VENDOR_ID (1 << 9)
342349
343/**350/**
344 * struct cec_caps - CEC capabilities structure.351 * struct cec_caps - CEC capabilities structure.
lib/libc/include/any-linux-any/linux/const.h+17
...@@ -28,6 +28,23 @@...@@ -28,6 +28,23 @@
28#define _BITUL(x) (_UL(1) << (x))28#define _BITUL(x) (_UL(1) << (x))
29#define _BITULL(x) (_ULL(1) << (x))29#define _BITULL(x) (_ULL(1) << (x))
3030
31#if !defined(__ASSEMBLY__)
32/*
33 * Missing __asm__ support
34 *
35 * __BIT128() would not work in the __asm__ code, as it shifts an
36 * 'unsigned __init128' data type as direct representation of
37 * 128 bit constants is not supported in the gcc compiler, as
38 * they get silently truncated.
39 *
40 * TODO: Please revisit this implementation when gcc compiler
41 * starts representing 128 bit constants directly like long
42 * and unsigned long etc. Subsequently drop the comment for
43 * GENMASK_U128() which would then start supporting __asm__ code.
44 */
45#define _BIT128(x) ((unsigned __int128)(1) << (x))
46#endif
47
31#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)48#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
32#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))49#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
3350
lib/libc/include/any-linux-any/linux/cryptouser.h+5
...@@ -64,6 +64,7 @@ enum crypto_attr_type_t {...@@ -64,6 +64,7 @@ enum crypto_attr_type_t {
64 CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */64 CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */
65 CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */65 CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */
66 CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */66 CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */
67 CRYPTOCFGA_REPORT_SIG, /* struct crypto_report_sig */
67 __CRYPTOCFGA_MAX68 __CRYPTOCFGA_MAX
6869
69#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)70#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
...@@ -207,6 +208,10 @@ struct crypto_report_acomp {...@@ -207,6 +208,10 @@ struct crypto_report_acomp {
207 char type[CRYPTO_MAX_NAME];208 char type[CRYPTO_MAX_NAME];
208};209};
209210
211struct crypto_report_sig {
212 char type[CRYPTO_MAX_NAME];
213};
214
210#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \215#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
211 sizeof(struct crypto_report_blkcipher))216 sizeof(struct crypto_report_blkcipher))
212217
lib/libc/include/any-linux-any/linux/dlm.h+2
...@@ -71,6 +71,8 @@ struct dlm_lksb {...@@ -71,6 +71,8 @@ struct dlm_lksb {
71/* DLM_LSFL_TIMEWARN is deprecated and reserved. DO NOT USE! */71/* DLM_LSFL_TIMEWARN is deprecated and reserved. DO NOT USE! */
72#define DLM_LSFL_TIMEWARN 0x0000000272#define DLM_LSFL_TIMEWARN 0x00000002
73#define DLM_LSFL_NEWEXCL 0x0000000873#define DLM_LSFL_NEWEXCL 0x00000008
74/* currently reserved due in-kernel use */
75#define __DLM_LSFL_RESERVED0 0x00000010
7476
7577
76#endif /* __DLM_DOT_H__ */78#endif /* __DLM_DOT_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dma-heap.h+1-1
...@@ -19,7 +19,7 @@...@@ -19,7 +19,7 @@
19#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)19#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)
2020
21/* Currently no heap flags */21/* Currently no heap flags */
22#define DMA_HEAP_VALID_HEAP_FLAGS (0)22#define DMA_HEAP_VALID_HEAP_FLAGS (0ULL)
2323
24/**24/**
25 * struct dma_heap_allocation_data - metadata passed from userspace for25 * struct dma_heap_allocation_data - metadata passed from userspace for
lib/libc/include/any-linux-any/linux/dpll.h+27
...@@ -79,6 +79,29 @@ enum dpll_lock_status_error {...@@ -79,6 +79,29 @@ enum dpll_lock_status_error {
79 DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)79 DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
80};80};
8181
82/*
83 * level of quality of a clock device. This mainly applies when the dpll
84 * lock-status is DPLL_LOCK_STATUS_HOLDOVER. The current list is defined
85 * according to the table 11-7 contained in ITU-T G.8264/Y.1364 document. One
86 * may extend this list freely by other ITU-T defined clock qualities, or
87 * different ones defined by another standardization body (for those, please
88 * use different prefix).
89 */
90enum dpll_clock_quality_level {
91 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRC = 1,
92 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_A,
93 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_B,
94 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEC1,
95 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRTC,
96 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRTC,
97 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEEC,
98 DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRC,
99
100 /* private: */
101 __DPLL_CLOCK_QUALITY_LEVEL_MAX,
102 DPLL_CLOCK_QUALITY_LEVEL_MAX = (__DPLL_CLOCK_QUALITY_LEVEL_MAX - 1)
103};
104
82#define DPLL_TEMP_DIVIDER 1000105#define DPLL_TEMP_DIVIDER 1000
83106
84/**107/**
...@@ -180,6 +203,7 @@ enum dpll_a {...@@ -180,6 +203,7 @@ enum dpll_a {
180 DPLL_A_TEMP,203 DPLL_A_TEMP,
181 DPLL_A_TYPE,204 DPLL_A_TYPE,
182 DPLL_A_LOCK_STATUS_ERROR,205 DPLL_A_LOCK_STATUS_ERROR,
206 DPLL_A_CLOCK_QUALITY_LEVEL,
183207
184 __DPLL_A_MAX,208 __DPLL_A_MAX,
185 DPLL_A_MAX = (__DPLL_A_MAX - 1)209 DPLL_A_MAX = (__DPLL_A_MAX - 1)
...@@ -210,6 +234,9 @@ enum dpll_a_pin {...@@ -210,6 +234,9 @@ enum dpll_a_pin {
210 DPLL_A_PIN_PHASE_ADJUST,234 DPLL_A_PIN_PHASE_ADJUST,
211 DPLL_A_PIN_PHASE_OFFSET,235 DPLL_A_PIN_PHASE_OFFSET,
212 DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET,236 DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET,
237 DPLL_A_PIN_ESYNC_FREQUENCY,
238 DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED,
239 DPLL_A_PIN_ESYNC_PULSE,
213240
214 __DPLL_A_PIN_MAX,241 __DPLL_A_PIN_MAX,
215 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)242 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
lib/libc/include/any-linux-any/linux/elf.h+4
...@@ -411,6 +411,7 @@ typedef struct elf64_shdr {...@@ -411,6 +411,7 @@ typedef struct elf64_shdr {
411#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */411#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
412/* Old binutils treats 0x203 as a CET state */412/* Old binutils treats 0x203 as a CET state */
413#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */413#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
414#define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description */
414#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */415#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
415#define NT_S390_TIMER 0x301 /* s390 timer register */416#define NT_S390_TIMER 0x301 /* s390 timer register */
416#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */417#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
...@@ -441,6 +442,8 @@ typedef struct elf64_shdr {...@@ -441,6 +442,8 @@ typedef struct elf64_shdr {
441#define NT_ARM_ZA 0x40c /* ARM SME ZA registers */442#define NT_ARM_ZA 0x40c /* ARM SME ZA registers */
442#define NT_ARM_ZT 0x40d /* ARM SME ZT registers */443#define NT_ARM_ZT 0x40d /* ARM SME ZT registers */
443#define NT_ARM_FPMR 0x40e /* ARM floating point mode register */444#define NT_ARM_FPMR 0x40e /* ARM floating point mode register */
445#define NT_ARM_POE 0x40f /* ARM POE registers */
446#define NT_ARM_GCS 0x410 /* ARM GCS state */
444#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */447#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
445#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */448#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
446#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */449#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
...@@ -448,6 +451,7 @@ typedef struct elf64_shdr {...@@ -448,6 +451,7 @@ typedef struct elf64_shdr {
448#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */451#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
449#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */452#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
450#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */453#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
454#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control (prctl()) */
451#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */455#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */
452#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */456#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */
453#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */457#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */
lib/libc/include/any-linux-any/linux/ethtool.h+231
...@@ -750,6 +750,197 @@ enum ethtool_module_power_mode {...@@ -750,6 +750,197 @@ enum ethtool_module_power_mode {
750 ETHTOOL_MODULE_POWER_MODE_HIGH,750 ETHTOOL_MODULE_POWER_MODE_HIGH,
751};751};
752752
753/**
754 * enum ethtool_c33_pse_ext_state - groups of PSE extended states
755 * functions. IEEE 802.3-2022 33.2.4.4 Variables
756 *
757 * @ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION: Group of error_condition states
758 * @ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID: Group of mr_mps_valid states
759 * @ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE: Group of mr_pse_enable states
760 * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED: Group of option_detect_ted
761 * states
762 * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM: Group of option_vport_lim states
763 * @ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED: Group of ovld_detected states
764 * @ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE: Group of pd_dll_power_type
765 * states
766 * @ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE: Group of power_not_available
767 * states
768 * @ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED: Group of short_detected states
769 */
770enum ethtool_c33_pse_ext_state {
771 ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1,
772 ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID,
773 ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE,
774 ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED,
775 ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM,
776 ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED,
777 ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE,
778 ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE,
779 ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED,
780};
781
782/**
783 * enum ethtool_c33_pse_ext_substate_mr_mps_valid - mr_mps_valid states
784 * functions. IEEE 802.3-2022 33.2.4.4 Variables
785 *
786 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD: Underload
787 * state
788 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN: Port is not
789 * connected
790 *
791 * The PSE monitors either the DC or AC Maintain Power Signature
792 * (MPS, see 33.2.9.1). This variable indicates the presence or absence of
793 * a valid MPS.
794 */
795enum ethtool_c33_pse_ext_substate_mr_mps_valid {
796 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1,
797 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN,
798};
799
800/**
801 * enum ethtool_c33_pse_ext_substate_error_condition - error_condition states
802 * functions. IEEE 802.3-2022 33.2.4.4 Variables
803 *
804 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT: Non-existing
805 * port number
806 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT: Undefined port
807 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT: Internal
808 * hardware fault
809 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON:
810 * Communication error after force on
811 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS: Unknown
812 * port status
813 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF: Host
814 * crash turn off
815 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN:
816 * Host crash force shutdown
817 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE: Configuration
818 * change
819 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP: Over
820 * temperature detected
821 *
822 * error_condition is a variable indicating the status of
823 * implementation-specific fault conditions or optionally other system faults
824 * that prevent the PSE from meeting the specifications in Table 33–11 and that
825 * require the PSE not to source power. These error conditions are different
826 * from those monitored by the state diagrams in Figure 33–10.
827 */
828enum ethtool_c33_pse_ext_substate_error_condition {
829 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1,
830 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT,
831 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT,
832 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON,
833 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS,
834 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF,
835 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN,
836 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE,
837 ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP,
838};
839
840/**
841 * enum ethtool_c33_pse_ext_substate_mr_pse_enable - mr_pse_enable states
842 * functions. IEEE 802.3-2022 33.2.4.4 Variables
843 *
844 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE: Disable
845 * pin active
846 *
847 * mr_pse_enable is control variable that selects PSE operation and test
848 * functions.
849 */
850enum ethtool_c33_pse_ext_substate_mr_pse_enable {
851 ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1,
852};
853
854/**
855 * enum ethtool_c33_pse_ext_substate_option_detect_ted - option_detect_ted
856 * states functions. IEEE 802.3-2022 33.2.4.4 Variables
857 *
858 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS: Detection
859 * in process
860 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR:
861 * Connection check error
862 *
863 * option_detect_ted is a variable indicating if detection can be performed
864 * by the PSE during the ted_timer interval.
865 */
866enum ethtool_c33_pse_ext_substate_option_detect_ted {
867 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1,
868 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR,
869};
870
871/**
872 * enum ethtool_c33_pse_ext_substate_option_vport_lim - option_vport_lim states
873 * functions. IEEE 802.3-2022 33.2.4.4 Variables
874 *
875 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE: Main supply
876 * voltage is high
877 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE: Main supply
878 * voltage is low
879 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION: Voltage
880 * injection into the port
881 *
882 * option_vport_lim is an optional variable indicates if VPSE is out of the
883 * operating range during normal operating state.
884 */
885enum ethtool_c33_pse_ext_substate_option_vport_lim {
886 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1,
887 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE,
888 ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION,
889};
890
891/**
892 * enum ethtool_c33_pse_ext_substate_ovld_detected - ovld_detected states
893 * functions. IEEE 802.3-2022 33.2.4.4 Variables
894 *
895 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD: Overload state
896 *
897 * ovld_detected is a variable indicating if the PSE output current has been
898 * in an overload condition (see 33.2.7.6) for at least TCUT of a one-second
899 * sliding time.
900 */
901enum ethtool_c33_pse_ext_substate_ovld_detected {
902 ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1,
903};
904
905/**
906 * enum ethtool_c33_pse_ext_substate_power_not_available - power_not_available
907 * states functions. IEEE 802.3-2022 33.2.4.4 Variables
908 *
909 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED: Power
910 * budget exceeded for the controller
911 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET:
912 * Configured port power limit exceeded controller power budget
913 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT:
914 * Power request from PD exceeds port limit
915 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT: Power
916 * denied due to Hardware power limit
917 *
918 * power_not_available is a variable that is asserted in an
919 * implementation-dependent manner when the PSE is no longer capable of
920 * sourcing sufficient power to support the attached PD. Sufficient power
921 * is defined by classification; see 33.2.6.
922 */
923enum ethtool_c33_pse_ext_substate_power_not_available {
924 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1,
925 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET,
926 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT,
927 ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT,
928};
929
930/**
931 * enum ethtool_c33_pse_ext_substate_short_detected - short_detected states
932 * functions. IEEE 802.3-2022 33.2.4.4 Variables
933 *
934 * @ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION: Short
935 * condition was detected
936 *
937 * short_detected is a variable indicating if the PSE output current has been
938 * in a short circuit condition for TLIM within a sliding window (see 33.2.7.7).
939 */
940enum ethtool_c33_pse_ext_substate_short_detected {
941 ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1,
942};
943
753/**944/**
754 * enum ethtool_pse_types - Types of PSE controller.945 * enum ethtool_pse_types - Types of PSE controller.
755 * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown946 * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown
...@@ -875,6 +1066,24 @@ enum ethtool_mm_verify_status {...@@ -875,6 +1066,24 @@ enum ethtool_mm_verify_status {
875 ETHTOOL_MM_VERIFY_STATUS_DISABLED,1066 ETHTOOL_MM_VERIFY_STATUS_DISABLED,
876};1067};
8771068
1069/**
1070 * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status
1071 * @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has
1072 * started.
1073 * @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process
1074 * is in progress.
1075 * @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was
1076 * completed successfully.
1077 * @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was
1078 * stopped due to an error.
1079 */
1080enum ethtool_module_fw_flash_status {
1081 ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1,
1082 ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS,
1083 ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED,
1084 ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR,
1085};
1086
878/**1087/**
879 * struct ethtool_gstrings - string set for data tagging1088 * struct ethtool_gstrings - string set for data tagging
880 * @cmd: Command number = %ETHTOOL_GSTRINGS1089 * @cmd: Command number = %ETHTOOL_GSTRINGS
...@@ -1843,6 +2052,7 @@ enum ethtool_link_mode_bit_indices {...@@ -1843,6 +2052,7 @@ enum ethtool_link_mode_bit_indices {
1843 ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99,2052 ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99,
1844 ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,2053 ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,
1845 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,2054 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,
2055 ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102,
18462056
1847 /* must be last entry */2057 /* must be last entry */
1848 __ETHTOOL_LINK_MODE_MASK_NBITS2058 __ETHTOOL_LINK_MODE_MASK_NBITS
...@@ -2314,6 +2524,11 @@ struct ethtool_link_settings {...@@ -2314,6 +2524,11 @@ struct ethtool_link_settings {
2314 __u8 master_slave_state;2524 __u8 master_slave_state;
2315 __u8 rate_matching;2525 __u8 rate_matching;
2316 __u32 reserved[7];2526 __u32 reserved[7];
2527 /* Linux builds with -Wflex-array-member-not-at-end but does
2528 * not use the "link_mode_masks" member. Leave it defined for
2529 * userspace for now, and when userspace wants to start using
2530 * -Wfamnae, we'll need a new solution.
2531 */
2317 __u32 link_mode_masks[];2532 __u32 link_mode_masks[];
2318 /* layout of link_mode_masks fields:2533 /* layout of link_mode_masks fields:
2319 * __u32 map_supported[link_mode_masks_nwords];2534 * __u32 map_supported[link_mode_masks_nwords];
...@@ -2321,4 +2536,20 @@ struct ethtool_link_settings {...@@ -2321,4 +2536,20 @@ struct ethtool_link_settings {
2321 * __u32 map_lp_advertising[link_mode_masks_nwords];2536 * __u32 map_lp_advertising[link_mode_masks_nwords];
2322 */2537 */
2323};2538};
2539
2540/**
2541 * enum phy_upstream - Represents the upstream component a given PHY device
2542 * is connected to, as in what is on the other end of the MII bus. Most PHYs
2543 * will be attached to an Ethernet MAC controller, but in some cases, there's
2544 * an intermediate PHY used as a media-converter, which will driver another
2545 * MII interface as its output.
2546 * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port,
2547 * or ethernet controller)
2548 * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter)
2549 */
2550enum phy_upstream {
2551 PHY_UPSTREAM_MAC,
2552 PHY_UPSTREAM_PHY,
2553};
2554
2324#endif /* _LINUX_ETHTOOL_H */2555#endif /* _LINUX_ETHTOOL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ethtool_netlink.h+89
...@@ -57,6 +57,8 @@ enum {...@@ -57,6 +57,8 @@ enum {
57 ETHTOOL_MSG_PLCA_GET_STATUS,57 ETHTOOL_MSG_PLCA_GET_STATUS,
58 ETHTOOL_MSG_MM_GET,58 ETHTOOL_MSG_MM_GET,
59 ETHTOOL_MSG_MM_SET,59 ETHTOOL_MSG_MM_SET,
60 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,
61 ETHTOOL_MSG_PHY_GET,
6062
61 /* add new constants above here */63 /* add new constants above here */
62 __ETHTOOL_MSG_USER_CNT,64 __ETHTOOL_MSG_USER_CNT,
...@@ -109,6 +111,9 @@ enum {...@@ -109,6 +111,9 @@ enum {
109 ETHTOOL_MSG_PLCA_NTF,111 ETHTOOL_MSG_PLCA_NTF,
110 ETHTOOL_MSG_MM_GET_REPLY,112 ETHTOOL_MSG_MM_GET_REPLY,
111 ETHTOOL_MSG_MM_NTF,113 ETHTOOL_MSG_MM_NTF,
114 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,
115 ETHTOOL_MSG_PHY_GET_REPLY,
116 ETHTOOL_MSG_PHY_NTF,
112117
113 /* add new constants above here */118 /* add new constants above here */
114 __ETHTOOL_MSG_KERNEL_CNT,119 __ETHTOOL_MSG_KERNEL_CNT,
...@@ -132,6 +137,7 @@ enum {...@@ -132,6 +137,7 @@ enum {
132 ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */137 ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */
133 ETHTOOL_A_HEADER_DEV_NAME, /* string */138 ETHTOOL_A_HEADER_DEV_NAME, /* string */
134 ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */139 ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */
140 ETHTOOL_A_HEADER_PHY_INDEX, /* u32 */
135141
136 /* add new constants above here */142 /* add new constants above here */
137 __ETHTOOL_A_HEADER_CNT,143 __ETHTOOL_A_HEADER_CNT,
...@@ -415,12 +421,34 @@ enum {...@@ -415,12 +421,34 @@ enum {
415 ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES, /* u32 */421 ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES, /* u32 */
416 ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES, /* u32 */422 ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES, /* u32 */
417 ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS, /* 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,
418428
419 /* add new constants above here */429 /* add new constants above here */
420 __ETHTOOL_A_COALESCE_CNT,430 __ETHTOOL_A_COALESCE_CNT,
421 ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)431 ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
422};432};
423433
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
424/* PAUSE */452/* PAUSE */
425453
426enum {454enum {
...@@ -532,6 +560,10 @@ enum {...@@ -532,6 +560,10 @@ enum {
532 * a regular 100 Ohm cable and a part with the abnormal impedance value560 * a regular 100 Ohm cable and a part with the abnormal impedance value
533 */561 */
534 ETHTOOL_A_CABLE_RESULT_CODE_IMPEDANCE_MISMATCH,562 ETHTOOL_A_CABLE_RESULT_CODE_IMPEDANCE_MISMATCH,
563 /* TDR not possible due to high noise level */
564 ETHTOOL_A_CABLE_RESULT_CODE_NOISE,
565 /* TDR resolution not possible / out of distance */
566 ETHTOOL_A_CABLE_RESULT_CODE_RESOLUTION_NOT_POSSIBLE,
535};567};
536568
537enum {569enum {
...@@ -541,10 +573,20 @@ enum {...@@ -541,10 +573,20 @@ enum {
541 ETHTOOL_A_CABLE_PAIR_D,573 ETHTOOL_A_CABLE_PAIR_D,
542};574};
543575
576/* Information source for specific results. */
577enum {
578 ETHTOOL_A_CABLE_INF_SRC_UNSPEC,
579 /* Results provided by the Time Domain Reflectometry (TDR) */
580 ETHTOOL_A_CABLE_INF_SRC_TDR,
581 /* Results provided by the Active Link Cable Diagnostic (ALCD) */
582 ETHTOOL_A_CABLE_INF_SRC_ALCD,
583};
584
544enum {585enum {
545 ETHTOOL_A_CABLE_RESULT_UNSPEC,586 ETHTOOL_A_CABLE_RESULT_UNSPEC,
546 ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */587 ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
547 ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */588 ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */
589 ETHTOOL_A_CABLE_RESULT_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
548590
549 __ETHTOOL_A_CABLE_RESULT_CNT,591 __ETHTOOL_A_CABLE_RESULT_CNT,
550 ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)592 ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
...@@ -554,6 +596,7 @@ enum {...@@ -554,6 +596,7 @@ enum {
554 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,596 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
555 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */597 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
556 ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */598 ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */
599 ETHTOOL_A_CABLE_FAULT_LENGTH_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
557600
558 __ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,601 __ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
559 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)602 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)
...@@ -906,6 +949,12 @@ enum {...@@ -906,6 +949,12 @@ enum {
906};949};
907950
908/* Power Sourcing Equipment */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
909enum {958enum {
910 ETHTOOL_A_PSE_UNSPEC,959 ETHTOOL_A_PSE_UNSPEC,
911 ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */960 ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */
...@@ -915,6 +964,12 @@ enum {...@@ -915,6 +964,12 @@ enum {
915 ETHTOOL_A_C33_PSE_ADMIN_STATE, /* u32 */964 ETHTOOL_A_C33_PSE_ADMIN_STATE, /* u32 */
916 ETHTOOL_A_C33_PSE_ADMIN_CONTROL, /* u32 */965 ETHTOOL_A_C33_PSE_ADMIN_CONTROL, /* u32 */
917 ETHTOOL_A_C33_PSE_PW_D_STATUS, /* 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_* */
918973
919 /* add new constants above here */974 /* add new constants above here */
920 __ETHTOOL_A_PSE_CNT,975 __ETHTOOL_A_PSE_CNT,
...@@ -929,6 +984,7 @@ enum {...@@ -929,6 +984,7 @@ enum {
929 ETHTOOL_A_RSS_INDIR, /* binary */984 ETHTOOL_A_RSS_INDIR, /* binary */
930 ETHTOOL_A_RSS_HKEY, /* binary */985 ETHTOOL_A_RSS_HKEY, /* binary */
931 ETHTOOL_A_RSS_INPUT_XFRM, /* u32 */986 ETHTOOL_A_RSS_INPUT_XFRM, /* u32 */
987 ETHTOOL_A_RSS_START_CONTEXT, /* u32 */
932988
933 __ETHTOOL_A_RSS_CNT,989 __ETHTOOL_A_RSS_CNT,
934 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),990 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
...@@ -996,6 +1052,39 @@ enum {...@@ -996,6 +1052,39 @@ enum {
996 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)1052 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
997};1053};
9981054
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
999/* generic netlink info */1088/* generic netlink info */
1000#define ETHTOOL_GENL_NAME "ethtool"1089#define ETHTOOL_GENL_NAME "ethtool"
1001#define ETHTOOL_GENL_VERSION 11090#define ETHTOOL_GENL_VERSION 1
lib/libc/include/any-linux-any/linux/exfat.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2024 Unisoc Technologies Co., Ltd.
4 */
5
6#ifndef _LINUX_EXFAT_H
7#define _LINUX_EXFAT_H
8#include <linux/types.h>
9#include <linux/ioctl.h>
10
11/*
12 * exfat-specific ioctl commands
13 */
14
15#define EXFAT_IOC_SHUTDOWN _IOR('X', 125, __u32)
16
17/*
18 * Flags used by EXFAT_IOC_SHUTDOWN
19 */
20
21#define EXFAT_GOING_DOWN_DEFAULT 0x0 /* default with full sync */
22#define EXFAT_GOING_DOWN_FULLSYNC 0x1 /* going down with full sync*/
23#define EXFAT_GOING_DOWN_NOSYNC 0x2 /* going down */
24
25#endif /* _LINUX_EXFAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/f2fs.h+1
...@@ -43,6 +43,7 @@...@@ -43,6 +43,7 @@
43#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)43#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)
44#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)44#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
45#define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25)45#define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25)
46#define F2FS_IOC_GET_DEV_ALIAS_FILE _IOR(F2FS_IOCTL_MAGIC, 26, __u32)
4647
47/*48/*
48 * should be same as XFS_IOC_GOINGDOWN.49 * should be same as XFS_IOC_GOINGDOWN.
lib/libc/include/any-linux-any/linux/falloc.h+1
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef _FALLOC_H_2#ifndef _FALLOC_H_
3#define _FALLOC_H_3#define _FALLOC_H_
44
5#define FALLOC_FL_ALLOCATE_RANGE 0x00 /* allocate range */
5#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */6#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
6#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */7#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
7#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */8#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
lib/libc/include/any-linux-any/linux/fanotify.h+1
...@@ -60,6 +60,7 @@...@@ -60,6 +60,7 @@
60#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */60#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */
61#define FAN_REPORT_NAME 0x00000800 /* Report events with name */61#define FAN_REPORT_NAME 0x00000800 /* Report events with name */
62#define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */62#define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */
63#define FAN_REPORT_FD_ERROR 0x00002000 /* event->fd can report error */
6364
64/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */65/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */
65#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)66#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)
lib/libc/include/any-linux-any/linux/fcntl.h+61-25
...@@ -16,6 +16,9 @@...@@ -16,6 +16,9 @@
1616
17#define F_DUPFD_QUERY (F_LINUX_SPECIFIC_BASE + 3)17#define F_DUPFD_QUERY (F_LINUX_SPECIFIC_BASE + 3)
1818
19/* Was the file just created? */
20#define F_CREATED_QUERY (F_LINUX_SPECIFIC_BASE + 4)
21
19/*22/*
20 * Cancel a blocking posix lock; internal use only until we expose an23 * Cancel a blocking posix lock; internal use only until we expose an
21 * asynchronous lock api to userspace:24 * asynchronous lock api to userspace:
...@@ -87,36 +90,69 @@...@@ -87,36 +90,69 @@
87#define DN_ATTRIB 0x00000020 /* File changed attibutes */90#define DN_ATTRIB 0x00000020 /* File changed attibutes */
88#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */91#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
8992
93#define AT_FDCWD -100 /* Special value for dirfd used to
94 indicate openat should use the
95 current working directory. */
96
97
98/* Generic flags for the *at(2) family of syscalls. */
99
100/* Reserved for per-syscall flags 0xff. */
101#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic
102 links. */
103/* Reserved for per-syscall flags 0x200 */
104#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
105#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
106 traversal. */
107#define AT_EMPTY_PATH 0x1000 /* Allow empty relative
108 pathname to operate on dirfd
109 directly. */
90/*110/*
91 * The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EACCESS is111 * These flags are currently statx(2)-specific, but they could be made generic
92 * meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to112 * in the future and so they should not be used for other per-syscall flags.
93 * unlinkat. The two functions do completely different things and therefore,
94 * the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to
95 * faccessat would be undefined behavior and thus treating it equivalent to
96 * AT_EACCESS is valid undefined behavior.
97 */113 */
98#define AT_FDCWD -100 /* Special value used to indicate114#define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */
99 openat should use the current115#define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */
100 working directory. */116#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
101#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */117#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
118
119#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
120
121/*
122 * Per-syscall flags for the *at(2) family of syscalls.
123 *
124 * These are flags that are so syscall-specific that a user passing these flags
125 * to the wrong syscall is so "clearly wrong" that we can safely call such
126 * usage "undefined behaviour".
127 *
128 * For example, the constants AT_REMOVEDIR and AT_EACCESS have the same value.
129 * AT_EACCESS is meaningful only to faccessat, while AT_REMOVEDIR is meaningful
130 * only to unlinkat. The two functions do completely different things and
131 * therefore, the flags can be allowed to overlap. For example, passing
132 * AT_REMOVEDIR to faccessat would be undefined behavior and thus treating it
133 * equivalent to AT_EACCESS is valid undefined behavior.
134 *
135 * Note for implementers: When picking a new per-syscall AT_* flag, try to
136 * reuse already existing flags first. This leaves us with as many unused bits
137 * as possible, so we can use them for generic bits in the future if necessary.
138 */
139
140/* Flags for renameat2(2) (must match legacy RENAME_* flags). */
141#define AT_RENAME_NOREPLACE 0x0001
142#define AT_RENAME_EXCHANGE 0x0002
143#define AT_RENAME_WHITEOUT 0x0004
144
145/* Flag for faccessat(2). */
102#define AT_EACCESS 0x200 /* Test access permitted for146#define AT_EACCESS 0x200 /* Test access permitted for
103 effective IDs, not real IDs. */147 effective IDs, not real IDs. */
148/* Flag for unlinkat(2). */
104#define AT_REMOVEDIR 0x200 /* Remove directory instead of149#define AT_REMOVEDIR 0x200 /* Remove directory instead of
105 unlinking file. */150 unlinking file. */
106#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */151/* Flags for name_to_handle_at(2). */
107#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */152#define AT_HANDLE_FID 0x200 /* File handle is needed to compare
108#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */153 object identity and may not be
109154 usable with open_by_handle_at(2). */
110#define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */155#define AT_HANDLE_MNT_ID_UNIQUE 0x001 /* Return the u64 unique mount ID. */
111#define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */156#define AT_HANDLE_CONNECTABLE 0x002 /* Request a connectable file handle */
112#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
113#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
114
115#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
116
117/* Flags for name_to_handle_at(2). We reuse AT_ flag space to save bits... */
118#define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to
119 compare object identity and may not
120 be usable to open_by_handle_at(2) */
121157
122#endif /* _LINUX_FCNTL_H */158#endif /* _LINUX_FCNTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fib_rules.h+1
...@@ -67,6 +67,7 @@ enum {...@@ -67,6 +67,7 @@ enum {
67 FRA_IP_PROTO, /* ip proto */67 FRA_IP_PROTO, /* ip proto */
68 FRA_SPORT_RANGE, /* sport */68 FRA_SPORT_RANGE, /* sport */
69 FRA_DPORT_RANGE, /* dport */69 FRA_DPORT_RANGE, /* dport */
70 FRA_DSCP, /* dscp */
70 __FRA_MAX71 __FRA_MAX
71};72};
7273
lib/libc/include/any-linux-any/linux/fs.h+161-2
...@@ -325,12 +325,17 @@ typedef int __bitwise __kernel_rwf_t;...@@ -325,12 +325,17 @@ typedef int __bitwise __kernel_rwf_t;
325/* per-IO negation of O_APPEND */325/* per-IO negation of O_APPEND */
326#define RWF_NOAPPEND ((__kernel_rwf_t)0x00000020)326#define RWF_NOAPPEND ((__kernel_rwf_t)0x00000020)
327327
328/* Atomic Write */
329#define RWF_ATOMIC ((__kernel_rwf_t)0x00000040)
330
328/* mask of flags supported by the kernel */331/* mask of flags supported by the kernel */
329#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\332#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
330 RWF_APPEND | RWF_NOAPPEND)333 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC)
334
335#define PROCFS_IOCTL_MAGIC 'f'
331336
332/* Pagemap ioctl */337/* Pagemap ioctl */
333#define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg)338#define PAGEMAP_SCAN _IOWR(PROCFS_IOCTL_MAGIC, 16, struct pm_scan_arg)
334339
335/* Bitmasks provided in pm_scan_args masks and reported in page_region.categories. */340/* Bitmasks provided in pm_scan_args masks and reported in page_region.categories. */
336#define PAGE_IS_WPALLOWED (1 << 0)341#define PAGE_IS_WPALLOWED (1 << 0)
...@@ -389,4 +394,158 @@ struct pm_scan_arg {...@@ -389,4 +394,158 @@ struct pm_scan_arg {
389 __u64 return_mask;394 __u64 return_mask;
390};395};
391396
397/* /proc/<pid>/maps ioctl */
398#define PROCMAP_QUERY _IOWR(PROCFS_IOCTL_MAGIC, 17, struct procmap_query)
399
400enum procmap_query_flags {
401 /*
402 * VMA permission flags.
403 *
404 * Can be used as part of procmap_query.query_flags field to look up
405 * only VMAs satisfying specified subset of permissions. E.g., specifying
406 * PROCMAP_QUERY_VMA_READABLE only will return both readable and read/write VMAs,
407 * while having PROCMAP_QUERY_VMA_READABLE | PROCMAP_QUERY_VMA_WRITABLE will only
408 * return read/write VMAs, though both executable/non-executable and
409 * private/shared will be ignored.
410 *
411 * PROCMAP_QUERY_VMA_* flags are also returned in procmap_query.vma_flags
412 * field to specify actual VMA permissions.
413 */
414 PROCMAP_QUERY_VMA_READABLE = 0x01,
415 PROCMAP_QUERY_VMA_WRITABLE = 0x02,
416 PROCMAP_QUERY_VMA_EXECUTABLE = 0x04,
417 PROCMAP_QUERY_VMA_SHARED = 0x08,
418 /*
419 * Query modifier flags.
420 *
421 * By default VMA that covers provided address is returned, or -ENOENT
422 * is returned. With PROCMAP_QUERY_COVERING_OR_NEXT_VMA flag set, closest
423 * VMA with vma_start > addr will be returned if no covering VMA is
424 * found.
425 *
426 * PROCMAP_QUERY_FILE_BACKED_VMA instructs query to consider only VMAs that
427 * have file backing. Can be combined with PROCMAP_QUERY_COVERING_OR_NEXT_VMA
428 * to iterate all VMAs with file backing.
429 */
430 PROCMAP_QUERY_COVERING_OR_NEXT_VMA = 0x10,
431 PROCMAP_QUERY_FILE_BACKED_VMA = 0x20,
432};
433
434/*
435 * Input/output argument structured passed into ioctl() call. It can be used
436 * to query a set of VMAs (Virtual Memory Areas) of a process.
437 *
438 * Each field can be one of three kinds, marked in a short comment to the
439 * right of the field:
440 * - "in", input argument, user has to provide this value, kernel doesn't modify it;
441 * - "out", output argument, kernel sets this field with VMA data;
442 * - "in/out", input and output argument; user provides initial value (used
443 * to specify maximum allowable buffer size), and kernel sets it to actual
444 * amount of data written (or zero, if there is no data).
445 *
446 * If matching VMA is found (according to criterias specified by
447 * query_addr/query_flags, all the out fields are filled out, and ioctl()
448 * returns 0. If there is no matching VMA, -ENOENT will be returned.
449 * In case of any other error, negative error code other than -ENOENT is
450 * returned.
451 *
452 * Most of the data is similar to the one returned as text in /proc/<pid>/maps
453 * file, but procmap_query provides more querying flexibility. There are no
454 * consistency guarantees between subsequent ioctl() calls, but data returned
455 * for matched VMA is self-consistent.
456 */
457struct procmap_query {
458 /* Query struct size, for backwards/forward compatibility */
459 __u64 size;
460 /*
461 * Query flags, a combination of enum procmap_query_flags values.
462 * Defines query filtering and behavior, see enum procmap_query_flags.
463 *
464 * Input argument, provided by user. Kernel doesn't modify it.
465 */
466 __u64 query_flags; /* in */
467 /*
468 * Query address. By default, VMA that covers this address will
469 * be looked up. PROCMAP_QUERY_* flags above modify this default
470 * behavior further.
471 *
472 * Input argument, provided by user. Kernel doesn't modify it.
473 */
474 __u64 query_addr; /* in */
475 /* VMA starting (inclusive) and ending (exclusive) address, if VMA is found. */
476 __u64 vma_start; /* out */
477 __u64 vma_end; /* out */
478 /* VMA permissions flags. A combination of PROCMAP_QUERY_VMA_* flags. */
479 __u64 vma_flags; /* out */
480 /* VMA backing page size granularity. */
481 __u64 vma_page_size; /* out */
482 /*
483 * VMA file offset. If VMA has file backing, this specifies offset
484 * within the file that VMA's start address corresponds to.
485 * Is set to zero if VMA has no backing file.
486 */
487 __u64 vma_offset; /* out */
488 /* Backing file's inode number, or zero, if VMA has no backing file. */
489 __u64 inode; /* out */
490 /* Backing file's device major/minor number, or zero, if VMA has no backing file. */
491 __u32 dev_major; /* out */
492 __u32 dev_minor; /* out */
493 /*
494 * If set to non-zero value, signals the request to return VMA name
495 * (i.e., VMA's backing file's absolute path, with " (deleted)" suffix
496 * appended, if file was unlinked from FS) for matched VMA. VMA name
497 * can also be some special name (e.g., "[heap]", "[stack]") or could
498 * be even user-supplied with prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME).
499 *
500 * Kernel will set this field to zero, if VMA has no associated name.
501 * Otherwise kernel will return actual amount of bytes filled in
502 * user-supplied buffer (see vma_name_addr field below), including the
503 * terminating zero.
504 *
505 * If VMA name is longer that user-supplied maximum buffer size,
506 * -E2BIG error is returned.
507 *
508 * If this field is set to non-zero value, vma_name_addr should point
509 * to valid user space memory buffer of at least vma_name_size bytes.
510 * If set to zero, vma_name_addr should be set to zero as well
511 */
512 __u32 vma_name_size; /* in/out */
513 /*
514 * If set to non-zero value, signals the request to extract and return
515 * VMA's backing file's build ID, if the backing file is an ELF file
516 * and it contains embedded build ID.
517 *
518 * Kernel will set this field to zero, if VMA has no backing file,
519 * backing file is not an ELF file, or ELF file has no build ID
520 * embedded.
521 *
522 * Build ID is a binary value (not a string). Kernel will set
523 * build_id_size field to exact number of bytes used for build ID.
524 * If build ID is requested and present, but needs more bytes than
525 * user-supplied maximum buffer size (see build_id_addr field below),
526 * -E2BIG error will be returned.
527 *
528 * If this field is set to non-zero value, build_id_addr should point
529 * to valid user space memory buffer of at least build_id_size bytes.
530 * If set to zero, build_id_addr should be set to zero as well
531 */
532 __u32 build_id_size; /* in/out */
533 /*
534 * User-supplied address of a buffer of at least vma_name_size bytes
535 * for kernel to fill with matched VMA's name (see vma_name_size field
536 * description above for details).
537 *
538 * Should be set to zero if VMA name should not be returned.
539 */
540 __u64 vma_name_addr; /* in */
541 /*
542 * User-supplied address of a buffer of at least build_id_size bytes
543 * for kernel to fill with matched VMA's ELF build ID, if available
544 * (see build_id_size field description above for details).
545 *
546 * Should be set to zero if build ID should not be returned.
547 */
548 __u64 build_id_addr; /* in */
549};
550
392#endif /* _LINUX_FS_H */551#endif /* _LINUX_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fuse.h+21-1
...@@ -217,6 +217,9 @@...@@ -217,6 +217,9 @@
217 * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag217 * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag
218 * - add FUSE_NO_EXPORT_SUPPORT init flag218 * - add FUSE_NO_EXPORT_SUPPORT init flag
219 * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag219 * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag
220 *
221 * 7.41
222 * - add FUSE_ALLOW_IDMAP
220 */223 */
221224
222#ifndef _LINUX_FUSE_H225#ifndef _LINUX_FUSE_H
...@@ -248,7 +251,7 @@...@@ -248,7 +251,7 @@
248#define FUSE_KERNEL_VERSION 7251#define FUSE_KERNEL_VERSION 7
249252
250/** Minor version number of this interface */253/** Minor version number of this interface */
251#define FUSE_KERNEL_MINOR_VERSION 40254#define FUSE_KERNEL_MINOR_VERSION 41
252255
253/** The node ID of the root inode */256/** The node ID of the root inode */
254#define FUSE_ROOT_ID 1257#define FUSE_ROOT_ID 1
...@@ -417,6 +420,7 @@ struct fuse_file_lock {...@@ -417,6 +420,7 @@ struct fuse_file_lock {
417 * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support420 * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support
418 * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit421 * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit
419 * of the request ID indicates resend requests422 * of the request ID indicates resend requests
423 * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts
420 */424 */
421#define FUSE_ASYNC_READ (1 << 0)425#define FUSE_ASYNC_READ (1 << 0)
422#define FUSE_POSIX_LOCKS (1 << 1)426#define FUSE_POSIX_LOCKS (1 << 1)
...@@ -462,6 +466,7 @@ struct fuse_file_lock {...@@ -462,6 +466,7 @@ struct fuse_file_lock {
462466
463/* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */467/* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */
464#define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP468#define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP
469#define FUSE_ALLOW_IDMAP (1ULL << 40)
465470
466/**471/**
467 * CUSE INIT request/reply flags472 * CUSE INIT request/reply flags
...@@ -980,6 +985,21 @@ struct fuse_fallocate_in {...@@ -980,6 +985,21 @@ struct fuse_fallocate_in {
980 */985 */
981#define FUSE_UNIQUE_RESEND (1ULL << 63)986#define FUSE_UNIQUE_RESEND (1ULL << 63)
982987
988/**
989 * This value will be set by the kernel to
990 * (struct fuse_in_header).{uid,gid} fields in
991 * case when:
992 * - fuse daemon enabled FUSE_ALLOW_IDMAP
993 * - idmapping information is not available and uid/gid
994 * can not be mapped in accordance with an idmapping.
995 *
996 * Note: an idmapping information always available
997 * for inode creation operations like:
998 * FUSE_MKNOD, FUSE_SYMLINK, FUSE_MKDIR, FUSE_TMPFILE,
999 * FUSE_CREATE and FUSE_RENAME2 (with RENAME_WHITEOUT).
1000 */
1001#define FUSE_INVALID_UIDGID ((uint32_t)(-1))
1002
983struct fuse_in_header {1003struct fuse_in_header {
984 uint32_t len;1004 uint32_t len;
985 uint32_t opcode;1005 uint32_t opcode;
lib/libc/include/any-linux-any/linux/hidraw.h+1
...@@ -46,6 +46,7 @@ struct hidraw_devinfo {...@@ -46,6 +46,7 @@ struct hidraw_devinfo {
46/* The first byte of SOUTPUT and GOUTPUT is the report number */46/* The first byte of SOUTPUT and GOUTPUT is the report number */
47#define HIDIOCSOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0B, len)47#define HIDIOCSOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0B, len)
48#define HIDIOCGOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0C, len)48#define HIDIOCGOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0C, len)
49#define HIDIOCREVOKE _IOW('H', 0x0D, int) /* Revoke device access */
4950
50#define HIDRAW_FIRST_MINOR 051#define HIDRAW_FIRST_MINOR 0
51#define HIDRAW_MAX_DEVICES 6452#define HIDRAW_MAX_DEVICES 64
lib/libc/include/any-linux-any/linux/if_link.h+17
...@@ -377,6 +377,7 @@ enum {...@@ -377,6 +377,7 @@ enum {
377 IFLA_GSO_IPV4_MAX_SIZE,377 IFLA_GSO_IPV4_MAX_SIZE,
378 IFLA_GRO_IPV4_MAX_SIZE,378 IFLA_GRO_IPV4_MAX_SIZE,
379 IFLA_DPLL_PIN,379 IFLA_DPLL_PIN,
380 IFLA_MAX_PACING_OFFLOAD_HORIZON,
380 __IFLA_MAX381 __IFLA_MAX
381};382};
382383
...@@ -1290,6 +1291,19 @@ enum netkit_mode {...@@ -1290,6 +1291,19 @@ enum netkit_mode {
1290 NETKIT_L3,1291 NETKIT_L3,
1291};1292};
12921293
1294/* NETKIT_SCRUB_NONE leaves clearing skb->{mark,priority} up to
1295 * the BPF program if attached. This also means the latter can
1296 * consume the two fields if they were populated earlier.
1297 *
1298 * NETKIT_SCRUB_DEFAULT zeroes skb->{mark,priority} fields before
1299 * invoking the attached BPF program when the peer device resides
1300 * in a different network namespace. This is the default behavior.
1301 */
1302enum netkit_scrub {
1303 NETKIT_SCRUB_NONE,
1304 NETKIT_SCRUB_DEFAULT,
1305};
1306
1293enum {1307enum {
1294 IFLA_NETKIT_UNSPEC,1308 IFLA_NETKIT_UNSPEC,
1295 IFLA_NETKIT_PEER_INFO,1309 IFLA_NETKIT_PEER_INFO,
...@@ -1297,6 +1311,8 @@ enum {...@@ -1297,6 +1311,8 @@ enum {
1297 IFLA_NETKIT_POLICY,1311 IFLA_NETKIT_POLICY,
1298 IFLA_NETKIT_PEER_POLICY,1312 IFLA_NETKIT_PEER_POLICY,
1299 IFLA_NETKIT_MODE,1313 IFLA_NETKIT_MODE,
1314 IFLA_NETKIT_SCRUB,
1315 IFLA_NETKIT_PEER_SCRUB,
1300 __IFLA_NETKIT_MAX,1316 __IFLA_NETKIT_MAX,
1301};1317};
1302#define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)1318#define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)
...@@ -1940,6 +1956,7 @@ struct ifla_rmnet_flags {...@@ -1940,6 +1956,7 @@ struct ifla_rmnet_flags {
1940enum {1956enum {
1941 IFLA_MCTP_UNSPEC,1957 IFLA_MCTP_UNSPEC,
1942 IFLA_MCTP_NET,1958 IFLA_MCTP_NET,
1959 IFLA_MCTP_PHYS_BINDING,
1943 __IFLA_MCTP_MAX,1960 __IFLA_MCTP_MAX,
1944};1961};
19451962
lib/libc/include/any-linux-any/linux/if_packet.h+4-3
...@@ -230,8 +230,8 @@ struct tpacket_hdr_v1 {...@@ -230,8 +230,8 @@ struct tpacket_hdr_v1 {
230 * ts_first_pkt:230 * ts_first_pkt:
231 * Is always the time-stamp when the block was opened.231 * Is always the time-stamp when the block was opened.
232 * Case a) ZERO packets232 * Case a) ZERO packets
233 * No packets to deal with but atleast you know the233 * No packets to deal with but at least you know
234 * time-interval of this block.234 * the time-interval of this block.
235 * Case b) Non-zero packets235 * Case b) Non-zero packets
236 * Use the ts of the first packet in the block.236 * Use the ts of the first packet in the block.
237 *237 *
...@@ -265,7 +265,8 @@ enum tpacket_versions {...@@ -265,7 +265,8 @@ enum tpacket_versions {
265 - struct tpacket_hdr265 - struct tpacket_hdr
266 - pad to TPACKET_ALIGNMENT=16266 - pad to TPACKET_ALIGNMENT=16
267 - struct sockaddr_ll267 - struct sockaddr_ll
268 - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16268 - Gap, chosen so that packet data (Start+tp_net) aligns to
269 TPACKET_ALIGNMENT=16
269 - Start+tp_mac: [ Optional MAC header ]270 - Start+tp_mac: [ Optional MAC header ]
270 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.271 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
271 - Pad to align to TPACKET_ALIGNMENT=16272 - Pad to align to TPACKET_ALIGNMENT=16
lib/libc/include/any-linux-any/linux/if_xdp.h+4
...@@ -41,6 +41,10 @@...@@ -41,6 +41,10 @@
41 */41 */
42#define XDP_UMEM_TX_SW_CSUM (1 << 1)42#define XDP_UMEM_TX_SW_CSUM (1 << 1)
4343
44/* Request to reserve tx_metadata_len bytes of per-chunk metadata.
45 */
46#define XDP_UMEM_TX_METADATA_LEN (1 << 2)
47
44struct sockaddr_xdp {48struct sockaddr_xdp {
45 __u16 sxdp_family;49 __u16 sxdp_family;
46 __u16 sxdp_flags;50 __u16 sxdp_flags;
lib/libc/include/any-linux-any/linux/iio/buffer.h+22
...@@ -5,6 +5,28 @@...@@ -5,6 +5,28 @@
5#ifndef _IIO_BUFFER_H_5#ifndef _IIO_BUFFER_H_
6#define _IIO_BUFFER_H_6#define _IIO_BUFFER_H_
77
8#include <linux/types.h>
9
10/* Flags for iio_dmabuf.flags */
11#define IIO_BUFFER_DMABUF_CYCLIC (1 << 0)
12#define IIO_BUFFER_DMABUF_SUPPORTED_FLAGS 0x00000001
13
14/**
15 * struct iio_dmabuf - Descriptor for a single IIO DMABUF object
16 * @fd: file descriptor of the DMABUF object
17 * @flags: one or more IIO_BUFFER_DMABUF_* flags
18 * @bytes_used: number of bytes used in this DMABUF for the data transfer.
19 * Should generally be set to the DMABUF's size.
20 */
21struct iio_dmabuf {
22 __u32 fd;
23 __u32 flags;
24 __u64 bytes_used;
25};
26
8#define IIO_BUFFER_GET_FD_IOCTL _IOWR('i', 0x91, int)27#define IIO_BUFFER_GET_FD_IOCTL _IOWR('i', 0x91, int)
28#define IIO_BUFFER_DMABUF_ATTACH_IOCTL _IOW('i', 0x92, int)
29#define IIO_BUFFER_DMABUF_DETACH_IOCTL _IOW('i', 0x93, int)
30#define IIO_BUFFER_DMABUF_ENQUEUE_IOCTL _IOW('i', 0x94, struct iio_dmabuf)
931
10#endif /* _IIO_BUFFER_H_ */32#endif /* _IIO_BUFFER_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iio/types.h+1
...@@ -51,6 +51,7 @@ enum iio_chan_type {...@@ -51,6 +51,7 @@ enum iio_chan_type {
51 IIO_DELTA_VELOCITY,51 IIO_DELTA_VELOCITY,
52 IIO_COLORTEMP,52 IIO_COLORTEMP,
53 IIO_CHROMATICITY,53 IIO_CHROMATICITY,
54 IIO_ATTENTION,
54};55};
5556
56enum iio_modifier {57enum iio_modifier {
lib/libc/include/any-linux-any/linux/in.h+3-1
...@@ -81,6 +81,8 @@ enum {...@@ -81,6 +81,8 @@ enum {
81#define IPPROTO_ETHERNET IPPROTO_ETHERNET81#define IPPROTO_ETHERNET IPPROTO_ETHERNET
82 IPPROTO_RAW = 255, /* Raw IP packets */82 IPPROTO_RAW = 255, /* Raw IP packets */
83#define IPPROTO_RAW IPPROTO_RAW83#define IPPROTO_RAW IPPROTO_RAW
84 IPPROTO_SMC = 256, /* Shared Memory Communications */
85#define IPPROTO_SMC IPPROTO_SMC
84 IPPROTO_MPTCP = 262, /* Multipath TCP connection */86 IPPROTO_MPTCP = 262, /* Multipath TCP connection */
85#define IPPROTO_MPTCP IPPROTO_MPTCP87#define IPPROTO_MPTCP IPPROTO_MPTCP
86 IPPROTO_MAX88 IPPROTO_MAX
...@@ -139,7 +141,7 @@ struct in_addr {...@@ -139,7 +141,7 @@ struct in_addr {
139 */141 */
140#define IP_PMTUDISC_INTERFACE 4142#define IP_PMTUDISC_INTERFACE 4
141/* weaker version of IP_PMTUDISC_INTERFACE, which allows packets to get143/* weaker version of IP_PMTUDISC_INTERFACE, which allows packets to get
142 * fragmented if they exeed the interface mtu144 * fragmented if they exceed the interface mtu
143 */145 */
144#define IP_PMTUDISC_OMIT 5146#define IP_PMTUDISC_OMIT 5
145147
lib/libc/include/any-linux-any/linux/inet_diag.h+1-1
...@@ -143,7 +143,7 @@ enum {...@@ -143,7 +143,7 @@ enum {
143 INET_DIAG_SHUTDOWN,143 INET_DIAG_SHUTDOWN,
144144
145 /*145 /*
146 * Next extenstions cannot be requested in struct inet_diag_req_v2:146 * Next extensions cannot be requested in struct inet_diag_req_v2:
147 * its field idiag_ext has only 8 bits.147 * its field idiag_ext has only 8 bits.
148 */148 */
149149
lib/libc/include/any-linux-any/linux/input-event-codes.h+1
...@@ -519,6 +519,7 @@...@@ -519,6 +519,7 @@
519#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */519#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
520#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */520#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */
521#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */521#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */
522#define KEY_LINK_PHONE 0x1bf /* AL Phone Syncing */
522523
523#define KEY_DEL_EOL 0x1c0524#define KEY_DEL_EOL 0x1c0
524#define KEY_DEL_EOS 0x1c1525#define KEY_DEL_EOS 0x1c1
lib/libc/include/any-linux-any/linux/io_uring.h+143-4
...@@ -200,6 +200,9 @@ enum io_uring_sqe_flags_bit {...@@ -200,6 +200,9 @@ enum io_uring_sqe_flags_bit {
200 */200 */
201#define IORING_SETUP_NO_SQARRAY (1U << 16)201#define IORING_SETUP_NO_SQARRAY (1U << 16)
202202
203/* Use hybrid poll in iopoll process */
204#define IORING_SETUP_HYBRID_IOPOLL (1U << 17)
205
203enum io_uring_op {206enum io_uring_op {
204 IORING_OP_NOP,207 IORING_OP_NOP,
205 IORING_OP_READV,208 IORING_OP_READV,
...@@ -257,6 +260,8 @@ enum io_uring_op {...@@ -257,6 +260,8 @@ enum io_uring_op {
257 IORING_OP_FUTEX_WAITV,260 IORING_OP_FUTEX_WAITV,
258 IORING_OP_FIXED_FD_INSTALL,261 IORING_OP_FIXED_FD_INSTALL,
259 IORING_OP_FTRUNCATE,262 IORING_OP_FTRUNCATE,
263 IORING_OP_BIND,
264 IORING_OP_LISTEN,
260265
261 /* this goes last, obviously */266 /* this goes last, obviously */
262 IORING_OP_LAST,267 IORING_OP_LAST,
...@@ -414,12 +419,15 @@ enum io_uring_msg_ring_flags {...@@ -414,12 +419,15 @@ enum io_uring_msg_ring_flags {
414 * IORING_NOP_INJECT_RESULT Inject result from sqe->result419 * IORING_NOP_INJECT_RESULT Inject result from sqe->result
415 */420 */
416#define IORING_NOP_INJECT_RESULT (1U << 0)421#define IORING_NOP_INJECT_RESULT (1U << 0)
422#define IORING_NOP_FILE (1U << 1)
423#define IORING_NOP_FIXED_FILE (1U << 2)
424#define IORING_NOP_FIXED_BUFFER (1U << 3)
417425
418/*426/*
419 * IO completion data structure (Completion Queue Entry)427 * IO completion data structure (Completion Queue Entry)
420 */428 */
421struct io_uring_cqe {429struct io_uring_cqe {
422 __u64 user_data; /* sqe->data submission passed back */430 __u64 user_data; /* sqe->user_data value passed back */
423 __s32 res; /* result code for this event */431 __s32 res; /* result code for this event */
424 __u32 flags;432 __u32 flags;
425433
...@@ -438,11 +446,21 @@ struct io_uring_cqe {...@@ -438,11 +446,21 @@ struct io_uring_cqe {
438 * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv446 * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv
439 * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct447 * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct
440 * them from sends.448 * them from sends.
449 * IORING_CQE_F_BUF_MORE If set, the buffer ID set in the completion will get
450 * more completions. In other words, the buffer is being
451 * partially consumed, and will be used by the kernel for
452 * more completions. This is only set for buffers used via
453 * the incremental buffer consumption, as provided by
454 * a ring buffer setup with IOU_PBUF_RING_INC. For any
455 * other provided buffer type, all completions with a
456 * buffer passed back is automatically returned to the
457 * application.
441 */458 */
442#define IORING_CQE_F_BUFFER (1U << 0)459#define IORING_CQE_F_BUFFER (1U << 0)
443#define IORING_CQE_F_MORE (1U << 1)460#define IORING_CQE_F_MORE (1U << 1)
444#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)461#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
445#define IORING_CQE_F_NOTIF (1U << 3)462#define IORING_CQE_F_NOTIF (1U << 3)
463#define IORING_CQE_F_BUF_MORE (1U << 4)
446464
447#define IORING_CQE_BUFFER_SHIFT 16465#define IORING_CQE_BUFFER_SHIFT 16
448466
...@@ -505,6 +523,8 @@ struct io_cqring_offsets {...@@ -505,6 +523,8 @@ struct io_cqring_offsets {
505#define IORING_ENTER_SQ_WAIT (1U << 2)523#define IORING_ENTER_SQ_WAIT (1U << 2)
506#define IORING_ENTER_EXT_ARG (1U << 3)524#define IORING_ENTER_EXT_ARG (1U << 3)
507#define IORING_ENTER_REGISTERED_RING (1U << 4)525#define IORING_ENTER_REGISTERED_RING (1U << 4)
526#define IORING_ENTER_ABS_TIMER (1U << 5)
527#define IORING_ENTER_EXT_ARG_REG (1U << 6)
508528
509/*529/*
510 * Passed in for io_uring_setup(2). Copied back with updated info on success530 * Passed in for io_uring_setup(2). Copied back with updated info on success
...@@ -540,6 +560,7 @@ struct io_uring_params {...@@ -540,6 +560,7 @@ struct io_uring_params {
540#define IORING_FEAT_LINKED_FILE (1U << 12)560#define IORING_FEAT_LINKED_FILE (1U << 12)
541#define IORING_FEAT_REG_REG_RING (1U << 13)561#define IORING_FEAT_REG_REG_RING (1U << 13)
542#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)562#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
563#define IORING_FEAT_MIN_TIMEOUT (1U << 15)
543564
544/*565/*
545 * io_uring_register(2) opcodes and arguments566 * io_uring_register(2) opcodes and arguments
...@@ -593,6 +614,21 @@ enum io_uring_register_op {...@@ -593,6 +614,21 @@ enum io_uring_register_op {
593 IORING_REGISTER_NAPI = 27,614 IORING_REGISTER_NAPI = 27,
594 IORING_UNREGISTER_NAPI = 28,615 IORING_UNREGISTER_NAPI = 28,
595616
617 IORING_REGISTER_CLOCK = 29,
618
619 /* clone registered buffers from source ring to current ring */
620 IORING_REGISTER_CLONE_BUFFERS = 30,
621
622 /* send MSG_RING without having a ring */
623 IORING_REGISTER_SEND_MSG_RING = 31,
624
625 /* 32 reserved for zc rx */
626
627 /* resize CQ ring */
628 IORING_REGISTER_RESIZE_RINGS = 33,
629
630 IORING_REGISTER_MEM_REGION = 34,
631
596 /* this goes last */632 /* this goes last */
597 IORING_REGISTER_LAST,633 IORING_REGISTER_LAST,
598634
...@@ -613,6 +649,31 @@ struct io_uring_files_update {...@@ -613,6 +649,31 @@ struct io_uring_files_update {
613 __aligned_u64 /* __s32 * */ fds;649 __aligned_u64 /* __s32 * */ fds;
614};650};
615651
652enum {
653 /* initialise with user provided memory pointed by user_addr */
654 IORING_MEM_REGION_TYPE_USER = 1,
655};
656
657struct io_uring_region_desc {
658 __u64 user_addr;
659 __u64 size;
660 __u32 flags;
661 __u32 id;
662 __u64 mmap_offset;
663 __u64 __resv[4];
664};
665
666enum {
667 /* expose the region as registered wait arguments */
668 IORING_MEM_REGION_REG_WAIT_ARG = 1,
669};
670
671struct io_uring_mem_region_reg {
672 __u64 region_uptr; /* struct io_uring_region_desc * */
673 __u64 flags;
674 __u64 __resv[2];
675};
676
616/*677/*
617 * Register a fully sparse file space, rather than pass in an array of all678 * Register a fully sparse file space, rather than pass in an array of all
618 * -1 file descriptors.679 * -1 file descriptors.
...@@ -673,6 +734,25 @@ struct io_uring_restriction {...@@ -673,6 +734,25 @@ struct io_uring_restriction {
673 __u32 resv2[3];734 __u32 resv2[3];
674};735};
675736
737struct io_uring_clock_register {
738 __u32 clockid;
739 __u32 __resv[3];
740};
741
742enum {
743 IORING_REGISTER_SRC_REGISTERED = (1U << 0),
744 IORING_REGISTER_DST_REPLACE = (1U << 1),
745};
746
747struct io_uring_clone_buffers {
748 __u32 src_fd;
749 __u32 flags;
750 __u32 src_off;
751 __u32 dst_off;
752 __u32 nr;
753 __u32 pad[3];
754};
755
676struct io_uring_buf {756struct io_uring_buf {
677 __u64 addr;757 __u64 addr;
678 __u32 len;758 __u32 len;
...@@ -705,9 +785,17 @@ struct io_uring_buf_ring {...@@ -705,9 +785,17 @@ struct io_uring_buf_ring {
705 * mmap(2) with the offset set as:785 * mmap(2) with the offset set as:
706 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT)786 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT)
707 * to get a virtual mapping for the ring.787 * to get a virtual mapping for the ring.
788 * IOU_PBUF_RING_INC: If set, buffers consumed from this buffer ring can be
789 * consumed incrementally. Normally one (or more) buffers
790 * are fully consumed. With incremental consumptions, it's
791 * feasible to register big ranges of buffers, and each
792 * use of it will consume only as much as it needs. This
793 * requires that both the kernel and application keep
794 * track of where the current read/recv index is at.
708 */795 */
709enum io_uring_register_pbuf_ring_flags {796enum io_uring_register_pbuf_ring_flags {
710 IOU_PBUF_RING_MMAP = 1,797 IOU_PBUF_RING_MMAP = 1,
798 IOU_PBUF_RING_INC = 2,
711};799};
712800
713/* argument for IORING_(UN)REGISTER_PBUF_RING */801/* argument for IORING_(UN)REGISTER_PBUF_RING */
...@@ -726,12 +814,40 @@ struct io_uring_buf_status {...@@ -726,12 +814,40 @@ struct io_uring_buf_status {
726 __u32 resv[8];814 __u32 resv[8];
727};815};
728816
817enum io_uring_napi_op {
818 /* register/ungister backward compatible opcode */
819 IO_URING_NAPI_REGISTER_OP = 0,
820
821 /* opcodes to update napi_list when static tracking is used */
822 IO_URING_NAPI_STATIC_ADD_ID = 1,
823 IO_URING_NAPI_STATIC_DEL_ID = 2
824};
825
826enum io_uring_napi_tracking_strategy {
827 /* value must be 0 for backward compatibility */
828 IO_URING_NAPI_TRACKING_DYNAMIC = 0,
829 IO_URING_NAPI_TRACKING_STATIC = 1,
830 IO_URING_NAPI_TRACKING_INACTIVE = 255
831};
832
729/* argument for IORING_(UN)REGISTER_NAPI */833/* argument for IORING_(UN)REGISTER_NAPI */
730struct io_uring_napi {834struct io_uring_napi {
731 __u32 busy_poll_to;835 __u32 busy_poll_to;
732 __u8 prefer_busy_poll;836 __u8 prefer_busy_poll;
733 __u8 pad[3];837
734 __u64 resv;838 /* a io_uring_napi_op value */
839 __u8 opcode;
840 __u8 pad[2];
841
842 /*
843 * for IO_URING_NAPI_REGISTER_OP, it is a
844 * io_uring_napi_tracking_strategy value.
845 *
846 * for IO_URING_NAPI_STATIC_ADD_ID/IO_URING_NAPI_STATIC_DEL_ID
847 * it is the napi id to add/del from napi_list.
848 */
849 __u32 op_param;
850 __u32 resv;
735};851};
736852
737/*853/*
...@@ -753,10 +869,33 @@ enum io_uring_register_restriction_op {...@@ -753,10 +869,33 @@ enum io_uring_register_restriction_op {
753 IORING_RESTRICTION_LAST869 IORING_RESTRICTION_LAST
754};870};
755871
872enum {
873 IORING_REG_WAIT_TS = (1U << 0),
874};
875
876/*
877 * Argument for io_uring_enter(2) with
878 * IORING_GETEVENTS | IORING_ENTER_EXT_ARG_REG set, where the actual argument
879 * is an index into a previously registered fixed wait region described by
880 * the below structure.
881 */
882struct io_uring_reg_wait {
883 struct __kernel_timespec ts;
884 __u32 min_wait_usec;
885 __u32 flags;
886 __u64 sigmask;
887 __u32 sigmask_sz;
888 __u32 pad[3];
889 __u64 pad2[2];
890};
891
892/*
893 * Argument for io_uring_enter(2) with IORING_GETEVENTS | IORING_ENTER_EXT_ARG
894 */
756struct io_uring_getevents_arg {895struct io_uring_getevents_arg {
757 __u64 sigmask;896 __u64 sigmask;
758 __u32 sigmask_sz;897 __u32 sigmask_sz;
759 __u32 pad;898 __u32 min_wait_usec;
760 __u64 ts;899 __u64 ts;
761};900};
762901
lib/libc/include/any-linux-any/linux/ioam6_iptunnel.h+6
...@@ -50,6 +50,12 @@ enum {...@@ -50,6 +50,12 @@ enum {
50 IOAM6_IPTUNNEL_FREQ_K, /* u32 */50 IOAM6_IPTUNNEL_FREQ_K, /* u32 */
51 IOAM6_IPTUNNEL_FREQ_N, /* u32 */51 IOAM6_IPTUNNEL_FREQ_N, /* u32 */
5252
53 /* Tunnel src address.
54 * For encap,auto modes.
55 * Optional (automatic if not provided).
56 */
57 IOAM6_IPTUNNEL_SRC, /* struct in6_addr */
58
53 __IOAM6_IPTUNNEL_MAX,59 __IOAM6_IPTUNNEL_MAX,
54};60};
5561
lib/libc/include/any-linux-any/linux/iommufd.h+351-29
...@@ -4,8 +4,8 @@...@@ -4,8 +4,8 @@
4#ifndef _IOMMUFD_H4#ifndef _IOMMUFD_H
5#define _IOMMUFD_H5#define _IOMMUFD_H
66
7#include <linux/types.h>
8#include <linux/ioctl.h>7#include <linux/ioctl.h>
8#include <linux/types.h>
99
10#define IOMMUFD_TYPE (';')10#define IOMMUFD_TYPE (';')
1111
...@@ -37,19 +37,24 @@...@@ -37,19 +37,24 @@
37enum {37enum {
38 IOMMUFD_CMD_BASE = 0x80,38 IOMMUFD_CMD_BASE = 0x80,
39 IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE,39 IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE,
40 IOMMUFD_CMD_IOAS_ALLOC,40 IOMMUFD_CMD_IOAS_ALLOC = 0x81,
41 IOMMUFD_CMD_IOAS_ALLOW_IOVAS,41 IOMMUFD_CMD_IOAS_ALLOW_IOVAS = 0x82,
42 IOMMUFD_CMD_IOAS_COPY,42 IOMMUFD_CMD_IOAS_COPY = 0x83,
43 IOMMUFD_CMD_IOAS_IOVA_RANGES,43 IOMMUFD_CMD_IOAS_IOVA_RANGES = 0x84,
44 IOMMUFD_CMD_IOAS_MAP,44 IOMMUFD_CMD_IOAS_MAP = 0x85,
45 IOMMUFD_CMD_IOAS_UNMAP,45 IOMMUFD_CMD_IOAS_UNMAP = 0x86,
46 IOMMUFD_CMD_OPTION,46 IOMMUFD_CMD_OPTION = 0x87,
47 IOMMUFD_CMD_VFIO_IOAS,47 IOMMUFD_CMD_VFIO_IOAS = 0x88,
48 IOMMUFD_CMD_HWPT_ALLOC,48 IOMMUFD_CMD_HWPT_ALLOC = 0x89,
49 IOMMUFD_CMD_GET_HW_INFO,49 IOMMUFD_CMD_GET_HW_INFO = 0x8a,
50 IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING,50 IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING = 0x8b,
51 IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP,51 IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c,
52 IOMMUFD_CMD_HWPT_INVALIDATE,52 IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d,
53 IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e,
54 IOMMUFD_CMD_IOAS_MAP_FILE = 0x8f,
55 IOMMUFD_CMD_VIOMMU_ALLOC = 0x90,
56 IOMMUFD_CMD_VDEVICE_ALLOC = 0x91,
57 IOMMUFD_CMD_IOAS_CHANGE_PROCESS = 0x92,
53};58};
5459
55/**60/**
...@@ -212,6 +217,30 @@ struct iommu_ioas_map {...@@ -212,6 +217,30 @@ struct iommu_ioas_map {
212};217};
213#define IOMMU_IOAS_MAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP)218#define IOMMU_IOAS_MAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP)
214219
220/**
221 * struct iommu_ioas_map_file - ioctl(IOMMU_IOAS_MAP_FILE)
222 * @size: sizeof(struct iommu_ioas_map_file)
223 * @flags: same as for iommu_ioas_map
224 * @ioas_id: same as for iommu_ioas_map
225 * @fd: the memfd to map
226 * @start: byte offset from start of file to map from
227 * @length: same as for iommu_ioas_map
228 * @iova: same as for iommu_ioas_map
229 *
230 * Set an IOVA mapping from a memfd file. All other arguments and semantics
231 * match those of IOMMU_IOAS_MAP.
232 */
233struct iommu_ioas_map_file {
234 __u32 size;
235 __u32 flags;
236 __u32 ioas_id;
237 __s32 fd;
238 __aligned_u64 start;
239 __aligned_u64 length;
240 __aligned_u64 iova;
241};
242#define IOMMU_IOAS_MAP_FILE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP_FILE)
243
215/**244/**
216 * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY)245 * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY)
217 * @size: sizeof(struct iommu_ioas_copy)246 * @size: sizeof(struct iommu_ioas_copy)
...@@ -268,7 +297,7 @@ struct iommu_ioas_unmap {...@@ -268,7 +297,7 @@ struct iommu_ioas_unmap {
268 * ioctl(IOMMU_OPTION_HUGE_PAGES)297 * ioctl(IOMMU_OPTION_HUGE_PAGES)
269 * @IOMMU_OPTION_RLIMIT_MODE:298 * @IOMMU_OPTION_RLIMIT_MODE:
270 * Change how RLIMIT_MEMLOCK accounting works. The caller must have privilege299 * Change how RLIMIT_MEMLOCK accounting works. The caller must have privilege
271 * to invoke this. Value 0 (default) is user based accouting, 1 uses process300 * to invoke this. Value 0 (default) is user based accounting, 1 uses process
272 * based accounting. Global option, object_id must be 0301 * based accounting. Global option, object_id must be 0
273 * @IOMMU_OPTION_HUGE_PAGES:302 * @IOMMU_OPTION_HUGE_PAGES:
274 * Value 1 (default) allows contiguous pages to be combined when generating303 * Value 1 (default) allows contiguous pages to be combined when generating
...@@ -356,10 +385,21 @@ struct iommu_vfio_ioas {...@@ -356,10 +385,21 @@ struct iommu_vfio_ioas {
356 * the parent HWPT in a nesting configuration.385 * the parent HWPT in a nesting configuration.
357 * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is386 * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is
358 * enforced on device attachment387 * enforced on device attachment
388 * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is
389 * valid.
390 * @IOMMU_HWPT_ALLOC_PASID: Requests a domain that can be used with PASID. The
391 * domain can be attached to any PASID on the device.
392 * Any domain attached to the non-PASID part of the
393 * device must also be flagged, otherwise attaching a
394 * PASID will blocked.
395 * If IOMMU does not support PASID it will return
396 * error (-EOPNOTSUPP).
359 */397 */
360enum iommufd_hwpt_alloc_flags {398enum iommufd_hwpt_alloc_flags {
361 IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0,399 IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0,
362 IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1,400 IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1,
401 IOMMU_HWPT_FAULT_ID_VALID = 1 << 2,
402 IOMMU_HWPT_ALLOC_PASID = 1 << 3,
363};403};
364404
365/**405/**
...@@ -390,14 +430,36 @@ struct iommu_hwpt_vtd_s1 {...@@ -390,14 +430,36 @@ struct iommu_hwpt_vtd_s1 {
390 __u32 __reserved;430 __u32 __reserved;
391};431};
392432
433/**
434 * struct iommu_hwpt_arm_smmuv3 - ARM SMMUv3 nested STE
435 * (IOMMU_HWPT_DATA_ARM_SMMUV3)
436 *
437 * @ste: The first two double words of the user space Stream Table Entry for
438 * the translation. Must be little-endian.
439 * Allowed fields: (Refer to "5.2 Stream Table Entry" in SMMUv3 HW Spec)
440 * - word-0: V, Cfg, S1Fmt, S1ContextPtr, S1CDMax
441 * - word-1: EATS, S1DSS, S1CIR, S1COR, S1CSH, S1STALLD
442 *
443 * -EIO will be returned if @ste is not legal or contains any non-allowed field.
444 * Cfg can be used to select a S1, Bypass or Abort configuration. A Bypass
445 * nested domain will translate the same as the nesting parent. The S1 will
446 * install a Context Descriptor Table pointing at userspace memory translated
447 * by the nesting parent.
448 */
449struct iommu_hwpt_arm_smmuv3 {
450 __aligned_le64 ste[2];
451};
452
393/**453/**
394 * enum iommu_hwpt_data_type - IOMMU HWPT Data Type454 * enum iommu_hwpt_data_type - IOMMU HWPT Data Type
395 * @IOMMU_HWPT_DATA_NONE: no data455 * @IOMMU_HWPT_DATA_NONE: no data
396 * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table456 * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table
457 * @IOMMU_HWPT_DATA_ARM_SMMUV3: ARM SMMUv3 Context Descriptor Table
397 */458 */
398enum iommu_hwpt_data_type {459enum iommu_hwpt_data_type {
399 IOMMU_HWPT_DATA_NONE,460 IOMMU_HWPT_DATA_NONE = 0,
400 IOMMU_HWPT_DATA_VTD_S1,461 IOMMU_HWPT_DATA_VTD_S1 = 1,
462 IOMMU_HWPT_DATA_ARM_SMMUV3 = 2,
401};463};
402464
403/**465/**
...@@ -405,12 +467,15 @@ enum iommu_hwpt_data_type {...@@ -405,12 +467,15 @@ enum iommu_hwpt_data_type {
405 * @size: sizeof(struct iommu_hwpt_alloc)467 * @size: sizeof(struct iommu_hwpt_alloc)
406 * @flags: Combination of enum iommufd_hwpt_alloc_flags468 * @flags: Combination of enum iommufd_hwpt_alloc_flags
407 * @dev_id: The device to allocate this HWPT for469 * @dev_id: The device to allocate this HWPT for
408 * @pt_id: The IOAS or HWPT to connect this HWPT to470 * @pt_id: The IOAS or HWPT or vIOMMU to connect this HWPT to
409 * @out_hwpt_id: The ID of the new HWPT471 * @out_hwpt_id: The ID of the new HWPT
410 * @__reserved: Must be 0472 * @__reserved: Must be 0
411 * @data_type: One of enum iommu_hwpt_data_type473 * @data_type: One of enum iommu_hwpt_data_type
412 * @data_len: Length of the type specific data474 * @data_len: Length of the type specific data
413 * @data_uptr: User pointer to the type specific data475 * @data_uptr: User pointer to the type specific data
476 * @fault_id: The ID of IOMMUFD_FAULT object. Valid only if flags field of
477 * IOMMU_HWPT_FAULT_ID_VALID is set.
478 * @__reserved2: Padding to 64-bit alignment. Must be 0.
414 *479 *
415 * Explicitly allocate a hardware page table object. This is the same object480 * Explicitly allocate a hardware page table object. This is the same object
416 * type that is returned by iommufd_device_attach() and represents the481 * type that is returned by iommufd_device_attach() and represents the
...@@ -421,11 +486,13 @@ enum iommu_hwpt_data_type {...@@ -421,11 +486,13 @@ enum iommu_hwpt_data_type {
421 * IOMMU_HWPT_DATA_NONE. The HWPT can be allocated as a parent HWPT for a486 * IOMMU_HWPT_DATA_NONE. The HWPT can be allocated as a parent HWPT for a
422 * nesting configuration by passing IOMMU_HWPT_ALLOC_NEST_PARENT via @flags.487 * nesting configuration by passing IOMMU_HWPT_ALLOC_NEST_PARENT via @flags.
423 *488 *
424 * A user-managed nested HWPT will be created from a given parent HWPT via489 * A user-managed nested HWPT will be created from a given vIOMMU (wrapping a
425 * @pt_id, in which the parent HWPT must be allocated previously via the490 * parent HWPT) or a parent HWPT via @pt_id, in which the parent HWPT must be
426 * same ioctl from a given IOAS (@pt_id). In this case, the @data_type491 * allocated previously via the same ioctl from a given IOAS (@pt_id). In this
427 * must be set to a pre-defined type corresponding to an I/O page table492 * case, the @data_type must be set to a pre-defined type corresponding to an
428 * type supported by the underlying IOMMU hardware.493 * I/O page table type supported by the underlying IOMMU hardware. The device
494 * via @dev_id and the vIOMMU via @pt_id must be associated to the same IOMMU
495 * instance.
429 *496 *
430 * If the @data_type is set to IOMMU_HWPT_DATA_NONE, @data_len and497 * If the @data_type is set to IOMMU_HWPT_DATA_NONE, @data_len and
431 * @data_uptr should be zero. Otherwise, both @data_len and @data_uptr498 * @data_uptr should be zero. Otherwise, both @data_len and @data_uptr
...@@ -441,6 +508,8 @@ struct iommu_hwpt_alloc {...@@ -441,6 +508,8 @@ struct iommu_hwpt_alloc {
441 __u32 data_type;508 __u32 data_type;
442 __u32 data_len;509 __u32 data_len;
443 __aligned_u64 data_uptr;510 __aligned_u64 data_uptr;
511 __u32 fault_id;
512 __u32 __reserved2;
444};513};
445#define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC)514#define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC)
446515
...@@ -475,15 +544,59 @@ struct iommu_hw_info_vtd {...@@ -475,15 +544,59 @@ struct iommu_hw_info_vtd {
475 __aligned_u64 ecap_reg;544 __aligned_u64 ecap_reg;
476};545};
477546
547/**
548 * struct iommu_hw_info_arm_smmuv3 - ARM SMMUv3 hardware information
549 * (IOMMU_HW_INFO_TYPE_ARM_SMMUV3)
550 *
551 * @flags: Must be set to 0
552 * @__reserved: Must be 0
553 * @idr: Implemented features for ARM SMMU Non-secure programming interface
554 * @iidr: Information about the implementation and implementer of ARM SMMU,
555 * and architecture version supported
556 * @aidr: ARM SMMU architecture version
557 *
558 * For the details of @idr, @iidr and @aidr, please refer to the chapters
559 * from 6.3.1 to 6.3.6 in the SMMUv3 Spec.
560 *
561 * This reports the raw HW capability, and not all bits are meaningful to be
562 * read by userspace. Only the following fields should be used:
563 *
564 * idr[0]: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN , CD2L, ASID16, TTF
565 * idr[1]: SIDSIZE, SSIDSIZE
566 * idr[3]: BBML, RIL
567 * idr[5]: VAX, GRAN64K, GRAN16K, GRAN4K
568 *
569 * - S1P should be assumed to be true if a NESTED HWPT can be created
570 * - VFIO/iommufd only support platforms with COHACC, it should be assumed to be
571 * true.
572 * - ATS is a per-device property. If the VMM describes any devices as ATS
573 * capable in ACPI/DT it should set the corresponding idr.
574 *
575 * This list may expand in future (eg E0PD, AIE, PBHA, D128, DS etc). It is
576 * important that VMMs do not read bits outside the list to allow for
577 * compatibility with future kernels. Several features in the SMMUv3
578 * architecture are not currently supported by the kernel for nesting: HTTU,
579 * BTM, MPAM and others.
580 */
581struct iommu_hw_info_arm_smmuv3 {
582 __u32 flags;
583 __u32 __reserved;
584 __u32 idr[6];
585 __u32 iidr;
586 __u32 aidr;
587};
588
478/**589/**
479 * enum iommu_hw_info_type - IOMMU Hardware Info Types590 * enum iommu_hw_info_type - IOMMU Hardware Info Types
480 * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware591 * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware
481 * info592 * info
482 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type593 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type
594 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
483 */595 */
484enum iommu_hw_info_type {596enum iommu_hw_info_type {
485 IOMMU_HW_INFO_TYPE_NONE,597 IOMMU_HW_INFO_TYPE_NONE = 0,
486 IOMMU_HW_INFO_TYPE_INTEL_VTD,598 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
599 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
487};600};
488601
489/**602/**
...@@ -618,9 +731,11 @@ struct iommu_hwpt_get_dirty_bitmap {...@@ -618,9 +731,11 @@ struct iommu_hwpt_get_dirty_bitmap {
618 * enum iommu_hwpt_invalidate_data_type - IOMMU HWPT Cache Invalidation731 * enum iommu_hwpt_invalidate_data_type - IOMMU HWPT Cache Invalidation
619 * Data Type732 * Data Type
620 * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1733 * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1
734 * @IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3: Invalidation data for ARM SMMUv3
621 */735 */
622enum iommu_hwpt_invalidate_data_type {736enum iommu_hwpt_invalidate_data_type {
623 IOMMU_HWPT_INVALIDATE_DATA_VTD_S1,737 IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0,
738 IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3 = 1,
624};739};
625740
626/**741/**
...@@ -659,10 +774,32 @@ struct iommu_hwpt_vtd_s1_invalidate {...@@ -659,10 +774,32 @@ struct iommu_hwpt_vtd_s1_invalidate {
659 __u32 __reserved;774 __u32 __reserved;
660};775};
661776
777/**
778 * struct iommu_viommu_arm_smmuv3_invalidate - ARM SMMUv3 cache invalidation
779 * (IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3)
780 * @cmd: 128-bit cache invalidation command that runs in SMMU CMDQ.
781 * Must be little-endian.
782 *
783 * Supported command list only when passing in a vIOMMU via @hwpt_id:
784 * CMDQ_OP_TLBI_NSNH_ALL
785 * CMDQ_OP_TLBI_NH_VA
786 * CMDQ_OP_TLBI_NH_VAA
787 * CMDQ_OP_TLBI_NH_ALL
788 * CMDQ_OP_TLBI_NH_ASID
789 * CMDQ_OP_ATC_INV
790 * CMDQ_OP_CFGI_CD
791 * CMDQ_OP_CFGI_CD_ALL
792 *
793 * -EIO will be returned if the command is not supported.
794 */
795struct iommu_viommu_arm_smmuv3_invalidate {
796 __aligned_le64 cmd[2];
797};
798
662/**799/**
663 * struct iommu_hwpt_invalidate - ioctl(IOMMU_HWPT_INVALIDATE)800 * struct iommu_hwpt_invalidate - ioctl(IOMMU_HWPT_INVALIDATE)
664 * @size: sizeof(struct iommu_hwpt_invalidate)801 * @size: sizeof(struct iommu_hwpt_invalidate)
665 * @hwpt_id: ID of a nested HWPT for cache invalidation802 * @hwpt_id: ID of a nested HWPT or a vIOMMU, for cache invalidation
666 * @data_uptr: User pointer to an array of driver-specific cache invalidation803 * @data_uptr: User pointer to an array of driver-specific cache invalidation
667 * data.804 * data.
668 * @data_type: One of enum iommu_hwpt_invalidate_data_type, defining the data805 * @data_type: One of enum iommu_hwpt_invalidate_data_type, defining the data
...@@ -673,8 +810,11 @@ struct iommu_hwpt_vtd_s1_invalidate {...@@ -673,8 +810,11 @@ struct iommu_hwpt_vtd_s1_invalidate {
673 * Output the number of requests successfully handled by kernel.810 * Output the number of requests successfully handled by kernel.
674 * @__reserved: Must be 0.811 * @__reserved: Must be 0.
675 *812 *
676 * Invalidate the iommu cache for user-managed page table. Modifications on a813 * Invalidate iommu cache for user-managed page table or vIOMMU. Modifications
677 * user-managed page table should be followed by this operation to sync cache.814 * on a user-managed page table should be followed by this operation, if a HWPT
815 * is passed in via @hwpt_id. Other caches, such as device cache or descriptor
816 * cache can be flushed if a vIOMMU is passed in via the @hwpt_id field.
817 *
678 * Each ioctl can support one or more cache invalidation requests in the array818 * Each ioctl can support one or more cache invalidation requests in the array
679 * that has a total size of @entry_len * @entry_num.819 * that has a total size of @entry_len * @entry_num.
680 *820 *
...@@ -692,4 +832,186 @@ struct iommu_hwpt_invalidate {...@@ -692,4 +832,186 @@ struct iommu_hwpt_invalidate {
692 __u32 __reserved;832 __u32 __reserved;
693};833};
694#define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE)834#define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE)
835
836/**
837 * enum iommu_hwpt_pgfault_flags - flags for struct iommu_hwpt_pgfault
838 * @IOMMU_PGFAULT_FLAGS_PASID_VALID: The pasid field of the fault data is
839 * valid.
840 * @IOMMU_PGFAULT_FLAGS_LAST_PAGE: It's the last fault of a fault group.
841 */
842enum iommu_hwpt_pgfault_flags {
843 IOMMU_PGFAULT_FLAGS_PASID_VALID = (1 << 0),
844 IOMMU_PGFAULT_FLAGS_LAST_PAGE = (1 << 1),
845};
846
847/**
848 * enum iommu_hwpt_pgfault_perm - perm bits for struct iommu_hwpt_pgfault
849 * @IOMMU_PGFAULT_PERM_READ: request for read permission
850 * @IOMMU_PGFAULT_PERM_WRITE: request for write permission
851 * @IOMMU_PGFAULT_PERM_EXEC: (PCIE 10.4.1) request with a PASID that has the
852 * Execute Requested bit set in PASID TLP Prefix.
853 * @IOMMU_PGFAULT_PERM_PRIV: (PCIE 10.4.1) request with a PASID that has the
854 * Privileged Mode Requested bit set in PASID TLP
855 * Prefix.
856 */
857enum iommu_hwpt_pgfault_perm {
858 IOMMU_PGFAULT_PERM_READ = (1 << 0),
859 IOMMU_PGFAULT_PERM_WRITE = (1 << 1),
860 IOMMU_PGFAULT_PERM_EXEC = (1 << 2),
861 IOMMU_PGFAULT_PERM_PRIV = (1 << 3),
862};
863
864/**
865 * struct iommu_hwpt_pgfault - iommu page fault data
866 * @flags: Combination of enum iommu_hwpt_pgfault_flags
867 * @dev_id: id of the originated device
868 * @pasid: Process Address Space ID
869 * @grpid: Page Request Group Index
870 * @perm: Combination of enum iommu_hwpt_pgfault_perm
871 * @__reserved: Must be 0.
872 * @addr: Fault address
873 * @length: a hint of how much data the requestor is expecting to fetch. For
874 * example, if the PRI initiator knows it is going to do a 10MB
875 * transfer, it could fill in 10MB and the OS could pre-fault in
876 * 10MB of IOVA. It's default to 0 if there's no such hint.
877 * @cookie: kernel-managed cookie identifying a group of fault messages. The
878 * cookie number encoded in the last page fault of the group should
879 * be echoed back in the response message.
880 */
881struct iommu_hwpt_pgfault {
882 __u32 flags;
883 __u32 dev_id;
884 __u32 pasid;
885 __u32 grpid;
886 __u32 perm;
887 __u32 __reserved;
888 __aligned_u64 addr;
889 __u32 length;
890 __u32 cookie;
891};
892
893/**
894 * enum iommufd_page_response_code - Return status of fault handlers
895 * @IOMMUFD_PAGE_RESP_SUCCESS: Fault has been handled and the page tables
896 * populated, retry the access. This is the
897 * "Success" defined in PCI 10.4.2.1.
898 * @IOMMUFD_PAGE_RESP_INVALID: Could not handle this fault, don't retry the
899 * access. This is the "Invalid Request" in PCI
900 * 10.4.2.1.
901 */
902enum iommufd_page_response_code {
903 IOMMUFD_PAGE_RESP_SUCCESS = 0,
904 IOMMUFD_PAGE_RESP_INVALID = 1,
905};
906
907/**
908 * struct iommu_hwpt_page_response - IOMMU page fault response
909 * @cookie: The kernel-managed cookie reported in the fault message.
910 * @code: One of response code in enum iommufd_page_response_code.
911 */
912struct iommu_hwpt_page_response {
913 __u32 cookie;
914 __u32 code;
915};
916
917/**
918 * struct iommu_fault_alloc - ioctl(IOMMU_FAULT_QUEUE_ALLOC)
919 * @size: sizeof(struct iommu_fault_alloc)
920 * @flags: Must be 0
921 * @out_fault_id: The ID of the new FAULT
922 * @out_fault_fd: The fd of the new FAULT
923 *
924 * Explicitly allocate a fault handling object.
925 */
926struct iommu_fault_alloc {
927 __u32 size;
928 __u32 flags;
929 __u32 out_fault_id;
930 __u32 out_fault_fd;
931};
932#define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC)
933
934/**
935 * enum iommu_viommu_type - Virtual IOMMU Type
936 * @IOMMU_VIOMMU_TYPE_DEFAULT: Reserved for future use
937 * @IOMMU_VIOMMU_TYPE_ARM_SMMUV3: ARM SMMUv3 driver specific type
938 */
939enum iommu_viommu_type {
940 IOMMU_VIOMMU_TYPE_DEFAULT = 0,
941 IOMMU_VIOMMU_TYPE_ARM_SMMUV3 = 1,
942};
943
944/**
945 * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC)
946 * @size: sizeof(struct iommu_viommu_alloc)
947 * @flags: Must be 0
948 * @type: Type of the virtual IOMMU. Must be defined in enum iommu_viommu_type
949 * @dev_id: The device's physical IOMMU will be used to back the virtual IOMMU
950 * @hwpt_id: ID of a nesting parent HWPT to associate to
951 * @out_viommu_id: Output virtual IOMMU ID for the allocated object
952 *
953 * Allocate a virtual IOMMU object, representing the underlying physical IOMMU's
954 * virtualization support that is a security-isolated slice of the real IOMMU HW
955 * that is unique to a specific VM. Operations global to the IOMMU are connected
956 * to the vIOMMU, such as:
957 * - Security namespace for guest owned ID, e.g. guest-controlled cache tags
958 * - Non-device-affiliated event reporting, e.g. invalidation queue errors
959 * - Access to a sharable nesting parent pagetable across physical IOMMUs
960 * - Virtualization of various platforms IDs, e.g. RIDs and others
961 * - Delivery of paravirtualized invalidation
962 * - Direct assigned invalidation queues
963 * - Direct assigned interrupts
964 */
965struct iommu_viommu_alloc {
966 __u32 size;
967 __u32 flags;
968 __u32 type;
969 __u32 dev_id;
970 __u32 hwpt_id;
971 __u32 out_viommu_id;
972};
973#define IOMMU_VIOMMU_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_ALLOC)
974
975/**
976 * struct iommu_vdevice_alloc - ioctl(IOMMU_VDEVICE_ALLOC)
977 * @size: sizeof(struct iommu_vdevice_alloc)
978 * @viommu_id: vIOMMU ID to associate with the virtual device
979 * @dev_id: The physical device to allocate a virtual instance on the vIOMMU
980 * @out_vdevice_id: Object handle for the vDevice. Pass to IOMMU_DESTORY
981 * @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
983 *
984 * Allocate a virtual device instance (for a physical device) against a vIOMMU.
985 * This instance holds the device's information (related to its vIOMMU) in a VM.
986 */
987struct iommu_vdevice_alloc {
988 __u32 size;
989 __u32 viommu_id;
990 __u32 dev_id;
991 __u32 out_vdevice_id;
992 __aligned_u64 virt_id;
993};
994#define IOMMU_VDEVICE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VDEVICE_ALLOC)
995
996/**
997 * struct iommu_ioas_change_process - ioctl(VFIO_IOAS_CHANGE_PROCESS)
998 * @size: sizeof(struct iommu_ioas_change_process)
999 * @__reserved: Must be 0
1000 *
1001 * This transfers pinned memory counts for every memory map in every IOAS
1002 * in the context to the current process. This only supports maps created
1003 * with IOMMU_IOAS_MAP_FILE, and returns EINVAL if other maps are present.
1004 * If the ioctl returns a failure status, then nothing is changed.
1005 *
1006 * This API is useful for transferring operation of a device from one process
1007 * to another, such as during userland live update.
1008 */
1009struct iommu_ioas_change_process {
1010 __u32 size;
1011 __u32 __reserved;
1012};
1013
1014#define IOMMU_IOAS_CHANGE_PROCESS \
1015 _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_CHANGE_PROCESS)
1016
695#endif1017#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kernel-page-flags.h+1-1
...@@ -7,7 +7,7 @@...@@ -7,7 +7,7 @@
7 */7 */
88
9#define KPF_LOCKED 09#define KPF_LOCKED 0
10#define KPF_ERROR 110#define KPF_ERROR 1 /* Now unused */
11#define KPF_REFERENCED 211#define KPF_REFERENCED 2
12#define KPF_UPTODATE 312#define KPF_UPTODATE 3
13#define KPF_DIRTY 413#define KPF_DIRTY 4
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+96-14
...@@ -41,9 +41,11 @@...@@ -41,9 +41,11 @@
41 * - 1.13 - Add debugger API41 * - 1.13 - Add debugger API
42 * - 1.14 - Update kfd_event_data42 * - 1.14 - Update kfd_event_data
43 * - 1.15 - Enable managing mappings in compute VMs with GEM_VA ioctl43 * - 1.15 - Enable managing mappings in compute VMs with GEM_VA ioctl
44 * - 1.16 - Add contiguous VRAM allocation flag
45 * - 1.17 - Add SDMA queue creation with target SDMA engine ID
44 */46 */
45#define KFD_IOCTL_MAJOR_VERSION 147#define KFD_IOCTL_MAJOR_VERSION 1
46#define KFD_IOCTL_MINOR_VERSION 1548#define KFD_IOCTL_MINOR_VERSION 17
4749
48struct kfd_ioctl_get_version_args {50struct kfd_ioctl_get_version_args {
49 __u32 major_version; /* from KFD */51 __u32 major_version; /* from KFD */
...@@ -55,6 +57,7 @@ struct kfd_ioctl_get_version_args {...@@ -55,6 +57,7 @@ struct kfd_ioctl_get_version_args {
55#define KFD_IOC_QUEUE_TYPE_SDMA 0x157#define KFD_IOC_QUEUE_TYPE_SDMA 0x1
56#define KFD_IOC_QUEUE_TYPE_COMPUTE_AQL 0x258#define KFD_IOC_QUEUE_TYPE_COMPUTE_AQL 0x2
57#define KFD_IOC_QUEUE_TYPE_SDMA_XGMI 0x359#define KFD_IOC_QUEUE_TYPE_SDMA_XGMI 0x3
60#define KFD_IOC_QUEUE_TYPE_SDMA_BY_ENG_ID 0x4
5861
59#define KFD_MAX_QUEUE_PERCENTAGE 10062#define KFD_MAX_QUEUE_PERCENTAGE 100
60#define KFD_MAX_QUEUE_PRIORITY 1563#define KFD_MAX_QUEUE_PRIORITY 15
...@@ -77,6 +80,8 @@ struct kfd_ioctl_create_queue_args {...@@ -77,6 +80,8 @@ struct kfd_ioctl_create_queue_args {
77 __u64 ctx_save_restore_address; /* to KFD */80 __u64 ctx_save_restore_address; /* to KFD */
78 __u32 ctx_save_restore_size; /* to KFD */81 __u32 ctx_save_restore_size; /* to KFD */
79 __u32 ctl_stack_size; /* to KFD */82 __u32 ctl_stack_size; /* to KFD */
83 __u32 sdma_engine_id; /* to KFD */
84 __u32 pad;
80};85};
8186
82struct kfd_ioctl_destroy_queue_args {87struct kfd_ioctl_destroy_queue_args {
...@@ -407,6 +412,7 @@ struct kfd_ioctl_acquire_vm_args {...@@ -407,6 +412,7 @@ struct kfd_ioctl_acquire_vm_args {
407#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)412#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)
408#define KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED (1 << 25)413#define KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED (1 << 25)
409#define KFD_IOC_ALLOC_MEM_FLAGS_EXT_COHERENT (1 << 24)414#define KFD_IOC_ALLOC_MEM_FLAGS_EXT_COHERENT (1 << 24)
415#define KFD_IOC_ALLOC_MEM_FLAGS_CONTIGUOUS (1 << 23)
410416
411/* Allocate memory for later SVM (shared virtual memory) mapping.417/* Allocate memory for later SVM (shared virtual memory) mapping.
412 *418 *
...@@ -534,26 +540,29 @@ enum kfd_smi_event {...@@ -534,26 +540,29 @@ enum kfd_smi_event {
534 KFD_SMI_EVENT_ALL_PROCESS = 64540 KFD_SMI_EVENT_ALL_PROCESS = 64
535};541};
536542
543/* The reason of the page migration event */
537enum KFD_MIGRATE_TRIGGERS {544enum KFD_MIGRATE_TRIGGERS {
538 KFD_MIGRATE_TRIGGER_PREFETCH,545 KFD_MIGRATE_TRIGGER_PREFETCH, /* Prefetch to GPU VRAM or system memory */
539 KFD_MIGRATE_TRIGGER_PAGEFAULT_GPU,546 KFD_MIGRATE_TRIGGER_PAGEFAULT_GPU, /* GPU page fault recover */
540 KFD_MIGRATE_TRIGGER_PAGEFAULT_CPU,547 KFD_MIGRATE_TRIGGER_PAGEFAULT_CPU, /* CPU page fault recover */
541 KFD_MIGRATE_TRIGGER_TTM_EVICTION548 KFD_MIGRATE_TRIGGER_TTM_EVICTION /* TTM eviction */
542};549};
543550
551/* The reason of user queue evition event */
544enum KFD_QUEUE_EVICTION_TRIGGERS {552enum KFD_QUEUE_EVICTION_TRIGGERS {
545 KFD_QUEUE_EVICTION_TRIGGER_SVM,553 KFD_QUEUE_EVICTION_TRIGGER_SVM, /* SVM buffer migration */
546 KFD_QUEUE_EVICTION_TRIGGER_USERPTR,554 KFD_QUEUE_EVICTION_TRIGGER_USERPTR, /* userptr movement */
547 KFD_QUEUE_EVICTION_TRIGGER_TTM,555 KFD_QUEUE_EVICTION_TRIGGER_TTM, /* TTM move buffer */
548 KFD_QUEUE_EVICTION_TRIGGER_SUSPEND,556 KFD_QUEUE_EVICTION_TRIGGER_SUSPEND, /* GPU suspend */
549 KFD_QUEUE_EVICTION_CRIU_CHECKPOINT,557 KFD_QUEUE_EVICTION_CRIU_CHECKPOINT, /* CRIU checkpoint */
550 KFD_QUEUE_EVICTION_CRIU_RESTORE558 KFD_QUEUE_EVICTION_CRIU_RESTORE /* CRIU restore */
551};559};
552560
561/* The reason of unmap buffer from GPU event */
553enum KFD_SVM_UNMAP_TRIGGERS {562enum KFD_SVM_UNMAP_TRIGGERS {
554 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY,563 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY, /* MMU notifier CPU buffer movement */
555 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY_MIGRATE,564 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY_MIGRATE,/* MMU notifier page migration */
556 KFD_SVM_UNMAP_TRIGGER_UNMAP_FROM_CPU565 KFD_SVM_UNMAP_TRIGGER_UNMAP_FROM_CPU /* Unmap to free the buffer */
557};566};
558567
559#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))568#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
...@@ -564,6 +573,78 @@ struct kfd_ioctl_smi_events_args {...@@ -564,6 +573,78 @@ struct kfd_ioctl_smi_events_args {
564 __u32 anon_fd; /* from KFD */573 __u32 anon_fd; /* from KFD */
565};574};
566575
576/*
577 * SVM event tracing via SMI system management interface
578 *
579 * Open event file descriptor
580 * use ioctl AMDKFD_IOC_SMI_EVENTS, pass in gpuid and return a anonymous file
581 * descriptor to receive SMI events.
582 * If calling with sudo permission, then file descriptor can be used to receive
583 * SVM events from all processes, otherwise, to only receive SVM events of same
584 * process.
585 *
586 * To enable the SVM event
587 * Write event file descriptor with KFD_SMI_EVENT_MASK_FROM_INDEX(event) bitmap
588 * mask to start record the event to the kfifo, use bitmap mask combination
589 * for multiple events. New event mask will overwrite the previous event mask.
590 * KFD_SMI_EVENT_MASK_FROM_INDEX(KFD_SMI_EVENT_ALL_PROCESS) bit requires sudo
591 * permisson to receive SVM events from all process.
592 *
593 * To receive the event
594 * Application can poll file descriptor to wait for the events, then read event
595 * from the file into a buffer. Each event is one line string message, starting
596 * with the event id, then the event specific information.
597 *
598 * To decode event information
599 * The following event format string macro can be used with sscanf to decode
600 * the specific event information.
601 * event triggers: the reason to generate the event, defined as enum for unmap,
602 * eviction and migrate events.
603 * node, from, to, prefetch_loc, preferred_loc: GPU ID, or 0 for system memory.
604 * addr: user mode address, in pages
605 * size: in pages
606 * pid: the process ID to generate the event
607 * ns: timestamp in nanosecond-resolution, starts at system boot time but
608 * stops during suspend
609 * migrate_update: GPU page fault is recovered by 'M' for migrate, 'U' for update
610 * rw: 'W' for write page fault, 'R' for read page fault
611 * rescheduled: 'R' if the queue restore failed and rescheduled to try again
612 * error_code: migrate failure error code, 0 if no error
613 */
614#define KFD_EVENT_FMT_UPDATE_GPU_RESET(reset_seq_num, reset_cause)\
615 "%x %s\n", (reset_seq_num), (reset_cause)
616
617#define KFD_EVENT_FMT_THERMAL_THROTTLING(bitmask, counter)\
618 "%llx:%llx\n", (bitmask), (counter)
619
620#define KFD_EVENT_FMT_VMFAULT(pid, task_name)\
621 "%x:%s\n", (pid), (task_name)
622
623#define KFD_EVENT_FMT_PAGEFAULT_START(ns, pid, addr, node, rw)\
624 "%lld -%d @%lx(%x) %c\n", (ns), (pid), (addr), (node), (rw)
625
626#define KFD_EVENT_FMT_PAGEFAULT_END(ns, pid, addr, node, migrate_update)\
627 "%lld -%d @%lx(%x) %c\n", (ns), (pid), (addr), (node), (migrate_update)
628
629#define KFD_EVENT_FMT_MIGRATE_START(ns, pid, start, size, from, to, prefetch_loc,\
630 preferred_loc, migrate_trigger)\
631 "%lld -%d @%lx(%lx) %x->%x %x:%x %d\n", (ns), (pid), (start), (size),\
632 (from), (to), (prefetch_loc), (preferred_loc), (migrate_trigger)
633
634#define KFD_EVENT_FMT_MIGRATE_END(ns, pid, start, size, from, to, migrate_trigger, error_code) \
635 "%lld -%d @%lx(%lx) %x->%x %d %d\n", (ns), (pid), (start), (size),\
636 (from), (to), (migrate_trigger), (error_code)
637
638#define KFD_EVENT_FMT_QUEUE_EVICTION(ns, pid, node, evict_trigger)\
639 "%lld -%d %x %d\n", (ns), (pid), (node), (evict_trigger)
640
641#define KFD_EVENT_FMT_QUEUE_RESTORE(ns, pid, node, rescheduled)\
642 "%lld -%d %x %c\n", (ns), (pid), (node), (rescheduled)
643
644#define KFD_EVENT_FMT_UNMAP_FROM_GPU(ns, pid, addr, size, node, unmap_trigger)\
645 "%lld -%d @%lx(%lx) %x %d\n", (ns), (pid), (addr), (size),\
646 (node), (unmap_trigger)
647
567/**************************************************************************************************648/**************************************************************************************************
568 * CRIU IOCTLs (Checkpoint Restore In Userspace)649 * CRIU IOCTLs (Checkpoint Restore In Userspace)
569 *650 *
...@@ -852,6 +933,7 @@ enum kfd_dbg_trap_address_watch_mode {...@@ -852,6 +933,7 @@ enum kfd_dbg_trap_address_watch_mode {
852/* Additional wave settings */933/* Additional wave settings */
853enum kfd_dbg_trap_flags {934enum kfd_dbg_trap_flags {
854 KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP = 1,935 KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP = 1,
936 KFD_DBG_TRAP_FLAG_SINGLE_ALU_OP = 2,
855};937};
856938
857/* Trap exceptions */939/* Trap exceptions */
lib/libc/include/any-linux-any/linux/kfd_sysfs.h+11-9
...@@ -51,15 +51,17 @@...@@ -51,15 +51,17 @@
51/* Old buggy user mode depends on this being 0 */51/* Old buggy user mode depends on this being 0 */
52#define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x0008000052#define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x00080000
5353
54#define HSA_CAP_MEM_EDCSUPPORTED 0x0010000054#define HSA_CAP_MEM_EDCSUPPORTED 0x00100000
55#define HSA_CAP_RASEVENTNOTIFY 0x0020000055#define HSA_CAP_RASEVENTNOTIFY 0x00200000
56#define HSA_CAP_ASIC_REVISION_MASK 0x03c0000056#define HSA_CAP_ASIC_REVISION_MASK 0x03c00000
57#define HSA_CAP_ASIC_REVISION_SHIFT 2257#define HSA_CAP_ASIC_REVISION_SHIFT 22
58#define HSA_CAP_SRAM_EDCSUPPORTED 0x0400000058#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000
59#define HSA_CAP_SVMAPI_SUPPORTED 0x0800000059#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000
60#define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x1000000060#define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x10000000
61#define HSA_CAP_TRAP_DEBUG_FIRMWARE_SUPPORTED 0x2000000061#define HSA_CAP_TRAP_DEBUG_FIRMWARE_SUPPORTED 0x20000000
62#define HSA_CAP_RESERVED 0xe00f800062#define HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED 0x40000000
63#define HSA_CAP_PER_QUEUE_RESET_SUPPORTED 0x80000000
64#define HSA_CAP_RESERVED 0x000f8000
6365
64/* debug_prop bits in node properties */66/* debug_prop bits in node properties */
65#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f67#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f
lib/libc/include/any-linux-any/linux/kvm.h+30-1
...@@ -192,11 +192,20 @@ struct kvm_xen_exit {...@@ -192,11 +192,20 @@ struct kvm_xen_exit {
192/* Flags that describe what fields in emulation_failure hold valid data. */192/* Flags that describe what fields in emulation_failure hold valid data. */
193#define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0)193#define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0)
194194
195/*
196 * struct kvm_run can be modified by userspace at any time, so KVM must be
197 * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM()
198 * renames fields in struct kvm_run from <symbol> to <symbol>__unsafe when
199 * compiled into the kernel, ensuring that any use within KVM is obvious and
200 * gets extra scrutiny.
201 */
202#define HINT_UNSAFE_IN_KVM(_symbol) _symbol
203
195/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */204/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
196struct kvm_run {205struct kvm_run {
197 /* in */206 /* in */
198 __u8 request_interrupt_window;207 __u8 request_interrupt_window;
199 __u8 immediate_exit;208 __u8 HINT_UNSAFE_IN_KVM(immediate_exit);
200 __u8 padding1[6];209 __u8 padding1[6];
201210
202 /* out */211 /* out */
...@@ -913,6 +922,9 @@ struct kvm_enable_cap {...@@ -913,6 +922,9 @@ struct kvm_enable_cap {
913#define KVM_CAP_MEMORY_ATTRIBUTES 233922#define KVM_CAP_MEMORY_ATTRIBUTES 233
914#define KVM_CAP_GUEST_MEMFD 234923#define KVM_CAP_GUEST_MEMFD 234
915#define KVM_CAP_VM_TYPES 235924#define KVM_CAP_VM_TYPES 235
925#define KVM_CAP_PRE_FAULT_MEMORY 236
926#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237
927#define KVM_CAP_X86_GUEST_MODE 238
916928
917struct kvm_irq_routing_irqchip {929struct kvm_irq_routing_irqchip {
918 __u32 irqchip;930 __u32 irqchip;
...@@ -1138,7 +1150,15 @@ enum kvm_device_type {...@@ -1138,7 +1150,15 @@ enum kvm_device_type {
1138#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME1150#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
1139 KVM_DEV_TYPE_RISCV_AIA,1151 KVM_DEV_TYPE_RISCV_AIA,
1140#define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA1152#define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA
1153 KVM_DEV_TYPE_LOONGARCH_IPI,
1154#define KVM_DEV_TYPE_LOONGARCH_IPI KVM_DEV_TYPE_LOONGARCH_IPI
1155 KVM_DEV_TYPE_LOONGARCH_EIOINTC,
1156#define KVM_DEV_TYPE_LOONGARCH_EIOINTC KVM_DEV_TYPE_LOONGARCH_EIOINTC
1157 KVM_DEV_TYPE_LOONGARCH_PCHPIC,
1158#define KVM_DEV_TYPE_LOONGARCH_PCHPIC KVM_DEV_TYPE_LOONGARCH_PCHPIC
1159
1141 KVM_DEV_TYPE_MAX,1160 KVM_DEV_TYPE_MAX,
1161
1142};1162};
11431163
1144struct kvm_vfio_spapr_tce {1164struct kvm_vfio_spapr_tce {
...@@ -1544,4 +1564,13 @@ struct kvm_create_guest_memfd {...@@ -1544,4 +1564,13 @@ struct kvm_create_guest_memfd {
1544 __u64 reserved[6];1564 __u64 reserved[6];
1545};1565};
15461566
1567#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory)
1568
1569struct kvm_pre_fault_memory {
1570 __u64 gpa;
1571 __u64 size;
1572 __u64 flags;
1573 __u64 padding[5];
1574};
1575
1547#endif /* __LINUX_KVM_H */1576#endif /* __LINUX_KVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/landlock.h+67-29
...@@ -12,31 +12,44 @@...@@ -12,31 +12,44 @@
12#include <linux/types.h>12#include <linux/types.h>
1313
14/**14/**
15 * struct landlock_ruleset_attr - Ruleset definition15 * struct landlock_ruleset_attr - Ruleset definition.
16 *16 *
17 * Argument of sys_landlock_create_ruleset(). This structure can grow in17 * Argument of sys_landlock_create_ruleset().
18 * future versions.18 *
19 * This structure defines a set of *handled access rights*, a set of actions on
20 * different object types, which should be denied by default when the ruleset is
21 * enacted. Vice versa, access rights that are not specifically listed here are
22 * not going to be denied by this ruleset when it is enacted.
23 *
24 * For historical reasons, the %LANDLOCK_ACCESS_FS_REFER right is always denied
25 * by default, even when its bit is not set in @handled_access_fs. In order to
26 * add new rules with this access right, the bit must still be set explicitly
27 * (cf. `Filesystem flags`_).
28 *
29 * The explicit listing of *handled access rights* is required for backwards
30 * compatibility reasons. In most use cases, processes that use Landlock will
31 * *handle* a wide range or all access rights that they know about at build time
32 * (and that they have tested with a kernel that supported them all).
33 *
34 * This structure can grow in future Landlock versions.
19 */35 */
20struct landlock_ruleset_attr {36struct landlock_ruleset_attr {
21 /**37 /**
22 * @handled_access_fs: Bitmask of actions (cf. `Filesystem flags`_)38 * @handled_access_fs: Bitmask of handled filesystem actions
23 * that is handled by this ruleset and should then be forbidden if no39 * (cf. `Filesystem flags`_).
24 * rule explicitly allow them: it is a deny-by-default list that should
25 * contain as much Landlock access rights as possible. Indeed, all
26 * Landlock filesystem access rights that are not part of
27 * handled_access_fs are allowed. This is needed for backward
28 * compatibility reasons. One exception is the
29 * %LANDLOCK_ACCESS_FS_REFER access right, which is always implicitly
30 * handled, but must still be explicitly handled to add new rules with
31 * this access right.
32 */40 */
33 __u64 handled_access_fs;41 __u64 handled_access_fs;
34 /**42 /**
35 * @handled_access_net: Bitmask of actions (cf. `Network flags`_)43 * @handled_access_net: Bitmask of handled network actions (cf. `Network
36 * that is handled by this ruleset and should then be forbidden if no44 * flags`_).
37 * rule explicitly allow them.
38 */45 */
39 __u64 handled_access_net;46 __u64 handled_access_net;
47 /**
48 * @scoped: Bitmask of scopes (cf. `Scope flags`_)
49 * restricting a Landlock domain from accessing outside
50 * resources (e.g. IPCs).
51 */
52 __u64 scoped;
40};53};
4154
42/*55/*
...@@ -97,20 +110,21 @@ struct landlock_path_beneath_attr {...@@ -97,20 +110,21 @@ struct landlock_path_beneath_attr {
97 */110 */
98struct landlock_net_port_attr {111struct landlock_net_port_attr {
99 /**112 /**
100 * @allowed_access: Bitmask of allowed access network for a port113 * @allowed_access: Bitmask of allowed network actions for a port
101 * (cf. `Network flags`_).114 * (cf. `Network flags`_).
102 */115 */
103 __u64 allowed_access;116 __u64 allowed_access;
104 /**117 /**
105 * @port: Network port in host endianness.118 * @port: Network port in host endianness.
106 *119 *
107 * It should be noted that port 0 passed to :manpage:`bind(2)` will120 * It should be noted that port 0 passed to :manpage:`bind(2)` will bind
108 * bind to an available port from a specific port range. This can be121 * to an available port from the ephemeral port range. This can be
109 * configured thanks to the ``/proc/sys/net/ipv4/ip_local_port_range``122 * configured with the ``/proc/sys/net/ipv4/ip_local_port_range`` sysctl
110 * sysctl (also used for IPv6). A Landlock rule with port 0 and the123 * (also used for IPv6).
111 * ``LANDLOCK_ACCESS_NET_BIND_TCP`` right means that requesting to bind124 *
112 * on port 0 is allowed and it will automatically translate to binding125 * A Landlock rule with port 0 and the ``LANDLOCK_ACCESS_NET_BIND_TCP``
113 * on the related port range.126 * right means that requesting to bind on port 0 is allowed and it will
127 * automatically translate to binding on the related port range.
114 */128 */
115 __u64 port;129 __u64 port;
116};130};
...@@ -131,10 +145,10 @@ struct landlock_net_port_attr {...@@ -131,10 +145,10 @@ struct landlock_net_port_attr {
131 * The following access rights apply only to files:145 * The following access rights apply only to files:
132 *146 *
133 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.147 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.
134 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access. Note that148 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access. When
135 * you might additionally need the %LANDLOCK_ACCESS_FS_TRUNCATE right in order149 * opening files for writing, you will often additionally need the
136 * to overwrite files with :manpage:`open(2)` using ``O_TRUNC`` or150 * %LANDLOCK_ACCESS_FS_TRUNCATE right. In many cases, these system calls
137 * :manpage:`creat(2)`.151 * truncate existing files when overwriting them (e.g., :manpage:`creat(2)`).
138 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.152 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.
139 * - %LANDLOCK_ACCESS_FS_TRUNCATE: Truncate a file with :manpage:`truncate(2)`,153 * - %LANDLOCK_ACCESS_FS_TRUNCATE: Truncate a file with :manpage:`truncate(2)`,
140 * :manpage:`ftruncate(2)`, :manpage:`creat(2)`, or :manpage:`open(2)` with154 * :manpage:`ftruncate(2)`, :manpage:`creat(2)`, or :manpage:`open(2)` with
...@@ -256,7 +270,7 @@ struct landlock_net_port_attr {...@@ -256,7 +270,7 @@ struct landlock_net_port_attr {
256 * These flags enable to restrict a sandboxed process to a set of network270 * These flags enable to restrict a sandboxed process to a set of network
257 * actions. This is supported since the Landlock ABI version 4.271 * actions. This is supported since the Landlock ABI version 4.
258 *272 *
259 * TCP sockets with allowed actions:273 * The following access rights apply to TCP port numbers:
260 *274 *
261 * - %LANDLOCK_ACCESS_NET_BIND_TCP: Bind a TCP socket to a local port.275 * - %LANDLOCK_ACCESS_NET_BIND_TCP: Bind a TCP socket to a local port.
262 * - %LANDLOCK_ACCESS_NET_CONNECT_TCP: Connect an active TCP socket to276 * - %LANDLOCK_ACCESS_NET_CONNECT_TCP: Connect an active TCP socket to
...@@ -266,4 +280,28 @@ struct landlock_net_port_attr {...@@ -266,4 +280,28 @@ struct landlock_net_port_attr {
266#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)280#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)
267#define LANDLOCK_ACCESS_NET_CONNECT_TCP (1ULL << 1)281#define LANDLOCK_ACCESS_NET_CONNECT_TCP (1ULL << 1)
268/* clang-format on */282/* clang-format on */
283
284/**
285 * DOC: scope
286 *
287 * Scope flags
288 * ~~~~~~~~~~~
289 *
290 * These flags enable to isolate a sandboxed process from a set of IPC actions.
291 * Setting a flag for a ruleset will isolate the Landlock domain to forbid
292 * connections to resources outside the domain.
293 *
294 * Scopes:
295 *
296 * - %LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET: Restrict a sandboxed process from
297 * 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).
299 * - %LANDLOCK_SCOPE_SIGNAL: Restrict a sandboxed process from sending a signal
300 * to another process outside the domain.
301 */
302/* clang-format off */
303#define LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET (1ULL << 0)
304#define LANDLOCK_SCOPE_SIGNAL (1ULL << 1)
305/* clang-format on*/
306
269#endif /* _LINUX_LANDLOCK_H */307#endif /* _LINUX_LANDLOCK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/libc-compat.h-36
...@@ -140,25 +140,6 @@...@@ -140,25 +140,6 @@
140140
141#endif /* _NETINET_IN_H */141#endif /* _NETINET_IN_H */
142142
143/* Coordinate with glibc netipx/ipx.h header. */
144#if defined(__NETIPX_IPX_H)
145
146#define __UAPI_DEF_SOCKADDR_IPX 0
147#define __UAPI_DEF_IPX_ROUTE_DEFINITION 0
148#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 0
149#define __UAPI_DEF_IPX_CONFIG_DATA 0
150#define __UAPI_DEF_IPX_ROUTE_DEF 0
151
152#else /* defined(__NETIPX_IPX_H) */
153
154#define __UAPI_DEF_SOCKADDR_IPX 1
155#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
156#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
157#define __UAPI_DEF_IPX_CONFIG_DATA 1
158#define __UAPI_DEF_IPX_ROUTE_DEF 1
159
160#endif /* defined(__NETIPX_IPX_H) */
161
162/* Definitions for xattr.h */143/* Definitions for xattr.h */
163#if defined(_SYS_XATTR_H)144#if defined(_SYS_XATTR_H)
164#define __UAPI_DEF_XATTR 0145#define __UAPI_DEF_XATTR 0
...@@ -240,23 +221,6 @@...@@ -240,23 +221,6 @@
240#define __UAPI_DEF_IP6_MTUINFO 1221#define __UAPI_DEF_IP6_MTUINFO 1
241#endif222#endif
242223
243/* Definitions for ipx.h */
244#ifndef __UAPI_DEF_SOCKADDR_IPX
245#define __UAPI_DEF_SOCKADDR_IPX 1
246#endif
247#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
248#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
249#endif
250#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
251#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
252#endif
253#ifndef __UAPI_DEF_IPX_CONFIG_DATA
254#define __UAPI_DEF_IPX_CONFIG_DATA 1
255#endif
256#ifndef __UAPI_DEF_IPX_ROUTE_DEF
257#define __UAPI_DEF_IPX_ROUTE_DEF 1
258#endif
259
260/* Definitions for xattr.h */224/* Definitions for xattr.h */
261#ifndef __UAPI_DEF_XATTR225#ifndef __UAPI_DEF_XATTR
262#define __UAPI_DEF_XATTR 1226#define __UAPI_DEF_XATTR 1
lib/libc/include/any-linux-any/linux/lsm.h+1
...@@ -64,6 +64,7 @@ struct lsm_ctx {...@@ -64,6 +64,7 @@ struct lsm_ctx {
64#define LSM_ID_LANDLOCK 11064#define LSM_ID_LANDLOCK 110
65#define LSM_ID_IMA 11165#define LSM_ID_IMA 111
66#define LSM_ID_EVM 11266#define LSM_ID_EVM 112
67#define LSM_ID_IPE 113
6768
68/*69/*
69 * LSM_ATTR_XXX definitions identify different LSM attributes70 * LSM_ATTR_XXX definitions identify different LSM attributes
lib/libc/include/any-linux-any/linux/mdio.h+1
...@@ -23,6 +23,7 @@...@@ -23,6 +23,7 @@
23#define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */23#define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */
24#define MDIO_MMD_TC 6 /* Transmission Convergence */24#define MDIO_MMD_TC 6 /* Transmission Convergence */
25#define MDIO_MMD_AN 7 /* Auto-Negotiation */25#define MDIO_MMD_AN 7 /* Auto-Negotiation */
26#define MDIO_MMD_POWER_UNIT 13 /* PHY Power Unit */
26#define MDIO_MMD_C22EXT 29 /* Clause 22 extension */27#define MDIO_MMD_C22EXT 29 /* Clause 22 extension */
27#define MDIO_MMD_VEND1 30 /* Vendor specific 1 */28#define MDIO_MMD_VEND1 30 /* Vendor specific 1 */
28#define MDIO_MMD_VEND2 31 /* Vendor specific 2 */29#define MDIO_MMD_VEND2 31 /* Vendor specific 2 */
lib/libc/include/any-linux-any/linux/media-bus-format.h+3-1
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
3434
35#define MEDIA_BUS_FMT_FIXED 0x000135#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x1026 */37/* RGB - next is 0x1028 */
38#define MEDIA_BUS_FMT_RGB444_1X12 0x101638#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
39#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x100139#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
40#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x100240#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
...@@ -68,6 +68,8 @@...@@ -68,6 +68,8 @@
68#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d68#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
69#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f69#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f
70#define MEDIA_BUS_FMT_RGB101010_1X30 0x101870#define MEDIA_BUS_FMT_RGB101010_1X30 0x1018
71#define MEDIA_BUS_FMT_RGB101010_1X7X5_SPWG 0x1026
72#define MEDIA_BUS_FMT_RGB101010_1X7X5_JEIDA 0x1027
71#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO 0x102073#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO 0x1020
72#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x102174#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x1021
73#define MEDIA_BUS_FMT_RGB121212_1X36 0x101975#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
lib/libc/include/any-linux-any/linux/media/raspberrypi/pisp_be_config.h created+968
...@@ -0,0 +1,968 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * PiSP Back End configuration definitions.
4 *
5 * Copyright (C) 2021 - Raspberry Pi Ltd
6 *
7 */
8#ifndef _PISP_BE_CONFIG_H_
9#define _PISP_BE_CONFIG_H_
10
11#include <linux/types.h>
12
13#include "pisp_common.h"
14
15/* byte alignment for inputs */
16#define PISP_BACK_END_INPUT_ALIGN 4u
17/* alignment for compressed inputs */
18#define PISP_BACK_END_COMPRESSED_ALIGN 8u
19/* minimum required byte alignment for outputs */
20#define PISP_BACK_END_OUTPUT_MIN_ALIGN 16u
21/* preferred byte alignment for outputs */
22#define PISP_BACK_END_OUTPUT_MAX_ALIGN 64u
23
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
28
29#define PISP_BACK_END_NUM_OUTPUTS 2
30#define PISP_BACK_END_HOG_OUTPUT 1
31
32#define PISP_BACK_END_NUM_TILES 64
33
34enum pisp_be_bayer_enable {
35 PISP_BE_BAYER_ENABLE_INPUT = 0x000001,
36 PISP_BE_BAYER_ENABLE_DECOMPRESS = 0x000002,
37 PISP_BE_BAYER_ENABLE_DPC = 0x000004,
38 PISP_BE_BAYER_ENABLE_GEQ = 0x000008,
39 PISP_BE_BAYER_ENABLE_TDN_INPUT = 0x000010,
40 PISP_BE_BAYER_ENABLE_TDN_DECOMPRESS = 0x000020,
41 PISP_BE_BAYER_ENABLE_TDN = 0x000040,
42 PISP_BE_BAYER_ENABLE_TDN_COMPRESS = 0x000080,
43 PISP_BE_BAYER_ENABLE_TDN_OUTPUT = 0x000100,
44 PISP_BE_BAYER_ENABLE_SDN = 0x000200,
45 PISP_BE_BAYER_ENABLE_BLC = 0x000400,
46 PISP_BE_BAYER_ENABLE_STITCH_INPUT = 0x000800,
47 PISP_BE_BAYER_ENABLE_STITCH_DECOMPRESS = 0x001000,
48 PISP_BE_BAYER_ENABLE_STITCH = 0x002000,
49 PISP_BE_BAYER_ENABLE_STITCH_COMPRESS = 0x004000,
50 PISP_BE_BAYER_ENABLE_STITCH_OUTPUT = 0x008000,
51 PISP_BE_BAYER_ENABLE_WBG = 0x010000,
52 PISP_BE_BAYER_ENABLE_CDN = 0x020000,
53 PISP_BE_BAYER_ENABLE_LSC = 0x040000,
54 PISP_BE_BAYER_ENABLE_TONEMAP = 0x080000,
55 PISP_BE_BAYER_ENABLE_CAC = 0x100000,
56 PISP_BE_BAYER_ENABLE_DEBIN = 0x200000,
57 PISP_BE_BAYER_ENABLE_DEMOSAIC = 0x400000,
58};
59
60enum pisp_be_rgb_enable {
61 PISP_BE_RGB_ENABLE_INPUT = 0x000001,
62 PISP_BE_RGB_ENABLE_CCM = 0x000002,
63 PISP_BE_RGB_ENABLE_SAT_CONTROL = 0x000004,
64 PISP_BE_RGB_ENABLE_YCBCR = 0x000008,
65 PISP_BE_RGB_ENABLE_FALSE_COLOUR = 0x000010,
66 PISP_BE_RGB_ENABLE_SHARPEN = 0x000020,
67 /* Preferred colours would occupy 0x000040 */
68 PISP_BE_RGB_ENABLE_YCBCR_INVERSE = 0x000080,
69 PISP_BE_RGB_ENABLE_GAMMA = 0x000100,
70 PISP_BE_RGB_ENABLE_CSC0 = 0x000200,
71 PISP_BE_RGB_ENABLE_CSC1 = 0x000400,
72 PISP_BE_RGB_ENABLE_DOWNSCALE0 = 0x001000,
73 PISP_BE_RGB_ENABLE_DOWNSCALE1 = 0x002000,
74 PISP_BE_RGB_ENABLE_RESAMPLE0 = 0x008000,
75 PISP_BE_RGB_ENABLE_RESAMPLE1 = 0x010000,
76 PISP_BE_RGB_ENABLE_OUTPUT0 = 0x040000,
77 PISP_BE_RGB_ENABLE_OUTPUT1 = 0x080000,
78 PISP_BE_RGB_ENABLE_HOG = 0x200000
79};
80
81#define PISP_BE_RGB_ENABLE_CSC(i) (PISP_BE_RGB_ENABLE_CSC0 << (i))
82#define PISP_BE_RGB_ENABLE_DOWNSCALE(i) (PISP_BE_RGB_ENABLE_DOWNSCALE0 << (i))
83#define PISP_BE_RGB_ENABLE_RESAMPLE(i) (PISP_BE_RGB_ENABLE_RESAMPLE0 << (i))
84#define PISP_BE_RGB_ENABLE_OUTPUT(i) (PISP_BE_RGB_ENABLE_OUTPUT0 << (i))
85
86/*
87 * We use the enable flags to show when blocks are "dirty", but we need some
88 * extra ones too.
89 */
90enum pisp_be_dirty {
91 PISP_BE_DIRTY_GLOBAL = 0x0001,
92 PISP_BE_DIRTY_SH_FC_COMBINE = 0x0002,
93 PISP_BE_DIRTY_CROP = 0x0004
94};
95
96/**
97 * struct pisp_be_global_config - PiSP global enable bitmaps
98 * @bayer_enables: Bayer input enable flags
99 * @rgb_enables: RGB output enable flags
100 * @bayer_order: Bayer input format ordering
101 * @pad: Padding bytes
102 */
103struct pisp_be_global_config {
104 __u32 bayer_enables;
105 __u32 rgb_enables;
106 __u8 bayer_order;
107 __u8 pad[3];
108} __attribute__((packed));
109
110/**
111 * struct pisp_be_input_buffer_config - PiSP Back End input buffer
112 * @addr: Input buffer address
113 */
114struct pisp_be_input_buffer_config {
115 /* low 32 bits followed by high 32 bits (for each of up to 3 planes) */
116 __u32 addr[3][2];
117} __attribute__((packed));
118
119/**
120 * struct pisp_be_dpc_config - PiSP Back End DPC config
121 *
122 * Defective Pixel Correction configuration
123 *
124 * @coeff_level: Coefficient for the darkest neighbouring pixel value
125 * @coeff_range: Coefficient for the range of pixels for this Bayer channel
126 * @pad: Padding byte
127 * @flags: DPC configuration flags
128 */
129struct pisp_be_dpc_config {
130 __u8 coeff_level;
131 __u8 coeff_range;
132 __u8 pad;
133#define PISP_BE_DPC_FLAG_FOLDBACK 1
134 __u8 flags;
135} __attribute__((packed));
136
137/**
138 * struct pisp_be_geq_config - PiSP Back End GEQ config
139 *
140 * Green Equalisation configuration
141 *
142 * @offset: Offset value for threshold calculation
143 * @slope_sharper: Slope/Sharper configuration
144 * @min: Minimum value the threshold may have
145 * @max: Maximum value the threshold may have
146 */
147struct pisp_be_geq_config {
148 __u16 offset;
149#define PISP_BE_GEQ_SHARPER (1U << 15)
150#define PISP_BE_GEQ_SLOPE ((1 << 10) - 1)
151 /* top bit is the "sharper" flag, slope value is bottom 10 bits */
152 __u16 slope_sharper;
153 __u16 min;
154 __u16 max;
155} __attribute__((packed));
156
157/**
158 * struct pisp_be_tdn_input_buffer_config - PiSP Back End TDN input buffer
159 * @addr: TDN input buffer address
160 */
161struct pisp_be_tdn_input_buffer_config {
162 /* low 32 bits followed by high 32 bits */
163 __u32 addr[2];
164} __attribute__((packed));
165
166/**
167 * struct pisp_be_tdn_config - PiSP Back End TDN config
168 *
169 * Temporal Denoise configuration
170 *
171 * @black_level: Black level value subtracted from pixels
172 * @ratio: Multiplier for the LTA input frame
173 * @noise_constant: Constant offset value used in noise estimation
174 * @noise_slope: Noise estimation multiplier
175 * @threshold: Threshold for TDN operations
176 * @reset: Disable TDN operations
177 * @pad: Padding byte
178 */
179struct pisp_be_tdn_config {
180 __u16 black_level;
181 __u16 ratio;
182 __u16 noise_constant;
183 __u16 noise_slope;
184 __u16 threshold;
185 __u8 reset;
186 __u8 pad;
187} __attribute__((packed));
188
189/**
190 * struct pisp_be_tdn_output_buffer_config - PiSP Back End TDN output buffer
191 * @addr: TDN output buffer address
192 */
193struct pisp_be_tdn_output_buffer_config {
194 /* low 32 bits followed by high 32 bits */
195 __u32 addr[2];
196} __attribute__((packed));
197
198/**
199 * struct pisp_be_sdn_config - PiSP Back End SDN config
200 *
201 * Spatial Denoise configuration
202 *
203 * @black_level: Black level subtracted from pixel for noise estimation
204 * @leakage: Proportion of the original undenoised value to mix in
205 * denoised output
206 * @pad: Padding byte
207 * @noise_constant: Noise constant used for noise estimation
208 * @noise_slope: Noise slope value used for noise estimation
209 * @noise_constant2: Second noise constant used for noise estimation
210 * @noise_slope2: Second slope value used for noise estimation
211 */
212struct pisp_be_sdn_config {
213 __u16 black_level;
214 __u8 leakage;
215 __u8 pad;
216 __u16 noise_constant;
217 __u16 noise_slope;
218 __u16 noise_constant2;
219 __u16 noise_slope2;
220} __attribute__((packed));
221
222/**
223 * struct pisp_be_stitch_input_buffer_config - PiSP Back End Stitch input
224 * @addr: Stitch input buffer address
225 */
226struct pisp_be_stitch_input_buffer_config {
227 /* low 32 bits followed by high 32 bits */
228 __u32 addr[2];
229} __attribute__((packed));
230
231#define PISP_BE_STITCH_STREAMING_LONG 0x8000
232#define PISP_BE_STITCH_EXPOSURE_RATIO_MASK 0x7fff
233
234/**
235 * struct pisp_be_stitch_config - PiSP Back End Stitch config
236 *
237 * Stitch block configuration
238 *
239 * @threshold_lo: Low threshold value
240 * @threshold_diff_power: Low and high threshold difference
241 * @pad: Padding bytes
242 * @exposure_ratio: Multiplier to convert long exposure pixels into
243 * short exposure pixels
244 * @motion_threshold_256: Motion threshold above which short exposure
245 * pixels are used
246 * @motion_threshold_recip: Reciprocal of motion_threshold_256 value
247 */
248struct pisp_be_stitch_config {
249 __u16 threshold_lo;
250 __u8 threshold_diff_power;
251 __u8 pad;
252
253 /* top bit indicates whether streaming input is the long exposure */
254 __u16 exposure_ratio;
255
256 __u8 motion_threshold_256;
257 __u8 motion_threshold_recip;
258} __attribute__((packed));
259
260/**
261 * struct pisp_be_stitch_output_buffer_config - PiSP Back End Stitch output
262 * @addr: Stitch input buffer address
263 */
264struct pisp_be_stitch_output_buffer_config {
265 /* low 32 bits followed by high 32 bits */
266 __u32 addr[2];
267} __attribute__((packed));
268
269/**
270 * struct pisp_be_cdn_config - PiSP Back End CDN config
271 *
272 * Colour Denoise configuration
273 *
274 * @thresh: Constant for noise estimation
275 * @iir_strength: Relative strength of the IIR part of the filter
276 * @g_adjust: Proportion of the change assigned to the G channel
277 */
278struct pisp_be_cdn_config {
279 __u16 thresh;
280 __u8 iir_strength;
281 __u8 g_adjust;
282} __attribute__((packed));
283
284#define PISP_BE_LSC_LOG_GRID_SIZE 5
285#define PISP_BE_LSC_GRID_SIZE (1 << PISP_BE_LSC_LOG_GRID_SIZE)
286#define PISP_BE_LSC_STEP_PRECISION 18
287
288/**
289 * struct pisp_be_lsc_config - PiSP Back End LSC config
290 *
291 * Lens Shading Correction configuration
292 *
293 * @grid_step_x: Reciprocal of cell size width
294 * @grid_step_y: Reciprocal of cell size height
295 * @lut_packed: Jointly-coded RGB gains for each LSC grid
296 */
297struct pisp_be_lsc_config {
298 /* (1<<18) / grid_cell_width */
299 __u16 grid_step_x;
300 /* (1<<18) / grid_cell_height */
301 __u16 grid_step_y;
302 /* RGB gains jointly encoded in 32 bits */
303#define PISP_BE_LSC_LUT_SIZE (PISP_BE_LSC_GRID_SIZE + 1)
304 __u32 lut_packed[PISP_BE_LSC_LUT_SIZE][PISP_BE_LSC_LUT_SIZE];
305} __attribute__((packed));
306
307/**
308 * struct pisp_be_lsc_extra - PiSP Back End LSC Extra config
309 * @offset_x: Horizontal offset into the LSC table of this tile
310 * @offset_y: Vertical offset into the LSC table of this tile
311 */
312struct pisp_be_lsc_extra {
313 __u16 offset_x;
314 __u16 offset_y;
315} __attribute__((packed));
316
317#define PISP_BE_CAC_LOG_GRID_SIZE 3
318#define PISP_BE_CAC_GRID_SIZE (1 << PISP_BE_CAC_LOG_GRID_SIZE)
319#define PISP_BE_CAC_STEP_PRECISION 20
320
321/**
322 * struct pisp_be_cac_config - PiSP Back End CAC config
323 *
324 * Chromatic Aberration Correction config
325 *
326 * @grid_step_x: Reciprocal of cell size width
327 * @grid_step_y: Reciprocal of cell size height
328 * @lut: Pixel shift for the CAC grid
329 */
330struct pisp_be_cac_config {
331 /* (1<<20) / grid_cell_width */
332 __u16 grid_step_x;
333 /* (1<<20) / grid_cell_height */
334 __u16 grid_step_y;
335 /* [gridy][gridx][rb][xy] */
336#define PISP_BE_CAC_LUT_SIZE (PISP_BE_CAC_GRID_SIZE + 1)
337 __s8 lut[PISP_BE_CAC_LUT_SIZE][PISP_BE_CAC_LUT_SIZE][2][2];
338} __attribute__((packed));
339
340/**
341 * struct pisp_be_cac_extra - PiSP Back End CAC extra config
342 * @offset_x: Horizontal offset into the CAC table of this tile
343 * @offset_y: Horizontal offset into the CAC table of this tile
344 */
345struct pisp_be_cac_extra {
346 __u16 offset_x;
347 __u16 offset_y;
348} __attribute__((packed));
349
350#define PISP_BE_DEBIN_NUM_COEFFS 4
351
352/**
353 * struct pisp_be_debin_config - PiSP Back End Debin config
354 *
355 * Debinning configuration
356 *
357 * @coeffs: Filter coefficients for debinning
358 * @h_enable: Horizontal debinning enable
359 * @v_enable: Vertical debinning enable
360 * @pad: Padding bytes
361 */
362struct pisp_be_debin_config {
363 __s8 coeffs[PISP_BE_DEBIN_NUM_COEFFS];
364 __s8 h_enable;
365 __s8 v_enable;
366 __s8 pad[2];
367} __attribute__((packed));
368
369#define PISP_BE_TONEMAP_LUT_SIZE 64
370
371/**
372 * struct pisp_be_tonemap_config - PiSP Back End Tonemap config
373 *
374 * Tonemapping configuration
375 *
376 * @detail_constant: Constant value for threshold calculation
377 * @detail_slope: Slope value for threshold calculation
378 * @iir_strength: Relative strength of the IIR fiter
379 * @strength: Strength factor
380 * @lut: Look-up table for tonemap curve
381 */
382struct pisp_be_tonemap_config {
383 __u16 detail_constant;
384 __u16 detail_slope;
385 __u16 iir_strength;
386 __u16 strength;
387 __u32 lut[PISP_BE_TONEMAP_LUT_SIZE];
388} __attribute__((packed));
389
390/**
391 * struct pisp_be_demosaic_config - PiSP Back End Demosaic config
392 *
393 * Demosaic configuration
394 *
395 * @sharper: Use other Bayer channels to increase sharpness
396 * @fc_mode: Built-in false colour suppression mode
397 * @pad: Padding bytes
398 */
399struct pisp_be_demosaic_config {
400 __u8 sharper;
401 __u8 fc_mode;
402 __u8 pad[2];
403} __attribute__((packed));
404
405/**
406 * struct pisp_be_ccm_config - PiSP Back End CCM config
407 *
408 * Colour Correction Matrix configuration
409 *
410 * @coeffs: Matrix coefficients
411 * @pad: Padding bytes
412 * @offsets: Offsets triplet
413 */
414struct pisp_be_ccm_config {
415 __s16 coeffs[9];
416 __u8 pad[2];
417 __s32 offsets[3];
418} __attribute__((packed));
419
420/**
421 * struct pisp_be_sat_control_config - PiSP Back End SAT config
422 *
423 * Saturation Control configuration
424 *
425 * @shift_r: Left shift for Red colour channel
426 * @shift_g: Left shift for Green colour channel
427 * @shift_b: Left shift for Blue colour channel
428 * @pad: Padding byte
429 */
430struct pisp_be_sat_control_config {
431 __u8 shift_r;
432 __u8 shift_g;
433 __u8 shift_b;
434 __u8 pad;
435} __attribute__((packed));
436
437/**
438 * struct pisp_be_false_colour_config - PiSP Back End False Colour config
439 *
440 * False Colour configuration
441 *
442 * @distance: Distance of neighbouring pixels, either 1 or 2
443 * @pad: Padding bytes
444 */
445struct pisp_be_false_colour_config {
446 __u8 distance;
447 __u8 pad[3];
448} __attribute__((packed));
449
450#define PISP_BE_SHARPEN_SIZE 5
451#define PISP_BE_SHARPEN_FUNC_NUM_POINTS 9
452
453/**
454 * struct pisp_be_sharpen_config - PiSP Back End Sharpening config
455 *
456 * Sharpening configuration
457 *
458 * @kernel0: Coefficient for filter 0
459 * @pad0: Padding byte
460 * @kernel1: Coefficient for filter 1
461 * @pad1: Padding byte
462 * @kernel2: Coefficient for filter 2
463 * @pad2: Padding byte
464 * @kernel3: Coefficient for filter 3
465 * @pad3: Padding byte
466 * @kernel4: Coefficient for filter 4
467 * @pad4: Padding byte
468 * @threshold_offset0: Offset for filter 0 response calculation
469 * @threshold_slope0: Slope multiplier for the filter 0 response calculation
470 * @scale0: Scale factor for filter 0 response calculation
471 * @pad5: Padding byte
472 * @threshold_offset1: Offset for filter 0 response calculation
473 * @threshold_slope1: Slope multiplier for the filter 0 response calculation
474 * @scale1: Scale factor for filter 0 response calculation
475 * @pad6: Padding byte
476 * @threshold_offset2: Offset for filter 0 response calculation
477 * @threshold_slope2: Slope multiplier for the filter 0 response calculation
478 * @scale2: Scale factor for filter 0 response calculation
479 * @pad7: Padding byte
480 * @threshold_offset3: Offset for filter 0 response calculation
481 * @threshold_slope3: Slope multiplier for the filter 0 response calculation
482 * @scale3: Scale factor for filter 0 response calculation
483 * @pad8: Padding byte
484 * @threshold_offset4: Offset for filter 0 response calculation
485 * @threshold_slope4: Slope multiplier for the filter 0 response calculation
486 * @scale4: Scale factor for filter 0 response calculation
487 * @pad9: Padding byte
488 * @positive_strength: Factor to scale the positive sharpening strength
489 * @positive_pre_limit: Maximum allowed possible positive sharpening value
490 * @positive_func: Gain factor applied to positive sharpening response
491 * @positive_limit: Final gain factor applied to positive sharpening
492 * @negative_strength: Factor to scale the negative sharpening strength
493 * @negative_pre_limit: Maximum allowed possible negative sharpening value
494 * @negative_func: Gain factor applied to negative sharpening response
495 * @negative_limit: Final gain factor applied to negative sharpening
496 * @enables: Filter enable mask
497 * @white: White output pixel filter mask
498 * @black: Black output pixel filter mask
499 * @grey: Grey output pixel filter mask
500 */
501struct pisp_be_sharpen_config {
502 __s8 kernel0[PISP_BE_SHARPEN_SIZE * PISP_BE_SHARPEN_SIZE];
503 __s8 pad0[3];
504 __s8 kernel1[PISP_BE_SHARPEN_SIZE * PISP_BE_SHARPEN_SIZE];
505 __s8 pad1[3];
506 __s8 kernel2[PISP_BE_SHARPEN_SIZE * PISP_BE_SHARPEN_SIZE];
507 __s8 pad2[3];
508 __s8 kernel3[PISP_BE_SHARPEN_SIZE * PISP_BE_SHARPEN_SIZE];
509 __s8 pad3[3];
510 __s8 kernel4[PISP_BE_SHARPEN_SIZE * PISP_BE_SHARPEN_SIZE];
511 __s8 pad4[3];
512 __u16 threshold_offset0;
513 __u16 threshold_slope0;
514 __u16 scale0;
515 __u16 pad5;
516 __u16 threshold_offset1;
517 __u16 threshold_slope1;
518 __u16 scale1;
519 __u16 pad6;
520 __u16 threshold_offset2;
521 __u16 threshold_slope2;
522 __u16 scale2;
523 __u16 pad7;
524 __u16 threshold_offset3;
525 __u16 threshold_slope3;
526 __u16 scale3;
527 __u16 pad8;
528 __u16 threshold_offset4;
529 __u16 threshold_slope4;
530 __u16 scale4;
531 __u16 pad9;
532 __u16 positive_strength;
533 __u16 positive_pre_limit;
534 __u16 positive_func[PISP_BE_SHARPEN_FUNC_NUM_POINTS];
535 __u16 positive_limit;
536 __u16 negative_strength;
537 __u16 negative_pre_limit;
538 __u16 negative_func[PISP_BE_SHARPEN_FUNC_NUM_POINTS];
539 __u16 negative_limit;
540 __u8 enables;
541 __u8 white;
542 __u8 black;
543 __u8 grey;
544} __attribute__((packed));
545
546/**
547 * struct pisp_be_sh_fc_combine_config - PiSP Back End Sharpening and
548 * False Colour config
549 *
550 * Sharpening and False Colour configuration
551 *
552 * @y_factor: Control amount of desaturation of pixels being darkened
553 * @c1_factor: Control amount of brightening of a pixel for the Cb
554 * channel
555 * @c2_factor: Control amount of brightening of a pixel for the Cr
556 * channel
557 * @pad: Padding byte
558 */
559struct pisp_be_sh_fc_combine_config {
560 __u8 y_factor;
561 __u8 c1_factor;
562 __u8 c2_factor;
563 __u8 pad;
564} __attribute__((packed));
565
566#define PISP_BE_GAMMA_LUT_SIZE 64
567
568/**
569 * struct pisp_be_gamma_config - PiSP Back End Gamma configuration
570 * @lut: Gamma curve look-up table
571 */
572struct pisp_be_gamma_config {
573 __u32 lut[PISP_BE_GAMMA_LUT_SIZE];
574} __attribute__((packed));
575
576/**
577 * struct pisp_be_crop_config - PiSP Back End Crop config
578 *
579 * Crop configuration
580 *
581 * @offset_x: Number of pixels cropped from the left of the tile
582 * @offset_y: Number of pixels cropped from the top of the tile
583 * @width: Width of the cropped tile output
584 * @height: Height of the cropped tile output
585 */
586struct pisp_be_crop_config {
587 __u16 offset_x, offset_y;
588 __u16 width, height;
589} __attribute__((packed));
590
591#define PISP_BE_RESAMPLE_FILTER_SIZE 96
592
593/**
594 * struct pisp_be_resample_config - PiSP Back End Resampling config
595 *
596 * Resample configuration
597 *
598 * @scale_factor_h: Horizontal scale factor
599 * @scale_factor_v: Vertical scale factor
600 * @coef: Resample coefficients
601 */
602struct pisp_be_resample_config {
603 __u16 scale_factor_h, scale_factor_v;
604 __s16 coef[PISP_BE_RESAMPLE_FILTER_SIZE];
605} __attribute__((packed));
606
607/**
608 * struct pisp_be_resample_extra - PiSP Back End Resample config
609 *
610 * Resample configuration
611 *
612 * @scaled_width: Width in pixels of the scaled output
613 * @scaled_height: Height in pixels of the scaled output
614 * @initial_phase_h: Initial horizontal phase
615 * @initial_phase_v: Initial vertical phase
616 */
617struct pisp_be_resample_extra {
618 __u16 scaled_width;
619 __u16 scaled_height;
620 __s16 initial_phase_h[3];
621 __s16 initial_phase_v[3];
622} __attribute__((packed));
623
624/**
625 * struct pisp_be_downscale_config - PiSP Back End Downscale config
626 *
627 * Downscale configuration
628 *
629 * @scale_factor_h: Horizontal scale factor
630 * @scale_factor_v: Vertical scale factor
631 * @scale_recip_h: Horizontal reciprocal factor
632 * @scale_recip_v: Vertical reciprocal factor
633 */
634struct pisp_be_downscale_config {
635 __u16 scale_factor_h;
636 __u16 scale_factor_v;
637 __u16 scale_recip_h;
638 __u16 scale_recip_v;
639} __attribute__((packed));
640
641/**
642 * struct pisp_be_downscale_extra - PiSP Back End Downscale Extra config
643 * @scaled_width: Scaled image width
644 * @scaled_height: Scaled image height
645 */
646struct pisp_be_downscale_extra {
647 __u16 scaled_width;
648 __u16 scaled_height;
649} __attribute__((packed));
650
651/**
652 * struct pisp_be_hog_config - PiSP Back End HOG config
653 *
654 * Histogram of Oriented Gradients configuration
655 *
656 * @compute_signed: Set 0 for unsigned gradients, 1 for signed
657 * @channel_mix: Channels proportions to use
658 * @stride: Stride in bytes between blocks directly below
659 */
660struct pisp_be_hog_config {
661 __u8 compute_signed;
662 __u8 channel_mix[3];
663 __u32 stride;
664} __attribute__((packed));
665
666struct pisp_be_axi_config {
667 __u8 r_qos; /* Read QoS */
668 __u8 r_cache_prot; /* Read { prot[2:0], cache[3:0] } */
669 __u8 w_qos; /* Write QoS */
670 __u8 w_cache_prot; /* Write { prot[2:0], cache[3:0] } */
671} __attribute__((packed));
672
673/**
674 * enum pisp_be_transform - PiSP Back End Transform flags
675 * @PISP_BE_TRANSFORM_NONE: No transform
676 * @PISP_BE_TRANSFORM_HFLIP: Horizontal flip
677 * @PISP_BE_TRANSFORM_VFLIP: Vertical flip
678 * @PISP_BE_TRANSFORM_ROT180: 180 degress rotation
679 */
680enum pisp_be_transform {
681 PISP_BE_TRANSFORM_NONE = 0x0,
682 PISP_BE_TRANSFORM_HFLIP = 0x1,
683 PISP_BE_TRANSFORM_VFLIP = 0x2,
684 PISP_BE_TRANSFORM_ROT180 =
685 (PISP_BE_TRANSFORM_HFLIP | PISP_BE_TRANSFORM_VFLIP)
686};
687
688struct pisp_be_output_format_config {
689 struct pisp_image_format_config image;
690 __u8 transform;
691 __u8 pad[3];
692 __u16 lo;
693 __u16 hi;
694 __u16 lo2;
695 __u16 hi2;
696} __attribute__((packed));
697
698/**
699 * struct pisp_be_output_buffer_config - PiSP Back End Output buffer
700 * @addr: Output buffer address
701 */
702struct pisp_be_output_buffer_config {
703 /* low 32 bits followed by high 32 bits (for each of 3 planes) */
704 __u32 addr[3][2];
705} __attribute__((packed));
706
707/**
708 * struct pisp_be_hog_buffer_config - PiSP Back End HOG buffer
709 * @addr: HOG buffer address
710 */
711struct pisp_be_hog_buffer_config {
712 /* low 32 bits followed by high 32 bits */
713 __u32 addr[2];
714} __attribute__((packed));
715
716/**
717 * struct pisp_be_config - RaspberryPi PiSP Back End Processing configuration
718 *
719 * @input_buffer: Input buffer addresses
720 * @tdn_input_buffer: TDN input buffer addresses
721 * @stitch_input_buffer: Stitch input buffer addresses
722 * @tdn_output_buffer: TDN output buffer addresses
723 * @stitch_output_buffer: Stitch output buffer addresses
724 * @output_buffer: Output buffers addresses
725 * @hog_buffer: HOG buffer addresses
726 * @global: Global PiSP configuration
727 * @input_format: Input image format
728 * @decompress: Decompress configuration
729 * @dpc: Defective Pixel Correction configuration
730 * @geq: Green Equalisation configuration
731 * @tdn_input_format: Temporal Denoise input format
732 * @tdn_decompress: Temporal Denoise decompress configuration
733 * @tdn: Temporal Denoise configuration
734 * @tdn_compress: Temporal Denoise compress configuration
735 * @tdn_output_format: Temporal Denoise output format
736 * @sdn: Spatial Denoise configuration
737 * @blc: Black Level Correction configuration
738 * @stitch_compress: Stitch compress configuration
739 * @stitch_output_format: Stitch output format
740 * @stitch_input_format: Stitch input format
741 * @stitch_decompress: Stitch decompress configuration
742 * @stitch: Stitch configuration
743 * @lsc: Lens Shading Correction configuration
744 * @wbg: White Balance Gain configuration
745 * @cdn: Colour Denoise configuration
746 * @cac: Colour Aberration Correction configuration
747 * @debin: Debinning configuration
748 * @tonemap: Tonemapping configuration
749 * @demosaic: Demosaicing configuration
750 * @ccm: Colour Correction Matrix configuration
751 * @sat_control: Saturation Control configuration
752 * @ycbcr: YCbCr colour correction configuration
753 * @sharpen: Sharpening configuration
754 * @false_colour: False colour correction
755 * @sh_fc_combine: Sharpening and False Colour correction
756 * @ycbcr_inverse: Inverse YCbCr colour correction
757 * @gamma: Gamma curve configuration
758 * @csc: Color Space Conversion configuration
759 * @downscale: Downscale configuration
760 * @resample: Resampling configuration
761 * @output_format: Output format configuration
762 * @hog: HOG configuration
763 * @axi: AXI bus configuration
764 * @lsc_extra: LSC extra info
765 * @cac_extra: CAC extra info
766 * @downscale_extra: Downscaler extra info
767 * @resample_extra: Resample extra info
768 * @crop: Crop configuration
769 * @hog_format: HOG format info
770 * @dirty_flags_bayer: Bayer enable dirty flags
771 * (:c:type:`pisp_be_bayer_enable`)
772 * @dirty_flags_rgb: RGB enable dirty flags
773 * (:c:type:`pisp_be_rgb_enable`)
774 * @dirty_flags_extra: Extra dirty flags
775 */
776struct pisp_be_config {
777 /* I/O configuration: */
778 struct pisp_be_input_buffer_config input_buffer;
779 struct pisp_be_tdn_input_buffer_config tdn_input_buffer;
780 struct pisp_be_stitch_input_buffer_config stitch_input_buffer;
781 struct pisp_be_tdn_output_buffer_config tdn_output_buffer;
782 struct pisp_be_stitch_output_buffer_config stitch_output_buffer;
783 struct pisp_be_output_buffer_config
784 output_buffer[PISP_BACK_END_NUM_OUTPUTS];
785 struct pisp_be_hog_buffer_config hog_buffer;
786 /* Processing configuration: */
787 struct pisp_be_global_config global;
788 struct pisp_image_format_config input_format;
789 struct pisp_decompress_config decompress;
790 struct pisp_be_dpc_config dpc;
791 struct pisp_be_geq_config geq;
792 struct pisp_image_format_config tdn_input_format;
793 struct pisp_decompress_config tdn_decompress;
794 struct pisp_be_tdn_config tdn;
795 struct pisp_compress_config tdn_compress;
796 struct pisp_image_format_config tdn_output_format;
797 struct pisp_be_sdn_config sdn;
798 struct pisp_bla_config blc;
799 struct pisp_compress_config stitch_compress;
800 struct pisp_image_format_config stitch_output_format;
801 struct pisp_image_format_config stitch_input_format;
802 struct pisp_decompress_config stitch_decompress;
803 struct pisp_be_stitch_config stitch;
804 struct pisp_be_lsc_config lsc;
805 struct pisp_wbg_config wbg;
806 struct pisp_be_cdn_config cdn;
807 struct pisp_be_cac_config cac;
808 struct pisp_be_debin_config debin;
809 struct pisp_be_tonemap_config tonemap;
810 struct pisp_be_demosaic_config demosaic;
811 struct pisp_be_ccm_config ccm;
812 struct pisp_be_sat_control_config sat_control;
813 struct pisp_be_ccm_config ycbcr;
814 struct pisp_be_sharpen_config sharpen;
815 struct pisp_be_false_colour_config false_colour;
816 struct pisp_be_sh_fc_combine_config sh_fc_combine;
817 struct pisp_be_ccm_config ycbcr_inverse;
818 struct pisp_be_gamma_config gamma;
819 struct pisp_be_ccm_config csc[PISP_BACK_END_NUM_OUTPUTS];
820 struct pisp_be_downscale_config downscale[PISP_BACK_END_NUM_OUTPUTS];
821 struct pisp_be_resample_config resample[PISP_BACK_END_NUM_OUTPUTS];
822 struct pisp_be_output_format_config
823 output_format[PISP_BACK_END_NUM_OUTPUTS];
824 struct pisp_be_hog_config hog;
825 struct pisp_be_axi_config axi;
826 /* Non-register fields: */
827 struct pisp_be_lsc_extra lsc_extra;
828 struct pisp_be_cac_extra cac_extra;
829 struct pisp_be_downscale_extra
830 downscale_extra[PISP_BACK_END_NUM_OUTPUTS];
831 struct pisp_be_resample_extra resample_extra[PISP_BACK_END_NUM_OUTPUTS];
832 struct pisp_be_crop_config crop;
833 struct pisp_image_format_config hog_format;
834 __u32 dirty_flags_bayer; /* these use pisp_be_bayer_enable */
835 __u32 dirty_flags_rgb; /* use pisp_be_rgb_enable */
836 __u32 dirty_flags_extra; /* these use pisp_be_dirty_t */
837} __attribute__((packed));
838
839/**
840 * enum pisp_tile_edge - PiSP Back End Tile position
841 * @PISP_LEFT_EDGE: Left edge tile
842 * @PISP_RIGHT_EDGE: Right edge tile
843 * @PISP_TOP_EDGE: Top edge tile
844 * @PISP_BOTTOM_EDGE: Bottom edge tile
845 */
846enum pisp_tile_edge {
847 PISP_LEFT_EDGE = (1 << 0),
848 PISP_RIGHT_EDGE = (1 << 1),
849 PISP_TOP_EDGE = (1 << 2),
850 PISP_BOTTOM_EDGE = (1 << 3)
851};
852
853/**
854 * struct pisp_tile - Raspberry Pi PiSP Back End tile configuration
855 *
856 * Tile parameters: each set of tile parameters is a 160-bytes block of data
857 * which contains the tile processing parameters.
858 *
859 * @edge: Edge tile flag
860 * @pad0: Padding bytes
861 * @input_addr_offset: Top-left pixel offset, in bytes
862 * @input_addr_offset2: Top-left pixel offset, in bytes for the second/
863 * third image planes
864 * @input_offset_x: Horizontal offset in pixels of this tile in the
865 * input image
866 * @input_offset_y: Vertical offset in pixels of this tile in the
867 * input image
868 * @input_width: Width in pixels of this tile
869 * @input_height: Height in pixels of the this tile
870 * @tdn_input_addr_offset: TDN input image offset, in bytes
871 * @tdn_output_addr_offset: TDN output image offset, in bytes
872 * @stitch_input_addr_offset: Stitch input image offset, in bytes
873 * @stitch_output_addr_offset: Stitch output image offset, in bytes
874 * @lsc_grid_offset_x: Horizontal offset in the LSC table for this tile
875 * @lsc_grid_offset_y: Vertical offset in the LSC table for this tile
876 * @cac_grid_offset_x: Horizontal offset in the CAC table for this tile
877 * @cac_grid_offset_y: Horizontal offset in the CAC table for this tile
878 * @crop_x_start: Number of pixels cropped from the left of the
879 * tile
880 * @crop_x_end: Number of pixels cropped from the right of the
881 * tile
882 * @crop_y_start: Number of pixels cropped from the top of the
883 * tile
884 * @crop_y_end: Number of pixels cropped from the bottom of the
885 * tile
886 * @downscale_phase_x: Initial horizontal phase in pixels
887 * @downscale_phase_y: Initial vertical phase in pixels
888 * @resample_in_width: Width in pixels of the tile entering the
889 * Resample block
890 * @resample_in_height: Height in pixels of the tile entering the
891 * Resample block
892 * @resample_phase_x: Initial horizontal phase for the Resample block
893 * @resample_phase_y: Initial vertical phase for the Resample block
894 * @output_offset_x: Horizontal offset in pixels where the tile will
895 * be written into the output image
896 * @output_offset_y: Vertical offset in pixels where the tile will be
897 * written into the output image
898 * @output_width: Width in pixels in the output image of this tile
899 * @output_height: Height in pixels in the output image of this tile
900 * @output_addr_offset: Offset in bytes into the output buffer
901 * @output_addr_offset2: Offset in bytes into the output buffer for the
902 * second and third plane
903 * @output_hog_addr_offset: Offset in bytes into the HOG buffer where
904 * results of this tile are to be written
905 */
906struct pisp_tile {
907 __u8 edge; /* enum pisp_tile_edge */
908 __u8 pad0[3];
909 /* 4 bytes */
910 __u32 input_addr_offset;
911 __u32 input_addr_offset2;
912 __u16 input_offset_x;
913 __u16 input_offset_y;
914 __u16 input_width;
915 __u16 input_height;
916 /* 20 bytes */
917 __u32 tdn_input_addr_offset;
918 __u32 tdn_output_addr_offset;
919 __u32 stitch_input_addr_offset;
920 __u32 stitch_output_addr_offset;
921 /* 36 bytes */
922 __u32 lsc_grid_offset_x;
923 __u32 lsc_grid_offset_y;
924 /* 44 bytes */
925 __u32 cac_grid_offset_x;
926 __u32 cac_grid_offset_y;
927 /* 52 bytes */
928 __u16 crop_x_start[PISP_BACK_END_NUM_OUTPUTS];
929 __u16 crop_x_end[PISP_BACK_END_NUM_OUTPUTS];
930 __u16 crop_y_start[PISP_BACK_END_NUM_OUTPUTS];
931 __u16 crop_y_end[PISP_BACK_END_NUM_OUTPUTS];
932 /* 68 bytes */
933 /* Ordering is planes then branches */
934 __u16 downscale_phase_x[3 * PISP_BACK_END_NUM_OUTPUTS];
935 __u16 downscale_phase_y[3 * PISP_BACK_END_NUM_OUTPUTS];
936 /* 92 bytes */
937 __u16 resample_in_width[PISP_BACK_END_NUM_OUTPUTS];
938 __u16 resample_in_height[PISP_BACK_END_NUM_OUTPUTS];
939 /* 100 bytes */
940 /* Ordering is planes then branches */
941 __u16 resample_phase_x[3 * PISP_BACK_END_NUM_OUTPUTS];
942 __u16 resample_phase_y[3 * PISP_BACK_END_NUM_OUTPUTS];
943 /* 124 bytes */
944 __u16 output_offset_x[PISP_BACK_END_NUM_OUTPUTS];
945 __u16 output_offset_y[PISP_BACK_END_NUM_OUTPUTS];
946 __u16 output_width[PISP_BACK_END_NUM_OUTPUTS];
947 __u16 output_height[PISP_BACK_END_NUM_OUTPUTS];
948 /* 140 bytes */
949 __u32 output_addr_offset[PISP_BACK_END_NUM_OUTPUTS];
950 __u32 output_addr_offset2[PISP_BACK_END_NUM_OUTPUTS];
951 /* 156 bytes */
952 __u32 output_hog_addr_offset;
953 /* 160 bytes */
954} __attribute__((packed));
955
956/**
957 * struct pisp_be_tiles_config - Raspberry Pi PiSP Back End configuration
958 * @tiles: Tile descriptors
959 * @num_tiles: Number of tiles
960 * @config: PiSP Back End configuration
961 */
962struct pisp_be_tiles_config {
963 struct pisp_be_config config;
964 struct pisp_tile tiles[PISP_BACK_END_NUM_TILES];
965 __u32 num_tiles;
966} __attribute__((packed));
967
968#endif /* _PISP_BE_CONFIG_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/raspberrypi/pisp_common.h created+202
...@@ -0,0 +1,202 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * RP1 PiSP common definitions.
4 *
5 * Copyright (C) 2021 - Raspberry Pi Ltd.
6 *
7 */
8#ifndef _PISP_COMMON_H_
9#define _PISP_COMMON_H_
10
11#include <linux/types.h>
12
13struct pisp_image_format_config {
14 /* size in pixels */
15 __u16 width;
16 __u16 height;
17 /* must match struct pisp_image_format below */
18 __u32 format;
19 __s32 stride;
20 /* some planar image formats will need a second stride */
21 __s32 stride2;
22} __attribute__((packed));
23
24enum pisp_bayer_order {
25 /*
26 * Note how bayer_order&1 tells you if G is on the even pixels of the
27 * checkerboard or not, and bayer_order&2 tells you if R is on the even
28 * rows or is swapped with B. Note that if the top (of the 8) bits is
29 * set, this denotes a monochrome or greyscale image, and the lower bits
30 * should all be ignored.
31 */
32 PISP_BAYER_ORDER_RGGB = 0,
33 PISP_BAYER_ORDER_GBRG = 1,
34 PISP_BAYER_ORDER_BGGR = 2,
35 PISP_BAYER_ORDER_GRBG = 3,
36 PISP_BAYER_ORDER_GREYSCALE = 128
37};
38
39enum pisp_image_format {
40 /*
41 * Precise values are mostly tbd. Generally these will be portmanteau
42 * values comprising bit fields and flags. This format must be shared
43 * throughout the PiSP.
44 */
45 PISP_IMAGE_FORMAT_BPS_8 = 0x00000000,
46 PISP_IMAGE_FORMAT_BPS_10 = 0x00000001,
47 PISP_IMAGE_FORMAT_BPS_12 = 0x00000002,
48 PISP_IMAGE_FORMAT_BPS_16 = 0x00000003,
49 PISP_IMAGE_FORMAT_BPS_MASK = 0x00000003,
50
51 PISP_IMAGE_FORMAT_PLANARITY_INTERLEAVED = 0x00000000,
52 PISP_IMAGE_FORMAT_PLANARITY_SEMI_PLANAR = 0x00000010,
53 PISP_IMAGE_FORMAT_PLANARITY_PLANAR = 0x00000020,
54 PISP_IMAGE_FORMAT_PLANARITY_MASK = 0x00000030,
55
56 PISP_IMAGE_FORMAT_SAMPLING_444 = 0x00000000,
57 PISP_IMAGE_FORMAT_SAMPLING_422 = 0x00000100,
58 PISP_IMAGE_FORMAT_SAMPLING_420 = 0x00000200,
59 PISP_IMAGE_FORMAT_SAMPLING_MASK = 0x00000300,
60
61 PISP_IMAGE_FORMAT_ORDER_NORMAL = 0x00000000,
62 PISP_IMAGE_FORMAT_ORDER_SWAPPED = 0x00001000,
63
64 PISP_IMAGE_FORMAT_SHIFT_0 = 0x00000000,
65 PISP_IMAGE_FORMAT_SHIFT_1 = 0x00010000,
66 PISP_IMAGE_FORMAT_SHIFT_2 = 0x00020000,
67 PISP_IMAGE_FORMAT_SHIFT_3 = 0x00030000,
68 PISP_IMAGE_FORMAT_SHIFT_4 = 0x00040000,
69 PISP_IMAGE_FORMAT_SHIFT_5 = 0x00050000,
70 PISP_IMAGE_FORMAT_SHIFT_6 = 0x00060000,
71 PISP_IMAGE_FORMAT_SHIFT_7 = 0x00070000,
72 PISP_IMAGE_FORMAT_SHIFT_8 = 0x00080000,
73 PISP_IMAGE_FORMAT_SHIFT_MASK = 0x000f0000,
74
75 PISP_IMAGE_FORMAT_BPP_32 = 0x00100000,
76
77 PISP_IMAGE_FORMAT_UNCOMPRESSED = 0x00000000,
78 PISP_IMAGE_FORMAT_COMPRESSION_MODE_1 = 0x01000000,
79 PISP_IMAGE_FORMAT_COMPRESSION_MODE_2 = 0x02000000,
80 PISP_IMAGE_FORMAT_COMPRESSION_MODE_3 = 0x03000000,
81 PISP_IMAGE_FORMAT_COMPRESSION_MASK = 0x03000000,
82
83 PISP_IMAGE_FORMAT_HOG_SIGNED = 0x04000000,
84 PISP_IMAGE_FORMAT_HOG_UNSIGNED = 0x08000000,
85 PISP_IMAGE_FORMAT_INTEGRAL_IMAGE = 0x10000000,
86 PISP_IMAGE_FORMAT_WALLPAPER_ROLL = 0x20000000,
87 PISP_IMAGE_FORMAT_THREE_CHANNEL = 0x40000000,
88
89 /* Lastly a few specific instantiations of the above. */
90 PISP_IMAGE_FORMAT_SINGLE_16 = PISP_IMAGE_FORMAT_BPS_16,
91 PISP_IMAGE_FORMAT_THREE_16 = PISP_IMAGE_FORMAT_BPS_16 |
92 PISP_IMAGE_FORMAT_THREE_CHANNEL
93};
94
95#define PISP_IMAGE_FORMAT_BPS_8(fmt) \
96 (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) == PISP_IMAGE_FORMAT_BPS_8)
97#define PISP_IMAGE_FORMAT_BPS_10(fmt) \
98 (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) == PISP_IMAGE_FORMAT_BPS_10)
99#define PISP_IMAGE_FORMAT_BPS_12(fmt) \
100 (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) == PISP_IMAGE_FORMAT_BPS_12)
101#define PISP_IMAGE_FORMAT_BPS_16(fmt) \
102 (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) == PISP_IMAGE_FORMAT_BPS_16)
103#define PISP_IMAGE_FORMAT_BPS(fmt) \
104 (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) ? \
105 8 + (2 << (((fmt) & PISP_IMAGE_FORMAT_BPS_MASK) - 1)) : 8)
106#define PISP_IMAGE_FORMAT_SHIFT(fmt) \
107 (((fmt) & PISP_IMAGE_FORMAT_SHIFT_MASK) / PISP_IMAGE_FORMAT_SHIFT_1)
108#define PISP_IMAGE_FORMAT_THREE_CHANNEL(fmt) \
109 ((fmt) & PISP_IMAGE_FORMAT_THREE_CHANNEL)
110#define PISP_IMAGE_FORMAT_SINGLE_CHANNEL(fmt) \
111 (!((fmt) & PISP_IMAGE_FORMAT_THREE_CHANNEL))
112#define PISP_IMAGE_FORMAT_COMPRESSED(fmt) \
113 (((fmt) & PISP_IMAGE_FORMAT_COMPRESSION_MASK) != \
114 PISP_IMAGE_FORMAT_UNCOMPRESSED)
115#define PISP_IMAGE_FORMAT_SAMPLING_444(fmt) \
116 (((fmt) & PISP_IMAGE_FORMAT_SAMPLING_MASK) == \
117 PISP_IMAGE_FORMAT_SAMPLING_444)
118#define PISP_IMAGE_FORMAT_SAMPLING_422(fmt) \
119 (((fmt) & PISP_IMAGE_FORMAT_SAMPLING_MASK) == \
120 PISP_IMAGE_FORMAT_SAMPLING_422)
121#define PISP_IMAGE_FORMAT_SAMPLING_420(fmt) \
122 (((fmt) & PISP_IMAGE_FORMAT_SAMPLING_MASK) == \
123 PISP_IMAGE_FORMAT_SAMPLING_420)
124#define PISP_IMAGE_FORMAT_ORDER_NORMAL(fmt) \
125 (!((fmt) & PISP_IMAGE_FORMAT_ORDER_SWAPPED))
126#define PISP_IMAGE_FORMAT_ORDER_SWAPPED(fmt) \
127 ((fmt) & PISP_IMAGE_FORMAT_ORDER_SWAPPED)
128#define PISP_IMAGE_FORMAT_INTERLEAVED(fmt) \
129 (((fmt) & PISP_IMAGE_FORMAT_PLANARITY_MASK) == \
130 PISP_IMAGE_FORMAT_PLANARITY_INTERLEAVED)
131#define PISP_IMAGE_FORMAT_SEMIPLANAR(fmt) \
132 (((fmt) & PISP_IMAGE_FORMAT_PLANARITY_MASK) == \
133 PISP_IMAGE_FORMAT_PLANARITY_SEMI_PLANAR)
134#define PISP_IMAGE_FORMAT_PLANAR(fmt) \
135 (((fmt) & PISP_IMAGE_FORMAT_PLANARITY_MASK) == \
136 PISP_IMAGE_FORMAT_PLANARITY_PLANAR)
137#define PISP_IMAGE_FORMAT_WALLPAPER(fmt) \
138 ((fmt) & PISP_IMAGE_FORMAT_WALLPAPER_ROLL)
139#define PISP_IMAGE_FORMAT_BPP_32(fmt) ((fmt) & PISP_IMAGE_FORMAT_BPP_32)
140#define PISP_IMAGE_FORMAT_HOG(fmt) \
141 ((fmt) & \
142 (PISP_IMAGE_FORMAT_HOG_SIGNED | PISP_IMAGE_FORMAT_HOG_UNSIGNED))
143
144#define PISP_WALLPAPER_WIDTH 128 /* in bytes */
145
146struct pisp_bla_config {
147 __u16 black_level_r;
148 __u16 black_level_gr;
149 __u16 black_level_gb;
150 __u16 black_level_b;
151 __u16 output_black_level;
152 __u8 pad[2];
153} __attribute__((packed));
154
155struct pisp_wbg_config {
156 __u16 gain_r;
157 __u16 gain_g;
158 __u16 gain_b;
159 __u8 pad[2];
160} __attribute__((packed));
161
162struct pisp_compress_config {
163 /* value subtracted from incoming data */
164 __u16 offset;
165 __u8 pad;
166 /* 1 => Companding; 2 => Delta (recommended); 3 => Combined (for HDR) */
167 __u8 mode;
168} __attribute__((packed));
169
170struct pisp_decompress_config {
171 /* value added to reconstructed data */
172 __u16 offset;
173 __u8 pad;
174 /* 1 => Companding; 2 => Delta (recommended); 3 => Combined (for HDR) */
175 __u8 mode;
176} __attribute__((packed));
177
178enum pisp_axi_flags {
179 /*
180 * round down bursts to end at a 32-byte boundary, to align following
181 * bursts
182 */
183 PISP_AXI_FLAG_ALIGN = 128,
184 /* for FE writer: force WSTRB high, to pad output to 16-byte boundary */
185 PISP_AXI_FLAG_PAD = 64,
186 /* for FE writer: Use Output FIFO level to trigger "panic" */
187 PISP_AXI_FLAG_PANIC = 32,
188};
189
190struct pisp_axi_config {
191 /*
192 * burst length minus one, which must be in the range 0:15; OR'd with
193 * flags
194 */
195 __u8 maxlen_flags;
196 /* { prot[2:0], cache[3:0] } fields, echoed on AXI bus */
197 __u8 cache_prot;
198 /* QoS field(s) (4x4 bits for FE writer; 4 bits for other masters) */
199 __u16 qos;
200} __attribute__((packed));
201
202#endif /* _PISP_COMMON_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/raspberrypi/pisp_fe_config.h created+273
...@@ -0,0 +1,273 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * RP1 PiSP Front End Driver Configuration structures
4 *
5 * Copyright (C) 2021 - Raspberry Pi Ltd.
6 *
7 */
8#ifndef _PISP_FE_CONFIG_
9#define _PISP_FE_CONFIG_
10
11#include <linux/types.h>
12
13#include "pisp_common.h"
14#include "pisp_fe_statistics.h"
15
16#define PISP_FE_NUM_OUTPUTS 2
17
18enum pisp_fe_enable {
19 PISP_FE_ENABLE_INPUT = 0x000001,
20 PISP_FE_ENABLE_DECOMPRESS = 0x000002,
21 PISP_FE_ENABLE_DECOMPAND = 0x000004,
22 PISP_FE_ENABLE_BLA = 0x000008,
23 PISP_FE_ENABLE_DPC = 0x000010,
24 PISP_FE_ENABLE_STATS_CROP = 0x000020,
25 PISP_FE_ENABLE_DECIMATE = 0x000040,
26 PISP_FE_ENABLE_BLC = 0x000080,
27 PISP_FE_ENABLE_CDAF_STATS = 0x000100,
28 PISP_FE_ENABLE_AWB_STATS = 0x000200,
29 PISP_FE_ENABLE_RGBY = 0x000400,
30 PISP_FE_ENABLE_LSC = 0x000800,
31 PISP_FE_ENABLE_AGC_STATS = 0x001000,
32 PISP_FE_ENABLE_CROP0 = 0x010000,
33 PISP_FE_ENABLE_DOWNSCALE0 = 0x020000,
34 PISP_FE_ENABLE_COMPRESS0 = 0x040000,
35 PISP_FE_ENABLE_OUTPUT0 = 0x080000,
36 PISP_FE_ENABLE_CROP1 = 0x100000,
37 PISP_FE_ENABLE_DOWNSCALE1 = 0x200000,
38 PISP_FE_ENABLE_COMPRESS1 = 0x400000,
39 PISP_FE_ENABLE_OUTPUT1 = 0x800000
40};
41
42#define PISP_FE_ENABLE_CROP(i) (PISP_FE_ENABLE_CROP0 << (4 * (i)))
43#define PISP_FE_ENABLE_DOWNSCALE(i) (PISP_FE_ENABLE_DOWNSCALE0 << (4 * (i)))
44#define PISP_FE_ENABLE_COMPRESS(i) (PISP_FE_ENABLE_COMPRESS0 << (4 * (i)))
45#define PISP_FE_ENABLE_OUTPUT(i) (PISP_FE_ENABLE_OUTPUT0 << (4 * (i)))
46
47/*
48 * We use the enable flags to show when blocks are "dirty", but we need some
49 * extra ones too.
50 */
51enum pisp_fe_dirty {
52 PISP_FE_DIRTY_GLOBAL = 0x0001,
53 PISP_FE_DIRTY_FLOATING = 0x0002,
54 PISP_FE_DIRTY_OUTPUT_AXI = 0x0004
55};
56
57struct pisp_fe_global_config {
58 __u32 enables;
59 __u8 bayer_order;
60 __u8 pad[3];
61} __attribute__((packed));
62
63struct pisp_fe_input_axi_config {
64 /* burst length minus one, in the range 0..15; OR'd with flags */
65 __u8 maxlen_flags;
66 /* { prot[2:0], cache[3:0] } fields */
67 __u8 cache_prot;
68 /* QoS (only 4 LS bits are used) */
69 __u16 qos;
70} __attribute__((packed));
71
72struct pisp_fe_output_axi_config {
73 /* burst length minus one, in the range 0..15; OR'd with flags */
74 __u8 maxlen_flags;
75 /* { prot[2:0], cache[3:0] } fields */
76 __u8 cache_prot;
77 /* QoS (4 bitfields of 4 bits each for different panic levels) */
78 __u16 qos;
79 /* For Panic mode: Output FIFO panic threshold */
80 __u16 thresh;
81 /* For Panic mode: Output FIFO statistics throttle threshold */
82 __u16 throttle;
83} __attribute__((packed));
84
85struct pisp_fe_input_config {
86 __u8 streaming;
87 __u8 pad[3];
88 struct pisp_image_format_config format;
89 struct pisp_fe_input_axi_config axi;
90 /* Extra cycles delay before issuing each burst request */
91 __u8 holdoff;
92 __u8 pad2[3];
93} __attribute__((packed));
94
95struct pisp_fe_output_config {
96 struct pisp_image_format_config format;
97 __u16 ilines;
98 __u8 pad[2];
99} __attribute__((packed));
100
101struct pisp_fe_input_buffer_config {
102 __u32 addr_lo;
103 __u32 addr_hi;
104 __u16 frame_id;
105 __u16 pad;
106} __attribute__((packed));
107
108#define PISP_FE_DECOMPAND_LUT_SIZE 65
109
110struct pisp_fe_decompand_config {
111 __u16 lut[PISP_FE_DECOMPAND_LUT_SIZE];
112 __u16 pad;
113} __attribute__((packed));
114
115struct pisp_fe_dpc_config {
116 __u8 coeff_level;
117 __u8 coeff_range;
118 __u8 coeff_range2;
119#define PISP_FE_DPC_FLAG_FOLDBACK 1
120#define PISP_FE_DPC_FLAG_VFLAG 2
121 __u8 flags;
122} __attribute__((packed));
123
124#define PISP_FE_LSC_LUT_SIZE 16
125
126struct pisp_fe_lsc_config {
127 __u8 shift;
128 __u8 pad0;
129 __u16 scale;
130 __u16 centre_x;
131 __u16 centre_y;
132 __u16 lut[PISP_FE_LSC_LUT_SIZE];
133} __attribute__((packed));
134
135struct pisp_fe_rgby_config {
136 __u16 gain_r;
137 __u16 gain_g;
138 __u16 gain_b;
139 __u8 maxflag;
140 __u8 pad;
141} __attribute__((packed));
142
143struct pisp_fe_agc_stats_config {
144 __u16 offset_x;
145 __u16 offset_y;
146 __u16 size_x;
147 __u16 size_y;
148 /* each weight only 4 bits */
149 __u8 weights[PISP_AGC_STATS_NUM_ZONES / 2];
150 __u16 row_offset_x;
151 __u16 row_offset_y;
152 __u16 row_size_x;
153 __u16 row_size_y;
154 __u8 row_shift;
155 __u8 float_shift;
156 __u8 pad1[2];
157} __attribute__((packed));
158
159struct pisp_fe_awb_stats_config {
160 __u16 offset_x;
161 __u16 offset_y;
162 __u16 size_x;
163 __u16 size_y;
164 __u8 shift;
165 __u8 pad[3];
166 __u16 r_lo;
167 __u16 r_hi;
168 __u16 g_lo;
169 __u16 g_hi;
170 __u16 b_lo;
171 __u16 b_hi;
172} __attribute__((packed));
173
174struct pisp_fe_floating_stats_region {
175 __u16 offset_x;
176 __u16 offset_y;
177 __u16 size_x;
178 __u16 size_y;
179} __attribute__((packed));
180
181struct pisp_fe_floating_stats_config {
182 struct pisp_fe_floating_stats_region
183 regions[PISP_FLOATING_STATS_NUM_ZONES];
184} __attribute__((packed));
185
186#define PISP_FE_CDAF_NUM_WEIGHTS 8
187
188struct pisp_fe_cdaf_stats_config {
189 __u16 noise_constant;
190 __u16 noise_slope;
191 __u16 offset_x;
192 __u16 offset_y;
193 __u16 size_x;
194 __u16 size_y;
195 __u16 skip_x;
196 __u16 skip_y;
197 __u32 mode;
198} __attribute__((packed));
199
200struct pisp_fe_stats_buffer_config {
201 __u32 addr_lo;
202 __u32 addr_hi;
203} __attribute__((packed));
204
205struct pisp_fe_crop_config {
206 __u16 offset_x;
207 __u16 offset_y;
208 __u16 width;
209 __u16 height;
210} __attribute__((packed));
211
212enum pisp_fe_downscale_flags {
213 /* downscale the four Bayer components independently... */
214 DOWNSCALE_BAYER = 1,
215 /* ...without trying to preserve their spatial relationship */
216 DOWNSCALE_BIN = 2,
217};
218
219struct pisp_fe_downscale_config {
220 __u8 xin;
221 __u8 xout;
222 __u8 yin;
223 __u8 yout;
224 __u8 flags; /* enum pisp_fe_downscale_flags */
225 __u8 pad[3];
226 __u16 output_width;
227 __u16 output_height;
228} __attribute__((packed));
229
230struct pisp_fe_output_buffer_config {
231 __u32 addr_lo;
232 __u32 addr_hi;
233} __attribute__((packed));
234
235/* Each of the two output channels/branches: */
236struct pisp_fe_output_branch_config {
237 struct pisp_fe_crop_config crop;
238 struct pisp_fe_downscale_config downscale;
239 struct pisp_compress_config compress;
240 struct pisp_fe_output_config output;
241 __u32 pad;
242} __attribute__((packed));
243
244/* And finally one to rule them all: */
245struct pisp_fe_config {
246 /* I/O configuration: */
247 struct pisp_fe_stats_buffer_config stats_buffer;
248 struct pisp_fe_output_buffer_config output_buffer[PISP_FE_NUM_OUTPUTS];
249 struct pisp_fe_input_buffer_config input_buffer;
250 /* processing configuration: */
251 struct pisp_fe_global_config global;
252 struct pisp_fe_input_config input;
253 struct pisp_decompress_config decompress;
254 struct pisp_fe_decompand_config decompand;
255 struct pisp_bla_config bla;
256 struct pisp_fe_dpc_config dpc;
257 struct pisp_fe_crop_config stats_crop;
258 __u32 spare1; /* placeholder for future decimate configuration */
259 struct pisp_bla_config blc;
260 struct pisp_fe_rgby_config rgby;
261 struct pisp_fe_lsc_config lsc;
262 struct pisp_fe_agc_stats_config agc_stats;
263 struct pisp_fe_awb_stats_config awb_stats;
264 struct pisp_fe_cdaf_stats_config cdaf_stats;
265 struct pisp_fe_floating_stats_config floating_stats;
266 struct pisp_fe_output_axi_config output_axi;
267 struct pisp_fe_output_branch_config ch[PISP_FE_NUM_OUTPUTS];
268 /* non-register fields: */
269 __u32 dirty_flags; /* these use pisp_fe_enable */
270 __u32 dirty_flags_extra; /* these use pisp_fe_dirty */
271} __attribute__((packed));
272
273#endif /* _PISP_FE_CONFIG_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/raspberrypi/pisp_fe_statistics.h created+64
...@@ -0,0 +1,64 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * RP1 PiSP Front End statistics definitions
4 *
5 * Copyright (C) 2021 - Raspberry Pi Ltd.
6 *
7 */
8#ifndef _PISP_FE_STATISTICS_H_
9#define _PISP_FE_STATISTICS_H_
10
11#include <linux/types.h>
12
13#define PISP_FLOATING_STATS_NUM_ZONES 4
14#define PISP_AGC_STATS_NUM_BINS 1024
15#define PISP_AGC_STATS_SIZE 16
16#define PISP_AGC_STATS_NUM_ZONES (PISP_AGC_STATS_SIZE * PISP_AGC_STATS_SIZE)
17#define PISP_AGC_STATS_NUM_ROW_SUMS 512
18
19struct pisp_agc_statistics_zone {
20 __u64 Y_sum;
21 __u32 counted;
22 __u32 pad;
23} __attribute__((packed));
24
25struct pisp_agc_statistics {
26 __u32 row_sums[PISP_AGC_STATS_NUM_ROW_SUMS];
27 /*
28 * 32-bits per bin means an image (just less than) 16384x16384 pixels
29 * in size can weight every pixel from 0 to 15.
30 */
31 __u32 histogram[PISP_AGC_STATS_NUM_BINS];
32 struct pisp_agc_statistics_zone floating[PISP_FLOATING_STATS_NUM_ZONES];
33} __attribute__((packed));
34
35#define PISP_AWB_STATS_SIZE 32
36#define PISP_AWB_STATS_NUM_ZONES (PISP_AWB_STATS_SIZE * PISP_AWB_STATS_SIZE)
37
38struct pisp_awb_statistics_zone {
39 __u32 R_sum;
40 __u32 G_sum;
41 __u32 B_sum;
42 __u32 counted;
43} __attribute__((packed));
44
45struct pisp_awb_statistics {
46 struct pisp_awb_statistics_zone zones[PISP_AWB_STATS_NUM_ZONES];
47 struct pisp_awb_statistics_zone floating[PISP_FLOATING_STATS_NUM_ZONES];
48} __attribute__((packed));
49
50#define PISP_CDAF_STATS_SIZE 8
51#define PISP_CDAF_STATS_NUM_FOMS (PISP_CDAF_STATS_SIZE * PISP_CDAF_STATS_SIZE)
52
53struct pisp_cdaf_statistics {
54 __u64 foms[PISP_CDAF_STATS_NUM_FOMS];
55 __u64 floating[PISP_FLOATING_STATS_NUM_ZONES];
56} __attribute__((packed));
57
58struct pisp_statistics {
59 struct pisp_awb_statistics awb;
60 struct pisp_agc_statistics agc;
61 struct pisp_cdaf_statistics cdaf;
62} __attribute__((packed));
63
64#endif /* _PISP_FE_STATISTICS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mman.h+1
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#define MAP_SHARED 0x01 /* Share changes */17#define MAP_SHARED 0x01 /* Share changes */
18#define MAP_PRIVATE 0x02 /* Changes are private */18#define MAP_PRIVATE 0x02 /* Changes are private */
19#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */19#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
20#define MAP_DROPPABLE 0x08 /* Zero memory under memory pressure. */
2021
21/*22/*
22 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page23 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
lib/libc/include/any-linux-any/linux/mount.h+18-2
...@@ -154,7 +154,7 @@ struct mount_attr {...@@ -154,7 +154,7 @@ struct mount_attr {
154 */154 */
155struct statmount {155struct statmount {
156 __u32 size; /* Total size, including strings */156 __u32 size; /* Total size, including strings */
157 __u32 __spare1;157 __u32 mnt_opts; /* [str] Options (comma separated, escaped) */
158 __u64 mask; /* What results were written */158 __u64 mask; /* What results were written */
159 __u32 sb_dev_major; /* Device ID */159 __u32 sb_dev_major; /* Device ID */
160 __u32 sb_dev_minor;160 __u32 sb_dev_minor;
...@@ -172,7 +172,14 @@ struct statmount {...@@ -172,7 +172,14 @@ struct statmount {
172 __u64 propagate_from; /* Propagation from in current namespace */172 __u64 propagate_from; /* Propagation from in current namespace */
173 __u32 mnt_root; /* [str] Root of mount relative to root of fs */173 __u32 mnt_root; /* [str] Root of mount relative to root of fs */
174 __u32 mnt_point; /* [str] Mountpoint relative to current root */174 __u32 mnt_point; /* [str] Mountpoint relative to current root */
175 __u64 __spare2[50];175 __u64 mnt_ns_id; /* ID of the mount namespace */
176 __u32 fs_subtype; /* [str] Subtype of fs_type (if any) */
177 __u32 sb_source; /* [str] Source string of the mount */
178 __u32 opt_num; /* Number of fs options */
179 __u32 opt_array; /* [str] Array of nul terminated fs options */
180 __u32 opt_sec_num; /* Number of security options */
181 __u32 opt_sec_array; /* [str] Array of nul terminated security options */
182 __u64 __spare2[46];
176 char str[]; /* Variable size part containing strings */183 char str[]; /* Variable size part containing strings */
177};184};
178185
...@@ -188,10 +195,12 @@ struct mnt_id_req {...@@ -188,10 +195,12 @@ struct mnt_id_req {
188 __u32 spare;195 __u32 spare;
189 __u64 mnt_id;196 __u64 mnt_id;
190 __u64 param;197 __u64 param;
198 __u64 mnt_ns_id;
191};199};
192200
193/* List of all mnt_id_req versions. */201/* List of all mnt_id_req versions. */
194#define MNT_ID_REQ_SIZE_VER0 24 /* sizeof first published struct */202#define MNT_ID_REQ_SIZE_VER0 24 /* sizeof first published struct */
203#define MNT_ID_REQ_SIZE_VER1 32 /* sizeof second published struct */
195204
196/*205/*
197 * @mask bits for statmount(2)206 * @mask bits for statmount(2)
...@@ -202,10 +211,17 @@ struct mnt_id_req {...@@ -202,10 +211,17 @@ struct mnt_id_req {
202#define STATMOUNT_MNT_ROOT 0x00000008U /* Want/got mnt_root */211#define STATMOUNT_MNT_ROOT 0x00000008U /* Want/got mnt_root */
203#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */212#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */
204#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */213#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */
214#define STATMOUNT_MNT_NS_ID 0x00000040U /* Want/got mnt_ns_id */
215#define STATMOUNT_MNT_OPTS 0x00000080U /* Want/got mnt_opts */
216#define STATMOUNT_FS_SUBTYPE 0x00000100U /* Want/got fs_subtype */
217#define STATMOUNT_SB_SOURCE 0x00000200U /* Want/got sb_source */
218#define STATMOUNT_OPT_ARRAY 0x00000400U /* Want/got opt_... */
219#define STATMOUNT_OPT_SEC_ARRAY 0x00000800U /* Want/got opt_sec... */
205220
206/*221/*
207 * Special @mnt_id values that can be passed to listmount222 * Special @mnt_id values that can be passed to listmount
208 */223 */
209#define LSMT_ROOT 0xffffffffffffffff /* root mount */224#define LSMT_ROOT 0xffffffffffffffff /* root mount */
225#define LISTMOUNT_REVERSE (1 << 0) /* List later mounts first */
210226
211#endif /* _LINUX_MOUNT_H */227#endif /* _LINUX_MOUNT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mptcp_pm.h+26-24
...@@ -12,31 +12,33 @@...@@ -12,31 +12,33 @@
12/**12/**
13 * enum mptcp_event_type13 * enum mptcp_event_type
14 * @MPTCP_EVENT_UNSPEC: unused event14 * @MPTCP_EVENT_UNSPEC: unused event
15 * @MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,15 * @MPTCP_EVENT_CREATED: A new MPTCP connection has been created. It is the
16 * sport, dport A new MPTCP connection has been created. It is the good time16 * good time to allocate memory and send ADD_ADDR if needed. Depending on the
17 * to allocate memory and send ADD_ADDR if needed. Depending on the
18 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED17 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
19 * is sent.18 * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
20 * @MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,19 * sport, dport, server-side.
21 * sport, dport A MPTCP connection is established (can start new subflows).20 * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new
22 * @MPTCP_EVENT_CLOSED: token A MPTCP connection has stopped.21 * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
23 * @MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport] A22 * sport, dport, server-side.
24 * new address has been announced by the peer.23 * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.
25 * @MPTCP_EVENT_REMOVED: token, rem_id An address has been lost by the peer.24 * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.
26 * @MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, saddr4 |25 * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
27 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error] A new26 * @MPTCP_EVENT_REMOVED: An address has been lost by the peer. Attributes:
28 * subflow has been established. 'error' should not be set.27 * token, rem_id.
29 * @MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,28 * @MPTCP_EVENT_SUB_ESTABLISHED: A new subflow has been established. 'error'
30 * daddr4 | daddr6, sport, dport, backup, if_idx [, error] A subflow has been29 * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |
31 * closed. An error (copy of sk_err) could be set if an error has been30 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].
32 * detected for this subflow.31 * @MPTCP_EVENT_SUB_CLOSED: A subflow has been closed. An error (copy of
33 * @MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,32 * sk_err) could be set if an error has been detected for this subflow.
34 * daddr4 | daddr6, sport, dport, backup, if_idx [, error] The priority of a33 * Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
35 * subflow has changed. 'error' should not be set.34 * daddr6, sport, dport, backup, if_idx [, error].
36 * @MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6 A new PM35 * @MPTCP_EVENT_SUB_PRIORITY: The priority of a subflow has changed. 'error'
37 * listener is created.36 * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |
38 * @MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6 A PM listener37 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].
39 * is closed.38 * @MPTCP_EVENT_LISTENER_CREATED: A new PM listener is created. Attributes:
39 * family, sport, saddr4 | saddr6.
40 * @MPTCP_EVENT_LISTENER_CLOSED: A PM listener is closed. Attributes: family,
41 * sport, saddr4 | saddr6.
40 */42 */
41enum mptcp_event_type {43enum mptcp_event_type {
42 MPTCP_EVENT_UNSPEC,44 MPTCP_EVENT_UNSPEC,
lib/libc/include/any-linux-any/linux/nbd.h+6-2
...@@ -42,8 +42,9 @@ enum {...@@ -42,8 +42,9 @@ enum {
42 NBD_CMD_WRITE = 1,42 NBD_CMD_WRITE = 1,
43 NBD_CMD_DISC = 2,43 NBD_CMD_DISC = 2,
44 NBD_CMD_FLUSH = 3,44 NBD_CMD_FLUSH = 3,
45 NBD_CMD_TRIM = 445 NBD_CMD_TRIM = 4,
46 /* userspace defines additional extension commands */46 /* userspace defines additional extension commands */
47 NBD_CMD_WRITE_ZEROES = 6,
47};48};
4849
49/* values for flags field, these are server interaction specific. */50/* values for flags field, these are server interaction specific. */
...@@ -51,12 +52,15 @@ enum {...@@ -51,12 +52,15 @@ enum {
51#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */52#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
52#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */53#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */
53#define NBD_FLAG_SEND_FUA (1 << 3) /* send FUA (forced unit access) */54#define NBD_FLAG_SEND_FUA (1 << 3) /* send FUA (forced unit access) */
54/* there is a gap here to match userspace */55#define NBD_FLAG_ROTATIONAL (1 << 4) /* device is rotational */
55#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */56#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
57#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* supports WRITE_ZEROES */
58/* there is a gap here to match userspace */
56#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Server supports multiple connections per export. */59#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Server supports multiple connections per export. */
5760
58/* values for cmd flags in the upper 16 bits of request type */61/* values for cmd flags in the upper 16 bits of request type */
59#define NBD_CMD_FLAG_FUA (1 << 16) /* FUA (forced unit access) op */62#define NBD_CMD_FLAG_FUA (1 << 16) /* FUA (forced unit access) op */
63#define NBD_CMD_FLAG_NO_HOLE (1 << 17) /* Do not punch a hole for WRITE_ZEROES */
6064
61/* These are client behavior specific flags. */65/* These are client behavior specific flags. */
62#define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on66#define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
lib/libc/include/any-linux-any/linux/net_shaper.h created+95
...@@ -0,0 +1,95 @@
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/net_shaper.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_NET_SHAPER_H
7#define _LINUX_NET_SHAPER_H
8
9#define NET_SHAPER_FAMILY_NAME "net-shaper"
10#define NET_SHAPER_FAMILY_VERSION 1
11
12/**
13 * enum net_shaper_scope - Defines the shaper @id interpretation.
14 * @NET_SHAPER_SCOPE_UNSPEC: The scope is not specified.
15 * @NET_SHAPER_SCOPE_NETDEV: The main shaper for the given network device.
16 * @NET_SHAPER_SCOPE_QUEUE: The shaper is attached to the given device queue,
17 * the @id represents the queue number.
18 * @NET_SHAPER_SCOPE_NODE: The shaper allows grouping of queues or other node
19 * shapers; can be nested in either @netdev shapers or other @node shapers,
20 * allowing placement in any location of the scheduling tree, except leaves
21 * and root.
22 */
23enum net_shaper_scope {
24 NET_SHAPER_SCOPE_UNSPEC,
25 NET_SHAPER_SCOPE_NETDEV,
26 NET_SHAPER_SCOPE_QUEUE,
27 NET_SHAPER_SCOPE_NODE,
28
29 /* private: */
30 __NET_SHAPER_SCOPE_MAX,
31 NET_SHAPER_SCOPE_MAX = (__NET_SHAPER_SCOPE_MAX - 1)
32};
33
34/**
35 * enum net_shaper_metric - Different metric supported by the shaper.
36 * @NET_SHAPER_METRIC_BPS: Shaper operates on a bits per second basis.
37 * @NET_SHAPER_METRIC_PPS: Shaper operates on a packets per second basis.
38 */
39enum net_shaper_metric {
40 NET_SHAPER_METRIC_BPS,
41 NET_SHAPER_METRIC_PPS,
42};
43
44enum {
45 NET_SHAPER_A_HANDLE = 1,
46 NET_SHAPER_A_METRIC,
47 NET_SHAPER_A_BW_MIN,
48 NET_SHAPER_A_BW_MAX,
49 NET_SHAPER_A_BURST,
50 NET_SHAPER_A_PRIORITY,
51 NET_SHAPER_A_WEIGHT,
52 NET_SHAPER_A_IFINDEX,
53 NET_SHAPER_A_PARENT,
54 NET_SHAPER_A_LEAVES,
55
56 __NET_SHAPER_A_MAX,
57 NET_SHAPER_A_MAX = (__NET_SHAPER_A_MAX - 1)
58};
59
60enum {
61 NET_SHAPER_A_HANDLE_SCOPE = 1,
62 NET_SHAPER_A_HANDLE_ID,
63
64 __NET_SHAPER_A_HANDLE_MAX,
65 NET_SHAPER_A_HANDLE_MAX = (__NET_SHAPER_A_HANDLE_MAX - 1)
66};
67
68enum {
69 NET_SHAPER_A_CAPS_IFINDEX = 1,
70 NET_SHAPER_A_CAPS_SCOPE,
71 NET_SHAPER_A_CAPS_SUPPORT_METRIC_BPS,
72 NET_SHAPER_A_CAPS_SUPPORT_METRIC_PPS,
73 NET_SHAPER_A_CAPS_SUPPORT_NESTING,
74 NET_SHAPER_A_CAPS_SUPPORT_BW_MIN,
75 NET_SHAPER_A_CAPS_SUPPORT_BW_MAX,
76 NET_SHAPER_A_CAPS_SUPPORT_BURST,
77 NET_SHAPER_A_CAPS_SUPPORT_PRIORITY,
78 NET_SHAPER_A_CAPS_SUPPORT_WEIGHT,
79
80 __NET_SHAPER_A_CAPS_MAX,
81 NET_SHAPER_A_CAPS_MAX = (__NET_SHAPER_A_CAPS_MAX - 1)
82};
83
84enum {
85 NET_SHAPER_CMD_GET = 1,
86 NET_SHAPER_CMD_SET,
87 NET_SHAPER_CMD_DELETE,
88 NET_SHAPER_CMD_GROUP,
89 NET_SHAPER_CMD_CAP_GET,
90
91 __NET_SHAPER_CMD_MAX,
92 NET_SHAPER_CMD_MAX = (__NET_SHAPER_CMD_MAX - 1)
93};
94
95#endif /* _LINUX_NET_SHAPER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/net_tstamp.h+2-1
...@@ -32,8 +32,9 @@ enum {...@@ -32,8 +32,9 @@ enum {
32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
33 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),33 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),
34 SOF_TIMESTAMPING_OPT_ID_TCP = (1 << 16),34 SOF_TIMESTAMPING_OPT_ID_TCP = (1 << 16),
35 SOF_TIMESTAMPING_OPT_RX_FILTER = (1 << 17),
3536
36 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_ID_TCP,37 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_RX_FILTER,
37 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |38 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
38 SOF_TIMESTAMPING_LAST39 SOF_TIMESTAMPING_LAST
39};40};
lib/libc/include/any-linux-any/linux/netdev.h+17
...@@ -93,6 +93,7 @@ enum {...@@ -93,6 +93,7 @@ enum {
93 NETDEV_A_PAGE_POOL_INFLIGHT,93 NETDEV_A_PAGE_POOL_INFLIGHT,
94 NETDEV_A_PAGE_POOL_INFLIGHT_MEM,94 NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
95 NETDEV_A_PAGE_POOL_DETACH_TIME,95 NETDEV_A_PAGE_POOL_DETACH_TIME,
96 NETDEV_A_PAGE_POOL_DMABUF,
9697
97 __NETDEV_A_PAGE_POOL_MAX,98 __NETDEV_A_PAGE_POOL_MAX,
98 NETDEV_A_PAGE_POOL_MAX = (__NETDEV_A_PAGE_POOL_MAX - 1)99 NETDEV_A_PAGE_POOL_MAX = (__NETDEV_A_PAGE_POOL_MAX - 1)
...@@ -121,6 +122,9 @@ enum {...@@ -121,6 +122,9 @@ enum {
121 NETDEV_A_NAPI_ID,122 NETDEV_A_NAPI_ID,
122 NETDEV_A_NAPI_IRQ,123 NETDEV_A_NAPI_IRQ,
123 NETDEV_A_NAPI_PID,124 NETDEV_A_NAPI_PID,
125 NETDEV_A_NAPI_DEFER_HARD_IRQS,
126 NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
127 NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT,
124128
125 __NETDEV_A_NAPI_MAX,129 __NETDEV_A_NAPI_MAX,
126 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)130 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
...@@ -131,6 +135,7 @@ enum {...@@ -131,6 +135,7 @@ enum {
131 NETDEV_A_QUEUE_IFINDEX,135 NETDEV_A_QUEUE_IFINDEX,
132 NETDEV_A_QUEUE_TYPE,136 NETDEV_A_QUEUE_TYPE,
133 NETDEV_A_QUEUE_NAPI_ID,137 NETDEV_A_QUEUE_NAPI_ID,
138 NETDEV_A_QUEUE_DMABUF,
134139
135 __NETDEV_A_QUEUE_MAX,140 __NETDEV_A_QUEUE_MAX,
136 NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)141 NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
...@@ -173,6 +178,16 @@ enum {...@@ -173,6 +178,16 @@ enum {
173 NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)178 NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
174};179};
175180
181enum {
182 NETDEV_A_DMABUF_IFINDEX = 1,
183 NETDEV_A_DMABUF_QUEUES,
184 NETDEV_A_DMABUF_FD,
185 NETDEV_A_DMABUF_ID,
186
187 __NETDEV_A_DMABUF_MAX,
188 NETDEV_A_DMABUF_MAX = (__NETDEV_A_DMABUF_MAX - 1)
189};
190
176enum {191enum {
177 NETDEV_CMD_DEV_GET = 1,192 NETDEV_CMD_DEV_GET = 1,
178 NETDEV_CMD_DEV_ADD_NTF,193 NETDEV_CMD_DEV_ADD_NTF,
...@@ -186,6 +201,8 @@ enum {...@@ -186,6 +201,8 @@ enum {
186 NETDEV_CMD_QUEUE_GET,201 NETDEV_CMD_QUEUE_GET,
187 NETDEV_CMD_NAPI_GET,202 NETDEV_CMD_NAPI_GET,
188 NETDEV_CMD_QSTATS_GET,203 NETDEV_CMD_QSTATS_GET,
204 NETDEV_CMD_BIND_RX,
205 NETDEV_CMD_NAPI_SET,
189206
190 __NETDEV_CMD_MAX,207 __NETDEV_CMD_MAX,
191 NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)208 NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+18-6
...@@ -436,7 +436,7 @@ enum nft_set_elem_flags {...@@ -436,7 +436,7 @@ enum nft_set_elem_flags {
436 * @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data)436 * @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data)
437 * @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes)437 * @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes)
438 * @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32)438 * @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32)
439 * @NFTA_SET_ELEM_TIMEOUT: timeout value (NLA_U64)439 * @NFTA_SET_ELEM_TIMEOUT: timeout value, zero means never times out (NLA_U64)
440 * @NFTA_SET_ELEM_EXPIRATION: expiration time (NLA_U64)440 * @NFTA_SET_ELEM_EXPIRATION: expiration time (NLA_U64)
441 * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY)441 * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY)
442 * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes)442 * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes)
...@@ -564,16 +564,26 @@ enum nft_immediate_attributes {...@@ -564,16 +564,26 @@ enum nft_immediate_attributes {
564/**564/**
565 * enum nft_bitwise_ops - nf_tables bitwise operations565 * enum nft_bitwise_ops - nf_tables bitwise operations
566 *566 *
567 * @NFT_BITWISE_BOOL: mask-and-xor operation used to implement NOT, AND, OR and567 * @NFT_BITWISE_MASK_XOR: mask-and-xor operation used to implement NOT, AND, OR
568 * XOR boolean operations568 * and XOR boolean operations
569 * @NFT_BITWISE_LSHIFT: left-shift operation569 * @NFT_BITWISE_LSHIFT: left-shift operation
570 * @NFT_BITWISE_RSHIFT: right-shift operation570 * @NFT_BITWISE_RSHIFT: right-shift operation
571 * @NFT_BITWISE_AND: and operation
572 * @NFT_BITWISE_OR: or operation
573 * @NFT_BITWISE_XOR: xor operation
571 */574 */
572enum nft_bitwise_ops {575enum nft_bitwise_ops {
573 NFT_BITWISE_BOOL,576 NFT_BITWISE_MASK_XOR,
574 NFT_BITWISE_LSHIFT,577 NFT_BITWISE_LSHIFT,
575 NFT_BITWISE_RSHIFT,578 NFT_BITWISE_RSHIFT,
579 NFT_BITWISE_AND,
580 NFT_BITWISE_OR,
581 NFT_BITWISE_XOR,
576};582};
583/*
584 * Old name for NFT_BITWISE_MASK_XOR. Retained for backwards-compatibility.
585 */
586#define NFT_BITWISE_BOOL NFT_BITWISE_MASK_XOR
577587
578/**588/**
579 * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes589 * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes
...@@ -586,6 +596,7 @@ enum nft_bitwise_ops {...@@ -586,6 +596,7 @@ enum nft_bitwise_ops {
586 * @NFTA_BITWISE_OP: type of operation (NLA_U32: nft_bitwise_ops)596 * @NFTA_BITWISE_OP: type of operation (NLA_U32: nft_bitwise_ops)
587 * @NFTA_BITWISE_DATA: argument for non-boolean operations597 * @NFTA_BITWISE_DATA: argument for non-boolean operations
588 * (NLA_NESTED: nft_data_attributes)598 * (NLA_NESTED: nft_data_attributes)
599 * @NFTA_BITWISE_SREG2: second source register (NLA_U32: nft_registers)
589 *600 *
590 * The bitwise expression supports boolean and shift operations. It implements601 * The bitwise expression supports boolean and shift operations. It implements
591 * the boolean operations by performing the following operation:602 * the boolean operations by performing the following operation:
...@@ -609,6 +620,7 @@ enum nft_bitwise_attributes {...@@ -609,6 +620,7 @@ enum nft_bitwise_attributes {
609 NFTA_BITWISE_XOR,620 NFTA_BITWISE_XOR,
610 NFTA_BITWISE_OP,621 NFTA_BITWISE_OP,
611 NFTA_BITWISE_DATA,622 NFTA_BITWISE_DATA,
623 NFTA_BITWISE_SREG2,
612 __NFTA_BITWISE_MAX624 __NFTA_BITWISE_MAX
613};625};
614#define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1)626#define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1)
...@@ -1376,7 +1388,7 @@ enum nft_secmark_attributes {...@@ -1376,7 +1388,7 @@ enum nft_secmark_attributes {
1376#define NFTA_SECMARK_MAX (__NFTA_SECMARK_MAX - 1)1388#define NFTA_SECMARK_MAX (__NFTA_SECMARK_MAX - 1)
13771389
1378/* Max security context length */1390/* Max security context length */
1379#define NFT_SECMARK_CTX_MAXLEN 2561391#define NFT_SECMARK_CTX_MAXLEN 4096
13801392
1381/**1393/**
1382 * enum nft_reject_types - nf_tables reject expression reject types1394 * enum nft_reject_types - nf_tables reject expression reject types
...@@ -1694,7 +1706,7 @@ enum nft_flowtable_flags {...@@ -1694,7 +1706,7 @@ enum nft_flowtable_flags {
1694 *1706 *
1695 * @NFTA_FLOWTABLE_TABLE: name of the table containing the expression (NLA_STRING)1707 * @NFTA_FLOWTABLE_TABLE: name of the table containing the expression (NLA_STRING)
1696 * @NFTA_FLOWTABLE_NAME: name of this flow table (NLA_STRING)1708 * @NFTA_FLOWTABLE_NAME: name of this flow table (NLA_STRING)
1697 * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32)1709 * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration (NLA_NESTED)
1698 * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)1710 * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)
1699 * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)1711 * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)
1700 * @NFTA_FLOWTABLE_FLAGS: flags (NLA_U32)1712 * @NFTA_FLOWTABLE_FLAGS: flags (NLA_U32)
lib/libc/include/any-linux-any/linux/nexthop.h+9-1
...@@ -16,10 +16,15 @@ struct nhmsg {...@@ -16,10 +16,15 @@ struct nhmsg {
16struct nexthop_grp {16struct nexthop_grp {
17 __u32 id; /* nexthop id - must exist */17 __u32 id; /* nexthop id - must exist */
18 __u8 weight; /* weight of this nexthop */18 __u8 weight; /* weight of this nexthop */
19 __u8 resvd1;19 __u8 weight_high; /* high order bits of weight */
20 __u16 resvd2;20 __u16 resvd2;
21};21};
2222
23static __inline__ __u16 nexthop_grp_weight(const struct nexthop_grp *entry)
24{
25 return ((entry->weight_high << 8) | entry->weight) + 1;
26}
27
23enum {28enum {
24 NEXTHOP_GRP_TYPE_MPATH, /* hash-threshold nexthop group29 NEXTHOP_GRP_TYPE_MPATH, /* hash-threshold nexthop group
25 * default type if not specified30 * default type if not specified
...@@ -33,6 +38,9 @@ enum {...@@ -33,6 +38,9 @@ enum {
33#define NHA_OP_FLAG_DUMP_STATS BIT(0)38#define NHA_OP_FLAG_DUMP_STATS BIT(0)
34#define NHA_OP_FLAG_DUMP_HW_STATS BIT(1)39#define NHA_OP_FLAG_DUMP_HW_STATS BIT(1)
3540
41/* Response OP_FLAGS. */
42#define NHA_OP_FLAG_RESP_GRP_RESVD_0 BIT(31) /* Dump clears resvd fields. */
43
36enum {44enum {
37 NHA_UNSPEC,45 NHA_UNSPEC,
38 NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */46 NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */
lib/libc/include/any-linux-any/linux/nfc.h+3
...@@ -164,6 +164,7 @@ enum nfc_commands {...@@ -164,6 +164,7 @@ enum nfc_commands {
164 * @NFC_ATTR_VENDOR_SUBCMD: Vendor specific sub command164 * @NFC_ATTR_VENDOR_SUBCMD: Vendor specific sub command
165 * @NFC_ATTR_VENDOR_DATA: Vendor specific data, to be optionally passed165 * @NFC_ATTR_VENDOR_DATA: Vendor specific data, to be optionally passed
166 * to a vendor specific command implementation166 * to a vendor specific command implementation
167 * @NFC_ATTR_TARGET_ATS: ISO 14443 type A target Answer To Select
167 */168 */
168enum nfc_attrs {169enum nfc_attrs {
169 NFC_ATTR_UNSPEC,170 NFC_ATTR_UNSPEC,
...@@ -198,6 +199,7 @@ enum nfc_attrs {...@@ -198,6 +199,7 @@ enum nfc_attrs {
198 NFC_ATTR_VENDOR_ID,199 NFC_ATTR_VENDOR_ID,
199 NFC_ATTR_VENDOR_SUBCMD,200 NFC_ATTR_VENDOR_SUBCMD,
200 NFC_ATTR_VENDOR_DATA,201 NFC_ATTR_VENDOR_DATA,
202 NFC_ATTR_TARGET_ATS,
201/* private: internal use only */203/* private: internal use only */
202 __NFC_ATTR_AFTER_LAST204 __NFC_ATTR_AFTER_LAST
203};205};
...@@ -225,6 +227,7 @@ enum nfc_sdp_attr {...@@ -225,6 +227,7 @@ enum nfc_sdp_attr {
225#define NFC_GB_MAXSIZE 48227#define NFC_GB_MAXSIZE 48
226#define NFC_FIRMWARE_NAME_MAXSIZE 32228#define NFC_FIRMWARE_NAME_MAXSIZE 32
227#define NFC_ISO15693_UID_MAXSIZE 8229#define NFC_ISO15693_UID_MAXSIZE 8
230#define NFC_ATS_MAXSIZE 20
228231
229/* NFC protocols */232/* NFC protocols */
230#define NFC_PROTO_JEWEL 1233#define NFC_PROTO_JEWEL 1
lib/libc/include/any-linux-any/linux/nfs4.h+4
...@@ -46,6 +46,7 @@...@@ -46,6 +46,7 @@
46#define NFS4_OPEN_RESULT_CONFIRM 0x000246#define NFS4_OPEN_RESULT_CONFIRM 0x0002
47#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x000447#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
48#define NFS4_OPEN_RESULT_PRESERVE_UNLINKED 0x000848#define NFS4_OPEN_RESULT_PRESERVE_UNLINKED 0x0008
49#define NFS4_OPEN_RESULT_NO_OPEN_STATEID 0x0010
49#define NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK 0x002050#define NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK 0x0020
5051
51#define NFS4_SHARE_ACCESS_MASK 0x000F52#define NFS4_SHARE_ACCESS_MASK 0x000F
...@@ -69,6 +70,9 @@...@@ -69,6 +70,9 @@
69#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x1000070#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
70#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x2000071#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
7172
73#define NFS4_SHARE_WANT_DELEG_TIMESTAMPS 0x100000
74#define NFS4_SHARE_WANT_OPEN_XOR_DELEGATION 0x200000
75
72#define NFS4_CDFC4_FORE 0x176#define NFS4_CDFC4_FORE 0x1
73#define NFS4_CDFC4_BACK 0x277#define NFS4_CDFC4_BACK 0x2
74#define NFS4_CDFC4_BOTH 0x378#define NFS4_CDFC4_BOTH 0x3
lib/libc/include/any-linux-any/linux/nfsd_netlink.h+10
...@@ -70,6 +70,14 @@ enum {...@@ -70,6 +70,14 @@ enum {
70 NFSD_A_SERVER_SOCK_MAX = (__NFSD_A_SERVER_SOCK_MAX - 1)70 NFSD_A_SERVER_SOCK_MAX = (__NFSD_A_SERVER_SOCK_MAX - 1)
71};71};
7272
73enum {
74 NFSD_A_POOL_MODE_MODE = 1,
75 NFSD_A_POOL_MODE_NPOOLS,
76
77 __NFSD_A_POOL_MODE_MAX,
78 NFSD_A_POOL_MODE_MAX = (__NFSD_A_POOL_MODE_MAX - 1)
79};
80
73enum {81enum {
74 NFSD_CMD_RPC_STATUS_GET = 1,82 NFSD_CMD_RPC_STATUS_GET = 1,
75 NFSD_CMD_THREADS_SET,83 NFSD_CMD_THREADS_SET,
...@@ -78,6 +86,8 @@ enum {...@@ -78,6 +86,8 @@ enum {
78 NFSD_CMD_VERSION_GET,86 NFSD_CMD_VERSION_GET,
79 NFSD_CMD_LISTENER_SET,87 NFSD_CMD_LISTENER_SET,
80 NFSD_CMD_LISTENER_GET,88 NFSD_CMD_LISTENER_GET,
89 NFSD_CMD_POOL_MODE_SET,
90 NFSD_CMD_POOL_MODE_GET,
8191
82 __NFSD_CMD_MAX,92 __NFSD_CMD_MAX,
83 NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1)93 NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1)
lib/libc/include/any-linux-any/linux/nl80211.h+81
...@@ -2052,6 +2052,10 @@ enum nl80211_commands {...@@ -2052,6 +2052,10 @@ enum nl80211_commands {
2052 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported2052 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
2053 * interface combinations. In each nested item, it contains attributes2053 * interface combinations. In each nested item, it contains attributes
2054 * defined in &enum nl80211_if_combination_attrs.2054 * defined in &enum nl80211_if_combination_attrs.
2055 * If the wiphy uses multiple radios (@NL80211_ATTR_WIPHY_RADIOS is set),
2056 * this attribute contains the interface combinations of the first radio.
2057 * See @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS for the global wiphy
2058 * combinations for the sum of all radios.
2055 * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like2059 * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
2056 * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that2060 * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
2057 * are managed in software: interfaces of these types aren't subject to2061 * are managed in software: interfaces of these types aren't subject to
...@@ -2856,6 +2860,17 @@ enum nl80211_commands {...@@ -2856,6 +2860,17 @@ enum nl80211_commands {
2856 * %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs2860 * %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs
2857 * are used on this connection2861 * are used on this connection
2858 *2862 *
2863 * @NL80211_ATTR_WIPHY_RADIOS: Nested attribute describing physical radios
2864 * belonging to this wiphy. See &enum nl80211_wiphy_radio_attrs.
2865 *
2866 * @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS: Nested attribute listing the
2867 * supported interface combinations for all radios combined. In each
2868 * nested item, it contains attributes defined in
2869 * &enum nl80211_if_combination_attrs.
2870 *
2871 * @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32).
2872 * A value of 0 means all radios.
2873 *
2859 * @NUM_NL80211_ATTR: total number of nl80211_attrs available2874 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
2860 * @NL80211_ATTR_MAX: highest attribute number currently defined2875 * @NL80211_ATTR_MAX: highest attribute number currently defined
2861 * @__NL80211_ATTR_AFTER_LAST: internal use2876 * @__NL80211_ATTR_AFTER_LAST: internal use
...@@ -3401,6 +3416,11 @@ enum nl80211_attrs {...@@ -3401,6 +3416,11 @@ enum nl80211_attrs {
34013416
3402 NL80211_ATTR_ASSOC_SPP_AMSDU,3417 NL80211_ATTR_ASSOC_SPP_AMSDU,
34033418
3419 NL80211_ATTR_WIPHY_RADIOS,
3420 NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS,
3421
3422 NL80211_ATTR_VIF_RADIO_MASK,
3423
3404 /* add attributes here, update the policy in nl80211.c */3424 /* add attributes here, update the policy in nl80211.c */
34053425
3406 __NL80211_ATTR_AFTER_LAST,3426 __NL80211_ATTR_AFTER_LAST,
...@@ -4277,6 +4297,8 @@ enum nl80211_wmm_rule {...@@ -4277,6 +4297,8 @@ enum nl80211_wmm_rule {
4277 * @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor4297 * @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor
4278 * mode despite other (regulatory) restrictions, even if the channel is4298 * mode despite other (regulatory) restrictions, even if the channel is
4279 * otherwise completely disabled.4299 * otherwise completely disabled.
4300 * @NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP: This channel can be used for a
4301 * very low power (VLP) AP, despite being NO_IR.
4280 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number4302 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
4281 * currently defined4303 * currently defined
4282 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use4304 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
...@@ -4320,6 +4342,7 @@ enum nl80211_frequency_attr {...@@ -4320,6 +4342,7 @@ enum nl80211_frequency_attr {
4320 NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT,4342 NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT,
4321 NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,4343 NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,
4322 NL80211_FREQUENCY_ATTR_CAN_MONITOR,4344 NL80211_FREQUENCY_ATTR_CAN_MONITOR,
4345 NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP,
43234346
4324 /* keep last */4347 /* keep last */
4325 __NL80211_FREQUENCY_ATTR_AFTER_LAST,4348 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
...@@ -4529,6 +4552,8 @@ enum nl80211_sched_scan_match_attr {...@@ -4529,6 +4552,8 @@ enum nl80211_sched_scan_match_attr {
4529 * Should be used together with %NL80211_RRF_DFS only.4552 * Should be used together with %NL80211_RRF_DFS only.
4530 * @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed4553 * @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed
4531 * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed4554 * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed
4555 * @NL80211_RRF_ALLOW_6GHZ_VLP_AP: Very low power (VLP) AP can be permitted
4556 * despite NO_IR configuration.
4532 */4557 */
4533enum nl80211_reg_rule_flags {4558enum nl80211_reg_rule_flags {
4534 NL80211_RRF_NO_OFDM = 1<<0,4559 NL80211_RRF_NO_OFDM = 1<<0,
...@@ -4553,6 +4578,7 @@ enum nl80211_reg_rule_flags {...@@ -4553,6 +4578,7 @@ enum nl80211_reg_rule_flags {
4553 NL80211_RRF_DFS_CONCURRENT = 1<<21,4578 NL80211_RRF_DFS_CONCURRENT = 1<<21,
4554 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22,4579 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22,
4555 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23,4580 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23,
4581 NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1<<24,
4556};4582};
45574583
4558#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR4584#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
...@@ -4677,6 +4703,7 @@ enum nl80211_survey_info {...@@ -4677,6 +4703,7 @@ enum nl80211_survey_info {
4677 * overrides all other flags.4703 * overrides all other flags.
4678 * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address4704 * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
4679 * and ACK incoming unicast packets.4705 * and ACK incoming unicast packets.
4706 * @NL80211_MNTR_FLAG_SKIP_TX: do not pass local tx packets
4680 *4707 *
4681 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use4708 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
4682 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag4709 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
...@@ -4689,6 +4716,7 @@ enum nl80211_mntr_flags {...@@ -4689,6 +4716,7 @@ enum nl80211_mntr_flags {
4689 NL80211_MNTR_FLAG_OTHER_BSS,4716 NL80211_MNTR_FLAG_OTHER_BSS,
4690 NL80211_MNTR_FLAG_COOK_FRAMES,4717 NL80211_MNTR_FLAG_COOK_FRAMES,
4691 NL80211_MNTR_FLAG_ACTIVE,4718 NL80211_MNTR_FLAG_ACTIVE,
4719 NL80211_MNTR_FLAG_SKIP_TX,
46924720
4693 /* keep last */4721 /* keep last */
4694 __NL80211_MNTR_FLAG_AFTER_LAST,4722 __NL80211_MNTR_FLAG_AFTER_LAST,
...@@ -7999,4 +8027,57 @@ enum nl80211_ap_settings_flags {...@@ -7999,4 +8027,57 @@ enum nl80211_ap_settings_flags {
7999 NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,8027 NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
8000};8028};
80018029
8030/**
8031 * enum nl80211_wiphy_radio_attrs - wiphy radio attributes
8032 *
8033 * @__NL80211_WIPHY_RADIO_ATTR_INVALID: Invalid
8034 *
8035 * @NL80211_WIPHY_RADIO_ATTR_INDEX: Index of this radio (u32)
8036 * @NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE: Frequency range supported by this
8037 * radio. Attribute may be present multiple times.
8038 * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface
8039 * combination for this radio. Attribute may be present multiple times
8040 * and contains attributes defined in &enum nl80211_if_combination_attrs.
8041 * @NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK: bitmask (u32) of antennas
8042 * connected to this radio.
8043 *
8044 * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
8045 * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
8046 */
8047enum nl80211_wiphy_radio_attrs {
8048 __NL80211_WIPHY_RADIO_ATTR_INVALID,
8049
8050 NL80211_WIPHY_RADIO_ATTR_INDEX,
8051 NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
8052 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
8053 NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
8054
8055 /* keep last */
8056 __NL80211_WIPHY_RADIO_ATTR_LAST,
8057 NL80211_WIPHY_RADIO_ATTR_MAX = __NL80211_WIPHY_RADIO_ATTR_LAST - 1,
8058};
8059
8060/**
8061 * enum nl80211_wiphy_radio_freq_range - wiphy radio frequency range
8062 *
8063 * @__NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID: Invalid
8064 *
8065 * @NL80211_WIPHY_RADIO_FREQ_ATTR_START: Frequency range start (u32).
8066 * The unit is kHz.
8067 * @NL80211_WIPHY_RADIO_FREQ_ATTR_END: Frequency range end (u32).
8068 * The unit is kHz.
8069 *
8070 * @__NL80211_WIPHY_RADIO_FREQ_ATTR_LAST: Internal
8071 * @NL80211_WIPHY_RADIO_FREQ_ATTR_MAX: Highest attribute
8072 */
8073enum nl80211_wiphy_radio_freq_range {
8074 __NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID,
8075
8076 NL80211_WIPHY_RADIO_FREQ_ATTR_START,
8077 NL80211_WIPHY_RADIO_FREQ_ATTR_END,
8078
8079 __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST,
8080 NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
8081};
8082
8002#endif /* __LINUX_NL80211_H */8083#endif /* __LINUX_NL80211_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nsfs.h+26
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3#define __LINUX_NSFS_H3#define __LINUX_NSFS_H
44
5#include <linux/ioctl.h>5#include <linux/ioctl.h>
6#include <linux/types.h>
67
7#define NSIO 0xb78#define NSIO 0xb7
89
...@@ -15,5 +16,30 @@...@@ -15,5 +16,30 @@
15#define NS_GET_NSTYPE _IO(NSIO, 0x3)16#define NS_GET_NSTYPE _IO(NSIO, 0x3)
16/* Get owner UID (in the caller's user namespace) for a user namespace */17/* Get owner UID (in the caller's user namespace) for a user namespace */
17#define NS_GET_OWNER_UID _IO(NSIO, 0x4)18#define NS_GET_OWNER_UID _IO(NSIO, 0x4)
19/* Get the id for a mount namespace */
20#define NS_GET_MNTNS_ID _IOR(NSIO, 0x5, __u64)
21/* Translate pid from target pid namespace into the caller's pid namespace. */
22#define NS_GET_PID_FROM_PIDNS _IOR(NSIO, 0x6, int)
23/* Return thread-group leader id of pid in the callers pid namespace. */
24#define NS_GET_TGID_FROM_PIDNS _IOR(NSIO, 0x7, int)
25/* Translate pid from caller's pid namespace into a target pid namespace. */
26#define NS_GET_PID_IN_PIDNS _IOR(NSIO, 0x8, int)
27/* Return thread-group leader id of pid in the target pid namespace. */
28#define NS_GET_TGID_IN_PIDNS _IOR(NSIO, 0x9, int)
29
30struct mnt_ns_info {
31 __u32 size;
32 __u32 nr_mounts;
33 __u64 mnt_ns_id;
34};
35
36#define MNT_NS_INFO_SIZE_VER0 16 /* size of first published struct */
37
38/* Get information about namespace. */
39#define NS_MNT_GET_INFO _IOR(NSIO, 10, struct mnt_ns_info)
40/* Get next namespace. */
41#define NS_MNT_GET_NEXT _IOR(NSIO, 11, struct mnt_ns_info)
42/* Get previous namespace. */
43#define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info)
1844
19#endif /* __LINUX_NSFS_H */45#endif /* __LINUX_NSFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/openvswitch.h+30-1
...@@ -649,7 +649,8 @@ enum ovs_flow_attr {...@@ -649,7 +649,8 @@ enum ovs_flow_attr {
649 * Actions are passed as nested attributes.649 * Actions are passed as nested attributes.
650 *650 *
651 * Executes the specified actions with the given probability on a per-packet651 * Executes the specified actions with the given probability on a per-packet
652 * basis.652 * basis. Nested actions will be able to access the probability value of the
653 * parent @OVS_ACTION_ATTR_SAMPLE.
653 */654 */
654enum ovs_sample_attr {655enum ovs_sample_attr {
655 OVS_SAMPLE_ATTR_UNSPEC,656 OVS_SAMPLE_ATTR_UNSPEC,
...@@ -886,6 +887,31 @@ enum ovs_check_pkt_len_attr {...@@ -886,6 +887,31 @@ enum ovs_check_pkt_len_attr {
886#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)887#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
887888
888889
890#define OVS_PSAMPLE_COOKIE_MAX_SIZE 16
891/**
892 * enum ovs_psample_attr - Attributes for %OVS_ACTION_ATTR_PSAMPLE
893 * action.
894 *
895 * @OVS_PSAMPLE_ATTR_GROUP: 32-bit number to identify the source of the
896 * sample.
897 * @OVS_PSAMPLE_ATTR_COOKIE: An optional variable-length binary cookie that
898 * contains user-defined metadata. The maximum length is
899 * OVS_PSAMPLE_COOKIE_MAX_SIZE bytes.
900 *
901 * Sends the packet to the psample multicast group with the specified group and
902 * cookie. It is possible to combine this action with the
903 * %OVS_ACTION_ATTR_TRUNC action to limit the size of the sample.
904 */
905enum ovs_psample_attr {
906 OVS_PSAMPLE_ATTR_GROUP = 1, /* u32 number. */
907 OVS_PSAMPLE_ATTR_COOKIE, /* Optional, user specified cookie. */
908
909 /* private: */
910 __OVS_PSAMPLE_ATTR_MAX
911};
912
913#define OVS_PSAMPLE_ATTR_MAX (__OVS_PSAMPLE_ATTR_MAX - 1)
914
889/**915/**
890 * enum ovs_action_attr - Action types.916 * enum ovs_action_attr - Action types.
891 *917 *
...@@ -938,6 +964,8 @@ enum ovs_check_pkt_len_attr {...@@ -938,6 +964,8 @@ enum ovs_check_pkt_len_attr {
938 * of l3 tunnel flag in the tun_flags field of OVS_ACTION_ATTR_ADD_MPLS964 * of l3 tunnel flag in the tun_flags field of OVS_ACTION_ATTR_ADD_MPLS
939 * argument.965 * argument.
940 * @OVS_ACTION_ATTR_DROP: Explicit drop action.966 * @OVS_ACTION_ATTR_DROP: Explicit drop action.
967 * @OVS_ACTION_ATTR_PSAMPLE: Send a sample of the packet to external observers
968 * via psample.
941 *969 *
942 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all970 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
943 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment971 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
...@@ -976,6 +1004,7 @@ enum ovs_action_attr {...@@ -976,6 +1004,7 @@ enum ovs_action_attr {
976 OVS_ACTION_ATTR_ADD_MPLS, /* struct ovs_action_add_mpls. */1004 OVS_ACTION_ATTR_ADD_MPLS, /* struct ovs_action_add_mpls. */
977 OVS_ACTION_ATTR_DEC_TTL, /* Nested OVS_DEC_TTL_ATTR_*. */1005 OVS_ACTION_ATTR_DEC_TTL, /* Nested OVS_DEC_TTL_ATTR_*. */
978 OVS_ACTION_ATTR_DROP, /* u32 error code. */1006 OVS_ACTION_ATTR_DROP, /* u32 error code. */
1007 OVS_ACTION_ATTR_PSAMPLE, /* Nested OVS_PSAMPLE_ATTR_*. */
9791008
980 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted1009 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
981 * from userspace. */1010 * from userspace. */
lib/libc/include/any-linux-any/linux/pci_regs.h+69-10
...@@ -340,7 +340,8 @@...@@ -340,7 +340,8 @@
340#define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */340#define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */
341#define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */341#define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */
342#define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */342#define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */
343#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001343#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 /* Mask Bit */
344#define PCI_MSIX_ENTRY_CTRL_ST 0xffff0000 /* Steering Tag */
344345
345/* CompactPCI Hotswap Register */346/* CompactPCI Hotswap Register */
346347
...@@ -634,9 +635,11 @@...@@ -634,9 +635,11 @@
634#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */635#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
635#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */636#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
636#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */637#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
637#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */638#define PCI_EXP_RTCTL_RRS_SVE 0x0010 /* Config RRS Software Visibility Enable */
639#define PCI_EXP_RTCTL_CRSSVE PCI_EXP_RTCTL_RRS_SVE /* compatibility */
638#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */640#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
639#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */641#define PCI_EXP_RTCAP_RRS_SV 0x0001 /* Config RRS Software Visibility */
642#define PCI_EXP_RTCAP_CRSVIS PCI_EXP_RTCAP_RRS_SV /* compatibility */
640#define PCI_EXP_RTSTA 0x20 /* Root Status */643#define PCI_EXP_RTSTA 0x20 /* Root Status */
641#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */644#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */
642#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */645#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
...@@ -657,6 +660,7 @@...@@ -657,6 +660,7 @@
657#define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */660#define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */
658#define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */661#define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */
659#define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */662#define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */
663#define PCI_EXP_DEVCAP2_TPH_COMP_MASK 0x00003000 /* TPH completer support */
660#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */664#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */
661#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */665#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
662#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */666#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
...@@ -676,6 +680,7 @@...@@ -676,6 +680,7 @@
676#define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */680#define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */
677#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */681#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */
678#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */682#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */
683#define PCI_EXP_LNKCAP2_SLS 0x000000fe /* Supported Link Speeds Vector */
679#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */684#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
680#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */685#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
681#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */686#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */
...@@ -740,6 +745,7 @@...@@ -740,6 +745,7 @@
740#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */745#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
741#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */746#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
742#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */747#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
748#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */
743#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */749#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
744#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */750#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
745#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE751#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
...@@ -1020,15 +1026,34 @@...@@ -1020,15 +1026,34 @@
1020#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */1026#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
1021#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */1027#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
10221028
1029/* TPH Completer Support */
1030#define PCI_EXP_DEVCAP2_TPH_COMP_NONE 0x0 /* None */
1031#define PCI_EXP_DEVCAP2_TPH_COMP_TPH_ONLY 0x1 /* TPH only */
1032#define PCI_EXP_DEVCAP2_TPH_COMP_EXT_TPH 0x3 /* TPH and Extended TPH */
1033
1023/* TPH Requester */1034/* TPH Requester */
1024#define PCI_TPH_CAP 4 /* capability register */1035#define PCI_TPH_CAP 4 /* capability register */
1025#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */1036#define PCI_TPH_CAP_ST_NS 0x00000001 /* No ST Mode Supported */
1026#define PCI_TPH_LOC_NONE 0x000 /* no location */1037#define PCI_TPH_CAP_ST_IV 0x00000002 /* Interrupt Vector Mode Supported */
1027#define PCI_TPH_LOC_CAP 0x200 /* in capability */1038#define PCI_TPH_CAP_ST_DS 0x00000004 /* Device Specific Mode Supported */
1028#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */1039#define PCI_TPH_CAP_EXT_TPH 0x00000100 /* Ext TPH Requester Supported */
1029#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST table mask */1040#define PCI_TPH_CAP_LOC_MASK 0x00000600 /* ST Table Location */
1030#define PCI_TPH_CAP_ST_SHIFT 16 /* ST table shift */1041#define PCI_TPH_LOC_NONE 0x00000000 /* Not present */
1031#define PCI_TPH_BASE_SIZEOF 0xc /* size with no ST table */1042#define PCI_TPH_LOC_CAP 0x00000200 /* In capability */
1043#define PCI_TPH_LOC_MSIX 0x00000400 /* In MSI-X */
1044#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST Table Size */
1045#define PCI_TPH_CAP_ST_SHIFT 16 /* ST Table Size shift */
1046#define PCI_TPH_BASE_SIZEOF 0xc /* Size with no ST table */
1047
1048#define PCI_TPH_CTRL 8 /* control register */
1049#define PCI_TPH_CTRL_MODE_SEL_MASK 0x00000007 /* ST Mode Select */
1050#define PCI_TPH_ST_NS_MODE 0x0 /* No ST Mode */
1051#define PCI_TPH_ST_IV_MODE 0x1 /* Interrupt Vector Mode */
1052#define PCI_TPH_ST_DS_MODE 0x2 /* Device Specific Mode */
1053#define PCI_TPH_CTRL_REQ_EN_MASK 0x00000300 /* TPH Requester Enable */
1054#define PCI_TPH_REQ_DISABLE 0x0 /* No TPH requests allowed */
1055#define PCI_TPH_REQ_TPH_ONLY 0x1 /* TPH only requests allowed */
1056#define PCI_TPH_REQ_EXT_TPH 0x3 /* Extended TPH requests allowed */
10321057
1033/* Downstream Port Containment */1058/* Downstream Port Containment */
1034#define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */1059#define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */
...@@ -1121,6 +1146,40 @@...@@ -1121,6 +1146,40 @@
1121#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F01146#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
1122#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 41147#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
11231148
1149/* Native PCIe Enclosure Management */
1150#define PCI_NPEM_CAP 0x04 /* NPEM capability register */
1151#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */
1152
1153#define PCI_NPEM_CTRL 0x08 /* NPEM control register */
1154#define PCI_NPEM_CTRL_ENABLE 0x00000001 /* NPEM Enable */
1155
1156/*
1157 * Native PCIe Enclosure Management indication bits and Reset command bit
1158 * are corresponding for capability and control registers.
1159 */
1160#define PCI_NPEM_CMD_RESET 0x00000002 /* Reset Command */
1161#define PCI_NPEM_IND_OK 0x00000004 /* OK */
1162#define PCI_NPEM_IND_LOCATE 0x00000008 /* Locate */
1163#define PCI_NPEM_IND_FAIL 0x00000010 /* Fail */
1164#define PCI_NPEM_IND_REBUILD 0x00000020 /* Rebuild */
1165#define PCI_NPEM_IND_PFA 0x00000040 /* Predicted Failure Analysis */
1166#define PCI_NPEM_IND_HOTSPARE 0x00000080 /* Hot Spare */
1167#define PCI_NPEM_IND_ICA 0x00000100 /* In Critical Array */
1168#define PCI_NPEM_IND_IFA 0x00000200 /* In Failed Array */
1169#define PCI_NPEM_IND_IDT 0x00000400 /* Device Type */
1170#define PCI_NPEM_IND_DISABLED 0x00000800 /* Disabled */
1171#define PCI_NPEM_IND_SPEC_0 0x01000000
1172#define PCI_NPEM_IND_SPEC_1 0x02000000
1173#define PCI_NPEM_IND_SPEC_2 0x04000000
1174#define PCI_NPEM_IND_SPEC_3 0x08000000
1175#define PCI_NPEM_IND_SPEC_4 0x10000000
1176#define PCI_NPEM_IND_SPEC_5 0x20000000
1177#define PCI_NPEM_IND_SPEC_6 0x40000000
1178#define PCI_NPEM_IND_SPEC_7 0x80000000
1179
1180#define PCI_NPEM_STATUS 0x0c /* NPEM status register */
1181#define PCI_NPEM_STATUS_CC 0x00000001 /* Command Completed */
1182
1124/* Data Object Exchange */1183/* Data Object Exchange */
1125#define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */1184#define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */
1126#define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */1185#define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */
lib/libc/include/any-linux-any/linux/perf_event.h+14-3
...@@ -511,7 +511,16 @@ struct perf_event_attr {...@@ -511,7 +511,16 @@ struct perf_event_attr {
511 __u16 sample_max_stack;511 __u16 sample_max_stack;
512 __u16 __reserved_2;512 __u16 __reserved_2;
513 __u32 aux_sample_size;513 __u32 aux_sample_size;
514 __u32 __reserved_3;514
515 union {
516 __u32 aux_action;
517 struct {
518 __u32 aux_start_paused : 1, /* start AUX area tracing paused */
519 aux_pause : 1, /* on overflow, pause AUX area tracing */
520 aux_resume : 1, /* on overflow, resume AUX area tracing */
521 __reserved_3 : 29;
522 };
523 };
515524
516 /*525 /*
517 * User provided data if sigtrap=1, passed back to user via526 * User provided data if sigtrap=1, passed back to user via
...@@ -1349,12 +1358,14 @@ union perf_mem_data_src {...@@ -1349,12 +1358,14 @@ union perf_mem_data_src {
1349#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */1358#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
1350#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */1359#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
1351#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */1360#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
1352/* 5-0x7 available */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 */
1353#define PERF_MEM_LVLNUM_UNC 0x08 /* Uncached */1364#define PERF_MEM_LVLNUM_UNC 0x08 /* Uncached */
1354#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */1365#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */
1355#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */1366#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */
1356#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */1367#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
1357#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */1368#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB / L1 Miss Handling Buffer */
1358#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */1369#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */
1359#define PERF_MEM_LVLNUM_PMEM 0x0e /* PMEM */1370#define PERF_MEM_LVLNUM_PMEM 0x0e /* PMEM */
1360#define PERF_MEM_LVLNUM_NA 0x0f /* N/A */1371#define PERF_MEM_LVLNUM_NA 0x0f /* N/A */
lib/libc/include/any-linux-any/linux/pidfd.h+64
...@@ -5,6 +5,7 @@...@@ -5,6 +5,7 @@
55
6#include <linux/types.h>6#include <linux/types.h>
7#include <linux/fcntl.h>7#include <linux/fcntl.h>
8#include <linux/ioctl.h>
89
9/* Flags for pidfd_open(). */10/* Flags for pidfd_open(). */
10#define PIDFD_NONBLOCK O_NONBLOCK11#define PIDFD_NONBLOCK O_NONBLOCK
...@@ -15,4 +16,67 @@...@@ -15,4 +16,67 @@
15#define PIDFD_SIGNAL_THREAD_GROUP (1UL << 1)16#define PIDFD_SIGNAL_THREAD_GROUP (1UL << 1)
16#define PIDFD_SIGNAL_PROCESS_GROUP (1UL << 2)17#define PIDFD_SIGNAL_PROCESS_GROUP (1UL << 2)
1718
19/* Flags for pidfd_info. */
20#define PIDFD_INFO_PID (1UL << 0) /* Always returned, even if not requested */
21#define PIDFD_INFO_CREDS (1UL << 1) /* Always returned, even if not requested */
22#define PIDFD_INFO_CGROUPID (1UL << 2) /* Always returned if available, even if not requested */
23
24#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */
25
26struct pidfd_info {
27 /*
28 * This mask is similar to the request_mask in statx(2).
29 *
30 * Userspace indicates what extensions or expensive-to-calculate fields
31 * they want by setting the corresponding bits in mask. The kernel
32 * will ignore bits that it does not know about.
33 *
34 * When filling the structure, the kernel will only set bits
35 * corresponding to the fields that were actually filled by the kernel.
36 * This also includes any future extensions that might be automatically
37 * filled. If the structure size is too small to contain a field
38 * (requested or not), to avoid confusion the mask will not
39 * contain a bit for that field.
40 *
41 * As such, userspace MUST verify that mask contains the
42 * corresponding flags after the ioctl(2) returns to ensure that it is
43 * using valid data.
44 */
45 __u64 mask;
46 /*
47 * The information contained in the following fields might be stale at the
48 * time it is received, as the target process might have exited as soon as
49 * the IOCTL was processed, and there is no way to avoid that. However, it
50 * is guaranteed that if the call was successful, then the information was
51 * correct and referred to the intended process at the time the work was
52 * performed. */
53 __u64 cgroupid;
54 __u32 pid;
55 __u32 tgid;
56 __u32 ppid;
57 __u32 ruid;
58 __u32 rgid;
59 __u32 euid;
60 __u32 egid;
61 __u32 suid;
62 __u32 sgid;
63 __u32 fsuid;
64 __u32 fsgid;
65 __u32 spare0[1];
66};
67
68#define PIDFS_IOCTL_MAGIC 0xFF
69
70#define PIDFD_GET_CGROUP_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 1)
71#define PIDFD_GET_IPC_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 2)
72#define PIDFD_GET_MNT_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 3)
73#define PIDFD_GET_NET_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 4)
74#define PIDFD_GET_PID_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 5)
75#define PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 6)
76#define PIDFD_GET_TIME_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 7)
77#define PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 8)
78#define PIDFD_GET_USER_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 9)
79#define PIDFD_GET_UTS_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 10)
80#define PIDFD_GET_INFO _IOWR(PIDFS_IOCTL_MAGIC, 11, struct pidfd_info)
81
18#endif /* _LINUX_PIDFD_H */82#endif /* _LINUX_PIDFD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pkt_cls.h+23-10
...@@ -246,16 +246,19 @@ struct tc_u32_key {...@@ -246,16 +246,19 @@ struct tc_u32_key {
246};246};
247247
248struct tc_u32_sel {248struct tc_u32_sel {
249 unsigned char flags;249 /* New members MUST be added within the __struct_group() macro below. */
250 unsigned char offshift;250 __struct_group(tc_u32_sel_hdr, hdr, /* no attrs */,
251 unsigned char nkeys;251 unsigned char flags;
252252 unsigned char offshift;
253 __be16 offmask;253 unsigned char nkeys;
254 __u16 off;254
255 short offoff;255 __be16 offmask;
256256 __u16 off;
257 short hoff;257 short offoff;
258 __be32 hmask;258
259 short hoff;
260 __be32 hmask;
261 );
259 struct tc_u32_key keys[];262 struct tc_u32_key keys[];
260};263};
261264
...@@ -554,6 +557,9 @@ enum {...@@ -554,6 +557,9 @@ enum {
554 TCA_FLOWER_KEY_SPI, /* be32 */557 TCA_FLOWER_KEY_SPI, /* be32 */
555 TCA_FLOWER_KEY_SPI_MASK, /* be32 */558 TCA_FLOWER_KEY_SPI_MASK, /* be32 */
556559
560 TCA_FLOWER_KEY_ENC_FLAGS, /* be32 */
561 TCA_FLOWER_KEY_ENC_FLAGS_MASK, /* be32 */
562
557 __TCA_FLOWER_MAX,563 __TCA_FLOWER_MAX,
558};564};
559565
...@@ -674,8 +680,15 @@ enum {...@@ -674,8 +680,15 @@ enum {
674enum {680enum {
675 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),681 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
676 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),682 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
683 TCA_FLOWER_KEY_FLAGS_TUNNEL_CSUM = (1 << 2),
684 TCA_FLOWER_KEY_FLAGS_TUNNEL_DONT_FRAGMENT = (1 << 3),
685 TCA_FLOWER_KEY_FLAGS_TUNNEL_OAM = (1 << 4),
686 TCA_FLOWER_KEY_FLAGS_TUNNEL_CRIT_OPT = (1 << 5),
687 __TCA_FLOWER_KEY_FLAGS_MAX,
677};688};
678689
690#define TCA_FLOWER_KEY_FLAGS_MAX (__TCA_FLOWER_KEY_FLAGS_MAX - 1)
691
679enum {692enum {
680 TCA_FLOWER_KEY_CFM_OPT_UNSPEC,693 TCA_FLOWER_KEY_CFM_OPT_UNSPEC,
681 TCA_FLOWER_KEY_CFM_MD_LEVEL,694 TCA_FLOWER_KEY_CFM_MD_LEVEL,
lib/libc/include/any-linux-any/linux/pkt_sched.h+2
...@@ -836,6 +836,8 @@ enum {...@@ -836,6 +836,8 @@ enum {
836836
837 TCA_FQ_WEIGHTS, /* Weights for each band */837 TCA_FQ_WEIGHTS, /* Weights for each band */
838838
839 TCA_FQ_OFFLOAD_HORIZON, /* dequeue paced packets within this horizon immediately (us units) */
840
839 __TCA_FQ_MAX841 __TCA_FQ_MAX
840};842};
841843
lib/libc/include/any-linux-any/linux/prctl.h+26-1
...@@ -230,7 +230,7 @@ struct prctl_mm_map {...@@ -230,7 +230,7 @@ struct prctl_mm_map {
230# define PR_PAC_APDBKEY (1UL << 3)230# define PR_PAC_APDBKEY (1UL << 3)
231# define PR_PAC_APGAKEY (1UL << 4)231# define PR_PAC_APGAKEY (1UL << 4)
232232
233/* Tagged user address controls for arm64 */233/* Tagged user address controls for arm64 and RISC-V */
234#define PR_SET_TAGGED_ADDR_CTRL 55234#define PR_SET_TAGGED_ADDR_CTRL 55
235#define PR_GET_TAGGED_ADDR_CTRL 56235#define PR_GET_TAGGED_ADDR_CTRL 56
236# define PR_TAGGED_ADDR_ENABLE (1UL << 0)236# define PR_TAGGED_ADDR_ENABLE (1UL << 0)
...@@ -244,6 +244,9 @@ struct prctl_mm_map {...@@ -244,6 +244,9 @@ struct prctl_mm_map {
244# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)244# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
245/* Unused; kept only for source compatibility */245/* Unused; kept only for source compatibility */
246# define PR_MTE_TCF_SHIFT 1246# define PR_MTE_TCF_SHIFT 1
247/* RISC-V pointer masking tag length */
248# define PR_PMLEN_SHIFT 24
249# define PR_PMLEN_MASK (0x7fUL << PR_PMLEN_SHIFT)
247250
248/* Control reclaim behavior when allocating memory */251/* Control reclaim behavior when allocating memory */
249#define PR_SET_IO_FLUSHER 57252#define PR_SET_IO_FLUSHER 57
...@@ -328,4 +331,26 @@ struct prctl_mm_map {...@@ -328,4 +331,26 @@ struct prctl_mm_map {
328# define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 /* Clear the aspect on exec */331# define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 /* Clear the aspect on exec */
329# define PR_PPC_DEXCR_CTRL_MASK 0x1f332# define PR_PPC_DEXCR_CTRL_MASK 0x1f
330333
334/*
335 * Get the current shadow stack configuration for the current thread,
336 * this will be the value configured via PR_SET_SHADOW_STACK_STATUS.
337 */
338#define PR_GET_SHADOW_STACK_STATUS 74
339
340/*
341 * Set the current shadow stack configuration. Enabling the shadow
342 * stack will cause a shadow stack to be allocated for the thread.
343 */
344#define PR_SET_SHADOW_STACK_STATUS 75
345# define PR_SHADOW_STACK_ENABLE (1UL << 0)
346# define PR_SHADOW_STACK_WRITE (1UL << 1)
347# define PR_SHADOW_STACK_PUSH (1UL << 2)
348
349/*
350 * Prevent further changes to the specified shadow stack
351 * configuration. All bits may be locked via this call, including
352 * undefined bits.
353 */
354#define PR_LOCK_SHADOW_STACK_STATUS 76
355
331#endif /* _LINUX_PRCTL_H */356#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psample.h+10-1
...@@ -8,7 +8,11 @@ enum {...@@ -8,7 +8,11 @@ enum {
8 PSAMPLE_ATTR_ORIGSIZE,8 PSAMPLE_ATTR_ORIGSIZE,
9 PSAMPLE_ATTR_SAMPLE_GROUP,9 PSAMPLE_ATTR_SAMPLE_GROUP,
10 PSAMPLE_ATTR_GROUP_SEQ,10 PSAMPLE_ATTR_GROUP_SEQ,
11 PSAMPLE_ATTR_SAMPLE_RATE,11 PSAMPLE_ATTR_SAMPLE_RATE, /* u32, ratio between observed and
12 * sampled packets or scaled probability
13 * if PSAMPLE_ATTR_SAMPLE_PROBABILITY
14 * is set.
15 */
12 PSAMPLE_ATTR_DATA,16 PSAMPLE_ATTR_DATA,
13 PSAMPLE_ATTR_GROUP_REFCOUNT,17 PSAMPLE_ATTR_GROUP_REFCOUNT,
14 PSAMPLE_ATTR_TUNNEL,18 PSAMPLE_ATTR_TUNNEL,
...@@ -19,6 +23,11 @@ enum {...@@ -19,6 +23,11 @@ enum {
19 PSAMPLE_ATTR_LATENCY, /* u64, nanoseconds */23 PSAMPLE_ATTR_LATENCY, /* u64, nanoseconds */
20 PSAMPLE_ATTR_TIMESTAMP, /* u64, nanoseconds */24 PSAMPLE_ATTR_TIMESTAMP, /* u64, nanoseconds */
21 PSAMPLE_ATTR_PROTO, /* u16 */25 PSAMPLE_ATTR_PROTO, /* u16 */
26 PSAMPLE_ATTR_USER_COOKIE, /* binary, user provided data */
27 PSAMPLE_ATTR_SAMPLE_PROBABILITY,/* no argument, interpret rate in
28 * PSAMPLE_ATTR_SAMPLE_RATE as a
29 * probability scaled 0 - U32_MAX.
30 */
2231
23 __PSAMPLE_ATTR_MAX32 __PSAMPLE_ATTR_MAX
24};33};
lib/libc/include/any-linux-any/linux/psci.h+5
...@@ -59,6 +59,7 @@...@@ -59,6 +59,7 @@
59#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)59#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)
60#define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19)60#define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19)
61#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20)61#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20)
62#define PSCI_1_3_FN_SYSTEM_OFF2 PSCI_0_2_FN(21)
6263
63#define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12)64#define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12)
64#define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13)65#define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13)
...@@ -68,6 +69,7 @@...@@ -68,6 +69,7 @@
6869
69#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)70#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)
70#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20)71#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20)
72#define PSCI_1_3_FN64_SYSTEM_OFF2 PSCI_0_2_FN64(21)
7173
72/* PSCI v0.2 power state encoding for CPU_SUSPEND function */74/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
73#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff75#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
...@@ -100,6 +102,9 @@...@@ -100,6 +102,9 @@
100#define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET 0102#define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET 0
101#define PSCI_1_1_RESET_TYPE_VENDOR_START 0x80000000U103#define PSCI_1_1_RESET_TYPE_VENDOR_START 0x80000000U
102104
105/* PSCI v1.3 hibernate type for SYSTEM_OFF2 */
106#define PSCI_1_3_OFF_TYPE_HIBERNATE_OFF BIT(0)
107
103/* PSCI version decoding (independent of PSCI version) */108/* PSCI version decoding (independent of PSCI version) */
104#define PSCI_VERSION_MAJOR_SHIFT 16109#define PSCI_VERSION_MAJOR_SHIFT 16
105#define PSCI_VERSION_MINOR_MASK \110#define PSCI_VERSION_MINOR_MASK \
lib/libc/include/any-linux-any/linux/psp-sev.h+28
...@@ -31,6 +31,7 @@ enum {...@@ -31,6 +31,7 @@ enum {
31 SNP_PLATFORM_STATUS,31 SNP_PLATFORM_STATUS,
32 SNP_COMMIT,32 SNP_COMMIT,
33 SNP_SET_CONFIG,33 SNP_SET_CONFIG,
34 SNP_VLEK_LOAD,
3435
35 SEV_MAX,36 SEV_MAX,
36};37};
...@@ -50,6 +51,7 @@ typedef enum {...@@ -50,6 +51,7 @@ typedef enum {
50 SEV_RET_INVALID_PLATFORM_STATE,51 SEV_RET_INVALID_PLATFORM_STATE,
51 SEV_RET_INVALID_GUEST_STATE,52 SEV_RET_INVALID_GUEST_STATE,
52 SEV_RET_INAVLID_CONFIG,53 SEV_RET_INAVLID_CONFIG,
54 SEV_RET_INVALID_CONFIG = SEV_RET_INAVLID_CONFIG,
53 SEV_RET_INVALID_LEN,55 SEV_RET_INVALID_LEN,
54 SEV_RET_ALREADY_OWNED,56 SEV_RET_ALREADY_OWNED,
55 SEV_RET_INVALID_CERTIFICATE,57 SEV_RET_INVALID_CERTIFICATE,
...@@ -214,6 +216,32 @@ struct sev_user_data_snp_config {...@@ -214,6 +216,32 @@ struct sev_user_data_snp_config {
214 __u8 rsvd1[52];216 __u8 rsvd1[52];
215} __attribute__((packed));217} __attribute__((packed));
216218
219/**
220 * struct sev_data_snp_vlek_load - SNP_VLEK_LOAD structure
221 *
222 * @len: length of the command buffer read by the PSP
223 * @vlek_wrapped_version: version of wrapped VLEK hashstick (Must be 0h)
224 * @rsvd: reserved
225 * @vlek_wrapped_address: address of a wrapped VLEK hashstick
226 * (struct sev_user_data_snp_wrapped_vlek_hashstick)
227 */
228struct sev_user_data_snp_vlek_load {
229 __u32 len; /* In */
230 __u8 vlek_wrapped_version; /* In */
231 __u8 rsvd[3]; /* In */
232 __u64 vlek_wrapped_address; /* In */
233} __attribute__((packed));
234
235/**
236 * struct sev_user_data_snp_vlek_wrapped_vlek_hashstick - Wrapped VLEK data
237 *
238 * @data: Opaque data provided by AMD KDS (as described in SEV-SNP Firmware ABI
239 * 1.54, SNP_VLEK_LOAD)
240 */
241struct sev_user_data_snp_wrapped_vlek_hashstick {
242 __u8 data[432]; /* In */
243} __attribute__((packed));
244
217/**245/**
218 * struct sev_issue_cmd - SEV ioctl parameters246 * struct sev_issue_cmd - SEV ioctl parameters
219 *247 *
lib/libc/include/any-linux-any/linux/ptp_clock.h+18-6
...@@ -155,13 +155,25 @@ struct ptp_sys_offset {...@@ -155,13 +155,25 @@ struct ptp_sys_offset {
155 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];155 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
156};156};
157157
158/*
159 * ptp_sys_offset_extended - data structure for IOCTL operation
160 * PTP_SYS_OFFSET_EXTENDED
161 *
162 * @n_samples: Desired number of measurements.
163 * @clockid: clockid of a clock-base used for pre/post timestamps.
164 * @rsv: Reserved for future use.
165 * @ts: Array of samples in the form [pre-TS, PHC, post-TS]. The
166 * kernel provides @n_samples.
167 *
168 * Starting from kernel 6.12 and onwards, the first word of the reserved-field
169 * is used for @clockid. That's backward compatible since previous kernel
170 * expect all three reserved words (@rsv[3]) to be 0 while the clockid (first
171 * word in the new structure) for CLOCK_REALTIME is '0'.
172 */
158struct ptp_sys_offset_extended {173struct ptp_sys_offset_extended {
159 unsigned int n_samples; /* Desired number of measurements. */174 unsigned int n_samples;
160 unsigned int rsv[3]; /* Reserved for future use. */175 __kernel_clockid_t clockid;
161 /*176 unsigned int rsv[2];
162 * Array of [system, phc, system] time stamps. The kernel will provide
163 * 3*n_samples time stamps.
164 */
165 struct ptp_clock_time ts[PTP_MAX_SAMPLES][3];177 struct ptp_clock_time ts[PTP_MAX_SAMPLES][3];
166};178};
167179
lib/libc/include/any-linux-any/linux/raid/md_p.h+1-1
...@@ -233,7 +233,7 @@ struct mdp_superblock_1 {...@@ -233,7 +233,7 @@ struct mdp_superblock_1 {
233 char set_name[32]; /* set and interpreted by user-space */233 char set_name[32]; /* set and interpreted by user-space */
234234
235 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/235 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
236 __le32 level; /* 0,1,4,5 */236 __le32 level; /* 0,1,4,5, -1 (linear) */
237 __le32 layout; /* only for raid5 and raid10 currently */237 __le32 layout; /* only for raid5 and raid10 currently */
238 __le64 size; /* used size of component devices, in 512byte sectors */238 __le64 size; /* used size of component devices, in 512byte sectors */
239239
lib/libc/include/any-linux-any/linux/raid/md_u.h+2
...@@ -103,6 +103,8 @@ typedef struct mdu_array_info_s {...@@ -103,6 +103,8 @@ typedef struct mdu_array_info_s {
103103
104} mdu_array_info_t;104} mdu_array_info_t;
105105
106#define LEVEL_LINEAR (-1)
107
106/* we need a value for 'no level specified' and 0108/* we need a value for 'no level specified' and 0
107 * means 'raid0', so we need something else. This is109 * means 'raid0', so we need something else. This is
108 * for internal use only110 * for internal use only
lib/libc/include/any-linux-any/linux/random.h+16-1
...@@ -20,7 +20,7 @@...@@ -20,7 +20,7 @@
20/* Add to (or subtract from) the entropy count. (Superuser only.) */20/* Add to (or subtract from) the entropy count. (Superuser only.) */
21#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )21#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
2222
23/* Get the contents of the entropy pool. (Superuser only.) */23/* Get the contents of the entropy pool. (Superuser only.) (Removed in 2.6.9-rc2.) */
24#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )24#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
2525
26/* 26/*
...@@ -55,4 +55,19 @@ struct rand_pool_info {...@@ -55,4 +55,19 @@ struct rand_pool_info {
55#define GRND_RANDOM 0x000255#define GRND_RANDOM 0x0002
56#define GRND_INSECURE 0x000456#define GRND_INSECURE 0x0004
5757
58/**
59 * struct vgetrandom_opaque_params - arguments for allocating memory for vgetrandom
60 *
61 * @size_per_opaque_state: Size of each state that is to be passed to vgetrandom().
62 * @mmap_prot: Value of the prot argument in mmap(2).
63 * @mmap_flags: Value of the flags argument in mmap(2).
64 * @reserved: Reserved for future use.
65 */
66struct vgetrandom_opaque_params {
67 __u32 size_of_opaque_state;
68 __u32 mmap_prot;
69 __u32 mmap_flags;
70 __u32 reserved[13];
71};
72
58#endif /* _LINUX_RANDOM_H */73#endif /* _LINUX_RANDOM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/reiserfs_fs.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 1996, 1997, 1998 Hans Reiser, see reiserfs/README for licensing and copyright details
4 */
5#ifndef _LINUX_REISER_FS_H
6#define _LINUX_REISER_FS_H
7
8#include <linux/types.h>
9#include <linux/magic.h>
10
11/*
12 * include/linux/reiser_fs.h
13 *
14 * Reiser File System constants and structures
15 *
16 */
17
18/* ioctl's command */
19#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
20/* define following flags to be the same as in ext2, so that chattr(1),
21 lsattr(1) will work with us. */
22#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
23#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
24#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
25#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
26
27#endif /* _LINUX_REISER_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/reiserfs_xattr.h deleted-25
...@@ -1,25 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 File: linux/reiserfs_xattr.h
4*/
5
6#ifndef _LINUX_REISERFS_XATTR_H
7#define _LINUX_REISERFS_XATTR_H
8
9#include <linux/types.h>
10
11/* Magic value in header */
12#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
13
14struct reiserfs_xattr_header {
15 __le32 h_magic; /* magic number for identification */
16 __le32 h_hash; /* hash of the value */
17};
18
19struct reiserfs_security_handle {
20 const char *name;
21 void *value;
22 __kernel_size_t length;
23};
24
25#endif /* _LINUX_REISERFS_XATTR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rkisp1-config.h+578
...@@ -164,6 +164,11 @@...@@ -164,6 +164,11 @@
164#define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS 17164#define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS 17
165#define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS 6165#define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS 6
166166
167/*
168 * Compand
169 */
170#define RKISP1_CIF_ISP_COMPAND_NUM_POINTS 64
171
167/*172/*
168 * Measurement types173 * Measurement types
169 */174 */
...@@ -851,6 +856,39 @@ struct rkisp1_params_cfg {...@@ -851,6 +856,39 @@ struct rkisp1_params_cfg {
851 struct rkisp1_cif_isp_isp_other_cfg others;856 struct rkisp1_cif_isp_isp_other_cfg others;
852};857};
853858
859/**
860 * struct rkisp1_cif_isp_compand_bls_config - Rockchip ISP1 Companding parameters (BLS)
861 * @r: Fixed subtraction value for Bayer pattern R
862 * @gr: Fixed subtraction value for Bayer pattern Gr
863 * @gb: Fixed subtraction value for Bayer pattern Gb
864 * @b: Fixed subtraction value for Bayer pattern B
865 *
866 * The values will be subtracted from the sensor values. Note that unlike the
867 * dedicated BLS block, the BLS values in the compander are 20-bit unsigned.
868 */
869struct rkisp1_cif_isp_compand_bls_config {
870 __u32 r;
871 __u32 gr;
872 __u32 gb;
873 __u32 b;
874};
875
876/**
877 * struct rkisp1_cif_isp_compand_curve_config - Rockchip ISP1 Companding
878 * parameters (expand and compression curves)
879 * @px: Compand curve x-values. Each value stores the distance from the
880 * previous x-value, expressed as log2 of the distance on 5 bits.
881 * @x: Compand curve x-values. The functionality of these parameters are
882 * unknown due to do a lack of hardware documentation, but these are left
883 * here for future compatibility purposes.
884 * @y: Compand curve y-values
885 */
886struct rkisp1_cif_isp_compand_curve_config {
887 __u8 px[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];
888 __u32 x[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];
889 __u32 y[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];
890};
891
854/*---------- PART2: Measurement Statistics ------------*/892/*---------- PART2: Measurement Statistics ------------*/
855893
856/**894/**
...@@ -996,4 +1034,544 @@ struct rkisp1_stat_buffer {...@@ -996,4 +1034,544 @@ struct rkisp1_stat_buffer {
996 struct rkisp1_cif_isp_stat params;1034 struct rkisp1_cif_isp_stat params;
997};1035};
9981036
1037/*---------- PART3: Extensible Configuration Parameters ------------*/
1038
1039/**
1040 * enum rkisp1_ext_params_block_type - RkISP1 extensible params block type
1041 *
1042 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS: Black level subtraction
1043 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC: Defect pixel cluster correction
1044 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG: Sensor de-gamma
1045 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN: Auto white balance gains
1046 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_FLT: ISP filtering
1047 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM: Bayer de-mosaic
1048 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK: Cross-talk correction
1049 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_GOC: Gamma out correction
1050 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF: De-noise pre-filter
1051 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH: De-noise pre-filter strength
1052 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC: Color processing
1053 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_IE: Image effects
1054 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_LSC: Lens shading correction
1055 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS: Auto white balance statistics
1056 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS: Histogram statistics
1057 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS: Auto exposure statistics
1058 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS: Auto-focus statistics
1059 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS: BLS in the compand block
1060 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve
1061 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve
1062 */
1063enum rkisp1_ext_params_block_type {
1064 RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS,
1065 RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC,
1066 RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG,
1067 RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN,
1068 RKISP1_EXT_PARAMS_BLOCK_TYPE_FLT,
1069 RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM,
1070 RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK,
1071 RKISP1_EXT_PARAMS_BLOCK_TYPE_GOC,
1072 RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF,
1073 RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH,
1074 RKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC,
1075 RKISP1_EXT_PARAMS_BLOCK_TYPE_IE,
1076 RKISP1_EXT_PARAMS_BLOCK_TYPE_LSC,
1077 RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS,
1078 RKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS,
1079 RKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS,
1080 RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS,
1081 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS,
1082 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND,
1083 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS,
1084};
1085
1086#define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE (1U << 0)
1087#define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE (1U << 1)
1088
1089/**
1090 * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block
1091 * header
1092 *
1093 * This structure represents the common part of all the ISP configuration
1094 * blocks. Each parameters block shall embed an instance of this structure type
1095 * as its first member, followed by the block-specific configuration data. The
1096 * driver inspects this common header to discern the block type and its size and
1097 * properly handle the block content by casting it to the correct block-specific
1098 * type.
1099 *
1100 * The @type field is one of the values enumerated by
1101 * :c:type:`rkisp1_ext_params_block_type` and specifies how the data should be
1102 * interpreted by the driver. The @size field specifies the size of the
1103 * parameters block and is used by the driver for validation purposes.
1104 *
1105 * The @flags field is a bitmask of per-block flags RKISP1_EXT_PARAMS_FL_*.
1106 *
1107 * When userspace wants to configure and enable an ISP block it shall fully
1108 * populate the block configuration and set the
1109 * RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE bit in the @flags field.
1110 *
1111 * When userspace simply wants to disable an ISP block the
1112 * RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bit should be set in @flags field. The
1113 * driver ignores the rest of the block configuration structure in this case.
1114 *
1115 * If a new configuration of an ISP block has to be applied userspace shall
1116 * fully populate the ISP block configuration and omit setting the
1117 * RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE and RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bits
1118 * in the @flags field.
1119 *
1120 * Setting both the RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE and
1121 * RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bits in the @flags field is not allowed
1122 * and not accepted by the driver.
1123 *
1124 * Userspace is responsible for correctly populating the parameters block header
1125 * fields (@type, @flags and @size) and the block-specific parameters.
1126 *
1127 * For example:
1128 *
1129 * .. code-block:: c
1130 *
1131 * void populate_bls(struct rkisp1_ext_params_block_header *block) {
1132 * struct rkisp1_ext_params_bls_config *bls =
1133 * (struct rkisp1_ext_params_bls_config *)block;
1134 *
1135 * bls->header.type = RKISP1_EXT_PARAMS_BLOCK_ID_BLS;
1136 * bls->header.flags = RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE;
1137 * bls->header.size = sizeof(*bls);
1138 *
1139 * bls->config.enable_auto = 0;
1140 * bls->config.fixed_val.r = blackLevelRed_;
1141 * bls->config.fixed_val.gr = blackLevelGreenR_;
1142 * bls->config.fixed_val.gb = blackLevelGreenB_;
1143 * bls->config.fixed_val.b = blackLevelBlue_;
1144 * }
1145 *
1146 * @type: The parameters block type, see
1147 * :c:type:`rkisp1_ext_params_block_type`
1148 * @flags: A bitmask of block flags
1149 * @size: Size (in bytes) of the parameters block, including this header
1150 */
1151struct rkisp1_ext_params_block_header {
1152 __u16 type;
1153 __u16 flags;
1154 __u32 size;
1155};
1156
1157/**
1158 * struct rkisp1_ext_params_bls_config - RkISP1 extensible params BLS config
1159 *
1160 * RkISP1 extensible parameters Black Level Subtraction configuration block.
1161 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS`.
1162 *
1163 * @header: The RkISP1 extensible parameters header, see
1164 * :c:type:`rkisp1_ext_params_block_header`
1165 * @config: Black Level Subtraction configuration, see
1166 * :c:type:`rkisp1_cif_isp_bls_config`
1167 */
1168struct rkisp1_ext_params_bls_config {
1169 struct rkisp1_ext_params_block_header header;
1170 struct rkisp1_cif_isp_bls_config config;
1171} __attribute__((aligned(8)));
1172
1173/**
1174 * struct rkisp1_ext_params_dpcc_config - RkISP1 extensible params DPCC config
1175 *
1176 * RkISP1 extensible parameters Defective Pixel Cluster Correction configuration
1177 * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC`.
1178 *
1179 * @header: The RkISP1 extensible parameters header, see
1180 * :c:type:`rkisp1_ext_params_block_header`
1181 * @config: Defective Pixel Cluster Correction configuration, see
1182 * :c:type:`rkisp1_cif_isp_dpcc_config`
1183 */
1184struct rkisp1_ext_params_dpcc_config {
1185 struct rkisp1_ext_params_block_header header;
1186 struct rkisp1_cif_isp_dpcc_config config;
1187} __attribute__((aligned(8)));
1188
1189/**
1190 * struct rkisp1_ext_params_sdg_config - RkISP1 extensible params SDG config
1191 *
1192 * RkISP1 extensible parameters Sensor Degamma configuration block. Identified
1193 * by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG`.
1194 *
1195 * @header: The RkISP1 extensible parameters header, see
1196 * :c:type:`rkisp1_ext_params_block_header`
1197 * @config: Sensor Degamma configuration, see
1198 * :c:type:`rkisp1_cif_isp_sdg_config`
1199 */
1200struct rkisp1_ext_params_sdg_config {
1201 struct rkisp1_ext_params_block_header header;
1202 struct rkisp1_cif_isp_sdg_config config;
1203} __attribute__((aligned(8)));
1204
1205/**
1206 * struct rkisp1_ext_params_lsc_config - RkISP1 extensible params LSC config
1207 *
1208 * RkISP1 extensible parameters Lens Shading Correction configuration block.
1209 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_LSC`.
1210 *
1211 * @header: The RkISP1 extensible parameters header, see
1212 * :c:type:`rkisp1_ext_params_block_header`
1213 * @config: Lens Shading Correction configuration, see
1214 * :c:type:`rkisp1_cif_isp_lsc_config`
1215 */
1216struct rkisp1_ext_params_lsc_config {
1217 struct rkisp1_ext_params_block_header header;
1218 struct rkisp1_cif_isp_lsc_config config;
1219} __attribute__((aligned(8)));
1220
1221/**
1222 * struct rkisp1_ext_params_awb_gain_config - RkISP1 extensible params AWB
1223 * gain config
1224 *
1225 * RkISP1 extensible parameters Auto-White Balance Gains configuration block.
1226 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN`.
1227 *
1228 * @header: The RkISP1 extensible parameters header, see
1229 * :c:type:`rkisp1_ext_params_block_header`
1230 * @config: Auto-White Balance Gains configuration, see
1231 * :c:type:`rkisp1_cif_isp_awb_gain_config`
1232 */
1233struct rkisp1_ext_params_awb_gain_config {
1234 struct rkisp1_ext_params_block_header header;
1235 struct rkisp1_cif_isp_awb_gain_config config;
1236} __attribute__((aligned(8)));
1237
1238/**
1239 * struct rkisp1_ext_params_flt_config - RkISP1 extensible params FLT config
1240 *
1241 * RkISP1 extensible parameters Filter configuration block. Identified by
1242 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_FLT`.
1243 *
1244 * @header: The RkISP1 extensible parameters header, see
1245 * :c:type:`rkisp1_ext_params_block_header`
1246 * @config: Filter configuration, see :c:type:`rkisp1_cif_isp_flt_config`
1247 */
1248struct rkisp1_ext_params_flt_config {
1249 struct rkisp1_ext_params_block_header header;
1250 struct rkisp1_cif_isp_flt_config config;
1251} __attribute__((aligned(8)));
1252
1253/**
1254 * struct rkisp1_ext_params_bdm_config - RkISP1 extensible params BDM config
1255 *
1256 * RkISP1 extensible parameters Demosaicing configuration block. Identified by
1257 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM`.
1258 *
1259 * @header: The RkISP1 extensible parameters header, see
1260 * :c:type:`rkisp1_ext_params_block_header`
1261 * @config: Demosaicing configuration, see :c:type:`rkisp1_cif_isp_bdm_config`
1262 */
1263struct rkisp1_ext_params_bdm_config {
1264 struct rkisp1_ext_params_block_header header;
1265 struct rkisp1_cif_isp_bdm_config config;
1266} __attribute__((aligned(8)));
1267
1268/**
1269 * struct rkisp1_ext_params_ctk_config - RkISP1 extensible params CTK config
1270 *
1271 * RkISP1 extensible parameters Cross-Talk configuration block. Identified by
1272 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK`.
1273 *
1274 * @header: The RkISP1 extensible parameters header, see
1275 * :c:type:`rkisp1_ext_params_block_header`
1276 * @config: Cross-Talk configuration, see :c:type:`rkisp1_cif_isp_ctk_config`
1277 */
1278struct rkisp1_ext_params_ctk_config {
1279 struct rkisp1_ext_params_block_header header;
1280 struct rkisp1_cif_isp_ctk_config config;
1281} __attribute__((aligned(8)));
1282
1283/**
1284 * struct rkisp1_ext_params_goc_config - RkISP1 extensible params GOC config
1285 *
1286 * RkISP1 extensible parameters Gamma-Out configuration block. Identified by
1287 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_GOC`.
1288 *
1289 * @header: The RkISP1 extensible parameters header, see
1290 * :c:type:`rkisp1_ext_params_block_header`
1291 * @config: Gamma-Out configuration, see :c:type:`rkisp1_cif_isp_goc_config`
1292 */
1293struct rkisp1_ext_params_goc_config {
1294 struct rkisp1_ext_params_block_header header;
1295 struct rkisp1_cif_isp_goc_config config;
1296} __attribute__((aligned(8)));
1297
1298/**
1299 * struct rkisp1_ext_params_dpf_config - RkISP1 extensible params DPF config
1300 *
1301 * RkISP1 extensible parameters De-noise Pre-Filter configuration block.
1302 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF`.
1303 *
1304 * @header: The RkISP1 extensible parameters header, see
1305 * :c:type:`rkisp1_ext_params_block_header`
1306 * @config: De-noise Pre-Filter configuration, see
1307 * :c:type:`rkisp1_cif_isp_dpf_config`
1308 */
1309struct rkisp1_ext_params_dpf_config {
1310 struct rkisp1_ext_params_block_header header;
1311 struct rkisp1_cif_isp_dpf_config config;
1312} __attribute__((aligned(8)));
1313
1314/**
1315 * struct rkisp1_ext_params_dpf_strength_config - RkISP1 extensible params DPF
1316 * strength config
1317 *
1318 * RkISP1 extensible parameters De-noise Pre-Filter strength configuration
1319 * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH`.
1320 *
1321 * @header: The RkISP1 extensible parameters header, see
1322 * :c:type:`rkisp1_ext_params_block_header`
1323 * @config: De-noise Pre-Filter strength configuration, see
1324 * :c:type:`rkisp1_cif_isp_dpf_strength_config`
1325 */
1326struct rkisp1_ext_params_dpf_strength_config {
1327 struct rkisp1_ext_params_block_header header;
1328 struct rkisp1_cif_isp_dpf_strength_config config;
1329} __attribute__((aligned(8)));
1330
1331/**
1332 * struct rkisp1_ext_params_cproc_config - RkISP1 extensible params CPROC config
1333 *
1334 * RkISP1 extensible parameters Color Processing configuration block.
1335 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC`.
1336 *
1337 * @header: The RkISP1 extensible parameters header, see
1338 * :c:type:`rkisp1_ext_params_block_header`
1339 * @config: Color processing configuration, see
1340 * :c:type:`rkisp1_cif_isp_cproc_config`
1341 */
1342struct rkisp1_ext_params_cproc_config {
1343 struct rkisp1_ext_params_block_header header;
1344 struct rkisp1_cif_isp_cproc_config config;
1345} __attribute__((aligned(8)));
1346
1347/**
1348 * struct rkisp1_ext_params_ie_config - RkISP1 extensible params IE config
1349 *
1350 * RkISP1 extensible parameters Image Effect configuration block. Identified by
1351 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_IE`.
1352 *
1353 * @header: The RkISP1 extensible parameters header, see
1354 * :c:type:`rkisp1_ext_params_block_header`
1355 * @config: Image Effect configuration, see :c:type:`rkisp1_cif_isp_ie_config`
1356 */
1357struct rkisp1_ext_params_ie_config {
1358 struct rkisp1_ext_params_block_header header;
1359 struct rkisp1_cif_isp_ie_config config;
1360} __attribute__((aligned(8)));
1361
1362/**
1363 * struct rkisp1_ext_params_awb_meas_config - RkISP1 extensible params AWB
1364 * Meas config
1365 *
1366 * RkISP1 extensible parameters Auto-White Balance Measurement configuration
1367 * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS`.
1368 *
1369 * @header: The RkISP1 extensible parameters header, see
1370 * :c:type:`rkisp1_ext_params_block_header`
1371 * @config: Auto-White Balance measure configuration, see
1372 * :c:type:`rkisp1_cif_isp_awb_meas_config`
1373 */
1374struct rkisp1_ext_params_awb_meas_config {
1375 struct rkisp1_ext_params_block_header header;
1376 struct rkisp1_cif_isp_awb_meas_config config;
1377} __attribute__((aligned(8)));
1378
1379/**
1380 * struct rkisp1_ext_params_hst_config - RkISP1 extensible params Histogram config
1381 *
1382 * RkISP1 extensible parameters Histogram statistics configuration block.
1383 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS`.
1384 *
1385 * @header: The RkISP1 extensible parameters header, see
1386 * :c:type:`rkisp1_ext_params_block_header`
1387 * @config: Histogram statistics configuration, see
1388 * :c:type:`rkisp1_cif_isp_hst_config`
1389 */
1390struct rkisp1_ext_params_hst_config {
1391 struct rkisp1_ext_params_block_header header;
1392 struct rkisp1_cif_isp_hst_config config;
1393} __attribute__((aligned(8)));
1394
1395/**
1396 * struct rkisp1_ext_params_aec_config - RkISP1 extensible params AEC config
1397 *
1398 * RkISP1 extensible parameters Auto-Exposure statistics configuration block.
1399 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS`.
1400 *
1401 * @header: The RkISP1 extensible parameters header, see
1402 * :c:type:`rkisp1_ext_params_block_header`
1403 * @config: Auto-Exposure statistics configuration, see
1404 * :c:type:`rkisp1_cif_isp_aec_config`
1405 */
1406struct rkisp1_ext_params_aec_config {
1407 struct rkisp1_ext_params_block_header header;
1408 struct rkisp1_cif_isp_aec_config config;
1409} __attribute__((aligned(8)));
1410
1411/**
1412 * struct rkisp1_ext_params_afc_config - RkISP1 extensible params AFC config
1413 *
1414 * RkISP1 extensible parameters Auto-Focus statistics configuration block.
1415 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS`.
1416 *
1417 * @header: The RkISP1 extensible parameters header, see
1418 * :c:type:`rkisp1_ext_params_block_header`
1419 * @config: Auto-Focus statistics configuration, see
1420 * :c:type:`rkisp1_cif_isp_afc_config`
1421 */
1422struct rkisp1_ext_params_afc_config {
1423 struct rkisp1_ext_params_block_header header;
1424 struct rkisp1_cif_isp_afc_config config;
1425} __attribute__((aligned(8)));
1426
1427/**
1428 * struct rkisp1_ext_params_compand_bls_config - RkISP1 extensible params
1429 * Compand BLS config
1430 *
1431 * RkISP1 extensible parameters Companding configuration block (black level
1432 * subtraction). Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS`.
1433 *
1434 * @header: The RkISP1 extensible parameters header, see
1435 * :c:type:`rkisp1_ext_params_block_header`
1436 * @config: Companding BLS configuration, see
1437 * :c:type:`rkisp1_cif_isp_compand_bls_config`
1438 */
1439struct rkisp1_ext_params_compand_bls_config {
1440 struct rkisp1_ext_params_block_header header;
1441 struct rkisp1_cif_isp_compand_bls_config config;
1442} __attribute__((aligned(8)));
1443
1444/**
1445 * struct rkisp1_ext_params_compand_curve_config - RkISP1 extensible params
1446 * Compand curve config
1447 *
1448 * RkISP1 extensible parameters Companding configuration block (expand and
1449 * compression curves). Identified by
1450 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND` or
1451 * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS`.
1452 *
1453 * @header: The RkISP1 extensible parameters header, see
1454 * :c:type:`rkisp1_ext_params_block_header`
1455 * @config: Companding curve configuration, see
1456 * :c:type:`rkisp1_cif_isp_compand_curve_config`
1457 */
1458struct rkisp1_ext_params_compand_curve_config {
1459 struct rkisp1_ext_params_block_header header;
1460 struct rkisp1_cif_isp_compand_curve_config config;
1461} __attribute__((aligned(8)));
1462
1463/*
1464 * The rkisp1_ext_params_compand_curve_config structure is counted twice as it
1465 * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types.
1466 */
1467#define RKISP1_EXT_PARAMS_MAX_SIZE \
1468 (sizeof(struct rkisp1_ext_params_bls_config) +\
1469 sizeof(struct rkisp1_ext_params_dpcc_config) +\
1470 sizeof(struct rkisp1_ext_params_sdg_config) +\
1471 sizeof(struct rkisp1_ext_params_lsc_config) +\
1472 sizeof(struct rkisp1_ext_params_awb_gain_config) +\
1473 sizeof(struct rkisp1_ext_params_flt_config) +\
1474 sizeof(struct rkisp1_ext_params_bdm_config) +\
1475 sizeof(struct rkisp1_ext_params_ctk_config) +\
1476 sizeof(struct rkisp1_ext_params_goc_config) +\
1477 sizeof(struct rkisp1_ext_params_dpf_config) +\
1478 sizeof(struct rkisp1_ext_params_dpf_strength_config) +\
1479 sizeof(struct rkisp1_ext_params_cproc_config) +\
1480 sizeof(struct rkisp1_ext_params_ie_config) +\
1481 sizeof(struct rkisp1_ext_params_awb_meas_config) +\
1482 sizeof(struct rkisp1_ext_params_hst_config) +\
1483 sizeof(struct rkisp1_ext_params_aec_config) +\
1484 sizeof(struct rkisp1_ext_params_afc_config) +\
1485 sizeof(struct rkisp1_ext_params_compand_bls_config) +\
1486 sizeof(struct rkisp1_ext_params_compand_curve_config) +\
1487 sizeof(struct rkisp1_ext_params_compand_curve_config))
1488
1489/**
1490 * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version
1491 *
1492 * @RKISP1_EXT_PARAM_BUFFER_V1: First version of RkISP1 extensible parameters
1493 */
1494enum rksip1_ext_param_buffer_version {
1495 RKISP1_EXT_PARAM_BUFFER_V1 = 1,
1496};
1497
1498/**
1499 * struct rkisp1_ext_params_cfg - RkISP1 extensible parameters configuration
1500 *
1501 * This struct contains the configuration parameters of the RkISP1 ISP
1502 * algorithms, serialized by userspace into a data buffer. Each configuration
1503 * parameter block is represented by a block-specific structure which contains a
1504 * :c:type:`rkisp1_ext_params_block_header` entry as first member. Userspace
1505 * populates the @data buffer with configuration parameters for the blocks that
1506 * it intends to configure. As a consequence, the data buffer effective size
1507 * changes according to the number of ISP blocks that userspace intends to
1508 * configure and is set by userspace in the @data_size field.
1509 *
1510 * The parameters buffer is versioned by the @version field to allow modifying
1511 * and extending its definition. Userspace shall populate the @version field to
1512 * inform the driver about the version it intends to use. The driver will parse
1513 * and handle the @data buffer according to the data layout specific to the
1514 * indicated version and return an error if the desired version is not
1515 * supported.
1516 *
1517 * Currently the single RKISP1_EXT_PARAM_BUFFER_V1 version is supported.
1518 * When a new format version will be added, a mechanism for userspace to query
1519 * the supported format versions will be implemented in the form of a read-only
1520 * V4L2 control. If such control is not available, userspace should assume only
1521 * RKISP1_EXT_PARAM_BUFFER_V1 is supported by the driver.
1522 *
1523 * For each ISP block that userspace wants to configure, a block-specific
1524 * structure is appended to the @data buffer, one after the other without gaps
1525 * in between nor overlaps. Userspace shall populate the @data_size field with
1526 * the effective size, in bytes, of the @data buffer.
1527 *
1528 * The expected memory layout of the parameters buffer is::
1529 *
1530 * +-------------------- struct rkisp1_ext_params_cfg -------------------+
1531 * | version = RKISP_EXT_PARAMS_BUFFER_V1; |
1532 * | data_size = sizeof(struct rkisp1_ext_params_bls_config) |
1533 * | + sizeof(struct rkisp1_ext_params_dpcc_config); |
1534 * | +------------------------- data ---------------------------------+ |
1535 * | | +------------- struct rkisp1_ext_params_bls_config -----------+ | |
1536 * | | | +-------- struct rkisp1_ext_params_block_header ---------+ | | |
1537 * | | | | type = RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS; | | | |
1538 * | | | | flags = RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE; | | | |
1539 * | | | | size = sizeof(struct rkisp1_ext_params_bls_config); | | | |
1540 * | | | +---------------------------------------------------------+ | | |
1541 * | | | +---------- struct rkisp1_cif_isp_bls_config -------------+ | | |
1542 * | | | | enable_auto = 0; | | | |
1543 * | | | | fixed_val.r = 256; | | | |
1544 * | | | | fixed_val.gr = 256; | | | |
1545 * | | | | fixed_val.gb = 256; | | | |
1546 * | | | | fixed_val.b = 256; | | | |
1547 * | | | +---------------------------------------------------------+ | | |
1548 * | | +------------ struct rkisp1_ext_params_dpcc_config -----------+ | |
1549 * | | | +-------- struct rkisp1_ext_params_block_header ---------+ | | |
1550 * | | | | type = RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC; | | | |
1551 * | | | | flags = RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE; | | | |
1552 * | | | | size = sizeof(struct rkisp1_ext_params_dpcc_config); | | | |
1553 * | | | +---------------------------------------------------------+ | | |
1554 * | | | +---------- struct rkisp1_cif_isp_dpcc_config ------------+ | | |
1555 * | | | | mode = RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE; | | | |
1556 * | | | | output_mode = | | | |
1557 * | | | | RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER; | | | |
1558 * | | | | set_use = ... ; | | | |
1559 * | | | | ... = ... ; | | | |
1560 * | | | +---------------------------------------------------------+ | | |
1561 * | | +-------------------------------------------------------------+ | |
1562 * | +-----------------------------------------------------------------+ |
1563 * +---------------------------------------------------------------------+
1564 *
1565 * @version: The RkISP1 extensible parameters buffer version, see
1566 * :c:type:`rksip1_ext_param_buffer_version`
1567 * @data_size: The RkISP1 configuration data effective size, excluding this
1568 * header
1569 * @data: The RkISP1 extensible configuration data blocks
1570 */
1571struct rkisp1_ext_params_cfg {
1572 __u32 version;
1573 __u32 data_size;
1574 __u8 data[RKISP1_EXT_PARAMS_MAX_SIZE];
1575};
1576
999#endif /* _RKISP1_CONFIG_H */1577#endif /* _RKISP1_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rtnetlink.h+1-1
...@@ -174,7 +174,7 @@ enum {...@@ -174,7 +174,7 @@ enum {
174#define RTM_GETLINKPROP RTM_GETLINKPROP174#define RTM_GETLINKPROP RTM_GETLINKPROP
175175
176 RTM_NEWVLAN = 112,176 RTM_NEWVLAN = 112,
177#define RTM_NEWNVLAN RTM_NEWVLAN177#define RTM_NEWVLAN RTM_NEWVLAN
178 RTM_DELVLAN,178 RTM_DELVLAN,
179#define RTM_DELVLAN RTM_DELVLAN179#define RTM_DELVLAN RTM_DELVLAN
180 RTM_GETVLAN,180 RTM_GETVLAN,
lib/libc/include/any-linux-any/linux/sched.h+1
...@@ -118,6 +118,7 @@ struct clone_args {...@@ -118,6 +118,7 @@ struct clone_args {
118/* SCHED_ISO: reserved but not implemented yet */118/* SCHED_ISO: reserved but not implemented yet */
119#define SCHED_IDLE 5119#define SCHED_IDLE 5
120#define SCHED_DEADLINE 6120#define SCHED_DEADLINE 6
121#define SCHED_EXT 7
121122
122/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */123/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
123#define SCHED_RESET_ON_FORK 0x40000000124#define SCHED_RESET_ON_FORK 0x40000000
lib/libc/include/any-linux-any/linux/sched/types.h+3-3
...@@ -58,9 +58,9 @@...@@ -58,9 +58,9 @@
58 *58 *
59 * This is reflected by the following fields of the sched_attr structure:59 * This is reflected by the following fields of the sched_attr structure:
60 *60 *
61 * @sched_deadline representative of the task's deadline61 * @sched_deadline representative of the task's deadline in nanoseconds
62 * @sched_runtime representative of the task's runtime62 * @sched_runtime representative of the task's runtime in nanoseconds
63 * @sched_period representative of the task's period63 * @sched_period representative of the task's period in nanoseconds
64 *64 *
65 * Given this task model, there are a multiplicity of scheduling algorithms65 * Given this task model, there are a multiplicity of scheduling algorithms
66 * and policies, that can be used to ensure all the tasks will make their66 * and policies, that can be used to ensure all the tasks will make their
lib/libc/include/any-linux-any/linux/sed-opal.h+1
...@@ -215,5 +215,6 @@ struct opal_revert_lsp {...@@ -215,5 +215,6 @@ struct opal_revert_lsp {
215#define IOC_OPAL_GET_GEOMETRY _IOR('p', 238, struct opal_geometry)215#define IOC_OPAL_GET_GEOMETRY _IOR('p', 238, struct opal_geometry)
216#define IOC_OPAL_DISCOVERY _IOW('p', 239, struct opal_discovery)216#define IOC_OPAL_DISCOVERY _IOW('p', 239, struct opal_discovery)
217#define IOC_OPAL_REVERT_LSP _IOW('p', 240, struct opal_revert_lsp)217#define IOC_OPAL_REVERT_LSP _IOW('p', 240, struct opal_revert_lsp)
218#define IOC_OPAL_SET_SID_PW _IOW('p', 241, struct opal_new_pw)
218219
219#endif /* _SED_OPAL_H */220#endif /* _SED_OPAL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serio.h+1
...@@ -83,5 +83,6 @@...@@ -83,5 +83,6 @@
83#define SERIO_PULSE8_CEC 0x4083#define SERIO_PULSE8_CEC 0x40
84#define SERIO_RAINSHADOW_CEC 0x4184#define SERIO_RAINSHADOW_CEC 0x41
85#define SERIO_FSIA6B 0x4285#define SERIO_FSIA6B 0x42
86#define SERIO_EXTRON_DA_HD_4K_PLUS 0x43
8687
87#endif /* _SERIO_H */88#endif /* _SERIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sev-guest.h+3
...@@ -89,6 +89,9 @@ struct snp_ext_report_req {...@@ -89,6 +89,9 @@ struct snp_ext_report_req {
89#define SNP_GUEST_FW_ERR_MASK GENMASK_ULL(31, 0)89#define SNP_GUEST_FW_ERR_MASK GENMASK_ULL(31, 0)
90#define SNP_GUEST_VMM_ERR_SHIFT 3290#define SNP_GUEST_VMM_ERR_SHIFT 32
91#define SNP_GUEST_VMM_ERR(x) (((u64)x) << SNP_GUEST_VMM_ERR_SHIFT)91#define SNP_GUEST_VMM_ERR(x) (((u64)x) << SNP_GUEST_VMM_ERR_SHIFT)
92#define SNP_GUEST_FW_ERR(x) ((x) & SNP_GUEST_FW_ERR_MASK)
93#define SNP_GUEST_ERR(vmm_err, fw_err) (SNP_GUEST_VMM_ERR(vmm_err) | \
94 SNP_GUEST_FW_ERR(fw_err))
9295
93#define SNP_GUEST_VMM_ERR_INVALID_LEN 196#define SNP_GUEST_VMM_ERR_INVALID_LEN 1
94#define SNP_GUEST_VMM_ERR_BUSY 297#define SNP_GUEST_VMM_ERR_BUSY 2
lib/libc/include/any-linux-any/linux/smc.h+6
...@@ -127,6 +127,8 @@ enum {...@@ -127,6 +127,8 @@ enum {
127 SMC_NLA_LGR_R_NET_COOKIE, /* u64 */127 SMC_NLA_LGR_R_NET_COOKIE, /* u64 */
128 SMC_NLA_LGR_R_PAD, /* flag */128 SMC_NLA_LGR_R_PAD, /* flag */
129 SMC_NLA_LGR_R_BUF_TYPE, /* u8 */129 SMC_NLA_LGR_R_BUF_TYPE, /* u8 */
130 SMC_NLA_LGR_R_SNDBUF_ALLOC, /* uint */
131 SMC_NLA_LGR_R_RMB_ALLOC, /* uint */
130 __SMC_NLA_LGR_R_MAX,132 __SMC_NLA_LGR_R_MAX,
131 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1133 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1
132};134};
...@@ -162,6 +164,8 @@ enum {...@@ -162,6 +164,8 @@ enum {
162 SMC_NLA_LGR_D_V2_COMMON, /* nest */164 SMC_NLA_LGR_D_V2_COMMON, /* nest */
163 SMC_NLA_LGR_D_EXT_GID, /* u64 */165 SMC_NLA_LGR_D_EXT_GID, /* u64 */
164 SMC_NLA_LGR_D_PEER_EXT_GID, /* u64 */166 SMC_NLA_LGR_D_PEER_EXT_GID, /* u64 */
167 SMC_NLA_LGR_D_SNDBUF_ALLOC, /* uint */
168 SMC_NLA_LGR_D_DMB_ALLOC, /* uint */
165 __SMC_NLA_LGR_D_MAX,169 __SMC_NLA_LGR_D_MAX,
166 SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1170 SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
167};171};
...@@ -249,6 +253,8 @@ enum {...@@ -249,6 +253,8 @@ enum {
249 SMC_NLA_STATS_T_TX_BYTES, /* u64 */253 SMC_NLA_STATS_T_TX_BYTES, /* u64 */
250 SMC_NLA_STATS_T_RX_CNT, /* u64 */254 SMC_NLA_STATS_T_RX_CNT, /* u64 */
251 SMC_NLA_STATS_T_TX_CNT, /* u64 */255 SMC_NLA_STATS_T_TX_CNT, /* u64 */
256 SMC_NLA_STATS_T_RX_RMB_USAGE, /* uint */
257 SMC_NLA_STATS_T_TX_RMB_USAGE, /* uint */
252 __SMC_NLA_STATS_T_MAX,258 __SMC_NLA_STATS_T_MAX,
253 SMC_NLA_STATS_T_MAX = __SMC_NLA_STATS_T_MAX - 1259 SMC_NLA_STATS_T_MAX = __SMC_NLA_STATS_T_MAX - 1
254};260};
lib/libc/include/any-linux-any/linux/spi/spi.h+3-2
...@@ -28,7 +28,8 @@...@@ -28,7 +28,8 @@
28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
30#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */30#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */
31#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave mosi line low when idle */31#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave MOSI line low when idle */
32#define SPI_MOSI_IDLE_HIGH _BITUL(18) /* leave MOSI line high when idle */
3233
33/*34/*
34 * All the bits defined above should be covered by SPI_MODE_USER_MASK.35 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
...@@ -38,6 +39,6 @@...@@ -38,6 +39,6 @@
38 * These bits must not overlap. A static assert check should make sure of that.39 * These bits must not overlap. A static assert check should make sure of that.
39 * If adding extra bits, make sure to increase the bit index below as well.40 * If adding extra bits, make sure to increase the bit index below as well.
40 */41 */
41#define SPI_MODE_USER_MASK (_BITUL(18) - 1)42#define SPI_MODE_USER_MASK (_BITUL(19) - 1)
4243
43#endif /* _SPI_H */44#endif /* _SPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stat.h+9-1
...@@ -128,7 +128,13 @@ struct statx {...@@ -128,7 +128,13 @@ struct statx {
128 __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */128 __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
129 /* 0xa0 */129 /* 0xa0 */
130 __u64 stx_subvol; /* Subvolume identifier */130 __u64 stx_subvol; /* Subvolume identifier */
131 __u64 __spare3[11]; /* Spare space for future expansion */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 */
133 /* 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 */
132 /* 0x100 */138 /* 0x100 */
133};139};
134140
...@@ -157,6 +163,7 @@ struct statx {...@@ -157,6 +163,7 @@ struct statx {
157#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */163#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
158#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */164#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
159#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */165#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
166#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
160167
161#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */168#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
162169
...@@ -190,6 +197,7 @@ struct statx {...@@ -190,6 +197,7 @@ struct statx {
190#define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */197#define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */
191#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */198#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */
192#define STATX_ATTR_DAX 0x00200000 /* File is currently in DAX state */199#define STATX_ATTR_DAX 0x00200000 /* File is currently in DAX state */
200#define STATX_ATTR_WRITE_ATOMIC 0x00400000 /* File supports atomic write operations */
193201
194202
195#endif /* _LINUX_STAT_H */203#endif /* _LINUX_STAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stddef.h+10-3
...@@ -8,6 +8,13 @@...@@ -8,6 +8,13 @@
8#define __always_inline __inline__8#define __always_inline __inline__
9#endif9#endif
1010
11/* Not all C++ standards support type declarations inside an anonymous union */
12#ifndef __cplusplus
13#define __struct_group_tag(TAG) TAG
14#else
15#define __struct_group_tag(TAG)
16#endif
17
11/**18/**
12 * __struct_group() - Create a mirrored named and anonyomous struct19 * __struct_group() - Create a mirrored named and anonyomous struct
13 *20 *
...@@ -20,13 +27,13 @@...@@ -20,13 +27,13 @@
20 * and size: one anonymous and one named. The former's members can be used27 * and size: one anonymous and one named. The former's members can be used
21 * normally without sub-struct naming, and the latter can be used to28 * normally without sub-struct naming, and the latter can be used to
22 * reason about the start, end, and size of the group of struct members.29 * reason about the start, end, and size of the group of struct members.
23 * The named struct can also be explicitly tagged for layer reuse, as well30 * The named struct can also be explicitly tagged for layer reuse (C only),
24 * as both having struct attributes appended.31 * as well as both having struct attributes appended.
25 */32 */
26#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \33#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
27 union { \34 union { \
28 struct { MEMBERS } ATTRS; \35 struct { MEMBERS } ATTRS; \
29 struct TAG { MEMBERS } ATTRS NAME; \36 struct __struct_group_tag(TAG) { MEMBERS } ATTRS NAME; \
30 } ATTRS37 } ATTRS
3138
32#ifdef __cplusplus39#ifdef __cplusplus
lib/libc/include/any-linux-any/linux/tcp_metrics.h+16
...@@ -27,6 +27,22 @@ enum tcp_metric_index {...@@ -27,6 +27,22 @@ enum tcp_metric_index {
2727
28#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)28#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)
2929
30/* Re-define enum tcp_metric_index, again, using the values carried
31 * as netlink attribute types.
32 */
33enum {
34 TCP_METRICS_A_METRICS_RTT = 1,
35 TCP_METRICS_A_METRICS_RTTVAR,
36 TCP_METRICS_A_METRICS_SSTHRESH,
37 TCP_METRICS_A_METRICS_CWND,
38 TCP_METRICS_A_METRICS_REODERING,
39 TCP_METRICS_A_METRICS_RTT_US,
40 TCP_METRICS_A_METRICS_RTTVAR_US,
41
42 __TCP_METRICS_A_METRICS_MAX
43};
44#define TCP_METRICS_A_METRICS_MAX (__TCP_METRICS_A_METRICS_MAX - 1)
45
30enum {46enum {
31 TCP_METRICS_ATTR_UNSPEC,47 TCP_METRICS_ATTR_UNSPEC,
32 TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */48 TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */
lib/libc/include/any-linux-any/linux/thermal.h+22-7
...@@ -3,6 +3,8 @@...@@ -3,6 +3,8 @@
3#define _LINUX_THERMAL_H3#define _LINUX_THERMAL_H
44
5#define THERMAL_NAME_LENGTH 205#define THERMAL_NAME_LENGTH 20
6#define THERMAL_THRESHOLD_WAY_UP 0x1
7#define THERMAL_THRESHOLD_WAY_DOWN 0x2
68
7enum thermal_device_mode {9enum thermal_device_mode {
8 THERMAL_DEVICE_DISABLED = 0,10 THERMAL_DEVICE_DISABLED = 0,
...@@ -18,7 +20,7 @@ enum thermal_trip_type {...@@ -18,7 +20,7 @@ enum thermal_trip_type {
1820
19/* Adding event notification support elements */21/* Adding event notification support elements */
20#define THERMAL_GENL_FAMILY_NAME "thermal"22#define THERMAL_GENL_FAMILY_NAME "thermal"
21#define THERMAL_GENL_VERSION 0x0123#define THERMAL_GENL_VERSION 0x02
22#define THERMAL_GENL_SAMPLING_GROUP_NAME "sampling"24#define THERMAL_GENL_SAMPLING_GROUP_NAME "sampling"
23#define THERMAL_GENL_EVENT_GROUP_NAME "event"25#define THERMAL_GENL_EVENT_GROUP_NAME "event"
2426
...@@ -48,6 +50,10 @@ enum thermal_genl_attr {...@@ -48,6 +50,10 @@ enum thermal_genl_attr {
48 THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,50 THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,
49 THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,51 THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,
50 THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,52 THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,
53 THERMAL_GENL_ATTR_THRESHOLD,
54 THERMAL_GENL_ATTR_THRESHOLD_TEMP,
55 THERMAL_GENL_ATTR_THRESHOLD_DIRECTION,
56 THERMAL_GENL_ATTR_TZ_PREV_TEMP,
51 __THERMAL_GENL_ATTR_MAX,57 __THERMAL_GENL_ATTR_MAX,
52};58};
53#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)59#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
...@@ -75,6 +81,11 @@ enum thermal_genl_event {...@@ -75,6 +81,11 @@ enum thermal_genl_event {
75 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */81 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
76 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */82 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
77 THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */83 THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */
84 THERMAL_GENL_EVENT_THRESHOLD_ADD, /* A thresold has been added */
85 THERMAL_GENL_EVENT_THRESHOLD_DELETE, /* A thresold has been deleted */
86 THERMAL_GENL_EVENT_THRESHOLD_FLUSH, /* All thresolds have been deleted */
87 THERMAL_GENL_EVENT_THRESHOLD_UP, /* A thresold has been crossed the way up */
88 THERMAL_GENL_EVENT_THRESHOLD_DOWN, /* A thresold has been crossed the way down */
78 __THERMAL_GENL_EVENT_MAX,89 __THERMAL_GENL_EVENT_MAX,
79};90};
80#define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)91#define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)
...@@ -82,12 +93,16 @@ enum thermal_genl_event {...@@ -82,12 +93,16 @@ enum thermal_genl_event {
82/* Commands supported by the thermal_genl_family */93/* Commands supported by the thermal_genl_family */
83enum thermal_genl_cmd {94enum thermal_genl_cmd {
84 THERMAL_GENL_CMD_UNSPEC,95 THERMAL_GENL_CMD_UNSPEC,
85 THERMAL_GENL_CMD_TZ_GET_ID, /* List of thermal zones id */96 THERMAL_GENL_CMD_TZ_GET_ID, /* List of thermal zones id */
86 THERMAL_GENL_CMD_TZ_GET_TRIP, /* List of thermal trips */97 THERMAL_GENL_CMD_TZ_GET_TRIP, /* List of thermal trips */
87 THERMAL_GENL_CMD_TZ_GET_TEMP, /* Get the thermal zone temperature */98 THERMAL_GENL_CMD_TZ_GET_TEMP, /* Get the thermal zone temperature */
88 THERMAL_GENL_CMD_TZ_GET_GOV, /* Get the thermal zone governor */99 THERMAL_GENL_CMD_TZ_GET_GOV, /* Get the thermal zone governor */
89 THERMAL_GENL_CMD_TZ_GET_MODE, /* Get the thermal zone mode */100 THERMAL_GENL_CMD_TZ_GET_MODE, /* Get the thermal zone mode */
90 THERMAL_GENL_CMD_CDEV_GET, /* List of cdev id */101 THERMAL_GENL_CMD_CDEV_GET, /* List of cdev id */
102 THERMAL_GENL_CMD_THRESHOLD_GET, /* List of thresholds */
103 THERMAL_GENL_CMD_THRESHOLD_ADD, /* Add a threshold */
104 THERMAL_GENL_CMD_THRESHOLD_DELETE, /* Delete a threshold */
105 THERMAL_GENL_CMD_THRESHOLD_FLUSH, /* Flush all the thresholds */
91 __THERMAL_GENL_CMD_MAX,106 __THERMAL_GENL_CMD_MAX,
92};107};
93#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)108#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
lib/libc/include/any-linux-any/linux/types.h+1
...@@ -48,6 +48,7 @@ typedef __u32 __bitwise __wsum;...@@ -48,6 +48,7 @@ typedef __u32 __bitwise __wsum;
48 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.48 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
49 */49 */
50#define __aligned_u64 __u64 __attribute__((aligned(8)))50#define __aligned_u64 __u64 __attribute__((aligned(8)))
51#define __aligned_s64 __s64 __attribute__((aligned(8)))
51#define __aligned_be64 __be64 __attribute__((aligned(8)))52#define __aligned_be64 __be64 __attribute__((aligned(8)))
52#define __aligned_le64 __le64 __attribute__((aligned(8)))53#define __aligned_le64 __le64 __attribute__((aligned(8)))
5354
lib/libc/include/any-linux-any/linux/ublk_cmd.h+25-1
...@@ -147,8 +147,18 @@...@@ -147,8 +147,18 @@
147 */147 */
148#define UBLK_F_NEED_GET_DATA (1UL << 2)148#define UBLK_F_NEED_GET_DATA (1UL << 2)
149149
150/*
151 * - Block devices are recoverable if ublk server exits and restarts
152 * - Outstanding I/O when ublk server exits is met with errors
153 * - I/O issued while there is no ublk server queues
154 */
150#define UBLK_F_USER_RECOVERY (1UL << 3)155#define UBLK_F_USER_RECOVERY (1UL << 3)
151156
157/*
158 * - Block devices are recoverable if ublk server exits and restarts
159 * - Outstanding I/O when ublk server exits is reissued
160 * - I/O issued while there is no ublk server queues
161 */
152#define UBLK_F_USER_RECOVERY_REISSUE (1UL << 4)162#define UBLK_F_USER_RECOVERY_REISSUE (1UL << 4)
153163
154/*164/*
...@@ -175,7 +185,13 @@...@@ -175,7 +185,13 @@
175/* use ioctl encoding for uring command */185/* use ioctl encoding for uring command */
176#define UBLK_F_CMD_IOCTL_ENCODE (1UL << 6)186#define UBLK_F_CMD_IOCTL_ENCODE (1UL << 6)
177187
178/* Copy between request and user buffer by pread()/pwrite() */188/*
189 * Copy between request and user buffer by pread()/pwrite()
190 *
191 * Not available for UBLK_F_UNPRIVILEGED_DEV, otherwise userspace may
192 * deceive us by not filling request buffer, then kernel uninitialized
193 * data may be leaked.
194 */
179#define UBLK_F_USER_COPY (1UL << 7)195#define UBLK_F_USER_COPY (1UL << 7)
180196
181/*197/*
...@@ -184,10 +200,18 @@...@@ -184,10 +200,18 @@
184 */200 */
185#define UBLK_F_ZONED (1ULL << 8)201#define UBLK_F_ZONED (1ULL << 8)
186202
203/*
204 * - Block devices are recoverable if ublk server exits and restarts
205 * - Outstanding I/O when ublk server exits is met with errors
206 * - I/O issued while there is no ublk server is met with errors
207 */
208#define UBLK_F_USER_RECOVERY_FAIL_IO (1ULL << 9)
209
187/* device state */210/* device state */
188#define UBLK_S_DEV_DEAD 0211#define UBLK_S_DEV_DEAD 0
189#define UBLK_S_DEV_LIVE 1212#define UBLK_S_DEV_LIVE 1
190#define UBLK_S_DEV_QUIESCED 2213#define UBLK_S_DEV_QUIESCED 2
214#define UBLK_S_DEV_FAIL_IO 3
191215
192/* shipped via sqe->cmd of io_uring command */216/* shipped via sqe->cmd of io_uring command */
193struct ublksrv_ctrl_cmd {217struct ublksrv_ctrl_cmd {
lib/libc/include/any-linux-any/linux/udp.h+1-1
...@@ -31,7 +31,7 @@ struct udphdr {...@@ -31,7 +31,7 @@ struct udphdr {
31#define UDP_CORK 1 /* Never send partially complete segments */31#define UDP_CORK 1 /* Never send partially complete segments */
32#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */32#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
33#define UDP_NO_CHECK6_TX 101 /* Disable sending checksum for UDP6X */33#define UDP_NO_CHECK6_TX 101 /* Disable sending checksum for UDP6X */
34#define UDP_NO_CHECK6_RX 102 /* Disable accpeting checksum for UDP6 */34#define UDP_NO_CHECK6_RX 102 /* Disable accepting checksum for UDP6 */
35#define UDP_SEGMENT 103 /* Set GSO segmentation size */35#define UDP_SEGMENT 103 /* Set GSO segmentation size */
36#define UDP_GRO 104 /* This socket can receive UDP GRO packets */36#define UDP_GRO 104 /* This socket can receive UDP GRO packets */
3737
lib/libc/include/any-linux-any/linux/uio.h+18
...@@ -20,6 +20,24 @@ struct iovec...@@ -20,6 +20,24 @@ struct iovec
20 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */20 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
21};21};
2222
23struct dmabuf_cmsg {
24 __u64 frag_offset; /* offset into the dmabuf where the frag starts.
25 */
26 __u32 frag_size; /* size of the frag. */
27 __u32 frag_token; /* token representing this frag for
28 * DEVMEM_DONTNEED.
29 */
30 __u32 dmabuf_id; /* dmabuf id this frag belongs to. */
31 __u32 flags; /* Currently unused. Reserved for future
32 * uses.
33 */
34};
35
36struct dmabuf_token {
37 __u32 token_start;
38 __u32 token_count;
39};
40
23/*41/*
24 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)42 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
25 */43 */
lib/libc/include/any-linux-any/linux/um_timetravel.h+176-14
...@@ -1,17 +1,6 @@...@@ -1,17 +1,6 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
1/*2/*
2 * Permission to use, copy, modify, and/or distribute this software for any3 * Copyright (C) 2019 - 2023 Intel Corporation
3 * purpose with or without fee is hereby granted, provided that the above
4 * copyright notice and this permission notice appear in all copies.
5 *
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 *
14 * Copyright (C) 2019 Intel Corporation
15 */4 */
16#ifndef _LINUX_UM_TIMETRAVEL_H5#ifndef _LINUX_UM_TIMETRAVEL_H
17#define _LINUX_UM_TIMETRAVEL_H6#define _LINUX_UM_TIMETRAVEL_H
...@@ -50,6 +39,36 @@ struct um_timetravel_msg {...@@ -50,6 +39,36 @@ struct um_timetravel_msg {
50 __u64 time;39 __u64 time;
51};40};
5241
42/* max number of file descriptors that can be sent/received in a message */
43#define UM_TIMETRAVEL_MAX_FDS 2
44
45/**
46 * enum um_timetravel_shared_mem_fds - fds sent in ACK message for START message
47 */
48enum um_timetravel_shared_mem_fds {
49 /**
50 * @UM_TIMETRAVEL_SHARED_MEMFD: Index of the shared memory file
51 * descriptor in the control message
52 */
53 UM_TIMETRAVEL_SHARED_MEMFD,
54 /**
55 * @UM_TIMETRAVEL_SHARED_LOGFD: Index of the logging file descriptor
56 * in the control message
57 */
58 UM_TIMETRAVEL_SHARED_LOGFD,
59 UM_TIMETRAVEL_SHARED_MAX_FDS,
60};
61
62/**
63 * enum um_timetravel_start_ack - ack-time mask for start message
64 */
65enum um_timetravel_start_ack {
66 /**
67 * @UM_TIMETRAVEL_START_ACK_ID: client ID that controller allocated.
68 */
69 UM_TIMETRAVEL_START_ACK_ID = 0xffff,
70};
71
53/**72/**
54 * enum um_timetravel_ops - Operation codes73 * enum um_timetravel_ops - Operation codes
55 */74 */
...@@ -57,7 +76,9 @@ enum um_timetravel_ops {...@@ -57,7 +76,9 @@ enum um_timetravel_ops {
57 /**76 /**
58 * @UM_TIMETRAVEL_ACK: response (ACK) to any previous message,77 * @UM_TIMETRAVEL_ACK: response (ACK) to any previous message,
59 * this usually doesn't carry any data in the 'time' field78 * this usually doesn't carry any data in the 'time' field
60 * unless otherwise specified below79 * unless otherwise specified below, note: while using shared
80 * memory no ACK for WAIT and RUN messages, for more info see
81 * &struct um_timetravel_schedshm.
61 */82 */
62 UM_TIMETRAVEL_ACK = 0,83 UM_TIMETRAVEL_ACK = 0,
6384
...@@ -123,6 +144,147 @@ enum um_timetravel_ops {...@@ -123,6 +144,147 @@ enum um_timetravel_ops {
123 * the simulation.144 * the simulation.
124 */145 */
125 UM_TIMETRAVEL_GET_TOD = 8,146 UM_TIMETRAVEL_GET_TOD = 8,
147
148 /**
149 * @UM_TIMETRAVEL_BROADCAST: Send/Receive a broadcast message.
150 * This message can be used to sync all components in the system
151 * with a single message, if the calender gets the message, the
152 * calender broadcast the message to all components, and if a
153 * component receives it it should act based on it e.g print a
154 * message to it's log system.
155 * (calendar <-> host)
156 */
157 UM_TIMETRAVEL_BROADCAST = 9,
158};
159
160/* version of struct um_timetravel_schedshm */
161#define UM_TIMETRAVEL_SCHEDSHM_VERSION 2
162
163/**
164 * enum um_timetravel_schedshm_cap - time travel capabilities of every client
165 *
166 * These flags must be set immediately after processing the ACK to
167 * the START message, before sending any message to the controller.
168 */
169enum um_timetravel_schedshm_cap {
170 /**
171 * @UM_TIMETRAVEL_SCHEDSHM_CAP_TIME_SHARE: client can read current time
172 * update internal time request to shared memory and read
173 * free until and send no Ack on RUN and doesn't expect ACK on
174 * WAIT.
175 */
176 UM_TIMETRAVEL_SCHEDSHM_CAP_TIME_SHARE = 0x1,
177};
178
179/**
180 * enum um_timetravel_schedshm_flags - time travel flags of every client
181 */
182enum um_timetravel_schedshm_flags {
183 /**
184 * @UM_TIMETRAVEL_SCHEDSHM_FLAGS_REQ_RUN: client has a request to run.
185 * It's set by client when it has a request to run, if (and only
186 * if) the @running_id points to a client that is able to use
187 * shared memory, i.e. has %UM_TIMETRAVEL_SCHEDSHM_CAP_TIME_SHARE
188 * (this includes the client itself). Otherwise, a message must
189 * be used.
190 */
191 UM_TIMETRAVEL_SCHEDSHM_FLAGS_REQ_RUN = 0x1,
192};
193
194/**
195 * DOC: Time travel shared memory overview
196 *
197 * The main purpose of the shared memory is to avoid all time travel message
198 * that don't need any action, for example current time can be held in shared
199 * memory without the need of any client to send a message UM_TIMETRAVEL_GET
200 * in order to know what's the time.
201 *
202 * Since this is shared memory with all clients and controller and controller
203 * creates the shared memory space, all time values are absolute to controller
204 * time. So first time client connects to shared memory mode it should take the
205 * current_time value in shared memory and keep it internally as a diff to
206 * shared memory times, and once shared memory is initialized, any interaction
207 * with the controller must happen in the controller time domain, including any
208 * messages (for clients that are not using shared memory, the controller will
209 * handle an offset and make the clients think they start at time zero.)
210 *
211 * Along with the shared memory file descriptor is sent to the client a logging
212 * file descriptor, to have all logs related to shared memory,
213 * logged into one place. note: to have all logs synced into log file at write,
214 * file should be flushed (fflush) after writing to it.
215 *
216 * To avoid memory corruption, we define below for each field who can write to
217 * it at what time, defined in the structure fields.
218 *
219 * To avoid having to pack this struct, all fields in it must be naturally aligned
220 * (i.e. aligned to their size).
221 */
222
223/**
224 * union um_timetravel_schedshm_client - UM time travel client struct
225 *
226 * Every entity using the shared memory including the controller has a place in
227 * the um_timetravel_schedshm clients array, that holds info related to the client
228 * using the shared memory, and can be set only by the client after it gets the
229 * fd memory.
230 *
231 * @capa: bit fields with client capabilities see
232 * &enum um_timetravel_schedshm_cap, set by client once after getting the
233 * shared memory file descriptor.
234 * @flags: bit fields for flags see &enum um_timetravel_schedshm_flags for doc.
235 * @req_time: request time to run, set by client on every request it needs.
236 * @name: unique id sent to the controller by client with START message.
237 */
238union um_timetravel_schedshm_client {
239 struct {
240 __u32 capa;
241 __u32 flags;
242 __u64 req_time;
243 __u64 name;
244 };
245 char reserve[128]; /* reserved for future usage */
126};246};
127247
248/**
249 * struct um_timetravel_schedshm - UM time travel shared memory struct
250 *
251 * @hdr: header fields:
252 * @version: Current version struct UM_TIMETRAVEL_SCHEDSHM_VERSION,
253 * set by controller once at init, clients must check this after mapping
254 * and work without shared memory if they cannot handle the indicated
255 * version.
256 * @len: Length of all the memory including header (@hdr), clients should once
257 * per connection first mmap the header and take the length (@len) to remap the entire size.
258 * This is done in order to support dynamic struct size letting number of
259 * clients be dynamic based on controller support.
260 * @free_until: Stores the next request to run by any client, in order for the
261 * current client to know how long it can still run. A client needs to (at
262 * least) reload this value immediately after communicating with any other
263 * client, since the controller will update this field when a new request
264 * is made by any client. Clients also must update this value when they
265 * insert/update an own request into the shared memory while not running
266 * themselves, and the new request is before than the current value.
267 * current_time: Current time, can only be set by the client in running state
268 * (indicated by @running_id), though that client may only run until @free_until,
269 * so it must remain smaller than @free_until.
270 * @running_id: The current client in state running, set before a client is
271 * notified that it's now running.
272 * @max_clients: size of @clients array, set once at init by the controller.
273 * @clients: clients array see &union um_timetravel_schedshm_client for doc,
274 * set only by client.
275 */
276struct um_timetravel_schedshm {
277 union {
278 struct {
279 __u32 version;
280 __u32 len;
281 __u64 free_until;
282 __u64 current_time;
283 __u16 running_id;
284 __u16 max_clients;
285 };
286 char hdr[4096]; /* align to 4K page size */
287 };
288 union um_timetravel_schedshm_client clients[];
289};
128#endif /* _LINUX_UM_TIMETRAVEL_H */290#endif /* _LINUX_UM_TIMETRAVEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/ch9.h+6-2
...@@ -254,6 +254,9 @@ struct usb_ctrlrequest {...@@ -254,6 +254,9 @@ struct usb_ctrlrequest {
254#define USB_DT_DEVICE_CAPABILITY 0x10254#define USB_DT_DEVICE_CAPABILITY 0x10
255#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11255#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
256#define USB_DT_WIRE_ADAPTER 0x21256#define USB_DT_WIRE_ADAPTER 0x21
257/* From USB Device Firmware Upgrade Specification, Revision 1.1 */
258#define USB_DT_DFU_FUNCTIONAL 0x21
259/* these are from the Wireless USB spec */
257#define USB_DT_RPIPE 0x22260#define USB_DT_RPIPE 0x22
258#define USB_DT_CS_RADIO_CONTROL 0x23261#define USB_DT_CS_RADIO_CONTROL 0x23
259/* From the T10 UAS specification */262/* From the T10 UAS specification */
...@@ -329,9 +332,10 @@ struct usb_device_descriptor {...@@ -329,9 +332,10 @@ struct usb_device_descriptor {
329#define USB_CLASS_USB_TYPE_C_BRIDGE 0x12332#define USB_CLASS_USB_TYPE_C_BRIDGE 0x12
330#define USB_CLASS_MISC 0xef333#define USB_CLASS_MISC 0xef
331#define USB_CLASS_APP_SPEC 0xfe334#define USB_CLASS_APP_SPEC 0xfe
332#define USB_CLASS_VENDOR_SPEC 0xff335#define USB_SUBCLASS_DFU 0x01
333336
334#define USB_SUBCLASS_VENDOR_SPEC 0xff337#define USB_CLASS_VENDOR_SPEC 0xff
338#define USB_SUBCLASS_VENDOR_SPEC 0xff
335339
336/*-------------------------------------------------------------------------*/340/*-------------------------------------------------------------------------*/
337341
lib/libc/include/any-linux-any/linux/usb/functionfs.h+89-8
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3#define __LINUX_FUNCTIONFS_H__3#define __LINUX_FUNCTIONFS_H__
44
55
6#include <linux/const.h>
6#include <linux/types.h>7#include <linux/types.h>
7#include <linux/ioctl.h>8#include <linux/ioctl.h>
89
...@@ -37,6 +38,31 @@ struct usb_endpoint_descriptor_no_audio {...@@ -37,6 +38,31 @@ struct usb_endpoint_descriptor_no_audio {
37 __u8 bInterval;38 __u8 bInterval;
38} __attribute__((packed));39} __attribute__((packed));
3940
41/**
42 * struct usb_dfu_functional_descriptor - DFU Functional descriptor
43 * @bLength: Size of the descriptor (bytes)
44 * @bDescriptorType: USB_DT_DFU_FUNCTIONAL
45 * @bmAttributes: DFU attributes
46 * @wDetachTimeOut: Maximum time to wait after DFU_DETACH (ms, le16)
47 * @wTransferSize: Maximum number of bytes per control-write (le16)
48 * @bcdDFUVersion: DFU Spec version (BCD, le16)
49 */
50struct usb_dfu_functional_descriptor {
51 __u8 bLength;
52 __u8 bDescriptorType;
53 __u8 bmAttributes;
54 __le16 wDetachTimeOut;
55 __le16 wTransferSize;
56 __le16 bcdDFUVersion;
57} __attribute__ ((packed));
58
59/* from DFU functional descriptor bmAttributes */
60#define DFU_FUNC_ATT_CAN_DOWNLOAD _BITUL(0)
61#define DFU_FUNC_ATT_CAN_UPLOAD _BITUL(1)
62#define DFU_FUNC_ATT_MANIFEST_TOLERANT _BITUL(2)
63#define DFU_FUNC_ATT_WILL_DETACH _BITUL(3)
64
65
40struct usb_functionfs_descs_head_v2 {66struct usb_functionfs_descs_head_v2 {
41 __le32 magic;67 __le32 magic;
42 __le32 length;68 __le32 length;
...@@ -103,23 +129,38 @@ struct usb_ffs_dmabuf_transfer_req {...@@ -103,23 +129,38 @@ struct usb_ffs_dmabuf_transfer_req {
103} __attribute__((packed));129} __attribute__((packed));
104130
105131
106/*132/**
133 * DOC: descriptors
134 *
107 * Descriptors format:135 * Descriptors format:
108 *136 *
137 * +-----+-----------+--------------+--------------------------------------+
109 * | off | name | type | description |138 * | off | name | type | description |
110 * |-----+-----------+--------------+--------------------------------------|139 * +-----+-----------+--------------+--------------------------------------+
111 * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 |140 * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 |
141 * +-----+-----------+--------------+--------------------------------------+
112 * | 4 | length | LE32 | length of the whole data chunk |142 * | 4 | length | LE32 | length of the whole data chunk |
143 * +-----+-----------+--------------+--------------------------------------+
113 * | 8 | flags | LE32 | combination of functionfs_flags |144 * | 8 | flags | LE32 | combination of functionfs_flags |
145 * +-----+-----------+--------------+--------------------------------------+
114 * | | eventfd | LE32 | eventfd file descriptor |146 * | | eventfd | LE32 | eventfd file descriptor |
147 * +-----+-----------+--------------+--------------------------------------+
115 * | | fs_count | LE32 | number of full-speed descriptors |148 * | | fs_count | LE32 | number of full-speed descriptors |
149 * +-----+-----------+--------------+--------------------------------------+
116 * | | hs_count | LE32 | number of high-speed descriptors |150 * | | hs_count | LE32 | number of high-speed descriptors |
151 * +-----+-----------+--------------+--------------------------------------+
117 * | | ss_count | LE32 | number of super-speed descriptors |152 * | | ss_count | LE32 | number of super-speed descriptors |
153 * +-----+-----------+--------------+--------------------------------------+
118 * | | os_count | LE32 | number of MS OS descriptors |154 * | | os_count | LE32 | number of MS OS descriptors |
155 * +-----+-----------+--------------+--------------------------------------+
119 * | | fs_descrs | Descriptor[] | list of full-speed descriptors |156 * | | fs_descrs | Descriptor[] | list of full-speed descriptors |
157 * +-----+-----------+--------------+--------------------------------------+
120 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |158 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |
159 * +-----+-----------+--------------+--------------------------------------+
121 * | | ss_descrs | Descriptor[] | list of super-speed descriptors |160 * | | ss_descrs | Descriptor[] | list of super-speed descriptors |
161 * +-----+-----------+--------------+--------------------------------------+
122 * | | os_descrs | OSDesc[] | list of MS OS descriptors |162 * | | os_descrs | OSDesc[] | list of MS OS descriptors |
163 * +-----+-----------+--------------+--------------------------------------+
123 *164 *
124 * Depending on which flags are set, various fields may be missing in the165 * Depending on which flags are set, various fields may be missing in the
125 * structure. Any flags that are not recognised cause the whole block to be166 * structure. Any flags that are not recognised cause the whole block to be
...@@ -127,71 +168,111 @@ struct usb_ffs_dmabuf_transfer_req {...@@ -127,71 +168,111 @@ struct usb_ffs_dmabuf_transfer_req {
127 *168 *
128 * Legacy descriptors format (deprecated as of 3.14):169 * Legacy descriptors format (deprecated as of 3.14):
129 *170 *
171 * +-----+-----------+--------------+--------------------------------------+
130 * | off | name | type | description |172 * | off | name | type | description |
131 * |-----+-----------+--------------+--------------------------------------|173 * +-----+-----------+--------------+--------------------------------------+
132 * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC |174 * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC |
175 * +-----+-----------+--------------+--------------------------------------+
133 * | 4 | length | LE32 | length of the whole data chunk |176 * | 4 | length | LE32 | length of the whole data chunk |
177 * +-----+-----------+--------------+--------------------------------------+
134 * | 8 | fs_count | LE32 | number of full-speed descriptors |178 * | 8 | fs_count | LE32 | number of full-speed descriptors |
179 * +-----+-----------+--------------+--------------------------------------+
135 * | 12 | hs_count | LE32 | number of high-speed descriptors |180 * | 12 | hs_count | LE32 | number of high-speed descriptors |
181 * +-----+-----------+--------------+--------------------------------------+
136 * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |182 * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |
183 * +-----+-----------+--------------+--------------------------------------+
137 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |184 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |
185 * +-----+-----------+--------------+--------------------------------------+
138 *186 *
139 * All numbers must be in little endian order.187 * All numbers must be in little endian order.
140 *188 *
141 * Descriptor[] is an array of valid USB descriptors which have the following189 * Descriptor[] is an array of valid USB descriptors which have the following
142 * format:190 * format:
143 *191 *
192 * +-----+-----------------+------+--------------------------+
144 * | off | name | type | description |193 * | off | name | type | description |
145 * |-----+-----------------+------+--------------------------|194 * +-----+-----------------+------+--------------------------+
146 * | 0 | bLength | U8 | length of the descriptor |195 * | 0 | bLength | U8 | length of the descriptor |
196 * +-----+-----------------+------+--------------------------+
147 * | 1 | bDescriptorType | U8 | descriptor type |197 * | 1 | bDescriptorType | U8 | descriptor type |
198 * +-----+-----------------+------+--------------------------+
148 * | 2 | payload | | descriptor's payload |199 * | 2 | payload | | descriptor's payload |
200 * +-----+-----------------+------+--------------------------+
149 *201 *
150 * OSDesc[] is an array of valid MS OS Feature Descriptors which have one of202 * OSDesc[] is an array of valid MS OS Feature Descriptors which have one of
151 * the following formats:203 * the following formats:
152 *204 *
205 * +-----+-----------------+------+--------------------------+
153 * | off | name | type | description |206 * | off | name | type | description |
154 * |-----+-----------------+------+--------------------------|207 * +-----+-----------------+------+--------------------------+
155 * | 0 | inteface | U8 | related interface number |208 * | 0 | inteface | U8 | related interface number |
209 * +-----+-----------------+------+--------------------------+
156 * | 1 | dwLength | U32 | length of the descriptor |210 * | 1 | dwLength | U32 | length of the descriptor |
211 * +-----+-----------------+------+--------------------------+
157 * | 5 | bcdVersion | U16 | currently supported: 1 |212 * | 5 | bcdVersion | U16 | currently supported: 1 |
213 * +-----+-----------------+------+--------------------------+
158 * | 7 | wIndex | U16 | currently supported: 4 |214 * | 7 | wIndex | U16 | currently supported: 4 |
215 * +-----+-----------------+------+--------------------------+
159 * | 9 | bCount | U8 | number of ext. compat. |216 * | 9 | bCount | U8 | number of ext. compat. |
217 * +-----+-----------------+------+--------------------------+
160 * | 10 | Reserved | U8 | 0 |218 * | 10 | Reserved | U8 | 0 |
219 * +-----+-----------------+------+--------------------------+
161 * | 11 | ExtCompat[] | | list of ext. compat. d. |220 * | 11 | ExtCompat[] | | list of ext. compat. d. |
221 * +-----+-----------------+------+--------------------------+
162 *222 *
223 * +-----+-----------------+------+--------------------------+
163 * | off | name | type | description |224 * | off | name | type | description |
164 * |-----+-----------------+------+--------------------------|225 * +-----+-----------------+------+--------------------------+
165 * | 0 | inteface | U8 | related interface number |226 * | 0 | inteface | U8 | related interface number |
227 * +-----+-----------------+------+--------------------------+
166 * | 1 | dwLength | U32 | length of the descriptor |228 * | 1 | dwLength | U32 | length of the descriptor |
229 * +-----+-----------------+------+--------------------------+
167 * | 5 | bcdVersion | U16 | currently supported: 1 |230 * | 5 | bcdVersion | U16 | currently supported: 1 |
231 * +-----+-----------------+------+--------------------------+
168 * | 7 | wIndex | U16 | currently supported: 5 |232 * | 7 | wIndex | U16 | currently supported: 5 |
233 * +-----+-----------------+------+--------------------------+
169 * | 9 | wCount | U16 | number of ext. compat. |234 * | 9 | wCount | U16 | number of ext. compat. |
235 * +-----+-----------------+------+--------------------------+
170 * | 11 | ExtProp[] | | list of ext. prop. d. |236 * | 11 | ExtProp[] | | list of ext. prop. d. |
237 * +-----+-----------------+------+--------------------------+
171 *238 *
172 * ExtCompat[] is an array of valid Extended Compatiblity descriptors239 * ExtCompat[] is an array of valid Extended Compatiblity descriptors
173 * which have the following format:240 * which have the following format:
174 *241 *
242 * +-----+-----------------------+------+-------------------------------------+
175 * | off | name | type | description |243 * | off | name | type | description |
176 * |-----+-----------------------+------+-------------------------------------|244 * +-----+-----------------------+------+-------------------------------------+
177 * | 0 | bFirstInterfaceNumber | U8 | index of the interface or of the 1st|245 * | 0 | bFirstInterfaceNumber | U8 | index of the interface or of the 1st|
246 * +-----+-----------------------+------+-------------------------------------+
178 * | | | | interface in an IAD group |247 * | | | | interface in an IAD group |
248 * +-----+-----------------------+------+-------------------------------------+
179 * | 1 | Reserved | U8 | 1 |249 * | 1 | Reserved | U8 | 1 |
250 * +-----+-----------------------+------+-------------------------------------+
180 * | 2 | CompatibleID | U8[8]| compatible ID string |251 * | 2 | CompatibleID | U8[8]| compatible ID string |
252 * +-----+-----------------------+------+-------------------------------------+
181 * | 10 | SubCompatibleID | U8[8]| subcompatible ID string |253 * | 10 | SubCompatibleID | U8[8]| subcompatible ID string |
254 * +-----+-----------------------+------+-------------------------------------+
182 * | 18 | Reserved | U8[6]| 0 |255 * | 18 | Reserved | U8[6]| 0 |
256 * +-----+-----------------------+------+-------------------------------------+
183 *257 *
184 * ExtProp[] is an array of valid Extended Properties descriptors258 * ExtProp[] is an array of valid Extended Properties descriptors
185 * which have the following format:259 * which have the following format:
186 *260 *
261 * +-----+-----------------------+------+-------------------------------------+
187 * | off | name | type | description |262 * | off | name | type | description |
188 * |-----+-----------------------+------+-------------------------------------|263 * +-----+-----------------------+------+-------------------------------------+
189 * | 0 | dwSize | U32 | length of the descriptor |264 * | 0 | dwSize | U32 | length of the descriptor |
265 * +-----+-----------------------+------+-------------------------------------+
190 * | 4 | dwPropertyDataType | U32 | 1..7 |266 * | 4 | dwPropertyDataType | U32 | 1..7 |
267 * +-----+-----------------------+------+-------------------------------------+
191 * | 8 | wPropertyNameLength | U16 | bPropertyName length (NL) |268 * | 8 | wPropertyNameLength | U16 | bPropertyName length (NL) |
269 * +-----+-----------------------+------+-------------------------------------+
192 * | 10 | bPropertyName |U8[NL]| name of this property |270 * | 10 | bPropertyName |U8[NL]| name of this property |
271 * +-----+-----------------------+------+-------------------------------------+
193 * |10+NL| dwPropertyDataLength | U32 | bPropertyData length (DL) |272 * |10+NL| dwPropertyDataLength | U32 | bPropertyData length (DL) |
273 * +-----+-----------------------+------+-------------------------------------+
194 * |14+NL| bProperty |U8[DL]| payload of this property |274 * |14+NL| bProperty |U8[DL]| payload of this property |
275 * +-----+-----------------------+------+-------------------------------------+
195 */276 */
196277
197struct usb_functionfs_strings_head {278struct usb_functionfs_strings_head {
lib/libc/include/any-linux-any/linux/usb/g_hid.h created+40
...@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2
3#ifndef __UAPI_LINUX_USB_G_HID_H
4#define __UAPI_LINUX_USB_G_HID_H
5
6#include <linux/types.h>
7
8/* Maximum HID report length for High-Speed USB (i.e. USB 2.0) */
9#define MAX_REPORT_LENGTH 64
10
11/**
12 * struct usb_hidg_report - response to GET_REPORT
13 * @report_id: report ID that this is a response for
14 * @userspace_req:
15 * !0 this report is used for any pending GET_REPORT request
16 * but wait on userspace to issue a new report on future requests
17 * 0 this report is to be used for any future GET_REPORT requests
18 * @length: length of the report response
19 * @data: report response
20 * @padding: padding for 32/64 bit compatibility
21 *
22 * Structure used by GADGET_HID_WRITE_GET_REPORT ioctl on /dev/hidg*.
23 */
24struct usb_hidg_report {
25 __u8 report_id;
26 __u8 userspace_req;
27 __u16 length;
28 __u8 data[MAX_REPORT_LENGTH];
29 __u8 padding[4];
30};
31
32/* The 'g' code is used by gadgetfs and hid gadget ioctl requests.
33 * Don't add any colliding codes to either driver, and keep
34 * them in unique ranges.
35 */
36
37#define GADGET_HID_READ_GET_REPORT_ID _IOR('g', 0x41, __u8)
38#define GADGET_HID_WRITE_GET_REPORT _IOW('g', 0x42, struct usb_hidg_report)
39
40#endif /* __UAPI_LINUX_USB_G_HID_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/gadgetfs.h+1-1
...@@ -62,7 +62,7 @@ struct usb_gadgetfs_event {...@@ -62,7 +62,7 @@ struct usb_gadgetfs_event {
62};62};
6363
6464
65/* The 'g' code is also used by printer gadget ioctl requests.65/* The 'g' code is also used by printer and hid gadget ioctl requests.
66 * Don't add any colliding codes to either driver, and keep66 * Don't add any colliding codes to either driver, and keep
67 * them in unique ranges (size 0x20 for now).67 * them in unique ranges (size 0x20 for now).
68 */68 */
lib/libc/include/any-linux-any/linux/usb/video.h+58
...@@ -597,4 +597,62 @@ struct UVC_FRAME_MJPEG(n) { \...@@ -597,4 +597,62 @@ struct UVC_FRAME_MJPEG(n) { \
597 __le32 dwFrameInterval[n]; \597 __le32 dwFrameInterval[n]; \
598} __attribute__ ((packed))598} __attribute__ ((packed))
599599
600/* Frame Based Payload - 3.1.1. Frame Based Video Format Descriptor */
601struct uvc_format_framebased {
602 __u8 bLength;
603 __u8 bDescriptorType;
604 __u8 bDescriptorSubType;
605 __u8 bFormatIndex;
606 __u8 bNumFrameDescriptors;
607 __u8 guidFormat[16];
608 __u8 bBitsPerPixel;
609 __u8 bDefaultFrameIndex;
610 __u8 bAspectRatioX;
611 __u8 bAspectRatioY;
612 __u8 bmInterfaceFlags;
613 __u8 bCopyProtect;
614 __u8 bVariableSize;
615} __attribute__((__packed__));
616
617#define UVC_DT_FORMAT_FRAMEBASED_SIZE 28
618
619/* Frame Based Payload - 3.1.2. Frame Based Video Frame Descriptor */
620struct uvc_frame_framebased {
621 __u8 bLength;
622 __u8 bDescriptorType;
623 __u8 bDescriptorSubType;
624 __u8 bFrameIndex;
625 __u8 bmCapabilities;
626 __u16 wWidth;
627 __u16 wHeight;
628 __u32 dwMinBitRate;
629 __u32 dwMaxBitRate;
630 __u32 dwDefaultFrameInterval;
631 __u8 bFrameIntervalType;
632 __u32 dwBytesPerLine;
633 __u32 dwFrameInterval[];
634} __attribute__((__packed__));
635
636#define UVC_DT_FRAME_FRAMEBASED_SIZE(n) (26+4*(n))
637
638#define UVC_FRAME_FRAMEBASED(n) \
639 uvc_frame_framebased_##n
640
641#define DECLARE_UVC_FRAME_FRAMEBASED(n) \
642struct UVC_FRAME_FRAMEBASED(n) { \
643 __u8 bLength; \
644 __u8 bDescriptorType; \
645 __u8 bDescriptorSubType; \
646 __u8 bFrameIndex; \
647 __u8 bmCapabilities; \
648 __u16 wWidth; \
649 __u16 wHeight; \
650 __u32 dwMinBitRate; \
651 __u32 dwMaxBitRate; \
652 __u32 dwDefaultFrameInterval; \
653 __u8 bFrameIntervalType; \
654 __u32 dwBytesPerLine; \
655 __u32 dwFrameInterval[n]; \
656} __attribute__ ((packed))
657
600#endif /* __LINUX_USB_VIDEO_H */658#endif /* __LINUX_USB_VIDEO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/v4l2-controls.h+2
...@@ -894,6 +894,8 @@ enum v4l2_mpeg_video_av1_level {...@@ -894,6 +894,8 @@ enum v4l2_mpeg_video_av1_level {
894 V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23894 V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23
895};895};
896896
897#define V4L2_CID_MPEG_VIDEO_AVERAGE_QP (V4L2_CID_CODEC_BASE + 657)
898
897/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */899/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
898#define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)900#define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)
899#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)901#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)
lib/libc/include/any-linux-any/linux/v4l2-dv-timings.h+1-1
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2/*2/*
3 * V4L2 DV timings header.3 * V4L2 DV timings header.
4 *4 *
5 * Copyright (C) 2012-2016 Hans Verkuil <hans.verkuil@cisco.com>5 * Copyright (C) 2012-2016 Hans Verkuil <hansverk@cisco.com>
6 */6 */
77
8#ifndef _V4L2_DV_TIMINGS_H8#ifndef _V4L2_DV_TIMINGS_H
lib/libc/include/any-linux-any/linux/vbox_vmmdev_types.h+4-1
...@@ -282,7 +282,10 @@ struct vmmdev_hgcm_pagelist {...@@ -282,7 +282,10 @@ struct vmmdev_hgcm_pagelist {
282 __u32 flags; /** VMMDEV_HGCM_F_PARM_*. */282 __u32 flags; /** VMMDEV_HGCM_F_PARM_*. */
283 __u16 offset_first_page; /** Data offset in the first page. */283 __u16 offset_first_page; /** Data offset in the first page. */
284 __u16 page_count; /** Number of pages. */284 __u16 page_count; /** Number of pages. */
285 __u64 pages[1]; /** Page addresses. */285 union {
286 __u64 unused; /** Deprecated place-holder for first "pages" entry. */
287 __DECLARE_FLEX_ARRAY(__u64, pages); /** Page addresses. */
288 };
286};289};
287VMMDEV_ASSERT_SIZE(vmmdev_hgcm_pagelist, 4 + 2 + 2 + 8);290VMMDEV_ASSERT_SIZE(vmmdev_hgcm_pagelist, 4 + 2 + 2 + 8);
288291
lib/libc/include/any-linux-any/linux/vdpa.h+1
...@@ -19,6 +19,7 @@ enum vdpa_command {...@@ -19,6 +19,7 @@ enum vdpa_command {
19 VDPA_CMD_DEV_GET, /* can dump */19 VDPA_CMD_DEV_GET, /* can dump */
20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */
21 VDPA_CMD_DEV_VSTATS_GET,21 VDPA_CMD_DEV_VSTATS_GET,
22 VDPA_CMD_DEV_ATTR_SET,
22};23};
2324
24enum vdpa_attr {25enum vdpa_attr {
lib/libc/include/any-linux-any/linux/version.h+3-3
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 3957761#define LINUX_VERSION_CODE 396548
2#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))2#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
3#define LINUX_VERSION_MAJOR 63#define LINUX_VERSION_MAJOR 6
4#define LINUX_VERSION_PATCHLEVEL 10
5#define LINUX_VERSION_SUBLEVEL 0
\ No newline at end of file
4#define LINUX_VERSION_PATCHLEVEL 13
5#define LINUX_VERSION_SUBLEVEL 4
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+1-1
...@@ -35,7 +35,7 @@...@@ -35,7 +35,7 @@
35#define VFIO_EEH 535#define VFIO_EEH 5
3636
37/* Two-stage IOMMU */37/* Two-stage IOMMU */
38#define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */38#define __VFIO_RESERVED_TYPE1_NESTING_IOMMU 6 /* Implies v2 */
3939
40#define VFIO_SPAPR_TCE_v2_IOMMU 740#define VFIO_SPAPR_TCE_v2_IOMMU 7
4141
lib/libc/include/any-linux-any/linux/videodev2.h+25
...@@ -475,6 +475,7 @@ struct v4l2_capability {...@@ -475,6 +475,7 @@ struct v4l2_capability {
475#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */475#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */
476476
477#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */477#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
478#define V4L2_CAP_EDID 0x02000000 /* Is an EDID-only device */
478#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */479#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
479#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */480#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */
480481
...@@ -555,6 +556,8 @@ struct v4l2_pix_format {...@@ -555,6 +556,8 @@ struct v4l2_pix_format {
555556
556/* RGB formats (6 or 8 bytes per pixel) */557/* RGB formats (6 or 8 bytes per pixel) */
557#define V4L2_PIX_FMT_BGR48_12 v4l2_fourcc('B', '3', '1', '2') /* 48 BGR 12-bit per component */558#define V4L2_PIX_FMT_BGR48_12 v4l2_fourcc('B', '3', '1', '2') /* 48 BGR 12-bit per component */
559#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 48 BGR 16-bit per component */
560#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 48 RGB 16-bit per component */
558#define V4L2_PIX_FMT_ABGR64_12 v4l2_fourcc('B', '4', '1', '2') /* 64 BGRA 12-bit per component */561#define V4L2_PIX_FMT_ABGR64_12 v4l2_fourcc('B', '4', '1', '2') /* 64 BGRA 12-bit per component */
559562
560/* Grey formats */563/* Grey formats */
...@@ -768,6 +771,7 @@ struct v4l2_pix_format {...@@ -768,6 +771,7 @@ struct v4l2_pix_format {
768#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */771#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
769#define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */772#define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
770#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */773#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
774#define V4L2_PIX_FMT_Y16I v4l2_fourcc('Y', '1', '6', 'I') /* Greyscale 16-bit L/R interleaved */
771#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */775#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
772#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */776#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
773#define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */777#define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */
...@@ -787,6 +791,18 @@ struct v4l2_pix_format {...@@ -787,6 +791,18 @@ struct v4l2_pix_format {
787#define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */791#define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
788#define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */792#define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */
789793
794/* Raspberry Pi PiSP compressed formats. */
795#define V4L2_PIX_FMT_PISP_COMP1_RGGB v4l2_fourcc('P', 'C', '1', 'R') /* PiSP 8-bit mode 1 compressed RGGB bayer */
796#define V4L2_PIX_FMT_PISP_COMP1_GRBG v4l2_fourcc('P', 'C', '1', 'G') /* PiSP 8-bit mode 1 compressed GRBG bayer */
797#define V4L2_PIX_FMT_PISP_COMP1_GBRG v4l2_fourcc('P', 'C', '1', 'g') /* PiSP 8-bit mode 1 compressed GBRG bayer */
798#define V4L2_PIX_FMT_PISP_COMP1_BGGR v4l2_fourcc('P', 'C', '1', 'B') /* PiSP 8-bit mode 1 compressed BGGR bayer */
799#define V4L2_PIX_FMT_PISP_COMP1_MONO v4l2_fourcc('P', 'C', '1', 'M') /* PiSP 8-bit mode 1 compressed monochrome */
800#define V4L2_PIX_FMT_PISP_COMP2_RGGB v4l2_fourcc('P', 'C', '2', 'R') /* PiSP 8-bit mode 2 compressed RGGB bayer */
801#define V4L2_PIX_FMT_PISP_COMP2_GRBG v4l2_fourcc('P', 'C', '2', 'G') /* PiSP 8-bit mode 2 compressed GRBG bayer */
802#define V4L2_PIX_FMT_PISP_COMP2_GBRG v4l2_fourcc('P', 'C', '2', 'g') /* PiSP 8-bit mode 2 compressed GBRG bayer */
803#define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */
804#define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */
805
790/* SDR formats - used only for Software Defined Radio devices */806/* SDR formats - used only for Software Defined Radio devices */
791#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */807#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
792#define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */808#define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
...@@ -813,6 +829,12 @@ struct v4l2_pix_format {...@@ -813,6 +829,12 @@ struct v4l2_pix_format {
813/* Vendor specific - used for RK_ISP1 camera sub-system */829/* Vendor specific - used for RK_ISP1 camera sub-system */
814#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */830#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */
815#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */831#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */
832#define V4L2_META_FMT_RK_ISP1_EXT_PARAMS v4l2_fourcc('R', 'K', '1', 'E') /* Rockchip ISP1 3a Extensible Parameters */
833
834/* Vendor specific - used for RaspberryPi PiSP */
835#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C') /* PiSP BE configuration */
836#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C') /* PiSP FE configuration */
837#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S') /* PiSP FE stats */
816838
817839
818/* priv field value to indicates that subsequent fields are valid. */840/* priv field value to indicates that subsequent fields are valid. */
...@@ -847,6 +869,9 @@ struct v4l2_fmtdesc {...@@ -847,6 +869,9 @@ struct v4l2_fmtdesc {
847#define V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100869#define V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100
848#define V4L2_FMT_FLAG_META_LINE_BASED 0x0200870#define V4L2_FMT_FLAG_META_LINE_BASED 0x0200
849871
872/* Format description flag, to be ORed with the index */
873#define V4L2_FMTDESC_FLAG_ENUM_ALL 0x80000000
874
850 /* Frame Size and frame rate enumeration */875 /* Frame Size and frame rate enumeration */
851/*876/*
852 * F R A M E S I Z E E N U M E R A T I O N877 * F R A M E S I Z E E N U M E R A T I O N
lib/libc/include/any-linux-any/linux/virtio_balloon.h+14-2
...@@ -71,7 +71,13 @@ struct virtio_balloon_config {...@@ -71,7 +71,13 @@ struct virtio_balloon_config {
71#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */71#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */
72#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */72#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */
73#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */73#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */
74#define VIRTIO_BALLOON_S_NR 1074#define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */
75#define VIRTIO_BALLOON_S_ALLOC_STALL 11 /* Stall count of memory allocatoin */
76#define VIRTIO_BALLOON_S_ASYNC_SCAN 12 /* Amount of memory scanned asynchronously */
77#define VIRTIO_BALLOON_S_DIRECT_SCAN 13 /* Amount of memory scanned directly */
78#define VIRTIO_BALLOON_S_ASYNC_RECLAIM 14 /* Amount of memory reclaimed asynchronously */
79#define VIRTIO_BALLOON_S_DIRECT_RECLAIM 15 /* Amount of memory reclaimed directly */
80#define VIRTIO_BALLOON_S_NR 16
7581
76#define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \82#define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \
77 VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \83 VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \
...@@ -83,7 +89,13 @@ struct virtio_balloon_config {...@@ -83,7 +89,13 @@ struct virtio_balloon_config {
83 VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \89 VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \
84 VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \90 VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \
85 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \91 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \
86 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \92 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \
93 VIRTIO_BALLOON_S_NAMES_prefix "oom-kills", \
94 VIRTIO_BALLOON_S_NAMES_prefix "alloc-stalls", \
95 VIRTIO_BALLOON_S_NAMES_prefix "async-scans", \
96 VIRTIO_BALLOON_S_NAMES_prefix "direct-scans", \
97 VIRTIO_BALLOON_S_NAMES_prefix "async-reclaims", \
98 VIRTIO_BALLOON_S_NAMES_prefix "direct-reclaims" \
87}99}
88100
89#define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("")101#define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("")
lib/libc/include/any-linux-any/linux/virtio_crypto.h+1
...@@ -329,6 +329,7 @@ struct virtio_crypto_op_header {...@@ -329,6 +329,7 @@ struct virtio_crypto_op_header {
329 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00)329 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00)
330#define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \330#define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \
331 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01)331 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01)
332 /* akcipher sign/verify opcodes are deprecated */
332#define VIRTIO_CRYPTO_AKCIPHER_SIGN \333#define VIRTIO_CRYPTO_AKCIPHER_SIGN \
333 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02)334 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02)
334#define VIRTIO_CRYPTO_AKCIPHER_VERIFY \335#define VIRTIO_CRYPTO_AKCIPHER_VERIFY \
lib/libc/include/any-linux-any/linux/virtio_gpu.h+1
...@@ -311,6 +311,7 @@ struct virtio_gpu_cmd_submit {...@@ -311,6 +311,7 @@ struct virtio_gpu_cmd_submit {
311#define VIRTIO_GPU_CAPSET_VIRGL2 2311#define VIRTIO_GPU_CAPSET_VIRGL2 2
312/* 3 is reserved for gfxstream */312/* 3 is reserved for gfxstream */
313#define VIRTIO_GPU_CAPSET_VENUS 4313#define VIRTIO_GPU_CAPSET_VENUS 4
314#define VIRTIO_GPU_CAPSET_DRM 6
314315
315/* VIRTIO_GPU_CMD_GET_CAPSET_INFO */316/* VIRTIO_GPU_CMD_GET_CAPSET_INFO */
316struct virtio_gpu_get_capset_info {317struct virtio_gpu_get_capset_info {
lib/libc/include/any-linux-any/linux/virtio_pci.h+131
...@@ -40,6 +40,7 @@...@@ -40,6 +40,7 @@
40#define _LINUX_VIRTIO_PCI_H40#define _LINUX_VIRTIO_PCI_H
4141
42#include <linux/types.h>42#include <linux/types.h>
43#include <linux/kernel.h>
4344
44#ifndef VIRTIO_PCI_NO_LEGACY45#ifndef VIRTIO_PCI_NO_LEGACY
4546
...@@ -240,6 +241,17 @@ struct virtio_pci_cfg_cap {...@@ -240,6 +241,17 @@ struct virtio_pci_cfg_cap {
240#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5241#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5
241#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6242#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6
242243
244/* Device parts access commands. */
245#define VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY 0x7
246#define VIRTIO_ADMIN_CMD_DEVICE_CAP_GET 0x8
247#define VIRTIO_ADMIN_CMD_DRIVER_CAP_SET 0x9
248#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_CREATE 0xa
249#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_DESTROY 0xd
250#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_GET 0xe
251#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET 0xf
252#define VIRTIO_ADMIN_CMD_DEV_PARTS_SET 0x10
253#define VIRTIO_ADMIN_CMD_DEV_MODE_SET 0x11
254
243struct virtio_admin_cmd_hdr {255struct virtio_admin_cmd_hdr {
244 __le16 opcode;256 __le16 opcode;
245 /*257 /*
...@@ -286,4 +298,123 @@ struct virtio_admin_cmd_notify_info_result {...@@ -286,4 +298,123 @@ struct virtio_admin_cmd_notify_info_result {
286 struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO];298 struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO];
287};299};
288300
301#define VIRTIO_DEV_PARTS_CAP 0x0000
302
303struct virtio_dev_parts_cap {
304 __u8 get_parts_resource_objects_limit;
305 __u8 set_parts_resource_objects_limit;
306};
307
308#define MAX_CAP_ID __KERNEL_DIV_ROUND_UP(VIRTIO_DEV_PARTS_CAP + 1, 64)
309
310struct virtio_admin_cmd_query_cap_id_result {
311 __le64 supported_caps[MAX_CAP_ID];
312};
313
314struct virtio_admin_cmd_cap_get_data {
315 __le16 id;
316 __u8 reserved[6];
317};
318
319struct virtio_admin_cmd_cap_set_data {
320 __le16 id;
321 __u8 reserved[6];
322 __u8 cap_specific_data[];
323};
324
325struct virtio_admin_cmd_resource_obj_cmd_hdr {
326 __le16 type;
327 __u8 reserved[2];
328 __le32 id; /* Indicates unique resource object id per resource object type */
329};
330
331struct virtio_admin_cmd_resource_obj_create_data {
332 struct virtio_admin_cmd_resource_obj_cmd_hdr hdr;
333 __le64 flags;
334 __u8 resource_obj_specific_data[];
335};
336
337#define VIRTIO_RESOURCE_OBJ_DEV_PARTS 0
338
339#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_GET 0
340#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_SET 1
341
342struct virtio_resource_obj_dev_parts {
343 __u8 type;
344 __u8 reserved[7];
345};
346
347#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_SIZE 0
348#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_COUNT 1
349#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_LIST 2
350
351struct virtio_admin_cmd_dev_parts_metadata_data {
352 struct virtio_admin_cmd_resource_obj_cmd_hdr hdr;
353 __u8 type;
354 __u8 reserved[7];
355};
356
357#define VIRTIO_DEV_PART_F_OPTIONAL 0
358
359struct virtio_dev_part_hdr {
360 __le16 part_type;
361 __u8 flags;
362 __u8 reserved;
363 union {
364 struct {
365 __le32 offset;
366 __le32 reserved;
367 } pci_common_cfg;
368 struct {
369 __le16 index;
370 __u8 reserved[6];
371 } vq_index;
372 } selector;
373 __le32 length;
374};
375
376struct virtio_dev_part {
377 struct virtio_dev_part_hdr hdr;
378 __u8 value[];
379};
380
381struct virtio_admin_cmd_dev_parts_metadata_result {
382 union {
383 struct {
384 __le32 size;
385 __le32 reserved;
386 } parts_size;
387 struct {
388 __le32 count;
389 __le32 reserved;
390 } hdr_list_count;
391 struct {
392 __le32 count;
393 __le32 reserved;
394 struct virtio_dev_part_hdr hdrs[];
395 } hdr_list;
396 };
397};
398
399#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_SELECTED 0
400#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_ALL 1
401
402struct virtio_admin_cmd_dev_parts_get_data {
403 struct virtio_admin_cmd_resource_obj_cmd_hdr hdr;
404 __u8 type;
405 __u8 reserved[7];
406 struct virtio_dev_part_hdr hdr_list[];
407};
408
409struct virtio_admin_cmd_dev_parts_set_data {
410 struct virtio_admin_cmd_resource_obj_cmd_hdr hdr;
411 struct virtio_dev_part parts[];
412};
413
414#define VIRTIO_ADMIN_CMD_DEV_MODE_F_STOPPED 0
415
416struct virtio_admin_cmd_dev_mode_set_data {
417 __u8 flags;
418};
419
289#endif420#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vmclock-abi.h created+182
...@@ -0,0 +1,182 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2
3/*
4 * This structure provides a vDSO-style clock to VM guests, exposing the
5 * relationship (or lack thereof) between the CPU clock (TSC, timebase, arch
6 * counter, etc.) and real time. It is designed to address the problem of
7 * live migration, which other clock enlightenments do not.
8 *
9 * When a guest is live migrated, this affects the clock in two ways.
10 *
11 * First, even between identical hosts the actual frequency of the underlying
12 * counter will change within the tolerances of its specification (typically
13 * ±50PPM, or 4 seconds a day). This frequency also varies over time on the
14 * same host, but can be tracked by NTP as it generally varies slowly. With
15 * live migration there is a step change in the frequency, with no warning.
16 *
17 * Second, there may be a step change in the value of the counter itself, as
18 * its accuracy is limited by the precision of the NTP synchronization on the
19 * source and destination hosts.
20 *
21 * So any calibration (NTP, PTP, etc.) which the guest has done on the source
22 * host before migration is invalid, and needs to be redone on the new host.
23 *
24 * In its most basic mode, this structure provides only an indication to the
25 * guest that live migration has occurred. This allows the guest to know that
26 * its clock is invalid and take remedial action. For applications that need
27 * reliable accurate timestamps (e.g. distributed databases), the structure
28 * can be mapped all the way to userspace. This allows the application to see
29 * directly for itself that the clock is disrupted and take appropriate
30 * action, even when using a vDSO-style method to get the time instead of a
31 * system call.
32 *
33 * In its more advanced mode. this structure can also be used to expose the
34 * precise relationship of the CPU counter to real time, as calibrated by the
35 * host. This means that userspace applications can have accurate time
36 * immediately after live migration, rather than having to pause operations
37 * and wait for NTP to recover. This mode does, of course, rely on the
38 * counter being reliable and consistent across CPUs.
39 *
40 * Note that this must be true UTC, never with smeared leap seconds. If a
41 * guest wishes to construct a smeared clock, it can do so. Presenting a
42 * smeared clock through this interface would be problematic because it
43 * actually messes with the apparent counter *period*. A linear smearing
44 * of 1 ms per second would effectively tweak the counter period by 1000PPM
45 * at the start/end of the smearing period, while a sinusoidal smear would
46 * basically be impossible to represent.
47 *
48 * This structure is offered with the intent that it be adopted into the
49 * nascent virtio-rtc standard, as a virtio-rtc that does not address the live
50 * migration problem seems a little less than fit for purpose. For that
51 * reason, certain fields use precisely the same numeric definitions as in
52 * the virtio-rtc proposal. The structure can also be exposed through an ACPI
53 * device with the CID "VMCLOCK", modelled on the "VMGENID" device except for
54 * the fact that it uses a real _CRS to convey the address of the structure
55 * (which should be a full page, to allow for mapping directly to userspace).
56 */
57
58#ifndef __VMCLOCK_ABI_H__
59#define __VMCLOCK_ABI_H__
60
61#include <linux/types.h>
62
63struct vmclock_abi {
64 /* CONSTANT FIELDS */
65 __le32 magic;
66#define VMCLOCK_MAGIC 0x4b4c4356 /* "VCLK" */
67 __le32 size; /* Size of region containing this structure */
68 __le16 version; /* 1 */
69 __u8 counter_id; /* Matches VIRTIO_RTC_COUNTER_xxx except INVALID */
70#define VMCLOCK_COUNTER_ARM_VCNT 0
71#define VMCLOCK_COUNTER_X86_TSC 1
72#define VMCLOCK_COUNTER_INVALID 0xff
73 __u8 time_type; /* Matches VIRTIO_RTC_TYPE_xxx */
74#define VMCLOCK_TIME_UTC 0 /* Since 1970-01-01 00:00:00z */
75#define VMCLOCK_TIME_TAI 1 /* Since 1970-01-01 00:00:00z */
76#define VMCLOCK_TIME_MONOTONIC 2 /* Since undefined epoch */
77#define VMCLOCK_TIME_INVALID_SMEARED 3 /* Not supported */
78#define VMCLOCK_TIME_INVALID_MAYBE_SMEARED 4 /* Not supported */
79
80 /* NON-CONSTANT FIELDS PROTECTED BY SEQCOUNT LOCK */
81 __le32 seq_count; /* Low bit means an update is in progress */
82 /*
83 * This field changes to another non-repeating value when the CPU
84 * counter is disrupted, for example on live migration. This lets
85 * the guest know that it should discard any calibration it has
86 * performed of the counter against external sources (NTP/PTP/etc.).
87 */
88 __le64 disruption_marker;
89 __le64 flags;
90 /* Indicates that the tai_offset_sec field is valid */
91#define VMCLOCK_FLAG_TAI_OFFSET_VALID (1 << 0)
92 /*
93 * Optionally used to notify guests of pending maintenance events.
94 * A guest which provides latency-sensitive services may wish to
95 * remove itself from service if an event is coming up. Two flags
96 * indicate the approximate imminence of the event.
97 */
98#define VMCLOCK_FLAG_DISRUPTION_SOON (1 << 1) /* About a day */
99#define VMCLOCK_FLAG_DISRUPTION_IMMINENT (1 << 2) /* About an hour */
100#define VMCLOCK_FLAG_PERIOD_ESTERROR_VALID (1 << 3)
101#define VMCLOCK_FLAG_PERIOD_MAXERROR_VALID (1 << 4)
102#define VMCLOCK_FLAG_TIME_ESTERROR_VALID (1 << 5)
103#define VMCLOCK_FLAG_TIME_MAXERROR_VALID (1 << 6)
104 /*
105 * If the MONOTONIC flag is set then (other than leap seconds) it is
106 * guaranteed that the time calculated according this structure at
107 * any given moment shall never appear to be later than the time
108 * calculated via the structure at any *later* moment.
109 *
110 * In particular, a timestamp based on a counter reading taken
111 * immediately after setting the low bit of seq_count (and the
112 * associated memory barrier), using the previously-valid time and
113 * period fields, shall never be later than a timestamp based on
114 * a counter reading taken immediately before *clearing* the low
115 * bit again after the update, using the about-to-be-valid fields.
116 */
117#define VMCLOCK_FLAG_TIME_MONOTONIC (1 << 7)
118
119 __u8 pad[2];
120 __u8 clock_status;
121#define VMCLOCK_STATUS_UNKNOWN 0
122#define VMCLOCK_STATUS_INITIALIZING 1
123#define VMCLOCK_STATUS_SYNCHRONIZED 2
124#define VMCLOCK_STATUS_FREERUNNING 3
125#define VMCLOCK_STATUS_UNRELIABLE 4
126
127 /*
128 * The time exposed through this device is never smeared. This field
129 * corresponds to the 'subtype' field in virtio-rtc, which indicates
130 * the smearing method. However in this case it provides a *hint* to
131 * the guest operating system, such that *if* the guest OS wants to
132 * provide its users with an alternative clock which does not follow
133 * UTC, it may do so in a fashion consistent with the other systems
134 * in the nearby environment.
135 */
136 __u8 leap_second_smearing_hint; /* Matches VIRTIO_RTC_SUBTYPE_xxx */
137#define VMCLOCK_SMEARING_STRICT 0
138#define VMCLOCK_SMEARING_NOON_LINEAR 1
139#define VMCLOCK_SMEARING_UTC_SLS 2
140 __le16 tai_offset_sec; /* Actually two's complement signed */
141 __u8 leap_indicator;
142 /*
143 * This field is based on the VIRTIO_RTC_LEAP_xxx values as defined
144 * in the current draft of virtio-rtc, but since smearing cannot be
145 * used with the shared memory device, some values are not used.
146 *
147 * The _POST_POS and _POST_NEG values allow the guest to perform
148 * its own smearing during the day or so after a leap second when
149 * such smearing may need to continue being applied for a leap
150 * second which is now theoretically "historical".
151 */
152#define VMCLOCK_LEAP_NONE 0x00 /* No known nearby leap second */
153#define VMCLOCK_LEAP_PRE_POS 0x01 /* Positive leap second at EOM */
154#define VMCLOCK_LEAP_PRE_NEG 0x02 /* Negative leap second at EOM */
155#define VMCLOCK_LEAP_POS 0x03 /* Set during 23:59:60 second */
156#define VMCLOCK_LEAP_POST_POS 0x04
157#define VMCLOCK_LEAP_POST_NEG 0x05
158
159 /* Bit shift for counter_period_frac_sec and its error rate */
160 __u8 counter_period_shift;
161 /*
162 * Paired values of counter and UTC at a given point in time.
163 */
164 __le64 counter_value;
165 /*
166 * Counter period, and error margin of same. The unit of these
167 * fields is 1/2^(64 + counter_period_shift) of a second.
168 */
169 __le64 counter_period_frac_sec;
170 __le64 counter_period_esterror_rate_frac_sec;
171 __le64 counter_period_maxerror_rate_frac_sec;
172
173 /*
174 * Time according to time_type field above.
175 */
176 __le64 time_sec; /* Seconds since time_type epoch */
177 __le64 time_frac_sec; /* Units of 1/2^64 of a second */
178 __le64 time_esterror_nanosec;
179 __le64 time_maxerror_nanosec;
180};
181
182#endif /* __VMCLOCK_ABI_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/xattr.h+7
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11*/11*/
1212
13#include <linux/libc-compat.h>13#include <linux/libc-compat.h>
14#include <linux/types.h>
1415
15#ifndef _LINUX_XATTR_H16#ifndef _LINUX_XATTR_H
16#define _LINUX_XATTR_H17#define _LINUX_XATTR_H
...@@ -20,6 +21,12 @@...@@ -20,6 +21,12 @@
2021
21#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */22#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
22#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */23#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
24
25struct xattr_args {
26 __aligned_u64 value;
27 __u32 size;
28 __u32 flags;
29};
23#endif30#endif
2431
25/* Namespaces */32/* Namespaces */
lib/libc/include/any-linux-any/linux/xfrm.h+3
...@@ -321,6 +321,8 @@ enum xfrm_attr_type_t {...@@ -321,6 +321,8 @@ enum xfrm_attr_type_t {
321 XFRMA_IF_ID, /* __u32 */321 XFRMA_IF_ID, /* __u32 */
322 XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */322 XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */
323 XFRMA_SA_DIR, /* __u8 */323 XFRMA_SA_DIR, /* __u8 */
324 XFRMA_NAT_KEEPALIVE_INTERVAL, /* __u32 in seconds for NAT keepalive */
325 XFRMA_SA_PCPU, /* __u32 */
324 __XFRMA_MAX326 __XFRMA_MAX
325327
326#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */328#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */
...@@ -436,6 +438,7 @@ struct xfrm_userpolicy_info {...@@ -436,6 +438,7 @@ struct xfrm_userpolicy_info {
436#define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */438#define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */
437 /* Automatically expand selector to include matching ICMP payloads. */439 /* Automatically expand selector to include matching ICMP payloads. */
438#define XFRM_POLICY_ICMP 2440#define XFRM_POLICY_ICMP 2
441#define XFRM_POLICY_CPU_ACQUIRE 4
439 __u8 share;442 __u8 share;
440};443};
441444
lib/libc/include/any-linux-any/linux/zorro_ids.h+3
...@@ -449,6 +449,9 @@...@@ -449,6 +449,9 @@
449#define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0)449#define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0)
450#define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0)450#define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0)
451451
452#define ZORRO_MANUF_CSLAB 0x1400
453#define ZORRO_PROD_CSLAB_WARP_1260 ZORRO_ID(CSLAB, 0x65, 0)
454
452#define ZORRO_MANUF_INFORMATION 0x157C455#define ZORRO_MANUF_INFORMATION 0x157C
453#define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0)456#define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0)
454457
lib/libc/include/any-linux-any/misc/fastrpc.h-3
...@@ -8,14 +8,11 @@...@@ -8,14 +8,11 @@
8#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)8#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)
9#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)9#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)
10#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)10#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)
11/* This ioctl is only supported with secure device nodes */
12#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)11#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)
13#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)12#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)
14#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
15#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
16/* This ioctl is only supported with secure device nodes */
17#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)15#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
18/* This ioctl is only supported with secure device nodes */
19#define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init_create_static)16#define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init_create_static)
20#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)17#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)
21#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)18#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)
lib/libc/include/any-linux-any/misc/mrvl_cn10k_dpi.h created+39
...@@ -0,0 +1,39 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Marvell Octeon CN10K DPI driver
4 *
5 * Copyright (C) 2024 Marvell.
6 *
7 */
8
9#ifndef __MRVL_CN10K_DPI_H__
10#define __MRVL_CN10K_DPI_H__
11
12#include <linux/types.h>
13
14#define DPI_MAX_ENGINES 6
15
16struct dpi_mps_mrrs_cfg {
17 __u16 max_read_req_sz; /* Max read request size */
18 __u16 max_payload_sz; /* Max payload size */
19 __u16 port; /* Ebus port */
20 __u16 reserved; /* Reserved */
21};
22
23struct dpi_engine_cfg {
24 __u64 fifo_mask; /* FIFO size mask in KBytes */
25 __u16 molr[DPI_MAX_ENGINES]; /* Max outstanding load requests */
26 __u16 update_molr; /* '1' to update engine MOLR */
27 __u16 reserved; /* Reserved */
28};
29
30/* DPI ioctl numbers */
31#define DPI_MAGIC_NUM 0xB8
32
33/* Set MPS & MRRS parameters */
34#define DPI_MPS_MRRS_CFG _IOW(DPI_MAGIC_NUM, 1, struct dpi_mps_mrrs_cfg)
35
36/* Set Engine FIFO configuration */
37#define DPI_ENGINE_CFG _IOW(DPI_MAGIC_NUM, 2, struct dpi_engine_cfg)
38
39#endif /* __MRVL_CN10K_DPI_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/bnxt_re-abi.h+14-1
...@@ -55,7 +55,7 @@ enum {...@@ -55,7 +55,7 @@ enum {
55 BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL,55 BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL,
56 BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL,56 BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL,
57 BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL,57 BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL,
58 BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40,58 BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED = 0x40,
59};59};
6060
61enum bnxt_re_wqe_mode {61enum bnxt_re_wqe_mode {
...@@ -66,6 +66,7 @@ enum bnxt_re_wqe_mode {...@@ -66,6 +66,7 @@ enum bnxt_re_wqe_mode {
6666
67enum {67enum {
68 BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT = 0x01,68 BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT = 0x01,
69 BNXT_RE_COMP_MASK_REQ_UCNTX_VAR_WQE_SUPPORT = 0x02,
69};70};
7071
71struct bnxt_re_uctx_req {72struct bnxt_re_uctx_req {
...@@ -118,10 +119,16 @@ struct bnxt_re_resize_cq_req {...@@ -118,10 +119,16 @@ struct bnxt_re_resize_cq_req {
118 __aligned_u64 cq_va;119 __aligned_u64 cq_va;
119};120};
120121
122enum bnxt_re_qp_mask {
123 BNXT_RE_QP_REQ_MASK_VAR_WQE_SQ_SLOTS = 0x1,
124};
125
121struct bnxt_re_qp_req {126struct bnxt_re_qp_req {
122 __aligned_u64 qpsva;127 __aligned_u64 qpsva;
123 __aligned_u64 qprva;128 __aligned_u64 qprva;
124 __aligned_u64 qp_handle;129 __aligned_u64 qp_handle;
130 __aligned_u64 comp_mask;
131 __u32 sq_slots;
125};132};
126133
127struct bnxt_re_qp_resp {134struct bnxt_re_qp_resp {
...@@ -134,8 +141,14 @@ struct bnxt_re_srq_req {...@@ -134,8 +141,14 @@ struct bnxt_re_srq_req {
134 __aligned_u64 srq_handle;141 __aligned_u64 srq_handle;
135};142};
136143
144enum bnxt_re_srq_mask {
145 BNXT_RE_SRQ_TOGGLE_PAGE_SUPPORT = 0x1,
146};
147
137struct bnxt_re_srq_resp {148struct bnxt_re_srq_resp {
138 __u32 srqid;149 __u32 srqid;
150 __u32 rsvd; /* padding */
151 __aligned_u64 comp_mask;
139};152};
140153
141enum bnxt_re_shpg_offt {154enum bnxt_re_shpg_offt {
lib/libc/include/any-linux-any/rdma/efa-abi.h+2-1
...@@ -95,7 +95,8 @@ struct efa_ibv_create_qp {...@@ -95,7 +95,8 @@ struct efa_ibv_create_qp {
95 __u32 sq_ring_size; /* bytes */95 __u32 sq_ring_size; /* bytes */
96 __u32 driver_qp_type;96 __u32 driver_qp_type;
97 __u16 flags;97 __u16 flags;
98 __u8 reserved_90[6];98 __u8 sl;
99 __u8 reserved_98[5];
99};100};
100101
101struct efa_ibv_create_qp_resp {102struct efa_ibv_create_qp_resp {
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_cmds.h+3-4
...@@ -37,9 +37,6 @@...@@ -37,9 +37,6 @@
37#define UVERBS_ID_NS_MASK 0xF00037#define UVERBS_ID_NS_MASK 0xF000
38#define UVERBS_ID_NS_SHIFT 1238#define UVERBS_ID_NS_SHIFT 12
3939
40#define UVERBS_UDATA_DRIVER_DATA_NS 1
41#define UVERBS_UDATA_DRIVER_DATA_FLAG (1UL << UVERBS_ID_NS_SHIFT)
42
43enum uverbs_default_objects {40enum uverbs_default_objects {
44 UVERBS_OBJECT_DEVICE, /* No instances of DEVICE are allowed */41 UVERBS_OBJECT_DEVICE, /* No instances of DEVICE are allowed */
45 UVERBS_OBJECT_PD,42 UVERBS_OBJECT_PD,
...@@ -61,8 +58,10 @@ enum uverbs_default_objects {...@@ -61,8 +58,10 @@ enum uverbs_default_objects {
61};58};
6259
63enum {60enum {
64 UVERBS_ATTR_UHW_IN = UVERBS_UDATA_DRIVER_DATA_FLAG,61 UVERBS_ID_DRIVER_NS = 1UL << UVERBS_ID_NS_SHIFT,
62 UVERBS_ATTR_UHW_IN = UVERBS_ID_DRIVER_NS,
65 UVERBS_ATTR_UHW_OUT,63 UVERBS_ATTR_UHW_OUT,
64 UVERBS_ID_DRIVER_NS_WITH_UHW,
66};65};
6766
68enum uverbs_methods_device {67enum uverbs_methods_device {
lib/libc/include/any-linux-any/rdma/mana-abi.h+9
...@@ -45,6 +45,15 @@ struct mana_ib_create_qp_resp {...@@ -45,6 +45,15 @@ struct mana_ib_create_qp_resp {
45 __u32 reserved;45 __u32 reserved;
46};46};
4747
48struct mana_ib_create_rc_qp {
49 __aligned_u64 queue_buf[4];
50 __u32 queue_size[4];
51};
52
53struct mana_ib_create_rc_qp_resp {
54 __u32 queue_id[4];
55};
56
48struct mana_ib_create_wq {57struct mana_ib_create_wq {
49 __aligned_u64 wq_buf_addr;58 __aligned_u64 wq_buf_addr;
50 __u32 wq_buf_size;59 __u32 wq_buf_size;
lib/libc/include/any-linux-any/rdma/mlx5-abi.h+5
...@@ -252,6 +252,7 @@ enum mlx5_ib_query_dev_resp_flags {...@@ -252,6 +252,7 @@ enum mlx5_ib_query_dev_resp_flags {
252 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1,252 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1,
253 MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,253 MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,
254 MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3,254 MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3,
255 MLX5_IB_QUERY_DEV_RESP_FLAGS_OOO_DP = 1 << 4,
255};256};
256257
257enum mlx5_ib_tunnel_offloads {258enum mlx5_ib_tunnel_offloads {
...@@ -439,6 +440,10 @@ struct mlx5_ib_burst_info {...@@ -439,6 +440,10 @@ struct mlx5_ib_burst_info {
439 __u16 reserved;440 __u16 reserved;
440};441};
441442
443enum mlx5_ib_modify_qp_mask {
444 MLX5_IB_MODIFY_QP_OOO_DP = 1 << 0,
445};
446
442struct mlx5_ib_modify_qp {447struct mlx5_ib_modify_qp {
443 __u32 comp_mask;448 __u32 comp_mask;
444 struct mlx5_ib_burst_info burst_info;449 struct mlx5_ib_burst_info burst_info;
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_cmds.h+13
...@@ -270,6 +270,14 @@ enum mlx5_ib_device_query_context_attrs {...@@ -270,6 +270,14 @@ enum mlx5_ib_device_query_context_attrs {
270 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),270 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),
271};271};
272272
273enum mlx5_ib_create_cq_attrs {
274 MLX5_IB_ATTR_CREATE_CQ_UAR_INDEX = UVERBS_ID_DRIVER_NS_WITH_UHW,
275};
276
277enum mlx5_ib_reg_dmabuf_mr_attrs {
278 MLX5_IB_ATTR_REG_DMABUF_MR_ACCESS_FLAGS = (1U << UVERBS_ID_NS_SHIFT),
279};
280
273#define MLX5_IB_DW_MATCH_PARAM 0xA0281#define MLX5_IB_DW_MATCH_PARAM 0xA0
274282
275struct mlx5_ib_match_params {283struct mlx5_ib_match_params {
...@@ -340,6 +348,7 @@ enum mlx5_ib_pd_methods {...@@ -340,6 +348,7 @@ enum mlx5_ib_pd_methods {
340348
341enum mlx5_ib_device_methods {349enum mlx5_ib_device_methods {
342 MLX5_IB_METHOD_QUERY_PORT = (1U << UVERBS_ID_NS_SHIFT),350 MLX5_IB_METHOD_QUERY_PORT = (1U << UVERBS_ID_NS_SHIFT),
351 MLX5_IB_METHOD_GET_DATA_DIRECT_SYSFS_PATH,
343};352};
344353
345enum mlx5_ib_query_port_attrs {354enum mlx5_ib_query_port_attrs {
...@@ -347,4 +356,8 @@ enum mlx5_ib_query_port_attrs {...@@ -347,4 +356,8 @@ enum mlx5_ib_query_port_attrs {
347 MLX5_IB_ATTR_QUERY_PORT,356 MLX5_IB_ATTR_QUERY_PORT,
348};357};
349358
359enum mlx5_ib_get_data_direct_sysfs_path_attrs {
360 MLX5_IB_ATTR_GET_DATA_DIRECT_SYSFS_PATH = (1U << UVERBS_ID_NS_SHIFT),
361};
362
350#endif363#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_verbs.h+4
...@@ -54,6 +54,10 @@ enum mlx5_ib_uapi_flow_action_packet_reformat_type {...@@ -54,6 +54,10 @@ enum mlx5_ib_uapi_flow_action_packet_reformat_type {
54 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x3,54 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x3,
55};55};
5656
57enum mlx5_ib_uapi_reg_dmabuf_flags {
58 MLX5_IB_UAPI_REG_DMABUF_ACCESS_DATA_DIRECT = 1 << 0,
59};
60
57struct mlx5_ib_uapi_devx_async_cmd_hdr {61struct mlx5_ib_uapi_devx_async_cmd_hdr {
58 __aligned_u64 wr_id;62 __aligned_u64 wr_id;
59 __u8 out_data[];63 __u8 out_data[];
lib/libc/include/any-linux-any/rdma/rdma_netlink.h+40
...@@ -15,6 +15,7 @@ enum {...@@ -15,6 +15,7 @@ enum {
15enum {15enum {
16 RDMA_NL_GROUP_IWPM = 2,16 RDMA_NL_GROUP_IWPM = 2,
17 RDMA_NL_GROUP_LS,17 RDMA_NL_GROUP_LS,
18 RDMA_NL_GROUP_NOTIFY,
18 RDMA_NL_NUM_GROUPS19 RDMA_NL_NUM_GROUPS
19};20};
2021
...@@ -301,6 +302,12 @@ enum rdma_nldev_command {...@@ -301,6 +302,12 @@ enum rdma_nldev_command {
301302
302 RDMA_NLDEV_CMD_RES_SRQ_GET_RAW,303 RDMA_NLDEV_CMD_RES_SRQ_GET_RAW,
303304
305 RDMA_NLDEV_CMD_NEWDEV,
306
307 RDMA_NLDEV_CMD_DELDEV,
308
309 RDMA_NLDEV_CMD_MONITOR,
310
304 RDMA_NLDEV_NUM_OPS311 RDMA_NLDEV_NUM_OPS
305};312};
306313
...@@ -564,6 +571,15 @@ enum rdma_nldev_attr {...@@ -564,6 +571,15 @@ enum rdma_nldev_attr {
564 */571 */
565 RDMA_NLDEV_ATTR_RES_SUBTYPE, /* string */572 RDMA_NLDEV_ATTR_RES_SUBTYPE, /* string */
566573
574 RDMA_NLDEV_ATTR_DEV_TYPE, /* u8 */
575
576 RDMA_NLDEV_ATTR_PARENT_NAME, /* string */
577
578 RDMA_NLDEV_ATTR_NAME_ASSIGN_TYPE, /* u8 */
579
580 RDMA_NLDEV_ATTR_EVENT_TYPE, /* u8 */
581
582 RDMA_NLDEV_SYS_ATTR_MONITOR_MODE, /* u8 */
567 /*583 /*
568 * Always the end584 * Always the end
569 */585 */
...@@ -602,4 +618,28 @@ enum rdma_nl_counter_mask {...@@ -602,4 +618,28 @@ enum rdma_nl_counter_mask {
602 RDMA_COUNTER_MASK_QP_TYPE = 1,618 RDMA_COUNTER_MASK_QP_TYPE = 1,
603 RDMA_COUNTER_MASK_PID = 1 << 1,619 RDMA_COUNTER_MASK_PID = 1 << 1,
604};620};
621
622/* Supported rdma device types. */
623enum rdma_nl_dev_type {
624 RDMA_DEVICE_TYPE_SMI = 1,
625};
626
627/* RDMA device name assignment types */
628enum rdma_nl_name_assign_type {
629 RDMA_NAME_ASSIGN_TYPE_UNKNOWN = 0,
630 RDMA_NAME_ASSIGN_TYPE_USER = 1, /* Provided by user-space */
631};
632
633/*
634 * Supported rdma monitoring event types.
635 */
636enum rdma_nl_notify_event_type {
637 RDMA_REGISTER_EVENT,
638 RDMA_UNREGISTER_EVENT,
639 RDMA_NETDEV_ATTACH_EVENT,
640 RDMA_NETDEV_DETACH_EVENT,
641 RDMA_RENAME_EVENT,
642 RDMA_NETDEV_RENAME_EVENT,
643};
644
605#endif /* _RDMA_NETLINK_H */645#endif /* _RDMA_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_bsg_mpi3mr.h+2-1
...@@ -296,6 +296,7 @@ struct mpi3mr_hdb_entry {...@@ -296,6 +296,7 @@ struct mpi3mr_hdb_entry {
296 * multiple hdb entries.296 * multiple hdb entries.
297 *297 *
298 * @num_hdb_types: Number of host diag buffer types supported298 * @num_hdb_types: Number of host diag buffer types supported
299 * @element_trigger_format: Element trigger format
299 * @rsvd1: Reserved300 * @rsvd1: Reserved
300 * @rsvd2: Reserved301 * @rsvd2: Reserved
301 * @rsvd3: Reserved302 * @rsvd3: Reserved
...@@ -303,7 +304,7 @@ struct mpi3mr_hdb_entry {...@@ -303,7 +304,7 @@ struct mpi3mr_hdb_entry {
303 */304 */
304struct mpi3mr_bsg_in_hdb_status {305struct mpi3mr_bsg_in_hdb_status {
305 __u8 num_hdb_types;306 __u8 num_hdb_types;
306 __u8 rsvd1;307 __u8 element_trigger_format;
307 __u16 rsvd2;308 __u16 rsvd2;
308 __u32 rsvd3;309 __u32 rsvd3;
309 struct mpi3mr_hdb_entry entry[1];310 struct mpi3mr_hdb_entry entry[1];
lib/libc/include/any-linux-any/sound/asequencer.h+6-3
...@@ -10,7 +10,7 @@...@@ -10,7 +10,7 @@
10#include <sound/asound.h>10#include <sound/asound.h>
1111
12/** version of the sequencer */12/** version of the sequencer */
13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3)13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
1414
15/**15/**
16 * definition of sequencer event types16 * definition of sequencer event types
...@@ -461,6 +461,8 @@ struct snd_seq_remove_events {...@@ -461,6 +461,8 @@ struct snd_seq_remove_events {
461#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)461#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
462#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)462#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
463463
464#define SNDRV_SEQ_PORT_FLG_IS_MIDI1 (1<<3) /* Keep MIDI 1.0 protocol */
465
464/* port direction */466/* port direction */
465#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0467#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
466#define SNDRV_SEQ_PORT_DIR_INPUT 1468#define SNDRV_SEQ_PORT_DIR_INPUT 1
...@@ -523,11 +525,12 @@ struct snd_seq_queue_status {...@@ -523,11 +525,12 @@ struct snd_seq_queue_status {
523/* queue tempo */525/* queue tempo */
524struct snd_seq_queue_tempo {526struct snd_seq_queue_tempo {
525 int queue; /* sequencer queue */527 int queue; /* sequencer queue */
526 unsigned int tempo; /* current tempo, us/tick */528 unsigned int tempo; /* current tempo, us/tick (or different time-base below) */
527 int ppq; /* time resolution, ticks/quarter */529 int ppq; /* time resolution, ticks/quarter */
528 unsigned int skew_value; /* queue skew */530 unsigned int skew_value; /* queue skew */
529 unsigned int skew_base; /* queue skew base */531 unsigned int skew_base; /* queue skew base */
530 char reserved[24]; /* for the future */532 unsigned short tempo_base; /* tempo base in nsec unit; either 10 or 1000 */
533 char reserved[22]; /* for the future */
531};534};
532535
533536
lib/libc/include/any-linux-any/sound/asoc.h+1-1
...@@ -88,7 +88,7 @@...@@ -88,7 +88,7 @@
8888
89/* ABI version */89/* ABI version */
90#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */90#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
91#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */91#define SND_SOC_TPLG_ABI_VERSION_MIN 0x5 /* oldest version supported */
9292
93/* Max size of TLV data */93/* Max size of TLV data */
94#define SND_SOC_TPLG_TLV_SIZE 3294#define SND_SOC_TPLG_TLV_SIZE 32
lib/libc/include/any-linux-any/sound/asound.h+21-5
...@@ -140,7 +140,7 @@ struct snd_hwdep_dsp_image {...@@ -140,7 +140,7 @@ struct snd_hwdep_dsp_image {
140 * *140 * *
141 *****************************************************************************/141 *****************************************************************************/
142142
143#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 17)143#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 18)
144144
145typedef unsigned long snd_pcm_uframes_t;145typedef unsigned long snd_pcm_uframes_t;
146typedef signed long snd_pcm_sframes_t;146typedef signed long snd_pcm_sframes_t;
...@@ -332,7 +332,7 @@ union snd_pcm_sync_id {...@@ -332,7 +332,7 @@ union snd_pcm_sync_id {
332 unsigned char id[16];332 unsigned char id[16];
333 unsigned short id16[8];333 unsigned short id16[8];
334 unsigned int id32[4];334 unsigned int id32[4];
335};335} __attribute__((deprecated));
336336
337struct snd_pcm_info {337struct snd_pcm_info {
338 unsigned int device; /* RO/WR (control): device number */338 unsigned int device; /* RO/WR (control): device number */
...@@ -346,7 +346,7 @@ struct snd_pcm_info {...@@ -346,7 +346,7 @@ struct snd_pcm_info {
346 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */346 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
347 unsigned int subdevices_count;347 unsigned int subdevices_count;
348 unsigned int subdevices_avail;348 unsigned int subdevices_avail;
349 union snd_pcm_sync_id sync; /* hardware synchronization ID */349 unsigned char pad1[16]; /* was: hardware synchronization ID */
350 unsigned char reserved[64]; /* reserved for future... */350 unsigned char reserved[64]; /* reserved for future... */
351};351};
352352
...@@ -418,7 +418,8 @@ struct snd_pcm_hw_params {...@@ -418,7 +418,8 @@ struct snd_pcm_hw_params {
418 unsigned int rate_num; /* R: rate numerator */418 unsigned int rate_num; /* R: rate numerator */
419 unsigned int rate_den; /* R: rate denominator */419 unsigned int rate_den; /* R: rate denominator */
420 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */420 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
421 unsigned char reserved[64]; /* reserved for future */421 unsigned char sync[16]; /* R: synchronization ID (perfect sync - one clock source) */
422 unsigned char reserved[48]; /* reserved for future */
422};423};
423424
424enum {425enum {
...@@ -858,7 +859,7 @@ struct snd_ump_block_info {...@@ -858,7 +859,7 @@ struct snd_ump_block_info {
858 * Timer section - /dev/snd/timer859 * Timer section - /dev/snd/timer
859 */860 */
860861
861#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)862#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
862863
863enum {864enum {
864 SNDRV_TIMER_CLASS_NONE = -1,865 SNDRV_TIMER_CLASS_NONE = -1,
...@@ -883,6 +884,7 @@ enum {...@@ -883,6 +884,7 @@ enum {
883#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */884#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */
884#define SNDRV_TIMER_GLOBAL_HPET 2885#define SNDRV_TIMER_GLOBAL_HPET 2
885#define SNDRV_TIMER_GLOBAL_HRTIMER 3886#define SNDRV_TIMER_GLOBAL_HRTIMER 3
887#define SNDRV_TIMER_GLOBAL_UDRIVEN 4
886888
887/* info flags */889/* info flags */
888#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */890#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
...@@ -961,6 +963,18 @@ struct snd_timer_status {...@@ -961,6 +963,18 @@ struct snd_timer_status {
961 unsigned char reserved[64]; /* reserved */963 unsigned char reserved[64]; /* reserved */
962};964};
963965
966/*
967 * This structure describes the userspace-driven timer. Such timers are purely virtual,
968 * and can only be triggered from software (for instance, by userspace application).
969 */
970struct snd_timer_uinfo {
971 /* To pretend being a normal timer, we need to know the resolution in ns. */
972 __u64 resolution;
973 int fd;
974 unsigned int id;
975 unsigned char reserved[16];
976};
977
964#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)978#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
965#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)979#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
966#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int)980#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int)
...@@ -977,6 +991,8 @@ struct snd_timer_status {...@@ -977,6 +991,8 @@ struct snd_timer_status {
977#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)991#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
978#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)992#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
979#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int)993#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int)
994#define SNDRV_TIMER_IOCTL_CREATE _IOWR('T', 0xa5, struct snd_timer_uinfo)
995#define SNDRV_TIMER_IOCTL_TRIGGER _IO('T', 0xa6)
980996
981#if __BITS_PER_LONG == 64997#if __BITS_PER_LONG == 64
982#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD998#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD
lib/libc/include/any-linux-any/sound/compress_offload.h+64-2
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14#include <sound/compress_params.h>14#include <sound/compress_params.h>
1515
1616
17#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0)17#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 3, 0)
18/**18/**
19 * struct snd_compressed_buffer - compressed buffer19 * struct snd_compressed_buffer - compressed buffer
20 * @fragment_size: size of buffer fragment in bytes20 * @fragment_size: size of buffer fragment in bytes
...@@ -68,7 +68,8 @@ struct snd_compr_avail {...@@ -68,7 +68,8 @@ struct snd_compr_avail {
6868
69enum snd_compr_direction {69enum snd_compr_direction {
70 SND_COMPRESS_PLAYBACK = 0,70 SND_COMPRESS_PLAYBACK = 0,
71 SND_COMPRESS_CAPTURE71 SND_COMPRESS_CAPTURE,
72 SND_COMPRESS_ACCEL
72};73};
7374
74/**75/**
...@@ -127,6 +128,59 @@ struct snd_compr_metadata {...@@ -127,6 +128,59 @@ struct snd_compr_metadata {
127 __u32 value[8];128 __u32 value[8];
128} __attribute__((packed, aligned(4)));129} __attribute__((packed, aligned(4)));
129130
131/* flags for struct snd_compr_task */
132#define SND_COMPRESS_TFLG_NEW_STREAM (1<<0) /* mark for the new stream data */
133
134/**
135 * struct snd_compr_task - task primitive for non-realtime operation
136 * @seqno: sequence number (task identifier)
137 * @origin_seqno: previous sequence number (task identifier) - for reuse
138 * @input_fd: data input file descriptor (dma-buf)
139 * @output_fd: data output file descriptor (dma-buf)
140 * @input_size: filled data in bytes (from caller, must not exceed fragment size)
141 * @flags: see SND_COMPRESS_TFLG_* defines
142 * @reserved: reserved for future extension
143 */
144struct snd_compr_task {
145 __u64 seqno;
146 __u64 origin_seqno;
147 int input_fd;
148 int output_fd;
149 __u64 input_size;
150 __u32 flags;
151 __u8 reserved[16];
152} __attribute__((packed, aligned(4)));
153
154/**
155 * enum snd_compr_state - task state
156 * @SND_COMPRESS_TASK_STATE_IDLE: task is not queued
157 * @SND_COMPRESS_TASK_STATE_ACTIVE: task is in the queue
158 * @SND_COMPRESS_TASK_STATE_FINISHED: task was processed, output is available
159 */
160enum snd_compr_state {
161 SND_COMPRESS_TASK_STATE_IDLE = 0,
162 SND_COMPRESS_TASK_STATE_ACTIVE,
163 SND_COMPRESS_TASK_STATE_FINISHED
164};
165
166/**
167 * struct snd_compr_task_status - task status
168 * @seqno: sequence number (task identifier)
169 * @input_size: filled data in bytes (from user space)
170 * @output_size: filled data in bytes (from driver)
171 * @output_flags: reserved for future (all zeros - from driver)
172 * @state: actual task state (SND_COMPRESS_TASK_STATE_*)
173 * @reserved: reserved for future extension
174 */
175struct snd_compr_task_status {
176 __u64 seqno;
177 __u64 input_size;
178 __u64 output_size;
179 __u32 output_flags;
180 __u8 state;
181 __u8 reserved[15];
182} __attribute__((packed, aligned(4)));
183
130/*184/*
131 * compress path ioctl definitions185 * compress path ioctl definitions
132 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP186 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
...@@ -164,6 +218,14 @@ struct snd_compr_metadata {...@@ -164,6 +218,14 @@ struct snd_compr_metadata {
164#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)218#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
165#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)219#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)
166#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)220#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)
221
222
223#define SNDRV_COMPRESS_TASK_CREATE _IOWR('C', 0x60, struct snd_compr_task)
224#define SNDRV_COMPRESS_TASK_FREE _IOW('C', 0x61, __u64)
225#define SNDRV_COMPRESS_TASK_START _IOWR('C', 0x62, struct snd_compr_task)
226#define SNDRV_COMPRESS_TASK_STOP _IOW('C', 0x63, __u64)
227#define SNDRV_COMPRESS_TASK_STATUS _IOWR('C', 0x68, struct snd_compr_task_status)
228
167/*229/*
168 * TODO230 * TODO
169 * 1. add mmap support231 * 1. add mmap support
lib/libc/include/any-linux-any/sound/sof/abi.h+1-1
...@@ -29,7 +29,7 @@...@@ -29,7 +29,7 @@
29/* SOF ABI version major, minor and patch numbers */29/* SOF ABI version major, minor and patch numbers */
30#define SOF_ABI_MAJOR 330#define SOF_ABI_MAJOR 3
31#define SOF_ABI_MINOR 2331#define SOF_ABI_MINOR 23
32#define SOF_ABI_PATCH 032#define SOF_ABI_PATCH 1
3333
34/* SOF ABI version number. Format within 32bit word is MMmmmppp */34/* SOF ABI version number. Format within 32bit word is MMmmmppp */
35#define SOF_ABI_MAJOR_SHIFT 2435#define SOF_ABI_MAJOR_SHIFT 24
lib/libc/include/any-linux-any/xen/privcmd.h+7
...@@ -126,6 +126,11 @@ struct privcmd_ioeventfd {...@@ -126,6 +126,11 @@ struct privcmd_ioeventfd {
126 __u8 pad[2];126 __u8 pad[2];
127};127};
128128
129struct privcmd_pcidev_get_gsi {
130 __u32 sbdf;
131 __u32 gsi;
132};
133
129/*134/*
130 * @cmd: IOCTL_PRIVCMD_HYPERCALL135 * @cmd: IOCTL_PRIVCMD_HYPERCALL
131 * @arg: &privcmd_hypercall_t136 * @arg: &privcmd_hypercall_t
...@@ -157,5 +162,7 @@ struct privcmd_ioeventfd {...@@ -157,5 +162,7 @@ struct privcmd_ioeventfd {
157 _IOW('P', 8, struct privcmd_irqfd)162 _IOW('P', 8, struct privcmd_irqfd)
158#define IOCTL_PRIVCMD_IOEVENTFD \163#define IOCTL_PRIVCMD_IOEVENTFD \
159 _IOW('P', 9, struct privcmd_ioeventfd)164 _IOW('P', 9, struct privcmd_ioeventfd)
165#define IOCTL_PRIVCMD_PCIDEV_GET_GSI \
166 _IOC(_IOC_NONE, 'P', 10, sizeof(struct privcmd_pcidev_get_gsi))
160167
161#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */168#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/page.h+2-3
...@@ -21,10 +21,9 @@...@@ -21,10 +21,9 @@
21 * not available21 * not available
22 */22 */
23#define PAGE_SHIFT 1323#define PAGE_SHIFT 13
24
25#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */24#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
26#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
27
28#define PAGE_MASK (~(PAGE_SIZE-1))25#define PAGE_MASK (~(PAGE_SIZE-1))
2926
27#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
28
30#endif /* __ASM_ARC_PAGE_H */29#endif /* __ASM_ARC_PAGE_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/unistd.h+1-43
...@@ -7,46 +7,4 @@...@@ -7,46 +7,4 @@
7 * published by the Free Software Foundation.7 * published by the Free Software Foundation.
8 */8 */
99
10/******** no-legacy-syscalls-ABI *******/
11
12/*
13 * Non-typical guard macro to enable inclusion twice in ARCH sys.c
14 * That is how the Generic syscall wrapper generator works
15 */
16#if !defined(_UAPI_ASM_ARC_UNISTD_H) || defined(__SYSCALL)
17#define _ASM_ARC_UNISTD_H
18
19#define __ARCH_WANT_RENAMEAT
20#define __ARCH_WANT_STAT64
21#define __ARCH_WANT_SET_GET_RLIMIT
22#define __ARCH_WANT_SYS_EXECVE
23#define __ARCH_WANT_SYS_CLONE
24#define __ARCH_WANT_SYS_CLONE3
25#define __ARCH_WANT_SYS_VFORK
26#define __ARCH_WANT_SYS_FORK
27#define __ARCH_WANT_TIME32_SYSCALLS
28
29#define sys_mmap2 sys_mmap_pgoff
30
31#include <asm-generic/unistd.h>
32
33#define NR_syscalls __NR_syscalls
34
35/* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */
36#define __NR_sysfs (__NR_arch_specific_syscall + 3)
37
38/* ARC specific syscall */
39#define __NR_cacheflush (__NR_arch_specific_syscall + 0)
40#define __NR_arc_settls (__NR_arch_specific_syscall + 1)
41#define __NR_arc_gettls (__NR_arch_specific_syscall + 2)
42#define __NR_arc_usr_cmpxchg (__NR_arch_specific_syscall + 4)
43
44__SYSCALL(__NR_cacheflush, sys_cacheflush)
45__SYSCALL(__NR_arc_settls, sys_arc_settls)
46__SYSCALL(__NR_arc_gettls, sys_arc_gettls)
47__SYSCALL(__NR_arc_usr_cmpxchg, sys_arc_usr_cmpxchg)
48__SYSCALL(__NR_sysfs, sys_sysfs)
49
50#undef __SYSCALL
51
52#endif
\ No newline at end of file
10#include <asm/unistd_32.h>
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/unistd_32.h created+352
...@@ -0,0 +1,352 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl64 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_renameat 38
43#define __NR_umount2 39
44#define __NR_mount 40
45#define __NR_pivot_root 41
46#define __NR_nfsservctl 42
47#define __NR_statfs64 43
48#define __NR_fstatfs64 44
49#define __NR_truncate64 45
50#define __NR_ftruncate64 46
51#define __NR_fallocate 47
52#define __NR_faccessat 48
53#define __NR_chdir 49
54#define __NR_fchdir 50
55#define __NR_chroot 51
56#define __NR_fchmod 52
57#define __NR_fchmodat 53
58#define __NR_fchownat 54
59#define __NR_fchown 55
60#define __NR_openat 56
61#define __NR_close 57
62#define __NR_vhangup 58
63#define __NR_pipe2 59
64#define __NR_quotactl 60
65#define __NR_getdents64 61
66#define __NR_llseek 62
67#define __NR_read 63
68#define __NR_write 64
69#define __NR_readv 65
70#define __NR_writev 66
71#define __NR_pread64 67
72#define __NR_pwrite64 68
73#define __NR_preadv 69
74#define __NR_pwritev 70
75#define __NR_sendfile64 71
76#define __NR_pselect6 72
77#define __NR_ppoll 73
78#define __NR_signalfd4 74
79#define __NR_vmsplice 75
80#define __NR_splice 76
81#define __NR_tee 77
82#define __NR_readlinkat 78
83#define __NR_fstatat64 79
84#define __NR_fstat64 80
85#define __NR_sync 81
86#define __NR_fsync 82
87#define __NR_fdatasync 83
88#define __NR_sync_file_range 84
89#define __NR_timerfd_create 85
90#define __NR_timerfd_settime 86
91#define __NR_timerfd_gettime 87
92#define __NR_utimensat 88
93#define __NR_acct 89
94#define __NR_capget 90
95#define __NR_capset 91
96#define __NR_personality 92
97#define __NR_exit 93
98#define __NR_exit_group 94
99#define __NR_waitid 95
100#define __NR_set_tid_address 96
101#define __NR_unshare 97
102#define __NR_futex 98
103#define __NR_set_robust_list 99
104#define __NR_get_robust_list 100
105#define __NR_nanosleep 101
106#define __NR_getitimer 102
107#define __NR_setitimer 103
108#define __NR_kexec_load 104
109#define __NR_init_module 105
110#define __NR_delete_module 106
111#define __NR_timer_create 107
112#define __NR_timer_gettime 108
113#define __NR_timer_getoverrun 109
114#define __NR_timer_settime 110
115#define __NR_timer_delete 111
116#define __NR_clock_settime 112
117#define __NR_clock_gettime 113
118#define __NR_clock_getres 114
119#define __NR_clock_nanosleep 115
120#define __NR_syslog 116
121#define __NR_ptrace 117
122#define __NR_sched_setparam 118
123#define __NR_sched_setscheduler 119
124#define __NR_sched_getscheduler 120
125#define __NR_sched_getparam 121
126#define __NR_sched_setaffinity 122
127#define __NR_sched_getaffinity 123
128#define __NR_sched_yield 124
129#define __NR_sched_get_priority_max 125
130#define __NR_sched_get_priority_min 126
131#define __NR_sched_rr_get_interval 127
132#define __NR_restart_syscall 128
133#define __NR_kill 129
134#define __NR_tkill 130
135#define __NR_tgkill 131
136#define __NR_sigaltstack 132
137#define __NR_rt_sigsuspend 133
138#define __NR_rt_sigaction 134
139#define __NR_rt_sigprocmask 135
140#define __NR_rt_sigpending 136
141#define __NR_rt_sigtimedwait 137
142#define __NR_rt_sigqueueinfo 138
143#define __NR_rt_sigreturn 139
144#define __NR_setpriority 140
145#define __NR_getpriority 141
146#define __NR_reboot 142
147#define __NR_setregid 143
148#define __NR_setgid 144
149#define __NR_setreuid 145
150#define __NR_setuid 146
151#define __NR_setresuid 147
152#define __NR_getresuid 148
153#define __NR_setresgid 149
154#define __NR_getresgid 150
155#define __NR_setfsuid 151
156#define __NR_setfsgid 152
157#define __NR_times 153
158#define __NR_setpgid 154
159#define __NR_getpgid 155
160#define __NR_getsid 156
161#define __NR_setsid 157
162#define __NR_getgroups 158
163#define __NR_setgroups 159
164#define __NR_uname 160
165#define __NR_sethostname 161
166#define __NR_setdomainname 162
167#define __NR_getrlimit 163
168#define __NR_setrlimit 164
169#define __NR_getrusage 165
170#define __NR_umask 166
171#define __NR_prctl 167
172#define __NR_getcpu 168
173#define __NR_gettimeofday 169
174#define __NR_settimeofday 170
175#define __NR_adjtimex 171
176#define __NR_getpid 172
177#define __NR_getppid 173
178#define __NR_getuid 174
179#define __NR_geteuid 175
180#define __NR_getgid 176
181#define __NR_getegid 177
182#define __NR_gettid 178
183#define __NR_sysinfo 179
184#define __NR_mq_open 180
185#define __NR_mq_unlink 181
186#define __NR_mq_timedsend 182
187#define __NR_mq_timedreceive 183
188#define __NR_mq_notify 184
189#define __NR_mq_getsetattr 185
190#define __NR_msgget 186
191#define __NR_msgctl 187
192#define __NR_msgrcv 188
193#define __NR_msgsnd 189
194#define __NR_semget 190
195#define __NR_semctl 191
196#define __NR_semtimedop 192
197#define __NR_semop 193
198#define __NR_shmget 194
199#define __NR_shmctl 195
200#define __NR_shmat 196
201#define __NR_shmdt 197
202#define __NR_socket 198
203#define __NR_socketpair 199
204#define __NR_bind 200
205#define __NR_listen 201
206#define __NR_accept 202
207#define __NR_connect 203
208#define __NR_getsockname 204
209#define __NR_getpeername 205
210#define __NR_sendto 206
211#define __NR_recvfrom 207
212#define __NR_setsockopt 208
213#define __NR_getsockopt 209
214#define __NR_shutdown 210
215#define __NR_sendmsg 211
216#define __NR_recvmsg 212
217#define __NR_readahead 213
218#define __NR_brk 214
219#define __NR_munmap 215
220#define __NR_mremap 216
221#define __NR_add_key 217
222#define __NR_request_key 218
223#define __NR_keyctl 219
224#define __NR_clone 220
225#define __NR_execve 221
226#define __NR_mmap2 222
227#define __NR_fadvise64_64 223
228#define __NR_swapon 224
229#define __NR_swapoff 225
230#define __NR_mprotect 226
231#define __NR_msync 227
232#define __NR_mlock 228
233#define __NR_munlock 229
234#define __NR_mlockall 230
235#define __NR_munlockall 231
236#define __NR_mincore 232
237#define __NR_madvise 233
238#define __NR_remap_file_pages 234
239#define __NR_mbind 235
240#define __NR_get_mempolicy 236
241#define __NR_set_mempolicy 237
242#define __NR_migrate_pages 238
243#define __NR_move_pages 239
244#define __NR_rt_tgsigqueueinfo 240
245#define __NR_perf_event_open 241
246#define __NR_accept4 242
247#define __NR_recvmmsg 243
248#define __NR_cacheflush 244
249#define __NR_arc_settls 245
250#define __NR_arc_gettls 246
251#define __NR_sysfs 247
252#define __NR_arc_usr_cmpxchg 248
253#define __NR_wait4 260
254#define __NR_prlimit64 261
255#define __NR_fanotify_init 262
256#define __NR_fanotify_mark 263
257#define __NR_name_to_handle_at 264
258#define __NR_open_by_handle_at 265
259#define __NR_clock_adjtime 266
260#define __NR_syncfs 267
261#define __NR_setns 268
262#define __NR_sendmmsg 269
263#define __NR_process_vm_readv 270
264#define __NR_process_vm_writev 271
265#define __NR_kcmp 272
266#define __NR_finit_module 273
267#define __NR_sched_setattr 274
268#define __NR_sched_getattr 275
269#define __NR_renameat2 276
270#define __NR_seccomp 277
271#define __NR_getrandom 278
272#define __NR_memfd_create 279
273#define __NR_bpf 280
274#define __NR_execveat 281
275#define __NR_userfaultfd 282
276#define __NR_membarrier 283
277#define __NR_mlock2 284
278#define __NR_copy_file_range 285
279#define __NR_preadv2 286
280#define __NR_pwritev2 287
281#define __NR_pkey_mprotect 288
282#define __NR_pkey_alloc 289
283#define __NR_pkey_free 290
284#define __NR_statx 291
285#define __NR_io_pgetevents 292
286#define __NR_rseq 293
287#define __NR_kexec_file_load 294
288#define __NR_clock_gettime64 403
289#define __NR_clock_settime64 404
290#define __NR_clock_adjtime64 405
291#define __NR_clock_getres_time64 406
292#define __NR_clock_nanosleep_time64 407
293#define __NR_timer_gettime64 408
294#define __NR_timer_settime64 409
295#define __NR_timerfd_gettime64 410
296#define __NR_timerfd_settime64 411
297#define __NR_utimensat_time64 412
298#define __NR_pselect6_time64 413
299#define __NR_ppoll_time64 414
300#define __NR_io_pgetevents_time64 416
301#define __NR_recvmmsg_time64 417
302#define __NR_mq_timedsend_time64 418
303#define __NR_mq_timedreceive_time64 419
304#define __NR_semtimedop_time64 420
305#define __NR_rt_sigtimedwait_time64 421
306#define __NR_futex_time64 422
307#define __NR_sched_rr_get_interval_time64 423
308#define __NR_pidfd_send_signal 424
309#define __NR_io_uring_setup 425
310#define __NR_io_uring_enter 426
311#define __NR_io_uring_register 427
312#define __NR_open_tree 428
313#define __NR_move_mount 429
314#define __NR_fsopen 430
315#define __NR_fsconfig 431
316#define __NR_fsmount 432
317#define __NR_fspick 433
318#define __NR_pidfd_open 434
319#define __NR_clone3 435
320#define __NR_close_range 436
321#define __NR_openat2 437
322#define __NR_pidfd_getfd 438
323#define __NR_faccessat2 439
324#define __NR_process_madvise 440
325#define __NR_epoll_pwait2 441
326#define __NR_mount_setattr 442
327#define __NR_quotactl_fd 443
328#define __NR_landlock_create_ruleset 444
329#define __NR_landlock_add_rule 445
330#define __NR_landlock_restrict_self 446
331#define __NR_process_mrelease 448
332#define __NR_futex_waitv 449
333#define __NR_set_mempolicy_home_node 450
334#define __NR_cachestat 451
335#define __NR_fchmodat2 452
336#define __NR_map_shadow_stack 453
337#define __NR_futex_wake 454
338#define __NR_futex_wait 455
339#define __NR_futex_requeue 456
340#define __NR_statmount 457
341#define __NR_listmount 458
342#define __NR_lsm_get_self_attr 459
343#define __NR_lsm_set_self_attr 460
344#define __NR_lsm_list_modules 461
345#define __NR_mseal 462
346#define __NR_setxattrat 463
347#define __NR_getxattrat 464
348#define __NR_listxattrat 465
349#define __NR_removexattrat 466
350
351
352#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+4
...@@ -416,5 +416,9 @@...@@ -416,5 +416,9 @@
416#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)416#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
417#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)417#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
418#define __NR_mseal (__NR_SYSCALL_BASE + 462)418#define __NR_mseal (__NR_SYSCALL_BASE + 462)
419#define __NR_setxattrat (__NR_SYSCALL_BASE + 463)
420#define __NR_getxattrat (__NR_SYSCALL_BASE + 464)
421#define __NR_listxattrat (__NR_SYSCALL_BASE + 465)
422#define __NR_removexattrat (__NR_SYSCALL_BASE + 466)
419423
420#endif /* _ASM_UNISTD_EABI_H */424#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h+4
...@@ -428,5 +428,9 @@...@@ -428,5 +428,9 @@
428#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)428#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
429#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)429#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
430#define __NR_mseal (__NR_SYSCALL_BASE + 462)430#define __NR_mseal (__NR_SYSCALL_BASE + 462)
431#define __NR_setxattrat (__NR_SYSCALL_BASE + 463)
432#define __NR_getxattrat (__NR_SYSCALL_BASE + 464)
433#define __NR_listxattrat (__NR_SYSCALL_BASE + 465)
434#define __NR_removexattrat (__NR_SYSCALL_BASE + 466)
431435
432#endif /* _ASM_UNISTD_OABI_H */436#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd.h+3-12
...@@ -1,15 +1,6 @@...@@ -1,15 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22
3#define __ARCH_WANT_STAT643#include <asm/unistd_32.h>
4#define __ARCH_WANT_NEW_STAT
5#define __ARCH_WANT_SYS_CLONE
6#define __ARCH_WANT_SYS_CLONE3
7#define __ARCH_WANT_SET_GET_RLIMIT
8#define __ARCH_WANT_TIME32_SYSCALLS
9#define __ARCH_WANT_SYNC_FILE_RANGE2
10#include <asm-generic/unistd.h>
114
12#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
13__SYSCALL(__NR_set_thread_area, sys_set_thread_area)
14#define __NR_cacheflush (__NR_arch_specific_syscall + 1)
15__SYSCALL(__NR_cacheflush, sys_cacheflush)
\ No newline at end of file
5#define __NR_sync_file_range2 84
6#undef __NR_sync_file_range
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd_32.h created+348
...@@ -0,0 +1,348 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl64 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_umount2 39
43#define __NR_mount 40
44#define __NR_pivot_root 41
45#define __NR_nfsservctl 42
46#define __NR_statfs64 43
47#define __NR_fstatfs64 44
48#define __NR_truncate64 45
49#define __NR_ftruncate64 46
50#define __NR_fallocate 47
51#define __NR_faccessat 48
52#define __NR_chdir 49
53#define __NR_fchdir 50
54#define __NR_chroot 51
55#define __NR_fchmod 52
56#define __NR_fchmodat 53
57#define __NR_fchownat 54
58#define __NR_fchown 55
59#define __NR_openat 56
60#define __NR_close 57
61#define __NR_vhangup 58
62#define __NR_pipe2 59
63#define __NR_quotactl 60
64#define __NR_getdents64 61
65#define __NR_llseek 62
66#define __NR_read 63
67#define __NR_write 64
68#define __NR_readv 65
69#define __NR_writev 66
70#define __NR_pread64 67
71#define __NR_pwrite64 68
72#define __NR_preadv 69
73#define __NR_pwritev 70
74#define __NR_sendfile64 71
75#define __NR_pselect6 72
76#define __NR_ppoll 73
77#define __NR_signalfd4 74
78#define __NR_vmsplice 75
79#define __NR_splice 76
80#define __NR_tee 77
81#define __NR_readlinkat 78
82#define __NR_fstatat64 79
83#define __NR_fstat64 80
84#define __NR_sync 81
85#define __NR_fsync 82
86#define __NR_fdatasync 83
87#define __NR_sync_file_range 84
88#define __NR_timerfd_create 85
89#define __NR_timerfd_settime 86
90#define __NR_timerfd_gettime 87
91#define __NR_utimensat 88
92#define __NR_acct 89
93#define __NR_capget 90
94#define __NR_capset 91
95#define __NR_personality 92
96#define __NR_exit 93
97#define __NR_exit_group 94
98#define __NR_waitid 95
99#define __NR_set_tid_address 96
100#define __NR_unshare 97
101#define __NR_futex 98
102#define __NR_set_robust_list 99
103#define __NR_get_robust_list 100
104#define __NR_nanosleep 101
105#define __NR_getitimer 102
106#define __NR_setitimer 103
107#define __NR_kexec_load 104
108#define __NR_init_module 105
109#define __NR_delete_module 106
110#define __NR_timer_create 107
111#define __NR_timer_gettime 108
112#define __NR_timer_getoverrun 109
113#define __NR_timer_settime 110
114#define __NR_timer_delete 111
115#define __NR_clock_settime 112
116#define __NR_clock_gettime 113
117#define __NR_clock_getres 114
118#define __NR_clock_nanosleep 115
119#define __NR_syslog 116
120#define __NR_ptrace 117
121#define __NR_sched_setparam 118
122#define __NR_sched_setscheduler 119
123#define __NR_sched_getscheduler 120
124#define __NR_sched_getparam 121
125#define __NR_sched_setaffinity 122
126#define __NR_sched_getaffinity 123
127#define __NR_sched_yield 124
128#define __NR_sched_get_priority_max 125
129#define __NR_sched_get_priority_min 126
130#define __NR_sched_rr_get_interval 127
131#define __NR_restart_syscall 128
132#define __NR_kill 129
133#define __NR_tkill 130
134#define __NR_tgkill 131
135#define __NR_sigaltstack 132
136#define __NR_rt_sigsuspend 133
137#define __NR_rt_sigaction 134
138#define __NR_rt_sigprocmask 135
139#define __NR_rt_sigpending 136
140#define __NR_rt_sigtimedwait 137
141#define __NR_rt_sigqueueinfo 138
142#define __NR_rt_sigreturn 139
143#define __NR_setpriority 140
144#define __NR_getpriority 141
145#define __NR_reboot 142
146#define __NR_setregid 143
147#define __NR_setgid 144
148#define __NR_setreuid 145
149#define __NR_setuid 146
150#define __NR_setresuid 147
151#define __NR_getresuid 148
152#define __NR_setresgid 149
153#define __NR_getresgid 150
154#define __NR_setfsuid 151
155#define __NR_setfsgid 152
156#define __NR_times 153
157#define __NR_setpgid 154
158#define __NR_getpgid 155
159#define __NR_getsid 156
160#define __NR_setsid 157
161#define __NR_getgroups 158
162#define __NR_setgroups 159
163#define __NR_uname 160
164#define __NR_sethostname 161
165#define __NR_setdomainname 162
166#define __NR_getrlimit 163
167#define __NR_setrlimit 164
168#define __NR_getrusage 165
169#define __NR_umask 166
170#define __NR_prctl 167
171#define __NR_getcpu 168
172#define __NR_gettimeofday 169
173#define __NR_settimeofday 170
174#define __NR_adjtimex 171
175#define __NR_getpid 172
176#define __NR_getppid 173
177#define __NR_getuid 174
178#define __NR_geteuid 175
179#define __NR_getgid 176
180#define __NR_getegid 177
181#define __NR_gettid 178
182#define __NR_sysinfo 179
183#define __NR_mq_open 180
184#define __NR_mq_unlink 181
185#define __NR_mq_timedsend 182
186#define __NR_mq_timedreceive 183
187#define __NR_mq_notify 184
188#define __NR_mq_getsetattr 185
189#define __NR_msgget 186
190#define __NR_msgctl 187
191#define __NR_msgrcv 188
192#define __NR_msgsnd 189
193#define __NR_semget 190
194#define __NR_semctl 191
195#define __NR_semtimedop 192
196#define __NR_semop 193
197#define __NR_shmget 194
198#define __NR_shmctl 195
199#define __NR_shmat 196
200#define __NR_shmdt 197
201#define __NR_socket 198
202#define __NR_socketpair 199
203#define __NR_bind 200
204#define __NR_listen 201
205#define __NR_accept 202
206#define __NR_connect 203
207#define __NR_getsockname 204
208#define __NR_getpeername 205
209#define __NR_sendto 206
210#define __NR_recvfrom 207
211#define __NR_setsockopt 208
212#define __NR_getsockopt 209
213#define __NR_shutdown 210
214#define __NR_sendmsg 211
215#define __NR_recvmsg 212
216#define __NR_readahead 213
217#define __NR_brk 214
218#define __NR_munmap 215
219#define __NR_mremap 216
220#define __NR_add_key 217
221#define __NR_request_key 218
222#define __NR_keyctl 219
223#define __NR_clone 220
224#define __NR_execve 221
225#define __NR_mmap2 222
226#define __NR_fadvise64_64 223
227#define __NR_swapon 224
228#define __NR_swapoff 225
229#define __NR_mprotect 226
230#define __NR_msync 227
231#define __NR_mlock 228
232#define __NR_munlock 229
233#define __NR_mlockall 230
234#define __NR_munlockall 231
235#define __NR_mincore 232
236#define __NR_madvise 233
237#define __NR_remap_file_pages 234
238#define __NR_mbind 235
239#define __NR_get_mempolicy 236
240#define __NR_set_mempolicy 237
241#define __NR_migrate_pages 238
242#define __NR_move_pages 239
243#define __NR_rt_tgsigqueueinfo 240
244#define __NR_perf_event_open 241
245#define __NR_accept4 242
246#define __NR_recvmmsg 243
247#define __NR_set_thread_area 244
248#define __NR_cacheflush 245
249#define __NR_wait4 260
250#define __NR_prlimit64 261
251#define __NR_fanotify_init 262
252#define __NR_fanotify_mark 263
253#define __NR_name_to_handle_at 264
254#define __NR_open_by_handle_at 265
255#define __NR_clock_adjtime 266
256#define __NR_syncfs 267
257#define __NR_setns 268
258#define __NR_sendmmsg 269
259#define __NR_process_vm_readv 270
260#define __NR_process_vm_writev 271
261#define __NR_kcmp 272
262#define __NR_finit_module 273
263#define __NR_sched_setattr 274
264#define __NR_sched_getattr 275
265#define __NR_renameat2 276
266#define __NR_seccomp 277
267#define __NR_getrandom 278
268#define __NR_memfd_create 279
269#define __NR_bpf 280
270#define __NR_execveat 281
271#define __NR_userfaultfd 282
272#define __NR_membarrier 283
273#define __NR_mlock2 284
274#define __NR_copy_file_range 285
275#define __NR_preadv2 286
276#define __NR_pwritev2 287
277#define __NR_pkey_mprotect 288
278#define __NR_pkey_alloc 289
279#define __NR_pkey_free 290
280#define __NR_statx 291
281#define __NR_io_pgetevents 292
282#define __NR_rseq 293
283#define __NR_kexec_file_load 294
284#define __NR_clock_gettime64 403
285#define __NR_clock_settime64 404
286#define __NR_clock_adjtime64 405
287#define __NR_clock_getres_time64 406
288#define __NR_clock_nanosleep_time64 407
289#define __NR_timer_gettime64 408
290#define __NR_timer_settime64 409
291#define __NR_timerfd_gettime64 410
292#define __NR_timerfd_settime64 411
293#define __NR_utimensat_time64 412
294#define __NR_pselect6_time64 413
295#define __NR_ppoll_time64 414
296#define __NR_io_pgetevents_time64 416
297#define __NR_recvmmsg_time64 417
298#define __NR_mq_timedsend_time64 418
299#define __NR_mq_timedreceive_time64 419
300#define __NR_semtimedop_time64 420
301#define __NR_rt_sigtimedwait_time64 421
302#define __NR_futex_time64 422
303#define __NR_sched_rr_get_interval_time64 423
304#define __NR_pidfd_send_signal 424
305#define __NR_io_uring_setup 425
306#define __NR_io_uring_enter 426
307#define __NR_io_uring_register 427
308#define __NR_open_tree 428
309#define __NR_move_mount 429
310#define __NR_fsopen 430
311#define __NR_fsconfig 431
312#define __NR_fsmount 432
313#define __NR_fspick 433
314#define __NR_pidfd_open 434
315#define __NR_clone3 435
316#define __NR_close_range 436
317#define __NR_openat2 437
318#define __NR_pidfd_getfd 438
319#define __NR_faccessat2 439
320#define __NR_process_madvise 440
321#define __NR_epoll_pwait2 441
322#define __NR_mount_setattr 442
323#define __NR_quotactl_fd 443
324#define __NR_landlock_create_ruleset 444
325#define __NR_landlock_add_rule 445
326#define __NR_landlock_restrict_self 446
327#define __NR_process_mrelease 448
328#define __NR_futex_waitv 449
329#define __NR_set_mempolicy_home_node 450
330#define __NR_cachestat 451
331#define __NR_fchmodat2 452
332#define __NR_map_shadow_stack 453
333#define __NR_futex_wake 454
334#define __NR_futex_wait 455
335#define __NR_futex_requeue 456
336#define __NR_statmount 457
337#define __NR_listmount 458
338#define __NR_lsm_get_self_attr 459
339#define __NR_lsm_set_self_attr 460
340#define __NR_lsm_list_modules 461
341#define __NR_mseal 462
342#define __NR_setxattrat 463
343#define __NR_getxattrat 464
344#define __NR_listxattrat 465
345#define __NR_removexattrat 466
346
347
348#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd.h+3-11
...@@ -27,15 +27,7 @@...@@ -27,15 +27,7 @@
27 * See also: syscalltab.c27 * See also: syscalltab.c
28 */28 */
2929
30#define sys_mmap2 sys_mmap_pgoff30#include <asm/unistd_32.h>
31#define __ARCH_WANT_RENAMEAT
32#define __ARCH_WANT_STAT64
33#define __ARCH_WANT_SET_GET_RLIMIT
34#define __ARCH_WANT_SYS_EXECVE
35#define __ARCH_WANT_SYS_CLONE
36#define __ARCH_WANT_SYS_VFORK
37#define __ARCH_WANT_SYS_FORK
38#define __ARCH_WANT_TIME32_SYSCALLS
39#define __ARCH_WANT_SYNC_FILE_RANGE2
4031
41#include <asm-generic/unistd.h>
\ No newline at end of file
32#define __NR_sync_file_range2 84
33#undef __NR_sync_file_range
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd_32.h created+347
...@@ -0,0 +1,347 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl64 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_renameat 38
43#define __NR_umount2 39
44#define __NR_mount 40
45#define __NR_pivot_root 41
46#define __NR_nfsservctl 42
47#define __NR_statfs64 43
48#define __NR_fstatfs64 44
49#define __NR_truncate64 45
50#define __NR_ftruncate64 46
51#define __NR_fallocate 47
52#define __NR_faccessat 48
53#define __NR_chdir 49
54#define __NR_fchdir 50
55#define __NR_chroot 51
56#define __NR_fchmod 52
57#define __NR_fchmodat 53
58#define __NR_fchownat 54
59#define __NR_fchown 55
60#define __NR_openat 56
61#define __NR_close 57
62#define __NR_vhangup 58
63#define __NR_pipe2 59
64#define __NR_quotactl 60
65#define __NR_getdents64 61
66#define __NR_llseek 62
67#define __NR_read 63
68#define __NR_write 64
69#define __NR_readv 65
70#define __NR_writev 66
71#define __NR_pread64 67
72#define __NR_pwrite64 68
73#define __NR_preadv 69
74#define __NR_pwritev 70
75#define __NR_sendfile64 71
76#define __NR_pselect6 72
77#define __NR_ppoll 73
78#define __NR_signalfd4 74
79#define __NR_vmsplice 75
80#define __NR_splice 76
81#define __NR_tee 77
82#define __NR_readlinkat 78
83#define __NR_fstatat64 79
84#define __NR_fstat64 80
85#define __NR_sync 81
86#define __NR_fsync 82
87#define __NR_fdatasync 83
88#define __NR_sync_file_range 84
89#define __NR_timerfd_create 85
90#define __NR_timerfd_settime 86
91#define __NR_timerfd_gettime 87
92#define __NR_utimensat 88
93#define __NR_acct 89
94#define __NR_capget 90
95#define __NR_capset 91
96#define __NR_personality 92
97#define __NR_exit 93
98#define __NR_exit_group 94
99#define __NR_waitid 95
100#define __NR_set_tid_address 96
101#define __NR_unshare 97
102#define __NR_futex 98
103#define __NR_set_robust_list 99
104#define __NR_get_robust_list 100
105#define __NR_nanosleep 101
106#define __NR_getitimer 102
107#define __NR_setitimer 103
108#define __NR_kexec_load 104
109#define __NR_init_module 105
110#define __NR_delete_module 106
111#define __NR_timer_create 107
112#define __NR_timer_gettime 108
113#define __NR_timer_getoverrun 109
114#define __NR_timer_settime 110
115#define __NR_timer_delete 111
116#define __NR_clock_settime 112
117#define __NR_clock_gettime 113
118#define __NR_clock_getres 114
119#define __NR_clock_nanosleep 115
120#define __NR_syslog 116
121#define __NR_ptrace 117
122#define __NR_sched_setparam 118
123#define __NR_sched_setscheduler 119
124#define __NR_sched_getscheduler 120
125#define __NR_sched_getparam 121
126#define __NR_sched_setaffinity 122
127#define __NR_sched_getaffinity 123
128#define __NR_sched_yield 124
129#define __NR_sched_get_priority_max 125
130#define __NR_sched_get_priority_min 126
131#define __NR_sched_rr_get_interval 127
132#define __NR_restart_syscall 128
133#define __NR_kill 129
134#define __NR_tkill 130
135#define __NR_tgkill 131
136#define __NR_sigaltstack 132
137#define __NR_rt_sigsuspend 133
138#define __NR_rt_sigaction 134
139#define __NR_rt_sigprocmask 135
140#define __NR_rt_sigpending 136
141#define __NR_rt_sigtimedwait 137
142#define __NR_rt_sigqueueinfo 138
143#define __NR_rt_sigreturn 139
144#define __NR_setpriority 140
145#define __NR_getpriority 141
146#define __NR_reboot 142
147#define __NR_setregid 143
148#define __NR_setgid 144
149#define __NR_setreuid 145
150#define __NR_setuid 146
151#define __NR_setresuid 147
152#define __NR_getresuid 148
153#define __NR_setresgid 149
154#define __NR_getresgid 150
155#define __NR_setfsuid 151
156#define __NR_setfsgid 152
157#define __NR_times 153
158#define __NR_setpgid 154
159#define __NR_getpgid 155
160#define __NR_getsid 156
161#define __NR_setsid 157
162#define __NR_getgroups 158
163#define __NR_setgroups 159
164#define __NR_uname 160
165#define __NR_sethostname 161
166#define __NR_setdomainname 162
167#define __NR_getrlimit 163
168#define __NR_setrlimit 164
169#define __NR_getrusage 165
170#define __NR_umask 166
171#define __NR_prctl 167
172#define __NR_getcpu 168
173#define __NR_gettimeofday 169
174#define __NR_settimeofday 170
175#define __NR_adjtimex 171
176#define __NR_getpid 172
177#define __NR_getppid 173
178#define __NR_getuid 174
179#define __NR_geteuid 175
180#define __NR_getgid 176
181#define __NR_getegid 177
182#define __NR_gettid 178
183#define __NR_sysinfo 179
184#define __NR_mq_open 180
185#define __NR_mq_unlink 181
186#define __NR_mq_timedsend 182
187#define __NR_mq_timedreceive 183
188#define __NR_mq_notify 184
189#define __NR_mq_getsetattr 185
190#define __NR_msgget 186
191#define __NR_msgctl 187
192#define __NR_msgrcv 188
193#define __NR_msgsnd 189
194#define __NR_semget 190
195#define __NR_semctl 191
196#define __NR_semtimedop 192
197#define __NR_semop 193
198#define __NR_shmget 194
199#define __NR_shmctl 195
200#define __NR_shmat 196
201#define __NR_shmdt 197
202#define __NR_socket 198
203#define __NR_socketpair 199
204#define __NR_bind 200
205#define __NR_listen 201
206#define __NR_accept 202
207#define __NR_connect 203
208#define __NR_getsockname 204
209#define __NR_getpeername 205
210#define __NR_sendto 206
211#define __NR_recvfrom 207
212#define __NR_setsockopt 208
213#define __NR_getsockopt 209
214#define __NR_shutdown 210
215#define __NR_sendmsg 211
216#define __NR_recvmsg 212
217#define __NR_readahead 213
218#define __NR_brk 214
219#define __NR_munmap 215
220#define __NR_mremap 216
221#define __NR_add_key 217
222#define __NR_request_key 218
223#define __NR_keyctl 219
224#define __NR_clone 220
225#define __NR_execve 221
226#define __NR_mmap2 222
227#define __NR_fadvise64_64 223
228#define __NR_swapon 224
229#define __NR_swapoff 225
230#define __NR_mprotect 226
231#define __NR_msync 227
232#define __NR_mlock 228
233#define __NR_munlock 229
234#define __NR_mlockall 230
235#define __NR_munlockall 231
236#define __NR_mincore 232
237#define __NR_madvise 233
238#define __NR_remap_file_pages 234
239#define __NR_mbind 235
240#define __NR_get_mempolicy 236
241#define __NR_set_mempolicy 237
242#define __NR_migrate_pages 238
243#define __NR_move_pages 239
244#define __NR_rt_tgsigqueueinfo 240
245#define __NR_perf_event_open 241
246#define __NR_accept4 242
247#define __NR_recvmmsg 243
248#define __NR_wait4 260
249#define __NR_prlimit64 261
250#define __NR_fanotify_init 262
251#define __NR_fanotify_mark 263
252#define __NR_name_to_handle_at 264
253#define __NR_open_by_handle_at 265
254#define __NR_clock_adjtime 266
255#define __NR_syncfs 267
256#define __NR_setns 268
257#define __NR_sendmmsg 269
258#define __NR_process_vm_readv 270
259#define __NR_process_vm_writev 271
260#define __NR_kcmp 272
261#define __NR_finit_module 273
262#define __NR_sched_setattr 274
263#define __NR_sched_getattr 275
264#define __NR_renameat2 276
265#define __NR_seccomp 277
266#define __NR_getrandom 278
267#define __NR_memfd_create 279
268#define __NR_bpf 280
269#define __NR_execveat 281
270#define __NR_userfaultfd 282
271#define __NR_membarrier 283
272#define __NR_mlock2 284
273#define __NR_copy_file_range 285
274#define __NR_preadv2 286
275#define __NR_pwritev2 287
276#define __NR_pkey_mprotect 288
277#define __NR_pkey_alloc 289
278#define __NR_pkey_free 290
279#define __NR_statx 291
280#define __NR_io_pgetevents 292
281#define __NR_rseq 293
282#define __NR_kexec_file_load 294
283#define __NR_clock_gettime64 403
284#define __NR_clock_settime64 404
285#define __NR_clock_adjtime64 405
286#define __NR_clock_getres_time64 406
287#define __NR_clock_nanosleep_time64 407
288#define __NR_timer_gettime64 408
289#define __NR_timer_settime64 409
290#define __NR_timerfd_gettime64 410
291#define __NR_timerfd_settime64 411
292#define __NR_utimensat_time64 412
293#define __NR_pselect6_time64 413
294#define __NR_ppoll_time64 414
295#define __NR_io_pgetevents_time64 416
296#define __NR_recvmmsg_time64 417
297#define __NR_mq_timedsend_time64 418
298#define __NR_mq_timedreceive_time64 419
299#define __NR_semtimedop_time64 420
300#define __NR_rt_sigtimedwait_time64 421
301#define __NR_futex_time64 422
302#define __NR_sched_rr_get_interval_time64 423
303#define __NR_pidfd_send_signal 424
304#define __NR_io_uring_setup 425
305#define __NR_io_uring_enter 426
306#define __NR_io_uring_register 427
307#define __NR_open_tree 428
308#define __NR_move_mount 429
309#define __NR_fsopen 430
310#define __NR_fsconfig 431
311#define __NR_fsmount 432
312#define __NR_fspick 433
313#define __NR_pidfd_open 434
314#define __NR_clone3 435
315#define __NR_close_range 436
316#define __NR_openat2 437
317#define __NR_pidfd_getfd 438
318#define __NR_faccessat2 439
319#define __NR_process_madvise 440
320#define __NR_epoll_pwait2 441
321#define __NR_mount_setattr 442
322#define __NR_quotactl_fd 443
323#define __NR_landlock_create_ruleset 444
324#define __NR_landlock_add_rule 445
325#define __NR_landlock_restrict_self 446
326#define __NR_process_mrelease 448
327#define __NR_futex_waitv 449
328#define __NR_set_mempolicy_home_node 450
329#define __NR_cachestat 451
330#define __NR_fchmodat2 452
331#define __NR_map_shadow_stack 453
332#define __NR_futex_wake 454
333#define __NR_futex_wait 455
334#define __NR_futex_requeue 456
335#define __NR_statmount 457
336#define __NR_listmount 458
337#define __NR_lsm_get_self_attr 459
338#define __NR_lsm_set_self_attr 460
339#define __NR_lsm_list_modules 461
340#define __NR_mseal 462
341#define __NR_setxattrat 463
342#define __NR_getxattrat 464
343#define __NR_listxattrat 465
344#define __NR_removexattrat 466
345
346
347#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/hwcap.h+1
...@@ -17,5 +17,6 @@...@@ -17,5 +17,6 @@
17#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)17#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
18#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)18#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
19#define HWCAP_LOONGARCH_PTW (1 << 13)19#define HWCAP_LOONGARCH_PTW (1 << 13)
20#define HWCAP_LOONGARCH_LSPW (1 << 14)
2021
21#endif /* _ASM_HWCAP_H */22#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/kvm.h+44
...@@ -8,6 +8,8 @@...@@ -8,6 +8,8 @@
88
9#include <linux/types.h>9#include <linux/types.h>
1010
11#define __KVM_HAVE_IRQ_LINE
12
11/*13/*
12 * KVM LoongArch specific structures and definitions.14 * KVM LoongArch specific structures and definitions.
13 *15 *
...@@ -64,6 +66,7 @@ struct kvm_fpu {...@@ -64,6 +66,7 @@ struct kvm_fpu {
64#define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL)66#define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL)
65#define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL)67#define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL)
66#define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL)68#define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL)
69#define KVM_REG_LOONGARCH_LBT (KVM_REG_LOONGARCH | 0x50000ULL)
67#define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL)70#define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL)
68#define KVM_CSR_IDX_MASK 0x7fff71#define KVM_CSR_IDX_MASK 0x7fff
69#define KVM_CPUCFG_IDX_MASK 0x7fff72#define KVM_CPUCFG_IDX_MASK 0x7fff
...@@ -77,11 +80,34 @@ struct kvm_fpu {...@@ -77,11 +80,34 @@ struct kvm_fpu {
77/* Debugging: Special instruction for software breakpoint */80/* Debugging: Special instruction for software breakpoint */
78#define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3)81#define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3)
7982
83/* LBT registers */
84#define KVM_REG_LOONGARCH_LBT_SCR0 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 1)
85#define KVM_REG_LOONGARCH_LBT_SCR1 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 2)
86#define KVM_REG_LOONGARCH_LBT_SCR2 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 3)
87#define KVM_REG_LOONGARCH_LBT_SCR3 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 4)
88#define KVM_REG_LOONGARCH_LBT_EFLAGS (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 5)
89#define KVM_REG_LOONGARCH_LBT_FTOP (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 6)
90
80#define LOONGARCH_REG_SHIFT 391#define LOONGARCH_REG_SHIFT 3
81#define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT))92#define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT))
82#define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG)93#define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG)
83#define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG)94#define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG)
95
96/* Device Control API on vm fd */
97#define KVM_LOONGARCH_VM_FEAT_CTRL 0
98#define KVM_LOONGARCH_VM_FEAT_LSX 0
99#define KVM_LOONGARCH_VM_FEAT_LASX 1
100#define KVM_LOONGARCH_VM_FEAT_X86BT 2
101#define KVM_LOONGARCH_VM_FEAT_ARMBT 3
102#define KVM_LOONGARCH_VM_FEAT_MIPSBT 4
103#define KVM_LOONGARCH_VM_FEAT_PMU 5
104#define KVM_LOONGARCH_VM_FEAT_PV_IPI 6
105#define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7
106
107/* Device Control API on vcpu fd */
84#define KVM_LOONGARCH_VCPU_CPUCFG 0108#define KVM_LOONGARCH_VCPU_CPUCFG 0
109#define KVM_LOONGARCH_VCPU_PVTIME_CTRL 1
110#define KVM_LOONGARCH_VCPU_PVTIME_GPA 0
85111
86struct kvm_debug_exit_arch {112struct kvm_debug_exit_arch {
87};113};
...@@ -108,4 +134,22 @@ struct kvm_iocsr_entry {...@@ -108,4 +134,22 @@ struct kvm_iocsr_entry {
108#define KVM_IRQCHIP_NUM_PINS 64134#define KVM_IRQCHIP_NUM_PINS 64
109#define KVM_MAX_CORES 256135#define KVM_MAX_CORES 256
110136
137#define KVM_DEV_LOONGARCH_IPI_GRP_REGS 0x40000001
138
139#define KVM_DEV_LOONGARCH_EXTIOI_GRP_REGS 0x40000002
140
141#define KVM_DEV_LOONGARCH_EXTIOI_GRP_SW_STATUS 0x40000003
142#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_NUM_CPU 0x0
143#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_FEATURE 0x1
144#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_STATE 0x2
145
146#define KVM_DEV_LOONGARCH_EXTIOI_GRP_CTRL 0x40000004
147#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_NUM_CPU 0x0
148#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_FEATURE 0x1
149#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_LOAD_FINISHED 0x3
150
151#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_REGS 0x40000005
152#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_CTRL 0x40000006
153#define KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT 0
154
111#endif /* __UAPI_ASM_LOONGARCH_KVM_H */155#endif /* __UAPI_ASM_LOONGARCH_KVM_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/kvm_para.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_KVM_PARA_H
3#define _ASM_KVM_PARA_H
4
5#include <linux/types.h>
6
7/*
8 * CPUCFG index area: 0x40000000 -- 0x400000ff
9 * SW emulation for KVM hypervirsor
10 */
11#define CPUCFG_KVM_BASE 0x40000000
12#define CPUCFG_KVM_SIZE 0x100
13#define CPUCFG_KVM_SIG (CPUCFG_KVM_BASE + 0)
14#define KVM_SIGNATURE "KVM\0"
15#define CPUCFG_KVM_FEATURE (CPUCFG_KVM_BASE + 4)
16#define KVM_FEATURE_IPI 1
17#define KVM_FEATURE_STEAL_TIME 2
18/* BIT 24 - 31 are features configurable by user space vmm */
19#define KVM_FEATURE_VIRT_EXTIOI 24
20
21#endif /* _ASM_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/ptrace.h+10
...@@ -70,6 +70,16 @@ struct user_watch_state {...@@ -70,6 +70,16 @@ struct user_watch_state {
70 } dbg_regs[8];70 } dbg_regs[8];
71};71};
7272
73struct user_watch_state_v2 {
74 uint64_t dbg_info;
75 struct {
76 uint64_t addr;
77 uint64_t mask;
78 uint32_t ctrl;
79 uint32_t pad;
80 } dbg_regs[14];
81};
82
73#define PTRACE_SYSEMU 0x1f83#define PTRACE_SYSEMU 0x1f
74#define PTRACE_SYSEMU_SINGLESTEP 0x2084#define PTRACE_SYSEMU_SINGLESTEP 0x20
7585
lib/libc/include/loongarch-linux-any/asm/sigcontext.h-1
...@@ -9,7 +9,6 @@...@@ -9,7 +9,6 @@
9#define _ASM_SIGCONTEXT_H9#define _ASM_SIGCONTEXT_H
1010
11#include <linux/types.h>11#include <linux/types.h>
12#include <linux/posix_types.h>
1312
14/* FP context was used */13/* FP context was used */
15#define SC_USED_FP (1 << 0)14#define SC_USED_FP (1 << 0)
lib/libc/include/loongarch-linux-any/asm/unistd.h+1-3
...@@ -1,5 +1,3 @@...@@ -1,5 +1,3 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#define __ARCH_WANT_SYS_CLONE
3#define __ARCH_WANT_SYS_CLONE3
42
5#include <asm-generic/unistd.h>
\ No newline at end of file
3#include <asm/unistd_64.h>
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/unistd_64.h created+324
...@@ -0,0 +1,324 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_umount2 39
43#define __NR_mount 40
44#define __NR_pivot_root 41
45#define __NR_nfsservctl 42
46#define __NR_statfs 43
47#define __NR_fstatfs 44
48#define __NR_truncate 45
49#define __NR_ftruncate 46
50#define __NR_fallocate 47
51#define __NR_faccessat 48
52#define __NR_chdir 49
53#define __NR_fchdir 50
54#define __NR_chroot 51
55#define __NR_fchmod 52
56#define __NR_fchmodat 53
57#define __NR_fchownat 54
58#define __NR_fchown 55
59#define __NR_openat 56
60#define __NR_close 57
61#define __NR_vhangup 58
62#define __NR_pipe2 59
63#define __NR_quotactl 60
64#define __NR_getdents64 61
65#define __NR_lseek 62
66#define __NR_read 63
67#define __NR_write 64
68#define __NR_readv 65
69#define __NR_writev 66
70#define __NR_pread64 67
71#define __NR_pwrite64 68
72#define __NR_preadv 69
73#define __NR_pwritev 70
74#define __NR_sendfile 71
75#define __NR_pselect6 72
76#define __NR_ppoll 73
77#define __NR_signalfd4 74
78#define __NR_vmsplice 75
79#define __NR_splice 76
80#define __NR_tee 77
81#define __NR_readlinkat 78
82#define __NR_newfstatat 79
83#define __NR_fstat 80
84#define __NR_sync 81
85#define __NR_fsync 82
86#define __NR_fdatasync 83
87#define __NR_sync_file_range 84
88#define __NR_timerfd_create 85
89#define __NR_timerfd_settime 86
90#define __NR_timerfd_gettime 87
91#define __NR_utimensat 88
92#define __NR_acct 89
93#define __NR_capget 90
94#define __NR_capset 91
95#define __NR_personality 92
96#define __NR_exit 93
97#define __NR_exit_group 94
98#define __NR_waitid 95
99#define __NR_set_tid_address 96
100#define __NR_unshare 97
101#define __NR_futex 98
102#define __NR_set_robust_list 99
103#define __NR_get_robust_list 100
104#define __NR_nanosleep 101
105#define __NR_getitimer 102
106#define __NR_setitimer 103
107#define __NR_kexec_load 104
108#define __NR_init_module 105
109#define __NR_delete_module 106
110#define __NR_timer_create 107
111#define __NR_timer_gettime 108
112#define __NR_timer_getoverrun 109
113#define __NR_timer_settime 110
114#define __NR_timer_delete 111
115#define __NR_clock_settime 112
116#define __NR_clock_gettime 113
117#define __NR_clock_getres 114
118#define __NR_clock_nanosleep 115
119#define __NR_syslog 116
120#define __NR_ptrace 117
121#define __NR_sched_setparam 118
122#define __NR_sched_setscheduler 119
123#define __NR_sched_getscheduler 120
124#define __NR_sched_getparam 121
125#define __NR_sched_setaffinity 122
126#define __NR_sched_getaffinity 123
127#define __NR_sched_yield 124
128#define __NR_sched_get_priority_max 125
129#define __NR_sched_get_priority_min 126
130#define __NR_sched_rr_get_interval 127
131#define __NR_restart_syscall 128
132#define __NR_kill 129
133#define __NR_tkill 130
134#define __NR_tgkill 131
135#define __NR_sigaltstack 132
136#define __NR_rt_sigsuspend 133
137#define __NR_rt_sigaction 134
138#define __NR_rt_sigprocmask 135
139#define __NR_rt_sigpending 136
140#define __NR_rt_sigtimedwait 137
141#define __NR_rt_sigqueueinfo 138
142#define __NR_rt_sigreturn 139
143#define __NR_setpriority 140
144#define __NR_getpriority 141
145#define __NR_reboot 142
146#define __NR_setregid 143
147#define __NR_setgid 144
148#define __NR_setreuid 145
149#define __NR_setuid 146
150#define __NR_setresuid 147
151#define __NR_getresuid 148
152#define __NR_setresgid 149
153#define __NR_getresgid 150
154#define __NR_setfsuid 151
155#define __NR_setfsgid 152
156#define __NR_times 153
157#define __NR_setpgid 154
158#define __NR_getpgid 155
159#define __NR_getsid 156
160#define __NR_setsid 157
161#define __NR_getgroups 158
162#define __NR_setgroups 159
163#define __NR_uname 160
164#define __NR_sethostname 161
165#define __NR_setdomainname 162
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_wait4 260
246#define __NR_prlimit64 261
247#define __NR_fanotify_init 262
248#define __NR_fanotify_mark 263
249#define __NR_name_to_handle_at 264
250#define __NR_open_by_handle_at 265
251#define __NR_clock_adjtime 266
252#define __NR_syncfs 267
253#define __NR_setns 268
254#define __NR_sendmmsg 269
255#define __NR_process_vm_readv 270
256#define __NR_process_vm_writev 271
257#define __NR_kcmp 272
258#define __NR_finit_module 273
259#define __NR_sched_setattr 274
260#define __NR_sched_getattr 275
261#define __NR_renameat2 276
262#define __NR_seccomp 277
263#define __NR_getrandom 278
264#define __NR_memfd_create 279
265#define __NR_bpf 280
266#define __NR_execveat 281
267#define __NR_userfaultfd 282
268#define __NR_membarrier 283
269#define __NR_mlock2 284
270#define __NR_copy_file_range 285
271#define __NR_preadv2 286
272#define __NR_pwritev2 287
273#define __NR_pkey_mprotect 288
274#define __NR_pkey_alloc 289
275#define __NR_pkey_free 290
276#define __NR_statx 291
277#define __NR_io_pgetevents 292
278#define __NR_rseq 293
279#define __NR_kexec_file_load 294
280#define __NR_pidfd_send_signal 424
281#define __NR_io_uring_setup 425
282#define __NR_io_uring_enter 426
283#define __NR_io_uring_register 427
284#define __NR_open_tree 428
285#define __NR_move_mount 429
286#define __NR_fsopen 430
287#define __NR_fsconfig 431
288#define __NR_fsmount 432
289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
292#define __NR_close_range 436
293#define __NR_openat2 437
294#define __NR_pidfd_getfd 438
295#define __NR_faccessat2 439
296#define __NR_process_madvise 440
297#define __NR_epoll_pwait2 441
298#define __NR_mount_setattr 442
299#define __NR_quotactl_fd 443
300#define __NR_landlock_create_ruleset 444
301#define __NR_landlock_add_rule 445
302#define __NR_landlock_restrict_self 446
303#define __NR_process_mrelease 448
304#define __NR_futex_waitv 449
305#define __NR_set_mempolicy_home_node 450
306#define __NR_cachestat 451
307#define __NR_fchmodat2 452
308#define __NR_map_shadow_stack 453
309#define __NR_futex_wake 454
310#define __NR_futex_wait 455
311#define __NR_futex_requeue 456
312#define __NR_statmount 457
313#define __NR_listmount 458
314#define __NR_lsm_get_self_attr 459
315#define __NR_lsm_set_self_attr 460
316#define __NR_lsm_list_modules 461
317#define __NR_mseal 462
318#define __NR_setxattrat 463
319#define __NR_getxattrat 464
320#define __NR_listxattrat 465
321#define __NR_removexattrat 466
322
323
324#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd_32.h+4
...@@ -435,6 +435,10 @@...@@ -435,6 +435,10 @@
435#define __NR_lsm_set_self_attr 460435#define __NR_lsm_set_self_attr 460
436#define __NR_lsm_list_modules 461436#define __NR_lsm_list_modules 461
437#define __NR_mseal 462437#define __NR_mseal 462
438#define __NR_setxattrat 463
439#define __NR_getxattrat 464
440#define __NR_listxattrat 465
441#define __NR_removexattrat 466
438442
439443
440#endif /* _ASM_UNISTD_32_H */444#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/mman.h+3
...@@ -105,6 +105,9 @@...@@ -105,6 +105,9 @@
105105
106#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */106#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
107107
108#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */
109#define MADV_GUARD_REMOVE 103 /* unguard range */
110
108/* compatibility flags */111/* compatibility flags */
109#define MAP_FILE 0112#define MAP_FILE 0
110113
lib/libc/include/mips-linux-any/asm/sigcontext.h-1
...@@ -56,7 +56,6 @@ struct sigcontext {...@@ -56,7 +56,6 @@ struct sigcontext {
5656
57#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI3257#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
5858
59#include <linux/posix_types.h>
60/*59/*
61 * Keep this struct definition in sync with the sigcontext fragment60 * Keep this struct definition in sync with the sigcontext fragment
62 * in arch/mips/kernel/asm-offsets.c61 * in arch/mips/kernel/asm-offsets.c
lib/libc/include/mips-linux-any/asm/socket.h+8
...@@ -151,6 +151,14 @@...@@ -151,6 +151,14 @@
151#define SO_PASSPIDFD 76151#define SO_PASSPIDFD 76
152#define SO_PEERPIDFD 77152#define SO_PEERPIDFD 77
153153
154#define SO_DEVMEM_LINEAR 78
155#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
156#define SO_DEVMEM_DMABUF 79
157#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
158#define SO_DEVMEM_DONTNEED 80
159
160#define SCM_TS_OPT_ID 81
161
154162
155#if __BITS_PER_LONG == 64163#if __BITS_PER_LONG == 64
156#define SO_TIMESTAMP SO_TIMESTAMP_OLD164#define SO_TIMESTAMP SO_TIMESTAMP_OLD
lib/libc/include/mips-linux-any/asm/unistd_n32.h+4
...@@ -391,5 +391,9 @@...@@ -391,5 +391,9 @@
391#define __NR_lsm_set_self_attr (__NR_Linux + 460)391#define __NR_lsm_set_self_attr (__NR_Linux + 460)
392#define __NR_lsm_list_modules (__NR_Linux + 461)392#define __NR_lsm_list_modules (__NR_Linux + 461)
393#define __NR_mseal (__NR_Linux + 462)393#define __NR_mseal (__NR_Linux + 462)
394#define __NR_setxattrat (__NR_Linux + 463)
395#define __NR_getxattrat (__NR_Linux + 464)
396#define __NR_listxattrat (__NR_Linux + 465)
397#define __NR_removexattrat (__NR_Linux + 466)
394398
395#endif /* _ASM_UNISTD_N32_H */399#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h+4
...@@ -367,5 +367,9 @@...@@ -367,5 +367,9 @@
367#define __NR_lsm_set_self_attr (__NR_Linux + 460)367#define __NR_lsm_set_self_attr (__NR_Linux + 460)
368#define __NR_lsm_list_modules (__NR_Linux + 461)368#define __NR_lsm_list_modules (__NR_Linux + 461)
369#define __NR_mseal (__NR_Linux + 462)369#define __NR_mseal (__NR_Linux + 462)
370#define __NR_setxattrat (__NR_Linux + 463)
371#define __NR_getxattrat (__NR_Linux + 464)
372#define __NR_listxattrat (__NR_Linux + 465)
373#define __NR_removexattrat (__NR_Linux + 466)
370374
371#endif /* _ASM_UNISTD_N64_H */375#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h+4
...@@ -437,5 +437,9 @@...@@ -437,5 +437,9 @@
437#define __NR_lsm_set_self_attr (__NR_Linux + 460)437#define __NR_lsm_set_self_attr (__NR_Linux + 460)
438#define __NR_lsm_list_modules (__NR_Linux + 461)438#define __NR_lsm_list_modules (__NR_Linux + 461)
439#define __NR_mseal (__NR_Linux + 462)439#define __NR_mseal (__NR_Linux + 462)
440#define __NR_setxattrat (__NR_Linux + 463)
441#define __NR_getxattrat (__NR_Linux + 464)
442#define __NR_listxattrat (__NR_Linux + 465)
443#define __NR_removexattrat (__NR_Linux + 466)
440444
441#endif /* _ASM_UNISTD_O32_H */445#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/kvm.h+3
...@@ -645,6 +645,9 @@ struct kvm_ppc_cpu_char {...@@ -645,6 +645,9 @@ struct kvm_ppc_cpu_char {
645#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)645#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)
646#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)646#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)
647#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)647#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)
648#define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6)
649#define KVM_REG_PPC_HASHKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc7)
650#define KVM_REG_PPC_HASHPKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc8)
648651
649/* Transactional Memory checkpointed state:652/* Transactional Memory checkpointed state:
650 * This is all GPRs, all VSX regs and a subset of SPRs653 * This is all GPRs, all VSX regs and a subset of SPRs
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+4
...@@ -444,6 +444,10 @@...@@ -444,6 +444,10 @@
444#define __NR_lsm_set_self_attr 460444#define __NR_lsm_set_self_attr 460
445#define __NR_lsm_list_modules 461445#define __NR_lsm_list_modules 461
446#define __NR_mseal 462446#define __NR_mseal 462
447#define __NR_setxattrat 463
448#define __NR_getxattrat 464
449#define __NR_listxattrat 465
450#define __NR_removexattrat 466
447451
448452
449#endif /* _ASM_UNISTD_32_H */453#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h+4
...@@ -416,6 +416,10 @@...@@ -416,6 +416,10 @@
416#define __NR_lsm_set_self_attr 460416#define __NR_lsm_set_self_attr 460
417#define __NR_lsm_list_modules 461417#define __NR_lsm_list_modules 461
418#define __NR_mseal 462418#define __NR_mseal 462
419#define __NR_setxattrat 463
420#define __NR_getxattrat 464
421#define __NR_listxattrat 465
422#define __NR_removexattrat 466
419423
420424
421#endif /* _ASM_UNISTD_64_H */425#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwprobe.h+26
...@@ -60,6 +60,19 @@ struct riscv_hwprobe {...@@ -60,6 +60,19 @@ struct riscv_hwprobe {
60#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)60#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
61#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)61#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
62#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)62#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
63#define RISCV_HWPROBE_EXT_ZVE32X (1ULL << 37)
64#define RISCV_HWPROBE_EXT_ZVE32F (1ULL << 38)
65#define RISCV_HWPROBE_EXT_ZVE64X (1ULL << 39)
66#define RISCV_HWPROBE_EXT_ZVE64F (1ULL << 40)
67#define RISCV_HWPROBE_EXT_ZVE64D (1ULL << 41)
68#define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 42)
69#define RISCV_HWPROBE_EXT_ZCA (1ULL << 43)
70#define RISCV_HWPROBE_EXT_ZCB (1ULL << 44)
71#define RISCV_HWPROBE_EXT_ZCD (1ULL << 45)
72#define RISCV_HWPROBE_EXT_ZCF (1ULL << 46)
73#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47)
74#define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48)
75#define RISCV_HWPROBE_EXT_SUPM (1ULL << 49)
63#define RISCV_HWPROBE_KEY_CPUPERF_0 576#define RISCV_HWPROBE_KEY_CPUPERF_0 5
64#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)77#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
65#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)78#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
...@@ -68,6 +81,19 @@ struct riscv_hwprobe {...@@ -68,6 +81,19 @@ struct riscv_hwprobe {
68#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)81#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
69#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)82#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)
70#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 683#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
84#define RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS 7
85#define RISCV_HWPROBE_KEY_TIME_CSR_FREQ 8
86#define RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF 9
87#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN 0
88#define RISCV_HWPROBE_MISALIGNED_SCALAR_EMULATED 1
89#define RISCV_HWPROBE_MISALIGNED_SCALAR_SLOW 2
90#define RISCV_HWPROBE_MISALIGNED_SCALAR_FAST 3
91#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED 4
92#define RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF 10
93#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN 0
94#define RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW 2
95#define RISCV_HWPROBE_MISALIGNED_VECTOR_FAST 3
96#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED 4
71/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */97/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
7298
73/* Flags */99/* Flags */
lib/libc/include/riscv-linux-any/asm/kvm.h+11
...@@ -168,6 +168,17 @@ enum KVM_RISCV_ISA_EXT_ID {...@@ -168,6 +168,17 @@ enum KVM_RISCV_ISA_EXT_ID {
168 KVM_RISCV_ISA_EXT_ZTSO,168 KVM_RISCV_ISA_EXT_ZTSO,
169 KVM_RISCV_ISA_EXT_ZACAS,169 KVM_RISCV_ISA_EXT_ZACAS,
170 KVM_RISCV_ISA_EXT_SSCOFPMF,170 KVM_RISCV_ISA_EXT_SSCOFPMF,
171 KVM_RISCV_ISA_EXT_ZIMOP,
172 KVM_RISCV_ISA_EXT_ZCA,
173 KVM_RISCV_ISA_EXT_ZCB,
174 KVM_RISCV_ISA_EXT_ZCD,
175 KVM_RISCV_ISA_EXT_ZCF,
176 KVM_RISCV_ISA_EXT_ZCMOP,
177 KVM_RISCV_ISA_EXT_ZAWRS,
178 KVM_RISCV_ISA_EXT_SMNPM,
179 KVM_RISCV_ISA_EXT_SSNPM,
180 KVM_RISCV_ISA_EXT_SVADE,
181 KVM_RISCV_ISA_EXT_SVADU,
171 KVM_RISCV_ISA_EXT_MAX,182 KVM_RISCV_ISA_EXT_MAX,
172};183};
173184
lib/libc/include/riscv-linux-any/asm/unistd.h+6-37
...@@ -14,41 +14,10 @@...@@ -14,41 +14,10 @@
14 * You should have received a copy of the GNU General Public License14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */16 */
17#include <asm/bitsperlong.h>
1718
18#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
19#define __ARCH_WANT_NEW_STAT
20#define __ARCH_WANT_SET_GET_RLIMIT
21#endif /* __LP64__ */
22
23#define __ARCH_WANT_SYS_CLONE3
24#define __ARCH_WANT_MEMFD_SECRET
25
26#include <asm-generic/unistd.h>
27
28/*
29 * Allows the instruction cache to be flushed from userspace. Despite RISC-V
30 * having a direct 'fence.i' instruction available to userspace (which we
31 * can't trap!), that's not actually viable when running on Linux because the
32 * kernel might schedule a process on another hart. There is no way for
33 * userspace to handle this without invoking the kernel (as it doesn't know the
34 * thread->hart mappings), so we've defined a RISC-V specific system call to
35 * flush the instruction cache.
36 *
37 * __NR_riscv_flush_icache is defined to flush the instruction cache over an
38 * address range, with the flush applying to either all threads or just the
39 * caller. We don't currently do anything with the address range, that's just
40 * in there for forwards compatibility.
41 */
42#ifndef __NR_riscv_flush_icache
43#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
44#endif
45__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
46
47/*
48 * Allows userspace to query the kernel for CPU architecture and
49 * microarchitecture details across a given set of CPUs.
50 */
51#ifndef __NR_riscv_hwprobe
52#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14)
53#endif
54__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe)
\ No newline at end of file
19#if __BITS_PER_LONG == 64
20#include <asm/unistd_64.h>
21#else
22#include <asm/unistd_32.h>
23#endif
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd_32.h created+319
...@@ -0,0 +1,319 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_setxattr 5
9#define __NR_lsetxattr 6
10#define __NR_fsetxattr 7
11#define __NR_getxattr 8
12#define __NR_lgetxattr 9
13#define __NR_fgetxattr 10
14#define __NR_listxattr 11
15#define __NR_llistxattr 12
16#define __NR_flistxattr 13
17#define __NR_removexattr 14
18#define __NR_lremovexattr 15
19#define __NR_fremovexattr 16
20#define __NR_getcwd 17
21#define __NR_lookup_dcookie 18
22#define __NR_eventfd2 19
23#define __NR_epoll_create1 20
24#define __NR_epoll_ctl 21
25#define __NR_epoll_pwait 22
26#define __NR_dup 23
27#define __NR_dup3 24
28#define __NR_fcntl64 25
29#define __NR_inotify_init1 26
30#define __NR_inotify_add_watch 27
31#define __NR_inotify_rm_watch 28
32#define __NR_ioctl 29
33#define __NR_ioprio_set 30
34#define __NR_ioprio_get 31
35#define __NR_flock 32
36#define __NR_mknodat 33
37#define __NR_mkdirat 34
38#define __NR_unlinkat 35
39#define __NR_symlinkat 36
40#define __NR_linkat 37
41#define __NR_umount2 39
42#define __NR_mount 40
43#define __NR_pivot_root 41
44#define __NR_nfsservctl 42
45#define __NR_statfs64 43
46#define __NR_fstatfs64 44
47#define __NR_truncate64 45
48#define __NR_ftruncate64 46
49#define __NR_fallocate 47
50#define __NR_faccessat 48
51#define __NR_chdir 49
52#define __NR_fchdir 50
53#define __NR_chroot 51
54#define __NR_fchmod 52
55#define __NR_fchmodat 53
56#define __NR_fchownat 54
57#define __NR_fchown 55
58#define __NR_openat 56
59#define __NR_close 57
60#define __NR_vhangup 58
61#define __NR_pipe2 59
62#define __NR_quotactl 60
63#define __NR_getdents64 61
64#define __NR_llseek 62
65#define __NR_read 63
66#define __NR_write 64
67#define __NR_readv 65
68#define __NR_writev 66
69#define __NR_pread64 67
70#define __NR_pwrite64 68
71#define __NR_preadv 69
72#define __NR_pwritev 70
73#define __NR_sendfile64 71
74#define __NR_signalfd4 74
75#define __NR_vmsplice 75
76#define __NR_splice 76
77#define __NR_tee 77
78#define __NR_readlinkat 78
79#define __NR_sync 81
80#define __NR_fsync 82
81#define __NR_fdatasync 83
82#define __NR_sync_file_range 84
83#define __NR_timerfd_create 85
84#define __NR_acct 89
85#define __NR_capget 90
86#define __NR_capset 91
87#define __NR_personality 92
88#define __NR_exit 93
89#define __NR_exit_group 94
90#define __NR_waitid 95
91#define __NR_set_tid_address 96
92#define __NR_unshare 97
93#define __NR_set_robust_list 99
94#define __NR_get_robust_list 100
95#define __NR_getitimer 102
96#define __NR_setitimer 103
97#define __NR_kexec_load 104
98#define __NR_init_module 105
99#define __NR_delete_module 106
100#define __NR_timer_create 107
101#define __NR_timer_getoverrun 109
102#define __NR_timer_delete 111
103#define __NR_syslog 116
104#define __NR_ptrace 117
105#define __NR_sched_setparam 118
106#define __NR_sched_setscheduler 119
107#define __NR_sched_getscheduler 120
108#define __NR_sched_getparam 121
109#define __NR_sched_setaffinity 122
110#define __NR_sched_getaffinity 123
111#define __NR_sched_yield 124
112#define __NR_sched_get_priority_max 125
113#define __NR_sched_get_priority_min 126
114#define __NR_restart_syscall 128
115#define __NR_kill 129
116#define __NR_tkill 130
117#define __NR_tgkill 131
118#define __NR_sigaltstack 132
119#define __NR_rt_sigsuspend 133
120#define __NR_rt_sigaction 134
121#define __NR_rt_sigprocmask 135
122#define __NR_rt_sigpending 136
123#define __NR_rt_sigqueueinfo 138
124#define __NR_rt_sigreturn 139
125#define __NR_setpriority 140
126#define __NR_getpriority 141
127#define __NR_reboot 142
128#define __NR_setregid 143
129#define __NR_setgid 144
130#define __NR_setreuid 145
131#define __NR_setuid 146
132#define __NR_setresuid 147
133#define __NR_getresuid 148
134#define __NR_setresgid 149
135#define __NR_getresgid 150
136#define __NR_setfsuid 151
137#define __NR_setfsgid 152
138#define __NR_times 153
139#define __NR_setpgid 154
140#define __NR_getpgid 155
141#define __NR_getsid 156
142#define __NR_setsid 157
143#define __NR_getgroups 158
144#define __NR_setgroups 159
145#define __NR_uname 160
146#define __NR_sethostname 161
147#define __NR_setdomainname 162
148#define __NR_getrusage 165
149#define __NR_umask 166
150#define __NR_prctl 167
151#define __NR_getcpu 168
152#define __NR_getpid 172
153#define __NR_getppid 173
154#define __NR_getuid 174
155#define __NR_geteuid 175
156#define __NR_getgid 176
157#define __NR_getegid 177
158#define __NR_gettid 178
159#define __NR_sysinfo 179
160#define __NR_mq_open 180
161#define __NR_mq_unlink 181
162#define __NR_mq_notify 184
163#define __NR_mq_getsetattr 185
164#define __NR_msgget 186
165#define __NR_msgctl 187
166#define __NR_msgrcv 188
167#define __NR_msgsnd 189
168#define __NR_semget 190
169#define __NR_semctl 191
170#define __NR_semop 193
171#define __NR_shmget 194
172#define __NR_shmctl 195
173#define __NR_shmat 196
174#define __NR_shmdt 197
175#define __NR_socket 198
176#define __NR_socketpair 199
177#define __NR_bind 200
178#define __NR_listen 201
179#define __NR_accept 202
180#define __NR_connect 203
181#define __NR_getsockname 204
182#define __NR_getpeername 205
183#define __NR_sendto 206
184#define __NR_recvfrom 207
185#define __NR_setsockopt 208
186#define __NR_getsockopt 209
187#define __NR_shutdown 210
188#define __NR_sendmsg 211
189#define __NR_recvmsg 212
190#define __NR_readahead 213
191#define __NR_brk 214
192#define __NR_munmap 215
193#define __NR_mremap 216
194#define __NR_add_key 217
195#define __NR_request_key 218
196#define __NR_keyctl 219
197#define __NR_clone 220
198#define __NR_execve 221
199#define __NR_mmap2 222
200#define __NR_fadvise64_64 223
201#define __NR_swapon 224
202#define __NR_swapoff 225
203#define __NR_mprotect 226
204#define __NR_msync 227
205#define __NR_mlock 228
206#define __NR_munlock 229
207#define __NR_mlockall 230
208#define __NR_munlockall 231
209#define __NR_mincore 232
210#define __NR_madvise 233
211#define __NR_remap_file_pages 234
212#define __NR_mbind 235
213#define __NR_get_mempolicy 236
214#define __NR_set_mempolicy 237
215#define __NR_migrate_pages 238
216#define __NR_move_pages 239
217#define __NR_rt_tgsigqueueinfo 240
218#define __NR_perf_event_open 241
219#define __NR_accept4 242
220#define __NR_riscv_hwprobe 258
221#define __NR_riscv_flush_icache 259
222#define __NR_prlimit64 261
223#define __NR_fanotify_init 262
224#define __NR_fanotify_mark 263
225#define __NR_name_to_handle_at 264
226#define __NR_open_by_handle_at 265
227#define __NR_syncfs 267
228#define __NR_setns 268
229#define __NR_sendmmsg 269
230#define __NR_process_vm_readv 270
231#define __NR_process_vm_writev 271
232#define __NR_kcmp 272
233#define __NR_finit_module 273
234#define __NR_sched_setattr 274
235#define __NR_sched_getattr 275
236#define __NR_renameat2 276
237#define __NR_seccomp 277
238#define __NR_getrandom 278
239#define __NR_memfd_create 279
240#define __NR_bpf 280
241#define __NR_execveat 281
242#define __NR_userfaultfd 282
243#define __NR_membarrier 283
244#define __NR_mlock2 284
245#define __NR_copy_file_range 285
246#define __NR_preadv2 286
247#define __NR_pwritev2 287
248#define __NR_pkey_mprotect 288
249#define __NR_pkey_alloc 289
250#define __NR_pkey_free 290
251#define __NR_statx 291
252#define __NR_rseq 293
253#define __NR_kexec_file_load 294
254#define __NR_clock_gettime64 403
255#define __NR_clock_settime64 404
256#define __NR_clock_adjtime64 405
257#define __NR_clock_getres_time64 406
258#define __NR_clock_nanosleep_time64 407
259#define __NR_timer_gettime64 408
260#define __NR_timer_settime64 409
261#define __NR_timerfd_gettime64 410
262#define __NR_timerfd_settime64 411
263#define __NR_utimensat_time64 412
264#define __NR_pselect6_time64 413
265#define __NR_ppoll_time64 414
266#define __NR_io_pgetevents_time64 416
267#define __NR_recvmmsg_time64 417
268#define __NR_mq_timedsend_time64 418
269#define __NR_mq_timedreceive_time64 419
270#define __NR_semtimedop_time64 420
271#define __NR_rt_sigtimedwait_time64 421
272#define __NR_futex_time64 422
273#define __NR_sched_rr_get_interval_time64 423
274#define __NR_pidfd_send_signal 424
275#define __NR_io_uring_setup 425
276#define __NR_io_uring_enter 426
277#define __NR_io_uring_register 427
278#define __NR_open_tree 428
279#define __NR_move_mount 429
280#define __NR_fsopen 430
281#define __NR_fsconfig 431
282#define __NR_fsmount 432
283#define __NR_fspick 433
284#define __NR_pidfd_open 434
285#define __NR_clone3 435
286#define __NR_close_range 436
287#define __NR_openat2 437
288#define __NR_pidfd_getfd 438
289#define __NR_faccessat2 439
290#define __NR_process_madvise 440
291#define __NR_epoll_pwait2 441
292#define __NR_mount_setattr 442
293#define __NR_quotactl_fd 443
294#define __NR_landlock_create_ruleset 444
295#define __NR_landlock_add_rule 445
296#define __NR_landlock_restrict_self 446
297#define __NR_memfd_secret 447
298#define __NR_process_mrelease 448
299#define __NR_futex_waitv 449
300#define __NR_set_mempolicy_home_node 450
301#define __NR_cachestat 451
302#define __NR_fchmodat2 452
303#define __NR_map_shadow_stack 453
304#define __NR_futex_wake 454
305#define __NR_futex_wait 455
306#define __NR_futex_requeue 456
307#define __NR_statmount 457
308#define __NR_listmount 458
309#define __NR_lsm_get_self_attr 459
310#define __NR_lsm_set_self_attr 460
311#define __NR_lsm_list_modules 461
312#define __NR_mseal 462
313#define __NR_setxattrat 463
314#define __NR_getxattrat 464
315#define __NR_listxattrat 465
316#define __NR_removexattrat 466
317
318
319#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd_64.h created+329
...@@ -0,0 +1,329 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_io_setup 0
5#define __NR_io_destroy 1
6#define __NR_io_submit 2
7#define __NR_io_cancel 3
8#define __NR_io_getevents 4
9#define __NR_setxattr 5
10#define __NR_lsetxattr 6
11#define __NR_fsetxattr 7
12#define __NR_getxattr 8
13#define __NR_lgetxattr 9
14#define __NR_fgetxattr 10
15#define __NR_listxattr 11
16#define __NR_llistxattr 12
17#define __NR_flistxattr 13
18#define __NR_removexattr 14
19#define __NR_lremovexattr 15
20#define __NR_fremovexattr 16
21#define __NR_getcwd 17
22#define __NR_lookup_dcookie 18
23#define __NR_eventfd2 19
24#define __NR_epoll_create1 20
25#define __NR_epoll_ctl 21
26#define __NR_epoll_pwait 22
27#define __NR_dup 23
28#define __NR_dup3 24
29#define __NR_fcntl 25
30#define __NR_inotify_init1 26
31#define __NR_inotify_add_watch 27
32#define __NR_inotify_rm_watch 28
33#define __NR_ioctl 29
34#define __NR_ioprio_set 30
35#define __NR_ioprio_get 31
36#define __NR_flock 32
37#define __NR_mknodat 33
38#define __NR_mkdirat 34
39#define __NR_unlinkat 35
40#define __NR_symlinkat 36
41#define __NR_linkat 37
42#define __NR_umount2 39
43#define __NR_mount 40
44#define __NR_pivot_root 41
45#define __NR_nfsservctl 42
46#define __NR_statfs 43
47#define __NR_fstatfs 44
48#define __NR_truncate 45
49#define __NR_ftruncate 46
50#define __NR_fallocate 47
51#define __NR_faccessat 48
52#define __NR_chdir 49
53#define __NR_fchdir 50
54#define __NR_chroot 51
55#define __NR_fchmod 52
56#define __NR_fchmodat 53
57#define __NR_fchownat 54
58#define __NR_fchown 55
59#define __NR_openat 56
60#define __NR_close 57
61#define __NR_vhangup 58
62#define __NR_pipe2 59
63#define __NR_quotactl 60
64#define __NR_getdents64 61
65#define __NR_lseek 62
66#define __NR_read 63
67#define __NR_write 64
68#define __NR_readv 65
69#define __NR_writev 66
70#define __NR_pread64 67
71#define __NR_pwrite64 68
72#define __NR_preadv 69
73#define __NR_pwritev 70
74#define __NR_sendfile 71
75#define __NR_pselect6 72
76#define __NR_ppoll 73
77#define __NR_signalfd4 74
78#define __NR_vmsplice 75
79#define __NR_splice 76
80#define __NR_tee 77
81#define __NR_readlinkat 78
82#define __NR_newfstatat 79
83#define __NR_fstat 80
84#define __NR_sync 81
85#define __NR_fsync 82
86#define __NR_fdatasync 83
87#define __NR_sync_file_range 84
88#define __NR_timerfd_create 85
89#define __NR_timerfd_settime 86
90#define __NR_timerfd_gettime 87
91#define __NR_utimensat 88
92#define __NR_acct 89
93#define __NR_capget 90
94#define __NR_capset 91
95#define __NR_personality 92
96#define __NR_exit 93
97#define __NR_exit_group 94
98#define __NR_waitid 95
99#define __NR_set_tid_address 96
100#define __NR_unshare 97
101#define __NR_futex 98
102#define __NR_set_robust_list 99
103#define __NR_get_robust_list 100
104#define __NR_nanosleep 101
105#define __NR_getitimer 102
106#define __NR_setitimer 103
107#define __NR_kexec_load 104
108#define __NR_init_module 105
109#define __NR_delete_module 106
110#define __NR_timer_create 107
111#define __NR_timer_gettime 108
112#define __NR_timer_getoverrun 109
113#define __NR_timer_settime 110
114#define __NR_timer_delete 111
115#define __NR_clock_settime 112
116#define __NR_clock_gettime 113
117#define __NR_clock_getres 114
118#define __NR_clock_nanosleep 115
119#define __NR_syslog 116
120#define __NR_ptrace 117
121#define __NR_sched_setparam 118
122#define __NR_sched_setscheduler 119
123#define __NR_sched_getscheduler 120
124#define __NR_sched_getparam 121
125#define __NR_sched_setaffinity 122
126#define __NR_sched_getaffinity 123
127#define __NR_sched_yield 124
128#define __NR_sched_get_priority_max 125
129#define __NR_sched_get_priority_min 126
130#define __NR_sched_rr_get_interval 127
131#define __NR_restart_syscall 128
132#define __NR_kill 129
133#define __NR_tkill 130
134#define __NR_tgkill 131
135#define __NR_sigaltstack 132
136#define __NR_rt_sigsuspend 133
137#define __NR_rt_sigaction 134
138#define __NR_rt_sigprocmask 135
139#define __NR_rt_sigpending 136
140#define __NR_rt_sigtimedwait 137
141#define __NR_rt_sigqueueinfo 138
142#define __NR_rt_sigreturn 139
143#define __NR_setpriority 140
144#define __NR_getpriority 141
145#define __NR_reboot 142
146#define __NR_setregid 143
147#define __NR_setgid 144
148#define __NR_setreuid 145
149#define __NR_setuid 146
150#define __NR_setresuid 147
151#define __NR_getresuid 148
152#define __NR_setresgid 149
153#define __NR_getresgid 150
154#define __NR_setfsuid 151
155#define __NR_setfsgid 152
156#define __NR_times 153
157#define __NR_setpgid 154
158#define __NR_getpgid 155
159#define __NR_getsid 156
160#define __NR_setsid 157
161#define __NR_getgroups 158
162#define __NR_setgroups 159
163#define __NR_uname 160
164#define __NR_sethostname 161
165#define __NR_setdomainname 162
166#define __NR_getrlimit 163
167#define __NR_setrlimit 164
168#define __NR_getrusage 165
169#define __NR_umask 166
170#define __NR_prctl 167
171#define __NR_getcpu 168
172#define __NR_gettimeofday 169
173#define __NR_settimeofday 170
174#define __NR_adjtimex 171
175#define __NR_getpid 172
176#define __NR_getppid 173
177#define __NR_getuid 174
178#define __NR_geteuid 175
179#define __NR_getgid 176
180#define __NR_getegid 177
181#define __NR_gettid 178
182#define __NR_sysinfo 179
183#define __NR_mq_open 180
184#define __NR_mq_unlink 181
185#define __NR_mq_timedsend 182
186#define __NR_mq_timedreceive 183
187#define __NR_mq_notify 184
188#define __NR_mq_getsetattr 185
189#define __NR_msgget 186
190#define __NR_msgctl 187
191#define __NR_msgrcv 188
192#define __NR_msgsnd 189
193#define __NR_semget 190
194#define __NR_semctl 191
195#define __NR_semtimedop 192
196#define __NR_semop 193
197#define __NR_shmget 194
198#define __NR_shmctl 195
199#define __NR_shmat 196
200#define __NR_shmdt 197
201#define __NR_socket 198
202#define __NR_socketpair 199
203#define __NR_bind 200
204#define __NR_listen 201
205#define __NR_accept 202
206#define __NR_connect 203
207#define __NR_getsockname 204
208#define __NR_getpeername 205
209#define __NR_sendto 206
210#define __NR_recvfrom 207
211#define __NR_setsockopt 208
212#define __NR_getsockopt 209
213#define __NR_shutdown 210
214#define __NR_sendmsg 211
215#define __NR_recvmsg 212
216#define __NR_readahead 213
217#define __NR_brk 214
218#define __NR_munmap 215
219#define __NR_mremap 216
220#define __NR_add_key 217
221#define __NR_request_key 218
222#define __NR_keyctl 219
223#define __NR_clone 220
224#define __NR_execve 221
225#define __NR_mmap 222
226#define __NR_fadvise64 223
227#define __NR_swapon 224
228#define __NR_swapoff 225
229#define __NR_mprotect 226
230#define __NR_msync 227
231#define __NR_mlock 228
232#define __NR_munlock 229
233#define __NR_mlockall 230
234#define __NR_munlockall 231
235#define __NR_mincore 232
236#define __NR_madvise 233
237#define __NR_remap_file_pages 234
238#define __NR_mbind 235
239#define __NR_get_mempolicy 236
240#define __NR_set_mempolicy 237
241#define __NR_migrate_pages 238
242#define __NR_move_pages 239
243#define __NR_rt_tgsigqueueinfo 240
244#define __NR_perf_event_open 241
245#define __NR_accept4 242
246#define __NR_recvmmsg 243
247#define __NR_riscv_hwprobe 258
248#define __NR_riscv_flush_icache 259
249#define __NR_wait4 260
250#define __NR_prlimit64 261
251#define __NR_fanotify_init 262
252#define __NR_fanotify_mark 263
253#define __NR_name_to_handle_at 264
254#define __NR_open_by_handle_at 265
255#define __NR_clock_adjtime 266
256#define __NR_syncfs 267
257#define __NR_setns 268
258#define __NR_sendmmsg 269
259#define __NR_process_vm_readv 270
260#define __NR_process_vm_writev 271
261#define __NR_kcmp 272
262#define __NR_finit_module 273
263#define __NR_sched_setattr 274
264#define __NR_sched_getattr 275
265#define __NR_renameat2 276
266#define __NR_seccomp 277
267#define __NR_getrandom 278
268#define __NR_memfd_create 279
269#define __NR_bpf 280
270#define __NR_execveat 281
271#define __NR_userfaultfd 282
272#define __NR_membarrier 283
273#define __NR_mlock2 284
274#define __NR_copy_file_range 285
275#define __NR_preadv2 286
276#define __NR_pwritev2 287
277#define __NR_pkey_mprotect 288
278#define __NR_pkey_alloc 289
279#define __NR_pkey_free 290
280#define __NR_statx 291
281#define __NR_io_pgetevents 292
282#define __NR_rseq 293
283#define __NR_kexec_file_load 294
284#define __NR_pidfd_send_signal 424
285#define __NR_io_uring_setup 425
286#define __NR_io_uring_enter 426
287#define __NR_io_uring_register 427
288#define __NR_open_tree 428
289#define __NR_move_mount 429
290#define __NR_fsopen 430
291#define __NR_fsconfig 431
292#define __NR_fsmount 432
293#define __NR_fspick 433
294#define __NR_pidfd_open 434
295#define __NR_clone3 435
296#define __NR_close_range 436
297#define __NR_openat2 437
298#define __NR_pidfd_getfd 438
299#define __NR_faccessat2 439
300#define __NR_process_madvise 440
301#define __NR_epoll_pwait2 441
302#define __NR_mount_setattr 442
303#define __NR_quotactl_fd 443
304#define __NR_landlock_create_ruleset 444
305#define __NR_landlock_add_rule 445
306#define __NR_landlock_restrict_self 446
307#define __NR_memfd_secret 447
308#define __NR_process_mrelease 448
309#define __NR_futex_waitv 449
310#define __NR_set_mempolicy_home_node 450
311#define __NR_cachestat 451
312#define __NR_fchmodat2 452
313#define __NR_map_shadow_stack 453
314#define __NR_futex_wake 454
315#define __NR_futex_wait 455
316#define __NR_futex_requeue 456
317#define __NR_statmount 457
318#define __NR_listmount 458
319#define __NR_lsm_get_self_attr 459
320#define __NR_lsm_set_self_attr 460
321#define __NR_lsm_list_modules 461
322#define __NR_mseal 462
323#define __NR_setxattrat 463
324#define __NR_getxattrat 464
325#define __NR_listxattrat 465
326#define __NR_removexattrat 466
327
328
329#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/dasd.h+1-1
...@@ -294,7 +294,7 @@ struct dasd_snid_ioctl_data {...@@ -294,7 +294,7 @@ struct dasd_snid_ioctl_data {
294/********************************************************************************294/********************************************************************************
295 * SECTION: Definition of IOCTLs295 * SECTION: Definition of IOCTLs
296 *296 *
297 * Here ist how the ioctl-nr should be used:297 * Here is how the ioctl-nr should be used:
298 * 0 - 31 DASD driver itself298 * 0 - 31 DASD driver itself
299 * 32 - 239 still open299 * 32 - 239 still open
300 * 240 - 255 reserved for EMC300 * 240 - 255 reserved for EMC
lib/libc/include/s390x-linux-any/asm/kvm.h+2-1
...@@ -469,7 +469,8 @@ struct kvm_s390_vm_cpu_subfunc {...@@ -469,7 +469,8 @@ struct kvm_s390_vm_cpu_subfunc {
469 __u8 kdsa[16]; /* with MSA9 */469 __u8 kdsa[16]; /* with MSA9 */
470 __u8 sortl[32]; /* with STFLE.150 */470 __u8 sortl[32]; /* with STFLE.150 */
471 __u8 dfltcc[32]; /* with STFLE.151 */471 __u8 dfltcc[32]; /* with STFLE.151 */
472 __u8 reserved[1728];472 __u8 pfcr[16]; /* with STFLE.201 */
473 __u8 reserved[1712];
473};474};
474475
475#define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6476#define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6
lib/libc/include/s390x-linux-any/asm/pkey.h+31-10
...@@ -41,23 +41,29 @@...@@ -41,23 +41,29 @@
41#define PKEY_KEYTYPE_ECC_P521 741#define PKEY_KEYTYPE_ECC_P521 7
42#define PKEY_KEYTYPE_ECC_ED25519 842#define PKEY_KEYTYPE_ECC_ED25519 8
43#define PKEY_KEYTYPE_ECC_ED448 943#define PKEY_KEYTYPE_ECC_ED448 9
44#define PKEY_KEYTYPE_AES_XTS_128 10
45#define PKEY_KEYTYPE_AES_XTS_256 11
46#define PKEY_KEYTYPE_HMAC_512 12
47#define PKEY_KEYTYPE_HMAC_1024 13
4448
45/* the newer ioctls use a pkey_key_type enum for type information */49/* the newer ioctls use a pkey_key_type enum for type information */
46enum pkey_key_type {50enum pkey_key_type {
47 PKEY_TYPE_CCA_DATA = (__u32) 1,51 PKEY_TYPE_CCA_DATA = (__u32)1,
48 PKEY_TYPE_CCA_CIPHER = (__u32) 2,52 PKEY_TYPE_CCA_CIPHER = (__u32)2,
49 PKEY_TYPE_EP11 = (__u32) 3,53 PKEY_TYPE_EP11 = (__u32)3,
50 PKEY_TYPE_CCA_ECC = (__u32) 0x1f,54 PKEY_TYPE_CCA_ECC = (__u32)0x1f,
51 PKEY_TYPE_EP11_AES = (__u32) 6,55 PKEY_TYPE_EP11_AES = (__u32)6,
52 PKEY_TYPE_EP11_ECC = (__u32) 7,56 PKEY_TYPE_EP11_ECC = (__u32)7,
57 PKEY_TYPE_PROTKEY = (__u32)8,
58 PKEY_TYPE_UVSECRET = (__u32)9,
53};59};
5460
55/* the newer ioctls use a pkey_key_size enum for key size information */61/* the newer ioctls use a pkey_key_size enum for key size information */
56enum pkey_key_size {62enum pkey_key_size {
57 PKEY_SIZE_AES_128 = (__u32) 128,63 PKEY_SIZE_AES_128 = (__u32)128,
58 PKEY_SIZE_AES_192 = (__u32) 192,64 PKEY_SIZE_AES_192 = (__u32)192,
59 PKEY_SIZE_AES_256 = (__u32) 256,65 PKEY_SIZE_AES_256 = (__u32)256,
60 PKEY_SIZE_UNKNOWN = (__u32) 0xFFFFFFFF,66 PKEY_SIZE_UNKNOWN = (__u32)0xFFFFFFFF,
61};67};
6268
63/* some of the newer ioctls use these flags */69/* some of the newer ioctls use these flags */
...@@ -120,6 +126,7 @@ struct pkey_genseck {...@@ -120,6 +126,7 @@ struct pkey_genseck {
120 __u32 keytype; /* in: key type to generate */126 __u32 keytype; /* in: key type to generate */
121 struct pkey_seckey seckey; /* out: the secure key blob */127 struct pkey_seckey seckey; /* out: the secure key blob */
122};128};
129
123#define PKEY_GENSECK _IOWR(PKEY_IOCTL_MAGIC, 0x01, struct pkey_genseck)130#define PKEY_GENSECK _IOWR(PKEY_IOCTL_MAGIC, 0x01, struct pkey_genseck)
124131
125/*132/*
...@@ -132,6 +139,7 @@ struct pkey_clr2seck {...@@ -132,6 +139,7 @@ struct pkey_clr2seck {
132 struct pkey_clrkey clrkey; /* in: the clear key value */139 struct pkey_clrkey clrkey; /* in: the clear key value */
133 struct pkey_seckey seckey; /* out: the secure key blob */140 struct pkey_seckey seckey; /* out: the secure key blob */
134};141};
142
135#define PKEY_CLR2SECK _IOWR(PKEY_IOCTL_MAGIC, 0x02, struct pkey_clr2seck)143#define PKEY_CLR2SECK _IOWR(PKEY_IOCTL_MAGIC, 0x02, struct pkey_clr2seck)
136144
137/*145/*
...@@ -143,6 +151,7 @@ struct pkey_sec2protk {...@@ -143,6 +151,7 @@ struct pkey_sec2protk {
143 struct pkey_seckey seckey; /* in: the secure key blob */151 struct pkey_seckey seckey; /* in: the secure key blob */
144 struct pkey_protkey protkey; /* out: the protected key */152 struct pkey_protkey protkey; /* out: the protected key */
145};153};
154
146#define PKEY_SEC2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x03, struct pkey_sec2protk)155#define PKEY_SEC2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x03, struct pkey_sec2protk)
147156
148/*157/*
...@@ -153,6 +162,7 @@ struct pkey_clr2protk {...@@ -153,6 +162,7 @@ struct pkey_clr2protk {
153 struct pkey_clrkey clrkey; /* in: the clear key value */162 struct pkey_clrkey clrkey; /* in: the clear key value */
154 struct pkey_protkey protkey; /* out: the protected key */163 struct pkey_protkey protkey; /* out: the protected key */
155};164};
165
156#define PKEY_CLR2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x04, struct pkey_clr2protk)166#define PKEY_CLR2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x04, struct pkey_clr2protk)
157167
158/*168/*
...@@ -164,6 +174,7 @@ struct pkey_findcard {...@@ -164,6 +174,7 @@ struct pkey_findcard {
164 __u16 cardnr; /* out: card number */174 __u16 cardnr; /* out: card number */
165 __u16 domain; /* out: domain number */175 __u16 domain; /* out: domain number */
166};176};
177
167#define PKEY_FINDCARD _IOWR(PKEY_IOCTL_MAGIC, 0x05, struct pkey_findcard)178#define PKEY_FINDCARD _IOWR(PKEY_IOCTL_MAGIC, 0x05, struct pkey_findcard)
168179
169/*180/*
...@@ -173,6 +184,7 @@ struct pkey_skey2pkey {...@@ -173,6 +184,7 @@ struct pkey_skey2pkey {
173 struct pkey_seckey seckey; /* in: the secure key blob */184 struct pkey_seckey seckey; /* in: the secure key blob */
174 struct pkey_protkey protkey; /* out: the protected key */185 struct pkey_protkey protkey; /* out: the protected key */
175};186};
187
176#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)188#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)
177189
178/*190/*
...@@ -190,6 +202,7 @@ struct pkey_verifykey {...@@ -190,6 +202,7 @@ struct pkey_verifykey {
190 __u16 keysize; /* out: key size in bits */202 __u16 keysize; /* out: key size in bits */
191 __u32 attributes; /* out: attribute bits */203 __u32 attributes; /* out: attribute bits */
192};204};
205
193#define PKEY_VERIFYKEY _IOWR(PKEY_IOCTL_MAGIC, 0x07, struct pkey_verifykey)206#define PKEY_VERIFYKEY _IOWR(PKEY_IOCTL_MAGIC, 0x07, struct pkey_verifykey)
194#define PKEY_VERIFY_ATTR_AES 0x00000001 /* key is an AES key */207#define PKEY_VERIFY_ATTR_AES 0x00000001 /* key is an AES key */
195#define PKEY_VERIFY_ATTR_OLD_MKVP 0x00000100 /* key has old MKVP value */208#define PKEY_VERIFY_ATTR_OLD_MKVP 0x00000100 /* key has old MKVP value */
...@@ -221,6 +234,7 @@ struct pkey_kblob2pkey {...@@ -221,6 +234,7 @@ struct pkey_kblob2pkey {
221 __u32 keylen; /* in: the key blob length */234 __u32 keylen; /* in: the key blob length */
222 struct pkey_protkey protkey; /* out: the protected key */235 struct pkey_protkey protkey; /* out: the protected key */
223};236};
237
224#define PKEY_KBLOB2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x0A, struct pkey_kblob2pkey)238#define PKEY_KBLOB2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x0A, struct pkey_kblob2pkey)
225239
226/*240/*
...@@ -253,6 +267,7 @@ struct pkey_genseck2 {...@@ -253,6 +267,7 @@ struct pkey_genseck2 {
253 __u32 keylen; /* in: available key blob buffer size */267 __u32 keylen; /* in: available key blob buffer size */
254 /* out: actual key blob size */268 /* out: actual key blob size */
255};269};
270
256#define PKEY_GENSECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x11, struct pkey_genseck2)271#define PKEY_GENSECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x11, struct pkey_genseck2)
257272
258/*273/*
...@@ -287,6 +302,7 @@ struct pkey_clr2seck2 {...@@ -287,6 +302,7 @@ struct pkey_clr2seck2 {
287 __u32 keylen; /* in: available key blob buffer size */302 __u32 keylen; /* in: available key blob buffer size */
288 /* out: actual key blob size */303 /* out: actual key blob size */
289};304};
305
290#define PKEY_CLR2SECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x12, struct pkey_clr2seck2)306#define PKEY_CLR2SECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x12, struct pkey_clr2seck2)
291307
292/*308/*
...@@ -324,6 +340,7 @@ struct pkey_verifykey2 {...@@ -324,6 +340,7 @@ struct pkey_verifykey2 {
324 enum pkey_key_size size; /* out: the key size */340 enum pkey_key_size size; /* out: the key size */
325 __u32 flags; /* out: additional key info flags */341 __u32 flags; /* out: additional key info flags */
326};342};
343
327#define PKEY_VERIFYKEY2 _IOWR(PKEY_IOCTL_MAGIC, 0x17, struct pkey_verifykey2)344#define PKEY_VERIFYKEY2 _IOWR(PKEY_IOCTL_MAGIC, 0x17, struct pkey_verifykey2)
328345
329/*346/*
...@@ -346,6 +363,7 @@ struct pkey_kblob2pkey2 {...@@ -346,6 +363,7 @@ struct pkey_kblob2pkey2 {
346 __u32 apqn_entries; /* in: # of apqn target list entries */363 __u32 apqn_entries; /* in: # of apqn target list entries */
347 struct pkey_protkey protkey; /* out: the protected key */364 struct pkey_protkey protkey; /* out: the protected key */
348};365};
366
349#define PKEY_KBLOB2PROTK2 _IOWR(PKEY_IOCTL_MAGIC, 0x1A, struct pkey_kblob2pkey2)367#define PKEY_KBLOB2PROTK2 _IOWR(PKEY_IOCTL_MAGIC, 0x1A, struct pkey_kblob2pkey2)
350368
351/*369/*
...@@ -382,6 +400,7 @@ struct pkey_apqns4key {...@@ -382,6 +400,7 @@ struct pkey_apqns4key {
382 __u32 apqn_entries; /* in: max # of apqn entries in the list */400 __u32 apqn_entries; /* in: max # of apqn entries in the list */
383 /* out: # apqns stored into the list */401 /* out: # apqns stored into the list */
384};402};
403
385#define PKEY_APQNS4K _IOWR(PKEY_IOCTL_MAGIC, 0x1B, struct pkey_apqns4key)404#define PKEY_APQNS4K _IOWR(PKEY_IOCTL_MAGIC, 0x1B, struct pkey_apqns4key)
386405
387/*406/*
...@@ -421,6 +440,7 @@ struct pkey_apqns4keytype {...@@ -421,6 +440,7 @@ struct pkey_apqns4keytype {
421 __u32 apqn_entries; /* in: max # of apqn entries in the list */440 __u32 apqn_entries; /* in: max # of apqn entries in the list */
422 /* out: # apqns stored into the list */441 /* out: # apqns stored into the list */
423};442};
443
424#define PKEY_APQNS4KT _IOWR(PKEY_IOCTL_MAGIC, 0x1C, struct pkey_apqns4keytype)444#define PKEY_APQNS4KT _IOWR(PKEY_IOCTL_MAGIC, 0x1C, struct pkey_apqns4keytype)
425445
426/*446/*
...@@ -447,6 +467,7 @@ struct pkey_kblob2pkey3 {...@@ -447,6 +467,7 @@ struct pkey_kblob2pkey3 {
447 __u32 pkeylen; /* in/out: size of pkey buffer/actual len of pkey */467 __u32 pkeylen; /* in/out: size of pkey buffer/actual len of pkey */
448 __u8 *pkey; /* in: pkey blob buffer space ptr */468 __u8 *pkey; /* in: pkey blob buffer space ptr */
449};469};
470
450#define PKEY_KBLOB2PROTK3 _IOWR(PKEY_IOCTL_MAGIC, 0x1D, struct pkey_kblob2pkey3)471#define PKEY_KBLOB2PROTK3 _IOWR(PKEY_IOCTL_MAGIC, 0x1D, struct pkey_kblob2pkey3)
451472
452#endif /* _PKEY_H */473#endif /* _PKEY_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_32.h+4
...@@ -435,5 +435,9 @@...@@ -435,5 +435,9 @@
435#define __NR_lsm_set_self_attr 460435#define __NR_lsm_set_self_attr 460
436#define __NR_lsm_list_modules 461436#define __NR_lsm_list_modules 461
437#define __NR_mseal 462437#define __NR_mseal 462
438#define __NR_setxattrat 463
439#define __NR_getxattrat 464
440#define __NR_listxattrat 465
441#define __NR_removexattrat 466
438442
439#endif /* _ASM_S390_UNISTD_32_H */443#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+4
...@@ -383,5 +383,9 @@...@@ -383,5 +383,9 @@
383#define __NR_lsm_set_self_attr 460383#define __NR_lsm_set_self_attr 460
384#define __NR_lsm_list_modules 461384#define __NR_lsm_list_modules 461
385#define __NR_mseal 462385#define __NR_mseal 462
386#define __NR_setxattrat 463
387#define __NR_getxattrat 464
388#define __NR_listxattrat 465
389#define __NR_removexattrat 466
386390
387#endif /* _ASM_S390_UNISTD_64_H */391#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/uvdevice.h+18-14
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*2/*
3 * Copyright IBM Corp. 20223 * Copyright IBM Corp. 2022, 2024
4 * Author(s): Steffen Eiden <seiden@linux.ibm.com>4 * Author(s): Steffen Eiden <seiden@linux.ibm.com>
5 */5 */
6#ifndef __S390_ASM_UVDEVICE_H6#ifndef __S390_ASM_UVDEVICE_H
...@@ -52,7 +52,7 @@ struct uvio_uvdev_info {...@@ -52,7 +52,7 @@ struct uvio_uvdev_info {
52 __u64 supp_uvio_cmds;52 __u64 supp_uvio_cmds;
53 /*53 /*
54 * If bit `n` is set, the Ultravisor(UV) supports the UV-call54 * If bit `n` is set, the Ultravisor(UV) supports the UV-call
55 * corresponding to the IOCTL with nr `n` in the calling contextx (host55 * corresponding to the IOCTL with nr `n` in the calling context (host
56 * or guest). The value is only valid if the corresponding bit in56 * or guest). The value is only valid if the corresponding bit in
57 * @supp_uvio_cmds is set as well.57 * @supp_uvio_cmds is set as well.
58 */58 */
...@@ -71,6 +71,7 @@ struct uvio_uvdev_info {...@@ -71,6 +71,7 @@ struct uvio_uvdev_info {
71#define UVIO_ATT_ADDITIONAL_MAX_LEN 0x800071#define UVIO_ATT_ADDITIONAL_MAX_LEN 0x8000
72#define UVIO_ADD_SECRET_MAX_LEN 0x10000072#define UVIO_ADD_SECRET_MAX_LEN 0x100000
73#define UVIO_LIST_SECRETS_LEN 0x100073#define UVIO_LIST_SECRETS_LEN 0x1000
74#define UVIO_RETR_SECRET_MAX_LEN 0x2000
7475
75#define UVIO_DEVICE_NAME "uv"76#define UVIO_DEVICE_NAME "uv"
76#define UVIO_TYPE_UVC 'u'77#define UVIO_TYPE_UVC 'u'
...@@ -81,22 +82,25 @@ enum UVIO_IOCTL_NR {...@@ -81,22 +82,25 @@ enum UVIO_IOCTL_NR {
81 UVIO_IOCTL_ADD_SECRET_NR,82 UVIO_IOCTL_ADD_SECRET_NR,
82 UVIO_IOCTL_LIST_SECRETS_NR,83 UVIO_IOCTL_LIST_SECRETS_NR,
83 UVIO_IOCTL_LOCK_SECRETS_NR,84 UVIO_IOCTL_LOCK_SECRETS_NR,
85 UVIO_IOCTL_RETR_SECRET_NR,
84 /* must be the last entry */86 /* must be the last entry */
85 UVIO_IOCTL_NUM_IOCTLS87 UVIO_IOCTL_NUM_IOCTLS
86};88};
8789
88#define UVIO_IOCTL(nr) _IOWR(UVIO_TYPE_UVC, nr, struct uvio_ioctl_cb)90#define UVIO_IOCTL(nr) _IOWR(UVIO_TYPE_UVC, nr, struct uvio_ioctl_cb)
89#define UVIO_IOCTL_UVDEV_INFO UVIO_IOCTL(UVIO_IOCTL_UVDEV_INFO_NR)91#define UVIO_IOCTL_UVDEV_INFO UVIO_IOCTL(UVIO_IOCTL_UVDEV_INFO_NR)
90#define UVIO_IOCTL_ATT UVIO_IOCTL(UVIO_IOCTL_ATT_NR)92#define UVIO_IOCTL_ATT UVIO_IOCTL(UVIO_IOCTL_ATT_NR)
91#define UVIO_IOCTL_ADD_SECRET UVIO_IOCTL(UVIO_IOCTL_ADD_SECRET_NR)93#define UVIO_IOCTL_ADD_SECRET UVIO_IOCTL(UVIO_IOCTL_ADD_SECRET_NR)
92#define UVIO_IOCTL_LIST_SECRETS UVIO_IOCTL(UVIO_IOCTL_LIST_SECRETS_NR)94#define UVIO_IOCTL_LIST_SECRETS UVIO_IOCTL(UVIO_IOCTL_LIST_SECRETS_NR)
93#define UVIO_IOCTL_LOCK_SECRETS UVIO_IOCTL(UVIO_IOCTL_LOCK_SECRETS_NR)95#define UVIO_IOCTL_LOCK_SECRETS UVIO_IOCTL(UVIO_IOCTL_LOCK_SECRETS_NR)
96#define UVIO_IOCTL_RETR_SECRET UVIO_IOCTL(UVIO_IOCTL_RETR_SECRET_NR)
9497
95#define UVIO_SUPP_CALL(nr) (1ULL << (nr))98#define UVIO_SUPP_CALL(nr) (1ULL << (nr))
96#define UVIO_SUPP_UDEV_INFO UVIO_SUPP_CALL(UVIO_IOCTL_UDEV_INFO_NR)99#define UVIO_SUPP_UDEV_INFO UVIO_SUPP_CALL(UVIO_IOCTL_UDEV_INFO_NR)
97#define UVIO_SUPP_ATT UVIO_SUPP_CALL(UVIO_IOCTL_ATT_NR)100#define UVIO_SUPP_ATT UVIO_SUPP_CALL(UVIO_IOCTL_ATT_NR)
98#define UVIO_SUPP_ADD_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_ADD_SECRET_NR)101#define UVIO_SUPP_ADD_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_ADD_SECRET_NR)
99#define UVIO_SUPP_LIST_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LIST_SECRETS_NR)102#define UVIO_SUPP_LIST_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LIST_SECRETS_NR)
100#define UVIO_SUPP_LOCK_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LOCK_SECRETS_NR)103#define UVIO_SUPP_LOCK_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LOCK_SECRETS_NR)
104#define UVIO_SUPP_RETR_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_RETR_SECRET_NR)
101105
102#endif /* __S390_ASM_UVDEVICE_H */106#endif /* __S390_ASM_UVDEVICE_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/socket.h+8
...@@ -133,6 +133,14 @@...@@ -133,6 +133,14 @@
133#define SO_PASSPIDFD 0x0055133#define SO_PASSPIDFD 0x0055
134#define SO_PEERPIDFD 0x0056134#define SO_PEERPIDFD 0x0056
135135
136#define SO_DEVMEM_LINEAR 0x0057
137#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
138#define SO_DEVMEM_DMABUF 0x0058
139#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
140#define SO_DEVMEM_DONTNEED 0x0059
141
142#define SCM_TS_OPT_ID 0x005a
143
136144
137145
138#if __BITS_PER_LONG == 64146#if __BITS_PER_LONG == 64
lib/libc/include/sparc-linux-any/asm/unistd_32.h+4
...@@ -432,6 +432,10 @@...@@ -432,6 +432,10 @@
432#define __NR_lsm_set_self_attr 460432#define __NR_lsm_set_self_attr 460
433#define __NR_lsm_list_modules 461433#define __NR_lsm_list_modules 461
434#define __NR_mseal 462434#define __NR_mseal 462
435#define __NR_setxattrat 463
436#define __NR_getxattrat 464
437#define __NR_listxattrat 465
438#define __NR_removexattrat 466
435439
436440
437#endif /* _ASM_UNISTD_32_H */441#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h+4
...@@ -395,6 +395,10 @@...@@ -395,6 +395,10 @@
395#define __NR_lsm_set_self_attr 460395#define __NR_lsm_set_self_attr 460
396#define __NR_lsm_list_modules 461396#define __NR_lsm_list_modules 461
397#define __NR_mseal 462397#define __NR_mseal 462
398#define __NR_setxattrat 463
399#define __NR_getxattrat 464
400#define __NR_listxattrat 465
401#define __NR_removexattrat 466
398402
399403
400#endif /* _ASM_UNISTD_64_H */404#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/amd_hsmp.h+2-1
...@@ -88,7 +88,8 @@ struct hsmp_msg_desc {...@@ -88,7 +88,8 @@ struct hsmp_msg_desc {
88 *88 *
89 * Not supported messages would return -ENOMSG.89 * Not supported messages would return -ENOMSG.
90 */90 */
91static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {91static const struct hsmp_msg_desc hsmp_msg_desc_table[]
92 __attribute__((unused)) = {
92 /* RESERVED */93 /* RESERVED */
93 {0, 0, HSMP_RSVD},94 {0, 0, HSMP_RSVD},
9495
lib/libc/include/x86-linux-any/asm/elf.h created+16
...@@ -0,0 +1,16 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_ELF_H
3#define _ASM_X86_ELF_H
4
5#include <linux/types.h>
6
7struct x86_xfeat_component {
8 __u32 type;
9 __u32 size;
10 __u32 offset;
11 __u32 flags;
12} __attribute__((packed));
13
14_Static_assert(sizeof(struct x86_xfeat_component) % 4 == 0, "x86_xfeat_component is not aligned");
15
16#endif /* _ASM_X86_ELF_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm.h+51
...@@ -106,6 +106,7 @@ struct kvm_ioapic_state {...@@ -106,6 +106,7 @@ struct kvm_ioapic_state {
106106
107#define KVM_RUN_X86_SMM (1 << 0)107#define KVM_RUN_X86_SMM (1 << 0)
108#define KVM_RUN_X86_BUS_LOCK (1 << 1)108#define KVM_RUN_X86_BUS_LOCK (1 << 1)
109#define KVM_RUN_X86_GUEST_MODE (1 << 2)
109110
110/* for KVM_GET_REGS and KVM_SET_REGS */111/* for KVM_GET_REGS and KVM_SET_REGS */
111struct kvm_regs {112struct kvm_regs {
...@@ -436,6 +437,8 @@ struct kvm_sync_regs {...@@ -436,6 +437,8 @@ struct kvm_sync_regs {
436#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)437#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
437#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5)438#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5)
438#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)439#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)
440#define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7)
441#define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8)
439442
440#define KVM_STATE_NESTED_FORMAT_VMX 0443#define KVM_STATE_NESTED_FORMAT_VMX 0
441#define KVM_STATE_NESTED_FORMAT_SVM 1444#define KVM_STATE_NESTED_FORMAT_SVM 1
...@@ -695,6 +698,11 @@ enum sev_cmd_id {...@@ -695,6 +698,11 @@ enum sev_cmd_id {
695 /* Second time is the charm; improved versions of the above ioctls. */698 /* Second time is the charm; improved versions of the above ioctls. */
696 KVM_SEV_INIT2,699 KVM_SEV_INIT2,
697700
701 /* SNP-specific commands */
702 KVM_SEV_SNP_LAUNCH_START = 100,
703 KVM_SEV_SNP_LAUNCH_UPDATE,
704 KVM_SEV_SNP_LAUNCH_FINISH,
705
698 KVM_SEV_NR_MAX,706 KVM_SEV_NR_MAX,
699};707};
700708
...@@ -822,6 +830,48 @@ struct kvm_sev_receive_update_data {...@@ -822,6 +830,48 @@ struct kvm_sev_receive_update_data {
822 __u32 pad2;830 __u32 pad2;
823};831};
824832
833struct kvm_sev_snp_launch_start {
834 __u64 policy;
835 __u8 gosvw[16];
836 __u16 flags;
837 __u8 pad0[6];
838 __u64 pad1[4];
839};
840
841/* Kept in sync with firmware values for simplicity. */
842#define KVM_SEV_SNP_PAGE_TYPE_NORMAL 0x1
843#define KVM_SEV_SNP_PAGE_TYPE_ZERO 0x3
844#define KVM_SEV_SNP_PAGE_TYPE_UNMEASURED 0x4
845#define KVM_SEV_SNP_PAGE_TYPE_SECRETS 0x5
846#define KVM_SEV_SNP_PAGE_TYPE_CPUID 0x6
847
848struct kvm_sev_snp_launch_update {
849 __u64 gfn_start;
850 __u64 uaddr;
851 __u64 len;
852 __u8 type;
853 __u8 pad0;
854 __u16 flags;
855 __u32 pad1;
856 __u64 pad2[4];
857};
858
859#define KVM_SEV_SNP_ID_BLOCK_SIZE 96
860#define KVM_SEV_SNP_ID_AUTH_SIZE 4096
861#define KVM_SEV_SNP_FINISH_DATA_SIZE 32
862
863struct kvm_sev_snp_launch_finish {
864 __u64 id_block_uaddr;
865 __u64 id_auth_uaddr;
866 __u8 id_block_en;
867 __u8 auth_key_en;
868 __u8 vcek_disabled;
869 __u8 host_data[KVM_SEV_SNP_FINISH_DATA_SIZE];
870 __u8 pad0[3];
871 __u16 flags;
872 __u64 pad1[4];
873};
874
825#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)875#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
826#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)876#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
827877
...@@ -872,5 +922,6 @@ struct kvm_hyperv_eventfd {...@@ -872,5 +922,6 @@ struct kvm_hyperv_eventfd {
872#define KVM_X86_SW_PROTECTED_VM 1922#define KVM_X86_SW_PROTECTED_VM 1
873#define KVM_X86_SEV_VM 2923#define KVM_X86_SEV_VM 2
874#define KVM_X86_SEV_ES_VM 3924#define KVM_X86_SEV_ES_VM 3
925#define KVM_X86_SNP_VM 4
875926
876#endif /* _ASM_X86_KVM_H */927#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/mce.h+2-1
...@@ -8,7 +8,8 @@...@@ -8,7 +8,8 @@
8/*8/*
9 * Fields are zero when not available. Also, this struct is shared with9 * Fields are zero when not available. Also, this struct is shared with
10 * userspace mcelog and thus must keep existing fields at current offsets.10 * userspace mcelog and thus must keep existing fields at current offsets.
11 * Only add new fields to the end of the structure11 * Only add new, shared fields to the end of the structure.
12 * Do not add vendor-specific fields.
12 */13 */
13struct mce {14struct mce {
14 __u64 status; /* Bank's MCi_STATUS MSR */15 __u64 status; /* Bank's MCi_STATUS MSR */
lib/libc/include/x86-linux-any/asm/mman.h-3
...@@ -5,9 +5,6 @@...@@ -5,9 +5,6 @@
5#define MAP_32BIT 0x40 /* only give out 32bit addresses */5#define MAP_32BIT 0x40 /* only give out 32bit addresses */
6#define MAP_ABOVE4G 0x80 /* only map above 4GB */6#define MAP_ABOVE4G 0x80 /* only map above 4GB */
77
8/* Flags for map_shadow_stack(2) */
9#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */
10
11#include <asm-generic/mman.h>8#include <asm-generic/mman.h>
129
13#endif /* _ASM_X86_MMAN_H */10#endif /* _ASM_X86_MMAN_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/svm.h+1
...@@ -115,6 +115,7 @@...@@ -115,6 +115,7 @@
115#define SVM_VMGEXIT_AP_CREATE_ON_INIT 0115#define SVM_VMGEXIT_AP_CREATE_ON_INIT 0
116#define SVM_VMGEXIT_AP_CREATE 1116#define SVM_VMGEXIT_AP_CREATE 1
117#define SVM_VMGEXIT_AP_DESTROY 2117#define SVM_VMGEXIT_AP_DESTROY 2
118#define SVM_VMGEXIT_SNP_RUN_VMPL 0x80000018
118#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd119#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd
119#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe120#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe
120#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \121#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \
lib/libc/include/x86-linux-any/asm/unistd_32.h+4
...@@ -453,6 +453,10 @@...@@ -453,6 +453,10 @@
453#define __NR_lsm_set_self_attr 460453#define __NR_lsm_set_self_attr 460
454#define __NR_lsm_list_modules 461454#define __NR_lsm_list_modules 461
455#define __NR_mseal 462455#define __NR_mseal 462
456#define __NR_setxattrat 463
457#define __NR_getxattrat 464
458#define __NR_listxattrat 465
459#define __NR_removexattrat 466
456460
457461
458#endif /* _ASM_UNISTD_32_H */462#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h+5
...@@ -336,6 +336,7 @@...@@ -336,6 +336,7 @@
336#define __NR_statx 332336#define __NR_statx 332
337#define __NR_io_pgetevents 333337#define __NR_io_pgetevents 333
338#define __NR_rseq 334338#define __NR_rseq 334
339#define __NR_uretprobe 335
339#define __NR_pidfd_send_signal 424340#define __NR_pidfd_send_signal 424
340#define __NR_io_uring_setup 425341#define __NR_io_uring_setup 425
341#define __NR_io_uring_enter 426342#define __NR_io_uring_enter 426
...@@ -375,6 +376,10 @@...@@ -375,6 +376,10 @@
375#define __NR_lsm_set_self_attr 460376#define __NR_lsm_set_self_attr 460
376#define __NR_lsm_list_modules 461377#define __NR_lsm_list_modules 461
377#define __NR_mseal 462378#define __NR_mseal 462
379#define __NR_setxattrat 463
380#define __NR_getxattrat 464
381#define __NR_listxattrat 465
382#define __NR_removexattrat 466
378383
379384
380#endif /* _ASM_UNISTD_64_H */385#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h+5
...@@ -289,6 +289,7 @@...@@ -289,6 +289,7 @@
289#define __NR_statx (__X32_SYSCALL_BIT + 332)289#define __NR_statx (__X32_SYSCALL_BIT + 332)
290#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)290#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
291#define __NR_rseq (__X32_SYSCALL_BIT + 334)291#define __NR_rseq (__X32_SYSCALL_BIT + 334)
292#define __NR_uretprobe (__X32_SYSCALL_BIT + 335)
292#define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424)293#define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424)
293#define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425)294#define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425)
294#define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426)295#define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426)
...@@ -328,6 +329,10 @@...@@ -328,6 +329,10 @@
328#define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460)329#define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460)
329#define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461)330#define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461)
330#define __NR_mseal (__X32_SYSCALL_BIT + 462)331#define __NR_mseal (__X32_SYSCALL_BIT + 462)
332#define __NR_setxattrat (__X32_SYSCALL_BIT + 463)
333#define __NR_getxattrat (__X32_SYSCALL_BIT + 464)
334#define __NR_listxattrat (__X32_SYSCALL_BIT + 465)
335#define __NR_removexattrat (__X32_SYSCALL_BIT + 466)
331#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)336#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
332#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)337#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
333#define __NR_ioctl (__X32_SYSCALL_BIT + 514)338#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/xtensa-linux-any/asm/mman.h+3
...@@ -113,6 +113,9 @@...@@ -113,6 +113,9 @@
113113
114#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */114#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
115115
116#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */
117#define MADV_GUARD_REMOVE 103 /* unguard range */
118
116/* compatibility flags */119/* compatibility flags */
117#define MAP_FILE 0120#define MAP_FILE 0
118121
lib/libc/include/xtensa-linux-any/asm/unistd_32.h+4
...@@ -409,6 +409,10 @@...@@ -409,6 +409,10 @@
409#define __NR_lsm_set_self_attr 460409#define __NR_lsm_set_self_attr 460
410#define __NR_lsm_list_modules 461410#define __NR_lsm_list_modules 461
411#define __NR_mseal 462411#define __NR_mseal 462
412#define __NR_setxattrat 463
413#define __NR_getxattrat 464
414#define __NR_listxattrat 465
415#define __NR_removexattrat 466
412416
413417
414#endif /* _ASM_UNISTD_32_H */418#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file