authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-10 05:29:00+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-10 05:29:00+01:00
log7fbeeca924eba1bd33f054e19b2d937446fa228b
treeea366d6a1bf10ed9660b50f5ae2e5b3dc5d77330
parent6c7814fabd5cc94dce13ed02e5313069be9af482
parentfcf0fc225a7e9023d62138e6cbc6d5ffd91453e0

Merge pull request 'Linux 6.19' (#31165) from alexrp/zig:linux-6.19 into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31165 Reviewed-by: Andrew Kelley <andrew@ziglang.org>

187 files changed, 6270 insertions(+), 1470 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+1
......@@ -145,5 +145,6 @@
145145 */
146146#define HWCAP3_MTE_FAR (1UL << 0)
147147#define HWCAP3_MTE_STORE_ONLY (1UL << 1)
148#define HWCAP3_LSFE (1UL << 2)
148149
149150#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h+1-1
......@@ -31,7 +31,7 @@
3131#define KVM_SPSR_FIQ 4
3232#define KVM_NR_SPSR 5
3333
34#ifndef __ASSEMBLY__
34#ifndef __ASSEMBLER__
3535#include <linux/psci.h>
3636#include <linux/types.h>
3737#include <asm/ptrace.h>
lib/libc/include/aarch64-linux-any/asm/ptrace.h+2-2
......@@ -80,7 +80,7 @@
8080#define PTRACE_PEEKMTETAGS 33
8181#define PTRACE_POKEMTETAGS 34
8282
83#ifndef __ASSEMBLY__
83#ifndef __ASSEMBLER__
8484
8585/*
8686 * User structures for general purpose, floating point and debug registers.
......@@ -332,6 +332,6 @@ struct user_gcs {
332332 __u64 gcspr_el0;
333333};
334334
335#endif /* __ASSEMBLY__ */
335#endif /* __ASSEMBLER__ */
336336
337337#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/sigcontext.h+2-2
......@@ -17,7 +17,7 @@
1717#ifndef __ASM_SIGCONTEXT_H
1818#define __ASM_SIGCONTEXT_H
1919
20#ifndef __ASSEMBLY__
20#ifndef __ASSEMBLER__
2121
2222#include <linux/types.h>
2323
......@@ -192,7 +192,7 @@ struct gcs_context {
192192 __u64 reserved;
193193};
194194
195#endif /* !__ASSEMBLY__ */
195#endif /* !__ASSEMBLER__ */
196196
197197#include <asm/sve_context.h>
198198
lib/libc/include/aarch64-linux-any/asm/unistd_64.h+1
......@@ -326,6 +326,7 @@
326326#define __NR_open_tree_attr 467
327327#define __NR_file_getattr 468
328328#define __NR_file_setattr 469
329#define __NR_listns 470
329330
330331
331332#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/posix_types.h+1
......@@ -86,6 +86,7 @@ typedef struct {
8686 */
8787typedef __kernel_long_t __kernel_off_t;
8888typedef long long __kernel_loff_t;
89typedef unsigned long long __kernel_uoff_t;
8990typedef __kernel_long_t __kernel_old_time_t;
9091typedef __kernel_long_t __kernel_time_t;
9192typedef long long __kernel_time64_t;
lib/libc/include/any-linux-any/asm-generic/unistd.h+3-1
......@@ -857,9 +857,11 @@ __SYSCALL(__NR_open_tree_attr, sys_open_tree_attr)
857857__SYSCALL(__NR_file_getattr, sys_file_getattr)
858858#define __NR_file_setattr 469
859859__SYSCALL(__NR_file_setattr, sys_file_setattr)
860#define __NR_listns 470
861__SYSCALL(__NR_listns, sys_listns)
860862
861863#undef __NR_syscalls
862#define __NR_syscalls 470
864#define __NR_syscalls 471
863865
864866/*
865867 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+65-37
......@@ -57,6 +57,7 @@ extern "C" {
5757#define DRM_AMDGPU_USERQ 0x16
5858#define DRM_AMDGPU_USERQ_SIGNAL 0x17
5959#define DRM_AMDGPU_USERQ_WAIT 0x18
60#define DRM_AMDGPU_GEM_LIST_HANDLES 0x19
6061
6162#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
6263#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
......@@ -77,6 +78,7 @@ extern "C" {
7778#define DRM_IOCTL_AMDGPU_USERQ DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ, union drm_amdgpu_userq)
7879#define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)
7980#define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)
81#define DRM_IOCTL_AMDGPU_GEM_LIST_HANDLES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_LIST_HANDLES, struct drm_amdgpu_gem_list_handles)
8082
8183/**
8284 * DOC: memory domains
......@@ -103,6 +105,8 @@ extern "C" {
103105 *
104106 * %AMDGPU_GEM_DOMAIN_DOORBELL Doorbell. It is an MMIO region for
105107 * signalling user mode queues.
108 *
109 * %AMDGPU_GEM_DOMAIN_MMIO_REMAP MMIO remap page (special mapping for HDP flushing).
106110 */
107111#define AMDGPU_GEM_DOMAIN_CPU 0x1
108112#define AMDGPU_GEM_DOMAIN_GTT 0x2
......@@ -111,13 +115,15 @@ extern "C" {
111115#define AMDGPU_GEM_DOMAIN_GWS 0x10
112116#define AMDGPU_GEM_DOMAIN_OA 0x20
113117#define AMDGPU_GEM_DOMAIN_DOORBELL 0x40
118#define AMDGPU_GEM_DOMAIN_MMIO_REMAP 0x80
114119#define AMDGPU_GEM_DOMAIN_MASK (AMDGPU_GEM_DOMAIN_CPU | \
115120 AMDGPU_GEM_DOMAIN_GTT | \
116121 AMDGPU_GEM_DOMAIN_VRAM | \
117122 AMDGPU_GEM_DOMAIN_GDS | \
118123 AMDGPU_GEM_DOMAIN_GWS | \
119 AMDGPU_GEM_DOMAIN_OA | \
120 AMDGPU_GEM_DOMAIN_DOORBELL)
124 AMDGPU_GEM_DOMAIN_OA | \
125 AMDGPU_GEM_DOMAIN_DOORBELL | \
126 AMDGPU_GEM_DOMAIN_MMIO_REMAP)
121127
122128/* Flag that CPU access will be required for the case of VRAM domain */
123129#define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0)
......@@ -800,6 +806,21 @@ union drm_amdgpu_wait_fences {
800806
801807#define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0
802808#define AMDGPU_GEM_OP_SET_PLACEMENT 1
809#define AMDGPU_GEM_OP_GET_MAPPING_INFO 2
810
811struct drm_amdgpu_gem_vm_entry {
812 /* Start of mapping (in bytes) */
813 __u64 addr;
814
815 /* Size of mapping (in bytes) */
816 __u64 size;
817
818 /* Mapping offset */
819 __u64 offset;
820
821 /* flags needed to recreate mapping */
822 __u64 flags;
823};
803824
804825/* Sets or returns a value associated with a buffer. */
805826struct drm_amdgpu_gem_op {
......@@ -807,8 +828,44 @@ struct drm_amdgpu_gem_op {
807828 __u32 handle;
808829 /** AMDGPU_GEM_OP_* */
809830 __u32 op;
810 /** Input or return value */
831 /** Input or return value. For MAPPING_INFO op: pointer to array of struct drm_amdgpu_gem_vm_entry */
811832 __u64 value;
833 /** For MAPPING_INFO op: number of mappings (in/out) */
834 __u32 num_entries;
835
836 __u32 padding;
837};
838
839#define AMDGPU_GEM_LIST_HANDLES_FLAG_IS_IMPORT (1 << 0)
840
841struct drm_amdgpu_gem_list_handles {
842 /* User pointer to array of drm_amdgpu_gem_bo_info_entry */
843 __u64 entries;
844
845 /* Size of entries buffer / Number of handles in process (if larger than size of buffer, must retry) */
846 __u32 num_entries;
847
848 __u32 padding;
849};
850
851struct drm_amdgpu_gem_list_handles_entry {
852 /* gem handle of buffer object */
853 __u32 gem_handle;
854
855 /* Currently just one flag: IS_IMPORT */
856 __u32 flags;
857
858 /* Size of bo */
859 __u64 size;
860
861 /* Preferred domains for GEM_CREATE */
862 __u64 preferred_domains;
863
864 /* GEM_CREATE flags for re-creation of buffer */
865 __u64 alloc_flags;
866
867 /* physical start_addr alignment in bytes for some HW requirements */
868 __u64 alignment;
812869};
813870
814871#define AMDGPU_VA_OP_MAP 1
......@@ -1031,10 +1088,11 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
10311088 * Query h/w info: Flag that this is integrated (a.h.a. fusion) GPU
10321089 *
10331090 */
1034#define AMDGPU_IDS_FLAGS_FUSION 0x1
1035#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
1036#define AMDGPU_IDS_FLAGS_TMZ 0x4
1037#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
1091#define AMDGPU_IDS_FLAGS_FUSION 0x01
1092#define AMDGPU_IDS_FLAGS_PREEMPTION 0x02
1093#define AMDGPU_IDS_FLAGS_TMZ 0x04
1094#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x08
1095#define AMDGPU_IDS_FLAGS_GANG_SUBMIT 0x10
10381096
10391097/*
10401098 * Query h/w info: Flag identifying VF/PF/PT mode
......@@ -1497,27 +1555,6 @@ struct drm_amdgpu_info_hw_ip {
14971555 __u32 userq_num_slots;
14981556};
14991557
1500/* GFX metadata BO sizes and alignment info (in bytes) */
1501struct drm_amdgpu_info_uq_fw_areas_gfx {
1502 /* shadow area size */
1503 __u32 shadow_size;
1504 /* shadow area base virtual mem alignment */
1505 __u32 shadow_alignment;
1506 /* context save area size */
1507 __u32 csa_size;
1508 /* context save area base virtual mem alignment */
1509 __u32 csa_alignment;
1510};
1511
1512/* IP specific fw related information used in the
1513 * subquery AMDGPU_INFO_UQ_FW_AREAS
1514 */
1515struct drm_amdgpu_info_uq_fw_areas {
1516 union {
1517 struct drm_amdgpu_info_uq_fw_areas_gfx gfx;
1518 };
1519};
1520
15211558struct drm_amdgpu_info_num_handles {
15221559 /** Max handles as supported by firmware for UVD */
15231560 __u32 uvd_max_handles;
......@@ -1619,15 +1656,6 @@ struct drm_amdgpu_info_uq_metadata {
16191656#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
16201657#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
16211658
1622/* FIXME wrong namespace! */
1623struct drm_color_ctm_3x4 {
1624 /*
1625 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
1626 * (not two's complement!) format.
1627 */
1628 __u64 matrix[12];
1629};
1630
16311659#if defined(__cplusplus)
16321660}
16331661#endif
lib/libc/include/any-linux-any/drm/amdxdna_accel.h+197
......@@ -34,6 +34,7 @@ enum amdxdna_drm_ioctl_id {
3434 DRM_AMDXDNA_EXEC_CMD,
3535 DRM_AMDXDNA_GET_INFO,
3636 DRM_AMDXDNA_SET_STATE,
37 DRM_AMDXDNA_GET_ARRAY = 10,
3738};
3839
3940/**
......@@ -153,6 +154,31 @@ enum amdxdna_bo_type {
153154 AMDXDNA_BO_CMD,
154155};
155156
157/**
158 * struct amdxdna_drm_va_entry
159 * @vaddr: Virtual address.
160 * @len: Size of entry.
161 */
162struct amdxdna_drm_va_entry {
163 __u64 vaddr;
164 __u64 len;
165};
166
167/**
168 * struct amdxdna_drm_va_tbl
169 * @dmabuf_fd: The fd of dmabuf.
170 * @num_entries: Number of va entries.
171 * @va_entries: Array of va entries.
172 *
173 * The input can be either a dmabuf fd or a virtual address entry table.
174 * When dmabuf_fd is used, num_entries must be zero.
175 */
176struct amdxdna_drm_va_tbl {
177 __s32 dmabuf_fd;
178 __u32 num_entries;
179 struct amdxdna_drm_va_entry va_entries[];
180};
181
156182/**
157183 * struct amdxdna_drm_create_bo - Create a buffer object.
158184 * @flags: Buffer flags. MBZ.
......@@ -416,6 +442,52 @@ enum amdxdna_drm_get_param {
416442 DRM_AMDXDNA_QUERY_HW_CONTEXTS,
417443 DRM_AMDXDNA_QUERY_FIRMWARE_VERSION = 8,
418444 DRM_AMDXDNA_GET_POWER_MODE,
445 DRM_AMDXDNA_QUERY_TELEMETRY,
446 DRM_AMDXDNA_GET_FORCE_PREEMPT_STATE,
447 DRM_AMDXDNA_QUERY_RESOURCE_INFO,
448 DRM_AMDXDNA_GET_FRAME_BOUNDARY_PREEMPT_STATE,
449};
450
451/**
452 * struct amdxdna_drm_get_resource_info - Get resource information
453 */
454struct amdxdna_drm_get_resource_info {
455 /** @npu_clk_max: max H-Clocks */
456 __u64 npu_clk_max;
457 /** @npu_tops_max: max TOPs */
458 __u64 npu_tops_max;
459 /** @npu_task_max: max number of tasks */
460 __u64 npu_task_max;
461 /** @npu_tops_curr: current TOPs */
462 __u64 npu_tops_curr;
463 /** @npu_task_curr: current number of tasks */
464 __u64 npu_task_curr;
465};
466
467/**
468 * struct amdxdna_drm_attribute_state - State of an attribute
469 */
470struct amdxdna_drm_attribute_state {
471 /** @state: enabled or disabled */
472 __u8 state;
473 /** @pad: MBZ */
474 __u8 pad[7];
475};
476
477/**
478 * struct amdxdna_drm_query_telemetry_header - Telemetry data header
479 */
480struct amdxdna_drm_query_telemetry_header {
481 /** @major: Firmware telemetry interface major version number */
482 __u32 major;
483 /** @minor: Firmware telemetry interface minor version number */
484 __u32 minor;
485 /** @type: Telemetry query type */
486 __u32 type;
487 /** @map_num_elements: Total number of elements in the map table */
488 __u32 map_num_elements;
489 /** @map: Element map */
490 __u32 map[];
419491};
420492
421493/**
......@@ -430,10 +502,131 @@ struct amdxdna_drm_get_info {
430502 __u64 buffer; /* in/out */
431503};
432504
505#define AMDXDNA_HWCTX_STATE_IDLE 0
506#define AMDXDNA_HWCTX_STATE_ACTIVE 1
507
508/**
509 * struct amdxdna_drm_hwctx_entry - The hardware context array entry
510 */
511struct amdxdna_drm_hwctx_entry {
512 /** @context_id: Context ID. */
513 __u32 context_id;
514 /** @start_col: Start AIE array column assigned to context. */
515 __u32 start_col;
516 /** @num_col: Number of AIE array columns assigned to context. */
517 __u32 num_col;
518 /** @hwctx_id: The real hardware context id. */
519 __u32 hwctx_id;
520 /** @pid: ID of process which created this context. */
521 __s64 pid;
522 /** @command_submissions: Number of commands submitted. */
523 __u64 command_submissions;
524 /** @command_completions: Number of commands completed. */
525 __u64 command_completions;
526 /** @migrations: Number of times been migrated. */
527 __u64 migrations;
528 /** @preemptions: Number of times been preempted. */
529 __u64 preemptions;
530 /** @errors: Number of errors happened. */
531 __u64 errors;
532 /** @priority: Context priority. */
533 __u64 priority;
534 /** @heap_usage: Usage of device heap buffer. */
535 __u64 heap_usage;
536 /** @suspensions: Number of times been suspended. */
537 __u64 suspensions;
538 /**
539 * @state: Context state.
540 * %AMDXDNA_HWCTX_STATE_IDLE
541 * %AMDXDNA_HWCTX_STATE_ACTIVE
542 */
543 __u32 state;
544 /** @pasid: PASID been bound. */
545 __u32 pasid;
546 /** @gops: Giga operations per second. */
547 __u32 gops;
548 /** @fps: Frames per second. */
549 __u32 fps;
550 /** @dma_bandwidth: DMA bandwidth. */
551 __u32 dma_bandwidth;
552 /** @latency: Frame response latency. */
553 __u32 latency;
554 /** @frame_exec_time: Frame execution time. */
555 __u32 frame_exec_time;
556 /** @txn_op_idx: Index of last control code executed. */
557 __u32 txn_op_idx;
558 /** @ctx_pc: Program counter. */
559 __u32 ctx_pc;
560 /** @fatal_error_type: Fatal error type if context crashes. */
561 __u32 fatal_error_type;
562 /** @fatal_error_exception_type: Firmware exception type. */
563 __u32 fatal_error_exception_type;
564 /** @fatal_error_exception_pc: Firmware exception program counter. */
565 __u32 fatal_error_exception_pc;
566 /** @fatal_error_app_module: Exception module name. */
567 __u32 fatal_error_app_module;
568 /** @pad: Structure pad. */
569 __u32 pad;
570};
571
572/**
573 * struct amdxdna_async_error - XDNA async error structure
574 */
575struct amdxdna_async_error {
576 /** @err_code: Error code. */
577 __u64 err_code;
578 /** @ts_us: Timestamp. */
579 __u64 ts_us;
580 /** @ex_err_code: Extra error code */
581 __u64 ex_err_code;
582};
583
584#define DRM_AMDXDNA_HW_CONTEXT_ALL 0
585#define DRM_AMDXDNA_HW_LAST_ASYNC_ERR 2
586
587/**
588 * struct amdxdna_drm_get_array - Get information array.
589 */
590struct amdxdna_drm_get_array {
591 /**
592 * @param:
593 *
594 * Supported params:
595 *
596 * %DRM_AMDXDNA_HW_CONTEXT_ALL:
597 * Returns all created hardware contexts.
598 */
599 __u32 param;
600 /**
601 * @element_size:
602 *
603 * Specifies maximum element size and returns the actual element size.
604 */
605 __u32 element_size;
606 /**
607 * @num_element:
608 *
609 * Specifies maximum number of elements and returns the actual number
610 * of elements.
611 */
612 __u32 num_element; /* in/out */
613 /** @pad: MBZ */
614 __u32 pad;
615 /**
616 * @buffer:
617 *
618 * Specifies the match conditions and returns the matched information
619 * array.
620 */
621 __u64 buffer;
622};
623
433624enum amdxdna_drm_set_param {
434625 DRM_AMDXDNA_SET_POWER_MODE,
435626 DRM_AMDXDNA_WRITE_AIE_MEM,
436627 DRM_AMDXDNA_WRITE_AIE_REG,
628 DRM_AMDXDNA_SET_FORCE_PREEMPT,
629 DRM_AMDXDNA_SET_FRAME_BOUNDARY_PREEMPT,
437630};
438631
439632/**
......@@ -494,6 +687,10 @@ struct amdxdna_drm_set_power_mode {
494687 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_SET_STATE, \
495688 struct amdxdna_drm_set_state)
496689
690#define DRM_IOCTL_AMDXDNA_GET_ARRAY \
691 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_ARRAY, \
692 struct amdxdna_drm_get_array)
693
497694#if defined(__cplusplus)
498695} /* extern c end */
499696#endif
lib/libc/include/any-linux-any/drm/drm.h+66-12
......@@ -591,34 +591,65 @@ struct drm_set_version {
591591 int drm_dd_minor;
592592};
593593
594/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
594/**
595 * struct drm_gem_close - Argument for &DRM_IOCTL_GEM_CLOSE ioctl.
596 * @handle: Handle of the object to be closed.
597 * @pad: Padding.
598 *
599 * Releases the handle to an mm object.
600 */
595601struct drm_gem_close {
596 /** Handle of the object to be closed. */
597602 __u32 handle;
598603 __u32 pad;
599604};
600605
601/* DRM_IOCTL_GEM_FLINK ioctl argument type */
606/**
607 * struct drm_gem_flink - Argument for &DRM_IOCTL_GEM_FLINK ioctl.
608 * @handle: Handle for the object being named.
609 * @name: Returned global name.
610 *
611 * Create a global name for an object, returning the name.
612 *
613 * Note that the name does not hold a reference; when the object
614 * is freed, the name goes away.
615 */
602616struct drm_gem_flink {
603 /** Handle for the object being named */
604617 __u32 handle;
605
606 /** Returned global name */
607618 __u32 name;
608619};
609620
610/* DRM_IOCTL_GEM_OPEN ioctl argument type */
621/**
622 * struct drm_gem_open - Argument for &DRM_IOCTL_GEM_OPEN ioctl.
623 * @name: Name of object being opened.
624 * @handle: Returned handle for the object.
625 * @size: Returned size of the object
626 *
627 * Open an object using the global name, returning a handle and the size.
628 *
629 * This handle (of course) holds a reference to the object, so the object
630 * will not go away until the handle is deleted.
631 */
611632struct drm_gem_open {
612 /** Name of object being opened */
613633 __u32 name;
614
615 /** Returned handle for the object */
616634 __u32 handle;
617
618 /** Returned size of the object */
619635 __u64 size;
620636};
621637
638/**
639 * struct drm_gem_change_handle - Argument for &DRM_IOCTL_GEM_CHANGE_HANDLE ioctl.
640 * @handle: The handle of a gem object.
641 * @new_handle: An available gem handle.
642 *
643 * This ioctl changes the handle of a GEM object to the specified one.
644 * The new handle must be unused. On success the old handle is closed
645 * and all further IOCTL should refer to the new handle only.
646 * Calls to DRM_IOCTL_PRIME_FD_TO_HANDLE will return the new handle.
647 */
648struct drm_gem_change_handle {
649 __u32 handle;
650 __u32 new_handle;
651};
652
622653/**
623654 * DRM_CAP_DUMB_BUFFER
624655 *
......@@ -869,6 +900,21 @@ struct drm_get_cap {
869900 */
870901#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6
871902
903/**
904 * DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
905 *
906 * If set to 1 the DRM core will allow setting the COLOR_PIPELINE
907 * property on a &drm_plane, as well as drm_colorop properties.
908 *
909 * Setting of these plane properties will be rejected when this client
910 * cap is set:
911 * - COLOR_ENCODING
912 * - COLOR_RANGE
913 *
914 * The client must enable &DRM_CLIENT_CAP_ATOMIC first.
915 */
916#define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 7
917
872918/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
873919struct drm_set_client_cap {
874920 __u64 capability;
......@@ -1303,6 +1349,14 @@ extern "C" {
13031349 */
13041350#define DRM_IOCTL_SET_CLIENT_NAME DRM_IOWR(0xD1, struct drm_set_client_name)
13051351
1352/**
1353 * DRM_IOCTL_GEM_CHANGE_HANDLE - Move an object to a different handle
1354 *
1355 * Some applications (notably CRIU) need objects to have specific gem handles.
1356 * This ioctl changes the object at one gem handle to use a new gem handle.
1357 */
1358#define DRM_IOCTL_GEM_CHANGE_HANDLE DRM_IOWR(0xD2, struct drm_gem_change_handle)
1359
13061360/*
13071361 * Device specific ioctls should only be in their respective headers
13081362 * The device specific ioctl range is from 0x40 to 0x9f.
lib/libc/include/any-linux-any/drm/drm_fourcc.h+16-9
......@@ -979,14 +979,20 @@ extern "C" {
979979 * 2 = Gob Height 8, Turing+ Page Kind mapping
980980 * 3 = Reserved for future use.
981981 *
982 * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further
983 * bit remapping step that occurs at an even lower level than the
984 * page kind and block linear swizzles. This causes the layout of
985 * surfaces mapped in those SOC's GPUs to be incompatible with the
986 * equivalent mapping on other GPUs in the same system.
987 *
988 * 0 = Tegra K1 - Tegra Parker/TX2 Layout.
989 * 1 = Desktop GPU and Tegra Xavier+ Layout
982 * 22:22 s Sector layout. There is a further bit remapping step that occurs
983 * 26:27 at an even lower level than the page kind and block linear
984 * swizzles. This causes the bit arrangement of surfaces in memory
985 * to differ subtly, and prevents direct sharing of surfaces between
986 * GPUs with different layouts.
987 *
988 * 0 = Tegra K1 - Tegra Parker/TX2 Layout
989 * 1 = Pre-GB20x, GB20x 32+ bpp, GB10, Tegra Xavier-Orin Layout
990 * 2 = GB20x(Blackwell 2)+ 8 bpp surface layout
991 * 3 = GB20x(Blackwell 2)+ 16 bpp surface layout
992 * 4 = Reserved for future use.
993 * 5 = Reserved for future use.
994 * 6 = Reserved for future use.
995 * 7 = Reserved for future use.
990996 *
991997 * 25:23 c Lossless Framebuffer Compression type.
992998 *
......@@ -1001,7 +1007,7 @@ extern "C" {
10011007 * 6 = Reserved for future use
10021008 * 7 = Reserved for future use
10031009 *
1004 * 55:25 - Reserved for future use. Must be zero.
1010 * 55:28 - Reserved for future use. Must be zero.
10051011 */
10061012#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \
10071013 fourcc_mod_code(NVIDIA, (0x10 | \
......@@ -1009,6 +1015,7 @@ extern "C" {
10091015 (((k) & 0xff) << 12) | \
10101016 (((g) & 0x3) << 20) | \
10111017 (((s) & 0x1) << 22) | \
1018 (((s) & 0x6) << 25) | \
10121019 (((c) & 0x7) << 23)))
10131020
10141021/* To grandfather in prior block linear format modifiers to the above layout,
lib/libc/include/any-linux-any/drm/drm_mode.h+191-1
......@@ -629,6 +629,7 @@ struct drm_mode_connector_set_property {
629629#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
630630#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
631631#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
632#define DRM_MODE_OBJECT_COLOROP 0xfafafafa
632633#define DRM_MODE_OBJECT_ANY 0
633634
634635struct drm_mode_obj_get_properties {
......@@ -846,6 +847,20 @@ struct drm_color_ctm {
846847 __u64 matrix[9];
847848};
848849
850struct drm_color_ctm_3x4 {
851 /*
852 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
853 * (not two's complement!) format.
854 *
855 * out matrix in
856 * |R| |0 1 2 3 | | R |
857 * |G| = |4 5 6 7 | x | G |
858 * |B| |8 9 10 11| | B |
859 * |1.0|
860 */
861 __u64 matrix[12];
862};
863
849864struct drm_color_lut {
850865 /*
851866 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
......@@ -857,6 +872,125 @@ struct drm_color_lut {
857872 __u16 reserved;
858873};
859874
875/*
876 * struct drm_color_lut32
877 *
878 * 32-bit per channel color LUT entry, similar to drm_color_lut.
879 */
880struct drm_color_lut32 {
881 __u32 red;
882 __u32 green;
883 __u32 blue;
884 __u32 reserved;
885};
886
887/**
888 * enum drm_colorop_type - Type of color operation
889 *
890 * drm_colorops can be of many different types. Each type behaves differently
891 * and defines a different set of properties. This enum defines all types and
892 * gives a high-level description.
893 */
894enum drm_colorop_type {
895 /**
896 * @DRM_COLOROP_1D_CURVE:
897 *
898 * enum string "1D Curve"
899 *
900 * A 1D curve that is being applied to all color channels. The
901 * curve is specified via the CURVE_1D_TYPE colorop property.
902 */
903 DRM_COLOROP_1D_CURVE,
904
905 /**
906 * @DRM_COLOROP_1D_LUT:
907 *
908 * enum string "1D LUT"
909 *
910 * A simple 1D LUT of uniformly spaced &drm_color_lut32 entries,
911 * packed into a blob via the DATA property. The driver's
912 * expected LUT size is advertised via the SIZE property.
913 *
914 * The DATA blob is an array of struct drm_color_lut32 with size
915 * of "size".
916 */
917 DRM_COLOROP_1D_LUT,
918
919 /**
920 * @DRM_COLOROP_CTM_3X4:
921 *
922 * enum string "3x4 Matrix"
923 *
924 * A 3x4 matrix. Its values are specified via the
925 * &drm_color_ctm_3x4 struct provided via the DATA property.
926 *
927 * The DATA blob is a float[12]:
928 * out matrix in
929 * | R | | 0 1 2 3 | | R |
930 * | G | = | 4 5 6 7 | x | G |
931 * | B | | 8 9 10 12 | | B |
932 */
933 DRM_COLOROP_CTM_3X4,
934
935 /**
936 * @DRM_COLOROP_MULTIPLIER:
937 *
938 * enum string "Multiplier"
939 *
940 * A simple multiplier, applied to all color values. The
941 * multiplier is specified as a S31.32 via the MULTIPLIER
942 * property.
943 */
944 DRM_COLOROP_MULTIPLIER,
945
946 /**
947 * @DRM_COLOROP_3D_LUT:
948 *
949 * enum string "3D LUT"
950 *
951 * A 3D LUT of &drm_color_lut32 entries,
952 * packed into a blob via the DATA property. The driver's expected
953 * LUT size is advertised via the SIZE property, i.e., a 3D LUT with
954 * 17x17x17 entries will have SIZE set to 17.
955 *
956 * The DATA blob is a 3D array of struct drm_color_lut32 with dimension
957 * length of "size".
958 * The LUT elements are traversed like so:
959 *
960 * for B in range 0..n
961 * for G in range 0..n
962 * for R in range 0..n
963 * index = R + n * (G + n * B)
964 * color = lut3d[index]
965 */
966 DRM_COLOROP_3D_LUT,
967};
968
969/**
970 * enum drm_colorop_lut3d_interpolation_type - type of 3DLUT interpolation
971 */
972enum drm_colorop_lut3d_interpolation_type {
973 /**
974 * @DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL:
975 *
976 * Tetrahedral 3DLUT interpolation
977 */
978 DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,
979};
980
981/**
982 * enum drm_colorop_lut1d_interpolation_type - type of interpolation for 1D LUTs
983 */
984enum drm_colorop_lut1d_interpolation_type {
985 /**
986 * @DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR:
987 *
988 * Linear interpolation. Values between points of the LUT will be
989 * linearly interpolated.
990 */
991 DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
992};
993
860994/**
861995 * struct drm_plane_size_hint - Plane size hints
862996 * @width: The width of the plane in pixel
......@@ -962,6 +1096,14 @@ struct hdr_output_metadata {
9621096 * Request that the kernel sends back a vblank event (see
9631097 * struct drm_event_vblank) with the &DRM_EVENT_FLIP_COMPLETE type when the
9641098 * page-flip is done.
1099 *
1100 * When used with atomic uAPI, one event will be delivered per CRTC included in
1101 * the atomic commit. A CRTC is included in an atomic commit if one of its
1102 * properties is set, or if a property is set on a connector or plane linked
1103 * via the CRTC_ID property to the CRTC. At least one CRTC must be included,
1104 * and all pulled in CRTCs must be either previously or newly powered on (in
1105 * other words, a powered off CRTC which stays off cannot be included in the
1106 * atomic commit).
9651107 */
9661108#define DRM_MODE_PAGE_FLIP_EVENT 0x01
9671109/**
......@@ -1058,7 +1200,7 @@ struct drm_mode_crtc_page_flip_target {
10581200 * struct drm_mode_create_dumb - Create a KMS dumb buffer for scanout.
10591201 * @height: buffer height in pixels
10601202 * @width: buffer width in pixels
1061 * @bpp: bits per pixel
1203 * @bpp: color mode
10621204 * @flags: must be zero
10631205 * @handle: buffer object handle
10641206 * @pitch: number of bytes between two consecutive lines
......@@ -1066,6 +1208,54 @@ struct drm_mode_crtc_page_flip_target {
10661208 *
10671209 * User-space fills @height, @width, @bpp and @flags. If the IOCTL succeeds,
10681210 * the kernel fills @handle, @pitch and @size.
1211 *
1212 * The value of @bpp is a color-mode number describing a specific format
1213 * or a variant thereof. The value often corresponds to the number of bits
1214 * per pixel for most modes, although there are exceptions. Each color mode
1215 * maps to a DRM format plus a number of modes with similar pixel layout.
1216 * Framebuffer layout is always linear.
1217 *
1218 * Support for all modes and formats is optional. Even if dumb-buffer
1219 * creation with a certain color mode succeeds, it is not guaranteed that
1220 * the DRM driver supports any of the related formats. Most drivers support
1221 * a color mode of 32 with a format of DRM_FORMAT_XRGB8888 on their primary
1222 * plane.
1223 *
1224 * +------------+------------------------+------------------------+
1225 * | Color mode | Framebuffer format | Compatible formats |
1226 * +============+========================+========================+
1227 * | 32 | * DRM_FORMAT_XRGB8888 | * DRM_FORMAT_BGRX8888 |
1228 * | | | * DRM_FORMAT_RGBX8888 |
1229 * | | | * DRM_FORMAT_XBGR8888 |
1230 * +------------+------------------------+------------------------+
1231 * | 24 | * DRM_FORMAT_RGB888 | * DRM_FORMAT_BGR888 |
1232 * +------------+------------------------+------------------------+
1233 * | 16 | * DRM_FORMAT_RGB565 | * DRM_FORMAT_BGR565 |
1234 * +------------+------------------------+------------------------+
1235 * | 15 | * DRM_FORMAT_XRGB1555 | * DRM_FORMAT_BGRX1555 |
1236 * | | | * DRM_FORMAT_RGBX1555 |
1237 * | | | * DRM_FORMAT_XBGR1555 |
1238 * +------------+------------------------+------------------------+
1239 * | 8 | * DRM_FORMAT_C8 | * DRM_FORMAT_D8 |
1240 * | | | * DRM_FORMAT_R8 |
1241 * +------------+------------------------+------------------------+
1242 * | 4 | * DRM_FORMAT_C4 | * DRM_FORMAT_D4 |
1243 * | | | * DRM_FORMAT_R4 |
1244 * +------------+------------------------+------------------------+
1245 * | 2 | * DRM_FORMAT_C2 | * DRM_FORMAT_D2 |
1246 * | | | * DRM_FORMAT_R2 |
1247 * +------------+------------------------+------------------------+
1248 * | 1 | * DRM_FORMAT_C1 | * DRM_FORMAT_D1 |
1249 * | | | * DRM_FORMAT_R1 |
1250 * +------------+------------------------+------------------------+
1251 *
1252 * Color modes of 10, 12, 15, 30 and 64 are only supported for use by
1253 * legacy user space. Please don't use them in new code. Other modes
1254 * are not support.
1255 *
1256 * Do not attempt to allocate anything but linear framebuffer memory
1257 * with single-plane RGB data. Allocation of other framebuffer
1258 * layouts requires dedicated ioctls in the respective DRM driver.
10691259 */
10701260struct drm_mode_create_dumb {
10711261 __u32 height;
lib/libc/include/any-linux-any/drm/ethosu_accel.h created+261
......@@ -0,0 +1,261 @@
1/* SPDX-License-Identifier: MIT */
2/* Copyright (C) 2025 Arm, Ltd. */
3#ifndef _ETHOSU_DRM_H_
4#define _ETHOSU_DRM_H_
5
6#include "drm.h"
7
8#if defined(__cplusplus)
9extern "C" {
10#endif
11
12/**
13 * DOC: IOCTL IDs
14 *
15 * enum drm_ethosu_ioctl_id - IOCTL IDs
16 *
17 * Place new ioctls at the end, don't re-order, don't replace or remove entries.
18 *
19 * These IDs are not meant to be used directly. Use the DRM_IOCTL_ETHOSU_xxx
20 * definitions instead.
21 */
22enum drm_ethosu_ioctl_id {
23 /** @DRM_ETHOSU_DEV_QUERY: Query device information. */
24 DRM_ETHOSU_DEV_QUERY = 0,
25
26 /** @DRM_ETHOSU_BO_CREATE: Create a buffer object. */
27 DRM_ETHOSU_BO_CREATE,
28
29 /** @DRM_ETHOSU_BO_WAIT: Wait on a buffer object's fence. */
30 DRM_ETHOSU_BO_WAIT,
31
32 /**
33 * @DRM_ETHOSU_BO_MMAP_OFFSET: Get the file offset to pass to
34 * mmap to map a GEM object.
35 */
36 DRM_ETHOSU_BO_MMAP_OFFSET,
37
38 /**
39 * @DRM_ETHOSU_CMDSTREAM_BO_CREATE: Create a command stream buffer
40 * object.
41 */
42 DRM_ETHOSU_CMDSTREAM_BO_CREATE,
43
44 /** @DRM_ETHOSU_SUBMIT: Submit a job and BOs to run. */
45 DRM_ETHOSU_SUBMIT,
46};
47
48/**
49 * DOC: IOCTL arguments
50 */
51
52/**
53 * enum drm_ethosu_dev_query_type - Query type
54 *
55 * Place new types at the end, don't re-order, don't remove or replace.
56 */
57enum drm_ethosu_dev_query_type {
58 /** @DRM_ETHOSU_DEV_QUERY_NPU_INFO: Query NPU information. */
59 DRM_ETHOSU_DEV_QUERY_NPU_INFO = 0,
60};
61
62/**
63 * struct drm_ethosu_gpu_info - NPU information
64 *
65 * Structure grouping all queryable information relating to the NPU.
66 */
67struct drm_ethosu_npu_info {
68 /** @id : NPU ID. */
69 __u32 id;
70#define DRM_ETHOSU_ARCH_MAJOR(x) ((x) >> 28)
71#define DRM_ETHOSU_ARCH_MINOR(x) (((x) >> 20) & 0xff)
72#define DRM_ETHOSU_ARCH_PATCH(x) (((x) >> 16) & 0xf)
73#define DRM_ETHOSU_PRODUCT_MAJOR(x) (((x) >> 12) & 0xf)
74#define DRM_ETHOSU_VERSION_MAJOR(x) (((x) >> 8) & 0xf)
75#define DRM_ETHOSU_VERSION_MINOR(x) (((x) >> 4) & 0xff)
76#define DRM_ETHOSU_VERSION_STATUS(x) ((x) & 0xf)
77
78 /** @gpu_rev: GPU revision. */
79 __u32 config;
80
81 __u32 sram_size;
82};
83
84/**
85 * struct drm_ethosu_dev_query - Arguments passed to DRM_ETHOSU_IOCTL_DEV_QUERY
86 */
87struct drm_ethosu_dev_query {
88 /** @type: the query type (see drm_ethosu_dev_query_type). */
89 __u32 type;
90
91 /**
92 * @size: size of the type being queried.
93 *
94 * If pointer is NULL, size is updated by the driver to provide the
95 * output structure size. If pointer is not NULL, the driver will
96 * only copy min(size, actual_structure_size) bytes to the pointer,
97 * and update the size accordingly. This allows us to extend query
98 * types without breaking userspace.
99 */
100 __u32 size;
101
102 /**
103 * @pointer: user pointer to a query type struct.
104 *
105 * Pointer can be NULL, in which case, nothing is copied, but the
106 * actual structure size is returned. If not NULL, it must point to
107 * a location that's large enough to hold size bytes.
108 */
109 __u64 pointer;
110};
111
112/**
113 * enum drm_ethosu_bo_flags - Buffer object flags, passed at creation time.
114 */
115enum drm_ethosu_bo_flags {
116 /**
117 * @DRM_ETHOSU_BO_NO_MMAP: The buffer object will never be CPU-mapped
118 * in userspace.
119 */
120 DRM_ETHOSU_BO_NO_MMAP = (1 << 0),
121};
122
123/**
124 * struct drm_ethosu_bo_create - Arguments passed to DRM_IOCTL_ETHOSU_BO_CREATE.
125 */
126struct drm_ethosu_bo_create {
127 /**
128 * @size: Requested size for the object
129 *
130 * The (page-aligned) allocated size for the object will be returned.
131 */
132 __u64 size;
133
134 /**
135 * @flags: Flags. Must be a combination of drm_ethosu_bo_flags flags.
136 */
137 __u32 flags;
138
139 /**
140 * @handle: Returned handle for the object.
141 *
142 * Object handles are nonzero.
143 */
144 __u32 handle;
145};
146
147/**
148 * struct drm_ethosu_bo_mmap_offset - Arguments passed to DRM_IOCTL_ETHOSU_BO_MMAP_OFFSET.
149 */
150struct drm_ethosu_bo_mmap_offset {
151 /** @handle: Handle of the object we want an mmap offset for. */
152 __u32 handle;
153
154 /** @pad: MBZ. */
155 __u32 pad;
156
157 /** @offset: The fake offset to use for subsequent mmap calls. */
158 __u64 offset;
159};
160
161/**
162 * struct drm_ethosu_wait_bo - ioctl argument for waiting for
163 * completion of the last DRM_ETHOSU_SUBMIT on a BO.
164 *
165 * This is useful for cases where multiple processes might be
166 * rendering to a BO and you want to wait for all rendering to be
167 * completed.
168 */
169struct drm_ethosu_bo_wait {
170 __u32 handle;
171 __u32 pad;
172 __s64 timeout_ns; /* absolute */
173};
174
175struct drm_ethosu_cmdstream_bo_create {
176 /* Size of the data argument. */
177 __u32 size;
178
179 /* Flags, currently must be 0. */
180 __u32 flags;
181
182 /* Pointer to the data. */
183 __u64 data;
184
185 /** Returned GEM handle for the BO. */
186 __u32 handle;
187
188 /* Pad, must be 0. */
189 __u32 pad;
190};
191
192/**
193 * struct drm_ethosu_job - A job to be run on the NPU
194 *
195 * The kernel will schedule the execution of this job taking into account its
196 * dependencies with other jobs. All tasks in the same job will be executed
197 * sequentially on the same core, to benefit from memory residency in SRAM.
198 */
199struct drm_ethosu_job {
200 /** Input: BO handle for cmdstream. */
201 __u32 cmd_bo;
202
203 /** Input: Amount of SRAM to use. */
204 __u32 sram_size;
205
206#define ETHOSU_MAX_REGIONS 8
207 /** Input: Array of BO handles for each region. */
208 __u32 region_bo_handles[ETHOSU_MAX_REGIONS];
209};
210
211/**
212 * struct drm_ethosu_submit - ioctl argument for submitting commands to the NPU.
213 *
214 * The kernel will schedule the execution of these jobs in dependency order.
215 */
216struct drm_ethosu_submit {
217 /** Input: Pointer to an array of struct drm_ethosu_job. */
218 __u64 jobs;
219
220 /** Input: Number of jobs passed in. */
221 __u32 job_count;
222
223 /** Reserved, must be zero. */
224 __u32 pad;
225};
226
227/**
228 * DRM_IOCTL_ETHOSU() - Build a ethosu IOCTL number
229 * @__access: Access type. Must be R, W or RW.
230 * @__id: One of the DRM_ETHOSU_xxx id.
231 * @__type: Suffix of the type being passed to the IOCTL.
232 *
233 * Don't use this macro directly, use the DRM_IOCTL_ETHOSU_xxx
234 * values instead.
235 *
236 * Return: An IOCTL number to be passed to ioctl() from userspace.
237 */
238#define DRM_IOCTL_ETHOSU(__access, __id, __type) \
239 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_ETHOSU_ ## __id, \
240 struct drm_ethosu_ ## __type)
241
242enum {
243 DRM_IOCTL_ETHOSU_DEV_QUERY =
244 DRM_IOCTL_ETHOSU(WR, DEV_QUERY, dev_query),
245 DRM_IOCTL_ETHOSU_BO_CREATE =
246 DRM_IOCTL_ETHOSU(WR, BO_CREATE, bo_create),
247 DRM_IOCTL_ETHOSU_BO_WAIT =
248 DRM_IOCTL_ETHOSU(WR, BO_WAIT, bo_wait),
249 DRM_IOCTL_ETHOSU_BO_MMAP_OFFSET =
250 DRM_IOCTL_ETHOSU(WR, BO_MMAP_OFFSET, bo_mmap_offset),
251 DRM_IOCTL_ETHOSU_CMDSTREAM_BO_CREATE =
252 DRM_IOCTL_ETHOSU(WR, CMDSTREAM_BO_CREATE, cmdstream_bo_create),
253 DRM_IOCTL_ETHOSU_SUBMIT =
254 DRM_IOCTL_ETHOSU(WR, SUBMIT, submit),
255};
256
257#if defined(__cplusplus)
258}
259#endif
260
261#endif /* _ETHOSU_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/ivpu_accel.h+63
......@@ -25,6 +25,7 @@ extern "C" {
2525#define DRM_IVPU_CMDQ_CREATE 0x0b
2626#define DRM_IVPU_CMDQ_DESTROY 0x0c
2727#define DRM_IVPU_CMDQ_SUBMIT 0x0d
28#define DRM_IVPU_BO_CREATE_FROM_USERPTR 0x0e
2829
2930#define DRM_IOCTL_IVPU_GET_PARAM \
3031 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
......@@ -69,6 +70,10 @@ extern "C" {
6970#define DRM_IOCTL_IVPU_CMDQ_SUBMIT \
7071 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_CMDQ_SUBMIT, struct drm_ivpu_cmdq_submit)
7172
73#define DRM_IOCTL_IVPU_BO_CREATE_FROM_USERPTR \
74 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_CREATE_FROM_USERPTR, \
75 struct drm_ivpu_bo_create_from_userptr)
76
7277/**
7378 * DOC: contexts
7479 *
......@@ -90,6 +95,7 @@ extern "C" {
9095#define DRM_IVPU_PARAM_TILE_CONFIG 11
9196#define DRM_IVPU_PARAM_SKU 12
9297#define DRM_IVPU_PARAM_CAPABILITIES 13
98#define DRM_IVPU_PARAM_PREEMPT_BUFFER_SIZE 14
9399
94100#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
95101
......@@ -126,6 +132,13 @@ extern "C" {
126132 * command queue destroy and submit job on specific command queue.
127133 */
128134#define DRM_IVPU_CAP_MANAGE_CMDQ 3
135/**
136 * DRM_IVPU_CAP_BO_CREATE_FROM_USERPTR
137 *
138 * Driver supports creating buffer objects from user space memory pointers.
139 * This allows creating GEM buffers from existing user memory regions.
140 */
141#define DRM_IVPU_CAP_BO_CREATE_FROM_USERPTR 4
129142
130143/**
131144 * struct drm_ivpu_param - Get/Set VPU parameters
......@@ -176,6 +189,9 @@ struct drm_ivpu_param {
176189 *
177190 * %DRM_IVPU_PARAM_CAPABILITIES:
178191 * Supported capabilities (read-only)
192 *
193 * %DRM_IVPU_PARAM_PREEMPT_BUFFER_SIZE:
194 * Size of the preemption buffer (read-only)
179195 */
180196 __u32 param;
181197
......@@ -190,6 +206,7 @@ struct drm_ivpu_param {
190206#define DRM_IVPU_BO_HIGH_MEM DRM_IVPU_BO_SHAVE_MEM
191207#define DRM_IVPU_BO_MAPPABLE 0x00000002
192208#define DRM_IVPU_BO_DMA_MEM 0x00000004
209#define DRM_IVPU_BO_READ_ONLY 0x00000008
193210
194211#define DRM_IVPU_BO_CACHED 0x00000000
195212#define DRM_IVPU_BO_UNCACHED 0x00010000
......@@ -200,6 +217,7 @@ struct drm_ivpu_param {
200217 (DRM_IVPU_BO_HIGH_MEM | \
201218 DRM_IVPU_BO_MAPPABLE | \
202219 DRM_IVPU_BO_DMA_MEM | \
220 DRM_IVPU_BO_READ_ONLY | \
203221 DRM_IVPU_BO_CACHE_MASK)
204222
205223/**
......@@ -251,6 +269,44 @@ struct drm_ivpu_bo_create {
251269 __u64 vpu_addr;
252270};
253271
272/**
273 * struct drm_ivpu_bo_create_from_userptr - Create dma-buf from user pointer
274 *
275 * Create a GEM buffer object from a user pointer to a memory region.
276 */
277struct drm_ivpu_bo_create_from_userptr {
278 /** @user_ptr: User pointer to memory region (must be page aligned) */
279 __u64 user_ptr;
280
281 /** @size: Size of the memory region in bytes (must be page aligned) */
282 __u64 size;
283
284 /**
285 * @flags:
286 *
287 * Supported flags:
288 *
289 * %DRM_IVPU_BO_HIGH_MEM:
290 *
291 * Allocate VPU address from >4GB range.
292 *
293 * %DRM_IVPU_BO_DMA_MEM:
294 *
295 * Allocate from DMA memory range accessible by hardware DMA.
296 *
297 * %DRM_IVPU_BO_READ_ONLY:
298 *
299 * Allocate as a read-only buffer object.
300 */
301 __u32 flags;
302
303 /** @handle: Returned GEM object handle */
304 __u32 handle;
305
306 /** @vpu_addr: Returned VPU virtual address */
307 __u64 vpu_addr;
308};
309
254310/**
255311 * struct drm_ivpu_bo_info - Query buffer object info
256312 */
......@@ -371,6 +427,13 @@ struct drm_ivpu_cmdq_submit {
371427 * to be executed. The offset has to be 8-byte aligned.
372428 */
373429 __u32 commands_offset;
430 /**
431 * @preempt_buffer_index:
432 *
433 * Index of the preemption buffer in the buffers_ptr array.
434 */
435 __u32 preempt_buffer_index;
436 __u32 reserved;
374437};
375438
376439/* drm_ivpu_bo_wait job status codes */
lib/libc/include/any-linux-any/drm/panfrost_drm.h+123-27
......@@ -22,6 +22,8 @@ extern "C" {
2222#define DRM_PANFROST_PERFCNT_DUMP 0x07
2323#define DRM_PANFROST_MADVISE 0x08
2424#define DRM_PANFROST_SET_LABEL_BO 0x09
25#define DRM_PANFROST_JM_CTX_CREATE 0x0a
26#define DRM_PANFROST_JM_CTX_DESTROY 0x0b
2527
2628#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
2729#define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
......@@ -31,6 +33,8 @@ extern "C" {
3133#define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
3234#define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
3335#define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)
36#define DRM_IOCTL_PANFROST_JM_CTX_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_CREATE, struct drm_panfrost_jm_ctx_create)
37#define DRM_IOCTL_PANFROST_JM_CTX_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_DESTROY, struct drm_panfrost_jm_ctx_destroy)
3438
3539/*
3640 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
......@@ -50,27 +54,47 @@ extern "C" {
5054 * This asks the kernel to have the GPU execute a render command list.
5155 */
5256struct drm_panfrost_submit {
53
54 /** Address to GPU mapping of job descriptor */
57 /**
58 * @jc: Address to GPU mapping of job descriptor
59 */
5560 __u64 jc;
56
57 /** An optional array of sync objects to wait on before starting this job. */
61 /**
62 * @in_syncs: An optional array of sync objects to wait on
63 * before starting this job.
64 */
5865 __u64 in_syncs;
59
60 /** Number of sync objects to wait on before starting this job. */
66 /**
67 * @in_sync_count: Number of sync objects to wait on before
68 * starting this job.
69 */
6170 __u32 in_sync_count;
62
63 /** An optional sync object to place the completion fence in. */
71 /**
72 * @out_sync: An optional sync object to place the completion fence in.
73 */
6474 __u32 out_sync;
65
66 /** Pointer to a u32 array of the BOs that are referenced by the job. */
75 /**
76 * @bo_handles: Pointer to a u32 array of the BOs that are
77 * referenced by the job.
78 */
6779 __u64 bo_handles;
68
69 /** Number of BO handles passed in (size is that times 4). */
80 /**
81 * @bo_handle_count: Number of BO handles passed in (size is
82 * that times 4).
83 */
7084 __u32 bo_handle_count;
71
72 /** A combination of PANFROST_JD_REQ_* */
85 /**
86 * @requirements: A combination of PANFROST_JD_REQ_*
87 */
7388 __u32 requirements;
89 /**
90 * @jm_ctx_handle: JM context handle. Zero if you want to use the
91 * default context.
92 */
93 __u32 jm_ctx_handle;
94 /**
95 * @pad: Padding field. Must be zero.
96 */
97 __u32 pad;
7498};
7599
76100/**
......@@ -82,9 +106,18 @@ struct drm_panfrost_submit {
82106 * completed.
83107 */
84108struct drm_panfrost_wait_bo {
109 /**
110 * @handle: Handle for the object to wait for.
111 */
85112 __u32 handle;
113 /**
114 * @pad: Padding, must be zero-filled.
115 */
86116 __u32 pad;
87 __s64 timeout_ns; /* absolute */
117 /**
118 * @timeout_ns: absolute number of nanoseconds to wait.
119 */
120 __s64 timeout_ns;
88121};
89122
90123/* Valid flags to pass to drm_panfrost_create_bo */
......@@ -97,16 +130,26 @@ struct drm_panfrost_wait_bo {
97130 * The flags argument is a bit mask of PANFROST_BO_* flags.
98131 */
99132struct drm_panfrost_create_bo {
133 /**
134 * @size: size of shmem/BO area to create (bytes)
135 */
100136 __u32 size;
137 /**
138 * @flags: see PANFROST_BO_* flags
139 */
101140 __u32 flags;
102 /** Returned GEM handle for the BO. */
141 /**
142 * @handle: Returned GEM handle for the BO.
143 */
103144 __u32 handle;
104 /* Pad, must be zero-filled. */
145 /**
146 * @pad: Padding, must be zero-filled.
147 */
105148 __u32 pad;
106149 /**
107 * Returned offset for the BO in the GPU address space. This offset
108 * is private to the DRM fd and is valid for the lifetime of the GEM
109 * handle.
150 * @offset: Returned offset for the BO in the GPU address space.
151 * This offset is private to the DRM fd and is valid for the
152 * lifetime of the GEM handle.
110153 *
111154 * This offset value will always be nonzero, since various HW
112155 * units treat 0 specially.
......@@ -126,10 +169,17 @@ struct drm_panfrost_create_bo {
126169 * used in a future extension.
127170 */
128171struct drm_panfrost_mmap_bo {
129 /** Handle for the object being mapped. */
172 /**
173 * @handle: Handle for the object being mapped.
174 */
130175 __u32 handle;
176 /**
177 * @flags: currently not used (should be zero)
178 */
131179 __u32 flags;
132 /** offset into the drm node to use for subsequent mmap call. */
180 /**
181 * @offset: offset into the drm node to use for subsequent mmap call.
182 */
133183 __u64 offset;
134184};
135185
......@@ -177,6 +227,7 @@ enum drm_panfrost_param {
177227 DRM_PANFROST_PARAM_AFBC_FEATURES,
178228 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,
179229 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,
230 DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,
180231};
181232
182233struct drm_panfrost_get_param {
......@@ -185,7 +236,7 @@ struct drm_panfrost_get_param {
185236 __u64 value;
186237};
187238
188/**
239/*
189240 * Returns the offset for the BO in the GPU address space for this DRM fd.
190241 * This is the same value returned by drm_panfrost_create_bo, if that was called
191242 * from this DRM fd.
......@@ -233,12 +284,14 @@ struct drm_panfrost_madvise {
233284 * struct drm_panfrost_set_label_bo - ioctl argument for labelling Panfrost BOs.
234285 */
235286struct drm_panfrost_set_label_bo {
236 /** @handle: Handle of the buffer object to label. */
287 /**
288 * @handle: Handle of the buffer object to label.
289 */
237290 __u32 handle;
238
239 /** @pad: MBZ. */
291 /**
292 * @pad: Must be zero.
293 */
240294 __u32 pad;
241
242295 /**
243296 * @label: User pointer to a NUL-terminated string
244297 *
......@@ -299,6 +352,49 @@ struct panfrost_dump_registers {
299352 __u32 value;
300353};
301354
355enum drm_panfrost_jm_ctx_priority {
356 /**
357 * @PANFROST_JM_CTX_PRIORITY_LOW: Low priority context.
358 */
359 PANFROST_JM_CTX_PRIORITY_LOW = 0,
360
361 /**
362 * @PANFROST_JM_CTX_PRIORITY_MEDIUM: Medium priority context.
363 */
364 PANFROST_JM_CTX_PRIORITY_MEDIUM,
365
366 /**
367 * @PANFROST_JM_CTX_PRIORITY_HIGH: High priority context.
368 *
369 * Requires CAP_SYS_NICE or DRM_MASTER.
370 */
371 PANFROST_JM_CTX_PRIORITY_HIGH,
372};
373
374struct drm_panfrost_jm_ctx_create {
375 /**
376 * @handle: Handle of the created JM context
377 */
378 __u32 handle;
379 /**
380 * @priority: Context priority (see enum drm_panfrost_jm_ctx_priority).
381 */
382 __u32 priority;
383};
384
385struct drm_panfrost_jm_ctx_destroy {
386 /**
387 * @handle: Handle of the JM context to destroy.
388 *
389 * Must be a valid context handle returned by DRM_IOCTL_PANTHOR_JM_CTX_CREATE.
390 */
391 __u32 handle;
392 /**
393 * @pad: Padding field, must be zero.
394 */
395 __u32 pad;
396};
397
302398#if defined(__cplusplus)
303399}
304400#endif
lib/libc/include/any-linux-any/drm/panthor_drm.h+3
......@@ -327,6 +327,9 @@ struct drm_panthor_gpu_info {
327327
328328 /** @pad: MBZ. */
329329 __u32 pad;
330
331 /** @gpu_features: Bitmask describing supported GPU-wide features */
332 __u64 gpu_features;
330333};
331334
332335/**
lib/libc/include/any-linux-any/drm/rocket_accel.h created+142
......@@ -0,0 +1,142 @@
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2024 Tomeu Vizoso
4 */
5#ifndef __DRM_UAPI_ROCKET_ACCEL_H__
6#define __DRM_UAPI_ROCKET_ACCEL_H__
7
8#include "drm.h"
9
10#if defined(__cplusplus)
11extern "C" {
12#endif
13
14#define DRM_ROCKET_CREATE_BO 0x00
15#define DRM_ROCKET_SUBMIT 0x01
16#define DRM_ROCKET_PREP_BO 0x02
17#define DRM_ROCKET_FINI_BO 0x03
18
19#define DRM_IOCTL_ROCKET_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_ROCKET_CREATE_BO, struct drm_rocket_create_bo)
20#define DRM_IOCTL_ROCKET_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_ROCKET_SUBMIT, struct drm_rocket_submit)
21#define DRM_IOCTL_ROCKET_PREP_BO DRM_IOW(DRM_COMMAND_BASE + DRM_ROCKET_PREP_BO, struct drm_rocket_prep_bo)
22#define DRM_IOCTL_ROCKET_FINI_BO DRM_IOW(DRM_COMMAND_BASE + DRM_ROCKET_FINI_BO, struct drm_rocket_fini_bo)
23
24/**
25 * struct drm_rocket_create_bo - ioctl argument for creating Rocket BOs.
26 *
27 */
28struct drm_rocket_create_bo {
29 /** Input: Size of the requested BO. */
30 __u32 size;
31
32 /** Output: GEM handle for the BO. */
33 __u32 handle;
34
35 /**
36 * Output: DMA address for the BO in the NPU address space. This address
37 * is private to the DRM fd and is valid for the lifetime of the GEM
38 * handle.
39 */
40 __u64 dma_address;
41
42 /** Output: Offset into the drm node to use for subsequent mmap call. */
43 __u64 offset;
44};
45
46/**
47 * struct drm_rocket_prep_bo - ioctl argument for starting CPU ownership of the BO.
48 *
49 * Takes care of waiting for any NPU jobs that might still use the NPU and performs cache
50 * synchronization.
51 */
52struct drm_rocket_prep_bo {
53 /** Input: GEM handle of the buffer object. */
54 __u32 handle;
55
56 /** Reserved, must be zero. */
57 __u32 reserved;
58
59 /** Input: Amount of time to wait for NPU jobs. */
60 __s64 timeout_ns;
61};
62
63/**
64 * struct drm_rocket_fini_bo - ioctl argument for finishing CPU ownership of the BO.
65 *
66 * Synchronize caches for NPU access.
67 */
68struct drm_rocket_fini_bo {
69 /** Input: GEM handle of the buffer object. */
70 __u32 handle;
71
72 /** Reserved, must be zero. */
73 __u32 reserved;
74};
75
76/**
77 * struct drm_rocket_task - A task to be run on the NPU
78 *
79 * A task is the smallest unit of work that can be run on the NPU.
80 */
81struct drm_rocket_task {
82 /** Input: DMA address to NPU mapping of register command buffer */
83 __u32 regcmd;
84
85 /** Input: Number of commands in the register command buffer */
86 __u32 regcmd_count;
87};
88
89/**
90 * struct drm_rocket_job - A job to be run on the NPU
91 *
92 * The kernel will schedule the execution of this job taking into account its
93 * dependencies with other jobs. All tasks in the same job will be executed
94 * sequentially on the same core, to benefit from memory residency in SRAM.
95 */
96struct drm_rocket_job {
97 /** Input: Pointer to an array of struct drm_rocket_task. */
98 __u64 tasks;
99
100 /** Input: Pointer to a u32 array of the BOs that are read by the job. */
101 __u64 in_bo_handles;
102
103 /** Input: Pointer to a u32 array of the BOs that are written to by the job. */
104 __u64 out_bo_handles;
105
106 /** Input: Number of tasks passed in. */
107 __u32 task_count;
108
109 /** Input: Size in bytes of the structs in the @tasks field. */
110 __u32 task_struct_size;
111
112 /** Input: Number of input BO handles passed in (size is that times 4). */
113 __u32 in_bo_handle_count;
114
115 /** Input: Number of output BO handles passed in (size is that times 4). */
116 __u32 out_bo_handle_count;
117};
118
119/**
120 * struct drm_rocket_submit - ioctl argument for submitting commands to the NPU.
121 *
122 * The kernel will schedule the execution of these jobs in dependency order.
123 */
124struct drm_rocket_submit {
125 /** Input: Pointer to an array of struct drm_rocket_job. */
126 __u64 jobs;
127
128 /** Input: Number of jobs passed in. */
129 __u32 job_count;
130
131 /** Input: Size in bytes of the structs in the @jobs field. */
132 __u32 job_struct_size;
133
134 /** Reserved, must be zero. */
135 __u64 reserved;
136};
137
138#if defined(__cplusplus)
139}
140#endif
141
142#endif /* __DRM_UAPI_ROCKET_ACCEL_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/v3d_drm.h+2
......@@ -294,6 +294,8 @@ enum drm_v3d_param {
294294 DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
295295 DRM_V3D_PARAM_MAX_PERF_COUNTERS,
296296 DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES,
297 DRM_V3D_PARAM_GLOBAL_RESET_COUNTER,
298 DRM_V3D_PARAM_CONTEXT_RESET_COUNTER,
297299};
298300
299301struct drm_v3d_get_param {
lib/libc/include/any-linux-any/drm/xe_drm.h+302-2
......@@ -81,6 +81,8 @@ extern "C" {
8181 * - &DRM_IOCTL_XE_EXEC
8282 * - &DRM_IOCTL_XE_WAIT_USER_FENCE
8383 * - &DRM_IOCTL_XE_OBSERVATION
84 * - &DRM_IOCTL_XE_MADVISE
85 * - &DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS
8486 */
8587
8688/*
......@@ -102,6 +104,8 @@ extern "C" {
102104#define DRM_XE_EXEC 0x09
103105#define DRM_XE_WAIT_USER_FENCE 0x0a
104106#define DRM_XE_OBSERVATION 0x0b
107#define DRM_XE_MADVISE 0x0c
108#define DRM_XE_VM_QUERY_MEM_RANGE_ATTRS 0x0d
105109
106110/* Must be kept compact -- no holes */
107111
......@@ -117,6 +121,8 @@ extern "C" {
117121#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)
118122#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
119123#define DRM_IOCTL_XE_OBSERVATION DRM_IOW(DRM_COMMAND_BASE + DRM_XE_OBSERVATION, struct drm_xe_observation_param)
124#define DRM_IOCTL_XE_MADVISE DRM_IOW(DRM_COMMAND_BASE + DRM_XE_MADVISE, struct drm_xe_madvise)
125#define DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_VM_QUERY_MEM_RANGE_ATTRS, struct drm_xe_vm_query_mem_range_attr)
120126
121127/**
122128 * DOC: Xe IOCTL Extensions
......@@ -760,8 +766,16 @@ struct drm_xe_device_query {
760766 * gem creation
761767 *
762768 * The @flags can be:
763 * - %DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING
764 * - %DRM_XE_GEM_CREATE_FLAG_SCANOUT
769 * - %DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING - Modify the GEM object
770 * allocation strategy by deferring physical memory allocation
771 * until the object is either bound to a virtual memory region via
772 * VM_BIND or accessed by the CPU. As a result, no backing memory is
773 * reserved at the time of GEM object creation.
774 * - %DRM_XE_GEM_CREATE_FLAG_SCANOUT - Indicates that the GEM object is
775 * intended for scanout via the display engine. When set, kernel ensures
776 * that the allocation is placed in a memory region compatible with the
777 * display engine requirements. This may impose restrictions on tiling,
778 * alignment, and memory placement to guarantee proper display functionality.
765779 * - %DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM - When using VRAM as a
766780 * possible placement, ensure that the corresponding VRAM allocation
767781 * will always use the CPU accessible part of VRAM. This is important
......@@ -1003,6 +1017,24 @@ struct drm_xe_vm_destroy {
10031017 * valid on VMs with DRM_XE_VM_CREATE_FLAG_FAULT_MODE set. The CPU address
10041018 * mirror flag are only valid for DRM_XE_VM_BIND_OP_MAP operations, the BO
10051019 * handle MBZ, and the BO offset MBZ.
1020 * - %DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET - Can be used in combination with
1021 * %DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR to reset madvises when the underlying
1022 * CPU address space range is unmapped (typically with munmap(2) or brk(2)).
1023 * The madvise values set with &DRM_IOCTL_XE_MADVISE are reset to the values
1024 * that were present immediately after the &DRM_IOCTL_XE_VM_BIND.
1025 * The reset GPU virtual address range is the intersection of the range bound
1026 * using &DRM_IOCTL_XE_VM_BIND and the virtual CPU address space range
1027 * unmapped.
1028 * This functionality is present to mimic the behaviour of CPU address space
1029 * madvises set using madvise(2), which are typically reset on unmap.
1030 * Note: free(3) may or may not call munmap(2) and/or brk(2), and may thus
1031 * not invoke autoreset. Neither will stack variables going out of scope.
1032 * Therefore it's recommended to always explicitly reset the madvises when
1033 * freeing the memory backing a region used in a &DRM_IOCTL_XE_MADVISE call.
1034 *
1035 * The @prefetch_mem_region_instance for %DRM_XE_VM_BIND_OP_PREFETCH can also be:
1036 * - %DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC, which ensures prefetching occurs in
1037 * the memory region advised by madvise.
10061038 */
10071039struct drm_xe_vm_bind_op {
10081040 /** @extensions: Pointer to the first extension struct, if any */
......@@ -1105,9 +1137,11 @@ struct drm_xe_vm_bind_op {
11051137#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3)
11061138#define DRM_XE_VM_BIND_FLAG_CHECK_PXP (1 << 4)
11071139#define DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR (1 << 5)
1140#define DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET (1 << 6)
11081141 /** @flags: Bind flags */
11091142 __u32 flags;
11101143
1144#define DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC -1
11111145 /**
11121146 * @prefetch_mem_region_instance: Memory region to prefetch VMA to.
11131147 * It is a region instance, not a mask.
......@@ -1429,6 +1463,7 @@ struct drm_xe_exec {
14291463 /** @exec_queue_id: Exec queue ID for the batch buffer */
14301464 __u32 exec_queue_id;
14311465
1466#define DRM_XE_MAX_SYNCS 1024
14321467 /** @num_syncs: Amount of struct drm_xe_sync in array. */
14331468 __u32 num_syncs;
14341469
......@@ -1974,6 +2009,271 @@ struct drm_xe_query_eu_stall {
19742009 __u64 sampling_rates[];
19752010};
19762011
2012/**
2013 * struct drm_xe_madvise - Input of &DRM_IOCTL_XE_MADVISE
2014 *
2015 * This structure is used to set memory attributes for a virtual address range
2016 * in a VM. The type of attribute is specified by @type, and the corresponding
2017 * union member is used to provide additional parameters for @type.
2018 *
2019 * Supported attribute types:
2020 * - DRM_XE_MEM_RANGE_ATTR_PREFERRED_LOC: Set preferred memory location.
2021 * - DRM_XE_MEM_RANGE_ATTR_ATOMIC: Set atomic access policy.
2022 * - DRM_XE_MEM_RANGE_ATTR_PAT: Set page attribute table index.
2023 *
2024 * Example:
2025 *
2026 * .. code-block:: C
2027 *
2028 * struct drm_xe_madvise madvise = {
2029 * .vm_id = vm_id,
2030 * .start = 0x100000,
2031 * .range = 0x2000,
2032 * .type = DRM_XE_MEM_RANGE_ATTR_ATOMIC,
2033 * .atomic_val = DRM_XE_ATOMIC_DEVICE,
2034 * };
2035 *
2036 * ioctl(fd, DRM_IOCTL_XE_MADVISE, &madvise);
2037 *
2038 */
2039struct drm_xe_madvise {
2040 /** @extensions: Pointer to the first extension struct, if any */
2041 __u64 extensions;
2042
2043 /** @start: start of the virtual address range */
2044 __u64 start;
2045
2046 /** @range: size of the virtual address range */
2047 __u64 range;
2048
2049 /** @vm_id: vm_id of the virtual range */
2050 __u32 vm_id;
2051
2052#define DRM_XE_MEM_RANGE_ATTR_PREFERRED_LOC 0
2053#define DRM_XE_MEM_RANGE_ATTR_ATOMIC 1
2054#define DRM_XE_MEM_RANGE_ATTR_PAT 2
2055 /** @type: type of attribute */
2056 __u32 type;
2057
2058 union {
2059 /**
2060 * @preferred_mem_loc: preferred memory location
2061 *
2062 * Used when @type == DRM_XE_MEM_RANGE_ATTR_PREFERRED_LOC
2063 *
2064 * Supported values for @preferred_mem_loc.devmem_fd:
2065 * - DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE: set vram of fault tile as preferred loc
2066 * - DRM_XE_PREFERRED_LOC_DEFAULT_SYSTEM: set smem as preferred loc
2067 *
2068 * Supported values for @preferred_mem_loc.migration_policy:
2069 * - DRM_XE_MIGRATE_ALL_PAGES
2070 * - DRM_XE_MIGRATE_ONLY_SYSTEM_PAGES
2071 */
2072 struct {
2073#define DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE 0
2074#define DRM_XE_PREFERRED_LOC_DEFAULT_SYSTEM -1
2075 /** @preferred_mem_loc.devmem_fd: fd for preferred loc */
2076 __u32 devmem_fd;
2077
2078#define DRM_XE_MIGRATE_ALL_PAGES 0
2079#define DRM_XE_MIGRATE_ONLY_SYSTEM_PAGES 1
2080 /** @preferred_mem_loc.migration_policy: Page migration policy */
2081 __u16 migration_policy;
2082
2083 /** @preferred_mem_loc.pad : MBZ */
2084 __u16 pad;
2085
2086 /** @preferred_mem_loc.reserved : Reserved */
2087 __u64 reserved;
2088 } preferred_mem_loc;
2089
2090 /**
2091 * @atomic: Atomic access policy
2092 *
2093 * Used when @type == DRM_XE_MEM_RANGE_ATTR_ATOMIC.
2094 *
2095 * Supported values for @atomic.val:
2096 * - DRM_XE_ATOMIC_UNDEFINED: Undefined or default behaviour.
2097 * Support both GPU and CPU atomic operations for system allocator.
2098 * Support GPU atomic operations for normal(bo) allocator.
2099 * - DRM_XE_ATOMIC_DEVICE: Support GPU atomic operations.
2100 * - DRM_XE_ATOMIC_GLOBAL: Support both GPU and CPU atomic operations.
2101 * - DRM_XE_ATOMIC_CPU: Support CPU atomic only, no GPU atomics supported.
2102 */
2103 struct {
2104#define DRM_XE_ATOMIC_UNDEFINED 0
2105#define DRM_XE_ATOMIC_DEVICE 1
2106#define DRM_XE_ATOMIC_GLOBAL 2
2107#define DRM_XE_ATOMIC_CPU 3
2108 /** @atomic.val: value of atomic operation */
2109 __u32 val;
2110
2111 /** @atomic.pad: MBZ */
2112 __u32 pad;
2113
2114 /** @atomic.reserved: Reserved */
2115 __u64 reserved;
2116 } atomic;
2117
2118 /**
2119 * @pat_index: Page attribute table index
2120 *
2121 * Used when @type == DRM_XE_MEM_RANGE_ATTR_PAT.
2122 */
2123 struct {
2124 /** @pat_index.val: PAT index value */
2125 __u32 val;
2126
2127 /** @pat_index.pad: MBZ */
2128 __u32 pad;
2129
2130 /** @pat_index.reserved: Reserved */
2131 __u64 reserved;
2132 } pat_index;
2133 };
2134
2135 /** @reserved: Reserved */
2136 __u64 reserved[2];
2137};
2138
2139/**
2140 * struct drm_xe_mem_range_attr - Output of &DRM_IOCTL_XE_VM_QUERY_MEM_RANGES_ATTRS
2141 *
2142 * This structure is provided by userspace and filled by KMD in response to the
2143 * DRM_IOCTL_XE_VM_QUERY_MEM_RANGES_ATTRS ioctl. It describes memory attributes of
2144 * a memory ranges within a user specified address range in a VM.
2145 *
2146 * The structure includes information such as atomic access policy,
2147 * page attribute table (PAT) index, and preferred memory location.
2148 * Userspace allocates an array of these structures and passes a pointer to the
2149 * ioctl to retrieve attributes for each memory ranges
2150 *
2151 * @extensions: Pointer to the first extension struct, if any
2152 * @start: Start address of the memory range
2153 * @end: End address of the virtual memory range
2154 *
2155 */
2156struct drm_xe_mem_range_attr {
2157 /** @extensions: Pointer to the first extension struct, if any */
2158 __u64 extensions;
2159
2160 /** @start: start of the memory range */
2161 __u64 start;
2162
2163 /** @end: end of the memory range */
2164 __u64 end;
2165
2166 /** @preferred_mem_loc: preferred memory location */
2167 struct {
2168 /** @preferred_mem_loc.devmem_fd: fd for preferred loc */
2169 __u32 devmem_fd;
2170
2171 /** @preferred_mem_loc.migration_policy: Page migration policy */
2172 __u32 migration_policy;
2173 } preferred_mem_loc;
2174
2175 /** @atomic: Atomic access policy */
2176 struct {
2177 /** @atomic.val: atomic attribute */
2178 __u32 val;
2179
2180 /** @atomic.reserved: Reserved */
2181 __u32 reserved;
2182 } atomic;
2183
2184 /** @pat_index: Page attribute table index */
2185 struct {
2186 /** @pat_index.val: PAT index */
2187 __u32 val;
2188
2189 /** @pat_index.reserved: Reserved */
2190 __u32 reserved;
2191 } pat_index;
2192
2193 /** @reserved: Reserved */
2194 __u64 reserved[2];
2195};
2196
2197/**
2198 * struct drm_xe_vm_query_mem_range_attr - Input of &DRM_IOCTL_XE_VM_QUERY_MEM_ATTRIBUTES
2199 *
2200 * This structure is used to query memory attributes of memory regions
2201 * within a user specified address range in a VM. It provides detailed
2202 * information about each memory range, including atomic access policy,
2203 * page attribute table (PAT) index, and preferred memory location.
2204 *
2205 * Userspace first calls the ioctl with @num_mem_ranges = 0,
2206 * @sizeof_mem_ranges_attr = 0 and @vector_of_vma_mem_attr = NULL to retrieve
2207 * the number of memory regions and size of each memory range attribute.
2208 * Then, it allocates a buffer of that size and calls the ioctl again to fill
2209 * the buffer with memory range attributes.
2210 *
2211 * If second call fails with -ENOSPC, it means memory ranges changed between
2212 * first call and now, retry IOCTL again with @num_mem_ranges = 0,
2213 * @sizeof_mem_ranges_attr = 0 and @vector_of_vma_mem_attr = NULL followed by
2214 * Second ioctl call.
2215 *
2216 * Example:
2217 *
2218 * .. code-block:: C
2219 *
2220 * struct drm_xe_vm_query_mem_range_attr query = {
2221 * .vm_id = vm_id,
2222 * .start = 0x100000,
2223 * .range = 0x2000,
2224 * };
2225 *
2226 * // First ioctl call to get num of mem regions and sizeof each attribute
2227 * ioctl(fd, DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS, &query);
2228 *
2229 * // Allocate buffer for the memory region attributes
2230 * void *ptr = malloc(query.num_mem_ranges * query.sizeof_mem_range_attr);
2231 * void *ptr_start = ptr;
2232 *
2233 * query.vector_of_mem_attr = (uintptr_t)ptr;
2234 *
2235 * // Second ioctl call to actually fill the memory attributes
2236 * ioctl(fd, DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS, &query);
2237 *
2238 * // Iterate over the returned memory region attributes
2239 * for (unsigned int i = 0; i < query.num_mem_ranges; ++i) {
2240 * struct drm_xe_mem_range_attr *attr = (struct drm_xe_mem_range_attr *)ptr;
2241 *
2242 * // Do something with attr
2243 *
2244 * // Move pointer by one entry
2245 * ptr += query.sizeof_mem_range_attr;
2246 * }
2247 *
2248 * free(ptr_start);
2249 */
2250struct drm_xe_vm_query_mem_range_attr {
2251 /** @extensions: Pointer to the first extension struct, if any */
2252 __u64 extensions;
2253
2254 /** @vm_id: vm_id of the virtual range */
2255 __u32 vm_id;
2256
2257 /** @num_mem_ranges: number of mem_ranges in range */
2258 __u32 num_mem_ranges;
2259
2260 /** @start: start of the virtual address range */
2261 __u64 start;
2262
2263 /** @range: size of the virtual address range */
2264 __u64 range;
2265
2266 /** @sizeof_mem_range_attr: size of struct drm_xe_mem_range_attr */
2267 __u64 sizeof_mem_range_attr;
2268
2269 /** @vector_of_mem_attr: userptr to array of struct drm_xe_mem_range_attr */
2270 __u64 vector_of_mem_attr;
2271
2272 /** @reserved: Reserved */
2273 __u64 reserved[2];
2274
2275};
2276
19772277#if defined(__cplusplus)
19782278}
19792279#endif
lib/libc/include/any-linux-any/linux/acrn.h+21-15
......@@ -418,26 +418,32 @@ struct acrn_pcidev {
418418};
419419
420420/**
421 * struct acrn_mmiodev - Info for assigning or de-assigning a MMIO device
422 * @name: Name of the MMIO device.
423 * @res[].user_vm_pa: Physical address of User VM of the MMIO region
424 * for the MMIO device.
425 * @res[].service_vm_pa: Physical address of Service VM of the MMIO
426 * region for the MMIO device.
427 * @res[].size: Size of the MMIO region for the MMIO device.
428 * @res[].mem_type: Memory type of the MMIO region for the MMIO
429 * device.
421 * struct acrn_mmio_dev_res - MMIO device resource description
422 * @user_vm_pa: Physical address of User VM of the MMIO region
423 * for the MMIO device.
424 * @service_vm_pa: Physical address of Service VM of the MMIO
425 * region for the MMIO device.
426 * @size: Size of the MMIO region for the MMIO device.
427 * @mem_type: Memory type of the MMIO region for the MMIO
428 * device.
429 */
430struct acrn_mmio_dev_res {
431 __u64 user_vm_pa;
432 __u64 service_vm_pa;
433 __u64 size;
434 __u64 mem_type;
435};
436
437/**
438 * struct acrn_mmiodev - Info for assigning or de-assigning an MMIO device
439 * @name: Name of the MMIO device.
440 * @res: Array of MMIO device descriptions
430441 *
431442 * This structure will be passed to hypervisor directly.
432443 */
433444struct acrn_mmiodev {
434445 __u8 name[8];
435 struct {
436 __u64 user_vm_pa;
437 __u64 service_vm_pa;
438 __u64 size;
439 __u64 mem_type;
440 } res[ACRN_MMIODEV_RES_NUM];
446 struct acrn_mmio_dev_res res[ACRN_MMIODEV_RES_NUM];
441447};
442448
443449/**
lib/libc/include/any-linux-any/linux/android/binder.h+1-1
......@@ -38,7 +38,7 @@ enum {
3838 BINDER_TYPE_PTR = B_PACK_CHARS('p', 't', '*', B_TYPE_LARGE),
3939};
4040
41enum {
41enum flat_binder_object_flags {
4242 FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
4343 FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
4444
lib/libc/include/any-linux-any/linux/android/binder_netlink.h created+38
......@@ -0,0 +1,38 @@
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/binder.yaml */
4/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
6
7#ifndef _LINUX_ANDROID_BINDER_NETLINK_H
8#define _LINUX_ANDROID_BINDER_NETLINK_H
9
10#define BINDER_FAMILY_NAME "binder"
11#define BINDER_FAMILY_VERSION 1
12
13enum {
14 BINDER_A_REPORT_ERROR = 1,
15 BINDER_A_REPORT_CONTEXT,
16 BINDER_A_REPORT_FROM_PID,
17 BINDER_A_REPORT_FROM_TID,
18 BINDER_A_REPORT_TO_PID,
19 BINDER_A_REPORT_TO_TID,
20 BINDER_A_REPORT_IS_REPLY,
21 BINDER_A_REPORT_FLAGS,
22 BINDER_A_REPORT_CODE,
23 BINDER_A_REPORT_DATA_SIZE,
24
25 __BINDER_A_REPORT_MAX,
26 BINDER_A_REPORT_MAX = (__BINDER_A_REPORT_MAX - 1)
27};
28
29enum {
30 BINDER_CMD_REPORT = 1,
31
32 __BINDER_CMD_MAX,
33 BINDER_CMD_MAX = (__BINDER_CMD_MAX - 1)
34};
35
36#define BINDER_MCGRP_REPORT "report"
37
38#endif /* _LINUX_ANDROID_BINDER_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/aspeed-video.h+7
......@@ -8,6 +8,13 @@
88
99#include <linux/v4l2-controls.h>
1010
11/* aspeed video's input types */
12enum aspeed_video_input {
13 VIDEO_INPUT_VGA = 0,
14 VIDEO_INPUT_GFX,
15 VIDEO_INPUT_MAX
16};
17
1118#define V4L2_CID_ASPEED_HQ_MODE (V4L2_CID_USER_ASPEED_BASE + 1)
1219#define V4L2_CID_ASPEED_HQ_JPEG_QUALITY (V4L2_CID_USER_ASPEED_BASE + 2)
1320
lib/libc/include/any-linux-any/linux/audit.h+2
......@@ -148,6 +148,8 @@
148148#define AUDIT_IPE_POLICY_LOAD 1422 /* IPE policy load */
149149#define AUDIT_LANDLOCK_ACCESS 1423 /* Landlock denial */
150150#define AUDIT_LANDLOCK_DOMAIN 1424 /* Landlock domain status */
151#define AUDIT_MAC_TASK_CONTEXTS 1425 /* Multiple LSM task contexts */
152#define AUDIT_MAC_OBJ_CONTEXTS 1426 /* Multiple LSM objext contexts */
151153
152154#define AUDIT_FIRST_KERN_ANOM_MSG 1700
153155#define AUDIT_LAST_KERN_ANOM_MSG 1799
lib/libc/include/any-linux-any/linux/blktrace_api.h+53-2
......@@ -26,11 +26,22 @@ enum blktrace_cat {
2626 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
2727 BLK_TC_FUA = 1 << 15, /* fua requests */
2828
29 BLK_TC_END = 1 << 15, /* we've run out of bits! */
29 BLK_TC_END_V1 = 1 << 15, /* we've run out of bits! */
30
31 BLK_TC_ZONE_APPEND = 1ull << 16, /* zone append */
32 BLK_TC_ZONE_RESET = 1ull << 17, /* zone reset */
33 BLK_TC_ZONE_RESET_ALL = 1ull << 18, /* zone reset all */
34 BLK_TC_ZONE_FINISH = 1ull << 19, /* zone finish */
35 BLK_TC_ZONE_OPEN = 1ull << 20, /* zone open */
36 BLK_TC_ZONE_CLOSE = 1ull << 21, /* zone close */
37
38 BLK_TC_WRITE_ZEROES = 1ull << 22, /* write-zeroes */
39
40 BLK_TC_END_V2 = 1ull << 22,
3041};
3142
3243#define BLK_TC_SHIFT (16)
33#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
44#define BLK_TC_ACT(act) ((u64)(act) << BLK_TC_SHIFT)
3445
3546/*
3647 * Basic trace actions
......@@ -53,6 +64,8 @@ enum blktrace_act {
5364 __BLK_TA_REMAP, /* bio was remapped */
5465 __BLK_TA_ABORT, /* request aborted */
5566 __BLK_TA_DRV_DATA, /* driver-specific binary data */
67 __BLK_TA_ZONE_PLUG, /* zone write plug was plugged */
68 __BLK_TA_ZONE_UNPLUG, /* zone write plug was unplugged */
5669 __BLK_TA_CGROUP = 1 << 8, /* from a cgroup*/
5770};
5871
......@@ -88,12 +101,19 @@ enum blktrace_notify {
88101#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
89102#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
90103
104#define BLK_TA_ZONE_APPEND (__BLK_TA_COMPLETE |\
105 BLK_TC_ACT(BLK_TC_ZONE_APPEND))
106#define BLK_TA_ZONE_PLUG (__BLK_TA_ZONE_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
107#define BLK_TA_ZONE_UNPLUG (__BLK_TA_ZONE_UNPLUG |\
108 BLK_TC_ACT(BLK_TC_QUEUE))
109
91110#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
92111#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
93112#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
94113
95114#define BLK_IO_TRACE_MAGIC 0x65617400
96115#define BLK_IO_TRACE_VERSION 0x07
116#define BLK_IO_TRACE2_VERSION 0x08
97117
98118/*
99119 * The trace itself
......@@ -113,6 +133,21 @@ struct blk_io_trace {
113133 /* cgroup id will be stored here if exists */
114134};
115135
136struct blk_io_trace2 {
137 __u32 magic; /* MAGIC << 8 | BLK_IO_TRACE2_VERSION */
138 __u32 sequence; /* event number */
139 __u64 time; /* in nanoseconds */
140 __u64 sector; /* disk offset */
141 __u32 bytes; /* transfer length */
142 __u32 pid; /* who did it */
143 __u64 action; /* what happened */
144 __u32 device; /* device number */
145 __u32 cpu; /* on what cpu did it happen */
146 __u16 error; /* completion error */
147 __u16 pdu_len; /* length of data after this trace */
148 __u8 pad[12];
149 /* cgroup id will be stored here if it exists */
150};
116151/*
117152 * The remap event
118153 */
......@@ -129,6 +164,7 @@ enum {
129164};
130165
131166#define BLKTRACE_BDEV_SIZE 32
167#define BLKTRACE_BDEV_SIZE2 64
132168
133169/*
134170 * User setup structure passed with BLKTRACESETUP
......@@ -143,4 +179,19 @@ struct blk_user_trace_setup {
143179 __u32 pid;
144180};
145181
182/*
183 * User setup structure passed with BLKTRACESETUP2
184 */
185struct blk_user_trace_setup2 {
186 char name[BLKTRACE_BDEV_SIZE2]; /* output */
187 __u64 act_mask; /* input */
188 __u32 buf_size; /* input */
189 __u32 buf_nr; /* input */
190 __u64 start_lba;
191 __u64 end_lba;
192 __u32 pid;
193 __u32 flags; /* currently unused */
194 __u64 reserved[11];
195};
196
146197#endif /* BLKTRACE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blkzoned.h+43-5
......@@ -48,6 +48,8 @@ enum blk_zone_type {
4848 * FINISH ZONE command.
4949 * @BLK_ZONE_COND_READONLY: The zone is read-only.
5050 * @BLK_ZONE_COND_OFFLINE: The zone is offline (sectors cannot be read/written).
51 * @BLK_ZONE_COND_ACTIVE: The zone is either implicitly open, explicitly open,
52 * or closed.
5153 *
5254 * The Zone Condition state machine in the ZBC/ZAC standards maps the above
5355 * deinitions as:
......@@ -61,6 +63,13 @@ enum blk_zone_type {
6163 *
6264 * Conditions 0x5 to 0xC are reserved by the current ZBC/ZAC spec and should
6365 * be considered invalid.
66 *
67 * The condition BLK_ZONE_COND_ACTIVE is used only with cached zone reports.
68 * It is used to report any of the BLK_ZONE_COND_IMP_OPEN,
69 * BLK_ZONE_COND_EXP_OPEN and BLK_ZONE_COND_CLOSED conditions. Conversely, a
70 * regular zone report will never report a zone condition using
71 * BLK_ZONE_COND_ACTIVE and instead use the conditions BLK_ZONE_COND_IMP_OPEN,
72 * BLK_ZONE_COND_EXP_OPEN or BLK_ZONE_COND_CLOSED as reported by the device.
6473 */
6574enum blk_zone_cond {
6675 BLK_ZONE_COND_NOT_WP = 0x0,
......@@ -71,15 +80,29 @@ enum blk_zone_cond {
7180 BLK_ZONE_COND_READONLY = 0xD,
7281 BLK_ZONE_COND_FULL = 0xE,
7382 BLK_ZONE_COND_OFFLINE = 0xF,
83
84 BLK_ZONE_COND_ACTIVE = 0xFF, /* added in Linux 6.19 */
85#define BLK_ZONE_COND_ACTIVE BLK_ZONE_COND_ACTIVE
7486};
7587
7688/**
7789 * enum blk_zone_report_flags - Feature flags of reported zone descriptors.
7890 *
79 * @BLK_ZONE_REP_CAPACITY: Zone descriptor has capacity field.
91 * @BLK_ZONE_REP_CAPACITY: Output only. Indicates that zone descriptors in a
92 * zone report have a valid capacity field.
93 * @BLK_ZONE_REP_CACHED: Input only. Indicates that the zone report should be
94 * generated using cached zone information. In this case,
95 * the implicit open, explicit open and closed zone
96 * conditions are all reported with the
97 * BLK_ZONE_COND_ACTIVE condition.
8098 */
8199enum blk_zone_report_flags {
82 BLK_ZONE_REP_CAPACITY = (1 << 0),
100 /* Output flags */
101 BLK_ZONE_REP_CAPACITY = (1U << 0),
102
103 /* Input flags */
104 BLK_ZONE_REP_CACHED = (1U << 31), /* added in Linux 6.19 */
105#define BLK_ZONE_REP_CACHED BLK_ZONE_REP_CACHED
83106};
84107
85108/**
......@@ -122,6 +145,10 @@ struct blk_zone {
122145 * @sector: starting sector of report
123146 * @nr_zones: IN maximum / OUT actual
124147 * @flags: one or more flags as defined by enum blk_zone_report_flags.
148 * @flags: one or more flags as defined by enum blk_zone_report_flags.
149 * With BLKREPORTZONE, this field is ignored as an input and is valid
150 * only as an output. Using BLKREPORTZONEV2, this field is used as both
151 * input and output.
125152 * @zones: Space to hold @nr_zones @zones entries on reply.
126153 *
127154 * The array of at most @nr_zones must follow this structure in memory.
......@@ -148,9 +175,19 @@ struct blk_zone_range {
148175/**
149176 * Zoned block device ioctl's:
150177 *
151 * @BLKREPORTZONE: Get zone information. Takes a zone report as argument.
152 * The zone report will start from the zone containing the
153 * sector specified in the report request structure.
178 * @BLKREPORTZONE: Get zone information from a zoned device. Takes a zone report
179 * as argument. The zone report will start from the zone
180 * containing the sector specified in struct blk_zone_report.
181 * The flags field of struct blk_zone_report is used as an
182 * output only and ignored as an input.
183 * DEPRECATED, use BLKREPORTZONEV2 instead.
184 * @BLKREPORTZONEV2: Same as @BLKREPORTZONE but uses the flags field of
185 * struct blk_zone_report as an input, allowing to get a zone
186 * report using cached zone information if the flag
187 * BLK_ZONE_REP_CACHED is set. In such case, the zone report
188 * may include zones with the condition @BLK_ZONE_COND_ACTIVE
189 * (c.f. the description of this condition above for more
190 * details).
154191 * @BLKRESETZONE: Reset the write pointer of the zones in the specified
155192 * sector range. The sector range must be zone aligned.
156193 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
......@@ -169,5 +206,6 @@ struct blk_zone_range {
169206#define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range)
170207#define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range)
171208#define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range)
209#define BLKREPORTZONEV2 _IOWR(0x12, 142, struct blk_zone_report)
172210
173211#endif /* _BLKZONED_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bpf.h+54-5
......@@ -1026,6 +1026,7 @@ enum bpf_map_type {
10261026 BPF_MAP_TYPE_USER_RINGBUF,
10271027 BPF_MAP_TYPE_CGRP_STORAGE,
10281028 BPF_MAP_TYPE_ARENA,
1029 BPF_MAP_TYPE_INSN_ARRAY,
10291030 __MAX_BPF_MAP_TYPE
10301031};
10311032
......@@ -1430,6 +1431,9 @@ enum {
14301431
14311432/* Do not translate kernel bpf_arena pointers to user pointers */
14321433 BPF_F_NO_USER_CONV = (1U << 18),
1434
1435/* Enable BPF ringbuf overwrite mode */
1436 BPF_F_RB_OVERWRITE = (1U << 19),
14331437};
14341438
14351439/* Flags for BPF_PROG_QUERY. */
......@@ -1522,6 +1526,12 @@ union bpf_attr {
15221526 * If provided, map_flags should have BPF_F_TOKEN_FD flag set.
15231527 */
15241528 __s32 map_token_fd;
1529
1530 /* Hash of the program that has exclusive access to the map.
1531 */
1532 __aligned_u64 excl_prog_hash;
1533 /* Size of the passed excl_prog_hash. */
1534 __u32 excl_prog_hash_size;
15251535 };
15261536
15271537 struct { /* anonymous struct used by BPF_MAP_*_ELEM and BPF_MAP_FREEZE commands */
......@@ -1605,6 +1615,16 @@ union bpf_attr {
16051615 * continuous.
16061616 */
16071617 __u32 fd_array_cnt;
1618 /* Pointer to a buffer containing the signature of the BPF
1619 * program.
1620 */
1621 __aligned_u64 signature;
1622 /* Size of the signature buffer in bytes. */
1623 __u32 signature_size;
1624 /* ID of the kernel keyring to be used for signature
1625 * verification.
1626 */
1627 __s32 keyring_id;
16081628 };
16091629
16101630 struct { /* anonymous struct used by BPF_OBJ_* commands */
......@@ -4875,7 +4895,7 @@ union bpf_attr {
48754895 *
48764896 * **-ENOENT** if the bpf_local_storage cannot be found.
48774897 *
4878 * long bpf_d_path(struct path *path, char *buf, u32 sz)
4898 * long bpf_d_path(const struct path *path, char *buf, u32 sz)
48794899 * Description
48804900 * Return full path for given **struct path** object, which
48814901 * needs to be the kernel BTF *path* object. The path is
......@@ -5602,7 +5622,7 @@ union bpf_attr {
56025622 * Return
56035623 * *sk* if casting is valid, or **NULL** otherwise.
56045624 *
5605 * long bpf_dynptr_from_mem(void *data, u32 size, u64 flags, struct bpf_dynptr *ptr)
5625 * long bpf_dynptr_from_mem(void *data, u64 size, u64 flags, struct bpf_dynptr *ptr)
56065626 * Description
56075627 * Get a dynptr to local memory *data*.
56085628 *
......@@ -5645,7 +5665,7 @@ union bpf_attr {
56455665 * Return
56465666 * Nothing. Always succeeds.
56475667 *
5648 * long bpf_dynptr_read(void *dst, u32 len, const struct bpf_dynptr *src, u32 offset, u64 flags)
5668 * long bpf_dynptr_read(void *dst, u64 len, const struct bpf_dynptr *src, u64 offset, u64 flags)
56495669 * Description
56505670 * Read *len* bytes from *src* into *dst*, starting from *offset*
56515671 * into *src*.
......@@ -5655,7 +5675,7 @@ union bpf_attr {
56555675 * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
56565676 * *flags* is not 0.
56575677 *
5658 * long bpf_dynptr_write(const struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags)
5678 * long bpf_dynptr_write(const struct bpf_dynptr *dst, u64 offset, void *src, u64 len, u64 flags)
56595679 * Description
56605680 * Write *len* bytes from *src* into *dst*, starting from *offset*
56615681 * into *dst*.
......@@ -5676,7 +5696,7 @@ union bpf_attr {
56765696 * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
56775697 * other errors correspond to errors returned by **bpf_skb_store_bytes**\ ().
56785698 *
5679 * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len)
5699 * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u64 offset, u64 len)
56805700 * Description
56815701 * Get a pointer to the underlying dynptr data.
56825702 *
......@@ -6215,6 +6235,7 @@ enum {
62156235 BPF_RB_RING_SIZE = 1,
62166236 BPF_RB_CONS_POS = 2,
62176237 BPF_RB_PROD_POS = 3,
6238 BPF_RB_OVERWRITE_POS = 4,
62186239};
62196240
62206241/* BPF ring buffer constants */
......@@ -6666,6 +6687,8 @@ struct bpf_map_info {
66666687 __u32 btf_value_type_id;
66676688 __u32 btf_vmlinux_id;
66686689 __u64 map_extra;
6690 __aligned_u64 hash;
6691 __u32 hash_size;
66696692} __attribute__((aligned(8)));
66706693
66716694struct bpf_btf_info {
......@@ -7182,6 +7205,8 @@ enum {
71827205 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
71837206 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
71847207 SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
7208 SK_BPF_BYPASS_PROT_MEM = 1010, /* Get or Set sk->sk_bypass_prot_mem */
7209
71857210};
71867211
71877212enum {
......@@ -7418,6 +7443,10 @@ struct bpf_timer {
74187443 __u64 __opaque[2];
74197444} __attribute__((aligned(8)));
74207445
7446struct bpf_task_work {
7447 __u64 __opaque;
7448} __attribute__((aligned(8)));
7449
74217450struct bpf_wq {
74227451 __u64 __opaque[2];
74237452} __attribute__((aligned(8)));
......@@ -7623,4 +7652,24 @@ enum bpf_kfunc_flags {
76237652 BPF_F_PAD_ZEROS = (1ULL << 0),
76247653};
76257654
7655/*
7656 * Values of a BPF_MAP_TYPE_INSN_ARRAY entry must be of this type.
7657 *
7658 * Before the map is used the orig_off field should point to an
7659 * instruction inside the program being loaded. The other fields
7660 * must be set to 0.
7661 *
7662 * After the program is loaded, the xlated_off will be adjusted
7663 * by the verifier to point to the index of the original instruction
7664 * in the xlated program. If the instruction is deleted, it will
7665 * be set to (u32)-1. The jitted_off will be set to the corresponding
7666 * offset in the jitted image of the program.
7667 */
7668struct bpf_insn_array_value {
7669 __u32 orig_off;
7670 __u32 xlated_off;
7671 __u32 jitted_off;
7672 __u32 :32;
7673};
7674
76267675#endif /* __LINUX_BPF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs.h+9
......@@ -1097,6 +1097,12 @@ enum btrfs_err_code {
10971097 BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET,
10981098};
10991099
1100/* Flags for IOC_SHUTDOWN, must match XFS_FSOP_GOING_FLAGS_* flags. */
1101#define BTRFS_SHUTDOWN_FLAGS_DEFAULT 0x0
1102#define BTRFS_SHUTDOWN_FLAGS_LOGFLUSH 0x1
1103#define BTRFS_SHUTDOWN_FLAGS_NOLOGFLUSH 0x2
1104#define BTRFS_SHUTDOWN_FLAGS_LAST 0x3
1105
11001106#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
11011107 struct btrfs_ioctl_vol_args)
11021108#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
......@@ -1218,6 +1224,9 @@ enum btrfs_err_code {
12181224#define BTRFS_IOC_SUBVOL_SYNC_WAIT _IOW(BTRFS_IOCTL_MAGIC, 65, \
12191225 struct btrfs_ioctl_subvol_wait)
12201226
1227/* Shutdown ioctl should follow XFS's interfaces, thus not using btrfs magic. */
1228#define BTRFS_IOC_SHUTDOWN _IOR('X', 125, __u32)
1229
12211230#ifdef __cplusplus
12221231}
12231232#endif
lib/libc/include/any-linux-any/linux/can/netlink.h+41-7
......@@ -5,6 +5,7 @@
55 * Definitions for the CAN netlink interface
66 *
77 * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
8 * Copyright (c) 2021-2025 Vincent Mailhol <mailhol@kernel.org>
89 *
910 * This program is free software; you can redistribute it and/or modify
1011 * it under the terms of the version 2 of the GNU General Public License
......@@ -101,8 +102,13 @@ struct can_ctrlmode {
101102#define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */
102103#define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */
103104#define CAN_CTRLMODE_CC_LEN8_DLC 0x100 /* Classic CAN DLC option */
104#define CAN_CTRLMODE_TDC_AUTO 0x200 /* CAN transiver automatically calculates TDCV */
105#define CAN_CTRLMODE_TDC_MANUAL 0x400 /* TDCV is manually set up by user */
105#define CAN_CTRLMODE_TDC_AUTO 0x200 /* FD transceiver automatically calculates TDCV */
106#define CAN_CTRLMODE_TDC_MANUAL 0x400 /* FD TDCV is manually set up by user */
107#define CAN_CTRLMODE_RESTRICTED 0x800 /* Restricted operation mode */
108#define CAN_CTRLMODE_XL 0x1000 /* CAN XL mode */
109#define CAN_CTRLMODE_XL_TDC_AUTO 0x2000 /* XL transceiver automatically calculates TDCV */
110#define CAN_CTRLMODE_XL_TDC_MANUAL 0x4000 /* XL TDCV is manually set up by user */
111#define CAN_CTRLMODE_XL_TMS 0x8000 /* Transceiver Mode Switching */
106112
107113/*
108114 * CAN device statistics
......@@ -129,15 +135,20 @@ enum {
129135 IFLA_CAN_RESTART_MS,
130136 IFLA_CAN_RESTART,
131137 IFLA_CAN_BERR_COUNTER,
132 IFLA_CAN_DATA_BITTIMING,
133 IFLA_CAN_DATA_BITTIMING_CONST,
138 IFLA_CAN_DATA_BITTIMING, /* FD */
139 IFLA_CAN_DATA_BITTIMING_CONST, /* FD */
134140 IFLA_CAN_TERMINATION,
135141 IFLA_CAN_TERMINATION_CONST,
136142 IFLA_CAN_BITRATE_CONST,
137 IFLA_CAN_DATA_BITRATE_CONST,
143 IFLA_CAN_DATA_BITRATE_CONST, /* FD */
138144 IFLA_CAN_BITRATE_MAX,
139 IFLA_CAN_TDC,
145 IFLA_CAN_TDC, /* FD */
140146 IFLA_CAN_CTRLMODE_EXT,
147 IFLA_CAN_XL_DATA_BITTIMING,
148 IFLA_CAN_XL_DATA_BITTIMING_CONST,
149 IFLA_CAN_XL_DATA_BITRATE_CONST,
150 IFLA_CAN_XL_TDC,
151 IFLA_CAN_XL_PWM,
141152
142153 /* add new constants above here */
143154 __IFLA_CAN_MAX,
......@@ -145,7 +156,7 @@ enum {
145156};
146157
147158/*
148 * CAN FD Transmitter Delay Compensation (TDC)
159 * CAN FD/XL Transmitter Delay Compensation (TDC)
149160 *
150161 * Please refer to struct can_tdc_const and can_tdc in
151162 * include/linux/can/bittiming.h for further details.
......@@ -179,6 +190,29 @@ enum {
179190 IFLA_CAN_CTRLMODE_MAX = __IFLA_CAN_CTRLMODE - 1
180191};
181192
193/*
194 * CAN FD/XL Pulse-Width Modulation (PWM)
195 *
196 * Please refer to struct can_pwm_const and can_pwm in
197 * include/linux/can/bittiming.h for further details.
198 */
199enum {
200 IFLA_CAN_PWM_UNSPEC,
201 IFLA_CAN_PWM_PWMS_MIN, /* u32 */
202 IFLA_CAN_PWM_PWMS_MAX, /* u32 */
203 IFLA_CAN_PWM_PWML_MIN, /* u32 */
204 IFLA_CAN_PWM_PWML_MAX, /* u32 */
205 IFLA_CAN_PWM_PWMO_MIN, /* u32 */
206 IFLA_CAN_PWM_PWMO_MAX, /* u32 */
207 IFLA_CAN_PWM_PWMS, /* u32 */
208 IFLA_CAN_PWM_PWML, /* u32 */
209 IFLA_CAN_PWM_PWMO, /* u32 */
210
211 /* add new constants above here */
212 __IFLA_CAN_PWM,
213 IFLA_CAN_PWM_MAX = __IFLA_CAN_PWM - 1
214};
215
182216/* u16 termination range: 1..65535 Ohms */
183217#define CAN_TERMINATION_DISABLED 0
184218
lib/libc/include/any-linux-any/linux/comedi.h+1-1
......@@ -640,7 +640,7 @@ struct comedi_chaninfo {
640640
641641/**
642642 * struct comedi_rangeinfo - used to retrieve the range table for a channel
643 * @range_type: Encodes subdevice index (bits 27:24), channel index
643 * @range_type: Encodes subdevice index (bits 31:24), channel index
644644 * (bits 23:16) and range table length (bits 15:0).
645645 * @range_ptr: Pointer to array of @struct comedi_krange to be filled
646646 * in with the range table for the channel or subdevice.
lib/libc/include/any-linux-any/linux/dev_energymodel.h created+82
......@@ -0,0 +1,82 @@
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/dev-energymodel.yaml */
4/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
6
7#ifndef _LINUX_DEV_ENERGYMODEL_H
8#define _LINUX_DEV_ENERGYMODEL_H
9
10#define DEV_ENERGYMODEL_FAMILY_NAME "dev-energymodel"
11#define DEV_ENERGYMODEL_FAMILY_VERSION 1
12
13/**
14 * enum dev_energymodel_perf_state_flags
15 * @DEV_ENERGYMODEL_PERF_STATE_FLAGS_PERF_STATE_INEFFICIENT: The performance
16 * state is inefficient. There is in this perf-domain, another performance
17 * state with a higher frequency but a lower or equal power cost.
18 */
19enum dev_energymodel_perf_state_flags {
20 DEV_ENERGYMODEL_PERF_STATE_FLAGS_PERF_STATE_INEFFICIENT = 1,
21};
22
23/**
24 * enum dev_energymodel_perf_domain_flags
25 * @DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_MICROWATTS: The power values
26 * are in micro-Watts or some other scale.
27 * @DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_SKIP_INEFFICIENCIES: Skip
28 * inefficient states when estimating energy consumption.
29 * @DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_ARTIFICIAL: The power values
30 * are artificial and might be created by platform missing real power
31 * information.
32 */
33enum dev_energymodel_perf_domain_flags {
34 DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_MICROWATTS = 1,
35 DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_SKIP_INEFFICIENCIES = 2,
36 DEV_ENERGYMODEL_PERF_DOMAIN_FLAGS_PERF_DOMAIN_ARTIFICIAL = 4,
37};
38
39enum {
40 DEV_ENERGYMODEL_A_PERF_DOMAIN_PAD = 1,
41 DEV_ENERGYMODEL_A_PERF_DOMAIN_PERF_DOMAIN_ID,
42 DEV_ENERGYMODEL_A_PERF_DOMAIN_FLAGS,
43 DEV_ENERGYMODEL_A_PERF_DOMAIN_CPUS,
44
45 __DEV_ENERGYMODEL_A_PERF_DOMAIN_MAX,
46 DEV_ENERGYMODEL_A_PERF_DOMAIN_MAX = (__DEV_ENERGYMODEL_A_PERF_DOMAIN_MAX - 1)
47};
48
49enum {
50 DEV_ENERGYMODEL_A_PERF_TABLE_PERF_DOMAIN_ID = 1,
51 DEV_ENERGYMODEL_A_PERF_TABLE_PERF_STATE,
52
53 __DEV_ENERGYMODEL_A_PERF_TABLE_MAX,
54 DEV_ENERGYMODEL_A_PERF_TABLE_MAX = (__DEV_ENERGYMODEL_A_PERF_TABLE_MAX - 1)
55};
56
57enum {
58 DEV_ENERGYMODEL_A_PERF_STATE_PAD = 1,
59 DEV_ENERGYMODEL_A_PERF_STATE_PERFORMANCE,
60 DEV_ENERGYMODEL_A_PERF_STATE_FREQUENCY,
61 DEV_ENERGYMODEL_A_PERF_STATE_POWER,
62 DEV_ENERGYMODEL_A_PERF_STATE_COST,
63 DEV_ENERGYMODEL_A_PERF_STATE_FLAGS,
64
65 __DEV_ENERGYMODEL_A_PERF_STATE_MAX,
66 DEV_ENERGYMODEL_A_PERF_STATE_MAX = (__DEV_ENERGYMODEL_A_PERF_STATE_MAX - 1)
67};
68
69enum {
70 DEV_ENERGYMODEL_CMD_GET_PERF_DOMAINS = 1,
71 DEV_ENERGYMODEL_CMD_GET_PERF_TABLE,
72 DEV_ENERGYMODEL_CMD_PERF_DOMAIN_CREATED,
73 DEV_ENERGYMODEL_CMD_PERF_DOMAIN_UPDATED,
74 DEV_ENERGYMODEL_CMD_PERF_DOMAIN_DELETED,
75
76 __DEV_ENERGYMODEL_CMD_MAX,
77 DEV_ENERGYMODEL_CMD_MAX = (__DEV_ENERGYMODEL_CMD_MAX - 1)
78};
79
80#define DEV_ENERGYMODEL_MCGRP_EVENT "event"
81
82#endif /* _LINUX_DEV_ENERGYMODEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/devlink.h+6
......@@ -181,6 +181,7 @@ enum devlink_sb_threshold_type {
181181enum devlink_eswitch_mode {
182182 DEVLINK_ESWITCH_MODE_LEGACY,
183183 DEVLINK_ESWITCH_MODE_SWITCHDEV,
184 DEVLINK_ESWITCH_MODE_SWITCHDEV_INACTIVE,
184185};
185186
186187enum devlink_eswitch_inline_mode {
......@@ -636,6 +637,11 @@ enum devlink_attr {
636637
637638 DEVLINK_ATTR_RATE_TC_BWS, /* nested */
638639
640 DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */
641
642 DEVLINK_ATTR_PARAM_VALUE_DEFAULT, /* dynamic */
643 DEVLINK_ATTR_PARAM_RESET_DEFAULT, /* flag */
644
639645 /* Add new attributes above here, update the spec in
640646 * Documentation/netlink/specs/devlink.yaml and re-generate
641647 * net/devlink/netlink_gen.c.
lib/libc/include/any-linux-any/linux/dpll.h+3
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/dpll.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_DPLL_H
78#define _LINUX_DPLL_H
......@@ -216,6 +217,7 @@ enum dpll_a {
216217 DPLL_A_LOCK_STATUS_ERROR,
217218 DPLL_A_CLOCK_QUALITY_LEVEL,
218219 DPLL_A_PHASE_OFFSET_MONITOR,
220 DPLL_A_PHASE_OFFSET_AVG_FACTOR,
219221
220222 __DPLL_A_MAX,
221223 DPLL_A_MAX = (__DPLL_A_MAX - 1)
......@@ -250,6 +252,7 @@ enum dpll_a_pin {
250252 DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED,
251253 DPLL_A_PIN_ESYNC_PULSE,
252254 DPLL_A_PIN_REFERENCE_SYNC,
255 DPLL_A_PIN_PHASE_ADJUST_GRAN,
253256
254257 __DPLL_A_PIN_MAX,
255258 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
lib/libc/include/any-linux-any/linux/ethtool.h+6
......@@ -2075,6 +2075,10 @@ enum ethtool_link_mode_bit_indices {
20752075 ETHTOOL_LINK_MODE_800000baseDR4_2_Full_BIT = 118,
20762076 ETHTOOL_LINK_MODE_800000baseSR4_Full_BIT = 119,
20772077 ETHTOOL_LINK_MODE_800000baseVR4_Full_BIT = 120,
2078 ETHTOOL_LINK_MODE_1600000baseCR8_Full_BIT = 121,
2079 ETHTOOL_LINK_MODE_1600000baseKR8_Full_BIT = 122,
2080 ETHTOOL_LINK_MODE_1600000baseDR8_Full_BIT = 123,
2081 ETHTOOL_LINK_MODE_1600000baseDR8_2_Full_BIT = 124,
20782082
20792083 /* must be last entry */
20802084 __ETHTOOL_LINK_MODE_MASK_NBITS
......@@ -2188,6 +2192,7 @@ enum ethtool_link_mode_bit_indices {
21882192#define SPEED_200000 200000
21892193#define SPEED_400000 400000
21902194#define SPEED_800000 800000
2195#define SPEED_1600000 1600000
21912196
21922197#define SPEED_UNKNOWN -1
21932198
......@@ -2378,6 +2383,7 @@ enum {
23782383#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
23792384#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
23802385#define RXH_GTP_TEID (1 << 8) /* teid in case of GTP */
2386#define RXH_IP6_FL (1 << 9) /* IPv6 flow label */
23812387#define RXH_DISCARD (1 << 31)
23822388
23832389#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
lib/libc/include/any-linux-any/linux/ethtool_netlink_generated.h+48
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/ethtool.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_ETHTOOL_NETLINK_GENERATED_H
78#define _LINUX_ETHTOOL_NETLINK_GENERATED_H
......@@ -561,12 +562,24 @@ enum {
561562 ETHTOOL_A_TUNNEL_INFO_MAX = (__ETHTOOL_A_TUNNEL_INFO_CNT - 1)
562563};
563564
565enum {
566 ETHTOOL_A_FEC_HIST_PAD = 1,
567 ETHTOOL_A_FEC_HIST_BIN_LOW,
568 ETHTOOL_A_FEC_HIST_BIN_HIGH,
569 ETHTOOL_A_FEC_HIST_BIN_VAL,
570 ETHTOOL_A_FEC_HIST_BIN_VAL_PER_LANE,
571
572 __ETHTOOL_A_FEC_HIST_CNT,
573 ETHTOOL_A_FEC_HIST_MAX = (__ETHTOOL_A_FEC_HIST_CNT - 1)
574};
575
564576enum {
565577 ETHTOOL_A_FEC_STAT_UNSPEC,
566578 ETHTOOL_A_FEC_STAT_PAD,
567579 ETHTOOL_A_FEC_STAT_CORRECTED,
568580 ETHTOOL_A_FEC_STAT_UNCORR,
569581 ETHTOOL_A_FEC_STAT_CORR_BITS,
582 ETHTOOL_A_FEC_STAT_HIST,
570583
571584 __ETHTOOL_A_FEC_STAT_CNT,
572585 ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
......@@ -791,6 +804,39 @@ enum {
791804 ETHTOOL_A_PSE_NTF_MAX = (__ETHTOOL_A_PSE_NTF_CNT - 1)
792805};
793806
807enum {
808 ETHTOOL_A_MSE_CAPABILITIES_MAX_AVERAGE_MSE = 1,
809 ETHTOOL_A_MSE_CAPABILITIES_MAX_PEAK_MSE,
810 ETHTOOL_A_MSE_CAPABILITIES_REFRESH_RATE_PS,
811 ETHTOOL_A_MSE_CAPABILITIES_NUM_SYMBOLS,
812
813 __ETHTOOL_A_MSE_CAPABILITIES_CNT,
814 ETHTOOL_A_MSE_CAPABILITIES_MAX = (__ETHTOOL_A_MSE_CAPABILITIES_CNT - 1)
815};
816
817enum {
818 ETHTOOL_A_MSE_SNAPSHOT_AVERAGE_MSE = 1,
819 ETHTOOL_A_MSE_SNAPSHOT_PEAK_MSE,
820 ETHTOOL_A_MSE_SNAPSHOT_WORST_PEAK_MSE,
821
822 __ETHTOOL_A_MSE_SNAPSHOT_CNT,
823 ETHTOOL_A_MSE_SNAPSHOT_MAX = (__ETHTOOL_A_MSE_SNAPSHOT_CNT - 1)
824};
825
826enum {
827 ETHTOOL_A_MSE_HEADER = 1,
828 ETHTOOL_A_MSE_CAPABILITIES,
829 ETHTOOL_A_MSE_CHANNEL_A,
830 ETHTOOL_A_MSE_CHANNEL_B,
831 ETHTOOL_A_MSE_CHANNEL_C,
832 ETHTOOL_A_MSE_CHANNEL_D,
833 ETHTOOL_A_MSE_WORST_CHANNEL,
834 ETHTOOL_A_MSE_LINK,
835
836 __ETHTOOL_A_MSE_CNT,
837 ETHTOOL_A_MSE_MAX = (__ETHTOOL_A_MSE_CNT - 1)
838};
839
794840enum {
795841 ETHTOOL_MSG_USER_NONE = 0,
796842 ETHTOOL_MSG_STRSET_GET = 1,
......@@ -843,6 +889,7 @@ enum {
843889 ETHTOOL_MSG_RSS_SET,
844890 ETHTOOL_MSG_RSS_CREATE_ACT,
845891 ETHTOOL_MSG_RSS_DELETE_ACT,
892 ETHTOOL_MSG_MSE_GET,
846893
847894 __ETHTOOL_MSG_USER_CNT,
848895 ETHTOOL_MSG_USER_MAX = (__ETHTOOL_MSG_USER_CNT - 1)
......@@ -903,6 +950,7 @@ enum {
903950 ETHTOOL_MSG_RSS_CREATE_ACT_REPLY,
904951 ETHTOOL_MSG_RSS_CREATE_NTF,
905952 ETHTOOL_MSG_RSS_DELETE_NTF,
953 ETHTOOL_MSG_MSE_GET_REPLY,
906954
907955 __ETHTOOL_MSG_KERNEL_CNT,
908956 ETHTOOL_MSG_KERNEL_MAX = (__ETHTOOL_MSG_KERNEL_CNT - 1)
lib/libc/include/any-linux-any/linux/ext4.h+53
......@@ -33,6 +33,8 @@
3333#define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
3434#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
3535#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
36#define EXT4_IOC_GET_TUNE_SB_PARAM _IOR('f', 45, struct ext4_tune_sb_params)
37#define EXT4_IOC_SET_TUNE_SB_PARAM _IOW('f', 46, struct ext4_tune_sb_params)
3638
3739#define EXT4_IOC_SHUTDOWN _IOR('X', 125, __u32)
3840
......@@ -108,6 +110,57 @@ struct ext4_new_group_input {
108110 __u16 unused;
109111};
110112
113struct ext4_tune_sb_params {
114 __u32 set_flags;
115 __u32 checkinterval;
116 __u16 errors_behavior;
117 __u16 mnt_count;
118 __u16 max_mnt_count;
119 __u16 raid_stride;
120 __u64 last_check_time;
121 __u64 reserved_blocks;
122 __u64 blocks_count;
123 __u32 default_mnt_opts;
124 __u32 reserved_uid;
125 __u32 reserved_gid;
126 __u32 raid_stripe_width;
127 __u16 encoding;
128 __u16 encoding_flags;
129 __u8 def_hash_alg;
130 __u8 pad_1;
131 __u16 pad_2;
132 __u32 feature_compat;
133 __u32 feature_incompat;
134 __u32 feature_ro_compat;
135 __u32 set_feature_compat_mask;
136 __u32 set_feature_incompat_mask;
137 __u32 set_feature_ro_compat_mask;
138 __u32 clear_feature_compat_mask;
139 __u32 clear_feature_incompat_mask;
140 __u32 clear_feature_ro_compat_mask;
141 __u8 mount_opts[64];
142 __u8 pad[68];
143};
144
145#define EXT4_TUNE_FL_ERRORS_BEHAVIOR 0x00000001
146#define EXT4_TUNE_FL_MNT_COUNT 0x00000002
147#define EXT4_TUNE_FL_MAX_MNT_COUNT 0x00000004
148#define EXT4_TUNE_FL_CHECKINTRVAL 0x00000008
149#define EXT4_TUNE_FL_LAST_CHECK_TIME 0x00000010
150#define EXT4_TUNE_FL_RESERVED_BLOCKS 0x00000020
151#define EXT4_TUNE_FL_RESERVED_UID 0x00000040
152#define EXT4_TUNE_FL_RESERVED_GID 0x00000080
153#define EXT4_TUNE_FL_DEFAULT_MNT_OPTS 0x00000100
154#define EXT4_TUNE_FL_DEF_HASH_ALG 0x00000200
155#define EXT4_TUNE_FL_RAID_STRIDE 0x00000400
156#define EXT4_TUNE_FL_RAID_STRIPE_WIDTH 0x00000800
157#define EXT4_TUNE_FL_MOUNT_OPTS 0x00001000
158#define EXT4_TUNE_FL_FEATURES 0x00002000
159#define EXT4_TUNE_FL_EDIT_FEATURES 0x00004000
160#define EXT4_TUNE_FL_FORCE_FSCK 0x00008000
161#define EXT4_TUNE_FL_ENCODING 0x00010000
162#define EXT4_TUNE_FL_ENCODING_FLAGS 0x00020000
163
111164/*
112165 * Returned by EXT4_IOC_GET_ES_CACHE as an additional possible flag.
113166 * It indicates that the entry in extent status cache is for a hole.
lib/libc/include/any-linux-any/linux/fb.h+1-1
......@@ -317,7 +317,7 @@ enum {
317317#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
318318#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
319319#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
320#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
320#define FB_VBLANK_HAVE_VSYNC 0x100 /* vertical syncs can be detected */
321321
322322struct fb_vblank {
323323 __u32 flags; /* FB_VBLANK flags */
lib/libc/include/any-linux-any/linux/fcntl.h+13
......@@ -4,6 +4,7 @@
44
55#include <asm/fcntl.h>
66#include <linux/openat2.h>
7#include <linux/types.h>
78
89#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
910#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
......@@ -79,6 +80,17 @@
7980 */
8081#define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
8182
83/* Set/Get delegations */
84#define F_GETDELEG (F_LINUX_SPECIFIC_BASE + 15)
85#define F_SETDELEG (F_LINUX_SPECIFIC_BASE + 16)
86
87/* Argument structure for F_GETDELEG and F_SETDELEG */
88struct delegation {
89 __u32 d_flags; /* Must be 0 */
90 __u16 d_type; /* F_RDLCK, F_WRLCK, F_UNLCK */
91 __u16 __pad; /* Must be 0 */
92};
93
8294/*
8395 * Types of directory notifications that may be requested.
8496 */
......@@ -111,6 +123,7 @@
111123#define PIDFD_SELF_THREAD_GROUP -10001 /* Current thread group leader. */
112124
113125#define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */
126#define FD_NSFS_ROOT -10003 /* Root of the nsfs filesystem */
114127#define FD_INVALID -10009 /* Invalid file descriptor: -10000 - EBADF = -10009 */
115128
116129/* Generic flags for the *at(2) family of syscalls. */
lib/libc/include/any-linux-any/linux/fou.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/fou.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_FOU_H
78#define _LINUX_FOU_H
lib/libc/include/any-linux-any/linux/fs.h+6-2
......@@ -294,8 +294,9 @@ struct file_attr {
294294#define BLKROTATIONAL _IO(0x12,126)
295295#define BLKZEROOUT _IO(0x12,127)
296296#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
297/* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
297/* 130-136 and 142 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
298298/* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */
299#define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2)
299300
300301#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
301302#define FIBMAP _IO(0x00,1) /* bmap access */
......@@ -426,10 +427,13 @@ typedef int __bitwise __kernel_rwf_t;
426427/* buffered IO that drops the cache after reading or writing data */
427428#define RWF_DONTCACHE ((__kernel_rwf_t)0x00000080)
428429
430/* prevent pipe and socket writes from raising SIGPIPE */
431#define RWF_NOSIGNAL ((__kernel_rwf_t)0x00000100)
432
429433/* mask of flags supported by the kernel */
430434#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
431435 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC |\
432 RWF_DONTCACHE)
436 RWF_DONTCACHE | RWF_NOSIGNAL)
433437
434438#define PROCFS_IOCTL_MAGIC 'f'
435439
lib/libc/include/any-linux-any/linux/fuse.h+20-2
......@@ -235,6 +235,11 @@
235235 *
236236 * 7.44
237237 * - add FUSE_NOTIFY_INC_EPOCH
238 *
239 * 7.45
240 * - add FUSE_COPY_FILE_RANGE_64
241 * - add struct fuse_copy_file_range_out
242 * - add FUSE_NOTIFY_PRUNE
238243 */
239244
240245#ifndef _LINUX_FUSE_H
......@@ -266,7 +271,7 @@
266271#define FUSE_KERNEL_VERSION 7
267272
268273/** Minor version number of this interface */
269#define FUSE_KERNEL_MINOR_VERSION 44
274#define FUSE_KERNEL_MINOR_VERSION 45
270275
271276/** The node ID of the root inode */
272277#define FUSE_ROOT_ID 1
......@@ -653,6 +658,7 @@ enum fuse_opcode {
653658 FUSE_SYNCFS = 50,
654659 FUSE_TMPFILE = 51,
655660 FUSE_STATX = 52,
661 FUSE_COPY_FILE_RANGE_64 = 53,
656662
657663 /* CUSE specific operations */
658664 CUSE_INIT = 4096,
......@@ -671,7 +677,7 @@ enum fuse_notify_code {
671677 FUSE_NOTIFY_DELETE = 6,
672678 FUSE_NOTIFY_RESEND = 7,
673679 FUSE_NOTIFY_INC_EPOCH = 8,
674 FUSE_NOTIFY_CODE_MAX,
680 FUSE_NOTIFY_PRUNE = 9,
675681};
676682
677683/* The read buffer is required to be at least 8k, but may be much larger */
......@@ -1110,6 +1116,12 @@ struct fuse_notify_retrieve_in {
11101116 uint64_t dummy4;
11111117};
11121118
1119struct fuse_notify_prune_out {
1120 uint32_t count;
1121 uint32_t padding;
1122 uint64_t spare;
1123};
1124
11131125struct fuse_backing_map {
11141126 int32_t fd;
11151127 uint32_t flags;
......@@ -1122,6 +1134,7 @@ struct fuse_backing_map {
11221134#define FUSE_DEV_IOC_BACKING_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 1, \
11231135 struct fuse_backing_map)
11241136#define FUSE_DEV_IOC_BACKING_CLOSE _IOW(FUSE_DEV_IOC_MAGIC, 2, uint32_t)
1137#define FUSE_DEV_IOC_SYNC_INIT _IO(FUSE_DEV_IOC_MAGIC, 3)
11251138
11261139struct fuse_lseek_in {
11271140 uint64_t fh;
......@@ -1144,6 +1157,11 @@ struct fuse_copy_file_range_in {
11441157 uint64_t flags;
11451158};
11461159
1160/* For FUSE_COPY_FILE_RANGE_64 */
1161struct fuse_copy_file_range_out {
1162 uint64_t bytes_copied;
1163};
1164
11471165#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
11481166#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
11491167struct fuse_setupmapping_in {
lib/libc/include/any-linux-any/linux/gpib.h created+103
......@@ -0,0 +1,103 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3/***************************************************************************
4 * copyright : (C) 2002 by Frank Mori Hess
5 ***************************************************************************/
6
7#ifndef _GPIB_H
8#define _GPIB_H
9
10#define GPIB_MAX_NUM_BOARDS 16
11#define GPIB_MAX_NUM_DESCRIPTORS 0x1000
12
13enum ibsta_bit_numbers {
14 DCAS_NUM = 0,
15 DTAS_NUM = 1,
16 LACS_NUM = 2,
17 TACS_NUM = 3,
18 ATN_NUM = 4,
19 CIC_NUM = 5,
20 REM_NUM = 6,
21 LOK_NUM = 7,
22 CMPL_NUM = 8,
23 EVENT_NUM = 9,
24 SPOLL_NUM = 10,
25 RQS_NUM = 11,
26 SRQI_NUM = 12,
27 END_NUM = 13,
28 TIMO_NUM = 14,
29 ERR_NUM = 15
30};
31
32/* IBSTA status bits (returned by all functions) */
33enum ibsta_bits {
34 DCAS = (1 << DCAS_NUM), /* device clear state */
35 DTAS = (1 << DTAS_NUM), /* device trigger state */
36 LACS = (1 << LACS_NUM), /* GPIB interface is addressed as Listener */
37 TACS = (1 << TACS_NUM), /* GPIB interface is addressed as Talker */
38 ATN = (1 << ATN_NUM), /* Attention is asserted */
39 CIC = (1 << CIC_NUM), /* GPIB interface is Controller-in-Charge */
40 REM = (1 << REM_NUM), /* remote state */
41 LOK = (1 << LOK_NUM), /* lockout state */
42 CMPL = (1 << CMPL_NUM), /* I/O is complete */
43 EVENT = (1 << EVENT_NUM), /* DCAS, DTAS, or IFC has occurred */
44 SPOLL = (1 << SPOLL_NUM), /* board serial polled by busmaster */
45 RQS = (1 << RQS_NUM), /* Device requesting service */
46 SRQI = (1 << SRQI_NUM), /* SRQ is asserted */
47 END = (1 << END_NUM), /* EOI or EOS encountered */
48 TIMO = (1 << TIMO_NUM), /* Time limit on I/O or wait function exceeded */
49 ERR = (1 << ERR_NUM), /* Function call terminated on error */
50
51 device_status_mask = ERR | TIMO | END | CMPL | RQS,
52 board_status_mask = ERR | TIMO | END | CMPL | SPOLL |
53 EVENT | LOK | REM | CIC | ATN | TACS | LACS | DTAS | DCAS | SRQI,
54};
55
56/* End-of-string (EOS) modes for use with ibeos */
57
58enum eos_flags {
59 EOS_MASK = 0x1c00,
60 REOS = 0x0400, /* Terminate reads on EOS */
61 XEOS = 0x800, /* assert EOI when EOS char is sent */
62 BIN = 0x1000 /* Do 8-bit compare on EOS */
63};
64
65/* GPIB Bus Control Lines bit vector */
66enum bus_control_line {
67 VALID_DAV = 0x01,
68 VALID_NDAC = 0x02,
69 VALID_NRFD = 0x04,
70 VALID_IFC = 0x08,
71 VALID_REN = 0x10,
72 VALID_SRQ = 0x20,
73 VALID_ATN = 0x40,
74 VALID_EOI = 0x80,
75 VALID_ALL = 0xff,
76 BUS_DAV = 0x0100, /* DAV line status bit */
77 BUS_NDAC = 0x0200, /* NDAC line status bit */
78 BUS_NRFD = 0x0400, /* NRFD line status bit */
79 BUS_IFC = 0x0800, /* IFC line status bit */
80 BUS_REN = 0x1000, /* REN line status bit */
81 BUS_SRQ = 0x2000, /* SRQ line status bit */
82 BUS_ATN = 0x4000, /* ATN line status bit */
83 BUS_EOI = 0x8000 /* EOI line status bit */
84};
85
86enum ppe_bits {
87 PPC_DISABLE = 0x10,
88 PPC_SENSE = 0x8, /* parallel poll sense bit */
89 PPC_DIO_MASK = 0x7
90};
91
92enum {
93 request_service_bit = 0x40,
94};
95
96enum gpib_events {
97 EVENT_NONE = 0,
98 EVENT_DEV_TRG = 1,
99 EVENT_DEV_CLR = 2,
100 EVENT_IFC = 3
101};
102
103#endif /* _GPIB_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gpib_ioctl.h created+167
......@@ -0,0 +1,167 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3/***************************************************************************
4 * copyright : (C) 2002 by Frank Mori Hess
5 ***************************************************************************/
6
7#ifndef _GPIB_IOCTL_H
8#define _GPIB_IOCTL_H
9
10#include <asm/ioctl.h>
11#include <linux/types.h>
12
13#define GPIB_CODE 160
14
15struct gpib_board_type_ioctl {
16 char name[100];
17};
18
19/* argument for read/write/command ioctls */
20struct gpib_read_write_ioctl {
21 __u64 buffer_ptr;
22 __u32 requested_transfer_count;
23 __u32 completed_transfer_count;
24 __s32 end; /* end flag return for reads, end io suppression request for cmd*/
25 __s32 handle;
26};
27
28struct gpib_open_dev_ioctl {
29 __u32 handle;
30 __u32 pad;
31 __s32 sad;
32 __u32 is_board;
33};
34
35struct gpib_close_dev_ioctl {
36 __u32 handle;
37};
38
39struct gpib_serial_poll_ioctl {
40 __u32 pad;
41 __s32 sad;
42 __u8 status_byte;
43 __u8 padding[3]; /* align to 32 bit boundary */
44};
45
46struct gpib_eos_ioctl {
47 __s32 eos;
48 __s32 eos_flags;
49};
50
51struct gpib_wait_ioctl {
52 __s32 handle;
53 __s32 wait_mask;
54 __s32 clear_mask;
55 __s32 set_mask;
56 __s32 ibsta;
57 __s32 pad;
58 __s32 sad;
59 __u32 usec_timeout;
60};
61
62struct gpib_online_ioctl {
63 __u64 init_data_ptr;
64 __s32 init_data_length;
65 __s32 online;
66};
67
68struct gpib_spoll_bytes_ioctl {
69 __u32 num_bytes;
70 __u32 pad;
71 __s32 sad;
72};
73
74struct gpib_board_info_ioctl {
75 __u32 pad;
76 __s32 sad;
77 __s32 parallel_poll_configuration;
78 __s32 autopolling;
79 __s32 is_system_controller;
80 __u32 t1_delay;
81 unsigned ist : 1;
82 unsigned no_7_bit_eos : 1;
83 unsigned padding :30; /* align to 32 bit boundary */
84};
85
86struct gpib_select_pci_ioctl {
87 __s32 pci_bus;
88 __s32 pci_slot;
89};
90
91struct gpib_ppoll_config_ioctl {
92 __u8 config;
93 unsigned set_ist : 1;
94 unsigned clear_ist : 1;
95 unsigned padding :22; /* align to 32 bit boundary */
96};
97
98struct gpib_pad_ioctl {
99 __u32 handle;
100 __u32 pad;
101};
102
103struct gpib_sad_ioctl {
104 __u32 handle;
105 __s32 sad;
106};
107
108/* select a piece of hardware to attach by its sysfs device path */
109struct gpib_select_device_path_ioctl {
110 char device_path[0x1000];
111};
112
113/* update status byte and request service */
114struct gpib_request_service2 {
115 __u8 status_byte;
116 __u8 padding[3]; /* align to 32 bit boundary */
117 __s32 new_reason_for_service;
118};
119
120/* Standard functions. */
121enum gpib_ioctl {
122 IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl),
123 IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl),
124 IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl),
125 IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl),
126 IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl),
127 IBWAIT = _IOWR(GPIB_CODE, 5, struct gpib_wait_ioctl),
128 IBRPP = _IOWR(GPIB_CODE, 6, __u8),
129
130 IBSIC = _IOW(GPIB_CODE, 9, __u32),
131 IBSRE = _IOW(GPIB_CODE, 10, __s32),
132 IBGTS = _IO(GPIB_CODE, 11),
133 IBCAC = _IOW(GPIB_CODE, 12, __s32),
134 IBLINES = _IOR(GPIB_CODE, 14, __s16),
135 IBPAD = _IOW(GPIB_CODE, 15, struct gpib_pad_ioctl),
136 IBSAD = _IOW(GPIB_CODE, 16, struct gpib_sad_ioctl),
137 IBTMO = _IOW(GPIB_CODE, 17, __u32),
138 IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
139 IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl),
140 IBRSV = _IOW(GPIB_CODE, 20, __u8),
141 CFCBASE = _IOW(GPIB_CODE, 21, __u64),
142 CFCIRQ = _IOW(GPIB_CODE, 22, __u32),
143 CFCDMA = _IOW(GPIB_CODE, 23, __u32),
144 CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl),
145
146 IBMUTEX = _IOW(GPIB_CODE, 26, __s32),
147 IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl),
148 IBPPC = _IOW(GPIB_CODE, 28, struct gpib_ppoll_config_ioctl),
149 IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl),
150
151 IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, __s32),
152 IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl),
153 IBEVENT = _IOR(GPIB_CODE, 33, __s16),
154 IBRSC = _IOW(GPIB_CODE, 34, __s32),
155 IB_T1_DELAY = _IOW(GPIB_CODE, 35, __u32),
156 IBLOC = _IO(GPIB_CODE, 36),
157
158 IBAUTOSPOLL = _IOW(GPIB_CODE, 38, __s16),
159 IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl),
160 IBPP2_SET = _IOW(GPIB_CODE, 40, __s16),
161 IBPP2_GET = _IOR(GPIB_CODE, 41, __s16),
162 IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl),
163 /* 44 was IBSELECT_SERIAL_NUMBER */
164 IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2)
165};
166
167#endif /* _GPIB_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/handshake.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/handshake.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_HANDSHAKE_H
78#define _LINUX_HANDSHAKE_H
lib/libc/include/any-linux-any/linux/hidraw.h+2
......@@ -48,6 +48,8 @@ struct hidraw_devinfo {
4848#define HIDIOCGOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0C, len)
4949#define HIDIOCREVOKE _IOW('H', 0x0D, int) /* Revoke device access */
5050
51#define HIDIOCTL_LAST _IOC_NR(HIDIOCREVOKE)
52
5153#define HIDRAW_FIRST_MINOR 0
5254#define HIDRAW_MAX_DEVICES 64
5355/* number of reports to buffer */
lib/libc/include/any-linux-any/linux/i2c.h+1-1
......@@ -36,7 +36,7 @@
3636 *
3737 * Only if I2C_FUNC_NOSTART is set:
3838 * %I2C_M_NOSTART: skip repeated start sequence
39
39 *
4040 * Only if I2C_FUNC_PROTOCOL_MANGLING is set:
4141 * %I2C_M_NO_RD_ACK: in a read message, master ACK/NACK bit is skipped
4242 * %I2C_M_IGNORE_NAK: treat NACK from client as ACK
lib/libc/include/any-linux-any/linux/i8k.h+2
......@@ -36,6 +36,8 @@
3636#define I8K_FAN_LOW 1
3737#define I8K_FAN_HIGH 2
3838#define I8K_FAN_TURBO 3
39/* Many machines treat this mode as some sort of automatic mode */
40#define I8K_FAN_AUTO 3
3941#define I8K_FAN_MAX I8K_FAN_TURBO
4042
4143#define I8K_VOL_UP 1
lib/libc/include/any-linux-any/linux/if_bridge.h+3
......@@ -823,6 +823,8 @@ struct br_mcast_stats {
823823/* bridge boolean options
824824 * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
825825 * BR_BOOLOPT_MCAST_VLAN_SNOOPING - control vlan multicast snooping
826 * BR_BOOLOPT_FDB_LOCAL_VLAN_0 - local FDB entries installed by the bridge
827 * driver itself should only be added on VLAN 0
826828 *
827829 * IMPORTANT: if adding a new option do not forget to handle
828830 * it in br_boolopt_toggle/get and bridge sysfs
......@@ -832,6 +834,7 @@ enum br_boolopt_id {
832834 BR_BOOLOPT_MCAST_VLAN_SNOOPING,
833835 BR_BOOLOPT_MST_ENABLE,
834836 BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
837 BR_BOOLOPT_FDB_LOCAL_VLAN_0,
835838 BR_BOOLOPT_MAX
836839};
837840
lib/libc/include/any-linux-any/linux/if_ether.h+4
......@@ -92,6 +92,9 @@
9292#define ETH_P_ETHERCAT 0x88A4 /* EtherCAT */
9393#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
9494#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
95#define ETH_P_MXLGSW 0x88C3 /* Infineon Technologies Corporate Research ST
96 * Used by MaxLinear GSW DSA
97 */
9598#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */
9699#define ETH_P_TIPC 0x88CA /* TIPC */
97100#define ETH_P_LLDP 0x88CC /* Link Layer Discovery Protocol */
......@@ -114,6 +117,7 @@
114117#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
115118#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
116119#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
120#define ETH_P_YT921X 0x9988 /* Motorcomm YT921x DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
117121#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
118122#define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
119123#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW Tag Value [ NOT AN OFFICIALLY REGISTERED ID ] */
lib/libc/include/any-linux-any/linux/if_link.h+3
......@@ -379,6 +379,8 @@ enum {
379379 IFLA_DPLL_PIN,
380380 IFLA_MAX_PACING_OFFLOAD_HORIZON,
381381 IFLA_NETNS_IMMUTABLE,
382 IFLA_HEADROOM,
383 IFLA_TAILROOM,
382384 __IFLA_MAX
383385};
384386
......@@ -1562,6 +1564,7 @@ enum {
15621564 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
15631565 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
15641566 IFLA_BOND_SLAVE_PRIO,
1567 IFLA_BOND_SLAVE_ACTOR_PORT_PRIO,
15651568 __IFLA_BOND_SLAVE_MAX,
15661569};
15671570
lib/libc/include/any-linux-any/linux/if_team.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/team.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_IF_TEAM_H
78#define _LINUX_IF_TEAM_H
lib/libc/include/any-linux-any/linux/iio/types.h+5
......@@ -52,6 +52,7 @@ enum iio_chan_type {
5252 IIO_COLORTEMP,
5353 IIO_CHROMATICITY,
5454 IIO_ATTENTION,
55 IIO_ALTCURRENT,
5556};
5657
5758enum iio_modifier {
......@@ -108,6 +109,10 @@ enum iio_modifier {
108109 IIO_MOD_ROLL,
109110 IIO_MOD_LIGHT_UVA,
110111 IIO_MOD_LIGHT_UVB,
112 IIO_MOD_RMS,
113 IIO_MOD_ACTIVE,
114 IIO_MOD_REACTIVE,
115 IIO_MOD_APPARENT,
111116};
112117
113118enum iio_event_type {
lib/libc/include/any-linux-any/linux/input-event-codes.h+22
......@@ -27,6 +27,7 @@
2727#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */
2828#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */
2929#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */
30#define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */
3031
3132#define INPUT_PROP_MAX 0x1f
3233#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
......@@ -630,6 +631,18 @@
630631#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
631632#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
632633
634/*
635 * Keycodes for hotkeys toggling the electronic privacy screen found on some
636 * laptops on/off. Note when the embedded-controller turns on/off the eprivacy
637 * screen itself then the state should be reported through drm connecter props:
638 * https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
639 * Except when implementing the drm connecter properties API is not possible
640 * because e.g. the firmware does not allow querying the presence and/or status
641 * of the eprivacy screen at boot.
642 */
643#define KEY_EPRIVACY_SCREEN_ON 0x252
644#define KEY_EPRIVACY_SCREEN_OFF 0x253
645
633646#define KEY_KBDINPUTASSIST_PREV 0x260
634647#define KEY_KBDINPUTASSIST_NEXT 0x261
635648#define KEY_KBDINPUTASSIST_PREVGROUP 0x262
......@@ -878,6 +891,7 @@
878891
879892#define ABS_VOLUME 0x20
880893#define ABS_PROFILE 0x21
894#define ABS_SND_PROFILE 0x22
881895
882896#define ABS_MISC 0x28
883897
......@@ -987,4 +1001,12 @@
9871001#define SND_MAX 0x07
9881002#define SND_CNT (SND_MAX+1)
9891003
1004/*
1005 * ABS_SND_PROFILE values
1006 */
1007
1008#define SND_PROFILE_SILENT 0x00
1009#define SND_PROFILE_VIBRATE 0x01
1010#define SND_PROFILE_RING 0x02
1011
9901012#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/input.h+21-1
......@@ -427,6 +427,24 @@ struct ff_rumble_effect {
427427 __u16 weak_magnitude;
428428};
429429
430/**
431 * struct ff_haptic_effect
432 * @hid_usage: hid_usage according to Haptics page (WAVEFORM_CLICK, etc.)
433 * @vendor_id: the waveform vendor ID if hid_usage is in the vendor-defined range
434 * @vendor_waveform_page: the vendor waveform page if hid_usage is in the vendor-defined range
435 * @intensity: strength of the effect as percentage
436 * @repeat_count: number of times to retrigger effect
437 * @retrigger_period: time before effect is retriggered (in ms)
438 */
439struct ff_haptic_effect {
440 __u16 hid_usage;
441 __u16 vendor_id;
442 __u8 vendor_waveform_page;
443 __u16 intensity;
444 __u16 repeat_count;
445 __u16 retrigger_period;
446};
447
430448/**
431449 * struct ff_effect - defines force feedback effect
432450 * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
......@@ -463,6 +481,7 @@ struct ff_effect {
463481 struct ff_periodic_effect periodic;
464482 struct ff_condition_effect condition[2]; /* One for each axis */
465483 struct ff_rumble_effect rumble;
484 struct ff_haptic_effect haptic;
466485 } u;
467486};
468487
......@@ -470,6 +489,7 @@ struct ff_effect {
470489 * Force feedback effect types
471490 */
472491
492#define FF_HAPTIC 0x4f
473493#define FF_RUMBLE 0x50
474494#define FF_PERIODIC 0x51
475495#define FF_CONSTANT 0x52
......@@ -479,7 +499,7 @@ struct ff_effect {
479499#define FF_INERTIA 0x56
480500#define FF_RAMP 0x57
481501
482#define FF_EFFECT_MIN FF_RUMBLE
502#define FF_EFFECT_MIN FF_HAPTIC
483503#define FF_EFFECT_MAX FF_RAMP
484504
485505/*
lib/libc/include/any-linux-any/linux/io_uring.h+69-2
......@@ -225,6 +225,18 @@ enum io_uring_sqe_flags_bit {
225225/* Use hybrid poll in iopoll process */
226226#define IORING_SETUP_HYBRID_IOPOLL (1U << 17)
227227
228/*
229 * Allow both 16b and 32b CQEs. If a 32b CQE is posted, it will have
230 * IORING_CQE_F_32 set in cqe->flags.
231 */
232#define IORING_SETUP_CQE_MIXED (1U << 18)
233
234/*
235 * Allow both 64b and 128b SQEs. If a 128b SQE is posted, it will have
236 * a 128b opcode.
237 */
238#define IORING_SETUP_SQE_MIXED (1U << 19)
239
228240enum io_uring_op {
229241 IORING_OP_NOP,
230242 IORING_OP_READV,
......@@ -289,6 +301,8 @@ enum io_uring_op {
289301 IORING_OP_READV_FIXED,
290302 IORING_OP_WRITEV_FIXED,
291303 IORING_OP_PIPE,
304 IORING_OP_NOP128,
305 IORING_OP_URING_CMD128,
292306
293307 /* this goes last, obviously */
294308 IORING_OP_LAST,
......@@ -298,9 +312,13 @@ enum io_uring_op {
298312 * sqe->uring_cmd_flags top 8bits aren't available for userspace
299313 * IORING_URING_CMD_FIXED use registered buffer; pass this flag
300314 * along with setting sqe->buf_index.
315 * IORING_URING_CMD_MULTISHOT must be used with buffer select, like other
316 * multishot commands. Not compatible with
317 * IORING_URING_CMD_FIXED, for now.
301318 */
302319#define IORING_URING_CMD_FIXED (1U << 0)
303#define IORING_URING_CMD_MASK IORING_URING_CMD_FIXED
320#define IORING_URING_CMD_MULTISHOT (1U << 1)
321#define IORING_URING_CMD_MASK (IORING_URING_CMD_FIXED | IORING_URING_CMD_MULTISHOT)
304322
305323
306324/*
......@@ -394,7 +412,7 @@ enum io_uring_op {
394412 * will be contiguous from the starting buffer ID.
395413 *
396414 * IORING_SEND_VECTORIZED If set, SEND[_ZC] will take a pointer to a io_vec
397 * to allow vectorized send operations.
415 * to allow vectorized send operations.
398416 */
399417#define IORING_RECVSEND_POLL_FIRST (1U << 0)
400418#define IORING_RECV_MULTISHOT (1U << 1)
......@@ -454,6 +472,7 @@ enum io_uring_msg_ring_flags {
454472#define IORING_NOP_FIXED_FILE (1U << 2)
455473#define IORING_NOP_FIXED_BUFFER (1U << 3)
456474#define IORING_NOP_TW (1U << 4)
475#define IORING_NOP_CQE32 (1U << 5)
457476
458477/*
459478 * IO completion data structure (Completion Queue Entry)
......@@ -487,12 +506,22 @@ struct io_uring_cqe {
487506 * other provided buffer type, all completions with a
488507 * buffer passed back is automatically returned to the
489508 * application.
509 * IORING_CQE_F_SKIP If set, then the application/liburing must ignore this
510 * CQE. It's only purpose is to fill a gap in the ring,
511 * if a large CQE is attempted posted when the ring has
512 * just a single small CQE worth of space left before
513 * wrapping.
514 * IORING_CQE_F_32 If set, this is a 32b/big-cqe posting. Use with rings
515 * setup in a mixed CQE mode, where both 16b and 32b
516 * CQEs may be posted to the CQ ring.
490517 */
491518#define IORING_CQE_F_BUFFER (1U << 0)
492519#define IORING_CQE_F_MORE (1U << 1)
493520#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
494521#define IORING_CQE_F_NOTIF (1U << 3)
495522#define IORING_CQE_F_BUF_MORE (1U << 4)
523#define IORING_CQE_F_SKIP (1U << 5)
524#define IORING_CQE_F_32 (1U << 15)
496525
497526#define IORING_CQE_BUFFER_SHIFT 16
498527
......@@ -665,6 +694,12 @@ enum io_uring_register_op {
665694
666695 IORING_REGISTER_MEM_REGION = 34,
667696
697 /* query various aspects of io_uring, see linux/io_uring/query.h */
698 IORING_REGISTER_QUERY = 35,
699
700 /* auxiliary zcrx configuration, see enum zcrx_ctrl_op */
701 IORING_REGISTER_ZCRX_CTRL = 36,
702
668703 /* this goes last */
669704 IORING_REGISTER_LAST,
670705
......@@ -974,6 +1009,7 @@ enum io_uring_socket_op {
9741009 SOCKET_URING_OP_GETSOCKOPT,
9751010 SOCKET_URING_OP_SETSOCKOPT,
9761011 SOCKET_URING_OP_TX_TIMESTAMP,
1012 SOCKET_URING_OP_GETSOCKNAME,
9771013};
9781014
9791015/*
......@@ -1028,6 +1064,10 @@ struct io_uring_zcrx_area_reg {
10281064 __u64 __resv2[2];
10291065};
10301066
1067enum zcrx_reg_flags {
1068 ZCRX_REG_IMPORT = 1,
1069};
1070
10311071/*
10321072 * Argument for IORING_REGISTER_ZCRX_IFQ
10331073 */
......@@ -1046,6 +1086,33 @@ struct io_uring_zcrx_ifq_reg {
10461086 __u64 __resv[3];
10471087};
10481088
1089enum zcrx_ctrl_op {
1090 ZCRX_CTRL_FLUSH_RQ,
1091 ZCRX_CTRL_EXPORT,
1092
1093 __ZCRX_CTRL_LAST,
1094};
1095
1096struct zcrx_ctrl_flush_rq {
1097 __u64 __resv[6];
1098};
1099
1100struct zcrx_ctrl_export {
1101 __u32 zcrx_fd;
1102 __u32 __resv1[11];
1103};
1104
1105struct zcrx_ctrl {
1106 __u32 zcrx_id;
1107 __u32 op; /* see enum zcrx_ctrl_op */
1108 __u64 __resv[2];
1109
1110 union {
1111 struct zcrx_ctrl_export zc_export;
1112 struct zcrx_ctrl_flush_rq zc_flush;
1113 };
1114};
1115
10491116#ifdef __cplusplus
10501117}
10511118#endif
lib/libc/include/any-linux-any/linux/io_uring/query.h created+68
......@@ -0,0 +1,68 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/*
3 * Header file for the io_uring query interface.
4 */
5#ifndef LINUX_IO_URING_QUERY_H
6#define LINUX_IO_URING_QUERY_H
7
8#include <linux/types.h>
9
10struct io_uring_query_hdr {
11 __u64 next_entry;
12 __u64 query_data;
13 __u32 query_op;
14 __u32 size;
15 __s32 result;
16 __u32 __resv[3];
17};
18
19enum {
20 IO_URING_QUERY_OPCODES = 0,
21 IO_URING_QUERY_ZCRX = 1,
22 IO_URING_QUERY_SCQ = 2,
23
24 __IO_URING_QUERY_MAX,
25};
26
27/* Doesn't require a ring */
28struct io_uring_query_opcode {
29 /* The number of supported IORING_OP_* opcodes */
30 __u32 nr_request_opcodes;
31 /* The number of supported IORING_[UN]REGISTER_* opcodes */
32 __u32 nr_register_opcodes;
33 /* Bitmask of all supported IORING_FEAT_* flags */
34 __u64 feature_flags;
35 /* Bitmask of all supported IORING_SETUP_* flags */
36 __u64 ring_setup_flags;
37 /* Bitmask of all supported IORING_ENTER_** flags */
38 __u64 enter_flags;
39 /* Bitmask of all supported IOSQE_* flags */
40 __u64 sqe_flags;
41 /* The number of available query opcodes */
42 __u32 nr_query_opcodes;
43 __u32 __pad;
44};
45
46struct io_uring_query_zcrx {
47 /* Bitmask of supported ZCRX_REG_* flags, */
48 __u64 register_flags;
49 /* Bitmask of all supported IORING_ZCRX_AREA_* flags */
50 __u64 area_flags;
51 /* The number of supported ZCRX_CTRL_* opcodes */
52 __u32 nr_ctrl_opcodes;
53 __u32 __resv1;
54 /* The refill ring header size */
55 __u32 rq_hdr_size;
56 /* The alignment for the header */
57 __u32 rq_hdr_alignment;
58 __u64 __resv2;
59};
60
61struct io_uring_query_scq {
62 /* The SQ/CQ rings header size */
63 __u64 hdr_size;
64 /* The alignment for the header */
65 __u64 hdr_alignment;
66};
67
68#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommufd.h+10
......@@ -450,6 +450,16 @@ struct iommu_hwpt_vtd_s1 {
450450 * nested domain will translate the same as the nesting parent. The S1 will
451451 * install a Context Descriptor Table pointing at userspace memory translated
452452 * by the nesting parent.
453 *
454 * It's suggested to allocate a vDEVICE object carrying vSID and then re-attach
455 * the nested domain, as soon as the vSID is available in the VMM level:
456 *
457 * - when Cfg=translate, a vDEVICE must be allocated prior to attaching to the
458 * allocated nested domain, as CD/ATS invalidations and vevents need a vSID.
459 * - when Cfg=bypass/abort, a vDEVICE is not enforced during the nested domain
460 * attachment, to support a GBPA case where VM sets CR0.SMMUEN=0. However, if
461 * VM sets CR0.SMMUEN=1 while missing a vDEVICE object, kernel would fail to
462 * report events to the VM. E.g. F_TRANSLATION when guest STE.Cfg=abort.
453463 */
454464struct iommu_hwpt_arm_smmuv3 {
455465 __aligned_le64 ste[2];
lib/libc/include/any-linux-any/linux/isst_if.h+27-23
......@@ -52,7 +52,7 @@ struct isst_if_cpu_map {
5252/**
5353 * struct isst_if_cpu_maps - structure for CPU map IOCTL
5454 * @cmd_count: Number of CPU mapping command in cpu_map[]
55 * @cpu_map[]: Holds one or more CPU map data structure
55 * @cpu_map: Holds one or more CPU map data structure
5656 *
5757 * This structure used with ioctl ISST_IF_GET_PHY_ID to send
5858 * one or more CPU mapping commands. Here IOCTL return value indicates
......@@ -82,8 +82,8 @@ struct isst_if_io_reg {
8282
8383/**
8484 * struct isst_if_io_regs - structure for IO register commands
85 * @cmd_count: Number of io reg commands in io_reg[]
86 * @io_reg[]: Holds one or more io_reg command structure
85 * @req_count: Number of io reg commands in io_reg[]
86 * @io_reg: Holds one or more io_reg command structure
8787 *
8888 * This structure used with ioctl ISST_IF_IO_CMD to send
8989 * one or more read/write commands to PUNIT. Here IOCTL return value
......@@ -120,7 +120,7 @@ struct isst_if_mbox_cmd {
120120/**
121121 * struct isst_if_mbox_cmds - structure for mailbox commands
122122 * @cmd_count: Number of mailbox commands in mbox_cmd[]
123 * @mbox_cmd[]: Holds one or more mbox commands
123 * @mbox_cmd: Holds one or more mbox commands
124124 *
125125 * This structure used with ioctl ISST_IF_MBOX_COMMAND to send
126126 * one or more mailbox commands to PUNIT. Here IOCTL return value
......@@ -152,7 +152,7 @@ struct isst_if_msr_cmd {
152152/**
153153 * struct isst_if_msr_cmds - structure for msr commands
154154 * @cmd_count: Number of mailbox commands in msr_cmd[]
155 * @msr_cmd[]: Holds one or more msr commands
155 * @msr_cmd: Holds one or more msr commands
156156 *
157157 * This structure used with ioctl ISST_IF_MSR_COMMAND to send
158158 * one or more MSR commands. IOCTL return value indicates number of
......@@ -167,8 +167,9 @@ struct isst_if_msr_cmds {
167167 * struct isst_core_power - Structure to get/set core_power feature
168168 * @get_set: 0: Get, 1: Set
169169 * @socket_id: Socket/package id
170 * @power_domain: Power Domain id
170 * @power_domain_id: Power Domain id
171171 * @enable: Feature enable status
172 * @supported: Power domain supports SST_CP interface
172173 * @priority_type: Priority type for the feature (ordered/proportional)
173174 *
174175 * Structure to get/set core_power feature state using IOCTL
......@@ -187,11 +188,11 @@ struct isst_core_power {
187188 * struct isst_clos_param - Structure to get/set clos praram
188189 * @get_set: 0: Get, 1: Set
189190 * @socket_id: Socket/package id
190 * @power_domain: Power Domain id
191 * clos: Clos ID for the parameters
192 * min_freq_mhz: Minimum frequency in MHz
193 * max_freq_mhz: Maximum frequency in MHz
194 * prop_prio: Proportional priority from 0-15
191 * @power_domain_id: Power Domain id
192 * @clos: Clos ID for the parameters
193 * @min_freq_mhz: Minimum frequency in MHz
194 * @max_freq_mhz: Maximum frequency in MHz
195 * @prop_prio: Proportional priority from 0-15
195196 *
196197 * Structure to get/set per clos property using IOCTL
197198 * ISST_IF_CLOS_PARAM.
......@@ -209,7 +210,7 @@ struct isst_clos_param {
209210/**
210211 * struct isst_if_clos_assoc - Structure to assign clos to a CPU
211212 * @socket_id: Socket/package id
212 * @power_domain: Power Domain id
213 * @power_domain_id: Power Domain id
213214 * @logical_cpu: CPU number
214215 * @clos: Clos ID to assign to the logical CPU
215216 *
......@@ -228,6 +229,7 @@ struct isst_if_clos_assoc {
228229 * @get_set: Request is for get or set
229230 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not
230231 * Linux CPU number
232 * @assoc_info: CLOS data for this CPU
231233 *
232234 * Structure used to get/set associate CPUs to clos using IOCTL
233235 * ISST_IF_CLOS_ASSOC.
......@@ -257,7 +259,7 @@ struct isst_tpmi_instance_count {
257259/**
258260 * struct isst_perf_level_info - Structure to get information on SST-PP levels
259261 * @socket_id: Socket/package id
260 * @power_domain: Power Domain id
262 * @power_domain_id: Power Domain id
261263 * @logical_cpu: CPU number
262264 * @clos: Clos ID to assign to the logical CPU
263265 * @max_level: Maximum performance level supported by the platform
......@@ -267,8 +269,8 @@ struct isst_tpmi_instance_count {
267269 * @feature_state: SST-BF and SST-TF (enabled/disabled) status at current level
268270 * @locked: SST-PP performance level change is locked/unlocked
269271 * @enabled: SST-PP feature is enabled or not
270 * @sst-tf_support: SST-TF support status at this level
271 * @sst-bf_support: SST-BF support status at this level
272 * @sst_tf_support: SST-TF support status at this level
273 * @sst_bf_support: SST-BF support status at this level
272274 *
273275 * Structure to get SST-PP details using IOCTL ISST_IF_PERF_LEVELS.
274276 */
......@@ -289,7 +291,7 @@ struct isst_perf_level_info {
289291/**
290292 * struct isst_perf_level_control - Structure to set SST-PP level
291293 * @socket_id: Socket/package id
292 * @power_domain: Power Domain id
294 * @power_domain_id: Power Domain id
293295 * @level: level to set
294296 *
295297 * Structure used change SST-PP level using IOCTL ISST_IF_PERF_SET_LEVEL.
......@@ -303,7 +305,7 @@ struct isst_perf_level_control {
303305/**
304306 * struct isst_perf_feature_control - Structure to activate SST-BF/SST-TF
305307 * @socket_id: Socket/package id
306 * @power_domain: Power Domain id
308 * @power_domain_id: Power Domain id
307309 * @feature: bit 0 = SST-BF state, bit 1 = SST-TF state
308310 *
309311 * Structure used to enable SST-BF/SST-TF using IOCTL ISST_IF_PERF_SET_FEATURE.
......@@ -320,7 +322,7 @@ struct isst_perf_feature_control {
320322/**
321323 * struct isst_perf_level_data_info - Structure to get SST-PP level details
322324 * @socket_id: Socket/package id
323 * @power_domain: Power Domain id
325 * @power_domain_id: Power Domain id
324326 * @level: SST-PP level for which caller wants to get information
325327 * @tdp_ratio: TDP Ratio
326328 * @base_freq_mhz: Base frequency in MHz
......@@ -341,8 +343,8 @@ struct isst_perf_feature_control {
341343 * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency
342344 * @max_buckets: Maximum trl buckets
343345 * @max_trl_levels: Maximum trl levels
344 * @bucket_core_counts[TRL_MAX_BUCKETS]: Number of cores per bucket
345 * @trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]: maximum frequency
346 * @bucket_core_counts: Number of cores per bucket
347 * @trl_freq_mhz: maximum frequency
346348 * for a bucket and trl level
347349 *
348350 * Structure used to get information on frequencies and TDP for a SST-PP
......@@ -402,7 +404,7 @@ struct isst_perf_level_fabric_info {
402404/**
403405 * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask
404406 * @socket_id: Socket/package id
405 * @power_domain: Power Domain id
407 * @power_domain_id: Power Domain id
406408 * @level: SST-PP level for which caller wants to get information
407409 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not
408410 * Linux CPU number. If 0 CPU buffer is copied to user space
......@@ -430,7 +432,7 @@ struct isst_perf_level_cpu_mask {
430432/**
431433 * struct isst_base_freq_info - Structure to get SST-BF frequencies
432434 * @socket_id: Socket/package id
433 * @power_domain: Power Domain id
435 * @power_domain_id: Power Domain id
434436 * @level: SST-PP level for which caller wants to get information
435437 * @high_base_freq_mhz: High priority CPU base frequency
436438 * @low_base_freq_mhz: Low priority CPU base frequency
......@@ -453,9 +455,11 @@ struct isst_base_freq_info {
453455/**
454456 * struct isst_turbo_freq_info - Structure to get SST-TF frequencies
455457 * @socket_id: Socket/package id
456 * @power_domain: Power Domain id
458 * @power_domain_id: Power Domain id
457459 * @level: SST-PP level for which caller wants to get information
458460 * @max_clip_freqs: Maximum number of low priority core clipping frequencies
461 * @max_buckets: Maximum trl buckets
462 * @max_trl_levels: Maximum trl levels
459463 * @lp_clip_freq_mhz: Clip frequencies per trl level
460464 * @bucket_core_counts: Maximum number of cores for a bucket
461465 * @trl_freq_mhz: Frequencies per trl level for each bucket
lib/libc/include/any-linux-any/linux/ivtv.h+1-1
......@@ -2,7 +2,7 @@
22/*
33 Public ivtv API header
44 Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
5 Copyright (C) 2004-2007 Hans Verkuil <hverkuil@xs4all.nl>
5 Copyright (C) 2004-2007 Hans Verkuil <hverkuil@kernel.org>
66
77 This program is free software; you can redistribute it and/or modify
88 it under the terms of the GNU General Public License as published by
lib/libc/include/any-linux-any/linux/kexec.h+4
......@@ -22,12 +22,16 @@
2222 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
2323 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
2424 * fd field.
25 * KEXEC_FILE_FORCE_DTB : Force carrying over the current boot's DTB to the new
26 * kernel on x86. This is already the default behavior on
27 * some other architectures, like ARM64 and PowerPC.
2528 */
2629#define KEXEC_FILE_UNLOAD 0x00000001
2730#define KEXEC_FILE_ON_CRASH 0x00000002
2831#define KEXEC_FILE_NO_INITRAMFS 0x00000004
2932#define KEXEC_FILE_DEBUG 0x00000008
3033#define KEXEC_FILE_NO_CMA 0x00000010
34#define KEXEC_FILE_FORCE_DTB 0x00000020
3135
3236/* These values match the ELF architecture values.
3337 * Unless there is a good reason that should continue to be the case.
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+2-2
......@@ -67,8 +67,8 @@ struct kfd_ioctl_get_version_args {
6767
6868struct kfd_ioctl_create_queue_args {
6969 __u64 ring_base_address; /* to KFD */
70 __u64 write_pointer_address; /* from KFD */
71 __u64 read_pointer_address; /* from KFD */
70 __u64 write_pointer_address; /* to KFD */
71 __u64 read_pointer_address; /* to KFD */
7272 __u64 doorbell_offset; /* from KFD */
7373
7474 __u32 ring_size; /* to KFD */
lib/libc/include/any-linux-any/linux/kvm.h+14
......@@ -179,6 +179,7 @@ struct kvm_xen_exit {
179179#define KVM_EXIT_LOONGARCH_IOCSR 38
180180#define KVM_EXIT_MEMORY_FAULT 39
181181#define KVM_EXIT_TDX 40
182#define KVM_EXIT_ARM_SEA 41
182183
183184/* For KVM_EXIT_INTERNAL_ERROR */
184185/* Emulate instruction failed. */
......@@ -465,6 +466,14 @@ struct kvm_run {
465466 } setup_event_notify;
466467 };
467468 } tdx;
469 /* KVM_EXIT_ARM_SEA */
470 struct {
471#define KVM_EXIT_ARM_SEA_FLAG_GPA_VALID (1ULL << 0)
472 __u64 flags;
473 __u64 esr;
474 __u64 gva;
475 __u64 gpa;
476 } arm_sea;
468477 /* Fix the size of the union. */
469478 char padding[256];
470479 };
......@@ -954,6 +963,9 @@ struct kvm_enable_cap {
954963#define KVM_CAP_ARM_EL2_E2H0 241
955964#define KVM_CAP_RISCV_MP_STATE_RESET 242
956965#define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243
966#define KVM_CAP_GUEST_MEMFD_FLAGS 244
967#define KVM_CAP_ARM_SEA_TO_USER 245
968#define KVM_CAP_S390_USER_OPEREXEC 246
957969
958970struct kvm_irq_routing_irqchip {
959971 __u32 irqchip;
......@@ -1590,6 +1602,8 @@ struct kvm_memory_attributes {
15901602#define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3)
15911603
15921604#define KVM_CREATE_GUEST_MEMFD _IOWR(KVMIO, 0xd4, struct kvm_create_guest_memfd)
1605#define GUEST_MEMFD_FLAG_MMAP (1ULL << 0)
1606#define GUEST_MEMFD_FLAG_INIT_SHARED (1ULL << 1)
15931607
15941608struct kvm_create_guest_memfd {
15951609 __u64 size;
lib/libc/include/any-linux-any/linux/landlock.h+17-20
......@@ -216,6 +216,23 @@ struct landlock_net_port_attr {
216216 * :manpage:`ftruncate(2)`, :manpage:`creat(2)`, or :manpage:`open(2)` with
217217 * ``O_TRUNC``. This access right is available since the third version of the
218218 * Landlock ABI.
219 * - %LANDLOCK_ACCESS_FS_IOCTL_DEV: Invoke :manpage:`ioctl(2)` commands on an opened
220 * character or block device.
221 *
222 * This access right applies to all `ioctl(2)` commands implemented by device
223 * drivers. However, the following common IOCTL commands continue to be
224 * invokable independent of the %LANDLOCK_ACCESS_FS_IOCTL_DEV right:
225 *
226 * * IOCTL commands targeting file descriptors (``FIOCLEX``, ``FIONCLEX``),
227 * * IOCTL commands targeting file descriptions (``FIONBIO``, ``FIOASYNC``),
228 * * IOCTL commands targeting file systems (``FIFREEZE``, ``FITHAW``,
229 * ``FIGETBSZ``, ``FS_IOC_GETFSUUID``, ``FS_IOC_GETFSSYSFSPATH``)
230 * * Some IOCTL commands which do not make sense when used with devices, but
231 * whose implementations are safe and return the right error codes
232 * (``FS_IOC_FIEMAP``, ``FICLONE``, ``FICLONERANGE``, ``FIDEDUPERANGE``)
233 *
234 * This access right is available since the fifth version of the Landlock
235 * ABI.
219236 *
220237 * Whether an opened file can be truncated with :manpage:`ftruncate(2)` or used
221238 * with `ioctl(2)` is determined during :manpage:`open(2)`, in the same way as
......@@ -275,26 +292,6 @@ struct landlock_net_port_attr {
275292 * If multiple requirements are not met, the ``EACCES`` error code takes
276293 * precedence over ``EXDEV``.
277294 *
278 * The following access right applies both to files and directories:
279 *
280 * - %LANDLOCK_ACCESS_FS_IOCTL_DEV: Invoke :manpage:`ioctl(2)` commands on an opened
281 * character or block device.
282 *
283 * This access right applies to all `ioctl(2)` commands implemented by device
284 * drivers. However, the following common IOCTL commands continue to be
285 * invokable independent of the %LANDLOCK_ACCESS_FS_IOCTL_DEV right:
286 *
287 * * IOCTL commands targeting file descriptors (``FIOCLEX``, ``FIONCLEX``),
288 * * IOCTL commands targeting file descriptions (``FIONBIO``, ``FIOASYNC``),
289 * * IOCTL commands targeting file systems (``FIFREEZE``, ``FITHAW``,
290 * ``FIGETBSZ``, ``FS_IOC_GETFSUUID``, ``FS_IOC_GETFSSYSFSPATH``)
291 * * Some IOCTL commands which do not make sense when used with devices, but
292 * whose implementations are safe and return the right error codes
293 * (``FS_IOC_FIEMAP``, ``FICLONE``, ``FICLONERANGE``, ``FIDEDUPERANGE``)
294 *
295 * This access right is available since the fifth version of the Landlock
296 * ABI.
297 *
298295 * .. warning::
299296 *
300297 * It is currently not possible to restrict some file-related actions
lib/libc/include/any-linux-any/linux/liveupdate.h created+216
......@@ -0,0 +1,216 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3/*
4 * Userspace interface for /dev/liveupdate
5 * Live Update Orchestrator
6 *
7 * Copyright (c) 2025, Google LLC.
8 * Pasha Tatashin <pasha.tatashin@soleen.com>
9 */
10
11#ifndef _LIVEUPDATE_H
12#define _LIVEUPDATE_H
13
14#include <linux/ioctl.h>
15#include <linux/types.h>
16
17/**
18 * DOC: General ioctl format
19 *
20 * The ioctl interface follows a general format to allow for extensibility. Each
21 * ioctl is passed in a structure pointer as the argument providing the size of
22 * the structure in the first u32. The kernel checks that any structure space
23 * beyond what it understands is 0. This allows userspace to use the backward
24 * compatible portion while consistently using the newer, larger, structures.
25 *
26 * ioctls use a standard meaning for common errnos:
27 *
28 * - ENOTTY: The IOCTL number itself is not supported at all
29 * - E2BIG: The IOCTL number is supported, but the provided structure has
30 * non-zero in a part the kernel does not understand.
31 * - EOPNOTSUPP: The IOCTL number is supported, and the structure is
32 * understood, however a known field has a value the kernel does not
33 * understand or support.
34 * - EINVAL: Everything about the IOCTL was understood, but a field is not
35 * correct.
36 * - ENOENT: A provided token does not exist.
37 * - ENOMEM: Out of memory.
38 * - EOVERFLOW: Mathematics overflowed.
39 *
40 * As well as additional errnos, within specific ioctls.
41 */
42
43/* The ioctl type, documented in ioctl-number.rst */
44#define LIVEUPDATE_IOCTL_TYPE 0xBA
45
46/* The maximum length of session name including null termination */
47#define LIVEUPDATE_SESSION_NAME_LENGTH 64
48
49/* The /dev/liveupdate ioctl commands */
50enum {
51 LIVEUPDATE_CMD_BASE = 0x00,
52 LIVEUPDATE_CMD_CREATE_SESSION = LIVEUPDATE_CMD_BASE,
53 LIVEUPDATE_CMD_RETRIEVE_SESSION = 0x01,
54};
55
56/* ioctl commands for session file descriptors */
57enum {
58 LIVEUPDATE_CMD_SESSION_BASE = 0x40,
59 LIVEUPDATE_CMD_SESSION_PRESERVE_FD = LIVEUPDATE_CMD_SESSION_BASE,
60 LIVEUPDATE_CMD_SESSION_RETRIEVE_FD = 0x41,
61 LIVEUPDATE_CMD_SESSION_FINISH = 0x42,
62};
63
64/**
65 * struct liveupdate_ioctl_create_session - ioctl(LIVEUPDATE_IOCTL_CREATE_SESSION)
66 * @size: Input; sizeof(struct liveupdate_ioctl_create_session)
67 * @fd: Output; The new file descriptor for the created session.
68 * @name: Input; A null-terminated string for the session name, max
69 * length %LIVEUPDATE_SESSION_NAME_LENGTH including termination
70 * character.
71 *
72 * Creates a new live update session for managing preserved resources.
73 * This ioctl can only be called on the main /dev/liveupdate device.
74 *
75 * Return: 0 on success, negative error code on failure.
76 */
77struct liveupdate_ioctl_create_session {
78 __u32 size;
79 __s32 fd;
80 __u8 name[LIVEUPDATE_SESSION_NAME_LENGTH];
81};
82
83#define LIVEUPDATE_IOCTL_CREATE_SESSION \
84 _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_CREATE_SESSION)
85
86/**
87 * struct liveupdate_ioctl_retrieve_session - ioctl(LIVEUPDATE_IOCTL_RETRIEVE_SESSION)
88 * @size: Input; sizeof(struct liveupdate_ioctl_retrieve_session)
89 * @fd: Output; The new file descriptor for the retrieved session.
90 * @name: Input; A null-terminated string identifying the session to retrieve.
91 * The name must exactly match the name used when the session was
92 * created in the previous kernel.
93 *
94 * Retrieves a handle (a new file descriptor) for a preserved session by its
95 * name. This is the primary mechanism for a userspace agent to regain control
96 * of its preserved resources after a live update.
97 *
98 * The userspace application provides the null-terminated `name` of a session
99 * it created before the live update. If a preserved session with a matching
100 * name is found, the kernel instantiates it and returns a new file descriptor
101 * in the `fd` field. This new session FD can then be used for all file-specific
102 * operations, such as restoring individual file descriptors with
103 * LIVEUPDATE_SESSION_RETRIEVE_FD.
104 *
105 * It is the responsibility of the userspace application to know the names of
106 * the sessions it needs to retrieve. If no session with the given name is
107 * found, the ioctl will fail with -ENOENT.
108 *
109 * This ioctl can only be called on the main /dev/liveupdate device when the
110 * system is in the LIVEUPDATE_STATE_UPDATED state.
111 */
112struct liveupdate_ioctl_retrieve_session {
113 __u32 size;
114 __s32 fd;
115 __u8 name[LIVEUPDATE_SESSION_NAME_LENGTH];
116};
117
118#define LIVEUPDATE_IOCTL_RETRIEVE_SESSION \
119 _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_RETRIEVE_SESSION)
120
121/* Session specific IOCTLs */
122
123/**
124 * struct liveupdate_session_preserve_fd - ioctl(LIVEUPDATE_SESSION_PRESERVE_FD)
125 * @size: Input; sizeof(struct liveupdate_session_preserve_fd)
126 * @fd: Input; The user-space file descriptor to be preserved.
127 * @token: Input; An opaque, unique token for preserved resource.
128 *
129 * Holds parameters for preserving a file descriptor.
130 *
131 * User sets the @fd field identifying the file descriptor to preserve
132 * (e.g., memfd, kvm, iommufd, VFIO). The kernel validates if this FD type
133 * and its dependencies are supported for preservation. If validation passes,
134 * the kernel marks the FD internally and *initiates the process* of preparing
135 * its state for saving. The actual snapshotting of the state typically occurs
136 * during the subsequent %LIVEUPDATE_IOCTL_PREPARE execution phase, though
137 * some finalization might occur during freeze.
138 * On successful validation and initiation, the kernel uses the @token
139 * field with an opaque identifier representing the resource being preserved.
140 * This token confirms the FD is targeted for preservation and is required for
141 * the subsequent %LIVEUPDATE_SESSION_RETRIEVE_FD call after the live update.
142 *
143 * Return: 0 on success (validation passed, preservation initiated), negative
144 * error code on failure (e.g., unsupported FD type, dependency issue,
145 * validation failed).
146 */
147struct liveupdate_session_preserve_fd {
148 __u32 size;
149 __s32 fd;
150 __aligned_u64 token;
151};
152
153#define LIVEUPDATE_SESSION_PRESERVE_FD \
154 _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_SESSION_PRESERVE_FD)
155
156/**
157 * struct liveupdate_session_retrieve_fd - ioctl(LIVEUPDATE_SESSION_RETRIEVE_FD)
158 * @size: Input; sizeof(struct liveupdate_session_retrieve_fd)
159 * @fd: Output; The new file descriptor representing the fully restored
160 * kernel resource.
161 * @token: Input; An opaque, token that was used to preserve the resource.
162 *
163 * Retrieve a previously preserved file descriptor.
164 *
165 * User sets the @token field to the value obtained from a successful
166 * %LIVEUPDATE_IOCTL_FD_PRESERVE call before the live update. On success,
167 * the kernel restores the state (saved during the PREPARE/FREEZE phases)
168 * associated with the token and populates the @fd field with a new file
169 * descriptor referencing the restored resource in the current (new) kernel.
170 * This operation must be performed *before* signaling completion via
171 * %LIVEUPDATE_IOCTL_FINISH.
172 *
173 * Return: 0 on success, negative error code on failure (e.g., invalid token).
174 */
175struct liveupdate_session_retrieve_fd {
176 __u32 size;
177 __s32 fd;
178 __aligned_u64 token;
179};
180
181#define LIVEUPDATE_SESSION_RETRIEVE_FD \
182 _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_SESSION_RETRIEVE_FD)
183
184/**
185 * struct liveupdate_session_finish - ioctl(LIVEUPDATE_SESSION_FINISH)
186 * @size: Input; sizeof(struct liveupdate_session_finish)
187 * @reserved: Input; Must be zero. Reserved for future use.
188 *
189 * Signals the completion of the restoration process for a retrieved session.
190 * This is the final operation that should be performed on a session file
191 * descriptor after a live update.
192 *
193 * This ioctl must be called once all required file descriptors for the session
194 * have been successfully retrieved (using %LIVEUPDATE_SESSION_RETRIEVE_FD) and
195 * are fully restored from the userspace and kernel perspective.
196 *
197 * Upon success, the kernel releases its ownership of the preserved resources
198 * associated with this session. This allows internal resources to be freed,
199 * typically by decrementing reference counts on the underlying preserved
200 * objects.
201 *
202 * If this operation fails, the resources remain preserved in memory. Userspace
203 * may attempt to call finish again. The resources will otherwise be reset
204 * during the next live update cycle.
205 *
206 * Return: 0 on success, negative error code on failure.
207 */
208struct liveupdate_session_finish {
209 __u32 size;
210 __u32 reserved;
211};
212
213#define LIVEUPDATE_SESSION_FINISH \
214 _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_SESSION_FINISH)
215
216#endif /* _LIVEUPDATE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/lockd_netlink.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/lockd.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_LOCKD_NETLINK_H
78#define _LINUX_LOCKD_NETLINK_H
lib/libc/include/any-linux-any/linux/magic.h+1
......@@ -103,5 +103,6 @@
103103#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */
104104#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
105105#define PID_FS_MAGIC 0x50494446 /* "PIDF" */
106#define GUEST_MEMFD_MAGIC 0x474d454d /* "GMEM" */
106107
107108#endif /* __LINUX_MAGIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/map_benchmark.h created+35
......@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2022-2025 HiSilicon Limited.
4 */
5
6#ifndef _DMA_BENCHMARK_H
7#define _DMA_BENCHMARK_H
8
9#include <linux/types.h>
10
11#define DMA_MAP_BENCHMARK _IOWR('d', 1, struct map_benchmark)
12#define DMA_MAP_MAX_THREADS 1024
13#define DMA_MAP_MAX_SECONDS 300
14#define DMA_MAP_MAX_TRANS_DELAY (10 * NSEC_PER_MSEC)
15
16#define DMA_MAP_BIDIRECTIONAL 0
17#define DMA_MAP_TO_DEVICE 1
18#define DMA_MAP_FROM_DEVICE 2
19
20struct map_benchmark {
21 __u64 avg_map_100ns; /* average map latency in 100ns */
22 __u64 map_stddev; /* standard deviation of map latency */
23 __u64 avg_unmap_100ns; /* as above */
24 __u64 unmap_stddev;
25 __u32 threads; /* how many threads will do map/unmap in parallel */
26 __u32 seconds; /* how long the test will last */
27 __s32 node; /* which numa node this benchmark will run on */
28 __u32 dma_bits; /* DMA addressing capability */
29 __u32 dma_dir; /* DMA data direction */
30 __u32 dma_trans_ns; /* time for DMA transmission in ns */
31 __u32 granule; /* how many PAGE_SIZE will do map/unmap once a time */
32 __u8 expansion[76]; /* For future use */
33};
34
35#endif /* _DMA_BENCHMARK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mdio.h+21-2
......@@ -116,10 +116,24 @@
116116#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
117117/* 10PASS-TS/2BASE-TL */
118118#define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)
119/* Note: the MDIO_CTRL1_SPEED_XXX values for everything past 10PASS-TS/2BASE-TL
120 * do not match between the PCS and PMA values. Any additions past this point
121 * should be PMA or PCS specific. The following 2 defines are workarounds for
122 * values added before this was caught. They should be considered deprecated.
123 */
124#define MDIO_CTRL1_SPEED2_5G MDIO_PMA_CTRL1_SPEED2_5G
125#define MDIO_CTRL1_SPEED5G MDIO_PMA_CTRL1_SPEED5G
126/* 100 Gb/s */
127#define MDIO_PCS_CTRL1_SPEED100G (MDIO_CTRL1_SPEEDSELEXT | 0x10)
128/* 25 Gb/s */
129#define MDIO_PCS_CTRL1_SPEED25G (MDIO_CTRL1_SPEEDSELEXT | 0x14)
130/* 50 Gb/s */
131#define MDIO_PCS_CTRL1_SPEED50G (MDIO_CTRL1_SPEEDSELEXT | 0x18)
119132/* 2.5 Gb/s */
120#define MDIO_CTRL1_SPEED2_5G (MDIO_CTRL1_SPEEDSELEXT | 0x18)
133#define MDIO_PMA_CTRL1_SPEED2_5G (MDIO_CTRL1_SPEEDSELEXT | 0x18)
121134/* 5 Gb/s */
122#define MDIO_CTRL1_SPEED5G (MDIO_CTRL1_SPEEDSELEXT | 0x1c)
135#define MDIO_PMA_CTRL1_SPEED5G (MDIO_CTRL1_SPEEDSELEXT | 0x1c)
136
123137
124138/* Status register 1. */
125139#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */
......@@ -133,6 +147,11 @@
133147#define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */
134148#define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */
135149
150/* Device Identifier 2 */
151#define MDIO_DEVID2_OUI 0xfc00 /* OUI Portion of PHY ID */
152#define MDIO_DEVID2_MODEL_NUM 0x03f0 /* Manufacturer's Model Number */
153#define MDIO_DEVID2_REV_NUM 0x000f /* Revision Number */
154
136155/* Speed register. */
137156#define MDIO_SPEED_10G 0x0001 /* 10G capable */
138157#define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */
lib/libc/include/any-linux-any/linux/media-bus-format.h+7-2
......@@ -34,7 +34,7 @@
3434
3535#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x1028 */
37/* RGB - next is 0x1029 */
3838#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
3939#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
4040#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
......@@ -74,6 +74,7 @@
7474#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x1021
7575#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
7676#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
77#define MEDIA_BUS_FMT_RGB202020_1X60 0x1028
7778
7879/* YUV (including grey) - next is 0x202f */
7980#define MEDIA_BUS_FMT_Y8_1X8 0x2001
......@@ -123,7 +124,7 @@
123124#define MEDIA_BUS_FMT_YUV16_1X48 0x202a
124125#define MEDIA_BUS_FMT_UYYVYY16_0_5X48 0x202b
125126
126/* Bayer - next is 0x3021 */
127/* Bayer - next is 0x3025 */
127128#define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001
128129#define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013
129130#define MEDIA_BUS_FMT_SGRBG8_1X8 0x3002
......@@ -156,6 +157,10 @@
156157#define MEDIA_BUS_FMT_SGBRG16_1X16 0x301e
157158#define MEDIA_BUS_FMT_SGRBG16_1X16 0x301f
158159#define MEDIA_BUS_FMT_SRGGB16_1X16 0x3020
160#define MEDIA_BUS_FMT_SBGGR20_1X20 0x3021
161#define MEDIA_BUS_FMT_SGBRG20_1X20 0x3022
162#define MEDIA_BUS_FMT_SGRBG20_1X20 0x3023
163#define MEDIA_BUS_FMT_SRGGB20_1X20 0x3024
159164
160165/* JPEG compressed formats - next is 0x4002 */
161166#define MEDIA_BUS_FMT_JPEG_1X8 0x4001
lib/libc/include/any-linux-any/linux/media/amlogic/c3-isp-config.h+17-69
......@@ -8,6 +8,8 @@
88
99#include <linux/types.h>
1010
11#include <linux/media/v4l2-isp.h>
12
1113/*
1214 * Frames are split into zones of almost equal width and height - a zone is a
1315 * rectangular tile of a frame. The metering blocks within the ISP collect
......@@ -141,7 +143,7 @@ struct c3_isp_stats_info {
141143 * @C3_ISP_PARAMS_BUFFER_V0: First version of C3 ISP parameters block
142144 */
143145enum c3_isp_params_buffer_version {
144 C3_ISP_PARAMS_BUFFER_V0,
146 C3_ISP_PARAMS_BUFFER_V0 = V4L2_ISP_PARAMS_VERSION_V0,
145147};
146148
147149/**
......@@ -176,62 +178,23 @@ enum c3_isp_params_block_type {
176178 C3_ISP_PARAMS_BLOCK_SENTINEL
177179};
178180
179#define C3_ISP_PARAMS_BLOCK_FL_DISABLE (1U << 0)
180#define C3_ISP_PARAMS_BLOCK_FL_ENABLE (1U << 1)
181/* For backward compatibility */
182#define C3_ISP_PARAMS_BLOCK_FL_DISABLE V4L2_ISP_PARAMS_FL_BLOCK_DISABLE
183#define C3_ISP_PARAMS_BLOCK_FL_ENABLE V4L2_ISP_PARAMS_FL_BLOCK_ENABLE
181184
182185/**
183 * struct c3_isp_params_block_header - C3 ISP parameter block header
186 * c3_isp_params_block_header - C3 ISP parameter block header
184187 *
185188 * This structure represents the common part of all the ISP configuration
186 * blocks. Each parameters block shall embed an instance of this structure type
187 * as its first member, followed by the block-specific configuration data. The
188 * driver inspects this common header to discern the block type and its size and
189 * properly handle the block content by casting it to the correct block-specific
190 * type.
189 * blocks and is identical to :c:type:`v4l2_isp_params_block_header`.
191190 *
192 * The @type field is one of the values enumerated by
191 * The type field is one of the values enumerated by
193192 * :c:type:`c3_isp_params_block_type` and specifies how the data should be
194 * interpreted by the driver. The @size field specifies the size of the
195 * parameters block and is used by the driver for validation purposes. The
196 * @flags field is a bitmask of per-block flags C3_ISP_PARAMS_FL*.
197 *
198 * When userspace wants to disable an ISP block the
199 * C3_ISP_PARAMS_BLOCK_FL_DISABLED bit should be set in the @flags field. In
200 * this case userspace may optionally omit the remainder of the configuration
201 * block, which will be ignored by the driver.
202 *
203 * When a new configuration of an ISP block needs to be applied userspace
204 * shall fully populate the ISP block and omit setting the
205 * C3_ISP_PARAMS_BLOCK_FL_DISABLED bit in the @flags field.
206 *
207 * Userspace is responsible for correctly populating the parameters block header
208 * fields (@type, @flags and @size) and the block-specific parameters.
209 *
210 * For example:
211 *
212 * .. code-block:: c
193 * interpreted by the driver.
213194 *
214 * void populate_pst_gamma(struct c3_isp_params_block_header *block) {
215 * struct c3_isp_params_pst_gamma *gamma =
216 * (struct c3_isp_params_pst_gamma *)block;
217 *
218 * gamma->header.type = C3_ISP_PARAMS_BLOCK_PST_GAMMA;
219 * gamma->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
220 * gamma->header.size = sizeof(*gamma);
221 *
222 * for (unsigned int i = 0; i < 129; i++)
223 * gamma->pst_gamma_lut[i] = i;
224 * }
225 *
226 * @type: The parameters block type from :c:type:`c3_isp_params_block_type`
227 * @flags: A bitmask of block flags
228 * @size: Size (in bytes) of the parameters block, including this header
195 * The flags field is a bitmask of per-block flags C3_ISP_PARAMS_FL_*.
229196 */
230struct c3_isp_params_block_header {
231 __u16 type;
232 __u16 flags;
233 __u32 size;
234};
197#define c3_isp_params_block_header v4l2_isp_params_block_header
235198
236199/**
237200 * struct c3_isp_params_awb_gains - Gains for auto-white balance
......@@ -498,26 +461,10 @@ struct c3_isp_params_blc {
498461/**
499462 * struct c3_isp_params_cfg - C3 ISP configuration parameters
500463 *
501 * This struct contains the configuration parameters of the C3 ISP
502 * algorithms, serialized by userspace into an opaque data buffer. Each
503 * configuration parameter block is represented by a block-specific structure
504 * which contains a :c:type:`c3_isp_param_block_header` entry as first
505 * member. Userspace populates the @data buffer with configuration parameters
506 * for the blocks that it intends to configure. As a consequence, the data
507 * buffer effective size changes according to the number of ISP blocks that
508 * userspace intends to configure.
509 *
510 * The parameters buffer is versioned by the @version field to allow modifying
511 * and extending its definition. Userspace should populate the @version field to
512 * inform the driver about the version it intends to use. The driver will parse
513 * and handle the @data buffer according to the data layout specific to the
514 * indicated revision and return an error if the desired revision is not
515 * supported.
516 *
517 * For each ISP block that userspace wants to configure, a block-specific
518 * structure is appended to the @data buffer, one after the other without gaps
519 * in between nor overlaps. Userspace shall populate the @total_size field with
520 * the effective size, in bytes, of the @data buffer.
464 * This is the driver-specific implementation of
465 * :c:type:`v4l2_isp_params_buffer`.
466 *
467 * Currently only C3_ISP_PARAM_BUFFER_V0 is supported.
521468 *
522469 * The expected memory layout of the parameters buffer is::
523470 *
......@@ -561,4 +508,5 @@ struct c3_isp_params_cfg {
561508 __u8 data[C3_ISP_PARAMS_MAX_SIZE];
562509};
563510
511
564512#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/arm/mali-c55-config.h created+785
......@@ -0,0 +1,785 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * ARM Mali-C55 ISP Driver - Userspace API
4 *
5 * Copyright (C) 2023 Ideas on Board Oy
6 */
7
8#ifndef __UAPI_MALI_C55_CONFIG_H
9#define __UAPI_MALI_C55_CONFIG_H
10
11#include <linux/types.h>
12#include <linux/v4l2-controls.h>
13#include <linux/media/v4l2-isp.h>
14
15#define V4L2_CID_MALI_C55_CAPABILITIES (V4L2_CID_USER_MALI_C55_BASE + 0x0)
16#define MALI_C55_GPS_PONG (1U << 0)
17#define MALI_C55_GPS_WDR (1U << 1)
18#define MALI_C55_GPS_COMPRESSION (1U << 2)
19#define MALI_C55_GPS_TEMPER (1U << 3)
20#define MALI_C55_GPS_SINTER_LITE (1U << 4)
21#define MALI_C55_GPS_SINTER (1U << 5)
22#define MALI_C55_GPS_IRIDIX_LTM (1U << 6)
23#define MALI_C55_GPS_IRIDIX_GTM (1U << 7)
24#define MALI_C55_GPS_CNR (1U << 8)
25#define MALI_C55_GPS_FRSCALER (1U << 9)
26#define MALI_C55_GPS_DS_PIPE (1U << 10)
27
28/*
29 * Frames are split into zones of almost equal width and height - a zone is a
30 * rectangular tile of a frame. The metering blocks within the ISP collect
31 * aggregated statistics per zone. A maximum of 15x15 zones can be configured,
32 * and so the statistics buffer within the hardware is sized to accommodate
33 * that.
34 *
35 * The utilised number of zones is runtime configurable.
36 */
37#define MALI_C55_MAX_ZONES (15 * 15)
38
39/**
40 * struct mali_c55_ae_1024bin_hist - Auto Exposure 1024-bin histogram statistics
41 *
42 * @bins: 1024 element array of 16-bit pixel counts.
43 *
44 * The 1024-bin histogram module collects image-global but zone-weighted
45 * intensity distributions of pixels in fixed-width bins. The modules can be
46 * configured into different "plane modes" which affect the contents of the
47 * collected statistics. In plane mode 0, pixel intensities are taken regardless
48 * of colour plane into a single 1024-bin histogram with a bin width of 4. In
49 * plane mode 1, four 256-bin histograms with a bin width of 16 are collected -
50 * one for each CFA colour plane. In plane modes 4, 5, 6 and 7 two 512-bin
51 * histograms with a bin width of 8 are collected - in each mode one of the
52 * colour planes is collected into the first histogram and all the others are
53 * combined into the second. The histograms are stored consecutively in the bins
54 * array.
55 *
56 * The 16-bit pixel counts are stored as a 4-bit exponent in the most
57 * significant bits followed by a 12-bit mantissa. Conversion to a usable
58 * format can be done according to the following pseudo-code::
59 *
60 * if (e == 0) {
61 * bin = m * 2;
62 * } else {
63 * bin = (m + 4096) * 2^e
64 * }
65 *
66 * where
67 * e is the exponent value in range 0..15
68 * m is the mantissa value in range 0..4095
69 *
70 * The pixels used in calculating the statistics can be masked using three
71 * methods:
72 *
73 * 1. Pixels can be skipped in X and Y directions independently.
74 * 2. Minimum/Maximum intensities can be configured
75 * 3. Zones can be differentially weighted, including 0 weighted to mask them
76 *
77 * The data for this histogram can be collected from different tap points in the
78 * ISP depending on configuration - after the white balance or digital gain
79 * blocks, or immediately after the input crossbar.
80 */
81struct mali_c55_ae_1024bin_hist {
82 __u16 bins[1024];
83} __attribute__((packed));
84
85/**
86 * struct mali_c55_ae_5bin_hist - Auto Exposure 5-bin histogram statistics
87 *
88 * @hist0: 16-bit normalised pixel count for the 0th intensity bin
89 * @hist1: 16-bit normalised pixel count for the 1st intensity bin
90 * @hist3: 16-bit normalised pixel count for the 3rd intensity bin
91 * @hist4: 16-bit normalised pixel count for the 4th intensity bin
92 *
93 * The ISP generates a 5-bin histogram of normalised pixel counts within bins of
94 * pixel intensity for each of 225 possible zones within a frame. The centre bin
95 * of the histogram for each zone is not available from the hardware and must be
96 * calculated by subtracting the values of hist0, hist1, hist3 and hist4 from
97 * 0xffff as in the following equation:
98 *
99 * hist2 = 0xffff - (hist0 + hist1 + hist3 + hist4)
100 */
101struct mali_c55_ae_5bin_hist {
102 __u16 hist0;
103 __u16 hist1;
104 __u16 hist3;
105 __u16 hist4;
106} __attribute__((packed));
107
108/**
109 * struct mali_c55_awb_average_ratios - Auto White Balance colour ratios
110 *
111 * @avg_rg_gr: Average R/G or G/R ratio in Q4.8 format.
112 * @avg_bg_br: Average B/G or B/R ratio in Q4.8 format.
113 * @num_pixels: The number of pixels used in the AWB calculation
114 *
115 * The ISP calculates and collects average colour ratios for each zone in an
116 * image and stores them in Q4.8 format (the lowest 8 bits are fractional, with
117 * bits [11:8] representing the integer). The exact ratios collected (either
118 * R/G, B/G or G/R, B/R) are configurable through the parameters buffer. The
119 * value of the 4 high bits is undefined.
120 */
121struct mali_c55_awb_average_ratios {
122 __u16 avg_rg_gr;
123 __u16 avg_bg_br;
124 __u32 num_pixels;
125} __attribute__((packed));
126
127/**
128 * struct mali_c55_af_statistics - Auto Focus edge and intensity statistics
129 *
130 * @intensity_stats: Packed mantissa and exponent value for pixel intensity
131 * @edge_stats: Packed mantissa and exponent values for edge intensity
132 *
133 * The ISP collects the squared sum of pixel intensities for each zone within a
134 * configurable Region of Interest on the frame. Additionally, the same data are
135 * collected after being passed through a bandpass filter which removes high and
136 * low frequency components - these are referred to as the edge statistics.
137 *
138 * The intensity and edge statistics for a zone can be used to calculate the
139 * contrast information for a zone
140 *
141 * C = E2 / I2
142 *
143 * Where I2 is the intensity statistic for a zone and E2 is the edge statistic
144 * for that zone. Optimum focus is reached when C is at its maximum.
145 *
146 * The intensity and edge statistics are stored packed into a non-standard 16
147 * bit floating point format, where the 7 most significant bits represent the
148 * exponent and the 9 least significant bits the mantissa. This format can be
149 * unpacked with the following pseudocode::
150 *
151 * if (e == 0) {
152 * x = m;
153 * } else {
154 * x = 2^e-1 * (m + 2^9)
155 * }
156 *
157 * where
158 * e is the exponent value in range 0..127
159 * m is the mantissa value in range 0..511
160 */
161struct mali_c55_af_statistics {
162 __u16 intensity_stats;
163 __u16 edge_stats;
164} __attribute__((packed));
165
166/**
167 * struct mali_c55_stats_buffer - 3A statistics for the mali-c55 ISP
168 *
169 * @ae_1024bin_hist: 1024-bin frame-global pixel intensity histogram
170 * @iridix_1024bin_hist: Post-Iridix block 1024-bin histogram
171 * @ae_5bin_hists: 5-bin pixel intensity histograms for AEC
172 * @reserved1: Undefined buffer space
173 * @awb_ratios: Color balance ratios for Auto White Balance
174 * @reserved2: Undefined buffer space
175 * @af_statistics: Pixel intensity statistics for Auto Focus
176 * @reserved3: Undefined buffer space
177 *
178 * This struct describes the metering statistics space in the Mali-C55 ISP's
179 * hardware in its entirety. The space between each defined area is marked as
180 * "unknown" and may not be 0, but should not be used. The @ae_5bin_hists,
181 * @awb_ratios and @af_statistics members are arrays of statistics per-zone.
182 * The zones are arranged in the array in raster order starting from the top
183 * left corner of the image.
184 */
185
186struct mali_c55_stats_buffer {
187 struct mali_c55_ae_1024bin_hist ae_1024bin_hist;
188 struct mali_c55_ae_1024bin_hist iridix_1024bin_hist;
189 struct mali_c55_ae_5bin_hist ae_5bin_hists[MALI_C55_MAX_ZONES];
190 __u32 reserved1[14];
191 struct mali_c55_awb_average_ratios awb_ratios[MALI_C55_MAX_ZONES];
192 __u32 reserved2[14];
193 struct mali_c55_af_statistics af_statistics[MALI_C55_MAX_ZONES];
194 __u32 reserved3[15];
195} __attribute__((packed));
196
197/**
198 * enum mali_c55_param_block_type - Enumeration of Mali-C55 parameter blocks
199 *
200 * This enumeration defines the types of Mali-C55 parameters block. Each block
201 * configures a specific processing block of the Mali-C55 ISP. The block
202 * type allows the driver to correctly interpret the parameters block data.
203 *
204 * It is the responsibility of userspace to correctly set the type of each
205 * parameters block.
206 *
207 * @MALI_C55_PARAM_BLOCK_SENSOR_OFFS: Sensor pre-shading black level offset
208 * @MALI_C55_PARAM_BLOCK_AEXP_HIST: Auto-exposure 1024-bin histogram
209 * configuration
210 * @MALI_C55_PARAM_BLOCK_AEXP_IHIST: Post-Iridix auto-exposure 1024-bin
211 * histogram configuration
212 * @MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS: Auto-exposure 1024-bin histogram
213 * weighting
214 * @MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS: Post-Iridix auto-exposure 1024-bin
215 * histogram weighting
216 * @MALI_C55_PARAM_BLOCK_DIGITAL_GAIN: Digital gain
217 * @MALI_C55_PARAM_BLOCK_AWB_GAINS: Auto-white balance gains
218 * @MALI_C55_PARAM_BLOCK_AWB_CONFIG: Auto-white balance statistics config
219 * @MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP: Auto-white balance gains for AEXP-0 tap
220 * @MALI_C55_PARAM_MESH_SHADING_CONFIG : Mesh shading tables configuration
221 * @MALI_C55_PARAM_MESH_SHADING_SELECTION: Mesh shading table selection
222 */
223enum mali_c55_param_block_type {
224 MALI_C55_PARAM_BLOCK_SENSOR_OFFS,
225 MALI_C55_PARAM_BLOCK_AEXP_HIST,
226 MALI_C55_PARAM_BLOCK_AEXP_IHIST,
227 MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS,
228 MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS,
229 MALI_C55_PARAM_BLOCK_DIGITAL_GAIN,
230 MALI_C55_PARAM_BLOCK_AWB_GAINS,
231 MALI_C55_PARAM_BLOCK_AWB_CONFIG,
232 MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP,
233 MALI_C55_PARAM_MESH_SHADING_CONFIG,
234 MALI_C55_PARAM_MESH_SHADING_SELECTION,
235};
236
237/**
238 * struct mali_c55_params_sensor_off_preshading - offset subtraction for each
239 * color channel
240 *
241 * Provides removal of the sensor black level from the sensor data. Separate
242 * offsets are provided for each of the four Bayer component color channels
243 * which are defaulted to R, Gr, Gb, B.
244 *
245 * header.type should be set to MALI_C55_PARAM_BLOCK_SENSOR_OFFS from
246 * :c:type:`mali_c55_param_block_type` for this block.
247 *
248 * @header: The Mali-C55 parameters block header
249 * @chan00: Offset for color channel 00 (default: R)
250 * @chan01: Offset for color channel 01 (default: Gr)
251 * @chan10: Offset for color channel 10 (default: Gb)
252 * @chan11: Offset for color channel 11 (default: B)
253 */
254struct mali_c55_params_sensor_off_preshading {
255 struct v4l2_isp_params_block_header header;
256 __u32 chan00;
257 __u32 chan01;
258 __u32 chan10;
259 __u32 chan11;
260};
261
262/**
263 * enum mali_c55_aexp_hist_tap_points - Tap points for the AEXP histogram
264 * @MALI_C55_AEXP_HIST_TAP_WB: After static white balance
265 * @MALI_C55_AEXP_HIST_TAP_FS: After WDR Frame Stitch
266 * @MALI_C55_AEXP_HIST_TAP_TPG: After the test pattern generator
267 */
268enum mali_c55_aexp_hist_tap_points {
269 MALI_C55_AEXP_HIST_TAP_WB = 0,
270 MALI_C55_AEXP_HIST_TAP_FS,
271 MALI_C55_AEXP_HIST_TAP_TPG,
272};
273
274/**
275 * enum mali_c55_aexp_skip_x - Horizontal pixel skipping
276 * @MALI_C55_AEXP_SKIP_X_EVERY_2ND: Collect every 2nd pixel horizontally
277 * @MALI_C55_AEXP_SKIP_X_EVERY_3RD: Collect every 3rd pixel horizontally
278 * @MALI_C55_AEXP_SKIP_X_EVERY_4TH: Collect every 4th pixel horizontally
279 * @MALI_C55_AEXP_SKIP_X_EVERY_5TH: Collect every 5th pixel horizontally
280 * @MALI_C55_AEXP_SKIP_X_EVERY_8TH: Collect every 8th pixel horizontally
281 * @MALI_C55_AEXP_SKIP_X_EVERY_9TH: Collect every 9th pixel horizontally
282 */
283enum mali_c55_aexp_skip_x {
284 MALI_C55_AEXP_SKIP_X_EVERY_2ND,
285 MALI_C55_AEXP_SKIP_X_EVERY_3RD,
286 MALI_C55_AEXP_SKIP_X_EVERY_4TH,
287 MALI_C55_AEXP_SKIP_X_EVERY_5TH,
288 MALI_C55_AEXP_SKIP_X_EVERY_8TH,
289 MALI_C55_AEXP_SKIP_X_EVERY_9TH
290};
291
292/**
293 * enum mali_c55_aexp_skip_y - Vertical pixel skipping
294 * @MALI_C55_AEXP_SKIP_Y_ALL: Collect every single pixel vertically
295 * @MALI_C55_AEXP_SKIP_Y_EVERY_2ND: Collect every 2nd pixel vertically
296 * @MALI_C55_AEXP_SKIP_Y_EVERY_3RD: Collect every 3rd pixel vertically
297 * @MALI_C55_AEXP_SKIP_Y_EVERY_4TH: Collect every 4th pixel vertically
298 * @MALI_C55_AEXP_SKIP_Y_EVERY_5TH: Collect every 5th pixel vertically
299 * @MALI_C55_AEXP_SKIP_Y_EVERY_8TH: Collect every 8th pixel vertically
300 * @MALI_C55_AEXP_SKIP_Y_EVERY_9TH: Collect every 9th pixel vertically
301 */
302enum mali_c55_aexp_skip_y {
303 MALI_C55_AEXP_SKIP_Y_ALL,
304 MALI_C55_AEXP_SKIP_Y_EVERY_2ND,
305 MALI_C55_AEXP_SKIP_Y_EVERY_3RD,
306 MALI_C55_AEXP_SKIP_Y_EVERY_4TH,
307 MALI_C55_AEXP_SKIP_Y_EVERY_5TH,
308 MALI_C55_AEXP_SKIP_Y_EVERY_8TH,
309 MALI_C55_AEXP_SKIP_Y_EVERY_9TH
310};
311
312/**
313 * enum mali_c55_aexp_row_column_offset - Start from the first or second row or
314 * column
315 * @MALI_C55_AEXP_FIRST_ROW_OR_COL: Start from the first row / column
316 * @MALI_C55_AEXP_SECOND_ROW_OR_COL: Start from the second row / column
317 */
318enum mali_c55_aexp_row_column_offset {
319 MALI_C55_AEXP_FIRST_ROW_OR_COL = 1,
320 MALI_C55_AEXP_SECOND_ROW_OR_COL = 2,
321};
322
323/**
324 * enum mali_c55_aexp_hist_plane_mode - Mode for the AEXP Histograms
325 * @MALI_C55_AEXP_HIST_COMBINED: All color planes in one 1024-bin histogram
326 * @MALI_C55_AEXP_HIST_SEPARATE: Each color plane in one 256-bin histogram with a bin width of 16
327 * @MALI_C55_AEXP_HIST_FOCUS_00: Top left plane in the first bank, rest in second bank
328 * @MALI_C55_AEXP_HIST_FOCUS_01: Top right plane in the first bank, rest in second bank
329 * @MALI_C55_AEXP_HIST_FOCUS_10: Bottom left plane in the first bank, rest in second bank
330 * @MALI_C55_AEXP_HIST_FOCUS_11: Bottom right plane in the first bank, rest in second bank
331 *
332 * In the "focus" modes statistics are collected into two 512-bin histograms
333 * with a bin width of 8. One colour plane is in the first histogram with the
334 * remainder combined into the second. The four options represent which of the
335 * four positions in a bayer pattern are the focused plane.
336 */
337enum mali_c55_aexp_hist_plane_mode {
338 MALI_C55_AEXP_HIST_COMBINED = 0,
339 MALI_C55_AEXP_HIST_SEPARATE = 1,
340 MALI_C55_AEXP_HIST_FOCUS_00 = 4,
341 MALI_C55_AEXP_HIST_FOCUS_01 = 5,
342 MALI_C55_AEXP_HIST_FOCUS_10 = 6,
343 MALI_C55_AEXP_HIST_FOCUS_11 = 7,
344};
345
346/**
347 * struct mali_c55_params_aexp_hist - configuration for AEXP metering hists
348 *
349 * This struct allows users to configure the 1024-bin AEXP histograms. Broadly
350 * speaking the parameters allow you to mask particular regions of the image and
351 * to select different kinds of histogram.
352 *
353 * The skip_x, offset_x, skip_y and offset_y fields allow users to ignore or
354 * mask pixels in the frame by their position relative to the top left pixel.
355 * First, the skip_y, offset_x and offset_y fields define which of the pixels
356 * within each 2x2 region will be counted in the statistics.
357 *
358 * If skip_y == 0 then two pixels from each covered region will be counted. If
359 * both offset_x and offset_y are zero, then the two left-most pixels in each
360 * 2x2 pixel region will be counted. Setting offset_x = 1 will discount the top
361 * left pixel and count the top right pixel. Setting offset_y = 1 will discount
362 * the bottom left pixel and count the bottom right pixel.
363 *
364 * If skip_y != 0 then only a single pixel from each region covered by the
365 * pattern will be counted. In this case offset_x controls whether the pixel
366 * that's counted is in the left (if offset_x == 0) or right (if offset_x == 1)
367 * column and offset_y controls whether the pixel that's counted is in the top
368 * (if offset_y == 0) or bottom (if offset_y == 1) row.
369 *
370 * The skip_x and skip_y fields control how the 2x2 pixel region is repeated
371 * across the image data. The first instance of the region is always in the top
372 * left of the image data. The skip_x field controls how many pixels are ignored
373 * in the x direction before the pixel masking region is repeated. The skip_y
374 * field controls how many pixels are ignored in the y direction before the
375 * pixel masking region is repeated.
376 *
377 * These fields can be used to reduce the number of pixels counted for the
378 * statistics, but it's important to be careful to configure them correctly.
379 * Some combinations of values will result in colour components from the input
380 * data being ignored entirely, for example in the following configuration:
381 *
382 * skip_x = 0
383 * offset_x = 0
384 * skip_y = 0
385 * offset_y = 0
386 *
387 * Only the R and Gb components of RGGB data that was input would be collected.
388 * Similarly in the following configuration:
389 *
390 * skip_x = 0
391 * offset_x = 0
392 * skip_y = 1
393 * offset_y = 1
394 *
395 * Only the Gb component of RGGB data that was input would be collected. To
396 * correct things such that all 4 colour components were included it would be
397 * necessary to set the skip_x and skip_y fields in a way that resulted in all
398 * four colour components being collected:
399 *
400 * skip_x = 1
401 * offset_x = 0
402 * skip_y = 1
403 * offset_y = 1
404 *
405 * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AEXP_HIST or
406 * MALI_C55_PARAM_BLOCK_AEXP_IHIST from :c:type:`mali_c55_param_block_type`.
407 *
408 * @header: The Mali-C55 parameters block header
409 * @skip_x: Horizontal decimation. See enum mali_c55_aexp_skip_x
410 * @offset_x: Skip the first column, or not. See enum mali_c55_aexp_row_column_offset
411 * @skip_y: Vertical decimation. See enum mali_c55_aexp_skip_y
412 * @offset_y: Skip the first row, or not. See enum mali_c55_aexp_row_column_offset
413 * @scale_bottom: Scale pixels in bottom half of intensity range: 0=1x ,1=2x, 2=4x, 4=8x, 4=16x
414 * @scale_top: scale pixels in top half of intensity range: 0=1x ,1=2x, 2=4x, 4=8x, 4=16x
415 * @plane_mode: Plane separation mode. See enum mali_c55_aexp_hist_plane_mode
416 * @tap_point: Tap point for histogram from enum mali_c55_aexp_hist_tap_points.
417 * This parameter is unused for the post-Iridix Histogram
418 */
419struct mali_c55_params_aexp_hist {
420 struct v4l2_isp_params_block_header header;
421 __u8 skip_x;
422 __u8 offset_x;
423 __u8 skip_y;
424 __u8 offset_y;
425 __u8 scale_bottom;
426 __u8 scale_top;
427 __u8 plane_mode;
428 __u8 tap_point;
429};
430
431/**
432 * struct mali_c55_params_aexp_weights - Array of weights for AEXP metering
433 *
434 * This struct allows users to configure the weighting for both of the 1024-bin
435 * AEXP histograms. The pixel data collected for each zone is multiplied by the
436 * corresponding weight from this array, which may be zero if the intention is
437 * to mask off the zone entirely.
438 *
439 * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS
440 * or MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS from :c:type:`mali_c55_param_block_type`.
441 *
442 * @header: The Mali-C55 parameters block header
443 * @nodes_used_horiz: Number of active zones horizontally [0..15]
444 * @nodes_used_vert: Number of active zones vertically [0..15]
445 * @zone_weights: Zone weighting. Index is row*col where 0,0 is the top
446 * left zone continuing in raster order. Each zone can be
447 * weighted in the range [0..15]. The number of rows and
448 * columns is defined by @nodes_used_vert and
449 * @nodes_used_horiz
450 */
451struct mali_c55_params_aexp_weights {
452 struct v4l2_isp_params_block_header header;
453 __u8 nodes_used_horiz;
454 __u8 nodes_used_vert;
455 __u8 zone_weights[MALI_C55_MAX_ZONES];
456};
457
458/**
459 * struct mali_c55_params_digital_gain - Digital gain value
460 *
461 * This struct carries a digital gain value to set in the ISP.
462 *
463 * header.type should be set to MALI_C55_PARAM_BLOCK_DIGITAL_GAIN from
464 * :c:type:`mali_c55_param_block_type` for this block.
465 *
466 * @header: The Mali-C55 parameters block header
467 * @gain: The digital gain value to apply, in Q5.8 format.
468 */
469struct mali_c55_params_digital_gain {
470 struct v4l2_isp_params_block_header header;
471 __u16 gain;
472};
473
474/**
475 * enum mali_c55_awb_stats_mode - Statistics mode for AWB
476 * @MALI_C55_AWB_MODE_GRBR: Statistics collected as Green/Red and Blue/Red ratios
477 * @MALI_C55_AWB_MODE_RGBG: Statistics collected as Red/Green and Blue/Green ratios
478 */
479enum mali_c55_awb_stats_mode {
480 MALI_C55_AWB_MODE_GRBR = 0,
481 MALI_C55_AWB_MODE_RGBG,
482};
483
484/**
485 * struct mali_c55_params_awb_gains - Gain settings for auto white balance
486 *
487 * This struct allows users to configure the gains for auto-white balance. There
488 * are four gain settings corresponding to each colour channel in the bayer
489 * domain. Although named generically, the association between the gain applied
490 * and the colour channel is done automatically within the ISP depending on the
491 * input format, and so the following mapping always holds true::
492 *
493 * gain00 = R
494 * gain01 = Gr
495 * gain10 = Gb
496 * gain11 = B
497 *
498 * All of the gains are stored in Q4.8 format.
499 *
500 * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AWB_GAINS or
501 * MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP from :c:type:`mali_c55_param_block_type`.
502 *
503 * @header: The Mali-C55 parameters block header
504 * @gain00: Multiplier for colour channel 00
505 * @gain01: Multiplier for colour channel 01
506 * @gain10: Multiplier for colour channel 10
507 * @gain11: Multiplier for colour channel 11
508 */
509struct mali_c55_params_awb_gains {
510 struct v4l2_isp_params_block_header header;
511 __u16 gain00;
512 __u16 gain01;
513 __u16 gain10;
514 __u16 gain11;
515};
516
517/**
518 * enum mali_c55_params_awb_tap_points - Tap points for the AWB statistics
519 * @MALI_C55_AWB_STATS_TAP_PF: Immediately after the Purple Fringe block
520 * @MALI_C55_AWB_STATS_TAP_CNR: Immediately after the CNR block
521 */
522enum mali_c55_params_awb_tap_points {
523 MALI_C55_AWB_STATS_TAP_PF = 0,
524 MALI_C55_AWB_STATS_TAP_CNR,
525};
526
527/**
528 * struct mali_c55_params_awb_config - Stats settings for auto-white balance
529 *
530 * This struct allows the configuration of the statistics generated for auto
531 * white balance. Pixel intensity limits can be set to exclude overly bright or
532 * dark regions of an image from the statistics entirely. Colour ratio minima
533 * and maxima can be set to discount pixels who's ratios fall outside the
534 * defined boundaries; there are two sets of registers to do this - the
535 * "min/max" ratios which bound a region and the "high/low" ratios which further
536 * trim the upper and lower ratios. For example with the boundaries configured
537 * as follows, only pixels whos colour ratios falls into the region marked "A"
538 * would be counted::
539 *
540 * cr_high
541 * 2.0 | |
542 * | cb_max --> _________________________v_____
543 * 1.8 | | \ |
544 * | | \ |
545 * 1.6 | | \ |
546 * | | \ |
547 * c 1.4 | cb_low -->|\ A \|<-- cb_high
548 * b | | \ |
549 * 1.2 | | \ |
550 * r | | \ |
551 * a 1.0 | cb_min --> |____\_________________________|
552 * t | ^ ^ ^
553 * i 0.8 | | | |
554 * o | cr_min | cr_max
555 * s 0.6 | |
556 * | cr_low
557 * 0.4 |
558 * |
559 * 0.2 |
560 * |
561 * 0.0 |_______________________________________________________________
562 * 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
563 * cr ratios
564 *
565 * header.type should be set to MALI_C55_PARAM_BLOCK_AWB_CONFIG from
566 * :c:type:`mali_c55_param_block_type` for this block.
567 *
568 * @header: The Mali-C55 parameters block header
569 * @tap_point: The tap point from enum mali_c55_params_awb_tap_points
570 * @stats_mode: AWB statistics collection mode, see :c:type:`mali_c55_awb_stats_mode`
571 * @white_level: Upper pixel intensity (I.E. raw pixel values) limit
572 * @black_level: Lower pixel intensity (I.E. raw pixel values) limit
573 * @cr_max: Maximum R/G ratio (Q4.8 format)
574 * @cr_min: Minimum R/G ratio (Q4.8 format)
575 * @cb_max: Maximum B/G ratio (Q4.8 format)
576 * @cb_min: Minimum B/G ratio (Q4.8 format)
577 * @nodes_used_horiz: Number of active zones horizontally [0..15]
578 * @nodes_used_vert: Number of active zones vertically [0..15]
579 * @cr_high: R/G ratio trim high (Q4.8 format)
580 * @cr_low: R/G ratio trim low (Q4.8 format)
581 * @cb_high: B/G ratio trim high (Q4.8 format)
582 * @cb_low: B/G ratio trim low (Q4.8 format)
583 */
584struct mali_c55_params_awb_config {
585 struct v4l2_isp_params_block_header header;
586 __u8 tap_point;
587 __u8 stats_mode;
588 __u16 white_level;
589 __u16 black_level;
590 __u16 cr_max;
591 __u16 cr_min;
592 __u16 cb_max;
593 __u16 cb_min;
594 __u8 nodes_used_horiz;
595 __u8 nodes_used_vert;
596 __u16 cr_high;
597 __u16 cr_low;
598 __u16 cb_high;
599 __u16 cb_low;
600};
601
602#define MALI_C55_NUM_MESH_SHADING_ELEMENTS 3072
603
604/**
605 * struct mali_c55_params_mesh_shading_config - Mesh shading configuration
606 *
607 * The mesh shading correction module allows programming a separate table of
608 * either 16x16 or 32x32 node coefficients for 3 different light sources. The
609 * final correction coefficients applied are computed by blending the
610 * coefficients from two tables together.
611 *
612 * A page of 1024 32-bit integers is associated to each colour channel, with
613 * pages stored consecutively in memory. Each 32-bit integer packs 3 8-bit
614 * correction coefficients for a single node, one for each of the three light
615 * sources. The 8 most significant bits are unused. The following table
616 * describes the layout::
617 *
618 * +----------- Page (Colour Plane) 0 -------------+
619 * | @mesh[i] | Mesh Point | Bits | Light Source |
620 * +-----------+------------+-------+--------------+
621 * | 0 | 0,0 | 16,23 | LS2 |
622 * | | | 08-15 | LS1 |
623 * | | | 00-07 | LS0 |
624 * +-----------+------------+-------+--------------+
625 * | 1 | 0,1 | 16,23 | LS2 |
626 * | | | 08-15 | LS1 |
627 * | | | 00-07 | LS0 |
628 * +-----------+------------+-------+--------------+
629 * | ... | ... | ... | ... |
630 * +-----------+------------+-------+--------------+
631 * | 1023 | 31,31 | 16,23 | LS2 |
632 * | | | 08-15 | LS1 |
633 * | | | 00-07 | LS0 |
634 * +----------- Page (Colour Plane) 1 -------------+
635 * | @mesh[i] | Mesh Point | Bits | Light Source |
636 * +-----------+------------+-------+--------------+
637 * | 1024 | 0,0 | 16,23 | LS2 |
638 * | | | 08-15 | LS1 |
639 * | | | 00-07 | LS0 |
640 * +-----------+------------+-------+--------------+
641 * | 1025 | 0,1 | 16,23 | LS2 |
642 * | | | 08-15 | LS1 |
643 * | | | 00-07 | LS0 |
644 * +-----------+------------+-------+--------------+
645 * | ... | ... | ... | ... |
646 * +-----------+------------+-------+--------------+
647 * | 2047 | 31,31 | 16,23 | LS2 |
648 * | | | 08-15 | LS1 |
649 * | | | 00-07 | LS0 |
650 * +----------- Page (Colour Plane) 2 -------------+
651 * | @mesh[i] | Mesh Point | Bits | Light Source |
652 * +-----------+------------+-------+--------------+
653 * | 2048 | 0,0 | 16,23 | LS2 |
654 * | | | 08-15 | LS1 |
655 * | | | 00-07 | LS0 |
656 * +-----------+------------+-------+--------------+
657 * | 2049 | 0,1 | 16,23 | LS2 |
658 * | | | 08-15 | LS1 |
659 * | | | 00-07 | LS0 |
660 * +-----------+------------+-------+--------------+
661 * | ... | ... | ... | ... |
662 * +-----------+------------+-------+--------------+
663 * | 3071 | 31,31 | 16,23 | LS2 |
664 * | | | 08-15 | LS1 |
665 * | | | 00-07 | LS0 |
666 * +-----------+------------+-------+--------------+
667 *
668 * The @mesh_scale member determines the precision and minimum and maximum gain.
669 * For example if @mesh_scale is 0 and therefore selects 0 - 2x gain, a value of
670 * 0 in a coefficient means 0.0 gain, a value of 128 means 1.0 gain and 255
671 * means 2.0 gain.
672 *
673 * header.type should be set to MALI_C55_PARAM_MESH_SHADING_CONFIG from
674 * :c:type:`mali_c55_param_block_type` for this block.
675 *
676 * @header: The Mali-C55 parameters block header
677 * @mesh_show: Output the mesh data rather than image data
678 * @mesh_scale: Set the precision and maximum gain range of mesh shading
679 * - 0 = 0-2x gain
680 * - 1 = 0-4x gain
681 * - 2 = 0-8x gain
682 * - 3 = 0-16x gain
683 * - 4 = 1-2x gain
684 * - 5 = 1-3x gain
685 * - 6 = 1-5x gain
686 * - 7 = 1-9x gain
687 * @mesh_page_r: Mesh page select for red colour plane [0..2]
688 * @mesh_page_g: Mesh page select for green colour plane [0..2]
689 * @mesh_page_b: Mesh page select for blue colour plane [0..2]
690 * @mesh_width: Number of horizontal nodes minus 1 [15,31]
691 * @mesh_height: Number of vertical nodes minus 1 [15,31]
692 * @mesh: Mesh shading correction tables
693 */
694struct mali_c55_params_mesh_shading_config {
695 struct v4l2_isp_params_block_header header;
696 __u8 mesh_show;
697 __u8 mesh_scale;
698 __u8 mesh_page_r;
699 __u8 mesh_page_g;
700 __u8 mesh_page_b;
701 __u8 mesh_width;
702 __u8 mesh_height;
703 __u32 mesh[MALI_C55_NUM_MESH_SHADING_ELEMENTS];
704};
705
706/** enum mali_c55_params_mesh_alpha_bank - Mesh shading table bank selection
707 * @MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS1 - Select Light Sources 0 and 1
708 * @MALI_C55_MESH_ALPHA_BANK_LS1_AND_LS2 - Select Light Sources 1 and 2
709 * @MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS2 - Select Light Sources 0 and 2
710 */
711enum mali_c55_params_mesh_alpha_bank {
712 MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS1 = 0,
713 MALI_C55_MESH_ALPHA_BANK_LS1_AND_LS2 = 1,
714 MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS2 = 4
715};
716
717/**
718 * struct mali_c55_params_mesh_shading_selection - Mesh table selection
719 *
720 * The module computes the final correction coefficients by blending the ones
721 * from two light source tables, which are selected (independently for each
722 * colour channel) by the @mesh_alpha_bank_r/g/b fields.
723 *
724 * The final blended coefficients for each node are calculated using the
725 * following equation:
726 *
727 * Final coefficient = (a * LS\ :sub:`b`\ + (256 - a) * LS\ :sub:`a`\) / 256
728 *
729 * Where a is the @mesh_alpha_r/g/b value, and LS\ :sub:`a`\ and LS\ :sub:`b`\
730 * are the node cofficients for the two tables selected by the
731 * @mesh_alpha_bank_r/g/b value.
732 *
733 * The scale of the applied correction may also be controlled by tuning the
734 * @mesh_strength member. This is a modifier to the final coefficients which can
735 * be used to globally reduce the gains applied.
736 *
737 * header.type should be set to MALI_C55_PARAM_MESH_SHADING_SELECTION from
738 * :c:type:`mali_c55_param_block_type` for this block.
739 *
740 * @header: The Mali-C55 parameters block header
741 * @mesh_alpha_bank_r: Red mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)
742 * @mesh_alpha_bank_g: Green mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)
743 * @mesh_alpha_bank_b: Blue mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)
744 * @mesh_alpha_r: Blend coefficient for R [0..255]
745 * @mesh_alpha_g: Blend coefficient for G [0..255]
746 * @mesh_alpha_b: Blend coefficient for B [0..255]
747 * @mesh_strength: Mesh strength in Q4.12 format [0..4096]
748 */
749struct mali_c55_params_mesh_shading_selection {
750 struct v4l2_isp_params_block_header header;
751 __u8 mesh_alpha_bank_r;
752 __u8 mesh_alpha_bank_g;
753 __u8 mesh_alpha_bank_b;
754 __u8 mesh_alpha_r;
755 __u8 mesh_alpha_g;
756 __u8 mesh_alpha_b;
757 __u16 mesh_strength;
758};
759
760/**
761 * define MALI_C55_PARAMS_MAX_SIZE - Maximum size of all Mali C55 Parameters
762 *
763 * Though the parameters for the Mali-C55 are passed as optional blocks, the
764 * driver still needs to know the absolute maximum size so that it can allocate
765 * a buffer sized appropriately to accommodate userspace attempting to set all
766 * possible parameters in a single frame.
767 *
768 * Some structs are in this list multiple times. Where that's the case, it just
769 * reflects the fact that the same struct can be used with multiple different
770 * header types from :c:type:`mali_c55_param_block_type`.
771 */
772#define MALI_C55_PARAMS_MAX_SIZE \
773 (sizeof(struct mali_c55_params_sensor_off_preshading) + \
774 sizeof(struct mali_c55_params_aexp_hist) + \
775 sizeof(struct mali_c55_params_aexp_weights) + \
776 sizeof(struct mali_c55_params_aexp_hist) + \
777 sizeof(struct mali_c55_params_aexp_weights) + \
778 sizeof(struct mali_c55_params_digital_gain) + \
779 sizeof(struct mali_c55_params_awb_gains) + \
780 sizeof(struct mali_c55_params_awb_config) + \
781 sizeof(struct mali_c55_params_awb_gains) + \
782 sizeof(struct mali_c55_params_mesh_shading_config) + \
783 sizeof(struct mali_c55_params_mesh_shading_selection))
784
785#endif /* __UAPI_MALI_C55_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/v4l2-isp.h created+102
......@@ -0,0 +1,102 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Video4Linux2 generic ISP parameters and statistics support
4 *
5 * Copyright (C) 2025 Ideas On Board Oy
6 * Author: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
7 */
8
9#ifndef _V4L2_ISP_H_
10#define _V4L2_ISP_H_
11
12#include <linux/stddef.h>
13#include <linux/types.h>
14
15/**
16 * enum v4l2_isp_params_version - V4L2 ISP parameters versioning
17 *
18 * @V4L2_ISP_PARAMS_VERSION_V0: First version of the V4L2 ISP parameters format
19 * (for compatibility)
20 * @V4L2_ISP_PARAMS_VERSION_V1: First version of the V4L2 ISP parameters format
21 *
22 * V0 and V1 are identical in order to support drivers compatible with the V4L2
23 * ISP parameters format already upstreamed which use either 0 or 1 as their
24 * versioning identifier. Both V0 and V1 refers to the first version of the
25 * V4L2 ISP parameters format.
26 *
27 * Future revisions of the V4L2 ISP parameters format should start from the
28 * value of 2.
29 */
30enum v4l2_isp_params_version {
31 V4L2_ISP_PARAMS_VERSION_V0 = 0,
32 V4L2_ISP_PARAMS_VERSION_V1
33};
34
35#define V4L2_ISP_PARAMS_FL_BLOCK_DISABLE (1U << 0)
36#define V4L2_ISP_PARAMS_FL_BLOCK_ENABLE (1U << 1)
37
38/*
39 * Reserve the first 8 bits for V4L2_ISP_PARAMS_FL_* flag.
40 *
41 * Driver-specific flags should be defined as:
42 * #define DRIVER_SPECIFIC_FLAG0 ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(0))
43 * #define DRIVER_SPECIFIC_FLAG1 ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(1))
44 */
45#define V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(n) ((n) + 8)
46
47/**
48 * struct v4l2_isp_params_block_header - V4L2 extensible parameters block header
49 * @type: The parameters block type (driver-specific)
50 * @flags: A bitmask of block flags (driver-specific)
51 * @size: Size (in bytes) of the parameters block, including this header
52 *
53 * This structure represents the common part of all the ISP configuration
54 * blocks. Each parameters block shall embed an instance of this structure type
55 * as its first member, followed by the block-specific configuration data.
56 *
57 * The @type field is an ISP driver-specific value that identifies the block
58 * type. The @size field specifies the size of the parameters block.
59 *
60 * The @flags field is a bitmask of per-block flags V4L2_PARAMS_ISP_FL_* and
61 * driver-specific flags specified by the driver header.
62 */
63struct v4l2_isp_params_block_header {
64 __u16 type;
65 __u16 flags;
66 __u32 size;
67} __attribute__((aligned(8)));
68
69/**
70 * struct v4l2_isp_params_buffer - V4L2 extensible parameters configuration
71 * @version: The parameters buffer version (driver-specific)
72 * @data_size: The configuration data effective size, excluding this header
73 * @data: The configuration data
74 *
75 * This structure contains the configuration parameters of the ISP algorithms,
76 * serialized by userspace into a data buffer. Each configuration parameter
77 * block is represented by a block-specific structure which contains a
78 * :c:type:`v4l2_isp_params_block_header` entry as first member. Userspace
79 * populates the @data buffer with configuration parameters for the blocks that
80 * it intends to configure. As a consequence, the data buffer effective size
81 * changes according to the number of ISP blocks that userspace intends to
82 * configure and is set by userspace in the @data_size field.
83 *
84 * The parameters buffer is versioned by the @version field to allow modifying
85 * and extending its definition. Userspace shall populate the @version field to
86 * inform the driver about the version it intends to use. The driver will parse
87 * and handle the @data buffer according to the data layout specific to the
88 * indicated version and return an error if the desired version is not
89 * supported.
90 *
91 * For each ISP block that userspace wants to configure, a block-specific
92 * structure is appended to the @data buffer, one after the other without gaps
93 * in between. Userspace shall populate the @data_size field with the effective
94 * size, in bytes, of the @data buffer.
95 */
96struct v4l2_isp_params_buffer {
97 __u32 version;
98 __u32 data_size;
99 __u8 data[] __counted_by(data_size);
100};
101
102#endif /* _V4L2_ISP_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mempolicy.h+9-3
......@@ -66,10 +66,16 @@ enum {
6666#define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */
6767
6868/*
69 * These bit locations are exposed in the vm.zone_reclaim_mode sysctl
70 * ABI. New bits are OK, but existing bits can never change.
69 * Enabling zone reclaim means the page allocator will attempt to fulfill
70 * the allocation request on the current node by triggering reclaim and
71 * trying to shrink the current node.
72 * Fallback allocations on the next candidates in the zonelist are considered
73 * when reclaim fails to free up enough memory in the current node/zone.
74 *
75 * These bit locations are exposed in the vm.zone_reclaim_mode sysctl.
76 * New bits are OK, but existing bits should not be changed.
7177 */
72#define RECLAIM_ZONE (1<<0) /* Run shrink_inactive_list on the zone */
78#define RECLAIM_ZONE (1<<0) /* Enable zone reclaim */
7379#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */
7480#define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */
7581
lib/libc/include/any-linux-any/linux/mount.h+1-1
......@@ -197,7 +197,7 @@ struct statmount {
197197 */
198198struct mnt_id_req {
199199 __u32 size;
200 __u32 spare;
200 __u32 mnt_ns_fd;
201201 __u64 mnt_id;
202202 __u64 param;
203203 __u64 mnt_ns_id;
lib/libc/include/any-linux-any/linux/mptcp.h+18-6
......@@ -30,20 +30,28 @@
3030#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
3131
3232#define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0)
33#define MPTCP_PM_EV_FLAG_SERVER_SIDE _BITUL(1)
3334
34#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
35#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
36#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
37#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
38#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
35#define MPTCP_PM_ADDR_FLAG_SIGNAL _BITUL(0)
36#define MPTCP_PM_ADDR_FLAG_SUBFLOW _BITUL(1)
37#define MPTCP_PM_ADDR_FLAG_BACKUP _BITUL(2)
38#define MPTCP_PM_ADDR_FLAG_FULLMESH _BITUL(3)
39#define MPTCP_PM_ADDR_FLAG_IMPLICIT _BITUL(4)
40#define MPTCP_PM_ADDR_FLAG_LAMINAR _BITUL(5)
41#define MPTCP_PM_ADDR_FLAGS_MASK GENMASK(5, 0)
3942
4043struct mptcp_info {
4144 __u8 mptcpi_subflows;
45 #define mptcpi_extra_subflows mptcpi_subflows
4246 __u8 mptcpi_add_addr_signal;
4347 __u8 mptcpi_add_addr_accepted;
4448 __u8 mptcpi_subflows_max;
49 #define mptcpi_limit_extra_subflows mptcpi_subflows_max
4550 __u8 mptcpi_add_addr_signal_max;
51 #define mptcpi_endp_signal_max mptcpi_add_addr_signal_max
4652 __u8 mptcpi_add_addr_accepted_max;
53 #define mptcpi_limit_add_addr_accepted mptcpi_add_addr_accepted_max
54 /* 16-bit hole that can no longer be filled */
4755 __u32 mptcpi_flags;
4856 __u32 mptcpi_token;
4957 __u64 mptcpi_write_seq;
......@@ -51,14 +59,18 @@ struct mptcp_info {
5159 __u64 mptcpi_rcv_nxt;
5260 __u8 mptcpi_local_addr_used;
5361 __u8 mptcpi_local_addr_max;
62 #define mptcpi_endp_subflow_max mptcpi_local_addr_max
5463 __u8 mptcpi_csum_enabled;
64 /* 8-bit hole that can no longer be filled */
5565 __u32 mptcpi_retransmits;
5666 __u64 mptcpi_bytes_retrans;
5767 __u64 mptcpi_bytes_sent;
5868 __u64 mptcpi_bytes_received;
5969 __u64 mptcpi_bytes_acked;
6070 __u8 mptcpi_subflows_total;
61 __u8 reserved[3];
71 __u8 mptcpi_endp_laminar_max;
72 __u8 mptcpi_endp_fullmesh_max;
73 __u8 reserved;
6274 __u32 mptcpi_last_data_sent;
6375 __u32 mptcpi_last_data_recv;
6476 __u32 mptcpi_last_ack_recv;
lib/libc/include/any-linux-any/linux/mptcp_pm.h+3-2
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/mptcp_pm.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_MPTCP_PM_H
78#define _LINUX_MPTCP_PM_H
......@@ -16,10 +17,10 @@
1617 * good time to allocate memory and send ADD_ADDR if needed. Depending on the
1718 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
1819 * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
19 * sport, dport, server-side, [flags].
20 * sport, dport, [server-side], [flags].
2021 * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new
2122 * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
22 * sport, dport, server-side, [flags].
23 * sport, dport, [server-side], [flags].
2324 * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.
2425 * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.
2526 * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
lib/libc/include/any-linux-any/linux/mshv.h+115-1
......@@ -26,6 +26,7 @@ enum {
2626 MSHV_PT_BIT_LAPIC,
2727 MSHV_PT_BIT_X2APIC,
2828 MSHV_PT_BIT_GPA_SUPER_PAGES,
29 MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
2930 MSHV_PT_BIT_COUNT,
3031};
3132
......@@ -41,6 +42,8 @@ enum {
4142 * @pt_flags: Bitmask of 1 << MSHV_PT_BIT_*
4243 * @pt_isolation: MSHV_PT_ISOLATION_*
4344 *
45 * This is the initial/v1 version for backward compatibility.
46 *
4447 * Returns a file descriptor to act as a handle to a guest partition.
4548 * At this point the partition is not yet initialized in the hypervisor.
4649 * Some operations must be done with the partition in this state, e.g. setting
......@@ -52,6 +55,37 @@ struct mshv_create_partition {
5255 __u64 pt_isolation;
5356};
5457
58#define MSHV_NUM_CPU_FEATURES_BANKS 2
59
60/**
61 * struct mshv_create_partition_v2
62 *
63 * This is extended version of the above initial MSHV_CREATE_PARTITION
64 * ioctl and allows for following additional parameters:
65 *
66 * @pt_num_cpu_fbanks: Must be set to MSHV_NUM_CPU_FEATURES_BANKS.
67 * @pt_cpu_fbanks: Disabled processor feature banks array.
68 * @pt_disabled_xsave: Disabled xsave feature bits.
69 *
70 * pt_cpu_fbanks and pt_disabled_xsave are passed through as-is to the create
71 * partition hypercall.
72 *
73 * Returns : same as above original mshv_create_partition
74 */
75struct mshv_create_partition_v2 {
76 __u64 pt_flags;
77 __u64 pt_isolation;
78 __u16 pt_num_cpu_fbanks;
79 __u8 pt_rsvd[6]; /* MBZ */
80 __u64 pt_cpu_fbanks[MSHV_NUM_CPU_FEATURES_BANKS];
81 __u64 pt_rsvd1[2]; /* MBZ */
82#if defined(__x86_64__)
83 __u64 pt_disabled_xsave;
84#else
85 __u64 pt_rsvd2; /* MBZ */
86#endif
87} __attribute__((packed));
88
5589/* /dev/mshv */
5690#define MSHV_CREATE_PARTITION _IOW(MSHV_IOCTL, 0x00, struct mshv_create_partition)
5791
......@@ -89,7 +123,7 @@ enum {
89123 * @rsvd: MBZ
90124 *
91125 * Map or unmap a region of userspace memory to Guest Physical Addresses (GPA).
92 * Mappings can't overlap in GPA space or userspace.
126 * Mappings can't overlap in GPA space.
93127 * To unmap, these fields must match an existing mapping.
94128 */
95129struct mshv_user_mem_region {
......@@ -288,4 +322,84 @@ struct mshv_get_set_vp_state {
288322 * #define MSHV_ROOT_HVCALL _IOWR(MSHV_IOCTL, 0x07, struct mshv_root_hvcall)
289323 */
290324
325/* Structure definitions, macros and IOCTLs for mshv_vtl */
326
327#define MSHV_CAP_CORE_API_STABLE 0x0
328#define MSHV_CAP_REGISTER_PAGE 0x1
329#define MSHV_CAP_VTL_RETURN_ACTION 0x2
330#define MSHV_CAP_DR6_SHARED 0x3
331#define MSHV_MAX_RUN_MSG_SIZE 256
332
333struct mshv_vp_registers {
334 __u32 count; /* supports only 1 register at a time */
335 __u32 reserved; /* Reserved for alignment or future use */
336 __u64 regs_ptr; /* pointer to struct hv_register_assoc */
337};
338
339struct mshv_vtl_set_eventfd {
340 __s32 fd;
341 __u32 flag;
342};
343
344struct mshv_vtl_signal_event {
345 __u32 connection_id;
346 __u32 flag;
347};
348
349struct mshv_vtl_sint_post_msg {
350 __u64 message_type;
351 __u32 connection_id;
352 __u32 payload_size; /* Must not exceed HV_MESSAGE_PAYLOAD_BYTE_COUNT */
353 __u64 payload_ptr; /* pointer to message payload (bytes) */
354};
355
356struct mshv_vtl_ram_disposition {
357 __u64 start_pfn;
358 __u64 last_pfn;
359};
360
361struct mshv_vtl_set_poll_file {
362 __u32 cpu;
363 __u32 fd;
364};
365
366struct mshv_vtl_hvcall_setup {
367 __u64 bitmap_array_size; /* stores number of bytes */
368 __u64 allow_bitmap_ptr;
369};
370
371struct mshv_vtl_hvcall {
372 __u64 control; /* Hypercall control code */
373 __u64 input_size; /* Size of the input data */
374 __u64 input_ptr; /* Pointer to the input struct */
375 __u64 status; /* Status of the hypercall (output) */
376 __u64 output_size; /* Size of the output data */
377 __u64 output_ptr; /* Pointer to the output struct */
378};
379
380struct mshv_sint_mask {
381 __u8 mask;
382 __u8 reserved[7];
383};
384
385/* /dev/mshv device IOCTL */
386#define MSHV_CHECK_EXTENSION _IOW(MSHV_IOCTL, 0x00, __u32)
387
388/* vtl device */
389#define MSHV_CREATE_VTL _IOR(MSHV_IOCTL, 0x1D, char)
390#define MSHV_ADD_VTL0_MEMORY _IOW(MSHV_IOCTL, 0x21, struct mshv_vtl_ram_disposition)
391#define MSHV_SET_POLL_FILE _IOW(MSHV_IOCTL, 0x25, struct mshv_vtl_set_poll_file)
392#define MSHV_RETURN_TO_LOWER_VTL _IO(MSHV_IOCTL, 0x27)
393#define MSHV_GET_VP_REGISTERS _IOWR(MSHV_IOCTL, 0x05, struct mshv_vp_registers)
394#define MSHV_SET_VP_REGISTERS _IOW(MSHV_IOCTL, 0x06, struct mshv_vp_registers)
395
396/* VMBus device IOCTLs */
397#define MSHV_SINT_SIGNAL_EVENT _IOW(MSHV_IOCTL, 0x22, struct mshv_vtl_signal_event)
398#define MSHV_SINT_POST_MESSAGE _IOW(MSHV_IOCTL, 0x23, struct mshv_vtl_sint_post_msg)
399#define MSHV_SINT_SET_EVENTFD _IOW(MSHV_IOCTL, 0x24, struct mshv_vtl_set_eventfd)
400#define MSHV_SINT_PAUSE_MESSAGE_STREAM _IOW(MSHV_IOCTL, 0x25, struct mshv_sint_mask)
401
402/* hv_hvcall device */
403#define MSHV_HVCALL_SETUP _IOW(MSHV_IOCTL, 0x1E, struct mshv_vtl_hvcall_setup)
404#define MSHV_HVCALL _IOWR(MSHV_IOCTL, 0x1F, struct mshv_vtl_hvcall)
291405#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/net_shaper.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/net_shaper.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_NET_SHAPER_H
78#define _LINUX_NET_SHAPER_H
lib/libc/include/any-linux-any/linux/netdev.h+2
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/netdev.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_NETDEV_H
78#define _LINUX_NETDEV_H
......@@ -80,6 +81,7 @@ enum netdev_qstats_scope {
8081enum netdev_napi_threaded {
8182 NETDEV_NAPI_THREADED_DISABLED,
8283 NETDEV_NAPI_THREADED_ENABLED,
84 NETDEV_NAPI_THREADED_BUSY_POLL,
8385};
8486
8587enum {
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+9-7
......@@ -881,7 +881,7 @@ enum nft_exthdr_flags {
881881 * enum nft_exthdr_op - nf_tables match options
882882 *
883883 * @NFT_EXTHDR_OP_IPV6: match against ipv6 extension headers
884 * @NFT_EXTHDR_OP_TCP: match against tcp options
884 * @NFT_EXTHDR_OP_TCPOPT: match against tcp options
885885 * @NFT_EXTHDR_OP_IPV4: match against ipv4 options
886886 * @NFT_EXTHDR_OP_SCTP: match against sctp chunks
887887 * @NFT_EXTHDR_OP_DCCP: match against dccp otions
......@@ -959,6 +959,7 @@ enum nft_exthdr_attributes {
959959 * @NFT_META_SDIF: slave device interface index
960960 * @NFT_META_SDIFNAME: slave device interface name
961961 * @NFT_META_BRI_BROUTE: packet br_netfilter_broute bit
962 * @NFT_META_BRI_IIFHWADDR: packet input bridge interface ethernet address
962963 */
963964enum nft_meta_keys {
964965 NFT_META_LEN,
......@@ -999,6 +1000,7 @@ enum nft_meta_keys {
9991000 NFT_META_SDIFNAME,
10001001 NFT_META_BRI_BROUTE,
10011002 __NFT_META_IIFTYPE,
1003 NFT_META_BRI_IIFHWADDR,
10021004};
10031005
10041006/**
......@@ -1198,7 +1200,7 @@ enum nft_ct_attributes {
11981200#define NFTA_CT_MAX (__NFTA_CT_MAX - 1)
11991201
12001202/**
1201 * enum nft_flow_attributes - ct offload expression attributes
1203 * enum nft_offload_attributes - ct offload expression attributes
12021204 * @NFTA_FLOW_TABLE_NAME: flow table name (NLA_STRING)
12031205 */
12041206enum nft_offload_attributes {
......@@ -1408,7 +1410,7 @@ enum nft_reject_types {
14081410};
14091411
14101412/**
1411 * enum nft_reject_code - Generic reject codes for IPv4/IPv6
1413 * enum nft_reject_inet_code - Generic reject codes for IPv4/IPv6
14121414 *
14131415 * @NFT_REJECT_ICMPX_NO_ROUTE: no route to host / network unreachable
14141416 * @NFT_REJECT_ICMPX_PORT_UNREACH: port unreachable
......@@ -1478,9 +1480,9 @@ enum nft_nat_attributes {
14781480/**
14791481 * enum nft_tproxy_attributes - nf_tables tproxy expression netlink attributes
14801482 *
1481 * NFTA_TPROXY_FAMILY: Target address family (NLA_U32: nft_registers)
1482 * NFTA_TPROXY_REG_ADDR: Target address register (NLA_U32: nft_registers)
1483 * NFTA_TPROXY_REG_PORT: Target port register (NLA_U32: nft_registers)
1483 * @NFTA_TPROXY_FAMILY: Target address family (NLA_U32: nft_registers)
1484 * @NFTA_TPROXY_REG_ADDR: Target address register (NLA_U32: nft_registers)
1485 * @NFTA_TPROXY_REG_PORT: Target port register (NLA_U32: nft_registers)
14841486 */
14851487enum nft_tproxy_attributes {
14861488 NFTA_TPROXY_UNSPEC,
......@@ -1781,7 +1783,7 @@ enum nft_synproxy_attributes {
17811783#define NFTA_SYNPROXY_MAX (__NFTA_SYNPROXY_MAX - 1)
17821784
17831785/**
1784 * enum nft_device_attributes - nf_tables device netlink attributes
1786 * enum nft_devices_attributes - nf_tables device netlink attributes
17851787 *
17861788 * @NFTA_DEVICE_NAME: name of this device (NLA_STRING)
17871789 * @NFTA_DEVICE_PREFIX: device name prefix, a simple wildcard (NLA_STRING)
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6t_srh.h+20-20
......@@ -41,13 +41,13 @@
4141
4242/**
4343 * struct ip6t_srh - SRH match options
44 * @ next_hdr: Next header field of SRH
45 * @ hdr_len: Extension header length field of SRH
46 * @ segs_left: Segments left field of SRH
47 * @ last_entry: Last entry field of SRH
48 * @ tag: Tag field of SRH
49 * @ mt_flags: match options
50 * @ mt_invflags: Invert the sense of match options
44 * @next_hdr: Next header field of SRH
45 * @hdr_len: Extension header length field of SRH
46 * @segs_left: Segments left field of SRH
47 * @last_entry: Last entry field of SRH
48 * @tag: Tag field of SRH
49 * @mt_flags: match options
50 * @mt_invflags: Invert the sense of match options
5151 */
5252
5353struct ip6t_srh {
......@@ -62,19 +62,19 @@ struct ip6t_srh {
6262
6363/**
6464 * struct ip6t_srh1 - SRH match options (revision 1)
65 * @ next_hdr: Next header field of SRH
66 * @ hdr_len: Extension header length field of SRH
67 * @ segs_left: Segments left field of SRH
68 * @ last_entry: Last entry field of SRH
69 * @ tag: Tag field of SRH
70 * @ psid_addr: Address of previous SID in SRH SID list
71 * @ nsid_addr: Address of NEXT SID in SRH SID list
72 * @ lsid_addr: Address of LAST SID in SRH SID list
73 * @ psid_msk: Mask of previous SID in SRH SID list
74 * @ nsid_msk: Mask of next SID in SRH SID list
75 * @ lsid_msk: MAsk of last SID in SRH SID list
76 * @ mt_flags: match options
77 * @ mt_invflags: Invert the sense of match options
65 * @next_hdr: Next header field of SRH
66 * @hdr_len: Extension header length field of SRH
67 * @segs_left: Segments left field of SRH
68 * @last_entry: Last entry field of SRH
69 * @tag: Tag field of SRH
70 * @psid_addr: Address of previous SID in SRH SID list
71 * @nsid_addr: Address of NEXT SID in SRH SID list
72 * @lsid_addr: Address of LAST SID in SRH SID list
73 * @psid_msk: Mask of previous SID in SRH SID list
74 * @nsid_msk: Mask of next SID in SRH SID list
75 * @lsid_msk: MAsk of last SID in SRH SID list
76 * @mt_flags: match options
77 * @mt_invflags: Invert the sense of match options
7878 */
7979
8080struct ip6t_srh1 {
lib/libc/include/any-linux-any/linux/nfs.h-1
......@@ -49,7 +49,6 @@
4949 NFSERR_NOENT = 2, /* v2 v3 v4 */
5050 NFSERR_IO = 5, /* v2 v3 v4 */
5151 NFSERR_NXIO = 6, /* v2 v3 v4 */
52 NFSERR_EAGAIN = 11, /* v2 v3 */
5352 NFSERR_ACCES = 13, /* v2 v3 v4 */
5453 NFSERR_EXIST = 17, /* v2 v3 v4 */
5554 NFSERR_XDEV = 18, /* v3 v4 */
lib/libc/include/any-linux-any/linux/nfsd_netlink.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/nfsd.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_NFSD_NETLINK_H
78#define _LINUX_NFSD_NETLINK_H
lib/libc/include/any-linux-any/linux/nl80211-vnd-intel.h-1
......@@ -84,7 +84,6 @@ enum iwl_vendor_auth_akm_mode {
8484 *
8585 * @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes
8686 * @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number
87
8887 */
8988enum iwl_mvm_vendor_attr {
9089 __IWL_MVM_VENDOR_ATTR_INVALID = 0x00,
lib/libc/include/any-linux-any/linux/nl80211.h+253-7
......@@ -1085,8 +1085,9 @@
10851085 * %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
10861086 * %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is
10871087 * omitted or set to 0, it means don't-care and the device will
1088 * decide what to use. After this command NAN functions can be
1089 * added.
1088 * decide what to use. Additional cluster configuration may be
1089 * optionally provided with %NL80211_ATTR_NAN_CONFIG.
1090 * After this command NAN functions can be added.
10901091 * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
10911092 * its %NL80211_ATTR_WDEV interface.
10921093 * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined
......@@ -1115,6 +1116,10 @@
11151116 * current configuration is not changed. If it is present but
11161117 * set to zero, the configuration is changed to don't-care
11171118 * (i.e. the device can decide what to do).
1119 * Additional parameters may be provided with
1120 * %NL80211_ATTR_NAN_CONFIG. User space should provide all previously
1121 * configured nested attributes under %NL80211_ATTR_NAN_CONFIG, even if
1122 * only a subset was changed.
11181123 * @NL80211_CMD_NAN_MATCH: Notification sent when a match is reported.
11191124 * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
11201125 * %NL80211_ATTR_COOKIE.
......@@ -1344,6 +1349,18 @@
13441349 * control EPCS configuration. Used to notify userland on the current state
13451350 * of EPCS.
13461351 *
1352 * @NL80211_CMD_NAN_NEXT_DW_NOTIFICATION: This command is used to notify
1353 * user space about the next NAN Discovery Window (DW). User space may use
1354 * it to prepare frames to be sent in the next DW.
1355 * %NL80211_ATTR_WIPHY_FREQ is used to indicate the frequency of the next
1356 * DW. SDF transmission should be requested with %NL80211_CMD_FRAME and
1357 * the device/driver shall take care of the actual transmission timing.
1358 * This notification is only sent to the NAN interface owning socket
1359 * (see %NL80211_ATTR_SOCKET_OWNER flag).
1360 * @NL80211_CMD_NAN_CLUSTER_JOINED: This command is used to notify
1361 * user space that the NAN new cluster has been joined. The cluster ID is
1362 * indicated by %NL80211_ATTR_MAC.
1363 *
13471364 * @NL80211_CMD_MAX: highest used command number
13481365 * @__NL80211_CMD_AFTER_LAST: internal use
13491366 */
......@@ -1604,6 +1621,9 @@ enum nl80211_commands {
16041621 NL80211_CMD_ASSOC_MLO_RECONF,
16051622 NL80211_CMD_EPCS_CFG,
16061623
1624 NL80211_CMD_NAN_NEXT_DW_NOTIFICATION,
1625 NL80211_CMD_NAN_CLUSTER_JOINED,
1626
16071627 /* add new commands above here */
16081628
16091629 /* used to define NL80211_CMD_MAX below */
......@@ -1943,8 +1963,9 @@ enum nl80211_commands {
19431963 * The driver must also specify support for this with the extended
19441964 * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
19451965 * NL80211_EXT_FEATURE_BEACON_RATE_HT,
1946 * NL80211_EXT_FEATURE_BEACON_RATE_VHT and
1947 * NL80211_EXT_FEATURE_BEACON_RATE_HE.
1966 * NL80211_EXT_FEATURE_BEACON_RATE_VHT,
1967 * NL80211_EXT_FEATURE_BEACON_RATE_HE and
1968 * NL80211_EXT_FEATURE_BEACON_RATE_EHT.
19481969 *
19491970 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
19501971 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
......@@ -2283,7 +2304,8 @@ enum nl80211_commands {
22832304 * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
22842305 * This is similar to @NL80211_ATTR_STA_AID but with a difference of being
22852306 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
2286 * update a TDLS peer STA entry.
2307 * update a TDLS peer STA entry. For S1G interfaces, this is limited to
2308 * 1600 for the current mac80211 implementation.
22872309 *
22882310 * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
22892311 *
......@@ -2858,8 +2880,9 @@ enum nl80211_commands {
28582880 * index. If the userspace includes more RNR elements than number of
28592881 * MBSSID elements then these will be added in every EMA beacon.
28602882 *
2861 * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
2862 * disabled.
2883 * @NL80211_ATTR_MLO_LINK_DISABLED: Unused. It was used to indicate that a link
2884 * is disabled during association. However, the AP will send the
2885 * information by including a TTLM in the association response.
28632886 *
28642887 * @NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA: Include BSS usage data, i.e.
28652888 * include BSSes that can only be used in restricted scenarios and/or
......@@ -2928,6 +2951,29 @@ enum nl80211_commands {
29282951 * required alongside this attribute. Refer to
29292952 * @enum nl80211_s1g_short_beacon_attrs for the attribute definitions.
29302953 *
2954 * @NL80211_ATTR_BSS_PARAM: nested attribute used with %NL80211_CMD_GET_WIPHY
2955 * which indicates which BSS parameters can be modified. The attribute can
2956 * also be used as flag attribute by user-space in %NL80211_CMD_SET_BSS to
2957 * indicate that it wants strict checking on the BSS parameters to be
2958 * modified.
2959 *
2960 * @NL80211_ATTR_NAN_CONFIG: Nested attribute for
2961 * extended NAN cluster configuration. This is used with
2962 * %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG.
2963 * See &enum nl80211_nan_conf_attributes for details.
2964 * This attribute is optional.
2965 * @NL80211_ATTR_NAN_NEW_CLUSTER: Flag attribute indicating that a new
2966 * NAN cluster has been created. This is used with
2967 * %NL80211_CMD_NAN_CLUSTER_JOINED
2968 * @NL80211_ATTR_NAN_CAPABILITIES: Nested attribute for NAN capabilities.
2969 * This is used with %NL80211_CMD_GET_WIPHY to indicate the NAN
2970 * capabilities supported by the driver. See &enum nl80211_nan_capabilities
2971 * for details.
2972 *
2973 * @NL80211_ATTR_S1G_PRIMARY_2MHZ: flag attribute indicating that the S1G
2974 * primary channel is 2 MHz wide, and the control channel designates
2975 * the 1 MHz primary subchannel within that 2 MHz primary.
2976 *
29312977 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
29322978 * @NL80211_ATTR_MAX: highest attribute number currently defined
29332979 * @__NL80211_ATTR_AFTER_LAST: internal use
......@@ -3489,6 +3535,12 @@ enum nl80211_attrs {
34893535
34903536 NL80211_ATTR_S1G_LONG_BEACON_PERIOD,
34913537 NL80211_ATTR_S1G_SHORT_BEACON,
3538 NL80211_ATTR_BSS_PARAM,
3539 NL80211_ATTR_NAN_CONFIG,
3540 NL80211_ATTR_NAN_NEW_CLUSTER,
3541 NL80211_ATTR_NAN_CAPABILITIES,
3542
3543 NL80211_ATTR_S1G_PRIMARY_2MHZ,
34923544
34933545 /* add attributes here, update the policy in nl80211.c */
34943546
......@@ -3735,6 +3787,22 @@ enum nl80211_eht_gi {
37353787 NL80211_RATE_INFO_EHT_GI_3_2,
37363788};
37373789
3790/**
3791 * enum nl80211_eht_ltf - EHT long training field
3792 * @NL80211_RATE_INFO_EHT_1XLTF: 3.2 usec
3793 * @NL80211_RATE_INFO_EHT_2XLTF: 6.4 usec
3794 * @NL80211_RATE_INFO_EHT_4XLTF: 12.8 usec
3795 * @NL80211_RATE_INFO_EHT_6XLTF: 19.2 usec
3796 * @NL80211_RATE_INFO_EHT_8XLTF: 25.6 usec
3797 */
3798enum nl80211_eht_ltf {
3799 NL80211_RATE_INFO_EHT_1XLTF,
3800 NL80211_RATE_INFO_EHT_2XLTF,
3801 NL80211_RATE_INFO_EHT_4XLTF,
3802 NL80211_RATE_INFO_EHT_6XLTF,
3803 NL80211_RATE_INFO_EHT_8XLTF,
3804};
3805
37383806/**
37393807 * enum nl80211_eht_ru_alloc - EHT RU allocation values
37403808 * @NL80211_RATE_INFO_EHT_RU_ALLOC_26: 26-tone RU allocation
......@@ -4371,6 +4439,12 @@ enum nl80211_wmm_rule {
43714439 * very low power (VLP) AP, despite being NO_IR.
43724440 * @NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY: This channel can be active in
43734441 * 20 MHz bandwidth, despite being NO_IR.
4442 * @NL80211_FREQUENCY_ATTR_NO_4MHZ: 4 MHz operation is not allowed on this
4443 * channel in current regulatory domain.
4444 * @NL80211_FREQUENCY_ATTR_NO_8MHZ: 8 MHz operation is not allowed on this
4445 * channel in current regulatory domain.
4446 * @NL80211_FREQUENCY_ATTR_NO_16MHZ: 16 MHz operation is not allowed on this
4447 * channel in current regulatory domain.
43744448 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
43754449 * currently defined
43764450 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
......@@ -4416,6 +4490,9 @@ enum nl80211_frequency_attr {
44164490 NL80211_FREQUENCY_ATTR_CAN_MONITOR,
44174491 NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP,
44184492 NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY,
4493 NL80211_FREQUENCY_ATTR_NO_4MHZ,
4494 NL80211_FREQUENCY_ATTR_NO_8MHZ,
4495 NL80211_FREQUENCY_ATTR_NO_16MHZ,
44194496
44204497 /* keep last */
44214498 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
......@@ -5481,6 +5558,10 @@ enum nl80211_key_attributes {
54815558 * see &struct nl80211_txrate_he
54825559 * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us.
54835560 * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF.
5561 * @NL80211_TXRATE_EHT: EHT rates allowed for TX rate selection,
5562 * see &struct nl80211_txrate_eht
5563 * @NL80211_TXRATE_EHT_GI: configure EHT GI, (u8, see &enum nl80211_eht_gi)
5564 * @NL80211_TXRATE_EHT_LTF: configure EHT LTF, (u8, see &enum nl80211_eht_ltf)
54845565 * @__NL80211_TXRATE_AFTER_LAST: internal
54855566 * @NL80211_TXRATE_MAX: highest TX rate attribute
54865567 */
......@@ -5493,6 +5574,9 @@ enum nl80211_tx_rate_attributes {
54935574 NL80211_TXRATE_HE,
54945575 NL80211_TXRATE_HE_GI,
54955576 NL80211_TXRATE_HE_LTF,
5577 NL80211_TXRATE_EHT,
5578 NL80211_TXRATE_EHT_GI,
5579 NL80211_TXRATE_EHT_LTF,
54965580
54975581 /* keep last */
54985582 __NL80211_TXRATE_AFTER_LAST,
......@@ -5525,6 +5609,15 @@ enum nl80211_txrate_gi {
55255609 NL80211_TXRATE_FORCE_LGI,
55265610};
55275611
5612#define NL80211_EHT_NSS_MAX 16
5613/**
5614 * struct nl80211_txrate_eht - EHT MCS/NSS txrate bitmap
5615 * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
5616 */
5617struct nl80211_txrate_eht {
5618 __u16 mcs[NL80211_EHT_NSS_MAX];
5619};
5620
55285621/**
55295622 * enum nl80211_band - Frequency band
55305623 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
......@@ -6649,6 +6742,9 @@ enum nl80211_feature_flags {
66496742 * (signaling and payload protected) A-MSDUs and this shall be advertised
66506743 * in the RSNXE.
66516744 *
6745 * @NL80211_EXT_FEATURE_BEACON_RATE_EHT: Driver supports beacon rate
6746 * configuration (AP/mesh) with EHT rates.
6747 *
66526748 * @NUM_NL80211_EXT_FEATURES: number of extended features.
66536749 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
66546750 */
......@@ -6724,6 +6820,7 @@ enum nl80211_ext_feature_index {
67246820 NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
67256821 NL80211_EXT_FEATURE_DFS_CONCURRENT,
67266822 NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT,
6823 NL80211_EXT_FEATURE_BEACON_RATE_EHT,
67276824
67286825 /* add new features before the definition below */
67296826 NUM_NL80211_EXT_FEATURES,
......@@ -7278,6 +7375,105 @@ enum nl80211_nan_match_attributes {
72787375 NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1
72797376};
72807377
7378/**
7379 * enum nl80211_nan_band_conf_attributes - NAN band configuration attributes
7380 * @__NL80211_NAN_BAND_CONF_INVALID: Invalid.
7381 * @NL80211_NAN_BAND_CONF_BAND: Band for which the configuration is
7382 * being set. The value is according to &enum nl80211_band (u8).
7383 * @NL80211_NAN_BAND_CONF_FREQ: Discovery frequency. This attribute shall not
7384 * be present on 2.4 GHZ band. On 5 GHz band its presence is optional.
7385 * The allowed values are 5220 (channel 44) or 5745 (channel 149).
7386 * If not present, channel 149 is used if allowed, otherwise channel 44
7387 * will be selected. The value is in MHz (u16).
7388 * @NL80211_NAN_BAND_CONF_RSSI_CLOSE: RSSI close threshold used for NAN state
7389 * transition algorithm as described in chapters 3.3.6 and 3.3.7 "NAN
7390 * Device Role and State Transition" of Wi-Fi Aware (TM) Specification
7391 * v4.0. If not specified, default device value is used. The value should
7392 * be greater than -60 dBm (s8).
7393 * @NL80211_NAN_BAND_CONF_RSSI_MIDDLE: RSSI middle threshold used for NAN state
7394 * transition algorithm as described in chapters 3.3.6 and 3.3.7 "NAN
7395 * Device Role and State Transition" of Wi-Fi Aware (TM) Specification
7396 * v4.0. If not present, default device value is used. The value should be
7397 * greater than -75 dBm and less than %NL80211_NAN_BAND_CONF_RSSI_CLOSE
7398 * (s8).
7399 * @NL80211_NAN_BAND_CONF_WAKE_DW: Committed DW information (values 0-5).
7400 * Value 0 means that the device will not wake up during the
7401 * discovery window. Values 1-5 mean that the device will wake up
7402 * during each 2^(n - 1) discovery window, where n is the value of
7403 * this attribute. Setting this attribute to 0 is not allowed on
7404 * 2.4 GHz band (u8). This is an optional parameter (default is 1).
7405 * @NL80211_NAN_BAND_CONF_DISABLE_SCAN: Optional flag attribute to disable
7406 * scanning (for cluster merge) on the band. If set, the device will not
7407 * scan on this band anymore. Disabling scanning on 2.4 GHz band is not
7408 * allowed.
7409 * @NUM_NL80211_NAN_BAND_CONF_ATTR: Internal.
7410 * @NL80211_NAN_BAND_CONF_ATTR_MAX: Highest NAN band configuration attribute.
7411 *
7412 * These attributes are used to configure NAN band-specific parameters. Note,
7413 * that both RSSI attributes should be configured (or both left unset).
7414 */
7415enum nl80211_nan_band_conf_attributes {
7416 __NL80211_NAN_BAND_CONF_INVALID,
7417 NL80211_NAN_BAND_CONF_BAND,
7418 NL80211_NAN_BAND_CONF_FREQ,
7419 NL80211_NAN_BAND_CONF_RSSI_CLOSE,
7420 NL80211_NAN_BAND_CONF_RSSI_MIDDLE,
7421 NL80211_NAN_BAND_CONF_WAKE_DW,
7422 NL80211_NAN_BAND_CONF_DISABLE_SCAN,
7423
7424 /* keep last */
7425 NUM_NL80211_NAN_BAND_CONF_ATTR,
7426 NL80211_NAN_BAND_CONF_ATTR_MAX = NUM_NL80211_NAN_BAND_CONF_ATTR - 1,
7427};
7428
7429/**
7430 * enum nl80211_nan_conf_attributes - NAN configuration attributes
7431 * @__NL80211_NAN_CONF_INVALID: Invalid attribute, used for validation.
7432 * @NL80211_NAN_CONF_CLUSTER_ID: ID for the NAN cluster. This is a MAC
7433 * address that can take values from 50-6F-9A-01-00-00 to
7434 * 50-6F-9A-01-FF-FF. This attribute is optional. If not present,
7435 * a random Cluster ID will be chosen.
7436 * @NL80211_NAN_CONF_EXTRA_ATTRS: Additional NAN attributes to be
7437 * published in the beacons. This is an optional byte array.
7438 * @NL80211_NAN_CONF_VENDOR_ELEMS: Vendor-specific elements that will
7439 * be published in the beacons. This is an optional byte array.
7440 * @NL80211_NAN_CONF_BAND_CONFIGS: This is a nested array attribute,
7441 * containing multiple entries for each supported band. Each band
7442 * configuration consists of &enum nl80211_nan_band_conf_attributes.
7443 * @NL80211_NAN_CONF_SCAN_PERIOD: Scan period in seconds. If not configured,
7444 * device default is used. Zero value will disable scanning.
7445 * This is u16 (optional).
7446 * @NL80211_NAN_CONF_SCAN_DWELL_TIME: Scan dwell time in TUs per channel.
7447 * Only non-zero values are valid. If not configured the device default
7448 * value is used. This is u16 (optional)
7449 * @NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL: Discovery beacon interval
7450 * in TUs. Valid range is 50-200 TUs. If not configured the device default
7451 * value is used. This is u8 (optional)
7452 * @NL80211_NAN_CONF_NOTIFY_DW: If set, the driver will notify userspace about
7453 * the upcoming discovery window with
7454 * %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION.
7455 * This is a flag attribute.
7456 * @NUM_NL80211_NAN_CONF_ATTR: Internal.
7457 * @NL80211_NAN_CONF_ATTR_MAX: Highest NAN configuration attribute.
7458 *
7459 * These attributes are used to configure NAN-specific parameters.
7460 */
7461enum nl80211_nan_conf_attributes {
7462 __NL80211_NAN_CONF_INVALID,
7463 NL80211_NAN_CONF_CLUSTER_ID,
7464 NL80211_NAN_CONF_EXTRA_ATTRS,
7465 NL80211_NAN_CONF_VENDOR_ELEMS,
7466 NL80211_NAN_CONF_BAND_CONFIGS,
7467 NL80211_NAN_CONF_SCAN_PERIOD,
7468 NL80211_NAN_CONF_SCAN_DWELL_TIME,
7469 NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL,
7470 NL80211_NAN_CONF_NOTIFY_DW,
7471
7472 /* keep last */
7473 NUM_NL80211_NAN_CONF_ATTR,
7474 NL80211_NAN_CONF_ATTR_MAX = NUM_NL80211_NAN_CONF_ATTR - 1,
7475};
7476
72817477/**
72827478 * enum nl80211_external_auth_action - Action to perform with external
72837479 * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION.
......@@ -8187,4 +8383,54 @@ enum nl80211_s1g_short_beacon_attrs {
81878383 __NL80211_S1G_SHORT_BEACON_ATTR_LAST - 1
81888384};
81898385
8386/**
8387 * enum nl80211_nan_capabilities - NAN (Neighbor Aware Networking)
8388 * capabilities.
8389 *
8390 * @__NL80211_NAN_CAPABILITIES_INVALID: Invalid.
8391 * @NL80211_NAN_CAPA_CONFIGURABLE_SYNC: Flag attribute indicating that
8392 * the device supports configurable synchronization. If set, the device
8393 * should be able to handle %NL80211_ATTR_NAN_CONFIG
8394 * attribute in the %NL80211_CMD_START_NAN (and change) command.
8395 * @NL80211_NAN_CAPA_USERSPACE_DE: Flag attribute indicating that
8396 * NAN Discovery Engine (DE) is not offloaded and the driver assumes
8397 * user space DE implementation. When set, %NL80211_CMD_ADD_NAN_FUNCTION,
8398 * %NL80211_CMD_DEL_NAN_FUNCTION and %NL80211_CMD_NAN_MATCH commands
8399 * should not be used. In addition, the device/driver should support
8400 * sending discovery window (DW) notifications using
8401 * %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION and handling transmission and
8402 * reception of NAN SDF frames on NAN device interface during DW windows.
8403 * (%NL80211_CMD_FRAME is used to transmit SDFs)
8404 * @NL80211_NAN_CAPA_OP_MODE: u8 attribute indicating the supported operation
8405 * modes as defined in Wi-Fi Aware (TM) specification Table 81 (Operation
8406 * Mode field format).
8407 * @NL80211_NAN_CAPA_NUM_ANTENNAS: u8 attribute indicating the number of
8408 * TX and RX antennas supported by the device. Lower nibble indicates
8409 * the number of TX antennas and upper nibble indicates the number of RX
8410 * antennas. Value 0 indicates the information is not available.
8411 * See table 79 of Wi-Fi Aware (TM) specification (Number of
8412 * Antennas field).
8413 * @NL80211_NAN_CAPA_MAX_CHANNEL_SWITCH_TIME: u16 attribute indicating the
8414 * maximum time in microseconds that the device requires to switch
8415 * channels.
8416 * @NL80211_NAN_CAPA_CAPABILITIES: u8 attribute containing the
8417 * capabilities of the device as defined in Wi-Fi Aware (TM)
8418 * specification Table 79 (Capabilities field).
8419 * @__NL80211_NAN_CAPABILITIES_LAST: Internal
8420 * @NL80211_NAN_CAPABILITIES_MAX: Highest NAN capability attribute.
8421 */
8422enum nl80211_nan_capabilities {
8423 __NL80211_NAN_CAPABILITIES_INVALID,
8424
8425 NL80211_NAN_CAPA_CONFIGURABLE_SYNC,
8426 NL80211_NAN_CAPA_USERSPACE_DE,
8427 NL80211_NAN_CAPA_OP_MODE,
8428 NL80211_NAN_CAPA_NUM_ANTENNAS,
8429 NL80211_NAN_CAPA_MAX_CHANNEL_SWITCH_TIME,
8430 NL80211_NAN_CAPA_CAPABILITIES,
8431 /* keep last */
8432 __NL80211_NAN_CAPABILITIES_LAST,
8433 NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
8434};
8435
81908436#endif /* __LINUX_NL80211_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nsfs.h+68-2
......@@ -16,8 +16,6 @@
1616#define NS_GET_NSTYPE _IO(NSIO, 0x3)
1717/* Get owner UID (in the caller's user namespace) for a user namespace */
1818#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)
2119/* Translate pid from target pid namespace into the caller's pid namespace. */
2220#define NS_GET_PID_FROM_PIDNS _IOR(NSIO, 0x6, int)
2321/* Return thread-group leader id of pid in the callers pid namespace. */
......@@ -42,6 +40,10 @@ struct mnt_ns_info {
4240/* Get previous namespace. */
4341#define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info)
4442
43/* Retrieve namespace identifiers. */
44#define NS_GET_MNTNS_ID _IOR(NSIO, 5, __u64)
45#define NS_GET_ID _IOR(NSIO, 13, __u64)
46
4547enum init_ns_ino {
4648 IPC_NS_INIT_INO = 0xEFFFFFFFU,
4749 UTS_NS_INIT_INO = 0xEFFFFFFEU,
......@@ -53,4 +55,68 @@ enum init_ns_ino {
5355 MNT_NS_INIT_INO = 0xEFFFFFF8U,
5456};
5557
58struct nsfs_file_handle {
59 __u64 ns_id;
60 __u32 ns_type;
61 __u32 ns_inum;
62};
63
64#define NSFS_FILE_HANDLE_SIZE_VER0 16 /* sizeof first published struct */
65#define NSFS_FILE_HANDLE_SIZE_LATEST sizeof(struct nsfs_file_handle) /* sizeof latest published struct */
66
67enum init_ns_id {
68 IPC_NS_INIT_ID = 1ULL,
69 UTS_NS_INIT_ID = 2ULL,
70 USER_NS_INIT_ID = 3ULL,
71 PID_NS_INIT_ID = 4ULL,
72 CGROUP_NS_INIT_ID = 5ULL,
73 TIME_NS_INIT_ID = 6ULL,
74 NET_NS_INIT_ID = 7ULL,
75 MNT_NS_INIT_ID = 8ULL,
76};
77
78enum ns_type {
79 TIME_NS = (1ULL << 7), /* CLONE_NEWTIME */
80 MNT_NS = (1ULL << 17), /* CLONE_NEWNS */
81 CGROUP_NS = (1ULL << 25), /* CLONE_NEWCGROUP */
82 UTS_NS = (1ULL << 26), /* CLONE_NEWUTS */
83 IPC_NS = (1ULL << 27), /* CLONE_NEWIPC */
84 USER_NS = (1ULL << 28), /* CLONE_NEWUSER */
85 PID_NS = (1ULL << 29), /* CLONE_NEWPID */
86 NET_NS = (1ULL << 30), /* CLONE_NEWNET */
87};
88
89/**
90 * struct ns_id_req - namespace ID request structure
91 * @size: size of this structure
92 * @spare: reserved for future use
93 * @filter: filter mask
94 * @ns_id: last namespace id
95 * @user_ns_id: owning user namespace ID
96 *
97 * Structure for passing namespace ID and miscellaneous parameters to
98 * statns(2) and listns(2).
99 *
100 * For statns(2) @param represents the request mask.
101 * For listns(2) @param represents the last listed mount id (or zero).
102 */
103struct ns_id_req {
104 __u32 size;
105 __u32 spare;
106 __u64 ns_id;
107 struct /* listns */ {
108 __u32 ns_type;
109 __u32 spare2;
110 __u64 user_ns_id;
111 };
112};
113
114/*
115 * Special @user_ns_id value that can be passed to listns()
116 */
117#define LISTNS_CURRENT_USER 0xffffffffffffffff /* Caller's userns */
118
119/* List of all ns_id_req versions. */
120#define NS_ID_REQ_SIZE_VER0 32 /* sizeof first published struct */
121
56122#endif /* __LINUX_NSFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ovpn.h+1
......@@ -2,6 +2,7 @@
22/* Do not edit directly, auto-generated from: */
33/* Documentation/netlink/specs/ovpn.yaml */
44/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
56
67#ifndef _LINUX_OVPN_H
78#define _LINUX_OVPN_H
lib/libc/include/any-linux-any/linux/pci_regs.h+99
......@@ -207,6 +207,9 @@
207207
208208/* Capability lists */
209209
210#define PCI_CAP_ID_MASK 0x00ff /* Capability ID mask */
211#define PCI_CAP_LIST_NEXT_MASK 0xff00 /* Next Capability Pointer mask */
212
210213#define PCI_CAP_LIST_ID 0 /* Capability ID */
211214#define PCI_CAP_ID_PM 0x01 /* Power Management */
212215#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
......@@ -500,6 +503,7 @@
500503#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
501504#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
502505#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
506#define PCI_EXP_DEVCAP_TEE 0x40000000 /* TEE I/O (TDISP) Support */
503507#define PCI_EXP_DEVCTL 0x08 /* Device Control */
504508#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
505509#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
......@@ -751,6 +755,8 @@
751755#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */
752756#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
753757#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
758#define PCI_EXT_CAP_ID_DEV3 0x2F /* Device 3 Capability/Control/Status */
759#define PCI_EXT_CAP_ID_IDE 0x30 /* Integrity and Data Encryption */
754760#define PCI_EXT_CAP_ID_PL_64GT 0x31 /* Physical Layer 64.0 GT/s */
755761#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_64GT
756762
......@@ -776,6 +782,12 @@
776782#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
777783#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
778784#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
785#define PCI_ERR_UNC_POISON_BLK 0x04000000 /* Poisoned TLP Egress Blocked */
786#define PCI_ERR_UNC_DMWR_BLK 0x08000000 /* DMWr Request Egress Blocked */
787#define PCI_ERR_UNC_IDE_CHECK 0x10000000 /* IDE Check Failed */
788#define PCI_ERR_UNC_MISR_IDE 0x20000000 /* Misrouted IDE TLP */
789#define PCI_ERR_UNC_PCRC_CHECK 0x40000000 /* PCRC Check Failed */
790#define PCI_ERR_UNC_XLAT_BLK 0x80000000 /* TLP Translation Egress Blocked */
779791#define PCI_ERR_UNCOR_MASK 0x08 /* Uncorrectable Error Mask */
780792 /* Same bits as above */
781793#define PCI_ERR_UNCOR_SEVER 0x0c /* Uncorrectable Error Severity */
......@@ -798,6 +810,7 @@
798810#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
799811#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
800812#define PCI_ERR_CAP_PREFIX_LOG_PRESENT 0x00000800 /* TLP Prefix Log Present */
813#define PCI_ERR_CAP_COMP_TIME_LOG 0x00001000 /* Completion Timeout Prefix/Header Log Capable */
801814#define PCI_ERR_CAP_TLP_LOG_FLIT 0x00040000 /* TLP was logged in Flit Mode */
802815#define PCI_ERR_CAP_TLP_LOG_SIZE 0x00f80000 /* Logged TLP Size (only in Flit mode) */
803816#define PCI_ERR_HEADER_LOG 0x1c /* Header Log Register (16 bytes) */
......@@ -1234,9 +1247,95 @@
12341247/* Deprecated old name, replaced with PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE */
12351248#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE
12361249
1250/* Device 3 Extended Capability */
1251#define PCI_DEV3_CAP 0x04 /* Device 3 Capabilities Register */
1252#define PCI_DEV3_CTL 0x08 /* Device 3 Control Register */
1253#define PCI_DEV3_STA 0x0c /* Device 3 Status Register */
1254#define PCI_DEV3_STA_SEGMENT 0x8 /* Segment Captured (end-to-end flit-mode detected) */
1255
12371256/* Compute Express Link (CXL r3.1, sec 8.1.5) */
12381257#define PCI_DVSEC_CXL_PORT 3
12391258#define PCI_DVSEC_CXL_PORT_CTL 0x0c
12401259#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001
12411260
1261/* Integrity and Data Encryption Extended Capability */
1262#define PCI_IDE_CAP 0x04
1263#define PCI_IDE_CAP_LINK 0x1 /* Link IDE Stream Supported */
1264#define PCI_IDE_CAP_SELECTIVE 0x2 /* Selective IDE Streams Supported */
1265#define PCI_IDE_CAP_FLOWTHROUGH 0x4 /* Flow-Through IDE Stream Supported */
1266#define PCI_IDE_CAP_PARTIAL_HEADER_ENC 0x8 /* Partial Header Encryption Supported */
1267#define PCI_IDE_CAP_AGGREGATION 0x10 /* Aggregation Supported */
1268#define PCI_IDE_CAP_PCRC 0x20 /* PCRC Supported */
1269#define PCI_IDE_CAP_IDE_KM 0x40 /* IDE_KM Protocol Supported */
1270#define PCI_IDE_CAP_SEL_CFG 0x80 /* Selective IDE for Config Request Support */
1271#define PCI_IDE_CAP_ALG __GENMASK(12, 8) /* Supported Algorithms */
1272#define PCI_IDE_CAP_ALG_AES_GCM_256 0 /* AES-GCM 256 key size, 96b MAC */
1273#define PCI_IDE_CAP_LINK_TC_NUM __GENMASK(15, 13) /* Link IDE TCs */
1274#define PCI_IDE_CAP_SEL_NUM __GENMASK(23, 16) /* Supported Selective IDE Streams */
1275#define PCI_IDE_CAP_TEE_LIMITED 0x1000000 /* TEE-Limited Stream Supported */
1276#define PCI_IDE_CTL 0x08
1277#define PCI_IDE_CTL_FLOWTHROUGH_IDE 0x4 /* Flow-Through IDE Stream Enabled */
1278
1279#define PCI_IDE_LINK_STREAM_0 0xc /* First Link Stream Register Block */
1280#define PCI_IDE_LINK_BLOCK_SIZE 8
1281/* Link IDE Stream block, up to PCI_IDE_CAP_LINK_TC_NUM */
1282#define PCI_IDE_LINK_CTL_0 0x00 /* First Link Control Register Offset in block */
1283#define PCI_IDE_LINK_CTL_EN 0x1 /* Link IDE Stream Enable */
1284#define PCI_IDE_LINK_CTL_TX_AGGR_NPR __GENMASK(3, 2) /* Tx Aggregation Mode NPR */
1285#define PCI_IDE_LINK_CTL_TX_AGGR_PR __GENMASK(5, 4) /* Tx Aggregation Mode PR */
1286#define PCI_IDE_LINK_CTL_TX_AGGR_CPL __GENMASK(7, 6) /* Tx Aggregation Mode CPL */
1287#define PCI_IDE_LINK_CTL_PCRC_EN 0x100 /* PCRC Enable */
1288#define PCI_IDE_LINK_CTL_PART_ENC __GENMASK(13, 10) /* Partial Header Encryption Mode */
1289#define PCI_IDE_LINK_CTL_ALG __GENMASK(18, 14) /* Selection from PCI_IDE_CAP_ALG */
1290#define PCI_IDE_LINK_CTL_TC __GENMASK(21, 19) /* Traffic Class */
1291#define PCI_IDE_LINK_CTL_ID __GENMASK(31, 24) /* Stream ID */
1292#define PCI_IDE_LINK_STS_0 0x4 /* First Link Status Register Offset in block */
1293#define PCI_IDE_LINK_STS_STATE __GENMASK(3, 0) /* Link IDE Stream State */
1294#define PCI_IDE_LINK_STS_IDE_FAIL 0x80000000 /* IDE fail message received */
1295
1296/* Selective IDE Stream block, up to PCI_IDE_CAP_SELECTIVE_STREAMS_NUM */
1297/* Selective IDE Stream Capability Register */
1298#define PCI_IDE_SEL_CAP 0x00
1299#define PCI_IDE_SEL_CAP_ASSOC_NUM __GENMASK(3, 0)
1300/* Selective IDE Stream Control Register */
1301#define PCI_IDE_SEL_CTL 0x04
1302#define PCI_IDE_SEL_CTL_EN 0x1 /* Selective IDE Stream Enable */
1303#define PCI_IDE_SEL_CTL_TX_AGGR_NPR __GENMASK(3, 2) /* Tx Aggregation Mode NPR */
1304#define PCI_IDE_SEL_CTL_TX_AGGR_PR __GENMASK(5, 4) /* Tx Aggregation Mode PR */
1305#define PCI_IDE_SEL_CTL_TX_AGGR_CPL __GENMASK(7, 6) /* Tx Aggregation Mode CPL */
1306#define PCI_IDE_SEL_CTL_PCRC_EN 0x100 /* PCRC Enable */
1307#define PCI_IDE_SEL_CTL_CFG_EN 0x200 /* Selective IDE for Configuration Requests */
1308#define PCI_IDE_SEL_CTL_PART_ENC __GENMASK(13, 10) /* Partial Header Encryption Mode */
1309#define PCI_IDE_SEL_CTL_ALG __GENMASK(18, 14) /* Selection from PCI_IDE_CAP_ALG */
1310#define PCI_IDE_SEL_CTL_TC __GENMASK(21, 19) /* Traffic Class */
1311#define PCI_IDE_SEL_CTL_DEFAULT 0x400000 /* Default Stream */
1312#define PCI_IDE_SEL_CTL_TEE_LIMITED 0x800000 /* TEE-Limited Stream */
1313#define PCI_IDE_SEL_CTL_ID __GENMASK(31, 24) /* Stream ID */
1314#define PCI_IDE_SEL_CTL_ID_MAX 255
1315/* Selective IDE Stream Status Register */
1316#define PCI_IDE_SEL_STS 0x08
1317#define PCI_IDE_SEL_STS_STATE __GENMASK(3, 0) /* Selective IDE Stream State */
1318#define PCI_IDE_SEL_STS_STATE_INSECURE 0
1319#define PCI_IDE_SEL_STS_STATE_SECURE 2
1320#define PCI_IDE_SEL_STS_IDE_FAIL 0x80000000 /* IDE fail message received */
1321/* IDE RID Association Register 1 */
1322#define PCI_IDE_SEL_RID_1 0x0c
1323#define PCI_IDE_SEL_RID_1_LIMIT __GENMASK(23, 8)
1324/* IDE RID Association Register 2 */
1325#define PCI_IDE_SEL_RID_2 0x10
1326#define PCI_IDE_SEL_RID_2_VALID 0x1
1327#define PCI_IDE_SEL_RID_2_BASE __GENMASK(23, 8)
1328#define PCI_IDE_SEL_RID_2_SEG __GENMASK(31, 24)
1329/* Selective IDE Address Association Register Block, up to PCI_IDE_SEL_CAP_ASSOC_NUM */
1330#define PCI_IDE_SEL_ADDR_BLOCK_SIZE 12
1331#define PCI_IDE_SEL_ADDR_1(x) (20 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE)
1332#define PCI_IDE_SEL_ADDR_1_VALID 0x1
1333#define PCI_IDE_SEL_ADDR_1_BASE_LOW __GENMASK(19, 8)
1334#define PCI_IDE_SEL_ADDR_1_LIMIT_LOW __GENMASK(31, 20)
1335/* IDE Address Association Register 2 is "Memory Limit Upper" */
1336#define PCI_IDE_SEL_ADDR_2(x) (24 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE)
1337/* IDE Address Association Register 3 is "Memory Base Upper" */
1338#define PCI_IDE_SEL_ADDR_3(x) (28 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE)
1339#define PCI_IDE_SEL_BLOCK_SIZE(nr_assoc) (20 + PCI_IDE_SEL_ADDR_BLOCK_SIZE * (nr_assoc))
1340
12421341#endif /* LINUX_PCI_REGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/perf_event.h+23-2
......@@ -2,7 +2,7 @@
22/*
33 * Performance events:
44 *
5 * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de>
5 * Copyright (C) 2008-2009, Linutronix GmbH, Thomas Gleixner <tglx@kernel.org>
66 * Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar
77 * Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra
88 *
......@@ -382,6 +382,7 @@ enum perf_event_read_format {
382382#define PERF_ATTR_SIZE_VER6 120 /* Add: aux_sample_size */
383383#define PERF_ATTR_SIZE_VER7 128 /* Add: sig_data */
384384#define PERF_ATTR_SIZE_VER8 136 /* Add: config3 */
385#define PERF_ATTR_SIZE_VER9 144 /* add: config4 */
385386
386387/*
387388 * 'struct perf_event_attr' contains various attributes that define
......@@ -463,7 +464,9 @@ struct perf_event_attr {
463464 inherit_thread : 1, /* children only inherit if cloned with CLONE_THREAD */
464465 remove_on_exec : 1, /* event is removed from task on exec */
465466 sigtrap : 1, /* send synchronous SIGTRAP on event */
466 __reserved_1 : 26;
467 defer_callchain: 1, /* request PERF_RECORD_CALLCHAIN_DEFERRED records */
468 defer_output : 1, /* output PERF_RECORD_CALLCHAIN_DEFERRED records */
469 __reserved_1 : 24;
467470
468471 union {
469472 __u32 wakeup_events; /* wake up every n events */
......@@ -543,6 +546,7 @@ struct perf_event_attr {
543546 __u64 sig_data;
544547
545548 __u64 config3; /* extension of config2 */
549 __u64 config4; /* extension of config3 */
546550};
547551
548552/*
......@@ -1239,6 +1243,22 @@ enum perf_event_type {
12391243 */
12401244 PERF_RECORD_AUX_OUTPUT_HW_ID = 21,
12411245
1246 /*
1247 * This user callchain capture was deferred until shortly before
1248 * returning to user space. Previous samples would have kernel
1249 * callchains only and they need to be stitched with this to make full
1250 * callchains.
1251 *
1252 * struct {
1253 * struct perf_event_header header;
1254 * u64 cookie;
1255 * u64 nr;
1256 * u64 ips[nr];
1257 * struct sample_id sample_id;
1258 * };
1259 */
1260 PERF_RECORD_CALLCHAIN_DEFERRED = 22,
1261
12421262 PERF_RECORD_MAX, /* non-ABI */
12431263};
12441264
......@@ -1269,6 +1289,7 @@ enum perf_callchain_context {
12691289 PERF_CONTEXT_HV = (__u64)-32,
12701290 PERF_CONTEXT_KERNEL = (__u64)-128,
12711291 PERF_CONTEXT_USER = (__u64)-512,
1292 PERF_CONTEXT_USER_DEFERRED = (__u64)-640,
12721293
12731294 PERF_CONTEXT_GUEST = (__u64)-2048,
12741295 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
lib/libc/include/any-linux-any/linux/pidfd.h+9-2
......@@ -22,8 +22,12 @@
2222#define PIDFD_INFO_CGROUPID (1UL << 2) /* Always returned if available, even if not requested */
2323#define PIDFD_INFO_EXIT (1UL << 3) /* Only returned if requested. */
2424#define PIDFD_INFO_COREDUMP (1UL << 4) /* Only returned if requested. */
25#define PIDFD_INFO_SUPPORTED_MASK (1UL << 5) /* Want/got supported mask flags */
26#define PIDFD_INFO_COREDUMP_SIGNAL (1UL << 6) /* Always returned if PIDFD_INFO_COREDUMP is requested. */
2527
2628#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */
29#define PIDFD_INFO_SIZE_VER1 72 /* sizeof second published struct */
30#define PIDFD_INFO_SIZE_VER2 80 /* sizeof third published struct */
2731
2832/*
2933 * Values for @coredump_mask in pidfd_info.
......@@ -87,8 +91,11 @@ struct pidfd_info {
8791 __u32 fsuid;
8892 __u32 fsgid;
8993 __s32 exit_code;
90 __u32 coredump_mask;
91 __u32 __spare1;
94 struct /* coredump info */ {
95 __u32 coredump_mask;
96 __u32 coredump_signal;
97 };
98 __u64 supported_mask; /* Mask flags that this kernel supports */
9299};
93100
94101#define PIDFS_IOCTL_MAGIC 0xFF
lib/libc/include/any-linux-any/linux/pr.h+16
......@@ -56,6 +56,18 @@ struct pr_clear {
5656 __u32 __pad;
5757};
5858
59struct pr_read_keys {
60 __u32 generation;
61 __u32 num_keys;
62 __u64 keys_ptr;
63};
64
65struct pr_read_reservation {
66 __u64 key;
67 __u32 generation;
68 __u32 type;
69};
70
5971#define PR_FL_IGNORE_KEY (1 << 0) /* ignore existing key */
6072
6173#define IOC_PR_REGISTER _IOW('p', 200, struct pr_registration)
......@@ -64,5 +76,9 @@ struct pr_clear {
6476#define IOC_PR_PREEMPT _IOW('p', 203, struct pr_preempt)
6577#define IOC_PR_PREEMPT_ABORT _IOW('p', 204, struct pr_preempt)
6678#define IOC_PR_CLEAR _IOW('p', 205, struct pr_clear)
79#define IOC_PR_READ_KEYS _IOWR('p', 206, struct pr_read_keys)
80#define IOC_PR_READ_RESERVATION _IOR('p', 207, struct pr_read_reservation)
81
82#define PR_KEYS_MAX (1u << 16)
6783
6884#endif /* _PR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/prctl.h+10
......@@ -177,7 +177,17 @@ struct prctl_mm_map {
177177
178178#define PR_GET_TID_ADDRESS 40
179179
180/*
181 * Flags for PR_SET_THP_DISABLE are only applicable when disabling. Bit 0
182 * is reserved, so PR_GET_THP_DISABLE can return "1 | flags", to effectively
183 * return "1" when no flags were specified for PR_SET_THP_DISABLE.
184 */
180185#define PR_SET_THP_DISABLE 41
186/*
187 * Don't disable THPs when explicitly advised (e.g., MADV_HUGEPAGE /
188 * VM_HUGEPAGE, MADV_COLLAPSE).
189 */
190# define PR_THP_DISABLE_EXCEPT_ADVISED (1 << 1)
181191#define PR_GET_THP_DISABLE 42
182192
183193/*
lib/libc/include/any-linux-any/linux/psp-sev.h+50-26
......@@ -47,32 +47,32 @@ typedef enum {
4747 * with possible values from the specification.
4848 */
4949 SEV_RET_NO_FW_CALL = -1,
50 SEV_RET_SUCCESS = 0,
51 SEV_RET_INVALID_PLATFORM_STATE,
52 SEV_RET_INVALID_GUEST_STATE,
53 SEV_RET_INAVLID_CONFIG,
50 SEV_RET_SUCCESS = 0,
51 SEV_RET_INVALID_PLATFORM_STATE = 0x0001,
52 SEV_RET_INVALID_GUEST_STATE = 0x0002,
53 SEV_RET_INAVLID_CONFIG = 0x0003,
5454 SEV_RET_INVALID_CONFIG = SEV_RET_INAVLID_CONFIG,
55 SEV_RET_INVALID_LEN,
56 SEV_RET_ALREADY_OWNED,
57 SEV_RET_INVALID_CERTIFICATE,
58 SEV_RET_POLICY_FAILURE,
59 SEV_RET_INACTIVE,
60 SEV_RET_INVALID_ADDRESS,
61 SEV_RET_BAD_SIGNATURE,
62 SEV_RET_BAD_MEASUREMENT,
63 SEV_RET_ASID_OWNED,
64 SEV_RET_INVALID_ASID,
65 SEV_RET_WBINVD_REQUIRED,
66 SEV_RET_DFFLUSH_REQUIRED,
67 SEV_RET_INVALID_GUEST,
68 SEV_RET_INVALID_COMMAND,
69 SEV_RET_ACTIVE,
70 SEV_RET_HWSEV_RET_PLATFORM,
71 SEV_RET_HWSEV_RET_UNSAFE,
72 SEV_RET_UNSUPPORTED,
73 SEV_RET_INVALID_PARAM,
74 SEV_RET_RESOURCE_LIMIT,
75 SEV_RET_SECURE_DATA_INVALID,
55 SEV_RET_INVALID_LEN = 0x0004,
56 SEV_RET_ALREADY_OWNED = 0x0005,
57 SEV_RET_INVALID_CERTIFICATE = 0x0006,
58 SEV_RET_POLICY_FAILURE = 0x0007,
59 SEV_RET_INACTIVE = 0x0008,
60 SEV_RET_INVALID_ADDRESS = 0x0009,
61 SEV_RET_BAD_SIGNATURE = 0x000A,
62 SEV_RET_BAD_MEASUREMENT = 0x000B,
63 SEV_RET_ASID_OWNED = 0x000C,
64 SEV_RET_INVALID_ASID = 0x000D,
65 SEV_RET_WBINVD_REQUIRED = 0x000E,
66 SEV_RET_DFFLUSH_REQUIRED = 0x000F,
67 SEV_RET_INVALID_GUEST = 0x0010,
68 SEV_RET_INVALID_COMMAND = 0x0011,
69 SEV_RET_ACTIVE = 0x0012,
70 SEV_RET_HWSEV_RET_PLATFORM = 0x0013,
71 SEV_RET_HWSEV_RET_UNSAFE = 0x0014,
72 SEV_RET_UNSUPPORTED = 0x0015,
73 SEV_RET_INVALID_PARAM = 0x0016,
74 SEV_RET_RESOURCE_LIMIT = 0x0017,
75 SEV_RET_SECURE_DATA_INVALID = 0x0018,
7676 SEV_RET_INVALID_PAGE_SIZE = 0x0019,
7777 SEV_RET_INVALID_PAGE_STATE = 0x001A,
7878 SEV_RET_INVALID_MDATA_ENTRY = 0x001B,
......@@ -87,6 +87,22 @@ typedef enum {
8787 SEV_RET_RESTORE_REQUIRED = 0x0025,
8888 SEV_RET_RMP_INITIALIZATION_FAILED = 0x0026,
8989 SEV_RET_INVALID_KEY = 0x0027,
90 SEV_RET_SHUTDOWN_INCOMPLETE = 0x0028,
91 SEV_RET_INCORRECT_BUFFER_LENGTH = 0x0030,
92 SEV_RET_EXPAND_BUFFER_LENGTH_REQUEST = 0x0031,
93 SEV_RET_SPDM_REQUEST = 0x0032,
94 SEV_RET_SPDM_ERROR = 0x0033,
95 SEV_RET_SEV_STATUS_ERR_IN_DEV_CONN = 0x0035,
96 SEV_RET_SEV_STATUS_INVALID_DEV_CTX = 0x0036,
97 SEV_RET_SEV_STATUS_INVALID_TDI_CTX = 0x0037,
98 SEV_RET_SEV_STATUS_INVALID_TDI = 0x0038,
99 SEV_RET_SEV_STATUS_RECLAIM_REQUIRED = 0x0039,
100 SEV_RET_IN_USE = 0x003A,
101 SEV_RET_SEV_STATUS_INVALID_DEV_STATE = 0x003B,
102 SEV_RET_SEV_STATUS_INVALID_TDI_STATE = 0x003C,
103 SEV_RET_SEV_STATUS_DEV_CERT_CHANGED = 0x003D,
104 SEV_RET_SEV_STATUS_RESYNC_REQ = 0x003E,
105 SEV_RET_SEV_STATUS_RESPONSE_TOO_LARGE = 0x003F,
90106 SEV_RET_MAX,
91107} sev_ret_code;
92108
......@@ -185,6 +201,10 @@ struct sev_user_data_get_id2 {
185201 * @mask_chip_id: whether chip id is present in attestation reports or not
186202 * @mask_chip_key: whether attestation reports are signed or not
187203 * @vlek_en: VLEK (Version Loaded Endorsement Key) hashstick is loaded
204 * @feature_info: whether SNP_FEATURE_INFO command is available
205 * @rapl_dis: whether RAPL is disabled
206 * @ciphertext_hiding_cap: whether platform has ciphertext hiding capability
207 * @ciphertext_hiding_en: whether ciphertext hiding is enabled
188208 * @rsvd1: reserved
189209 * @guest_count: the number of guest currently managed by the firmware
190210 * @current_tcb_version: current TCB version
......@@ -200,7 +220,11 @@ struct sev_user_data_snp_status {
200220 __u32 mask_chip_id:1; /* Out */
201221 __u32 mask_chip_key:1; /* Out */
202222 __u32 vlek_en:1; /* Out */
203 __u32 rsvd1:29;
223 __u32 feature_info:1; /* Out */
224 __u32 rapl_dis:1; /* Out */
225 __u32 ciphertext_hiding_cap:1; /* Out */
226 __u32 ciphertext_hiding_en:1; /* Out */
227 __u32 rsvd1:25;
204228 __u32 guest_count; /* Out */
205229 __u64 current_tcb_version; /* Out */
206230 __u64 reported_tcb_version; /* Out */
lib/libc/include/any-linux-any/linux/psp-sfs.h created+87
......@@ -0,0 +1,87 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Userspace interface for AMD Seamless Firmware Servicing (SFS)
4 *
5 * Copyright (C) 2025 Advanced Micro Devices, Inc.
6 *
7 * Author: Ashish Kalra <ashish.kalra@amd.com>
8 */
9
10#ifndef __PSP_SFS_USER_H__
11#define __PSP_SFS_USER_H__
12
13#include <linux/types.h>
14
15/**
16 * SFS: AMD Seamless Firmware Support (SFS) interface
17 */
18
19#define PAYLOAD_NAME_SIZE 64
20#define TEE_EXT_CMD_BUFFER_SIZE 4096
21
22/**
23 * struct sfs_user_get_fw_versions - get current level of base firmware (output).
24 * @blob: current level of base firmware for ASP and patch levels (input/output).
25 * @sfs_status: 32-bit SFS status value (output).
26 * @sfs_extended_status: 32-bit SFS extended status value (output).
27 */
28struct sfs_user_get_fw_versions {
29 __u8 blob[TEE_EXT_CMD_BUFFER_SIZE];
30 __u32 sfs_status;
31 __u32 sfs_extended_status;
32} __attribute__((packed));
33
34/**
35 * struct sfs_user_update_package - update SFS package (input).
36 * @payload_name: name of SFS package to load, verify and execute (input).
37 * @sfs_status: 32-bit SFS status value (output).
38 * @sfs_extended_status: 32-bit SFS extended status value (output).
39 */
40struct sfs_user_update_package {
41 char payload_name[PAYLOAD_NAME_SIZE];
42 __u32 sfs_status;
43 __u32 sfs_extended_status;
44} __attribute__((packed));
45
46/**
47 * Seamless Firmware Support (SFS) IOC
48 *
49 * possible return codes for all SFS IOCTLs:
50 * 0: success
51 * -EINVAL: invalid input
52 * -E2BIG: excess data passed
53 * -EFAULT: failed to copy to/from userspace
54 * -EBUSY: mailbox in recovery or in use
55 * -ENODEV: driver not bound with PSP device
56 * -EACCES: request isn't authorized
57 * -EINVAL: invalid parameter
58 * -ETIMEDOUT: request timed out
59 * -EAGAIN: invalid request for state machine
60 * -ENOENT: not implemented
61 * -ENFILE: overflow
62 * -EPERM: invalid signature
63 * -EIO: PSP I/O error
64 */
65#define SFS_IOC_TYPE 'S'
66
67/**
68 * SFSIOCFWVERS - returns blob containing FW versions
69 * ASP provides the current level of Base Firmware for the ASP
70 * and the other microprocessors as well as current patch
71 * level(s).
72 */
73#define SFSIOCFWVERS _IOWR(SFS_IOC_TYPE, 0x1, struct sfs_user_get_fw_versions)
74
75/**
76 * SFSIOCUPDATEPKG - updates package/payload
77 * ASP loads, verifies and executes the SFS package.
78 * By default, the SFS package/payload is loaded from
79 * /lib/firmware/amd, but alternative firmware loading
80 * path can be specified using kernel parameter
81 * firmware_class.path or the firmware loading path
82 * can be customized using sysfs file:
83 * /sys/module/firmware_class/parameters/path.
84 */
85#define SFSIOCUPDATEPKG _IOWR(SFS_IOC_TYPE, 0x2, struct sfs_user_update_package)
86
87#endif /* __PSP_SFS_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psp.h created+85
......@@ -0,0 +1,85 @@
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/psp.yaml */
4/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
6
7#ifndef _LINUX_PSP_H
8#define _LINUX_PSP_H
9
10#define PSP_FAMILY_NAME "psp"
11#define PSP_FAMILY_VERSION 1
12
13enum psp_version {
14 PSP_VERSION_HDR0_AES_GCM_128,
15 PSP_VERSION_HDR0_AES_GCM_256,
16 PSP_VERSION_HDR0_AES_GMAC_128,
17 PSP_VERSION_HDR0_AES_GMAC_256,
18};
19
20enum {
21 PSP_A_DEV_ID = 1,
22 PSP_A_DEV_IFINDEX,
23 PSP_A_DEV_PSP_VERSIONS_CAP,
24 PSP_A_DEV_PSP_VERSIONS_ENA,
25
26 __PSP_A_DEV_MAX,
27 PSP_A_DEV_MAX = (__PSP_A_DEV_MAX - 1)
28};
29
30enum {
31 PSP_A_ASSOC_DEV_ID = 1,
32 PSP_A_ASSOC_VERSION,
33 PSP_A_ASSOC_RX_KEY,
34 PSP_A_ASSOC_TX_KEY,
35 PSP_A_ASSOC_SOCK_FD,
36
37 __PSP_A_ASSOC_MAX,
38 PSP_A_ASSOC_MAX = (__PSP_A_ASSOC_MAX - 1)
39};
40
41enum {
42 PSP_A_KEYS_KEY = 1,
43 PSP_A_KEYS_SPI,
44
45 __PSP_A_KEYS_MAX,
46 PSP_A_KEYS_MAX = (__PSP_A_KEYS_MAX - 1)
47};
48
49enum {
50 PSP_A_STATS_DEV_ID = 1,
51 PSP_A_STATS_KEY_ROTATIONS,
52 PSP_A_STATS_STALE_EVENTS,
53 PSP_A_STATS_RX_PACKETS,
54 PSP_A_STATS_RX_BYTES,
55 PSP_A_STATS_RX_AUTH_FAIL,
56 PSP_A_STATS_RX_ERROR,
57 PSP_A_STATS_RX_BAD,
58 PSP_A_STATS_TX_PACKETS,
59 PSP_A_STATS_TX_BYTES,
60 PSP_A_STATS_TX_ERROR,
61
62 __PSP_A_STATS_MAX,
63 PSP_A_STATS_MAX = (__PSP_A_STATS_MAX - 1)
64};
65
66enum {
67 PSP_CMD_DEV_GET = 1,
68 PSP_CMD_DEV_ADD_NTF,
69 PSP_CMD_DEV_DEL_NTF,
70 PSP_CMD_DEV_SET,
71 PSP_CMD_DEV_CHANGE_NTF,
72 PSP_CMD_KEY_ROTATE,
73 PSP_CMD_KEY_ROTATE_NTF,
74 PSP_CMD_RX_ASSOC,
75 PSP_CMD_TX_ASSOC,
76 PSP_CMD_GET_STATS,
77
78 __PSP_CMD_MAX,
79 PSP_CMD_MAX = (__PSP_CMD_MAX - 1)
80};
81
82#define PSP_MCGRP_MGMT "mgmt"
83#define PSP_MCGRP_USE "use"
84
85#endif /* _LINUX_PSP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ptp_clock.h+4
......@@ -248,6 +248,10 @@ struct ptp_pin_desc {
248248 _IOWR(PTP_CLK_MAGIC, 18, struct ptp_sys_offset_extended)
249249#define PTP_MASK_CLEAR_ALL _IO(PTP_CLK_MAGIC, 19)
250250#define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)
251#define PTP_SYS_OFFSET_PRECISE_CYCLES \
252 _IOWR(PTP_CLK_MAGIC, 21, struct ptp_sys_offset_precise)
253#define PTP_SYS_OFFSET_EXTENDED_CYCLES \
254 _IOWR(PTP_CLK_MAGIC, 22, struct ptp_sys_offset_extended)
251255
252256struct ptp_extts_event {
253257 struct ptp_clock_time t; /* Time event occurred. */
lib/libc/include/any-linux-any/linux/raid/md_p.h+2-1
......@@ -291,7 +291,8 @@ struct mdp_superblock_1 {
291291 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
292292 __le32 sb_csum; /* checksum up to devs[max_dev] */
293293 __le32 max_dev; /* size of devs[] array to consider */
294 __u8 pad3[64-32]; /* set to 0 when writing */
294 __le32 logical_block_size; /* same as q->limits->logical_block_size */
295 __u8 pad3[64-36]; /* set to 0 when writing */
295296
296297 /* device state information. Indexed by dev_number.
297298 * 2 bytes per device
lib/libc/include/any-linux-any/linux/rkisp1-config.h+15-83
......@@ -9,6 +9,8 @@
99
1010#include <linux/types.h>
1111
12#include <linux/media/v4l2-isp.h>
13
1214/* Defect Pixel Cluster Detection */
1315#define RKISP1_CIF_ISP_MODULE_DPCC (1U << 0)
1416/* Black Level Subtraction */
......@@ -1158,79 +1160,26 @@ enum rkisp1_ext_params_block_type {
11581160 RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR,
11591161};
11601162
1161#define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE (1U << 0)
1162#define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE (1U << 1)
1163/* For backward compatibility */
1164#define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE V4L2_ISP_PARAMS_FL_BLOCK_DISABLE
1165#define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE V4L2_ISP_PARAMS_FL_BLOCK_ENABLE
11631166
11641167/* A bitmask of parameters blocks supported on the current hardware. */
11651168#define RKISP1_CID_SUPPORTED_PARAMS_BLOCKS (V4L2_CID_USER_RKISP1_BASE + 0x01)
11661169
11671170/**
1168 * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block
1169 * header
1171 * rkisp1_ext_params_block_header - RkISP1 extensible parameters block header
11701172 *
11711173 * This structure represents the common part of all the ISP configuration
1172 * blocks. Each parameters block shall embed an instance of this structure type
1173 * as its first member, followed by the block-specific configuration data. The
1174 * driver inspects this common header to discern the block type and its size and
1175 * properly handle the block content by casting it to the correct block-specific
1176 * type.
1174 * blocks and is identical to :c:type:`v4l2_isp_params_block_header`.
11771175 *
1178 * The @type field is one of the values enumerated by
1176 * The type field is one of the values enumerated by
11791177 * :c:type:`rkisp1_ext_params_block_type` and specifies how the data should be
1180 * interpreted by the driver. The @size field specifies the size of the
1181 * parameters block and is used by the driver for validation purposes.
1182 *
1183 * The @flags field is a bitmask of per-block flags RKISP1_EXT_PARAMS_FL_*.
1184 *
1185 * When userspace wants to configure and enable an ISP block it shall fully
1186 * populate the block configuration and set the
1187 * RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE bit in the @flags field.
1188 *
1189 * When userspace simply wants to disable an ISP block the
1190 * RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bit should be set in @flags field. The
1191 * driver ignores the rest of the block configuration structure in this case.
1192 *
1193 * If a new configuration of an ISP block has to be applied userspace shall
1194 * fully populate the ISP block configuration and omit setting the
1195 * RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE and RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bits
1196 * in the @flags field.
1197 *
1198 * Setting both the RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE and
1199 * RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE bits in the @flags field is not allowed
1200 * and not accepted by the driver.
1201 *
1202 * Userspace is responsible for correctly populating the parameters block header
1203 * fields (@type, @flags and @size) and the block-specific parameters.
1204 *
1205 * For example:
1178 * interpreted by the driver.
12061179 *
1207 * .. code-block:: c
1208 *
1209 * void populate_bls(struct rkisp1_ext_params_block_header *block) {
1210 * struct rkisp1_ext_params_bls_config *bls =
1211 * (struct rkisp1_ext_params_bls_config *)block;
1212 *
1213 * bls->header.type = RKISP1_EXT_PARAMS_BLOCK_ID_BLS;
1214 * bls->header.flags = RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE;
1215 * bls->header.size = sizeof(*bls);
1216 *
1217 * bls->config.enable_auto = 0;
1218 * bls->config.fixed_val.r = blackLevelRed_;
1219 * bls->config.fixed_val.gr = blackLevelGreenR_;
1220 * bls->config.fixed_val.gb = blackLevelGreenB_;
1221 * bls->config.fixed_val.b = blackLevelBlue_;
1222 * }
1223 *
1224 * @type: The parameters block type, see
1225 * :c:type:`rkisp1_ext_params_block_type`
1226 * @flags: A bitmask of block flags
1227 * @size: Size (in bytes) of the parameters block, including this header
1180 * The flags field is a bitmask of per-block flags RKISP1_EXT_PARAMS_FL_*.
12281181 */
1229struct rkisp1_ext_params_block_header {
1230 __u16 type;
1231 __u16 flags;
1232 __u32 size;
1233};
1182#define rkisp1_ext_params_block_header v4l2_isp_params_block_header
12341183
12351184/**
12361185 * struct rkisp1_ext_params_bls_config - RkISP1 extensible params BLS config
......@@ -1588,27 +1537,14 @@ struct rkisp1_ext_params_wdr_config {
15881537 * @RKISP1_EXT_PARAM_BUFFER_V1: First version of RkISP1 extensible parameters
15891538 */
15901539enum rksip1_ext_param_buffer_version {
1591 RKISP1_EXT_PARAM_BUFFER_V1 = 1,
1540 RKISP1_EXT_PARAM_BUFFER_V1 = V4L2_ISP_PARAMS_VERSION_V1,
15921541};
15931542
15941543/**
15951544 * struct rkisp1_ext_params_cfg - RkISP1 extensible parameters configuration
15961545 *
1597 * This struct contains the configuration parameters of the RkISP1 ISP
1598 * algorithms, serialized by userspace into a data buffer. Each configuration
1599 * parameter block is represented by a block-specific structure which contains a
1600 * :c:type:`rkisp1_ext_params_block_header` entry as first member. Userspace
1601 * populates the @data buffer with configuration parameters for the blocks that
1602 * it intends to configure. As a consequence, the data buffer effective size
1603 * changes according to the number of ISP blocks that userspace intends to
1604 * configure and is set by userspace in the @data_size field.
1605 *
1606 * The parameters buffer is versioned by the @version field to allow modifying
1607 * and extending its definition. Userspace shall populate the @version field to
1608 * inform the driver about the version it intends to use. The driver will parse
1609 * and handle the @data buffer according to the data layout specific to the
1610 * indicated version and return an error if the desired version is not
1611 * supported.
1546 * This is the driver-specific implementation of
1547 * :c:type:`v4l2_isp_params_buffer`.
16121548 *
16131549 * Currently the single RKISP1_EXT_PARAM_BUFFER_V1 version is supported.
16141550 * When a new format version will be added, a mechanism for userspace to query
......@@ -1624,11 +1560,6 @@ enum rksip1_ext_param_buffer_version {
16241560 * the maximum value represents the blocks supported by the kernel driver,
16251561 * independently of the device instance.
16261562 *
1627 * For each ISP block that userspace wants to configure, a block-specific
1628 * structure is appended to the @data buffer, one after the other without gaps
1629 * in between nor overlaps. Userspace shall populate the @data_size field with
1630 * the effective size, in bytes, of the @data buffer.
1631 *
16321563 * The expected memory layout of the parameters buffer is::
16331564 *
16341565 * +-------------------- struct rkisp1_ext_params_cfg -------------------+
......@@ -1678,4 +1609,5 @@ struct rkisp1_ext_params_cfg {
16781609 __u8 data[RKISP1_EXT_PARAMS_MAX_SIZE];
16791610};
16801611
1612
16811613#endif /* _RKISP1_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rseq.h+7-14
......@@ -114,20 +114,13 @@ struct rseq {
114114 /*
115115 * Restartable sequences flags field.
116116 *
117 * This field should only be updated by the thread which
118 * registered this data structure. Read by the kernel.
119 * Mainly used for single-stepping through rseq critical sections
120 * with debuggers.
121 *
122 * - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
123 * Inhibit instruction sequence block restart on preemption
124 * for this thread.
125 * - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
126 * Inhibit instruction sequence block restart on signal
127 * delivery for this thread.
128 * - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
129 * Inhibit instruction sequence block restart on migration for
130 * this thread.
117 * This field was initially intended to allow event masking for
118 * single-stepping through rseq critical sections with debuggers.
119 * The kernel does not support this anymore and the relevant bits
120 * are checked for being always false:
121 * - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
122 * - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
123 * - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
131124 */
132125 __u32 flags;
133126
lib/libc/include/any-linux-any/linux/stddef.h-1
......@@ -3,7 +3,6 @@
33#define _LINUX_STDDEF_H
44
55
6
76#ifndef __always_inline
87#define __always_inline __inline__
98#endif
lib/libc/include/any-linux-any/linux/tcp.h+9
......@@ -316,6 +316,15 @@ struct tcp_info {
316316 * in milliseconds, including any
317317 * unfinished recovery.
318318 */
319 __u32 tcpi_received_ce; /* # of CE marks received */
320 __u32 tcpi_delivered_e1_bytes; /* Accurate ECN byte counters */
321 __u32 tcpi_delivered_e0_bytes;
322 __u32 tcpi_delivered_ce_bytes;
323 __u32 tcpi_received_e1_bytes;
324 __u32 tcpi_received_e0_bytes;
325 __u32 tcpi_received_ce_bytes;
326 __u16 tcpi_accecn_fail_mode;
327 __u16 tcpi_accecn_opt_seen;
319328};
320329
321330/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
lib/libc/include/any-linux-any/linux/tee.h+92-16
......@@ -42,14 +42,16 @@
4242#define TEE_IOC_MAGIC 0xa4
4343#define TEE_IOC_BASE 0
4444
45#define TEE_MAX_ARG_SIZE 1024
45#define TEE_MAX_ARG_SIZE 4096
4646
4747#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
4848#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
4949#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
5050#define TEE_GEN_CAP_MEMREF_NULL (1 << 3)/* NULL MemRef support */
51#define TEE_GEN_CAP_OBJREF (1 << 4)/* Supports generic object reference */
5152
52#define TEE_MEMREF_NULL (__u64)(-1) /* NULL MemRef Buffer */
53#define TEE_MEMREF_NULL ((__u64)(-1)) /* NULL MemRef Buffer */
54#define TEE_OBJREF_NULL ((__u64)(-1)) /* NULL ObjRef Object */
5355
5456/*
5557 * TEE Implementation ID
......@@ -57,6 +59,7 @@
5759#define TEE_IMPL_ID_OPTEE 1
5860#define TEE_IMPL_ID_AMDTEE 2
5961#define TEE_IMPL_ID_TSTEE 3
62#define TEE_IMPL_ID_QTEE 4
6063
6164/*
6265 * OP-TEE specific capabilities
......@@ -151,6 +154,20 @@ struct tee_ioctl_buf_data {
151154#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT 6
152155#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7 /* input and output */
153156
157/*
158 * These defines userspace buffer parameters.
159 */
160#define TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_INPUT 8
161#define TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_OUTPUT 9
162#define TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_INOUT 10 /* input and output */
163
164/*
165 * These defines object reference parameters.
166 */
167#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT 11
168#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_OUTPUT 12
169#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT 13
170
154171/*
155172 * Mask for the type part of the attribute, leaves room for more types
156173 */
......@@ -186,14 +203,18 @@ struct tee_ioctl_buf_data {
186203/**
187204 * struct tee_ioctl_param - parameter
188205 * @attr: attributes
189 * @a: if a memref, offset into the shared memory object, else a value parameter
190 * @b: if a memref, size of the buffer, else a value parameter
206 * @a: if a memref, offset into the shared memory object,
207 * else if a ubuf, address of the user buffer,
208 * else if an objref, object identifier, else a value parameter
209 * @b: if a memref or ubuf, size of the buffer,
210 * else if objref, flags for the object, else a value parameter
191211 * @c: if a memref, shared memory identifier, else a value parameter
192212 *
193 * @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref or value is used in
194 * the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value and
195 * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref. TEE_PARAM_ATTR_TYPE_NONE
196 * indicates that none of the members are used.
213 * @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref, ubuf, or value is
214 * used in the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value,
215 * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref, TEE_PARAM_ATTR_TYPE_UBUF_*
216 * indicates ubuf, and TEE_PARAM_ATTR_TYPE_OBJREF_* indicates objref.
217 * TEE_PARAM_ATTR_TYPE_NONE indicates that none of the members are used.
197218 *
198219 * Shared memory is allocated with TEE_IOC_SHM_ALLOC which returns an
199220 * identifier representing the shared memory object. A memref can reference
......@@ -228,8 +249,9 @@ struct tee_ioctl_param {
228249 * @cancel_id: [in] Cancellation id, a unique value to identify this request
229250 * @session: [out] Session id
230251 * @ret: [out] return value
231 * @ret_origin [out] origin of the return value
232 * @num_params [in] number of parameters following this struct
252 * @ret_origin: [out] origin of the return value
253 * @num_params: [in] number of &struct tee_ioctl_param entries in @params
254 * @params: array of ioctl parameters
233255 */
234256struct tee_ioctl_open_session_arg {
235257 __u8 uuid[TEE_IOCTL_UUID_LEN];
......@@ -255,14 +277,14 @@ struct tee_ioctl_open_session_arg {
255277 struct tee_ioctl_buf_data)
256278
257279/**
258 * struct tee_ioctl_invoke_func_arg - Invokes a function in a Trusted
259 * Application
280 * struct tee_ioctl_invoke_arg - Invokes a function in a Trusted Application
260281 * @func: [in] Trusted Application function, specific to the TA
261282 * @session: [in] Session id
262283 * @cancel_id: [in] Cancellation id, a unique value to identify this request
263284 * @ret: [out] return value
264 * @ret_origin [out] origin of the return value
265 * @num_params [in] number of parameters following this struct
285 * @ret_origin: [out] origin of the return value
286 * @num_params: [in] number of parameters following this struct
287 * @params: array of ioctl parameters
266288 */
267289struct tee_ioctl_invoke_arg {
268290 __u32 func;
......@@ -317,7 +339,8 @@ struct tee_ioctl_close_session_arg {
317339/**
318340 * struct tee_iocl_supp_recv_arg - Receive a request for a supplicant function
319341 * @func: [in] supplicant function
320 * @num_params [in/out] number of parameters following this struct
342 * @num_params: [in/out] number of &struct tee_ioctl_param entries in @params
343 * @params: array of ioctl parameters
321344 *
322345 * @num_params is the number of params that tee-supplicant has room to
323346 * receive when input, @num_params is the number of actual params
......@@ -342,7 +365,8 @@ struct tee_iocl_supp_recv_arg {
342365/**
343366 * struct tee_iocl_supp_send_arg - Send a response to a received request
344367 * @ret: [out] return value
345 * @num_params [in] number of parameters following this struct
368 * @num_params: [in] number of &struct tee_ioctl_param entries in @params
369 * @params: array of ioctl parameters
346370 */
347371struct tee_iocl_supp_send_arg {
348372 __u32 ret;
......@@ -378,6 +402,37 @@ struct tee_ioctl_shm_register_data {
378402 __s32 id;
379403};
380404
405/**
406 * struct tee_ioctl_shm_register_fd_data - Shared memory registering argument
407 * @fd: [in] File descriptor identifying dmabuf reference
408 * @size: [out] Size of referenced memory
409 * @flags: [in] Flags to/from allocation.
410 * @id: [out] Identifier of the shared memory
411 *
412 * The flags field should currently be zero as input. Updated by the call
413 * with actual flags as defined by TEE_IOCTL_SHM_* above.
414 * This structure is used as argument for TEE_IOC_SHM_REGISTER_FD below.
415 */
416struct tee_ioctl_shm_register_fd_data {
417 __s64 fd;
418 __u64 size;
419 __u32 flags;
420 __s32 id;
421};
422
423/**
424 * TEE_IOC_SHM_REGISTER_FD - register a shared memory from a file descriptor
425 *
426 * Returns a file descriptor on success or < 0 on failure
427 *
428 * The returned file descriptor refers to the shared memory object in the
429 * kernel. The supplied file deccriptor can be closed if it's not needed
430 * for other purposes. The shared memory is freed when the descriptor is
431 * closed.
432 */
433#define TEE_IOC_SHM_REGISTER_FD _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \
434 struct tee_ioctl_shm_register_fd_data)
435
381436/**
382437 * TEE_IOC_SHM_REGISTER - Register shared memory argument
383438 *
......@@ -401,4 +456,25 @@ struct tee_ioctl_shm_register_data {
401456 * munmap(): unmaps previously shared memory
402457 */
403458
459/**
460 * struct tee_ioctl_object_invoke_arg - Invokes an object in a
461 * Trusted Application
462 * @id: [in] Object id
463 * @op: [in] Object operation, specific to the object
464 * @ret: [out] return value
465 * @num_params: [in] number of parameters following this struct
466 * @params: array of ioctl parameters
467 */
468struct tee_ioctl_object_invoke_arg {
469 __u64 id;
470 __u32 op;
471 __u32 ret;
472 __u32 num_params;
473 /* num_params tells the actual number of element in params */
474 struct tee_ioctl_param params[];
475};
476
477#define TEE_IOC_OBJECT_INVOKE _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 10, \
478 struct tee_ioctl_buf_data)
479
404480#endif /*__TEE_H*/
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tls.h+2
......@@ -41,6 +41,7 @@
4141#define TLS_RX 2 /* Set receive parameters */
4242#define TLS_TX_ZEROCOPY_RO 3 /* TX zerocopy (only sendfile now) */
4343#define TLS_RX_EXPECT_NO_PAD 4 /* Attempt opportunistic zero-copy */
44#define TLS_TX_MAX_PAYLOAD_LEN 5 /* Maximum plaintext size */
4445
4546/* Supported versions */
4647#define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)
......@@ -194,6 +195,7 @@ enum {
194195 TLS_INFO_RXCONF,
195196 TLS_INFO_ZC_RO_TX,
196197 TLS_INFO_RX_NO_PAD,
198 TLS_INFO_TX_MAX_PAYLOAD_LEN,
197199 __TLS_INFO_MAX,
198200};
199201#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
lib/libc/include/any-linux-any/linux/usb/cdc.h+8-4
......@@ -104,8 +104,10 @@ struct usb_cdc_union_desc {
104104 __u8 bDescriptorSubType;
105105
106106 __u8 bMasterInterface0;
107 __u8 bSlaveInterface0;
108 /* ... and there could be other slave interfaces */
107 union {
108 __u8 bSlaveInterface0;
109 __DECLARE_FLEX_ARRAY(__u8, bSlaveInterfaces);
110 };
109111} __attribute__ ((packed));
110112
111113/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
......@@ -115,8 +117,10 @@ struct usb_cdc_country_functional_desc {
115117 __u8 bDescriptorSubType;
116118
117119 __u8 iCountryCodeRelDate;
118 __le16 wCountyCode0;
119 /* ... and there can be a lot of country codes */
120 union {
121 __le16 wCountryCode0;
122 __DECLARE_FLEX_ARRAY(__le16, wCountryCodes);
123 };
120124} __attribute__ ((packed));
121125
122126/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
lib/libc/include/any-linux-any/linux/v4l2-controls.h+66-61
......@@ -226,6 +226,12 @@ enum v4l2_colorfx {
226226 */
227227#define V4L2_CID_USER_RKISP1_BASE (V4L2_CID_USER_BASE + 0x1220)
228228
229/*
230 * The base for the Arm Mali-C55 ISP driver controls.
231 * We reserve 16 controls for this driver
232 */
233#define V4L2_CID_USER_MALI_C55_BASE (V4L2_CID_USER_BASE + 0x1230)
234
229235/* MPEG-class control IDs */
230236/* The MPEG controls are applicable to all codec controls
231237 * and the 'MPEG' part of the define is historical */
......@@ -1189,7 +1195,7 @@ enum v4l2_flash_strobe_source {
11891195#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
11901196#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
11911197
1192#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
1198#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
11931199enum v4l2_jpeg_chroma_subsampling {
11941200 V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
11951201 V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
......@@ -1198,15 +1204,15 @@ enum v4l2_jpeg_chroma_subsampling {
11981204 V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
11991205 V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
12001206};
1201#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
1202#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
1207#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
1208#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
12031209
1204#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
1205#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
1206#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
1207#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
1208#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
1209#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
1210#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
1211#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
1212#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
1213#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
1214#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
1215#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
12101216
12111217
12121218/* Image source controls */
......@@ -1239,10 +1245,10 @@ enum v4l2_jpeg_chroma_subsampling {
12391245#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
12401246#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
12411247
1242#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
1243#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
1244#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
1245#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
1248#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
1249#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
1250#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
1251#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
12461252enum v4l2_dv_tx_mode {
12471253 V4L2_DV_TX_MODE_DVI_D = 0,
12481254 V4L2_DV_TX_MODE_HDMI = 1,
......@@ -1263,7 +1269,7 @@ enum v4l2_dv_it_content_type {
12631269 V4L2_DV_IT_CONTENT_TYPE_NO_ITC = 4,
12641270};
12651271
1266#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
1272#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
12671273#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
12681274#define V4L2_CID_DV_RX_IT_CONTENT_TYPE (V4L2_CID_DV_CLASS_BASE + 102)
12691275
......@@ -1533,15 +1539,6 @@ struct v4l2_ctrl_h264_pred_weights {
15331539 struct v4l2_h264_weight_factors weight_factors[2];
15341540};
15351541
1536#define V4L2_H264_SLICE_TYPE_P 0
1537#define V4L2_H264_SLICE_TYPE_B 1
1538#define V4L2_H264_SLICE_TYPE_I 2
1539#define V4L2_H264_SLICE_TYPE_SP 3
1540#define V4L2_H264_SLICE_TYPE_SI 4
1541
1542#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
1543#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
1544
15451542#define V4L2_H264_TOP_FIELD_REF 0x1
15461543#define V4L2_H264_BOTTOM_FIELD_REF 0x2
15471544#define V4L2_H264_FRAME_REF 0x3
......@@ -1562,8 +1559,17 @@ struct v4l2_h264_reference {
15621559 * Maximum DPB size, as specified by section 'A.3.1 Level limits
15631560 * common to the Baseline, Main, and Extended profiles'.
15641561 */
1565#define V4L2_H264_NUM_DPB_ENTRIES 16
1566#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
1562#define V4L2_H264_NUM_DPB_ENTRIES 16
1563#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
1564
1565#define V4L2_H264_SLICE_TYPE_P 0
1566#define V4L2_H264_SLICE_TYPE_B 1
1567#define V4L2_H264_SLICE_TYPE_I 2
1568#define V4L2_H264_SLICE_TYPE_SP 3
1569#define V4L2_H264_SLICE_TYPE_SI 4
1570
1571#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
1572#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
15671573
15681574#define V4L2_CID_STATELESS_H264_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 6)
15691575/**
......@@ -1703,7 +1709,6 @@ struct v4l2_ctrl_h264_decode_params {
17031709 __u32 flags;
17041710};
17051711
1706
17071712/* Stateless FWHT control, used by the vicodec driver */
17081713
17091714/* Current FWHT version */
......@@ -2545,44 +2550,10 @@ struct v4l2_ctrl_hevc_scaling_matrix {
25452550 __u8 scaling_list_dc_coef_32x32[2];
25462551};
25472552
2548#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
2549#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
2550
2551#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
2552
2553struct v4l2_ctrl_hdr10_cll_info {
2554 __u16 max_content_light_level;
2555 __u16 max_pic_average_light_level;
2556};
2557
2558#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1)
2559
2560#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
2561#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
2562#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
2563#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
2564#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
2565#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
2566#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
2567#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
2568#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
2569#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
2570#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
2571#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
2572
2573struct v4l2_ctrl_hdr10_mastering_display {
2574 __u16 display_primaries_x[3];
2575 __u16 display_primaries_y[3];
2576 __u16 white_point_x;
2577 __u16 white_point_y;
2578 __u32 max_display_mastering_luminance;
2579 __u32 min_display_mastering_luminance;
2580};
2581
25822553/* Stateless VP9 controls */
25832554
25842555#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
2585#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
2556#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
25862557
25872558/**
25882559 * struct v4l2_vp9_loop_filter - VP9 loop filter parameters
......@@ -3509,4 +3480,38 @@ struct v4l2_ctrl_av1_film_grain {
35093480#define V4L2_CID_MPEG_CX2341X_BASE V4L2_CID_CODEC_CX2341X_BASE
35103481#define V4L2_CID_MPEG_MFC51_BASE V4L2_CID_CODEC_MFC51_BASE
35113482
3483#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
3484#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
3485
3486#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
3487
3488struct v4l2_ctrl_hdr10_cll_info {
3489 __u16 max_content_light_level;
3490 __u16 max_pic_average_light_level;
3491};
3492
3493#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1)
3494
3495#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
3496#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
3497#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
3498#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
3499#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
3500#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
3501#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
3502#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
3503#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
3504#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
3505#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
3506#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
3507
3508struct v4l2_ctrl_hdr10_mastering_display {
3509 __u16 display_primaries_x[3];
3510 __u16 display_primaries_y[3];
3511 __u16 white_point_x;
3512 __u16 white_point_y;
3513 __u32 max_display_mastering_luminance;
3514 __u32 min_display_mastering_luminance;
3515};
3516
35123517#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/v4l2-dv-timings.h+1-1
......@@ -2,7 +2,7 @@
22/*
33 * V4L2 DV timings header.
44 *
5 * Copyright (C) 2012-2016 Hans Verkuil <hansverk@cisco.com>
5 * Copyright (C) 2012-2016 Hans Verkuil <hverkuil@kernel.org>
66 */
77
88#ifndef _V4L2_DV_TIMINGS_H
lib/libc/include/any-linux-any/linux/version.h+2-2
......@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 397568
1#define LINUX_VERSION_CODE 398080
22#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
33#define LINUX_VERSION_MAJOR 6
4#define LINUX_VERSION_PATCHLEVEL 17
4#define LINUX_VERSION_PATCHLEVEL 19
55#define LINUX_VERSION_SUBLEVEL 0
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+28
......@@ -14,6 +14,7 @@
1414
1515#include <linux/types.h>
1616#include <linux/ioctl.h>
17#include <linux/stddef.h>
1718
1819#define VFIO_API_VERSION 0
1920
......@@ -1478,6 +1479,33 @@ struct vfio_device_feature_bus_master {
14781479};
14791480#define VFIO_DEVICE_FEATURE_BUS_MASTER 10
14801481
1482/**
1483 * Upon VFIO_DEVICE_FEATURE_GET create a dma_buf fd for the
1484 * regions selected.
1485 *
1486 * open_flags are the typical flags passed to open(2), eg O_RDWR, O_CLOEXEC,
1487 * etc. offset/length specify a slice of the region to create the dmabuf from.
1488 * nr_ranges is the total number of (P2P DMA) ranges that comprise the dmabuf.
1489 *
1490 * flags should be 0.
1491 *
1492 * Return: The fd number on success, -1 and errno is set on failure.
1493 */
1494#define VFIO_DEVICE_FEATURE_DMA_BUF 11
1495
1496struct vfio_region_dma_range {
1497 __u64 offset;
1498 __u64 length;
1499};
1500
1501struct vfio_device_feature_dma_buf {
1502 __u32 region_index;
1503 __u32 open_flags;
1504 __u32 flags;
1505 __u32 nr_ranges;
1506 struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);
1507};
1508
14811509/* -------- API for Type1 VFIO IOMMU -------- */
14821510
14831511/**
lib/libc/include/any-linux-any/linux/videodev2.h+14-10
......@@ -51,7 +51,7 @@
5151 *
5252 * Author: Bill Dirks <bill@thedirks.org>
5353 * Justin Schoeman
54 * Hans Verkuil <hverkuil@xs4all.nl>
54 * Hans Verkuil <hverkuil@kernel.org>
5555 * et al.
5656 */
5757#ifndef __LINUX_VIDEODEV2_H
......@@ -857,6 +857,10 @@ struct v4l2_pix_format {
857857#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C') /* PiSP FE configuration */
858858#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S') /* PiSP FE stats */
859859
860/* Vendor specific - used for Arm Mali-C55 ISP */
861#define V4L2_META_FMT_MALI_C55_PARAMS v4l2_fourcc('C', '5', '5', 'P') /* ARM Mali-C55 Parameters */
862#define V4L2_META_FMT_MALI_C55_STATS v4l2_fourcc('C', '5', '5', 'S') /* ARM Mali-C55 3A Statistics */
863
860864
861865/* priv field value to indicates that subsequent fields are valid. */
862866#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
......@@ -1542,8 +1546,8 @@ struct v4l2_bt_timings {
15421546} __attribute__ ((packed));
15431547
15441548/* Interlaced or progressive format */
1545#define V4L2_DV_PROGRESSIVE 0
1546#define V4L2_DV_INTERLACED 1
1549#define V4L2_DV_PROGRESSIVE 0
1550#define V4L2_DV_INTERLACED 1
15471551
15481552/* Polarities. If bit is not set, it is assumed to be negative polarity */
15491553#define V4L2_DV_VSYNC_POS_POL 0x00000001
......@@ -2715,15 +2719,15 @@ struct v4l2_remove_buffers {
27152719 * Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
27162720 * You must be root to use these ioctls. Never use these in applications!
27172721 */
2718#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
2719#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
2722#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
2723#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
27202724
27212725#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
2722#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
2723#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
2724#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
2725#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
2726#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
2726#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
2727#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
2728#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
2729#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
2730#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
27272731#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
27282732#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
27292733#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
lib/libc/include/any-linux-any/linux/virtio_ids.h+1
......@@ -68,6 +68,7 @@
6868#define VIRTIO_ID_AUDIO_POLICY 39 /* virtio audio policy */
6969#define VIRTIO_ID_BT 40 /* virtio bluetooth */
7070#define VIRTIO_ID_GPIO 41 /* virtio gpio */
71#define VIRTIO_ID_SPI 45 /* virtio spi */
7172
7273/*
7374 * Virtio Transitional IDs
lib/libc/include/any-linux-any/linux/virtio_net.h+2-1
......@@ -193,7 +193,8 @@ struct virtio_net_hdr_v1 {
193193
194194struct virtio_net_hdr_v1_hash {
195195 struct virtio_net_hdr_v1 hdr;
196 __le32 hash_value;
196 __le16 hash_value_lo;
197 __le16 hash_value_hi;
197198#define VIRTIO_NET_HASH_REPORT_NONE 0
198199#define VIRTIO_NET_HASH_REPORT_IPv4 1
199200#define VIRTIO_NET_HASH_REPORT_TCPv4 2
lib/libc/include/any-linux-any/linux/virtio_pci.h+1-1
......@@ -40,7 +40,7 @@
4040#define _LINUX_VIRTIO_PCI_H
4141
4242#include <linux/types.h>
43#include <linux/kernel.h>
43#include <linux/const.h>
4444
4545#ifndef VIRTIO_PCI_NO_LEGACY
4646
lib/libc/include/any-linux-any/linux/virtio_spi.h created+181
......@@ -0,0 +1,181 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright (C) 2023 OpenSynergy GmbH
4 * Copyright (C) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
5 */
6#ifndef _LINUX_VIRTIO_VIRTIO_SPI_H
7#define _LINUX_VIRTIO_VIRTIO_SPI_H
8
9#include <linux/types.h>
10#include <linux/virtio_config.h>
11#include <linux/virtio_ids.h>
12#include <linux/virtio_types.h>
13
14/* Sample data on trailing clock edge */
15#define VIRTIO_SPI_CPHA _BITUL(0)
16/* Clock is high when IDLE */
17#define VIRTIO_SPI_CPOL _BITUL(1)
18/* Chip Select is active high */
19#define VIRTIO_SPI_CS_HIGH _BITUL(2)
20/* Transmit LSB first */
21#define VIRTIO_SPI_MODE_LSB_FIRST _BITUL(3)
22/* Loopback mode */
23#define VIRTIO_SPI_MODE_LOOP _BITUL(4)
24
25/**
26 * struct virtio_spi_config - All config fields are read-only for the
27 * Virtio SPI driver
28 * @cs_max_number: maximum number of chipselect the host SPI controller
29 * supports.
30 * @cs_change_supported: indicates if the host SPI controller supports to toggle
31 * chipselect after each transfer in one message:
32 * 0: unsupported, chipselect will be kept in active state throughout the
33 * message transaction;
34 * 1: supported.
35 * Note: Message here contains a sequence of SPI transfers.
36 * @tx_nbits_supported: indicates the supported number of bit for writing:
37 * bit 0: DUAL (2-bit transfer), 1 for supported
38 * bit 1: QUAD (4-bit transfer), 1 for supported
39 * bit 2: OCTAL (8-bit transfer), 1 for supported
40 * other bits are reserved as 0, 1-bit transfer is always supported.
41 * @rx_nbits_supported: indicates the supported number of bit for reading:
42 * bit 0: DUAL (2-bit transfer), 1 for supported
43 * bit 1: QUAD (4-bit transfer), 1 for supported
44 * bit 2: OCTAL (8-bit transfer), 1 for supported
45 * other bits are reserved as 0, 1-bit transfer is always supported.
46 * @bits_per_word_mask: mask indicating which values of bits_per_word are
47 * supported. If not set, no limitation for bits_per_word.
48 * @mode_func_supported: indicates the following features are supported or not:
49 * bit 0-1: CPHA feature
50 * 0b00: invalid, should support as least one CPHA setting
51 * 0b01: supports CPHA=0 only
52 * 0b10: supports CPHA=1 only
53 * 0b11: supports CPHA=0 and CPHA=1.
54 * bit 2-3: CPOL feature
55 * 0b00: invalid, should support as least one CPOL setting
56 * 0b01: supports CPOL=0 only
57 * 0b10: supports CPOL=1 only
58 * 0b11: supports CPOL=0 and CPOL=1.
59 * bit 4: chipselect active high feature, 0 for unsupported and 1 for
60 * supported, chipselect active low is supported by default.
61 * bit 5: LSB first feature, 0 for unsupported and 1 for supported,
62 * MSB first is supported by default.
63 * bit 6: loopback mode feature, 0 for unsupported and 1 for supported,
64 * normal mode is supported by default.
65 * @max_freq_hz: the maximum clock rate supported in Hz unit, 0 means no
66 * limitation for transfer speed.
67 * @max_word_delay_ns: the maximum word delay supported, in nanoseconds.
68 * A value of 0 indicates that word delay is unsupported.
69 * Each transfer may consist of a sequence of words.
70 * @max_cs_setup_ns: the maximum delay supported after chipselect is asserted,
71 * in ns unit, 0 means delay is not supported to introduce after chipselect is
72 * asserted.
73 * @max_cs_hold_ns: the maximum delay supported before chipselect is deasserted,
74 * in ns unit, 0 means delay is not supported to introduce before chipselect
75 * is deasserted.
76 * @max_cs_incative_ns: maximum delay supported after chipselect is deasserted,
77 * in ns unit, 0 means delay is not supported to introduce after chipselect is
78 * deasserted.
79 */
80struct virtio_spi_config {
81 __u8 cs_max_number;
82 __u8 cs_change_supported;
83#define VIRTIO_SPI_RX_TX_SUPPORT_DUAL _BITUL(0)
84#define VIRTIO_SPI_RX_TX_SUPPORT_QUAD _BITUL(1)
85#define VIRTIO_SPI_RX_TX_SUPPORT_OCTAL _BITUL(2)
86 __u8 tx_nbits_supported;
87 __u8 rx_nbits_supported;
88 __le32 bits_per_word_mask;
89#define VIRTIO_SPI_MF_SUPPORT_CPHA_0 _BITUL(0)
90#define VIRTIO_SPI_MF_SUPPORT_CPHA_1 _BITUL(1)
91#define VIRTIO_SPI_MF_SUPPORT_CPOL_0 _BITUL(2)
92#define VIRTIO_SPI_MF_SUPPORT_CPOL_1 _BITUL(3)
93#define VIRTIO_SPI_MF_SUPPORT_CS_HIGH _BITUL(4)
94#define VIRTIO_SPI_MF_SUPPORT_LSB_FIRST _BITUL(5)
95#define VIRTIO_SPI_MF_SUPPORT_LOOPBACK _BITUL(6)
96 __le32 mode_func_supported;
97 __le32 max_freq_hz;
98 __le32 max_word_delay_ns;
99 __le32 max_cs_setup_ns;
100 __le32 max_cs_hold_ns;
101 __le32 max_cs_inactive_ns;
102};
103
104/**
105 * struct spi_transfer_head - virtio SPI transfer descriptor
106 * @chip_select_id: chipselect index the SPI transfer used.
107 * @bits_per_word: the number of bits in each SPI transfer word.
108 * @cs_change: whether to deselect device after finishing this transfer
109 * before starting the next transfer, 0 means cs keep asserted and
110 * 1 means cs deasserted then asserted again.
111 * @tx_nbits: bus width for write transfer.
112 * 0,1: bus width is 1, also known as SINGLE
113 * 2 : bus width is 2, also known as DUAL
114 * 4 : bus width is 4, also known as QUAD
115 * 8 : bus width is 8, also known as OCTAL
116 * other values are invalid.
117 * @rx_nbits: bus width for read transfer.
118 * 0,1: bus width is 1, also known as SINGLE
119 * 2 : bus width is 2, also known as DUAL
120 * 4 : bus width is 4, also known as QUAD
121 * 8 : bus width is 8, also known as OCTAL
122 * other values are invalid.
123 * @reserved: for future use.
124 * @mode: SPI transfer mode.
125 * bit 0: CPHA, determines the timing (i.e. phase) of the data
126 * bits relative to the clock pulses.For CPHA=0, the
127 * "out" side changes the data on the trailing edge of the
128 * preceding clock cycle, while the "in" side captures the data
129 * on (or shortly after) the leading edge of the clock cycle.
130 * For CPHA=1, the "out" side changes the data on the leading
131 * edge of the current clock cycle, while the "in" side
132 * captures the data on (or shortly after) the trailing edge of
133 * the clock cycle.
134 * bit 1: CPOL, determines the polarity of the clock. CPOL=0 is a
135 * clock which idles at 0, and each cycle consists of a pulse
136 * of 1. CPOL=1 is a clock which idles at 1, and each cycle
137 * consists of a pulse of 0.
138 * bit 2: CS_HIGH, if 1, chip select active high, else active low.
139 * bit 3: LSB_FIRST, determines per-word bits-on-wire, if 0, MSB
140 * first, else LSB first.
141 * bit 4: LOOP, loopback mode.
142 * @freq: the transfer speed in Hz.
143 * @word_delay_ns: delay to be inserted between consecutive words of a
144 * transfer, in ns unit.
145 * @cs_setup_ns: delay to be introduced after CS is asserted, in ns
146 * unit.
147 * @cs_delay_hold_ns: delay to be introduced before CS is deasserted
148 * for each transfer, in ns unit.
149 * @cs_change_delay_inactive_ns: delay to be introduced after CS is
150 * deasserted and before next asserted, in ns unit.
151 */
152struct spi_transfer_head {
153 __u8 chip_select_id;
154 __u8 bits_per_word;
155 __u8 cs_change;
156 __u8 tx_nbits;
157 __u8 rx_nbits;
158 __u8 reserved[3];
159 __le32 mode;
160 __le32 freq;
161 __le32 word_delay_ns;
162 __le32 cs_setup_ns;
163 __le32 cs_delay_hold_ns;
164 __le32 cs_change_delay_inactive_ns;
165};
166
167/**
168 * struct spi_transfer_result - virtio SPI transfer result
169 * @result: Transfer result code.
170 * VIRTIO_SPI_TRANS_OK: Transfer successful.
171 * VIRTIO_SPI_PARAM_ERR: Parameter error.
172 * VIRTIO_SPI_TRANS_ERR: Transfer error.
173 */
174struct spi_transfer_result {
175#define VIRTIO_SPI_TRANS_OK 0
176#define VIRTIO_SPI_PARAM_ERR 1
177#define VIRTIO_SPI_TRANS_ERR 2
178 __u8 result;
179};
180
181#endif /* #ifndef _LINUX_VIRTIO_VIRTIO_SPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vmcore.h+9
......@@ -15,4 +15,13 @@ struct vmcoredd_header {
1515 __u8 dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Device dump's name */
1616};
1717
18enum hwerr_error_type {
19 HWERR_RECOV_CPU,
20 HWERR_RECOV_MEMORY,
21 HWERR_RECOV_PCI,
22 HWERR_RECOV_CXL,
23 HWERR_RECOV_OTHERS,
24 HWERR_RECOV_MAX,
25};
26
1827#endif /* _VMCORE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wireguard.h+33-158
......@@ -1,156 +1,31 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/*
3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 *
5 * Documentation
6 * =============
7 *
8 * The below enums and macros are for interfacing with WireGuard, using generic
9 * netlink, with family WG_GENL_NAME and version WG_GENL_VERSION. It defines two
10 * methods: get and set. Note that while they share many common attributes,
11 * these two functions actually accept a slightly different set of inputs and
12 * outputs.
13 *
14 * WG_CMD_GET_DEVICE
15 * -----------------
16 *
17 * May only be called via NLM_F_REQUEST | NLM_F_DUMP. The command should contain
18 * one but not both of:
19 *
20 * WGDEVICE_A_IFINDEX: NLA_U32
21 * WGDEVICE_A_IFNAME: NLA_NUL_STRING, maxlen IFNAMSIZ - 1
22 *
23 * The kernel will then return several messages (NLM_F_MULTI) containing the
24 * following tree of nested items:
25 *
26 * WGDEVICE_A_IFINDEX: NLA_U32
27 * WGDEVICE_A_IFNAME: NLA_NUL_STRING, maxlen IFNAMSIZ - 1
28 * WGDEVICE_A_PRIVATE_KEY: NLA_EXACT_LEN, len WG_KEY_LEN
29 * WGDEVICE_A_PUBLIC_KEY: NLA_EXACT_LEN, len WG_KEY_LEN
30 * WGDEVICE_A_LISTEN_PORT: NLA_U16
31 * WGDEVICE_A_FWMARK: NLA_U32
32 * WGDEVICE_A_PEERS: NLA_NESTED
33 * 0: NLA_NESTED
34 * WGPEER_A_PUBLIC_KEY: NLA_EXACT_LEN, len WG_KEY_LEN
35 * WGPEER_A_PRESHARED_KEY: NLA_EXACT_LEN, len WG_KEY_LEN
36 * WGPEER_A_ENDPOINT: NLA_MIN_LEN(struct sockaddr), struct sockaddr_in or struct sockaddr_in6
37 * WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL: NLA_U16
38 * WGPEER_A_LAST_HANDSHAKE_TIME: NLA_EXACT_LEN, struct __kernel_timespec
39 * WGPEER_A_RX_BYTES: NLA_U64
40 * WGPEER_A_TX_BYTES: NLA_U64
41 * WGPEER_A_ALLOWEDIPS: NLA_NESTED
42 * 0: NLA_NESTED
43 * WGALLOWEDIP_A_FAMILY: NLA_U16
44 * WGALLOWEDIP_A_IPADDR: NLA_MIN_LEN(struct in_addr), struct in_addr or struct in6_addr
45 * WGALLOWEDIP_A_CIDR_MASK: NLA_U8
46 * 0: NLA_NESTED
47 * ...
48 * 0: NLA_NESTED
49 * ...
50 * ...
51 * WGPEER_A_PROTOCOL_VERSION: NLA_U32
52 * 0: NLA_NESTED
53 * ...
54 * ...
55 *
56 * It is possible that all of the allowed IPs of a single peer will not
57 * fit within a single netlink message. In that case, the same peer will
58 * be written in the following message, except it will only contain
59 * WGPEER_A_PUBLIC_KEY and WGPEER_A_ALLOWEDIPS. This may occur several
60 * times in a row for the same peer. It is then up to the receiver to
61 * coalesce adjacent peers. Likewise, it is possible that all peers will
62 * not fit within a single message. So, subsequent peers will be sent
63 * in following messages, except those will only contain WGDEVICE_A_IFNAME
64 * and WGDEVICE_A_PEERS. It is then up to the receiver to coalesce these
65 * messages to form the complete list of peers.
66 *
67 * Since this is an NLA_F_DUMP command, the final message will always be
68 * NLMSG_DONE, even if an error occurs. However, this NLMSG_DONE message
69 * contains an integer error code. It is either zero or a negative error
70 * code corresponding to the errno.
71 *
72 * WG_CMD_SET_DEVICE
73 * -----------------
74 *
75 * May only be called via NLM_F_REQUEST. The command should contain the
76 * following tree of nested items, containing one but not both of
77 * WGDEVICE_A_IFINDEX and WGDEVICE_A_IFNAME:
78 *
79 * WGDEVICE_A_IFINDEX: NLA_U32
80 * WGDEVICE_A_IFNAME: NLA_NUL_STRING, maxlen IFNAMSIZ - 1
81 * WGDEVICE_A_FLAGS: NLA_U32, 0 or WGDEVICE_F_REPLACE_PEERS if all current
82 * peers should be removed prior to adding the list below.
83 * WGDEVICE_A_PRIVATE_KEY: len WG_KEY_LEN, all zeros to remove
84 * WGDEVICE_A_LISTEN_PORT: NLA_U16, 0 to choose randomly
85 * WGDEVICE_A_FWMARK: NLA_U32, 0 to disable
86 * WGDEVICE_A_PEERS: NLA_NESTED
87 * 0: NLA_NESTED
88 * WGPEER_A_PUBLIC_KEY: len WG_KEY_LEN
89 * WGPEER_A_FLAGS: NLA_U32, 0 and/or WGPEER_F_REMOVE_ME if the
90 * specified peer should not exist at the end of the
91 * operation, rather than added/updated and/or
92 * WGPEER_F_REPLACE_ALLOWEDIPS if all current allowed
93 * IPs of this peer should be removed prior to adding
94 * the list below and/or WGPEER_F_UPDATE_ONLY if the
95 * peer should only be set if it already exists.
96 * WGPEER_A_PRESHARED_KEY: len WG_KEY_LEN, all zeros to remove
97 * WGPEER_A_ENDPOINT: struct sockaddr_in or struct sockaddr_in6
98 * WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL: NLA_U16, 0 to disable
99 * WGPEER_A_ALLOWEDIPS: NLA_NESTED
100 * 0: NLA_NESTED
101 * WGALLOWEDIP_A_FAMILY: NLA_U16
102 * WGALLOWEDIP_A_IPADDR: struct in_addr or struct in6_addr
103 * WGALLOWEDIP_A_CIDR_MASK: NLA_U8
104 * WGALLOWEDIP_A_FLAGS: NLA_U32, WGALLOWEDIP_F_REMOVE_ME if
105 * the specified IP should be removed;
106 * otherwise, this IP will be added if
107 * it is not already present.
108 * 0: NLA_NESTED
109 * ...
110 * 0: NLA_NESTED
111 * ...
112 * ...
113 * WGPEER_A_PROTOCOL_VERSION: NLA_U32, should not be set or used at
114 * all by most users of this API, as the
115 * most recent protocol will be used when
116 * this is unset. Otherwise, must be set
117 * to 1.
118 * 0: NLA_NESTED
119 * ...
120 * ...
121 *
122 * It is possible that the amount of configuration data exceeds that of
123 * the maximum message length accepted by the kernel. In that case, several
124 * messages should be sent one after another, with each successive one
125 * filling in information not contained in the prior. Note that if
126 * WGDEVICE_F_REPLACE_PEERS is specified in the first message, it probably
127 * should not be specified in fragments that come after, so that the list
128 * of peers is only cleared the first time but appended after. Likewise for
129 * peers, if WGPEER_F_REPLACE_ALLOWEDIPS is specified in the first message
130 * of a peer, it likely should not be specified in subsequent fragments.
131 *
132 * If an error occurs, NLMSG_ERROR will reply containing an errno.
133 */
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/wireguard.yaml */
4/* YNL-GEN uapi header */
5/* To regenerate run: tools/net/ynl/ynl-regen.sh */
1346
135#ifndef _WG_UAPI_WIREGUARD_H
136#define _WG_UAPI_WIREGUARD_H
7#ifndef _LINUX_WIREGUARD_H
8#define _LINUX_WIREGUARD_H
1379
138#define WG_GENL_NAME "wireguard"
139#define WG_GENL_VERSION 1
10#define WG_GENL_NAME "wireguard"
11#define WG_GENL_VERSION 1
14012
141#define WG_KEY_LEN 32
13#define WG_KEY_LEN 32
14214
143enum wg_cmd {
144 WG_CMD_GET_DEVICE,
145 WG_CMD_SET_DEVICE,
146 __WG_CMD_MAX
15enum wgdevice_flag {
16 WGDEVICE_F_REPLACE_PEERS = 1,
14717};
148#define WG_CMD_MAX (__WG_CMD_MAX - 1)
14918
150enum wgdevice_flag {
151 WGDEVICE_F_REPLACE_PEERS = 1U << 0,
152 __WGDEVICE_F_ALL = WGDEVICE_F_REPLACE_PEERS
19enum wgpeer_flag {
20 WGPEER_F_REMOVE_ME = 1,
21 WGPEER_F_REPLACE_ALLOWEDIPS = 2,
22 WGPEER_F_UPDATE_ONLY = 4,
23};
24
25enum wgallowedip_flag {
26 WGALLOWEDIP_F_REMOVE_ME = 1,
15327};
28
15429enum wgdevice_attribute {
15530 WGDEVICE_A_UNSPEC,
15631 WGDEVICE_A_IFINDEX,
......@@ -161,17 +36,11 @@ enum wgdevice_attribute {
16136 WGDEVICE_A_LISTEN_PORT,
16237 WGDEVICE_A_FWMARK,
16338 WGDEVICE_A_PEERS,
39
16440 __WGDEVICE_A_LAST
16541};
16642#define WGDEVICE_A_MAX (__WGDEVICE_A_LAST - 1)
16743
168enum wgpeer_flag {
169 WGPEER_F_REMOVE_ME = 1U << 0,
170 WGPEER_F_REPLACE_ALLOWEDIPS = 1U << 1,
171 WGPEER_F_UPDATE_ONLY = 1U << 2,
172 __WGPEER_F_ALL = WGPEER_F_REMOVE_ME | WGPEER_F_REPLACE_ALLOWEDIPS |
173 WGPEER_F_UPDATE_ONLY
174};
17544enum wgpeer_attribute {
17645 WGPEER_A_UNSPEC,
17746 WGPEER_A_PUBLIC_KEY,
......@@ -184,22 +53,28 @@ enum wgpeer_attribute {
18453 WGPEER_A_TX_BYTES,
18554 WGPEER_A_ALLOWEDIPS,
18655 WGPEER_A_PROTOCOL_VERSION,
56
18757 __WGPEER_A_LAST
18858};
18959#define WGPEER_A_MAX (__WGPEER_A_LAST - 1)
19060
191enum wgallowedip_flag {
192 WGALLOWEDIP_F_REMOVE_ME = 1U << 0,
193 __WGALLOWEDIP_F_ALL = WGALLOWEDIP_F_REMOVE_ME
194};
19561enum wgallowedip_attribute {
19662 WGALLOWEDIP_A_UNSPEC,
19763 WGALLOWEDIP_A_FAMILY,
19864 WGALLOWEDIP_A_IPADDR,
19965 WGALLOWEDIP_A_CIDR_MASK,
20066 WGALLOWEDIP_A_FLAGS,
67
20168 __WGALLOWEDIP_A_LAST
20269};
20370#define WGALLOWEDIP_A_MAX (__WGALLOWEDIP_A_LAST - 1)
20471
205#endif /* _WG_UAPI_WIREGUARD_H */
\ No newline at end of file
72enum wg_cmd {
73 WG_CMD_GET_DEVICE,
74 WG_CMD_SET_DEVICE,
75
76 __WG_CMD_MAX
77};
78#define WG_CMD_MAX (__WG_CMD_MAX - 1)
79
80#endif /* _LINUX_WIREGUARD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/fastrpc.h+1-1
......@@ -134,7 +134,7 @@ struct fastrpc_mem_unmap {
134134};
135135
136136struct fastrpc_ioctl_capability {
137 __u32 domain;
137 __u32 unused; /* deprecated, ignored by the kernel */
138138 __u32 attribute_id;
139139 __u32 capability; /* dsp capability */
140140 __u32 reserved[4];
lib/libc/include/any-linux-any/misc/uacce/hisi_qm.h+1
......@@ -31,6 +31,7 @@ struct hisi_qp_info {
3131#define HISI_QM_API_VER_BASE "hisi_qm_v1"
3232#define HISI_QM_API_VER2_BASE "hisi_qm_v2"
3333#define HISI_QM_API_VER3_BASE "hisi_qm_v3"
34#define HISI_QM_API_VER5_BASE "hisi_qm_v5"
3435
3536/* UACCE_CMD_QM_SET_QP_CTX: Set qp algorithm type */
3637#define UACCE_CMD_QM_SET_QP_CTX _IOWR('H', 10, struct hisi_qp_ctx)
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_verbs.h+1
......@@ -255,6 +255,7 @@ enum rdma_driver_id {
255255 RDMA_DRIVER_SIW,
256256 RDMA_DRIVER_ERDMA,
257257 RDMA_DRIVER_MANA,
258 RDMA_DRIVER_IONIC,
258259};
259260
260261enum ib_uverbs_gid_type {
lib/libc/include/any-linux-any/rdma/ib_user_sa.h+14
......@@ -74,4 +74,18 @@ struct ib_user_path_rec {
7474 __u8 preference;
7575};
7676
77struct ib_user_service_rec {
78 __be64 id;
79 __u8 gid[16];
80 __be16 pkey;
81 __u8 reserved[2];
82 __be32 lease;
83 __u8 key[16];
84 __u8 name[64];
85 __u8 data_8[16];
86 __be16 data_16[8];
87 __be32 data_32[4];
88 __be64 data_64[2];
89};
90
7791#endif /* IB_USER_SA_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ionic-abi.h created+115
......@@ -0,0 +1,115 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (C) 2018-2025, Advanced Micro Devices, Inc */
3
4#ifndef IONIC_ABI_H
5#define IONIC_ABI_H
6
7#include <linux/types.h>
8
9#define IONIC_ABI_VERSION 1
10
11#define IONIC_EXPDB_64 1
12#define IONIC_EXPDB_128 2
13#define IONIC_EXPDB_256 4
14#define IONIC_EXPDB_512 8
15
16#define IONIC_EXPDB_SQ 1
17#define IONIC_EXPDB_RQ 2
18
19#define IONIC_CMB_ENABLE 1
20#define IONIC_CMB_REQUIRE 2
21#define IONIC_CMB_EXPDB 4
22#define IONIC_CMB_WC 8
23#define IONIC_CMB_UC 16
24
25struct ionic_ctx_req {
26 __u32 rsvd[2];
27};
28
29struct ionic_ctx_resp {
30 __u32 rsvd;
31 __u32 page_shift;
32
33 __aligned_u64 dbell_offset;
34
35 __u16 version;
36 __u8 qp_opcodes;
37 __u8 admin_opcodes;
38
39 __u8 sq_qtype;
40 __u8 rq_qtype;
41 __u8 cq_qtype;
42 __u8 admin_qtype;
43
44 __u8 max_stride;
45 __u8 max_spec;
46 __u8 udma_count;
47 __u8 expdb_mask;
48 __u8 expdb_qtypes;
49
50 __u8 rsvd2[3];
51};
52
53struct ionic_qdesc {
54 __aligned_u64 addr;
55 __u32 size;
56 __u16 mask;
57 __u8 depth_log2;
58 __u8 stride_log2;
59};
60
61struct ionic_ah_resp {
62 __u32 ahid;
63 __u32 pad;
64};
65
66struct ionic_cq_req {
67 struct ionic_qdesc cq[2];
68 __u8 udma_mask;
69 __u8 rsvd[7];
70};
71
72struct ionic_cq_resp {
73 __u32 cqid[2];
74 __u8 udma_mask;
75 __u8 rsvd[7];
76};
77
78struct ionic_qp_req {
79 struct ionic_qdesc sq;
80 struct ionic_qdesc rq;
81 __u8 sq_spec;
82 __u8 rq_spec;
83 __u8 sq_cmb;
84 __u8 rq_cmb;
85 __u8 udma_mask;
86 __u8 rsvd[3];
87};
88
89struct ionic_qp_resp {
90 __u32 qpid;
91 __u8 sq_cmb;
92 __u8 rq_cmb;
93 __u8 udma_idx;
94 __u8 rsvd[1];
95 __aligned_u64 sq_cmb_offset;
96 __aligned_u64 rq_cmb_offset;
97};
98
99struct ionic_srq_req {
100 struct ionic_qdesc rq;
101 __u8 rq_spec;
102 __u8 rq_cmb;
103 __u8 udma_mask;
104 __u8 rsvd[5];
105};
106
107struct ionic_srq_resp {
108 __u32 qpid;
109 __u8 rq_cmb;
110 __u8 udma_idx;
111 __u8 rsvd[2];
112 __aligned_u64 rq_cmb_offset;
113};
114
115#endif /* IONIC_ABI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/irdma-abi.h+15-1
......@@ -20,11 +20,14 @@ enum irdma_memreg_type {
2020 IRDMA_MEMREG_TYPE_MEM = 0,
2121 IRDMA_MEMREG_TYPE_QP = 1,
2222 IRDMA_MEMREG_TYPE_CQ = 2,
23 IRDMA_MEMREG_TYPE_SRQ = 3,
2324};
2425
2526enum {
2627 IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0,
2728 IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1,
29 IRDMA_ALLOC_UCTX_MAX_HW_SRQ_QUANTA = 1 << 2,
30 IRDMA_SUPPORT_WQE_FORMAT_V2 = 1 << 3,
2831};
2932
3033struct irdma_alloc_ucontext_req {
......@@ -54,7 +57,8 @@ struct irdma_alloc_ucontext_resp {
5457 __u8 rsvd2;
5558 __aligned_u64 comp_mask;
5659 __u16 min_hw_wq_size;
57 __u8 rsvd3[6];
60 __u8 revd3[2];
61 __u32 max_hw_srq_quanta;
5862};
5963
6064struct irdma_alloc_pd_resp {
......@@ -71,6 +75,16 @@ struct irdma_create_cq_req {
7175 __aligned_u64 user_shadow_area;
7276};
7377
78struct irdma_create_srq_req {
79 __aligned_u64 user_srq_buf;
80 __aligned_u64 user_shadow_area;
81};
82
83struct irdma_create_srq_resp {
84 __u32 srq_id;
85 __u32 srq_size;
86};
87
7488struct irdma_create_qp_req {
7589 __aligned_u64 user_wqe_bufs;
7690 __aligned_u64 user_compl_ctx;
lib/libc/include/any-linux-any/rdma/rdma_user_cm.h+42-2
......@@ -67,7 +67,9 @@ enum {
6767 RDMA_USER_CM_CMD_QUERY,
6868 RDMA_USER_CM_CMD_BIND,
6969 RDMA_USER_CM_CMD_RESOLVE_ADDR,
70 RDMA_USER_CM_CMD_JOIN_MCAST
70 RDMA_USER_CM_CMD_JOIN_MCAST,
71 RDMA_USER_CM_CMD_RESOLVE_IB_SERVICE,
72 RDMA_USER_CM_CMD_WRITE_CM_EVENT,
7173};
7274
7375/* See IBTA Annex A11, servies ID bytes 4 & 5 */
......@@ -147,7 +149,8 @@ struct rdma_ucm_resolve_route {
147149enum {
148150 RDMA_USER_CM_QUERY_ADDR,
149151 RDMA_USER_CM_QUERY_PATH,
150 RDMA_USER_CM_QUERY_GID
152 RDMA_USER_CM_QUERY_GID,
153 RDMA_USER_CM_QUERY_IB_SERVICE
151154};
152155
153156struct rdma_ucm_query {
......@@ -187,6 +190,12 @@ struct rdma_ucm_query_path_resp {
187190 struct ib_path_rec_data path_data[];
188191};
189192
193struct rdma_ucm_query_ib_service_resp {
194 __u32 num_service_recs;
195 __u32 reserved;
196 struct ib_user_service_rec recs[];
197};
198
190199struct rdma_ucm_conn_param {
191200 __u32 qp_num;
192201 __u32 qkey;
......@@ -297,6 +306,7 @@ struct rdma_ucm_event_resp {
297306 union {
298307 struct rdma_ucm_conn_param conn;
299308 struct rdma_ucm_ud_param ud;
309 __u32 arg32[2];
300310 } param;
301311 __u32 reserved;
302312 struct rdma_ucm_ece ece;
......@@ -338,4 +348,34 @@ struct rdma_ucm_migrate_resp {
338348 __u32 events_reported;
339349};
340350
351enum {
352 RDMA_USER_CM_IB_SERVICE_FLAG_ID = 1 << 0,
353 RDMA_USER_CM_IB_SERVICE_FLAG_NAME = 1 << 1,
354};
355
356#define RDMA_USER_CM_IB_SERVICE_NAME_SIZE 64
357struct rdma_ucm_ib_service {
358 __aligned_u64 service_id;
359 __u8 service_name[RDMA_USER_CM_IB_SERVICE_NAME_SIZE];
360 __u32 flags;
361 __u32 reserved;
362};
363
364struct rdma_ucm_resolve_ib_service {
365 __u32 id;
366 __u32 reserved;
367 struct rdma_ucm_ib_service ibs;
368};
369
370struct rdma_ucm_write_cm_event {
371 __u32 id;
372 __u32 reserved;
373 __u32 event;
374 __u32 status;
375 union {
376 struct rdma_ucm_conn_param conn;
377 struct rdma_ucm_ud_param ud;
378 __u64 arg;
379 } param;
380};
341381#endif /* RDMA_USER_CM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/regulator/regulator.h+2-2
......@@ -8,7 +8,7 @@
88#ifndef _REGULATOR_H
99#define _REGULATOR_H
1010
11#include <stdint.h>
11#include <linux/types.h>
1212
1313/*
1414 * Regulator notifier events.
......@@ -58,7 +58,7 @@
5858
5959struct reg_genl_event {
6060 char reg_name[32];
61 uint64_t event;
61 __u64 event;
6262};
6363
6464/* attributes of reg_genl_family */
lib/libc/include/any-linux-any/scsi/fc/fc_els.h+35-19
......@@ -11,6 +11,8 @@
1111#include <linux/types.h>
1212#include <asm/byteorder.h>
1313
14#include <stddef.h> /* for offsetof */
15
1416/*
1517 * Fibre Channel Switch - Enhanced Link Services definitions.
1618 * From T11 FC-LS Rev 1.2 June 7, 2005.
......@@ -1109,12 +1111,15 @@ struct fc_els_fpin {
11091111
11101112/* Diagnostic Function Descriptor - FPIN Registration */
11111113struct fc_df_desc_fpin_reg {
1112 __be32 desc_tag; /* FPIN Registration (0x00030001) */
1113 __be32 desc_len; /* Length of Descriptor (in bytes).
1114 * Size of descriptor excluding
1115 * desc_tag and desc_len fields.
1116 */
1117 __be32 count; /* Number of desc_tags elements */
1114 /* New members MUST be added within the __struct_group() macro below. */
1115 __struct_group(fc_df_desc_fpin_reg_hdr, __hdr, /* no attrs */,
1116 __be32 desc_tag; /* FPIN Registration (0x00030001) */
1117 __be32 desc_len; /* Length of Descriptor (in bytes).
1118 * Size of descriptor excluding
1119 * desc_tag and desc_len fields.
1120 */
1121 __be32 count; /* Number of desc_tags elements */
1122 );
11181123 __be32 desc_tags[]; /* Array of Descriptor Tags.
11191124 * Each tag indicates a function
11201125 * supported by the N_Port (request)
......@@ -1124,33 +1129,44 @@ struct fc_df_desc_fpin_reg {
11241129 * See ELS_FN_DTAG_xxx for tag values.
11251130 */
11261131};
1132_Static_assert(offsetof(struct fc_df_desc_fpin_reg, desc_tags) == sizeof(struct fc_df_desc_fpin_reg_hdr),
1133 "struct member likely outside of __struct_group()");
11271134
11281135/*
11291136 * ELS_RDF - Register Diagnostic Functions
11301137 */
11311138struct fc_els_rdf {
1132 __u8 fpin_cmd; /* command (0x19) */
1133 __u8 fpin_zero[3]; /* specified as zero - part of cmd */
1134 __be32 desc_len; /* Length of Descriptor List (in bytes).
1135 * Size of ELS excluding fpin_cmd,
1136 * fpin_zero and desc_len fields.
1137 */
1139 /* New members MUST be added within the __struct_group() macro below. */
1140 __struct_group(fc_els_rdf_hdr, __hdr, /* no attrs */,
1141 __u8 fpin_cmd; /* command (0x19) */
1142 __u8 fpin_zero[3]; /* specified as zero - part of cmd */
1143 __be32 desc_len; /* Length of Descriptor List (in bytes).
1144 * Size of ELS excluding fpin_cmd,
1145 * fpin_zero and desc_len fields.
1146 */
1147 );
11381148 struct fc_tlv_desc desc[]; /* Descriptor list */
11391149};
1150_Static_assert(offsetof(struct fc_els_rdf, desc) == sizeof(struct fc_els_rdf_hdr),
1151 "struct member likely outside of __struct_group()");
11401152
11411153/*
11421154 * ELS RDF LS_ACC Response.
11431155 */
11441156struct fc_els_rdf_resp {
1145 struct fc_els_ls_acc acc_hdr;
1146 __be32 desc_list_len; /* Length of response (in
1147 * bytes). Excludes acc_hdr
1148 * and desc_list_len fields.
1149 */
1150 struct fc_els_lsri_desc lsri;
1157 /* New members MUST be added within the __struct_group() macro below. */
1158 __struct_group(fc_els_rdf_resp_hdr, __hdr, /* no attrs */,
1159 struct fc_els_ls_acc acc_hdr;
1160 __be32 desc_list_len; /* Length of response (in
1161 * bytes). Excludes acc_hdr
1162 * and desc_list_len fields.
1163 */
1164 struct fc_els_lsri_desc lsri;
1165 );
11511166 struct fc_tlv_desc desc[]; /* Supported Descriptor list */
11521167};
1153
1168_Static_assert(offsetof(struct fc_els_rdf_resp, desc) == sizeof(struct fc_els_rdf_resp_hdr),
1169 "struct member likely outside of __struct_group()");
11541170
11551171/*
11561172 * Diagnostic Capability Descriptors for EDC ELS
lib/libc/include/any-linux-any/sound/asound.h+1-1
......@@ -58,7 +58,7 @@ struct snd_cea_861_aud_if {
5858 unsigned char db2_sf_ss; /* sample frequency and size */
5959 unsigned char db3; /* not used, all zeros */
6060 unsigned char db4_ca; /* channel allocation code */
61 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
61 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shift values */
6262};
6363
6464/****************************************************************************
lib/libc/include/any-linux-any/sound/compress_offload.h+33-2
......@@ -13,8 +13,7 @@
1313#include <sound/asound.h>
1414#include <sound/compress_params.h>
1515
16
17#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 3, 0)
16#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 4, 1)
1817/**
1918 * struct snd_compressed_buffer - compressed buffer
2019 * @fragment_size: size of buffer fragment in bytes
......@@ -56,6 +55,25 @@ struct snd_compr_tstamp {
5655 __u32 sampling_rate;
5756} __attribute__((packed, aligned(4)));
5857
58/**
59 * struct snd_compr_tstamp64 - timestamp descriptor with fields in 64 bit
60 * @byte_offset: Byte offset in ring buffer to DSP
61 * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
62 * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
63 * large steps and should only be used to monitor encoding/decoding
64 * progress. It shall not be used for timing estimates.
65 * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
66 * output/input. This field should be used for A/V sync or time estimates.
67 * @sampling_rate: sampling rate of audio
68 */
69struct snd_compr_tstamp64 {
70 __u32 byte_offset;
71 __u64 copied_total;
72 __u64 pcm_frames;
73 __u64 pcm_io_frames;
74 __u32 sampling_rate;
75} __attribute__((packed, aligned(4)));
76
5977/**
6078 * struct snd_compr_avail - avail descriptor
6179 * @avail: Number of bytes available in ring buffer for writing/reading
......@@ -66,6 +84,16 @@ struct snd_compr_avail {
6684 struct snd_compr_tstamp tstamp;
6785} __attribute__((packed, aligned(4)));
6886
87/**
88 * struct snd_compr_avail64 - avail descriptor with tstamp in 64 bit format
89 * @avail: Number of bytes available in ring buffer for writing/reading
90 * @tstamp: timestamp information
91 */
92struct snd_compr_avail64 {
93 __u64 avail;
94 struct snd_compr_tstamp64 tstamp;
95} __attribute__((packed, aligned(4)));
96
6997enum snd_compr_direction {
7098 SND_COMPRESS_PLAYBACK = 0,
7199 SND_COMPRESS_CAPTURE,
......@@ -189,6 +217,7 @@ struct snd_compr_task_status {
189217 * Note: only codec params can be changed runtime and stream params cant be
190218 * SNDRV_COMPRESS_GET_PARAMS: Query codec params
191219 * SNDRV_COMPRESS_TSTAMP: get the current timestamp value
220 * SNDRV_COMPRESS_TSTAMP64: get the current timestamp value in 64 bit format
192221 * SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
193222 * This also queries the tstamp properties
194223 * SNDRV_COMPRESS_PAUSE: Pause the running stream
......@@ -211,6 +240,8 @@ struct snd_compr_task_status {
211240 struct snd_compr_metadata)
212241#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
213242#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
243#define SNDRV_COMPRESS_TSTAMP64 _IOR('C', 0x22, struct snd_compr_tstamp64)
244#define SNDRV_COMPRESS_AVAIL64 _IOR('C', 0x23, struct snd_compr_avail64)
214245#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
215246#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
216247#define SNDRV_COMPRESS_START _IO('C', 0x32)
lib/libc/include/any-linux-any/sound/compress_params.h+40-1
......@@ -43,7 +43,8 @@
4343#define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
4444#define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F)
4545#define SND_AUDIOCODEC_APE ((__u32) 0x00000010)
46#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE
46#define SND_AUDIOCODEC_OPUS_RAW ((__u32) 0x00000011)
47#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_OPUS_RAW
4748
4849/*
4950 * Profile and modes are listed with bit masks. This allows for a
......@@ -324,6 +325,43 @@ struct snd_dec_ape {
324325 __u32 seek_table_present;
325326} __attribute__((packed, aligned(4)));
326327
328/**
329 * struct snd_dec_opus - Opus decoder parameters (raw opus packets)
330 * @version: Usually should be '1' but can be split into major (4 upper bits)
331 * and minor (4 lower bits) sub-fields.
332 * @num_channels: Number of output channels.
333 * @pre_skip: Number of samples to discard at 48 kHz.
334 * @sample_rate: Sample rate of original input.
335 * @output_gain: Gain to apply when decoding (in Q7.8 format).
336 * @mapping_family: Order and meaning of output channels. Only values 0 and 1
337 * are expected; values 2..255 are not recommended for playback.
338 *
339 * @chan_map: Optional channel mapping table. Describes mapping of opus streams
340 * to decoded channels. Fields:
341 * @chan_map.stream_count: Number of streams encoded in each Ogg packet.
342 * @chan_map.coupled_count: Number of streams whose decoders are used
343 * for two channels.
344 * @chan_map.channel_map: Which decoded channel to be used for each one.
345 * Supports only mapping families 0 and 1,
346 * max number of channels is 8.
347 *
348 * These options were extracted from RFC7845 Section 5.
349 */
350
351struct snd_dec_opus {
352 __u8 version;
353 __u8 num_channels;
354 __u16 pre_skip;
355 __u32 sample_rate;
356 __u16 output_gain;
357 __u8 mapping_family;
358 struct snd_dec_opus_ch_map {
359 __u8 stream_count;
360 __u8 coupled_count;
361 __u8 channel_map[8];
362 } chan_map;
363} __attribute__((packed, aligned(4)));
364
327365union snd_codec_options {
328366 struct snd_enc_wma wma;
329367 struct snd_enc_vorbis vorbis;
......@@ -334,6 +372,7 @@ union snd_codec_options {
334372 struct snd_dec_wma wma_d;
335373 struct snd_dec_alac alac_d;
336374 struct snd_dec_ape ape_d;
375 struct snd_dec_opus opus_d;
337376 struct {
338377 __u32 out_sample_rate;
339378 } src_d;
lib/libc/include/any-linux-any/sound/intel/avs/tokens.h+21
......@@ -21,6 +21,7 @@ enum avs_tplg_token {
2121 AVS_TKN_MANIFEST_NUM_BINDINGS_U32 = 8,
2222 AVS_TKN_MANIFEST_NUM_CONDPATH_TMPLS_U32 = 9,
2323 AVS_TKN_MANIFEST_NUM_INIT_CONFIGS_U32 = 10,
24 AVS_TKN_MANIFEST_NUM_NHLT_CONFIGS_U32 = 11,
2425
2526 /* struct avs_tplg_library */
2627 AVS_TKN_LIBRARY_ID_U32 = 101,
......@@ -124,6 +125,7 @@ enum avs_tplg_token {
124125 AVS_TKN_MOD_KCONTROL_ID_U32 = 1707,
125126 AVS_TKN_MOD_INIT_CONFIG_NUM_IDS_U32 = 1708,
126127 AVS_TKN_MOD_INIT_CONFIG_ID_U32 = 1709,
128 AVS_TKN_MOD_NHLT_CONFIG_ID_U32 = 1710,
127129
128130 /* struct avs_tplg_path_template */
129131 AVS_TKN_PATH_TMPL_ID_U32 = 1801,
......@@ -133,6 +135,21 @@ enum avs_tplg_token {
133135 AVS_TKN_PATH_FE_FMT_ID_U32 = 1902,
134136 AVS_TKN_PATH_BE_FMT_ID_U32 = 1903,
135137
138 /* struct avs_tplg_path_template (conditional) */
139 AVS_TKN_CONDPATH_TMPL_ID_U32 = 1801,
140 AVS_TKN_CONDPATH_TMPL_SOURCE_TPLG_NAME_STRING = 2002,
141 AVS_TKN_CONDPATH_TMPL_SOURCE_PATH_TMPL_ID_U32 = 2003,
142 AVS_TKN_CONDPATH_TMPL_SINK_TPLG_NAME_STRING = 2004,
143 AVS_TKN_CONDPATH_TMPL_SINK_PATH_TMPL_ID_U32 = 2005,
144 AVS_TKN_CONDPATH_TMPL_COND_TYPE_U32 = 2006,
145 AVS_TKN_CONDPATH_TMPL_OVERRIDABLE_BOOL = 2007,
146 AVS_TKN_CONDPATH_TMPL_PRIORITY_U8 = 2008,
147
148 /* struct avs_tplg_path (conditional) */
149 AVS_TKN_CONDPATH_ID_U32 = 1901,
150 AVS_TKN_CONDPATH_SOURCE_PATH_ID_U32 = 2102,
151 AVS_TKN_CONDPATH_SINK_PATH_ID_U32 = 2103,
152
136153 /* struct avs_tplg_pin_format */
137154 AVS_TKN_PIN_FMT_INDEX_U32 = 2201,
138155 AVS_TKN_PIN_FMT_IOBS_U32 = 2202,
......@@ -145,6 +162,10 @@ enum avs_tplg_token {
145162 AVS_TKN_INIT_CONFIG_ID_U32 = 2401,
146163 AVS_TKN_INIT_CONFIG_PARAM_U8 = 2402,
147164 AVS_TKN_INIT_CONFIG_LENGTH_U32 = 2403,
165
166 /* struct avs_tplg_nhlt_config */
167 AVS_TKN_NHLT_CONFIG_ID_U32 = 2501,
168 AVS_TKN_NHLT_CONFIG_SIZE_U32 = 2502,
148169};
149170
150171#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/snd_ar_tokens.h+18-2
......@@ -3,6 +3,8 @@
33#ifndef __SND_AR_TOKENS_H__
44#define __SND_AR_TOKENS_H__
55
6#include <linux/types.h>
7
68#define APM_SUB_GRAPH_PERF_MODE_LOW_POWER 0x1
79#define APM_SUB_GRAPH_PERF_MODE_LOW_LATENCY 0x2
810
......@@ -118,6 +120,12 @@ enum ar_event_types {
118120 * LPAIF_WSA = 2,
119121 * LPAIF_VA = 3,
120122 * LPAIF_AXI = 4
123 * Possible values for MI2S
124 * I2S_INTF_TYPE_PRIMARY = 0,
125 * I2S_INTF_TYPE_SECONDARY = 1,
126 * I2S_INTF_TYPE_TERTIARY = 2,
127 * I2S_INTF_TYPE_QUATERNARY = 3,
128 * I2S_INTF_TYPE_QUINARY = 4,
121129 *
122130 * %AR_TKN_U32_MODULE_FMT_INTERLEAVE: PCM Interleaving
123131 * PCM_INTERLEAVED = 1,
......@@ -184,8 +192,8 @@ enum ar_event_types {
184192#define AR_TKN_U32_MODULE_INSTANCE_ID 201
185193#define AR_TKN_U32_MODULE_MAX_IP_PORTS 202
186194#define AR_TKN_U32_MODULE_MAX_OP_PORTS 203
187#define AR_TKN_U32_MODULE_IN_PORTS 204
188#define AR_TKN_U32_MODULE_OUT_PORTS 205
195#define AR_TKN_U32_MODULE_IN_PORTS 204 /* deprecated */
196#define AR_TKN_U32_MODULE_OUT_PORTS 205 /* deprecated */
189197#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID 206
190198#define AR_TKN_U32_MODULE_DST_IN_PORT_ID 207
191199#define AR_TKN_U32_MODULE_SRC_INSTANCE_ID 208
......@@ -232,4 +240,12 @@ enum ar_event_types {
232240#define AR_TKN_U32_MODULE_LOG_TAP_POINT_ID 260
233241#define AR_TKN_U32_MODULE_LOG_MODE 261
234242
243#define SND_SOC_AR_TPLG_MODULE_CFG_TYPE 0x01001006
244struct audioreach_module_priv_data {
245 __le32 size; /* size in bytes of the array, including all elements */
246 __le32 type; /* SND_SOC_AR_TPLG_MODULE_CFG_TYPE */
247 __le32 priv[2]; /* Private data for future expansion */
248 __le32 data[0]; /* config data */
249};
250
235251#endif /* __SND_AR_TOKENS_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/tokens.h+2
......@@ -106,6 +106,8 @@
106106 */
107107#define SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME 417
108108
109#define SOF_TKN_COMP_SCHED_DOMAIN 418
110
109111/* SSP */
110112#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
111113#define SOF_TKN_INTEL_SSP_MCLK_ID 501
lib/libc/include/arc-linux-any/asm/unistd_32.h+1
......@@ -350,6 +350,7 @@
350350#define __NR_open_tree_attr 467
351351#define __NR_file_getattr 468
352352#define __NR_file_setattr 469
353#define __NR_listns 470
353354
354355
355356#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+1
......@@ -423,5 +423,6 @@
423423#define __NR_open_tree_attr (__NR_SYSCALL_BASE + 467)
424424#define __NR_file_getattr (__NR_SYSCALL_BASE + 468)
425425#define __NR_file_setattr (__NR_SYSCALL_BASE + 469)
426#define __NR_listns (__NR_SYSCALL_BASE + 470)
426427
427428#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h+1
......@@ -435,5 +435,6 @@
435435#define __NR_open_tree_attr (__NR_SYSCALL_BASE + 467)
436436#define __NR_file_getattr (__NR_SYSCALL_BASE + 468)
437437#define __NR_file_setattr (__NR_SYSCALL_BASE + 469)
438#define __NR_listns (__NR_SYSCALL_BASE + 470)
438439
439440#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/ptrace.h+2-2
......@@ -3,7 +3,7 @@
33#ifndef _CSKY_PTRACE_H
44#define _CSKY_PTRACE_H
55
6#ifndef __ASSEMBLY__
6#ifndef __ASSEMBLER__
77
88struct pt_regs {
99 unsigned long tls;
......@@ -47,5 +47,5 @@ struct user_fp {
4747 unsigned long reserved;
4848};
4949
50#endif /* __ASSEMBLY__ */
50#endif /* __ASSEMBLER__ */
5151#endif /* _CSKY_PTRACE_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd_32.h+1
......@@ -346,6 +346,7 @@
346346#define __NR_open_tree_attr 467
347347#define __NR_file_getattr 468
348348#define __NR_file_setattr 469
349#define __NR_listns 470
349350
350351
351352#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd_32.h+1
......@@ -345,6 +345,7 @@
345345#define __NR_open_tree_attr 467
346346#define __NR_file_getattr 468
347347#define __NR_file_setattr 469
348#define __NR_listns 470
348349
349350
350351#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/kvm.h+2
......@@ -103,6 +103,8 @@ struct kvm_fpu {
103103#define KVM_LOONGARCH_VM_FEAT_PMU 5
104104#define KVM_LOONGARCH_VM_FEAT_PV_IPI 6
105105#define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7
106#define KVM_LOONGARCH_VM_FEAT_PTW 8
107#define KVM_LOONGARCH_VM_FEAT_MSGINT 9
106108
107109/* Device Control API on vcpu fd */
108110#define KVM_LOONGARCH_VCPU_CPUCFG 0
lib/libc/include/loongarch-linux-any/asm/ptrace.h+28-20
......@@ -10,8 +10,6 @@
1010
1111#include <linux/types.h>
1212
13#include <stdint.h>
14
1513/*
1614 * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
1715 * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
......@@ -39,44 +37,54 @@ struct user_pt_regs {
3937} __attribute__((aligned(8)));
4038
4139struct user_fp_state {
42 uint64_t fpr[32];
43 uint64_t fcc;
44 uint32_t fcsr;
40 __u64 fpr[32];
41 __u64 fcc;
42 __u32 fcsr;
4543};
4644
4745struct user_lsx_state {
4846 /* 32 registers, 128 bits width per register. */
49 uint64_t vregs[32*2];
47 __u64 vregs[32*2];
5048};
5149
5250struct user_lasx_state {
5351 /* 32 registers, 256 bits width per register. */
54 uint64_t vregs[32*4];
52 __u64 vregs[32*4];
5553};
5654
5755struct user_lbt_state {
58 uint64_t scr[4];
59 uint32_t eflags;
60 uint32_t ftop;
56 __u64 scr[4];
57 __u32 eflags;
58 __u32 ftop;
6159};
6260
6361struct user_watch_state {
64 uint64_t dbg_info;
62 __u64 dbg_info;
6563 struct {
66 uint64_t addr;
67 uint64_t mask;
68 uint32_t ctrl;
69 uint32_t pad;
64#if __BITS_PER_LONG == 32
65 __u32 addr;
66 __u32 mask;
67#else
68 __u64 addr;
69 __u64 mask;
70#endif
71 __u32 ctrl;
72 __u32 pad;
7073 } dbg_regs[8];
7174};
7275
7376struct user_watch_state_v2 {
74 uint64_t dbg_info;
77 __u64 dbg_info;
7578 struct {
76 uint64_t addr;
77 uint64_t mask;
78 uint32_t ctrl;
79 uint32_t pad;
79#if __BITS_PER_LONG == 32
80 __u32 addr;
81 __u32 mask;
82#else
83 __u64 addr;
84 __u64 mask;
85#endif
86 __u32 ctrl;
87 __u32 pad;
8088 } dbg_regs[14];
8189};
8290
lib/libc/include/loongarch-linux-any/asm/unistd.h+7-1
......@@ -1,3 +1,9 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22
3#include <asm/unistd_64.h>
\ No newline at end of file
3#include <asm/bitsperlong.h>
4
5#if __BITS_PER_LONG == 32
6#include <asm/unistd_32.h>
7#else
8#include <asm/unistd_64.h>
9#endif
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/unistd_32.h created+320
......@@ -0,0 +1,320 @@
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_prlimit64 261
221#define __NR_fanotify_init 262
222#define __NR_fanotify_mark 263
223#define __NR_name_to_handle_at 264
224#define __NR_open_by_handle_at 265
225#define __NR_syncfs 267
226#define __NR_setns 268
227#define __NR_sendmmsg 269
228#define __NR_process_vm_readv 270
229#define __NR_process_vm_writev 271
230#define __NR_kcmp 272
231#define __NR_finit_module 273
232#define __NR_sched_setattr 274
233#define __NR_sched_getattr 275
234#define __NR_renameat2 276
235#define __NR_seccomp 277
236#define __NR_getrandom 278
237#define __NR_memfd_create 279
238#define __NR_bpf 280
239#define __NR_execveat 281
240#define __NR_userfaultfd 282
241#define __NR_membarrier 283
242#define __NR_mlock2 284
243#define __NR_copy_file_range 285
244#define __NR_preadv2 286
245#define __NR_pwritev2 287
246#define __NR_pkey_mprotect 288
247#define __NR_pkey_alloc 289
248#define __NR_pkey_free 290
249#define __NR_statx 291
250#define __NR_rseq 293
251#define __NR_kexec_file_load 294
252#define __NR_clock_gettime64 403
253#define __NR_clock_settime64 404
254#define __NR_clock_adjtime64 405
255#define __NR_clock_getres_time64 406
256#define __NR_clock_nanosleep_time64 407
257#define __NR_timer_gettime64 408
258#define __NR_timer_settime64 409
259#define __NR_timerfd_gettime64 410
260#define __NR_timerfd_settime64 411
261#define __NR_utimensat_time64 412
262#define __NR_pselect6_time64 413
263#define __NR_ppoll_time64 414
264#define __NR_io_pgetevents_time64 416
265#define __NR_recvmmsg_time64 417
266#define __NR_mq_timedsend_time64 418
267#define __NR_mq_timedreceive_time64 419
268#define __NR_semtimedop_time64 420
269#define __NR_rt_sigtimedwait_time64 421
270#define __NR_futex_time64 422
271#define __NR_sched_rr_get_interval_time64 423
272#define __NR_pidfd_send_signal 424
273#define __NR_io_uring_setup 425
274#define __NR_io_uring_enter 426
275#define __NR_io_uring_register 427
276#define __NR_open_tree 428
277#define __NR_move_mount 429
278#define __NR_fsopen 430
279#define __NR_fsconfig 431
280#define __NR_fsmount 432
281#define __NR_fspick 433
282#define __NR_pidfd_open 434
283#define __NR_clone3 435
284#define __NR_close_range 436
285#define __NR_openat2 437
286#define __NR_pidfd_getfd 438
287#define __NR_faccessat2 439
288#define __NR_process_madvise 440
289#define __NR_epoll_pwait2 441
290#define __NR_mount_setattr 442
291#define __NR_quotactl_fd 443
292#define __NR_landlock_create_ruleset 444
293#define __NR_landlock_add_rule 445
294#define __NR_landlock_restrict_self 446
295#define __NR_process_mrelease 448
296#define __NR_futex_waitv 449
297#define __NR_set_mempolicy_home_node 450
298#define __NR_cachestat 451
299#define __NR_fchmodat2 452
300#define __NR_map_shadow_stack 453
301#define __NR_futex_wake 454
302#define __NR_futex_wait 455
303#define __NR_futex_requeue 456
304#define __NR_statmount 457
305#define __NR_listmount 458
306#define __NR_lsm_get_self_attr 459
307#define __NR_lsm_set_self_attr 460
308#define __NR_lsm_list_modules 461
309#define __NR_mseal 462
310#define __NR_setxattrat 463
311#define __NR_getxattrat 464
312#define __NR_listxattrat 465
313#define __NR_removexattrat 466
314#define __NR_open_tree_attr 467
315#define __NR_file_getattr 468
316#define __NR_file_setattr 469
317#define __NR_listns 470
318
319
320#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/unistd_64.h+1
......@@ -322,6 +322,7 @@
322322#define __NR_open_tree_attr 467
323323#define __NR_file_getattr 468
324324#define __NR_file_setattr 469
325#define __NR_listns 470
325326
326327
327328#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd_32.h+1
......@@ -442,6 +442,7 @@
442442#define __NR_open_tree_attr 467
443443#define __NR_file_getattr 468
444444#define __NR_file_setattr 469
445#define __NR_listns 470
445446
446447
447448#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n32.h+1
......@@ -398,5 +398,6 @@
398398#define __NR_open_tree_attr (__NR_Linux + 467)
399399#define __NR_file_getattr (__NR_Linux + 468)
400400#define __NR_file_setattr (__NR_Linux + 469)
401#define __NR_listns (__NR_Linux + 470)
401402
402403#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h+1
......@@ -374,5 +374,6 @@
374374#define __NR_open_tree_attr (__NR_Linux + 467)
375375#define __NR_file_getattr (__NR_Linux + 468)
376376#define __NR_file_setattr (__NR_Linux + 469)
377#define __NR_listns (__NR_Linux + 470)
377378
378379#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h+1
......@@ -444,5 +444,6 @@
444444#define __NR_open_tree_attr (__NR_Linux + 467)
445445#define __NR_file_getattr (__NR_Linux + 468)
446446#define __NR_file_setattr (__NR_Linux + 469)
447#define __NR_listns (__NR_Linux + 470)
447448
448449#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/opal-prd.h+2-2
......@@ -40,7 +40,7 @@
4040#define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom)
4141#define OPAL_PRD_SCOM_WRITE _IOW('o', 0x03, struct opal_prd_scom)
4242
43#ifndef __ASSEMBLY__
43#ifndef __ASSEMBLER__
4444
4545struct opal_prd_info {
4646 __u64 version;
......@@ -54,6 +54,6 @@ struct opal_prd_scom {
5454 __s64 rc;
5555};
5656
57#endif /* __ASSEMBLY__ */
57#endif /* __ASSEMBLER__ */
5858
5959#endif /* _ASM_POWERPC_OPAL_PRD_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-hvpipe.h created+33
......@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_HVPIPE_H_
3#define _PAPR_HVPIPE_H_
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7#include <asm/papr-miscdev.h>
8
9/*
10 * This header is included in payload between OS and the user
11 * space.
12 * flags: OS notifies the user space whether the hvpipe is
13 * closed or the buffer has the payload.
14 */
15struct papr_hvpipe_hdr {
16 __u8 version;
17 __u8 reserved[3];
18 __u32 flags;
19 __u8 reserved2[40];
20};
21
22/*
23 * ioctl for /dev/papr-hvpipe
24 */
25#define PAPR_HVPIPE_IOC_CREATE_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 9, __u32)
26
27/*
28 * hvpipe_hdr flags used for read()
29 */
30#define HVPIPE_MSG_AVAILABLE 0x01 /* Payload is available */
31#define HVPIPE_LOST_CONNECTION 0x02 /* Pipe connection is closed/unavailable */
32
33#endif /* _PAPR_HVPIPE_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/ptrace.h+6-6
......@@ -27,7 +27,7 @@
2727
2828#include <linux/types.h>
2929
30#ifndef __ASSEMBLY__
30#ifndef __ASSEMBLER__
3131
3232struct pt_regs
3333{
......@@ -53,7 +53,7 @@ struct pt_regs
5353 unsigned long result; /* Result of a system call */
5454};
5555
56#endif /* __ASSEMBLY__ */
56#endif /* __ASSEMBLER__ */
5757
5858
5959/*
......@@ -196,7 +196,7 @@ struct pt_regs
196196#define PPC_PTRACE_SETHWDEBUG 0x88
197197#define PPC_PTRACE_DELHWDEBUG 0x87
198198
199#ifndef __ASSEMBLY__
199#ifndef __ASSEMBLER__
200200
201201struct ppc_debug_info {
202202 __u32 version; /* Only version 1 exists to date */
......@@ -208,7 +208,7 @@ struct ppc_debug_info {
208208 __u64 features;
209209};
210210
211#endif /* __ASSEMBLY__ */
211#endif /* __ASSEMBLER__ */
212212
213213/*
214214 * features will have bits indication whether there is support for:
......@@ -220,7 +220,7 @@ struct ppc_debug_info {
220220#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010
221221#define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x0000000000000020
222222
223#ifndef __ASSEMBLY__
223#ifndef __ASSEMBLER__
224224
225225struct ppc_hw_breakpoint {
226226 __u32 version; /* currently, version must be 1 */
......@@ -232,7 +232,7 @@ struct ppc_hw_breakpoint {
232232 __u64 condition_value; /* contents of the DVC register */
233233};
234234
235#endif /* __ASSEMBLY__ */
235#endif /* __ASSEMBLER__ */
236236
237237/*
238238 * Trigger Type
lib/libc/include/powerpc-linux-any/asm/types.h+2-2
......@@ -28,14 +28,14 @@
2828# include <asm-generic/int-ll64.h>
2929#endif
3030
31#ifndef __ASSEMBLY__
31#ifndef __ASSEMBLER__
3232
3333
3434typedef struct {
3535 __u32 u[4];
3636} __attribute__((aligned(16))) __vector128;
3737
38#endif /* __ASSEMBLY__ */
38#endif /* __ASSEMBLER__ */
3939
4040
4141#endif /* _ASM_POWERPC_TYPES_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+1
......@@ -451,6 +451,7 @@
451451#define __NR_open_tree_attr 467
452452#define __NR_file_getattr 468
453453#define __NR_file_setattr 469
454#define __NR_listns 470
454455
455456
456457#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h+1
......@@ -423,6 +423,7 @@
423423#define __NR_open_tree_attr 467
424424#define __NR_file_getattr 468
425425#define __NR_file_setattr 469
426#define __NR_listns 470
426427
427428
428429#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwprobe.h+7
......@@ -82,6 +82,11 @@ struct riscv_hwprobe {
8282#define RISCV_HWPROBE_EXT_ZAAMO (1ULL << 56)
8383#define RISCV_HWPROBE_EXT_ZALRSC (1ULL << 57)
8484#define RISCV_HWPROBE_EXT_ZABHA (1ULL << 58)
85#define RISCV_HWPROBE_EXT_ZALASR (1ULL << 59)
86#define RISCV_HWPROBE_EXT_ZICBOP (1ULL << 60)
87#define RISCV_HWPROBE_EXT_ZILSD (1ULL << 61)
88#define RISCV_HWPROBE_EXT_ZCLSD (1ULL << 62)
89
8590#define RISCV_HWPROBE_KEY_CPUPERF_0 5
8691#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
8792#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
......@@ -106,6 +111,8 @@ struct riscv_hwprobe {
106111#define RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 11
107112#define RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE 12
108113#define RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 13
114#define RISCV_HWPROBE_KEY_VENDOR_EXT_MIPS_0 14
115#define RISCV_HWPROBE_KEY_ZICBOP_BLOCK_SIZE 15
109116/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
110117
111118/* Flags */
lib/libc/include/riscv-linux-any/asm/kvm.h+25-1
......@@ -9,7 +9,7 @@
99#ifndef __LINUX_KVM_RISCV_H
1010#define __LINUX_KVM_RISCV_H
1111
12#ifndef __ASSEMBLY__
12#ifndef __ASSEMBLER__
1313
1414#include <linux/types.h>
1515#include <asm/bitsperlong.h>
......@@ -23,6 +23,8 @@
2323#define KVM_INTERRUPT_SET -1U
2424#define KVM_INTERRUPT_UNSET -2U
2525
26#define KVM_EXIT_FAIL_ENTRY_NO_VSFILE (1ULL << 0)
27
2628/* for KVM_GET_REGS and KVM_SET_REGS */
2729struct kvm_regs {
2830};
......@@ -56,6 +58,7 @@ struct kvm_riscv_config {
5658 unsigned long mimpid;
5759 unsigned long zicboz_block_size;
5860 unsigned long satp_mode;
61 unsigned long zicbop_block_size;
5962};
6063
6164/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
......@@ -185,6 +188,10 @@ enum KVM_RISCV_ISA_EXT_ID {
185188 KVM_RISCV_ISA_EXT_ZICCRSE,
186189 KVM_RISCV_ISA_EXT_ZAAMO,
187190 KVM_RISCV_ISA_EXT_ZALRSC,
191 KVM_RISCV_ISA_EXT_ZICBOP,
192 KVM_RISCV_ISA_EXT_ZFBFMIN,
193 KVM_RISCV_ISA_EXT_ZVFBFMIN,
194 KVM_RISCV_ISA_EXT_ZVFBFWMA,
188195 KVM_RISCV_ISA_EXT_MAX,
189196};
190197
......@@ -205,6 +212,8 @@ enum KVM_RISCV_SBI_EXT_ID {
205212 KVM_RISCV_SBI_EXT_DBCN,
206213 KVM_RISCV_SBI_EXT_STA,
207214 KVM_RISCV_SBI_EXT_SUSP,
215 KVM_RISCV_SBI_EXT_FWFT,
216 KVM_RISCV_SBI_EXT_MPXY,
208217 KVM_RISCV_SBI_EXT_MAX,
209218};
210219
......@@ -214,6 +223,18 @@ struct kvm_riscv_sbi_sta {
214223 unsigned long shmem_hi;
215224};
216225
226struct kvm_riscv_sbi_fwft_feature {
227 unsigned long enable;
228 unsigned long flags;
229 unsigned long value;
230};
231
232/* SBI FWFT extension registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
233struct kvm_riscv_sbi_fwft {
234 struct kvm_riscv_sbi_fwft_feature misaligned_deleg;
235 struct kvm_riscv_sbi_fwft_feature pointer_masking;
236};
237
217238/* Possible states for kvm_riscv_timer */
218239#define KVM_RISCV_TIMER_STATE_OFF 0
219240#define KVM_RISCV_TIMER_STATE_ON 1
......@@ -297,6 +318,9 @@ struct kvm_riscv_sbi_sta {
297318#define KVM_REG_RISCV_SBI_STA (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
298319#define KVM_REG_RISCV_SBI_STA_REG(name) \
299320 (offsetof(struct kvm_riscv_sbi_sta, name) / sizeof(unsigned long))
321#define KVM_REG_RISCV_SBI_FWFT (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
322#define KVM_REG_RISCV_SBI_FWFT_REG(name) \
323 (offsetof(struct kvm_riscv_sbi_fwft, name) / sizeof(unsigned long))
300324
301325/* Device Control API: RISC-V AIA */
302326#define KVM_DEV_RISCV_APLIC_ALIGN 0x1000
lib/libc/include/riscv-linux-any/asm/ptrace.h+2-2
......@@ -6,7 +6,7 @@
66#ifndef _ASM_RISCV_PTRACE_H
77#define _ASM_RISCV_PTRACE_H
88
9#ifndef __ASSEMBLY__
9#ifndef __ASSEMBLER__
1010
1111#include <linux/types.h>
1212
......@@ -127,6 +127,6 @@ struct __riscv_v_regset_state {
127127 */
128128#define RISCV_MAX_VLENB (8192)
129129
130#endif /* __ASSEMBLY__ */
130#endif /* __ASSEMBLER__ */
131131
132132#endif /* _ASM_RISCV_PTRACE_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/sigcontext.h+2-2
......@@ -15,7 +15,7 @@
1515/* The size of END signal context header. */
1616#define END_HDR_SIZE 0x0
1717
18#ifndef __ASSEMBLY__
18#ifndef __ASSEMBLER__
1919
2020struct __sc_riscv_v_state {
2121 struct __riscv_v_ext_state v_state;
......@@ -35,6 +35,6 @@ struct sigcontext {
3535 };
3636};
3737
38#endif /*!__ASSEMBLY__*/
38#endif /*!__ASSEMBLER__*/
3939
4040#endif /* _ASM_RISCV_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd_32.h+1
......@@ -317,6 +317,7 @@
317317#define __NR_open_tree_attr 467
318318#define __NR_file_getattr 468
319319#define __NR_file_setattr 469
320#define __NR_listns 470
320321
321322
322323#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd_64.h+1
......@@ -327,6 +327,7 @@
327327#define __NR_open_tree_attr 467
328328#define __NR_file_getattr 468
329329#define __NR_file_setattr 469
330#define __NR_listns 470
330331
331332
332333#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/vendor/mips.h created+3
......@@ -0,0 +1,3 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL BIT(0)
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/bitsperlong.h-4
......@@ -2,11 +2,7 @@
22#ifndef __ASM_S390_BITSPERLONG_H
33#define __ASM_S390_BITSPERLONG_H
44
5#ifndef __s390x__
6#define __BITS_PER_LONG 32
7#else
85#define __BITS_PER_LONG 64
9#endif
106
117#include <asm-generic/bitsperlong.h>
128
lib/libc/include/s390x-linux-any/asm/ipcbuf.h-3
......@@ -24,9 +24,6 @@ struct ipc64_perm
2424 __kernel_mode_t mode;
2525 unsigned short __pad1;
2626 unsigned short seq;
27#ifndef __s390x__
28 unsigned short __pad2;
29#endif /* ! __s390x__ */
3027 unsigned long __unused1;
3128 unsigned long __unused2;
3229};
lib/libc/include/s390x-linux-any/asm/ipl.h+1
......@@ -15,6 +15,7 @@ struct ipl_pl_hdr {
1515#define IPL_PL_FLAG_IPLPS 0x80
1616#define IPL_PL_FLAG_SIPL 0x40
1717#define IPL_PL_FLAG_IPLSR 0x20
18#define IPL_PL_FLAG_SBP 0x10
1819
1920/* IPL Parameter Block header */
2021struct ipl_pb_hdr {
lib/libc/include/s390x-linux-any/asm/posix_types.h-13
......@@ -21,17 +21,6 @@ typedef unsigned short __kernel_old_dev_t;
2121#define __kernel_old_dev_t __kernel_old_dev_t
2222
2323
24#ifndef __s390x__
25
26typedef unsigned long __kernel_ino_t;
27typedef unsigned short __kernel_mode_t;
28typedef unsigned short __kernel_ipc_pid_t;
29typedef unsigned short __kernel_uid_t;
30typedef unsigned short __kernel_gid_t;
31typedef int __kernel_ptrdiff_t;
32
33#else /* __s390x__ */
34
3524typedef unsigned int __kernel_ino_t;
3625typedef unsigned int __kernel_mode_t;
3726typedef int __kernel_ipc_pid_t;
......@@ -40,8 +29,6 @@ typedef unsigned int __kernel_gid_t;
4029typedef long __kernel_ptrdiff_t;
4130typedef unsigned long __kernel_sigset_t; /* at least 32 bits */
4231
43#endif /* __s390x__ */
44
4532#define __kernel_ino_t __kernel_ino_t
4633#define __kernel_mode_t __kernel_mode_t
4734#define __kernel_ipc_pid_t __kernel_ipc_pid_t
lib/libc/include/s390x-linux-any/asm/ptrace.h-124
......@@ -14,94 +14,6 @@
1414 * Offsets in the user_regs_struct. They are used for the ptrace
1515 * system call and in entry.S
1616 */
17#ifndef __s390x__
18
19#define PT_PSWMASK 0x00
20#define PT_PSWADDR 0x04
21#define PT_GPR0 0x08
22#define PT_GPR1 0x0C
23#define PT_GPR2 0x10
24#define PT_GPR3 0x14
25#define PT_GPR4 0x18
26#define PT_GPR5 0x1C
27#define PT_GPR6 0x20
28#define PT_GPR7 0x24
29#define PT_GPR8 0x28
30#define PT_GPR9 0x2C
31#define PT_GPR10 0x30
32#define PT_GPR11 0x34
33#define PT_GPR12 0x38
34#define PT_GPR13 0x3C
35#define PT_GPR14 0x40
36#define PT_GPR15 0x44
37#define PT_ACR0 0x48
38#define PT_ACR1 0x4C
39#define PT_ACR2 0x50
40#define PT_ACR3 0x54
41#define PT_ACR4 0x58
42#define PT_ACR5 0x5C
43#define PT_ACR6 0x60
44#define PT_ACR7 0x64
45#define PT_ACR8 0x68
46#define PT_ACR9 0x6C
47#define PT_ACR10 0x70
48#define PT_ACR11 0x74
49#define PT_ACR12 0x78
50#define PT_ACR13 0x7C
51#define PT_ACR14 0x80
52#define PT_ACR15 0x84
53#define PT_ORIGGPR2 0x88
54#define PT_FPC 0x90
55/*
56 * A nasty fact of life that the ptrace api
57 * only supports passing of longs.
58 */
59#define PT_FPR0_HI 0x98
60#define PT_FPR0_LO 0x9C
61#define PT_FPR1_HI 0xA0
62#define PT_FPR1_LO 0xA4
63#define PT_FPR2_HI 0xA8
64#define PT_FPR2_LO 0xAC
65#define PT_FPR3_HI 0xB0
66#define PT_FPR3_LO 0xB4
67#define PT_FPR4_HI 0xB8
68#define PT_FPR4_LO 0xBC
69#define PT_FPR5_HI 0xC0
70#define PT_FPR5_LO 0xC4
71#define PT_FPR6_HI 0xC8
72#define PT_FPR6_LO 0xCC
73#define PT_FPR7_HI 0xD0
74#define PT_FPR7_LO 0xD4
75#define PT_FPR8_HI 0xD8
76#define PT_FPR8_LO 0XDC
77#define PT_FPR9_HI 0xE0
78#define PT_FPR9_LO 0xE4
79#define PT_FPR10_HI 0xE8
80#define PT_FPR10_LO 0xEC
81#define PT_FPR11_HI 0xF0
82#define PT_FPR11_LO 0xF4
83#define PT_FPR12_HI 0xF8
84#define PT_FPR12_LO 0xFC
85#define PT_FPR13_HI 0x100
86#define PT_FPR13_LO 0x104
87#define PT_FPR14_HI 0x108
88#define PT_FPR14_LO 0x10C
89#define PT_FPR15_HI 0x110
90#define PT_FPR15_LO 0x114
91#define PT_CR_9 0x118
92#define PT_CR_10 0x11C
93#define PT_CR_11 0x120
94#define PT_IEEE_IP 0x13C
95#define PT_LASTOFF PT_IEEE_IP
96#define PT_ENDREGS 0x140-1
97
98#define GPR_SIZE 4
99#define CR_SIZE 4
100
101#define STACK_FRAME_OVERHEAD 96 /* size of minimum stack frame */
102
103#else /* __s390x__ */
104
10517#define PT_PSWMASK 0x00
10618#define PT_PSWADDR 0x08
10719#define PT_GPR0 0x10
......@@ -166,38 +78,6 @@
16678
16779#define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */
16880
169#endif /* __s390x__ */
170
171#ifndef __s390x__
172
173#define PSW_MASK_PER _AC(0x40000000, UL)
174#define PSW_MASK_DAT _AC(0x04000000, UL)
175#define PSW_MASK_IO _AC(0x02000000, UL)
176#define PSW_MASK_EXT _AC(0x01000000, UL)
177#define PSW_MASK_KEY _AC(0x00F00000, UL)
178#define PSW_MASK_BASE _AC(0x00080000, UL) /* always one */
179#define PSW_MASK_MCHECK _AC(0x00040000, UL)
180#define PSW_MASK_WAIT _AC(0x00020000, UL)
181#define PSW_MASK_PSTATE _AC(0x00010000, UL)
182#define PSW_MASK_ASC _AC(0x0000C000, UL)
183#define PSW_MASK_CC _AC(0x00003000, UL)
184#define PSW_MASK_PM _AC(0x00000F00, UL)
185#define PSW_MASK_RI _AC(0x00000000, UL)
186#define PSW_MASK_EA _AC(0x00000000, UL)
187#define PSW_MASK_BA _AC(0x00000000, UL)
188
189#define PSW_MASK_USER _AC(0x0000FF00, UL)
190
191#define PSW_ADDR_AMODE _AC(0x80000000, UL)
192#define PSW_ADDR_INSN _AC(0x7FFFFFFF, UL)
193
194#define PSW_ASC_PRIMARY _AC(0x00000000, UL)
195#define PSW_ASC_ACCREG _AC(0x00004000, UL)
196#define PSW_ASC_SECONDARY _AC(0x00008000, UL)
197#define PSW_ASC_HOME _AC(0x0000C000, UL)
198
199#else /* __s390x__ */
200
20181#define PSW_MASK_PER _AC(0x4000000000000000, UL)
20282#define PSW_MASK_DAT _AC(0x0400000000000000, UL)
20383#define PSW_MASK_IO _AC(0x0200000000000000, UL)
......@@ -224,8 +104,6 @@
224104#define PSW_ASC_SECONDARY _AC(0x0000800000000000, UL)
225105#define PSW_ASC_HOME _AC(0x0000C00000000000, UL)
226106
227#endif /* __s390x__ */
228
229107#define NUM_GPRS 16
230108#define NUM_FPRS 16
231109#define NUM_CRS 16
......@@ -308,9 +186,7 @@ typedef struct {
308186#define PER_EM_MASK 0xE8000000UL
309187
310188typedef struct {
311#ifdef __s390x__
312189 unsigned : 32;
313#endif /* __s390x__ */
314190 unsigned em_branching : 1;
315191 unsigned em_instruction_fetch : 1;
316192 /*
lib/libc/include/s390x-linux-any/asm/sigcontext.h-15
......@@ -17,24 +17,12 @@
1717#define __NUM_VXRS_LOW 16
1818#define __NUM_VXRS_HIGH 16
1919
20#ifndef __s390x__
21
22/* Has to be at least _NSIG_WORDS from asm/signal.h */
23#define _SIGCONTEXT_NSIG 64
24#define _SIGCONTEXT_NSIG_BPW 32
25/* Size of stack frame allocated when calling signal handler. */
26#define __SIGNAL_FRAMESIZE 96
27
28#else /* __s390x__ */
29
3020/* Has to be at least _NSIG_WORDS from asm/signal.h */
3121#define _SIGCONTEXT_NSIG 64
3222#define _SIGCONTEXT_NSIG_BPW 64
3323/* Size of stack frame allocated when calling signal handler. */
3424#define __SIGNAL_FRAMESIZE 160
3525
36#endif /* __s390x__ */
37
3826#define _SIGCONTEXT_NSIG_WORDS (_SIGCONTEXT_NSIG / _SIGCONTEXT_NSIG_BPW)
3927#define _SIGMASK_COPY_SIZE (sizeof(unsigned long)*_SIGCONTEXT_NSIG_WORDS)
4028
......@@ -66,9 +54,6 @@ typedef struct
6654
6755typedef struct
6856{
69#ifndef __s390x__
70 unsigned long gprs_high[__NUM_GPRS];
71#endif
7257 unsigned long long vxrs_low[__NUM_VXRS_LOW];
7358 __vector128 vxrs_high[__NUM_VXRS_HIGH];
7459 unsigned char __reserved[128];
lib/libc/include/s390x-linux-any/asm/stat.h-70
......@@ -8,74 +8,6 @@
88#ifndef _S390_STAT_H
99#define _S390_STAT_H
1010
11#ifndef __s390x__
12struct __old_kernel_stat {
13 unsigned short st_dev;
14 unsigned short st_ino;
15 unsigned short st_mode;
16 unsigned short st_nlink;
17 unsigned short st_uid;
18 unsigned short st_gid;
19 unsigned short st_rdev;
20 unsigned long st_size;
21 unsigned long st_atime;
22 unsigned long st_mtime;
23 unsigned long st_ctime;
24};
25
26struct stat {
27 unsigned short st_dev;
28 unsigned short __pad1;
29 unsigned long st_ino;
30 unsigned short st_mode;
31 unsigned short st_nlink;
32 unsigned short st_uid;
33 unsigned short st_gid;
34 unsigned short st_rdev;
35 unsigned short __pad2;
36 unsigned long st_size;
37 unsigned long st_blksize;
38 unsigned long st_blocks;
39 unsigned long st_atime;
40 unsigned long st_atime_nsec;
41 unsigned long st_mtime;
42 unsigned long st_mtime_nsec;
43 unsigned long st_ctime;
44 unsigned long st_ctime_nsec;
45 unsigned long __unused4;
46 unsigned long __unused5;
47};
48
49/* This matches struct stat64 in glibc2.1, hence the absolutely
50 * insane amounts of padding around dev_t's.
51 */
52struct stat64 {
53 unsigned long long st_dev;
54 unsigned int __pad1;
55#define STAT64_HAS_BROKEN_ST_INO 1
56 unsigned long __st_ino;
57 unsigned int st_mode;
58 unsigned int st_nlink;
59 unsigned long st_uid;
60 unsigned long st_gid;
61 unsigned long long st_rdev;
62 unsigned int __pad3;
63 long long st_size;
64 unsigned long st_blksize;
65 unsigned char __pad4[4];
66 unsigned long __pad5; /* future possible st_blocks high bits */
67 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
68 unsigned long st_atime;
69 unsigned long st_atime_nsec;
70 unsigned long st_mtime;
71 unsigned long st_mtime_nsec;
72 unsigned long st_ctime;
73 unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */
74 unsigned long long st_ino;
75};
76
77#else /* __s390x__ */
78
7911struct stat {
8012 unsigned long st_dev;
8113 unsigned long st_ino;
......@@ -97,8 +29,6 @@ struct stat {
9729 unsigned long __unused[3];
9830};
9931
100#endif /* __s390x__ */
101
10232#define STAT_HAVE_NSEC 1
10333
10434#endif
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd.h-4
......@@ -8,10 +8,6 @@
88#ifndef _ASM_S390_UNISTD_H_
99#define _ASM_S390_UNISTD_H_
1010
11#ifdef __s390x__
1211#include <asm/unistd_64.h>
13#else
14#include <asm/unistd_32.h>
15#endif
1612
1713#endif /* _ASM_S390_UNISTD_H_ */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_32.h deleted-446
......@@ -1,446 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_S390_UNISTD_32_H
3#define _ASM_S390_UNISTD_32_H
4
5#define __NR_exit 1
6#define __NR_fork 2
7#define __NR_read 3
8#define __NR_write 4
9#define __NR_open 5
10#define __NR_close 6
11#define __NR_restart_syscall 7
12#define __NR_creat 8
13#define __NR_link 9
14#define __NR_unlink 10
15#define __NR_execve 11
16#define __NR_chdir 12
17#define __NR_time 13
18#define __NR_mknod 14
19#define __NR_chmod 15
20#define __NR_lchown 16
21#define __NR_lseek 19
22#define __NR_getpid 20
23#define __NR_mount 21
24#define __NR_umount 22
25#define __NR_setuid 23
26#define __NR_getuid 24
27#define __NR_stime 25
28#define __NR_ptrace 26
29#define __NR_alarm 27
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_access 33
33#define __NR_nice 34
34#define __NR_sync 36
35#define __NR_kill 37
36#define __NR_rename 38
37#define __NR_mkdir 39
38#define __NR_rmdir 40
39#define __NR_dup 41
40#define __NR_pipe 42
41#define __NR_times 43
42#define __NR_brk 45
43#define __NR_setgid 46
44#define __NR_getgid 47
45#define __NR_signal 48
46#define __NR_geteuid 49
47#define __NR_getegid 50
48#define __NR_acct 51
49#define __NR_umount2 52
50#define __NR_ioctl 54
51#define __NR_fcntl 55
52#define __NR_setpgid 57
53#define __NR_umask 60
54#define __NR_chroot 61
55#define __NR_ustat 62
56#define __NR_dup2 63
57#define __NR_getppid 64
58#define __NR_getpgrp 65
59#define __NR_setsid 66
60#define __NR_sigaction 67
61#define __NR_setreuid 70
62#define __NR_setregid 71
63#define __NR_sigsuspend 72
64#define __NR_sigpending 73
65#define __NR_sethostname 74
66#define __NR_setrlimit 75
67#define __NR_getrlimit 76
68#define __NR_getrusage 77
69#define __NR_gettimeofday 78
70#define __NR_settimeofday 79
71#define __NR_getgroups 80
72#define __NR_setgroups 81
73#define __NR_symlink 83
74#define __NR_readlink 85
75#define __NR_uselib 86
76#define __NR_swapon 87
77#define __NR_reboot 88
78#define __NR_readdir 89
79#define __NR_mmap 90
80#define __NR_munmap 91
81#define __NR_truncate 92
82#define __NR_ftruncate 93
83#define __NR_fchmod 94
84#define __NR_fchown 95
85#define __NR_getpriority 96
86#define __NR_setpriority 97
87#define __NR_statfs 99
88#define __NR_fstatfs 100
89#define __NR_ioperm 101
90#define __NR_socketcall 102
91#define __NR_syslog 103
92#define __NR_setitimer 104
93#define __NR_getitimer 105
94#define __NR_stat 106
95#define __NR_lstat 107
96#define __NR_fstat 108
97#define __NR_lookup_dcookie 110
98#define __NR_vhangup 111
99#define __NR_idle 112
100#define __NR_wait4 114
101#define __NR_swapoff 115
102#define __NR_sysinfo 116
103#define __NR_ipc 117
104#define __NR_fsync 118
105#define __NR_sigreturn 119
106#define __NR_clone 120
107#define __NR_setdomainname 121
108#define __NR_uname 122
109#define __NR_adjtimex 124
110#define __NR_mprotect 125
111#define __NR_sigprocmask 126
112#define __NR_create_module 127
113#define __NR_init_module 128
114#define __NR_delete_module 129
115#define __NR_get_kernel_syms 130
116#define __NR_quotactl 131
117#define __NR_getpgid 132
118#define __NR_fchdir 133
119#define __NR_bdflush 134
120#define __NR_sysfs 135
121#define __NR_personality 136
122#define __NR_afs_syscall 137
123#define __NR_setfsuid 138
124#define __NR_setfsgid 139
125#define __NR__llseek 140
126#define __NR_getdents 141
127#define __NR__newselect 142
128#define __NR_flock 143
129#define __NR_msync 144
130#define __NR_readv 145
131#define __NR_writev 146
132#define __NR_getsid 147
133#define __NR_fdatasync 148
134#define __NR__sysctl 149
135#define __NR_mlock 150
136#define __NR_munlock 151
137#define __NR_mlockall 152
138#define __NR_munlockall 153
139#define __NR_sched_setparam 154
140#define __NR_sched_getparam 155
141#define __NR_sched_setscheduler 156
142#define __NR_sched_getscheduler 157
143#define __NR_sched_yield 158
144#define __NR_sched_get_priority_max 159
145#define __NR_sched_get_priority_min 160
146#define __NR_sched_rr_get_interval 161
147#define __NR_nanosleep 162
148#define __NR_mremap 163
149#define __NR_setresuid 164
150#define __NR_getresuid 165
151#define __NR_query_module 167
152#define __NR_poll 168
153#define __NR_nfsservctl 169
154#define __NR_setresgid 170
155#define __NR_getresgid 171
156#define __NR_prctl 172
157#define __NR_rt_sigreturn 173
158#define __NR_rt_sigaction 174
159#define __NR_rt_sigprocmask 175
160#define __NR_rt_sigpending 176
161#define __NR_rt_sigtimedwait 177
162#define __NR_rt_sigqueueinfo 178
163#define __NR_rt_sigsuspend 179
164#define __NR_pread64 180
165#define __NR_pwrite64 181
166#define __NR_chown 182
167#define __NR_getcwd 183
168#define __NR_capget 184
169#define __NR_capset 185
170#define __NR_sigaltstack 186
171#define __NR_sendfile 187
172#define __NR_getpmsg 188
173#define __NR_putpmsg 189
174#define __NR_vfork 190
175#define __NR_ugetrlimit 191
176#define __NR_mmap2 192
177#define __NR_truncate64 193
178#define __NR_ftruncate64 194
179#define __NR_stat64 195
180#define __NR_lstat64 196
181#define __NR_fstat64 197
182#define __NR_lchown32 198
183#define __NR_getuid32 199
184#define __NR_getgid32 200
185#define __NR_geteuid32 201
186#define __NR_getegid32 202
187#define __NR_setreuid32 203
188#define __NR_setregid32 204
189#define __NR_getgroups32 205
190#define __NR_setgroups32 206
191#define __NR_fchown32 207
192#define __NR_setresuid32 208
193#define __NR_getresuid32 209
194#define __NR_setresgid32 210
195#define __NR_getresgid32 211
196#define __NR_chown32 212
197#define __NR_setuid32 213
198#define __NR_setgid32 214
199#define __NR_setfsuid32 215
200#define __NR_setfsgid32 216
201#define __NR_pivot_root 217
202#define __NR_mincore 218
203#define __NR_madvise 219
204#define __NR_getdents64 220
205#define __NR_fcntl64 221
206#define __NR_readahead 222
207#define __NR_sendfile64 223
208#define __NR_setxattr 224
209#define __NR_lsetxattr 225
210#define __NR_fsetxattr 226
211#define __NR_getxattr 227
212#define __NR_lgetxattr 228
213#define __NR_fgetxattr 229
214#define __NR_listxattr 230
215#define __NR_llistxattr 231
216#define __NR_flistxattr 232
217#define __NR_removexattr 233
218#define __NR_lremovexattr 234
219#define __NR_fremovexattr 235
220#define __NR_gettid 236
221#define __NR_tkill 237
222#define __NR_futex 238
223#define __NR_sched_setaffinity 239
224#define __NR_sched_getaffinity 240
225#define __NR_tgkill 241
226#define __NR_io_setup 243
227#define __NR_io_destroy 244
228#define __NR_io_getevents 245
229#define __NR_io_submit 246
230#define __NR_io_cancel 247
231#define __NR_exit_group 248
232#define __NR_epoll_create 249
233#define __NR_epoll_ctl 250
234#define __NR_epoll_wait 251
235#define __NR_set_tid_address 252
236#define __NR_fadvise64 253
237#define __NR_timer_create 254
238#define __NR_timer_settime 255
239#define __NR_timer_gettime 256
240#define __NR_timer_getoverrun 257
241#define __NR_timer_delete 258
242#define __NR_clock_settime 259
243#define __NR_clock_gettime 260
244#define __NR_clock_getres 261
245#define __NR_clock_nanosleep 262
246#define __NR_fadvise64_64 264
247#define __NR_statfs64 265
248#define __NR_fstatfs64 266
249#define __NR_remap_file_pages 267
250#define __NR_mbind 268
251#define __NR_get_mempolicy 269
252#define __NR_set_mempolicy 270
253#define __NR_mq_open 271
254#define __NR_mq_unlink 272
255#define __NR_mq_timedsend 273
256#define __NR_mq_timedreceive 274
257#define __NR_mq_notify 275
258#define __NR_mq_getsetattr 276
259#define __NR_kexec_load 277
260#define __NR_add_key 278
261#define __NR_request_key 279
262#define __NR_keyctl 280
263#define __NR_waitid 281
264#define __NR_ioprio_set 282
265#define __NR_ioprio_get 283
266#define __NR_inotify_init 284
267#define __NR_inotify_add_watch 285
268#define __NR_inotify_rm_watch 286
269#define __NR_migrate_pages 287
270#define __NR_openat 288
271#define __NR_mkdirat 289
272#define __NR_mknodat 290
273#define __NR_fchownat 291
274#define __NR_futimesat 292
275#define __NR_fstatat64 293
276#define __NR_unlinkat 294
277#define __NR_renameat 295
278#define __NR_linkat 296
279#define __NR_symlinkat 297
280#define __NR_readlinkat 298
281#define __NR_fchmodat 299
282#define __NR_faccessat 300
283#define __NR_pselect6 301
284#define __NR_ppoll 302
285#define __NR_unshare 303
286#define __NR_set_robust_list 304
287#define __NR_get_robust_list 305
288#define __NR_splice 306
289#define __NR_sync_file_range 307
290#define __NR_tee 308
291#define __NR_vmsplice 309
292#define __NR_move_pages 310
293#define __NR_getcpu 311
294#define __NR_epoll_pwait 312
295#define __NR_utimes 313
296#define __NR_fallocate 314
297#define __NR_utimensat 315
298#define __NR_signalfd 316
299#define __NR_timerfd 317
300#define __NR_eventfd 318
301#define __NR_timerfd_create 319
302#define __NR_timerfd_settime 320
303#define __NR_timerfd_gettime 321
304#define __NR_signalfd4 322
305#define __NR_eventfd2 323
306#define __NR_inotify_init1 324
307#define __NR_pipe2 325
308#define __NR_dup3 326
309#define __NR_epoll_create1 327
310#define __NR_preadv 328
311#define __NR_pwritev 329
312#define __NR_rt_tgsigqueueinfo 330
313#define __NR_perf_event_open 331
314#define __NR_fanotify_init 332
315#define __NR_fanotify_mark 333
316#define __NR_prlimit64 334
317#define __NR_name_to_handle_at 335
318#define __NR_open_by_handle_at 336
319#define __NR_clock_adjtime 337
320#define __NR_syncfs 338
321#define __NR_setns 339
322#define __NR_process_vm_readv 340
323#define __NR_process_vm_writev 341
324#define __NR_s390_runtime_instr 342
325#define __NR_kcmp 343
326#define __NR_finit_module 344
327#define __NR_sched_setattr 345
328#define __NR_sched_getattr 346
329#define __NR_renameat2 347
330#define __NR_seccomp 348
331#define __NR_getrandom 349
332#define __NR_memfd_create 350
333#define __NR_bpf 351
334#define __NR_s390_pci_mmio_write 352
335#define __NR_s390_pci_mmio_read 353
336#define __NR_execveat 354
337#define __NR_userfaultfd 355
338#define __NR_membarrier 356
339#define __NR_recvmmsg 357
340#define __NR_sendmmsg 358
341#define __NR_socket 359
342#define __NR_socketpair 360
343#define __NR_bind 361
344#define __NR_connect 362
345#define __NR_listen 363
346#define __NR_accept4 364
347#define __NR_getsockopt 365
348#define __NR_setsockopt 366
349#define __NR_getsockname 367
350#define __NR_getpeername 368
351#define __NR_sendto 369
352#define __NR_sendmsg 370
353#define __NR_recvfrom 371
354#define __NR_recvmsg 372
355#define __NR_shutdown 373
356#define __NR_mlock2 374
357#define __NR_copy_file_range 375
358#define __NR_preadv2 376
359#define __NR_pwritev2 377
360#define __NR_s390_guarded_storage 378
361#define __NR_statx 379
362#define __NR_s390_sthyi 380
363#define __NR_kexec_file_load 381
364#define __NR_io_pgetevents 382
365#define __NR_rseq 383
366#define __NR_pkey_mprotect 384
367#define __NR_pkey_alloc 385
368#define __NR_pkey_free 386
369#define __NR_semget 393
370#define __NR_semctl 394
371#define __NR_shmget 395
372#define __NR_shmctl 396
373#define __NR_shmat 397
374#define __NR_shmdt 398
375#define __NR_msgget 399
376#define __NR_msgsnd 400
377#define __NR_msgrcv 401
378#define __NR_msgctl 402
379#define __NR_clock_gettime64 403
380#define __NR_clock_settime64 404
381#define __NR_clock_adjtime64 405
382#define __NR_clock_getres_time64 406
383#define __NR_clock_nanosleep_time64 407
384#define __NR_timer_gettime64 408
385#define __NR_timer_settime64 409
386#define __NR_timerfd_gettime64 410
387#define __NR_timerfd_settime64 411
388#define __NR_utimensat_time64 412
389#define __NR_pselect6_time64 413
390#define __NR_ppoll_time64 414
391#define __NR_io_pgetevents_time64 416
392#define __NR_recvmmsg_time64 417
393#define __NR_mq_timedsend_time64 418
394#define __NR_mq_timedreceive_time64 419
395#define __NR_semtimedop_time64 420
396#define __NR_rt_sigtimedwait_time64 421
397#define __NR_futex_time64 422
398#define __NR_sched_rr_get_interval_time64 423
399#define __NR_pidfd_send_signal 424
400#define __NR_io_uring_setup 425
401#define __NR_io_uring_enter 426
402#define __NR_io_uring_register 427
403#define __NR_open_tree 428
404#define __NR_move_mount 429
405#define __NR_fsopen 430
406#define __NR_fsconfig 431
407#define __NR_fsmount 432
408#define __NR_fspick 433
409#define __NR_pidfd_open 434
410#define __NR_clone3 435
411#define __NR_close_range 436
412#define __NR_openat2 437
413#define __NR_pidfd_getfd 438
414#define __NR_faccessat2 439
415#define __NR_process_madvise 440
416#define __NR_epoll_pwait2 441
417#define __NR_mount_setattr 442
418#define __NR_quotactl_fd 443
419#define __NR_landlock_create_ruleset 444
420#define __NR_landlock_add_rule 445
421#define __NR_landlock_restrict_self 446
422#define __NR_memfd_secret 447
423#define __NR_process_mrelease 448
424#define __NR_futex_waitv 449
425#define __NR_set_mempolicy_home_node 450
426#define __NR_cachestat 451
427#define __NR_fchmodat2 452
428#define __NR_map_shadow_stack 453
429#define __NR_futex_wake 454
430#define __NR_futex_wait 455
431#define __NR_futex_requeue 456
432#define __NR_statmount 457
433#define __NR_listmount 458
434#define __NR_lsm_get_self_attr 459
435#define __NR_lsm_set_self_attr 460
436#define __NR_lsm_list_modules 461
437#define __NR_mseal 462
438#define __NR_setxattrat 463
439#define __NR_getxattrat 464
440#define __NR_listxattrat 465
441#define __NR_removexattrat 466
442#define __NR_open_tree_attr 467
443#define __NR_file_getattr 468
444#define __NR_file_setattr 469
445
446#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+5-4
......@@ -1,6 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_S390_UNISTD_64_H
3#define _ASM_S390_UNISTD_64_H
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
43
54#define __NR_exit 1
65#define __NR_fork 2
......@@ -390,5 +389,7 @@
390389#define __NR_open_tree_attr 467
391390#define __NR_file_getattr 468
392391#define __NR_file_setattr 469
392#define __NR_listns 470
393393
394#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
394
395#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/ptrace.h+12-12
......@@ -15,7 +15,7 @@
1515 */
1616#define PT_REGS_MAGIC 0x57ac6c00
1717
18#ifndef __ASSEMBLY__
18#ifndef __ASSEMBLER__
1919
2020#include <linux/types.h>
2121
......@@ -88,7 +88,7 @@ struct sparc_trapf {
8888 unsigned long _unused;
8989 struct pt_regs *regs;
9090};
91#endif /* (!__ASSEMBLY__) */
91#endif /* (!__ASSEMBLER__) */
9292#else
9393/* 32 bit sparc */
9494
......@@ -97,7 +97,7 @@ struct sparc_trapf {
9797/* This struct defines the way the registers are stored on the
9898 * stack during a system call and basically all traps.
9999 */
100#ifndef __ASSEMBLY__
100#ifndef __ASSEMBLER__
101101
102102#include <linux/types.h>
103103
......@@ -125,11 +125,11 @@ struct sparc_stackf {
125125 unsigned long xargs[6];
126126 unsigned long xxargs[1];
127127};
128#endif /* (!__ASSEMBLY__) */
128#endif /* (!__ASSEMBLER__) */
129129
130130#endif /* (defined(__sparc__) && defined(__arch64__))*/
131131
132#ifndef __ASSEMBLY__
132#ifndef __ASSEMBLER__
133133
134134#define TRACEREG_SZ sizeof(struct pt_regs)
135135#define STACKFRAME_SZ sizeof(struct sparc_stackf)
......@@ -137,7 +137,7 @@ struct sparc_stackf {
137137#define TRACEREG32_SZ sizeof(struct pt_regs32)
138138#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
139139
140#endif /* (!__ASSEMBLY__) */
140#endif /* (!__ASSEMBLER__) */
141141
142142#define UREG_G0 0
143143#define UREG_G1 1
......@@ -161,30 +161,30 @@ struct sparc_stackf {
161161#if defined(__sparc__) && defined(__arch64__)
162162/* 64 bit sparc */
163163
164#ifndef __ASSEMBLY__
164#ifndef __ASSEMBLER__
165165
166166
167#else /* __ASSEMBLY__ */
167#else /* __ASSEMBLER__ */
168168/* For assembly code. */
169169#define TRACEREG_SZ 0xa0
170170#define STACKFRAME_SZ 0xc0
171171
172172#define TRACEREG32_SZ 0x50
173173#define STACKFRAME32_SZ 0x60
174#endif /* __ASSEMBLY__ */
174#endif /* __ASSEMBLER__ */
175175
176176#else /* (defined(__sparc__) && defined(__arch64__)) */
177177
178178/* 32 bit sparc */
179179
180#ifndef __ASSEMBLY__
180#ifndef __ASSEMBLER__
181181
182182
183#else /* (!__ASSEMBLY__) */
183#else /* (!__ASSEMBLER__) */
184184/* For assembly code. */
185185#define TRACEREG_SZ 0x50
186186#define STACKFRAME_SZ 0x60
187#endif /* (!__ASSEMBLY__) */
187#endif /* (!__ASSEMBLER__) */
188188
189189#endif /* (defined(__sparc__) && defined(__arch64__)) */
190190
lib/libc/include/sparc-linux-any/asm/signal.h+2-2
......@@ -105,7 +105,7 @@
105105#define __old_sigaction32 sigaction32
106106#endif
107107
108#ifndef __ASSEMBLY__
108#ifndef __ASSEMBLER__
109109
110110typedef unsigned long __old_sigset_t; /* at least 32 bits */
111111
......@@ -174,6 +174,6 @@ typedef struct sigaltstack {
174174} stack_t;
175175
176176
177#endif /* !(__ASSEMBLY__) */
177#endif /* !(__ASSEMBLER__) */
178178
179179#endif /* __SPARC_SIGNAL_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/traps.h+2-2
......@@ -10,8 +10,8 @@
1010
1111#define NUM_SPARC_TRAPS 255
1212
13#ifndef __ASSEMBLY__
14#endif /* !(__ASSEMBLY__) */
13#ifndef __ASSEMBLER__
14#endif /* !(__ASSEMBLER__) */
1515
1616/* For patching the trap table at boot time, we need to know how to
1717 * form various common Sparc instructions. Thus these macros...
lib/libc/include/sparc-linux-any/asm/unistd_32.h+1
......@@ -439,6 +439,7 @@
439439#define __NR_open_tree_attr 467
440440#define __NR_file_getattr 468
441441#define __NR_file_setattr 469
442#define __NR_listns 470
442443
443444
444445#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h+1
......@@ -402,6 +402,7 @@
402402#define __NR_open_tree_attr 467
403403#define __NR_file_getattr 468
404404#define __NR_file_setattr 469
405#define __NR_listns 470
405406
406407
407408#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/utrap.h+2-2
......@@ -44,9 +44,9 @@
4444
4545#define UTH_NOCHANGE (-1)
4646
47#ifndef __ASSEMBLY__
47#ifndef __ASSEMBLER__
4848typedef int utrap_entry_t;
4949typedef void *utrap_handler_t;
50#endif /* __ASSEMBLY__ */
50#endif /* __ASSEMBLER__ */
5151
5252#endif /* !(__ASM_SPARC64_PROCESSOR_H) */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm.h+35
......@@ -35,6 +35,11 @@
3535#define MC_VECTOR 18
3636#define XM_VECTOR 19
3737#define VE_VECTOR 20
38#define CP_VECTOR 21
39
40#define HV_VECTOR 28
41#define VC_VECTOR 29
42#define SX_VECTOR 30
3843
3944/* Select x86 specific features in <linux/kvm.h> */
4045#define __KVM_HAVE_PIT
......@@ -409,6 +414,35 @@ struct kvm_xcrs {
409414 __u64 padding[16];
410415};
411416
417#define KVM_X86_REG_TYPE_MSR 2
418#define KVM_X86_REG_TYPE_KVM 3
419
420#define KVM_X86_KVM_REG_SIZE(reg) \
421({ \
422 reg == KVM_REG_GUEST_SSP ? KVM_REG_SIZE_U64 : 0; \
423})
424
425#define KVM_X86_REG_TYPE_SIZE(type, reg) \
426({ \
427 __u64 type_size = (__u64)type << 32; \
428 \
429 type_size |= type == KVM_X86_REG_TYPE_MSR ? KVM_REG_SIZE_U64 : \
430 type == KVM_X86_REG_TYPE_KVM ? KVM_X86_KVM_REG_SIZE(reg) : \
431 0; \
432 type_size; \
433})
434
435#define KVM_X86_REG_ID(type, index) \
436 (KVM_REG_X86 | KVM_X86_REG_TYPE_SIZE(type, index) | index)
437
438#define KVM_X86_REG_MSR(index) \
439 KVM_X86_REG_ID(KVM_X86_REG_TYPE_MSR, index)
440#define KVM_X86_REG_KVM(index) \
441 KVM_X86_REG_ID(KVM_X86_REG_TYPE_KVM, index)
442
443/* KVM-defined registers starting from 0 */
444#define KVM_REG_GUEST_SSP 0
445
412446#define KVM_SYNC_X86_REGS (1UL << 0)
413447#define KVM_SYNC_X86_SREGS (1UL << 1)
414448#define KVM_SYNC_X86_EVENTS (1UL << 2)
......@@ -466,6 +500,7 @@ struct kvm_sync_regs {
466500/* vendor-specific groups and attributes for system fd */
467501#define KVM_X86_GRP_SEV 1
468502# define KVM_X86_SEV_VMSA_FEATURES 0
503# define KVM_X86_SNP_POLICY_BITS 1
469504
470505struct kvm_vmx_nested_state_data {
471506 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
lib/libc/include/x86-linux-any/asm/processor-flags.h+2
......@@ -136,6 +136,8 @@
136136#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
137137#define X86_CR4_CET_BIT 23 /* enable Control-flow Enforcement Technology */
138138#define X86_CR4_CET _BITUL(X86_CR4_CET_BIT)
139#define X86_CR4_LASS_BIT 27 /* enable Linear Address Space Separation support */
140#define X86_CR4_LASS _BITUL(X86_CR4_LASS_BIT)
139141#define X86_CR4_LAM_SUP_BIT 28 /* LAM for supervisor pointers */
140142#define X86_CR4_LAM_SUP _BITUL(X86_CR4_LAM_SUP_BIT)
141143
lib/libc/include/x86-linux-any/asm/sgx.h+8-2
......@@ -10,7 +10,7 @@
1010
1111/**
1212 * enum sgx_page_flags - page control flags
13 * %SGX_PAGE_MEASURE: Measure the page contents with a sequence of
13 * @SGX_PAGE_MEASURE: Measure the page contents with a sequence of
1414 * ENCLS[EEXTEND] operations.
1515 */
1616enum sgx_page_flags {
......@@ -143,6 +143,12 @@ struct sgx_enclave_run;
143143/**
144144 * typedef sgx_enclave_user_handler_t - Exit handler function accepted by
145145 * __vdso_sgx_enter_enclave()
146 * @rdi: RDI at the time of EEXIT, undefined on AEX
147 * @rsi: RSI at the time of EEXIT, undefined on AEX
148 * @rdx: RDX at the time of EEXIT, undefined on AEX
149 * @rsp: RSP (untrusted) at the time of EEXIT or AEX
150 * @r8: R8 at the time of EEXIT, undefined on AEX
151 * @r9: R9 at the time of EEXIT, undefined on AEX
146152 * @run: The run instance given by the caller
147153 *
148154 * The register parameters contain the snapshot of their values at enclave
......@@ -166,7 +172,7 @@ typedef int (*sgx_enclave_user_handler_t)(long rdi, long rsi, long rdx,
166172 * @exception_addr: The address that triggered the exception
167173 * @user_handler: User provided callback run on exception
168174 * @user_data: Data passed to the user handler
169 * @reserved Reserved for future extensions
175 * @reserved: Reserved for future extensions
170176 *
171177 * If @user_handler is provided, the handler will be invoked on all return paths
172178 * of the normal flow. The user handler may transfer control, e.g. via a
lib/libc/include/x86-linux-any/asm/svm.h+4
......@@ -118,6 +118,10 @@
118118#define SVM_VMGEXIT_AP_CREATE 1
119119#define SVM_VMGEXIT_AP_DESTROY 2
120120#define SVM_VMGEXIT_SNP_RUN_VMPL 0x80000018
121#define SVM_VMGEXIT_SAVIC 0x8000001a
122#define SVM_VMGEXIT_SAVIC_REGISTER_GPA 0
123#define SVM_VMGEXIT_SAVIC_UNREGISTER_GPA 1
124#define SVM_VMGEXIT_SAVIC_SELF_GPA ~0ULL
121125#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd
122126#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe
123127#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \
lib/libc/include/x86-linux-any/asm/unistd_32.h+1
......@@ -460,6 +460,7 @@
460460#define __NR_open_tree_attr 467
461461#define __NR_file_getattr 468
462462#define __NR_file_setattr 469
463#define __NR_listns 470
463464
464465
465466#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h+2
......@@ -337,6 +337,7 @@
337337#define __NR_io_pgetevents 333
338338#define __NR_rseq 334
339339#define __NR_uretprobe 335
340#define __NR_uprobe 336
340341#define __NR_pidfd_send_signal 424
341342#define __NR_io_uring_setup 425
342343#define __NR_io_uring_enter 426
......@@ -383,6 +384,7 @@
383384#define __NR_open_tree_attr 467
384385#define __NR_file_getattr 468
385386#define __NR_file_setattr 469
387#define __NR_listns 470
386388
387389
388390#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h+2
......@@ -290,6 +290,7 @@
290290#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
291291#define __NR_rseq (__X32_SYSCALL_BIT + 334)
292292#define __NR_uretprobe (__X32_SYSCALL_BIT + 335)
293#define __NR_uprobe (__X32_SYSCALL_BIT + 336)
293294#define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424)
294295#define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425)
295296#define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426)
......@@ -336,6 +337,7 @@
336337#define __NR_open_tree_attr (__X32_SYSCALL_BIT + 467)
337338#define __NR_file_getattr (__X32_SYSCALL_BIT + 468)
338339#define __NR_file_setattr (__X32_SYSCALL_BIT + 469)
340#define __NR_listns (__X32_SYSCALL_BIT + 470)
339341#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
340342#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
341343#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/x86-linux-any/asm/vmx.h+6-1
......@@ -93,7 +93,10 @@
9393#define EXIT_REASON_TPAUSE 68
9494#define EXIT_REASON_BUS_LOCK 74
9595#define EXIT_REASON_NOTIFY 75
96#define EXIT_REASON_SEAMCALL 76
9697#define EXIT_REASON_TDCALL 77
98#define EXIT_REASON_MSR_READ_IMM 84
99#define EXIT_REASON_MSR_WRITE_IMM 85
97100
98101#define VMX_EXIT_REASONS \
99102 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
......@@ -158,7 +161,9 @@
158161 { EXIT_REASON_TPAUSE, "TPAUSE" }, \
159162 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
160163 { EXIT_REASON_NOTIFY, "NOTIFY" }, \
161 { EXIT_REASON_TDCALL, "TDCALL" }
164 { EXIT_REASON_TDCALL, "TDCALL" }, \
165 { EXIT_REASON_MSR_READ_IMM, "MSR_READ_IMM" }, \
166 { EXIT_REASON_MSR_WRITE_IMM, "MSR_WRITE_IMM" }
162167
163168#define VMX_EXIT_REASON_FLAGS \
164169 { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }
lib/libc/include/xtensa-linux-any/asm/unistd_32.h+1
......@@ -416,6 +416,7 @@
416416#define __NR_open_tree_attr 467
417417#define __NR_file_getattr 468
418418#define __NR_file_setattr 469
419#define __NR_listns 470
419420
420421
421422#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/std/Target.zig+1-1
......@@ -443,7 +443,7 @@ pub const Os = struct {
443443
444444 break :blk default_min;
445445 },
446 .max = .{ .major = 6, .minor = 17, .patch = 0 },
446 .max = .{ .major = 6, .minor = 19, .patch = 0 },
447447 },
448448 .glibc = blk: {
449449 // For 32-bit targets that traditionally used 32-bit time, we require
lib/std/os/linux.zig+1
......@@ -118,6 +118,7 @@ pub const SYS = switch (native_arch) {
118118 .arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
119119 .csky => syscalls.CSky,
120120 .hexagon => syscalls.Hexagon,
121 .loongarch32 => syscalls.LoongArch32,
121122 .loongarch64 => syscalls.LoongArch64,
122123 .m68k => syscalls.M68k,
123124 .mips, .mipsel => syscalls.MipsO32,
lib/std/os/linux/syscalls.zig+340-1
......@@ -1,5 +1,5 @@
11// This file is automatically generated by tools/generate_linux_syscalls.zig
2// This list current as of kernel: 6.18.2
2// This list current as of kernel: 6.19.0
33
44pub const X86 = enum(usize) {
55 restart_syscall = 0,
......@@ -461,6 +461,7 @@ pub const X86 = enum(usize) {
461461 open_tree_attr = 467,
462462 file_getattr = 468,
463463 file_setattr = 469,
464 listns = 470,
464465};
465466
466467pub const X64 = enum(usize) {
......@@ -847,6 +848,7 @@ pub const X64 = enum(usize) {
847848 open_tree_attr = 467,
848849 file_getattr = 468,
849850 file_setattr = 469,
851 listns = 470,
850852};
851853
852854pub const X32 = enum(usize) {
......@@ -1186,6 +1188,7 @@ pub const X32 = enum(usize) {
11861188 open_tree_attr = 1073742291,
11871189 file_getattr = 1073742292,
11881190 file_setattr = 1073742293,
1191 listns = 1073742294,
11891192 rt_sigaction = 1073742336,
11901193 rt_sigreturn = 1073742337,
11911194 ioctl = 1073742338,
......@@ -1649,6 +1652,7 @@ pub const Arm = enum(usize) {
16491652 open_tree_attr = 467,
16501653 file_getattr = 468,
16511654 file_setattr = 469,
1655 listns = 470,
16521656
16531657 breakpoint = arm_base + 1,
16541658 cacheflush = arm_base + 2,
......@@ -2097,6 +2101,7 @@ pub const Sparc = enum(usize) {
20972101 open_tree_attr = 467,
20982102 file_getattr = 468,
20992103 file_setattr = 469,
2104 listns = 470,
21002105};
21012106
21022107pub const Sparc64 = enum(usize) {
......@@ -2501,6 +2506,7 @@ pub const Sparc64 = enum(usize) {
25012506 open_tree_attr = 467,
25022507 file_getattr = 468,
25032508 file_setattr = 469,
2509 listns = 470,
25042510};
25052511
25062512pub const M68k = enum(usize) {
......@@ -2945,6 +2951,7 @@ pub const M68k = enum(usize) {
29452951 open_tree_attr = 467,
29462952 file_getattr = 468,
29472953 file_setattr = 469,
2954 listns = 470,
29482955};
29492956
29502957pub const MipsO32 = enum(usize) {
......@@ -3383,6 +3390,7 @@ pub const MipsO32 = enum(usize) {
33833390 open_tree_attr = 4467,
33843391 file_getattr = 4468,
33853392 file_setattr = 4469,
3393 listns = 4470,
33863394};
33873395
33883396pub const MipsN64 = enum(usize) {
......@@ -3757,6 +3765,7 @@ pub const MipsN64 = enum(usize) {
37573765 open_tree_attr = 5467,
37583766 file_getattr = 5468,
37593767 file_setattr = 5469,
3768 listns = 5470,
37603769};
37613770
37623771pub const MipsN32 = enum(usize) {
......@@ -4155,6 +4164,7 @@ pub const MipsN32 = enum(usize) {
41554164 open_tree_attr = 6467,
41564165 file_getattr = 6468,
41574166 file_setattr = 6469,
4167 listns = 6470,
41584168};
41594169
41604170pub const PowerPC = enum(usize) {
......@@ -4608,6 +4618,7 @@ pub const PowerPC = enum(usize) {
46084618 open_tree_attr = 467,
46094619 file_getattr = 468,
46104620 file_setattr = 469,
4621 listns = 470,
46114622};
46124623
46134624pub const PowerPC64 = enum(usize) {
......@@ -5033,6 +5044,7 @@ pub const PowerPC64 = enum(usize) {
50335044 open_tree_attr = 467,
50345045 file_getattr = 468,
50355046 file_setattr = 469,
5047 listns = 470,
50365048};
50375049
50385050pub const S390x = enum(usize) {
......@@ -5424,6 +5436,7 @@ pub const S390x = enum(usize) {
54245436 open_tree_attr = 467,
54255437 file_getattr = 468,
54265438 file_setattr = 469,
5439 listns = 470,
54275440};
54285441
54295442pub const Xtensa = enum(usize) {
......@@ -5819,6 +5832,7 @@ pub const Xtensa = enum(usize) {
58195832 open_tree_attr = 467,
58205833 file_getattr = 468,
58215834 file_setattr = 469,
5835 listns = 470,
58225836};
58235837
58245838pub const Arm64 = enum(usize) {
......@@ -6147,6 +6161,7 @@ pub const Arm64 = enum(usize) {
61476161 open_tree_attr = 467,
61486162 file_getattr = 468,
61496163 file_setattr = 469,
6164 listns = 470,
61506165};
61516166
61526167pub const RiscV32 = enum(usize) {
......@@ -6466,6 +6481,7 @@ pub const RiscV32 = enum(usize) {
64666481 open_tree_attr = 467,
64676482 file_getattr = 468,
64686483 file_setattr = 469,
6484 listns = 470,
64696485};
64706486
64716487pub const RiscV64 = enum(usize) {
......@@ -6795,6 +6811,324 @@ pub const RiscV64 = enum(usize) {
67956811 open_tree_attr = 467,
67966812 file_getattr = 468,
67976813 file_setattr = 469,
6814 listns = 470,
6815};
6816
6817pub const LoongArch32 = enum(usize) {
6818 io_setup = 0,
6819 io_destroy = 1,
6820 io_submit = 2,
6821 io_cancel = 3,
6822 setxattr = 5,
6823 lsetxattr = 6,
6824 fsetxattr = 7,
6825 getxattr = 8,
6826 lgetxattr = 9,
6827 fgetxattr = 10,
6828 listxattr = 11,
6829 llistxattr = 12,
6830 flistxattr = 13,
6831 removexattr = 14,
6832 lremovexattr = 15,
6833 fremovexattr = 16,
6834 getcwd = 17,
6835 lookup_dcookie = 18,
6836 eventfd2 = 19,
6837 epoll_create1 = 20,
6838 epoll_ctl = 21,
6839 epoll_pwait = 22,
6840 dup = 23,
6841 dup3 = 24,
6842 fcntl64 = 25,
6843 inotify_init1 = 26,
6844 inotify_add_watch = 27,
6845 inotify_rm_watch = 28,
6846 ioctl = 29,
6847 ioprio_set = 30,
6848 ioprio_get = 31,
6849 flock = 32,
6850 mknodat = 33,
6851 mkdirat = 34,
6852 unlinkat = 35,
6853 symlinkat = 36,
6854 linkat = 37,
6855 umount2 = 39,
6856 mount = 40,
6857 pivot_root = 41,
6858 nfsservctl = 42,
6859 statfs64 = 43,
6860 fstatfs64 = 44,
6861 truncate64 = 45,
6862 ftruncate64 = 46,
6863 fallocate = 47,
6864 faccessat = 48,
6865 chdir = 49,
6866 fchdir = 50,
6867 chroot = 51,
6868 fchmod = 52,
6869 fchmodat = 53,
6870 fchownat = 54,
6871 fchown = 55,
6872 openat = 56,
6873 close = 57,
6874 vhangup = 58,
6875 pipe2 = 59,
6876 quotactl = 60,
6877 getdents64 = 61,
6878 llseek = 62,
6879 read = 63,
6880 write = 64,
6881 readv = 65,
6882 writev = 66,
6883 pread64 = 67,
6884 pwrite64 = 68,
6885 preadv = 69,
6886 pwritev = 70,
6887 sendfile64 = 71,
6888 signalfd4 = 74,
6889 vmsplice = 75,
6890 splice = 76,
6891 tee = 77,
6892 readlinkat = 78,
6893 sync = 81,
6894 fsync = 82,
6895 fdatasync = 83,
6896 sync_file_range = 84,
6897 timerfd_create = 85,
6898 acct = 89,
6899 capget = 90,
6900 capset = 91,
6901 personality = 92,
6902 exit = 93,
6903 exit_group = 94,
6904 waitid = 95,
6905 set_tid_address = 96,
6906 unshare = 97,
6907 set_robust_list = 99,
6908 get_robust_list = 100,
6909 getitimer = 102,
6910 setitimer = 103,
6911 kexec_load = 104,
6912 init_module = 105,
6913 delete_module = 106,
6914 timer_create = 107,
6915 timer_getoverrun = 109,
6916 timer_delete = 111,
6917 syslog = 116,
6918 ptrace = 117,
6919 sched_setparam = 118,
6920 sched_setscheduler = 119,
6921 sched_getscheduler = 120,
6922 sched_getparam = 121,
6923 sched_setaffinity = 122,
6924 sched_getaffinity = 123,
6925 sched_yield = 124,
6926 sched_get_priority_max = 125,
6927 sched_get_priority_min = 126,
6928 restart_syscall = 128,
6929 kill = 129,
6930 tkill = 130,
6931 tgkill = 131,
6932 sigaltstack = 132,
6933 rt_sigsuspend = 133,
6934 rt_sigaction = 134,
6935 rt_sigprocmask = 135,
6936 rt_sigpending = 136,
6937 rt_sigqueueinfo = 138,
6938 rt_sigreturn = 139,
6939 setpriority = 140,
6940 getpriority = 141,
6941 reboot = 142,
6942 setregid = 143,
6943 setgid = 144,
6944 setreuid = 145,
6945 setuid = 146,
6946 setresuid = 147,
6947 getresuid = 148,
6948 setresgid = 149,
6949 getresgid = 150,
6950 setfsuid = 151,
6951 setfsgid = 152,
6952 times = 153,
6953 setpgid = 154,
6954 getpgid = 155,
6955 getsid = 156,
6956 setsid = 157,
6957 getgroups = 158,
6958 setgroups = 159,
6959 uname = 160,
6960 sethostname = 161,
6961 setdomainname = 162,
6962 getrusage = 165,
6963 umask = 166,
6964 prctl = 167,
6965 getcpu = 168,
6966 getpid = 172,
6967 getppid = 173,
6968 getuid = 174,
6969 geteuid = 175,
6970 getgid = 176,
6971 getegid = 177,
6972 gettid = 178,
6973 sysinfo = 179,
6974 mq_open = 180,
6975 mq_unlink = 181,
6976 mq_notify = 184,
6977 mq_getsetattr = 185,
6978 msgget = 186,
6979 msgctl = 187,
6980 msgrcv = 188,
6981 msgsnd = 189,
6982 semget = 190,
6983 semctl = 191,
6984 semop = 193,
6985 shmget = 194,
6986 shmctl = 195,
6987 shmat = 196,
6988 shmdt = 197,
6989 socket = 198,
6990 socketpair = 199,
6991 bind = 200,
6992 listen = 201,
6993 accept = 202,
6994 connect = 203,
6995 getsockname = 204,
6996 getpeername = 205,
6997 sendto = 206,
6998 recvfrom = 207,
6999 setsockopt = 208,
7000 getsockopt = 209,
7001 shutdown = 210,
7002 sendmsg = 211,
7003 recvmsg = 212,
7004 readahead = 213,
7005 brk = 214,
7006 munmap = 215,
7007 mremap = 216,
7008 add_key = 217,
7009 request_key = 218,
7010 keyctl = 219,
7011 clone = 220,
7012 execve = 221,
7013 mmap2 = 222,
7014 fadvise64_64 = 223,
7015 swapon = 224,
7016 swapoff = 225,
7017 mprotect = 226,
7018 msync = 227,
7019 mlock = 228,
7020 munlock = 229,
7021 mlockall = 230,
7022 munlockall = 231,
7023 mincore = 232,
7024 madvise = 233,
7025 remap_file_pages = 234,
7026 mbind = 235,
7027 get_mempolicy = 236,
7028 set_mempolicy = 237,
7029 migrate_pages = 238,
7030 move_pages = 239,
7031 rt_tgsigqueueinfo = 240,
7032 perf_event_open = 241,
7033 accept4 = 242,
7034 prlimit64 = 261,
7035 fanotify_init = 262,
7036 fanotify_mark = 263,
7037 name_to_handle_at = 264,
7038 open_by_handle_at = 265,
7039 syncfs = 267,
7040 setns = 268,
7041 sendmmsg = 269,
7042 process_vm_readv = 270,
7043 process_vm_writev = 271,
7044 kcmp = 272,
7045 finit_module = 273,
7046 sched_setattr = 274,
7047 sched_getattr = 275,
7048 renameat2 = 276,
7049 seccomp = 277,
7050 getrandom = 278,
7051 memfd_create = 279,
7052 bpf = 280,
7053 execveat = 281,
7054 userfaultfd = 282,
7055 membarrier = 283,
7056 mlock2 = 284,
7057 copy_file_range = 285,
7058 preadv2 = 286,
7059 pwritev2 = 287,
7060 pkey_mprotect = 288,
7061 pkey_alloc = 289,
7062 pkey_free = 290,
7063 statx = 291,
7064 rseq = 293,
7065 kexec_file_load = 294,
7066 clock_gettime64 = 403,
7067 clock_settime64 = 404,
7068 clock_adjtime64 = 405,
7069 clock_getres_time64 = 406,
7070 clock_nanosleep_time64 = 407,
7071 timer_gettime64 = 408,
7072 timer_settime64 = 409,
7073 timerfd_gettime64 = 410,
7074 timerfd_settime64 = 411,
7075 utimensat_time64 = 412,
7076 pselect6_time64 = 413,
7077 ppoll_time64 = 414,
7078 io_pgetevents_time64 = 416,
7079 recvmmsg_time64 = 417,
7080 mq_timedsend_time64 = 418,
7081 mq_timedreceive_time64 = 419,
7082 semtimedop_time64 = 420,
7083 rt_sigtimedwait_time64 = 421,
7084 futex_time64 = 422,
7085 sched_rr_get_interval_time64 = 423,
7086 pidfd_send_signal = 424,
7087 io_uring_setup = 425,
7088 io_uring_enter = 426,
7089 io_uring_register = 427,
7090 open_tree = 428,
7091 move_mount = 429,
7092 fsopen = 430,
7093 fsconfig = 431,
7094 fsmount = 432,
7095 fspick = 433,
7096 pidfd_open = 434,
7097 clone3 = 435,
7098 close_range = 436,
7099 openat2 = 437,
7100 pidfd_getfd = 438,
7101 faccessat2 = 439,
7102 process_madvise = 440,
7103 epoll_pwait2 = 441,
7104 mount_setattr = 442,
7105 quotactl_fd = 443,
7106 landlock_create_ruleset = 444,
7107 landlock_add_rule = 445,
7108 landlock_restrict_self = 446,
7109 process_mrelease = 448,
7110 futex_waitv = 449,
7111 set_mempolicy_home_node = 450,
7112 cachestat = 451,
7113 fchmodat2 = 452,
7114 map_shadow_stack = 453,
7115 futex_wake = 454,
7116 futex_wait = 455,
7117 futex_requeue = 456,
7118 statmount = 457,
7119 listmount = 458,
7120 lsm_get_self_attr = 459,
7121 lsm_set_self_attr = 460,
7122 lsm_list_modules = 461,
7123 mseal = 462,
7124 setxattrat = 463,
7125 getxattrat = 464,
7126 listxattrat = 465,
7127 removexattrat = 466,
7128 open_tree_attr = 467,
7129 file_getattr = 468,
7130 file_setattr = 469,
7131 listns = 470,
67987132};
67997133
68007134pub const LoongArch64 = enum(usize) {
......@@ -7119,6 +7453,7 @@ pub const LoongArch64 = enum(usize) {
71197453 open_tree_attr = 467,
71207454 file_getattr = 468,
71217455 file_setattr = 469,
7456 listns = 470,
71227457};
71237458
71247459pub const Arc = enum(usize) {
......@@ -7471,6 +7806,7 @@ pub const Arc = enum(usize) {
74717806 open_tree_attr = 467,
74727807 file_getattr = 468,
74737808 file_setattr = 469,
7809 listns = 470,
74747810};
74757811
74767812pub const CSky = enum(usize) {
......@@ -7819,6 +8155,7 @@ pub const CSky = enum(usize) {
78198155 open_tree_attr = 467,
78208156 file_getattr = 468,
78218157 file_setattr = 469,
8158 listns = 470,
78228159};
78238160
78248161pub const Hexagon = enum(usize) {
......@@ -8166,6 +8503,7 @@ pub const Hexagon = enum(usize) {
81668503 open_tree_attr = 467,
81678504 file_getattr = 468,
81688505 file_setattr = 469,
8506 listns = 470,
81698507};
81708508
81718509pub const OpenRisc = enum(usize) {
......@@ -8514,4 +8852,5 @@ pub const OpenRisc = enum(usize) {
85148852 open_tree_attr = 467,
85158853 file_getattr = 468,
85168854 file_setattr = 469,
8855 listns = 470,
85178856};
tools/generate_linux_syscalls.zig+5-3
......@@ -73,6 +73,7 @@ const Abi = enum {
7373 nios2,
7474 or1k,
7575 riscv,
76 hexagon,
7677};
7778
7879const __X32_SYSCALL_BIT: u32 = 0x40000000;
......@@ -158,10 +159,11 @@ const architectures: []const Arch = &.{
158159 .{ .@"var" = "Arm64", .table = .generic, .abi = &.{ .common, .@"64", .renameat, .rlimit, .memfd_secret } },
159160 .{ .@"var" = "RiscV32", .table = .generic, .abi = &.{ .common, .@"32", .riscv, .memfd_secret } },
160161 .{ .@"var" = "RiscV64", .table = .generic, .abi = &.{ .common, .@"64", .riscv, .rlimit, .memfd_secret } },
162 .{ .@"var" = "LoongArch32", .table = .generic, .abi = &.{ .common, .@"32" } },
161163 .{ .@"var" = "LoongArch64", .table = .generic, .abi = &.{ .common, .@"64" } },
162164 .{ .@"var" = "Arc", .table = .generic, .abi = &.{ .common, .@"32", .arc, .time32, .renameat, .stat64, .rlimit } },
163165 .{ .@"var" = "CSky", .table = .generic, .abi = &.{ .common, .@"32", .csky, .time32, .stat64, .rlimit } },
164 .{ .@"var" = "Hexagon", .table = .generic, .abi = &.{ .common, .@"32", .time32, .stat64, .rlimit, .renameat } },
166 .{ .@"var" = "Hexagon", .table = .generic, .abi = &.{ .common, .@"32", .hexagon, .time32, .stat64, .rlimit, .renameat } },
165167 .{ .@"var" = "OpenRisc", .table = .generic, .abi = &.{ .common, .@"32", .or1k, .time32, .stat64, .rlimit, .renameat } },
166168 // .{ .@"var" = "Nios2", .table = .generic, .abi = &.{ .common, .@"32", .nios2, .time32, .stat64, .rlimit, .renameat } },
167169 // .{ .@"var" = "Parisc", .table = .{ .specific = "arch/parisc/kernel/syscalls/syscall.tbl" }, .abi = &.{ .common, .@"32" } },
......@@ -250,8 +252,8 @@ pub fn main(init: std.process.Init) !void {
250252
251253fn usage(w: *std.Io.Writer, arg0: []const u8) std.Io.Writer.Error!void {
252254 try w.print(
253 \\Usage: {s} /path/to/zig /path/to/linux
254 \\Alternative Usage: zig run /path/to/git/zig/tools/generate_linux_syscalls.zig -- /path/to/zig /path/to/linux
255 \\Usage: {s} /path/to/linux
256 \\Alternative Usage: zig run /path/to/git/zig/tools/generate_linux_syscalls.zig -- /path/to/linux
255257 \\
256258 \\Generates the list of Linux syscalls for each supported cpu arch, using the Linux development tree.
257259 \\Prints to stdout Zig code which you can use to replace the file lib/std/os/linux/syscalls.zig.