authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-29 16:51:05-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-29 18:05:11-07:00
log19eaf54bc9ea8229dd0ae9e8e99865aba6fe4398
tree4c880f4cef886512213513b170024e51c145e866
parentec10e63f4945e81cfc5369a2c886ef0b7ae11c1b

update libc linux headers to v5.16-rc3

* Add missing Linux headers. Closes #9837 * Update existing headers to latest Linux. * Consolidate headers that are the same for multiple Zig target CPU architectures. For example, Linux has only an x86 directory for both x86_64 and x86 CPU architectures. Now Zig only ships an x86 directory for Linux headers, and will emit the proper corresponding -isystem flags. * tools/update-linux-headers.zig is now available for upgrading to newer Linux headers, and the update process is now documented on the wiki.

1144 files changed, 86008 insertions(+), 36629 deletions(-)

lib/libc/include/aarch64-linux-any/asm/auxvec.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_AUXVEC_H
18#define __ASM_AUXVEC_H
19
20/* vDSO location */
21#define AT_SYSINFO_EHDR 33
22#define AT_MINSIGSTKSZ 51 /* stack needed for signal delivery */
23
24#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
25
26#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/bitsperlong.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BITSPERLONG_H
18#define __ASM_BITSPERLONG_H
19
20#define __BITS_PER_LONG 64
21
22#include <asm-generic/bitsperlong.h>
23
24#endif /* __ASM_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/bpf_perf_event.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/byteorder.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BYTEORDER_H
18#define __ASM_BYTEORDER_H
19
20#ifdef __AARCH64EB__
21#include <linux/byteorder/big_endian.h>
22#else
23#include <linux/byteorder/little_endian.h>
24#endif
25
26#endif /* __ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/fcntl.h deleted-30
...@@ -1,30 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_FCNTL_H
18#define __ASM_FCNTL_H
19
20/*
21 * Using our own definitions for AArch32 (compat) support.
22 */
23#define O_DIRECTORY 040000 /* must be a directory */
24#define O_NOFOLLOW 0100000 /* don't follow links */
25#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
26#define O_LARGEFILE 0400000
27
28#include <asm-generic/fcntl.h>
29
30#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/hwcap.h deleted-52
...@@ -1,52 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_HWCAP_H
18#define __ASM_HWCAP_H
19
20/*
21 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
22 */
23#define HWCAP_FP (1 << 0)
24#define HWCAP_ASIMD (1 << 1)
25#define HWCAP_EVTSTRM (1 << 2)
26#define HWCAP_AES (1 << 3)
27#define HWCAP_PMULL (1 << 4)
28#define HWCAP_SHA1 (1 << 5)
29#define HWCAP_SHA2 (1 << 6)
30#define HWCAP_CRC32 (1 << 7)
31#define HWCAP_ATOMICS (1 << 8)
32#define HWCAP_FPHP (1 << 9)
33#define HWCAP_ASIMDHP (1 << 10)
34#define HWCAP_CPUID (1 << 11)
35#define HWCAP_ASIMDRDM (1 << 12)
36#define HWCAP_JSCVT (1 << 13)
37#define HWCAP_FCMA (1 << 14)
38#define HWCAP_LRCPC (1 << 15)
39#define HWCAP_DCPOP (1 << 16)
40#define HWCAP_SHA3 (1 << 17)
41#define HWCAP_SM3 (1 << 18)
42#define HWCAP_SM4 (1 << 19)
43#define HWCAP_ASIMDDP (1 << 20)
44#define HWCAP_SHA512 (1 << 21)
45#define HWCAP_SVE (1 << 22)
46#define HWCAP_ASIMDFHM (1 << 23)
47#define HWCAP_DIT (1 << 24)
48#define HWCAP_USCAT (1 << 25)
49#define HWCAP_ILRCPC (1 << 26)
50#define HWCAP_FLAGM (1 << 27)
51
52#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h deleted-310
...@@ -1,310 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012,2013 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 *
6 * Derived from arch/arm/include/uapi/asm/kvm.h:
7 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
8 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __ARM_KVM_H__
24#define __ARM_KVM_H__
25
26#define KVM_SPSR_EL1 0
27#define KVM_SPSR_SVC KVM_SPSR_EL1
28#define KVM_SPSR_ABT 1
29#define KVM_SPSR_UND 2
30#define KVM_SPSR_IRQ 3
31#define KVM_SPSR_FIQ 4
32#define KVM_NR_SPSR 5
33
34#ifndef __ASSEMBLY__
35#include <linux/psci.h>
36#include <linux/types.h>
37#include <asm/ptrace.h>
38
39#define __KVM_HAVE_GUEST_DEBUG
40#define __KVM_HAVE_IRQ_LINE
41#define __KVM_HAVE_READONLY_MEM
42#define __KVM_HAVE_VCPU_EVENTS
43
44#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
45
46#define KVM_REG_SIZE(id) \
47 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
48
49struct kvm_regs {
50 struct user_pt_regs regs; /* sp = sp_el0 */
51
52 __u64 sp_el1;
53 __u64 elr_el1;
54
55 __u64 spsr[KVM_NR_SPSR];
56
57 struct user_fpsimd_state fp_regs;
58};
59
60/*
61 * Supported CPU Targets - Adding a new target type is not recommended,
62 * unless there are some special registers not supported by the
63 * genericv8 syreg table.
64 */
65#define KVM_ARM_TARGET_AEM_V8 0
66#define KVM_ARM_TARGET_FOUNDATION_V8 1
67#define KVM_ARM_TARGET_CORTEX_A57 2
68#define KVM_ARM_TARGET_XGENE_POTENZA 3
69#define KVM_ARM_TARGET_CORTEX_A53 4
70/* Generic ARM v8 target */
71#define KVM_ARM_TARGET_GENERIC_V8 5
72
73#define KVM_ARM_NUM_TARGETS 6
74
75/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
76#define KVM_ARM_DEVICE_TYPE_SHIFT 0
77#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
78#define KVM_ARM_DEVICE_ID_SHIFT 16
79#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
80
81/* Supported device IDs */
82#define KVM_ARM_DEVICE_VGIC_V2 0
83
84/* Supported VGIC address types */
85#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
86#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
87
88#define KVM_VGIC_V2_DIST_SIZE 0x1000
89#define KVM_VGIC_V2_CPU_SIZE 0x2000
90
91/* Supported VGICv3 address types */
92#define KVM_VGIC_V3_ADDR_TYPE_DIST 2
93#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
94#define KVM_VGIC_ITS_ADDR_TYPE 4
95#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
96
97#define KVM_VGIC_V3_DIST_SIZE SZ_64K
98#define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
99#define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K)
100
101#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
102#define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */
103#define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */
104#define KVM_ARM_VCPU_PMU_V3 3 /* Support guest PMUv3 */
105
106struct kvm_vcpu_init {
107 __u32 target;
108 __u32 features[7];
109};
110
111struct kvm_sregs {
112};
113
114struct kvm_fpu {
115};
116
117/*
118 * See v8 ARM ARM D7.3: Debug Registers
119 *
120 * The architectural limit is 16 debug registers of each type although
121 * in practice there are usually less (see ID_AA64DFR0_EL1).
122 *
123 * Although the control registers are architecturally defined as 32
124 * bits wide we use a 64 bit structure here to keep parity with
125 * KVM_GET/SET_ONE_REG behaviour which treats all system registers as
126 * 64 bit values. It also allows for the possibility of the
127 * architecture expanding the control registers without having to
128 * change the userspace ABI.
129 */
130#define KVM_ARM_MAX_DBG_REGS 16
131struct kvm_guest_debug_arch {
132 __u64 dbg_bcr[KVM_ARM_MAX_DBG_REGS];
133 __u64 dbg_bvr[KVM_ARM_MAX_DBG_REGS];
134 __u64 dbg_wcr[KVM_ARM_MAX_DBG_REGS];
135 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
136};
137
138struct kvm_debug_exit_arch {
139 __u32 hsr;
140 __u64 far; /* used for watchpoints */
141};
142
143/*
144 * Architecture specific defines for kvm_guest_debug->control
145 */
146
147#define KVM_GUESTDBG_USE_SW_BP (1 << 16)
148#define KVM_GUESTDBG_USE_HW (1 << 17)
149
150struct kvm_sync_regs {
151 /* Used with KVM_CAP_ARM_USER_IRQ */
152 __u64 device_irq_level;
153};
154
155struct kvm_arch_memory_slot {
156};
157
158/* for KVM_GET/SET_VCPU_EVENTS */
159struct kvm_vcpu_events {
160 struct {
161 __u8 serror_pending;
162 __u8 serror_has_esr;
163 /* Align it to 8 bytes */
164 __u8 pad[6];
165 __u64 serror_esr;
166 } exception;
167 __u32 reserved[12];
168};
169
170/* If you need to interpret the index values, here is the key: */
171#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
172#define KVM_REG_ARM_COPROC_SHIFT 16
173
174/* Normal registers are mapped as coprocessor 16. */
175#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
176#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / sizeof(__u32))
177
178/* Some registers need more space to represent values. */
179#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
180#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
181#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
182#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
183#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
184#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
185
186/* AArch64 system registers */
187#define KVM_REG_ARM64_SYSREG (0x0013 << KVM_REG_ARM_COPROC_SHIFT)
188#define KVM_REG_ARM64_SYSREG_OP0_MASK 0x000000000000c000
189#define KVM_REG_ARM64_SYSREG_OP0_SHIFT 14
190#define KVM_REG_ARM64_SYSREG_OP1_MASK 0x0000000000003800
191#define KVM_REG_ARM64_SYSREG_OP1_SHIFT 11
192#define KVM_REG_ARM64_SYSREG_CRN_MASK 0x0000000000000780
193#define KVM_REG_ARM64_SYSREG_CRN_SHIFT 7
194#define KVM_REG_ARM64_SYSREG_CRM_MASK 0x0000000000000078
195#define KVM_REG_ARM64_SYSREG_CRM_SHIFT 3
196#define KVM_REG_ARM64_SYSREG_OP2_MASK 0x0000000000000007
197#define KVM_REG_ARM64_SYSREG_OP2_SHIFT 0
198
199#define ARM64_SYS_REG_SHIFT_MASK(x,n) \
200 (((x) << KVM_REG_ARM64_SYSREG_ ## n ## _SHIFT) & \
201 KVM_REG_ARM64_SYSREG_ ## n ## _MASK)
202
203#define __ARM64_SYS_REG(op0,op1,crn,crm,op2) \
204 (KVM_REG_ARM64 | KVM_REG_ARM64_SYSREG | \
205 ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | \
206 ARM64_SYS_REG_SHIFT_MASK(op1, OP1) | \
207 ARM64_SYS_REG_SHIFT_MASK(crn, CRN) | \
208 ARM64_SYS_REG_SHIFT_MASK(crm, CRM) | \
209 ARM64_SYS_REG_SHIFT_MASK(op2, OP2))
210
211#define ARM64_SYS_REG(...) (__ARM64_SYS_REG(__VA_ARGS__) | KVM_REG_SIZE_U64)
212
213/* Physical Timer EL0 Registers */
214#define KVM_REG_ARM_PTIMER_CTL ARM64_SYS_REG(3, 3, 14, 2, 1)
215#define KVM_REG_ARM_PTIMER_CVAL ARM64_SYS_REG(3, 3, 14, 2, 2)
216#define KVM_REG_ARM_PTIMER_CNT ARM64_SYS_REG(3, 3, 14, 0, 1)
217
218/* EL0 Virtual Timer Registers */
219#define KVM_REG_ARM_TIMER_CTL ARM64_SYS_REG(3, 3, 14, 3, 1)
220#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
221#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
222
223/* KVM-as-firmware specific pseudo-registers */
224#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
225#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
226 KVM_REG_ARM_FW | ((r) & 0xffff))
227#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
228
229/* Device Control API: ARM VGIC */
230#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
231#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
232#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
233#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
234#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
235#define KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT 32
236#define KVM_DEV_ARM_VGIC_V3_MPIDR_MASK \
237 (0xffffffffULL << KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT)
238#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
239#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
240#define KVM_DEV_ARM_VGIC_SYSREG_INSTR_MASK (0xffff)
241#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS 3
242#define KVM_DEV_ARM_VGIC_GRP_CTRL 4
243#define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5
244#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
245#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
246#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
247#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
248#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
249 (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
250#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff
251#define VGIC_LEVEL_INFO_LINE_LEVEL 0
252
253#define KVM_DEV_ARM_VGIC_CTRL_INIT 0
254#define KVM_DEV_ARM_ITS_SAVE_TABLES 1
255#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2
256#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3
257#define KVM_DEV_ARM_ITS_CTRL_RESET 4
258
259/* Device Control API on vcpu fd */
260#define KVM_ARM_VCPU_PMU_V3_CTRL 0
261#define KVM_ARM_VCPU_PMU_V3_IRQ 0
262#define KVM_ARM_VCPU_PMU_V3_INIT 1
263#define KVM_ARM_VCPU_TIMER_CTRL 1
264#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
265#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
266
267/* KVM_IRQ_LINE irq field index values */
268#define KVM_ARM_IRQ_TYPE_SHIFT 24
269#define KVM_ARM_IRQ_TYPE_MASK 0xff
270#define KVM_ARM_IRQ_VCPU_SHIFT 16
271#define KVM_ARM_IRQ_VCPU_MASK 0xff
272#define KVM_ARM_IRQ_NUM_SHIFT 0
273#define KVM_ARM_IRQ_NUM_MASK 0xffff
274
275/* irq_type field */
276#define KVM_ARM_IRQ_TYPE_CPU 0
277#define KVM_ARM_IRQ_TYPE_SPI 1
278#define KVM_ARM_IRQ_TYPE_PPI 2
279
280/* out-of-kernel GIC cpu interrupt injection irq_number field */
281#define KVM_ARM_IRQ_CPU_IRQ 0
282#define KVM_ARM_IRQ_CPU_FIQ 1
283
284/*
285 * This used to hold the highest supported SPI, but it is now obsolete
286 * and only here to provide source code level compatibility with older
287 * userland. The highest SPI number can be set via KVM_DEV_ARM_VGIC_GRP_NR_IRQS.
288 */
289#define KVM_ARM_IRQ_GIC_MAX 127
290
291/* One single KVM irqchip, ie. the VGIC */
292#define KVM_NR_IRQCHIPS 1
293
294/* PSCI interface */
295#define KVM_PSCI_FN_BASE 0x95c1ba5e
296#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
297
298#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
299#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
300#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
301#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
302
303#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
304#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
305#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
306#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
307
308#endif
309
310#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm_para.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/kvm_para.h>
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/param.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_PARAM_H
18#define __ASM_PARAM_H
19
20#define EXEC_PAGESIZE 65536
21
22#include <asm-generic/param.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/perf_regs.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_ARM64_PERF_REGS_H
3#define _ASM_ARM64_PERF_REGS_H
4
5enum perf_event_arm_regs {
6 PERF_REG_ARM64_X0,
7 PERF_REG_ARM64_X1,
8 PERF_REG_ARM64_X2,
9 PERF_REG_ARM64_X3,
10 PERF_REG_ARM64_X4,
11 PERF_REG_ARM64_X5,
12 PERF_REG_ARM64_X6,
13 PERF_REG_ARM64_X7,
14 PERF_REG_ARM64_X8,
15 PERF_REG_ARM64_X9,
16 PERF_REG_ARM64_X10,
17 PERF_REG_ARM64_X11,
18 PERF_REG_ARM64_X12,
19 PERF_REG_ARM64_X13,
20 PERF_REG_ARM64_X14,
21 PERF_REG_ARM64_X15,
22 PERF_REG_ARM64_X16,
23 PERF_REG_ARM64_X17,
24 PERF_REG_ARM64_X18,
25 PERF_REG_ARM64_X19,
26 PERF_REG_ARM64_X20,
27 PERF_REG_ARM64_X21,
28 PERF_REG_ARM64_X22,
29 PERF_REG_ARM64_X23,
30 PERF_REG_ARM64_X24,
31 PERF_REG_ARM64_X25,
32 PERF_REG_ARM64_X26,
33 PERF_REG_ARM64_X27,
34 PERF_REG_ARM64_X28,
35 PERF_REG_ARM64_X29,
36 PERF_REG_ARM64_LR,
37 PERF_REG_ARM64_SP,
38 PERF_REG_ARM64_PC,
39 PERF_REG_ARM64_MAX,
40};
41#endif /* _ASM_ARM64_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/posix_types.h deleted-11
...@@ -1,11 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POSIX_TYPES_H
3#define __ASM_POSIX_TYPES_H
4
5typedef unsigned short __kernel_old_uid_t;
6typedef unsigned short __kernel_old_gid_t;
7#define __kernel_old_uid_t __kernel_old_uid_t
8
9#include <asm-generic/posix_types.h>
10
11#endif /* __ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/ptrace.h deleted-233
...@@ -1,233 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/ptrace.h
4 *
5 * Copyright (C) 1996-2003 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_PTRACE_H
21#define __ASM_PTRACE_H
22
23#include <linux/types.h>
24
25#include <asm/hwcap.h>
26#include <asm/sigcontext.h>
27
28
29/*
30 * PSR bits
31 */
32#define PSR_MODE_EL0t 0x00000000
33#define PSR_MODE_EL1t 0x00000004
34#define PSR_MODE_EL1h 0x00000005
35#define PSR_MODE_EL2t 0x00000008
36#define PSR_MODE_EL2h 0x00000009
37#define PSR_MODE_EL3t 0x0000000c
38#define PSR_MODE_EL3h 0x0000000d
39#define PSR_MODE_MASK 0x0000000f
40
41/* AArch32 CPSR bits */
42#define PSR_MODE32_BIT 0x00000010
43
44/* AArch64 SPSR bits */
45#define PSR_F_BIT 0x00000040
46#define PSR_I_BIT 0x00000080
47#define PSR_A_BIT 0x00000100
48#define PSR_D_BIT 0x00000200
49#define PSR_PAN_BIT 0x00400000
50#define PSR_UAO_BIT 0x00800000
51#define PSR_V_BIT 0x10000000
52#define PSR_C_BIT 0x20000000
53#define PSR_Z_BIT 0x40000000
54#define PSR_N_BIT 0x80000000
55
56/*
57 * Groups of PSR bits
58 */
59#define PSR_f 0xff000000 /* Flags */
60#define PSR_s 0x00ff0000 /* Status */
61#define PSR_x 0x0000ff00 /* Extension */
62#define PSR_c 0x000000ff /* Control */
63
64
65#ifndef __ASSEMBLY__
66
67#include <linux/prctl.h>
68
69/*
70 * User structures for general purpose, floating point and debug registers.
71 */
72struct user_pt_regs {
73 __u64 regs[31];
74 __u64 sp;
75 __u64 pc;
76 __u64 pstate;
77};
78
79struct user_fpsimd_state {
80 __uint128_t vregs[32];
81 __u32 fpsr;
82 __u32 fpcr;
83 __u32 __reserved[2];
84};
85
86struct user_hwdebug_state {
87 __u32 dbg_info;
88 __u32 pad;
89 struct {
90 __u64 addr;
91 __u32 ctrl;
92 __u32 pad;
93 } dbg_regs[16];
94};
95
96/* SVE/FP/SIMD state (NT_ARM_SVE) */
97
98struct user_sve_header {
99 __u32 size; /* total meaningful regset content in bytes */
100 __u32 max_size; /* maxmium possible size for this thread */
101 __u16 vl; /* current vector length */
102 __u16 max_vl; /* maximum possible vector length */
103 __u16 flags;
104 __u16 __reserved;
105};
106
107/* Definitions for user_sve_header.flags: */
108#define SVE_PT_REGS_MASK (1 << 0)
109
110#define SVE_PT_REGS_FPSIMD 0
111#define SVE_PT_REGS_SVE SVE_PT_REGS_MASK
112
113/*
114 * Common SVE_PT_* flags:
115 * These must be kept in sync with prctl interface in <linux/ptrace.h>
116 */
117#define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16)
118#define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16)
119
120
121/*
122 * The remainder of the SVE state follows struct user_sve_header. The
123 * total size of the SVE state (including header) depends on the
124 * metadata in the header: SVE_PT_SIZE(vq, flags) gives the total size
125 * of the state in bytes, including the header.
126 *
127 * Refer to <asm/sigcontext.h> for details of how to pass the correct
128 * "vq" argument to these macros.
129 */
130
131/* Offset from the start of struct user_sve_header to the register data */
132#define SVE_PT_REGS_OFFSET \
133 ((sizeof(struct user_sve_header) + (SVE_VQ_BYTES - 1)) \
134 / SVE_VQ_BYTES * SVE_VQ_BYTES)
135
136/*
137 * The register data content and layout depends on the value of the
138 * flags field.
139 */
140
141/*
142 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_FPSIMD case:
143 *
144 * The payload starts at offset SVE_PT_FPSIMD_OFFSET, and is of type
145 * struct user_fpsimd_state. Additional data might be appended in the
146 * future: use SVE_PT_FPSIMD_SIZE(vq, flags) to compute the total size.
147 * SVE_PT_FPSIMD_SIZE(vq, flags) will never be less than
148 * sizeof(struct user_fpsimd_state).
149 */
150
151#define SVE_PT_FPSIMD_OFFSET SVE_PT_REGS_OFFSET
152
153#define SVE_PT_FPSIMD_SIZE(vq, flags) (sizeof(struct user_fpsimd_state))
154
155/*
156 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE case:
157 *
158 * The payload starts at offset SVE_PT_SVE_OFFSET, and is of size
159 * SVE_PT_SVE_SIZE(vq, flags).
160 *
161 * Additional macros describe the contents and layout of the payload.
162 * For each, SVE_PT_SVE_x_OFFSET(args) is the start offset relative to
163 * the start of struct user_sve_header, and SVE_PT_SVE_x_SIZE(args) is
164 * the size in bytes:
165 *
166 * x type description
167 * - ---- -----------
168 * ZREGS \
169 * ZREG |
170 * PREGS | refer to <asm/sigcontext.h>
171 * PREG |
172 * FFR /
173 *
174 * FPSR uint32_t FPSR
175 * FPCR uint32_t FPCR
176 *
177 * Additional data might be appended in the future.
178 */
179
180#define SVE_PT_SVE_ZREG_SIZE(vq) SVE_SIG_ZREG_SIZE(vq)
181#define SVE_PT_SVE_PREG_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
182#define SVE_PT_SVE_FFR_SIZE(vq) SVE_SIG_FFR_SIZE(vq)
183#define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
184#define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
185
186#define __SVE_SIG_TO_PT(offset) \
187 ((offset) - SVE_SIG_REGS_OFFSET + SVE_PT_REGS_OFFSET)
188
189#define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
190
191#define SVE_PT_SVE_ZREGS_OFFSET \
192 __SVE_SIG_TO_PT(SVE_SIG_ZREGS_OFFSET)
193#define SVE_PT_SVE_ZREG_OFFSET(vq, n) \
194 __SVE_SIG_TO_PT(SVE_SIG_ZREG_OFFSET(vq, n))
195#define SVE_PT_SVE_ZREGS_SIZE(vq) \
196 (SVE_PT_SVE_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
197
198#define SVE_PT_SVE_PREGS_OFFSET(vq) \
199 __SVE_SIG_TO_PT(SVE_SIG_PREGS_OFFSET(vq))
200#define SVE_PT_SVE_PREG_OFFSET(vq, n) \
201 __SVE_SIG_TO_PT(SVE_SIG_PREG_OFFSET(vq, n))
202#define SVE_PT_SVE_PREGS_SIZE(vq) \
203 (SVE_PT_SVE_PREG_OFFSET(vq, SVE_NUM_PREGS) - \
204 SVE_PT_SVE_PREGS_OFFSET(vq))
205
206#define SVE_PT_SVE_FFR_OFFSET(vq) \
207 __SVE_SIG_TO_PT(SVE_SIG_FFR_OFFSET(vq))
208
209#define SVE_PT_SVE_FPSR_OFFSET(vq) \
210 ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + \
211 (SVE_VQ_BYTES - 1)) \
212 / SVE_VQ_BYTES * SVE_VQ_BYTES)
213#define SVE_PT_SVE_FPCR_OFFSET(vq) \
214 (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
215
216/*
217 * Any future extension appended after FPCR must be aligned to the next
218 * 128-bit boundary.
219 */
220
221#define SVE_PT_SVE_SIZE(vq, flags) \
222 ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE \
223 - SVE_PT_SVE_OFFSET + (SVE_VQ_BYTES - 1)) \
224 / SVE_VQ_BYTES * SVE_VQ_BYTES)
225
226#define SVE_PT_SIZE(vq, flags) \
227 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
228 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
229 : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
230
231#endif /* __ASSEMBLY__ */
232
233#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/setup.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/setup.h
4 *
5 * Copyright (C) 1997-1999 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_SETUP_H
21#define __ASM_SETUP_H
22
23#include <linux/types.h>
24
25#define COMMAND_LINE_SIZE 2048
26
27#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/sigcontext.h deleted-238
...@@ -1,238 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGCONTEXT_H
18#define __ASM_SIGCONTEXT_H
19
20#ifndef __ASSEMBLY__
21
22#include <linux/types.h>
23
24/*
25 * Signal context structure - contains all info to do with the state
26 * before the signal handler was invoked.
27 */
28struct sigcontext {
29 __u64 fault_address;
30 /* AArch64 registers */
31 __u64 regs[31];
32 __u64 sp;
33 __u64 pc;
34 __u64 pstate;
35 /* 4K reserved for FP/SIMD state and future expansion */
36 __u8 __reserved[4096] __attribute__((__aligned__(16)));
37};
38
39/*
40 * Allocation of __reserved[]:
41 * (Note: records do not necessarily occur in the order shown here.)
42 *
43 * size description
44 *
45 * 0x210 fpsimd_context
46 * 0x10 esr_context
47 * 0x8a0 sve_context (vl <= 64) (optional)
48 * 0x20 extra_context (optional)
49 * 0x10 terminator (null _aarch64_ctx)
50 *
51 * 0x510 (reserved for future allocation)
52 *
53 * New records that can exceed this space need to be opt-in for userspace, so
54 * that an expanded signal frame is not generated unexpectedly. The mechanism
55 * for opting in will depend on the extension that generates each new record.
56 * The above table documents the maximum set and sizes of records than can be
57 * generated when userspace does not opt in for any such extension.
58 */
59
60/*
61 * Header to be used at the beginning of structures extending the user
62 * context. Such structures must be placed after the rt_sigframe on the stack
63 * and be 16-byte aligned. The last structure must be a dummy one with the
64 * magic and size set to 0.
65 */
66struct _aarch64_ctx {
67 __u32 magic;
68 __u32 size;
69};
70
71#define FPSIMD_MAGIC 0x46508001
72
73struct fpsimd_context {
74 struct _aarch64_ctx head;
75 __u32 fpsr;
76 __u32 fpcr;
77 __uint128_t vregs[32];
78};
79
80/* ESR_EL1 context */
81#define ESR_MAGIC 0x45535201
82
83struct esr_context {
84 struct _aarch64_ctx head;
85 __u64 esr;
86};
87
88/*
89 * extra_context: describes extra space in the signal frame for
90 * additional structures that don't fit in sigcontext.__reserved[].
91 *
92 * Note:
93 *
94 * 1) fpsimd_context, esr_context and extra_context must be placed in
95 * sigcontext.__reserved[] if present. They cannot be placed in the
96 * extra space. Any other record can be placed either in the extra
97 * space or in sigcontext.__reserved[], unless otherwise specified in
98 * this file.
99 *
100 * 2) There must not be more than one extra_context.
101 *
102 * 3) If extra_context is present, it must be followed immediately in
103 * sigcontext.__reserved[] by the terminating null _aarch64_ctx.
104 *
105 * 4) The extra space to which datap points must start at the first
106 * 16-byte aligned address immediately after the terminating null
107 * _aarch64_ctx that follows the extra_context structure in
108 * __reserved[]. The extra space may overrun the end of __reserved[],
109 * as indicated by a sufficiently large value for the size field.
110 *
111 * 5) The extra space must itself be terminated with a null
112 * _aarch64_ctx.
113 */
114#define EXTRA_MAGIC 0x45585401
115
116struct extra_context {
117 struct _aarch64_ctx head;
118 __u64 datap; /* 16-byte aligned pointer to extra space cast to __u64 */
119 __u32 size; /* size in bytes of the extra space */
120 __u32 __reserved[3];
121};
122
123#define SVE_MAGIC 0x53564501
124
125struct sve_context {
126 struct _aarch64_ctx head;
127 __u16 vl;
128 __u16 __reserved[3];
129};
130
131#endif /* !__ASSEMBLY__ */
132
133/*
134 * The SVE architecture leaves space for future expansion of the
135 * vector length beyond its initial architectural limit of 2048 bits
136 * (16 quadwords).
137 *
138 * See linux/Documentation/arm64/sve.txt for a description of the VL/VQ
139 * terminology.
140 */
141#define SVE_VQ_BYTES 16 /* number of bytes per quadword */
142
143#define SVE_VQ_MIN 1
144#define SVE_VQ_MAX 512
145
146#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
147#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
148
149#define SVE_NUM_ZREGS 32
150#define SVE_NUM_PREGS 16
151
152#define sve_vl_valid(vl) \
153 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
154#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
155#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
156
157/*
158 * If the SVE registers are currently live for the thread at signal delivery,
159 * sve_context.head.size >=
160 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl))
161 * and the register data may be accessed using the SVE_SIG_*() macros.
162 *
163 * If sve_context.head.size <
164 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)),
165 * the SVE registers were not live for the thread and no register data
166 * is included: in this case, the SVE_SIG_*() macros should not be
167 * used except for this check.
168 *
169 * The same convention applies when returning from a signal: a caller
170 * will need to remove or resize the sve_context block if it wants to
171 * make the SVE registers live when they were previously non-live or
172 * vice-versa. This may require the the caller to allocate fresh
173 * memory and/or move other context blocks in the signal frame.
174 *
175 * Changing the vector length during signal return is not permitted:
176 * sve_context.vl must equal the thread's current vector length when
177 * doing a sigreturn.
178 *
179 *
180 * Note: for all these macros, the "vq" argument denotes the SVE
181 * vector length in quadwords (i.e., units of 128 bits).
182 *
183 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The
184 * result is valid if and only if sve_vl_valid(vl) is true. This is
185 * guaranteed for a struct sve_context written by the kernel.
186 *
187 *
188 * Additional macros describe the contents and layout of the payload.
189 * For each, SVE_SIG_x_OFFSET(args) is the start offset relative to
190 * the start of struct sve_context, and SVE_SIG_x_SIZE(args) is the
191 * size in bytes:
192 *
193 * x type description
194 * - ---- -----------
195 * REGS the entire SVE context
196 *
197 * ZREGS __uint128_t[SVE_NUM_ZREGS][vq] all Z-registers
198 * ZREG __uint128_t[vq] individual Z-register Zn
199 *
200 * PREGS uint16_t[SVE_NUM_PREGS][vq] all P-registers
201 * PREG uint16_t[vq] individual P-register Pn
202 *
203 * FFR uint16_t[vq] first-fault status register
204 *
205 * Additional data might be appended in the future.
206 */
207
208#define SVE_SIG_ZREG_SIZE(vq) ((__u32)(vq) * SVE_VQ_BYTES)
209#define SVE_SIG_PREG_SIZE(vq) ((__u32)(vq) * (SVE_VQ_BYTES / 8))
210#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
211
212#define SVE_SIG_REGS_OFFSET \
213 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
214 / SVE_VQ_BYTES * SVE_VQ_BYTES)
215
216#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
217#define SVE_SIG_ZREG_OFFSET(vq, n) \
218 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
219#define SVE_SIG_ZREGS_SIZE(vq) \
220 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
221
222#define SVE_SIG_PREGS_OFFSET(vq) \
223 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
224#define SVE_SIG_PREG_OFFSET(vq, n) \
225 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
226#define SVE_SIG_PREGS_SIZE(vq) \
227 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
228
229#define SVE_SIG_FFR_OFFSET(vq) \
230 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
231
232#define SVE_SIG_REGS_SIZE(vq) \
233 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
234
235#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
236
237
238#endif /* __ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/siginfo.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGINFO_H
18#define __ASM_SIGINFO_H
19
20#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
21
22#include <asm-generic/siginfo.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/signal.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGNAL_H
18#define __ASM_SIGNAL_H
19
20/* Required for AArch32 compatibility. */
21#define SA_RESTORER 0x04000000
22
23#define MINSIGSTKSZ 5120
24#define SIGSTKSZ 16384
25
26#include <asm-generic/signal.h>
27
28#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/stat.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#include <asm-generic/stat.h>
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/statfs.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_STATFS_H
18#define __ASM_STATFS_H
19
20#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
21
22#include <asm-generic/statfs.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/ucontext.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_UCONTEXT_H
18#define __ASM_UCONTEXT_H
19
20#include <linux/types.h>
21
22struct ucontext {
23 unsigned long uc_flags;
24 struct ucontext *uc_link;
25 stack_t uc_stack;
26 sigset_t uc_sigmask;
27 /* glibc uses a 1024-bit sigset_t */
28 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
29 /* last for future expansion */
30 struct sigcontext uc_mcontext;
31};
32
33#endif /* __ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/unistd.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#define __ARCH_WANT_RENAMEAT
19
20#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/auxvec.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_AUXVEC_H
18#define __ASM_AUXVEC_H
19
20/* vDSO location */
21#define AT_SYSINFO_EHDR 33
22#define AT_MINSIGSTKSZ 51 /* stack needed for signal delivery */
23
24#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
25
26#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/bitsperlong.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BITSPERLONG_H
18#define __ASM_BITSPERLONG_H
19
20#define __BITS_PER_LONG 64
21
22#include <asm-generic/bitsperlong.h>
23
24#endif /* __ASM_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/bpf_perf_event.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/byteorder.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BYTEORDER_H
18#define __ASM_BYTEORDER_H
19
20#ifdef __AARCH64EB__
21#include <linux/byteorder/big_endian.h>
22#else
23#include <linux/byteorder/little_endian.h>
24#endif
25
26#endif /* __ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/fcntl.h deleted-30
...@@ -1,30 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_FCNTL_H
18#define __ASM_FCNTL_H
19
20/*
21 * Using our own definitions for AArch32 (compat) support.
22 */
23#define O_DIRECTORY 040000 /* must be a directory */
24#define O_NOFOLLOW 0100000 /* don't follow links */
25#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
26#define O_LARGEFILE 0400000
27
28#include <asm-generic/fcntl.h>
29
30#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/hwcap.h deleted-52
...@@ -1,52 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_HWCAP_H
18#define __ASM_HWCAP_H
19
20/*
21 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
22 */
23#define HWCAP_FP (1 << 0)
24#define HWCAP_ASIMD (1 << 1)
25#define HWCAP_EVTSTRM (1 << 2)
26#define HWCAP_AES (1 << 3)
27#define HWCAP_PMULL (1 << 4)
28#define HWCAP_SHA1 (1 << 5)
29#define HWCAP_SHA2 (1 << 6)
30#define HWCAP_CRC32 (1 << 7)
31#define HWCAP_ATOMICS (1 << 8)
32#define HWCAP_FPHP (1 << 9)
33#define HWCAP_ASIMDHP (1 << 10)
34#define HWCAP_CPUID (1 << 11)
35#define HWCAP_ASIMDRDM (1 << 12)
36#define HWCAP_JSCVT (1 << 13)
37#define HWCAP_FCMA (1 << 14)
38#define HWCAP_LRCPC (1 << 15)
39#define HWCAP_DCPOP (1 << 16)
40#define HWCAP_SHA3 (1 << 17)
41#define HWCAP_SM3 (1 << 18)
42#define HWCAP_SM4 (1 << 19)
43#define HWCAP_ASIMDDP (1 << 20)
44#define HWCAP_SHA512 (1 << 21)
45#define HWCAP_SVE (1 << 22)
46#define HWCAP_ASIMDFHM (1 << 23)
47#define HWCAP_DIT (1 << 24)
48#define HWCAP_USCAT (1 << 25)
49#define HWCAP_ILRCPC (1 << 26)
50#define HWCAP_FLAGM (1 << 27)
51
52#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/kvm.h deleted-310
...@@ -1,310 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012,2013 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 *
6 * Derived from arch/arm/include/uapi/asm/kvm.h:
7 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
8 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __ARM_KVM_H__
24#define __ARM_KVM_H__
25
26#define KVM_SPSR_EL1 0
27#define KVM_SPSR_SVC KVM_SPSR_EL1
28#define KVM_SPSR_ABT 1
29#define KVM_SPSR_UND 2
30#define KVM_SPSR_IRQ 3
31#define KVM_SPSR_FIQ 4
32#define KVM_NR_SPSR 5
33
34#ifndef __ASSEMBLY__
35#include <linux/psci.h>
36#include <linux/types.h>
37#include <asm/ptrace.h>
38
39#define __KVM_HAVE_GUEST_DEBUG
40#define __KVM_HAVE_IRQ_LINE
41#define __KVM_HAVE_READONLY_MEM
42#define __KVM_HAVE_VCPU_EVENTS
43
44#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
45
46#define KVM_REG_SIZE(id) \
47 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
48
49struct kvm_regs {
50 struct user_pt_regs regs; /* sp = sp_el0 */
51
52 __u64 sp_el1;
53 __u64 elr_el1;
54
55 __u64 spsr[KVM_NR_SPSR];
56
57 struct user_fpsimd_state fp_regs;
58};
59
60/*
61 * Supported CPU Targets - Adding a new target type is not recommended,
62 * unless there are some special registers not supported by the
63 * genericv8 syreg table.
64 */
65#define KVM_ARM_TARGET_AEM_V8 0
66#define KVM_ARM_TARGET_FOUNDATION_V8 1
67#define KVM_ARM_TARGET_CORTEX_A57 2
68#define KVM_ARM_TARGET_XGENE_POTENZA 3
69#define KVM_ARM_TARGET_CORTEX_A53 4
70/* Generic ARM v8 target */
71#define KVM_ARM_TARGET_GENERIC_V8 5
72
73#define KVM_ARM_NUM_TARGETS 6
74
75/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
76#define KVM_ARM_DEVICE_TYPE_SHIFT 0
77#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
78#define KVM_ARM_DEVICE_ID_SHIFT 16
79#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
80
81/* Supported device IDs */
82#define KVM_ARM_DEVICE_VGIC_V2 0
83
84/* Supported VGIC address types */
85#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
86#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
87
88#define KVM_VGIC_V2_DIST_SIZE 0x1000
89#define KVM_VGIC_V2_CPU_SIZE 0x2000
90
91/* Supported VGICv3 address types */
92#define KVM_VGIC_V3_ADDR_TYPE_DIST 2
93#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
94#define KVM_VGIC_ITS_ADDR_TYPE 4
95#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
96
97#define KVM_VGIC_V3_DIST_SIZE SZ_64K
98#define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
99#define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K)
100
101#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
102#define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */
103#define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */
104#define KVM_ARM_VCPU_PMU_V3 3 /* Support guest PMUv3 */
105
106struct kvm_vcpu_init {
107 __u32 target;
108 __u32 features[7];
109};
110
111struct kvm_sregs {
112};
113
114struct kvm_fpu {
115};
116
117/*
118 * See v8 ARM ARM D7.3: Debug Registers
119 *
120 * The architectural limit is 16 debug registers of each type although
121 * in practice there are usually less (see ID_AA64DFR0_EL1).
122 *
123 * Although the control registers are architecturally defined as 32
124 * bits wide we use a 64 bit structure here to keep parity with
125 * KVM_GET/SET_ONE_REG behaviour which treats all system registers as
126 * 64 bit values. It also allows for the possibility of the
127 * architecture expanding the control registers without having to
128 * change the userspace ABI.
129 */
130#define KVM_ARM_MAX_DBG_REGS 16
131struct kvm_guest_debug_arch {
132 __u64 dbg_bcr[KVM_ARM_MAX_DBG_REGS];
133 __u64 dbg_bvr[KVM_ARM_MAX_DBG_REGS];
134 __u64 dbg_wcr[KVM_ARM_MAX_DBG_REGS];
135 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
136};
137
138struct kvm_debug_exit_arch {
139 __u32 hsr;
140 __u64 far; /* used for watchpoints */
141};
142
143/*
144 * Architecture specific defines for kvm_guest_debug->control
145 */
146
147#define KVM_GUESTDBG_USE_SW_BP (1 << 16)
148#define KVM_GUESTDBG_USE_HW (1 << 17)
149
150struct kvm_sync_regs {
151 /* Used with KVM_CAP_ARM_USER_IRQ */
152 __u64 device_irq_level;
153};
154
155struct kvm_arch_memory_slot {
156};
157
158/* for KVM_GET/SET_VCPU_EVENTS */
159struct kvm_vcpu_events {
160 struct {
161 __u8 serror_pending;
162 __u8 serror_has_esr;
163 /* Align it to 8 bytes */
164 __u8 pad[6];
165 __u64 serror_esr;
166 } exception;
167 __u32 reserved[12];
168};
169
170/* If you need to interpret the index values, here is the key: */
171#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
172#define KVM_REG_ARM_COPROC_SHIFT 16
173
174/* Normal registers are mapped as coprocessor 16. */
175#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
176#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / sizeof(__u32))
177
178/* Some registers need more space to represent values. */
179#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
180#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
181#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
182#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
183#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
184#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
185
186/* AArch64 system registers */
187#define KVM_REG_ARM64_SYSREG (0x0013 << KVM_REG_ARM_COPROC_SHIFT)
188#define KVM_REG_ARM64_SYSREG_OP0_MASK 0x000000000000c000
189#define KVM_REG_ARM64_SYSREG_OP0_SHIFT 14
190#define KVM_REG_ARM64_SYSREG_OP1_MASK 0x0000000000003800
191#define KVM_REG_ARM64_SYSREG_OP1_SHIFT 11
192#define KVM_REG_ARM64_SYSREG_CRN_MASK 0x0000000000000780
193#define KVM_REG_ARM64_SYSREG_CRN_SHIFT 7
194#define KVM_REG_ARM64_SYSREG_CRM_MASK 0x0000000000000078
195#define KVM_REG_ARM64_SYSREG_CRM_SHIFT 3
196#define KVM_REG_ARM64_SYSREG_OP2_MASK 0x0000000000000007
197#define KVM_REG_ARM64_SYSREG_OP2_SHIFT 0
198
199#define ARM64_SYS_REG_SHIFT_MASK(x,n) \
200 (((x) << KVM_REG_ARM64_SYSREG_ ## n ## _SHIFT) & \
201 KVM_REG_ARM64_SYSREG_ ## n ## _MASK)
202
203#define __ARM64_SYS_REG(op0,op1,crn,crm,op2) \
204 (KVM_REG_ARM64 | KVM_REG_ARM64_SYSREG | \
205 ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | \
206 ARM64_SYS_REG_SHIFT_MASK(op1, OP1) | \
207 ARM64_SYS_REG_SHIFT_MASK(crn, CRN) | \
208 ARM64_SYS_REG_SHIFT_MASK(crm, CRM) | \
209 ARM64_SYS_REG_SHIFT_MASK(op2, OP2))
210
211#define ARM64_SYS_REG(...) (__ARM64_SYS_REG(__VA_ARGS__) | KVM_REG_SIZE_U64)
212
213/* Physical Timer EL0 Registers */
214#define KVM_REG_ARM_PTIMER_CTL ARM64_SYS_REG(3, 3, 14, 2, 1)
215#define KVM_REG_ARM_PTIMER_CVAL ARM64_SYS_REG(3, 3, 14, 2, 2)
216#define KVM_REG_ARM_PTIMER_CNT ARM64_SYS_REG(3, 3, 14, 0, 1)
217
218/* EL0 Virtual Timer Registers */
219#define KVM_REG_ARM_TIMER_CTL ARM64_SYS_REG(3, 3, 14, 3, 1)
220#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
221#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
222
223/* KVM-as-firmware specific pseudo-registers */
224#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
225#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
226 KVM_REG_ARM_FW | ((r) & 0xffff))
227#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
228
229/* Device Control API: ARM VGIC */
230#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
231#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
232#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
233#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
234#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
235#define KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT 32
236#define KVM_DEV_ARM_VGIC_V3_MPIDR_MASK \
237 (0xffffffffULL << KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT)
238#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
239#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
240#define KVM_DEV_ARM_VGIC_SYSREG_INSTR_MASK (0xffff)
241#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS 3
242#define KVM_DEV_ARM_VGIC_GRP_CTRL 4
243#define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5
244#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
245#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
246#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
247#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
248#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
249 (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
250#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff
251#define VGIC_LEVEL_INFO_LINE_LEVEL 0
252
253#define KVM_DEV_ARM_VGIC_CTRL_INIT 0
254#define KVM_DEV_ARM_ITS_SAVE_TABLES 1
255#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2
256#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3
257#define KVM_DEV_ARM_ITS_CTRL_RESET 4
258
259/* Device Control API on vcpu fd */
260#define KVM_ARM_VCPU_PMU_V3_CTRL 0
261#define KVM_ARM_VCPU_PMU_V3_IRQ 0
262#define KVM_ARM_VCPU_PMU_V3_INIT 1
263#define KVM_ARM_VCPU_TIMER_CTRL 1
264#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
265#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
266
267/* KVM_IRQ_LINE irq field index values */
268#define KVM_ARM_IRQ_TYPE_SHIFT 24
269#define KVM_ARM_IRQ_TYPE_MASK 0xff
270#define KVM_ARM_IRQ_VCPU_SHIFT 16
271#define KVM_ARM_IRQ_VCPU_MASK 0xff
272#define KVM_ARM_IRQ_NUM_SHIFT 0
273#define KVM_ARM_IRQ_NUM_MASK 0xffff
274
275/* irq_type field */
276#define KVM_ARM_IRQ_TYPE_CPU 0
277#define KVM_ARM_IRQ_TYPE_SPI 1
278#define KVM_ARM_IRQ_TYPE_PPI 2
279
280/* out-of-kernel GIC cpu interrupt injection irq_number field */
281#define KVM_ARM_IRQ_CPU_IRQ 0
282#define KVM_ARM_IRQ_CPU_FIQ 1
283
284/*
285 * This used to hold the highest supported SPI, but it is now obsolete
286 * and only here to provide source code level compatibility with older
287 * userland. The highest SPI number can be set via KVM_DEV_ARM_VGIC_GRP_NR_IRQS.
288 */
289#define KVM_ARM_IRQ_GIC_MAX 127
290
291/* One single KVM irqchip, ie. the VGIC */
292#define KVM_NR_IRQCHIPS 1
293
294/* PSCI interface */
295#define KVM_PSCI_FN_BASE 0x95c1ba5e
296#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
297
298#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
299#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
300#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
301#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
302
303#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
304#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
305#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
306#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
307
308#endif
309
310#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/kvm_para.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/kvm_para.h>
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/param.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_PARAM_H
18#define __ASM_PARAM_H
19
20#define EXEC_PAGESIZE 65536
21
22#include <asm-generic/param.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/perf_regs.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_ARM64_PERF_REGS_H
3#define _ASM_ARM64_PERF_REGS_H
4
5enum perf_event_arm_regs {
6 PERF_REG_ARM64_X0,
7 PERF_REG_ARM64_X1,
8 PERF_REG_ARM64_X2,
9 PERF_REG_ARM64_X3,
10 PERF_REG_ARM64_X4,
11 PERF_REG_ARM64_X5,
12 PERF_REG_ARM64_X6,
13 PERF_REG_ARM64_X7,
14 PERF_REG_ARM64_X8,
15 PERF_REG_ARM64_X9,
16 PERF_REG_ARM64_X10,
17 PERF_REG_ARM64_X11,
18 PERF_REG_ARM64_X12,
19 PERF_REG_ARM64_X13,
20 PERF_REG_ARM64_X14,
21 PERF_REG_ARM64_X15,
22 PERF_REG_ARM64_X16,
23 PERF_REG_ARM64_X17,
24 PERF_REG_ARM64_X18,
25 PERF_REG_ARM64_X19,
26 PERF_REG_ARM64_X20,
27 PERF_REG_ARM64_X21,
28 PERF_REG_ARM64_X22,
29 PERF_REG_ARM64_X23,
30 PERF_REG_ARM64_X24,
31 PERF_REG_ARM64_X25,
32 PERF_REG_ARM64_X26,
33 PERF_REG_ARM64_X27,
34 PERF_REG_ARM64_X28,
35 PERF_REG_ARM64_X29,
36 PERF_REG_ARM64_LR,
37 PERF_REG_ARM64_SP,
38 PERF_REG_ARM64_PC,
39 PERF_REG_ARM64_MAX,
40};
41#endif /* _ASM_ARM64_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/posix_types.h deleted-11
...@@ -1,11 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POSIX_TYPES_H
3#define __ASM_POSIX_TYPES_H
4
5typedef unsigned short __kernel_old_uid_t;
6typedef unsigned short __kernel_old_gid_t;
7#define __kernel_old_uid_t __kernel_old_uid_t
8
9#include <asm-generic/posix_types.h>
10
11#endif /* __ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/ptrace.h deleted-233
...@@ -1,233 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/ptrace.h
4 *
5 * Copyright (C) 1996-2003 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_PTRACE_H
21#define __ASM_PTRACE_H
22
23#include <linux/types.h>
24
25#include <asm/hwcap.h>
26#include <asm/sigcontext.h>
27
28
29/*
30 * PSR bits
31 */
32#define PSR_MODE_EL0t 0x00000000
33#define PSR_MODE_EL1t 0x00000004
34#define PSR_MODE_EL1h 0x00000005
35#define PSR_MODE_EL2t 0x00000008
36#define PSR_MODE_EL2h 0x00000009
37#define PSR_MODE_EL3t 0x0000000c
38#define PSR_MODE_EL3h 0x0000000d
39#define PSR_MODE_MASK 0x0000000f
40
41/* AArch32 CPSR bits */
42#define PSR_MODE32_BIT 0x00000010
43
44/* AArch64 SPSR bits */
45#define PSR_F_BIT 0x00000040
46#define PSR_I_BIT 0x00000080
47#define PSR_A_BIT 0x00000100
48#define PSR_D_BIT 0x00000200
49#define PSR_PAN_BIT 0x00400000
50#define PSR_UAO_BIT 0x00800000
51#define PSR_V_BIT 0x10000000
52#define PSR_C_BIT 0x20000000
53#define PSR_Z_BIT 0x40000000
54#define PSR_N_BIT 0x80000000
55
56/*
57 * Groups of PSR bits
58 */
59#define PSR_f 0xff000000 /* Flags */
60#define PSR_s 0x00ff0000 /* Status */
61#define PSR_x 0x0000ff00 /* Extension */
62#define PSR_c 0x000000ff /* Control */
63
64
65#ifndef __ASSEMBLY__
66
67#include <linux/prctl.h>
68
69/*
70 * User structures for general purpose, floating point and debug registers.
71 */
72struct user_pt_regs {
73 __u64 regs[31];
74 __u64 sp;
75 __u64 pc;
76 __u64 pstate;
77};
78
79struct user_fpsimd_state {
80 __uint128_t vregs[32];
81 __u32 fpsr;
82 __u32 fpcr;
83 __u32 __reserved[2];
84};
85
86struct user_hwdebug_state {
87 __u32 dbg_info;
88 __u32 pad;
89 struct {
90 __u64 addr;
91 __u32 ctrl;
92 __u32 pad;
93 } dbg_regs[16];
94};
95
96/* SVE/FP/SIMD state (NT_ARM_SVE) */
97
98struct user_sve_header {
99 __u32 size; /* total meaningful regset content in bytes */
100 __u32 max_size; /* maxmium possible size for this thread */
101 __u16 vl; /* current vector length */
102 __u16 max_vl; /* maximum possible vector length */
103 __u16 flags;
104 __u16 __reserved;
105};
106
107/* Definitions for user_sve_header.flags: */
108#define SVE_PT_REGS_MASK (1 << 0)
109
110#define SVE_PT_REGS_FPSIMD 0
111#define SVE_PT_REGS_SVE SVE_PT_REGS_MASK
112
113/*
114 * Common SVE_PT_* flags:
115 * These must be kept in sync with prctl interface in <linux/ptrace.h>
116 */
117#define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16)
118#define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16)
119
120
121/*
122 * The remainder of the SVE state follows struct user_sve_header. The
123 * total size of the SVE state (including header) depends on the
124 * metadata in the header: SVE_PT_SIZE(vq, flags) gives the total size
125 * of the state in bytes, including the header.
126 *
127 * Refer to <asm/sigcontext.h> for details of how to pass the correct
128 * "vq" argument to these macros.
129 */
130
131/* Offset from the start of struct user_sve_header to the register data */
132#define SVE_PT_REGS_OFFSET \
133 ((sizeof(struct user_sve_header) + (SVE_VQ_BYTES - 1)) \
134 / SVE_VQ_BYTES * SVE_VQ_BYTES)
135
136/*
137 * The register data content and layout depends on the value of the
138 * flags field.
139 */
140
141/*
142 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_FPSIMD case:
143 *
144 * The payload starts at offset SVE_PT_FPSIMD_OFFSET, and is of type
145 * struct user_fpsimd_state. Additional data might be appended in the
146 * future: use SVE_PT_FPSIMD_SIZE(vq, flags) to compute the total size.
147 * SVE_PT_FPSIMD_SIZE(vq, flags) will never be less than
148 * sizeof(struct user_fpsimd_state).
149 */
150
151#define SVE_PT_FPSIMD_OFFSET SVE_PT_REGS_OFFSET
152
153#define SVE_PT_FPSIMD_SIZE(vq, flags) (sizeof(struct user_fpsimd_state))
154
155/*
156 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE case:
157 *
158 * The payload starts at offset SVE_PT_SVE_OFFSET, and is of size
159 * SVE_PT_SVE_SIZE(vq, flags).
160 *
161 * Additional macros describe the contents and layout of the payload.
162 * For each, SVE_PT_SVE_x_OFFSET(args) is the start offset relative to
163 * the start of struct user_sve_header, and SVE_PT_SVE_x_SIZE(args) is
164 * the size in bytes:
165 *
166 * x type description
167 * - ---- -----------
168 * ZREGS \
169 * ZREG |
170 * PREGS | refer to <asm/sigcontext.h>
171 * PREG |
172 * FFR /
173 *
174 * FPSR uint32_t FPSR
175 * FPCR uint32_t FPCR
176 *
177 * Additional data might be appended in the future.
178 */
179
180#define SVE_PT_SVE_ZREG_SIZE(vq) SVE_SIG_ZREG_SIZE(vq)
181#define SVE_PT_SVE_PREG_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
182#define SVE_PT_SVE_FFR_SIZE(vq) SVE_SIG_FFR_SIZE(vq)
183#define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
184#define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
185
186#define __SVE_SIG_TO_PT(offset) \
187 ((offset) - SVE_SIG_REGS_OFFSET + SVE_PT_REGS_OFFSET)
188
189#define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
190
191#define SVE_PT_SVE_ZREGS_OFFSET \
192 __SVE_SIG_TO_PT(SVE_SIG_ZREGS_OFFSET)
193#define SVE_PT_SVE_ZREG_OFFSET(vq, n) \
194 __SVE_SIG_TO_PT(SVE_SIG_ZREG_OFFSET(vq, n))
195#define SVE_PT_SVE_ZREGS_SIZE(vq) \
196 (SVE_PT_SVE_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
197
198#define SVE_PT_SVE_PREGS_OFFSET(vq) \
199 __SVE_SIG_TO_PT(SVE_SIG_PREGS_OFFSET(vq))
200#define SVE_PT_SVE_PREG_OFFSET(vq, n) \
201 __SVE_SIG_TO_PT(SVE_SIG_PREG_OFFSET(vq, n))
202#define SVE_PT_SVE_PREGS_SIZE(vq) \
203 (SVE_PT_SVE_PREG_OFFSET(vq, SVE_NUM_PREGS) - \
204 SVE_PT_SVE_PREGS_OFFSET(vq))
205
206#define SVE_PT_SVE_FFR_OFFSET(vq) \
207 __SVE_SIG_TO_PT(SVE_SIG_FFR_OFFSET(vq))
208
209#define SVE_PT_SVE_FPSR_OFFSET(vq) \
210 ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + \
211 (SVE_VQ_BYTES - 1)) \
212 / SVE_VQ_BYTES * SVE_VQ_BYTES)
213#define SVE_PT_SVE_FPCR_OFFSET(vq) \
214 (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
215
216/*
217 * Any future extension appended after FPCR must be aligned to the next
218 * 128-bit boundary.
219 */
220
221#define SVE_PT_SVE_SIZE(vq, flags) \
222 ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE \
223 - SVE_PT_SVE_OFFSET + (SVE_VQ_BYTES - 1)) \
224 / SVE_VQ_BYTES * SVE_VQ_BYTES)
225
226#define SVE_PT_SIZE(vq, flags) \
227 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
228 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
229 : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
230
231#endif /* __ASSEMBLY__ */
232
233#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/setup.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/setup.h
4 *
5 * Copyright (C) 1997-1999 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_SETUP_H
21#define __ASM_SETUP_H
22
23#include <linux/types.h>
24
25#define COMMAND_LINE_SIZE 2048
26
27#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/sigcontext.h deleted-238
...@@ -1,238 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGCONTEXT_H
18#define __ASM_SIGCONTEXT_H
19
20#ifndef __ASSEMBLY__
21
22#include <linux/types.h>
23
24/*
25 * Signal context structure - contains all info to do with the state
26 * before the signal handler was invoked.
27 */
28struct sigcontext {
29 __u64 fault_address;
30 /* AArch64 registers */
31 __u64 regs[31];
32 __u64 sp;
33 __u64 pc;
34 __u64 pstate;
35 /* 4K reserved for FP/SIMD state and future expansion */
36 __u8 __reserved[4096] __attribute__((__aligned__(16)));
37};
38
39/*
40 * Allocation of __reserved[]:
41 * (Note: records do not necessarily occur in the order shown here.)
42 *
43 * size description
44 *
45 * 0x210 fpsimd_context
46 * 0x10 esr_context
47 * 0x8a0 sve_context (vl <= 64) (optional)
48 * 0x20 extra_context (optional)
49 * 0x10 terminator (null _aarch64_ctx)
50 *
51 * 0x510 (reserved for future allocation)
52 *
53 * New records that can exceed this space need to be opt-in for userspace, so
54 * that an expanded signal frame is not generated unexpectedly. The mechanism
55 * for opting in will depend on the extension that generates each new record.
56 * The above table documents the maximum set and sizes of records than can be
57 * generated when userspace does not opt in for any such extension.
58 */
59
60/*
61 * Header to be used at the beginning of structures extending the user
62 * context. Such structures must be placed after the rt_sigframe on the stack
63 * and be 16-byte aligned. The last structure must be a dummy one with the
64 * magic and size set to 0.
65 */
66struct _aarch64_ctx {
67 __u32 magic;
68 __u32 size;
69};
70
71#define FPSIMD_MAGIC 0x46508001
72
73struct fpsimd_context {
74 struct _aarch64_ctx head;
75 __u32 fpsr;
76 __u32 fpcr;
77 __uint128_t vregs[32];
78};
79
80/* ESR_EL1 context */
81#define ESR_MAGIC 0x45535201
82
83struct esr_context {
84 struct _aarch64_ctx head;
85 __u64 esr;
86};
87
88/*
89 * extra_context: describes extra space in the signal frame for
90 * additional structures that don't fit in sigcontext.__reserved[].
91 *
92 * Note:
93 *
94 * 1) fpsimd_context, esr_context and extra_context must be placed in
95 * sigcontext.__reserved[] if present. They cannot be placed in the
96 * extra space. Any other record can be placed either in the extra
97 * space or in sigcontext.__reserved[], unless otherwise specified in
98 * this file.
99 *
100 * 2) There must not be more than one extra_context.
101 *
102 * 3) If extra_context is present, it must be followed immediately in
103 * sigcontext.__reserved[] by the terminating null _aarch64_ctx.
104 *
105 * 4) The extra space to which datap points must start at the first
106 * 16-byte aligned address immediately after the terminating null
107 * _aarch64_ctx that follows the extra_context structure in
108 * __reserved[]. The extra space may overrun the end of __reserved[],
109 * as indicated by a sufficiently large value for the size field.
110 *
111 * 5) The extra space must itself be terminated with a null
112 * _aarch64_ctx.
113 */
114#define EXTRA_MAGIC 0x45585401
115
116struct extra_context {
117 struct _aarch64_ctx head;
118 __u64 datap; /* 16-byte aligned pointer to extra space cast to __u64 */
119 __u32 size; /* size in bytes of the extra space */
120 __u32 __reserved[3];
121};
122
123#define SVE_MAGIC 0x53564501
124
125struct sve_context {
126 struct _aarch64_ctx head;
127 __u16 vl;
128 __u16 __reserved[3];
129};
130
131#endif /* !__ASSEMBLY__ */
132
133/*
134 * The SVE architecture leaves space for future expansion of the
135 * vector length beyond its initial architectural limit of 2048 bits
136 * (16 quadwords).
137 *
138 * See linux/Documentation/arm64/sve.txt for a description of the VL/VQ
139 * terminology.
140 */
141#define SVE_VQ_BYTES 16 /* number of bytes per quadword */
142
143#define SVE_VQ_MIN 1
144#define SVE_VQ_MAX 512
145
146#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
147#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
148
149#define SVE_NUM_ZREGS 32
150#define SVE_NUM_PREGS 16
151
152#define sve_vl_valid(vl) \
153 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
154#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
155#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
156
157/*
158 * If the SVE registers are currently live for the thread at signal delivery,
159 * sve_context.head.size >=
160 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl))
161 * and the register data may be accessed using the SVE_SIG_*() macros.
162 *
163 * If sve_context.head.size <
164 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)),
165 * the SVE registers were not live for the thread and no register data
166 * is included: in this case, the SVE_SIG_*() macros should not be
167 * used except for this check.
168 *
169 * The same convention applies when returning from a signal: a caller
170 * will need to remove or resize the sve_context block if it wants to
171 * make the SVE registers live when they were previously non-live or
172 * vice-versa. This may require the the caller to allocate fresh
173 * memory and/or move other context blocks in the signal frame.
174 *
175 * Changing the vector length during signal return is not permitted:
176 * sve_context.vl must equal the thread's current vector length when
177 * doing a sigreturn.
178 *
179 *
180 * Note: for all these macros, the "vq" argument denotes the SVE
181 * vector length in quadwords (i.e., units of 128 bits).
182 *
183 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The
184 * result is valid if and only if sve_vl_valid(vl) is true. This is
185 * guaranteed for a struct sve_context written by the kernel.
186 *
187 *
188 * Additional macros describe the contents and layout of the payload.
189 * For each, SVE_SIG_x_OFFSET(args) is the start offset relative to
190 * the start of struct sve_context, and SVE_SIG_x_SIZE(args) is the
191 * size in bytes:
192 *
193 * x type description
194 * - ---- -----------
195 * REGS the entire SVE context
196 *
197 * ZREGS __uint128_t[SVE_NUM_ZREGS][vq] all Z-registers
198 * ZREG __uint128_t[vq] individual Z-register Zn
199 *
200 * PREGS uint16_t[SVE_NUM_PREGS][vq] all P-registers
201 * PREG uint16_t[vq] individual P-register Pn
202 *
203 * FFR uint16_t[vq] first-fault status register
204 *
205 * Additional data might be appended in the future.
206 */
207
208#define SVE_SIG_ZREG_SIZE(vq) ((__u32)(vq) * SVE_VQ_BYTES)
209#define SVE_SIG_PREG_SIZE(vq) ((__u32)(vq) * (SVE_VQ_BYTES / 8))
210#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
211
212#define SVE_SIG_REGS_OFFSET \
213 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
214 / SVE_VQ_BYTES * SVE_VQ_BYTES)
215
216#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
217#define SVE_SIG_ZREG_OFFSET(vq, n) \
218 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
219#define SVE_SIG_ZREGS_SIZE(vq) \
220 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
221
222#define SVE_SIG_PREGS_OFFSET(vq) \
223 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
224#define SVE_SIG_PREG_OFFSET(vq, n) \
225 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
226#define SVE_SIG_PREGS_SIZE(vq) \
227 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
228
229#define SVE_SIG_FFR_OFFSET(vq) \
230 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
231
232#define SVE_SIG_REGS_SIZE(vq) \
233 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
234
235#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
236
237
238#endif /* __ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/siginfo.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGINFO_H
18#define __ASM_SIGINFO_H
19
20#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
21
22#include <asm-generic/siginfo.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/signal.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGNAL_H
18#define __ASM_SIGNAL_H
19
20/* Required for AArch32 compatibility. */
21#define SA_RESTORER 0x04000000
22
23#define MINSIGSTKSZ 5120
24#define SIGSTKSZ 16384
25
26#include <asm-generic/signal.h>
27
28#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/stat.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#include <asm-generic/stat.h>
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/statfs.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_STATFS_H
18#define __ASM_STATFS_H
19
20#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
21
22#include <asm-generic/statfs.h>
23
24#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/ucontext.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_UCONTEXT_H
18#define __ASM_UCONTEXT_H
19
20#include <linux/types.h>
21
22struct ucontext {
23 unsigned long uc_flags;
24 struct ucontext *uc_link;
25 stack_t uc_stack;
26 sigset_t uc_sigmask;
27 /* glibc uses a 1024-bit sigset_t */
28 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
29 /* last for future expansion */
30 struct sigcontext uc_mcontext;
31};
32
33#endif /* __ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-any/asm/unistd.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#define __ARCH_WANT_RENAMEAT
19
20#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/fcntl.h+4
...@@ -181,6 +181,10 @@ struct f_owner_ex {...@@ -181,6 +181,10 @@ struct f_owner_ex {
181 blocking */181 blocking */
182#define LOCK_UN 8 /* remove lock */182#define LOCK_UN 8 /* remove lock */
183183
184/*
185 * LOCK_MAND support has been removed from the kernel. We leave the symbols
186 * here to not break legacy builds, but these should not be used in new code.
187 */
184#define LOCK_MAND 32 /* This is a mandatory flock ... */188#define LOCK_MAND 32 /* This is a mandatory flock ... */
185#define LOCK_READ 64 /* which allows concurrent read operations */189#define LOCK_READ 64 /* which allows concurrent read operations */
186#define LOCK_WRITE 128 /* which allows concurrent write operations */190#define LOCK_WRITE 128 /* which allows concurrent write operations */
lib/libc/include/any-linux-any/asm-generic/hugetlb_encode.h+1
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20#define HUGETLB_FLAG_ENCODE_SHIFT 2620#define HUGETLB_FLAG_ENCODE_SHIFT 26
21#define HUGETLB_FLAG_ENCODE_MASK 0x3f21#define HUGETLB_FLAG_ENCODE_MASK 0x3f
2222
23#define HUGETLB_FLAG_ENCODE_16KB (14 << HUGETLB_FLAG_ENCODE_SHIFT)
23#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)24#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)
24#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)25#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)
25#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)26#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)
lib/libc/include/any-linux-any/asm-generic/ioctls.h+2
...@@ -79,6 +79,8 @@...@@ -79,6 +79,8 @@
79#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */79#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
80#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */80#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
81#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */81#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
82#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
83#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
8284
83#define FIONCLEX 0x545085#define FIONCLEX 0x5450
84#define FIOCLEX 0x545186#define FIOCLEX 0x5451
lib/libc/include/any-linux-any/asm-generic/ipcbuf.h+2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef __ASM_GENERIC_IPCBUF_H2#ifndef __ASM_GENERIC_IPCBUF_H
3#define __ASM_GENERIC_IPCBUF_H3#define __ASM_GENERIC_IPCBUF_H
44
5#include <linux/posix_types.h>
6
5/*7/*
6 * The generic ipc64_perm structure:8 * The generic ipc64_perm structure:
7 * Note extra padding because this structure is passed back and forth9 * Note extra padding because this structure is passed back and forth
lib/libc/include/any-linux-any/asm-generic/mman-common.h+18-9
...@@ -11,25 +11,28 @@...@@ -11,25 +11,28 @@
11#define PROT_WRITE 0x2 /* page can be written */11#define PROT_WRITE 0x2 /* page can be written */
12#define PROT_EXEC 0x4 /* page can be executed */12#define PROT_EXEC 0x4 /* page can be executed */
13#define PROT_SEM 0x8 /* page may be used for atomic ops */13#define PROT_SEM 0x8 /* page may be used for atomic ops */
14/* 0x10 reserved for arch-specific use */
15/* 0x20 reserved for arch-specific use */
14#define PROT_NONE 0x0 /* page can not be accessed */16#define PROT_NONE 0x0 /* page can not be accessed */
15#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */17#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
16#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */18#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
1719
18#define MAP_SHARED 0x01 /* Share changes */20/* 0x01 - 0x03 are defined in linux/mman.h */
19#define MAP_PRIVATE 0x02 /* Changes are private */
20#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
21#define MAP_TYPE 0x0f /* Mask for type of mapping */21#define MAP_TYPE 0x0f /* Mask for type of mapping */
22#define MAP_FIXED 0x10 /* Interpret addr exactly */22#define MAP_FIXED 0x10 /* Interpret addr exactly */
23#define MAP_ANONYMOUS 0x20 /* don't use a file */23#define MAP_ANONYMOUS 0x20 /* don't use a file */
24#ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED
25# define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be uninitialized */
26#else
27# define MAP_UNINITIALIZED 0x0 /* Don't support this flag */
28#endif
2924
30/* 0x0100 - 0x80000 flags are defined in asm-generic/mman.h */25/* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */
26#define MAP_POPULATE 0x008000 /* populate (prefault) pagetables */
27#define MAP_NONBLOCK 0x010000 /* do not block on IO */
28#define MAP_STACK 0x020000 /* give out an address that is best suited for process/thread stacks */
29#define MAP_HUGETLB 0x040000 /* create a huge page mapping */
30#define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */
31#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */31#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
3232
33#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be
34 * uninitialized */
35
33/*36/*
34 * Flags for mlock37 * Flags for mlock
35 */38 */
...@@ -66,6 +69,12 @@...@@ -66,6 +69,12 @@
66#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */69#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
67#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */70#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
6871
72#define MADV_COLD 20 /* deactivate these pages */
73#define MADV_PAGEOUT 21 /* reclaim these pages */
74
75#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
76#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
77
69/* compatibility flags */78/* compatibility flags */
70#define MAP_FILE 079#define MAP_FILE 0
7180
lib/libc/include/any-linux-any/asm-generic/mman.h+4-6
...@@ -9,13 +9,11 @@...@@ -9,13 +9,11 @@
9#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */9#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
10#define MAP_LOCKED 0x2000 /* pages are locked */10#define MAP_LOCKED 0x2000 /* pages are locked */
11#define MAP_NORESERVE 0x4000 /* don't check for reservations */11#define MAP_NORESERVE 0x4000 /* don't check for reservations */
12#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
13#define MAP_NONBLOCK 0x10000 /* do not block on IO */
14#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
15#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
16#define MAP_SYNC 0x80000 /* perform synchronous page faults for the mapping */
1712
18/* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */13/*
14 * Bits [26:31] are reserved, see asm-generic/hugetlb_encode.h
15 * for MAP_HUGETLB usage
16 */
1917
20#define MCL_CURRENT 1 /* lock all current mappings */18#define MCL_CURRENT 1 /* lock all current mappings */
21#define MCL_FUTURE 2 /* lock all future mappings */19#define MCL_FUTURE 2 /* lock all future mappings */
lib/libc/include/any-linux-any/asm-generic/msgbuf.h+8-6
...@@ -3,6 +3,8 @@...@@ -3,6 +3,8 @@
3#define __ASM_GENERIC_MSGBUF_H3#define __ASM_GENERIC_MSGBUF_H
44
5#include <asm/bitsperlong.h>5#include <asm/bitsperlong.h>
6#include <asm/ipcbuf.h>
7
6/*8/*
7 * generic msqid64_ds structure.9 * generic msqid64_ds structure.
8 *10 *
...@@ -13,9 +15,9 @@...@@ -13,9 +15,9 @@
13 * everyone just ended up making identical copies without specific15 * everyone just ended up making identical copies without specific
14 * optimizations, so we may just as well all use the same one.16 * optimizations, so we may just as well all use the same one.
15 *17 *
16 * 64 bit architectures typically define a 64 bit __kernel_time_t,18 * 64 bit architectures use a 64-bit long time field here, while
17 * so they do not need the first three padding words.19 * 32 bit architectures have a pair of unsigned long values.
18 * On big-endian systems, the padding is in the wrong place.20 * On big-endian systems, the lower half is in the wrong place.
19 *21 *
20 * Pad space is left for:22 * Pad space is left for:
21 * - 2 miscellaneous 32-bit values23 * - 2 miscellaneous 32-bit values
...@@ -24,9 +26,9 @@...@@ -24,9 +26,9 @@
24struct msqid64_ds {26struct msqid64_ds {
25 struct ipc64_perm msg_perm;27 struct ipc64_perm msg_perm;
26#if __BITS_PER_LONG == 6428#if __BITS_PER_LONG == 64
27 __kernel_time_t msg_stime; /* last msgsnd time */29 long msg_stime; /* last msgsnd time */
28 __kernel_time_t msg_rtime; /* last msgrcv time */30 long msg_rtime; /* last msgrcv time */
29 __kernel_time_t msg_ctime; /* last change time */31 long msg_ctime; /* last change time */
30#else32#else
31 unsigned long msg_stime; /* last msgsnd time */33 unsigned long msg_stime; /* last msgsnd time */
32 unsigned long msg_stime_high;34 unsigned long msg_stime_high;
lib/libc/include/any-linux-any/asm-generic/posix_types.h+1
...@@ -86,6 +86,7 @@ typedef struct {...@@ -86,6 +86,7 @@ typedef struct {
86 */86 */
87typedef __kernel_long_t __kernel_off_t;87typedef __kernel_long_t __kernel_off_t;
88typedef long long __kernel_loff_t;88typedef long long __kernel_loff_t;
89typedef __kernel_long_t __kernel_old_time_t;
89typedef __kernel_long_t __kernel_time_t;90typedef __kernel_long_t __kernel_time_t;
90typedef long long __kernel_time64_t;91typedef long long __kernel_time64_t;
91typedef __kernel_long_t __kernel_clock_t;92typedef __kernel_long_t __kernel_clock_t;
lib/libc/include/any-linux-any/asm-generic/sembuf.h+7-7
...@@ -3,19 +3,19 @@...@@ -3,19 +3,19 @@
3#define __ASM_GENERIC_SEMBUF_H3#define __ASM_GENERIC_SEMBUF_H
44
5#include <asm/bitsperlong.h>5#include <asm/bitsperlong.h>
6#include <asm/ipcbuf.h>
67
7/*8/*
8 * The semid64_ds structure for x86 architecture.9 * The semid64_ds structure for most architectures (though it came from x86_32
9 * Note extra padding because this structure is passed back and forth10 * originally). Note extra padding because this structure is passed back and
10 * between kernel and user space.11 * forth between kernel and user space.
11 *12 *
12 * semid64_ds was originally meant to be architecture specific, but13 * semid64_ds was originally meant to be architecture specific, but
13 * everyone just ended up making identical copies without specific14 * everyone just ended up making identical copies without specific
14 * optimizations, so we may just as well all use the same one.15 * optimizations, so we may just as well all use the same one.
15 *16 *
16 * 64 bit architectures use a 64-bit __kernel_time_t here, while17 * 64 bit architectures use a 64-bit long time field here, while
17 * 32 bit architectures have a pair of unsigned long values.18 * 32 bit architectures have a pair of unsigned long values.
18 * so they do not need the first two padding words.
19 *19 *
20 * On big-endian systems, the padding is in the wrong place for20 * On big-endian systems, the padding is in the wrong place for
21 * historic reasons, so user space has to reconstruct a time_t21 * historic reasons, so user space has to reconstruct a time_t
...@@ -29,8 +29,8 @@...@@ -29,8 +29,8 @@
29struct semid64_ds {29struct semid64_ds {
30 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */30 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
31#if __BITS_PER_LONG == 6431#if __BITS_PER_LONG == 64
32 __kernel_time_t sem_otime; /* last semop time */32 long sem_otime; /* last semop time */
33 __kernel_time_t sem_ctime; /* last change time */33 long sem_ctime; /* last change time */
34#else34#else
35 unsigned long sem_otime; /* last semop time */35 unsigned long sem_otime; /* last semop time */
36 unsigned long sem_otime_high;36 unsigned long sem_otime_high;
lib/libc/include/any-linux-any/asm-generic/shmbuf.h+6-6
...@@ -13,9 +13,9 @@...@@ -13,9 +13,9 @@
13 * everyone just ended up making identical copies without specific13 * everyone just ended up making identical copies without specific
14 * optimizations, so we may just as well all use the same one.14 * optimizations, so we may just as well all use the same one.
15 *15 *
16 * 64 bit architectures typically define a 64 bit __kernel_time_t,16 * 64 bit architectures use a 64-bit long time field here, while
17 * so they do not need the first two padding words.17 * 32 bit architectures have a pair of unsigned long values.
18 * On big-endian systems, the padding is in the wrong place.18 * On big-endian systems, the lower half is in the wrong place.
19 *19 *
20 *20 *
21 * Pad space is left for:21 * Pad space is left for:
...@@ -26,9 +26,9 @@ struct shmid64_ds {...@@ -26,9 +26,9 @@ struct shmid64_ds {
26 struct ipc64_perm shm_perm; /* operation perms */26 struct ipc64_perm shm_perm; /* operation perms */
27 size_t shm_segsz; /* size of segment (bytes) */27 size_t shm_segsz; /* size of segment (bytes) */
28#if __BITS_PER_LONG == 6428#if __BITS_PER_LONG == 64
29 __kernel_time_t shm_atime; /* last attach time */29 long shm_atime; /* last attach time */
30 __kernel_time_t shm_dtime; /* last detach time */30 long shm_dtime; /* last detach time */
31 __kernel_time_t shm_ctime; /* last change time */31 long shm_ctime; /* last change time */
32#else32#else
33 unsigned long shm_atime; /* last attach time */33 unsigned long shm_atime; /* last attach time */
34 unsigned long shm_atime_high;34 unsigned long shm_atime_high;
lib/libc/include/any-linux-any/asm-generic/shmparam.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_GENERIC_SHMPARAM_H
3#define __ASM_GENERIC_SHMPARAM_H
4
5#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
6
7#endif /* _ASM_GENERIC_SHMPARAM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/siginfo.h+120-100
...@@ -10,18 +10,7 @@ typedef union sigval {...@@ -10,18 +10,7 @@ typedef union sigval {
10 void *sival_ptr;10 void *sival_ptr;
11} sigval_t;11} sigval_t;
1212
13/*
14 * This is the size (including padding) of the part of the
15 * struct siginfo that is before the union.
16 */
17#ifndef __ARCH_SI_PREAMBLE_SIZE
18#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
19#endif
20
21#define SI_MAX_SIZE 12813#define SI_MAX_SIZE 128
22#ifndef SI_PAD_SIZE
23#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
24#endif
2514
26/*15/*
27 * The default "si_band" type is "long", as specified by POSIX.16 * The default "si_band" type is "long", as specified by POSIX.
...@@ -40,96 +29,117 @@ typedef union sigval {...@@ -40,96 +29,117 @@ typedef union sigval {
40#define __ARCH_SI_ATTRIBUTES29#define __ARCH_SI_ATTRIBUTES
41#endif30#endif
4231
43typedef struct siginfo {32/*
44 int si_signo;33 * Be careful when extending this union. On 32bit siginfo_t is 32bit
45#ifndef __ARCH_HAS_SWAPPED_SIGINFO34 * aligned. Which means that a 64bit field or any other field that
46 int si_errno;35 * would increase the alignment of siginfo_t will break the ABI.
47 int si_code;36 */
48#else37union __sifields {
49 int si_code;38 /* kill() */
50 int si_errno;39 struct {
51#endif40 __kernel_pid_t _pid; /* sender's pid */
5241 __kernel_uid32_t _uid; /* sender's uid */
53 union {42 } _kill;
54 int _pad[SI_PAD_SIZE];43
5544 /* POSIX.1b timers */
56 /* kill() */45 struct {
57 struct {46 __kernel_timer_t _tid; /* timer id */
58 __kernel_pid_t _pid; /* sender's pid */47 int _overrun; /* overrun count */
59 __kernel_uid32_t _uid; /* sender's uid */48 sigval_t _sigval; /* same as below */
60 } _kill;49 int _sys_private; /* not to be passed to user */
6150 } _timer;
62 /* POSIX.1b timers */51
63 struct {52 /* POSIX.1b signals */
64 __kernel_timer_t _tid; /* timer id */53 struct {
65 int _overrun; /* overrun count */54 __kernel_pid_t _pid; /* sender's pid */
66 sigval_t _sigval; /* same as below */55 __kernel_uid32_t _uid; /* sender's uid */
67 int _sys_private; /* not to be passed to user */56 sigval_t _sigval;
68 } _timer;57 } _rt;
6958
70 /* POSIX.1b signals */59 /* SIGCHLD */
71 struct {60 struct {
72 __kernel_pid_t _pid; /* sender's pid */61 __kernel_pid_t _pid; /* which child */
73 __kernel_uid32_t _uid; /* sender's uid */62 __kernel_uid32_t _uid; /* sender's uid */
74 sigval_t _sigval;63 int _status; /* exit code */
75 } _rt;64 __ARCH_SI_CLOCK_T _utime;
7665 __ARCH_SI_CLOCK_T _stime;
77 /* SIGCHLD */66 } _sigchld;
78 struct {67
79 __kernel_pid_t _pid; /* which child */68 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
80 __kernel_uid32_t _uid; /* sender's uid */69 struct {
81 int _status; /* exit code */70 void *_addr; /* faulting insn/memory ref. */
82 __ARCH_SI_CLOCK_T _utime;
83 __ARCH_SI_CLOCK_T _stime;
84 } _sigchld;
85
86 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
87 struct {
88 void *_addr; /* faulting insn/memory ref. */
89#ifdef __ARCH_SI_TRAPNO
90 int _trapno; /* TRAP # which caused the signal */
91#endif
92#ifdef __ia64__71#ifdef __ia64__
93 int _imm; /* immediate value for "break" */72 int _imm; /* immediate value for "break" */
94 unsigned int _flags; /* see ia64 si_flags */73 unsigned int _flags; /* see ia64 si_flags */
95 unsigned long _isr; /* isr */74 unsigned long _isr; /* isr */
96#endif75#endif
9776
98#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \77#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
99 sizeof(short) : __alignof__(void *))78 sizeof(short) : __alignof__(void *))
100 union {79 union {
101 /*80 /* used on alpha and sparc */
102 * used when si_code=BUS_MCEERR_AR or81 int _trapno; /* TRAP # which caused the signal */
103 * used when si_code=BUS_MCEERR_AO82 /*
104 */83 * used when si_code=BUS_MCEERR_AR or
105 short _addr_lsb; /* LSB of the reported address */84 * used when si_code=BUS_MCEERR_AO
106 /* used when si_code=SEGV_BNDERR */85 */
107 struct {86 short _addr_lsb; /* LSB of the reported address */
108 char _dummy_bnd[__ADDR_BND_PKEY_PAD];87 /* used when si_code=SEGV_BNDERR */
109 void *_lower;88 struct {
110 void *_upper;89 char _dummy_bnd[__ADDR_BND_PKEY_PAD];
111 } _addr_bnd;90 void *_lower;
112 /* used when si_code=SEGV_PKUERR */91 void *_upper;
113 struct {92 } _addr_bnd;
114 char _dummy_pkey[__ADDR_BND_PKEY_PAD];93 /* used when si_code=SEGV_PKUERR */
115 __u32 _pkey;94 struct {
116 } _addr_pkey;95 char _dummy_pkey[__ADDR_BND_PKEY_PAD];
117 };96 __u32 _pkey;
118 } _sigfault;97 } _addr_pkey;
11998 /* used when si_code=TRAP_PERF */
120 /* SIGPOLL */99 struct {
121 struct {100 unsigned long _data;
122 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */101 __u32 _type;
123 int _fd;102 } _perf;
124 } _sigpoll;103 };
104 } _sigfault;
105
106 /* SIGPOLL */
107 struct {
108 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
109 int _fd;
110 } _sigpoll;
111
112 /* SIGSYS */
113 struct {
114 void *_call_addr; /* calling user insn */
115 int _syscall; /* triggering system call number */
116 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
117 } _sigsys;
118};
125119
126 /* SIGSYS */120#ifndef __ARCH_HAS_SWAPPED_SIGINFO
127 struct {121#define __SIGINFO \
128 void *_call_addr; /* calling user insn */122struct { \
129 int _syscall; /* triggering system call number */123 int si_signo; \
130 unsigned int _arch; /* AUDIT_ARCH_* of syscall */124 int si_errno; \
131 } _sigsys;125 int si_code; \
132 } _sifields;126 union __sifields _sifields; \
127}
128#else
129#define __SIGINFO \
130struct { \
131 int si_signo; \
132 int si_code; \
133 int si_errno; \
134 union __sifields _sifields; \
135}
136#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
137
138typedef struct siginfo {
139 union {
140 __SIGINFO;
141 int _si_pad[SI_MAX_SIZE/sizeof(int)];
142 };
133} __ARCH_SI_ATTRIBUTES siginfo_t;143} __ARCH_SI_ATTRIBUTES siginfo_t;
134144
135/*145/*
...@@ -147,13 +157,13 @@ typedef struct siginfo {...@@ -147,13 +157,13 @@ typedef struct siginfo {
147#define si_int _sifields._rt._sigval.sival_int157#define si_int _sifields._rt._sigval.sival_int
148#define si_ptr _sifields._rt._sigval.sival_ptr158#define si_ptr _sifields._rt._sigval.sival_ptr
149#define si_addr _sifields._sigfault._addr159#define si_addr _sifields._sigfault._addr
150#ifdef __ARCH_SI_TRAPNO
151#define si_trapno _sifields._sigfault._trapno160#define si_trapno _sifields._sigfault._trapno
152#endif
153#define si_addr_lsb _sifields._sigfault._addr_lsb161#define si_addr_lsb _sifields._sigfault._addr_lsb
154#define si_lower _sifields._sigfault._addr_bnd._lower162#define si_lower _sifields._sigfault._addr_bnd._lower
155#define si_upper _sifields._sigfault._addr_bnd._upper163#define si_upper _sifields._sigfault._addr_bnd._upper
156#define si_pkey _sifields._sigfault._addr_pkey._pkey164#define si_pkey _sifields._sigfault._addr_pkey._pkey
165#define si_perf_data _sifields._sigfault._perf._data
166#define si_perf_type _sifields._sigfault._perf._type
157#define si_band _sifields._sigpoll._band167#define si_band _sifields._sigpoll._band
158#define si_fd _sifields._sigpoll._fd168#define si_fd _sifields._sigpoll._fd
159#define si_call_addr _sifields._sigsys._call_addr169#define si_call_addr _sifields._sigsys._call_addr
...@@ -228,7 +238,9 @@ typedef struct siginfo {...@@ -228,7 +238,9 @@ typedef struct siginfo {
228#define SEGV_ACCADI 5 /* ADI not enabled for mapped object */238#define SEGV_ACCADI 5 /* ADI not enabled for mapped object */
229#define SEGV_ADIDERR 6 /* Disrupting MCD error */239#define SEGV_ADIDERR 6 /* Disrupting MCD error */
230#define SEGV_ADIPERR 7 /* Precise MCD exception */240#define SEGV_ADIPERR 7 /* Precise MCD exception */
231#define NSIGSEGV 7241#define SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */
242#define SEGV_MTESERR 9 /* Synchronous ARM MTE exception */
243#define NSIGSEGV 9
232244
233/*245/*
234 * SIGBUS si_codes246 * SIGBUS si_codes
...@@ -250,7 +262,8 @@ typedef struct siginfo {...@@ -250,7 +262,8 @@ typedef struct siginfo {
250#define TRAP_BRANCH 3 /* process taken branch trap */262#define TRAP_BRANCH 3 /* process taken branch trap */
251#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */263#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */
252#define TRAP_UNK 5 /* undiagnosed trap */264#define TRAP_UNK 5 /* undiagnosed trap */
253#define NSIGTRAP 5265#define TRAP_PERF 6 /* perf event with sigtrap=1 */
266#define NSIGTRAP 6
254267
255/*268/*
256 * There is an additional set of SIGTRAP si_codes used by ptrace269 * There is an additional set of SIGTRAP si_codes used by ptrace
...@@ -283,7 +296,14 @@ typedef struct siginfo {...@@ -283,7 +296,14 @@ typedef struct siginfo {
283 * SIGSYS si_codes296 * SIGSYS si_codes
284 */297 */
285#define SYS_SECCOMP 1 /* seccomp triggered */298#define SYS_SECCOMP 1 /* seccomp triggered */
286#define NSIGSYS 1299#define SYS_USER_DISPATCH 2 /* syscall user dispatch triggered */
300#define NSIGSYS 2
301
302/*
303 * SIGEMT si_codes
304 */
305#define EMT_TAGOVF 1 /* tag overflow */
306#define NSIGEMT 1
287307
288/*308/*
289 * sigevent definitions309 * sigevent definitions
lib/libc/include/any-linux-any/asm-generic/signal-defs.h+64
...@@ -4,6 +4,70 @@...@@ -4,6 +4,70 @@
44
55
66
7/*
8 * SA_FLAGS values:
9 *
10 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
12 * SA_SIGINFO delivers the signal with SIGINFO structs.
13 * SA_ONSTACK indicates that a registered stack_t will be used.
14 * SA_RESTART flag to get restarting signals (which were the default long ago)
15 * SA_NODEFER prevents the current signal from being masked in the handler.
16 * SA_RESETHAND clears the handler when the signal is delivered.
17 * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
18 * before the introduction of SA_UNSUPPORTED did not clear unknown bits from
19 * sa_flags when read using the oldact argument to sigaction and rt_sigaction,
20 * so this bit allows flag bit support to be detected from userspace while
21 * allowing an old kernel to be distinguished from a kernel that supports every
22 * flag bit.
23 * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
24 * siginfo.si_addr.
25 *
26 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
27 * Unix names RESETHAND and NODEFER respectively.
28 */
29#ifndef SA_NOCLDSTOP
30#define SA_NOCLDSTOP 0x00000001
31#endif
32#ifndef SA_NOCLDWAIT
33#define SA_NOCLDWAIT 0x00000002
34#endif
35#ifndef SA_SIGINFO
36#define SA_SIGINFO 0x00000004
37#endif
38/* 0x00000008 used on alpha, mips, parisc */
39/* 0x00000010 used on alpha, parisc */
40/* 0x00000020 used on alpha, parisc, sparc */
41/* 0x00000040 used on alpha, parisc */
42/* 0x00000080 used on parisc */
43/* 0x00000100 used on sparc */
44/* 0x00000200 used on sparc */
45#define SA_UNSUPPORTED 0x00000400
46#define SA_EXPOSE_TAGBITS 0x00000800
47/* 0x00010000 used on mips */
48/* 0x00800000 used for internal SA_IMMUTABLE */
49/* 0x01000000 used on x86 */
50/* 0x02000000 used on x86 */
51/*
52 * New architectures should not define the obsolete
53 * SA_RESTORER 0x04000000
54 */
55#ifndef SA_ONSTACK
56#define SA_ONSTACK 0x08000000
57#endif
58#ifndef SA_RESTART
59#define SA_RESTART 0x10000000
60#endif
61#ifndef SA_NODEFER
62#define SA_NODEFER 0x40000000
63#endif
64#ifndef SA_RESETHAND
65#define SA_RESETHAND 0x80000000
66#endif
67
68#define SA_NOMASK SA_NODEFER
69#define SA_ONESHOT SA_RESETHAND
70
7#ifndef SIG_BLOCK71#ifndef SIG_BLOCK
8#define SIG_BLOCK 0 /* for blocking signals */72#define SIG_BLOCK 0 /* for blocking signals */
9#endif73#endif
lib/libc/include/any-linux-any/asm-generic/signal.h-29
...@@ -52,35 +52,6 @@...@@ -52,35 +52,6 @@
52#define SIGRTMAX _NSIG52#define SIGRTMAX _NSIG
53#endif53#endif
5454
55/*
56 * SA_FLAGS values:
57 *
58 * SA_ONSTACK indicates that a registered stack_t will be used.
59 * SA_RESTART flag to get restarting signals (which were the default long ago)
60 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
61 * SA_RESETHAND clears the handler when the signal is delivered.
62 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
63 * SA_NODEFER prevents the current signal from being masked in the handler.
64 *
65 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
66 * Unix names RESETHAND and NODEFER respectively.
67 */
68#define SA_NOCLDSTOP 0x00000001
69#define SA_NOCLDWAIT 0x00000002
70#define SA_SIGINFO 0x00000004
71#define SA_ONSTACK 0x08000000
72#define SA_RESTART 0x10000000
73#define SA_NODEFER 0x40000000
74#define SA_RESETHAND 0x80000000
75
76#define SA_NOMASK SA_NODEFER
77#define SA_ONESHOT SA_RESETHAND
78
79/*
80 * New architectures should not define the obsolete
81 * SA_RESTORER 0x04000000
82 */
83
84#if !defined MINSIGSTKSZ || !defined SIGSTKSZ55#if !defined MINSIGSTKSZ || !defined SIGSTKSZ
85#define MINSIGSTKSZ 204856#define MINSIGSTKSZ 2048
86#define SIGSTKSZ 819257#define SIGSTKSZ 8192
lib/libc/include/any-linux-any/asm-generic/socket.h+50-9
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef __ASM_GENERIC_SOCKET_H2#ifndef __ASM_GENERIC_SOCKET_H
3#define __ASM_GENERIC_SOCKET_H3#define __ASM_GENERIC_SOCKET_H
44
5#include <linux/posix_types.h>
5#include <asm/sockios.h>6#include <asm/sockios.h>
67
7/* For setsockopt(2) */8/* For setsockopt(2) */
...@@ -29,8 +30,8 @@...@@ -29,8 +30,8 @@
29#define SO_PEERCRED 1730#define SO_PEERCRED 17
30#define SO_RCVLOWAT 1831#define SO_RCVLOWAT 18
31#define SO_SNDLOWAT 1932#define SO_SNDLOWAT 19
32#define SO_RCVTIMEO 2033#define SO_RCVTIMEO_OLD 20
33#define SO_SNDTIMEO 2134#define SO_SNDTIMEO_OLD 21
34#endif35#endif
3536
36/* Security levels - as per NRL IPv6 - don't actually do anything */37/* Security levels - as per NRL IPv6 - don't actually do anything */
...@@ -46,21 +47,14 @@...@@ -46,21 +47,14 @@
46#define SO_GET_FILTER SO_ATTACH_FILTER47#define SO_GET_FILTER SO_ATTACH_FILTER
4748
48#define SO_PEERNAME 2849#define SO_PEERNAME 28
49#define SO_TIMESTAMP 29
50#define SCM_TIMESTAMP SO_TIMESTAMP
5150
52#define SO_ACCEPTCONN 3051#define SO_ACCEPTCONN 30
5352
54#define SO_PEERSEC 3153#define SO_PEERSEC 31
55#define SO_PASSSEC 3454#define SO_PASSSEC 34
56#define SO_TIMESTAMPNS 35
57#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
5855
59#define SO_MARK 3656#define SO_MARK 36
6057
61#define SO_TIMESTAMPING 37
62#define SCM_TIMESTAMPING SO_TIMESTAMPING
63
64#define SO_PROTOCOL 3858#define SO_PROTOCOL 38
65#define SO_DOMAIN 3959#define SO_DOMAIN 39
6660
...@@ -110,4 +104,51 @@...@@ -110,4 +104,51 @@
110#define SO_TXTIME 61104#define SO_TXTIME 61
111#define SCM_TXTIME SO_TXTIME105#define SCM_TXTIME SO_TXTIME
112106
107#define SO_BINDTOIFINDEX 62
108
109#define SO_TIMESTAMP_OLD 29
110#define SO_TIMESTAMPNS_OLD 35
111#define SO_TIMESTAMPING_OLD 37
112
113#define SO_TIMESTAMP_NEW 63
114#define SO_TIMESTAMPNS_NEW 64
115#define SO_TIMESTAMPING_NEW 65
116
117#define SO_RCVTIMEO_NEW 66
118#define SO_SNDTIMEO_NEW 67
119
120#define SO_DETACH_REUSEPORT_BPF 68
121
122#define SO_PREFER_BUSY_POLL 69
123#define SO_BUSY_POLL_BUDGET 70
124
125#define SO_NETNS_COOKIE 71
126
127#define SO_BUF_LOCK 72
128
129#define SO_RESERVE_MEM 73
130
131
132#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
133/* on 64-bit and x32, avoid the ?: operator */
134#define SO_TIMESTAMP SO_TIMESTAMP_OLD
135#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
136#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
137
138#define SO_RCVTIMEO SO_RCVTIMEO_OLD
139#define SO_SNDTIMEO SO_SNDTIMEO_OLD
140#else
141#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
142#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
143#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
144
145#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
146#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
147#endif
148
149#define SCM_TIMESTAMP SO_TIMESTAMP
150#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
151#define SCM_TIMESTAMPING SO_TIMESTAMPING
152
153
113#endif /* __ASM_GENERIC_SOCKET_H */154#endif /* __ASM_GENERIC_SOCKET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/sockios.h+2-2
...@@ -8,7 +8,7 @@...@@ -8,7 +8,7 @@
8#define FIOGETOWN 0x89038#define FIOGETOWN 0x8903
9#define SIOCGPGRP 0x89049#define SIOCGPGRP 0x8904
10#define SIOCATMARK 0x890510#define SIOCATMARK 0x8905
11#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */11#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
12#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */12#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
1313
14#endif /* __ASM_GENERIC_SOCKIOS_H */14#endif /* __ASM_GENERIC_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/unistd.h+199-49
...@@ -38,8 +38,10 @@ __SYSCALL(__NR_io_destroy, sys_io_destroy)...@@ -38,8 +38,10 @@ __SYSCALL(__NR_io_destroy, sys_io_destroy)
38__SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)38__SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
39#define __NR_io_cancel 339#define __NR_io_cancel 3
40__SYSCALL(__NR_io_cancel, sys_io_cancel)40__SYSCALL(__NR_io_cancel, sys_io_cancel)
41#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
41#define __NR_io_getevents 442#define __NR_io_getevents 4
42__SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents)43__SC_3264(__NR_io_getevents, sys_io_getevents_time32, sys_io_getevents)
44#endif
4345
44/* fs/xattr.c */46/* fs/xattr.c */
45#define __NR_setxattr 547#define __NR_setxattr 5
...@@ -138,7 +140,7 @@ __SYSCALL(__NR_renameat, sys_renameat)...@@ -138,7 +140,7 @@ __SYSCALL(__NR_renameat, sys_renameat)
138#define __NR_umount2 39140#define __NR_umount2 39
139__SYSCALL(__NR_umount2, sys_umount)141__SYSCALL(__NR_umount2, sys_umount)
140#define __NR_mount 40142#define __NR_mount 40
141__SC_COMP(__NR_mount, sys_mount, compat_sys_mount)143__SYSCALL(__NR_mount, sys_mount)
142#define __NR_pivot_root 41144#define __NR_pivot_root 41
143__SYSCALL(__NR_pivot_root, sys_pivot_root)145__SYSCALL(__NR_pivot_root, sys_pivot_root)
144146
...@@ -179,7 +181,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat)...@@ -179,7 +181,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat)
179#define __NR_fchown 55181#define __NR_fchown 55
180__SYSCALL(__NR_fchown, sys_fchown)182__SYSCALL(__NR_fchown, sys_fchown)
181#define __NR_openat 56183#define __NR_openat 56
182__SC_COMP(__NR_openat, sys_openat, compat_sys_openat)184__SYSCALL(__NR_openat, sys_openat)
183#define __NR_close 57185#define __NR_close 57
184__SYSCALL(__NR_close, sys_close)186__SYSCALL(__NR_close, sys_close)
185#define __NR_vhangup 58187#define __NR_vhangup 58
...@@ -205,9 +207,9 @@ __SYSCALL(__NR_read, sys_read)...@@ -205,9 +207,9 @@ __SYSCALL(__NR_read, sys_read)
205#define __NR_write 64207#define __NR_write 64
206__SYSCALL(__NR_write, sys_write)208__SYSCALL(__NR_write, sys_write)
207#define __NR_readv 65209#define __NR_readv 65
208__SC_COMP(__NR_readv, sys_readv, compat_sys_readv)210__SC_COMP(__NR_readv, sys_readv, sys_readv)
209#define __NR_writev 66211#define __NR_writev 66
210__SC_COMP(__NR_writev, sys_writev, compat_sys_writev)212__SC_COMP(__NR_writev, sys_writev, sys_writev)
211#define __NR_pread64 67213#define __NR_pread64 67
212__SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64)214__SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64)
213#define __NR_pwrite64 68215#define __NR_pwrite64 68
...@@ -222,10 +224,12 @@ __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)...@@ -222,10 +224,12 @@ __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)
222__SYSCALL(__NR3264_sendfile, sys_sendfile64)224__SYSCALL(__NR3264_sendfile, sys_sendfile64)
223225
224/* fs/select.c */226/* fs/select.c */
227#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
225#define __NR_pselect6 72228#define __NR_pselect6 72
226__SC_COMP(__NR_pselect6, sys_pselect6, compat_sys_pselect6)229__SC_COMP_3264(__NR_pselect6, sys_pselect6_time32, sys_pselect6, compat_sys_pselect6_time32)
227#define __NR_ppoll 73230#define __NR_ppoll 73
228__SC_COMP(__NR_ppoll, sys_ppoll, compat_sys_ppoll)231__SC_COMP_3264(__NR_ppoll, sys_ppoll_time32, sys_ppoll, compat_sys_ppoll_time32)
232#endif
229233
230/* fs/signalfd.c */234/* fs/signalfd.c */
231#define __NR_signalfd4 74235#define __NR_signalfd4 74
...@@ -233,7 +237,7 @@ __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)...@@ -233,7 +237,7 @@ __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
233237
234/* fs/splice.c */238/* fs/splice.c */
235#define __NR_vmsplice 75239#define __NR_vmsplice 75
236__SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice)240__SYSCALL(__NR_vmsplice, sys_vmsplice)
237#define __NR_splice 76241#define __NR_splice 76
238__SYSCALL(__NR_splice, sys_splice)242__SYSCALL(__NR_splice, sys_splice)
239#define __NR_tee 77243#define __NR_tee 77
...@@ -242,10 +246,12 @@ __SYSCALL(__NR_tee, sys_tee)...@@ -242,10 +246,12 @@ __SYSCALL(__NR_tee, sys_tee)
242/* fs/stat.c */246/* fs/stat.c */
243#define __NR_readlinkat 78247#define __NR_readlinkat 78
244__SYSCALL(__NR_readlinkat, sys_readlinkat)248__SYSCALL(__NR_readlinkat, sys_readlinkat)
249#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
245#define __NR3264_fstatat 79250#define __NR3264_fstatat 79
246__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)251__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
247#define __NR3264_fstat 80252#define __NR3264_fstat 80
248__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)253__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
254#endif
249255
250/* fs/sync.c */256/* fs/sync.c */
251#define __NR_sync 81257#define __NR_sync 81
...@@ -267,16 +273,20 @@ __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \...@@ -267,16 +273,20 @@ __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \
267/* fs/timerfd.c */273/* fs/timerfd.c */
268#define __NR_timerfd_create 85274#define __NR_timerfd_create 85
269__SYSCALL(__NR_timerfd_create, sys_timerfd_create)275__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
276#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
270#define __NR_timerfd_settime 86277#define __NR_timerfd_settime 86
271__SC_COMP(__NR_timerfd_settime, sys_timerfd_settime, \278__SC_3264(__NR_timerfd_settime, sys_timerfd_settime32, \
272 compat_sys_timerfd_settime)279 sys_timerfd_settime)
273#define __NR_timerfd_gettime 87280#define __NR_timerfd_gettime 87
274__SC_COMP(__NR_timerfd_gettime, sys_timerfd_gettime, \281__SC_3264(__NR_timerfd_gettime, sys_timerfd_gettime32, \
275 compat_sys_timerfd_gettime)282 sys_timerfd_gettime)
283#endif
276284
277/* fs/utimes.c */285/* fs/utimes.c */
286#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
278#define __NR_utimensat 88287#define __NR_utimensat 88
279__SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat)288__SC_3264(__NR_utimensat, sys_utimensat_time32, sys_utimensat)
289#endif
280290
281/* kernel/acct.c */291/* kernel/acct.c */
282#define __NR_acct 89292#define __NR_acct 89
...@@ -307,8 +317,10 @@ __SYSCALL(__NR_set_tid_address, sys_set_tid_address)...@@ -307,8 +317,10 @@ __SYSCALL(__NR_set_tid_address, sys_set_tid_address)
307__SYSCALL(__NR_unshare, sys_unshare)317__SYSCALL(__NR_unshare, sys_unshare)
308318
309/* kernel/futex.c */319/* kernel/futex.c */
320#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
310#define __NR_futex 98321#define __NR_futex 98
311__SC_COMP(__NR_futex, sys_futex, compat_sys_futex)322__SC_3264(__NR_futex, sys_futex_time32, sys_futex)
323#endif
312#define __NR_set_robust_list 99324#define __NR_set_robust_list 99
313__SC_COMP(__NR_set_robust_list, sys_set_robust_list, \325__SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
314 compat_sys_set_robust_list)326 compat_sys_set_robust_list)
...@@ -317,8 +329,10 @@ __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \...@@ -317,8 +329,10 @@ __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
317 compat_sys_get_robust_list)329 compat_sys_get_robust_list)
318330
319/* kernel/hrtimer.c */331/* kernel/hrtimer.c */
332#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
320#define __NR_nanosleep 101333#define __NR_nanosleep 101
321__SC_COMP(__NR_nanosleep, sys_nanosleep, compat_sys_nanosleep)334__SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
335#endif
322336
323/* kernel/itimer.c */337/* kernel/itimer.c */
324#define __NR_getitimer 102338#define __NR_getitimer 102
...@@ -339,23 +353,29 @@ __SYSCALL(__NR_delete_module, sys_delete_module)...@@ -339,23 +353,29 @@ __SYSCALL(__NR_delete_module, sys_delete_module)
339/* kernel/posix-timers.c */353/* kernel/posix-timers.c */
340#define __NR_timer_create 107354#define __NR_timer_create 107
341__SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)355__SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
356#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
342#define __NR_timer_gettime 108357#define __NR_timer_gettime 108
343__SC_COMP(__NR_timer_gettime, sys_timer_gettime, compat_sys_timer_gettime)358__SC_3264(__NR_timer_gettime, sys_timer_gettime32, sys_timer_gettime)
359#endif
344#define __NR_timer_getoverrun 109360#define __NR_timer_getoverrun 109
345__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)361__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
362#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
346#define __NR_timer_settime 110363#define __NR_timer_settime 110
347__SC_COMP(__NR_timer_settime, sys_timer_settime, compat_sys_timer_settime)364__SC_3264(__NR_timer_settime, sys_timer_settime32, sys_timer_settime)
365#endif
348#define __NR_timer_delete 111366#define __NR_timer_delete 111
349__SYSCALL(__NR_timer_delete, sys_timer_delete)367__SYSCALL(__NR_timer_delete, sys_timer_delete)
368#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
350#define __NR_clock_settime 112369#define __NR_clock_settime 112
351__SC_COMP(__NR_clock_settime, sys_clock_settime, compat_sys_clock_settime)370__SC_3264(__NR_clock_settime, sys_clock_settime32, sys_clock_settime)
352#define __NR_clock_gettime 113371#define __NR_clock_gettime 113
353__SC_COMP(__NR_clock_gettime, sys_clock_gettime, compat_sys_clock_gettime)372__SC_3264(__NR_clock_gettime, sys_clock_gettime32, sys_clock_gettime)
354#define __NR_clock_getres 114373#define __NR_clock_getres 114
355__SC_COMP(__NR_clock_getres, sys_clock_getres, compat_sys_clock_getres)374__SC_3264(__NR_clock_getres, sys_clock_getres_time32, sys_clock_getres)
356#define __NR_clock_nanosleep 115375#define __NR_clock_nanosleep 115
357__SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \376__SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \
358 compat_sys_clock_nanosleep)377 sys_clock_nanosleep)
378#endif
359379
360/* kernel/printk.c */380/* kernel/printk.c */
361#define __NR_syslog 116381#define __NR_syslog 116
...@@ -386,9 +406,11 @@ __SYSCALL(__NR_sched_yield, sys_sched_yield)...@@ -386,9 +406,11 @@ __SYSCALL(__NR_sched_yield, sys_sched_yield)
386__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)406__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
387#define __NR_sched_get_priority_min 126407#define __NR_sched_get_priority_min 126
388__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)408__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
409#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
389#define __NR_sched_rr_get_interval 127410#define __NR_sched_rr_get_interval 127
390__SC_COMP(__NR_sched_rr_get_interval, sys_sched_rr_get_interval, \411__SC_3264(__NR_sched_rr_get_interval, sys_sched_rr_get_interval_time32, \
391 compat_sys_sched_rr_get_interval)412 sys_sched_rr_get_interval)
413#endif
392414
393/* kernel/signal.c */415/* kernel/signal.c */
394#define __NR_restart_syscall 128416#define __NR_restart_syscall 128
...@@ -409,9 +431,11 @@ __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction)...@@ -409,9 +431,11 @@ __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction)
409__SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask)431__SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask)
410#define __NR_rt_sigpending 136432#define __NR_rt_sigpending 136
411__SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending)433__SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending)
434#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
412#define __NR_rt_sigtimedwait 137435#define __NR_rt_sigtimedwait 137
413__SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \436__SC_COMP_3264(__NR_rt_sigtimedwait, sys_rt_sigtimedwait_time32, \
414 compat_sys_rt_sigtimedwait)437 sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time32)
438#endif
415#define __NR_rt_sigqueueinfo 138439#define __NR_rt_sigqueueinfo 138
416__SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \440__SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \
417 compat_sys_rt_sigqueueinfo)441 compat_sys_rt_sigqueueinfo)
...@@ -465,10 +489,15 @@ __SYSCALL(__NR_uname, sys_newuname)...@@ -465,10 +489,15 @@ __SYSCALL(__NR_uname, sys_newuname)
465__SYSCALL(__NR_sethostname, sys_sethostname)489__SYSCALL(__NR_sethostname, sys_sethostname)
466#define __NR_setdomainname 162490#define __NR_setdomainname 162
467__SYSCALL(__NR_setdomainname, sys_setdomainname)491__SYSCALL(__NR_setdomainname, sys_setdomainname)
492
493#ifdef __ARCH_WANT_SET_GET_RLIMIT
494/* getrlimit and setrlimit are superseded with prlimit64 */
468#define __NR_getrlimit 163495#define __NR_getrlimit 163
469__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)496__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
470#define __NR_setrlimit 164497#define __NR_setrlimit 164
471__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)498__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
499#endif
500
472#define __NR_getrusage 165501#define __NR_getrusage 165
473__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)502__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
474#define __NR_umask 166503#define __NR_umask 166
...@@ -479,14 +508,16 @@ __SYSCALL(__NR_prctl, sys_prctl)...@@ -479,14 +508,16 @@ __SYSCALL(__NR_prctl, sys_prctl)
479__SYSCALL(__NR_getcpu, sys_getcpu)508__SYSCALL(__NR_getcpu, sys_getcpu)
480509
481/* kernel/time.c */510/* kernel/time.c */
511#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
482#define __NR_gettimeofday 169512#define __NR_gettimeofday 169
483__SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)513__SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
484#define __NR_settimeofday 170514#define __NR_settimeofday 170
485__SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)515__SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
486#define __NR_adjtimex 171516#define __NR_adjtimex 171
487__SC_COMP(__NR_adjtimex, sys_adjtimex, compat_sys_adjtimex)517__SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex)
518#endif
488519
489/* kernel/timer.c */520/* kernel/sys.c */
490#define __NR_getpid 172521#define __NR_getpid 172
491__SYSCALL(__NR_getpid, sys_getpid)522__SYSCALL(__NR_getpid, sys_getpid)
492#define __NR_getppid 173523#define __NR_getppid 173
...@@ -509,11 +540,13 @@ __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)...@@ -509,11 +540,13 @@ __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
509__SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)540__SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
510#define __NR_mq_unlink 181541#define __NR_mq_unlink 181
511__SYSCALL(__NR_mq_unlink, sys_mq_unlink)542__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
543#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
512#define __NR_mq_timedsend 182544#define __NR_mq_timedsend 182
513__SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend)545__SC_3264(__NR_mq_timedsend, sys_mq_timedsend_time32, sys_mq_timedsend)
514#define __NR_mq_timedreceive 183546#define __NR_mq_timedreceive 183
515__SC_COMP(__NR_mq_timedreceive, sys_mq_timedreceive, \547__SC_3264(__NR_mq_timedreceive, sys_mq_timedreceive_time32, \
516 compat_sys_mq_timedreceive)548 sys_mq_timedreceive)
549#endif
517#define __NR_mq_notify 184550#define __NR_mq_notify 184
518__SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)551__SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)
519#define __NR_mq_getsetattr 185552#define __NR_mq_getsetattr 185
...@@ -534,8 +567,10 @@ __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd)...@@ -534,8 +567,10 @@ __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd)
534__SYSCALL(__NR_semget, sys_semget)567__SYSCALL(__NR_semget, sys_semget)
535#define __NR_semctl 191568#define __NR_semctl 191
536__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)569__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
570#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
537#define __NR_semtimedop 192571#define __NR_semtimedop 192
538__SC_COMP(__NR_semtimedop, sys_semtimedop, compat_sys_semtimedop)572__SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop)
573#endif
539#define __NR_semop 193574#define __NR_semop 193
540__SYSCALL(__NR_semop, sys_semop)575__SYSCALL(__NR_semop, sys_semop)
541576
...@@ -571,9 +606,9 @@ __SYSCALL(__NR_sendto, sys_sendto)...@@ -571,9 +606,9 @@ __SYSCALL(__NR_sendto, sys_sendto)
571#define __NR_recvfrom 207606#define __NR_recvfrom 207
572__SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)607__SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
573#define __NR_setsockopt 208608#define __NR_setsockopt 208
574__SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt)609__SC_COMP(__NR_setsockopt, sys_setsockopt, sys_setsockopt)
575#define __NR_getsockopt 209610#define __NR_getsockopt 209
576__SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt)611__SC_COMP(__NR_getsockopt, sys_getsockopt, sys_getsockopt)
577#define __NR_shutdown 210612#define __NR_shutdown 210
578__SYSCALL(__NR_shutdown, sys_shutdown)613__SYSCALL(__NR_shutdown, sys_shutdown)
579#define __NR_sendmsg 211614#define __NR_sendmsg 211
...@@ -638,15 +673,15 @@ __SYSCALL(__NR_madvise, sys_madvise)...@@ -638,15 +673,15 @@ __SYSCALL(__NR_madvise, sys_madvise)
638#define __NR_remap_file_pages 234673#define __NR_remap_file_pages 234
639__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)674__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
640#define __NR_mbind 235675#define __NR_mbind 235
641__SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)676__SYSCALL(__NR_mbind, sys_mbind)
642#define __NR_get_mempolicy 236677#define __NR_get_mempolicy 236
643__SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy)678__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
644#define __NR_set_mempolicy 237679#define __NR_set_mempolicy 237
645__SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy)680__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
646#define __NR_migrate_pages 238681#define __NR_migrate_pages 238
647__SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages)682__SYSCALL(__NR_migrate_pages, sys_migrate_pages)
648#define __NR_move_pages 239683#define __NR_move_pages 239
649__SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)684__SYSCALL(__NR_move_pages, sys_move_pages)
650#endif685#endif
651686
652#define __NR_rt_tgsigqueueinfo 240687#define __NR_rt_tgsigqueueinfo 240
...@@ -656,8 +691,10 @@ __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \...@@ -656,8 +691,10 @@ __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
656__SYSCALL(__NR_perf_event_open, sys_perf_event_open)691__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
657#define __NR_accept4 242692#define __NR_accept4 242
658__SYSCALL(__NR_accept4, sys_accept4)693__SYSCALL(__NR_accept4, sys_accept4)
694#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
659#define __NR_recvmmsg 243695#define __NR_recvmmsg 243
660__SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)696__SC_COMP_3264(__NR_recvmmsg, sys_recvmmsg_time32, sys_recvmmsg, compat_sys_recvmmsg_time32)
697#endif
661698
662/*699/*
663 * Architectures may provide up to 16 syscalls of their own700 * Architectures may provide up to 16 syscalls of their own
...@@ -665,8 +702,10 @@ __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)...@@ -665,8 +702,10 @@ __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
665 */702 */
666#define __NR_arch_specific_syscall 244703#define __NR_arch_specific_syscall 244
667704
705#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
668#define __NR_wait4 260706#define __NR_wait4 260
669__SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)707__SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
708#endif
670#define __NR_prlimit64 261709#define __NR_prlimit64 261
671__SYSCALL(__NR_prlimit64, sys_prlimit64)710__SYSCALL(__NR_prlimit64, sys_prlimit64)
672#define __NR_fanotify_init 262711#define __NR_fanotify_init 262
...@@ -676,10 +715,11 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)...@@ -676,10 +715,11 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
676#define __NR_name_to_handle_at 264715#define __NR_name_to_handle_at 264
677__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)716__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
678#define __NR_open_by_handle_at 265717#define __NR_open_by_handle_at 265
679__SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \718__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at)
680 compat_sys_open_by_handle_at)719#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
681#define __NR_clock_adjtime 266720#define __NR_clock_adjtime 266
682__SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime)721__SC_3264(__NR_clock_adjtime, sys_clock_adjtime32, sys_clock_adjtime)
722#endif
683#define __NR_syncfs 267723#define __NR_syncfs 267
684__SYSCALL(__NR_syncfs, sys_syncfs)724__SYSCALL(__NR_syncfs, sys_syncfs)
685#define __NR_setns 268725#define __NR_setns 268
...@@ -687,11 +727,9 @@ __SYSCALL(__NR_setns, sys_setns)...@@ -687,11 +727,9 @@ __SYSCALL(__NR_setns, sys_setns)
687#define __NR_sendmmsg 269727#define __NR_sendmmsg 269
688__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)728__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
689#define __NR_process_vm_readv 270729#define __NR_process_vm_readv 270
690__SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \730__SYSCALL(__NR_process_vm_readv, sys_process_vm_readv)
691 compat_sys_process_vm_readv)
692#define __NR_process_vm_writev 271731#define __NR_process_vm_writev 271
693__SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \732__SYSCALL(__NR_process_vm_writev, sys_process_vm_writev)
694 compat_sys_process_vm_writev)
695#define __NR_kcmp 272733#define __NR_kcmp 272
696__SYSCALL(__NR_kcmp, sys_kcmp)734__SYSCALL(__NR_kcmp, sys_kcmp)
697#define __NR_finit_module 273735#define __NR_finit_module 273
...@@ -732,13 +770,121 @@ __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)...@@ -732,13 +770,121 @@ __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
732__SYSCALL(__NR_pkey_free, sys_pkey_free)770__SYSCALL(__NR_pkey_free, sys_pkey_free)
733#define __NR_statx 291771#define __NR_statx 291
734__SYSCALL(__NR_statx, sys_statx)772__SYSCALL(__NR_statx, sys_statx)
773#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
735#define __NR_io_pgetevents 292774#define __NR_io_pgetevents 292
736__SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)775__SC_COMP_3264(__NR_io_pgetevents, sys_io_pgetevents_time32, sys_io_pgetevents, compat_sys_io_pgetevents)
776#endif
737#define __NR_rseq 293777#define __NR_rseq 293
738__SYSCALL(__NR_rseq, sys_rseq)778__SYSCALL(__NR_rseq, sys_rseq)
779#define __NR_kexec_file_load 294
780__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
781/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
782#if __BITS_PER_LONG == 32
783#define __NR_clock_gettime64 403
784__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
785#define __NR_clock_settime64 404
786__SYSCALL(__NR_clock_settime64, sys_clock_settime)
787#define __NR_clock_adjtime64 405
788__SYSCALL(__NR_clock_adjtime64, sys_clock_adjtime)
789#define __NR_clock_getres_time64 406
790__SYSCALL(__NR_clock_getres_time64, sys_clock_getres)
791#define __NR_clock_nanosleep_time64 407
792__SYSCALL(__NR_clock_nanosleep_time64, sys_clock_nanosleep)
793#define __NR_timer_gettime64 408
794__SYSCALL(__NR_timer_gettime64, sys_timer_gettime)
795#define __NR_timer_settime64 409
796__SYSCALL(__NR_timer_settime64, sys_timer_settime)
797#define __NR_timerfd_gettime64 410
798__SYSCALL(__NR_timerfd_gettime64, sys_timerfd_gettime)
799#define __NR_timerfd_settime64 411
800__SYSCALL(__NR_timerfd_settime64, sys_timerfd_settime)
801#define __NR_utimensat_time64 412
802__SYSCALL(__NR_utimensat_time64, sys_utimensat)
803#define __NR_pselect6_time64 413
804__SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64)
805#define __NR_ppoll_time64 414
806__SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64)
807#define __NR_io_pgetevents_time64 416
808__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
809#define __NR_recvmmsg_time64 417
810__SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64)
811#define __NR_mq_timedsend_time64 418
812__SYSCALL(__NR_mq_timedsend_time64, sys_mq_timedsend)
813#define __NR_mq_timedreceive_time64 419
814__SYSCALL(__NR_mq_timedreceive_time64, sys_mq_timedreceive)
815#define __NR_semtimedop_time64 420
816__SYSCALL(__NR_semtimedop_time64, sys_semtimedop)
817#define __NR_rt_sigtimedwait_time64 421
818__SC_COMP(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time64)
819#define __NR_futex_time64 422
820__SYSCALL(__NR_futex_time64, sys_futex)
821#define __NR_sched_rr_get_interval_time64 423
822__SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval)
823#endif
824
825#define __NR_pidfd_send_signal 424
826__SYSCALL(__NR_pidfd_send_signal, sys_pidfd_send_signal)
827#define __NR_io_uring_setup 425
828__SYSCALL(__NR_io_uring_setup, sys_io_uring_setup)
829#define __NR_io_uring_enter 426
830__SYSCALL(__NR_io_uring_enter, sys_io_uring_enter)
831#define __NR_io_uring_register 427
832__SYSCALL(__NR_io_uring_register, sys_io_uring_register)
833#define __NR_open_tree 428
834__SYSCALL(__NR_open_tree, sys_open_tree)
835#define __NR_move_mount 429
836__SYSCALL(__NR_move_mount, sys_move_mount)
837#define __NR_fsopen 430
838__SYSCALL(__NR_fsopen, sys_fsopen)
839#define __NR_fsconfig 431
840__SYSCALL(__NR_fsconfig, sys_fsconfig)
841#define __NR_fsmount 432
842__SYSCALL(__NR_fsmount, sys_fsmount)
843#define __NR_fspick 433
844__SYSCALL(__NR_fspick, sys_fspick)
845#define __NR_pidfd_open 434
846__SYSCALL(__NR_pidfd_open, sys_pidfd_open)
847#ifdef __ARCH_WANT_SYS_CLONE3
848#define __NR_clone3 435
849__SYSCALL(__NR_clone3, sys_clone3)
850#endif
851#define __NR_close_range 436
852__SYSCALL(__NR_close_range, sys_close_range)
853
854#define __NR_openat2 437
855__SYSCALL(__NR_openat2, sys_openat2)
856#define __NR_pidfd_getfd 438
857__SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd)
858#define __NR_faccessat2 439
859__SYSCALL(__NR_faccessat2, sys_faccessat2)
860#define __NR_process_madvise 440
861__SYSCALL(__NR_process_madvise, sys_process_madvise)
862#define __NR_epoll_pwait2 441
863__SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
864#define __NR_mount_setattr 442
865__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
866#define __NR_quotactl_fd 443
867__SYSCALL(__NR_quotactl_fd, sys_quotactl_fd)
868
869#define __NR_landlock_create_ruleset 444
870__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
871#define __NR_landlock_add_rule 445
872__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
873#define __NR_landlock_restrict_self 446
874__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
875
876#ifdef __ARCH_WANT_MEMFD_SECRET
877#define __NR_memfd_secret 447
878__SYSCALL(__NR_memfd_secret, sys_memfd_secret)
879#endif
880#define __NR_process_mrelease 448
881__SYSCALL(__NR_process_mrelease, sys_process_mrelease)
882
883#define __NR_futex_waitv 449
884__SYSCALL(__NR_futex_waitv, sys_futex_waitv)
739885
740#undef __NR_syscalls886#undef __NR_syscalls
741#define __NR_syscalls 294887#define __NR_syscalls 450
742888
743/*889/*
744 * 32 bit systems traditionally used different890 * 32 bit systems traditionally used different
...@@ -758,8 +904,10 @@ __SYSCALL(__NR_rseq, sys_rseq)...@@ -758,8 +904,10 @@ __SYSCALL(__NR_rseq, sys_rseq)
758#define __NR_ftruncate __NR3264_ftruncate904#define __NR_ftruncate __NR3264_ftruncate
759#define __NR_lseek __NR3264_lseek905#define __NR_lseek __NR3264_lseek
760#define __NR_sendfile __NR3264_sendfile906#define __NR_sendfile __NR3264_sendfile
907#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
761#define __NR_newfstatat __NR3264_fstatat908#define __NR_newfstatat __NR3264_fstatat
762#define __NR_fstat __NR3264_fstat909#define __NR_fstat __NR3264_fstat
910#endif
763#define __NR_mmap __NR3264_mmap911#define __NR_mmap __NR3264_mmap
764#define __NR_fadvise64 __NR3264_fadvise64912#define __NR_fadvise64 __NR3264_fadvise64
765#ifdef __NR3264_stat913#ifdef __NR3264_stat
...@@ -774,8 +922,10 @@ __SYSCALL(__NR_rseq, sys_rseq)...@@ -774,8 +922,10 @@ __SYSCALL(__NR_rseq, sys_rseq)
774#define __NR_ftruncate64 __NR3264_ftruncate922#define __NR_ftruncate64 __NR3264_ftruncate
775#define __NR_llseek __NR3264_lseek923#define __NR_llseek __NR3264_lseek
776#define __NR_sendfile64 __NR3264_sendfile924#define __NR_sendfile64 __NR3264_sendfile
925#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
777#define __NR_fstatat64 __NR3264_fstatat926#define __NR_fstatat64 __NR3264_fstatat
778#define __NR_fstat64 __NR3264_fstat927#define __NR_fstat64 __NR3264_fstat
928#endif
779#define __NR_mmap2 __NR3264_mmap929#define __NR_mmap2 __NR3264_mmap
780#define __NR_fadvise64_64 __NR3264_fadvise64930#define __NR_fadvise64_64 __NR3264_fadvise64
781#ifdef __NR3264_stat931#ifdef __NR3264_stat
lib/libc/include/any-linux-any/asm/a.out.h deleted-21
...@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_A_OUT_H
3#define _ASM_X86_A_OUT_H
4
5struct exec
6{
7 unsigned int a_info; /* Use macros N_MAGIC, etc for access */
8 unsigned a_text; /* length of text, in bytes */
9 unsigned a_data; /* length of data, in bytes */
10 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
11 unsigned a_syms; /* length of symbol table data in file, in bytes */
12 unsigned a_entry; /* start address */
13 unsigned a_trsize; /* length of relocation info for text, in bytes */
14 unsigned a_drsize; /* length of relocation info for data, in bytes */
15};
16
17#define N_TRSIZE(a) ((a).a_trsize)
18#define N_DRSIZE(a) ((a).a_drsize)
19#define N_SYMSIZE(a) ((a).a_syms)
20
21#endif /* _ASM_X86_A_OUT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/auxvec.h+1-8
...@@ -1,8 +1 @@...@@ -1,8 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_AUXVEC_H
3#define __ASM_AUXVEC_H
4
5/* VDSO location */
6#define AT_SYSINFO_EHDR 33
7
8#endif
\ No newline at end of file
1#include <asm-generic/auxvec.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/bitfield.h deleted-30
...@@ -1,30 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 2014 by Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __UAPI_ASM_BITFIELD_H
10#define __UAPI_ASM_BITFIELD_H
11
12/*
13 * * Damn ... bitfields depend from byteorder :-(
14 * */
15#ifdef __MIPSEB__
16#define __BITFIELD_FIELD(field, more) \
17 field; \
18 more
19
20#elif defined(__MIPSEL__)
21
22#define __BITFIELD_FIELD(field, more) \
23 more \
24 field;
25
26#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */
27#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
28#endif
29
30#endif /* __UAPI_ASM_BITFIELD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/boot.h deleted-11
...@@ -1,11 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_BOOT_H
3#define _ASM_X86_BOOT_H
4
5/* Internal svga startup constants */
6#define NORMAL_VGA 0xffff /* 80x25 mode */
7#define EXTENDED_VGA 0xfffe /* 80x50 mode */
8#define ASK_VGA 0xfffd /* ask for it at bootup */
9
10
11#endif /* _ASM_X86_BOOT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/bootparam.h deleted-249
...@@ -1,249 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_BOOTPARAM_H
3#define _ASM_X86_BOOTPARAM_H
4
5/* setup_data types */
6#define SETUP_NONE 0
7#define SETUP_E820_EXT 1
8#define SETUP_DTB 2
9#define SETUP_PCI 3
10#define SETUP_EFI 4
11#define SETUP_APPLE_PROPERTIES 5
12#define SETUP_JAILHOUSE 6
13
14/* ram_size flags */
15#define RAMDISK_IMAGE_START_MASK 0x07FF
16#define RAMDISK_PROMPT_FLAG 0x8000
17#define RAMDISK_LOAD_FLAG 0x4000
18
19/* loadflags */
20#define LOADED_HIGH (1<<0)
21#define KASLR_FLAG (1<<1)
22#define QUIET_FLAG (1<<5)
23#define KEEP_SEGMENTS (1<<6)
24#define CAN_USE_HEAP (1<<7)
25
26/* xloadflags */
27#define XLF_KERNEL_64 (1<<0)
28#define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1)
29#define XLF_EFI_HANDOVER_32 (1<<2)
30#define XLF_EFI_HANDOVER_64 (1<<3)
31#define XLF_EFI_KEXEC (1<<4)
32
33#ifndef __ASSEMBLY__
34
35#include <linux/types.h>
36#include <linux/screen_info.h>
37#include <linux/apm_bios.h>
38#include <linux/edd.h>
39#include <asm/ist.h>
40#include <video/edid.h>
41
42/* extensible setup data list node */
43struct setup_data {
44 __u64 next;
45 __u32 type;
46 __u32 len;
47 __u8 data[0];
48};
49
50struct setup_header {
51 __u8 setup_sects;
52 __u16 root_flags;
53 __u32 syssize;
54 __u16 ram_size;
55 __u16 vid_mode;
56 __u16 root_dev;
57 __u16 boot_flag;
58 __u16 jump;
59 __u32 header;
60 __u16 version;
61 __u32 realmode_swtch;
62 __u16 start_sys_seg;
63 __u16 kernel_version;
64 __u8 type_of_loader;
65 __u8 loadflags;
66 __u16 setup_move_size;
67 __u32 code32_start;
68 __u32 ramdisk_image;
69 __u32 ramdisk_size;
70 __u32 bootsect_kludge;
71 __u16 heap_end_ptr;
72 __u8 ext_loader_ver;
73 __u8 ext_loader_type;
74 __u32 cmd_line_ptr;
75 __u32 initrd_addr_max;
76 __u32 kernel_alignment;
77 __u8 relocatable_kernel;
78 __u8 min_alignment;
79 __u16 xloadflags;
80 __u32 cmdline_size;
81 __u32 hardware_subarch;
82 __u64 hardware_subarch_data;
83 __u32 payload_offset;
84 __u32 payload_length;
85 __u64 setup_data;
86 __u64 pref_address;
87 __u32 init_size;
88 __u32 handover_offset;
89} __attribute__((packed));
90
91struct sys_desc_table {
92 __u16 length;
93 __u8 table[14];
94};
95
96/* Gleaned from OFW's set-parameters in cpu/x86/pc/linux.fth */
97struct olpc_ofw_header {
98 __u32 ofw_magic; /* OFW signature */
99 __u32 ofw_version;
100 __u32 cif_handler; /* callback into OFW */
101 __u32 irq_desc_table;
102} __attribute__((packed));
103
104struct efi_info {
105 __u32 efi_loader_signature;
106 __u32 efi_systab;
107 __u32 efi_memdesc_size;
108 __u32 efi_memdesc_version;
109 __u32 efi_memmap;
110 __u32 efi_memmap_size;
111 __u32 efi_systab_hi;
112 __u32 efi_memmap_hi;
113};
114
115/*
116 * This is the maximum number of entries in struct boot_params::e820_table
117 * (the zeropage), which is part of the x86 boot protocol ABI:
118 */
119#define E820_MAX_ENTRIES_ZEROPAGE 128
120
121/*
122 * The E820 memory region entry of the boot protocol ABI:
123 */
124struct boot_e820_entry {
125 __u64 addr;
126 __u64 size;
127 __u32 type;
128} __attribute__((packed));
129
130/*
131 * Smallest compatible version of jailhouse_setup_data required by this kernel.
132 */
133#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
134
135/*
136 * The boot loader is passing platform information via this Jailhouse-specific
137 * setup data structure.
138 */
139struct jailhouse_setup_data {
140 __u16 version;
141 __u16 compatible_version;
142 __u16 pm_timer_address;
143 __u16 num_cpus;
144 __u64 pci_mmconfig_base;
145 __u32 tsc_khz;
146 __u32 apic_khz;
147 __u8 standard_ioapic;
148 __u8 cpu_ids[255];
149} __attribute__((packed));
150
151/* The so-called "zeropage" */
152struct boot_params {
153 struct screen_info screen_info; /* 0x000 */
154 struct apm_bios_info apm_bios_info; /* 0x040 */
155 __u8 _pad2[4]; /* 0x054 */
156 __u64 tboot_addr; /* 0x058 */
157 struct ist_info ist_info; /* 0x060 */
158 __u8 _pad3[16]; /* 0x070 */
159 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
160 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
161 struct sys_desc_table sys_desc_table; /* obsolete! */ /* 0x0a0 */
162 struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */
163 __u32 ext_ramdisk_image; /* 0x0c0 */
164 __u32 ext_ramdisk_size; /* 0x0c4 */
165 __u32 ext_cmd_line_ptr; /* 0x0c8 */
166 __u8 _pad4[116]; /* 0x0cc */
167 struct edid_info edid_info; /* 0x140 */
168 struct efi_info efi_info; /* 0x1c0 */
169 __u32 alt_mem_k; /* 0x1e0 */
170 __u32 scratch; /* Scratch field! */ /* 0x1e4 */
171 __u8 e820_entries; /* 0x1e8 */
172 __u8 eddbuf_entries; /* 0x1e9 */
173 __u8 edd_mbr_sig_buf_entries; /* 0x1ea */
174 __u8 kbd_status; /* 0x1eb */
175 __u8 secure_boot; /* 0x1ec */
176 __u8 _pad5[2]; /* 0x1ed */
177 /*
178 * The sentinel is set to a nonzero value (0xff) in header.S.
179 *
180 * A bootloader is supposed to only take setup_header and put
181 * it into a clean boot_params buffer. If it turns out that
182 * it is clumsy or too generous with the buffer, it most
183 * probably will pick up the sentinel variable too. The fact
184 * that this variable then is still 0xff will let kernel
185 * know that some variables in boot_params are invalid and
186 * kernel should zero out certain portions of boot_params.
187 */
188 __u8 sentinel; /* 0x1ef */
189 __u8 _pad6[1]; /* 0x1f0 */
190 struct setup_header hdr; /* setup header */ /* 0x1f1 */
191 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
192 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
193 struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE]; /* 0x2d0 */
194 __u8 _pad8[48]; /* 0xcd0 */
195 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
196 __u8 _pad9[276]; /* 0xeec */
197} __attribute__((packed));
198
199/**
200 * enum x86_hardware_subarch - x86 hardware subarchitecture
201 *
202 * The x86 hardware_subarch and hardware_subarch_data were added as of the x86
203 * boot protocol 2.07 to help distinguish and support custom x86 boot
204 * sequences. This enum represents accepted values for the x86
205 * hardware_subarch. Custom x86 boot sequences (not X86_SUBARCH_PC) do not
206 * have or simply *cannot* make use of natural stubs like BIOS or EFI, the
207 * hardware_subarch can be used on the Linux entry path to revector to a
208 * subarchitecture stub when needed. This subarchitecture stub can be used to
209 * set up Linux boot parameters or for special care to account for nonstandard
210 * handling of page tables.
211 *
212 * These enums should only ever be used by x86 code, and the code that uses
213 * it should be well contained and compartamentalized.
214 *
215 * KVM and Xen HVM do not have a subarch as these are expected to follow
216 * standard x86 boot entries. If there is a genuine need for "hypervisor" type
217 * that should be considered separately in the future. Future guest types
218 * should seriously consider working with standard x86 boot stubs such as
219 * the BIOS or EFI boot stubs.
220 *
221 * WARNING: this enum is only used for legacy hacks, for platform features that
222 * are not easily enumerated or discoverable. You should not ever use
223 * this for new features.
224 *
225 * @X86_SUBARCH_PC: Should be used if the hardware is enumerable using standard
226 * PC mechanisms (PCI, ACPI) and doesn't need a special boot flow.
227 * @X86_SUBARCH_LGUEST: Used for x86 hypervisor demo, lguest, deprecated
228 * @X86_SUBARCH_XEN: Used for Xen guest types which follow the PV boot path,
229 * which start at __asm__ startup_xen() entry point and later jump to the C
230 * xen_start_kernel() entry point. Both domU and dom0 type of guests are
231 * currently supportd through this PV boot path.
232 * @X86_SUBARCH_INTEL_MID: Used for Intel MID (Mobile Internet Device) platform
233 * systems which do not have the PCI legacy interfaces.
234 * @X86_SUBARCH_CE4100: Used for Intel CE media processor (CE4100) SoC for
235 * for settop boxes and media devices, the use of a subarch for CE4100
236 * is more of a hack...
237 */
238enum x86_hardware_subarch {
239 X86_SUBARCH_PC = 0,
240 X86_SUBARCH_LGUEST,
241 X86_SUBARCH_XEN,
242 X86_SUBARCH_INTEL_MID,
243 X86_SUBARCH_CE4100,
244 X86_NR_SUBARCHS,
245};
246
247#endif /* __ASSEMBLY__ */
248
249#endif /* _ASM_X86_BOOTPARAM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/bootx.h deleted-133
...@@ -1,133 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file describes the structure passed from the BootX application
4 * (for MacOS) when it is used to boot Linux.
5 *
6 * Written by Benjamin Herrenschmidt.
7 */
8
9
10#ifndef __ASM_BOOTX_H__
11#define __ASM_BOOTX_H__
12
13#include <linux/types.h>
14
15#ifdef macintosh
16#include <Types.h>
17#include "linux_type_defs.h"
18#endif
19
20#ifdef macintosh
21/* All this requires PowerPC alignment */
22#pragma options align=power
23#endif
24
25/* On kernel entry:
26 *
27 * r3 = 0x426f6f58 ('BooX')
28 * r4 = pointer to boot_infos
29 * r5 = NULL
30 *
31 * Data and instruction translation disabled, interrupts
32 * disabled, kernel loaded at physical 0x00000000 on PCI
33 * machines (will be different on NuBus).
34 */
35
36#define BOOT_INFO_VERSION 5
37#define BOOT_INFO_COMPATIBLE_VERSION 1
38
39/* Bit in the architecture flag mask. More to be defined in
40 future versions. Note that either BOOT_ARCH_PCI or
41 BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
42 set additionally when BOOT_ARCH_NUBUS is set.
43 */
44#define BOOT_ARCH_PCI 0x00000001UL
45#define BOOT_ARCH_NUBUS 0x00000002UL
46#define BOOT_ARCH_NUBUS_PDM 0x00000010UL
47#define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL
48#define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL
49
50/* Maximum number of ranges in phys memory map */
51#define MAX_MEM_MAP_SIZE 26
52
53/* This is the format of an element in the physical memory map. Note that
54 the map is optional and current BootX will only build it for pre-PCI
55 machines */
56typedef struct boot_info_map_entry
57{
58 __u32 physAddr; /* Physical starting address */
59 __u32 size; /* Size in bytes */
60} boot_info_map_entry_t;
61
62
63/* Here are the boot informations that are passed to the bootstrap
64 * Note that the kernel arguments and the device tree are appended
65 * at the end of this structure. */
66typedef struct boot_infos
67{
68 /* Version of this structure */
69 __u32 version;
70 /* backward compatible down to version: */
71 __u32 compatible_version;
72
73 /* NEW (vers. 2) this holds the current _logical_ base addr of
74 the frame buffer (for use by early boot message) */
75 __u8* logicalDisplayBase;
76
77 /* NEW (vers. 4) Apple's machine identification */
78 __u32 machineID;
79
80 /* NEW (vers. 4) Detected hw architecture */
81 __u32 architecture;
82
83 /* The device tree (internal addresses relative to the beginning of the tree,
84 * device tree offset relative to the beginning of this structure).
85 * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
86 * field is 0.
87 */
88 __u32 deviceTreeOffset; /* Device tree offset */
89 __u32 deviceTreeSize; /* Size of the device tree */
90
91 /* Some infos about the current MacOS display */
92 __u32 dispDeviceRect[4]; /* left,top,right,bottom */
93 __u32 dispDeviceDepth; /* (8, 16 or 32) */
94 __u8* dispDeviceBase; /* base address (physical) */
95 __u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
96 __u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
97 /* Optional offset in the registry to the current
98 * MacOS display. (Can be 0 when not detected) */
99 __u32 dispDeviceRegEntryOffset;
100
101 /* Optional pointer to boot ramdisk (offset from this structure) */
102 __u32 ramDisk;
103 __u32 ramDiskSize; /* size of ramdisk image */
104
105 /* Kernel command line arguments (offset from this structure) */
106 __u32 kernelParamsOffset;
107
108 /* ALL BELOW NEW (vers. 4) */
109
110 /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
111 (non-PCI) only. On PCI, memory is contiguous and it's size is in the
112 device-tree. */
113 boot_info_map_entry_t
114 physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
115 __u32 physMemoryMapSize; /* How many entries in map */
116
117
118 /* The framebuffer size (optional, currently 0) */
119 __u32 frameBufferSize; /* Represents a max size, can be 0. */
120
121 /* NEW (vers. 5) */
122
123 /* Total params size (args + colormap + device tree + ramdisk) */
124 __u32 totalParamsSize;
125
126} boot_infos_t;
127
128
129#ifdef macintosh
130#pragma options align=reset
131#endif
132
133#endif /* __ASM_BOOTX_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/break.h deleted-32
...@@ -1,32 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 2003 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef __UAPI_ASM_BREAK_H
11#define __UAPI_ASM_BREAK_H
12
13/*
14 * The following break codes are or were in use for specific purposes in
15 * other MIPS operating systems. Linux/MIPS doesn't use all of them. The
16 * unused ones are here as placeholders; we might encounter them in
17 * non-Linux/MIPS object files or make use of them in the future.
18 */
19#define BRK_USERBP 0 /* User bp (used by debuggers) */
20#define BRK_SSTEPBP 5 /* User bp (used by debuggers) */
21#define BRK_OVERFLOW 6 /* Overflow check */
22#define BRK_DIVZERO 7 /* Divide by zero check */
23#define BRK_RANGE 8 /* Range error check */
24#define BRK_BUG 12 /* Used by BUG() */
25#define BRK_UPROBE 13 /* See <asm/uprobes.h> */
26#define BRK_UPROBE_XOL 14 /* See <asm/uprobes.h> */
27#define BRK_MEMU 514 /* Used by FPU emulator */
28#define BRK_KPROBE_BP 515 /* Kprobe break */
29#define BRK_KPROBE_SSTEPBP 516 /* Kprobe single step software implementation */
30#define BRK_MULOVF 1023 /* Multiply overflow */
31
32#endif /* __UAPI_ASM_BREAK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/byteorder.h deleted-25
...@@ -1,25 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/byteorder.h
4 *
5 * ARM Endian-ness. In little endian mode, the data bus is connected such
6 * that byte accesses appear as:
7 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
8 * and word accesses (data or instruction) appear as:
9 * d0...d31
10 *
11 * When in big endian mode, byte accesses appear as:
12 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
13 * and word accesses (data or instruction) appear as:
14 * d0...d31
15 */
16#ifndef __ASM_ARM_BYTEORDER_H
17#define __ASM_ARM_BYTEORDER_H
18
19#ifdef __ARMEB__
20#include <linux/byteorder/big_endian.h>
21#else
22#include <linux/byteorder/little_endian.h>
23#endif
24
25#endif
\ No newline at end of file
lib/libc/include/any-linux-any/asm/cachectl.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 1995, 1996 by Ralf Baechle
8 */
9#ifndef _ASM_CACHECTL
10#define _ASM_CACHECTL
11
12/*
13 * Options for cacheflush system call
14 */
15#define ICACHE (1<<0) /* flush instruction cache */
16#define DCACHE (1<<1) /* writeback and flush data cache */
17#define BCACHE (ICACHE|DCACHE) /* flush both caches */
18
19/*
20 * Caching modes for the cachectl(2) call
21 *
22 * cachectl(2) is currently not supported and returns ENOSYS.
23 */
24#define CACHEABLE 0 /* make pages cacheable */
25#define UNCACHEABLE 1 /* make pages uncacheable */
26
27#endif /* _ASM_CACHECTL */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/cputable.h deleted-61
...@@ -1,61 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POWERPC_CPUTABLE_H
3#define __ASM_POWERPC_CPUTABLE_H
4
5/* in AT_HWCAP */
6#define PPC_FEATURE_32 0x80000000
7#define PPC_FEATURE_64 0x40000000
8#define PPC_FEATURE_601_INSTR 0x20000000
9#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
10#define PPC_FEATURE_HAS_FPU 0x08000000
11#define PPC_FEATURE_HAS_MMU 0x04000000
12#define PPC_FEATURE_HAS_4xxMAC 0x02000000
13#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
14#define PPC_FEATURE_HAS_SPE 0x00800000
15#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
16#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
17#define PPC_FEATURE_NO_TB 0x00100000
18#define PPC_FEATURE_POWER4 0x00080000
19#define PPC_FEATURE_POWER5 0x00040000
20#define PPC_FEATURE_POWER5_PLUS 0x00020000
21#define PPC_FEATURE_CELL 0x00010000
22#define PPC_FEATURE_BOOKE 0x00008000
23#define PPC_FEATURE_SMT 0x00004000
24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
25#define PPC_FEATURE_ARCH_2_05 0x00001000
26#define PPC_FEATURE_PA6T 0x00000800
27#define PPC_FEATURE_HAS_DFP 0x00000400
28#define PPC_FEATURE_POWER6_EXT 0x00000200
29#define PPC_FEATURE_ARCH_2_06 0x00000100
30#define PPC_FEATURE_HAS_VSX 0x00000080
31
32#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
33 0x00000040
34
35/* Reserved - do not use 0x00000004 */
36#define PPC_FEATURE_TRUE_LE 0x00000002
37#define PPC_FEATURE_PPC_LE 0x00000001
38
39/* in AT_HWCAP2 */
40#define PPC_FEATURE2_ARCH_2_07 0x80000000
41#define PPC_FEATURE2_HTM 0x40000000
42#define PPC_FEATURE2_DSCR 0x20000000
43#define PPC_FEATURE2_EBB 0x10000000
44#define PPC_FEATURE2_ISEL 0x08000000
45#define PPC_FEATURE2_TAR 0x04000000
46#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
47#define PPC_FEATURE2_HTM_NOSC 0x01000000
48#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */
49#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */
50#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
51#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
52#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended state */
53
54/*
55 * IMPORTANT!
56 * All future PPC_FEATURE definitions should be allocated in cooperation with
57 * OPAL / skiboot firmware, in accordance with the ibm,powerpc-cpu-features
58 * device tree binding.
59 */
60
61#endif /* __ASM_POWERPC_CPUTABLE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/debugreg.h deleted-81
...@@ -1,81 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_DEBUGREG_H
3#define _ASM_X86_DEBUGREG_H
4
5
6/* Indicate the register numbers for a number of the specific
7 debug registers. Registers 0-3 contain the addresses we wish to trap on */
8#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
9#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
10
11#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
12#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
13
14/* Define a few things for the status register. We can use this to determine
15 which debugging register was responsible for the trap. The other bits
16 are either reserved or not of interest to us. */
17
18/* Define reserved bits in DR6 which are always set to 1 */
19#define DR6_RESERVED (0xFFFF0FF0)
20
21#define DR_TRAP0 (0x1) /* db0 */
22#define DR_TRAP1 (0x2) /* db1 */
23#define DR_TRAP2 (0x4) /* db2 */
24#define DR_TRAP3 (0x8) /* db3 */
25#define DR_TRAP_BITS (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)
26
27#define DR_STEP (0x4000) /* single-step */
28#define DR_SWITCH (0x8000) /* task switch */
29
30/* Now define a bunch of things for manipulating the control register.
31 The top two bytes of the control register consist of 4 fields of 4
32 bits - each field corresponds to one of the four debug registers,
33 and indicates what types of access we trap on, and how large the data
34 field is that we are looking at */
35
36#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
37#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
38
39#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
40#define DR_RW_WRITE (0x1)
41#define DR_RW_READ (0x3)
42
43#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
44#define DR_LEN_2 (0x4)
45#define DR_LEN_4 (0xC)
46#define DR_LEN_8 (0x8)
47
48/* The low byte to the control register determine which registers are
49 enabled. There are 4 fields of two bits. One bit is "local", meaning
50 that the processor will reset the bit after a task switch and the other
51 is global meaning that we have to explicitly reset the bit. With linux,
52 you can use either one, since we explicitly zero the register when we enter
53 kernel mode. */
54
55#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
56#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
57#define DR_LOCAL_ENABLE (0x1) /* Local enable for reg 0 */
58#define DR_GLOBAL_ENABLE (0x2) /* Global enable for reg 0 */
59#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
60
61#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
62#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
63
64/* The second byte to the control register has a few special things.
65 We can slow the instruction pipeline for instructions coming via the
66 gdt or the ldt if we want to. I am not sure why this is an advantage */
67
68#ifdef __i386__
69#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
70#else
71#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
72#endif
73
74#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
75#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
76
77/*
78 * HW breakpoint additions
79 */
80
81#endif /* _ASM_X86_DEBUGREG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/e820.h deleted-80
...@@ -1,80 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_E820_H
3#define _ASM_X86_E820_H
4#define E820MAP 0x2d0 /* our map */
5#define E820MAX 128 /* number of entries in E820MAP */
6
7/*
8 * Legacy E820 BIOS limits us to 128 (E820MAX) nodes due to the
9 * constrained space in the zeropage. If we have more nodes than
10 * that, and if we've booted off EFI firmware, then the EFI tables
11 * passed us from the EFI firmware can list more nodes. Size our
12 * internal memory map tables to have room for these additional
13 * nodes, based on up to three entries per node for which the
14 * kernel was built: MAX_NUMNODES == (1 << CONFIG_NODES_SHIFT),
15 * plus E820MAX, allowing space for the possible duplicate E820
16 * entries that might need room in the same arrays, prior to the
17 * call to sanitize_e820_map() to remove duplicates. The allowance
18 * of three memory map entries per node is "enough" entries for
19 * the initial hardware platform motivating this mechanism to make
20 * use of additional EFI map entries. Future platforms may want
21 * to allow more than three entries per node or otherwise refine
22 * this size.
23 */
24
25#define E820_X_MAX E820MAX
26
27#define E820NR 0x1e8 /* # entries in E820MAP */
28
29#define E820_RAM 1
30#define E820_RESERVED 2
31#define E820_ACPI 3
32#define E820_NVS 4
33#define E820_UNUSABLE 5
34#define E820_PMEM 7
35
36/*
37 * This is a non-standardized way to represent ADR or NVDIMM regions that
38 * persist over a reboot. The kernel will ignore their special capabilities
39 * unless the CONFIG_X86_PMEM_LEGACY option is set.
40 *
41 * ( Note that older platforms also used 6 for the same type of memory,
42 * but newer versions switched to 12 as 6 was assigned differently. Some
43 * time they will learn... )
44 */
45#define E820_PRAM 12
46
47/*
48 * reserved RAM used by kernel itself
49 * if CONFIG_INTEL_TXT is enabled, memory of this type will be
50 * included in the S3 integrity calculation and so should not include
51 * any memory that BIOS might alter over the S3 transition
52 */
53#define E820_RESERVED_KERN 128
54
55#ifndef __ASSEMBLY__
56#include <linux/types.h>
57struct e820entry {
58 __u64 addr; /* start of memory segment */
59 __u64 size; /* size of memory segment */
60 __u32 type; /* type of memory segment */
61} __attribute__((packed));
62
63struct e820map {
64 __u32 nr_map;
65 struct e820entry map[E820_X_MAX];
66};
67
68#define ISA_START_ADDRESS 0xa0000
69#define ISA_END_ADDRESS 0x100000
70
71#define BIOS_BEGIN 0x000a0000
72#define BIOS_END 0x00100000
73
74#define BIOS_ROM_BASE 0xffe00000
75#define BIOS_ROM_END 0xffffffff
76
77#endif /* __ASSEMBLY__ */
78
79
80#endif /* _ASM_X86_E820_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/eeh.h deleted-57
...@@ -1,57 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2015
17 *
18 * Authors: Gavin Shan <gwshan@linux.vnet.ibm.com>
19 */
20
21#ifndef _ASM_POWERPC_EEH_H
22#define _ASM_POWERPC_EEH_H
23
24/* PE states */
25#define EEH_PE_STATE_NORMAL 0 /* Normal state */
26#define EEH_PE_STATE_RESET 1 /* PE reset asserted */
27#define EEH_PE_STATE_STOPPED_IO_DMA 2 /* Frozen PE */
28#define EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
29#define EEH_PE_STATE_UNAVAIL 5 /* Unavailable */
30
31/* EEH error types and functions */
32#define EEH_ERR_TYPE_32 0 /* 32-bits error */
33#define EEH_ERR_TYPE_64 1 /* 64-bits error */
34#define EEH_ERR_FUNC_MIN 0
35#define EEH_ERR_FUNC_LD_MEM_ADDR 0 /* Memory load */
36#define EEH_ERR_FUNC_LD_MEM_DATA 1
37#define EEH_ERR_FUNC_LD_IO_ADDR 2 /* IO load */
38#define EEH_ERR_FUNC_LD_IO_DATA 3
39#define EEH_ERR_FUNC_LD_CFG_ADDR 4 /* Config load */
40#define EEH_ERR_FUNC_LD_CFG_DATA 5
41#define EEH_ERR_FUNC_ST_MEM_ADDR 6 /* Memory store */
42#define EEH_ERR_FUNC_ST_MEM_DATA 7
43#define EEH_ERR_FUNC_ST_IO_ADDR 8 /* IO store */
44#define EEH_ERR_FUNC_ST_IO_DATA 9
45#define EEH_ERR_FUNC_ST_CFG_ADDR 10 /* Config store */
46#define EEH_ERR_FUNC_ST_CFG_DATA 11
47#define EEH_ERR_FUNC_DMA_RD_ADDR 12 /* DMA read */
48#define EEH_ERR_FUNC_DMA_RD_DATA 13
49#define EEH_ERR_FUNC_DMA_RD_MASTER 14
50#define EEH_ERR_FUNC_DMA_RD_TARGET 15
51#define EEH_ERR_FUNC_DMA_WR_ADDR 16 /* DMA write */
52#define EEH_ERR_FUNC_DMA_WR_DATA 17
53#define EEH_ERR_FUNC_DMA_WR_MASTER 18
54#define EEH_ERR_FUNC_DMA_WR_TARGET 19
55#define EEH_ERR_FUNC_MAX 19
56
57#endif /* _ASM_POWERPC_EEH_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/elf.h deleted-300
...@@ -1,300 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * ELF register definitions..
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#ifndef _ASM_POWERPC_ELF_H
11#define _ASM_POWERPC_ELF_H
12
13
14#include <linux/types.h>
15
16#include <asm/ptrace.h>
17#include <asm/cputable.h>
18#include <asm/auxvec.h>
19
20/* PowerPC relocations defined by the ABIs */
21#define R_PPC_NONE 0
22#define R_PPC_ADDR32 1 /* 32bit absolute address */
23#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
24#define R_PPC_ADDR16 3 /* 16bit absolute address */
25#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
26#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
27#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
28#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
29#define R_PPC_ADDR14_BRTAKEN 8
30#define R_PPC_ADDR14_BRNTAKEN 9
31#define R_PPC_REL24 10 /* PC relative 26 bit */
32#define R_PPC_REL14 11 /* PC relative 16 bit */
33#define R_PPC_REL14_BRTAKEN 12
34#define R_PPC_REL14_BRNTAKEN 13
35#define R_PPC_GOT16 14
36#define R_PPC_GOT16_LO 15
37#define R_PPC_GOT16_HI 16
38#define R_PPC_GOT16_HA 17
39#define R_PPC_PLTREL24 18
40#define R_PPC_COPY 19
41#define R_PPC_GLOB_DAT 20
42#define R_PPC_JMP_SLOT 21
43#define R_PPC_RELATIVE 22
44#define R_PPC_LOCAL24PC 23
45#define R_PPC_UADDR32 24
46#define R_PPC_UADDR16 25
47#define R_PPC_REL32 26
48#define R_PPC_PLT32 27
49#define R_PPC_PLTREL32 28
50#define R_PPC_PLT16_LO 29
51#define R_PPC_PLT16_HI 30
52#define R_PPC_PLT16_HA 31
53#define R_PPC_SDAREL16 32
54#define R_PPC_SECTOFF 33
55#define R_PPC_SECTOFF_LO 34
56#define R_PPC_SECTOFF_HI 35
57#define R_PPC_SECTOFF_HA 36
58
59/* PowerPC relocations defined for the TLS access ABI. */
60#define R_PPC_TLS 67 /* none (sym+add)@tls */
61#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */
62#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */
63#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
64#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
65#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
66#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */
67#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */
68#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
69#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
70#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
71#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */
72#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
73#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
74#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
75#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
76#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
77#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
78#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
79#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
80#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */
81#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */
82#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
83#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
84#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */
85#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */
86#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */
87#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */
88
89/* keep this the last entry. */
90#define R_PPC_NUM 95
91
92
93#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
94#define ELF_NFPREG 33 /* includes fpscr */
95#define ELF_NVMX 34 /* includes all vector registers */
96#define ELF_NVSX 32 /* includes all VSX registers */
97#define ELF_NTMSPRREG 3 /* include tfhar, tfiar, texasr */
98#define ELF_NEBB 3 /* includes ebbrr, ebbhr, bescr */
99#define ELF_NPMU 5 /* includes siar, sdar, sier, mmcr2, mmcr0 */
100#define ELF_NPKEY 3 /* includes amr, iamr, uamor */
101
102typedef unsigned long elf_greg_t64;
103typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG];
104
105typedef unsigned int elf_greg_t32;
106typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
107typedef elf_gregset_t32 compat_elf_gregset_t;
108
109/*
110 * ELF_ARCH, CLASS, and DATA are used to set parameters in the core dumps.
111 */
112#ifdef __powerpc64__
113# define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */
114# define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */
115# define ELF_NVSRHALFREG 32 /* Half the vsx registers */
116# define ELF_GREG_TYPE elf_greg_t64
117# define ELF_ARCH EM_PPC64
118# define ELF_CLASS ELFCLASS64
119typedef elf_greg_t64 elf_greg_t;
120typedef elf_gregset_t64 elf_gregset_t;
121#else
122# define ELF_NEVRREG 34 /* includes acc (as 2) */
123# define ELF_NVRREG 33 /* includes vscr */
124# define ELF_GREG_TYPE elf_greg_t32
125# define ELF_ARCH EM_PPC
126# define ELF_CLASS ELFCLASS32
127typedef elf_greg_t32 elf_greg_t;
128typedef elf_gregset_t32 elf_gregset_t;
129#endif /* __powerpc64__ */
130
131#ifdef __BIG_ENDIAN__
132#define ELF_DATA ELFDATA2MSB
133#else
134#define ELF_DATA ELFDATA2LSB
135#endif
136
137/* Floating point registers */
138typedef double elf_fpreg_t;
139typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
140
141/* Altivec registers */
142/*
143 * The entries with indexes 0-31 contain the corresponding vector registers.
144 * The entry with index 32 contains the vscr as the last word (offset 12)
145 * within the quadword. This allows the vscr to be stored as either a
146 * quadword (since it must be copied via a vector register to/from storage)
147 * or as a word.
148 *
149 * 64-bit kernel notes: The entry at index 33 contains the vrsave as the first
150 * word (offset 0) within the quadword.
151 *
152 * This definition of the VMX state is compatible with the current PPC32
153 * ptrace interface. This allows signal handling and ptrace to use the same
154 * structures. This also simplifies the implementation of a bi-arch
155 * (combined (32- and 64-bit) gdb.
156 *
157 * Note that it's _not_ compatible with 32 bits ucontext which stuffs the
158 * vrsave along with vscr and so only uses 33 vectors for the register set
159 */
160typedef __vector128 elf_vrreg_t;
161typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
162#ifdef __powerpc64__
163typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
164typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
165#endif
166
167/* PowerPC64 relocations defined by the ABIs */
168#define R_PPC64_NONE R_PPC_NONE
169#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address. */
170#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned. */
171#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address. */
172#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of abs. address. */
173#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of abs. address. */
174#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */
175#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned. */
176#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
177#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
178#define R_PPC64_REL24 R_PPC_REL24 /* PC relative 26 bit, word aligned. */
179#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit. */
180#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
181#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
182#define R_PPC64_GOT16 R_PPC_GOT16
183#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
184#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
185#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
186
187#define R_PPC64_COPY R_PPC_COPY
188#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
189#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
190#define R_PPC64_RELATIVE R_PPC_RELATIVE
191
192#define R_PPC64_UADDR32 R_PPC_UADDR32
193#define R_PPC64_UADDR16 R_PPC_UADDR16
194#define R_PPC64_REL32 R_PPC_REL32
195#define R_PPC64_PLT32 R_PPC_PLT32
196#define R_PPC64_PLTREL32 R_PPC_PLTREL32
197#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
198#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
199#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
200
201#define R_PPC64_SECTOFF R_PPC_SECTOFF
202#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
203#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
204#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
205#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2. */
206#define R_PPC64_ADDR64 38 /* doubleword64 S + A. */
207#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A). */
208#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A). */
209#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A). */
210#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A). */
211#define R_PPC64_UADDR64 43 /* doubleword64 S + A. */
212#define R_PPC64_REL64 44 /* doubleword64 S + A - P. */
213#define R_PPC64_PLT64 45 /* doubleword64 L + A. */
214#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P. */
215#define R_PPC64_TOC16 47 /* half16* S + A - .TOC. */
216#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.). */
217#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.). */
218#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.). */
219#define R_PPC64_TOC 51 /* doubleword64 .TOC. */
220#define R_PPC64_PLTGOT16 52 /* half16* M + A. */
221#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A). */
222#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A). */
223#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A). */
224
225#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2. */
226#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2. */
227#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2. */
228#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2. */
229#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2. */
230#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2. */
231#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2. */
232#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2. */
233#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2. */
234#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2. */
235#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2. */
236
237/* PowerPC64 relocations defined for the TLS access ABI. */
238#define R_PPC64_TLS 67 /* none (sym+add)@tls */
239#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */
240#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */
241#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
242#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
243#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
244#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */
245#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */
246#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
247#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
248#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
249#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */
250#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
251#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
252#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
253#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
254#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
255#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
256#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
257#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
258#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */
259#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
260#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
261#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
262#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */
263#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
264#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */
265#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */
266#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */
267#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */
268#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */
269#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */
270#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */
271#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */
272#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */
273#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */
274#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */
275#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */
276#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */
277#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */
278#define R_PPC64_TLSGD 107
279#define R_PPC64_TLSLD 108
280#define R_PPC64_TOCSAVE 109
281
282#define R_PPC64_ENTRY 118
283
284#define R_PPC64_REL16 249
285#define R_PPC64_REL16_LO 250
286#define R_PPC64_REL16_HI 251
287#define R_PPC64_REL16_HA 252
288
289/* Keep this the last entry. */
290#define R_PPC64_NUM 253
291
292/* There's actually a third entry here, but it's unused */
293struct ppc64_opd_entry
294{
295 unsigned long funcaddr;
296 unsigned long r2;
297};
298
299
300#endif /* _ASM_POWERPC_ELF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/epapr_hcalls.h deleted-99
...@@ -1,99 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * ePAPR hcall interface
4 *
5 * Copyright 2008-2011 Freescale Semiconductor, Inc.
6 *
7 * Author: Timur Tabi <timur@freescale.com>
8 *
9 * This file is provided under a dual BSD/GPL license. When using or
10 * redistributing this file, you may do so under either license.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * * Neither the name of Freescale Semiconductor nor the
20 * names of its contributors may be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 *
24 * ALTERNATIVELY, this software may be distributed under the terms of the
25 * GNU General Public License ("GPL") as published by the Free Software
26 * Foundation, either version 2 of that License or (at your option) any
27 * later version.
28 *
29 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
30 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 */
40
41#ifndef _ASM_POWERPC_EPAPR_HCALLS_H
42#define _ASM_POWERPC_EPAPR_HCALLS_H
43
44#define EV_BYTE_CHANNEL_SEND 1
45#define EV_BYTE_CHANNEL_RECEIVE 2
46#define EV_BYTE_CHANNEL_POLL 3
47#define EV_INT_SET_CONFIG 4
48#define EV_INT_GET_CONFIG 5
49#define EV_INT_SET_MASK 6
50#define EV_INT_GET_MASK 7
51#define EV_INT_IACK 9
52#define EV_INT_EOI 10
53#define EV_INT_SEND_IPI 11
54#define EV_INT_SET_TASK_PRIORITY 12
55#define EV_INT_GET_TASK_PRIORITY 13
56#define EV_DOORBELL_SEND 14
57#define EV_MSGSND 15
58#define EV_IDLE 16
59
60/* vendor ID: epapr */
61#define EV_LOCAL_VENDOR_ID 0 /* for private use */
62#define EV_EPAPR_VENDOR_ID 1
63#define EV_FSL_VENDOR_ID 2 /* Freescale Semiconductor */
64#define EV_IBM_VENDOR_ID 3 /* IBM */
65#define EV_GHS_VENDOR_ID 4 /* Green Hills Software */
66#define EV_ENEA_VENDOR_ID 5 /* Enea */
67#define EV_WR_VENDOR_ID 6 /* Wind River Systems */
68#define EV_AMCC_VENDOR_ID 7 /* Applied Micro Circuits */
69#define EV_KVM_VENDOR_ID 42 /* KVM */
70
71/* The max number of bytes that a byte channel can send or receive per call */
72#define EV_BYTE_CHANNEL_MAX_BYTES 16
73
74
75#define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
76#define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)
77
78/* epapr return codes */
79#define EV_SUCCESS 0
80#define EV_EPERM 1 /* Operation not permitted */
81#define EV_ENOENT 2 /* Entry Not Found */
82#define EV_EIO 3 /* I/O error occurred */
83#define EV_EAGAIN 4 /* The operation had insufficient
84 * resources to complete and should be
85 * retried
86 */
87#define EV_ENOMEM 5 /* There was insufficient memory to
88 * complete the operation */
89#define EV_EFAULT 6 /* Bad guest address */
90#define EV_ENODEV 7 /* No such device */
91#define EV_EINVAL 8 /* An argument supplied to the hcall
92 was out of range or invalid */
93#define EV_INTERNAL 9 /* An internal error occurred */
94#define EV_CONFIG 10 /* A configuration error was detected */
95#define EV_INVALID_STATE 11 /* The object is in an invalid state */
96#define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */
97#define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */
98
99#endif /* _ASM_POWERPC_EPAPR_HCALLS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/hw_breakpoint.h deleted-2
...@@ -1,2 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/hwcap.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASMARM_HWCAP_H
3#define __ASMARM_HWCAP_H
4
5/*
6 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
7 */
8#define HWCAP_SWP (1 << 0)
9#define HWCAP_HALF (1 << 1)
10#define HWCAP_THUMB (1 << 2)
11#define HWCAP_26BIT (1 << 3) /* Play it safe */
12#define HWCAP_FAST_MULT (1 << 4)
13#define HWCAP_FPA (1 << 5)
14#define HWCAP_VFP (1 << 6)
15#define HWCAP_EDSP (1 << 7)
16#define HWCAP_JAVA (1 << 8)
17#define HWCAP_IWMMXT (1 << 9)
18#define HWCAP_CRUNCH (1 << 10)
19#define HWCAP_THUMBEE (1 << 11)
20#define HWCAP_NEON (1 << 12)
21#define HWCAP_VFPv3 (1 << 13)
22#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
23#define HWCAP_TLS (1 << 15)
24#define HWCAP_VFPv4 (1 << 16)
25#define HWCAP_IDIVA (1 << 17)
26#define HWCAP_IDIVT (1 << 18)
27#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
28#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
29#define HWCAP_LPAE (1 << 20)
30#define HWCAP_EVTSTRM (1 << 21)
31
32/*
33 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
34 */
35#define HWCAP2_AES (1 << 0)
36#define HWCAP2_PMULL (1 << 1)
37#define HWCAP2_SHA1 (1 << 2)
38#define HWCAP2_SHA2 (1 << 3)
39#define HWCAP2_CRC32 (1 << 4)
40
41#endif /* __ASMARM_HWCAP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/hwcap2.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_HWCAP2_H
3#define _ASM_X86_HWCAP2_H
4
5/* MONITOR/MWAIT enabled in Ring 3 */
6#define HWCAP2_RING3MWAIT (1 << 0)
7
8#endif
\ No newline at end of file
lib/libc/include/any-linux-any/asm/inst.h deleted-1103
...@@ -1,1103 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Format of an instruction in memory.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1996, 2000 by Ralf Baechle
10 * Copyright (C) 2006 by Thiemo Seufer
11 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
12 * Copyright (C) 2014 Imagination Technologies Ltd.
13 */
14#ifndef _ASM_INST_H
15#define _ASM_INST_H
16
17#include <asm/bitfield.h>
18
19/*
20 * Major opcodes; before MIPS IV cop1x was called cop3.
21 */
22enum major_op {
23 spec_op, bcond_op, j_op, jal_op,
24 beq_op, bne_op, blez_op, bgtz_op,
25 addi_op, pop10_op = addi_op, addiu_op, slti_op, sltiu_op,
26 andi_op, ori_op, xori_op, lui_op,
27 cop0_op, cop1_op, cop2_op, cop1x_op,
28 beql_op, bnel_op, blezl_op, bgtzl_op,
29 daddi_op, pop30_op = daddi_op, daddiu_op, ldl_op, ldr_op,
30 spec2_op, jalx_op, mdmx_op, msa_op = mdmx_op, spec3_op,
31 lb_op, lh_op, lwl_op, lw_op,
32 lbu_op, lhu_op, lwr_op, lwu_op,
33 sb_op, sh_op, swl_op, sw_op,
34 sdl_op, sdr_op, swr_op, cache_op,
35 ll_op, lwc1_op, lwc2_op, bc6_op = lwc2_op, pref_op,
36 lld_op, ldc1_op, ldc2_op, pop66_op = ldc2_op, ld_op,
37 sc_op, swc1_op, swc2_op, balc6_op = swc2_op, major_3b_op,
38 scd_op, sdc1_op, sdc2_op, pop76_op = sdc2_op, sd_op
39};
40
41/*
42 * func field of spec opcode.
43 */
44enum spec_op {
45 sll_op, movc_op, srl_op, sra_op,
46 sllv_op, pmon_op, srlv_op, srav_op,
47 jr_op, jalr_op, movz_op, movn_op,
48 syscall_op, break_op, spim_op, sync_op,
49 mfhi_op, mthi_op, mflo_op, mtlo_op,
50 dsllv_op, spec2_unused_op, dsrlv_op, dsrav_op,
51 mult_op, multu_op, div_op, divu_op,
52 dmult_op, dmultu_op, ddiv_op, ddivu_op,
53 add_op, addu_op, sub_op, subu_op,
54 and_op, or_op, xor_op, nor_op,
55 spec3_unused_op, spec4_unused_op, slt_op, sltu_op,
56 dadd_op, daddu_op, dsub_op, dsubu_op,
57 tge_op, tgeu_op, tlt_op, tltu_op,
58 teq_op, spec5_unused_op, tne_op, spec6_unused_op,
59 dsll_op, spec7_unused_op, dsrl_op, dsra_op,
60 dsll32_op, spec8_unused_op, dsrl32_op, dsra32_op
61};
62
63/*
64 * func field of spec2 opcode.
65 */
66enum spec2_op {
67 madd_op, maddu_op, mul_op, spec2_3_unused_op,
68 msub_op, msubu_op, /* more unused ops */
69 clz_op = 0x20, clo_op,
70 dclz_op = 0x24, dclo_op,
71 sdbpp_op = 0x3f
72};
73
74/*
75 * func field of spec3 opcode.
76 */
77enum spec3_op {
78 ext_op, dextm_op, dextu_op, dext_op,
79 ins_op, dinsm_op, dinsu_op, dins_op,
80 yield_op = 0x09, lx_op = 0x0a,
81 lwle_op = 0x19, lwre_op = 0x1a,
82 cachee_op = 0x1b, sbe_op = 0x1c,
83 she_op = 0x1d, sce_op = 0x1e,
84 swe_op = 0x1f, bshfl_op = 0x20,
85 swle_op = 0x21, swre_op = 0x22,
86 prefe_op = 0x23, dbshfl_op = 0x24,
87 cache6_op = 0x25, sc6_op = 0x26,
88 scd6_op = 0x27, lbue_op = 0x28,
89 lhue_op = 0x29, lbe_op = 0x2c,
90 lhe_op = 0x2d, lle_op = 0x2e,
91 lwe_op = 0x2f, pref6_op = 0x35,
92 ll6_op = 0x36, lld6_op = 0x37,
93 rdhwr_op = 0x3b
94};
95
96/*
97 * Bits 10-6 minor opcode for r6 spec mult/div encodings
98 */
99enum mult_op {
100 mult_mult_op = 0x0,
101 mult_mul_op = 0x2,
102 mult_muh_op = 0x3,
103};
104enum multu_op {
105 multu_multu_op = 0x0,
106 multu_mulu_op = 0x2,
107 multu_muhu_op = 0x3,
108};
109enum div_op {
110 div_div_op = 0x0,
111 div_div6_op = 0x2,
112 div_mod_op = 0x3,
113};
114enum divu_op {
115 divu_divu_op = 0x0,
116 divu_divu6_op = 0x2,
117 divu_modu_op = 0x3,
118};
119enum dmult_op {
120 dmult_dmult_op = 0x0,
121 dmult_dmul_op = 0x2,
122 dmult_dmuh_op = 0x3,
123};
124enum dmultu_op {
125 dmultu_dmultu_op = 0x0,
126 dmultu_dmulu_op = 0x2,
127 dmultu_dmuhu_op = 0x3,
128};
129enum ddiv_op {
130 ddiv_ddiv_op = 0x0,
131 ddiv_ddiv6_op = 0x2,
132 ddiv_dmod_op = 0x3,
133};
134enum ddivu_op {
135 ddivu_ddivu_op = 0x0,
136 ddivu_ddivu6_op = 0x2,
137 ddivu_dmodu_op = 0x3,
138};
139
140/*
141 * rt field of bcond opcodes.
142 */
143enum rt_op {
144 bltz_op, bgez_op, bltzl_op, bgezl_op,
145 spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07,
146 tgei_op, tgeiu_op, tlti_op, tltiu_op,
147 teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op,
148 bltzal_op, bgezal_op, bltzall_op, bgezall_op,
149 rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17,
150 rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b,
151 bposge32_op, rt_op_0x1d, rt_op_0x1e, synci_op
152};
153
154/*
155 * rs field of cop opcodes.
156 */
157enum cop_op {
158 mfc_op = 0x00, dmfc_op = 0x01,
159 cfc_op = 0x02, mfhc0_op = 0x02,
160 mfhc_op = 0x03, mtc_op = 0x04,
161 dmtc_op = 0x05, ctc_op = 0x06,
162 mthc0_op = 0x06, mthc_op = 0x07,
163 bc_op = 0x08, bc1eqz_op = 0x09,
164 mfmc0_op = 0x0b, bc1nez_op = 0x0d,
165 wrpgpr_op = 0x0e, cop_op = 0x10,
166 copm_op = 0x18
167};
168
169/*
170 * rt field of cop.bc_op opcodes
171 */
172enum bcop_op {
173 bcf_op, bct_op, bcfl_op, bctl_op
174};
175
176/*
177 * func field of cop0 coi opcodes.
178 */
179enum cop0_coi_func {
180 tlbr_op = 0x01, tlbwi_op = 0x02,
181 tlbwr_op = 0x06, tlbp_op = 0x08,
182 rfe_op = 0x10, eret_op = 0x18,
183 wait_op = 0x20, hypcall_op = 0x28
184};
185
186/*
187 * func field of cop0 com opcodes.
188 */
189enum cop0_com_func {
190 tlbr1_op = 0x01, tlbw_op = 0x02,
191 tlbp1_op = 0x08, dctr_op = 0x09,
192 dctw_op = 0x0a
193};
194
195/*
196 * fmt field of cop1 opcodes.
197 */
198enum cop1_fmt {
199 s_fmt, d_fmt, e_fmt, q_fmt,
200 w_fmt, l_fmt
201};
202
203/*
204 * func field of cop1 instructions using d, s or w format.
205 */
206enum cop1_sdw_func {
207 fadd_op = 0x00, fsub_op = 0x01,
208 fmul_op = 0x02, fdiv_op = 0x03,
209 fsqrt_op = 0x04, fabs_op = 0x05,
210 fmov_op = 0x06, fneg_op = 0x07,
211 froundl_op = 0x08, ftruncl_op = 0x09,
212 fceill_op = 0x0a, ffloorl_op = 0x0b,
213 fround_op = 0x0c, ftrunc_op = 0x0d,
214 fceil_op = 0x0e, ffloor_op = 0x0f,
215 fsel_op = 0x10,
216 fmovc_op = 0x11, fmovz_op = 0x12,
217 fmovn_op = 0x13, fseleqz_op = 0x14,
218 frecip_op = 0x15, frsqrt_op = 0x16,
219 fselnez_op = 0x17, fmaddf_op = 0x18,
220 fmsubf_op = 0x19, frint_op = 0x1a,
221 fclass_op = 0x1b, fmin_op = 0x1c,
222 fmina_op = 0x1d, fmax_op = 0x1e,
223 fmaxa_op = 0x1f, fcvts_op = 0x20,
224 fcvtd_op = 0x21, fcvte_op = 0x22,
225 fcvtw_op = 0x24, fcvtl_op = 0x25,
226 fcmp_op = 0x30
227};
228
229/*
230 * func field of cop1x opcodes (MIPS IV).
231 */
232enum cop1x_func {
233 lwxc1_op = 0x00, ldxc1_op = 0x01,
234 swxc1_op = 0x08, sdxc1_op = 0x09,
235 pfetch_op = 0x0f, madd_s_op = 0x20,
236 madd_d_op = 0x21, madd_e_op = 0x22,
237 msub_s_op = 0x28, msub_d_op = 0x29,
238 msub_e_op = 0x2a, nmadd_s_op = 0x30,
239 nmadd_d_op = 0x31, nmadd_e_op = 0x32,
240 nmsub_s_op = 0x38, nmsub_d_op = 0x39,
241 nmsub_e_op = 0x3a
242};
243
244/*
245 * func field for mad opcodes (MIPS IV).
246 */
247enum mad_func {
248 madd_fp_op = 0x08, msub_fp_op = 0x0a,
249 nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e
250};
251
252/*
253 * func field for page table walker (Loongson-3).
254 */
255enum ptw_func {
256 lwdir_op = 0x00,
257 lwpte_op = 0x01,
258 lddir_op = 0x02,
259 ldpte_op = 0x03,
260};
261
262/*
263 * func field for special3 lx opcodes (Cavium Octeon).
264 */
265enum lx_func {
266 lwx_op = 0x00,
267 lhx_op = 0x04,
268 lbux_op = 0x06,
269 ldx_op = 0x08,
270 lwux_op = 0x10,
271 lhux_op = 0x14,
272 lbx_op = 0x16,
273};
274
275/*
276 * BSHFL opcodes
277 */
278enum bshfl_func {
279 wsbh_op = 0x2,
280 seb_op = 0x10,
281 seh_op = 0x18,
282};
283
284/*
285 * DBSHFL opcodes
286 */
287enum dbshfl_func {
288 dsbh_op = 0x2,
289 dshd_op = 0x5,
290};
291
292/*
293 * MSA minor opcodes.
294 */
295enum msa_func {
296 msa_elm_op = 0x19,
297};
298
299/*
300 * MSA ELM opcodes.
301 */
302enum msa_elm {
303 msa_ctc_op = 0x3e,
304 msa_cfc_op = 0x7e,
305};
306
307/*
308 * func field for MSA MI10 format.
309 */
310enum msa_mi10_func {
311 msa_ld_op = 8,
312 msa_st_op = 9,
313};
314
315/*
316 * MSA 2 bit format fields.
317 */
318enum msa_2b_fmt {
319 msa_fmt_b = 0,
320 msa_fmt_h = 1,
321 msa_fmt_w = 2,
322 msa_fmt_d = 3,
323};
324
325/*
326 * (microMIPS) Major opcodes.
327 */
328enum mm_major_op {
329 mm_pool32a_op, mm_pool16a_op, mm_lbu16_op, mm_move16_op,
330 mm_addi32_op, mm_lbu32_op, mm_sb32_op, mm_lb32_op,
331 mm_pool32b_op, mm_pool16b_op, mm_lhu16_op, mm_andi16_op,
332 mm_addiu32_op, mm_lhu32_op, mm_sh32_op, mm_lh32_op,
333 mm_pool32i_op, mm_pool16c_op, mm_lwsp16_op, mm_pool16d_op,
334 mm_ori32_op, mm_pool32f_op, mm_pool32s_op, mm_reserved2_op,
335 mm_pool32c_op, mm_lwgp16_op, mm_lw16_op, mm_pool16e_op,
336 mm_xori32_op, mm_jals32_op, mm_addiupc_op, mm_reserved3_op,
337 mm_reserved4_op, mm_pool16f_op, mm_sb16_op, mm_beqz16_op,
338 mm_slti32_op, mm_beq32_op, mm_swc132_op, mm_lwc132_op,
339 mm_reserved5_op, mm_reserved6_op, mm_sh16_op, mm_bnez16_op,
340 mm_sltiu32_op, mm_bne32_op, mm_sdc132_op, mm_ldc132_op,
341 mm_reserved7_op, mm_reserved8_op, mm_swsp16_op, mm_b16_op,
342 mm_andi32_op, mm_j32_op, mm_sd32_op, mm_ld32_op,
343 mm_reserved11_op, mm_reserved12_op, mm_sw16_op, mm_li16_op,
344 mm_jalx32_op, mm_jal32_op, mm_sw32_op, mm_lw32_op,
345};
346
347/*
348 * (microMIPS) POOL32I minor opcodes.
349 */
350enum mm_32i_minor_op {
351 mm_bltz_op, mm_bltzal_op, mm_bgez_op, mm_bgezal_op,
352 mm_blez_op, mm_bnezc_op, mm_bgtz_op, mm_beqzc_op,
353 mm_tlti_op, mm_tgei_op, mm_tltiu_op, mm_tgeiu_op,
354 mm_tnei_op, mm_lui_op, mm_teqi_op, mm_reserved13_op,
355 mm_synci_op, mm_bltzals_op, mm_reserved14_op, mm_bgezals_op,
356 mm_bc2f_op, mm_bc2t_op, mm_reserved15_op, mm_reserved16_op,
357 mm_reserved17_op, mm_reserved18_op, mm_bposge64_op, mm_bposge32_op,
358 mm_bc1f_op, mm_bc1t_op, mm_reserved19_op, mm_reserved20_op,
359 mm_bc1any2f_op, mm_bc1any2t_op, mm_bc1any4f_op, mm_bc1any4t_op,
360};
361
362/*
363 * (microMIPS) POOL32A minor opcodes.
364 */
365enum mm_32a_minor_op {
366 mm_sll32_op = 0x000,
367 mm_ins_op = 0x00c,
368 mm_sllv32_op = 0x010,
369 mm_ext_op = 0x02c,
370 mm_pool32axf_op = 0x03c,
371 mm_srl32_op = 0x040,
372 mm_srlv32_op = 0x050,
373 mm_sra_op = 0x080,
374 mm_rotr_op = 0x0c0,
375 mm_lwxs_op = 0x118,
376 mm_addu32_op = 0x150,
377 mm_subu32_op = 0x1d0,
378 mm_wsbh_op = 0x1ec,
379 mm_mul_op = 0x210,
380 mm_and_op = 0x250,
381 mm_or32_op = 0x290,
382 mm_xor32_op = 0x310,
383 mm_slt_op = 0x350,
384 mm_sltu_op = 0x390,
385};
386
387/*
388 * (microMIPS) POOL32B functions.
389 */
390enum mm_32b_func {
391 mm_lwc2_func = 0x0,
392 mm_lwp_func = 0x1,
393 mm_ldc2_func = 0x2,
394 mm_ldp_func = 0x4,
395 mm_lwm32_func = 0x5,
396 mm_cache_func = 0x6,
397 mm_ldm_func = 0x7,
398 mm_swc2_func = 0x8,
399 mm_swp_func = 0x9,
400 mm_sdc2_func = 0xa,
401 mm_sdp_func = 0xc,
402 mm_swm32_func = 0xd,
403 mm_sdm_func = 0xf,
404};
405
406/*
407 * (microMIPS) POOL32C functions.
408 */
409enum mm_32c_func {
410 mm_pref_func = 0x2,
411 mm_ll_func = 0x3,
412 mm_swr_func = 0x9,
413 mm_sc_func = 0xb,
414 mm_lwu_func = 0xe,
415};
416
417/*
418 * (microMIPS) POOL32AXF minor opcodes.
419 */
420enum mm_32axf_minor_op {
421 mm_mfc0_op = 0x003,
422 mm_mtc0_op = 0x00b,
423 mm_tlbp_op = 0x00d,
424 mm_mfhi32_op = 0x035,
425 mm_jalr_op = 0x03c,
426 mm_tlbr_op = 0x04d,
427 mm_mflo32_op = 0x075,
428 mm_jalrhb_op = 0x07c,
429 mm_tlbwi_op = 0x08d,
430 mm_mthi32_op = 0x0b5,
431 mm_tlbwr_op = 0x0cd,
432 mm_mtlo32_op = 0x0f5,
433 mm_di_op = 0x11d,
434 mm_jalrs_op = 0x13c,
435 mm_jalrshb_op = 0x17c,
436 mm_sync_op = 0x1ad,
437 mm_syscall_op = 0x22d,
438 mm_wait_op = 0x24d,
439 mm_eret_op = 0x3cd,
440 mm_divu_op = 0x5dc,
441};
442
443/*
444 * (microMIPS) POOL32F minor opcodes.
445 */
446enum mm_32f_minor_op {
447 mm_32f_00_op = 0x00,
448 mm_32f_01_op = 0x01,
449 mm_32f_02_op = 0x02,
450 mm_32f_10_op = 0x08,
451 mm_32f_11_op = 0x09,
452 mm_32f_12_op = 0x0a,
453 mm_32f_20_op = 0x10,
454 mm_32f_30_op = 0x18,
455 mm_32f_40_op = 0x20,
456 mm_32f_41_op = 0x21,
457 mm_32f_42_op = 0x22,
458 mm_32f_50_op = 0x28,
459 mm_32f_51_op = 0x29,
460 mm_32f_52_op = 0x2a,
461 mm_32f_60_op = 0x30,
462 mm_32f_70_op = 0x38,
463 mm_32f_73_op = 0x3b,
464 mm_32f_74_op = 0x3c,
465};
466
467/*
468 * (microMIPS) POOL32F secondary minor opcodes.
469 */
470enum mm_32f_10_minor_op {
471 mm_lwxc1_op = 0x1,
472 mm_swxc1_op,
473 mm_ldxc1_op,
474 mm_sdxc1_op,
475 mm_luxc1_op,
476 mm_suxc1_op,
477};
478
479enum mm_32f_func {
480 mm_lwxc1_func = 0x048,
481 mm_swxc1_func = 0x088,
482 mm_ldxc1_func = 0x0c8,
483 mm_sdxc1_func = 0x108,
484};
485
486/*
487 * (microMIPS) POOL32F secondary minor opcodes.
488 */
489enum mm_32f_40_minor_op {
490 mm_fmovf_op,
491 mm_fmovt_op,
492};
493
494/*
495 * (microMIPS) POOL32F secondary minor opcodes.
496 */
497enum mm_32f_60_minor_op {
498 mm_fadd_op,
499 mm_fsub_op,
500 mm_fmul_op,
501 mm_fdiv_op,
502};
503
504/*
505 * (microMIPS) POOL32F secondary minor opcodes.
506 */
507enum mm_32f_70_minor_op {
508 mm_fmovn_op,
509 mm_fmovz_op,
510};
511
512/*
513 * (microMIPS) POOL32FXF secondary minor opcodes for POOL32F.
514 */
515enum mm_32f_73_minor_op {
516 mm_fmov0_op = 0x01,
517 mm_fcvtl_op = 0x04,
518 mm_movf0_op = 0x05,
519 mm_frsqrt_op = 0x08,
520 mm_ffloorl_op = 0x0c,
521 mm_fabs0_op = 0x0d,
522 mm_fcvtw_op = 0x24,
523 mm_movt0_op = 0x25,
524 mm_fsqrt_op = 0x28,
525 mm_ffloorw_op = 0x2c,
526 mm_fneg0_op = 0x2d,
527 mm_cfc1_op = 0x40,
528 mm_frecip_op = 0x48,
529 mm_fceill_op = 0x4c,
530 mm_fcvtd0_op = 0x4d,
531 mm_ctc1_op = 0x60,
532 mm_fceilw_op = 0x6c,
533 mm_fcvts0_op = 0x6d,
534 mm_mfc1_op = 0x80,
535 mm_fmov1_op = 0x81,
536 mm_movf1_op = 0x85,
537 mm_ftruncl_op = 0x8c,
538 mm_fabs1_op = 0x8d,
539 mm_mtc1_op = 0xa0,
540 mm_movt1_op = 0xa5,
541 mm_ftruncw_op = 0xac,
542 mm_fneg1_op = 0xad,
543 mm_mfhc1_op = 0xc0,
544 mm_froundl_op = 0xcc,
545 mm_fcvtd1_op = 0xcd,
546 mm_mthc1_op = 0xe0,
547 mm_froundw_op = 0xec,
548 mm_fcvts1_op = 0xed,
549};
550
551/*
552 * (microMIPS) POOL32S minor opcodes.
553 */
554enum mm_32s_minor_op {
555 mm_32s_elm_op = 0x16,
556};
557
558/*
559 * (microMIPS) POOL16C minor opcodes.
560 */
561enum mm_16c_minor_op {
562 mm_lwm16_op = 0x04,
563 mm_swm16_op = 0x05,
564 mm_jr16_op = 0x0c,
565 mm_jrc_op = 0x0d,
566 mm_jalr16_op = 0x0e,
567 mm_jalrs16_op = 0x0f,
568 mm_jraddiusp_op = 0x18,
569};
570
571/*
572 * (microMIPS) POOL16D minor opcodes.
573 */
574enum mm_16d_minor_op {
575 mm_addius5_func,
576 mm_addiusp_func,
577};
578
579/*
580 * (MIPS16e) opcodes.
581 */
582enum MIPS16e_ops {
583 MIPS16e_jal_op = 003,
584 MIPS16e_ld_op = 007,
585 MIPS16e_i8_op = 014,
586 MIPS16e_sd_op = 017,
587 MIPS16e_lb_op = 020,
588 MIPS16e_lh_op = 021,
589 MIPS16e_lwsp_op = 022,
590 MIPS16e_lw_op = 023,
591 MIPS16e_lbu_op = 024,
592 MIPS16e_lhu_op = 025,
593 MIPS16e_lwpc_op = 026,
594 MIPS16e_lwu_op = 027,
595 MIPS16e_sb_op = 030,
596 MIPS16e_sh_op = 031,
597 MIPS16e_swsp_op = 032,
598 MIPS16e_sw_op = 033,
599 MIPS16e_rr_op = 035,
600 MIPS16e_extend_op = 036,
601 MIPS16e_i64_op = 037,
602};
603
604enum MIPS16e_i64_func {
605 MIPS16e_ldsp_func,
606 MIPS16e_sdsp_func,
607 MIPS16e_sdrasp_func,
608 MIPS16e_dadjsp_func,
609 MIPS16e_ldpc_func,
610};
611
612enum MIPS16e_rr_func {
613 MIPS16e_jr_func,
614};
615
616enum MIPS6e_i8_func {
617 MIPS16e_swrasp_func = 02,
618};
619
620/*
621 * (microMIPS) NOP instruction.
622 */
623#define MM_NOP16 0x0c00
624
625struct j_format {
626 __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */
627 __BITFIELD_FIELD(unsigned int target : 26,
628 ;))
629};
630
631struct i_format { /* signed immediate format */
632 __BITFIELD_FIELD(unsigned int opcode : 6,
633 __BITFIELD_FIELD(unsigned int rs : 5,
634 __BITFIELD_FIELD(unsigned int rt : 5,
635 __BITFIELD_FIELD(signed int simmediate : 16,
636 ;))))
637};
638
639struct u_format { /* unsigned immediate format */
640 __BITFIELD_FIELD(unsigned int opcode : 6,
641 __BITFIELD_FIELD(unsigned int rs : 5,
642 __BITFIELD_FIELD(unsigned int rt : 5,
643 __BITFIELD_FIELD(unsigned int uimmediate : 16,
644 ;))))
645};
646
647struct c_format { /* Cache (>= R6000) format */
648 __BITFIELD_FIELD(unsigned int opcode : 6,
649 __BITFIELD_FIELD(unsigned int rs : 5,
650 __BITFIELD_FIELD(unsigned int c_op : 3,
651 __BITFIELD_FIELD(unsigned int cache : 2,
652 __BITFIELD_FIELD(unsigned int simmediate : 16,
653 ;)))))
654};
655
656struct r_format { /* Register format */
657 __BITFIELD_FIELD(unsigned int opcode : 6,
658 __BITFIELD_FIELD(unsigned int rs : 5,
659 __BITFIELD_FIELD(unsigned int rt : 5,
660 __BITFIELD_FIELD(unsigned int rd : 5,
661 __BITFIELD_FIELD(unsigned int re : 5,
662 __BITFIELD_FIELD(unsigned int func : 6,
663 ;))))))
664};
665
666struct c0r_format { /* C0 register format */
667 __BITFIELD_FIELD(unsigned int opcode : 6,
668 __BITFIELD_FIELD(unsigned int rs : 5,
669 __BITFIELD_FIELD(unsigned int rt : 5,
670 __BITFIELD_FIELD(unsigned int rd : 5,
671 __BITFIELD_FIELD(unsigned int z: 8,
672 __BITFIELD_FIELD(unsigned int sel : 3,
673 ;))))))
674};
675
676struct mfmc0_format { /* MFMC0 register format */
677 __BITFIELD_FIELD(unsigned int opcode : 6,
678 __BITFIELD_FIELD(unsigned int rs : 5,
679 __BITFIELD_FIELD(unsigned int rt : 5,
680 __BITFIELD_FIELD(unsigned int rd : 5,
681 __BITFIELD_FIELD(unsigned int re : 5,
682 __BITFIELD_FIELD(unsigned int sc : 1,
683 __BITFIELD_FIELD(unsigned int : 2,
684 __BITFIELD_FIELD(unsigned int sel : 3,
685 ;))))))))
686};
687
688struct co_format { /* C0 CO format */
689 __BITFIELD_FIELD(unsigned int opcode : 6,
690 __BITFIELD_FIELD(unsigned int co : 1,
691 __BITFIELD_FIELD(unsigned int code : 19,
692 __BITFIELD_FIELD(unsigned int func : 6,
693 ;))))
694};
695
696struct p_format { /* Performance counter format (R10000) */
697 __BITFIELD_FIELD(unsigned int opcode : 6,
698 __BITFIELD_FIELD(unsigned int rs : 5,
699 __BITFIELD_FIELD(unsigned int rt : 5,
700 __BITFIELD_FIELD(unsigned int rd : 5,
701 __BITFIELD_FIELD(unsigned int re : 5,
702 __BITFIELD_FIELD(unsigned int func : 6,
703 ;))))))
704};
705
706struct f_format { /* FPU register format */
707 __BITFIELD_FIELD(unsigned int opcode : 6,
708 __BITFIELD_FIELD(unsigned int : 1,
709 __BITFIELD_FIELD(unsigned int fmt : 4,
710 __BITFIELD_FIELD(unsigned int rt : 5,
711 __BITFIELD_FIELD(unsigned int rd : 5,
712 __BITFIELD_FIELD(unsigned int re : 5,
713 __BITFIELD_FIELD(unsigned int func : 6,
714 ;)))))))
715};
716
717struct ma_format { /* FPU multiply and add format (MIPS IV) */
718 __BITFIELD_FIELD(unsigned int opcode : 6,
719 __BITFIELD_FIELD(unsigned int fr : 5,
720 __BITFIELD_FIELD(unsigned int ft : 5,
721 __BITFIELD_FIELD(unsigned int fs : 5,
722 __BITFIELD_FIELD(unsigned int fd : 5,
723 __BITFIELD_FIELD(unsigned int func : 4,
724 __BITFIELD_FIELD(unsigned int fmt : 2,
725 ;)))))))
726};
727
728struct b_format { /* BREAK and SYSCALL */
729 __BITFIELD_FIELD(unsigned int opcode : 6,
730 __BITFIELD_FIELD(unsigned int code : 20,
731 __BITFIELD_FIELD(unsigned int func : 6,
732 ;)))
733};
734
735struct ps_format { /* MIPS-3D / paired single format */
736 __BITFIELD_FIELD(unsigned int opcode : 6,
737 __BITFIELD_FIELD(unsigned int rs : 5,
738 __BITFIELD_FIELD(unsigned int ft : 5,
739 __BITFIELD_FIELD(unsigned int fs : 5,
740 __BITFIELD_FIELD(unsigned int fd : 5,
741 __BITFIELD_FIELD(unsigned int func : 6,
742 ;))))))
743};
744
745struct v_format { /* MDMX vector format */
746 __BITFIELD_FIELD(unsigned int opcode : 6,
747 __BITFIELD_FIELD(unsigned int sel : 4,
748 __BITFIELD_FIELD(unsigned int fmt : 1,
749 __BITFIELD_FIELD(unsigned int vt : 5,
750 __BITFIELD_FIELD(unsigned int vs : 5,
751 __BITFIELD_FIELD(unsigned int vd : 5,
752 __BITFIELD_FIELD(unsigned int func : 6,
753 ;)))))))
754};
755
756struct msa_mi10_format { /* MSA MI10 */
757 __BITFIELD_FIELD(unsigned int opcode : 6,
758 __BITFIELD_FIELD(signed int s10 : 10,
759 __BITFIELD_FIELD(unsigned int rs : 5,
760 __BITFIELD_FIELD(unsigned int wd : 5,
761 __BITFIELD_FIELD(unsigned int func : 4,
762 __BITFIELD_FIELD(unsigned int df : 2,
763 ;))))))
764};
765
766struct dsp_format { /* SPEC3 DSP format instructions */
767 __BITFIELD_FIELD(unsigned int opcode : 6,
768 __BITFIELD_FIELD(unsigned int base : 5,
769 __BITFIELD_FIELD(unsigned int index : 5,
770 __BITFIELD_FIELD(unsigned int rd : 5,
771 __BITFIELD_FIELD(unsigned int op : 5,
772 __BITFIELD_FIELD(unsigned int func : 6,
773 ;))))))
774};
775
776struct spec3_format { /* SPEC3 */
777 __BITFIELD_FIELD(unsigned int opcode:6,
778 __BITFIELD_FIELD(unsigned int rs:5,
779 __BITFIELD_FIELD(unsigned int rt:5,
780 __BITFIELD_FIELD(signed int simmediate:9,
781 __BITFIELD_FIELD(unsigned int func:7,
782 ;)))))
783};
784
785/*
786 * microMIPS instruction formats (32-bit length)
787 *
788 * NOTE:
789 * Parenthesis denote whether the format is a microMIPS instruction or
790 * if it is MIPS32 instruction re-encoded for use in the microMIPS ASE.
791 */
792struct fb_format { /* FPU branch format (MIPS32) */
793 __BITFIELD_FIELD(unsigned int opcode : 6,
794 __BITFIELD_FIELD(unsigned int bc : 5,
795 __BITFIELD_FIELD(unsigned int cc : 3,
796 __BITFIELD_FIELD(unsigned int flag : 2,
797 __BITFIELD_FIELD(signed int simmediate : 16,
798 ;)))))
799};
800
801struct fp0_format { /* FPU multiply and add format (MIPS32) */
802 __BITFIELD_FIELD(unsigned int opcode : 6,
803 __BITFIELD_FIELD(unsigned int fmt : 5,
804 __BITFIELD_FIELD(unsigned int ft : 5,
805 __BITFIELD_FIELD(unsigned int fs : 5,
806 __BITFIELD_FIELD(unsigned int fd : 5,
807 __BITFIELD_FIELD(unsigned int func : 6,
808 ;))))))
809};
810
811struct mm_fp0_format { /* FPU multiply and add format (microMIPS) */
812 __BITFIELD_FIELD(unsigned int opcode : 6,
813 __BITFIELD_FIELD(unsigned int ft : 5,
814 __BITFIELD_FIELD(unsigned int fs : 5,
815 __BITFIELD_FIELD(unsigned int fd : 5,
816 __BITFIELD_FIELD(unsigned int fmt : 3,
817 __BITFIELD_FIELD(unsigned int op : 2,
818 __BITFIELD_FIELD(unsigned int func : 6,
819 ;)))))))
820};
821
822struct fp1_format { /* FPU mfc1 and cfc1 format (MIPS32) */
823 __BITFIELD_FIELD(unsigned int opcode : 6,
824 __BITFIELD_FIELD(unsigned int op : 5,
825 __BITFIELD_FIELD(unsigned int rt : 5,
826 __BITFIELD_FIELD(unsigned int fs : 5,
827 __BITFIELD_FIELD(unsigned int fd : 5,
828 __BITFIELD_FIELD(unsigned int func : 6,
829 ;))))))
830};
831
832struct mm_fp1_format { /* FPU mfc1 and cfc1 format (microMIPS) */
833 __BITFIELD_FIELD(unsigned int opcode : 6,
834 __BITFIELD_FIELD(unsigned int rt : 5,
835 __BITFIELD_FIELD(unsigned int fs : 5,
836 __BITFIELD_FIELD(unsigned int fmt : 2,
837 __BITFIELD_FIELD(unsigned int op : 8,
838 __BITFIELD_FIELD(unsigned int func : 6,
839 ;))))))
840};
841
842struct mm_fp2_format { /* FPU movt and movf format (microMIPS) */
843 __BITFIELD_FIELD(unsigned int opcode : 6,
844 __BITFIELD_FIELD(unsigned int fd : 5,
845 __BITFIELD_FIELD(unsigned int fs : 5,
846 __BITFIELD_FIELD(unsigned int cc : 3,
847 __BITFIELD_FIELD(unsigned int zero : 2,
848 __BITFIELD_FIELD(unsigned int fmt : 2,
849 __BITFIELD_FIELD(unsigned int op : 3,
850 __BITFIELD_FIELD(unsigned int func : 6,
851 ;))))))))
852};
853
854struct mm_fp3_format { /* FPU abs and neg format (microMIPS) */
855 __BITFIELD_FIELD(unsigned int opcode : 6,
856 __BITFIELD_FIELD(unsigned int rt : 5,
857 __BITFIELD_FIELD(unsigned int fs : 5,
858 __BITFIELD_FIELD(unsigned int fmt : 3,
859 __BITFIELD_FIELD(unsigned int op : 7,
860 __BITFIELD_FIELD(unsigned int func : 6,
861 ;))))))
862};
863
864struct mm_fp4_format { /* FPU c.cond format (microMIPS) */
865 __BITFIELD_FIELD(unsigned int opcode : 6,
866 __BITFIELD_FIELD(unsigned int rt : 5,
867 __BITFIELD_FIELD(unsigned int fs : 5,
868 __BITFIELD_FIELD(unsigned int cc : 3,
869 __BITFIELD_FIELD(unsigned int fmt : 3,
870 __BITFIELD_FIELD(unsigned int cond : 4,
871 __BITFIELD_FIELD(unsigned int func : 6,
872 ;)))))))
873};
874
875struct mm_fp5_format { /* FPU lwxc1 and swxc1 format (microMIPS) */
876 __BITFIELD_FIELD(unsigned int opcode : 6,
877 __BITFIELD_FIELD(unsigned int index : 5,
878 __BITFIELD_FIELD(unsigned int base : 5,
879 __BITFIELD_FIELD(unsigned int fd : 5,
880 __BITFIELD_FIELD(unsigned int op : 5,
881 __BITFIELD_FIELD(unsigned int func : 6,
882 ;))))))
883};
884
885struct fp6_format { /* FPU madd and msub format (MIPS IV) */
886 __BITFIELD_FIELD(unsigned int opcode : 6,
887 __BITFIELD_FIELD(unsigned int fr : 5,
888 __BITFIELD_FIELD(unsigned int ft : 5,
889 __BITFIELD_FIELD(unsigned int fs : 5,
890 __BITFIELD_FIELD(unsigned int fd : 5,
891 __BITFIELD_FIELD(unsigned int func : 6,
892 ;))))))
893};
894
895struct mm_fp6_format { /* FPU madd and msub format (microMIPS) */
896 __BITFIELD_FIELD(unsigned int opcode : 6,
897 __BITFIELD_FIELD(unsigned int ft : 5,
898 __BITFIELD_FIELD(unsigned int fs : 5,
899 __BITFIELD_FIELD(unsigned int fd : 5,
900 __BITFIELD_FIELD(unsigned int fr : 5,
901 __BITFIELD_FIELD(unsigned int func : 6,
902 ;))))))
903};
904
905struct mm_i_format { /* Immediate format (microMIPS) */
906 __BITFIELD_FIELD(unsigned int opcode : 6,
907 __BITFIELD_FIELD(unsigned int rt : 5,
908 __BITFIELD_FIELD(unsigned int rs : 5,
909 __BITFIELD_FIELD(signed int simmediate : 16,
910 ;))))
911};
912
913struct mm_m_format { /* Multi-word load/store format (microMIPS) */
914 __BITFIELD_FIELD(unsigned int opcode : 6,
915 __BITFIELD_FIELD(unsigned int rd : 5,
916 __BITFIELD_FIELD(unsigned int base : 5,
917 __BITFIELD_FIELD(unsigned int func : 4,
918 __BITFIELD_FIELD(signed int simmediate : 12,
919 ;)))))
920};
921
922struct mm_x_format { /* Scaled indexed load format (microMIPS) */
923 __BITFIELD_FIELD(unsigned int opcode : 6,
924 __BITFIELD_FIELD(unsigned int index : 5,
925 __BITFIELD_FIELD(unsigned int base : 5,
926 __BITFIELD_FIELD(unsigned int rd : 5,
927 __BITFIELD_FIELD(unsigned int func : 11,
928 ;)))))
929};
930
931struct mm_a_format { /* ADDIUPC format (microMIPS) */
932 __BITFIELD_FIELD(unsigned int opcode : 6,
933 __BITFIELD_FIELD(unsigned int rs : 3,
934 __BITFIELD_FIELD(signed int simmediate : 23,
935 ;)))
936};
937
938/*
939 * microMIPS instruction formats (16-bit length)
940 */
941struct mm_b0_format { /* Unconditional branch format (microMIPS) */
942 __BITFIELD_FIELD(unsigned int opcode : 6,
943 __BITFIELD_FIELD(signed int simmediate : 10,
944 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
945 ;)))
946};
947
948struct mm_b1_format { /* Conditional branch format (microMIPS) */
949 __BITFIELD_FIELD(unsigned int opcode : 6,
950 __BITFIELD_FIELD(unsigned int rs : 3,
951 __BITFIELD_FIELD(signed int simmediate : 7,
952 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
953 ;))))
954};
955
956struct mm16_m_format { /* Multi-word load/store format */
957 __BITFIELD_FIELD(unsigned int opcode : 6,
958 __BITFIELD_FIELD(unsigned int func : 4,
959 __BITFIELD_FIELD(unsigned int rlist : 2,
960 __BITFIELD_FIELD(unsigned int imm : 4,
961 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
962 ;)))))
963};
964
965struct mm16_rb_format { /* Signed immediate format */
966 __BITFIELD_FIELD(unsigned int opcode : 6,
967 __BITFIELD_FIELD(unsigned int rt : 3,
968 __BITFIELD_FIELD(unsigned int base : 3,
969 __BITFIELD_FIELD(signed int simmediate : 4,
970 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
971 ;)))))
972};
973
974struct mm16_r3_format { /* Load from global pointer format */
975 __BITFIELD_FIELD(unsigned int opcode : 6,
976 __BITFIELD_FIELD(unsigned int rt : 3,
977 __BITFIELD_FIELD(signed int simmediate : 7,
978 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
979 ;))))
980};
981
982struct mm16_r5_format { /* Load/store from stack pointer format */
983 __BITFIELD_FIELD(unsigned int opcode : 6,
984 __BITFIELD_FIELD(unsigned int rt : 5,
985 __BITFIELD_FIELD(unsigned int imm : 5,
986 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
987 ;))))
988};
989
990/*
991 * MIPS16e instruction formats (16-bit length)
992 */
993struct m16e_rr {
994 __BITFIELD_FIELD(unsigned int opcode : 5,
995 __BITFIELD_FIELD(unsigned int rx : 3,
996 __BITFIELD_FIELD(unsigned int nd : 1,
997 __BITFIELD_FIELD(unsigned int l : 1,
998 __BITFIELD_FIELD(unsigned int ra : 1,
999 __BITFIELD_FIELD(unsigned int func : 5,
1000 ;))))))
1001};
1002
1003struct m16e_jal {
1004 __BITFIELD_FIELD(unsigned int opcode : 5,
1005 __BITFIELD_FIELD(unsigned int x : 1,
1006 __BITFIELD_FIELD(unsigned int imm20_16 : 5,
1007 __BITFIELD_FIELD(signed int imm25_21 : 5,
1008 ;))))
1009};
1010
1011struct m16e_i64 {
1012 __BITFIELD_FIELD(unsigned int opcode : 5,
1013 __BITFIELD_FIELD(unsigned int func : 3,
1014 __BITFIELD_FIELD(unsigned int imm : 8,
1015 ;)))
1016};
1017
1018struct m16e_ri64 {
1019 __BITFIELD_FIELD(unsigned int opcode : 5,
1020 __BITFIELD_FIELD(unsigned int func : 3,
1021 __BITFIELD_FIELD(unsigned int ry : 3,
1022 __BITFIELD_FIELD(unsigned int imm : 5,
1023 ;))))
1024};
1025
1026struct m16e_ri {
1027 __BITFIELD_FIELD(unsigned int opcode : 5,
1028 __BITFIELD_FIELD(unsigned int rx : 3,
1029 __BITFIELD_FIELD(unsigned int imm : 8,
1030 ;)))
1031};
1032
1033struct m16e_rri {
1034 __BITFIELD_FIELD(unsigned int opcode : 5,
1035 __BITFIELD_FIELD(unsigned int rx : 3,
1036 __BITFIELD_FIELD(unsigned int ry : 3,
1037 __BITFIELD_FIELD(unsigned int imm : 5,
1038 ;))))
1039};
1040
1041struct m16e_i8 {
1042 __BITFIELD_FIELD(unsigned int opcode : 5,
1043 __BITFIELD_FIELD(unsigned int func : 3,
1044 __BITFIELD_FIELD(unsigned int imm : 8,
1045 ;)))
1046};
1047
1048union mips_instruction {
1049 unsigned int word;
1050 unsigned short halfword[2];
1051 unsigned char byte[4];
1052 struct j_format j_format;
1053 struct i_format i_format;
1054 struct u_format u_format;
1055 struct c_format c_format;
1056 struct r_format r_format;
1057 struct c0r_format c0r_format;
1058 struct mfmc0_format mfmc0_format;
1059 struct co_format co_format;
1060 struct p_format p_format;
1061 struct f_format f_format;
1062 struct ma_format ma_format;
1063 struct msa_mi10_format msa_mi10_format;
1064 struct b_format b_format;
1065 struct ps_format ps_format;
1066 struct v_format v_format;
1067 struct dsp_format dsp_format;
1068 struct spec3_format spec3_format;
1069 struct fb_format fb_format;
1070 struct fp0_format fp0_format;
1071 struct mm_fp0_format mm_fp0_format;
1072 struct fp1_format fp1_format;
1073 struct mm_fp1_format mm_fp1_format;
1074 struct mm_fp2_format mm_fp2_format;
1075 struct mm_fp3_format mm_fp3_format;
1076 struct mm_fp4_format mm_fp4_format;
1077 struct mm_fp5_format mm_fp5_format;
1078 struct fp6_format fp6_format;
1079 struct mm_fp6_format mm_fp6_format;
1080 struct mm_i_format mm_i_format;
1081 struct mm_m_format mm_m_format;
1082 struct mm_x_format mm_x_format;
1083 struct mm_a_format mm_a_format;
1084 struct mm_b0_format mm_b0_format;
1085 struct mm_b1_format mm_b1_format;
1086 struct mm16_m_format mm16_m_format ;
1087 struct mm16_rb_format mm16_rb_format;
1088 struct mm16_r3_format mm16_r3_format;
1089 struct mm16_r5_format mm16_r5_format;
1090};
1091
1092union mips16e_instruction {
1093 unsigned int full : 16;
1094 struct m16e_rr rr;
1095 struct m16e_jal jal;
1096 struct m16e_i64 i64;
1097 struct m16e_ri64 ri64;
1098 struct m16e_ri ri;
1099 struct m16e_rri rri;
1100 struct m16e_i8 i8;
1101};
1102
1103#endif /* _ASM_INST_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ist.h deleted-30
...@@ -1,30 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Include file for the interface to IST BIOS
4 * Copyright 2002 Andy Grover <andrew.grover@intel.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16#ifndef _ASM_X86_IST_H
17#define _ASM_X86_IST_H
18
19
20
21#include <linux/types.h>
22
23struct ist_info {
24 __u32 signature;
25 __u32 command;
26 __u32 event;
27 __u32 perf_level;
28};
29
30#endif /* _ASM_X86_IST_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/kvm.h deleted-297
...@@ -1,297 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
4 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __ARM_KVM_H__
21#define __ARM_KVM_H__
22
23#include <linux/types.h>
24#include <linux/psci.h>
25#include <asm/ptrace.h>
26
27#define __KVM_HAVE_GUEST_DEBUG
28#define __KVM_HAVE_IRQ_LINE
29#define __KVM_HAVE_READONLY_MEM
30#define __KVM_HAVE_VCPU_EVENTS
31
32#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
33
34#define KVM_REG_SIZE(id) \
35 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
36
37/* Valid for svc_regs, abt_regs, und_regs, irq_regs in struct kvm_regs */
38#define KVM_ARM_SVC_sp svc_regs[0]
39#define KVM_ARM_SVC_lr svc_regs[1]
40#define KVM_ARM_SVC_spsr svc_regs[2]
41#define KVM_ARM_ABT_sp abt_regs[0]
42#define KVM_ARM_ABT_lr abt_regs[1]
43#define KVM_ARM_ABT_spsr abt_regs[2]
44#define KVM_ARM_UND_sp und_regs[0]
45#define KVM_ARM_UND_lr und_regs[1]
46#define KVM_ARM_UND_spsr und_regs[2]
47#define KVM_ARM_IRQ_sp irq_regs[0]
48#define KVM_ARM_IRQ_lr irq_regs[1]
49#define KVM_ARM_IRQ_spsr irq_regs[2]
50
51/* Valid only for fiq_regs in struct kvm_regs */
52#define KVM_ARM_FIQ_r8 fiq_regs[0]
53#define KVM_ARM_FIQ_r9 fiq_regs[1]
54#define KVM_ARM_FIQ_r10 fiq_regs[2]
55#define KVM_ARM_FIQ_fp fiq_regs[3]
56#define KVM_ARM_FIQ_ip fiq_regs[4]
57#define KVM_ARM_FIQ_sp fiq_regs[5]
58#define KVM_ARM_FIQ_lr fiq_regs[6]
59#define KVM_ARM_FIQ_spsr fiq_regs[7]
60
61struct kvm_regs {
62 struct pt_regs usr_regs; /* R0_usr - R14_usr, PC, CPSR */
63 unsigned long svc_regs[3]; /* SP_svc, LR_svc, SPSR_svc */
64 unsigned long abt_regs[3]; /* SP_abt, LR_abt, SPSR_abt */
65 unsigned long und_regs[3]; /* SP_und, LR_und, SPSR_und */
66 unsigned long irq_regs[3]; /* SP_irq, LR_irq, SPSR_irq */
67 unsigned long fiq_regs[8]; /* R8_fiq - R14_fiq, SPSR_fiq */
68};
69
70/* Supported Processor Types */
71#define KVM_ARM_TARGET_CORTEX_A15 0
72#define KVM_ARM_TARGET_CORTEX_A7 1
73#define KVM_ARM_NUM_TARGETS 2
74
75/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
76#define KVM_ARM_DEVICE_TYPE_SHIFT 0
77#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
78#define KVM_ARM_DEVICE_ID_SHIFT 16
79#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
80
81/* Supported device IDs */
82#define KVM_ARM_DEVICE_VGIC_V2 0
83
84/* Supported VGIC address types */
85#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
86#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
87
88#define KVM_VGIC_V2_DIST_SIZE 0x1000
89#define KVM_VGIC_V2_CPU_SIZE 0x2000
90
91/* Supported VGICv3 address types */
92#define KVM_VGIC_V3_ADDR_TYPE_DIST 2
93#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
94#define KVM_VGIC_ITS_ADDR_TYPE 4
95#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
96
97#define KVM_VGIC_V3_DIST_SIZE SZ_64K
98#define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
99#define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K)
100
101#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
102#define KVM_ARM_VCPU_PSCI_0_2 1 /* CPU uses PSCI v0.2 */
103
104struct kvm_vcpu_init {
105 __u32 target;
106 __u32 features[7];
107};
108
109struct kvm_sregs {
110};
111
112struct kvm_fpu {
113};
114
115struct kvm_guest_debug_arch {
116};
117
118struct kvm_debug_exit_arch {
119};
120
121struct kvm_sync_regs {
122 /* Used with KVM_CAP_ARM_USER_IRQ */
123 __u64 device_irq_level;
124};
125
126struct kvm_arch_memory_slot {
127};
128
129/* for KVM_GET/SET_VCPU_EVENTS */
130struct kvm_vcpu_events {
131 struct {
132 __u8 serror_pending;
133 __u8 serror_has_esr;
134 /* Align it to 8 bytes */
135 __u8 pad[6];
136 __u64 serror_esr;
137 } exception;
138 __u32 reserved[12];
139};
140
141/* If you need to interpret the index values, here is the key: */
142#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
143#define KVM_REG_ARM_COPROC_SHIFT 16
144#define KVM_REG_ARM_32_OPC2_MASK 0x0000000000000007
145#define KVM_REG_ARM_32_OPC2_SHIFT 0
146#define KVM_REG_ARM_OPC1_MASK 0x0000000000000078
147#define KVM_REG_ARM_OPC1_SHIFT 3
148#define KVM_REG_ARM_CRM_MASK 0x0000000000000780
149#define KVM_REG_ARM_CRM_SHIFT 7
150#define KVM_REG_ARM_32_CRN_MASK 0x0000000000007800
151#define KVM_REG_ARM_32_CRN_SHIFT 11
152/*
153 * For KVM currently all guest registers are nonsecure, but we reserve a bit
154 * in the encoding to distinguish secure from nonsecure for AArch32 system
155 * registers that are banked by security. This is 1 for the secure banked
156 * register, and 0 for the nonsecure banked register or if the register is
157 * not banked by security.
158 */
159#define KVM_REG_ARM_SECURE_MASK 0x0000000010000000
160#define KVM_REG_ARM_SECURE_SHIFT 28
161
162#define ARM_CP15_REG_SHIFT_MASK(x,n) \
163 (((x) << KVM_REG_ARM_ ## n ## _SHIFT) & KVM_REG_ARM_ ## n ## _MASK)
164
165#define __ARM_CP15_REG(op1,crn,crm,op2) \
166 (KVM_REG_ARM | (15 << KVM_REG_ARM_COPROC_SHIFT) | \
167 ARM_CP15_REG_SHIFT_MASK(op1, OPC1) | \
168 ARM_CP15_REG_SHIFT_MASK(crn, 32_CRN) | \
169 ARM_CP15_REG_SHIFT_MASK(crm, CRM) | \
170 ARM_CP15_REG_SHIFT_MASK(op2, 32_OPC2))
171
172#define ARM_CP15_REG32(...) (__ARM_CP15_REG(__VA_ARGS__) | KVM_REG_SIZE_U32)
173
174#define __ARM_CP15_REG64(op1,crm) \
175 (__ARM_CP15_REG(op1, 0, crm, 0) | KVM_REG_SIZE_U64)
176#define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__)
177
178/* PL1 Physical Timer Registers */
179#define KVM_REG_ARM_PTIMER_CTL ARM_CP15_REG32(0, 14, 2, 1)
180#define KVM_REG_ARM_PTIMER_CNT ARM_CP15_REG64(0, 14)
181#define KVM_REG_ARM_PTIMER_CVAL ARM_CP15_REG64(2, 14)
182
183/* Virtual Timer Registers */
184#define KVM_REG_ARM_TIMER_CTL ARM_CP15_REG32(0, 14, 3, 1)
185#define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14)
186#define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14)
187
188/* Normal registers are mapped as coprocessor 16. */
189#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
190#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4)
191
192/* Some registers need more space to represent values. */
193#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
194#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
195#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
196#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
197#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
198#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
199
200/* VFP registers: we could overload CP10 like ARM does, but that's ugly. */
201#define KVM_REG_ARM_VFP (0x0012 << KVM_REG_ARM_COPROC_SHIFT)
202#define KVM_REG_ARM_VFP_MASK 0x000000000000FFFF
203#define KVM_REG_ARM_VFP_BASE_REG 0x0
204#define KVM_REG_ARM_VFP_FPSID 0x1000
205#define KVM_REG_ARM_VFP_FPSCR 0x1001
206#define KVM_REG_ARM_VFP_MVFR1 0x1006
207#define KVM_REG_ARM_VFP_MVFR0 0x1007
208#define KVM_REG_ARM_VFP_FPEXC 0x1008
209#define KVM_REG_ARM_VFP_FPINST 0x1009
210#define KVM_REG_ARM_VFP_FPINST2 0x100A
211
212/* KVM-as-firmware specific pseudo-registers */
213#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
214#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \
215 KVM_REG_ARM_FW | ((r) & 0xffff))
216#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
217
218/* Device Control API: ARM VGIC */
219#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
220#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
221#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
222#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
223#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
224#define KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT 32
225#define KVM_DEV_ARM_VGIC_V3_MPIDR_MASK \
226 (0xffffffffULL << KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT)
227#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
228#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
229#define KVM_DEV_ARM_VGIC_SYSREG_INSTR_MASK (0xffff)
230#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS 3
231#define KVM_DEV_ARM_VGIC_GRP_CTRL 4
232#define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5
233#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
234#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
235#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
236#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
237#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
238 (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
239#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff
240#define VGIC_LEVEL_INFO_LINE_LEVEL 0
241
242/* Device Control API on vcpu fd */
243#define KVM_ARM_VCPU_PMU_V3_CTRL 0
244#define KVM_ARM_VCPU_PMU_V3_IRQ 0
245#define KVM_ARM_VCPU_PMU_V3_INIT 1
246#define KVM_ARM_VCPU_TIMER_CTRL 1
247#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
248#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
249
250#define KVM_DEV_ARM_VGIC_CTRL_INIT 0
251#define KVM_DEV_ARM_ITS_SAVE_TABLES 1
252#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2
253#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3
254#define KVM_DEV_ARM_ITS_CTRL_RESET 4
255
256/* KVM_IRQ_LINE irq field index values */
257#define KVM_ARM_IRQ_TYPE_SHIFT 24
258#define KVM_ARM_IRQ_TYPE_MASK 0xff
259#define KVM_ARM_IRQ_VCPU_SHIFT 16
260#define KVM_ARM_IRQ_VCPU_MASK 0xff
261#define KVM_ARM_IRQ_NUM_SHIFT 0
262#define KVM_ARM_IRQ_NUM_MASK 0xffff
263
264/* irq_type field */
265#define KVM_ARM_IRQ_TYPE_CPU 0
266#define KVM_ARM_IRQ_TYPE_SPI 1
267#define KVM_ARM_IRQ_TYPE_PPI 2
268
269/* out-of-kernel GIC cpu interrupt injection irq_number field */
270#define KVM_ARM_IRQ_CPU_IRQ 0
271#define KVM_ARM_IRQ_CPU_FIQ 1
272
273/*
274 * This used to hold the highest supported SPI, but it is now obsolete
275 * and only here to provide source code level compatibility with older
276 * userland. The highest SPI number can be set via KVM_DEV_ARM_VGIC_GRP_NR_IRQS.
277 */
278#define KVM_ARM_IRQ_GIC_MAX 127
279
280/* One single KVM irqchip, ie. the VGIC */
281#define KVM_NR_IRQCHIPS 1
282
283/* PSCI interface */
284#define KVM_PSCI_FN_BASE 0x95c1ba5e
285#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
286
287#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
288#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
289#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
290#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
291
292#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
293#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
294#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
295#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
296
297#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/kvm_para.h-1
...@@ -1,2 +1 @@...@@ -1,2 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#include <asm-generic/kvm_para.h>1#include <asm-generic/kvm_para.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/kvm_perf.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_PERF_H
3#define _ASM_X86_KVM_PERF_H
4
5#include <asm/svm.h>
6#include <asm/vmx.h>
7#include <asm/kvm.h>
8
9#define DECODE_STR_LEN 20
10
11#define VCPU_ID "vcpu_id"
12
13#define KVM_ENTRY_TRACE "kvm:kvm_entry"
14#define KVM_EXIT_TRACE "kvm:kvm_exit"
15#define KVM_EXIT_REASON "exit_reason"
16
17#endif /* _ASM_X86_KVM_PERF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ldt.h deleted-48
...@@ -1,48 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * ldt.h
4 *
5 * Definitions of structures used with the modify_ldt system call.
6 */
7#ifndef _ASM_X86_LDT_H
8#define _ASM_X86_LDT_H
9
10/* Maximum number of LDT entries supported. */
11#define LDT_ENTRIES 8192
12/* The size of each LDT entry. */
13#define LDT_ENTRY_SIZE 8
14
15#ifndef __ASSEMBLY__
16/*
17 * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
18 * not to the default values if you still want to do syscalls. This
19 * call is more for 32bit mode therefore.
20 */
21struct user_desc {
22 unsigned int entry_number;
23 unsigned int base_addr;
24 unsigned int limit;
25 unsigned int seg_32bit:1;
26 unsigned int contents:2;
27 unsigned int read_exec_only:1;
28 unsigned int limit_in_pages:1;
29 unsigned int seg_not_present:1;
30 unsigned int useable:1;
31#ifdef __x86_64__
32 /*
33 * Because this bit is not present in 32-bit user code, user
34 * programs can pass uninitialized values here. Therefore, in
35 * any context in which a user_desc comes from a 32-bit program,
36 * the kernel must act as though lm == 0, regardless of the
37 * actual value.
38 */
39 unsigned int lm:1;
40#endif
41};
42
43#define MODIFY_LDT_CONTENTS_DATA 0
44#define MODIFY_LDT_CONTENTS_STACK 1
45#define MODIFY_LDT_CONTENTS_CODE 2
46
47#endif /* !__ASSEMBLY__ */
48#endif /* _ASM_X86_LDT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/mce.h deleted-44
...@@ -1,44 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MCE_H
3#define _ASM_X86_MCE_H
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8/*
9 * Fields are zero when not available. Also, this struct is shared with
10 * userspace mcelog and thus must keep existing fields at current offsets.
11 * Only add new fields to the end of the structure
12 */
13struct mce {
14 __u64 status; /* Bank's MCi_STATUS MSR */
15 __u64 misc; /* Bank's MCi_MISC MSR */
16 __u64 addr; /* Bank's MCi_ADDR MSR */
17 __u64 mcgstatus; /* Machine Check Global Status MSR */
18 __u64 ip; /* Instruction Pointer when the error happened */
19 __u64 tsc; /* CPU time stamp counter */
20 __u64 time; /* Wall time_t when error was detected */
21 __u8 cpuvendor; /* Kernel's X86_VENDOR enum */
22 __u8 inject_flags; /* Software inject flags */
23 __u8 severity; /* Error severity */
24 __u8 pad;
25 __u32 cpuid; /* CPUID 1 EAX */
26 __u8 cs; /* Code segment */
27 __u8 bank; /* Machine check bank reporting the error */
28 __u8 cpu; /* CPU number; obsoleted by extcpu */
29 __u8 finished; /* Entry is valid */
30 __u32 extcpu; /* Linux CPU number that detected the error */
31 __u32 socketid; /* CPU socket ID */
32 __u32 apicid; /* CPU initial APIC ID */
33 __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
34 __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */
35 __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
36 __u64 ppin; /* Protected Processor Inventory Number */
37 __u32 microcode; /* Microcode revision */
38};
39
40#define MCE_GET_RECORD_LEN _IOR('M', 1, int)
41#define MCE_GET_LOG_LEN _IOR('M', 2, int)
42#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
43
44#endif /* _ASM_X86_MCE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/msr.h deleted-14
...@@ -1,14 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MSR_H
3#define _ASM_X86_MSR_H
4
5#ifndef __ASSEMBLY__
6
7#include <linux/types.h>
8#include <linux/ioctl.h>
9
10#define X86_IOC_RDMSR_REGS _IOWR('c', 0xA0, __u32[8])
11#define X86_IOC_WRMSR_REGS _IOWR('c', 0xA1, __u32[8])
12
13#endif /* __ASSEMBLY__ */
14#endif /* _ASM_X86_MSR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/mtrr.h deleted-124
...@@ -1,124 +0,0 @@
1/* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */
2/* Generic MTRR (Memory Type Range Register) ioctls.
3
4 Copyright (C) 1997-1999 Richard Gooch
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the Free
18 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 Richard Gooch may be reached by email at rgooch@atnf.csiro.au
21 The postal address is:
22 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
23*/
24#ifndef _ASM_X86_MTRR_H
25#define _ASM_X86_MTRR_H
26
27#include <linux/types.h>
28#include <linux/ioctl.h>
29#include <linux/errno.h>
30
31#define MTRR_IOCTL_BASE 'M'
32
33/* Warning: this structure has a different order from i386
34 on x86-64. The 32bit emulation code takes care of that.
35 But you need to use this for 64bit, otherwise your X server
36 will break. */
37
38#ifdef __i386__
39struct mtrr_sentry {
40 unsigned long base; /* Base address */
41 unsigned int size; /* Size of region */
42 unsigned int type; /* Type of region */
43};
44
45struct mtrr_gentry {
46 unsigned int regnum; /* Register number */
47 unsigned long base; /* Base address */
48 unsigned int size; /* Size of region */
49 unsigned int type; /* Type of region */
50};
51
52#else /* __i386__ */
53
54struct mtrr_sentry {
55 __u64 base; /* Base address */
56 __u32 size; /* Size of region */
57 __u32 type; /* Type of region */
58};
59
60struct mtrr_gentry {
61 __u64 base; /* Base address */
62 __u32 size; /* Size of region */
63 __u32 regnum; /* Register number */
64 __u32 type; /* Type of region */
65 __u32 _pad; /* Unused */
66};
67
68#endif /* !__i386__ */
69
70struct mtrr_var_range {
71 __u32 base_lo;
72 __u32 base_hi;
73 __u32 mask_lo;
74 __u32 mask_hi;
75};
76
77/* In the Intel processor's MTRR interface, the MTRR type is always held in
78 an 8 bit field: */
79typedef __u8 mtrr_type;
80
81#define MTRR_NUM_FIXED_RANGES 88
82#define MTRR_MAX_VAR_RANGES 256
83
84struct mtrr_state_type {
85 struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
86 mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
87 unsigned char enabled;
88 unsigned char have_fixed;
89 mtrr_type def_type;
90};
91
92#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
93#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
94
95/* These are the various ioctls */
96#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
97#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)
98#define MTRRIOC_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry)
99#define MTRRIOC_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry)
100#define MTRRIOC_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry)
101#define MTRRIOC_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry)
102#define MTRRIOC_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry)
103#define MTRRIOC_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry)
104#define MTRRIOC_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry)
105#define MTRRIOC_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry)
106
107/* MTRR memory types, which are defined in SDM */
108#define MTRR_TYPE_UNCACHABLE 0
109#define MTRR_TYPE_WRCOMB 1
110/*#define MTRR_TYPE_ 2*/
111/*#define MTRR_TYPE_ 3*/
112#define MTRR_TYPE_WRTHROUGH 4
113#define MTRR_TYPE_WRPROT 5
114#define MTRR_TYPE_WRBACK 6
115#define MTRR_NUM_TYPES 7
116
117/*
118 * Invalid MTRR memory type. mtrr_type_lookup() returns this value when
119 * MTRRs are disabled. Note, this value is allocated from the reserved
120 * values (0x7-0xff) of the MTRR memory types.
121 */
122#define MTRR_TYPE_INVALID 0xff
123
124#endif /* _ASM_X86_MTRR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/nvram.h deleted-63
...@@ -1,63 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * NVRAM definitions and access functions.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _ASM_POWERPC_NVRAM_H
12#define _ASM_POWERPC_NVRAM_H
13
14/* Signatures for nvram partitions */
15#define NVRAM_SIG_SP 0x02 /* support processor */
16#define NVRAM_SIG_OF 0x50 /* open firmware config */
17#define NVRAM_SIG_FW 0x51 /* general firmware */
18#define NVRAM_SIG_HW 0x52 /* hardware (VPD) */
19#define NVRAM_SIG_FLIP 0x5a /* Apple flip/flop header */
20#define NVRAM_SIG_APPL 0x5f /* Apple "system" (???) */
21#define NVRAM_SIG_SYS 0x70 /* system env vars */
22#define NVRAM_SIG_CFG 0x71 /* config data */
23#define NVRAM_SIG_ELOG 0x72 /* error log */
24#define NVRAM_SIG_VEND 0x7e /* vendor defined */
25#define NVRAM_SIG_FREE 0x7f /* Free space */
26#define NVRAM_SIG_OS 0xa0 /* OS defined */
27#define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */
28
29
30/* PowerMac specific nvram stuffs */
31
32enum {
33 pmac_nvram_OF, /* Open Firmware partition */
34 pmac_nvram_XPRAM, /* MacOS XPRAM partition */
35 pmac_nvram_NR /* MacOS Name Registry partition */
36};
37
38
39/* Some offsets in XPRAM */
40#define PMAC_XPRAM_MACHINE_LOC 0xe4
41#define PMAC_XPRAM_SOUND_VOLUME 0x08
42
43/* Machine location structure in PowerMac XPRAM */
44struct pmac_machine_location {
45 unsigned int latitude; /* 2+30 bit Fractional number */
46 unsigned int longitude; /* 2+30 bit Fractional number */
47 unsigned int delta; /* mix of GMT delta and DLS */
48};
49
50/*
51 * /dev/nvram ioctls
52 *
53 * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
54 * definitely obsolete. Do not use it if you can avoid it
55 */
56
57#define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
58 _IOWR('p', 0x40, int)
59
60#define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */
61#define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */
62
63#endif /* _ASM_POWERPC_NVRAM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/opal-prd.h deleted-59
...@@ -1,59 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * OPAL Runtime Diagnostics interface driver
4 * Supported on POWERNV platform
5 *
6 * (C) Copyright IBM 2015
7 *
8 * Author: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
9 * Author: Jeremy Kerr <jk@ozlabs.org>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
14 * any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 */
21
22#ifndef _ASM_POWERPC_OPAL_PRD_H_
23#define _ASM_POWERPC_OPAL_PRD_H_
24
25#include <linux/types.h>
26
27/**
28 * The version of the kernel interface of the PRD system. This describes the
29 * interface available for the /dev/opal-prd device. The actual PRD message
30 * layout and content is private to the firmware <--> userspace interface, so
31 * is not covered by this versioning.
32 *
33 * Future interface versions are backwards-compatible; if a later kernel
34 * version is encountered, functionality provided in earlier versions
35 * will work.
36 */
37#define OPAL_PRD_KERNEL_VERSION 1
38
39#define OPAL_PRD_GET_INFO _IOR('o', 0x01, struct opal_prd_info)
40#define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom)
41#define OPAL_PRD_SCOM_WRITE _IOW('o', 0x03, struct opal_prd_scom)
42
43#ifndef __ASSEMBLY__
44
45struct opal_prd_info {
46 __u64 version;
47 __u64 reserved[3];
48};
49
50struct opal_prd_scom {
51 __u64 chip;
52 __u64 addr;
53 __u64 data;
54 __s64 rc;
55};
56
57#endif /* __ASSEMBLY__ */
58
59#endif /* _ASM_POWERPC_OPAL_PRD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/perf_event.h deleted-19
...@@ -1,19 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 2013 Michael Ellerman, IBM Corp.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; version 2 of the
8 * License.
9 */
10
11#ifndef _ASM_POWERPC_PERF_EVENT_H
12#define _ASM_POWERPC_PERF_EVENT_H
13
14/*
15 * We use bit 63 of perf_event_attr.config as a flag to request EBB.
16 */
17#define PERF_EVENT_CONFIG_EBB_SHIFT 63
18
19#endif /* _ASM_POWERPC_PERF_EVENT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/perf_regs.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_ARM_PERF_REGS_H
3#define _ASM_ARM_PERF_REGS_H
4
5enum perf_event_arm_regs {
6 PERF_REG_ARM_R0,
7 PERF_REG_ARM_R1,
8 PERF_REG_ARM_R2,
9 PERF_REG_ARM_R3,
10 PERF_REG_ARM_R4,
11 PERF_REG_ARM_R5,
12 PERF_REG_ARM_R6,
13 PERF_REG_ARM_R7,
14 PERF_REG_ARM_R8,
15 PERF_REG_ARM_R9,
16 PERF_REG_ARM_R10,
17 PERF_REG_ARM_FP,
18 PERF_REG_ARM_IP,
19 PERF_REG_ARM_SP,
20 PERF_REG_ARM_LR,
21 PERF_REG_ARM_PC,
22 PERF_REG_ARM_MAX,
23};
24#endif /* _ASM_ARM_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/posix_types.h+1-38
...@@ -1,38 +1 @@...@@ -1,38 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/posix_types.h
4 *
5 * Copyright (C) 1996-1998 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Changelog:
12 * 27-06-1996 RMK Created
13 */
14#ifndef __ARCH_ARM_POSIX_TYPES_H
15#define __ARCH_ARM_POSIX_TYPES_H
16
17/*
18 * This file is generally used by user-level software, so you need to
19 * be a little careful about namespace pollution etc. Also, we cannot
20 * assume GCC is being used.
21 */
22
23typedef unsigned short __kernel_mode_t;
24#define __kernel_mode_t __kernel_mode_t
25
26typedef unsigned short __kernel_ipc_pid_t;
27#define __kernel_ipc_pid_t __kernel_ipc_pid_t
28
29typedef unsigned short __kernel_uid_t;
30typedef unsigned short __kernel_gid_t;
31#define __kernel_uid_t __kernel_uid_t
32
33typedef unsigned short __kernel_old_dev_t;
34#define __kernel_old_dev_t __kernel_old_dev_t
35
36#include <asm-generic/posix_types.h>
37
38#endif
\ No newline at end of file
1#include <asm-generic/posix_types.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/posix_types_32.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_32_H
3#define _ASM_X86_POSIX_TYPES_32_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11typedef unsigned short __kernel_mode_t;
12#define __kernel_mode_t __kernel_mode_t
13
14typedef unsigned short __kernel_ipc_pid_t;
15#define __kernel_ipc_pid_t __kernel_ipc_pid_t
16
17typedef unsigned short __kernel_uid_t;
18typedef unsigned short __kernel_gid_t;
19#define __kernel_uid_t __kernel_uid_t
20
21typedef unsigned short __kernel_old_dev_t;
22#define __kernel_old_dev_t __kernel_old_dev_t
23
24#include <asm-generic/posix_types.h>
25
26#endif /* _ASM_X86_POSIX_TYPES_32_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/posix_types_64.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_64_H
3#define _ASM_X86_POSIX_TYPES_64_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11typedef unsigned short __kernel_old_uid_t;
12typedef unsigned short __kernel_old_gid_t;
13#define __kernel_old_uid_t __kernel_old_uid_t
14
15typedef unsigned long __kernel_old_dev_t;
16#define __kernel_old_dev_t __kernel_old_dev_t
17
18#include <asm-generic/posix_types.h>
19
20#endif /* _ASM_X86_POSIX_TYPES_64_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/posix_types_x32.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_X32_H
3#define _ASM_X86_POSIX_TYPES_X32_H
4
5/*
6 * This file is only used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 *
10 * These types should generally match the ones used by the 64-bit kernel,
11 *
12 */
13
14typedef long long __kernel_long_t;
15typedef unsigned long long __kernel_ulong_t;
16#define __kernel_long_t __kernel_long_t
17
18#include <asm/posix_types_64.h>
19
20#endif /* _ASM_X86_POSIX_TYPES_X32_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/prctl.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PRCTL_H
3#define _ASM_X86_PRCTL_H
4
5#define ARCH_SET_GS 0x1001
6#define ARCH_SET_FS 0x1002
7#define ARCH_GET_FS 0x1003
8#define ARCH_GET_GS 0x1004
9
10#define ARCH_GET_CPUID 0x1011
11#define ARCH_SET_CPUID 0x1012
12
13#define ARCH_MAP_VDSO_X32 0x2001
14#define ARCH_MAP_VDSO_32 0x2002
15#define ARCH_MAP_VDSO_64 0x2003
16
17#endif /* _ASM_X86_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/processor-flags.h deleted-166
...@@ -1,166 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PROCESSOR_FLAGS_H
3#define _ASM_X86_PROCESSOR_FLAGS_H
4/* Various flags defined: can be included from assembler. */
5
6#include <linux/const.h>
7
8/*
9 * EFLAGS bits
10 */
11#define X86_EFLAGS_CF_BIT 0 /* Carry Flag */
12#define X86_EFLAGS_CF _BITUL(X86_EFLAGS_CF_BIT)
13#define X86_EFLAGS_FIXED_BIT 1 /* Bit 1 - always on */
14#define X86_EFLAGS_FIXED _BITUL(X86_EFLAGS_FIXED_BIT)
15#define X86_EFLAGS_PF_BIT 2 /* Parity Flag */
16#define X86_EFLAGS_PF _BITUL(X86_EFLAGS_PF_BIT)
17#define X86_EFLAGS_AF_BIT 4 /* Auxiliary carry Flag */
18#define X86_EFLAGS_AF _BITUL(X86_EFLAGS_AF_BIT)
19#define X86_EFLAGS_ZF_BIT 6 /* Zero Flag */
20#define X86_EFLAGS_ZF _BITUL(X86_EFLAGS_ZF_BIT)
21#define X86_EFLAGS_SF_BIT 7 /* Sign Flag */
22#define X86_EFLAGS_SF _BITUL(X86_EFLAGS_SF_BIT)
23#define X86_EFLAGS_TF_BIT 8 /* Trap Flag */
24#define X86_EFLAGS_TF _BITUL(X86_EFLAGS_TF_BIT)
25#define X86_EFLAGS_IF_BIT 9 /* Interrupt Flag */
26#define X86_EFLAGS_IF _BITUL(X86_EFLAGS_IF_BIT)
27#define X86_EFLAGS_DF_BIT 10 /* Direction Flag */
28#define X86_EFLAGS_DF _BITUL(X86_EFLAGS_DF_BIT)
29#define X86_EFLAGS_OF_BIT 11 /* Overflow Flag */
30#define X86_EFLAGS_OF _BITUL(X86_EFLAGS_OF_BIT)
31#define X86_EFLAGS_IOPL_BIT 12 /* I/O Privilege Level (2 bits) */
32#define X86_EFLAGS_IOPL (_AC(3,UL) << X86_EFLAGS_IOPL_BIT)
33#define X86_EFLAGS_NT_BIT 14 /* Nested Task */
34#define X86_EFLAGS_NT _BITUL(X86_EFLAGS_NT_BIT)
35#define X86_EFLAGS_RF_BIT 16 /* Resume Flag */
36#define X86_EFLAGS_RF _BITUL(X86_EFLAGS_RF_BIT)
37#define X86_EFLAGS_VM_BIT 17 /* Virtual Mode */
38#define X86_EFLAGS_VM _BITUL(X86_EFLAGS_VM_BIT)
39#define X86_EFLAGS_AC_BIT 18 /* Alignment Check/Access Control */
40#define X86_EFLAGS_AC _BITUL(X86_EFLAGS_AC_BIT)
41#define X86_EFLAGS_VIF_BIT 19 /* Virtual Interrupt Flag */
42#define X86_EFLAGS_VIF _BITUL(X86_EFLAGS_VIF_BIT)
43#define X86_EFLAGS_VIP_BIT 20 /* Virtual Interrupt Pending */
44#define X86_EFLAGS_VIP _BITUL(X86_EFLAGS_VIP_BIT)
45#define X86_EFLAGS_ID_BIT 21 /* CPUID detection */
46#define X86_EFLAGS_ID _BITUL(X86_EFLAGS_ID_BIT)
47
48/*
49 * Basic CPU control in CR0
50 */
51#define X86_CR0_PE_BIT 0 /* Protection Enable */
52#define X86_CR0_PE _BITUL(X86_CR0_PE_BIT)
53#define X86_CR0_MP_BIT 1 /* Monitor Coprocessor */
54#define X86_CR0_MP _BITUL(X86_CR0_MP_BIT)
55#define X86_CR0_EM_BIT 2 /* Emulation */
56#define X86_CR0_EM _BITUL(X86_CR0_EM_BIT)
57#define X86_CR0_TS_BIT 3 /* Task Switched */
58#define X86_CR0_TS _BITUL(X86_CR0_TS_BIT)
59#define X86_CR0_ET_BIT 4 /* Extension Type */
60#define X86_CR0_ET _BITUL(X86_CR0_ET_BIT)
61#define X86_CR0_NE_BIT 5 /* Numeric Error */
62#define X86_CR0_NE _BITUL(X86_CR0_NE_BIT)
63#define X86_CR0_WP_BIT 16 /* Write Protect */
64#define X86_CR0_WP _BITUL(X86_CR0_WP_BIT)
65#define X86_CR0_AM_BIT 18 /* Alignment Mask */
66#define X86_CR0_AM _BITUL(X86_CR0_AM_BIT)
67#define X86_CR0_NW_BIT 29 /* Not Write-through */
68#define X86_CR0_NW _BITUL(X86_CR0_NW_BIT)
69#define X86_CR0_CD_BIT 30 /* Cache Disable */
70#define X86_CR0_CD _BITUL(X86_CR0_CD_BIT)
71#define X86_CR0_PG_BIT 31 /* Paging */
72#define X86_CR0_PG _BITUL(X86_CR0_PG_BIT)
73
74/*
75 * Paging options in CR3
76 */
77#define X86_CR3_PWT_BIT 3 /* Page Write Through */
78#define X86_CR3_PWT _BITUL(X86_CR3_PWT_BIT)
79#define X86_CR3_PCD_BIT 4 /* Page Cache Disable */
80#define X86_CR3_PCD _BITUL(X86_CR3_PCD_BIT)
81
82#define X86_CR3_PCID_BITS 12
83#define X86_CR3_PCID_MASK (_AC((1UL << X86_CR3_PCID_BITS) - 1, UL))
84
85#define X86_CR3_PCID_NOFLUSH_BIT 63 /* Preserve old PCID */
86#define X86_CR3_PCID_NOFLUSH _BITULL(X86_CR3_PCID_NOFLUSH_BIT)
87
88/*
89 * Intel CPU features in CR4
90 */
91#define X86_CR4_VME_BIT 0 /* enable vm86 extensions */
92#define X86_CR4_VME _BITUL(X86_CR4_VME_BIT)
93#define X86_CR4_PVI_BIT 1 /* virtual interrupts flag enable */
94#define X86_CR4_PVI _BITUL(X86_CR4_PVI_BIT)
95#define X86_CR4_TSD_BIT 2 /* disable time stamp at ipl 3 */
96#define X86_CR4_TSD _BITUL(X86_CR4_TSD_BIT)
97#define X86_CR4_DE_BIT 3 /* enable debugging extensions */
98#define X86_CR4_DE _BITUL(X86_CR4_DE_BIT)
99#define X86_CR4_PSE_BIT 4 /* enable page size extensions */
100#define X86_CR4_PSE _BITUL(X86_CR4_PSE_BIT)
101#define X86_CR4_PAE_BIT 5 /* enable physical address extensions */
102#define X86_CR4_PAE _BITUL(X86_CR4_PAE_BIT)
103#define X86_CR4_MCE_BIT 6 /* Machine check enable */
104#define X86_CR4_MCE _BITUL(X86_CR4_MCE_BIT)
105#define X86_CR4_PGE_BIT 7 /* enable global pages */
106#define X86_CR4_PGE _BITUL(X86_CR4_PGE_BIT)
107#define X86_CR4_PCE_BIT 8 /* enable performance counters at ipl 3 */
108#define X86_CR4_PCE _BITUL(X86_CR4_PCE_BIT)
109#define X86_CR4_OSFXSR_BIT 9 /* enable fast FPU save and restore */
110#define X86_CR4_OSFXSR _BITUL(X86_CR4_OSFXSR_BIT)
111#define X86_CR4_OSXMMEXCPT_BIT 10 /* enable unmasked SSE exceptions */
112#define X86_CR4_OSXMMEXCPT _BITUL(X86_CR4_OSXMMEXCPT_BIT)
113#define X86_CR4_UMIP_BIT 11 /* enable UMIP support */
114#define X86_CR4_UMIP _BITUL(X86_CR4_UMIP_BIT)
115#define X86_CR4_LA57_BIT 12 /* enable 5-level page tables */
116#define X86_CR4_LA57 _BITUL(X86_CR4_LA57_BIT)
117#define X86_CR4_VMXE_BIT 13 /* enable VMX virtualization */
118#define X86_CR4_VMXE _BITUL(X86_CR4_VMXE_BIT)
119#define X86_CR4_SMXE_BIT 14 /* enable safer mode (TXT) */
120#define X86_CR4_SMXE _BITUL(X86_CR4_SMXE_BIT)
121#define X86_CR4_FSGSBASE_BIT 16 /* enable RDWRFSGS support */
122#define X86_CR4_FSGSBASE _BITUL(X86_CR4_FSGSBASE_BIT)
123#define X86_CR4_PCIDE_BIT 17 /* enable PCID support */
124#define X86_CR4_PCIDE _BITUL(X86_CR4_PCIDE_BIT)
125#define X86_CR4_OSXSAVE_BIT 18 /* enable xsave and xrestore */
126#define X86_CR4_OSXSAVE _BITUL(X86_CR4_OSXSAVE_BIT)
127#define X86_CR4_SMEP_BIT 20 /* enable SMEP support */
128#define X86_CR4_SMEP _BITUL(X86_CR4_SMEP_BIT)
129#define X86_CR4_SMAP_BIT 21 /* enable SMAP support */
130#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT)
131#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */
132#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
133
134/*
135 * x86-64 Task Priority Register, CR8
136 */
137#define X86_CR8_TPR _AC(0x0000000f,UL) /* task priority register */
138
139/*
140 * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>
141 */
142
143/*
144 * NSC/Cyrix CPU configuration register indexes
145 */
146#define CX86_PCR0 0x20
147#define CX86_GCR 0xb8
148#define CX86_CCR0 0xc0
149#define CX86_CCR1 0xc1
150#define CX86_CCR2 0xc2
151#define CX86_CCR3 0xc3
152#define CX86_CCR4 0xe8
153#define CX86_CCR5 0xe9
154#define CX86_CCR6 0xea
155#define CX86_CCR7 0xeb
156#define CX86_PCR1 0xf0
157#define CX86_DIR0 0xfe
158#define CX86_DIR1 0xff
159#define CX86_ARR_BASE 0xc4
160#define CX86_RCR_BASE 0xdc
161
162#define CR0_STATE (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
163 X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
164 X86_CR0_PG)
165
166#endif /* _ASM_X86_PROCESSOR_FLAGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ps3fb.h deleted-46
...@@ -1,46 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2006 Sony Computer Entertainment Inc.
4 * Copyright 2006, 2007 Sony Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef _ASM_POWERPC_PS3FB_H_
21#define _ASM_POWERPC_PS3FB_H_
22
23#include <linux/types.h>
24#include <linux/ioctl.h>
25
26/* ioctl */
27#define PS3FB_IOCTL_SETMODE _IOW('r', 1, int) /* set video mode */
28#define PS3FB_IOCTL_GETMODE _IOR('r', 2, int) /* get video mode */
29#define PS3FB_IOCTL_SCREENINFO _IOR('r', 3, int) /* get screen info */
30#define PS3FB_IOCTL_ON _IO('r', 4) /* use IOCTL_FSEL */
31#define PS3FB_IOCTL_OFF _IO('r', 5) /* return to normal-flip */
32#define PS3FB_IOCTL_FSEL _IOW('r', 6, int) /* blit and flip request */
33
34#ifndef FBIO_WAITFORVSYNC
35#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) /* wait for vsync */
36#endif
37
38struct ps3fb_ioctl_res {
39 __u32 xres; /* frame buffer x_size */
40 __u32 yres; /* frame buffer y_size */
41 __u32 xoff; /* margine x */
42 __u32 yoff; /* margine y */
43 __u32 num_frames; /* num of frame buffers */
44};
45
46#endif /* _ASM_POWERPC_PS3FB_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ptrace-abi.h deleted-94
...@@ -1,94 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PTRACE_ABI_H
3#define _ASM_X86_PTRACE_ABI_H
4
5#ifdef __i386__
6
7#define EBX 0
8#define ECX 1
9#define EDX 2
10#define ESI 3
11#define EDI 4
12#define EBP 5
13#define EAX 6
14#define DS 7
15#define ES 8
16#define FS 9
17#define GS 10
18#define ORIG_EAX 11
19#define EIP 12
20#define CS 13
21#define EFL 14
22#define UESP 15
23#define SS 16
24#define FRAME_SIZE 17
25
26#else /* __i386__ */
27
28#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
29/*
30 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
31 * unless syscall needs a complete, fully filled "struct pt_regs".
32 */
33#define R15 0
34#define R14 8
35#define R13 16
36#define R12 24
37#define RBP 32
38#define RBX 40
39/* These regs are callee-clobbered. Always saved on kernel entry. */
40#define R11 48
41#define R10 56
42#define R9 64
43#define R8 72
44#define RAX 80
45#define RCX 88
46#define RDX 96
47#define RSI 104
48#define RDI 112
49/*
50 * On syscall entry, this is syscall#. On CPU exception, this is error code.
51 * On hw interrupt, it's IRQ number:
52 */
53#define ORIG_RAX 120
54/* Return frame for iretq */
55#define RIP 128
56#define CS 136
57#define EFLAGS 144
58#define RSP 152
59#define SS 160
60#endif /* __ASSEMBLY__ */
61
62/* top of stack page */
63#define FRAME_SIZE 168
64
65#endif /* !__i386__ */
66
67/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
68#define PTRACE_GETREGS 12
69#define PTRACE_SETREGS 13
70#define PTRACE_GETFPREGS 14
71#define PTRACE_SETFPREGS 15
72#define PTRACE_GETFPXREGS 18
73#define PTRACE_SETFPXREGS 19
74
75#define PTRACE_OLDSETOPTIONS 21
76
77/* only useful for access 32bit programs / kernels */
78#define PTRACE_GET_THREAD_AREA 25
79#define PTRACE_SET_THREAD_AREA 26
80
81#ifdef __x86_64__
82# define PTRACE_ARCH_PRCTL 30
83#endif
84
85#define PTRACE_SYSEMU 31
86#define PTRACE_SYSEMU_SINGLESTEP 32
87
88#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
89
90#ifndef __ASSEMBLY__
91#include <linux/types.h>
92#endif
93
94#endif /* _ASM_X86_PTRACE_ABI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ptrace.h deleted-148
...@@ -1,148 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/ptrace.h
4 *
5 * Copyright (C) 1996-2003 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_ARM_PTRACE_H
12#define __ASM_ARM_PTRACE_H
13
14#include <asm/hwcap.h>
15
16#define PTRACE_GETREGS 12
17#define PTRACE_SETREGS 13
18#define PTRACE_GETFPREGS 14
19#define PTRACE_SETFPREGS 15
20/* PTRACE_ATTACH is 16 */
21/* PTRACE_DETACH is 17 */
22#define PTRACE_GETWMMXREGS 18
23#define PTRACE_SETWMMXREGS 19
24/* 20 is unused */
25#define PTRACE_OLDSETOPTIONS 21
26#define PTRACE_GET_THREAD_AREA 22
27#define PTRACE_SET_SYSCALL 23
28/* PTRACE_SYSCALL is 24 */
29#define PTRACE_GETCRUNCHREGS 25
30#define PTRACE_SETCRUNCHREGS 26
31#define PTRACE_GETVFPREGS 27
32#define PTRACE_SETVFPREGS 28
33#define PTRACE_GETHBPREGS 29
34#define PTRACE_SETHBPREGS 30
35#define PTRACE_GETFDPIC 31
36
37#define PTRACE_GETFDPIC_EXEC 0
38#define PTRACE_GETFDPIC_INTERP 1
39
40/*
41 * PSR bits
42 * Note on V7M there is no mode contained in the PSR
43 */
44#define USR26_MODE 0x00000000
45#define FIQ26_MODE 0x00000001
46#define IRQ26_MODE 0x00000002
47#define SVC26_MODE 0x00000003
48#define USR_MODE 0x00000010
49#define SVC_MODE 0x00000013
50#define FIQ_MODE 0x00000011
51#define IRQ_MODE 0x00000012
52#define MON_MODE 0x00000016
53#define ABT_MODE 0x00000017
54#define HYP_MODE 0x0000001a
55#define UND_MODE 0x0000001b
56#define SYSTEM_MODE 0x0000001f
57#define MODE32_BIT 0x00000010
58#define MODE_MASK 0x0000001f
59
60#define V4_PSR_T_BIT 0x00000020 /* >= V4T, but not V7M */
61#define V7M_PSR_T_BIT 0x01000000
62/* for compatibility */
63#define PSR_T_BIT V4_PSR_T_BIT
64
65#define PSR_F_BIT 0x00000040 /* >= V4, but not V7M */
66#define PSR_I_BIT 0x00000080 /* >= V4, but not V7M */
67#define PSR_A_BIT 0x00000100 /* >= V6, but not V7M */
68#define PSR_E_BIT 0x00000200 /* >= V6, but not V7M */
69#define PSR_J_BIT 0x01000000 /* >= V5J, but not V7M */
70#define PSR_Q_BIT 0x08000000 /* >= V5E, including V7M */
71#define PSR_V_BIT 0x10000000
72#define PSR_C_BIT 0x20000000
73#define PSR_Z_BIT 0x40000000
74#define PSR_N_BIT 0x80000000
75
76/*
77 * Groups of PSR bits
78 */
79#define PSR_f 0xff000000 /* Flags */
80#define PSR_s 0x00ff0000 /* Status */
81#define PSR_x 0x0000ff00 /* Extension */
82#define PSR_c 0x000000ff /* Control */
83
84/*
85 * ARMv7 groups of PSR bits
86 */
87#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
88#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
89#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
90#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
91
92/*
93 * Default endianness state
94 */
95#ifdef CONFIG_CPU_ENDIAN_BE8
96#define PSR_ENDSTATE PSR_E_BIT
97#else
98#define PSR_ENDSTATE 0
99#endif
100
101/*
102 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
103 * process is located in memory.
104 */
105#define PT_TEXT_ADDR 0x10000
106#define PT_DATA_ADDR 0x10004
107#define PT_TEXT_END_ADDR 0x10008
108
109#ifndef __ASSEMBLY__
110
111/*
112 * This struct defines the way the registers are stored on the
113 * stack during a system call. Note that sizeof(struct pt_regs)
114 * has to be a multiple of 8.
115 */
116struct pt_regs {
117 long uregs[18];
118};
119
120#define ARM_cpsr uregs[16]
121#define ARM_pc uregs[15]
122#define ARM_lr uregs[14]
123#define ARM_sp uregs[13]
124#define ARM_ip uregs[12]
125#define ARM_fp uregs[11]
126#define ARM_r10 uregs[10]
127#define ARM_r9 uregs[9]
128#define ARM_r8 uregs[8]
129#define ARM_r7 uregs[7]
130#define ARM_r6 uregs[6]
131#define ARM_r5 uregs[5]
132#define ARM_r4 uregs[4]
133#define ARM_r3 uregs[3]
134#define ARM_r2 uregs[2]
135#define ARM_r1 uregs[1]
136#define ARM_r0 uregs[0]
137#define ARM_ORIG_r0 uregs[17]
138
139/*
140 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
141 * and core dumps.
142 */
143#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
144
145
146#endif /* __ASSEMBLY__ */
147
148#endif /* __ASM_ARM_PTRACE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/reg.h deleted-207
...@@ -1,207 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Various register offset definitions for debuggers, core file
4 * examiners and whatnot.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995, 1999 Ralf Baechle
11 * Copyright (C) 1995, 1999 Silicon Graphics
12 */
13#ifndef __UAPI_ASM_MIPS_REG_H
14#define __UAPI_ASM_MIPS_REG_H
15
16#define MIPS32_EF_R0 6
17#define MIPS32_EF_R1 7
18#define MIPS32_EF_R2 8
19#define MIPS32_EF_R3 9
20#define MIPS32_EF_R4 10
21#define MIPS32_EF_R5 11
22#define MIPS32_EF_R6 12
23#define MIPS32_EF_R7 13
24#define MIPS32_EF_R8 14
25#define MIPS32_EF_R9 15
26#define MIPS32_EF_R10 16
27#define MIPS32_EF_R11 17
28#define MIPS32_EF_R12 18
29#define MIPS32_EF_R13 19
30#define MIPS32_EF_R14 20
31#define MIPS32_EF_R15 21
32#define MIPS32_EF_R16 22
33#define MIPS32_EF_R17 23
34#define MIPS32_EF_R18 24
35#define MIPS32_EF_R19 25
36#define MIPS32_EF_R20 26
37#define MIPS32_EF_R21 27
38#define MIPS32_EF_R22 28
39#define MIPS32_EF_R23 29
40#define MIPS32_EF_R24 30
41#define MIPS32_EF_R25 31
42
43/*
44 * k0/k1 unsaved
45 */
46#define MIPS32_EF_R26 32
47#define MIPS32_EF_R27 33
48
49#define MIPS32_EF_R28 34
50#define MIPS32_EF_R29 35
51#define MIPS32_EF_R30 36
52#define MIPS32_EF_R31 37
53
54/*
55 * Saved special registers
56 */
57#define MIPS32_EF_LO 38
58#define MIPS32_EF_HI 39
59
60#define MIPS32_EF_CP0_EPC 40
61#define MIPS32_EF_CP0_BADVADDR 41
62#define MIPS32_EF_CP0_STATUS 42
63#define MIPS32_EF_CP0_CAUSE 43
64#define MIPS32_EF_UNUSED0 44
65
66#define MIPS32_EF_SIZE 180
67
68#define MIPS64_EF_R0 0
69#define MIPS64_EF_R1 1
70#define MIPS64_EF_R2 2
71#define MIPS64_EF_R3 3
72#define MIPS64_EF_R4 4
73#define MIPS64_EF_R5 5
74#define MIPS64_EF_R6 6
75#define MIPS64_EF_R7 7
76#define MIPS64_EF_R8 8
77#define MIPS64_EF_R9 9
78#define MIPS64_EF_R10 10
79#define MIPS64_EF_R11 11
80#define MIPS64_EF_R12 12
81#define MIPS64_EF_R13 13
82#define MIPS64_EF_R14 14
83#define MIPS64_EF_R15 15
84#define MIPS64_EF_R16 16
85#define MIPS64_EF_R17 17
86#define MIPS64_EF_R18 18
87#define MIPS64_EF_R19 19
88#define MIPS64_EF_R20 20
89#define MIPS64_EF_R21 21
90#define MIPS64_EF_R22 22
91#define MIPS64_EF_R23 23
92#define MIPS64_EF_R24 24
93#define MIPS64_EF_R25 25
94
95/*
96 * k0/k1 unsaved
97 */
98#define MIPS64_EF_R26 26
99#define MIPS64_EF_R27 27
100
101
102#define MIPS64_EF_R28 28
103#define MIPS64_EF_R29 29
104#define MIPS64_EF_R30 30
105#define MIPS64_EF_R31 31
106
107/*
108 * Saved special registers
109 */
110#define MIPS64_EF_LO 32
111#define MIPS64_EF_HI 33
112
113#define MIPS64_EF_CP0_EPC 34
114#define MIPS64_EF_CP0_BADVADDR 35
115#define MIPS64_EF_CP0_STATUS 36
116#define MIPS64_EF_CP0_CAUSE 37
117
118#define MIPS64_EF_SIZE 304 /* size in bytes */
119
120#if _MIPS_SIM == _MIPS_SIM_ABI32
121
122#define EF_R0 MIPS32_EF_R0
123#define EF_R1 MIPS32_EF_R1
124#define EF_R2 MIPS32_EF_R2
125#define EF_R3 MIPS32_EF_R3
126#define EF_R4 MIPS32_EF_R4
127#define EF_R5 MIPS32_EF_R5
128#define EF_R6 MIPS32_EF_R6
129#define EF_R7 MIPS32_EF_R7
130#define EF_R8 MIPS32_EF_R8
131#define EF_R9 MIPS32_EF_R9
132#define EF_R10 MIPS32_EF_R10
133#define EF_R11 MIPS32_EF_R11
134#define EF_R12 MIPS32_EF_R12
135#define EF_R13 MIPS32_EF_R13
136#define EF_R14 MIPS32_EF_R14
137#define EF_R15 MIPS32_EF_R15
138#define EF_R16 MIPS32_EF_R16
139#define EF_R17 MIPS32_EF_R17
140#define EF_R18 MIPS32_EF_R18
141#define EF_R19 MIPS32_EF_R19
142#define EF_R20 MIPS32_EF_R20
143#define EF_R21 MIPS32_EF_R21
144#define EF_R22 MIPS32_EF_R22
145#define EF_R23 MIPS32_EF_R23
146#define EF_R24 MIPS32_EF_R24
147#define EF_R25 MIPS32_EF_R25
148#define EF_R26 MIPS32_EF_R26
149#define EF_R27 MIPS32_EF_R27
150#define EF_R28 MIPS32_EF_R28
151#define EF_R29 MIPS32_EF_R29
152#define EF_R30 MIPS32_EF_R30
153#define EF_R31 MIPS32_EF_R31
154#define EF_LO MIPS32_EF_LO
155#define EF_HI MIPS32_EF_HI
156#define EF_CP0_EPC MIPS32_EF_CP0_EPC
157#define EF_CP0_BADVADDR MIPS32_EF_CP0_BADVADDR
158#define EF_CP0_STATUS MIPS32_EF_CP0_STATUS
159#define EF_CP0_CAUSE MIPS32_EF_CP0_CAUSE
160#define EF_UNUSED0 MIPS32_EF_UNUSED0
161#define EF_SIZE MIPS32_EF_SIZE
162
163#elif _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
164
165#define EF_R0 MIPS64_EF_R0
166#define EF_R1 MIPS64_EF_R1
167#define EF_R2 MIPS64_EF_R2
168#define EF_R3 MIPS64_EF_R3
169#define EF_R4 MIPS64_EF_R4
170#define EF_R5 MIPS64_EF_R5
171#define EF_R6 MIPS64_EF_R6
172#define EF_R7 MIPS64_EF_R7
173#define EF_R8 MIPS64_EF_R8
174#define EF_R9 MIPS64_EF_R9
175#define EF_R10 MIPS64_EF_R10
176#define EF_R11 MIPS64_EF_R11
177#define EF_R12 MIPS64_EF_R12
178#define EF_R13 MIPS64_EF_R13
179#define EF_R14 MIPS64_EF_R14
180#define EF_R15 MIPS64_EF_R15
181#define EF_R16 MIPS64_EF_R16
182#define EF_R17 MIPS64_EF_R17
183#define EF_R18 MIPS64_EF_R18
184#define EF_R19 MIPS64_EF_R19
185#define EF_R20 MIPS64_EF_R20
186#define EF_R21 MIPS64_EF_R21
187#define EF_R22 MIPS64_EF_R22
188#define EF_R23 MIPS64_EF_R23
189#define EF_R24 MIPS64_EF_R24
190#define EF_R25 MIPS64_EF_R25
191#define EF_R26 MIPS64_EF_R26
192#define EF_R27 MIPS64_EF_R27
193#define EF_R28 MIPS64_EF_R28
194#define EF_R29 MIPS64_EF_R29
195#define EF_R30 MIPS64_EF_R30
196#define EF_R31 MIPS64_EF_R31
197#define EF_LO MIPS64_EF_LO
198#define EF_HI MIPS64_EF_HI
199#define EF_CP0_EPC MIPS64_EF_CP0_EPC
200#define EF_CP0_BADVADDR MIPS64_EF_CP0_BADVADDR
201#define EF_CP0_STATUS MIPS64_EF_CP0_STATUS
202#define EF_CP0_CAUSE MIPS64_EF_CP0_CAUSE
203#define EF_SIZE MIPS64_EF_SIZE
204
205#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
206
207#endif /* __UAPI_ASM_MIPS_REG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/setup.h+1-188
...@@ -1,188 +1 @@...@@ -1,188 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * linux/include/asm/setup.h
4 *
5 * Copyright (C) 1997-1999 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Structure passed to kernel to tell it about the
12 * hardware it's running on. See Documentation/arm/Setup
13 * for more info.
14 */
15#ifndef __ASMARM_SETUP_H
16#define __ASMARM_SETUP_H
17
18#include <linux/types.h>
19
20#define COMMAND_LINE_SIZE 1024
21
22/* The list ends with an ATAG_NONE node. */
23#define ATAG_NONE 0x00000000
24
25struct tag_header {
26 __u32 size;
27 __u32 tag;
28};
29
30/* The list must start with an ATAG_CORE node */
31#define ATAG_CORE 0x54410001
32
33struct tag_core {
34 __u32 flags; /* bit 0 = read-only */
35 __u32 pagesize;
36 __u32 rootdev;
37};
38
39/* it is allowed to have multiple ATAG_MEM nodes */
40#define ATAG_MEM 0x54410002
41
42struct tag_mem32 {
43 __u32 size;
44 __u32 start; /* physical start address */
45};
46
47/* VGA text type displays */
48#define ATAG_VIDEOTEXT 0x54410003
49
50struct tag_videotext {
51 __u8 x;
52 __u8 y;
53 __u16 video_page;
54 __u8 video_mode;
55 __u8 video_cols;
56 __u16 video_ega_bx;
57 __u8 video_lines;
58 __u8 video_isvga;
59 __u16 video_points;
60};
61
62/* describes how the ramdisk will be used in kernel */
63#define ATAG_RAMDISK 0x54410004
64
65struct tag_ramdisk {
66 __u32 flags; /* bit 0 = load, bit 1 = prompt */
67 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
68 __u32 start; /* starting block of floppy-based RAM disk image */
69};
70
71/* describes where the compressed ramdisk image lives (virtual address) */
72/*
73 * this one accidentally used virtual addresses - as such,
74 * it's deprecated.
75 */
76#define ATAG_INITRD 0x54410005
77
78/* describes where the compressed ramdisk image lives (physical address) */
79#define ATAG_INITRD2 0x54420005
80
81struct tag_initrd {
82 __u32 start; /* physical start address */
83 __u32 size; /* size of compressed ramdisk image in bytes */
84};
85
86/* board serial number. "64 bits should be enough for everybody" */
87#define ATAG_SERIAL 0x54410006
88
89struct tag_serialnr {
90 __u32 low;
91 __u32 high;
92};
93
94/* board revision */
95#define ATAG_REVISION 0x54410007
96
97struct tag_revision {
98 __u32 rev;
99};
100
101/* initial values for vesafb-type framebuffers. see struct screen_info
102 * in include/linux/tty.h
103 */
104#define ATAG_VIDEOLFB 0x54410008
105
106struct tag_videolfb {
107 __u16 lfb_width;
108 __u16 lfb_height;
109 __u16 lfb_depth;
110 __u16 lfb_linelength;
111 __u32 lfb_base;
112 __u32 lfb_size;
113 __u8 red_size;
114 __u8 red_pos;
115 __u8 green_size;
116 __u8 green_pos;
117 __u8 blue_size;
118 __u8 blue_pos;
119 __u8 rsvd_size;
120 __u8 rsvd_pos;
121};
122
123/* command line: \0 terminated string */
124#define ATAG_CMDLINE 0x54410009
125
126struct tag_cmdline {
127 char cmdline[1]; /* this is the minimum size */
128};
129
130/* acorn RiscPC specific information */
131#define ATAG_ACORN 0x41000101
132
133struct tag_acorn {
134 __u32 memc_control_reg;
135 __u32 vram_pages;
136 __u8 sounddefault;
137 __u8 adfsdrives;
138};
139
140/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
141#define ATAG_MEMCLK 0x41000402
142
143struct tag_memclk {
144 __u32 fmemclk;
145};
146
147struct tag {
148 struct tag_header hdr;
149 union {
150 struct tag_core core;
151 struct tag_mem32 mem;
152 struct tag_videotext videotext;
153 struct tag_ramdisk ramdisk;
154 struct tag_initrd initrd;
155 struct tag_serialnr serialnr;
156 struct tag_revision revision;
157 struct tag_videolfb videolfb;
158 struct tag_cmdline cmdline;
159
160 /*
161 * Acorn specific
162 */
163 struct tag_acorn acorn;
164
165 /*
166 * DC21285 specific
167 */
168 struct tag_memclk memclk;
169 } u;
170};
171
172struct tagtable {
173 __u32 tag;
174 int (*parse)(const struct tag *);
175};
176
177#define tag_member_present(tag,member) \
178 ((unsigned long)(&((struct tag *)0L)->member + 1) \
179 <= (tag)->hdr.size * 4)
180
181#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
182#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
183
184#define for_each_tag(t,base) \
185 for (t = base; t->hdr.size; t = tag_next(t))
186
187
188#endif /* __ASMARM_SETUP_H */
\ No newline at end of file
1#include <asm-generic/setup.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/sgidefs.h deleted-45
...@@ -1,45 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 1999, 2001 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
11#ifndef __ASM_SGIDEFS_H
12#define __ASM_SGIDEFS_H
13
14/*
15 * Using a Linux compiler for building Linux seems logic but not to
16 * everybody.
17 */
18#ifndef __linux__
19#error Use a Linux compiler or give up.
20#endif
21
22/*
23 * Definitions for the ISA levels
24 *
25 * With the introduction of MIPS32 / MIPS64 instruction sets definitions
26 * MIPS ISAs are no longer subsets of each other. Therefore comparisons
27 * on these symbols except with == may result in unexpected results and
28 * are forbidden!
29 */
30#define _MIPS_ISA_MIPS1 1
31#define _MIPS_ISA_MIPS2 2
32#define _MIPS_ISA_MIPS3 3
33#define _MIPS_ISA_MIPS4 4
34#define _MIPS_ISA_MIPS5 5
35#define _MIPS_ISA_MIPS32 6
36#define _MIPS_ISA_MIPS64 7
37
38/*
39 * Subprogram calling convention
40 */
41#define _MIPS_SIM_ABI32 1
42#define _MIPS_SIM_NABI32 2
43#define _MIPS_SIM_ABI64 3
44
45#endif /* __ASM_SGIDEFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/sigcontext.h deleted-35
...@@ -1,35 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_SIGCONTEXT_H
3#define _ASMARM_SIGCONTEXT_H
4
5/*
6 * Signal context structure - contains all info to do with the state
7 * before the signal handler was invoked. Note: only add new entries
8 * to the end of the structure.
9 */
10struct sigcontext {
11 unsigned long trap_no;
12 unsigned long error_code;
13 unsigned long oldmask;
14 unsigned long arm_r0;
15 unsigned long arm_r1;
16 unsigned long arm_r2;
17 unsigned long arm_r3;
18 unsigned long arm_r4;
19 unsigned long arm_r5;
20 unsigned long arm_r6;
21 unsigned long arm_r7;
22 unsigned long arm_r8;
23 unsigned long arm_r9;
24 unsigned long arm_r10;
25 unsigned long arm_fp;
26 unsigned long arm_ip;
27 unsigned long arm_sp;
28 unsigned long arm_lr;
29 unsigned long arm_pc;
30 unsigned long arm_cpsr;
31 unsigned long fault_address;
32};
33
34
35#endif
\ No newline at end of file
lib/libc/include/any-linux-any/asm/sigcontext32.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_SIGCONTEXT32_H
3#define _ASM_X86_SIGCONTEXT32_H
4
5/* This is a legacy file - all the type definitions are in sigcontext.h: */
6
7#include <asm/sigcontext.h>
8
9#endif /* _ASM_X86_SIGCONTEXT32_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/signal.h+1-117
...@@ -1,117 +1 @@...@@ -1,117 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_SIGNAL_H
3#define _ASMARM_SIGNAL_H
4
5#include <linux/types.h>
6
7/* Avoid too many header ordering problems. */
8struct siginfo;
9
10/* Here we must cater to libcs that poke about in kernel headers. */
11
12#define NSIG 32
13typedef unsigned long sigset_t;
14
15
16#define SIGHUP 1
17#define SIGINT 2
18#define SIGQUIT 3
19#define SIGILL 4
20#define SIGTRAP 5
21#define SIGABRT 6
22#define SIGIOT 6
23#define SIGBUS 7
24#define SIGFPE 8
25#define SIGKILL 9
26#define SIGUSR1 10
27#define SIGSEGV 11
28#define SIGUSR2 12
29#define SIGPIPE 13
30#define SIGALRM 14
31#define SIGTERM 15
32#define SIGSTKFLT 16
33#define SIGCHLD 17
34#define SIGCONT 18
35#define SIGSTOP 19
36#define SIGTSTP 20
37#define SIGTTIN 21
38#define SIGTTOU 22
39#define SIGURG 23
40#define SIGXCPU 24
41#define SIGXFSZ 25
42#define SIGVTALRM 26
43#define SIGPROF 27
44#define SIGWINCH 28
45#define SIGIO 29
46#define SIGPOLL SIGIO
47/*
48#define SIGLOST 29
49*/
50#define SIGPWR 30
51#define SIGSYS 31
52#define SIGUNUSED 31
53
54/* These should not be considered constants from userland. */
55#define SIGRTMIN 32
56#define SIGRTMAX _NSIG
57
58#define SIGSWI 32
59
60/*
61 * SA_FLAGS values:
62 *
63 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
64 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
65 * SA_SIGINFO deliver the signal with SIGINFO structs
66 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
67 * is running in 26-bit.
68 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
69 * SA_RESTART flag to get restarting signals (which were the default long ago)
70 * SA_NODEFER prevents the current signal from being masked in the handler.
71 * SA_RESETHAND clears the handler when the signal is delivered.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001
77#define SA_NOCLDWAIT 0x00000002
78#define SA_SIGINFO 0x00000004
79#define SA_THIRTYTWO 0x02000000
80#define SA_RESTORER 0x04000000
81#define SA_ONSTACK 0x08000000
82#define SA_RESTART 0x10000000
83#define SA_NODEFER 0x40000000
84#define SA_RESETHAND 0x80000000
85
86#define SA_NOMASK SA_NODEFER
87#define SA_ONESHOT SA_RESETHAND
88
89#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192
91
92#include <asm-generic/signal-defs.h>
93
94/* Here we must cater to libcs that poke about in kernel headers. */
95
96struct sigaction {
97 union {
98 __sighandler_t _sa_handler;
99 void (*_sa_sigaction)(int, struct siginfo *, void *);
100 } _u;
101 sigset_t sa_mask;
102 unsigned long sa_flags;
103 void (*sa_restorer)(void);
104};
105
106#define sa_handler _u._sa_handler
107#define sa_sigaction _u._sa_sigaction
108
109
110typedef struct sigaltstack {
111 void *ss_sp;
112 int ss_flags;
113 size_t ss_size;
114} stack_t;
115
116
117#endif /* _ASMARM_SIGNAL_H */
\ No newline at end of file
1#include <asm-generic/signal.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/spu_info.h deleted-52
...@@ -1,52 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * SPU info structures
4 *
5 * (C) Copyright 2006 IBM Corp.
6 *
7 * Author: Dwayne Grant McConnell <decimal@us.ibm.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#ifndef _SPU_INFO_H
25#define _SPU_INFO_H
26
27#include <linux/types.h>
28
29struct mfc_cq_sr {
30 __u64 mfc_cq_data0_RW;
31 __u64 mfc_cq_data1_RW;
32 __u64 mfc_cq_data2_RW;
33 __u64 mfc_cq_data3_RW;
34};
35
36struct spu_dma_info {
37 __u64 dma_info_type;
38 __u64 dma_info_mask;
39 __u64 dma_info_status;
40 __u64 dma_info_stall_and_notify;
41 __u64 dma_info_atomic_command_status;
42 struct mfc_cq_sr dma_info_command_data[16];
43};
44
45struct spu_proxydma_info {
46 __u64 proxydma_info_type;
47 __u64 proxydma_info_mask;
48 __u64 proxydma_info_status;
49 struct mfc_cq_sr proxydma_info_command_data[8];
50};
51
52#endif /* _SPU_INFO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/stat.h+1-88
...@@ -1,88 +1 @@...@@ -1,88 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_STAT_H
3#define _ASMARM_STAT_H
4
5struct __old_kernel_stat {
6 unsigned short st_dev;
7 unsigned short st_ino;
8 unsigned short st_mode;
9 unsigned short st_nlink;
10 unsigned short st_uid;
11 unsigned short st_gid;
12 unsigned short st_rdev;
13 unsigned long st_size;
14 unsigned long st_atime;
15 unsigned long st_mtime;
16 unsigned long st_ctime;
17};
18
19#define STAT_HAVE_NSEC
20
21struct stat {
22#if defined(__ARMEB__)
23 unsigned short st_dev;
24 unsigned short __pad1;
25#else
26 unsigned long st_dev;
27#endif
28 unsigned long st_ino;
29 unsigned short st_mode;
30 unsigned short st_nlink;
31 unsigned short st_uid;
32 unsigned short st_gid;
33#if defined(__ARMEB__)
34 unsigned short st_rdev;
35 unsigned short __pad2;
36#else
37 unsigned long st_rdev;
38#endif
39 unsigned long st_size;
40 unsigned long st_blksize;
41 unsigned long st_blocks;
42 unsigned long st_atime;
43 unsigned long st_atime_nsec;
44 unsigned long st_mtime;
45 unsigned long st_mtime_nsec;
46 unsigned long st_ctime;
47 unsigned long st_ctime_nsec;
48 unsigned long __unused4;
49 unsigned long __unused5;
50};
51
52/* This matches struct stat64 in glibc2.1, hence the absolutely
53 * insane amounts of padding around dev_t's.
54 * Note: The kernel zero's the padded region because glibc might read them
55 * in the hope that the kernel has stretched to using larger sizes.
56 */
57struct stat64 {
58 unsigned long long st_dev;
59 unsigned char __pad0[4];
60
61#define STAT64_HAS_BROKEN_ST_INO 1
62 unsigned long __st_ino;
63 unsigned int st_mode;
64 unsigned int st_nlink;
65
66 unsigned long st_uid;
67 unsigned long st_gid;
68
69 unsigned long long st_rdev;
70 unsigned char __pad3[4];
71
72 long long st_size;
73 unsigned long st_blksize;
74 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
75
76 unsigned long st_atime;
77 unsigned long st_atime_nsec;
78
79 unsigned long st_mtime;
80 unsigned long st_mtime_nsec;
81
82 unsigned long st_ctime;
83 unsigned long st_ctime_nsec;
84
85 unsigned long long st_ino;
86};
87
88#endif
\ No newline at end of file
1#include <asm-generic/stat.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/svm.h deleted-179
...@@ -1,179 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SVM_H
3#define __SVM_H
4
5#define SVM_EXIT_READ_CR0 0x000
6#define SVM_EXIT_READ_CR2 0x002
7#define SVM_EXIT_READ_CR3 0x003
8#define SVM_EXIT_READ_CR4 0x004
9#define SVM_EXIT_READ_CR8 0x008
10#define SVM_EXIT_WRITE_CR0 0x010
11#define SVM_EXIT_WRITE_CR2 0x012
12#define SVM_EXIT_WRITE_CR3 0x013
13#define SVM_EXIT_WRITE_CR4 0x014
14#define SVM_EXIT_WRITE_CR8 0x018
15#define SVM_EXIT_READ_DR0 0x020
16#define SVM_EXIT_READ_DR1 0x021
17#define SVM_EXIT_READ_DR2 0x022
18#define SVM_EXIT_READ_DR3 0x023
19#define SVM_EXIT_READ_DR4 0x024
20#define SVM_EXIT_READ_DR5 0x025
21#define SVM_EXIT_READ_DR6 0x026
22#define SVM_EXIT_READ_DR7 0x027
23#define SVM_EXIT_WRITE_DR0 0x030
24#define SVM_EXIT_WRITE_DR1 0x031
25#define SVM_EXIT_WRITE_DR2 0x032
26#define SVM_EXIT_WRITE_DR3 0x033
27#define SVM_EXIT_WRITE_DR4 0x034
28#define SVM_EXIT_WRITE_DR5 0x035
29#define SVM_EXIT_WRITE_DR6 0x036
30#define SVM_EXIT_WRITE_DR7 0x037
31#define SVM_EXIT_EXCP_BASE 0x040
32#define SVM_EXIT_INTR 0x060
33#define SVM_EXIT_NMI 0x061
34#define SVM_EXIT_SMI 0x062
35#define SVM_EXIT_INIT 0x063
36#define SVM_EXIT_VINTR 0x064
37#define SVM_EXIT_CR0_SEL_WRITE 0x065
38#define SVM_EXIT_IDTR_READ 0x066
39#define SVM_EXIT_GDTR_READ 0x067
40#define SVM_EXIT_LDTR_READ 0x068
41#define SVM_EXIT_TR_READ 0x069
42#define SVM_EXIT_IDTR_WRITE 0x06a
43#define SVM_EXIT_GDTR_WRITE 0x06b
44#define SVM_EXIT_LDTR_WRITE 0x06c
45#define SVM_EXIT_TR_WRITE 0x06d
46#define SVM_EXIT_RDTSC 0x06e
47#define SVM_EXIT_RDPMC 0x06f
48#define SVM_EXIT_PUSHF 0x070
49#define SVM_EXIT_POPF 0x071
50#define SVM_EXIT_CPUID 0x072
51#define SVM_EXIT_RSM 0x073
52#define SVM_EXIT_IRET 0x074
53#define SVM_EXIT_SWINT 0x075
54#define SVM_EXIT_INVD 0x076
55#define SVM_EXIT_PAUSE 0x077
56#define SVM_EXIT_HLT 0x078
57#define SVM_EXIT_INVLPG 0x079
58#define SVM_EXIT_INVLPGA 0x07a
59#define SVM_EXIT_IOIO 0x07b
60#define SVM_EXIT_MSR 0x07c
61#define SVM_EXIT_TASK_SWITCH 0x07d
62#define SVM_EXIT_FERR_FREEZE 0x07e
63#define SVM_EXIT_SHUTDOWN 0x07f
64#define SVM_EXIT_VMRUN 0x080
65#define SVM_EXIT_VMMCALL 0x081
66#define SVM_EXIT_VMLOAD 0x082
67#define SVM_EXIT_VMSAVE 0x083
68#define SVM_EXIT_STGI 0x084
69#define SVM_EXIT_CLGI 0x085
70#define SVM_EXIT_SKINIT 0x086
71#define SVM_EXIT_RDTSCP 0x087
72#define SVM_EXIT_ICEBP 0x088
73#define SVM_EXIT_WBINVD 0x089
74#define SVM_EXIT_MONITOR 0x08a
75#define SVM_EXIT_MWAIT 0x08b
76#define SVM_EXIT_MWAIT_COND 0x08c
77#define SVM_EXIT_XSETBV 0x08d
78#define SVM_EXIT_NPF 0x400
79#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
80#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
81
82#define SVM_EXIT_ERR -1
83
84#define SVM_EXIT_REASONS \
85 { SVM_EXIT_READ_CR0, "read_cr0" }, \
86 { SVM_EXIT_READ_CR2, "read_cr2" }, \
87 { SVM_EXIT_READ_CR3, "read_cr3" }, \
88 { SVM_EXIT_READ_CR4, "read_cr4" }, \
89 { SVM_EXIT_READ_CR8, "read_cr8" }, \
90 { SVM_EXIT_WRITE_CR0, "write_cr0" }, \
91 { SVM_EXIT_WRITE_CR2, "write_cr2" }, \
92 { SVM_EXIT_WRITE_CR3, "write_cr3" }, \
93 { SVM_EXIT_WRITE_CR4, "write_cr4" }, \
94 { SVM_EXIT_WRITE_CR8, "write_cr8" }, \
95 { SVM_EXIT_READ_DR0, "read_dr0" }, \
96 { SVM_EXIT_READ_DR1, "read_dr1" }, \
97 { SVM_EXIT_READ_DR2, "read_dr2" }, \
98 { SVM_EXIT_READ_DR3, "read_dr3" }, \
99 { SVM_EXIT_READ_DR4, "read_dr4" }, \
100 { SVM_EXIT_READ_DR5, "read_dr5" }, \
101 { SVM_EXIT_READ_DR6, "read_dr6" }, \
102 { SVM_EXIT_READ_DR7, "read_dr7" }, \
103 { SVM_EXIT_WRITE_DR0, "write_dr0" }, \
104 { SVM_EXIT_WRITE_DR1, "write_dr1" }, \
105 { SVM_EXIT_WRITE_DR2, "write_dr2" }, \
106 { SVM_EXIT_WRITE_DR3, "write_dr3" }, \
107 { SVM_EXIT_WRITE_DR4, "write_dr4" }, \
108 { SVM_EXIT_WRITE_DR5, "write_dr5" }, \
109 { SVM_EXIT_WRITE_DR6, "write_dr6" }, \
110 { SVM_EXIT_WRITE_DR7, "write_dr7" }, \
111 { SVM_EXIT_EXCP_BASE + DE_VECTOR, "DE excp" }, \
112 { SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" }, \
113 { SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" }, \
114 { SVM_EXIT_EXCP_BASE + OF_VECTOR, "OF excp" }, \
115 { SVM_EXIT_EXCP_BASE + BR_VECTOR, "BR excp" }, \
116 { SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" }, \
117 { SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" }, \
118 { SVM_EXIT_EXCP_BASE + DF_VECTOR, "DF excp" }, \
119 { SVM_EXIT_EXCP_BASE + TS_VECTOR, "TS excp" }, \
120 { SVM_EXIT_EXCP_BASE + NP_VECTOR, "NP excp" }, \
121 { SVM_EXIT_EXCP_BASE + SS_VECTOR, "SS excp" }, \
122 { SVM_EXIT_EXCP_BASE + GP_VECTOR, "GP excp" }, \
123 { SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" }, \
124 { SVM_EXIT_EXCP_BASE + MF_VECTOR, "MF excp" }, \
125 { SVM_EXIT_EXCP_BASE + AC_VECTOR, "AC excp" }, \
126 { SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" }, \
127 { SVM_EXIT_EXCP_BASE + XM_VECTOR, "XF excp" }, \
128 { SVM_EXIT_INTR, "interrupt" }, \
129 { SVM_EXIT_NMI, "nmi" }, \
130 { SVM_EXIT_SMI, "smi" }, \
131 { SVM_EXIT_INIT, "init" }, \
132 { SVM_EXIT_VINTR, "vintr" }, \
133 { SVM_EXIT_CR0_SEL_WRITE, "cr0_sel_write" }, \
134 { SVM_EXIT_IDTR_READ, "read_idtr" }, \
135 { SVM_EXIT_GDTR_READ, "read_gdtr" }, \
136 { SVM_EXIT_LDTR_READ, "read_ldtr" }, \
137 { SVM_EXIT_TR_READ, "read_rt" }, \
138 { SVM_EXIT_IDTR_WRITE, "write_idtr" }, \
139 { SVM_EXIT_GDTR_WRITE, "write_gdtr" }, \
140 { SVM_EXIT_LDTR_WRITE, "write_ldtr" }, \
141 { SVM_EXIT_TR_WRITE, "write_rt" }, \
142 { SVM_EXIT_RDTSC, "rdtsc" }, \
143 { SVM_EXIT_RDPMC, "rdpmc" }, \
144 { SVM_EXIT_PUSHF, "pushf" }, \
145 { SVM_EXIT_POPF, "popf" }, \
146 { SVM_EXIT_CPUID, "cpuid" }, \
147 { SVM_EXIT_RSM, "rsm" }, \
148 { SVM_EXIT_IRET, "iret" }, \
149 { SVM_EXIT_SWINT, "swint" }, \
150 { SVM_EXIT_INVD, "invd" }, \
151 { SVM_EXIT_PAUSE, "pause" }, \
152 { SVM_EXIT_HLT, "hlt" }, \
153 { SVM_EXIT_INVLPG, "invlpg" }, \
154 { SVM_EXIT_INVLPGA, "invlpga" }, \
155 { SVM_EXIT_IOIO, "io" }, \
156 { SVM_EXIT_MSR, "msr" }, \
157 { SVM_EXIT_TASK_SWITCH, "task_switch" }, \
158 { SVM_EXIT_FERR_FREEZE, "ferr_freeze" }, \
159 { SVM_EXIT_SHUTDOWN, "shutdown" }, \
160 { SVM_EXIT_VMRUN, "vmrun" }, \
161 { SVM_EXIT_VMMCALL, "hypercall" }, \
162 { SVM_EXIT_VMLOAD, "vmload" }, \
163 { SVM_EXIT_VMSAVE, "vmsave" }, \
164 { SVM_EXIT_STGI, "stgi" }, \
165 { SVM_EXIT_CLGI, "clgi" }, \
166 { SVM_EXIT_SKINIT, "skinit" }, \
167 { SVM_EXIT_RDTSCP, "rdtscp" }, \
168 { SVM_EXIT_ICEBP, "icebp" }, \
169 { SVM_EXIT_WBINVD, "wbinvd" }, \
170 { SVM_EXIT_MONITOR, "monitor" }, \
171 { SVM_EXIT_MWAIT, "mwait" }, \
172 { SVM_EXIT_XSETBV, "xsetbv" }, \
173 { SVM_EXIT_NPF, "npf" }, \
174 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
175 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \
176 { SVM_EXIT_ERR, "invalid_guest_state" }
177
178
179#endif /* __SVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/syscalls.h deleted-29
...@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2017-2018 SiFive
4 */
5
6/*
7 * There is explicitly no include guard here because this file is expected to
8 * be included multiple times in order to define the syscall macros via
9 * __SYSCALL.
10 */
11
12/*
13 * Allows the instruction cache to be flushed from userspace. Despite RISC-V
14 * having a direct 'fence.i' instruction available to userspace (which we
15 * can't trap!), that's not actually viable when running on Linux because the
16 * kernel might schedule a process on another hart. There is no way for
17 * userspace to handle this without invoking the kernel (as it doesn't know the
18 * thread->hart mappings), so we've defined a RISC-V specific system call to
19 * flush the instruction cache.
20 *
21 * __NR_riscv_flush_icache is defined to flush the instruction cache over an
22 * address range, with the flush applying to either all threads or just the
23 * caller. We don't currently do anything with the address range, that's just
24 * in there for forwards compatibility.
25 */
26#ifndef __NR_riscv_flush_icache
27#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
28#endif
29__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
\ No newline at end of file
lib/libc/include/any-linux-any/asm/sysmips.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Definitions for the MIPS sysmips(2) call
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995 by Ralf Baechle
10 */
11#ifndef _ASM_SYSMIPS_H
12#define _ASM_SYSMIPS_H
13
14/*
15 * Commands for the sysmips(2) call
16 *
17 * sysmips(2) is deprecated - though some existing software uses it.
18 * We only support the following commands.
19 */
20#define SETNAME 1 /* set hostname */
21#define FLUSH_CACHE 3 /* writeback and invalidate caches */
22#define MIPS_FIXADE 7 /* control address error fixing */
23#define MIPS_RDNVRAM 10 /* read NVRAM */
24#define MIPS_ATOMIC_SET 2001 /* atomically set variable */
25
26#endif /* _ASM_SYSMIPS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/tm.h deleted-21
...@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_TM_H
3#define _ASM_POWERPC_TM_H
4
5/* Reason codes describing kernel causes for transaction aborts. By
6 * convention, bit0 is copied to TEXASR[56] (IBM bit 7) which is set if
7 * the failure is persistent. PAPR saves 0xff-0xe0 for the hypervisor.
8 */
9#define TM_CAUSE_PERSISTENT 0x01
10#define TM_CAUSE_KVM_RESCHED 0xe0 /* From PAPR */
11#define TM_CAUSE_KVM_FAC_UNAV 0xe2 /* From PAPR */
12#define TM_CAUSE_RESCHED 0xde
13#define TM_CAUSE_TLBI 0xdc
14#define TM_CAUSE_FAC_UNAV 0xda
15#define TM_CAUSE_SYSCALL 0xd8
16#define TM_CAUSE_MISC 0xd6 /* future use */
17#define TM_CAUSE_SIGNAL 0xd4
18#define TM_CAUSE_ALIGNMENT 0xd2
19#define TM_CAUSE_EMULATE 0xd0
20
21#endif
\ No newline at end of file
lib/libc/include/any-linux-any/asm/ucontext.h+1-66
...@@ -1,66 +1 @@...@@ -1,66 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __MIPS_UAPI_ASM_UCONTEXT_H
3#define __MIPS_UAPI_ASM_UCONTEXT_H
4
5/**
6 * struct extcontext - extended context header structure
7 * @magic: magic value identifying the type of extended context
8 * @size: the size in bytes of the enclosing structure
9 *
10 * Extended context structures provide context which does not fit within struct
11 * sigcontext. They are placed sequentially in memory at the end of struct
12 * ucontext and struct sigframe, with each extended context structure beginning
13 * with a header defined by this struct. The type of context represented is
14 * indicated by the magic field. Userland may check each extended context
15 * structure against magic values that it recognises. The size field allows any
16 * unrecognised context to be skipped, allowing for future expansion. The end
17 * of the extended context data is indicated by the magic value
18 * END_EXTCONTEXT_MAGIC.
19 */
20struct extcontext {
21 unsigned int magic;
22 unsigned int size;
23};
24
25/**
26 * struct msa_extcontext - MSA extended context structure
27 * @ext: the extended context header, with magic == MSA_EXTCONTEXT_MAGIC
28 * @wr: the most significant 64 bits of each MSA vector register
29 * @csr: the value of the MSA control & status register
30 *
31 * If MSA context is live for a task at the time a signal is delivered to it,
32 * this structure will hold the MSA context of the task as it was prior to the
33 * signal delivery.
34 */
35struct msa_extcontext {
36 struct extcontext ext;
37#define MSA_EXTCONTEXT_MAGIC 0x784d5341 /* xMSA */
38
39 unsigned long long wr[32];
40 unsigned int csr;
41};
42
43#define END_EXTCONTEXT_MAGIC 0x78454e44 /* xEND */
44
45/**
46 * struct ucontext - user context structure
47 * @uc_flags:
48 * @uc_link:
49 * @uc_stack:
50 * @uc_mcontext: holds basic processor state
51 * @uc_sigmask:
52 * @uc_extcontext: holds extended processor state
53 */
54struct ucontext {
55 /* Historic fields matching asm-generic */
56 unsigned long uc_flags;
57 struct ucontext *uc_link;
58 stack_t uc_stack;
59 struct sigcontext uc_mcontext;
60 sigset_t uc_sigmask;
61
62 /* Extended context structures may follow ucontext */
63 unsigned long long uc_extcontext[0];
64};
65
66#endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
\ No newline at end of file
1#include <asm-generic/ucontext.h>
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd-common.h deleted-360
...@@ -1,360 +0,0 @@
1#ifndef _ASM_ARM_UNISTD_COMMON_H
2#define _ASM_ARM_UNISTD_COMMON_H 1
3
4#define __NR_restart_syscall (__NR_SYSCALL_BASE + 0)
5#define __NR_exit (__NR_SYSCALL_BASE + 1)
6#define __NR_fork (__NR_SYSCALL_BASE + 2)
7#define __NR_read (__NR_SYSCALL_BASE + 3)
8#define __NR_write (__NR_SYSCALL_BASE + 4)
9#define __NR_open (__NR_SYSCALL_BASE + 5)
10#define __NR_close (__NR_SYSCALL_BASE + 6)
11#define __NR_creat (__NR_SYSCALL_BASE + 8)
12#define __NR_link (__NR_SYSCALL_BASE + 9)
13#define __NR_unlink (__NR_SYSCALL_BASE + 10)
14#define __NR_execve (__NR_SYSCALL_BASE + 11)
15#define __NR_chdir (__NR_SYSCALL_BASE + 12)
16#define __NR_mknod (__NR_SYSCALL_BASE + 14)
17#define __NR_chmod (__NR_SYSCALL_BASE + 15)
18#define __NR_lchown (__NR_SYSCALL_BASE + 16)
19#define __NR_lseek (__NR_SYSCALL_BASE + 19)
20#define __NR_getpid (__NR_SYSCALL_BASE + 20)
21#define __NR_mount (__NR_SYSCALL_BASE + 21)
22#define __NR_setuid (__NR_SYSCALL_BASE + 23)
23#define __NR_getuid (__NR_SYSCALL_BASE + 24)
24#define __NR_ptrace (__NR_SYSCALL_BASE + 26)
25#define __NR_pause (__NR_SYSCALL_BASE + 29)
26#define __NR_access (__NR_SYSCALL_BASE + 33)
27#define __NR_nice (__NR_SYSCALL_BASE + 34)
28#define __NR_sync (__NR_SYSCALL_BASE + 36)
29#define __NR_kill (__NR_SYSCALL_BASE + 37)
30#define __NR_rename (__NR_SYSCALL_BASE + 38)
31#define __NR_mkdir (__NR_SYSCALL_BASE + 39)
32#define __NR_rmdir (__NR_SYSCALL_BASE + 40)
33#define __NR_dup (__NR_SYSCALL_BASE + 41)
34#define __NR_pipe (__NR_SYSCALL_BASE + 42)
35#define __NR_times (__NR_SYSCALL_BASE + 43)
36#define __NR_brk (__NR_SYSCALL_BASE + 45)
37#define __NR_setgid (__NR_SYSCALL_BASE + 46)
38#define __NR_getgid (__NR_SYSCALL_BASE + 47)
39#define __NR_geteuid (__NR_SYSCALL_BASE + 49)
40#define __NR_getegid (__NR_SYSCALL_BASE + 50)
41#define __NR_acct (__NR_SYSCALL_BASE + 51)
42#define __NR_umount2 (__NR_SYSCALL_BASE + 52)
43#define __NR_ioctl (__NR_SYSCALL_BASE + 54)
44#define __NR_fcntl (__NR_SYSCALL_BASE + 55)
45#define __NR_setpgid (__NR_SYSCALL_BASE + 57)
46#define __NR_umask (__NR_SYSCALL_BASE + 60)
47#define __NR_chroot (__NR_SYSCALL_BASE + 61)
48#define __NR_ustat (__NR_SYSCALL_BASE + 62)
49#define __NR_dup2 (__NR_SYSCALL_BASE + 63)
50#define __NR_getppid (__NR_SYSCALL_BASE + 64)
51#define __NR_getpgrp (__NR_SYSCALL_BASE + 65)
52#define __NR_setsid (__NR_SYSCALL_BASE + 66)
53#define __NR_sigaction (__NR_SYSCALL_BASE + 67)
54#define __NR_setreuid (__NR_SYSCALL_BASE + 70)
55#define __NR_setregid (__NR_SYSCALL_BASE + 71)
56#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
57#define __NR_sigpending (__NR_SYSCALL_BASE + 73)
58#define __NR_sethostname (__NR_SYSCALL_BASE + 74)
59#define __NR_setrlimit (__NR_SYSCALL_BASE + 75)
60#define __NR_getrusage (__NR_SYSCALL_BASE + 77)
61#define __NR_gettimeofday (__NR_SYSCALL_BASE + 78)
62#define __NR_settimeofday (__NR_SYSCALL_BASE + 79)
63#define __NR_getgroups (__NR_SYSCALL_BASE + 80)
64#define __NR_setgroups (__NR_SYSCALL_BASE + 81)
65#define __NR_symlink (__NR_SYSCALL_BASE + 83)
66#define __NR_readlink (__NR_SYSCALL_BASE + 85)
67#define __NR_uselib (__NR_SYSCALL_BASE + 86)
68#define __NR_swapon (__NR_SYSCALL_BASE + 87)
69#define __NR_reboot (__NR_SYSCALL_BASE + 88)
70#define __NR_munmap (__NR_SYSCALL_BASE + 91)
71#define __NR_truncate (__NR_SYSCALL_BASE + 92)
72#define __NR_ftruncate (__NR_SYSCALL_BASE + 93)
73#define __NR_fchmod (__NR_SYSCALL_BASE + 94)
74#define __NR_fchown (__NR_SYSCALL_BASE + 95)
75#define __NR_getpriority (__NR_SYSCALL_BASE + 96)
76#define __NR_setpriority (__NR_SYSCALL_BASE + 97)
77#define __NR_statfs (__NR_SYSCALL_BASE + 99)
78#define __NR_fstatfs (__NR_SYSCALL_BASE + 100)
79#define __NR_syslog (__NR_SYSCALL_BASE + 103)
80#define __NR_setitimer (__NR_SYSCALL_BASE + 104)
81#define __NR_getitimer (__NR_SYSCALL_BASE + 105)
82#define __NR_stat (__NR_SYSCALL_BASE + 106)
83#define __NR_lstat (__NR_SYSCALL_BASE + 107)
84#define __NR_fstat (__NR_SYSCALL_BASE + 108)
85#define __NR_vhangup (__NR_SYSCALL_BASE + 111)
86#define __NR_wait4 (__NR_SYSCALL_BASE + 114)
87#define __NR_swapoff (__NR_SYSCALL_BASE + 115)
88#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
89#define __NR_fsync (__NR_SYSCALL_BASE + 118)
90#define __NR_sigreturn (__NR_SYSCALL_BASE + 119)
91#define __NR_clone (__NR_SYSCALL_BASE + 120)
92#define __NR_setdomainname (__NR_SYSCALL_BASE + 121)
93#define __NR_uname (__NR_SYSCALL_BASE + 122)
94#define __NR_adjtimex (__NR_SYSCALL_BASE + 124)
95#define __NR_mprotect (__NR_SYSCALL_BASE + 125)
96#define __NR_sigprocmask (__NR_SYSCALL_BASE + 126)
97#define __NR_init_module (__NR_SYSCALL_BASE + 128)
98#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
99#define __NR_quotactl (__NR_SYSCALL_BASE + 131)
100#define __NR_getpgid (__NR_SYSCALL_BASE + 132)
101#define __NR_fchdir (__NR_SYSCALL_BASE + 133)
102#define __NR_bdflush (__NR_SYSCALL_BASE + 134)
103#define __NR_sysfs (__NR_SYSCALL_BASE + 135)
104#define __NR_personality (__NR_SYSCALL_BASE + 136)
105#define __NR_setfsuid (__NR_SYSCALL_BASE + 138)
106#define __NR_setfsgid (__NR_SYSCALL_BASE + 139)
107#define __NR__llseek (__NR_SYSCALL_BASE + 140)
108#define __NR_getdents (__NR_SYSCALL_BASE + 141)
109#define __NR__newselect (__NR_SYSCALL_BASE + 142)
110#define __NR_flock (__NR_SYSCALL_BASE + 143)
111#define __NR_msync (__NR_SYSCALL_BASE + 144)
112#define __NR_readv (__NR_SYSCALL_BASE + 145)
113#define __NR_writev (__NR_SYSCALL_BASE + 146)
114#define __NR_getsid (__NR_SYSCALL_BASE + 147)
115#define __NR_fdatasync (__NR_SYSCALL_BASE + 148)
116#define __NR__sysctl (__NR_SYSCALL_BASE + 149)
117#define __NR_mlock (__NR_SYSCALL_BASE + 150)
118#define __NR_munlock (__NR_SYSCALL_BASE + 151)
119#define __NR_mlockall (__NR_SYSCALL_BASE + 152)
120#define __NR_munlockall (__NR_SYSCALL_BASE + 153)
121#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154)
122#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155)
123#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156)
124#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157)
125#define __NR_sched_yield (__NR_SYSCALL_BASE + 158)
126#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159)
127#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160)
128#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161)
129#define __NR_nanosleep (__NR_SYSCALL_BASE + 162)
130#define __NR_mremap (__NR_SYSCALL_BASE + 163)
131#define __NR_setresuid (__NR_SYSCALL_BASE + 164)
132#define __NR_getresuid (__NR_SYSCALL_BASE + 165)
133#define __NR_poll (__NR_SYSCALL_BASE + 168)
134#define __NR_nfsservctl (__NR_SYSCALL_BASE + 169)
135#define __NR_setresgid (__NR_SYSCALL_BASE + 170)
136#define __NR_getresgid (__NR_SYSCALL_BASE + 171)
137#define __NR_prctl (__NR_SYSCALL_BASE + 172)
138#define __NR_rt_sigreturn (__NR_SYSCALL_BASE + 173)
139#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
140#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
141#define __NR_rt_sigpending (__NR_SYSCALL_BASE + 176)
142#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177)
143#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE + 178)
144#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE + 179)
145#define __NR_pread64 (__NR_SYSCALL_BASE + 180)
146#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181)
147#define __NR_chown (__NR_SYSCALL_BASE + 182)
148#define __NR_getcwd (__NR_SYSCALL_BASE + 183)
149#define __NR_capget (__NR_SYSCALL_BASE + 184)
150#define __NR_capset (__NR_SYSCALL_BASE + 185)
151#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186)
152#define __NR_sendfile (__NR_SYSCALL_BASE + 187)
153#define __NR_vfork (__NR_SYSCALL_BASE + 190)
154#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191)
155#define __NR_mmap2 (__NR_SYSCALL_BASE + 192)
156#define __NR_truncate64 (__NR_SYSCALL_BASE + 193)
157#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194)
158#define __NR_stat64 (__NR_SYSCALL_BASE + 195)
159#define __NR_lstat64 (__NR_SYSCALL_BASE + 196)
160#define __NR_fstat64 (__NR_SYSCALL_BASE + 197)
161#define __NR_lchown32 (__NR_SYSCALL_BASE + 198)
162#define __NR_getuid32 (__NR_SYSCALL_BASE + 199)
163#define __NR_getgid32 (__NR_SYSCALL_BASE + 200)
164#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201)
165#define __NR_getegid32 (__NR_SYSCALL_BASE + 202)
166#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203)
167#define __NR_setregid32 (__NR_SYSCALL_BASE + 204)
168#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205)
169#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206)
170#define __NR_fchown32 (__NR_SYSCALL_BASE + 207)
171#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208)
172#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209)
173#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210)
174#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211)
175#define __NR_chown32 (__NR_SYSCALL_BASE + 212)
176#define __NR_setuid32 (__NR_SYSCALL_BASE + 213)
177#define __NR_setgid32 (__NR_SYSCALL_BASE + 214)
178#define __NR_setfsuid32 (__NR_SYSCALL_BASE + 215)
179#define __NR_setfsgid32 (__NR_SYSCALL_BASE + 216)
180#define __NR_getdents64 (__NR_SYSCALL_BASE + 217)
181#define __NR_pivot_root (__NR_SYSCALL_BASE + 218)
182#define __NR_mincore (__NR_SYSCALL_BASE + 219)
183#define __NR_madvise (__NR_SYSCALL_BASE + 220)
184#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221)
185#define __NR_gettid (__NR_SYSCALL_BASE + 224)
186#define __NR_readahead (__NR_SYSCALL_BASE + 225)
187#define __NR_setxattr (__NR_SYSCALL_BASE + 226)
188#define __NR_lsetxattr (__NR_SYSCALL_BASE + 227)
189#define __NR_fsetxattr (__NR_SYSCALL_BASE + 228)
190#define __NR_getxattr (__NR_SYSCALL_BASE + 229)
191#define __NR_lgetxattr (__NR_SYSCALL_BASE + 230)
192#define __NR_fgetxattr (__NR_SYSCALL_BASE + 231)
193#define __NR_listxattr (__NR_SYSCALL_BASE + 232)
194#define __NR_llistxattr (__NR_SYSCALL_BASE + 233)
195#define __NR_flistxattr (__NR_SYSCALL_BASE + 234)
196#define __NR_removexattr (__NR_SYSCALL_BASE + 235)
197#define __NR_lremovexattr (__NR_SYSCALL_BASE + 236)
198#define __NR_fremovexattr (__NR_SYSCALL_BASE + 237)
199#define __NR_tkill (__NR_SYSCALL_BASE + 238)
200#define __NR_sendfile64 (__NR_SYSCALL_BASE + 239)
201#define __NR_futex (__NR_SYSCALL_BASE + 240)
202#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241)
203#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242)
204#define __NR_io_setup (__NR_SYSCALL_BASE + 243)
205#define __NR_io_destroy (__NR_SYSCALL_BASE + 244)
206#define __NR_io_getevents (__NR_SYSCALL_BASE + 245)
207#define __NR_io_submit (__NR_SYSCALL_BASE + 246)
208#define __NR_io_cancel (__NR_SYSCALL_BASE + 247)
209#define __NR_exit_group (__NR_SYSCALL_BASE + 248)
210#define __NR_lookup_dcookie (__NR_SYSCALL_BASE + 249)
211#define __NR_epoll_create (__NR_SYSCALL_BASE + 250)
212#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251)
213#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252)
214#define __NR_remap_file_pages (__NR_SYSCALL_BASE + 253)
215#define __NR_set_tid_address (__NR_SYSCALL_BASE + 256)
216#define __NR_timer_create (__NR_SYSCALL_BASE + 257)
217#define __NR_timer_settime (__NR_SYSCALL_BASE + 258)
218#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259)
219#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260)
220#define __NR_timer_delete (__NR_SYSCALL_BASE + 261)
221#define __NR_clock_settime (__NR_SYSCALL_BASE + 262)
222#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263)
223#define __NR_clock_getres (__NR_SYSCALL_BASE + 264)
224#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265)
225#define __NR_statfs64 (__NR_SYSCALL_BASE + 266)
226#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267)
227#define __NR_tgkill (__NR_SYSCALL_BASE + 268)
228#define __NR_utimes (__NR_SYSCALL_BASE + 269)
229#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE + 270)
230#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE + 271)
231#define __NR_pciconfig_read (__NR_SYSCALL_BASE + 272)
232#define __NR_pciconfig_write (__NR_SYSCALL_BASE + 273)
233#define __NR_mq_open (__NR_SYSCALL_BASE + 274)
234#define __NR_mq_unlink (__NR_SYSCALL_BASE + 275)
235#define __NR_mq_timedsend (__NR_SYSCALL_BASE + 276)
236#define __NR_mq_timedreceive (__NR_SYSCALL_BASE + 277)
237#define __NR_mq_notify (__NR_SYSCALL_BASE + 278)
238#define __NR_mq_getsetattr (__NR_SYSCALL_BASE + 279)
239#define __NR_waitid (__NR_SYSCALL_BASE + 280)
240#define __NR_socket (__NR_SYSCALL_BASE + 281)
241#define __NR_bind (__NR_SYSCALL_BASE + 282)
242#define __NR_connect (__NR_SYSCALL_BASE + 283)
243#define __NR_listen (__NR_SYSCALL_BASE + 284)
244#define __NR_accept (__NR_SYSCALL_BASE + 285)
245#define __NR_getsockname (__NR_SYSCALL_BASE + 286)
246#define __NR_getpeername (__NR_SYSCALL_BASE + 287)
247#define __NR_socketpair (__NR_SYSCALL_BASE + 288)
248#define __NR_send (__NR_SYSCALL_BASE + 289)
249#define __NR_sendto (__NR_SYSCALL_BASE + 290)
250#define __NR_recv (__NR_SYSCALL_BASE + 291)
251#define __NR_recvfrom (__NR_SYSCALL_BASE + 292)
252#define __NR_shutdown (__NR_SYSCALL_BASE + 293)
253#define __NR_setsockopt (__NR_SYSCALL_BASE + 294)
254#define __NR_getsockopt (__NR_SYSCALL_BASE + 295)
255#define __NR_sendmsg (__NR_SYSCALL_BASE + 296)
256#define __NR_recvmsg (__NR_SYSCALL_BASE + 297)
257#define __NR_semop (__NR_SYSCALL_BASE + 298)
258#define __NR_semget (__NR_SYSCALL_BASE + 299)
259#define __NR_semctl (__NR_SYSCALL_BASE + 300)
260#define __NR_msgsnd (__NR_SYSCALL_BASE + 301)
261#define __NR_msgrcv (__NR_SYSCALL_BASE + 302)
262#define __NR_msgget (__NR_SYSCALL_BASE + 303)
263#define __NR_msgctl (__NR_SYSCALL_BASE + 304)
264#define __NR_shmat (__NR_SYSCALL_BASE + 305)
265#define __NR_shmdt (__NR_SYSCALL_BASE + 306)
266#define __NR_shmget (__NR_SYSCALL_BASE + 307)
267#define __NR_shmctl (__NR_SYSCALL_BASE + 308)
268#define __NR_add_key (__NR_SYSCALL_BASE + 309)
269#define __NR_request_key (__NR_SYSCALL_BASE + 310)
270#define __NR_keyctl (__NR_SYSCALL_BASE + 311)
271#define __NR_semtimedop (__NR_SYSCALL_BASE + 312)
272#define __NR_vserver (__NR_SYSCALL_BASE + 313)
273#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
274#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
275#define __NR_inotify_init (__NR_SYSCALL_BASE + 316)
276#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317)
277#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318)
278#define __NR_mbind (__NR_SYSCALL_BASE + 319)
279#define __NR_get_mempolicy (__NR_SYSCALL_BASE + 320)
280#define __NR_set_mempolicy (__NR_SYSCALL_BASE + 321)
281#define __NR_openat (__NR_SYSCALL_BASE + 322)
282#define __NR_mkdirat (__NR_SYSCALL_BASE + 323)
283#define __NR_mknodat (__NR_SYSCALL_BASE + 324)
284#define __NR_fchownat (__NR_SYSCALL_BASE + 325)
285#define __NR_futimesat (__NR_SYSCALL_BASE + 326)
286#define __NR_fstatat64 (__NR_SYSCALL_BASE + 327)
287#define __NR_unlinkat (__NR_SYSCALL_BASE + 328)
288#define __NR_renameat (__NR_SYSCALL_BASE + 329)
289#define __NR_linkat (__NR_SYSCALL_BASE + 330)
290#define __NR_symlinkat (__NR_SYSCALL_BASE + 331)
291#define __NR_readlinkat (__NR_SYSCALL_BASE + 332)
292#define __NR_fchmodat (__NR_SYSCALL_BASE + 333)
293#define __NR_faccessat (__NR_SYSCALL_BASE + 334)
294#define __NR_pselect6 (__NR_SYSCALL_BASE + 335)
295#define __NR_ppoll (__NR_SYSCALL_BASE + 336)
296#define __NR_unshare (__NR_SYSCALL_BASE + 337)
297#define __NR_set_robust_list (__NR_SYSCALL_BASE + 338)
298#define __NR_get_robust_list (__NR_SYSCALL_BASE + 339)
299#define __NR_splice (__NR_SYSCALL_BASE + 340)
300#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE + 341)
301#define __NR_tee (__NR_SYSCALL_BASE + 342)
302#define __NR_vmsplice (__NR_SYSCALL_BASE + 343)
303#define __NR_move_pages (__NR_SYSCALL_BASE + 344)
304#define __NR_getcpu (__NR_SYSCALL_BASE + 345)
305#define __NR_epoll_pwait (__NR_SYSCALL_BASE + 346)
306#define __NR_kexec_load (__NR_SYSCALL_BASE + 347)
307#define __NR_utimensat (__NR_SYSCALL_BASE + 348)
308#define __NR_signalfd (__NR_SYSCALL_BASE + 349)
309#define __NR_timerfd_create (__NR_SYSCALL_BASE + 350)
310#define __NR_eventfd (__NR_SYSCALL_BASE + 351)
311#define __NR_fallocate (__NR_SYSCALL_BASE + 352)
312#define __NR_timerfd_settime (__NR_SYSCALL_BASE + 353)
313#define __NR_timerfd_gettime (__NR_SYSCALL_BASE + 354)
314#define __NR_signalfd4 (__NR_SYSCALL_BASE + 355)
315#define __NR_eventfd2 (__NR_SYSCALL_BASE + 356)
316#define __NR_epoll_create1 (__NR_SYSCALL_BASE + 357)
317#define __NR_dup3 (__NR_SYSCALL_BASE + 358)
318#define __NR_pipe2 (__NR_SYSCALL_BASE + 359)
319#define __NR_inotify_init1 (__NR_SYSCALL_BASE + 360)
320#define __NR_preadv (__NR_SYSCALL_BASE + 361)
321#define __NR_pwritev (__NR_SYSCALL_BASE + 362)
322#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE + 363)
323#define __NR_perf_event_open (__NR_SYSCALL_BASE + 364)
324#define __NR_recvmmsg (__NR_SYSCALL_BASE + 365)
325#define __NR_accept4 (__NR_SYSCALL_BASE + 366)
326#define __NR_fanotify_init (__NR_SYSCALL_BASE + 367)
327#define __NR_fanotify_mark (__NR_SYSCALL_BASE + 368)
328#define __NR_prlimit64 (__NR_SYSCALL_BASE + 369)
329#define __NR_name_to_handle_at (__NR_SYSCALL_BASE + 370)
330#define __NR_open_by_handle_at (__NR_SYSCALL_BASE + 371)
331#define __NR_clock_adjtime (__NR_SYSCALL_BASE + 372)
332#define __NR_syncfs (__NR_SYSCALL_BASE + 373)
333#define __NR_sendmmsg (__NR_SYSCALL_BASE + 374)
334#define __NR_setns (__NR_SYSCALL_BASE + 375)
335#define __NR_process_vm_readv (__NR_SYSCALL_BASE + 376)
336#define __NR_process_vm_writev (__NR_SYSCALL_BASE + 377)
337#define __NR_kcmp (__NR_SYSCALL_BASE + 378)
338#define __NR_finit_module (__NR_SYSCALL_BASE + 379)
339#define __NR_sched_setattr (__NR_SYSCALL_BASE + 380)
340#define __NR_sched_getattr (__NR_SYSCALL_BASE + 381)
341#define __NR_renameat2 (__NR_SYSCALL_BASE + 382)
342#define __NR_seccomp (__NR_SYSCALL_BASE + 383)
343#define __NR_getrandom (__NR_SYSCALL_BASE + 384)
344#define __NR_memfd_create (__NR_SYSCALL_BASE + 385)
345#define __NR_bpf (__NR_SYSCALL_BASE + 386)
346#define __NR_execveat (__NR_SYSCALL_BASE + 387)
347#define __NR_userfaultfd (__NR_SYSCALL_BASE + 388)
348#define __NR_membarrier (__NR_SYSCALL_BASE + 389)
349#define __NR_mlock2 (__NR_SYSCALL_BASE + 390)
350#define __NR_copy_file_range (__NR_SYSCALL_BASE + 391)
351#define __NR_preadv2 (__NR_SYSCALL_BASE + 392)
352#define __NR_pwritev2 (__NR_SYSCALL_BASE + 393)
353#define __NR_pkey_mprotect (__NR_SYSCALL_BASE + 394)
354#define __NR_pkey_alloc (__NR_SYSCALL_BASE + 395)
355#define __NR_pkey_free (__NR_SYSCALL_BASE + 396)
356#define __NR_statx (__NR_SYSCALL_BASE + 397)
357#define __NR_rseq (__NR_SYSCALL_BASE + 398)
358#define __NR_io_pgetevents (__NR_SYSCALL_BASE + 399)
359
360#endif /* _ASM_ARM_UNISTD_COMMON_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd-eabi.h deleted-5
...@@ -1,5 +0,0 @@
1#ifndef _ASM_ARM_UNISTD_EABI_H
2#define _ASM_ARM_UNISTD_EABI_H 1
3
4
5#endif /* _ASM_ARM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd-oabi.h deleted-17
...@@ -1,17 +0,0 @@
1#ifndef _ASM_ARM_UNISTD_OABI_H
2#define _ASM_ARM_UNISTD_OABI_H 1
3
4#define __NR_time (__NR_SYSCALL_BASE + 13)
5#define __NR_umount (__NR_SYSCALL_BASE + 22)
6#define __NR_stime (__NR_SYSCALL_BASE + 25)
7#define __NR_alarm (__NR_SYSCALL_BASE + 27)
8#define __NR_utime (__NR_SYSCALL_BASE + 30)
9#define __NR_getrlimit (__NR_SYSCALL_BASE + 76)
10#define __NR_select (__NR_SYSCALL_BASE + 82)
11#define __NR_readdir (__NR_SYSCALL_BASE + 89)
12#define __NR_mmap (__NR_SYSCALL_BASE + 90)
13#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
14#define __NR_syscall (__NR_SYSCALL_BASE + 113)
15#define __NR_ipc (__NR_SYSCALL_BASE + 117)
16
17#endif /* _ASM_ARM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/unistd.h
4 *
5 * Copyright (C) 2001-2005 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
12 * no matter what the change is. Thanks!
13 */
14#ifndef __ASM_ARM_UNISTD_H
15#define __ASM_ARM_UNISTD_H
16
17#define __NR_OABI_SYSCALL_BASE 0x900000
18
19#if defined(__thumb__) || defined(__ARM_EABI__)
20#define __NR_SYSCALL_BASE 0
21#include <asm/unistd-eabi.h>
22#else
23#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
24#include <asm/unistd-oabi.h>
25#endif
26
27#include <asm/unistd-common.h>
28#define __NR_sync_file_range2 __NR_arm_sync_file_range
29
30/*
31 * The following SWIs are ARM private.
32 */
33#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
34#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
35#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
36#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
37#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
38#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
39#define __ARM_NR_get_tls (__ARM_NR_BASE+6)
40
41#endif /* __ASM_ARM_UNISTD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd_32.h deleted-388
...@@ -1,388 +0,0 @@
1#ifndef _ASM_X86_UNISTD_32_H
2#define _ASM_X86_UNISTD_32_H 1
3
4#define __NR_restart_syscall 0
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_waitpid 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_break 17
22#define __NR_oldstat 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_mount 21
26#define __NR_umount 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_stime 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_oldfstat 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_stty 31
36#define __NR_gtty 32
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_ftime 35
40#define __NR_sync 36
41#define __NR_kill 37
42#define __NR_rename 38
43#define __NR_mkdir 39
44#define __NR_rmdir 40
45#define __NR_dup 41
46#define __NR_pipe 42
47#define __NR_times 43
48#define __NR_prof 44
49#define __NR_brk 45
50#define __NR_setgid 46
51#define __NR_getgid 47
52#define __NR_signal 48
53#define __NR_geteuid 49
54#define __NR_getegid 50
55#define __NR_acct 51
56#define __NR_umount2 52
57#define __NR_lock 53
58#define __NR_ioctl 54
59#define __NR_fcntl 55
60#define __NR_mpx 56
61#define __NR_setpgid 57
62#define __NR_ulimit 58
63#define __NR_oldolduname 59
64#define __NR_umask 60
65#define __NR_chroot 61
66#define __NR_ustat 62
67#define __NR_dup2 63
68#define __NR_getppid 64
69#define __NR_getpgrp 65
70#define __NR_setsid 66
71#define __NR_sigaction 67
72#define __NR_sgetmask 68
73#define __NR_ssetmask 69
74#define __NR_setreuid 70
75#define __NR_setregid 71
76#define __NR_sigsuspend 72
77#define __NR_sigpending 73
78#define __NR_sethostname 74
79#define __NR_setrlimit 75
80#define __NR_getrlimit 76
81#define __NR_getrusage 77
82#define __NR_gettimeofday 78
83#define __NR_settimeofday 79
84#define __NR_getgroups 80
85#define __NR_setgroups 81
86#define __NR_select 82
87#define __NR_symlink 83
88#define __NR_oldlstat 84
89#define __NR_readlink 85
90#define __NR_uselib 86
91#define __NR_swapon 87
92#define __NR_reboot 88
93#define __NR_readdir 89
94#define __NR_mmap 90
95#define __NR_munmap 91
96#define __NR_truncate 92
97#define __NR_ftruncate 93
98#define __NR_fchmod 94
99#define __NR_fchown 95
100#define __NR_getpriority 96
101#define __NR_setpriority 97
102#define __NR_profil 98
103#define __NR_statfs 99
104#define __NR_fstatfs 100
105#define __NR_ioperm 101
106#define __NR_socketcall 102
107#define __NR_syslog 103
108#define __NR_setitimer 104
109#define __NR_getitimer 105
110#define __NR_stat 106
111#define __NR_lstat 107
112#define __NR_fstat 108
113#define __NR_olduname 109
114#define __NR_iopl 110
115#define __NR_vhangup 111
116#define __NR_idle 112
117#define __NR_vm86old 113
118#define __NR_wait4 114
119#define __NR_swapoff 115
120#define __NR_sysinfo 116
121#define __NR_ipc 117
122#define __NR_fsync 118
123#define __NR_sigreturn 119
124#define __NR_clone 120
125#define __NR_setdomainname 121
126#define __NR_uname 122
127#define __NR_modify_ldt 123
128#define __NR_adjtimex 124
129#define __NR_mprotect 125
130#define __NR_sigprocmask 126
131#define __NR_create_module 127
132#define __NR_init_module 128
133#define __NR_delete_module 129
134#define __NR_get_kernel_syms 130
135#define __NR_quotactl 131
136#define __NR_getpgid 132
137#define __NR_fchdir 133
138#define __NR_bdflush 134
139#define __NR_sysfs 135
140#define __NR_personality 136
141#define __NR_afs_syscall 137
142#define __NR_setfsuid 138
143#define __NR_setfsgid 139
144#define __NR__llseek 140
145#define __NR_getdents 141
146#define __NR__newselect 142
147#define __NR_flock 143
148#define __NR_msync 144
149#define __NR_readv 145
150#define __NR_writev 146
151#define __NR_getsid 147
152#define __NR_fdatasync 148
153#define __NR__sysctl 149
154#define __NR_mlock 150
155#define __NR_munlock 151
156#define __NR_mlockall 152
157#define __NR_munlockall 153
158#define __NR_sched_setparam 154
159#define __NR_sched_getparam 155
160#define __NR_sched_setscheduler 156
161#define __NR_sched_getscheduler 157
162#define __NR_sched_yield 158
163#define __NR_sched_get_priority_max 159
164#define __NR_sched_get_priority_min 160
165#define __NR_sched_rr_get_interval 161
166#define __NR_nanosleep 162
167#define __NR_mremap 163
168#define __NR_setresuid 164
169#define __NR_getresuid 165
170#define __NR_vm86 166
171#define __NR_query_module 167
172#define __NR_poll 168
173#define __NR_nfsservctl 169
174#define __NR_setresgid 170
175#define __NR_getresgid 171
176#define __NR_prctl 172
177#define __NR_rt_sigreturn 173
178#define __NR_rt_sigaction 174
179#define __NR_rt_sigprocmask 175
180#define __NR_rt_sigpending 176
181#define __NR_rt_sigtimedwait 177
182#define __NR_rt_sigqueueinfo 178
183#define __NR_rt_sigsuspend 179
184#define __NR_pread64 180
185#define __NR_pwrite64 181
186#define __NR_chown 182
187#define __NR_getcwd 183
188#define __NR_capget 184
189#define __NR_capset 185
190#define __NR_sigaltstack 186
191#define __NR_sendfile 187
192#define __NR_getpmsg 188
193#define __NR_putpmsg 189
194#define __NR_vfork 190
195#define __NR_ugetrlimit 191
196#define __NR_mmap2 192
197#define __NR_truncate64 193
198#define __NR_ftruncate64 194
199#define __NR_stat64 195
200#define __NR_lstat64 196
201#define __NR_fstat64 197
202#define __NR_lchown32 198
203#define __NR_getuid32 199
204#define __NR_getgid32 200
205#define __NR_geteuid32 201
206#define __NR_getegid32 202
207#define __NR_setreuid32 203
208#define __NR_setregid32 204
209#define __NR_getgroups32 205
210#define __NR_setgroups32 206
211#define __NR_fchown32 207
212#define __NR_setresuid32 208
213#define __NR_getresuid32 209
214#define __NR_setresgid32 210
215#define __NR_getresgid32 211
216#define __NR_chown32 212
217#define __NR_setuid32 213
218#define __NR_setgid32 214
219#define __NR_setfsuid32 215
220#define __NR_setfsgid32 216
221#define __NR_pivot_root 217
222#define __NR_mincore 218
223#define __NR_madvise 219
224#define __NR_getdents64 220
225#define __NR_fcntl64 221
226#define __NR_gettid 224
227#define __NR_readahead 225
228#define __NR_setxattr 226
229#define __NR_lsetxattr 227
230#define __NR_fsetxattr 228
231#define __NR_getxattr 229
232#define __NR_lgetxattr 230
233#define __NR_fgetxattr 231
234#define __NR_listxattr 232
235#define __NR_llistxattr 233
236#define __NR_flistxattr 234
237#define __NR_removexattr 235
238#define __NR_lremovexattr 236
239#define __NR_fremovexattr 237
240#define __NR_tkill 238
241#define __NR_sendfile64 239
242#define __NR_futex 240
243#define __NR_sched_setaffinity 241
244#define __NR_sched_getaffinity 242
245#define __NR_set_thread_area 243
246#define __NR_get_thread_area 244
247#define __NR_io_setup 245
248#define __NR_io_destroy 246
249#define __NR_io_getevents 247
250#define __NR_io_submit 248
251#define __NR_io_cancel 249
252#define __NR_fadvise64 250
253#define __NR_exit_group 252
254#define __NR_lookup_dcookie 253
255#define __NR_epoll_create 254
256#define __NR_epoll_ctl 255
257#define __NR_epoll_wait 256
258#define __NR_remap_file_pages 257
259#define __NR_set_tid_address 258
260#define __NR_timer_create 259
261#define __NR_timer_settime 260
262#define __NR_timer_gettime 261
263#define __NR_timer_getoverrun 262
264#define __NR_timer_delete 263
265#define __NR_clock_settime 264
266#define __NR_clock_gettime 265
267#define __NR_clock_getres 266
268#define __NR_clock_nanosleep 267
269#define __NR_statfs64 268
270#define __NR_fstatfs64 269
271#define __NR_tgkill 270
272#define __NR_utimes 271
273#define __NR_fadvise64_64 272
274#define __NR_vserver 273
275#define __NR_mbind 274
276#define __NR_get_mempolicy 275
277#define __NR_set_mempolicy 276
278#define __NR_mq_open 277
279#define __NR_mq_unlink 278
280#define __NR_mq_timedsend 279
281#define __NR_mq_timedreceive 280
282#define __NR_mq_notify 281
283#define __NR_mq_getsetattr 282
284#define __NR_kexec_load 283
285#define __NR_waitid 284
286#define __NR_add_key 286
287#define __NR_request_key 287
288#define __NR_keyctl 288
289#define __NR_ioprio_set 289
290#define __NR_ioprio_get 290
291#define __NR_inotify_init 291
292#define __NR_inotify_add_watch 292
293#define __NR_inotify_rm_watch 293
294#define __NR_migrate_pages 294
295#define __NR_openat 295
296#define __NR_mkdirat 296
297#define __NR_mknodat 297
298#define __NR_fchownat 298
299#define __NR_futimesat 299
300#define __NR_fstatat64 300
301#define __NR_unlinkat 301
302#define __NR_renameat 302
303#define __NR_linkat 303
304#define __NR_symlinkat 304
305#define __NR_readlinkat 305
306#define __NR_fchmodat 306
307#define __NR_faccessat 307
308#define __NR_pselect6 308
309#define __NR_ppoll 309
310#define __NR_unshare 310
311#define __NR_set_robust_list 311
312#define __NR_get_robust_list 312
313#define __NR_splice 313
314#define __NR_sync_file_range 314
315#define __NR_tee 315
316#define __NR_vmsplice 316
317#define __NR_move_pages 317
318#define __NR_getcpu 318
319#define __NR_epoll_pwait 319
320#define __NR_utimensat 320
321#define __NR_signalfd 321
322#define __NR_timerfd_create 322
323#define __NR_eventfd 323
324#define __NR_fallocate 324
325#define __NR_timerfd_settime 325
326#define __NR_timerfd_gettime 326
327#define __NR_signalfd4 327
328#define __NR_eventfd2 328
329#define __NR_epoll_create1 329
330#define __NR_dup3 330
331#define __NR_pipe2 331
332#define __NR_inotify_init1 332
333#define __NR_preadv 333
334#define __NR_pwritev 334
335#define __NR_rt_tgsigqueueinfo 335
336#define __NR_perf_event_open 336
337#define __NR_recvmmsg 337
338#define __NR_fanotify_init 338
339#define __NR_fanotify_mark 339
340#define __NR_prlimit64 340
341#define __NR_name_to_handle_at 341
342#define __NR_open_by_handle_at 342
343#define __NR_clock_adjtime 343
344#define __NR_syncfs 344
345#define __NR_sendmmsg 345
346#define __NR_setns 346
347#define __NR_process_vm_readv 347
348#define __NR_process_vm_writev 348
349#define __NR_kcmp 349
350#define __NR_finit_module 350
351#define __NR_sched_setattr 351
352#define __NR_sched_getattr 352
353#define __NR_renameat2 353
354#define __NR_seccomp 354
355#define __NR_getrandom 355
356#define __NR_memfd_create 356
357#define __NR_bpf 357
358#define __NR_execveat 358
359#define __NR_socket 359
360#define __NR_socketpair 360
361#define __NR_bind 361
362#define __NR_connect 362
363#define __NR_listen 363
364#define __NR_accept4 364
365#define __NR_getsockopt 365
366#define __NR_setsockopt 366
367#define __NR_getsockname 367
368#define __NR_getpeername 368
369#define __NR_sendto 369
370#define __NR_sendmsg 370
371#define __NR_recvfrom 371
372#define __NR_recvmsg 372
373#define __NR_shutdown 373
374#define __NR_userfaultfd 374
375#define __NR_membarrier 375
376#define __NR_mlock2 376
377#define __NR_copy_file_range 377
378#define __NR_preadv2 378
379#define __NR_pwritev2 379
380#define __NR_pkey_mprotect 380
381#define __NR_pkey_alloc 381
382#define __NR_pkey_free 382
383#define __NR_statx 383
384#define __NR_arch_prctl 384
385#define __NR_io_pgetevents 385
386#define __NR_rseq 386
387
388#endif /* _ASM_X86_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd_64.h deleted-340
...@@ -1,340 +0,0 @@
1#ifndef _ASM_X86_UNISTD_64_H
2#define _ASM_X86_UNISTD_64_H 1
3
4#define __NR_read 0
5#define __NR_write 1
6#define __NR_open 2
7#define __NR_close 3
8#define __NR_stat 4
9#define __NR_fstat 5
10#define __NR_lstat 6
11#define __NR_poll 7
12#define __NR_lseek 8
13#define __NR_mmap 9
14#define __NR_mprotect 10
15#define __NR_munmap 11
16#define __NR_brk 12
17#define __NR_rt_sigaction 13
18#define __NR_rt_sigprocmask 14
19#define __NR_rt_sigreturn 15
20#define __NR_ioctl 16
21#define __NR_pread64 17
22#define __NR_pwrite64 18
23#define __NR_readv 19
24#define __NR_writev 20
25#define __NR_access 21
26#define __NR_pipe 22
27#define __NR_select 23
28#define __NR_sched_yield 24
29#define __NR_mremap 25
30#define __NR_msync 26
31#define __NR_mincore 27
32#define __NR_madvise 28
33#define __NR_shmget 29
34#define __NR_shmat 30
35#define __NR_shmctl 31
36#define __NR_dup 32
37#define __NR_dup2 33
38#define __NR_pause 34
39#define __NR_nanosleep 35
40#define __NR_getitimer 36
41#define __NR_alarm 37
42#define __NR_setitimer 38
43#define __NR_getpid 39
44#define __NR_sendfile 40
45#define __NR_socket 41
46#define __NR_connect 42
47#define __NR_accept 43
48#define __NR_sendto 44
49#define __NR_recvfrom 45
50#define __NR_sendmsg 46
51#define __NR_recvmsg 47
52#define __NR_shutdown 48
53#define __NR_bind 49
54#define __NR_listen 50
55#define __NR_getsockname 51
56#define __NR_getpeername 52
57#define __NR_socketpair 53
58#define __NR_setsockopt 54
59#define __NR_getsockopt 55
60#define __NR_clone 56
61#define __NR_fork 57
62#define __NR_vfork 58
63#define __NR_execve 59
64#define __NR_exit 60
65#define __NR_wait4 61
66#define __NR_kill 62
67#define __NR_uname 63
68#define __NR_semget 64
69#define __NR_semop 65
70#define __NR_semctl 66
71#define __NR_shmdt 67
72#define __NR_msgget 68
73#define __NR_msgsnd 69
74#define __NR_msgrcv 70
75#define __NR_msgctl 71
76#define __NR_fcntl 72
77#define __NR_flock 73
78#define __NR_fsync 74
79#define __NR_fdatasync 75
80#define __NR_truncate 76
81#define __NR_ftruncate 77
82#define __NR_getdents 78
83#define __NR_getcwd 79
84#define __NR_chdir 80
85#define __NR_fchdir 81
86#define __NR_rename 82
87#define __NR_mkdir 83
88#define __NR_rmdir 84
89#define __NR_creat 85
90#define __NR_link 86
91#define __NR_unlink 87
92#define __NR_symlink 88
93#define __NR_readlink 89
94#define __NR_chmod 90
95#define __NR_fchmod 91
96#define __NR_chown 92
97#define __NR_fchown 93
98#define __NR_lchown 94
99#define __NR_umask 95
100#define __NR_gettimeofday 96
101#define __NR_getrlimit 97
102#define __NR_getrusage 98
103#define __NR_sysinfo 99
104#define __NR_times 100
105#define __NR_ptrace 101
106#define __NR_getuid 102
107#define __NR_syslog 103
108#define __NR_getgid 104
109#define __NR_setuid 105
110#define __NR_setgid 106
111#define __NR_geteuid 107
112#define __NR_getegid 108
113#define __NR_setpgid 109
114#define __NR_getppid 110
115#define __NR_getpgrp 111
116#define __NR_setsid 112
117#define __NR_setreuid 113
118#define __NR_setregid 114
119#define __NR_getgroups 115
120#define __NR_setgroups 116
121#define __NR_setresuid 117
122#define __NR_getresuid 118
123#define __NR_setresgid 119
124#define __NR_getresgid 120
125#define __NR_getpgid 121
126#define __NR_setfsuid 122
127#define __NR_setfsgid 123
128#define __NR_getsid 124
129#define __NR_capget 125
130#define __NR_capset 126
131#define __NR_rt_sigpending 127
132#define __NR_rt_sigtimedwait 128
133#define __NR_rt_sigqueueinfo 129
134#define __NR_rt_sigsuspend 130
135#define __NR_sigaltstack 131
136#define __NR_utime 132
137#define __NR_mknod 133
138#define __NR_uselib 134
139#define __NR_personality 135
140#define __NR_ustat 136
141#define __NR_statfs 137
142#define __NR_fstatfs 138
143#define __NR_sysfs 139
144#define __NR_getpriority 140
145#define __NR_setpriority 141
146#define __NR_sched_setparam 142
147#define __NR_sched_getparam 143
148#define __NR_sched_setscheduler 144
149#define __NR_sched_getscheduler 145
150#define __NR_sched_get_priority_max 146
151#define __NR_sched_get_priority_min 147
152#define __NR_sched_rr_get_interval 148
153#define __NR_mlock 149
154#define __NR_munlock 150
155#define __NR_mlockall 151
156#define __NR_munlockall 152
157#define __NR_vhangup 153
158#define __NR_modify_ldt 154
159#define __NR_pivot_root 155
160#define __NR__sysctl 156
161#define __NR_prctl 157
162#define __NR_arch_prctl 158
163#define __NR_adjtimex 159
164#define __NR_setrlimit 160
165#define __NR_chroot 161
166#define __NR_sync 162
167#define __NR_acct 163
168#define __NR_settimeofday 164
169#define __NR_mount 165
170#define __NR_umount2 166
171#define __NR_swapon 167
172#define __NR_swapoff 168
173#define __NR_reboot 169
174#define __NR_sethostname 170
175#define __NR_setdomainname 171
176#define __NR_iopl 172
177#define __NR_ioperm 173
178#define __NR_create_module 174
179#define __NR_init_module 175
180#define __NR_delete_module 176
181#define __NR_get_kernel_syms 177
182#define __NR_query_module 178
183#define __NR_quotactl 179
184#define __NR_nfsservctl 180
185#define __NR_getpmsg 181
186#define __NR_putpmsg 182
187#define __NR_afs_syscall 183
188#define __NR_tuxcall 184
189#define __NR_security 185
190#define __NR_gettid 186
191#define __NR_readahead 187
192#define __NR_setxattr 188
193#define __NR_lsetxattr 189
194#define __NR_fsetxattr 190
195#define __NR_getxattr 191
196#define __NR_lgetxattr 192
197#define __NR_fgetxattr 193
198#define __NR_listxattr 194
199#define __NR_llistxattr 195
200#define __NR_flistxattr 196
201#define __NR_removexattr 197
202#define __NR_lremovexattr 198
203#define __NR_fremovexattr 199
204#define __NR_tkill 200
205#define __NR_time 201
206#define __NR_futex 202
207#define __NR_sched_setaffinity 203
208#define __NR_sched_getaffinity 204
209#define __NR_set_thread_area 205
210#define __NR_io_setup 206
211#define __NR_io_destroy 207
212#define __NR_io_getevents 208
213#define __NR_io_submit 209
214#define __NR_io_cancel 210
215#define __NR_get_thread_area 211
216#define __NR_lookup_dcookie 212
217#define __NR_epoll_create 213
218#define __NR_epoll_ctl_old 214
219#define __NR_epoll_wait_old 215
220#define __NR_remap_file_pages 216
221#define __NR_getdents64 217
222#define __NR_set_tid_address 218
223#define __NR_restart_syscall 219
224#define __NR_semtimedop 220
225#define __NR_fadvise64 221
226#define __NR_timer_create 222
227#define __NR_timer_settime 223
228#define __NR_timer_gettime 224
229#define __NR_timer_getoverrun 225
230#define __NR_timer_delete 226
231#define __NR_clock_settime 227
232#define __NR_clock_gettime 228
233#define __NR_clock_getres 229
234#define __NR_clock_nanosleep 230
235#define __NR_exit_group 231
236#define __NR_epoll_wait 232
237#define __NR_epoll_ctl 233
238#define __NR_tgkill 234
239#define __NR_utimes 235
240#define __NR_vserver 236
241#define __NR_mbind 237
242#define __NR_set_mempolicy 238
243#define __NR_get_mempolicy 239
244#define __NR_mq_open 240
245#define __NR_mq_unlink 241
246#define __NR_mq_timedsend 242
247#define __NR_mq_timedreceive 243
248#define __NR_mq_notify 244
249#define __NR_mq_getsetattr 245
250#define __NR_kexec_load 246
251#define __NR_waitid 247
252#define __NR_add_key 248
253#define __NR_request_key 249
254#define __NR_keyctl 250
255#define __NR_ioprio_set 251
256#define __NR_ioprio_get 252
257#define __NR_inotify_init 253
258#define __NR_inotify_add_watch 254
259#define __NR_inotify_rm_watch 255
260#define __NR_migrate_pages 256
261#define __NR_openat 257
262#define __NR_mkdirat 258
263#define __NR_mknodat 259
264#define __NR_fchownat 260
265#define __NR_futimesat 261
266#define __NR_newfstatat 262
267#define __NR_unlinkat 263
268#define __NR_renameat 264
269#define __NR_linkat 265
270#define __NR_symlinkat 266
271#define __NR_readlinkat 267
272#define __NR_fchmodat 268
273#define __NR_faccessat 269
274#define __NR_pselect6 270
275#define __NR_ppoll 271
276#define __NR_unshare 272
277#define __NR_set_robust_list 273
278#define __NR_get_robust_list 274
279#define __NR_splice 275
280#define __NR_tee 276
281#define __NR_sync_file_range 277
282#define __NR_vmsplice 278
283#define __NR_move_pages 279
284#define __NR_utimensat 280
285#define __NR_epoll_pwait 281
286#define __NR_signalfd 282
287#define __NR_timerfd_create 283
288#define __NR_eventfd 284
289#define __NR_fallocate 285
290#define __NR_timerfd_settime 286
291#define __NR_timerfd_gettime 287
292#define __NR_accept4 288
293#define __NR_signalfd4 289
294#define __NR_eventfd2 290
295#define __NR_epoll_create1 291
296#define __NR_dup3 292
297#define __NR_pipe2 293
298#define __NR_inotify_init1 294
299#define __NR_preadv 295
300#define __NR_pwritev 296
301#define __NR_rt_tgsigqueueinfo 297
302#define __NR_perf_event_open 298
303#define __NR_recvmmsg 299
304#define __NR_fanotify_init 300
305#define __NR_fanotify_mark 301
306#define __NR_prlimit64 302
307#define __NR_name_to_handle_at 303
308#define __NR_open_by_handle_at 304
309#define __NR_clock_adjtime 305
310#define __NR_syncfs 306
311#define __NR_sendmmsg 307
312#define __NR_setns 308
313#define __NR_getcpu 309
314#define __NR_process_vm_readv 310
315#define __NR_process_vm_writev 311
316#define __NR_kcmp 312
317#define __NR_finit_module 313
318#define __NR_sched_setattr 314
319#define __NR_sched_getattr 315
320#define __NR_renameat2 316
321#define __NR_seccomp 317
322#define __NR_getrandom 318
323#define __NR_memfd_create 319
324#define __NR_kexec_file_load 320
325#define __NR_bpf 321
326#define __NR_execveat 322
327#define __NR_userfaultfd 323
328#define __NR_membarrier 324
329#define __NR_mlock2 325
330#define __NR_copy_file_range 326
331#define __NR_preadv2 327
332#define __NR_pwritev2 328
333#define __NR_pkey_mprotect 329
334#define __NR_pkey_alloc 330
335#define __NR_pkey_free 331
336#define __NR_statx 332
337#define __NR_io_pgetevents 333
338#define __NR_rseq 334
339
340#endif /* _ASM_X86_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/unistd_x32.h deleted-329
...@@ -1,329 +0,0 @@
1#ifndef _ASM_X86_UNISTD_X32_H
2#define _ASM_X86_UNISTD_X32_H 1
3
4#define __NR_read (__X32_SYSCALL_BIT + 0)
5#define __NR_write (__X32_SYSCALL_BIT + 1)
6#define __NR_open (__X32_SYSCALL_BIT + 2)
7#define __NR_close (__X32_SYSCALL_BIT + 3)
8#define __NR_stat (__X32_SYSCALL_BIT + 4)
9#define __NR_fstat (__X32_SYSCALL_BIT + 5)
10#define __NR_lstat (__X32_SYSCALL_BIT + 6)
11#define __NR_poll (__X32_SYSCALL_BIT + 7)
12#define __NR_lseek (__X32_SYSCALL_BIT + 8)
13#define __NR_mmap (__X32_SYSCALL_BIT + 9)
14#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
15#define __NR_munmap (__X32_SYSCALL_BIT + 11)
16#define __NR_brk (__X32_SYSCALL_BIT + 12)
17#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
18#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
19#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
20#define __NR_access (__X32_SYSCALL_BIT + 21)
21#define __NR_pipe (__X32_SYSCALL_BIT + 22)
22#define __NR_select (__X32_SYSCALL_BIT + 23)
23#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
24#define __NR_mremap (__X32_SYSCALL_BIT + 25)
25#define __NR_msync (__X32_SYSCALL_BIT + 26)
26#define __NR_mincore (__X32_SYSCALL_BIT + 27)
27#define __NR_madvise (__X32_SYSCALL_BIT + 28)
28#define __NR_shmget (__X32_SYSCALL_BIT + 29)
29#define __NR_shmat (__X32_SYSCALL_BIT + 30)
30#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
31#define __NR_dup (__X32_SYSCALL_BIT + 32)
32#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
33#define __NR_pause (__X32_SYSCALL_BIT + 34)
34#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
35#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
36#define __NR_alarm (__X32_SYSCALL_BIT + 37)
37#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
38#define __NR_getpid (__X32_SYSCALL_BIT + 39)
39#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
40#define __NR_socket (__X32_SYSCALL_BIT + 41)
41#define __NR_connect (__X32_SYSCALL_BIT + 42)
42#define __NR_accept (__X32_SYSCALL_BIT + 43)
43#define __NR_sendto (__X32_SYSCALL_BIT + 44)
44#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
45#define __NR_bind (__X32_SYSCALL_BIT + 49)
46#define __NR_listen (__X32_SYSCALL_BIT + 50)
47#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
48#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
49#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
50#define __NR_clone (__X32_SYSCALL_BIT + 56)
51#define __NR_fork (__X32_SYSCALL_BIT + 57)
52#define __NR_vfork (__X32_SYSCALL_BIT + 58)
53#define __NR_exit (__X32_SYSCALL_BIT + 60)
54#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
55#define __NR_kill (__X32_SYSCALL_BIT + 62)
56#define __NR_uname (__X32_SYSCALL_BIT + 63)
57#define __NR_semget (__X32_SYSCALL_BIT + 64)
58#define __NR_semop (__X32_SYSCALL_BIT + 65)
59#define __NR_semctl (__X32_SYSCALL_BIT + 66)
60#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
61#define __NR_msgget (__X32_SYSCALL_BIT + 68)
62#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
63#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
64#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
65#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
66#define __NR_flock (__X32_SYSCALL_BIT + 73)
67#define __NR_fsync (__X32_SYSCALL_BIT + 74)
68#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
69#define __NR_truncate (__X32_SYSCALL_BIT + 76)
70#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
71#define __NR_getdents (__X32_SYSCALL_BIT + 78)
72#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
73#define __NR_chdir (__X32_SYSCALL_BIT + 80)
74#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
75#define __NR_rename (__X32_SYSCALL_BIT + 82)
76#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
77#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
78#define __NR_creat (__X32_SYSCALL_BIT + 85)
79#define __NR_link (__X32_SYSCALL_BIT + 86)
80#define __NR_unlink (__X32_SYSCALL_BIT + 87)
81#define __NR_symlink (__X32_SYSCALL_BIT + 88)
82#define __NR_readlink (__X32_SYSCALL_BIT + 89)
83#define __NR_chmod (__X32_SYSCALL_BIT + 90)
84#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
85#define __NR_chown (__X32_SYSCALL_BIT + 92)
86#define __NR_fchown (__X32_SYSCALL_BIT + 93)
87#define __NR_lchown (__X32_SYSCALL_BIT + 94)
88#define __NR_umask (__X32_SYSCALL_BIT + 95)
89#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
90#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
91#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
92#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
93#define __NR_times (__X32_SYSCALL_BIT + 100)
94#define __NR_getuid (__X32_SYSCALL_BIT + 102)
95#define __NR_syslog (__X32_SYSCALL_BIT + 103)
96#define __NR_getgid (__X32_SYSCALL_BIT + 104)
97#define __NR_setuid (__X32_SYSCALL_BIT + 105)
98#define __NR_setgid (__X32_SYSCALL_BIT + 106)
99#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
100#define __NR_getegid (__X32_SYSCALL_BIT + 108)
101#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
102#define __NR_getppid (__X32_SYSCALL_BIT + 110)
103#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
104#define __NR_setsid (__X32_SYSCALL_BIT + 112)
105#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
106#define __NR_setregid (__X32_SYSCALL_BIT + 114)
107#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
108#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
109#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
110#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
111#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
112#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
113#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
114#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
115#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
116#define __NR_getsid (__X32_SYSCALL_BIT + 124)
117#define __NR_capget (__X32_SYSCALL_BIT + 125)
118#define __NR_capset (__X32_SYSCALL_BIT + 126)
119#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
120#define __NR_utime (__X32_SYSCALL_BIT + 132)
121#define __NR_mknod (__X32_SYSCALL_BIT + 133)
122#define __NR_personality (__X32_SYSCALL_BIT + 135)
123#define __NR_ustat (__X32_SYSCALL_BIT + 136)
124#define __NR_statfs (__X32_SYSCALL_BIT + 137)
125#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
126#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
127#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
128#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
129#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
130#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
131#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
132#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
133#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
134#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
135#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
136#define __NR_mlock (__X32_SYSCALL_BIT + 149)
137#define __NR_munlock (__X32_SYSCALL_BIT + 150)
138#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
139#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
140#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
141#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
142#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
143#define __NR_prctl (__X32_SYSCALL_BIT + 157)
144#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
145#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
146#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
147#define __NR_chroot (__X32_SYSCALL_BIT + 161)
148#define __NR_sync (__X32_SYSCALL_BIT + 162)
149#define __NR_acct (__X32_SYSCALL_BIT + 163)
150#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
151#define __NR_mount (__X32_SYSCALL_BIT + 165)
152#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
153#define __NR_swapon (__X32_SYSCALL_BIT + 167)
154#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
155#define __NR_reboot (__X32_SYSCALL_BIT + 169)
156#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
157#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
158#define __NR_iopl (__X32_SYSCALL_BIT + 172)
159#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
160#define __NR_init_module (__X32_SYSCALL_BIT + 175)
161#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
162#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
163#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
164#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
165#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
166#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
167#define __NR_security (__X32_SYSCALL_BIT + 185)
168#define __NR_gettid (__X32_SYSCALL_BIT + 186)
169#define __NR_readahead (__X32_SYSCALL_BIT + 187)
170#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
171#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
172#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
173#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
174#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
175#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
176#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
177#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
178#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
179#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
180#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
181#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
182#define __NR_tkill (__X32_SYSCALL_BIT + 200)
183#define __NR_time (__X32_SYSCALL_BIT + 201)
184#define __NR_futex (__X32_SYSCALL_BIT + 202)
185#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
186#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
187#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
188#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
189#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
190#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
191#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
192#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
193#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
194#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
195#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
196#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
197#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
198#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
199#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
200#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
201#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
202#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
203#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
204#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
205#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
206#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
207#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
208#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
209#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
210#define __NR_utimes (__X32_SYSCALL_BIT + 235)
211#define __NR_mbind (__X32_SYSCALL_BIT + 237)
212#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
213#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
214#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
215#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
216#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
217#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
218#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
219#define __NR_add_key (__X32_SYSCALL_BIT + 248)
220#define __NR_request_key (__X32_SYSCALL_BIT + 249)
221#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
222#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
223#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
224#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
225#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
226#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
227#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
228#define __NR_openat (__X32_SYSCALL_BIT + 257)
229#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
230#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
231#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
232#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
233#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
234#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
235#define __NR_renameat (__X32_SYSCALL_BIT + 264)
236#define __NR_linkat (__X32_SYSCALL_BIT + 265)
237#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
238#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
239#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
240#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
241#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
242#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
243#define __NR_unshare (__X32_SYSCALL_BIT + 272)
244#define __NR_splice (__X32_SYSCALL_BIT + 275)
245#define __NR_tee (__X32_SYSCALL_BIT + 276)
246#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
247#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
248#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
249#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
250#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
251#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
252#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
253#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
254#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
255#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
256#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
257#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
258#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
259#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
260#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
261#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
262#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
263#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
264#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
265#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
266#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
267#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
268#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
269#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
270#define __NR_setns (__X32_SYSCALL_BIT + 308)
271#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
272#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
273#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
274#define __NR_sched_setattr (__X32_SYSCALL_BIT + 314)
275#define __NR_sched_getattr (__X32_SYSCALL_BIT + 315)
276#define __NR_renameat2 (__X32_SYSCALL_BIT + 316)
277#define __NR_seccomp (__X32_SYSCALL_BIT + 317)
278#define __NR_getrandom (__X32_SYSCALL_BIT + 318)
279#define __NR_memfd_create (__X32_SYSCALL_BIT + 319)
280#define __NR_kexec_file_load (__X32_SYSCALL_BIT + 320)
281#define __NR_bpf (__X32_SYSCALL_BIT + 321)
282#define __NR_userfaultfd (__X32_SYSCALL_BIT + 323)
283#define __NR_membarrier (__X32_SYSCALL_BIT + 324)
284#define __NR_mlock2 (__X32_SYSCALL_BIT + 325)
285#define __NR_copy_file_range (__X32_SYSCALL_BIT + 326)
286#define __NR_pkey_mprotect (__X32_SYSCALL_BIT + 329)
287#define __NR_pkey_alloc (__X32_SYSCALL_BIT + 330)
288#define __NR_pkey_free (__X32_SYSCALL_BIT + 331)
289#define __NR_statx (__X32_SYSCALL_BIT + 332)
290#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
291#define __NR_rseq (__X32_SYSCALL_BIT + 334)
292#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
293#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
294#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
295#define __NR_readv (__X32_SYSCALL_BIT + 515)
296#define __NR_writev (__X32_SYSCALL_BIT + 516)
297#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
298#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
299#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
300#define __NR_execve (__X32_SYSCALL_BIT + 520)
301#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
302#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
303#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
304#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
305#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
306#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
307#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
308#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
309#define __NR_waitid (__X32_SYSCALL_BIT + 529)
310#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
311#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
312#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
313#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
314#define __NR_preadv (__X32_SYSCALL_BIT + 534)
315#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
316#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
317#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
318#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
319#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
320#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
321#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
322#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
323#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
324#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
325#define __NR_execveat (__X32_SYSCALL_BIT + 545)
326#define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
327#define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
328
329#endif /* _ASM_X86_UNISTD_X32_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/vm86.h deleted-130
...@@ -1,130 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_VM86_H
3#define _ASM_X86_VM86_H
4
5/*
6 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
7 * the Pentium uses them. Linux will return from vm86 mode when both
8 * VIF and VIP is set.
9 *
10 * On a Pentium, we could probably optimize the virtual flags directly
11 * in the eflags register instead of doing it "by hand" in vflags...
12 *
13 * Linus
14 */
15
16#include <asm/processor-flags.h>
17
18#define BIOSSEG 0x0f000
19
20#define CPU_086 0
21#define CPU_186 1
22#define CPU_286 2
23#define CPU_386 3
24#define CPU_486 4
25#define CPU_586 5
26
27/*
28 * Return values for the 'vm86()' system call
29 */
30#define VM86_TYPE(retval) ((retval) & 0xff)
31#define VM86_ARG(retval) ((retval) >> 8)
32
33#define VM86_SIGNAL 0 /* return due to signal */
34#define VM86_UNKNOWN 1 /* unhandled GP fault
35 - IO-instruction or similar */
36#define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
37#define VM86_STI 3 /* sti/popf/iret instruction enabled
38 virtual interrupts */
39
40/*
41 * Additional return values when invoking new vm86()
42 */
43#define VM86_PICRETURN 4 /* return due to pending PIC request */
44#define VM86_TRAP 6 /* return due to DOS-debugger request */
45
46/*
47 * function codes when invoking new vm86()
48 */
49#define VM86_PLUS_INSTALL_CHECK 0
50#define VM86_ENTER 1
51#define VM86_ENTER_NO_BYPASS 2
52#define VM86_REQUEST_IRQ 3
53#define VM86_FREE_IRQ 4
54#define VM86_GET_IRQ_BITS 5
55#define VM86_GET_AND_RESET_IRQ 6
56
57/*
58 * This is the stack-layout seen by the user space program when we have
59 * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
60 * is 'kernel_vm86_regs' (see below).
61 */
62
63struct vm86_regs {
64/*
65 * normal regs, with special meaning for the segment descriptors..
66 */
67 long ebx;
68 long ecx;
69 long edx;
70 long esi;
71 long edi;
72 long ebp;
73 long eax;
74 long __null_ds;
75 long __null_es;
76 long __null_fs;
77 long __null_gs;
78 long orig_eax;
79 long eip;
80 unsigned short cs, __csh;
81 long eflags;
82 long esp;
83 unsigned short ss, __ssh;
84/*
85 * these are specific to v86 mode:
86 */
87 unsigned short es, __esh;
88 unsigned short ds, __dsh;
89 unsigned short fs, __fsh;
90 unsigned short gs, __gsh;
91};
92
93struct revectored_struct {
94 unsigned long __map[8]; /* 256 bits */
95};
96
97struct vm86_struct {
98 struct vm86_regs regs;
99 unsigned long flags;
100 unsigned long screen_bitmap;
101 unsigned long cpu_type;
102 struct revectored_struct int_revectored;
103 struct revectored_struct int21_revectored;
104};
105
106/*
107 * flags masks
108 */
109#define VM86_SCREEN_BITMAP 0x0001
110
111struct vm86plus_info_struct {
112 unsigned long force_return_for_pic:1;
113 unsigned long vm86dbg_active:1; /* for debugger */
114 unsigned long vm86dbg_TFpendig:1; /* for debugger */
115 unsigned long unused:28;
116 unsigned long is_vm86pus:1; /* for vm86 internal use */
117 unsigned char vm86dbg_intxxtab[32]; /* for debugger */
118};
119struct vm86plus_struct {
120 struct vm86_regs regs;
121 unsigned long flags;
122 unsigned long screen_bitmap;
123 unsigned long cpu_type;
124 struct revectored_struct int_revectored;
125 struct revectored_struct int21_revectored;
126 struct vm86plus_info_struct vm86plus;
127};
128
129
130#endif /* _ASM_X86_VM86_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/vmx.h deleted-151
...@@ -1,151 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * vmx.h: VMX Architecture related definitions
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 *
19 * A few random additions are:
20 * Copyright (C) 2006 Qumranet
21 * Avi Kivity <avi@qumranet.com>
22 * Yaniv Kamay <yaniv@qumranet.com>
23 *
24 */
25#ifndef VMX_H
26#define VMX_H
27
28
29#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
30
31#define EXIT_REASON_EXCEPTION_NMI 0
32#define EXIT_REASON_EXTERNAL_INTERRUPT 1
33#define EXIT_REASON_TRIPLE_FAULT 2
34
35#define EXIT_REASON_PENDING_INTERRUPT 7
36#define EXIT_REASON_NMI_WINDOW 8
37#define EXIT_REASON_TASK_SWITCH 9
38#define EXIT_REASON_CPUID 10
39#define EXIT_REASON_HLT 12
40#define EXIT_REASON_INVD 13
41#define EXIT_REASON_INVLPG 14
42#define EXIT_REASON_RDPMC 15
43#define EXIT_REASON_RDTSC 16
44#define EXIT_REASON_VMCALL 18
45#define EXIT_REASON_VMCLEAR 19
46#define EXIT_REASON_VMLAUNCH 20
47#define EXIT_REASON_VMPTRLD 21
48#define EXIT_REASON_VMPTRST 22
49#define EXIT_REASON_VMREAD 23
50#define EXIT_REASON_VMRESUME 24
51#define EXIT_REASON_VMWRITE 25
52#define EXIT_REASON_VMOFF 26
53#define EXIT_REASON_VMON 27
54#define EXIT_REASON_CR_ACCESS 28
55#define EXIT_REASON_DR_ACCESS 29
56#define EXIT_REASON_IO_INSTRUCTION 30
57#define EXIT_REASON_MSR_READ 31
58#define EXIT_REASON_MSR_WRITE 32
59#define EXIT_REASON_INVALID_STATE 33
60#define EXIT_REASON_MSR_LOAD_FAIL 34
61#define EXIT_REASON_MWAIT_INSTRUCTION 36
62#define EXIT_REASON_MONITOR_TRAP_FLAG 37
63#define EXIT_REASON_MONITOR_INSTRUCTION 39
64#define EXIT_REASON_PAUSE_INSTRUCTION 40
65#define EXIT_REASON_MCE_DURING_VMENTRY 41
66#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
67#define EXIT_REASON_APIC_ACCESS 44
68#define EXIT_REASON_EOI_INDUCED 45
69#define EXIT_REASON_GDTR_IDTR 46
70#define EXIT_REASON_LDTR_TR 47
71#define EXIT_REASON_EPT_VIOLATION 48
72#define EXIT_REASON_EPT_MISCONFIG 49
73#define EXIT_REASON_INVEPT 50
74#define EXIT_REASON_RDTSCP 51
75#define EXIT_REASON_PREEMPTION_TIMER 52
76#define EXIT_REASON_INVVPID 53
77#define EXIT_REASON_WBINVD 54
78#define EXIT_REASON_XSETBV 55
79#define EXIT_REASON_APIC_WRITE 56
80#define EXIT_REASON_RDRAND 57
81#define EXIT_REASON_INVPCID 58
82#define EXIT_REASON_VMFUNC 59
83#define EXIT_REASON_ENCLS 60
84#define EXIT_REASON_RDSEED 61
85#define EXIT_REASON_PML_FULL 62
86#define EXIT_REASON_XSAVES 63
87#define EXIT_REASON_XRSTORS 64
88
89#define VMX_EXIT_REASONS \
90 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
91 { EXIT_REASON_EXTERNAL_INTERRUPT, "EXTERNAL_INTERRUPT" }, \
92 { EXIT_REASON_TRIPLE_FAULT, "TRIPLE_FAULT" }, \
93 { EXIT_REASON_PENDING_INTERRUPT, "PENDING_INTERRUPT" }, \
94 { EXIT_REASON_NMI_WINDOW, "NMI_WINDOW" }, \
95 { EXIT_REASON_TASK_SWITCH, "TASK_SWITCH" }, \
96 { EXIT_REASON_CPUID, "CPUID" }, \
97 { EXIT_REASON_HLT, "HLT" }, \
98 { EXIT_REASON_INVD, "INVD" }, \
99 { EXIT_REASON_INVLPG, "INVLPG" }, \
100 { EXIT_REASON_RDPMC, "RDPMC" }, \
101 { EXIT_REASON_RDTSC, "RDTSC" }, \
102 { EXIT_REASON_VMCALL, "VMCALL" }, \
103 { EXIT_REASON_VMCLEAR, "VMCLEAR" }, \
104 { EXIT_REASON_VMLAUNCH, "VMLAUNCH" }, \
105 { EXIT_REASON_VMPTRLD, "VMPTRLD" }, \
106 { EXIT_REASON_VMPTRST, "VMPTRST" }, \
107 { EXIT_REASON_VMREAD, "VMREAD" }, \
108 { EXIT_REASON_VMRESUME, "VMRESUME" }, \
109 { EXIT_REASON_VMWRITE, "VMWRITE" }, \
110 { EXIT_REASON_VMOFF, "VMOFF" }, \
111 { EXIT_REASON_VMON, "VMON" }, \
112 { EXIT_REASON_CR_ACCESS, "CR_ACCESS" }, \
113 { EXIT_REASON_DR_ACCESS, "DR_ACCESS" }, \
114 { EXIT_REASON_IO_INSTRUCTION, "IO_INSTRUCTION" }, \
115 { EXIT_REASON_MSR_READ, "MSR_READ" }, \
116 { EXIT_REASON_MSR_WRITE, "MSR_WRITE" }, \
117 { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \
118 { EXIT_REASON_MSR_LOAD_FAIL, "MSR_LOAD_FAIL" }, \
119 { EXIT_REASON_MWAIT_INSTRUCTION, "MWAIT_INSTRUCTION" }, \
120 { EXIT_REASON_MONITOR_TRAP_FLAG, "MONITOR_TRAP_FLAG" }, \
121 { EXIT_REASON_MONITOR_INSTRUCTION, "MONITOR_INSTRUCTION" }, \
122 { EXIT_REASON_PAUSE_INSTRUCTION, "PAUSE_INSTRUCTION" }, \
123 { EXIT_REASON_MCE_DURING_VMENTRY, "MCE_DURING_VMENTRY" }, \
124 { EXIT_REASON_TPR_BELOW_THRESHOLD, "TPR_BELOW_THRESHOLD" }, \
125 { EXIT_REASON_APIC_ACCESS, "APIC_ACCESS" }, \
126 { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \
127 { EXIT_REASON_GDTR_IDTR, "GDTR_IDTR" }, \
128 { EXIT_REASON_LDTR_TR, "LDTR_TR" }, \
129 { EXIT_REASON_EPT_VIOLATION, "EPT_VIOLATION" }, \
130 { EXIT_REASON_EPT_MISCONFIG, "EPT_MISCONFIG" }, \
131 { EXIT_REASON_INVEPT, "INVEPT" }, \
132 { EXIT_REASON_RDTSCP, "RDTSCP" }, \
133 { EXIT_REASON_PREEMPTION_TIMER, "PREEMPTION_TIMER" }, \
134 { EXIT_REASON_INVVPID, "INVVPID" }, \
135 { EXIT_REASON_WBINVD, "WBINVD" }, \
136 { EXIT_REASON_XSETBV, "XSETBV" }, \
137 { EXIT_REASON_APIC_WRITE, "APIC_WRITE" }, \
138 { EXIT_REASON_RDRAND, "RDRAND" }, \
139 { EXIT_REASON_INVPCID, "INVPCID" }, \
140 { EXIT_REASON_VMFUNC, "VMFUNC" }, \
141 { EXIT_REASON_ENCLS, "ENCLS" }, \
142 { EXIT_REASON_RDSEED, "RDSEED" }, \
143 { EXIT_REASON_PML_FULL, "PML_FULL" }, \
144 { EXIT_REASON_XSAVES, "XSAVES" }, \
145 { EXIT_REASON_XRSTORS, "XRSTORS" }
146
147#define VMX_ABORT_SAVE_GUEST_MSR_FAIL 1
148#define VMX_ABORT_LOAD_HOST_PDPTE_FAIL 2
149#define VMX_ABORT_LOAD_HOST_MSR_FAIL 4
150
151#endif /* VMX_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm/vsyscall.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_VSYSCALL_H
3#define _ASM_X86_VSYSCALL_H
4
5enum vsyscall_num {
6 __NR_vgettimeofday,
7 __NR_vtime,
8 __NR_vgetcpu,
9};
10
11#define VSYSCALL_ADDR (-10UL << 20)
12
13#endif /* _ASM_X86_VSYSCALL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/amdgpu_drm.h created+1142
...@@ -0,0 +1,1142 @@
1/* amdgpu_drm.h -- Public header for the amdgpu driver -*- linux-c -*-
2 *
3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
5 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Copyright 2014 Advanced Micro Devices, Inc.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 *
26 * Authors:
27 * Kevin E. Martin <martin@valinux.com>
28 * Gareth Hughes <gareth@valinux.com>
29 * Keith Whitwell <keith@tungstengraphics.com>
30 */
31
32#ifndef __AMDGPU_DRM_H__
33#define __AMDGPU_DRM_H__
34
35#include "drm.h"
36
37#if defined(__cplusplus)
38extern "C" {
39#endif
40
41#define DRM_AMDGPU_GEM_CREATE 0x00
42#define DRM_AMDGPU_GEM_MMAP 0x01
43#define DRM_AMDGPU_CTX 0x02
44#define DRM_AMDGPU_BO_LIST 0x03
45#define DRM_AMDGPU_CS 0x04
46#define DRM_AMDGPU_INFO 0x05
47#define DRM_AMDGPU_GEM_METADATA 0x06
48#define DRM_AMDGPU_GEM_WAIT_IDLE 0x07
49#define DRM_AMDGPU_GEM_VA 0x08
50#define DRM_AMDGPU_WAIT_CS 0x09
51#define DRM_AMDGPU_GEM_OP 0x10
52#define DRM_AMDGPU_GEM_USERPTR 0x11
53#define DRM_AMDGPU_WAIT_FENCES 0x12
54#define DRM_AMDGPU_VM 0x13
55#define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
56#define DRM_AMDGPU_SCHED 0x15
57
58#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
59#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
60#define DRM_IOCTL_AMDGPU_CTX DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CTX, union drm_amdgpu_ctx)
61#define DRM_IOCTL_AMDGPU_BO_LIST DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_BO_LIST, union drm_amdgpu_bo_list)
62#define DRM_IOCTL_AMDGPU_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CS, union drm_amdgpu_cs)
63#define DRM_IOCTL_AMDGPU_INFO DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_INFO, struct drm_amdgpu_info)
64#define DRM_IOCTL_AMDGPU_GEM_METADATA DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_METADATA, struct drm_amdgpu_gem_metadata)
65#define DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_WAIT_IDLE, union drm_amdgpu_gem_wait_idle)
66#define DRM_IOCTL_AMDGPU_GEM_VA DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_VA, struct drm_amdgpu_gem_va)
67#define DRM_IOCTL_AMDGPU_WAIT_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_CS, union drm_amdgpu_wait_cs)
68#define DRM_IOCTL_AMDGPU_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op)
69#define DRM_IOCTL_AMDGPU_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr)
70#define DRM_IOCTL_AMDGPU_WAIT_FENCES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences)
71#define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
72#define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
73#define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
74
75/**
76 * DOC: memory domains
77 *
78 * %AMDGPU_GEM_DOMAIN_CPU System memory that is not GPU accessible.
79 * Memory in this pool could be swapped out to disk if there is pressure.
80 *
81 * %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the
82 * GPU's virtual address space via gart. Gart memory linearizes non-contiguous
83 * pages of system memory, allows GPU access system memory in a linezrized
84 * fashion.
85 *
86 * %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory
87 * carved out by the BIOS.
88 *
89 * %AMDGPU_GEM_DOMAIN_GDS Global on-chip data storage used to share data
90 * across shader threads.
91 *
92 * %AMDGPU_GEM_DOMAIN_GWS Global wave sync, used to synchronize the
93 * execution of all the waves on a device.
94 *
95 * %AMDGPU_GEM_DOMAIN_OA Ordered append, used by 3D or Compute engines
96 * for appending data.
97 */
98#define AMDGPU_GEM_DOMAIN_CPU 0x1
99#define AMDGPU_GEM_DOMAIN_GTT 0x2
100#define AMDGPU_GEM_DOMAIN_VRAM 0x4
101#define AMDGPU_GEM_DOMAIN_GDS 0x8
102#define AMDGPU_GEM_DOMAIN_GWS 0x10
103#define AMDGPU_GEM_DOMAIN_OA 0x20
104#define AMDGPU_GEM_DOMAIN_MASK (AMDGPU_GEM_DOMAIN_CPU | \
105 AMDGPU_GEM_DOMAIN_GTT | \
106 AMDGPU_GEM_DOMAIN_VRAM | \
107 AMDGPU_GEM_DOMAIN_GDS | \
108 AMDGPU_GEM_DOMAIN_GWS | \
109 AMDGPU_GEM_DOMAIN_OA)
110
111/* Flag that CPU access will be required for the case of VRAM domain */
112#define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0)
113/* Flag that CPU access will not work, this VRAM domain is invisible */
114#define AMDGPU_GEM_CREATE_NO_CPU_ACCESS (1 << 1)
115/* Flag that USWC attributes should be used for GTT */
116#define AMDGPU_GEM_CREATE_CPU_GTT_USWC (1 << 2)
117/* Flag that the memory should be in VRAM and cleared */
118#define AMDGPU_GEM_CREATE_VRAM_CLEARED (1 << 3)
119/* Flag that allocating the BO should use linear VRAM */
120#define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5)
121/* Flag that BO is always valid in this VM */
122#define AMDGPU_GEM_CREATE_VM_ALWAYS_VALID (1 << 6)
123/* Flag that BO sharing will be explicitly synchronized */
124#define AMDGPU_GEM_CREATE_EXPLICIT_SYNC (1 << 7)
125/* Flag that indicates allocating MQD gart on GFX9, where the mtype
126 * for the second page onward should be set to NC. It should never
127 * be used by user space applications.
128 */
129#define AMDGPU_GEM_CREATE_CP_MQD_GFX9 (1 << 8)
130/* Flag that BO may contain sensitive data that must be wiped before
131 * releasing the memory
132 */
133#define AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE (1 << 9)
134/* Flag that BO will be encrypted and that the TMZ bit should be
135 * set in the PTEs when mapping this buffer via GPUVM or
136 * accessing it with various hw blocks
137 */
138#define AMDGPU_GEM_CREATE_ENCRYPTED (1 << 10)
139/* Flag that BO will be used only in preemptible context, which does
140 * not require GTT memory accounting
141 */
142#define AMDGPU_GEM_CREATE_PREEMPTIBLE (1 << 11)
143
144struct drm_amdgpu_gem_create_in {
145 /** the requested memory size */
146 __u64 bo_size;
147 /** physical start_addr alignment in bytes for some HW requirements */
148 __u64 alignment;
149 /** the requested memory domains */
150 __u64 domains;
151 /** allocation flags */
152 __u64 domain_flags;
153};
154
155struct drm_amdgpu_gem_create_out {
156 /** returned GEM object handle */
157 __u32 handle;
158 __u32 _pad;
159};
160
161union drm_amdgpu_gem_create {
162 struct drm_amdgpu_gem_create_in in;
163 struct drm_amdgpu_gem_create_out out;
164};
165
166/** Opcode to create new residency list. */
167#define AMDGPU_BO_LIST_OP_CREATE 0
168/** Opcode to destroy previously created residency list */
169#define AMDGPU_BO_LIST_OP_DESTROY 1
170/** Opcode to update resource information in the list */
171#define AMDGPU_BO_LIST_OP_UPDATE 2
172
173struct drm_amdgpu_bo_list_in {
174 /** Type of operation */
175 __u32 operation;
176 /** Handle of list or 0 if we want to create one */
177 __u32 list_handle;
178 /** Number of BOs in list */
179 __u32 bo_number;
180 /** Size of each element describing BO */
181 __u32 bo_info_size;
182 /** Pointer to array describing BOs */
183 __u64 bo_info_ptr;
184};
185
186struct drm_amdgpu_bo_list_entry {
187 /** Handle of BO */
188 __u32 bo_handle;
189 /** New (if specified) BO priority to be used during migration */
190 __u32 bo_priority;
191};
192
193struct drm_amdgpu_bo_list_out {
194 /** Handle of resource list */
195 __u32 list_handle;
196 __u32 _pad;
197};
198
199union drm_amdgpu_bo_list {
200 struct drm_amdgpu_bo_list_in in;
201 struct drm_amdgpu_bo_list_out out;
202};
203
204/* context related */
205#define AMDGPU_CTX_OP_ALLOC_CTX 1
206#define AMDGPU_CTX_OP_FREE_CTX 2
207#define AMDGPU_CTX_OP_QUERY_STATE 3
208#define AMDGPU_CTX_OP_QUERY_STATE2 4
209
210/* GPU reset status */
211#define AMDGPU_CTX_NO_RESET 0
212/* this the context caused it */
213#define AMDGPU_CTX_GUILTY_RESET 1
214/* some other context caused it */
215#define AMDGPU_CTX_INNOCENT_RESET 2
216/* unknown cause */
217#define AMDGPU_CTX_UNKNOWN_RESET 3
218
219/* indicate gpu reset occured after ctx created */
220#define AMDGPU_CTX_QUERY2_FLAGS_RESET (1<<0)
221/* indicate vram lost occured after ctx created */
222#define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1<<1)
223/* indicate some job from this context once cause gpu hang */
224#define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1<<2)
225/* indicate some errors are detected by RAS */
226#define AMDGPU_CTX_QUERY2_FLAGS_RAS_CE (1<<3)
227#define AMDGPU_CTX_QUERY2_FLAGS_RAS_UE (1<<4)
228
229/* Context priority level */
230#define AMDGPU_CTX_PRIORITY_UNSET -2048
231#define AMDGPU_CTX_PRIORITY_VERY_LOW -1023
232#define AMDGPU_CTX_PRIORITY_LOW -512
233#define AMDGPU_CTX_PRIORITY_NORMAL 0
234/*
235 * When used in struct drm_amdgpu_ctx_in, a priority above NORMAL requires
236 * CAP_SYS_NICE or DRM_MASTER
237*/
238#define AMDGPU_CTX_PRIORITY_HIGH 512
239#define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023
240
241struct drm_amdgpu_ctx_in {
242 /** AMDGPU_CTX_OP_* */
243 __u32 op;
244 /** For future use, no flags defined so far */
245 __u32 flags;
246 __u32 ctx_id;
247 /** AMDGPU_CTX_PRIORITY_* */
248 __s32 priority;
249};
250
251union drm_amdgpu_ctx_out {
252 struct {
253 __u32 ctx_id;
254 __u32 _pad;
255 } alloc;
256
257 struct {
258 /** For future use, no flags defined so far */
259 __u64 flags;
260 /** Number of resets caused by this context so far. */
261 __u32 hangs;
262 /** Reset status since the last call of the ioctl. */
263 __u32 reset_status;
264 } state;
265};
266
267union drm_amdgpu_ctx {
268 struct drm_amdgpu_ctx_in in;
269 union drm_amdgpu_ctx_out out;
270};
271
272/* vm ioctl */
273#define AMDGPU_VM_OP_RESERVE_VMID 1
274#define AMDGPU_VM_OP_UNRESERVE_VMID 2
275
276struct drm_amdgpu_vm_in {
277 /** AMDGPU_VM_OP_* */
278 __u32 op;
279 __u32 flags;
280};
281
282struct drm_amdgpu_vm_out {
283 /** For future use, no flags defined so far */
284 __u64 flags;
285};
286
287union drm_amdgpu_vm {
288 struct drm_amdgpu_vm_in in;
289 struct drm_amdgpu_vm_out out;
290};
291
292/* sched ioctl */
293#define AMDGPU_SCHED_OP_PROCESS_PRIORITY_OVERRIDE 1
294#define AMDGPU_SCHED_OP_CONTEXT_PRIORITY_OVERRIDE 2
295
296struct drm_amdgpu_sched_in {
297 /* AMDGPU_SCHED_OP_* */
298 __u32 op;
299 __u32 fd;
300 /** AMDGPU_CTX_PRIORITY_* */
301 __s32 priority;
302 __u32 ctx_id;
303};
304
305union drm_amdgpu_sched {
306 struct drm_amdgpu_sched_in in;
307};
308
309/*
310 * This is not a reliable API and you should expect it to fail for any
311 * number of reasons and have fallback path that do not use userptr to
312 * perform any operation.
313 */
314#define AMDGPU_GEM_USERPTR_READONLY (1 << 0)
315#define AMDGPU_GEM_USERPTR_ANONONLY (1 << 1)
316#define AMDGPU_GEM_USERPTR_VALIDATE (1 << 2)
317#define AMDGPU_GEM_USERPTR_REGISTER (1 << 3)
318
319struct drm_amdgpu_gem_userptr {
320 __u64 addr;
321 __u64 size;
322 /* AMDGPU_GEM_USERPTR_* */
323 __u32 flags;
324 /* Resulting GEM handle */
325 __u32 handle;
326};
327
328/* SI-CI-VI: */
329/* same meaning as the GB_TILE_MODE and GL_MACRO_TILE_MODE fields */
330#define AMDGPU_TILING_ARRAY_MODE_SHIFT 0
331#define AMDGPU_TILING_ARRAY_MODE_MASK 0xf
332#define AMDGPU_TILING_PIPE_CONFIG_SHIFT 4
333#define AMDGPU_TILING_PIPE_CONFIG_MASK 0x1f
334#define AMDGPU_TILING_TILE_SPLIT_SHIFT 9
335#define AMDGPU_TILING_TILE_SPLIT_MASK 0x7
336#define AMDGPU_TILING_MICRO_TILE_MODE_SHIFT 12
337#define AMDGPU_TILING_MICRO_TILE_MODE_MASK 0x7
338#define AMDGPU_TILING_BANK_WIDTH_SHIFT 15
339#define AMDGPU_TILING_BANK_WIDTH_MASK 0x3
340#define AMDGPU_TILING_BANK_HEIGHT_SHIFT 17
341#define AMDGPU_TILING_BANK_HEIGHT_MASK 0x3
342#define AMDGPU_TILING_MACRO_TILE_ASPECT_SHIFT 19
343#define AMDGPU_TILING_MACRO_TILE_ASPECT_MASK 0x3
344#define AMDGPU_TILING_NUM_BANKS_SHIFT 21
345#define AMDGPU_TILING_NUM_BANKS_MASK 0x3
346
347/* GFX9 and later: */
348#define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0
349#define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f
350#define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5
351#define AMDGPU_TILING_DCC_OFFSET_256B_MASK 0xFFFFFF
352#define AMDGPU_TILING_DCC_PITCH_MAX_SHIFT 29
353#define AMDGPU_TILING_DCC_PITCH_MAX_MASK 0x3FFF
354#define AMDGPU_TILING_DCC_INDEPENDENT_64B_SHIFT 43
355#define AMDGPU_TILING_DCC_INDEPENDENT_64B_MASK 0x1
356#define AMDGPU_TILING_DCC_INDEPENDENT_128B_SHIFT 44
357#define AMDGPU_TILING_DCC_INDEPENDENT_128B_MASK 0x1
358#define AMDGPU_TILING_SCANOUT_SHIFT 63
359#define AMDGPU_TILING_SCANOUT_MASK 0x1
360
361/* Set/Get helpers for tiling flags. */
362#define AMDGPU_TILING_SET(field, value) \
363 (((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT)
364#define AMDGPU_TILING_GET(value, field) \
365 (((__u64)(value) >> AMDGPU_TILING_##field##_SHIFT) & AMDGPU_TILING_##field##_MASK)
366
367#define AMDGPU_GEM_METADATA_OP_SET_METADATA 1
368#define AMDGPU_GEM_METADATA_OP_GET_METADATA 2
369
370/** The same structure is shared for input/output */
371struct drm_amdgpu_gem_metadata {
372 /** GEM Object handle */
373 __u32 handle;
374 /** Do we want get or set metadata */
375 __u32 op;
376 struct {
377 /** For future use, no flags defined so far */
378 __u64 flags;
379 /** family specific tiling info */
380 __u64 tiling_info;
381 __u32 data_size_bytes;
382 __u32 data[64];
383 } data;
384};
385
386struct drm_amdgpu_gem_mmap_in {
387 /** the GEM object handle */
388 __u32 handle;
389 __u32 _pad;
390};
391
392struct drm_amdgpu_gem_mmap_out {
393 /** mmap offset from the vma offset manager */
394 __u64 addr_ptr;
395};
396
397union drm_amdgpu_gem_mmap {
398 struct drm_amdgpu_gem_mmap_in in;
399 struct drm_amdgpu_gem_mmap_out out;
400};
401
402struct drm_amdgpu_gem_wait_idle_in {
403 /** GEM object handle */
404 __u32 handle;
405 /** For future use, no flags defined so far */
406 __u32 flags;
407 /** Absolute timeout to wait */
408 __u64 timeout;
409};
410
411struct drm_amdgpu_gem_wait_idle_out {
412 /** BO status: 0 - BO is idle, 1 - BO is busy */
413 __u32 status;
414 /** Returned current memory domain */
415 __u32 domain;
416};
417
418union drm_amdgpu_gem_wait_idle {
419 struct drm_amdgpu_gem_wait_idle_in in;
420 struct drm_amdgpu_gem_wait_idle_out out;
421};
422
423struct drm_amdgpu_wait_cs_in {
424 /* Command submission handle
425 * handle equals 0 means none to wait for
426 * handle equals ~0ull means wait for the latest sequence number
427 */
428 __u64 handle;
429 /** Absolute timeout to wait */
430 __u64 timeout;
431 __u32 ip_type;
432 __u32 ip_instance;
433 __u32 ring;
434 __u32 ctx_id;
435};
436
437struct drm_amdgpu_wait_cs_out {
438 /** CS status: 0 - CS completed, 1 - CS still busy */
439 __u64 status;
440};
441
442union drm_amdgpu_wait_cs {
443 struct drm_amdgpu_wait_cs_in in;
444 struct drm_amdgpu_wait_cs_out out;
445};
446
447struct drm_amdgpu_fence {
448 __u32 ctx_id;
449 __u32 ip_type;
450 __u32 ip_instance;
451 __u32 ring;
452 __u64 seq_no;
453};
454
455struct drm_amdgpu_wait_fences_in {
456 /** This points to uint64_t * which points to fences */
457 __u64 fences;
458 __u32 fence_count;
459 __u32 wait_all;
460 __u64 timeout_ns;
461};
462
463struct drm_amdgpu_wait_fences_out {
464 __u32 status;
465 __u32 first_signaled;
466};
467
468union drm_amdgpu_wait_fences {
469 struct drm_amdgpu_wait_fences_in in;
470 struct drm_amdgpu_wait_fences_out out;
471};
472
473#define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0
474#define AMDGPU_GEM_OP_SET_PLACEMENT 1
475
476/* Sets or returns a value associated with a buffer. */
477struct drm_amdgpu_gem_op {
478 /** GEM object handle */
479 __u32 handle;
480 /** AMDGPU_GEM_OP_* */
481 __u32 op;
482 /** Input or return value */
483 __u64 value;
484};
485
486#define AMDGPU_VA_OP_MAP 1
487#define AMDGPU_VA_OP_UNMAP 2
488#define AMDGPU_VA_OP_CLEAR 3
489#define AMDGPU_VA_OP_REPLACE 4
490
491/* Delay the page table update till the next CS */
492#define AMDGPU_VM_DELAY_UPDATE (1 << 0)
493
494/* Mapping flags */
495/* readable mapping */
496#define AMDGPU_VM_PAGE_READABLE (1 << 1)
497/* writable mapping */
498#define AMDGPU_VM_PAGE_WRITEABLE (1 << 2)
499/* executable mapping, new for VI */
500#define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3)
501/* partially resident texture */
502#define AMDGPU_VM_PAGE_PRT (1 << 4)
503/* MTYPE flags use bit 5 to 8 */
504#define AMDGPU_VM_MTYPE_MASK (0xf << 5)
505/* Default MTYPE. Pre-AI must use this. Recommended for newer ASICs. */
506#define AMDGPU_VM_MTYPE_DEFAULT (0 << 5)
507/* Use Non Coherent MTYPE instead of default MTYPE */
508#define AMDGPU_VM_MTYPE_NC (1 << 5)
509/* Use Write Combine MTYPE instead of default MTYPE */
510#define AMDGPU_VM_MTYPE_WC (2 << 5)
511/* Use Cache Coherent MTYPE instead of default MTYPE */
512#define AMDGPU_VM_MTYPE_CC (3 << 5)
513/* Use UnCached MTYPE instead of default MTYPE */
514#define AMDGPU_VM_MTYPE_UC (4 << 5)
515/* Use Read Write MTYPE instead of default MTYPE */
516#define AMDGPU_VM_MTYPE_RW (5 << 5)
517
518struct drm_amdgpu_gem_va {
519 /** GEM object handle */
520 __u32 handle;
521 __u32 _pad;
522 /** AMDGPU_VA_OP_* */
523 __u32 operation;
524 /** AMDGPU_VM_PAGE_* */
525 __u32 flags;
526 /** va address to assign . Must be correctly aligned.*/
527 __u64 va_address;
528 /** Specify offset inside of BO to assign. Must be correctly aligned.*/
529 __u64 offset_in_bo;
530 /** Specify mapping size. Must be correctly aligned. */
531 __u64 map_size;
532};
533
534#define AMDGPU_HW_IP_GFX 0
535#define AMDGPU_HW_IP_COMPUTE 1
536#define AMDGPU_HW_IP_DMA 2
537#define AMDGPU_HW_IP_UVD 3
538#define AMDGPU_HW_IP_VCE 4
539#define AMDGPU_HW_IP_UVD_ENC 5
540#define AMDGPU_HW_IP_VCN_DEC 6
541#define AMDGPU_HW_IP_VCN_ENC 7
542#define AMDGPU_HW_IP_VCN_JPEG 8
543#define AMDGPU_HW_IP_NUM 9
544
545#define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1
546
547#define AMDGPU_CHUNK_ID_IB 0x01
548#define AMDGPU_CHUNK_ID_FENCE 0x02
549#define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03
550#define AMDGPU_CHUNK_ID_SYNCOBJ_IN 0x04
551#define AMDGPU_CHUNK_ID_SYNCOBJ_OUT 0x05
552#define AMDGPU_CHUNK_ID_BO_HANDLES 0x06
553#define AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES 0x07
554#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x08
555#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x09
556
557struct drm_amdgpu_cs_chunk {
558 __u32 chunk_id;
559 __u32 length_dw;
560 __u64 chunk_data;
561};
562
563struct drm_amdgpu_cs_in {
564 /** Rendering context id */
565 __u32 ctx_id;
566 /** Handle of resource list associated with CS */
567 __u32 bo_list_handle;
568 __u32 num_chunks;
569 __u32 flags;
570 /** this points to __u64 * which point to cs chunks */
571 __u64 chunks;
572};
573
574struct drm_amdgpu_cs_out {
575 __u64 handle;
576};
577
578union drm_amdgpu_cs {
579 struct drm_amdgpu_cs_in in;
580 struct drm_amdgpu_cs_out out;
581};
582
583/* Specify flags to be used for IB */
584
585/* This IB should be submitted to CE */
586#define AMDGPU_IB_FLAG_CE (1<<0)
587
588/* Preamble flag, which means the IB could be dropped if no context switch */
589#define AMDGPU_IB_FLAG_PREAMBLE (1<<1)
590
591/* Preempt flag, IB should set Pre_enb bit if PREEMPT flag detected */
592#define AMDGPU_IB_FLAG_PREEMPT (1<<2)
593
594/* The IB fence should do the L2 writeback but not invalidate any shader
595 * caches (L2/vL1/sL1/I$). */
596#define AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE (1 << 3)
597
598/* Set GDS_COMPUTE_MAX_WAVE_ID = DEFAULT before PACKET3_INDIRECT_BUFFER.
599 * This will reset wave ID counters for the IB.
600 */
601#define AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID (1 << 4)
602
603/* Flag the IB as secure (TMZ)
604 */
605#define AMDGPU_IB_FLAGS_SECURE (1 << 5)
606
607/* Tell KMD to flush and invalidate caches
608 */
609#define AMDGPU_IB_FLAG_EMIT_MEM_SYNC (1 << 6)
610
611struct drm_amdgpu_cs_chunk_ib {
612 __u32 _pad;
613 /** AMDGPU_IB_FLAG_* */
614 __u32 flags;
615 /** Virtual address to begin IB execution */
616 __u64 va_start;
617 /** Size of submission */
618 __u32 ib_bytes;
619 /** HW IP to submit to */
620 __u32 ip_type;
621 /** HW IP index of the same type to submit to */
622 __u32 ip_instance;
623 /** Ring index to submit to */
624 __u32 ring;
625};
626
627struct drm_amdgpu_cs_chunk_dep {
628 __u32 ip_type;
629 __u32 ip_instance;
630 __u32 ring;
631 __u32 ctx_id;
632 __u64 handle;
633};
634
635struct drm_amdgpu_cs_chunk_fence {
636 __u32 handle;
637 __u32 offset;
638};
639
640struct drm_amdgpu_cs_chunk_sem {
641 __u32 handle;
642};
643
644struct drm_amdgpu_cs_chunk_syncobj {
645 __u32 handle;
646 __u32 flags;
647 __u64 point;
648};
649
650#define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ 0
651#define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD 1
652#define AMDGPU_FENCE_TO_HANDLE_GET_SYNC_FILE_FD 2
653
654union drm_amdgpu_fence_to_handle {
655 struct {
656 struct drm_amdgpu_fence fence;
657 __u32 what;
658 __u32 pad;
659 } in;
660 struct {
661 __u32 handle;
662 } out;
663};
664
665struct drm_amdgpu_cs_chunk_data {
666 union {
667 struct drm_amdgpu_cs_chunk_ib ib_data;
668 struct drm_amdgpu_cs_chunk_fence fence_data;
669 };
670};
671
672/*
673 * Query h/w info: Flag that this is integrated (a.h.a. fusion) GPU
674 *
675 */
676#define AMDGPU_IDS_FLAGS_FUSION 0x1
677#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
678#define AMDGPU_IDS_FLAGS_TMZ 0x4
679
680/* indicate if acceleration can be working */
681#define AMDGPU_INFO_ACCEL_WORKING 0x00
682/* get the crtc_id from the mode object id? */
683#define AMDGPU_INFO_CRTC_FROM_ID 0x01
684/* query hw IP info */
685#define AMDGPU_INFO_HW_IP_INFO 0x02
686/* query hw IP instance count for the specified type */
687#define AMDGPU_INFO_HW_IP_COUNT 0x03
688/* timestamp for GL_ARB_timer_query */
689#define AMDGPU_INFO_TIMESTAMP 0x05
690/* Query the firmware version */
691#define AMDGPU_INFO_FW_VERSION 0x0e
692 /* Subquery id: Query VCE firmware version */
693 #define AMDGPU_INFO_FW_VCE 0x1
694 /* Subquery id: Query UVD firmware version */
695 #define AMDGPU_INFO_FW_UVD 0x2
696 /* Subquery id: Query GMC firmware version */
697 #define AMDGPU_INFO_FW_GMC 0x03
698 /* Subquery id: Query GFX ME firmware version */
699 #define AMDGPU_INFO_FW_GFX_ME 0x04
700 /* Subquery id: Query GFX PFP firmware version */
701 #define AMDGPU_INFO_FW_GFX_PFP 0x05
702 /* Subquery id: Query GFX CE firmware version */
703 #define AMDGPU_INFO_FW_GFX_CE 0x06
704 /* Subquery id: Query GFX RLC firmware version */
705 #define AMDGPU_INFO_FW_GFX_RLC 0x07
706 /* Subquery id: Query GFX MEC firmware version */
707 #define AMDGPU_INFO_FW_GFX_MEC 0x08
708 /* Subquery id: Query SMC firmware version */
709 #define AMDGPU_INFO_FW_SMC 0x0a
710 /* Subquery id: Query SDMA firmware version */
711 #define AMDGPU_INFO_FW_SDMA 0x0b
712 /* Subquery id: Query PSP SOS firmware version */
713 #define AMDGPU_INFO_FW_SOS 0x0c
714 /* Subquery id: Query PSP ASD firmware version */
715 #define AMDGPU_INFO_FW_ASD 0x0d
716 /* Subquery id: Query VCN firmware version */
717 #define AMDGPU_INFO_FW_VCN 0x0e
718 /* Subquery id: Query GFX RLC SRLC firmware version */
719 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_CNTL 0x0f
720 /* Subquery id: Query GFX RLC SRLG firmware version */
721 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10
722 /* Subquery id: Query GFX RLC SRLS firmware version */
723 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11
724 /* Subquery id: Query DMCU firmware version */
725 #define AMDGPU_INFO_FW_DMCU 0x12
726 #define AMDGPU_INFO_FW_TA 0x13
727 /* Subquery id: Query DMCUB firmware version */
728 #define AMDGPU_INFO_FW_DMCUB 0x14
729 /* Subquery id: Query TOC firmware version */
730 #define AMDGPU_INFO_FW_TOC 0x15
731
732/* number of bytes moved for TTM migration */
733#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
734/* the used VRAM size */
735#define AMDGPU_INFO_VRAM_USAGE 0x10
736/* the used GTT size */
737#define AMDGPU_INFO_GTT_USAGE 0x11
738/* Information about GDS, etc. resource configuration */
739#define AMDGPU_INFO_GDS_CONFIG 0x13
740/* Query information about VRAM and GTT domains */
741#define AMDGPU_INFO_VRAM_GTT 0x14
742/* Query information about register in MMR address space*/
743#define AMDGPU_INFO_READ_MMR_REG 0x15
744/* Query information about device: rev id, family, etc. */
745#define AMDGPU_INFO_DEV_INFO 0x16
746/* visible vram usage */
747#define AMDGPU_INFO_VIS_VRAM_USAGE 0x17
748/* number of TTM buffer evictions */
749#define AMDGPU_INFO_NUM_EVICTIONS 0x18
750/* Query memory about VRAM and GTT domains */
751#define AMDGPU_INFO_MEMORY 0x19
752/* Query vce clock table */
753#define AMDGPU_INFO_VCE_CLOCK_TABLE 0x1A
754/* Query vbios related information */
755#define AMDGPU_INFO_VBIOS 0x1B
756 /* Subquery id: Query vbios size */
757 #define AMDGPU_INFO_VBIOS_SIZE 0x1
758 /* Subquery id: Query vbios image */
759 #define AMDGPU_INFO_VBIOS_IMAGE 0x2
760 /* Subquery id: Query vbios info */
761 #define AMDGPU_INFO_VBIOS_INFO 0x3
762/* Query UVD handles */
763#define AMDGPU_INFO_NUM_HANDLES 0x1C
764/* Query sensor related information */
765#define AMDGPU_INFO_SENSOR 0x1D
766 /* Subquery id: Query GPU shader clock */
767 #define AMDGPU_INFO_SENSOR_GFX_SCLK 0x1
768 /* Subquery id: Query GPU memory clock */
769 #define AMDGPU_INFO_SENSOR_GFX_MCLK 0x2
770 /* Subquery id: Query GPU temperature */
771 #define AMDGPU_INFO_SENSOR_GPU_TEMP 0x3
772 /* Subquery id: Query GPU load */
773 #define AMDGPU_INFO_SENSOR_GPU_LOAD 0x4
774 /* Subquery id: Query average GPU power */
775 #define AMDGPU_INFO_SENSOR_GPU_AVG_POWER 0x5
776 /* Subquery id: Query northbridge voltage */
777 #define AMDGPU_INFO_SENSOR_VDDNB 0x6
778 /* Subquery id: Query graphics voltage */
779 #define AMDGPU_INFO_SENSOR_VDDGFX 0x7
780 /* Subquery id: Query GPU stable pstate shader clock */
781 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
782 /* Subquery id: Query GPU stable pstate memory clock */
783 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
784/* Number of VRAM page faults on CPU access. */
785#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
786#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
787/* query ras mask of enabled features*/
788#define AMDGPU_INFO_RAS_ENABLED_FEATURES 0x20
789/* RAS MASK: UMC (VRAM) */
790#define AMDGPU_INFO_RAS_ENABLED_UMC (1 << 0)
791/* RAS MASK: SDMA */
792#define AMDGPU_INFO_RAS_ENABLED_SDMA (1 << 1)
793/* RAS MASK: GFX */
794#define AMDGPU_INFO_RAS_ENABLED_GFX (1 << 2)
795/* RAS MASK: MMHUB */
796#define AMDGPU_INFO_RAS_ENABLED_MMHUB (1 << 3)
797/* RAS MASK: ATHUB */
798#define AMDGPU_INFO_RAS_ENABLED_ATHUB (1 << 4)
799/* RAS MASK: PCIE */
800#define AMDGPU_INFO_RAS_ENABLED_PCIE (1 << 5)
801/* RAS MASK: HDP */
802#define AMDGPU_INFO_RAS_ENABLED_HDP (1 << 6)
803/* RAS MASK: XGMI */
804#define AMDGPU_INFO_RAS_ENABLED_XGMI (1 << 7)
805/* RAS MASK: DF */
806#define AMDGPU_INFO_RAS_ENABLED_DF (1 << 8)
807/* RAS MASK: SMN */
808#define AMDGPU_INFO_RAS_ENABLED_SMN (1 << 9)
809/* RAS MASK: SEM */
810#define AMDGPU_INFO_RAS_ENABLED_SEM (1 << 10)
811/* RAS MASK: MP0 */
812#define AMDGPU_INFO_RAS_ENABLED_MP0 (1 << 11)
813/* RAS MASK: MP1 */
814#define AMDGPU_INFO_RAS_ENABLED_MP1 (1 << 12)
815/* RAS MASK: FUSE */
816#define AMDGPU_INFO_RAS_ENABLED_FUSE (1 << 13)
817/* query video encode/decode caps */
818#define AMDGPU_INFO_VIDEO_CAPS 0x21
819 /* Subquery id: Decode */
820 #define AMDGPU_INFO_VIDEO_CAPS_DECODE 0
821 /* Subquery id: Encode */
822 #define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1
823
824#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
825#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
826#define AMDGPU_INFO_MMR_SH_INDEX_SHIFT 8
827#define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff
828
829struct drm_amdgpu_query_fw {
830 /** AMDGPU_INFO_FW_* */
831 __u32 fw_type;
832 /**
833 * Index of the IP if there are more IPs of
834 * the same type.
835 */
836 __u32 ip_instance;
837 /**
838 * Index of the engine. Whether this is used depends
839 * on the firmware type. (e.g. MEC, SDMA)
840 */
841 __u32 index;
842 __u32 _pad;
843};
844
845/* Input structure for the INFO ioctl */
846struct drm_amdgpu_info {
847 /* Where the return value will be stored */
848 __u64 return_pointer;
849 /* The size of the return value. Just like "size" in "snprintf",
850 * it limits how many bytes the kernel can write. */
851 __u32 return_size;
852 /* The query request id. */
853 __u32 query;
854
855 union {
856 struct {
857 __u32 id;
858 __u32 _pad;
859 } mode_crtc;
860
861 struct {
862 /** AMDGPU_HW_IP_* */
863 __u32 type;
864 /**
865 * Index of the IP if there are more IPs of the same
866 * type. Ignored by AMDGPU_INFO_HW_IP_COUNT.
867 */
868 __u32 ip_instance;
869 } query_hw_ip;
870
871 struct {
872 __u32 dword_offset;
873 /** number of registers to read */
874 __u32 count;
875 __u32 instance;
876 /** For future use, no flags defined so far */
877 __u32 flags;
878 } read_mmr_reg;
879
880 struct drm_amdgpu_query_fw query_fw;
881
882 struct {
883 __u32 type;
884 __u32 offset;
885 } vbios_info;
886
887 struct {
888 __u32 type;
889 } sensor_info;
890
891 struct {
892 __u32 type;
893 } video_cap;
894 };
895};
896
897struct drm_amdgpu_info_gds {
898 /** GDS GFX partition size */
899 __u32 gds_gfx_partition_size;
900 /** GDS compute partition size */
901 __u32 compute_partition_size;
902 /** total GDS memory size */
903 __u32 gds_total_size;
904 /** GWS size per GFX partition */
905 __u32 gws_per_gfx_partition;
906 /** GSW size per compute partition */
907 __u32 gws_per_compute_partition;
908 /** OA size per GFX partition */
909 __u32 oa_per_gfx_partition;
910 /** OA size per compute partition */
911 __u32 oa_per_compute_partition;
912 __u32 _pad;
913};
914
915struct drm_amdgpu_info_vram_gtt {
916 __u64 vram_size;
917 __u64 vram_cpu_accessible_size;
918 __u64 gtt_size;
919};
920
921struct drm_amdgpu_heap_info {
922 /** max. physical memory */
923 __u64 total_heap_size;
924
925 /** Theoretical max. available memory in the given heap */
926 __u64 usable_heap_size;
927
928 /**
929 * Number of bytes allocated in the heap. This includes all processes
930 * and private allocations in the kernel. It changes when new buffers
931 * are allocated, freed, and moved. It cannot be larger than
932 * heap_size.
933 */
934 __u64 heap_usage;
935
936 /**
937 * Theoretical possible max. size of buffer which
938 * could be allocated in the given heap
939 */
940 __u64 max_allocation;
941};
942
943struct drm_amdgpu_memory_info {
944 struct drm_amdgpu_heap_info vram;
945 struct drm_amdgpu_heap_info cpu_accessible_vram;
946 struct drm_amdgpu_heap_info gtt;
947};
948
949struct drm_amdgpu_info_firmware {
950 __u32 ver;
951 __u32 feature;
952};
953
954struct drm_amdgpu_info_vbios {
955 __u8 name[64];
956 __u8 vbios_pn[64];
957 __u32 version;
958 __u32 pad;
959 __u8 vbios_ver_str[32];
960 __u8 date[32];
961};
962
963#define AMDGPU_VRAM_TYPE_UNKNOWN 0
964#define AMDGPU_VRAM_TYPE_GDDR1 1
965#define AMDGPU_VRAM_TYPE_DDR2 2
966#define AMDGPU_VRAM_TYPE_GDDR3 3
967#define AMDGPU_VRAM_TYPE_GDDR4 4
968#define AMDGPU_VRAM_TYPE_GDDR5 5
969#define AMDGPU_VRAM_TYPE_HBM 6
970#define AMDGPU_VRAM_TYPE_DDR3 7
971#define AMDGPU_VRAM_TYPE_DDR4 8
972#define AMDGPU_VRAM_TYPE_GDDR6 9
973#define AMDGPU_VRAM_TYPE_DDR5 10
974
975struct drm_amdgpu_info_device {
976 /** PCI Device ID */
977 __u32 device_id;
978 /** Internal chip revision: A0, A1, etc.) */
979 __u32 chip_rev;
980 __u32 external_rev;
981 /** Revision id in PCI Config space */
982 __u32 pci_rev;
983 __u32 family;
984 __u32 num_shader_engines;
985 __u32 num_shader_arrays_per_engine;
986 /* in KHz */
987 __u32 gpu_counter_freq;
988 __u64 max_engine_clock;
989 __u64 max_memory_clock;
990 /* cu information */
991 __u32 cu_active_number;
992 /* NOTE: cu_ao_mask is INVALID, DON'T use it */
993 __u32 cu_ao_mask;
994 __u32 cu_bitmap[4][4];
995 /** Render backend pipe mask. One render backend is CB+DB. */
996 __u32 enabled_rb_pipes_mask;
997 __u32 num_rb_pipes;
998 __u32 num_hw_gfx_contexts;
999 __u32 _pad;
1000 __u64 ids_flags;
1001 /** Starting virtual address for UMDs. */
1002 __u64 virtual_address_offset;
1003 /** The maximum virtual address */
1004 __u64 virtual_address_max;
1005 /** Required alignment of virtual addresses. */
1006 __u32 virtual_address_alignment;
1007 /** Page table entry - fragment size */
1008 __u32 pte_fragment_size;
1009 __u32 gart_page_size;
1010 /** constant engine ram size*/
1011 __u32 ce_ram_size;
1012 /** video memory type info*/
1013 __u32 vram_type;
1014 /** video memory bit width*/
1015 __u32 vram_bit_width;
1016 /* vce harvesting instance */
1017 __u32 vce_harvest_config;
1018 /* gfx double offchip LDS buffers */
1019 __u32 gc_double_offchip_lds_buf;
1020 /* NGG Primitive Buffer */
1021 __u64 prim_buf_gpu_addr;
1022 /* NGG Position Buffer */
1023 __u64 pos_buf_gpu_addr;
1024 /* NGG Control Sideband */
1025 __u64 cntl_sb_buf_gpu_addr;
1026 /* NGG Parameter Cache */
1027 __u64 param_buf_gpu_addr;
1028 __u32 prim_buf_size;
1029 __u32 pos_buf_size;
1030 __u32 cntl_sb_buf_size;
1031 __u32 param_buf_size;
1032 /* wavefront size*/
1033 __u32 wave_front_size;
1034 /* shader visible vgprs*/
1035 __u32 num_shader_visible_vgprs;
1036 /* CU per shader array*/
1037 __u32 num_cu_per_sh;
1038 /* number of tcc blocks*/
1039 __u32 num_tcc_blocks;
1040 /* gs vgt table depth*/
1041 __u32 gs_vgt_table_depth;
1042 /* gs primitive buffer depth*/
1043 __u32 gs_prim_buffer_depth;
1044 /* max gs wavefront per vgt*/
1045 __u32 max_gs_waves_per_vgt;
1046 __u32 _pad1;
1047 /* always on cu bitmap */
1048 __u32 cu_ao_bitmap[4][4];
1049 /** Starting high virtual address for UMDs. */
1050 __u64 high_va_offset;
1051 /** The maximum high virtual address */
1052 __u64 high_va_max;
1053 /* gfx10 pa_sc_tile_steering_override */
1054 __u32 pa_sc_tile_steering_override;
1055 /* disabled TCCs */
1056 __u64 tcc_disabled_mask;
1057};
1058
1059struct drm_amdgpu_info_hw_ip {
1060 /** Version of h/w IP */
1061 __u32 hw_ip_version_major;
1062 __u32 hw_ip_version_minor;
1063 /** Capabilities */
1064 __u64 capabilities_flags;
1065 /** command buffer address start alignment*/
1066 __u32 ib_start_alignment;
1067 /** command buffer size alignment*/
1068 __u32 ib_size_alignment;
1069 /** Bitmask of available rings. Bit 0 means ring 0, etc. */
1070 __u32 available_rings;
1071 __u32 _pad;
1072};
1073
1074struct drm_amdgpu_info_num_handles {
1075 /** Max handles as supported by firmware for UVD */
1076 __u32 uvd_max_handles;
1077 /** Handles currently in use for UVD */
1078 __u32 uvd_used_handles;
1079};
1080
1081#define AMDGPU_VCE_CLOCK_TABLE_ENTRIES 6
1082
1083struct drm_amdgpu_info_vce_clock_table_entry {
1084 /** System clock */
1085 __u32 sclk;
1086 /** Memory clock */
1087 __u32 mclk;
1088 /** VCE clock */
1089 __u32 eclk;
1090 __u32 pad;
1091};
1092
1093struct drm_amdgpu_info_vce_clock_table {
1094 struct drm_amdgpu_info_vce_clock_table_entry entries[AMDGPU_VCE_CLOCK_TABLE_ENTRIES];
1095 __u32 num_valid_entries;
1096 __u32 pad;
1097};
1098
1099/* query video encode/decode caps */
1100#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2 0
1101#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4 1
1102#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1 2
1103#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC 3
1104#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC 4
1105#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG 5
1106#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9 6
1107#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1 7
1108#define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT 8
1109
1110struct drm_amdgpu_info_video_codec_info {
1111 __u32 valid;
1112 __u32 max_width;
1113 __u32 max_height;
1114 __u32 max_pixels_per_frame;
1115 __u32 max_level;
1116 __u32 pad;
1117};
1118
1119struct drm_amdgpu_info_video_caps {
1120 struct drm_amdgpu_info_video_codec_info codec_info[AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT];
1121};
1122
1123/*
1124 * Supported GPU families
1125 */
1126#define AMDGPU_FAMILY_UNKNOWN 0
1127#define AMDGPU_FAMILY_SI 110 /* Hainan, Oland, Verde, Pitcairn, Tahiti */
1128#define AMDGPU_FAMILY_CI 120 /* Bonaire, Hawaii */
1129#define AMDGPU_FAMILY_KV 125 /* Kaveri, Kabini, Mullins */
1130#define AMDGPU_FAMILY_VI 130 /* Iceland, Tonga */
1131#define AMDGPU_FAMILY_CZ 135 /* Carrizo, Stoney */
1132#define AMDGPU_FAMILY_AI 141 /* Vega10 */
1133#define AMDGPU_FAMILY_RV 142 /* Raven */
1134#define AMDGPU_FAMILY_NV 143 /* Navi10 */
1135#define AMDGPU_FAMILY_VGH 144 /* Van Gogh */
1136#define AMDGPU_FAMILY_YC 146 /* Yellow Carp */
1137
1138#if defined(__cplusplus)
1139}
1140#endif
1141
1142#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/armada_drm.h created+56
...@@ -0,0 +1,56 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 Russell King
4 * With inspiration from the i915 driver
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef DRM_ARMADA_IOCTL_H
11#define DRM_ARMADA_IOCTL_H
12
13#include "drm.h"
14
15#if defined(__cplusplus)
16extern "C" {
17#endif
18
19#define DRM_ARMADA_GEM_CREATE 0x00
20#define DRM_ARMADA_GEM_MMAP 0x02
21#define DRM_ARMADA_GEM_PWRITE 0x03
22
23#define ARMADA_IOCTL(dir, name, str) \
24 DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
25
26struct drm_armada_gem_create {
27 __u32 handle;
28 __u32 size;
29};
30#define DRM_IOCTL_ARMADA_GEM_CREATE \
31 ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
32
33struct drm_armada_gem_mmap {
34 __u32 handle;
35 __u32 pad;
36 __u64 offset;
37 __u64 size;
38 __u64 addr;
39};
40#define DRM_IOCTL_ARMADA_GEM_MMAP \
41 ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
42
43struct drm_armada_gem_pwrite {
44 __u64 ptr;
45 __u32 handle;
46 __u32 offset;
47 __u32 size;
48};
49#define DRM_IOCTL_ARMADA_GEM_PWRITE \
50 ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
51
52#if defined(__cplusplus)
53}
54#endif
55
56#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/drm.h created+1193
...@@ -0,0 +1,1193 @@
1/*
2 * Header for the Direct Rendering Manager
3 *
4 * Author: Rickard E. (Rik) Faith <faith@valinux.com>
5 *
6 * Acknowledgments:
7 * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
8 */
9
10/*
11 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
12 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
13 * All rights reserved.
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a
16 * copy of this software and associated documentation files (the "Software"),
17 * to deal in the Software without restriction, including without limitation
18 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
19 * and/or sell copies of the Software, and to permit persons to whom the
20 * Software is furnished to do so, subject to the following conditions:
21 *
22 * The above copyright notice and this permission notice (including the next
23 * paragraph) shall be included in all copies or substantial portions of the
24 * Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
29 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
30 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
31 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
32 * OTHER DEALINGS IN THE SOFTWARE.
33 */
34
35#ifndef _DRM_H_
36#define _DRM_H_
37
38#if defined(__linux__)
39
40#include <linux/types.h>
41#include <asm/ioctl.h>
42typedef unsigned int drm_handle_t;
43
44#else /* One of the BSDs */
45
46#include <stdint.h>
47#include <sys/ioccom.h>
48#include <sys/types.h>
49typedef int8_t __s8;
50typedef uint8_t __u8;
51typedef int16_t __s16;
52typedef uint16_t __u16;
53typedef int32_t __s32;
54typedef uint32_t __u32;
55typedef int64_t __s64;
56typedef uint64_t __u64;
57typedef size_t __kernel_size_t;
58typedef unsigned long drm_handle_t;
59
60#endif
61
62#if defined(__cplusplus)
63extern "C" {
64#endif
65
66#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
67#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
68#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
69#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */
70
71#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
72#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */
73#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
74#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
75#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
76
77typedef unsigned int drm_context_t;
78typedef unsigned int drm_drawable_t;
79typedef unsigned int drm_magic_t;
80
81/*
82 * Cliprect.
83 *
84 * \warning: If you change this structure, make sure you change
85 * XF86DRIClipRectRec in the server as well
86 *
87 * \note KW: Actually it's illegal to change either for
88 * backwards-compatibility reasons.
89 */
90struct drm_clip_rect {
91 unsigned short x1;
92 unsigned short y1;
93 unsigned short x2;
94 unsigned short y2;
95};
96
97/*
98 * Drawable information.
99 */
100struct drm_drawable_info {
101 unsigned int num_rects;
102 struct drm_clip_rect *rects;
103};
104
105/*
106 * Texture region,
107 */
108struct drm_tex_region {
109 unsigned char next;
110 unsigned char prev;
111 unsigned char in_use;
112 unsigned char padding;
113 unsigned int age;
114};
115
116/*
117 * Hardware lock.
118 *
119 * The lock structure is a simple cache-line aligned integer. To avoid
120 * processor bus contention on a multiprocessor system, there should not be any
121 * other data stored in the same cache line.
122 */
123struct drm_hw_lock {
124 __volatile__ unsigned int lock; /**< lock variable */
125 char padding[60]; /**< Pad to cache line */
126};
127
128/*
129 * DRM_IOCTL_VERSION ioctl argument type.
130 *
131 * \sa drmGetVersion().
132 */
133struct drm_version {
134 int version_major; /**< Major version */
135 int version_minor; /**< Minor version */
136 int version_patchlevel; /**< Patch level */
137 __kernel_size_t name_len; /**< Length of name buffer */
138 char *name; /**< Name of driver */
139 __kernel_size_t date_len; /**< Length of date buffer */
140 char *date; /**< User-space buffer to hold date */
141 __kernel_size_t desc_len; /**< Length of desc buffer */
142 char *desc; /**< User-space buffer to hold desc */
143};
144
145/*
146 * DRM_IOCTL_GET_UNIQUE ioctl argument type.
147 *
148 * \sa drmGetBusid() and drmSetBusId().
149 */
150struct drm_unique {
151 __kernel_size_t unique_len; /**< Length of unique */
152 char *unique; /**< Unique name for driver instantiation */
153};
154
155struct drm_list {
156 int count; /**< Length of user-space structures */
157 struct drm_version *version;
158};
159
160struct drm_block {
161 int unused;
162};
163
164/*
165 * DRM_IOCTL_CONTROL ioctl argument type.
166 *
167 * \sa drmCtlInstHandler() and drmCtlUninstHandler().
168 */
169struct drm_control {
170 enum {
171 DRM_ADD_COMMAND,
172 DRM_RM_COMMAND,
173 DRM_INST_HANDLER,
174 DRM_UNINST_HANDLER
175 } func;
176 int irq;
177};
178
179/*
180 * Type of memory to map.
181 */
182enum drm_map_type {
183 _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
184 _DRM_REGISTERS = 1, /**< no caching, no core dump */
185 _DRM_SHM = 2, /**< shared, cached */
186 _DRM_AGP = 3, /**< AGP/GART */
187 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
188 _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
189};
190
191/*
192 * Memory mapping flags.
193 */
194enum drm_map_flags {
195 _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
196 _DRM_READ_ONLY = 0x02,
197 _DRM_LOCKED = 0x04, /**< shared, cached, locked */
198 _DRM_KERNEL = 0x08, /**< kernel requires access */
199 _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
200 _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
201 _DRM_REMOVABLE = 0x40, /**< Removable mapping */
202 _DRM_DRIVER = 0x80 /**< Managed by driver */
203};
204
205struct drm_ctx_priv_map {
206 unsigned int ctx_id; /**< Context requesting private mapping */
207 void *handle; /**< Handle of map */
208};
209
210/*
211 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
212 * argument type.
213 *
214 * \sa drmAddMap().
215 */
216struct drm_map {
217 unsigned long offset; /**< Requested physical address (0 for SAREA)*/
218 unsigned long size; /**< Requested physical size (bytes) */
219 enum drm_map_type type; /**< Type of memory to map */
220 enum drm_map_flags flags; /**< Flags */
221 void *handle; /**< User-space: "Handle" to pass to mmap() */
222 /**< Kernel-space: kernel-virtual address */
223 int mtrr; /**< MTRR slot used */
224 /* Private data */
225};
226
227/*
228 * DRM_IOCTL_GET_CLIENT ioctl argument type.
229 */
230struct drm_client {
231 int idx; /**< Which client desired? */
232 int auth; /**< Is client authenticated? */
233 unsigned long pid; /**< Process ID */
234 unsigned long uid; /**< User ID */
235 unsigned long magic; /**< Magic */
236 unsigned long iocs; /**< Ioctl count */
237};
238
239enum drm_stat_type {
240 _DRM_STAT_LOCK,
241 _DRM_STAT_OPENS,
242 _DRM_STAT_CLOSES,
243 _DRM_STAT_IOCTLS,
244 _DRM_STAT_LOCKS,
245 _DRM_STAT_UNLOCKS,
246 _DRM_STAT_VALUE, /**< Generic value */
247 _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */
248 _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */
249
250 _DRM_STAT_IRQ, /**< IRQ */
251 _DRM_STAT_PRIMARY, /**< Primary DMA bytes */
252 _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */
253 _DRM_STAT_DMA, /**< DMA */
254 _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
255 _DRM_STAT_MISSED /**< Missed DMA opportunity */
256 /* Add to the *END* of the list */
257};
258
259/*
260 * DRM_IOCTL_GET_STATS ioctl argument type.
261 */
262struct drm_stats {
263 unsigned long count;
264 struct {
265 unsigned long value;
266 enum drm_stat_type type;
267 } data[15];
268};
269
270/*
271 * Hardware locking flags.
272 */
273enum drm_lock_flags {
274 _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
275 _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
276 _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
277 _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */
278 /* These *HALT* flags aren't supported yet
279 -- they will be used to support the
280 full-screen DGA-like mode. */
281 _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
282 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
283};
284
285/*
286 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
287 *
288 * \sa drmGetLock() and drmUnlock().
289 */
290struct drm_lock {
291 int context;
292 enum drm_lock_flags flags;
293};
294
295/*
296 * DMA flags
297 *
298 * \warning
299 * These values \e must match xf86drm.h.
300 *
301 * \sa drm_dma.
302 */
303enum drm_dma_flags {
304 /* Flags for DMA buffer dispatch */
305 _DRM_DMA_BLOCK = 0x01, /**<
306 * Block until buffer dispatched.
307 *
308 * \note The buffer may not yet have
309 * been processed by the hardware --
310 * getting a hardware lock with the
311 * hardware quiescent will ensure
312 * that the buffer has been
313 * processed.
314 */
315 _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
316 _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */
317
318 /* Flags for DMA buffer request */
319 _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
320 _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
321 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
322};
323
324/*
325 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
326 *
327 * \sa drmAddBufs().
328 */
329struct drm_buf_desc {
330 int count; /**< Number of buffers of this size */
331 int size; /**< Size in bytes */
332 int low_mark; /**< Low water mark */
333 int high_mark; /**< High water mark */
334 enum {
335 _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
336 _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
337 _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
338 _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
339 _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
340 } flags;
341 unsigned long agp_start; /**<
342 * Start address of where the AGP buffers are
343 * in the AGP aperture
344 */
345};
346
347/*
348 * DRM_IOCTL_INFO_BUFS ioctl argument type.
349 */
350struct drm_buf_info {
351 int count; /**< Entries in list */
352 struct drm_buf_desc *list;
353};
354
355/*
356 * DRM_IOCTL_FREE_BUFS ioctl argument type.
357 */
358struct drm_buf_free {
359 int count;
360 int *list;
361};
362
363/*
364 * Buffer information
365 *
366 * \sa drm_buf_map.
367 */
368struct drm_buf_pub {
369 int idx; /**< Index into the master buffer list */
370 int total; /**< Buffer size */
371 int used; /**< Amount of buffer in use (for DMA) */
372 void *address; /**< Address of buffer */
373};
374
375/*
376 * DRM_IOCTL_MAP_BUFS ioctl argument type.
377 */
378struct drm_buf_map {
379 int count; /**< Length of the buffer list */
380#ifdef __cplusplus
381 void *virt;
382#else
383 void *virtual; /**< Mmap'd area in user-virtual */
384#endif
385 struct drm_buf_pub *list; /**< Buffer information */
386};
387
388/*
389 * DRM_IOCTL_DMA ioctl argument type.
390 *
391 * Indices here refer to the offset into the buffer list in drm_buf_get.
392 *
393 * \sa drmDMA().
394 */
395struct drm_dma {
396 int context; /**< Context handle */
397 int send_count; /**< Number of buffers to send */
398 int *send_indices; /**< List of handles to buffers */
399 int *send_sizes; /**< Lengths of data to send */
400 enum drm_dma_flags flags; /**< Flags */
401 int request_count; /**< Number of buffers requested */
402 int request_size; /**< Desired size for buffers */
403 int *request_indices; /**< Buffer information */
404 int *request_sizes;
405 int granted_count; /**< Number of buffers granted */
406};
407
408enum drm_ctx_flags {
409 _DRM_CONTEXT_PRESERVED = 0x01,
410 _DRM_CONTEXT_2DONLY = 0x02
411};
412
413/*
414 * DRM_IOCTL_ADD_CTX ioctl argument type.
415 *
416 * \sa drmCreateContext() and drmDestroyContext().
417 */
418struct drm_ctx {
419 drm_context_t handle;
420 enum drm_ctx_flags flags;
421};
422
423/*
424 * DRM_IOCTL_RES_CTX ioctl argument type.
425 */
426struct drm_ctx_res {
427 int count;
428 struct drm_ctx *contexts;
429};
430
431/*
432 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
433 */
434struct drm_draw {
435 drm_drawable_t handle;
436};
437
438/*
439 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
440 */
441typedef enum {
442 DRM_DRAWABLE_CLIPRECTS
443} drm_drawable_info_type_t;
444
445struct drm_update_draw {
446 drm_drawable_t handle;
447 unsigned int type;
448 unsigned int num;
449 unsigned long long data;
450};
451
452/*
453 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
454 */
455struct drm_auth {
456 drm_magic_t magic;
457};
458
459/*
460 * DRM_IOCTL_IRQ_BUSID ioctl argument type.
461 *
462 * \sa drmGetInterruptFromBusID().
463 */
464struct drm_irq_busid {
465 int irq; /**< IRQ number */
466 int busnum; /**< bus number */
467 int devnum; /**< device number */
468 int funcnum; /**< function number */
469};
470
471enum drm_vblank_seq_type {
472 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
473 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
474 /* bits 1-6 are reserved for high crtcs */
475 _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
476 _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */
477 _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
478 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
479 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
480 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
481};
482#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
483
484#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
485#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
486 _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)
487
488struct drm_wait_vblank_request {
489 enum drm_vblank_seq_type type;
490 unsigned int sequence;
491 unsigned long signal;
492};
493
494struct drm_wait_vblank_reply {
495 enum drm_vblank_seq_type type;
496 unsigned int sequence;
497 long tval_sec;
498 long tval_usec;
499};
500
501/*
502 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
503 *
504 * \sa drmWaitVBlank().
505 */
506union drm_wait_vblank {
507 struct drm_wait_vblank_request request;
508 struct drm_wait_vblank_reply reply;
509};
510
511#define _DRM_PRE_MODESET 1
512#define _DRM_POST_MODESET 2
513
514/*
515 * DRM_IOCTL_MODESET_CTL ioctl argument type
516 *
517 * \sa drmModesetCtl().
518 */
519struct drm_modeset_ctl {
520 __u32 crtc;
521 __u32 cmd;
522};
523
524/*
525 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
526 *
527 * \sa drmAgpEnable().
528 */
529struct drm_agp_mode {
530 unsigned long mode; /**< AGP mode */
531};
532
533/*
534 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
535 *
536 * \sa drmAgpAlloc() and drmAgpFree().
537 */
538struct drm_agp_buffer {
539 unsigned long size; /**< In bytes -- will round to page boundary */
540 unsigned long handle; /**< Used for binding / unbinding */
541 unsigned long type; /**< Type of memory to allocate */
542 unsigned long physical; /**< Physical used by i810 */
543};
544
545/*
546 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
547 *
548 * \sa drmAgpBind() and drmAgpUnbind().
549 */
550struct drm_agp_binding {
551 unsigned long handle; /**< From drm_agp_buffer */
552 unsigned long offset; /**< In bytes -- will round to page boundary */
553};
554
555/*
556 * DRM_IOCTL_AGP_INFO ioctl argument type.
557 *
558 * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
559 * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
560 * drmAgpVendorId() and drmAgpDeviceId().
561 */
562struct drm_agp_info {
563 int agp_version_major;
564 int agp_version_minor;
565 unsigned long mode;
566 unsigned long aperture_base; /* physical address */
567 unsigned long aperture_size; /* bytes */
568 unsigned long memory_allowed; /* bytes */
569 unsigned long memory_used;
570
571 /* PCI information */
572 unsigned short id_vendor;
573 unsigned short id_device;
574};
575
576/*
577 * DRM_IOCTL_SG_ALLOC ioctl argument type.
578 */
579struct drm_scatter_gather {
580 unsigned long size; /**< In bytes -- will round to page boundary */
581 unsigned long handle; /**< Used for mapping / unmapping */
582};
583
584/*
585 * DRM_IOCTL_SET_VERSION ioctl argument type.
586 */
587struct drm_set_version {
588 int drm_di_major;
589 int drm_di_minor;
590 int drm_dd_major;
591 int drm_dd_minor;
592};
593
594/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
595struct drm_gem_close {
596 /** Handle of the object to be closed. */
597 __u32 handle;
598 __u32 pad;
599};
600
601/* DRM_IOCTL_GEM_FLINK ioctl argument type */
602struct drm_gem_flink {
603 /** Handle for the object being named */
604 __u32 handle;
605
606 /** Returned global name */
607 __u32 name;
608};
609
610/* DRM_IOCTL_GEM_OPEN ioctl argument type */
611struct drm_gem_open {
612 /** Name of object being opened */
613 __u32 name;
614
615 /** Returned handle for the object */
616 __u32 handle;
617
618 /** Returned size of the object */
619 __u64 size;
620};
621
622/**
623 * DRM_CAP_DUMB_BUFFER
624 *
625 * If set to 1, the driver supports creating dumb buffers via the
626 * &DRM_IOCTL_MODE_CREATE_DUMB ioctl.
627 */
628#define DRM_CAP_DUMB_BUFFER 0x1
629/**
630 * DRM_CAP_VBLANK_HIGH_CRTC
631 *
632 * If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
633 * in the high bits of &drm_wait_vblank_request.type.
634 *
635 * Starting kernel version 2.6.39, this capability is always set to 1.
636 */
637#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
638/**
639 * DRM_CAP_DUMB_PREFERRED_DEPTH
640 *
641 * The preferred bit depth for dumb buffers.
642 *
643 * The bit depth is the number of bits used to indicate the color of a single
644 * pixel excluding any padding. This is different from the number of bits per
645 * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per
646 * pixel.
647 *
648 * Note that this preference only applies to dumb buffers, it's irrelevant for
649 * other types of buffers.
650 */
651#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
652/**
653 * DRM_CAP_DUMB_PREFER_SHADOW
654 *
655 * If set to 1, the driver prefers userspace to render to a shadow buffer
656 * instead of directly rendering to a dumb buffer. For best speed, userspace
657 * should do streaming ordered memory copies into the dumb buffer and never
658 * read from it.
659 *
660 * Note that this preference only applies to dumb buffers, it's irrelevant for
661 * other types of buffers.
662 */
663#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
664/**
665 * DRM_CAP_PRIME
666 *
667 * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
668 * and &DRM_PRIME_CAP_EXPORT.
669 *
670 * PRIME buffers are exposed as dma-buf file descriptors. See
671 * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing".
672 */
673#define DRM_CAP_PRIME 0x5
674/**
675 * DRM_PRIME_CAP_IMPORT
676 *
677 * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
678 * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
679 */
680#define DRM_PRIME_CAP_IMPORT 0x1
681/**
682 * DRM_PRIME_CAP_EXPORT
683 *
684 * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
685 * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
686 */
687#define DRM_PRIME_CAP_EXPORT 0x2
688/**
689 * DRM_CAP_TIMESTAMP_MONOTONIC
690 *
691 * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in
692 * struct drm_event_vblank. If set to 1, the kernel will report timestamps with
693 * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these
694 * clocks.
695 *
696 * Starting from kernel version 2.6.39, the default value for this capability
697 * is 1. Starting kernel version 4.15, this capability is always set to 1.
698 */
699#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
700/**
701 * DRM_CAP_ASYNC_PAGE_FLIP
702 *
703 * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC.
704 */
705#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
706/**
707 * DRM_CAP_CURSOR_WIDTH
708 *
709 * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid
710 * width x height combination for the hardware cursor. The intention is that a
711 * hardware agnostic userspace can query a cursor plane size to use.
712 *
713 * Note that the cross-driver contract is to merely return a valid size;
714 * drivers are free to attach another meaning on top, eg. i915 returns the
715 * maximum plane size.
716 */
717#define DRM_CAP_CURSOR_WIDTH 0x8
718/**
719 * DRM_CAP_CURSOR_HEIGHT
720 *
721 * See &DRM_CAP_CURSOR_WIDTH.
722 */
723#define DRM_CAP_CURSOR_HEIGHT 0x9
724/**
725 * DRM_CAP_ADDFB2_MODIFIERS
726 *
727 * If set to 1, the driver supports supplying modifiers in the
728 * &DRM_IOCTL_MODE_ADDFB2 ioctl.
729 */
730#define DRM_CAP_ADDFB2_MODIFIERS 0x10
731/**
732 * DRM_CAP_PAGE_FLIP_TARGET
733 *
734 * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and
735 * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in
736 * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP
737 * ioctl.
738 */
739#define DRM_CAP_PAGE_FLIP_TARGET 0x11
740/**
741 * DRM_CAP_CRTC_IN_VBLANK_EVENT
742 *
743 * If set to 1, the kernel supports reporting the CRTC ID in
744 * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and
745 * &DRM_EVENT_FLIP_COMPLETE events.
746 *
747 * Starting kernel version 4.12, this capability is always set to 1.
748 */
749#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
750/**
751 * DRM_CAP_SYNCOBJ
752 *
753 * If set to 1, the driver supports sync objects. See
754 * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
755 */
756#define DRM_CAP_SYNCOBJ 0x13
757/**
758 * DRM_CAP_SYNCOBJ_TIMELINE
759 *
760 * If set to 1, the driver supports timeline operations on sync objects. See
761 * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
762 */
763#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
764
765/* DRM_IOCTL_GET_CAP ioctl argument type */
766struct drm_get_cap {
767 __u64 capability;
768 __u64 value;
769};
770
771/**
772 * DRM_CLIENT_CAP_STEREO_3D
773 *
774 * If set to 1, the DRM core will expose the stereo 3D capabilities of the
775 * monitor by advertising the supported 3D layouts in the flags of struct
776 * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``.
777 *
778 * This capability is always supported for all drivers starting from kernel
779 * version 3.13.
780 */
781#define DRM_CLIENT_CAP_STEREO_3D 1
782
783/**
784 * DRM_CLIENT_CAP_UNIVERSAL_PLANES
785 *
786 * If set to 1, the DRM core will expose all planes (overlay, primary, and
787 * cursor) to userspace.
788 *
789 * This capability has been introduced in kernel version 3.15. Starting from
790 * kernel version 3.17, this capability is always supported for all drivers.
791 */
792#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
793
794/**
795 * DRM_CLIENT_CAP_ATOMIC
796 *
797 * If set to 1, the DRM core will expose atomic properties to userspace. This
798 * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and
799 * &DRM_CLIENT_CAP_ASPECT_RATIO.
800 *
801 * If the driver doesn't support atomic mode-setting, enabling this capability
802 * will fail with -EOPNOTSUPP.
803 *
804 * This capability has been introduced in kernel version 4.0. Starting from
805 * kernel version 4.2, this capability is always supported for atomic-capable
806 * drivers.
807 */
808#define DRM_CLIENT_CAP_ATOMIC 3
809
810/**
811 * DRM_CLIENT_CAP_ASPECT_RATIO
812 *
813 * If set to 1, the DRM core will provide aspect ratio information in modes.
814 * See ``DRM_MODE_FLAG_PIC_AR_*``.
815 *
816 * This capability is always supported for all drivers starting from kernel
817 * version 4.18.
818 */
819#define DRM_CLIENT_CAP_ASPECT_RATIO 4
820
821/**
822 * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
823 *
824 * If set to 1, the DRM core will expose special connectors to be used for
825 * writing back to memory the scene setup in the commit. The client must enable
826 * &DRM_CLIENT_CAP_ATOMIC first.
827 *
828 * This capability is always supported for atomic-capable drivers starting from
829 * kernel version 4.19.
830 */
831#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
832
833/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
834struct drm_set_client_cap {
835 __u64 capability;
836 __u64 value;
837};
838
839#define DRM_RDWR O_RDWR
840#define DRM_CLOEXEC O_CLOEXEC
841struct drm_prime_handle {
842 __u32 handle;
843
844 /** Flags.. only applicable for handle->fd */
845 __u32 flags;
846
847 /** Returned dmabuf file descriptor */
848 __s32 fd;
849};
850
851struct drm_syncobj_create {
852 __u32 handle;
853#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
854 __u32 flags;
855};
856
857struct drm_syncobj_destroy {
858 __u32 handle;
859 __u32 pad;
860};
861
862#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
863#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
864struct drm_syncobj_handle {
865 __u32 handle;
866 __u32 flags;
867
868 __s32 fd;
869 __u32 pad;
870};
871
872struct drm_syncobj_transfer {
873 __u32 src_handle;
874 __u32 dst_handle;
875 __u64 src_point;
876 __u64 dst_point;
877 __u32 flags;
878 __u32 pad;
879};
880
881#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
882#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
883#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
884struct drm_syncobj_wait {
885 __u64 handles;
886 /* absolute timeout */
887 __s64 timeout_nsec;
888 __u32 count_handles;
889 __u32 flags;
890 __u32 first_signaled; /* only valid when not waiting all */
891 __u32 pad;
892};
893
894struct drm_syncobj_timeline_wait {
895 __u64 handles;
896 /* wait on specific timeline point for every handles*/
897 __u64 points;
898 /* absolute timeout */
899 __s64 timeout_nsec;
900 __u32 count_handles;
901 __u32 flags;
902 __u32 first_signaled; /* only valid when not waiting all */
903 __u32 pad;
904};
905
906
907struct drm_syncobj_array {
908 __u64 handles;
909 __u32 count_handles;
910 __u32 pad;
911};
912
913#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */
914struct drm_syncobj_timeline_array {
915 __u64 handles;
916 __u64 points;
917 __u32 count_handles;
918 __u32 flags;
919};
920
921
922/* Query current scanout sequence number */
923struct drm_crtc_get_sequence {
924 __u32 crtc_id; /* requested crtc_id */
925 __u32 active; /* return: crtc output is active */
926 __u64 sequence; /* return: most recent vblank sequence */
927 __s64 sequence_ns; /* return: most recent time of first pixel out */
928};
929
930/* Queue event to be delivered at specified sequence. Time stamp marks
931 * when the first pixel of the refresh cycle leaves the display engine
932 * for the display
933 */
934#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */
935#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */
936
937struct drm_crtc_queue_sequence {
938 __u32 crtc_id;
939 __u32 flags;
940 __u64 sequence; /* on input, target sequence. on output, actual sequence */
941 __u64 user_data; /* user data passed to event */
942};
943
944#if defined(__cplusplus)
945}
946#endif
947
948#include "drm_mode.h"
949
950#if defined(__cplusplus)
951extern "C" {
952#endif
953
954#define DRM_IOCTL_BASE 'd'
955#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
956#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
957#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
958#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
959
960#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
961#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
962#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
963#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
964#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
965#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
966#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
967#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
968#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
969#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
970#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
971#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
972#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
973#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
974
975#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
976#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
977#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
978#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
979#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
980#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
981#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
982#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
983#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
984#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
985#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
986
987#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
988
989#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
990#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
991
992#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
993#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
994
995#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
996#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
997#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
998#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
999#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
1000#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
1001#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
1002#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
1003#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
1004#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
1005#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
1006#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
1007#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
1008
1009#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
1010#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
1011
1012#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
1013#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
1014#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
1015#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
1016#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
1017#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
1018#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
1019#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
1020
1021#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
1022#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
1023
1024#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
1025
1026#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
1027#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
1028
1029#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
1030
1031#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
1032#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
1033#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
1034#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
1035#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
1036#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
1037#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
1038#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
1039#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */
1040#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */
1041
1042#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
1043#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
1044#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
1045#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
1046#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
1047/**
1048 * DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
1049 *
1050 * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
1051 * argument is a framebuffer object ID.
1052 *
1053 * Warning: removing a framebuffer currently in-use on an enabled plane will
1054 * disable that plane. The CRTC the plane is linked to may also be disabled
1055 * (depending on driver capabilities).
1056 */
1057#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
1058#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
1059#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
1060
1061#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
1062#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
1063#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
1064#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
1065#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
1066#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
1067#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
1068#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
1069#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
1070#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
1071#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic)
1072#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
1073#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
1074
1075#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
1076#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
1077#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
1078#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
1079#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
1080#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
1081#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
1082
1083#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
1084#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
1085#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
1086#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
1087
1088#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait)
1089#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array)
1090#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
1091#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
1092
1093#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
1094
1095/*
1096 * Device specific ioctls should only be in their respective headers
1097 * The device specific ioctl range is from 0x40 to 0x9f.
1098 * Generic IOCTLS restart at 0xA0.
1099 *
1100 * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
1101 * drmCommandReadWrite().
1102 */
1103#define DRM_COMMAND_BASE 0x40
1104#define DRM_COMMAND_END 0xA0
1105
1106/*
1107 * Header for events written back to userspace on the drm fd. The
1108 * type defines the type of event, the length specifies the total
1109 * length of the event (including the header), and user_data is
1110 * typically a 64 bit value passed with the ioctl that triggered the
1111 * event. A read on the drm fd will always only return complete
1112 * events, that is, if for example the read buffer is 100 bytes, and
1113 * there are two 64 byte events pending, only one will be returned.
1114 *
1115 * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
1116 * up are chipset specific.
1117 */
1118struct drm_event {
1119 __u32 type;
1120 __u32 length;
1121};
1122
1123#define DRM_EVENT_VBLANK 0x01
1124#define DRM_EVENT_FLIP_COMPLETE 0x02
1125#define DRM_EVENT_CRTC_SEQUENCE 0x03
1126
1127struct drm_event_vblank {
1128 struct drm_event base;
1129 __u64 user_data;
1130 __u32 tv_sec;
1131 __u32 tv_usec;
1132 __u32 sequence;
1133 __u32 crtc_id; /* 0 on older kernels that do not support this */
1134};
1135
1136/* Event delivered at sequence. Time stamp marks when the first pixel
1137 * of the refresh cycle leaves the display engine for the display
1138 */
1139struct drm_event_crtc_sequence {
1140 struct drm_event base;
1141 __u64 user_data;
1142 __s64 time_ns;
1143 __u64 sequence;
1144};
1145
1146/* typedef area */
1147typedef struct drm_clip_rect drm_clip_rect_t;
1148typedef struct drm_drawable_info drm_drawable_info_t;
1149typedef struct drm_tex_region drm_tex_region_t;
1150typedef struct drm_hw_lock drm_hw_lock_t;
1151typedef struct drm_version drm_version_t;
1152typedef struct drm_unique drm_unique_t;
1153typedef struct drm_list drm_list_t;
1154typedef struct drm_block drm_block_t;
1155typedef struct drm_control drm_control_t;
1156typedef enum drm_map_type drm_map_type_t;
1157typedef enum drm_map_flags drm_map_flags_t;
1158typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
1159typedef struct drm_map drm_map_t;
1160typedef struct drm_client drm_client_t;
1161typedef enum drm_stat_type drm_stat_type_t;
1162typedef struct drm_stats drm_stats_t;
1163typedef enum drm_lock_flags drm_lock_flags_t;
1164typedef struct drm_lock drm_lock_t;
1165typedef enum drm_dma_flags drm_dma_flags_t;
1166typedef struct drm_buf_desc drm_buf_desc_t;
1167typedef struct drm_buf_info drm_buf_info_t;
1168typedef struct drm_buf_free drm_buf_free_t;
1169typedef struct drm_buf_pub drm_buf_pub_t;
1170typedef struct drm_buf_map drm_buf_map_t;
1171typedef struct drm_dma drm_dma_t;
1172typedef union drm_wait_vblank drm_wait_vblank_t;
1173typedef struct drm_agp_mode drm_agp_mode_t;
1174typedef enum drm_ctx_flags drm_ctx_flags_t;
1175typedef struct drm_ctx drm_ctx_t;
1176typedef struct drm_ctx_res drm_ctx_res_t;
1177typedef struct drm_draw drm_draw_t;
1178typedef struct drm_update_draw drm_update_draw_t;
1179typedef struct drm_auth drm_auth_t;
1180typedef struct drm_irq_busid drm_irq_busid_t;
1181typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
1182
1183typedef struct drm_agp_buffer drm_agp_buffer_t;
1184typedef struct drm_agp_binding drm_agp_binding_t;
1185typedef struct drm_agp_info drm_agp_info_t;
1186typedef struct drm_scatter_gather drm_scatter_gather_t;
1187typedef struct drm_set_version drm_set_version_t;
1188
1189#if defined(__cplusplus)
1190}
1191#endif
1192
1193#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/drm_fourcc.h created+1377
...@@ -0,0 +1,1377 @@
1/*
2 * Copyright 2011 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef DRM_FOURCC_H
25#define DRM_FOURCC_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/**
34 * DOC: overview
35 *
36 * In the DRM subsystem, framebuffer pixel formats are described using the
37 * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the
38 * fourcc code, a Format Modifier may optionally be provided, in order to
39 * further describe the buffer's format - for example tiling or compression.
40 *
41 * Format Modifiers
42 * ----------------
43 *
44 * Format modifiers are used in conjunction with a fourcc code, forming a
45 * unique fourcc:modifier pair. This format:modifier pair must fully define the
46 * format and data layout of the buffer, and should be the only way to describe
47 * that particular buffer.
48 *
49 * Having multiple fourcc:modifier pairs which describe the same layout should
50 * be avoided, as such aliases run the risk of different drivers exposing
51 * different names for the same data format, forcing userspace to understand
52 * that they are aliases.
53 *
54 * Format modifiers may change any property of the buffer, including the number
55 * of planes and/or the required allocation size. Format modifiers are
56 * vendor-namespaced, and as such the relationship between a fourcc code and a
57 * modifier is specific to the modifer being used. For example, some modifiers
58 * may preserve meaning - such as number of planes - from the fourcc code,
59 * whereas others may not.
60 *
61 * Modifiers must uniquely encode buffer layout. In other words, a buffer must
62 * match only a single modifier. A modifier must not be a subset of layouts of
63 * another modifier. For instance, it's incorrect to encode pitch alignment in
64 * a modifier: a buffer may match a 64-pixel aligned modifier and a 32-pixel
65 * aligned modifier. That said, modifiers can have implicit minimal
66 * requirements.
67 *
68 * For modifiers where the combination of fourcc code and modifier can alias,
69 * a canonical pair needs to be defined and used by all drivers. Preferred
70 * combinations are also encouraged where all combinations might lead to
71 * confusion and unnecessarily reduced interoperability. An example for the
72 * latter is AFBC, where the ABGR layouts are preferred over ARGB layouts.
73 *
74 * There are two kinds of modifier users:
75 *
76 * - Kernel and user-space drivers: for drivers it's important that modifiers
77 * don't alias, otherwise two drivers might support the same format but use
78 * different aliases, preventing them from sharing buffers in an efficient
79 * format.
80 * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users
81 * see modifiers as opaque tokens they can check for equality and intersect.
82 * These users musn't need to know to reason about the modifier value
83 * (i.e. they are not expected to extract information out of the modifier).
84 *
85 * Vendors should document their modifier usage in as much detail as
86 * possible, to ensure maximum compatibility across devices, drivers and
87 * applications.
88 *
89 * The authoritative list of format modifier codes is found in
90 * `include/uapi/drm/drm_fourcc.h`
91 */
92
93#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
94 ((__u32)(c) << 16) | ((__u32)(d) << 24))
95
96#define DRM_FORMAT_BIG_ENDIAN (1U<<31) /* format is big endian instead of little endian */
97
98/* Reserve 0 for the invalid format specifier */
99#define DRM_FORMAT_INVALID 0
100
101/* color index */
102#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
103
104/* 8 bpp Red */
105#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
106
107/* 10 bpp Red */
108#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */
109
110/* 12 bpp Red */
111#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */
112
113/* 16 bpp Red */
114#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
115
116/* 16 bpp RG */
117#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */
118#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
119
120/* 32 bpp RG */
121#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */
122#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */
123
124/* 8 bpp RGB */
125#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */
126#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */
127
128/* 16 bpp RGB */
129#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */
130#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */
131#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */
132#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */
133
134#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */
135#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */
136#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */
137#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */
138
139#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */
140#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */
141#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */
142#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */
143
144#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */
145#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */
146#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */
147#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */
148
149#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */
150#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */
151
152/* 24 bpp RGB */
153#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */
154#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */
155
156/* 32 bpp RGB */
157#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */
158#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */
159#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */
160#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */
161
162#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */
163#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */
164#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */
165#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */
166
167#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */
168#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */
169#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */
170#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */
171
172#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */
173#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */
174#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
175#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
176
177/* 64 bpp RGB */
178#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
179#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
180
181#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */
182#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */
183
184/*
185 * Floating point 64bpp RGB
186 * IEEE 754-2008 binary16 half-precision float
187 * [15:0] sign:exponent:mantissa 1:5:10
188 */
189#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] x:R:G:B 16:16:16:16 little endian */
190#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */
191
192#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */
193#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */
194
195/*
196 * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits
197 * of unused padding per component:
198 */
199#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') /* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian */
200
201/* packed YCbCr */
202#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */
203#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */
204#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */
205#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
206
207#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
208#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
209#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
210#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
211
212/*
213 * packed Y2xx indicate for each component, xx valid data occupy msb
214 * 16-xx padding occupy lsb
215 */
216#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels */
217#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels */
218#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6') /* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels */
219
220/*
221 * packed Y4xx indicate for each component, xx valid data occupy msb
222 * 16-xx padding occupy lsb except Y410
223 */
224#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0') /* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian */
225#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2') /* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */
226#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6') /* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian */
227
228#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */
229#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6') /* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */
230#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8') /* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian */
231
232/*
233 * packed YCbCr420 2x2 tiled formats
234 * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile
235 */
236/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */
237#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0')
238/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */
239#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0')
240
241/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */
242#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2')
243/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */
244#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2')
245
246/*
247 * 1-plane YUV 4:2:0
248 * In these formats, the component ordering is specified (Y, followed by U
249 * then V), but the exact Linear layout is undefined.
250 * These formats can only be used with a non-Linear modifier.
251 */
252#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8')
253#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0')
254
255/*
256 * 2 plane RGB + A
257 * index 0 = RGB plane, same format as the corresponding non _A8 format has
258 * index 1 = A plane, [7:0] A
259 */
260#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
261#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
262#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
263#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8')
264#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8')
265#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8')
266#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8')
267#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8')
268
269/*
270 * 2 plane YCbCr
271 * index 0 = Y plane, [7:0] Y
272 * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian
273 * or
274 * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian
275 */
276#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */
277#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */
278#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */
279#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */
280#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
281#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
282/*
283 * 2 plane YCbCr
284 * index 0 = Y plane, [39:0] Y3:Y2:Y1:Y0 little endian
285 * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
286 */
287#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
288
289/*
290 * 2 plane YCbCr MSB aligned
291 * index 0 = Y plane, [15:0] Y:x [10:6] little endian
292 * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
293 */
294#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0') /* 2x1 subsampled Cr:Cb plane, 10 bit per channel */
295
296/*
297 * 2 plane YCbCr MSB aligned
298 * index 0 = Y plane, [15:0] Y:x [10:6] little endian
299 * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
300 */
301#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
302
303/*
304 * 2 plane YCbCr MSB aligned
305 * index 0 = Y plane, [15:0] Y:x [12:4] little endian
306 * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
307 */
308#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
309
310/*
311 * 2 plane YCbCr MSB aligned
312 * index 0 = Y plane, [15:0] Y little endian
313 * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
314 */
315#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
316
317/* 3 plane non-subsampled (444) YCbCr
318 * 16 bits per component, but only 10 bits are used and 6 bits are padded
319 * index 0: Y plane, [15:0] Y:x [10:6] little endian
320 * index 1: Cb plane, [15:0] Cb:x [10:6] little endian
321 * index 2: Cr plane, [15:0] Cr:x [10:6] little endian
322 */
323#define DRM_FORMAT_Q410 fourcc_code('Q', '4', '1', '0')
324
325/* 3 plane non-subsampled (444) YCrCb
326 * 16 bits per component, but only 10 bits are used and 6 bits are padded
327 * index 0: Y plane, [15:0] Y:x [10:6] little endian
328 * index 1: Cr plane, [15:0] Cr:x [10:6] little endian
329 * index 2: Cb plane, [15:0] Cb:x [10:6] little endian
330 */
331#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1')
332
333/*
334 * 3 plane YCbCr
335 * index 0: Y plane, [7:0] Y
336 * index 1: Cb plane, [7:0] Cb
337 * index 2: Cr plane, [7:0] Cr
338 * or
339 * index 1: Cr plane, [7:0] Cr
340 * index 2: Cb plane, [7:0] Cb
341 */
342#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */
343#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */
344#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */
345#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */
346#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */
347#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */
348#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */
349#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */
350#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
351#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
352
353
354/*
355 * Format Modifiers:
356 *
357 * Format modifiers describe, typically, a re-ordering or modification
358 * of the data in a plane of an FB. This can be used to express tiled/
359 * swizzled formats, or compression, or a combination of the two.
360 *
361 * The upper 8 bits of the format modifier are a vendor-id as assigned
362 * below. The lower 56 bits are assigned as vendor sees fit.
363 */
364
365/* Vendor Ids: */
366#define DRM_FORMAT_MOD_VENDOR_NONE 0
367#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01
368#define DRM_FORMAT_MOD_VENDOR_AMD 0x02
369#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03
370#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
371#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
372#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06
373#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07
374#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
375#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
376#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a
377
378/* add more to the end as needed */
379
380#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
381
382#define fourcc_mod_get_vendor(modifier) \
383 (((modifier) >> 56) & 0xff)
384
385#define fourcc_mod_is_vendor(modifier, vendor) \
386 (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor)
387
388#define fourcc_mod_code(vendor, val) \
389 ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
390
391/*
392 * Format Modifier tokens:
393 *
394 * When adding a new token please document the layout with a code comment,
395 * similar to the fourcc codes above. drm_fourcc.h is considered the
396 * authoritative source for all of these.
397 *
398 * Generic modifier names:
399 *
400 * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
401 * for layouts which are common across multiple vendors. To preserve
402 * compatibility, in cases where a vendor-specific definition already exists and
403 * a generic name for it is desired, the common name is a purely symbolic alias
404 * and must use the same numerical value as the original definition.
405 *
406 * Note that generic names should only be used for modifiers which describe
407 * generic layouts (such as pixel re-ordering), which may have
408 * independently-developed support across multiple vendors.
409 *
410 * In future cases where a generic layout is identified before merging with a
411 * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor
412 * 'NONE' could be considered. This should only be for obvious, exceptional
413 * cases to avoid polluting the 'GENERIC' namespace with modifiers which only
414 * apply to a single vendor.
415 *
416 * Generic names should not be used for cases where multiple hardware vendors
417 * have implementations of the same standardised compression scheme (such as
418 * AFBC). In those cases, all implementations should use the same format
419 * modifier(s), reflecting the vendor of the standard.
420 */
421
422#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
423
424/*
425 * Invalid Modifier
426 *
427 * This modifier can be used as a sentinel to terminate the format modifiers
428 * list, or to initialize a variable with an invalid modifier. It might also be
429 * used to report an error back to userspace for certain APIs.
430 */
431#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
432
433/*
434 * Linear Layout
435 *
436 * Just plain linear layout. Note that this is different from no specifying any
437 * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl),
438 * which tells the driver to also take driver-internal information into account
439 * and so might actually result in a tiled framebuffer.
440 */
441#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)
442
443/*
444 * Deprecated: use DRM_FORMAT_MOD_LINEAR instead
445 *
446 * The "none" format modifier doesn't actually mean that the modifier is
447 * implicit, instead it means that the layout is linear. Whether modifiers are
448 * used is out-of-band information carried in an API-specific way (e.g. in a
449 * flag for drm_mode_fb_cmd2).
450 */
451#define DRM_FORMAT_MOD_NONE 0
452
453/* Intel framebuffer modifiers */
454
455/*
456 * Intel X-tiling layout
457 *
458 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
459 * in row-major layout. Within the tile bytes are laid out row-major, with
460 * a platform-dependent stride. On top of that the memory can apply
461 * platform-depending swizzling of some higher address bits into bit6.
462 *
463 * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets.
464 * On earlier platforms the is highly platforms specific and not useful for
465 * cross-driver sharing. It exists since on a given platform it does uniquely
466 * identify the layout in a simple way for i915-specific userspace, which
467 * facilitated conversion of userspace to modifiers. Additionally the exact
468 * format on some really old platforms is not known.
469 */
470#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)
471
472/*
473 * Intel Y-tiling layout
474 *
475 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
476 * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
477 * chunks column-major, with a platform-dependent height. On top of that the
478 * memory can apply platform-depending swizzling of some higher address bits
479 * into bit6.
480 *
481 * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets.
482 * On earlier platforms the is highly platforms specific and not useful for
483 * cross-driver sharing. It exists since on a given platform it does uniquely
484 * identify the layout in a simple way for i915-specific userspace, which
485 * facilitated conversion of userspace to modifiers. Additionally the exact
486 * format on some really old platforms is not known.
487 */
488#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)
489
490/*
491 * Intel Yf-tiling layout
492 *
493 * This is a tiled layout using 4Kb tiles in row-major layout.
494 * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
495 * are arranged in four groups (two wide, two high) with column-major layout.
496 * Each group therefore consits out of four 256 byte units, which are also laid
497 * out as 2x2 column-major.
498 * 256 byte units are made out of four 64 byte blocks of pixels, producing
499 * either a square block or a 2:1 unit.
500 * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width
501 * in pixel depends on the pixel depth.
502 */
503#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
504
505/*
506 * Intel color control surface (CCS) for render compression
507 *
508 * The framebuffer format must be one of the 8:8:8:8 RGB formats.
509 * The main surface will be plane index 0 and must be Y/Yf-tiled,
510 * the CCS will be plane index 1.
511 *
512 * Each CCS tile matches a 1024x512 pixel area of the main surface.
513 * To match certain aspects of the 3D hardware the CCS is
514 * considered to be made up of normal 128Bx32 Y tiles, Thus
515 * the CCS pitch must be specified in multiples of 128 bytes.
516 *
517 * In reality the CCS tile appears to be a 64Bx64 Y tile, composed
518 * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks.
519 * But that fact is not relevant unless the memory is accessed
520 * directly.
521 */
522#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
523#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
524
525/*
526 * Intel color control surfaces (CCS) for Gen-12 render compression.
527 *
528 * The main surface is Y-tiled and at plane index 0, the CCS is linear and
529 * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
530 * main surface. In other words, 4 bits in CCS map to a main surface cache
531 * line pair. The main surface pitch is required to be a multiple of four
532 * Y-tile widths.
533 */
534#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6)
535
536/*
537 * Intel color control surfaces (CCS) for Gen-12 media compression
538 *
539 * The main surface is Y-tiled and at plane index 0, the CCS is linear and
540 * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
541 * main surface. In other words, 4 bits in CCS map to a main surface cache
542 * line pair. The main surface pitch is required to be a multiple of four
543 * Y-tile widths. For semi-planar formats like NV12, CCS planes follow the
544 * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces,
545 * planes 2 and 3 for the respective CCS.
546 */
547#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7)
548
549/*
550 * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render
551 * compression.
552 *
553 * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
554 * and at index 1. The clear color is stored at index 2, and the pitch should
555 * be ignored. The clear color structure is 256 bits. The first 128 bits
556 * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
557 * by 32 bits. The raw clear color is consumed by the 3d engine and generates
558 * the converted clear color of size 64 bits. The first 32 bits store the Lower
559 * Converted Clear Color value and the next 32 bits store the Higher Converted
560 * Clear Color value when applicable. The Converted Clear Color values are
561 * consumed by the DE. The last 64 bits are used to store Color Discard Enable
562 * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
563 * corresponds to an area of 4x1 tiles in the main surface. The main surface
564 * pitch is required to be a multiple of 4 tile widths.
565 */
566#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)
567
568/*
569 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
570 *
571 * Macroblocks are laid in a Z-shape, and each pixel data is following the
572 * standard NV12 style.
573 * As for NV12, an image is the result of two frame buffers: one for Y,
574 * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer).
575 * Alignment requirements are (for each buffer):
576 * - multiple of 128 pixels for the width
577 * - multiple of 32 pixels for the height
578 *
579 * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
580 */
581#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
582
583/*
584 * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks
585 *
586 * This is a simple tiled layout using tiles of 16x16 pixels in a row-major
587 * layout. For YCbCr formats Cb/Cr components are taken in such a way that
588 * they correspond to their 16x16 luma block.
589 */
590#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2)
591
592/*
593 * Qualcomm Compressed Format
594 *
595 * Refers to a compressed variant of the base format that is compressed.
596 * Implementation may be platform and base-format specific.
597 *
598 * Each macrotile consists of m x n (mostly 4 x 4) tiles.
599 * Pixel data pitch/stride is aligned with macrotile width.
600 * Pixel data height is aligned with macrotile height.
601 * Entire pixel data buffer is aligned with 4k(bytes).
602 */
603#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
604
605/* Vivante framebuffer modifiers */
606
607/*
608 * Vivante 4x4 tiling layout
609 *
610 * This is a simple tiled layout using tiles of 4x4 pixels in a row-major
611 * layout.
612 */
613#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1)
614
615/*
616 * Vivante 64x64 super-tiling layout
617 *
618 * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile
619 * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row-
620 * major layout.
621 *
622 * For more information: see
623 * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling
624 */
625#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2)
626
627/*
628 * Vivante 4x4 tiling layout for dual-pipe
629 *
630 * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a
631 * different base address. Offsets from the base addresses are therefore halved
632 * compared to the non-split tiled layout.
633 */
634#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3)
635
636/*
637 * Vivante 64x64 super-tiling layout for dual-pipe
638 *
639 * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile
640 * starts at a different base address. Offsets from the base addresses are
641 * therefore halved compared to the non-split super-tiled layout.
642 */
643#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
644
645/* NVIDIA frame buffer modifiers */
646
647/*
648 * Tegra Tiled Layout, used by Tegra 2, 3 and 4.
649 *
650 * Pixels are arranged in simple tiles of 16 x 16 bytes.
651 */
652#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1)
653
654/*
655 * Generalized Block Linear layout, used by desktop GPUs starting with NV50/G80,
656 * and Tegra GPUs starting with Tegra K1.
657 *
658 * Pixels are arranged in Groups of Bytes (GOBs). GOB size and layout varies
659 * based on the architecture generation. GOBs themselves are then arranged in
660 * 3D blocks, with the block dimensions (in terms of GOBs) always being a power
661 * of two, and hence expressible as their log2 equivalent (E.g., "2" represents
662 * a block depth or height of "4").
663 *
664 * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format
665 * in full detail.
666 *
667 * Macro
668 * Bits Param Description
669 * ---- ----- -----------------------------------------------------------------
670 *
671 * 3:0 h log2(height) of each block, in GOBs. Placed here for
672 * compatibility with the existing
673 * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers.
674 *
675 * 4:4 - Must be 1, to indicate block-linear layout. Necessary for
676 * compatibility with the existing
677 * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers.
678 *
679 * 8:5 - Reserved (To support 3D-surfaces with variable log2(depth) block
680 * size). Must be zero.
681 *
682 * Note there is no log2(width) parameter. Some portions of the
683 * hardware support a block width of two gobs, but it is impractical
684 * to use due to lack of support elsewhere, and has no known
685 * benefits.
686 *
687 * 11:9 - Reserved (To support 2D-array textures with variable array stride
688 * in blocks, specified via log2(tile width in blocks)). Must be
689 * zero.
690 *
691 * 19:12 k Page Kind. This value directly maps to a field in the page
692 * tables of all GPUs >= NV50. It affects the exact layout of bits
693 * in memory and can be derived from the tuple
694 *
695 * (format, GPU model, compression type, samples per pixel)
696 *
697 * Where compression type is defined below. If GPU model were
698 * implied by the format modifier, format, or memory buffer, page
699 * kind would not need to be included in the modifier itself, but
700 * since the modifier should define the layout of the associated
701 * memory buffer independent from any device or other context, it
702 * must be included here.
703 *
704 * 21:20 g GOB Height and Page Kind Generation. The height of a GOB changed
705 * starting with Fermi GPUs. Additionally, the mapping between page
706 * kind and bit layout has changed at various points.
707 *
708 * 0 = Gob Height 8, Fermi - Volta, Tegra K1+ Page Kind mapping
709 * 1 = Gob Height 4, G80 - GT2XX Page Kind mapping
710 * 2 = Gob Height 8, Turing+ Page Kind mapping
711 * 3 = Reserved for future use.
712 *
713 * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further
714 * bit remapping step that occurs at an even lower level than the
715 * page kind and block linear swizzles. This causes the layout of
716 * surfaces mapped in those SOC's GPUs to be incompatible with the
717 * equivalent mapping on other GPUs in the same system.
718 *
719 * 0 = Tegra K1 - Tegra Parker/TX2 Layout.
720 * 1 = Desktop GPU and Tegra Xavier+ Layout
721 *
722 * 25:23 c Lossless Framebuffer Compression type.
723 *
724 * 0 = none
725 * 1 = ROP/3D, layout 1, exact compression format implied by Page
726 * Kind field
727 * 2 = ROP/3D, layout 2, exact compression format implied by Page
728 * Kind field
729 * 3 = CDE horizontal
730 * 4 = CDE vertical
731 * 5 = Reserved for future use
732 * 6 = Reserved for future use
733 * 7 = Reserved for future use
734 *
735 * 55:25 - Reserved for future use. Must be zero.
736 */
737#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \
738 fourcc_mod_code(NVIDIA, (0x10 | \
739 ((h) & 0xf) | \
740 (((k) & 0xff) << 12) | \
741 (((g) & 0x3) << 20) | \
742 (((s) & 0x1) << 22) | \
743 (((c) & 0x7) << 23)))
744
745/* To grandfather in prior block linear format modifiers to the above layout,
746 * the page kind "0", which corresponds to "pitch/linear" and hence is unusable
747 * with block-linear layouts, is remapped within drivers to the value 0xfe,
748 * which corresponds to the "generic" kind used for simple single-sample
749 * uncompressed color formats on Fermi - Volta GPUs.
750 */
751static __inline__ __u64
752drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
753{
754 if (!(modifier & 0x10) || (modifier & (0xff << 12)))
755 return modifier;
756 else
757 return modifier | (0xfe << 12);
758}
759
760/*
761 * 16Bx2 Block Linear layout, used by Tegra K1 and later
762 *
763 * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked
764 * vertically by a power of 2 (1 to 32 GOBs) to form a block.
765 *
766 * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape.
767 *
768 * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically.
769 * Valid values are:
770 *
771 * 0 == ONE_GOB
772 * 1 == TWO_GOBS
773 * 2 == FOUR_GOBS
774 * 3 == EIGHT_GOBS
775 * 4 == SIXTEEN_GOBS
776 * 5 == THIRTYTWO_GOBS
777 *
778 * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format
779 * in full detail.
780 */
781#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \
782 DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 0, 0, 0, (v))
783
784#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \
785 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0)
786#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \
787 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1)
788#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \
789 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2)
790#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \
791 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3)
792#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \
793 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4)
794#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \
795 DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5)
796
797/*
798 * Some Broadcom modifiers take parameters, for example the number of
799 * vertical lines in the image. Reserve the lower 32 bits for modifier
800 * type, and the next 24 bits for parameters. Top 8 bits are the
801 * vendor code.
802 */
803#define __fourcc_mod_broadcom_param_shift 8
804#define __fourcc_mod_broadcom_param_bits 48
805#define fourcc_mod_broadcom_code(val, params) \
806 fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val))
807#define fourcc_mod_broadcom_param(m) \
808 ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \
809 ((1ULL << __fourcc_mod_broadcom_param_bits) - 1)))
810#define fourcc_mod_broadcom_mod(m) \
811 ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \
812 __fourcc_mod_broadcom_param_shift))
813
814/*
815 * Broadcom VC4 "T" format
816 *
817 * This is the primary layout that the V3D GPU can texture from (it
818 * can't do linear). The T format has:
819 *
820 * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4
821 * pixels at 32 bit depth.
822 *
823 * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually
824 * 16x16 pixels).
825 *
826 * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On
827 * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows
828 * they're (TR, BR, BL, TL), where bottom left is start of memory.
829 *
830 * - an image made of 4k tiles in rows either left-to-right (even rows of 4k
831 * tiles) or right-to-left (odd rows of 4k tiles).
832 */
833#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1)
834
835/*
836 * Broadcom SAND format
837 *
838 * This is the native format that the H.264 codec block uses. For VC4
839 * HVS, it is only valid for H.264 (NV12/21) and RGBA modes.
840 *
841 * The image can be considered to be split into columns, and the
842 * columns are placed consecutively into memory. The width of those
843 * columns can be either 32, 64, 128, or 256 pixels, but in practice
844 * only 128 pixel columns are used.
845 *
846 * The pitch between the start of each column is set to optimally
847 * switch between SDRAM banks. This is passed as the number of lines
848 * of column width in the modifier (we can't use the stride value due
849 * to various core checks that look at it , so you should set the
850 * stride to width*cpp).
851 *
852 * Note that the column height for this format modifier is the same
853 * for all of the planes, assuming that each column contains both Y
854 * and UV. Some SAND-using hardware stores UV in a separate tiled
855 * image from Y to reduce the column height, which is not supported
856 * with these modifiers.
857 */
858
859#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \
860 fourcc_mod_broadcom_code(2, v)
861#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \
862 fourcc_mod_broadcom_code(3, v)
863#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \
864 fourcc_mod_broadcom_code(4, v)
865#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \
866 fourcc_mod_broadcom_code(5, v)
867
868#define DRM_FORMAT_MOD_BROADCOM_SAND32 \
869 DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0)
870#define DRM_FORMAT_MOD_BROADCOM_SAND64 \
871 DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0)
872#define DRM_FORMAT_MOD_BROADCOM_SAND128 \
873 DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0)
874#define DRM_FORMAT_MOD_BROADCOM_SAND256 \
875 DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0)
876
877/* Broadcom UIF format
878 *
879 * This is the common format for the current Broadcom multimedia
880 * blocks, including V3D 3.x and newer, newer video codecs, and
881 * displays.
882 *
883 * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles),
884 * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are
885 * stored in columns, with padding between the columns to ensure that
886 * moving from one column to the next doesn't hit the same SDRAM page
887 * bank.
888 *
889 * To calculate the padding, it is assumed that each hardware block
890 * and the software driving it knows the platform's SDRAM page size,
891 * number of banks, and XOR address, and that it's identical between
892 * all blocks using the format. This tiling modifier will use XOR as
893 * necessary to reduce the padding. If a hardware block can't do XOR,
894 * the assumption is that a no-XOR tiling modifier will be created.
895 */
896#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6)
897
898/*
899 * Arm Framebuffer Compression (AFBC) modifiers
900 *
901 * AFBC is a proprietary lossless image compression protocol and format.
902 * It provides fine-grained random access and minimizes the amount of data
903 * transferred between IP blocks.
904 *
905 * AFBC has several features which may be supported and/or used, which are
906 * represented using bits in the modifier. Not all combinations are valid,
907 * and different devices or use-cases may support different combinations.
908 *
909 * Further information on the use of AFBC modifiers can be found in
910 * Documentation/gpu/afbc.rst
911 */
912
913/*
914 * The top 4 bits (out of the 56 bits alloted for specifying vendor specific
915 * modifiers) denote the category for modifiers. Currently we have three
916 * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of
917 * sixteen different categories.
918 */
919#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \
920 fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL))
921
922#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00
923#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01
924
925#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \
926 DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode)
927
928/*
929 * AFBC superblock size
930 *
931 * Indicates the superblock size(s) used for the AFBC buffer. The buffer
932 * size (in pixels) must be aligned to a multiple of the superblock size.
933 * Four lowest significant bits(LSBs) are reserved for block size.
934 *
935 * Where one superblock size is specified, it applies to all planes of the
936 * buffer (e.g. 16x16, 32x8). When multiple superblock sizes are specified,
937 * the first applies to the Luma plane and the second applies to the Chroma
938 * plane(s). e.g. (32x8_64x4 means 32x8 Luma, with 64x4 Chroma).
939 * Multiple superblock sizes are only valid for multi-plane YCbCr formats.
940 */
941#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf
942#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL)
943#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL)
944#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL)
945#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL)
946
947/*
948 * AFBC lossless colorspace transform
949 *
950 * Indicates that the buffer makes use of the AFBC lossless colorspace
951 * transform.
952 */
953#define AFBC_FORMAT_MOD_YTR (1ULL << 4)
954
955/*
956 * AFBC block-split
957 *
958 * Indicates that the payload of each superblock is split. The second
959 * half of the payload is positioned at a predefined offset from the start
960 * of the superblock payload.
961 */
962#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5)
963
964/*
965 * AFBC sparse layout
966 *
967 * This flag indicates that the payload of each superblock must be stored at a
968 * predefined position relative to the other superblocks in the same AFBC
969 * buffer. This order is the same order used by the header buffer. In this mode
970 * each superblock is given the same amount of space as an uncompressed
971 * superblock of the particular format would require, rounding up to the next
972 * multiple of 128 bytes in size.
973 */
974#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6)
975
976/*
977 * AFBC copy-block restrict
978 *
979 * Buffers with this flag must obey the copy-block restriction. The restriction
980 * is such that there are no copy-blocks referring across the border of 8x8
981 * blocks. For the subsampled data the 8x8 limitation is also subsampled.
982 */
983#define AFBC_FORMAT_MOD_CBR (1ULL << 7)
984
985/*
986 * AFBC tiled layout
987 *
988 * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all
989 * superblocks inside a tile are stored together in memory. 8x8 tiles are used
990 * for pixel formats up to and including 32 bpp while 4x4 tiles are used for
991 * larger bpp formats. The order between the tiles is scan line.
992 * When the tiled layout is used, the buffer size (in pixels) must be aligned
993 * to the tile size.
994 */
995#define AFBC_FORMAT_MOD_TILED (1ULL << 8)
996
997/*
998 * AFBC solid color blocks
999 *
1000 * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth
1001 * can be reduced if a whole superblock is a single color.
1002 */
1003#define AFBC_FORMAT_MOD_SC (1ULL << 9)
1004
1005/*
1006 * AFBC double-buffer
1007 *
1008 * Indicates that the buffer is allocated in a layout safe for front-buffer
1009 * rendering.
1010 */
1011#define AFBC_FORMAT_MOD_DB (1ULL << 10)
1012
1013/*
1014 * AFBC buffer content hints
1015 *
1016 * Indicates that the buffer includes per-superblock content hints.
1017 */
1018#define AFBC_FORMAT_MOD_BCH (1ULL << 11)
1019
1020/* AFBC uncompressed storage mode
1021 *
1022 * Indicates that the buffer is using AFBC uncompressed storage mode.
1023 * In this mode all superblock payloads in the buffer use the uncompressed
1024 * storage mode, which is usually only used for data which cannot be compressed.
1025 * The buffer layout is the same as for AFBC buffers without USM set, this only
1026 * affects the storage mode of the individual superblocks. Note that even a
1027 * buffer without USM set may use uncompressed storage mode for some or all
1028 * superblocks, USM just guarantees it for all.
1029 */
1030#define AFBC_FORMAT_MOD_USM (1ULL << 12)
1031
1032/*
1033 * Arm Fixed-Rate Compression (AFRC) modifiers
1034 *
1035 * AFRC is a proprietary fixed rate image compression protocol and format,
1036 * designed to provide guaranteed bandwidth and memory footprint
1037 * reductions in graphics and media use-cases.
1038 *
1039 * AFRC buffers consist of one or more planes, with the same components
1040 * and meaning as an uncompressed buffer using the same pixel format.
1041 *
1042 * Within each plane, the pixel/luma/chroma values are grouped into
1043 * "coding unit" blocks which are individually compressed to a
1044 * fixed size (in bytes). All coding units within a given plane of a buffer
1045 * store the same number of values, and have the same compressed size.
1046 *
1047 * The coding unit size is configurable, allowing different rates of compression.
1048 *
1049 * The start of each AFRC buffer plane must be aligned to an alignment granule which
1050 * depends on the coding unit size.
1051 *
1052 * Coding Unit Size Plane Alignment
1053 * ---------------- ---------------
1054 * 16 bytes 1024 bytes
1055 * 24 bytes 512 bytes
1056 * 32 bytes 2048 bytes
1057 *
1058 * Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned
1059 * to a multiple of the paging tile dimensions.
1060 * The dimensions of each paging tile depend on whether the buffer is optimised for
1061 * scanline (SCAN layout) or rotated (ROT layout) access.
1062 *
1063 * Layout Paging Tile Width Paging Tile Height
1064 * ------ ----------------- ------------------
1065 * SCAN 16 coding units 4 coding units
1066 * ROT 8 coding units 8 coding units
1067 *
1068 * The dimensions of each coding unit depend on the number of components
1069 * in the compressed plane and whether the buffer is optimised for
1070 * scanline (SCAN layout) or rotated (ROT layout) access.
1071 *
1072 * Number of Components in Plane Layout Coding Unit Width Coding Unit Height
1073 * ----------------------------- --------- ----------------- ------------------
1074 * 1 SCAN 16 samples 4 samples
1075 * Example: 16x4 luma samples in a 'Y' plane
1076 * 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer
1077 * ----------------------------- --------- ----------------- ------------------
1078 * 1 ROT 8 samples 8 samples
1079 * Example: 8x8 luma samples in a 'Y' plane
1080 * 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer
1081 * ----------------------------- --------- ----------------- ------------------
1082 * 2 DONT CARE 8 samples 4 samples
1083 * Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer
1084 * ----------------------------- --------- ----------------- ------------------
1085 * 3 DONT CARE 4 samples 4 samples
1086 * Example: 4x4 pixels in an RGB buffer without alpha
1087 * ----------------------------- --------- ----------------- ------------------
1088 * 4 DONT CARE 4 samples 4 samples
1089 * Example: 4x4 pixels in an RGB buffer with alpha
1090 */
1091
1092#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02
1093
1094#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \
1095 DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode)
1096
1097/*
1098 * AFRC coding unit size modifier.
1099 *
1100 * Indicates the number of bytes used to store each compressed coding unit for
1101 * one or more planes in an AFRC encoded buffer. The coding unit size for chrominance
1102 * is the same for both Cb and Cr, which may be stored in separate planes.
1103 *
1104 * AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store
1105 * each compressed coding unit in the first plane of the buffer. For RGBA buffers
1106 * this is the only plane, while for semi-planar and fully-planar YUV buffers,
1107 * this corresponds to the luma plane.
1108 *
1109 * AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store
1110 * each compressed coding unit in the second and third planes in the buffer.
1111 * For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s).
1112 *
1113 * For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified
1114 * and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero.
1115 * For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and
1116 * AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified.
1117 */
1118#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf
1119#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL)
1120#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL)
1121#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL)
1122
1123#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size)
1124#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4)
1125
1126/*
1127 * AFRC scanline memory layout.
1128 *
1129 * Indicates if the buffer uses the scanline-optimised layout
1130 * for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout.
1131 * The memory layout is the same for all planes.
1132 */
1133#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8)
1134
1135/*
1136 * Arm 16x16 Block U-Interleaved modifier
1137 *
1138 * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image
1139 * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels
1140 * in the block are reordered.
1141 */
1142#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \
1143 DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)
1144
1145/*
1146 * Allwinner tiled modifier
1147 *
1148 * This tiling mode is implemented by the VPU found on all Allwinner platforms,
1149 * codenamed sunxi. It is associated with a YUV format that uses either 2 or 3
1150 * planes.
1151 *
1152 * With this tiling, the luminance samples are disposed in tiles representing
1153 * 32x32 pixels and the chrominance samples in tiles representing 32x64 pixels.
1154 * The pixel order in each tile is linear and the tiles are disposed linearly,
1155 * both in row-major order.
1156 */
1157#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1)
1158
1159/*
1160 * Amlogic Video Framebuffer Compression modifiers
1161 *
1162 * Amlogic uses a proprietary lossless image compression protocol and format
1163 * for their hardware video codec accelerators, either video decoders or
1164 * video input encoders.
1165 *
1166 * It considerably reduces memory bandwidth while writing and reading
1167 * frames in memory.
1168 *
1169 * The underlying storage is considered to be 3 components, 8bit or 10-bit
1170 * per component YCbCr 420, single plane :
1171 * - DRM_FORMAT_YUV420_8BIT
1172 * - DRM_FORMAT_YUV420_10BIT
1173 *
1174 * The first 8 bits of the mode defines the layout, then the following 8 bits
1175 * defines the options changing the layout.
1176 *
1177 * Not all combinations are valid, and different SoCs may support different
1178 * combinations of layout and options.
1179 */
1180#define __fourcc_mod_amlogic_layout_mask 0xff
1181#define __fourcc_mod_amlogic_options_shift 8
1182#define __fourcc_mod_amlogic_options_mask 0xff
1183
1184#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
1185 fourcc_mod_code(AMLOGIC, \
1186 ((__layout) & __fourcc_mod_amlogic_layout_mask) | \
1187 (((__options) & __fourcc_mod_amlogic_options_mask) \
1188 << __fourcc_mod_amlogic_options_shift))
1189
1190/* Amlogic FBC Layouts */
1191
1192/*
1193 * Amlogic FBC Basic Layout
1194 *
1195 * The basic layout is composed of:
1196 * - a body content organized in 64x32 superblocks with 4096 bytes per
1197 * superblock in default mode.
1198 * - a 32 bytes per 128x64 header block
1199 *
1200 * This layout is transferrable between Amlogic SoCs supporting this modifier.
1201 */
1202#define AMLOGIC_FBC_LAYOUT_BASIC (1ULL)
1203
1204/*
1205 * Amlogic FBC Scatter Memory layout
1206 *
1207 * Indicates the header contains IOMMU references to the compressed
1208 * frames content to optimize memory access and layout.
1209 *
1210 * In this mode, only the header memory address is needed, thus the
1211 * content memory organization is tied to the current producer
1212 * execution and cannot be saved/dumped neither transferrable between
1213 * Amlogic SoCs supporting this modifier.
1214 *
1215 * Due to the nature of the layout, these buffers are not expected to
1216 * be accessible by the user-space clients, but only accessible by the
1217 * hardware producers and consumers.
1218 *
1219 * The user-space clients should expect a failure while trying to mmap
1220 * the DMA-BUF handle returned by the producer.
1221 */
1222#define AMLOGIC_FBC_LAYOUT_SCATTER (2ULL)
1223
1224/* Amlogic FBC Layout Options Bit Mask */
1225
1226/*
1227 * Amlogic FBC Memory Saving mode
1228 *
1229 * Indicates the storage is packed when pixel size is multiple of word
1230 * boudaries, i.e. 8bit should be stored in this mode to save allocation
1231 * memory.
1232 *
1233 * This mode reduces body layout to 3072 bytes per 64x32 superblock with
1234 * the basic layout and 3200 bytes per 64x32 superblock combined with
1235 * the scatter layout.
1236 */
1237#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0)
1238
1239/*
1240 * AMD modifiers
1241 *
1242 * Memory layout:
1243 *
1244 * without DCC:
1245 * - main surface
1246 *
1247 * with DCC & without DCC_RETILE:
1248 * - main surface in plane 0
1249 * - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set)
1250 *
1251 * with DCC & DCC_RETILE:
1252 * - main surface in plane 0
1253 * - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned)
1254 * - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned)
1255 *
1256 * For multi-plane formats the above surfaces get merged into one plane for
1257 * each format plane, based on the required alignment only.
1258 *
1259 * Bits Parameter Notes
1260 * ----- ------------------------ ---------------------------------------------
1261 *
1262 * 7:0 TILE_VERSION Values are AMD_FMT_MOD_TILE_VER_*
1263 * 12:8 TILE Values are AMD_FMT_MOD_TILE_<version>_*
1264 * 13 DCC
1265 * 14 DCC_RETILE
1266 * 15 DCC_PIPE_ALIGN
1267 * 16 DCC_INDEPENDENT_64B
1268 * 17 DCC_INDEPENDENT_128B
1269 * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_*
1270 * 20 DCC_CONSTANT_ENCODE
1271 * 23:21 PIPE_XOR_BITS Only for some chips
1272 * 26:24 BANK_XOR_BITS Only for some chips
1273 * 29:27 PACKERS Only for some chips
1274 * 32:30 RB Only for some chips
1275 * 35:33 PIPE Only for some chips
1276 * 55:36 - Reserved for future use, must be zero
1277 */
1278#define AMD_FMT_MOD fourcc_mod_code(AMD, 0)
1279
1280#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD)
1281
1282/* Reserve 0 for GFX8 and older */
1283#define AMD_FMT_MOD_TILE_VER_GFX9 1
1284#define AMD_FMT_MOD_TILE_VER_GFX10 2
1285#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
1286
1287/*
1288 * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
1289 * version.
1290 */
1291#define AMD_FMT_MOD_TILE_GFX9_64K_S 9
1292
1293/*
1294 * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has
1295 * GFX9 as canonical version.
1296 */
1297#define AMD_FMT_MOD_TILE_GFX9_64K_D 10
1298#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
1299#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
1300#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
1301
1302#define AMD_FMT_MOD_DCC_BLOCK_64B 0
1303#define AMD_FMT_MOD_DCC_BLOCK_128B 1
1304#define AMD_FMT_MOD_DCC_BLOCK_256B 2
1305
1306#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0
1307#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF
1308#define AMD_FMT_MOD_TILE_SHIFT 8
1309#define AMD_FMT_MOD_TILE_MASK 0x1F
1310
1311/* Whether DCC compression is enabled. */
1312#define AMD_FMT_MOD_DCC_SHIFT 13
1313#define AMD_FMT_MOD_DCC_MASK 0x1
1314
1315/*
1316 * Whether to include two DCC surfaces, one which is rb & pipe aligned, and
1317 * one which is not-aligned.
1318 */
1319#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14
1320#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1
1321
1322/* Only set if DCC_RETILE = false */
1323#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15
1324#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1
1325
1326#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16
1327#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1
1328#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17
1329#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1
1330#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18
1331#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3
1332
1333/*
1334 * DCC supports embedding some clear colors directly in the DCC surface.
1335 * However, on older GPUs the rendering HW ignores the embedded clear color
1336 * and prefers the driver provided color. This necessitates doing a fastclear
1337 * eliminate operation before a process transfers control.
1338 *
1339 * If this bit is set that means the fastclear eliminate is not needed for these
1340 * embeddable colors.
1341 */
1342#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20
1343#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1
1344
1345/*
1346 * The below fields are for accounting for per GPU differences. These are only
1347 * relevant for GFX9 and later and if the tile field is *_X/_T.
1348 *
1349 * PIPE_XOR_BITS = always needed
1350 * BANK_XOR_BITS = only for TILE_VER_GFX9
1351 * PACKERS = only for TILE_VER_GFX10_RBPLUS
1352 * RB = only for TILE_VER_GFX9 & DCC
1353 * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN)
1354 */
1355#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21
1356#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7
1357#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24
1358#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7
1359#define AMD_FMT_MOD_PACKERS_SHIFT 27
1360#define AMD_FMT_MOD_PACKERS_MASK 0x7
1361#define AMD_FMT_MOD_RB_SHIFT 30
1362#define AMD_FMT_MOD_RB_MASK 0x7
1363#define AMD_FMT_MOD_PIPE_SHIFT 33
1364#define AMD_FMT_MOD_PIPE_MASK 0x7
1365
1366#define AMD_FMT_MOD_SET(field, value) \
1367 ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
1368#define AMD_FMT_MOD_GET(field, value) \
1369 (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
1370#define AMD_FMT_MOD_CLEAR(field) \
1371 (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
1372
1373#if defined(__cplusplus)
1374}
1375#endif
1376
1377#endif /* DRM_FOURCC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/drm_mode.h created+1217
...@@ -0,0 +1,1217 @@
1/*
2 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
3 * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
4 * Copyright (c) 2008 Red Hat Inc.
5 * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
6 * Copyright (c) 2007-2008 Intel Corporation
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 * IN THE SOFTWARE.
25 */
26
27#ifndef _DRM_MODE_H
28#define _DRM_MODE_H
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/**
37 * DOC: overview
38 *
39 * DRM exposes many UAPI and structure definition to have a consistent
40 * and standardized interface with user.
41 * Userspace can refer to these structure definitions and UAPI formats
42 * to communicate to driver
43 */
44
45#define DRM_CONNECTOR_NAME_LEN 32
46#define DRM_DISPLAY_MODE_LEN 32
47#define DRM_PROP_NAME_LEN 32
48
49#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */
50#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
51#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
52#define DRM_MODE_TYPE_PREFERRED (1<<3)
53#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */
54#define DRM_MODE_TYPE_USERDEF (1<<5)
55#define DRM_MODE_TYPE_DRIVER (1<<6)
56
57#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \
58 DRM_MODE_TYPE_USERDEF | \
59 DRM_MODE_TYPE_DRIVER)
60
61/* Video mode flags */
62/* bit compatible with the xrandr RR_ definitions (bits 0-13)
63 *
64 * ABI warning: Existing userspace really expects
65 * the mode flags to match the xrandr definitions. Any
66 * changes that don't match the xrandr definitions will
67 * likely need a new client cap or some other mechanism
68 * to avoid breaking existing userspace. This includes
69 * allocating new flags in the previously unused bits!
70 */
71#define DRM_MODE_FLAG_PHSYNC (1<<0)
72#define DRM_MODE_FLAG_NHSYNC (1<<1)
73#define DRM_MODE_FLAG_PVSYNC (1<<2)
74#define DRM_MODE_FLAG_NVSYNC (1<<3)
75#define DRM_MODE_FLAG_INTERLACE (1<<4)
76#define DRM_MODE_FLAG_DBLSCAN (1<<5)
77#define DRM_MODE_FLAG_CSYNC (1<<6)
78#define DRM_MODE_FLAG_PCSYNC (1<<7)
79#define DRM_MODE_FLAG_NCSYNC (1<<8)
80#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */
81#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */
82#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */
83#define DRM_MODE_FLAG_DBLCLK (1<<12)
84#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
85 /*
86 * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
87 * (define not exposed to user space).
88 */
89#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)
90#define DRM_MODE_FLAG_3D_NONE (0<<14)
91#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)
92#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14)
93#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14)
94#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14)
95#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14)
96#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14)
97#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)
98#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)
99
100/* Picture aspect ratio options */
101#define DRM_MODE_PICTURE_ASPECT_NONE 0
102#define DRM_MODE_PICTURE_ASPECT_4_3 1
103#define DRM_MODE_PICTURE_ASPECT_16_9 2
104#define DRM_MODE_PICTURE_ASPECT_64_27 3
105#define DRM_MODE_PICTURE_ASPECT_256_135 4
106
107/* Content type options */
108#define DRM_MODE_CONTENT_TYPE_NO_DATA 0
109#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1
110#define DRM_MODE_CONTENT_TYPE_PHOTO 2
111#define DRM_MODE_CONTENT_TYPE_CINEMA 3
112#define DRM_MODE_CONTENT_TYPE_GAME 4
113
114/* Aspect ratio flag bitmask (4 bits 22:19) */
115#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19)
116#define DRM_MODE_FLAG_PIC_AR_NONE \
117 (DRM_MODE_PICTURE_ASPECT_NONE<<19)
118#define DRM_MODE_FLAG_PIC_AR_4_3 \
119 (DRM_MODE_PICTURE_ASPECT_4_3<<19)
120#define DRM_MODE_FLAG_PIC_AR_16_9 \
121 (DRM_MODE_PICTURE_ASPECT_16_9<<19)
122#define DRM_MODE_FLAG_PIC_AR_64_27 \
123 (DRM_MODE_PICTURE_ASPECT_64_27<<19)
124#define DRM_MODE_FLAG_PIC_AR_256_135 \
125 (DRM_MODE_PICTURE_ASPECT_256_135<<19)
126
127#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \
128 DRM_MODE_FLAG_NHSYNC | \
129 DRM_MODE_FLAG_PVSYNC | \
130 DRM_MODE_FLAG_NVSYNC | \
131 DRM_MODE_FLAG_INTERLACE | \
132 DRM_MODE_FLAG_DBLSCAN | \
133 DRM_MODE_FLAG_CSYNC | \
134 DRM_MODE_FLAG_PCSYNC | \
135 DRM_MODE_FLAG_NCSYNC | \
136 DRM_MODE_FLAG_HSKEW | \
137 DRM_MODE_FLAG_DBLCLK | \
138 DRM_MODE_FLAG_CLKDIV2 | \
139 DRM_MODE_FLAG_3D_MASK)
140
141/* DPMS flags */
142/* bit compatible with the xorg definitions. */
143#define DRM_MODE_DPMS_ON 0
144#define DRM_MODE_DPMS_STANDBY 1
145#define DRM_MODE_DPMS_SUSPEND 2
146#define DRM_MODE_DPMS_OFF 3
147
148/* Scaling mode options */
149#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or
150 software can still scale) */
151#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */
152#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
153#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
154
155/* Dithering mode options */
156#define DRM_MODE_DITHERING_OFF 0
157#define DRM_MODE_DITHERING_ON 1
158#define DRM_MODE_DITHERING_AUTO 2
159
160/* Dirty info options */
161#define DRM_MODE_DIRTY_OFF 0
162#define DRM_MODE_DIRTY_ON 1
163#define DRM_MODE_DIRTY_ANNOTATE 2
164
165/* Link Status options */
166#define DRM_MODE_LINK_STATUS_GOOD 0
167#define DRM_MODE_LINK_STATUS_BAD 1
168
169/*
170 * DRM_MODE_ROTATE_<degrees>
171 *
172 * Signals that a drm plane is been rotated <degrees> degrees in counter
173 * clockwise direction.
174 *
175 * This define is provided as a convenience, looking up the property id
176 * using the name->prop id lookup is the preferred method.
177 */
178#define DRM_MODE_ROTATE_0 (1<<0)
179#define DRM_MODE_ROTATE_90 (1<<1)
180#define DRM_MODE_ROTATE_180 (1<<2)
181#define DRM_MODE_ROTATE_270 (1<<3)
182
183/*
184 * DRM_MODE_ROTATE_MASK
185 *
186 * Bitmask used to look for drm plane rotations.
187 */
188#define DRM_MODE_ROTATE_MASK (\
189 DRM_MODE_ROTATE_0 | \
190 DRM_MODE_ROTATE_90 | \
191 DRM_MODE_ROTATE_180 | \
192 DRM_MODE_ROTATE_270)
193
194/*
195 * DRM_MODE_REFLECT_<axis>
196 *
197 * Signals that the contents of a drm plane is reflected along the <axis> axis,
198 * in the same way as mirroring.
199 * See kerneldoc chapter "Plane Composition Properties" for more details.
200 *
201 * This define is provided as a convenience, looking up the property id
202 * using the name->prop id lookup is the preferred method.
203 */
204#define DRM_MODE_REFLECT_X (1<<4)
205#define DRM_MODE_REFLECT_Y (1<<5)
206
207/*
208 * DRM_MODE_REFLECT_MASK
209 *
210 * Bitmask used to look for drm plane reflections.
211 */
212#define DRM_MODE_REFLECT_MASK (\
213 DRM_MODE_REFLECT_X | \
214 DRM_MODE_REFLECT_Y)
215
216/* Content Protection Flags */
217#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0
218#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1
219#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2
220
221/**
222 * struct drm_mode_modeinfo - Display mode information.
223 * @clock: pixel clock in kHz
224 * @hdisplay: horizontal display size
225 * @hsync_start: horizontal sync start
226 * @hsync_end: horizontal sync end
227 * @htotal: horizontal total size
228 * @hskew: horizontal skew
229 * @vdisplay: vertical display size
230 * @vsync_start: vertical sync start
231 * @vsync_end: vertical sync end
232 * @vtotal: vertical total size
233 * @vscan: vertical scan
234 * @vrefresh: approximate vertical refresh rate in Hz
235 * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines
236 * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines
237 * @name: string describing the mode resolution
238 *
239 * This is the user-space API display mode information structure. For the
240 * kernel version see struct drm_display_mode.
241 */
242struct drm_mode_modeinfo {
243 __u32 clock;
244 __u16 hdisplay;
245 __u16 hsync_start;
246 __u16 hsync_end;
247 __u16 htotal;
248 __u16 hskew;
249 __u16 vdisplay;
250 __u16 vsync_start;
251 __u16 vsync_end;
252 __u16 vtotal;
253 __u16 vscan;
254
255 __u32 vrefresh;
256
257 __u32 flags;
258 __u32 type;
259 char name[DRM_DISPLAY_MODE_LEN];
260};
261
262struct drm_mode_card_res {
263 __u64 fb_id_ptr;
264 __u64 crtc_id_ptr;
265 __u64 connector_id_ptr;
266 __u64 encoder_id_ptr;
267 __u32 count_fbs;
268 __u32 count_crtcs;
269 __u32 count_connectors;
270 __u32 count_encoders;
271 __u32 min_width;
272 __u32 max_width;
273 __u32 min_height;
274 __u32 max_height;
275};
276
277struct drm_mode_crtc {
278 __u64 set_connectors_ptr;
279 __u32 count_connectors;
280
281 __u32 crtc_id; /**< Id */
282 __u32 fb_id; /**< Id of framebuffer */
283
284 __u32 x; /**< x Position on the framebuffer */
285 __u32 y; /**< y Position on the framebuffer */
286
287 __u32 gamma_size;
288 __u32 mode_valid;
289 struct drm_mode_modeinfo mode;
290};
291
292#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)
293#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)
294
295/* Planes blend with or override other bits on the CRTC */
296struct drm_mode_set_plane {
297 __u32 plane_id;
298 __u32 crtc_id;
299 __u32 fb_id; /* fb object contains surface format type */
300 __u32 flags; /* see above flags */
301
302 /* Signed dest location allows it to be partially off screen */
303 __s32 crtc_x;
304 __s32 crtc_y;
305 __u32 crtc_w;
306 __u32 crtc_h;
307
308 /* Source values are 16.16 fixed point */
309 __u32 src_x;
310 __u32 src_y;
311 __u32 src_h;
312 __u32 src_w;
313};
314
315/**
316 * struct drm_mode_get_plane - Get plane metadata.
317 *
318 * Userspace can perform a GETPLANE ioctl to retrieve information about a
319 * plane.
320 *
321 * To retrieve the number of formats supported, set @count_format_types to zero
322 * and call the ioctl. @count_format_types will be updated with the value.
323 *
324 * To retrieve these formats, allocate an array with the memory needed to store
325 * @count_format_types formats. Point @format_type_ptr to this array and call
326 * the ioctl again (with @count_format_types still set to the value returned in
327 * the first ioctl call).
328 */
329struct drm_mode_get_plane {
330 /**
331 * @plane_id: Object ID of the plane whose information should be
332 * retrieved. Set by caller.
333 */
334 __u32 plane_id;
335
336 /** @crtc_id: Object ID of the current CRTC. */
337 __u32 crtc_id;
338 /** @fb_id: Object ID of the current fb. */
339 __u32 fb_id;
340
341 /**
342 * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
343 * are created and they receive an index, which corresponds to their
344 * position in the bitmask. Bit N corresponds to
345 * :ref:`CRTC index<crtc_index>` N.
346 */
347 __u32 possible_crtcs;
348 /** @gamma_size: Never used. */
349 __u32 gamma_size;
350
351 /** @count_format_types: Number of formats. */
352 __u32 count_format_types;
353 /**
354 * @format_type_ptr: Pointer to ``__u32`` array of formats that are
355 * supported by the plane. These formats do not require modifiers.
356 */
357 __u64 format_type_ptr;
358};
359
360struct drm_mode_get_plane_res {
361 __u64 plane_id_ptr;
362 __u32 count_planes;
363};
364
365#define DRM_MODE_ENCODER_NONE 0
366#define DRM_MODE_ENCODER_DAC 1
367#define DRM_MODE_ENCODER_TMDS 2
368#define DRM_MODE_ENCODER_LVDS 3
369#define DRM_MODE_ENCODER_TVDAC 4
370#define DRM_MODE_ENCODER_VIRTUAL 5
371#define DRM_MODE_ENCODER_DSI 6
372#define DRM_MODE_ENCODER_DPMST 7
373#define DRM_MODE_ENCODER_DPI 8
374
375struct drm_mode_get_encoder {
376 __u32 encoder_id;
377 __u32 encoder_type;
378
379 __u32 crtc_id; /**< Id of crtc */
380
381 __u32 possible_crtcs;
382 __u32 possible_clones;
383};
384
385/* This is for connectors with multiple signal types. */
386/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
387enum drm_mode_subconnector {
388 DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */
389 DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */
390 DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */
391 DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */
392 DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */
393 DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */
394 DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */
395 DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */
396 DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */
397 DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */
398 DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */
399 DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */
400 DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */
401};
402
403#define DRM_MODE_CONNECTOR_Unknown 0
404#define DRM_MODE_CONNECTOR_VGA 1
405#define DRM_MODE_CONNECTOR_DVII 2
406#define DRM_MODE_CONNECTOR_DVID 3
407#define DRM_MODE_CONNECTOR_DVIA 4
408#define DRM_MODE_CONNECTOR_Composite 5
409#define DRM_MODE_CONNECTOR_SVIDEO 6
410#define DRM_MODE_CONNECTOR_LVDS 7
411#define DRM_MODE_CONNECTOR_Component 8
412#define DRM_MODE_CONNECTOR_9PinDIN 9
413#define DRM_MODE_CONNECTOR_DisplayPort 10
414#define DRM_MODE_CONNECTOR_HDMIA 11
415#define DRM_MODE_CONNECTOR_HDMIB 12
416#define DRM_MODE_CONNECTOR_TV 13
417#define DRM_MODE_CONNECTOR_eDP 14
418#define DRM_MODE_CONNECTOR_VIRTUAL 15
419#define DRM_MODE_CONNECTOR_DSI 16
420#define DRM_MODE_CONNECTOR_DPI 17
421#define DRM_MODE_CONNECTOR_WRITEBACK 18
422#define DRM_MODE_CONNECTOR_SPI 19
423#define DRM_MODE_CONNECTOR_USB 20
424
425/**
426 * struct drm_mode_get_connector - Get connector metadata.
427 *
428 * User-space can perform a GETCONNECTOR ioctl to retrieve information about a
429 * connector. User-space is expected to retrieve encoders, modes and properties
430 * by performing this ioctl at least twice: the first time to retrieve the
431 * number of elements, the second time to retrieve the elements themselves.
432 *
433 * To retrieve the number of elements, set @count_props and @count_encoders to
434 * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct
435 * drm_mode_modeinfo element.
436 *
437 * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr,
438 * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and
439 * @count_encoders to their capacity.
440 *
441 * Performing the ioctl only twice may be racy: the number of elements may have
442 * changed with a hotplug event in-between the two ioctls. User-space is
443 * expected to retry the last ioctl until the number of elements stabilizes.
444 * The kernel won't fill any array which doesn't have the expected length.
445 *
446 * **Force-probing a connector**
447 *
448 * If the @count_modes field is set to zero and the DRM client is the current
449 * DRM master, the kernel will perform a forced probe on the connector to
450 * refresh the connector status, modes and EDID. A forced-probe can be slow,
451 * might cause flickering and the ioctl will block.
452 *
453 * User-space needs to force-probe connectors to ensure their metadata is
454 * up-to-date at startup and after receiving a hot-plug event. User-space
455 * may perform a forced-probe when the user explicitly requests it. User-space
456 * shouldn't perform a forced-probe in other situations.
457 */
458struct drm_mode_get_connector {
459 /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */
460 __u64 encoders_ptr;
461 /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */
462 __u64 modes_ptr;
463 /** @props_ptr: Pointer to ``__u32`` array of property IDs. */
464 __u64 props_ptr;
465 /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */
466 __u64 prop_values_ptr;
467
468 /** @count_modes: Number of modes. */
469 __u32 count_modes;
470 /** @count_props: Number of properties. */
471 __u32 count_props;
472 /** @count_encoders: Number of encoders. */
473 __u32 count_encoders;
474
475 /** @encoder_id: Object ID of the current encoder. */
476 __u32 encoder_id;
477 /** @connector_id: Object ID of the connector. */
478 __u32 connector_id;
479 /**
480 * @connector_type: Type of the connector.
481 *
482 * See DRM_MODE_CONNECTOR_* defines.
483 */
484 __u32 connector_type;
485 /**
486 * @connector_type_id: Type-specific connector number.
487 *
488 * This is not an object ID. This is a per-type connector number. Each
489 * (type, type_id) combination is unique across all connectors of a DRM
490 * device.
491 */
492 __u32 connector_type_id;
493
494 /**
495 * @connection: Status of the connector.
496 *
497 * See enum drm_connector_status.
498 */
499 __u32 connection;
500 /** @mm_width: Width of the connected sink in millimeters. */
501 __u32 mm_width;
502 /** @mm_height: Height of the connected sink in millimeters. */
503 __u32 mm_height;
504 /**
505 * @subpixel: Subpixel order of the connected sink.
506 *
507 * See enum subpixel_order.
508 */
509 __u32 subpixel;
510
511 /** @pad: Padding, must be zero. */
512 __u32 pad;
513};
514
515#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */
516#define DRM_MODE_PROP_RANGE (1<<1)
517#define DRM_MODE_PROP_IMMUTABLE (1<<2)
518#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */
519#define DRM_MODE_PROP_BLOB (1<<4)
520#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */
521
522/* non-extended types: legacy bitmask, one bit per type: */
523#define DRM_MODE_PROP_LEGACY_TYPE ( \
524 DRM_MODE_PROP_RANGE | \
525 DRM_MODE_PROP_ENUM | \
526 DRM_MODE_PROP_BLOB | \
527 DRM_MODE_PROP_BITMASK)
528
529/* extended-types: rather than continue to consume a bit per type,
530 * grab a chunk of the bits to use as integer type id.
531 */
532#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
533#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
534#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
535#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
536
537/* the PROP_ATOMIC flag is used to hide properties from userspace that
538 * is not aware of atomic properties. This is mostly to work around
539 * older userspace (DDX drivers) that read/write each prop they find,
540 * witout being aware that this could be triggering a lengthy modeset.
541 */
542#define DRM_MODE_PROP_ATOMIC 0x80000000
543
544/**
545 * struct drm_mode_property_enum - Description for an enum/bitfield entry.
546 * @value: numeric value for this enum entry.
547 * @name: symbolic name for this enum entry.
548 *
549 * See struct drm_property_enum for details.
550 */
551struct drm_mode_property_enum {
552 __u64 value;
553 char name[DRM_PROP_NAME_LEN];
554};
555
556/**
557 * struct drm_mode_get_property - Get property metadata.
558 *
559 * User-space can perform a GETPROPERTY ioctl to retrieve information about a
560 * property. The same property may be attached to multiple objects, see
561 * "Modeset Base Object Abstraction".
562 *
563 * The meaning of the @values_ptr field changes depending on the property type.
564 * See &drm_property.flags for more details.
565 *
566 * The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the
567 * property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For
568 * backwards compatibility, the kernel will always set @count_enum_blobs to
569 * zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must
570 * ignore these two fields if the property has a different type.
571 *
572 * User-space is expected to retrieve values and enums by performing this ioctl
573 * at least twice: the first time to retrieve the number of elements, the
574 * second time to retrieve the elements themselves.
575 *
576 * To retrieve the number of elements, set @count_values and @count_enum_blobs
577 * to zero, then call the ioctl. @count_values will be updated with the number
578 * of elements. If the property has the type &DRM_MODE_PROP_ENUM or
579 * &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well.
580 *
581 * To retrieve the elements themselves, allocate an array for @values_ptr and
582 * set @count_values to its capacity. If the property has the type
583 * &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for
584 * @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl
585 * again will fill the arrays.
586 */
587struct drm_mode_get_property {
588 /** @values_ptr: Pointer to a ``__u64`` array. */
589 __u64 values_ptr;
590 /** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */
591 __u64 enum_blob_ptr;
592
593 /**
594 * @prop_id: Object ID of the property which should be retrieved. Set
595 * by the caller.
596 */
597 __u32 prop_id;
598 /**
599 * @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for
600 * a definition of the flags.
601 */
602 __u32 flags;
603 /**
604 * @name: Symbolic property name. User-space should use this field to
605 * recognize properties.
606 */
607 char name[DRM_PROP_NAME_LEN];
608
609 /** @count_values: Number of elements in @values_ptr. */
610 __u32 count_values;
611 /** @count_enum_blobs: Number of elements in @enum_blob_ptr. */
612 __u32 count_enum_blobs;
613};
614
615struct drm_mode_connector_set_property {
616 __u64 value;
617 __u32 prop_id;
618 __u32 connector_id;
619};
620
621#define DRM_MODE_OBJECT_CRTC 0xcccccccc
622#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
623#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
624#define DRM_MODE_OBJECT_MODE 0xdededede
625#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
626#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
627#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
628#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
629#define DRM_MODE_OBJECT_ANY 0
630
631struct drm_mode_obj_get_properties {
632 __u64 props_ptr;
633 __u64 prop_values_ptr;
634 __u32 count_props;
635 __u32 obj_id;
636 __u32 obj_type;
637};
638
639struct drm_mode_obj_set_property {
640 __u64 value;
641 __u32 prop_id;
642 __u32 obj_id;
643 __u32 obj_type;
644};
645
646struct drm_mode_get_blob {
647 __u32 blob_id;
648 __u32 length;
649 __u64 data;
650};
651
652struct drm_mode_fb_cmd {
653 __u32 fb_id;
654 __u32 width;
655 __u32 height;
656 __u32 pitch;
657 __u32 bpp;
658 __u32 depth;
659 /* driver specific handle */
660 __u32 handle;
661};
662
663#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
664#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
665
666struct drm_mode_fb_cmd2 {
667 __u32 fb_id;
668 __u32 width;
669 __u32 height;
670 __u32 pixel_format; /* fourcc code from drm_fourcc.h */
671 __u32 flags; /* see above flags */
672
673 /*
674 * In case of planar formats, this ioctl allows up to 4
675 * buffer objects with offsets and pitches per plane.
676 * The pitch and offset order is dictated by the fourcc,
677 * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:
678 *
679 * YUV 4:2:0 image with a plane of 8 bit Y samples
680 * followed by an interleaved U/V plane containing
681 * 8 bit 2x2 subsampled colour difference samples.
682 *
683 * So it would consist of Y as offsets[0] and UV as
684 * offsets[1]. Note that offsets[0] will generally
685 * be 0 (but this is not required).
686 *
687 * To accommodate tiled, compressed, etc formats, a
688 * modifier can be specified. The default value of zero
689 * indicates "native" format as specified by the fourcc.
690 * Vendor specific modifier token. Note that even though
691 * it looks like we have a modifier per-plane, we in fact
692 * do not. The modifier for each plane must be identical.
693 * Thus all combinations of different data layouts for
694 * multi plane formats must be enumerated as separate
695 * modifiers.
696 */
697 __u32 handles[4];
698 __u32 pitches[4]; /* pitch for each plane */
699 __u32 offsets[4]; /* offset of each plane */
700 __u64 modifier[4]; /* ie, tiling, compress */
701};
702
703#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
704#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
705#define DRM_MODE_FB_DIRTY_FLAGS 0x03
706
707#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
708
709/*
710 * Mark a region of a framebuffer as dirty.
711 *
712 * Some hardware does not automatically update display contents
713 * as a hardware or software draw to a framebuffer. This ioctl
714 * allows userspace to tell the kernel and the hardware what
715 * regions of the framebuffer have changed.
716 *
717 * The kernel or hardware is free to update more then just the
718 * region specified by the clip rects. The kernel or hardware
719 * may also delay and/or coalesce several calls to dirty into a
720 * single update.
721 *
722 * Userspace may annotate the updates, the annotates are a
723 * promise made by the caller that the change is either a copy
724 * of pixels or a fill of a single color in the region specified.
725 *
726 * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then
727 * the number of updated regions are half of num_clips given,
728 * where the clip rects are paired in src and dst. The width and
729 * height of each one of the pairs must match.
730 *
731 * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller
732 * promises that the region specified of the clip rects is filled
733 * completely with a single color as given in the color argument.
734 */
735
736struct drm_mode_fb_dirty_cmd {
737 __u32 fb_id;
738 __u32 flags;
739 __u32 color;
740 __u32 num_clips;
741 __u64 clips_ptr;
742};
743
744struct drm_mode_mode_cmd {
745 __u32 connector_id;
746 struct drm_mode_modeinfo mode;
747};
748
749#define DRM_MODE_CURSOR_BO 0x01
750#define DRM_MODE_CURSOR_MOVE 0x02
751#define DRM_MODE_CURSOR_FLAGS 0x03
752
753/*
754 * depending on the value in flags different members are used.
755 *
756 * CURSOR_BO uses
757 * crtc_id
758 * width
759 * height
760 * handle - if 0 turns the cursor off
761 *
762 * CURSOR_MOVE uses
763 * crtc_id
764 * x
765 * y
766 */
767struct drm_mode_cursor {
768 __u32 flags;
769 __u32 crtc_id;
770 __s32 x;
771 __s32 y;
772 __u32 width;
773 __u32 height;
774 /* driver specific handle */
775 __u32 handle;
776};
777
778struct drm_mode_cursor2 {
779 __u32 flags;
780 __u32 crtc_id;
781 __s32 x;
782 __s32 y;
783 __u32 width;
784 __u32 height;
785 /* driver specific handle */
786 __u32 handle;
787 __s32 hot_x;
788 __s32 hot_y;
789};
790
791struct drm_mode_crtc_lut {
792 __u32 crtc_id;
793 __u32 gamma_size;
794
795 /* pointers to arrays */
796 __u64 red;
797 __u64 green;
798 __u64 blue;
799};
800
801struct drm_color_ctm {
802 /*
803 * Conversion matrix in S31.32 sign-magnitude
804 * (not two's complement!) format.
805 */
806 __u64 matrix[9];
807};
808
809struct drm_color_lut {
810 /*
811 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
812 * 0xffff == 1.0.
813 */
814 __u16 red;
815 __u16 green;
816 __u16 blue;
817 __u16 reserved;
818};
819
820/**
821 * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
822 *
823 * HDR Metadata Infoframe as per CTA 861.G spec. This is expected
824 * to match exactly with the spec.
825 *
826 * Userspace is expected to pass the metadata information as per
827 * the format described in this structure.
828 */
829struct hdr_metadata_infoframe {
830 /**
831 * @eotf: Electro-Optical Transfer Function (EOTF)
832 * used in the stream.
833 */
834 __u8 eotf;
835 /**
836 * @metadata_type: Static_Metadata_Descriptor_ID.
837 */
838 __u8 metadata_type;
839 /**
840 * @display_primaries: Color Primaries of the Data.
841 * These are coded as unsigned 16-bit values in units of
842 * 0.00002, where 0x0000 represents zero and 0xC350
843 * represents 1.0000.
844 * @display_primaries.x: X cordinate of color primary.
845 * @display_primaries.y: Y cordinate of color primary.
846 */
847 struct {
848 __u16 x, y;
849 } display_primaries[3];
850 /**
851 * @white_point: White Point of Colorspace Data.
852 * These are coded as unsigned 16-bit values in units of
853 * 0.00002, where 0x0000 represents zero and 0xC350
854 * represents 1.0000.
855 * @white_point.x: X cordinate of whitepoint of color primary.
856 * @white_point.y: Y cordinate of whitepoint of color primary.
857 */
858 struct {
859 __u16 x, y;
860 } white_point;
861 /**
862 * @max_display_mastering_luminance: Max Mastering Display Luminance.
863 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
864 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
865 */
866 __u16 max_display_mastering_luminance;
867 /**
868 * @min_display_mastering_luminance: Min Mastering Display Luminance.
869 * This value is coded as an unsigned 16-bit value in units of
870 * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
871 * represents 6.5535 cd/m2.
872 */
873 __u16 min_display_mastering_luminance;
874 /**
875 * @max_cll: Max Content Light Level.
876 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
877 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
878 */
879 __u16 max_cll;
880 /**
881 * @max_fall: Max Frame Average Light Level.
882 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
883 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
884 */
885 __u16 max_fall;
886};
887
888/**
889 * struct hdr_output_metadata - HDR output metadata
890 *
891 * Metadata Information to be passed from userspace
892 */
893struct hdr_output_metadata {
894 /**
895 * @metadata_type: Static_Metadata_Descriptor_ID.
896 */
897 __u32 metadata_type;
898 /**
899 * @hdmi_metadata_type1: HDR Metadata Infoframe.
900 */
901 union {
902 struct hdr_metadata_infoframe hdmi_metadata_type1;
903 };
904};
905
906#define DRM_MODE_PAGE_FLIP_EVENT 0x01
907#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
908#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
909#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
910#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
911 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
912#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
913 DRM_MODE_PAGE_FLIP_ASYNC | \
914 DRM_MODE_PAGE_FLIP_TARGET)
915
916/*
917 * Request a page flip on the specified crtc.
918 *
919 * This ioctl will ask KMS to schedule a page flip for the specified
920 * crtc. Once any pending rendering targeting the specified fb (as of
921 * ioctl time) has completed, the crtc will be reprogrammed to display
922 * that fb after the next vertical refresh. The ioctl returns
923 * immediately, but subsequent rendering to the current fb will block
924 * in the execbuffer ioctl until the page flip happens. If a page
925 * flip is already pending as the ioctl is called, EBUSY will be
926 * returned.
927 *
928 * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
929 * event (see drm.h: struct drm_event_vblank) when the page flip is
930 * done. The user_data field passed in with this ioctl will be
931 * returned as the user_data field in the vblank event struct.
932 *
933 * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
934 * 'as soon as possible', meaning that it not delay waiting for vblank.
935 * This may cause tearing on the screen.
936 *
937 * The reserved field must be zero.
938 */
939
940struct drm_mode_crtc_page_flip {
941 __u32 crtc_id;
942 __u32 fb_id;
943 __u32 flags;
944 __u32 reserved;
945 __u64 user_data;
946};
947
948/*
949 * Request a page flip on the specified crtc.
950 *
951 * Same as struct drm_mode_crtc_page_flip, but supports new flags and
952 * re-purposes the reserved field:
953 *
954 * The sequence field must be zero unless either of the
955 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When
956 * the ABSOLUTE flag is specified, the sequence field denotes the absolute
957 * vblank sequence when the flip should take effect. When the RELATIVE
958 * flag is specified, the sequence field denotes the relative (to the
959 * current one when the ioctl is called) vblank sequence when the flip
960 * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to
961 * make sure the vblank sequence before the target one has passed before
962 * calling this ioctl. The purpose of the
963 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify
964 * the target for when code dealing with a page flip runs during a
965 * vertical blank period.
966 */
967
968struct drm_mode_crtc_page_flip_target {
969 __u32 crtc_id;
970 __u32 fb_id;
971 __u32 flags;
972 __u32 sequence;
973 __u64 user_data;
974};
975
976/* create a dumb scanout buffer */
977struct drm_mode_create_dumb {
978 __u32 height;
979 __u32 width;
980 __u32 bpp;
981 __u32 flags;
982 /* handle, pitch, size will be returned */
983 __u32 handle;
984 __u32 pitch;
985 __u64 size;
986};
987
988/* set up for mmap of a dumb scanout buffer */
989struct drm_mode_map_dumb {
990 /** Handle for the object being mapped. */
991 __u32 handle;
992 __u32 pad;
993 /**
994 * Fake offset to use for subsequent mmap call
995 *
996 * This is a fixed-size type for 32/64 compatibility.
997 */
998 __u64 offset;
999};
1000
1001struct drm_mode_destroy_dumb {
1002 __u32 handle;
1003};
1004
1005/* page-flip flags are valid, plus: */
1006#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
1007#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
1008#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
1009
1010#define DRM_MODE_ATOMIC_FLAGS (\
1011 DRM_MODE_PAGE_FLIP_EVENT |\
1012 DRM_MODE_PAGE_FLIP_ASYNC |\
1013 DRM_MODE_ATOMIC_TEST_ONLY |\
1014 DRM_MODE_ATOMIC_NONBLOCK |\
1015 DRM_MODE_ATOMIC_ALLOW_MODESET)
1016
1017struct drm_mode_atomic {
1018 __u32 flags;
1019 __u32 count_objs;
1020 __u64 objs_ptr;
1021 __u64 count_props_ptr;
1022 __u64 props_ptr;
1023 __u64 prop_values_ptr;
1024 __u64 reserved;
1025 __u64 user_data;
1026};
1027
1028struct drm_format_modifier_blob {
1029#define FORMAT_BLOB_CURRENT 1
1030 /* Version of this blob format */
1031 __u32 version;
1032
1033 /* Flags */
1034 __u32 flags;
1035
1036 /* Number of fourcc formats supported */
1037 __u32 count_formats;
1038
1039 /* Where in this blob the formats exist (in bytes) */
1040 __u32 formats_offset;
1041
1042 /* Number of drm_format_modifiers */
1043 __u32 count_modifiers;
1044
1045 /* Where in this blob the modifiers exist (in bytes) */
1046 __u32 modifiers_offset;
1047
1048 /* __u32 formats[] */
1049 /* struct drm_format_modifier modifiers[] */
1050};
1051
1052struct drm_format_modifier {
1053 /* Bitmask of formats in get_plane format list this info applies to. The
1054 * offset allows a sliding window of which 64 formats (bits).
1055 *
1056 * Some examples:
1057 * In today's world with < 65 formats, and formats 0, and 2 are
1058 * supported
1059 * 0x0000000000000005
1060 * ^-offset = 0, formats = 5
1061 *
1062 * If the number formats grew to 128, and formats 98-102 are
1063 * supported with the modifier:
1064 *
1065 * 0x0000007c00000000 0000000000000000
1066 * ^
1067 * |__offset = 64, formats = 0x7c00000000
1068 *
1069 */
1070 __u64 formats;
1071 __u32 offset;
1072 __u32 pad;
1073
1074 /* The modifier that applies to the >get_plane format list bitmask. */
1075 __u64 modifier;
1076};
1077
1078/**
1079 * struct drm_mode_create_blob - Create New blob property
1080 *
1081 * Create a new 'blob' data property, copying length bytes from data pointer,
1082 * and returning new blob ID.
1083 */
1084struct drm_mode_create_blob {
1085 /** @data: Pointer to data to copy. */
1086 __u64 data;
1087 /** @length: Length of data to copy. */
1088 __u32 length;
1089 /** @blob_id: Return: new property ID. */
1090 __u32 blob_id;
1091};
1092
1093/**
1094 * struct drm_mode_destroy_blob - Destroy user blob
1095 * @blob_id: blob_id to destroy
1096 *
1097 * Destroy a user-created blob property.
1098 *
1099 * User-space can release blobs as soon as they do not need to refer to them by
1100 * their blob object ID. For instance, if you are using a MODE_ID blob in an
1101 * atomic commit and you will not make another commit re-using the same ID, you
1102 * can destroy the blob as soon as the commit has been issued, without waiting
1103 * for it to complete.
1104 */
1105struct drm_mode_destroy_blob {
1106 __u32 blob_id;
1107};
1108
1109/**
1110 * struct drm_mode_create_lease - Create lease
1111 *
1112 * Lease mode resources, creating another drm_master.
1113 *
1114 * The @object_ids array must reference at least one CRTC, one connector and
1115 * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
1116 * the lease can be completely empty.
1117 */
1118struct drm_mode_create_lease {
1119 /** @object_ids: Pointer to array of object ids (__u32) */
1120 __u64 object_ids;
1121 /** @object_count: Number of object ids */
1122 __u32 object_count;
1123 /** @flags: flags for new FD (O_CLOEXEC, etc) */
1124 __u32 flags;
1125
1126 /** @lessee_id: Return: unique identifier for lessee. */
1127 __u32 lessee_id;
1128 /** @fd: Return: file descriptor to new drm_master file */
1129 __u32 fd;
1130};
1131
1132/**
1133 * struct drm_mode_list_lessees - List lessees
1134 *
1135 * List lesses from a drm_master.
1136 */
1137struct drm_mode_list_lessees {
1138 /**
1139 * @count_lessees: Number of lessees.
1140 *
1141 * On input, provides length of the array.
1142 * On output, provides total number. No
1143 * more than the input number will be written
1144 * back, so two calls can be used to get
1145 * the size and then the data.
1146 */
1147 __u32 count_lessees;
1148 /** @pad: Padding. */
1149 __u32 pad;
1150
1151 /**
1152 * @lessees_ptr: Pointer to lessees.
1153 *
1154 * Pointer to __u64 array of lessee ids
1155 */
1156 __u64 lessees_ptr;
1157};
1158
1159/**
1160 * struct drm_mode_get_lease - Get Lease
1161 *
1162 * Get leased objects.
1163 */
1164struct drm_mode_get_lease {
1165 /**
1166 * @count_objects: Number of leased objects.
1167 *
1168 * On input, provides length of the array.
1169 * On output, provides total number. No
1170 * more than the input number will be written
1171 * back, so two calls can be used to get
1172 * the size and then the data.
1173 */
1174 __u32 count_objects;
1175 /** @pad: Padding. */
1176 __u32 pad;
1177
1178 /**
1179 * @objects_ptr: Pointer to objects.
1180 *
1181 * Pointer to __u32 array of object ids.
1182 */
1183 __u64 objects_ptr;
1184};
1185
1186/**
1187 * struct drm_mode_revoke_lease - Revoke lease
1188 */
1189struct drm_mode_revoke_lease {
1190 /** @lessee_id: Unique ID of lessee */
1191 __u32 lessee_id;
1192};
1193
1194/**
1195 * struct drm_mode_rect - Two dimensional rectangle.
1196 * @x1: Horizontal starting coordinate (inclusive).
1197 * @y1: Vertical starting coordinate (inclusive).
1198 * @x2: Horizontal ending coordinate (exclusive).
1199 * @y2: Vertical ending coordinate (exclusive).
1200 *
1201 * With drm subsystem using struct drm_rect to manage rectangular area this
1202 * export it to user-space.
1203 *
1204 * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.
1205 */
1206struct drm_mode_rect {
1207 __s32 x1;
1208 __s32 y1;
1209 __s32 x2;
1210 __s32 y2;
1211};
1212
1213#if defined(__cplusplus)
1214}
1215#endif
1216
1217#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/drm_sarea.h created+92
...@@ -0,0 +1,92 @@
1/**
2 * \file drm_sarea.h
3 * \brief SAREA definitions
4 *
5 * \author Michel Dänzer <michel@daenzer.net>
6 */
7
8/*
9 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
10 * All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice (including the next
20 * paragraph) shall be included in all copies or substantial portions of the
21 * Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 * OTHER DEALINGS IN THE SOFTWARE.
30 */
31
32#ifndef _DRM_SAREA_H_
33#define _DRM_SAREA_H_
34
35#include "drm.h"
36
37#if defined(__cplusplus)
38extern "C" {
39#endif
40
41/* SAREA area needs to be at least a page */
42#if defined(__alpha__)
43#define SAREA_MAX 0x2000U
44#elif defined(__mips__)
45#define SAREA_MAX 0x4000U
46#elif defined(__ia64__)
47#define SAREA_MAX 0x10000U /* 64kB */
48#else
49/* Intel 830M driver needs at least 8k SAREA */
50#define SAREA_MAX 0x2000U
51#endif
52
53/** Maximum number of drawables in the SAREA */
54#define SAREA_MAX_DRAWABLES 256
55
56#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
57
58/** SAREA drawable */
59struct drm_sarea_drawable {
60 unsigned int stamp;
61 unsigned int flags;
62};
63
64/** SAREA frame */
65struct drm_sarea_frame {
66 unsigned int x;
67 unsigned int y;
68 unsigned int width;
69 unsigned int height;
70 unsigned int fullscreen;
71};
72
73/** SAREA */
74struct drm_sarea {
75 /** first thing is always the DRM locking structure */
76 struct drm_hw_lock lock;
77 /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
78 struct drm_hw_lock drawable_lock;
79 struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
80 struct drm_sarea_frame frame; /**< frame */
81 drm_context_t dummy_context;
82};
83
84typedef struct drm_sarea_drawable drm_sarea_drawable_t;
85typedef struct drm_sarea_frame drm_sarea_frame_t;
86typedef struct drm_sarea drm_sarea_t;
87
88#if defined(__cplusplus)
89}
90#endif
91
92#endif /* _DRM_SAREA_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/etnaviv_drm.h created+300
...@@ -0,0 +1,300 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 Etnaviv Project
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __ETNAVIV_DRM_H__
19#define __ETNAVIV_DRM_H__
20
21#include "drm.h"
22
23#if defined(__cplusplus)
24extern "C" {
25#endif
26
27/* Please note that modifications to all structs defined here are
28 * subject to backwards-compatibility constraints:
29 * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
30 * user/kernel compatibility
31 * 2) Keep fields aligned to their size
32 * 3) Because of how drm_ioctl() works, we can add new fields at
33 * the end of an ioctl if some care is taken: drm_ioctl() will
34 * zero out the new fields at the tail of the ioctl, so a zero
35 * value should have a backwards compatible meaning. And for
36 * output params, userspace won't see the newly added output
37 * fields.. so that has to be somehow ok.
38 */
39
40/* timeouts are specified in clock-monotonic absolute times (to simplify
41 * restarting interrupted ioctls). The following struct is logically the
42 * same as 'struct timespec' but 32/64b ABI safe.
43 */
44struct drm_etnaviv_timespec {
45 __s64 tv_sec; /* seconds */
46 __s64 tv_nsec; /* nanoseconds */
47};
48
49#define ETNAVIV_PARAM_GPU_MODEL 0x01
50#define ETNAVIV_PARAM_GPU_REVISION 0x02
51#define ETNAVIV_PARAM_GPU_FEATURES_0 0x03
52#define ETNAVIV_PARAM_GPU_FEATURES_1 0x04
53#define ETNAVIV_PARAM_GPU_FEATURES_2 0x05
54#define ETNAVIV_PARAM_GPU_FEATURES_3 0x06
55#define ETNAVIV_PARAM_GPU_FEATURES_4 0x07
56#define ETNAVIV_PARAM_GPU_FEATURES_5 0x08
57#define ETNAVIV_PARAM_GPU_FEATURES_6 0x09
58#define ETNAVIV_PARAM_GPU_FEATURES_7 0x0a
59#define ETNAVIV_PARAM_GPU_FEATURES_8 0x0b
60#define ETNAVIV_PARAM_GPU_FEATURES_9 0x0c
61#define ETNAVIV_PARAM_GPU_FEATURES_10 0x0d
62#define ETNAVIV_PARAM_GPU_FEATURES_11 0x0e
63#define ETNAVIV_PARAM_GPU_FEATURES_12 0x0f
64
65#define ETNAVIV_PARAM_GPU_STREAM_COUNT 0x10
66#define ETNAVIV_PARAM_GPU_REGISTER_MAX 0x11
67#define ETNAVIV_PARAM_GPU_THREAD_COUNT 0x12
68#define ETNAVIV_PARAM_GPU_VERTEX_CACHE_SIZE 0x13
69#define ETNAVIV_PARAM_GPU_SHADER_CORE_COUNT 0x14
70#define ETNAVIV_PARAM_GPU_PIXEL_PIPES 0x15
71#define ETNAVIV_PARAM_GPU_VERTEX_OUTPUT_BUFFER_SIZE 0x16
72#define ETNAVIV_PARAM_GPU_BUFFER_SIZE 0x17
73#define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT 0x18
74#define ETNAVIV_PARAM_GPU_NUM_CONSTANTS 0x19
75#define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a
76#define ETNAVIV_PARAM_SOFTPIN_START_ADDR 0x1b
77#define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c
78#define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d
79#define ETNAVIV_PARAM_GPU_ECO_ID 0x1e
80
81#define ETNA_MAX_PIPES 4
82
83struct drm_etnaviv_param {
84 __u32 pipe; /* in */
85 __u32 param; /* in, ETNAVIV_PARAM_x */
86 __u64 value; /* out (get_param) or in (set_param) */
87};
88
89/*
90 * GEM buffers:
91 */
92
93#define ETNA_BO_CACHE_MASK 0x000f0000
94/* cache modes */
95#define ETNA_BO_CACHED 0x00010000
96#define ETNA_BO_WC 0x00020000
97#define ETNA_BO_UNCACHED 0x00040000
98/* map flags */
99#define ETNA_BO_FORCE_MMU 0x00100000
100
101struct drm_etnaviv_gem_new {
102 __u64 size; /* in */
103 __u32 flags; /* in, mask of ETNA_BO_x */
104 __u32 handle; /* out */
105};
106
107struct drm_etnaviv_gem_info {
108 __u32 handle; /* in */
109 __u32 pad;
110 __u64 offset; /* out, offset to pass to mmap() */
111};
112
113#define ETNA_PREP_READ 0x01
114#define ETNA_PREP_WRITE 0x02
115#define ETNA_PREP_NOSYNC 0x04
116
117struct drm_etnaviv_gem_cpu_prep {
118 __u32 handle; /* in */
119 __u32 op; /* in, mask of ETNA_PREP_x */
120 struct drm_etnaviv_timespec timeout; /* in */
121};
122
123struct drm_etnaviv_gem_cpu_fini {
124 __u32 handle; /* in */
125 __u32 flags; /* in, placeholder for now, no defined values */
126};
127
128/*
129 * Cmdstream Submission:
130 */
131
132/* The value written into the cmdstream is logically:
133 * relocbuf->gpuaddr + reloc_offset
134 *
135 * NOTE that reloc's must be sorted by order of increasing submit_offset,
136 * otherwise EINVAL.
137 */
138struct drm_etnaviv_gem_submit_reloc {
139 __u32 submit_offset; /* in, offset from submit_bo */
140 __u32 reloc_idx; /* in, index of reloc_bo buffer */
141 __u64 reloc_offset; /* in, offset from start of reloc_bo */
142 __u32 flags; /* in, placeholder for now, no defined values */
143};
144
145/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
146 * cmdstream buffer(s) themselves or reloc entries) has one (and only
147 * one) entry in the submit->bos[] table.
148 *
149 * As a optimization, the current buffer (gpu virtual address) can be
150 * passed back through the 'presumed' field. If on a subsequent reloc,
151 * userspace passes back a 'presumed' address that is still valid,
152 * then patching the cmdstream for this entry is skipped. This can
153 * avoid kernel needing to map/access the cmdstream bo in the common
154 * case.
155 * If the submit is a softpin submit (ETNA_SUBMIT_SOFTPIN) the 'presumed'
156 * field is interpreted as the fixed location to map the bo into the gpu
157 * virtual address space. If the kernel is unable to map the buffer at
158 * this location the submit will fail. This means userspace is responsible
159 * for the whole gpu virtual address management.
160 */
161#define ETNA_SUBMIT_BO_READ 0x0001
162#define ETNA_SUBMIT_BO_WRITE 0x0002
163struct drm_etnaviv_gem_submit_bo {
164 __u32 flags; /* in, mask of ETNA_SUBMIT_BO_x */
165 __u32 handle; /* in, GEM handle */
166 __u64 presumed; /* in/out, presumed buffer address */
167};
168
169/* performance monitor request (pmr) */
170#define ETNA_PM_PROCESS_PRE 0x0001
171#define ETNA_PM_PROCESS_POST 0x0002
172struct drm_etnaviv_gem_submit_pmr {
173 __u32 flags; /* in, when to process request (ETNA_PM_PROCESS_x) */
174 __u8 domain; /* in, pm domain */
175 __u8 pad;
176 __u16 signal; /* in, pm signal */
177 __u32 sequence; /* in, sequence number */
178 __u32 read_offset; /* in, offset from read_bo */
179 __u32 read_idx; /* in, index of read_bo buffer */
180};
181
182/* Each cmdstream submit consists of a table of buffers involved, and
183 * one or more cmdstream buffers. This allows for conditional execution
184 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
185 */
186#define ETNA_SUBMIT_NO_IMPLICIT 0x0001
187#define ETNA_SUBMIT_FENCE_FD_IN 0x0002
188#define ETNA_SUBMIT_FENCE_FD_OUT 0x0004
189#define ETNA_SUBMIT_SOFTPIN 0x0008
190#define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \
191 ETNA_SUBMIT_FENCE_FD_IN | \
192 ETNA_SUBMIT_FENCE_FD_OUT| \
193 ETNA_SUBMIT_SOFTPIN)
194#define ETNA_PIPE_3D 0x00
195#define ETNA_PIPE_2D 0x01
196#define ETNA_PIPE_VG 0x02
197struct drm_etnaviv_gem_submit {
198 __u32 fence; /* out */
199 __u32 pipe; /* in */
200 __u32 exec_state; /* in, initial execution state (ETNA_PIPE_x) */
201 __u32 nr_bos; /* in, number of submit_bo's */
202 __u32 nr_relocs; /* in, number of submit_reloc's */
203 __u32 stream_size; /* in, cmdstream size */
204 __u64 bos; /* in, ptr to array of submit_bo's */
205 __u64 relocs; /* in, ptr to array of submit_reloc's */
206 __u64 stream; /* in, ptr to cmdstream */
207 __u32 flags; /* in, mask of ETNA_SUBMIT_x */
208 __s32 fence_fd; /* in/out, fence fd (see ETNA_SUBMIT_FENCE_FD_x) */
209 __u64 pmrs; /* in, ptr to array of submit_pmr's */
210 __u32 nr_pmrs; /* in, number of submit_pmr's */
211 __u32 pad;
212};
213
214/* The normal way to synchronize with the GPU is just to CPU_PREP on
215 * a buffer if you need to access it from the CPU (other cmdstream
216 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
217 * handle the required synchronization under the hood). This ioctl
218 * mainly just exists as a way to implement the gallium pipe_fence
219 * APIs without requiring a dummy bo to synchronize on.
220 */
221#define ETNA_WAIT_NONBLOCK 0x01
222struct drm_etnaviv_wait_fence {
223 __u32 pipe; /* in */
224 __u32 fence; /* in */
225 __u32 flags; /* in, mask of ETNA_WAIT_x */
226 __u32 pad;
227 struct drm_etnaviv_timespec timeout; /* in */
228};
229
230#define ETNA_USERPTR_READ 0x01
231#define ETNA_USERPTR_WRITE 0x02
232struct drm_etnaviv_gem_userptr {
233 __u64 user_ptr; /* in, page aligned user pointer */
234 __u64 user_size; /* in, page aligned user size */
235 __u32 flags; /* in, flags */
236 __u32 handle; /* out, non-zero handle */
237};
238
239struct drm_etnaviv_gem_wait {
240 __u32 pipe; /* in */
241 __u32 handle; /* in, bo to be waited for */
242 __u32 flags; /* in, mask of ETNA_WAIT_x */
243 __u32 pad;
244 struct drm_etnaviv_timespec timeout; /* in */
245};
246
247/*
248 * Performance Monitor (PM):
249 */
250
251struct drm_etnaviv_pm_domain {
252 __u32 pipe; /* in */
253 __u8 iter; /* in/out, select pm domain at index iter */
254 __u8 id; /* out, id of domain */
255 __u16 nr_signals; /* out, how many signals does this domain provide */
256 char name[64]; /* out, name of domain */
257};
258
259struct drm_etnaviv_pm_signal {
260 __u32 pipe; /* in */
261 __u8 domain; /* in, pm domain index */
262 __u8 pad;
263 __u16 iter; /* in/out, select pm source at index iter */
264 __u16 id; /* out, id of signal */
265 char name[64]; /* out, name of domain */
266};
267
268#define DRM_ETNAVIV_GET_PARAM 0x00
269/* placeholder:
270#define DRM_ETNAVIV_SET_PARAM 0x01
271 */
272#define DRM_ETNAVIV_GEM_NEW 0x02
273#define DRM_ETNAVIV_GEM_INFO 0x03
274#define DRM_ETNAVIV_GEM_CPU_PREP 0x04
275#define DRM_ETNAVIV_GEM_CPU_FINI 0x05
276#define DRM_ETNAVIV_GEM_SUBMIT 0x06
277#define DRM_ETNAVIV_WAIT_FENCE 0x07
278#define DRM_ETNAVIV_GEM_USERPTR 0x08
279#define DRM_ETNAVIV_GEM_WAIT 0x09
280#define DRM_ETNAVIV_PM_QUERY_DOM 0x0a
281#define DRM_ETNAVIV_PM_QUERY_SIG 0x0b
282#define DRM_ETNAVIV_NUM_IOCTLS 0x0c
283
284#define DRM_IOCTL_ETNAVIV_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param)
285#define DRM_IOCTL_ETNAVIV_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new)
286#define DRM_IOCTL_ETNAVIV_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_INFO, struct drm_etnaviv_gem_info)
287#define DRM_IOCTL_ETNAVIV_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_PREP, struct drm_etnaviv_gem_cpu_prep)
288#define DRM_IOCTL_ETNAVIV_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_FINI, struct drm_etnaviv_gem_cpu_fini)
289#define DRM_IOCTL_ETNAVIV_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_SUBMIT, struct drm_etnaviv_gem_submit)
290#define DRM_IOCTL_ETNAVIV_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence)
291#define DRM_IOCTL_ETNAVIV_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr)
292#define DRM_IOCTL_ETNAVIV_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait)
293#define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain)
294#define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal)
295
296#if defined(__cplusplus)
297}
298#endif
299
300#endif /* __ETNAVIV_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/exynos_drm.h created+424
...@@ -0,0 +1,424 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* exynos_drm.h
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * Authors:
6 * Inki Dae <inki.dae@samsung.com>
7 * Joonyoung Shim <jy0922.shim@samsung.com>
8 * Seung-Woo Kim <sw0312.kim@samsung.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifndef _EXYNOS_DRM_H_
17#define _EXYNOS_DRM_H_
18
19#include "drm.h"
20
21#if defined(__cplusplus)
22extern "C" {
23#endif
24
25/**
26 * User-desired buffer creation information structure.
27 *
28 * @size: user-desired memory allocation size.
29 * - this size value would be page-aligned internally.
30 * @flags: user request for setting memory type or cache attributes.
31 * @handle: returned a handle to created gem object.
32 * - this handle will be set by gem module of kernel side.
33 */
34struct drm_exynos_gem_create {
35 __u64 size;
36 __u32 flags;
37 __u32 handle;
38};
39
40/**
41 * A structure for getting a fake-offset that can be used with mmap.
42 *
43 * @handle: handle of gem object.
44 * @reserved: just padding to be 64-bit aligned.
45 * @offset: a fake-offset of gem object.
46 */
47struct drm_exynos_gem_map {
48 __u32 handle;
49 __u32 reserved;
50 __u64 offset;
51};
52
53/**
54 * A structure to gem information.
55 *
56 * @handle: a handle to gem object created.
57 * @flags: flag value including memory type and cache attribute and
58 * this value would be set by driver.
59 * @size: size to memory region allocated by gem and this size would
60 * be set by driver.
61 */
62struct drm_exynos_gem_info {
63 __u32 handle;
64 __u32 flags;
65 __u64 size;
66};
67
68/**
69 * A structure for user connection request of virtual display.
70 *
71 * @connection: indicate whether doing connection or not by user.
72 * @extensions: if this value is 1 then the vidi driver would need additional
73 * 128bytes edid data.
74 * @edid: the edid data pointer from user side.
75 */
76struct drm_exynos_vidi_connection {
77 __u32 connection;
78 __u32 extensions;
79 __u64 edid;
80};
81
82/* memory type definitions. */
83enum e_drm_exynos_gem_mem_type {
84 /* Physically Continuous memory and used as default. */
85 EXYNOS_BO_CONTIG = 0 << 0,
86 /* Physically Non-Continuous memory. */
87 EXYNOS_BO_NONCONTIG = 1 << 0,
88 /* non-cachable mapping and used as default. */
89 EXYNOS_BO_NONCACHABLE = 0 << 1,
90 /* cachable mapping. */
91 EXYNOS_BO_CACHABLE = 1 << 1,
92 /* write-combine mapping. */
93 EXYNOS_BO_WC = 1 << 2,
94 EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | EXYNOS_BO_CACHABLE |
95 EXYNOS_BO_WC
96};
97
98struct drm_exynos_g2d_get_ver {
99 __u32 major;
100 __u32 minor;
101};
102
103struct drm_exynos_g2d_cmd {
104 __u32 offset;
105 __u32 data;
106};
107
108enum drm_exynos_g2d_buf_type {
109 G2D_BUF_USERPTR = 1 << 31,
110};
111
112enum drm_exynos_g2d_event_type {
113 G2D_EVENT_NOT,
114 G2D_EVENT_NONSTOP,
115 G2D_EVENT_STOP, /* not yet */
116};
117
118struct drm_exynos_g2d_userptr {
119 unsigned long userptr;
120 unsigned long size;
121};
122
123struct drm_exynos_g2d_set_cmdlist {
124 __u64 cmd;
125 __u64 cmd_buf;
126 __u32 cmd_nr;
127 __u32 cmd_buf_nr;
128
129 /* for g2d event */
130 __u64 event_type;
131 __u64 user_data;
132};
133
134struct drm_exynos_g2d_exec {
135 __u64 async;
136};
137
138/* Exynos DRM IPP v2 API */
139
140/**
141 * Enumerate available IPP hardware modules.
142 *
143 * @count_ipps: size of ipp_id array / number of ipp modules (set by driver)
144 * @reserved: padding
145 * @ipp_id_ptr: pointer to ipp_id array or NULL
146 */
147struct drm_exynos_ioctl_ipp_get_res {
148 __u32 count_ipps;
149 __u32 reserved;
150 __u64 ipp_id_ptr;
151};
152
153enum drm_exynos_ipp_format_type {
154 DRM_EXYNOS_IPP_FORMAT_SOURCE = 0x01,
155 DRM_EXYNOS_IPP_FORMAT_DESTINATION = 0x02,
156};
157
158struct drm_exynos_ipp_format {
159 __u32 fourcc;
160 __u32 type;
161 __u64 modifier;
162};
163
164enum drm_exynos_ipp_capability {
165 DRM_EXYNOS_IPP_CAP_CROP = 0x01,
166 DRM_EXYNOS_IPP_CAP_ROTATE = 0x02,
167 DRM_EXYNOS_IPP_CAP_SCALE = 0x04,
168 DRM_EXYNOS_IPP_CAP_CONVERT = 0x08,
169};
170
171/**
172 * Get IPP hardware capabilities and supported image formats.
173 *
174 * @ipp_id: id of IPP module to query
175 * @capabilities: bitmask of drm_exynos_ipp_capability (set by driver)
176 * @reserved: padding
177 * @formats_count: size of formats array (in entries) / number of filled
178 * formats (set by driver)
179 * @formats_ptr: pointer to formats array or NULL
180 */
181struct drm_exynos_ioctl_ipp_get_caps {
182 __u32 ipp_id;
183 __u32 capabilities;
184 __u32 reserved;
185 __u32 formats_count;
186 __u64 formats_ptr;
187};
188
189enum drm_exynos_ipp_limit_type {
190 /* size (horizontal/vertial) limits, in pixels (min, max, alignment) */
191 DRM_EXYNOS_IPP_LIMIT_TYPE_SIZE = 0x0001,
192 /* scale ratio (horizonta/vertial), 16.16 fixed point (min, max) */
193 DRM_EXYNOS_IPP_LIMIT_TYPE_SCALE = 0x0002,
194
195 /* image buffer area */
196 DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER = 0x0001 << 16,
197 /* src/dst rectangle area */
198 DRM_EXYNOS_IPP_LIMIT_SIZE_AREA = 0x0002 << 16,
199 /* src/dst rectangle area when rotation enabled */
200 DRM_EXYNOS_IPP_LIMIT_SIZE_ROTATED = 0x0003 << 16,
201
202 DRM_EXYNOS_IPP_LIMIT_TYPE_MASK = 0x000f,
203 DRM_EXYNOS_IPP_LIMIT_SIZE_MASK = 0x000f << 16,
204};
205
206struct drm_exynos_ipp_limit_val {
207 __u32 min;
208 __u32 max;
209 __u32 align;
210 __u32 reserved;
211};
212
213/**
214 * IPP module limitation.
215 *
216 * @type: limit type (see drm_exynos_ipp_limit_type enum)
217 * @reserved: padding
218 * @h: horizontal limits
219 * @v: vertical limits
220 */
221struct drm_exynos_ipp_limit {
222 __u32 type;
223 __u32 reserved;
224 struct drm_exynos_ipp_limit_val h;
225 struct drm_exynos_ipp_limit_val v;
226};
227
228/**
229 * Get IPP limits for given image format.
230 *
231 * @ipp_id: id of IPP module to query
232 * @fourcc: image format code (see DRM_FORMAT_* in drm_fourcc.h)
233 * @modifier: image format modifier (see DRM_FORMAT_MOD_* in drm_fourcc.h)
234 * @type: source/destination identifier (drm_exynos_ipp_format_flag enum)
235 * @limits_count: size of limits array (in entries) / number of filled entries
236 * (set by driver)
237 * @limits_ptr: pointer to limits array or NULL
238 */
239struct drm_exynos_ioctl_ipp_get_limits {
240 __u32 ipp_id;
241 __u32 fourcc;
242 __u64 modifier;
243 __u32 type;
244 __u32 limits_count;
245 __u64 limits_ptr;
246};
247
248enum drm_exynos_ipp_task_id {
249 /* buffer described by struct drm_exynos_ipp_task_buffer */
250 DRM_EXYNOS_IPP_TASK_BUFFER = 0x0001,
251 /* rectangle described by struct drm_exynos_ipp_task_rect */
252 DRM_EXYNOS_IPP_TASK_RECTANGLE = 0x0002,
253 /* transformation described by struct drm_exynos_ipp_task_transform */
254 DRM_EXYNOS_IPP_TASK_TRANSFORM = 0x0003,
255 /* alpha configuration described by struct drm_exynos_ipp_task_alpha */
256 DRM_EXYNOS_IPP_TASK_ALPHA = 0x0004,
257
258 /* source image data (for buffer and rectangle chunks) */
259 DRM_EXYNOS_IPP_TASK_TYPE_SOURCE = 0x0001 << 16,
260 /* destination image data (for buffer and rectangle chunks) */
261 DRM_EXYNOS_IPP_TASK_TYPE_DESTINATION = 0x0002 << 16,
262};
263
264/**
265 * Memory buffer with image data.
266 *
267 * @id: must be DRM_EXYNOS_IPP_TASK_BUFFER
268 * other parameters are same as for AddFB2 generic DRM ioctl
269 */
270struct drm_exynos_ipp_task_buffer {
271 __u32 id;
272 __u32 fourcc;
273 __u32 width, height;
274 __u32 gem_id[4];
275 __u32 offset[4];
276 __u32 pitch[4];
277 __u64 modifier;
278};
279
280/**
281 * Rectangle for processing.
282 *
283 * @id: must be DRM_EXYNOS_IPP_TASK_RECTANGLE
284 * @reserved: padding
285 * @x,@y: left corner in pixels
286 * @w,@h: width/height in pixels
287 */
288struct drm_exynos_ipp_task_rect {
289 __u32 id;
290 __u32 reserved;
291 __u32 x;
292 __u32 y;
293 __u32 w;
294 __u32 h;
295};
296
297/**
298 * Image tranformation description.
299 *
300 * @id: must be DRM_EXYNOS_IPP_TASK_TRANSFORM
301 * @rotation: DRM_MODE_ROTATE_* and DRM_MODE_REFLECT_* values
302 */
303struct drm_exynos_ipp_task_transform {
304 __u32 id;
305 __u32 rotation;
306};
307
308/**
309 * Image global alpha configuration for formats without alpha values.
310 *
311 * @id: must be DRM_EXYNOS_IPP_TASK_ALPHA
312 * @value: global alpha value (0-255)
313 */
314struct drm_exynos_ipp_task_alpha {
315 __u32 id;
316 __u32 value;
317};
318
319enum drm_exynos_ipp_flag {
320 /* generate DRM event after processing */
321 DRM_EXYNOS_IPP_FLAG_EVENT = 0x01,
322 /* dry run, only check task parameters */
323 DRM_EXYNOS_IPP_FLAG_TEST_ONLY = 0x02,
324 /* non-blocking processing */
325 DRM_EXYNOS_IPP_FLAG_NONBLOCK = 0x04,
326};
327
328#define DRM_EXYNOS_IPP_FLAGS (DRM_EXYNOS_IPP_FLAG_EVENT |\
329 DRM_EXYNOS_IPP_FLAG_TEST_ONLY | DRM_EXYNOS_IPP_FLAG_NONBLOCK)
330
331/**
332 * Perform image processing described by array of drm_exynos_ipp_task_*
333 * structures (parameters array).
334 *
335 * @ipp_id: id of IPP module to run the task
336 * @flags: bitmask of drm_exynos_ipp_flag values
337 * @reserved: padding
338 * @params_size: size of parameters array (in bytes)
339 * @params_ptr: pointer to parameters array or NULL
340 * @user_data: (optional) data for drm event
341 */
342struct drm_exynos_ioctl_ipp_commit {
343 __u32 ipp_id;
344 __u32 flags;
345 __u32 reserved;
346 __u32 params_size;
347 __u64 params_ptr;
348 __u64 user_data;
349};
350
351#define DRM_EXYNOS_GEM_CREATE 0x00
352#define DRM_EXYNOS_GEM_MAP 0x01
353/* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */
354#define DRM_EXYNOS_GEM_GET 0x04
355#define DRM_EXYNOS_VIDI_CONNECTION 0x07
356
357/* G2D */
358#define DRM_EXYNOS_G2D_GET_VER 0x20
359#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
360#define DRM_EXYNOS_G2D_EXEC 0x22
361
362/* Reserved 0x30 ~ 0x33 for obsolete Exynos IPP ioctls */
363/* IPP - Image Post Processing */
364#define DRM_EXYNOS_IPP_GET_RESOURCES 0x40
365#define DRM_EXYNOS_IPP_GET_CAPS 0x41
366#define DRM_EXYNOS_IPP_GET_LIMITS 0x42
367#define DRM_EXYNOS_IPP_COMMIT 0x43
368
369#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
370 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
371#define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
372 DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
373#define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
374 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
375
376#define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
377 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
378
379#define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
380 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
381#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
382 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
383#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
384 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
385
386#define DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES DRM_IOWR(DRM_COMMAND_BASE + \
387 DRM_EXYNOS_IPP_GET_RESOURCES, \
388 struct drm_exynos_ioctl_ipp_get_res)
389#define DRM_IOCTL_EXYNOS_IPP_GET_CAPS DRM_IOWR(DRM_COMMAND_BASE + \
390 DRM_EXYNOS_IPP_GET_CAPS, struct drm_exynos_ioctl_ipp_get_caps)
391#define DRM_IOCTL_EXYNOS_IPP_GET_LIMITS DRM_IOWR(DRM_COMMAND_BASE + \
392 DRM_EXYNOS_IPP_GET_LIMITS, \
393 struct drm_exynos_ioctl_ipp_get_limits)
394#define DRM_IOCTL_EXYNOS_IPP_COMMIT DRM_IOWR(DRM_COMMAND_BASE + \
395 DRM_EXYNOS_IPP_COMMIT, struct drm_exynos_ioctl_ipp_commit)
396
397/* Exynos specific events */
398#define DRM_EXYNOS_G2D_EVENT 0x80000000
399#define DRM_EXYNOS_IPP_EVENT 0x80000002
400
401struct drm_exynos_g2d_event {
402 struct drm_event base;
403 __u64 user_data;
404 __u32 tv_sec;
405 __u32 tv_usec;
406 __u32 cmdlist_no;
407 __u32 reserved;
408};
409
410struct drm_exynos_ipp_event {
411 struct drm_event base;
412 __u64 user_data;
413 __u32 tv_sec;
414 __u32 tv_usec;
415 __u32 ipp_id;
416 __u32 sequence;
417 __u64 reserved;
418};
419
420#if defined(__cplusplus)
421}
422#endif
423
424#endif /* _EXYNOS_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/i810_drm.h created+292
...@@ -0,0 +1,292 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _I810_DRM_H_
3#define _I810_DRM_H_
4
5#include "drm.h"
6
7#if defined(__cplusplus)
8extern "C" {
9#endif
10
11/* WARNING: These defines must be the same as what the Xserver uses.
12 * if you change them, you must change the defines in the Xserver.
13 */
14
15#ifndef _I810_DEFINES_
16#define _I810_DEFINES_
17
18#define I810_DMA_BUF_ORDER 12
19#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
20#define I810_DMA_BUF_NR 256
21#define I810_NR_SAREA_CLIPRECTS 8
22
23/* Each region is a minimum of 64k, and there are at most 64 of them.
24 */
25#define I810_NR_TEX_REGIONS 64
26#define I810_LOG_MIN_TEX_REGION_SIZE 16
27#endif
28
29#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
30#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
31#define I810_UPLOAD_CTX 0x4
32#define I810_UPLOAD_BUFFERS 0x8
33#define I810_UPLOAD_TEX0 0x10
34#define I810_UPLOAD_TEX1 0x20
35#define I810_UPLOAD_CLIPRECTS 0x40
36
37/* Indices into buf.Setup where various bits of state are mirrored per
38 * context and per buffer. These can be fired at the card as a unit,
39 * or in a piecewise fashion as required.
40 */
41
42/* Destbuffer state
43 * - backbuffer linear offset and pitch -- invarient in the current dri
44 * - zbuffer linear offset and pitch -- also invarient
45 * - drawing origin in back and depth buffers.
46 *
47 * Keep the depth/back buffer state here to accommodate private buffers
48 * in the future.
49 */
50#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
51#define I810_DESTREG_DI1 1
52#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
53#define I810_DESTREG_DV1 3
54#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
55#define I810_DESTREG_DR1 5
56#define I810_DESTREG_DR2 6
57#define I810_DESTREG_DR3 7
58#define I810_DESTREG_DR4 8
59#define I810_DEST_SETUP_SIZE 10
60
61/* Context state
62 */
63#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
64#define I810_CTXREG_CF1 1
65#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
66#define I810_CTXREG_ST1 3
67#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
68#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
69#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
70#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
71#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
72#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
73#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
74#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
75#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
76#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
77#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
78#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
79#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
80#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
81#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
82#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
83#define I810_CTX_SETUP_SIZE 20
84
85/* Texture state (per tex unit)
86 */
87#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
88#define I810_TEXREG_MI1 1
89#define I810_TEXREG_MI2 2
90#define I810_TEXREG_MI3 3
91#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
92#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
93#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
94#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
95#define I810_TEX_SETUP_SIZE 8
96
97/* Flags for clear ioctl
98 */
99#define I810_FRONT 0x1
100#define I810_BACK 0x2
101#define I810_DEPTH 0x4
102
103typedef enum _drm_i810_init_func {
104 I810_INIT_DMA = 0x01,
105 I810_CLEANUP_DMA = 0x02,
106 I810_INIT_DMA_1_4 = 0x03
107} drm_i810_init_func_t;
108
109/* This is the init structure after v1.2 */
110typedef struct _drm_i810_init {
111 drm_i810_init_func_t func;
112 unsigned int mmio_offset;
113 unsigned int buffers_offset;
114 int sarea_priv_offset;
115 unsigned int ring_start;
116 unsigned int ring_end;
117 unsigned int ring_size;
118 unsigned int front_offset;
119 unsigned int back_offset;
120 unsigned int depth_offset;
121 unsigned int overlay_offset;
122 unsigned int overlay_physical;
123 unsigned int w;
124 unsigned int h;
125 unsigned int pitch;
126 unsigned int pitch_bits;
127} drm_i810_init_t;
128
129/* This is the init structure prior to v1.2 */
130typedef struct _drm_i810_pre12_init {
131 drm_i810_init_func_t func;
132 unsigned int mmio_offset;
133 unsigned int buffers_offset;
134 int sarea_priv_offset;
135 unsigned int ring_start;
136 unsigned int ring_end;
137 unsigned int ring_size;
138 unsigned int front_offset;
139 unsigned int back_offset;
140 unsigned int depth_offset;
141 unsigned int w;
142 unsigned int h;
143 unsigned int pitch;
144 unsigned int pitch_bits;
145} drm_i810_pre12_init_t;
146
147/* Warning: If you change the SAREA structure you must change the Xserver
148 * structure as well */
149
150typedef struct _drm_i810_tex_region {
151 unsigned char next, prev; /* indices to form a circular LRU */
152 unsigned char in_use; /* owned by a client, or free? */
153 int age; /* tracked by clients to update local LRU's */
154} drm_i810_tex_region_t;
155
156typedef struct _drm_i810_sarea {
157 unsigned int ContextState[I810_CTX_SETUP_SIZE];
158 unsigned int BufferState[I810_DEST_SETUP_SIZE];
159 unsigned int TexState[2][I810_TEX_SETUP_SIZE];
160 unsigned int dirty;
161
162 unsigned int nbox;
163 struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
164
165 /* Maintain an LRU of contiguous regions of texture space. If
166 * you think you own a region of texture memory, and it has an
167 * age different to the one you set, then you are mistaken and
168 * it has been stolen by another client. If global texAge
169 * hasn't changed, there is no need to walk the list.
170 *
171 * These regions can be used as a proxy for the fine-grained
172 * texture information of other clients - by maintaining them
173 * in the same lru which is used to age their own textures,
174 * clients have an approximate lru for the whole of global
175 * texture space, and can make informed decisions as to which
176 * areas to kick out. There is no need to choose whether to
177 * kick out your own texture or someone else's - simply eject
178 * them all in LRU order.
179 */
180
181 drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
182 /* Last elt is sentinal */
183 int texAge; /* last time texture was uploaded */
184 int last_enqueue; /* last time a buffer was enqueued */
185 int last_dispatch; /* age of the most recently dispatched buffer */
186 int last_quiescent; /* */
187 int ctxOwner; /* last context to upload state */
188
189 int vertex_prim;
190
191 int pf_enabled; /* is pageflipping allowed? */
192 int pf_active;
193 int pf_current_page; /* which buffer is being displayed? */
194} drm_i810_sarea_t;
195
196/* WARNING: If you change any of these defines, make sure to change the
197 * defines in the Xserver file (xf86drmMga.h)
198 */
199
200/* i810 specific ioctls
201 * The device specific ioctl range is 0x40 to 0x79.
202 */
203#define DRM_I810_INIT 0x00
204#define DRM_I810_VERTEX 0x01
205#define DRM_I810_CLEAR 0x02
206#define DRM_I810_FLUSH 0x03
207#define DRM_I810_GETAGE 0x04
208#define DRM_I810_GETBUF 0x05
209#define DRM_I810_SWAP 0x06
210#define DRM_I810_COPY 0x07
211#define DRM_I810_DOCOPY 0x08
212#define DRM_I810_OV0INFO 0x09
213#define DRM_I810_FSTATUS 0x0a
214#define DRM_I810_OV0FLIP 0x0b
215#define DRM_I810_MC 0x0c
216#define DRM_I810_RSTATUS 0x0d
217#define DRM_I810_FLIP 0x0e
218
219#define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
220#define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
221#define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
222#define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH)
223#define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE)
224#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
225#define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP)
226#define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
227#define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY)
228#define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
229#define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS)
230#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
231#define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
232#define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS)
233#define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP)
234
235typedef struct _drm_i810_clear {
236 int clear_color;
237 int clear_depth;
238 int flags;
239} drm_i810_clear_t;
240
241/* These may be placeholders if we have more cliprects than
242 * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
243 * false, indicating that the buffer will be dispatched again with a
244 * new set of cliprects.
245 */
246typedef struct _drm_i810_vertex {
247 int idx; /* buffer index */
248 int used; /* nr bytes in use */
249 int discard; /* client is finished with the buffer? */
250} drm_i810_vertex_t;
251
252typedef struct _drm_i810_copy_t {
253 int idx; /* buffer index */
254 int used; /* nr bytes in use */
255 void *address; /* Address to copy from */
256} drm_i810_copy_t;
257
258#define PR_TRIANGLES (0x0<<18)
259#define PR_TRISTRIP_0 (0x1<<18)
260#define PR_TRISTRIP_1 (0x2<<18)
261#define PR_TRIFAN (0x3<<18)
262#define PR_POLYGON (0x4<<18)
263#define PR_LINES (0x5<<18)
264#define PR_LINESTRIP (0x6<<18)
265#define PR_RECTS (0x7<<18)
266#define PR_MASK (0x7<<18)
267
268typedef struct drm_i810_dma {
269 void *virtual;
270 int request_idx;
271 int request_size;
272 int granted;
273} drm_i810_dma_t;
274
275typedef struct _drm_i810_overlay_t {
276 unsigned int offset; /* Address of the Overlay Regs */
277 unsigned int physical;
278} drm_i810_overlay_t;
279
280typedef struct _drm_i810_mc {
281 int idx; /* buffer index */
282 int used; /* nr bytes in use */
283 int num_blocks; /* number of GFXBlocks */
284 int *length; /* List of lengths for GFXBlocks (FUTURE) */
285 unsigned int last_render; /* Last Render Request */
286} drm_i810_mc_t;
287
288#if defined(__cplusplus)
289}
290#endif
291
292#endif /* _I810_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/i915_drm.h created+3285
...@@ -0,0 +1,3285 @@
1/*
2 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#ifndef _I915_DRM_H_
28#define _I915_DRM_H_
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* Please note that modifications to all structs defined here are
37 * subject to backwards-compatibility constraints.
38 */
39
40/**
41 * DOC: uevents generated by i915 on it's device node
42 *
43 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
44 * event from the gpu l3 cache. Additional information supplied is ROW,
45 * BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep
46 * track of these events and if a specific cache-line seems to have a
47 * persistent error remap it with the l3 remapping tool supplied in
48 * intel-gpu-tools. The value supplied with the event is always 1.
49 *
50 * I915_ERROR_UEVENT - Generated upon error detection, currently only via
51 * hangcheck. The error detection event is a good indicator of when things
52 * began to go badly. The value supplied with the event is a 1 upon error
53 * detection, and a 0 upon reset completion, signifying no more error
54 * exists. NOTE: Disabling hangcheck or reset via module parameter will
55 * cause the related events to not be seen.
56 *
57 * I915_RESET_UEVENT - Event is generated just before an attempt to reset the
58 * GPU. The value supplied with the event is always 1. NOTE: Disable
59 * reset via module parameter will cause this event to not be seen.
60 */
61#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
62#define I915_ERROR_UEVENT "ERROR"
63#define I915_RESET_UEVENT "RESET"
64
65/**
66 * struct i915_user_extension - Base class for defining a chain of extensions
67 *
68 * Many interfaces need to grow over time. In most cases we can simply
69 * extend the struct and have userspace pass in more data. Another option,
70 * as demonstrated by Vulkan's approach to providing extensions for forward
71 * and backward compatibility, is to use a list of optional structs to
72 * provide those extra details.
73 *
74 * The key advantage to using an extension chain is that it allows us to
75 * redefine the interface more easily than an ever growing struct of
76 * increasing complexity, and for large parts of that interface to be
77 * entirely optional. The downside is more pointer chasing; chasing across
78 * the boundary with pointers encapsulated inside u64.
79 *
80 * Example chaining:
81 *
82 * .. code-block:: C
83 *
84 * struct i915_user_extension ext3 {
85 * .next_extension = 0, // end
86 * .name = ...,
87 * };
88 * struct i915_user_extension ext2 {
89 * .next_extension = (uintptr_t)&ext3,
90 * .name = ...,
91 * };
92 * struct i915_user_extension ext1 {
93 * .next_extension = (uintptr_t)&ext2,
94 * .name = ...,
95 * };
96 *
97 * Typically the struct i915_user_extension would be embedded in some uAPI
98 * struct, and in this case we would feed it the head of the chain(i.e ext1),
99 * which would then apply all of the above extensions.
100 *
101 */
102struct i915_user_extension {
103 /**
104 * @next_extension:
105 *
106 * Pointer to the next struct i915_user_extension, or zero if the end.
107 */
108 __u64 next_extension;
109 /**
110 * @name: Name of the extension.
111 *
112 * Note that the name here is just some integer.
113 *
114 * Also note that the name space for this is not global for the whole
115 * driver, but rather its scope/meaning is limited to the specific piece
116 * of uAPI which has embedded the struct i915_user_extension.
117 */
118 __u32 name;
119 /**
120 * @flags: MBZ
121 *
122 * All undefined bits must be zero.
123 */
124 __u32 flags;
125 /**
126 * @rsvd: MBZ
127 *
128 * Reserved for future use; must be zero.
129 */
130 __u32 rsvd[4];
131};
132
133/*
134 * MOCS indexes used for GPU surfaces, defining the cacheability of the
135 * surface data and the coherency for this data wrt. CPU vs. GPU accesses.
136 */
137enum i915_mocs_table_index {
138 /*
139 * Not cached anywhere, coherency between CPU and GPU accesses is
140 * guaranteed.
141 */
142 I915_MOCS_UNCACHED,
143 /*
144 * Cacheability and coherency controlled by the kernel automatically
145 * based on the DRM_I915_GEM_SET_CACHING IOCTL setting and the current
146 * usage of the surface (used for display scanout or not).
147 */
148 I915_MOCS_PTE,
149 /*
150 * Cached in all GPU caches available on the platform.
151 * Coherency between CPU and GPU accesses to the surface is not
152 * guaranteed without extra synchronization.
153 */
154 I915_MOCS_CACHED,
155};
156
157/*
158 * Different engines serve different roles, and there may be more than one
159 * engine serving each role. enum drm_i915_gem_engine_class provides a
160 * classification of the role of the engine, which may be used when requesting
161 * operations to be performed on a certain subset of engines, or for providing
162 * information about that group.
163 */
164enum drm_i915_gem_engine_class {
165 I915_ENGINE_CLASS_RENDER = 0,
166 I915_ENGINE_CLASS_COPY = 1,
167 I915_ENGINE_CLASS_VIDEO = 2,
168 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
169
170 /* should be kept compact */
171
172 I915_ENGINE_CLASS_INVALID = -1
173};
174
175/*
176 * There may be more than one engine fulfilling any role within the system.
177 * Each engine of a class is given a unique instance number and therefore
178 * any engine can be specified by its class:instance tuplet. APIs that allow
179 * access to any engine in the system will use struct i915_engine_class_instance
180 * for this identification.
181 */
182struct i915_engine_class_instance {
183 __u16 engine_class; /* see enum drm_i915_gem_engine_class */
184 __u16 engine_instance;
185#define I915_ENGINE_CLASS_INVALID_NONE -1
186#define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
187};
188
189/**
190 * DOC: perf_events exposed by i915 through /sys/bus/event_sources/drivers/i915
191 *
192 */
193
194enum drm_i915_pmu_engine_sample {
195 I915_SAMPLE_BUSY = 0,
196 I915_SAMPLE_WAIT = 1,
197 I915_SAMPLE_SEMA = 2
198};
199
200#define I915_PMU_SAMPLE_BITS (4)
201#define I915_PMU_SAMPLE_MASK (0xf)
202#define I915_PMU_SAMPLE_INSTANCE_BITS (8)
203#define I915_PMU_CLASS_SHIFT \
204 (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
205
206#define __I915_PMU_ENGINE(class, instance, sample) \
207 ((class) << I915_PMU_CLASS_SHIFT | \
208 (instance) << I915_PMU_SAMPLE_BITS | \
209 (sample))
210
211#define I915_PMU_ENGINE_BUSY(class, instance) \
212 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
213
214#define I915_PMU_ENGINE_WAIT(class, instance) \
215 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
216
217#define I915_PMU_ENGINE_SEMA(class, instance) \
218 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
219
220#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
221
222#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
223#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
224#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
225#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
226#define I915_PMU_SOFTWARE_GT_AWAKE_TIME __I915_PMU_OTHER(4)
227
228#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
229
230/* Each region is a minimum of 16k, and there are at most 255 of them.
231 */
232#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
233 * of chars for next/prev indices */
234#define I915_LOG_MIN_TEX_REGION_SIZE 14
235
236typedef struct _drm_i915_init {
237 enum {
238 I915_INIT_DMA = 0x01,
239 I915_CLEANUP_DMA = 0x02,
240 I915_RESUME_DMA = 0x03
241 } func;
242 unsigned int mmio_offset;
243 int sarea_priv_offset;
244 unsigned int ring_start;
245 unsigned int ring_end;
246 unsigned int ring_size;
247 unsigned int front_offset;
248 unsigned int back_offset;
249 unsigned int depth_offset;
250 unsigned int w;
251 unsigned int h;
252 unsigned int pitch;
253 unsigned int pitch_bits;
254 unsigned int back_pitch;
255 unsigned int depth_pitch;
256 unsigned int cpp;
257 unsigned int chipset;
258} drm_i915_init_t;
259
260typedef struct _drm_i915_sarea {
261 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
262 int last_upload; /* last time texture was uploaded */
263 int last_enqueue; /* last time a buffer was enqueued */
264 int last_dispatch; /* age of the most recently dispatched buffer */
265 int ctxOwner; /* last context to upload state */
266 int texAge;
267 int pf_enabled; /* is pageflipping allowed? */
268 int pf_active;
269 int pf_current_page; /* which buffer is being displayed? */
270 int perf_boxes; /* performance boxes to be displayed */
271 int width, height; /* screen size in pixels */
272
273 drm_handle_t front_handle;
274 int front_offset;
275 int front_size;
276
277 drm_handle_t back_handle;
278 int back_offset;
279 int back_size;
280
281 drm_handle_t depth_handle;
282 int depth_offset;
283 int depth_size;
284
285 drm_handle_t tex_handle;
286 int tex_offset;
287 int tex_size;
288 int log_tex_granularity;
289 int pitch;
290 int rotation; /* 0, 90, 180 or 270 */
291 int rotated_offset;
292 int rotated_size;
293 int rotated_pitch;
294 int virtualX, virtualY;
295
296 unsigned int front_tiled;
297 unsigned int back_tiled;
298 unsigned int depth_tiled;
299 unsigned int rotated_tiled;
300 unsigned int rotated2_tiled;
301
302 int pipeA_x;
303 int pipeA_y;
304 int pipeA_w;
305 int pipeA_h;
306 int pipeB_x;
307 int pipeB_y;
308 int pipeB_w;
309 int pipeB_h;
310
311 /* fill out some space for old userspace triple buffer */
312 drm_handle_t unused_handle;
313 __u32 unused1, unused2, unused3;
314
315 /* buffer object handles for static buffers. May change
316 * over the lifetime of the client.
317 */
318 __u32 front_bo_handle;
319 __u32 back_bo_handle;
320 __u32 unused_bo_handle;
321 __u32 depth_bo_handle;
322
323} drm_i915_sarea_t;
324
325/* due to userspace building against these headers we need some compat here */
326#define planeA_x pipeA_x
327#define planeA_y pipeA_y
328#define planeA_w pipeA_w
329#define planeA_h pipeA_h
330#define planeB_x pipeB_x
331#define planeB_y pipeB_y
332#define planeB_w pipeB_w
333#define planeB_h pipeB_h
334
335/* Flags for perf_boxes
336 */
337#define I915_BOX_RING_EMPTY 0x1
338#define I915_BOX_FLIP 0x2
339#define I915_BOX_WAIT 0x4
340#define I915_BOX_TEXTURE_LOAD 0x8
341#define I915_BOX_LOST_CONTEXT 0x10
342
343/*
344 * i915 specific ioctls.
345 *
346 * The device specific ioctl range is [DRM_COMMAND_BASE, DRM_COMMAND_END) ie
347 * [0x40, 0xa0) (a0 is excluded). The numbers below are defined as offset
348 * against DRM_COMMAND_BASE and should be between [0x0, 0x60).
349 */
350#define DRM_I915_INIT 0x00
351#define DRM_I915_FLUSH 0x01
352#define DRM_I915_FLIP 0x02
353#define DRM_I915_BATCHBUFFER 0x03
354#define DRM_I915_IRQ_EMIT 0x04
355#define DRM_I915_IRQ_WAIT 0x05
356#define DRM_I915_GETPARAM 0x06
357#define DRM_I915_SETPARAM 0x07
358#define DRM_I915_ALLOC 0x08
359#define DRM_I915_FREE 0x09
360#define DRM_I915_INIT_HEAP 0x0a
361#define DRM_I915_CMDBUFFER 0x0b
362#define DRM_I915_DESTROY_HEAP 0x0c
363#define DRM_I915_SET_VBLANK_PIPE 0x0d
364#define DRM_I915_GET_VBLANK_PIPE 0x0e
365#define DRM_I915_VBLANK_SWAP 0x0f
366#define DRM_I915_HWS_ADDR 0x11
367#define DRM_I915_GEM_INIT 0x13
368#define DRM_I915_GEM_EXECBUFFER 0x14
369#define DRM_I915_GEM_PIN 0x15
370#define DRM_I915_GEM_UNPIN 0x16
371#define DRM_I915_GEM_BUSY 0x17
372#define DRM_I915_GEM_THROTTLE 0x18
373#define DRM_I915_GEM_ENTERVT 0x19
374#define DRM_I915_GEM_LEAVEVT 0x1a
375#define DRM_I915_GEM_CREATE 0x1b
376#define DRM_I915_GEM_PREAD 0x1c
377#define DRM_I915_GEM_PWRITE 0x1d
378#define DRM_I915_GEM_MMAP 0x1e
379#define DRM_I915_GEM_SET_DOMAIN 0x1f
380#define DRM_I915_GEM_SW_FINISH 0x20
381#define DRM_I915_GEM_SET_TILING 0x21
382#define DRM_I915_GEM_GET_TILING 0x22
383#define DRM_I915_GEM_GET_APERTURE 0x23
384#define DRM_I915_GEM_MMAP_GTT 0x24
385#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
386#define DRM_I915_GEM_MADVISE 0x26
387#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
388#define DRM_I915_OVERLAY_ATTRS 0x28
389#define DRM_I915_GEM_EXECBUFFER2 0x29
390#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
391#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
392#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
393#define DRM_I915_GEM_WAIT 0x2c
394#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
395#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
396#define DRM_I915_GEM_SET_CACHING 0x2f
397#define DRM_I915_GEM_GET_CACHING 0x30
398#define DRM_I915_REG_READ 0x31
399#define DRM_I915_GET_RESET_STATS 0x32
400#define DRM_I915_GEM_USERPTR 0x33
401#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
402#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
403#define DRM_I915_PERF_OPEN 0x36
404#define DRM_I915_PERF_ADD_CONFIG 0x37
405#define DRM_I915_PERF_REMOVE_CONFIG 0x38
406#define DRM_I915_QUERY 0x39
407#define DRM_I915_GEM_VM_CREATE 0x3a
408#define DRM_I915_GEM_VM_DESTROY 0x3b
409#define DRM_I915_GEM_CREATE_EXT 0x3c
410/* Must be kept compact -- no holes */
411
412#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
413#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
414#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
415#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
416#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
417#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
418#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
419#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
420#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
421#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
422#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
423#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
424#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
425#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
426#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
427#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
428#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
429#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
430#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
431#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
432#define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
433#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
434#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
435#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
436#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
437#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
438#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
439#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
440#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
441#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
442#define DRM_IOCTL_I915_GEM_CREATE_EXT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE_EXT, struct drm_i915_gem_create_ext)
443#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
444#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
445#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
446#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
447#define DRM_IOCTL_I915_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_offset)
448#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
449#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
450#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
451#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
452#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
453#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
454#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
455#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
456#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
457#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
458#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
459#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
460#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
461#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create_ext)
462#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
463#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
464#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
465#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
466#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
467#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
468#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
469#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
470#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
471#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
472#define DRM_IOCTL_I915_GEM_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_VM_CREATE, struct drm_i915_gem_vm_control)
473#define DRM_IOCTL_I915_GEM_VM_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_VM_DESTROY, struct drm_i915_gem_vm_control)
474
475/* Allow drivers to submit batchbuffers directly to hardware, relying
476 * on the security mechanisms provided by hardware.
477 */
478typedef struct drm_i915_batchbuffer {
479 int start; /* agp offset */
480 int used; /* nr bytes in use */
481 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
482 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
483 int num_cliprects; /* mulitpass with multiple cliprects? */
484 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
485} drm_i915_batchbuffer_t;
486
487/* As above, but pass a pointer to userspace buffer which can be
488 * validated by the kernel prior to sending to hardware.
489 */
490typedef struct _drm_i915_cmdbuffer {
491 char *buf; /* pointer to userspace command buffer */
492 int sz; /* nr bytes in buf */
493 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
494 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
495 int num_cliprects; /* mulitpass with multiple cliprects? */
496 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
497} drm_i915_cmdbuffer_t;
498
499/* Userspace can request & wait on irq's:
500 */
501typedef struct drm_i915_irq_emit {
502 int *irq_seq;
503} drm_i915_irq_emit_t;
504
505typedef struct drm_i915_irq_wait {
506 int irq_seq;
507} drm_i915_irq_wait_t;
508
509/*
510 * Different modes of per-process Graphics Translation Table,
511 * see I915_PARAM_HAS_ALIASING_PPGTT
512 */
513#define I915_GEM_PPGTT_NONE 0
514#define I915_GEM_PPGTT_ALIASING 1
515#define I915_GEM_PPGTT_FULL 2
516
517/* Ioctl to query kernel params:
518 */
519#define I915_PARAM_IRQ_ACTIVE 1
520#define I915_PARAM_ALLOW_BATCHBUFFER 2
521#define I915_PARAM_LAST_DISPATCH 3
522#define I915_PARAM_CHIPSET_ID 4
523#define I915_PARAM_HAS_GEM 5
524#define I915_PARAM_NUM_FENCES_AVAIL 6
525#define I915_PARAM_HAS_OVERLAY 7
526#define I915_PARAM_HAS_PAGEFLIPPING 8
527#define I915_PARAM_HAS_EXECBUF2 9
528#define I915_PARAM_HAS_BSD 10
529#define I915_PARAM_HAS_BLT 11
530#define I915_PARAM_HAS_RELAXED_FENCING 12
531#define I915_PARAM_HAS_COHERENT_RINGS 13
532#define I915_PARAM_HAS_EXEC_CONSTANTS 14
533#define I915_PARAM_HAS_RELAXED_DELTA 15
534#define I915_PARAM_HAS_GEN7_SOL_RESET 16
535#define I915_PARAM_HAS_LLC 17
536#define I915_PARAM_HAS_ALIASING_PPGTT 18
537#define I915_PARAM_HAS_WAIT_TIMEOUT 19
538#define I915_PARAM_HAS_SEMAPHORES 20
539#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
540#define I915_PARAM_HAS_VEBOX 22
541#define I915_PARAM_HAS_SECURE_BATCHES 23
542#define I915_PARAM_HAS_PINNED_BATCHES 24
543#define I915_PARAM_HAS_EXEC_NO_RELOC 25
544#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
545#define I915_PARAM_HAS_WT 27
546#define I915_PARAM_CMD_PARSER_VERSION 28
547#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
548#define I915_PARAM_MMAP_VERSION 30
549#define I915_PARAM_HAS_BSD2 31
550#define I915_PARAM_REVISION 32
551#define I915_PARAM_SUBSLICE_TOTAL 33
552#define I915_PARAM_EU_TOTAL 34
553#define I915_PARAM_HAS_GPU_RESET 35
554#define I915_PARAM_HAS_RESOURCE_STREAMER 36
555#define I915_PARAM_HAS_EXEC_SOFTPIN 37
556#define I915_PARAM_HAS_POOLED_EU 38
557#define I915_PARAM_MIN_EU_IN_POOL 39
558#define I915_PARAM_MMAP_GTT_VERSION 40
559
560/*
561 * Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution
562 * priorities and the driver will attempt to execute batches in priority order.
563 * The param returns a capability bitmask, nonzero implies that the scheduler
564 * is enabled, with different features present according to the mask.
565 *
566 * The initial priority for each batch is supplied by the context and is
567 * controlled via I915_CONTEXT_PARAM_PRIORITY.
568 */
569#define I915_PARAM_HAS_SCHEDULER 41
570#define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
571#define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
572#define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
573#define I915_SCHEDULER_CAP_SEMAPHORES (1ul << 3)
574#define I915_SCHEDULER_CAP_ENGINE_BUSY_STATS (1ul << 4)
575/*
576 * Indicates the 2k user priority levels are statically mapped into 3 buckets as
577 * follows:
578 *
579 * -1k to -1 Low priority
580 * 0 Normal priority
581 * 1 to 1k Highest priority
582 */
583#define I915_SCHEDULER_CAP_STATIC_PRIORITY_MAP (1ul << 5)
584
585#define I915_PARAM_HUC_STATUS 42
586
587/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of
588 * synchronisation with implicit fencing on individual objects.
589 * See EXEC_OBJECT_ASYNC.
590 */
591#define I915_PARAM_HAS_EXEC_ASYNC 43
592
593/* Query whether DRM_I915_GEM_EXECBUFFER2 supports explicit fence support -
594 * both being able to pass in a sync_file fd to wait upon before executing,
595 * and being able to return a new sync_file fd that is signaled when the
596 * current request is complete. See I915_EXEC_FENCE_IN and I915_EXEC_FENCE_OUT.
597 */
598#define I915_PARAM_HAS_EXEC_FENCE 44
599
600/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
601 * user specified bufffers for post-mortem debugging of GPU hangs. See
602 * EXEC_OBJECT_CAPTURE.
603 */
604#define I915_PARAM_HAS_EXEC_CAPTURE 45
605
606#define I915_PARAM_SLICE_MASK 46
607
608/* Assuming it's uniform for each slice, this queries the mask of subslices
609 * per-slice for this system.
610 */
611#define I915_PARAM_SUBSLICE_MASK 47
612
613/*
614 * Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying the batch buffer
615 * as the first execobject as opposed to the last. See I915_EXEC_BATCH_FIRST.
616 */
617#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
618
619/* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of
620 * drm_i915_gem_exec_fence structures. See I915_EXEC_FENCE_ARRAY.
621 */
622#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
623
624/*
625 * Query whether every context (both per-file default and user created) is
626 * isolated (insofar as HW supports). If this parameter is not true, then
627 * freshly created contexts may inherit values from an existing context,
628 * rather than default HW values. If true, it also ensures (insofar as HW
629 * supports) that all state set by this context will not leak to any other
630 * context.
631 *
632 * As not every engine across every gen support contexts, the returned
633 * value reports the support of context isolation for individual engines by
634 * returning a bitmask of each engine class set to true if that class supports
635 * isolation.
636 */
637#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
638
639/* Frequency of the command streamer timestamps given by the *_TIMESTAMP
640 * registers. This used to be fixed per platform but from CNL onwards, this
641 * might vary depending on the parts.
642 */
643#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
644
645/*
646 * Once upon a time we supposed that writes through the GGTT would be
647 * immediately in physical memory (once flushed out of the CPU path). However,
648 * on a few different processors and chipsets, this is not necessarily the case
649 * as the writes appear to be buffered internally. Thus a read of the backing
650 * storage (physical memory) via a different path (with different physical tags
651 * to the indirect write via the GGTT) will see stale values from before
652 * the GGTT write. Inside the kernel, we can for the most part keep track of
653 * the different read/write domains in use (e.g. set-domain), but the assumption
654 * of coherency is baked into the ABI, hence reporting its true state in this
655 * parameter.
656 *
657 * Reports true when writes via mmap_gtt are immediately visible following an
658 * lfence to flush the WCB.
659 *
660 * Reports false when writes via mmap_gtt are indeterminately delayed in an in
661 * internal buffer and are _not_ immediately visible to third parties accessing
662 * directly via mmap_cpu/mmap_wc. Use of mmap_gtt as part of an IPC
663 * communications channel when reporting false is strongly disadvised.
664 */
665#define I915_PARAM_MMAP_GTT_COHERENT 52
666
667/*
668 * Query whether DRM_I915_GEM_EXECBUFFER2 supports coordination of parallel
669 * execution through use of explicit fence support.
670 * See I915_EXEC_FENCE_OUT and I915_EXEC_FENCE_SUBMIT.
671 */
672#define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
673
674/*
675 * Revision of the i915-perf uAPI. The value returned helps determine what
676 * i915-perf features are available. See drm_i915_perf_property_id.
677 */
678#define I915_PARAM_PERF_REVISION 54
679
680/* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of
681 * timeline syncobj through drm_i915_gem_execbuffer_ext_timeline_fences. See
682 * I915_EXEC_USE_EXTENSIONS.
683 */
684#define I915_PARAM_HAS_EXEC_TIMELINE_FENCES 55
685
686/* Query if the kernel supports the I915_USERPTR_PROBE flag. */
687#define I915_PARAM_HAS_USERPTR_PROBE 56
688
689/* Must be kept compact -- no holes and well documented */
690
691typedef struct drm_i915_getparam {
692 __s32 param;
693 /*
694 * WARNING: Using pointers instead of fixed-size u64 means we need to write
695 * compat32 code. Don't repeat this mistake.
696 */
697 int *value;
698} drm_i915_getparam_t;
699
700/* Ioctl to set kernel params:
701 */
702#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
703#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
704#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
705#define I915_SETPARAM_NUM_USED_FENCES 4
706/* Must be kept compact -- no holes */
707
708typedef struct drm_i915_setparam {
709 int param;
710 int value;
711} drm_i915_setparam_t;
712
713/* A memory manager for regions of shared memory:
714 */
715#define I915_MEM_REGION_AGP 1
716
717typedef struct drm_i915_mem_alloc {
718 int region;
719 int alignment;
720 int size;
721 int *region_offset; /* offset from start of fb or agp */
722} drm_i915_mem_alloc_t;
723
724typedef struct drm_i915_mem_free {
725 int region;
726 int region_offset;
727} drm_i915_mem_free_t;
728
729typedef struct drm_i915_mem_init_heap {
730 int region;
731 int size;
732 int start;
733} drm_i915_mem_init_heap_t;
734
735/* Allow memory manager to be torn down and re-initialized (eg on
736 * rotate):
737 */
738typedef struct drm_i915_mem_destroy_heap {
739 int region;
740} drm_i915_mem_destroy_heap_t;
741
742/* Allow X server to configure which pipes to monitor for vblank signals
743 */
744#define DRM_I915_VBLANK_PIPE_A 1
745#define DRM_I915_VBLANK_PIPE_B 2
746
747typedef struct drm_i915_vblank_pipe {
748 int pipe;
749} drm_i915_vblank_pipe_t;
750
751/* Schedule buffer swap at given vertical blank:
752 */
753typedef struct drm_i915_vblank_swap {
754 drm_drawable_t drawable;
755 enum drm_vblank_seq_type seqtype;
756 unsigned int sequence;
757} drm_i915_vblank_swap_t;
758
759typedef struct drm_i915_hws_addr {
760 __u64 addr;
761} drm_i915_hws_addr_t;
762
763struct drm_i915_gem_init {
764 /**
765 * Beginning offset in the GTT to be managed by the DRM memory
766 * manager.
767 */
768 __u64 gtt_start;
769 /**
770 * Ending offset in the GTT to be managed by the DRM memory
771 * manager.
772 */
773 __u64 gtt_end;
774};
775
776struct drm_i915_gem_create {
777 /**
778 * Requested size for the object.
779 *
780 * The (page-aligned) allocated size for the object will be returned.
781 */
782 __u64 size;
783 /**
784 * Returned handle for the object.
785 *
786 * Object handles are nonzero.
787 */
788 __u32 handle;
789 __u32 pad;
790};
791
792struct drm_i915_gem_pread {
793 /** Handle for the object being read. */
794 __u32 handle;
795 __u32 pad;
796 /** Offset into the object to read from */
797 __u64 offset;
798 /** Length of data to read */
799 __u64 size;
800 /**
801 * Pointer to write the data into.
802 *
803 * This is a fixed-size type for 32/64 compatibility.
804 */
805 __u64 data_ptr;
806};
807
808struct drm_i915_gem_pwrite {
809 /** Handle for the object being written to. */
810 __u32 handle;
811 __u32 pad;
812 /** Offset into the object to write to */
813 __u64 offset;
814 /** Length of data to write */
815 __u64 size;
816 /**
817 * Pointer to read the data from.
818 *
819 * This is a fixed-size type for 32/64 compatibility.
820 */
821 __u64 data_ptr;
822};
823
824struct drm_i915_gem_mmap {
825 /** Handle for the object being mapped. */
826 __u32 handle;
827 __u32 pad;
828 /** Offset in the object to map. */
829 __u64 offset;
830 /**
831 * Length of data to map.
832 *
833 * The value will be page-aligned.
834 */
835 __u64 size;
836 /**
837 * Returned pointer the data was mapped at.
838 *
839 * This is a fixed-size type for 32/64 compatibility.
840 */
841 __u64 addr_ptr;
842
843 /**
844 * Flags for extended behaviour.
845 *
846 * Added in version 2.
847 */
848 __u64 flags;
849#define I915_MMAP_WC 0x1
850};
851
852struct drm_i915_gem_mmap_gtt {
853 /** Handle for the object being mapped. */
854 __u32 handle;
855 __u32 pad;
856 /**
857 * Fake offset to use for subsequent mmap call
858 *
859 * This is a fixed-size type for 32/64 compatibility.
860 */
861 __u64 offset;
862};
863
864/**
865 * struct drm_i915_gem_mmap_offset - Retrieve an offset so we can mmap this buffer object.
866 *
867 * This struct is passed as argument to the `DRM_IOCTL_I915_GEM_MMAP_OFFSET` ioctl,
868 * and is used to retrieve the fake offset to mmap an object specified by &handle.
869 *
870 * The legacy way of using `DRM_IOCTL_I915_GEM_MMAP` is removed on gen12+.
871 * `DRM_IOCTL_I915_GEM_MMAP_GTT` is an older supported alias to this struct, but will behave
872 * as setting the &extensions to 0, and &flags to `I915_MMAP_OFFSET_GTT`.
873 */
874struct drm_i915_gem_mmap_offset {
875 /** @handle: Handle for the object being mapped. */
876 __u32 handle;
877 /** @pad: Must be zero */
878 __u32 pad;
879 /**
880 * @offset: The fake offset to use for subsequent mmap call
881 *
882 * This is a fixed-size type for 32/64 compatibility.
883 */
884 __u64 offset;
885
886 /**
887 * @flags: Flags for extended behaviour.
888 *
889 * It is mandatory that one of the `MMAP_OFFSET` types
890 * should be included:
891 *
892 * - `I915_MMAP_OFFSET_GTT`: Use mmap with the object bound to GTT. (Write-Combined)
893 * - `I915_MMAP_OFFSET_WC`: Use Write-Combined caching.
894 * - `I915_MMAP_OFFSET_WB`: Use Write-Back caching.
895 * - `I915_MMAP_OFFSET_FIXED`: Use object placement to determine caching.
896 *
897 * On devices with local memory `I915_MMAP_OFFSET_FIXED` is the only valid
898 * type. On devices without local memory, this caching mode is invalid.
899 *
900 * As caching mode when specifying `I915_MMAP_OFFSET_FIXED`, WC or WB will
901 * be used, depending on the object placement on creation. WB will be used
902 * when the object can only exist in system memory, WC otherwise.
903 */
904 __u64 flags;
905
906#define I915_MMAP_OFFSET_GTT 0
907#define I915_MMAP_OFFSET_WC 1
908#define I915_MMAP_OFFSET_WB 2
909#define I915_MMAP_OFFSET_UC 3
910#define I915_MMAP_OFFSET_FIXED 4
911
912 /**
913 * @extensions: Zero-terminated chain of extensions.
914 *
915 * No current extensions defined; mbz.
916 */
917 __u64 extensions;
918};
919
920/**
921 * struct drm_i915_gem_set_domain - Adjust the objects write or read domain, in
922 * preparation for accessing the pages via some CPU domain.
923 *
924 * Specifying a new write or read domain will flush the object out of the
925 * previous domain(if required), before then updating the objects domain
926 * tracking with the new domain.
927 *
928 * Note this might involve waiting for the object first if it is still active on
929 * the GPU.
930 *
931 * Supported values for @read_domains and @write_domain:
932 *
933 * - I915_GEM_DOMAIN_WC: Uncached write-combined domain
934 * - I915_GEM_DOMAIN_CPU: CPU cache domain
935 * - I915_GEM_DOMAIN_GTT: Mappable aperture domain
936 *
937 * All other domains are rejected.
938 *
939 * Note that for discrete, starting from DG1, this is no longer supported, and
940 * is instead rejected. On such platforms the CPU domain is effectively static,
941 * where we also only support a single &drm_i915_gem_mmap_offset cache mode,
942 * which can't be set explicitly and instead depends on the object placements,
943 * as per the below.
944 *
945 * Implicit caching rules, starting from DG1:
946 *
947 * - If any of the object placements (see &drm_i915_gem_create_ext_memory_regions)
948 * contain I915_MEMORY_CLASS_DEVICE then the object will be allocated and
949 * mapped as write-combined only.
950 *
951 * - Everything else is always allocated and mapped as write-back, with the
952 * guarantee that everything is also coherent with the GPU.
953 *
954 * Note that this is likely to change in the future again, where we might need
955 * more flexibility on future devices, so making this all explicit as part of a
956 * new &drm_i915_gem_create_ext extension is probable.
957 */
958struct drm_i915_gem_set_domain {
959 /** @handle: Handle for the object. */
960 __u32 handle;
961
962 /** @read_domains: New read domains. */
963 __u32 read_domains;
964
965 /**
966 * @write_domain: New write domain.
967 *
968 * Note that having something in the write domain implies it's in the
969 * read domain, and only that read domain.
970 */
971 __u32 write_domain;
972};
973
974struct drm_i915_gem_sw_finish {
975 /** Handle for the object */
976 __u32 handle;
977};
978
979struct drm_i915_gem_relocation_entry {
980 /**
981 * Handle of the buffer being pointed to by this relocation entry.
982 *
983 * It's appealing to make this be an index into the mm_validate_entry
984 * list to refer to the buffer, but this allows the driver to create
985 * a relocation list for state buffers and not re-write it per
986 * exec using the buffer.
987 */
988 __u32 target_handle;
989
990 /**
991 * Value to be added to the offset of the target buffer to make up
992 * the relocation entry.
993 */
994 __u32 delta;
995
996 /** Offset in the buffer the relocation entry will be written into */
997 __u64 offset;
998
999 /**
1000 * Offset value of the target buffer that the relocation entry was last
1001 * written as.
1002 *
1003 * If the buffer has the same offset as last time, we can skip syncing
1004 * and writing the relocation. This value is written back out by
1005 * the execbuffer ioctl when the relocation is written.
1006 */
1007 __u64 presumed_offset;
1008
1009 /**
1010 * Target memory domains read by this operation.
1011 */
1012 __u32 read_domains;
1013
1014 /**
1015 * Target memory domains written by this operation.
1016 *
1017 * Note that only one domain may be written by the whole
1018 * execbuffer operation, so that where there are conflicts,
1019 * the application will get -EINVAL back.
1020 */
1021 __u32 write_domain;
1022};
1023
1024/** @{
1025 * Intel memory domains
1026 *
1027 * Most of these just align with the various caches in
1028 * the system and are used to flush and invalidate as
1029 * objects end up cached in different domains.
1030 */
1031/** CPU cache */
1032#define I915_GEM_DOMAIN_CPU 0x00000001
1033/** Render cache, used by 2D and 3D drawing */
1034#define I915_GEM_DOMAIN_RENDER 0x00000002
1035/** Sampler cache, used by texture engine */
1036#define I915_GEM_DOMAIN_SAMPLER 0x00000004
1037/** Command queue, used to load batch buffers */
1038#define I915_GEM_DOMAIN_COMMAND 0x00000008
1039/** Instruction cache, used by shader programs */
1040#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
1041/** Vertex address cache */
1042#define I915_GEM_DOMAIN_VERTEX 0x00000020
1043/** GTT domain - aperture and scanout */
1044#define I915_GEM_DOMAIN_GTT 0x00000040
1045/** WC domain - uncached access */
1046#define I915_GEM_DOMAIN_WC 0x00000080
1047/** @} */
1048
1049struct drm_i915_gem_exec_object {
1050 /**
1051 * User's handle for a buffer to be bound into the GTT for this
1052 * operation.
1053 */
1054 __u32 handle;
1055
1056 /** Number of relocations to be performed on this buffer */
1057 __u32 relocation_count;
1058 /**
1059 * Pointer to array of struct drm_i915_gem_relocation_entry containing
1060 * the relocations to be performed in this buffer.
1061 */
1062 __u64 relocs_ptr;
1063
1064 /** Required alignment in graphics aperture */
1065 __u64 alignment;
1066
1067 /**
1068 * Returned value of the updated offset of the object, for future
1069 * presumed_offset writes.
1070 */
1071 __u64 offset;
1072};
1073
1074/* DRM_IOCTL_I915_GEM_EXECBUFFER was removed in Linux 5.13 */
1075struct drm_i915_gem_execbuffer {
1076 /**
1077 * List of buffers to be validated with their relocations to be
1078 * performend on them.
1079 *
1080 * This is a pointer to an array of struct drm_i915_gem_validate_entry.
1081 *
1082 * These buffers must be listed in an order such that all relocations
1083 * a buffer is performing refer to buffers that have already appeared
1084 * in the validate list.
1085 */
1086 __u64 buffers_ptr;
1087 __u32 buffer_count;
1088
1089 /** Offset in the batchbuffer to start execution from. */
1090 __u32 batch_start_offset;
1091 /** Bytes used in batchbuffer from batch_start_offset */
1092 __u32 batch_len;
1093 __u32 DR1;
1094 __u32 DR4;
1095 __u32 num_cliprects;
1096 /** This is a struct drm_clip_rect *cliprects */
1097 __u64 cliprects_ptr;
1098};
1099
1100struct drm_i915_gem_exec_object2 {
1101 /**
1102 * User's handle for a buffer to be bound into the GTT for this
1103 * operation.
1104 */
1105 __u32 handle;
1106
1107 /** Number of relocations to be performed on this buffer */
1108 __u32 relocation_count;
1109 /**
1110 * Pointer to array of struct drm_i915_gem_relocation_entry containing
1111 * the relocations to be performed in this buffer.
1112 */
1113 __u64 relocs_ptr;
1114
1115 /** Required alignment in graphics aperture */
1116 __u64 alignment;
1117
1118 /**
1119 * When the EXEC_OBJECT_PINNED flag is specified this is populated by
1120 * the user with the GTT offset at which this object will be pinned.
1121 * When the I915_EXEC_NO_RELOC flag is specified this must contain the
1122 * presumed_offset of the object.
1123 * During execbuffer2 the kernel populates it with the value of the
1124 * current GTT offset of the object, for future presumed_offset writes.
1125 */
1126 __u64 offset;
1127
1128#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
1129#define EXEC_OBJECT_NEEDS_GTT (1<<1)
1130#define EXEC_OBJECT_WRITE (1<<2)
1131#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
1132#define EXEC_OBJECT_PINNED (1<<4)
1133#define EXEC_OBJECT_PAD_TO_SIZE (1<<5)
1134/* The kernel implicitly tracks GPU activity on all GEM objects, and
1135 * synchronises operations with outstanding rendering. This includes
1136 * rendering on other devices if exported via dma-buf. However, sometimes
1137 * this tracking is too coarse and the user knows better. For example,
1138 * if the object is split into non-overlapping ranges shared between different
1139 * clients or engines (i.e. suballocating objects), the implicit tracking
1140 * by kernel assumes that each operation affects the whole object rather
1141 * than an individual range, causing needless synchronisation between clients.
1142 * The kernel will also forgo any CPU cache flushes prior to rendering from
1143 * the object as the client is expected to be also handling such domain
1144 * tracking.
1145 *
1146 * The kernel maintains the implicit tracking in order to manage resources
1147 * used by the GPU - this flag only disables the synchronisation prior to
1148 * rendering with this object in this execbuf.
1149 *
1150 * Opting out of implicit synhronisation requires the user to do its own
1151 * explicit tracking to avoid rendering corruption. See, for example,
1152 * I915_PARAM_HAS_EXEC_FENCE to order execbufs and execute them asynchronously.
1153 */
1154#define EXEC_OBJECT_ASYNC (1<<6)
1155/* Request that the contents of this execobject be copied into the error
1156 * state upon a GPU hang involving this batch for post-mortem debugging.
1157 * These buffers are recorded in no particular order as "user" in
1158 * /sys/class/drm/cardN/error. Query I915_PARAM_HAS_EXEC_CAPTURE to see
1159 * if the kernel supports this flag.
1160 */
1161#define EXEC_OBJECT_CAPTURE (1<<7)
1162/* All remaining bits are MBZ and RESERVED FOR FUTURE USE */
1163#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_CAPTURE<<1)
1164 __u64 flags;
1165
1166 union {
1167 __u64 rsvd1;
1168 __u64 pad_to_size;
1169 };
1170 __u64 rsvd2;
1171};
1172
1173struct drm_i915_gem_exec_fence {
1174 /**
1175 * User's handle for a drm_syncobj to wait on or signal.
1176 */
1177 __u32 handle;
1178
1179#define I915_EXEC_FENCE_WAIT (1<<0)
1180#define I915_EXEC_FENCE_SIGNAL (1<<1)
1181#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
1182 __u32 flags;
1183};
1184
1185/*
1186 * See drm_i915_gem_execbuffer_ext_timeline_fences.
1187 */
1188#define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
1189
1190/*
1191 * This structure describes an array of drm_syncobj and associated points for
1192 * timeline variants of drm_syncobj. It is invalid to append this structure to
1193 * the execbuf if I915_EXEC_FENCE_ARRAY is set.
1194 */
1195struct drm_i915_gem_execbuffer_ext_timeline_fences {
1196 struct i915_user_extension base;
1197
1198 /**
1199 * Number of element in the handles_ptr & value_ptr arrays.
1200 */
1201 __u64 fence_count;
1202
1203 /**
1204 * Pointer to an array of struct drm_i915_gem_exec_fence of length
1205 * fence_count.
1206 */
1207 __u64 handles_ptr;
1208
1209 /**
1210 * Pointer to an array of u64 values of length fence_count. Values
1211 * must be 0 for a binary drm_syncobj. A Value of 0 for a timeline
1212 * drm_syncobj is invalid as it turns a drm_syncobj into a binary one.
1213 */
1214 __u64 values_ptr;
1215};
1216
1217struct drm_i915_gem_execbuffer2 {
1218 /**
1219 * List of gem_exec_object2 structs
1220 */
1221 __u64 buffers_ptr;
1222 __u32 buffer_count;
1223
1224 /** Offset in the batchbuffer to start execution from. */
1225 __u32 batch_start_offset;
1226 /** Bytes used in batchbuffer from batch_start_offset */
1227 __u32 batch_len;
1228 __u32 DR1;
1229 __u32 DR4;
1230 __u32 num_cliprects;
1231 /**
1232 * This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY
1233 * & I915_EXEC_USE_EXTENSIONS are not set.
1234 *
1235 * If I915_EXEC_FENCE_ARRAY is set, then this is a pointer to an array
1236 * of struct drm_i915_gem_exec_fence and num_cliprects is the length
1237 * of the array.
1238 *
1239 * If I915_EXEC_USE_EXTENSIONS is set, then this is a pointer to a
1240 * single struct i915_user_extension and num_cliprects is 0.
1241 */
1242 __u64 cliprects_ptr;
1243#define I915_EXEC_RING_MASK (0x3f)
1244#define I915_EXEC_DEFAULT (0<<0)
1245#define I915_EXEC_RENDER (1<<0)
1246#define I915_EXEC_BSD (2<<0)
1247#define I915_EXEC_BLT (3<<0)
1248#define I915_EXEC_VEBOX (4<<0)
1249
1250/* Used for switching the constants addressing mode on gen4+ RENDER ring.
1251 * Gen6+ only supports relative addressing to dynamic state (default) and
1252 * absolute addressing.
1253 *
1254 * These flags are ignored for the BSD and BLT rings.
1255 */
1256#define I915_EXEC_CONSTANTS_MASK (3<<6)
1257#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
1258#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
1259#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
1260 __u64 flags;
1261 __u64 rsvd1; /* now used for context info */
1262 __u64 rsvd2;
1263};
1264
1265/** Resets the SO write offset registers for transform feedback on gen7. */
1266#define I915_EXEC_GEN7_SOL_RESET (1<<8)
1267
1268/** Request a privileged ("secure") batch buffer. Note only available for
1269 * DRM_ROOT_ONLY | DRM_MASTER processes.
1270 */
1271#define I915_EXEC_SECURE (1<<9)
1272
1273/** Inform the kernel that the batch is and will always be pinned. This
1274 * negates the requirement for a workaround to be performed to avoid
1275 * an incoherent CS (such as can be found on 830/845). If this flag is
1276 * not passed, the kernel will endeavour to make sure the batch is
1277 * coherent with the CS before execution. If this flag is passed,
1278 * userspace assumes the responsibility for ensuring the same.
1279 */
1280#define I915_EXEC_IS_PINNED (1<<10)
1281
1282/** Provide a hint to the kernel that the command stream and auxiliary
1283 * state buffers already holds the correct presumed addresses and so the
1284 * relocation process may be skipped if no buffers need to be moved in
1285 * preparation for the execbuffer.
1286 */
1287#define I915_EXEC_NO_RELOC (1<<11)
1288
1289/** Use the reloc.handle as an index into the exec object array rather
1290 * than as the per-file handle.
1291 */
1292#define I915_EXEC_HANDLE_LUT (1<<12)
1293
1294/** Used for switching BSD rings on the platforms with two BSD rings */
1295#define I915_EXEC_BSD_SHIFT (13)
1296#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
1297/* default ping-pong mode */
1298#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
1299#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
1300#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
1301
1302/** Tell the kernel that the batchbuffer is processed by
1303 * the resource streamer.
1304 */
1305#define I915_EXEC_RESOURCE_STREAMER (1<<15)
1306
1307/* Setting I915_EXEC_FENCE_IN implies that lower_32_bits(rsvd2) represent
1308 * a sync_file fd to wait upon (in a nonblocking manner) prior to executing
1309 * the batch.
1310 *
1311 * Returns -EINVAL if the sync_file fd cannot be found.
1312 */
1313#define I915_EXEC_FENCE_IN (1<<16)
1314
1315/* Setting I915_EXEC_FENCE_OUT causes the ioctl to return a sync_file fd
1316 * in the upper_32_bits(rsvd2) upon success. Ownership of the fd is given
1317 * to the caller, and it should be close() after use. (The fd is a regular
1318 * file descriptor and will be cleaned up on process termination. It holds
1319 * a reference to the request, but nothing else.)
1320 *
1321 * The sync_file fd can be combined with other sync_file and passed either
1322 * to execbuf using I915_EXEC_FENCE_IN, to atomic KMS ioctls (so that a flip
1323 * will only occur after this request completes), or to other devices.
1324 *
1325 * Using I915_EXEC_FENCE_OUT requires use of
1326 * DRM_IOCTL_I915_GEM_EXECBUFFER2_WR ioctl so that the result is written
1327 * back to userspace. Failure to do so will cause the out-fence to always
1328 * be reported as zero, and the real fence fd to be leaked.
1329 */
1330#define I915_EXEC_FENCE_OUT (1<<17)
1331
1332/*
1333 * Traditionally the execbuf ioctl has only considered the final element in
1334 * the execobject[] to be the executable batch. Often though, the client
1335 * will known the batch object prior to construction and being able to place
1336 * it into the execobject[] array first can simplify the relocation tracking.
1337 * Setting I915_EXEC_BATCH_FIRST tells execbuf to use element 0 of the
1338 * execobject[] as the * batch instead (the default is to use the last
1339 * element).
1340 */
1341#define I915_EXEC_BATCH_FIRST (1<<18)
1342
1343/* Setting I915_FENCE_ARRAY implies that num_cliprects and cliprects_ptr
1344 * define an array of i915_gem_exec_fence structures which specify a set of
1345 * dma fences to wait upon or signal.
1346 */
1347#define I915_EXEC_FENCE_ARRAY (1<<19)
1348
1349/*
1350 * Setting I915_EXEC_FENCE_SUBMIT implies that lower_32_bits(rsvd2) represent
1351 * a sync_file fd to wait upon (in a nonblocking manner) prior to executing
1352 * the batch.
1353 *
1354 * Returns -EINVAL if the sync_file fd cannot be found.
1355 */
1356#define I915_EXEC_FENCE_SUBMIT (1 << 20)
1357
1358/*
1359 * Setting I915_EXEC_USE_EXTENSIONS implies that
1360 * drm_i915_gem_execbuffer2.cliprects_ptr is treated as a pointer to an linked
1361 * list of i915_user_extension. Each i915_user_extension node is the base of a
1362 * larger structure. The list of supported structures are listed in the
1363 * drm_i915_gem_execbuffer_ext enum.
1364 */
1365#define I915_EXEC_USE_EXTENSIONS (1 << 21)
1366
1367#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_USE_EXTENSIONS << 1))
1368
1369#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1370#define i915_execbuffer2_set_context_id(eb2, context) \
1371 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
1372#define i915_execbuffer2_get_context_id(eb2) \
1373 ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
1374
1375struct drm_i915_gem_pin {
1376 /** Handle of the buffer to be pinned. */
1377 __u32 handle;
1378 __u32 pad;
1379
1380 /** alignment required within the aperture */
1381 __u64 alignment;
1382
1383 /** Returned GTT offset of the buffer. */
1384 __u64 offset;
1385};
1386
1387struct drm_i915_gem_unpin {
1388 /** Handle of the buffer to be unpinned. */
1389 __u32 handle;
1390 __u32 pad;
1391};
1392
1393struct drm_i915_gem_busy {
1394 /** Handle of the buffer to check for busy */
1395 __u32 handle;
1396
1397 /** Return busy status
1398 *
1399 * A return of 0 implies that the object is idle (after
1400 * having flushed any pending activity), and a non-zero return that
1401 * the object is still in-flight on the GPU. (The GPU has not yet
1402 * signaled completion for all pending requests that reference the
1403 * object.) An object is guaranteed to become idle eventually (so
1404 * long as no new GPU commands are executed upon it). Due to the
1405 * asynchronous nature of the hardware, an object reported
1406 * as busy may become idle before the ioctl is completed.
1407 *
1408 * Furthermore, if the object is busy, which engine is busy is only
1409 * provided as a guide and only indirectly by reporting its class
1410 * (there may be more than one engine in each class). There are race
1411 * conditions which prevent the report of which engines are busy from
1412 * being always accurate. However, the converse is not true. If the
1413 * object is idle, the result of the ioctl, that all engines are idle,
1414 * is accurate.
1415 *
1416 * The returned dword is split into two fields to indicate both
1417 * the engine classess on which the object is being read, and the
1418 * engine class on which it is currently being written (if any).
1419 *
1420 * The low word (bits 0:15) indicate if the object is being written
1421 * to by any engine (there can only be one, as the GEM implicit
1422 * synchronisation rules force writes to be serialised). Only the
1423 * engine class (offset by 1, I915_ENGINE_CLASS_RENDER is reported as
1424 * 1 not 0 etc) for the last write is reported.
1425 *
1426 * The high word (bits 16:31) are a bitmask of which engines classes
1427 * are currently reading from the object. Multiple engines may be
1428 * reading from the object simultaneously.
1429 *
1430 * The value of each engine class is the same as specified in the
1431 * I915_CONTEXT_PARAM_ENGINES context parameter and via perf, i.e.
1432 * I915_ENGINE_CLASS_RENDER, I915_ENGINE_CLASS_COPY, etc.
1433 * Some hardware may have parallel execution engines, e.g. multiple
1434 * media engines, which are mapped to the same class identifier and so
1435 * are not separately reported for busyness.
1436 *
1437 * Caveat emptor:
1438 * Only the boolean result of this query is reliable; that is whether
1439 * the object is idle or busy. The report of which engines are busy
1440 * should be only used as a heuristic.
1441 */
1442 __u32 busy;
1443};
1444
1445/**
1446 * struct drm_i915_gem_caching - Set or get the caching for given object
1447 * handle.
1448 *
1449 * Allow userspace to control the GTT caching bits for a given object when the
1450 * object is later mapped through the ppGTT(or GGTT on older platforms lacking
1451 * ppGTT support, or if the object is used for scanout). Note that this might
1452 * require unbinding the object from the GTT first, if its current caching value
1453 * doesn't match.
1454 *
1455 * Note that this all changes on discrete platforms, starting from DG1, the
1456 * set/get caching is no longer supported, and is now rejected. Instead the CPU
1457 * caching attributes(WB vs WC) will become an immutable creation time property
1458 * for the object, along with the GTT caching level. For now we don't expose any
1459 * new uAPI for this, instead on DG1 this is all implicit, although this largely
1460 * shouldn't matter since DG1 is coherent by default(without any way of
1461 * controlling it).
1462 *
1463 * Implicit caching rules, starting from DG1:
1464 *
1465 * - If any of the object placements (see &drm_i915_gem_create_ext_memory_regions)
1466 * contain I915_MEMORY_CLASS_DEVICE then the object will be allocated and
1467 * mapped as write-combined only.
1468 *
1469 * - Everything else is always allocated and mapped as write-back, with the
1470 * guarantee that everything is also coherent with the GPU.
1471 *
1472 * Note that this is likely to change in the future again, where we might need
1473 * more flexibility on future devices, so making this all explicit as part of a
1474 * new &drm_i915_gem_create_ext extension is probable.
1475 *
1476 * Side note: Part of the reason for this is that changing the at-allocation-time CPU
1477 * caching attributes for the pages might be required(and is expensive) if we
1478 * need to then CPU map the pages later with different caching attributes. This
1479 * inconsistent caching behaviour, while supported on x86, is not universally
1480 * supported on other architectures. So for simplicity we opt for setting
1481 * everything at creation time, whilst also making it immutable, on discrete
1482 * platforms.
1483 */
1484struct drm_i915_gem_caching {
1485 /**
1486 * @handle: Handle of the buffer to set/get the caching level.
1487 */
1488 __u32 handle;
1489
1490 /**
1491 * @caching: The GTT caching level to apply or possible return value.
1492 *
1493 * The supported @caching values:
1494 *
1495 * I915_CACHING_NONE:
1496 *
1497 * GPU access is not coherent with CPU caches. Default for machines
1498 * without an LLC. This means manual flushing might be needed, if we
1499 * want GPU access to be coherent.
1500 *
1501 * I915_CACHING_CACHED:
1502 *
1503 * GPU access is coherent with CPU caches and furthermore the data is
1504 * cached in last-level caches shared between CPU cores and the GPU GT.
1505 *
1506 * I915_CACHING_DISPLAY:
1507 *
1508 * Special GPU caching mode which is coherent with the scanout engines.
1509 * Transparently falls back to I915_CACHING_NONE on platforms where no
1510 * special cache mode (like write-through or gfdt flushing) is
1511 * available. The kernel automatically sets this mode when using a
1512 * buffer as a scanout target. Userspace can manually set this mode to
1513 * avoid a costly stall and clflush in the hotpath of drawing the first
1514 * frame.
1515 */
1516#define I915_CACHING_NONE 0
1517#define I915_CACHING_CACHED 1
1518#define I915_CACHING_DISPLAY 2
1519 __u32 caching;
1520};
1521
1522#define I915_TILING_NONE 0
1523#define I915_TILING_X 1
1524#define I915_TILING_Y 2
1525/*
1526 * Do not add new tiling types here. The I915_TILING_* values are for
1527 * de-tiling fence registers that no longer exist on modern platforms. Although
1528 * the hardware may support new types of tiling in general (e.g., Tile4), we
1529 * do not need to add them to the uapi that is specific to now-defunct ioctls.
1530 */
1531#define I915_TILING_LAST I915_TILING_Y
1532
1533#define I915_BIT_6_SWIZZLE_NONE 0
1534#define I915_BIT_6_SWIZZLE_9 1
1535#define I915_BIT_6_SWIZZLE_9_10 2
1536#define I915_BIT_6_SWIZZLE_9_11 3
1537#define I915_BIT_6_SWIZZLE_9_10_11 4
1538/* Not seen by userland */
1539#define I915_BIT_6_SWIZZLE_UNKNOWN 5
1540/* Seen by userland. */
1541#define I915_BIT_6_SWIZZLE_9_17 6
1542#define I915_BIT_6_SWIZZLE_9_10_17 7
1543
1544struct drm_i915_gem_set_tiling {
1545 /** Handle of the buffer to have its tiling state updated */
1546 __u32 handle;
1547
1548 /**
1549 * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1550 * I915_TILING_Y).
1551 *
1552 * This value is to be set on request, and will be updated by the
1553 * kernel on successful return with the actual chosen tiling layout.
1554 *
1555 * The tiling mode may be demoted to I915_TILING_NONE when the system
1556 * has bit 6 swizzling that can't be managed correctly by GEM.
1557 *
1558 * Buffer contents become undefined when changing tiling_mode.
1559 */
1560 __u32 tiling_mode;
1561
1562 /**
1563 * Stride in bytes for the object when in I915_TILING_X or
1564 * I915_TILING_Y.
1565 */
1566 __u32 stride;
1567
1568 /**
1569 * Returned address bit 6 swizzling required for CPU access through
1570 * mmap mapping.
1571 */
1572 __u32 swizzle_mode;
1573};
1574
1575struct drm_i915_gem_get_tiling {
1576 /** Handle of the buffer to get tiling state for. */
1577 __u32 handle;
1578
1579 /**
1580 * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1581 * I915_TILING_Y).
1582 */
1583 __u32 tiling_mode;
1584
1585 /**
1586 * Returned address bit 6 swizzling required for CPU access through
1587 * mmap mapping.
1588 */
1589 __u32 swizzle_mode;
1590
1591 /**
1592 * Returned address bit 6 swizzling required for CPU access through
1593 * mmap mapping whilst bound.
1594 */
1595 __u32 phys_swizzle_mode;
1596};
1597
1598struct drm_i915_gem_get_aperture {
1599 /** Total size of the aperture used by i915_gem_execbuffer, in bytes */
1600 __u64 aper_size;
1601
1602 /**
1603 * Available space in the aperture used by i915_gem_execbuffer, in
1604 * bytes
1605 */
1606 __u64 aper_available_size;
1607};
1608
1609struct drm_i915_get_pipe_from_crtc_id {
1610 /** ID of CRTC being requested **/
1611 __u32 crtc_id;
1612
1613 /** pipe of requested CRTC **/
1614 __u32 pipe;
1615};
1616
1617#define I915_MADV_WILLNEED 0
1618#define I915_MADV_DONTNEED 1
1619#define __I915_MADV_PURGED 2 /* internal state */
1620
1621struct drm_i915_gem_madvise {
1622 /** Handle of the buffer to change the backing store advice */
1623 __u32 handle;
1624
1625 /* Advice: either the buffer will be needed again in the near future,
1626 * or wont be and could be discarded under memory pressure.
1627 */
1628 __u32 madv;
1629
1630 /** Whether the backing store still exists. */
1631 __u32 retained;
1632};
1633
1634/* flags */
1635#define I915_OVERLAY_TYPE_MASK 0xff
1636#define I915_OVERLAY_YUV_PLANAR 0x01
1637#define I915_OVERLAY_YUV_PACKED 0x02
1638#define I915_OVERLAY_RGB 0x03
1639
1640#define I915_OVERLAY_DEPTH_MASK 0xff00
1641#define I915_OVERLAY_RGB24 0x1000
1642#define I915_OVERLAY_RGB16 0x2000
1643#define I915_OVERLAY_RGB15 0x3000
1644#define I915_OVERLAY_YUV422 0x0100
1645#define I915_OVERLAY_YUV411 0x0200
1646#define I915_OVERLAY_YUV420 0x0300
1647#define I915_OVERLAY_YUV410 0x0400
1648
1649#define I915_OVERLAY_SWAP_MASK 0xff0000
1650#define I915_OVERLAY_NO_SWAP 0x000000
1651#define I915_OVERLAY_UV_SWAP 0x010000
1652#define I915_OVERLAY_Y_SWAP 0x020000
1653#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
1654
1655#define I915_OVERLAY_FLAGS_MASK 0xff000000
1656#define I915_OVERLAY_ENABLE 0x01000000
1657
1658struct drm_intel_overlay_put_image {
1659 /* various flags and src format description */
1660 __u32 flags;
1661 /* source picture description */
1662 __u32 bo_handle;
1663 /* stride values and offsets are in bytes, buffer relative */
1664 __u16 stride_Y; /* stride for packed formats */
1665 __u16 stride_UV;
1666 __u32 offset_Y; /* offset for packet formats */
1667 __u32 offset_U;
1668 __u32 offset_V;
1669 /* in pixels */
1670 __u16 src_width;
1671 __u16 src_height;
1672 /* to compensate the scaling factors for partially covered surfaces */
1673 __u16 src_scan_width;
1674 __u16 src_scan_height;
1675 /* output crtc description */
1676 __u32 crtc_id;
1677 __u16 dst_x;
1678 __u16 dst_y;
1679 __u16 dst_width;
1680 __u16 dst_height;
1681};
1682
1683/* flags */
1684#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
1685#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
1686#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1<<2)
1687struct drm_intel_overlay_attrs {
1688 __u32 flags;
1689 __u32 color_key;
1690 __s32 brightness;
1691 __u32 contrast;
1692 __u32 saturation;
1693 __u32 gamma0;
1694 __u32 gamma1;
1695 __u32 gamma2;
1696 __u32 gamma3;
1697 __u32 gamma4;
1698 __u32 gamma5;
1699};
1700
1701/*
1702 * Intel sprite handling
1703 *
1704 * Color keying works with a min/mask/max tuple. Both source and destination
1705 * color keying is allowed.
1706 *
1707 * Source keying:
1708 * Sprite pixels within the min & max values, masked against the color channels
1709 * specified in the mask field, will be transparent. All other pixels will
1710 * be displayed on top of the primary plane. For RGB surfaces, only the min
1711 * and mask fields will be used; ranged compares are not allowed.
1712 *
1713 * Destination keying:
1714 * Primary plane pixels that match the min value, masked against the color
1715 * channels specified in the mask field, will be replaced by corresponding
1716 * pixels from the sprite plane.
1717 *
1718 * Note that source & destination keying are exclusive; only one can be
1719 * active on a given plane.
1720 */
1721
1722#define I915_SET_COLORKEY_NONE (1<<0) /* Deprecated. Instead set
1723 * flags==0 to disable colorkeying.
1724 */
1725#define I915_SET_COLORKEY_DESTINATION (1<<1)
1726#define I915_SET_COLORKEY_SOURCE (1<<2)
1727struct drm_intel_sprite_colorkey {
1728 __u32 plane_id;
1729 __u32 min_value;
1730 __u32 channel_mask;
1731 __u32 max_value;
1732 __u32 flags;
1733};
1734
1735struct drm_i915_gem_wait {
1736 /** Handle of BO we shall wait on */
1737 __u32 bo_handle;
1738 __u32 flags;
1739 /** Number of nanoseconds to wait, Returns time remaining. */
1740 __s64 timeout_ns;
1741};
1742
1743struct drm_i915_gem_context_create {
1744 __u32 ctx_id; /* output: id of new context*/
1745 __u32 pad;
1746};
1747
1748struct drm_i915_gem_context_create_ext {
1749 __u32 ctx_id; /* output: id of new context*/
1750 __u32 flags;
1751#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
1752#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
1753#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
1754 (-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
1755 __u64 extensions;
1756};
1757
1758struct drm_i915_gem_context_param {
1759 __u32 ctx_id;
1760 __u32 size;
1761 __u64 param;
1762#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
1763/* I915_CONTEXT_PARAM_NO_ZEROMAP has been removed. On the off chance
1764 * someone somewhere has attempted to use it, never re-use this context
1765 * param number.
1766 */
1767#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
1768#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
1769#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
1770#define I915_CONTEXT_PARAM_BANNABLE 0x5
1771#define I915_CONTEXT_PARAM_PRIORITY 0x6
1772#define I915_CONTEXT_MAX_USER_PRIORITY 1023 /* inclusive */
1773#define I915_CONTEXT_DEFAULT_PRIORITY 0
1774#define I915_CONTEXT_MIN_USER_PRIORITY -1023 /* inclusive */
1775 /*
1776 * When using the following param, value should be a pointer to
1777 * drm_i915_gem_context_param_sseu.
1778 */
1779#define I915_CONTEXT_PARAM_SSEU 0x7
1780
1781/*
1782 * Not all clients may want to attempt automatic recover of a context after
1783 * a hang (for example, some clients may only submit very small incremental
1784 * batches relying on known logical state of previous batches which will never
1785 * recover correctly and each attempt will hang), and so would prefer that
1786 * the context is forever banned instead.
1787 *
1788 * If set to false (0), after a reset, subsequent (and in flight) rendering
1789 * from this context is discarded, and the client will need to create a new
1790 * context to use instead.
1791 *
1792 * If set to true (1), the kernel will automatically attempt to recover the
1793 * context by skipping the hanging batch and executing the next batch starting
1794 * from the default context state (discarding the incomplete logical context
1795 * state lost due to the reset).
1796 *
1797 * On creation, all new contexts are marked as recoverable.
1798 */
1799#define I915_CONTEXT_PARAM_RECOVERABLE 0x8
1800
1801 /*
1802 * The id of the associated virtual memory address space (ppGTT) of
1803 * this context. Can be retrieved and passed to another context
1804 * (on the same fd) for both to use the same ppGTT and so share
1805 * address layouts, and avoid reloading the page tables on context
1806 * switches between themselves.
1807 *
1808 * See DRM_I915_GEM_VM_CREATE and DRM_I915_GEM_VM_DESTROY.
1809 */
1810#define I915_CONTEXT_PARAM_VM 0x9
1811
1812/*
1813 * I915_CONTEXT_PARAM_ENGINES:
1814 *
1815 * Bind this context to operate on this subset of available engines. Henceforth,
1816 * the I915_EXEC_RING selector for DRM_IOCTL_I915_GEM_EXECBUFFER2 operates as
1817 * an index into this array of engines; I915_EXEC_DEFAULT selecting engine[0]
1818 * and upwards. Slots 0...N are filled in using the specified (class, instance).
1819 * Use
1820 * engine_class: I915_ENGINE_CLASS_INVALID,
1821 * engine_instance: I915_ENGINE_CLASS_INVALID_NONE
1822 * to specify a gap in the array that can be filled in later, e.g. by a
1823 * virtual engine used for load balancing.
1824 *
1825 * Setting the number of engines bound to the context to 0, by passing a zero
1826 * sized argument, will revert back to default settings.
1827 *
1828 * See struct i915_context_param_engines.
1829 *
1830 * Extensions:
1831 * i915_context_engines_load_balance (I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE)
1832 * i915_context_engines_bond (I915_CONTEXT_ENGINES_EXT_BOND)
1833 * i915_context_engines_parallel_submit (I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT)
1834 */
1835#define I915_CONTEXT_PARAM_ENGINES 0xa
1836
1837/*
1838 * I915_CONTEXT_PARAM_PERSISTENCE:
1839 *
1840 * Allow the context and active rendering to survive the process until
1841 * completion. Persistence allows fire-and-forget clients to queue up a
1842 * bunch of work, hand the output over to a display server and then quit.
1843 * If the context is marked as not persistent, upon closing (either via
1844 * an explicit DRM_I915_GEM_CONTEXT_DESTROY or implicitly from file closure
1845 * or process termination), the context and any outstanding requests will be
1846 * cancelled (and exported fences for cancelled requests marked as -EIO).
1847 *
1848 * By default, new contexts allow persistence.
1849 */
1850#define I915_CONTEXT_PARAM_PERSISTENCE 0xb
1851
1852/* This API has been removed. On the off chance someone somewhere has
1853 * attempted to use it, never re-use this context param number.
1854 */
1855#define I915_CONTEXT_PARAM_RINGSIZE 0xc
1856
1857/*
1858 * I915_CONTEXT_PARAM_PROTECTED_CONTENT:
1859 *
1860 * Mark that the context makes use of protected content, which will result
1861 * in the context being invalidated when the protected content session is.
1862 * Given that the protected content session is killed on suspend, the device
1863 * is kept awake for the lifetime of a protected context, so the user should
1864 * make sure to dispose of them once done.
1865 * This flag can only be set at context creation time and, when set to true,
1866 * must be preceded by an explicit setting of I915_CONTEXT_PARAM_RECOVERABLE
1867 * to false. This flag can't be set to true in conjunction with setting the
1868 * I915_CONTEXT_PARAM_BANNABLE flag to false. Creation example:
1869 *
1870 * .. code-block:: C
1871 *
1872 * struct drm_i915_gem_context_create_ext_setparam p_protected = {
1873 * .base = {
1874 * .name = I915_CONTEXT_CREATE_EXT_SETPARAM,
1875 * },
1876 * .param = {
1877 * .param = I915_CONTEXT_PARAM_PROTECTED_CONTENT,
1878 * .value = 1,
1879 * }
1880 * };
1881 * struct drm_i915_gem_context_create_ext_setparam p_norecover = {
1882 * .base = {
1883 * .name = I915_CONTEXT_CREATE_EXT_SETPARAM,
1884 * .next_extension = to_user_pointer(&p_protected),
1885 * },
1886 * .param = {
1887 * .param = I915_CONTEXT_PARAM_RECOVERABLE,
1888 * .value = 0,
1889 * }
1890 * };
1891 * struct drm_i915_gem_context_create_ext create = {
1892 * .flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
1893 * .extensions = to_user_pointer(&p_norecover);
1894 * };
1895 *
1896 * ctx_id = gem_context_create_ext(drm_fd, &create);
1897 *
1898 * In addition to the normal failure cases, setting this flag during context
1899 * creation can result in the following errors:
1900 *
1901 * -ENODEV: feature not available
1902 * -EPERM: trying to mark a recoverable or not bannable context as protected
1903 */
1904#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
1905/* Must be kept compact -- no holes and well documented */
1906
1907 __u64 value;
1908};
1909
1910/*
1911 * Context SSEU programming
1912 *
1913 * It may be necessary for either functional or performance reason to configure
1914 * a context to run with a reduced number of SSEU (where SSEU stands for Slice/
1915 * Sub-slice/EU).
1916 *
1917 * This is done by configuring SSEU configuration using the below
1918 * @struct drm_i915_gem_context_param_sseu for every supported engine which
1919 * userspace intends to use.
1920 *
1921 * Not all GPUs or engines support this functionality in which case an error
1922 * code -ENODEV will be returned.
1923 *
1924 * Also, flexibility of possible SSEU configuration permutations varies between
1925 * GPU generations and software imposed limitations. Requesting such a
1926 * combination will return an error code of -EINVAL.
1927 *
1928 * NOTE: When perf/OA is active the context's SSEU configuration is ignored in
1929 * favour of a single global setting.
1930 */
1931struct drm_i915_gem_context_param_sseu {
1932 /*
1933 * Engine class & instance to be configured or queried.
1934 */
1935 struct i915_engine_class_instance engine;
1936
1937 /*
1938 * Unknown flags must be cleared to zero.
1939 */
1940 __u32 flags;
1941#define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
1942
1943 /*
1944 * Mask of slices to enable for the context. Valid values are a subset
1945 * of the bitmask value returned for I915_PARAM_SLICE_MASK.
1946 */
1947 __u64 slice_mask;
1948
1949 /*
1950 * Mask of subslices to enable for the context. Valid values are a
1951 * subset of the bitmask value return by I915_PARAM_SUBSLICE_MASK.
1952 */
1953 __u64 subslice_mask;
1954
1955 /*
1956 * Minimum/Maximum number of EUs to enable per subslice for the
1957 * context. min_eus_per_subslice must be inferior or equal to
1958 * max_eus_per_subslice.
1959 */
1960 __u16 min_eus_per_subslice;
1961 __u16 max_eus_per_subslice;
1962
1963 /*
1964 * Unused for now. Must be cleared to zero.
1965 */
1966 __u32 rsvd;
1967};
1968
1969/**
1970 * DOC: Virtual Engine uAPI
1971 *
1972 * Virtual engine is a concept where userspace is able to configure a set of
1973 * physical engines, submit a batch buffer, and let the driver execute it on any
1974 * engine from the set as it sees fit.
1975 *
1976 * This is primarily useful on parts which have multiple instances of a same
1977 * class engine, like for example GT3+ Skylake parts with their two VCS engines.
1978 *
1979 * For instance userspace can enumerate all engines of a certain class using the
1980 * previously described `Engine Discovery uAPI`_. After that userspace can
1981 * create a GEM context with a placeholder slot for the virtual engine (using
1982 * `I915_ENGINE_CLASS_INVALID` and `I915_ENGINE_CLASS_INVALID_NONE` for class
1983 * and instance respectively) and finally using the
1984 * `I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE` extension place a virtual engine in
1985 * the same reserved slot.
1986 *
1987 * Example of creating a virtual engine and submitting a batch buffer to it:
1988 *
1989 * .. code-block:: C
1990 *
1991 * I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(virtual, 2) = {
1992 * .base.name = I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE,
1993 * .engine_index = 0, // Place this virtual engine into engine map slot 0
1994 * .num_siblings = 2,
1995 * .engines = { { I915_ENGINE_CLASS_VIDEO, 0 },
1996 * { I915_ENGINE_CLASS_VIDEO, 1 }, },
1997 * };
1998 * I915_DEFINE_CONTEXT_PARAM_ENGINES(engines, 1) = {
1999 * .engines = { { I915_ENGINE_CLASS_INVALID,
2000 * I915_ENGINE_CLASS_INVALID_NONE } },
2001 * .extensions = to_user_pointer(&virtual), // Chains after load_balance extension
2002 * };
2003 * struct drm_i915_gem_context_create_ext_setparam p_engines = {
2004 * .base = {
2005 * .name = I915_CONTEXT_CREATE_EXT_SETPARAM,
2006 * },
2007 * .param = {
2008 * .param = I915_CONTEXT_PARAM_ENGINES,
2009 * .value = to_user_pointer(&engines),
2010 * .size = sizeof(engines),
2011 * },
2012 * };
2013 * struct drm_i915_gem_context_create_ext create = {
2014 * .flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
2015 * .extensions = to_user_pointer(&p_engines);
2016 * };
2017 *
2018 * ctx_id = gem_context_create_ext(drm_fd, &create);
2019 *
2020 * // Now we have created a GEM context with its engine map containing a
2021 * // single virtual engine. Submissions to this slot can go either to
2022 * // vcs0 or vcs1, depending on the load balancing algorithm used inside
2023 * // the driver. The load balancing is dynamic from one batch buffer to
2024 * // another and transparent to userspace.
2025 *
2026 * ...
2027 * execbuf.rsvd1 = ctx_id;
2028 * execbuf.flags = 0; // Submits to index 0 which is the virtual engine
2029 * gem_execbuf(drm_fd, &execbuf);
2030 */
2031
2032/*
2033 * i915_context_engines_load_balance:
2034 *
2035 * Enable load balancing across this set of engines.
2036 *
2037 * Into the I915_EXEC_DEFAULT slot [0], a virtual engine is created that when
2038 * used will proxy the execbuffer request onto one of the set of engines
2039 * in such a way as to distribute the load evenly across the set.
2040 *
2041 * The set of engines must be compatible (e.g. the same HW class) as they
2042 * will share the same logical GPU context and ring.
2043 *
2044 * To intermix rendering with the virtual engine and direct rendering onto
2045 * the backing engines (bypassing the load balancing proxy), the context must
2046 * be defined to use a single timeline for all engines.
2047 */
2048struct i915_context_engines_load_balance {
2049 struct i915_user_extension base;
2050
2051 __u16 engine_index;
2052 __u16 num_siblings;
2053 __u32 flags; /* all undefined flags must be zero */
2054
2055 __u64 mbz64; /* reserved for future use; must be zero */
2056
2057 struct i915_engine_class_instance engines[0];
2058} __attribute__((packed));
2059
2060#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
2061 struct i915_user_extension base; \
2062 __u16 engine_index; \
2063 __u16 num_siblings; \
2064 __u32 flags; \
2065 __u64 mbz64; \
2066 struct i915_engine_class_instance engines[N__]; \
2067} __attribute__((packed)) name__
2068
2069/*
2070 * i915_context_engines_bond:
2071 *
2072 * Constructed bonded pairs for execution within a virtual engine.
2073 *
2074 * All engines are equal, but some are more equal than others. Given
2075 * the distribution of resources in the HW, it may be preferable to run
2076 * a request on a given subset of engines in parallel to a request on a
2077 * specific engine. We enable this selection of engines within a virtual
2078 * engine by specifying bonding pairs, for any given master engine we will
2079 * only execute on one of the corresponding siblings within the virtual engine.
2080 *
2081 * To execute a request in parallel on the master engine and a sibling requires
2082 * coordination with a I915_EXEC_FENCE_SUBMIT.
2083 */
2084struct i915_context_engines_bond {
2085 struct i915_user_extension base;
2086
2087 struct i915_engine_class_instance master;
2088
2089 __u16 virtual_index; /* index of virtual engine in ctx->engines[] */
2090 __u16 num_bonds;
2091
2092 __u64 flags; /* all undefined flags must be zero */
2093 __u64 mbz64[4]; /* reserved for future use; must be zero */
2094
2095 struct i915_engine_class_instance engines[0];
2096} __attribute__((packed));
2097
2098#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
2099 struct i915_user_extension base; \
2100 struct i915_engine_class_instance master; \
2101 __u16 virtual_index; \
2102 __u16 num_bonds; \
2103 __u64 flags; \
2104 __u64 mbz64[4]; \
2105 struct i915_engine_class_instance engines[N__]; \
2106} __attribute__((packed)) name__
2107
2108/**
2109 * struct i915_context_engines_parallel_submit - Configure engine for
2110 * parallel submission.
2111 *
2112 * Setup a slot in the context engine map to allow multiple BBs to be submitted
2113 * in a single execbuf IOCTL. Those BBs will then be scheduled to run on the GPU
2114 * in parallel. Multiple hardware contexts are created internally in the i915 to
2115 * run these BBs. Once a slot is configured for N BBs only N BBs can be
2116 * submitted in each execbuf IOCTL and this is implicit behavior e.g. The user
2117 * doesn't tell the execbuf IOCTL there are N BBs, the execbuf IOCTL knows how
2118 * many BBs there are based on the slot's configuration. The N BBs are the last
2119 * N buffer objects or first N if I915_EXEC_BATCH_FIRST is set.
2120 *
2121 * The default placement behavior is to create implicit bonds between each
2122 * context if each context maps to more than 1 physical engine (e.g. context is
2123 * a virtual engine). Also we only allow contexts of same engine class and these
2124 * contexts must be in logically contiguous order. Examples of the placement
2125 * behavior are described below. Lastly, the default is to not allow BBs to be
2126 * preempted mid-batch. Rather insert coordinated preemption points on all
2127 * hardware contexts between each set of BBs. Flags could be added in the future
2128 * to change both of these default behaviors.
2129 *
2130 * Returns -EINVAL if hardware context placement configuration is invalid or if
2131 * the placement configuration isn't supported on the platform / submission
2132 * interface.
2133 * Returns -ENODEV if extension isn't supported on the platform / submission
2134 * interface.
2135 *
2136 * .. code-block:: none
2137 *
2138 * Examples syntax:
2139 * CS[X] = generic engine of same class, logical instance X
2140 * INVALID = I915_ENGINE_CLASS_INVALID, I915_ENGINE_CLASS_INVALID_NONE
2141 *
2142 * Example 1 pseudo code:
2143 * set_engines(INVALID)
2144 * set_parallel(engine_index=0, width=2, num_siblings=1,
2145 * engines=CS[0],CS[1])
2146 *
2147 * Results in the following valid placement:
2148 * CS[0], CS[1]
2149 *
2150 * Example 2 pseudo code:
2151 * set_engines(INVALID)
2152 * set_parallel(engine_index=0, width=2, num_siblings=2,
2153 * engines=CS[0],CS[2],CS[1],CS[3])
2154 *
2155 * Results in the following valid placements:
2156 * CS[0], CS[1]
2157 * CS[2], CS[3]
2158 *
2159 * This can be thought of as two virtual engines, each containing two
2160 * engines thereby making a 2D array. However, there are bonds tying the
2161 * entries together and placing restrictions on how they can be scheduled.
2162 * Specifically, the scheduler can choose only vertical columns from the 2D
2163 * array. That is, CS[0] is bonded to CS[1] and CS[2] to CS[3]. So if the
2164 * scheduler wants to submit to CS[0], it must also choose CS[1] and vice
2165 * versa. Same for CS[2] requires also using CS[3].
2166 * VE[0] = CS[0], CS[2]
2167 * VE[1] = CS[1], CS[3]
2168 *
2169 * Example 3 pseudo code:
2170 * set_engines(INVALID)
2171 * set_parallel(engine_index=0, width=2, num_siblings=2,
2172 * engines=CS[0],CS[1],CS[1],CS[3])
2173 *
2174 * Results in the following valid and invalid placements:
2175 * CS[0], CS[1]
2176 * CS[1], CS[3] - Not logically contiguous, return -EINVAL
2177 */
2178struct i915_context_engines_parallel_submit {
2179 /**
2180 * @base: base user extension.
2181 */
2182 struct i915_user_extension base;
2183
2184 /**
2185 * @engine_index: slot for parallel engine
2186 */
2187 __u16 engine_index;
2188
2189 /**
2190 * @width: number of contexts per parallel engine or in other words the
2191 * number of batches in each submission
2192 */
2193 __u16 width;
2194
2195 /**
2196 * @num_siblings: number of siblings per context or in other words the
2197 * number of possible placements for each submission
2198 */
2199 __u16 num_siblings;
2200
2201 /**
2202 * @mbz16: reserved for future use; must be zero
2203 */
2204 __u16 mbz16;
2205
2206 /**
2207 * @flags: all undefined flags must be zero, currently not defined flags
2208 */
2209 __u64 flags;
2210
2211 /**
2212 * @mbz64: reserved for future use; must be zero
2213 */
2214 __u64 mbz64[3];
2215
2216 /**
2217 * @engines: 2-d array of engine instances to configure parallel engine
2218 *
2219 * length = width (i) * num_siblings (j)
2220 * index = j + i * num_siblings
2221 */
2222 struct i915_engine_class_instance engines[0];
2223
2224} __attribute__((packed));
2225
2226#define I915_DEFINE_CONTEXT_ENGINES_PARALLEL_SUBMIT(name__, N__) struct { \
2227 struct i915_user_extension base; \
2228 __u16 engine_index; \
2229 __u16 width; \
2230 __u16 num_siblings; \
2231 __u16 mbz16; \
2232 __u64 flags; \
2233 __u64 mbz64[3]; \
2234 struct i915_engine_class_instance engines[N__]; \
2235} __attribute__((packed)) name__
2236
2237/**
2238 * DOC: Context Engine Map uAPI
2239 *
2240 * Context engine map is a new way of addressing engines when submitting batch-
2241 * buffers, replacing the existing way of using identifiers like `I915_EXEC_BLT`
2242 * inside the flags field of `struct drm_i915_gem_execbuffer2`.
2243 *
2244 * To use it created GEM contexts need to be configured with a list of engines
2245 * the user is intending to submit to. This is accomplished using the
2246 * `I915_CONTEXT_PARAM_ENGINES` parameter and `struct
2247 * i915_context_param_engines`.
2248 *
2249 * For such contexts the `I915_EXEC_RING_MASK` field becomes an index into the
2250 * configured map.
2251 *
2252 * Example of creating such context and submitting against it:
2253 *
2254 * .. code-block:: C
2255 *
2256 * I915_DEFINE_CONTEXT_PARAM_ENGINES(engines, 2) = {
2257 * .engines = { { I915_ENGINE_CLASS_RENDER, 0 },
2258 * { I915_ENGINE_CLASS_COPY, 0 } }
2259 * };
2260 * struct drm_i915_gem_context_create_ext_setparam p_engines = {
2261 * .base = {
2262 * .name = I915_CONTEXT_CREATE_EXT_SETPARAM,
2263 * },
2264 * .param = {
2265 * .param = I915_CONTEXT_PARAM_ENGINES,
2266 * .value = to_user_pointer(&engines),
2267 * .size = sizeof(engines),
2268 * },
2269 * };
2270 * struct drm_i915_gem_context_create_ext create = {
2271 * .flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
2272 * .extensions = to_user_pointer(&p_engines);
2273 * };
2274 *
2275 * ctx_id = gem_context_create_ext(drm_fd, &create);
2276 *
2277 * // We have now created a GEM context with two engines in the map:
2278 * // Index 0 points to rcs0 while index 1 points to bcs0. Other engines
2279 * // will not be accessible from this context.
2280 *
2281 * ...
2282 * execbuf.rsvd1 = ctx_id;
2283 * execbuf.flags = 0; // Submits to index 0, which is rcs0 for this context
2284 * gem_execbuf(drm_fd, &execbuf);
2285 *
2286 * ...
2287 * execbuf.rsvd1 = ctx_id;
2288 * execbuf.flags = 1; // Submits to index 0, which is bcs0 for this context
2289 * gem_execbuf(drm_fd, &execbuf);
2290 */
2291
2292struct i915_context_param_engines {
2293 __u64 extensions; /* linked chain of extension blocks, 0 terminates */
2294#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0 /* see i915_context_engines_load_balance */
2295#define I915_CONTEXT_ENGINES_EXT_BOND 1 /* see i915_context_engines_bond */
2296#define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */
2297 struct i915_engine_class_instance engines[0];
2298} __attribute__((packed));
2299
2300#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \
2301 __u64 extensions; \
2302 struct i915_engine_class_instance engines[N__]; \
2303} __attribute__((packed)) name__
2304
2305struct drm_i915_gem_context_create_ext_setparam {
2306#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
2307 struct i915_user_extension base;
2308 struct drm_i915_gem_context_param param;
2309};
2310
2311/* This API has been removed. On the off chance someone somewhere has
2312 * attempted to use it, never re-use this extension number.
2313 */
2314#define I915_CONTEXT_CREATE_EXT_CLONE 1
2315
2316struct drm_i915_gem_context_destroy {
2317 __u32 ctx_id;
2318 __u32 pad;
2319};
2320
2321/*
2322 * DRM_I915_GEM_VM_CREATE -
2323 *
2324 * Create a new virtual memory address space (ppGTT) for use within a context
2325 * on the same file. Extensions can be provided to configure exactly how the
2326 * address space is setup upon creation.
2327 *
2328 * The id of new VM (bound to the fd) for use with I915_CONTEXT_PARAM_VM is
2329 * returned in the outparam @id.
2330 *
2331 * No flags are defined, with all bits reserved and must be zero.
2332 *
2333 * An extension chain maybe provided, starting with @extensions, and terminated
2334 * by the @next_extension being 0. Currently, no extensions are defined.
2335 *
2336 * DRM_I915_GEM_VM_DESTROY -
2337 *
2338 * Destroys a previously created VM id, specified in @id.
2339 *
2340 * No extensions or flags are allowed currently, and so must be zero.
2341 */
2342struct drm_i915_gem_vm_control {
2343 __u64 extensions;
2344 __u32 flags;
2345 __u32 vm_id;
2346};
2347
2348struct drm_i915_reg_read {
2349 /*
2350 * Register offset.
2351 * For 64bit wide registers where the upper 32bits don't immediately
2352 * follow the lower 32bits, the offset of the lower 32bits must
2353 * be specified
2354 */
2355 __u64 offset;
2356#define I915_REG_READ_8B_WA (1ul << 0)
2357
2358 __u64 val; /* Return value */
2359};
2360
2361/* Known registers:
2362 *
2363 * Render engine timestamp - 0x2358 + 64bit - gen7+
2364 * - Note this register returns an invalid value if using the default
2365 * single instruction 8byte read, in order to workaround that pass
2366 * flag I915_REG_READ_8B_WA in offset field.
2367 *
2368 */
2369
2370struct drm_i915_reset_stats {
2371 __u32 ctx_id;
2372 __u32 flags;
2373
2374 /* All resets since boot/module reload, for all contexts */
2375 __u32 reset_count;
2376
2377 /* Number of batches lost when active in GPU, for this context */
2378 __u32 batch_active;
2379
2380 /* Number of batches lost pending for execution, for this context */
2381 __u32 batch_pending;
2382
2383 __u32 pad;
2384};
2385
2386/**
2387 * struct drm_i915_gem_userptr - Create GEM object from user allocated memory.
2388 *
2389 * Userptr objects have several restrictions on what ioctls can be used with the
2390 * object handle.
2391 */
2392struct drm_i915_gem_userptr {
2393 /**
2394 * @user_ptr: The pointer to the allocated memory.
2395 *
2396 * Needs to be aligned to PAGE_SIZE.
2397 */
2398 __u64 user_ptr;
2399
2400 /**
2401 * @user_size:
2402 *
2403 * The size in bytes for the allocated memory. This will also become the
2404 * object size.
2405 *
2406 * Needs to be aligned to PAGE_SIZE, and should be at least PAGE_SIZE,
2407 * or larger.
2408 */
2409 __u64 user_size;
2410
2411 /**
2412 * @flags:
2413 *
2414 * Supported flags:
2415 *
2416 * I915_USERPTR_READ_ONLY:
2417 *
2418 * Mark the object as readonly, this also means GPU access can only be
2419 * readonly. This is only supported on HW which supports readonly access
2420 * through the GTT. If the HW can't support readonly access, an error is
2421 * returned.
2422 *
2423 * I915_USERPTR_PROBE:
2424 *
2425 * Probe the provided @user_ptr range and validate that the @user_ptr is
2426 * indeed pointing to normal memory and that the range is also valid.
2427 * For example if some garbage address is given to the kernel, then this
2428 * should complain.
2429 *
2430 * Returns -EFAULT if the probe failed.
2431 *
2432 * Note that this doesn't populate the backing pages, and also doesn't
2433 * guarantee that the object will remain valid when the object is
2434 * eventually used.
2435 *
2436 * The kernel supports this feature if I915_PARAM_HAS_USERPTR_PROBE
2437 * returns a non-zero value.
2438 *
2439 * I915_USERPTR_UNSYNCHRONIZED:
2440 *
2441 * NOT USED. Setting this flag will result in an error.
2442 */
2443 __u32 flags;
2444#define I915_USERPTR_READ_ONLY 0x1
2445#define I915_USERPTR_PROBE 0x2
2446#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
2447 /**
2448 * @handle: Returned handle for the object.
2449 *
2450 * Object handles are nonzero.
2451 */
2452 __u32 handle;
2453};
2454
2455enum drm_i915_oa_format {
2456 I915_OA_FORMAT_A13 = 1, /* HSW only */
2457 I915_OA_FORMAT_A29, /* HSW only */
2458 I915_OA_FORMAT_A13_B8_C8, /* HSW only */
2459 I915_OA_FORMAT_B4_C8, /* HSW only */
2460 I915_OA_FORMAT_A45_B8_C8, /* HSW only */
2461 I915_OA_FORMAT_B4_C8_A16, /* HSW only */
2462 I915_OA_FORMAT_C4_B8, /* HSW+ */
2463
2464 /* Gen8+ */
2465 I915_OA_FORMAT_A12,
2466 I915_OA_FORMAT_A12_B8_C8,
2467 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
2468
2469 I915_OA_FORMAT_MAX /* non-ABI */
2470};
2471
2472enum drm_i915_perf_property_id {
2473 /**
2474 * Open the stream for a specific context handle (as used with
2475 * execbuffer2). A stream opened for a specific context this way
2476 * won't typically require root privileges.
2477 *
2478 * This property is available in perf revision 1.
2479 */
2480 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
2481
2482 /**
2483 * A value of 1 requests the inclusion of raw OA unit reports as
2484 * part of stream samples.
2485 *
2486 * This property is available in perf revision 1.
2487 */
2488 DRM_I915_PERF_PROP_SAMPLE_OA,
2489
2490 /**
2491 * The value specifies which set of OA unit metrics should be
2492 * configured, defining the contents of any OA unit reports.
2493 *
2494 * This property is available in perf revision 1.
2495 */
2496 DRM_I915_PERF_PROP_OA_METRICS_SET,
2497
2498 /**
2499 * The value specifies the size and layout of OA unit reports.
2500 *
2501 * This property is available in perf revision 1.
2502 */
2503 DRM_I915_PERF_PROP_OA_FORMAT,
2504
2505 /**
2506 * Specifying this property implicitly requests periodic OA unit
2507 * sampling and (at least on Haswell) the sampling frequency is derived
2508 * from this exponent as follows:
2509 *
2510 * 80ns * 2^(period_exponent + 1)
2511 *
2512 * This property is available in perf revision 1.
2513 */
2514 DRM_I915_PERF_PROP_OA_EXPONENT,
2515
2516 /**
2517 * Specifying this property is only valid when specify a context to
2518 * filter with DRM_I915_PERF_PROP_CTX_HANDLE. Specifying this property
2519 * will hold preemption of the particular context we want to gather
2520 * performance data about. The execbuf2 submissions must include a
2521 * drm_i915_gem_execbuffer_ext_perf parameter for this to apply.
2522 *
2523 * This property is available in perf revision 3.
2524 */
2525 DRM_I915_PERF_PROP_HOLD_PREEMPTION,
2526
2527 /**
2528 * Specifying this pins all contexts to the specified SSEU power
2529 * configuration for the duration of the recording.
2530 *
2531 * This parameter's value is a pointer to a struct
2532 * drm_i915_gem_context_param_sseu.
2533 *
2534 * This property is available in perf revision 4.
2535 */
2536 DRM_I915_PERF_PROP_GLOBAL_SSEU,
2537
2538 /**
2539 * This optional parameter specifies the timer interval in nanoseconds
2540 * at which the i915 driver will check the OA buffer for available data.
2541 * Minimum allowed value is 100 microseconds. A default value is used by
2542 * the driver if this parameter is not specified. Note that larger timer
2543 * values will reduce cpu consumption during OA perf captures. However,
2544 * excessively large values would potentially result in OA buffer
2545 * overwrites as captures reach end of the OA buffer.
2546 *
2547 * This property is available in perf revision 5.
2548 */
2549 DRM_I915_PERF_PROP_POLL_OA_PERIOD,
2550
2551 DRM_I915_PERF_PROP_MAX /* non-ABI */
2552};
2553
2554struct drm_i915_perf_open_param {
2555 __u32 flags;
2556#define I915_PERF_FLAG_FD_CLOEXEC (1<<0)
2557#define I915_PERF_FLAG_FD_NONBLOCK (1<<1)
2558#define I915_PERF_FLAG_DISABLED (1<<2)
2559
2560 /** The number of u64 (id, value) pairs */
2561 __u32 num_properties;
2562
2563 /**
2564 * Pointer to array of u64 (id, value) pairs configuring the stream
2565 * to open.
2566 */
2567 __u64 properties_ptr;
2568};
2569
2570/*
2571 * Enable data capture for a stream that was either opened in a disabled state
2572 * via I915_PERF_FLAG_DISABLED or was later disabled via
2573 * I915_PERF_IOCTL_DISABLE.
2574 *
2575 * It is intended to be cheaper to disable and enable a stream than it may be
2576 * to close and re-open a stream with the same configuration.
2577 *
2578 * It's undefined whether any pending data for the stream will be lost.
2579 *
2580 * This ioctl is available in perf revision 1.
2581 */
2582#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
2583
2584/*
2585 * Disable data capture for a stream.
2586 *
2587 * It is an error to try and read a stream that is disabled.
2588 *
2589 * This ioctl is available in perf revision 1.
2590 */
2591#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
2592
2593/*
2594 * Change metrics_set captured by a stream.
2595 *
2596 * If the stream is bound to a specific context, the configuration change
2597 * will performed __inline__ with that context such that it takes effect before
2598 * the next execbuf submission.
2599 *
2600 * Returns the previously bound metrics set id, or a negative error code.
2601 *
2602 * This ioctl is available in perf revision 2.
2603 */
2604#define I915_PERF_IOCTL_CONFIG _IO('i', 0x2)
2605
2606/*
2607 * Common to all i915 perf records
2608 */
2609struct drm_i915_perf_record_header {
2610 __u32 type;
2611 __u16 pad;
2612 __u16 size;
2613};
2614
2615enum drm_i915_perf_record_type {
2616
2617 /**
2618 * Samples are the work horse record type whose contents are extensible
2619 * and defined when opening an i915 perf stream based on the given
2620 * properties.
2621 *
2622 * Boolean properties following the naming convention
2623 * DRM_I915_PERF_SAMPLE_xyz_PROP request the inclusion of 'xyz' data in
2624 * every sample.
2625 *
2626 * The order of these sample properties given by userspace has no
2627 * affect on the ordering of data within a sample. The order is
2628 * documented here.
2629 *
2630 * struct {
2631 * struct drm_i915_perf_record_header header;
2632 *
2633 * { u32 oa_report[]; } && DRM_I915_PERF_PROP_SAMPLE_OA
2634 * };
2635 */
2636 DRM_I915_PERF_RECORD_SAMPLE = 1,
2637
2638 /*
2639 * Indicates that one or more OA reports were not written by the
2640 * hardware. This can happen for example if an MI_REPORT_PERF_COUNT
2641 * command collides with periodic sampling - which would be more likely
2642 * at higher sampling frequencies.
2643 */
2644 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
2645
2646 /**
2647 * An error occurred that resulted in all pending OA reports being lost.
2648 */
2649 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
2650
2651 DRM_I915_PERF_RECORD_MAX /* non-ABI */
2652};
2653
2654/*
2655 * Structure to upload perf dynamic configuration into the kernel.
2656 */
2657struct drm_i915_perf_oa_config {
2658 /** String formatted like "%08x-%04x-%04x-%04x-%012x" */
2659 char uuid[36];
2660
2661 __u32 n_mux_regs;
2662 __u32 n_boolean_regs;
2663 __u32 n_flex_regs;
2664
2665 /*
2666 * These fields are pointers to tuples of u32 values (register address,
2667 * value). For example the expected length of the buffer pointed by
2668 * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).
2669 */
2670 __u64 mux_regs_ptr;
2671 __u64 boolean_regs_ptr;
2672 __u64 flex_regs_ptr;
2673};
2674
2675/**
2676 * struct drm_i915_query_item - An individual query for the kernel to process.
2677 *
2678 * The behaviour is determined by the @query_id. Note that exactly what
2679 * @data_ptr is also depends on the specific @query_id.
2680 */
2681struct drm_i915_query_item {
2682 /** @query_id: The id for this query */
2683 __u64 query_id;
2684#define DRM_I915_QUERY_TOPOLOGY_INFO 1
2685#define DRM_I915_QUERY_ENGINE_INFO 2
2686#define DRM_I915_QUERY_PERF_CONFIG 3
2687#define DRM_I915_QUERY_MEMORY_REGIONS 4
2688/* Must be kept compact -- no holes and well documented */
2689
2690 /**
2691 * @length:
2692 *
2693 * When set to zero by userspace, this is filled with the size of the
2694 * data to be written at the @data_ptr pointer. The kernel sets this
2695 * value to a negative value to signal an error on a particular query
2696 * item.
2697 */
2698 __s32 length;
2699
2700 /**
2701 * @flags:
2702 *
2703 * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
2704 *
2705 * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
2706 * following:
2707 *
2708 * - DRM_I915_QUERY_PERF_CONFIG_LIST
2709 * - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
2710 * - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
2711 */
2712 __u32 flags;
2713#define DRM_I915_QUERY_PERF_CONFIG_LIST 1
2714#define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2
2715#define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID 3
2716
2717 /**
2718 * @data_ptr:
2719 *
2720 * Data will be written at the location pointed by @data_ptr when the
2721 * value of @length matches the length of the data to be written by the
2722 * kernel.
2723 */
2724 __u64 data_ptr;
2725};
2726
2727/**
2728 * struct drm_i915_query - Supply an array of struct drm_i915_query_item for the
2729 * kernel to fill out.
2730 *
2731 * Note that this is generally a two step process for each struct
2732 * drm_i915_query_item in the array:
2733 *
2734 * 1. Call the DRM_IOCTL_I915_QUERY, giving it our array of struct
2735 * drm_i915_query_item, with &drm_i915_query_item.length set to zero. The
2736 * kernel will then fill in the size, in bytes, which tells userspace how
2737 * memory it needs to allocate for the blob(say for an array of properties).
2738 *
2739 * 2. Next we call DRM_IOCTL_I915_QUERY again, this time with the
2740 * &drm_i915_query_item.data_ptr equal to our newly allocated blob. Note that
2741 * the &drm_i915_query_item.length should still be the same as what the
2742 * kernel previously set. At this point the kernel can fill in the blob.
2743 *
2744 * Note that for some query items it can make sense for userspace to just pass
2745 * in a buffer/blob equal to or larger than the required size. In this case only
2746 * a single ioctl call is needed. For some smaller query items this can work
2747 * quite well.
2748 *
2749 */
2750struct drm_i915_query {
2751 /** @num_items: The number of elements in the @items_ptr array */
2752 __u32 num_items;
2753
2754 /**
2755 * @flags: Unused for now. Must be cleared to zero.
2756 */
2757 __u32 flags;
2758
2759 /**
2760 * @items_ptr:
2761 *
2762 * Pointer to an array of struct drm_i915_query_item. The number of
2763 * array elements is @num_items.
2764 */
2765 __u64 items_ptr;
2766};
2767
2768/*
2769 * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :
2770 *
2771 * data: contains the 3 pieces of information :
2772 *
2773 * - the slice mask with one bit per slice telling whether a slice is
2774 * available. The availability of slice X can be queried with the following
2775 * formula :
2776 *
2777 * (data[X / 8] >> (X % 8)) & 1
2778 *
2779 * - the subslice mask for each slice with one bit per subslice telling
2780 * whether a subslice is available. Gen12 has dual-subslices, which are
2781 * similar to two gen11 subslices. For gen12, this array represents dual-
2782 * subslices. The availability of subslice Y in slice X can be queried
2783 * with the following formula :
2784 *
2785 * (data[subslice_offset +
2786 * X * subslice_stride +
2787 * Y / 8] >> (Y % 8)) & 1
2788 *
2789 * - the EU mask for each subslice in each slice with one bit per EU telling
2790 * whether an EU is available. The availability of EU Z in subslice Y in
2791 * slice X can be queried with the following formula :
2792 *
2793 * (data[eu_offset +
2794 * (X * max_subslices + Y) * eu_stride +
2795 * Z / 8] >> (Z % 8)) & 1
2796 */
2797struct drm_i915_query_topology_info {
2798 /*
2799 * Unused for now. Must be cleared to zero.
2800 */
2801 __u16 flags;
2802
2803 __u16 max_slices;
2804 __u16 max_subslices;
2805 __u16 max_eus_per_subslice;
2806
2807 /*
2808 * Offset in data[] at which the subslice masks are stored.
2809 */
2810 __u16 subslice_offset;
2811
2812 /*
2813 * Stride at which each of the subslice masks for each slice are
2814 * stored.
2815 */
2816 __u16 subslice_stride;
2817
2818 /*
2819 * Offset in data[] at which the EU masks are stored.
2820 */
2821 __u16 eu_offset;
2822
2823 /*
2824 * Stride at which each of the EU masks for each subslice are stored.
2825 */
2826 __u16 eu_stride;
2827
2828 __u8 data[];
2829};
2830
2831/**
2832 * DOC: Engine Discovery uAPI
2833 *
2834 * Engine discovery uAPI is a way of enumerating physical engines present in a
2835 * GPU associated with an open i915 DRM file descriptor. This supersedes the old
2836 * way of using `DRM_IOCTL_I915_GETPARAM` and engine identifiers like
2837 * `I915_PARAM_HAS_BLT`.
2838 *
2839 * The need for this interface came starting with Icelake and newer GPUs, which
2840 * started to establish a pattern of having multiple engines of a same class,
2841 * where not all instances were always completely functionally equivalent.
2842 *
2843 * Entry point for this uapi is `DRM_IOCTL_I915_QUERY` with the
2844 * `DRM_I915_QUERY_ENGINE_INFO` as the queried item id.
2845 *
2846 * Example for getting the list of engines:
2847 *
2848 * .. code-block:: C
2849 *
2850 * struct drm_i915_query_engine_info *info;
2851 * struct drm_i915_query_item item = {
2852 * .query_id = DRM_I915_QUERY_ENGINE_INFO;
2853 * };
2854 * struct drm_i915_query query = {
2855 * .num_items = 1,
2856 * .items_ptr = (uintptr_t)&item,
2857 * };
2858 * int err, i;
2859 *
2860 * // First query the size of the blob we need, this needs to be large
2861 * // enough to hold our array of engines. The kernel will fill out the
2862 * // item.length for us, which is the number of bytes we need.
2863 * //
2864 * // Alternatively a large buffer can be allocated straight away enabling
2865 * // querying in one pass, in which case item.length should contain the
2866 * // length of the provided buffer.
2867 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
2868 * if (err) ...
2869 *
2870 * info = calloc(1, item.length);
2871 * // Now that we allocated the required number of bytes, we call the ioctl
2872 * // again, this time with the data_ptr pointing to our newly allocated
2873 * // blob, which the kernel can then populate with info on all engines.
2874 * item.data_ptr = (uintptr_t)&info,
2875 *
2876 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
2877 * if (err) ...
2878 *
2879 * // We can now access each engine in the array
2880 * for (i = 0; i < info->num_engines; i++) {
2881 * struct drm_i915_engine_info einfo = info->engines[i];
2882 * u16 class = einfo.engine.class;
2883 * u16 instance = einfo.engine.instance;
2884 * ....
2885 * }
2886 *
2887 * free(info);
2888 *
2889 * Each of the enumerated engines, apart from being defined by its class and
2890 * instance (see `struct i915_engine_class_instance`), also can have flags and
2891 * capabilities defined as documented in i915_drm.h.
2892 *
2893 * For instance video engines which support HEVC encoding will have the
2894 * `I915_VIDEO_CLASS_CAPABILITY_HEVC` capability bit set.
2895 *
2896 * Engine discovery only fully comes to its own when combined with the new way
2897 * of addressing engines when submitting batch buffers using contexts with
2898 * engine maps configured.
2899 */
2900
2901/**
2902 * struct drm_i915_engine_info
2903 *
2904 * Describes one engine and it's capabilities as known to the driver.
2905 */
2906struct drm_i915_engine_info {
2907 /** @engine: Engine class and instance. */
2908 struct i915_engine_class_instance engine;
2909
2910 /** @rsvd0: Reserved field. */
2911 __u32 rsvd0;
2912
2913 /** @flags: Engine flags. */
2914 __u64 flags;
2915#define I915_ENGINE_INFO_HAS_LOGICAL_INSTANCE (1 << 0)
2916
2917 /** @capabilities: Capabilities of this engine. */
2918 __u64 capabilities;
2919#define I915_VIDEO_CLASS_CAPABILITY_HEVC (1 << 0)
2920#define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC (1 << 1)
2921
2922 /** @logical_instance: Logical instance of engine */
2923 __u16 logical_instance;
2924
2925 /** @rsvd1: Reserved fields. */
2926 __u16 rsvd1[3];
2927 /** @rsvd2: Reserved fields. */
2928 __u64 rsvd2[3];
2929};
2930
2931/**
2932 * struct drm_i915_query_engine_info
2933 *
2934 * Engine info query enumerates all engines known to the driver by filling in
2935 * an array of struct drm_i915_engine_info structures.
2936 */
2937struct drm_i915_query_engine_info {
2938 /** @num_engines: Number of struct drm_i915_engine_info structs following. */
2939 __u32 num_engines;
2940
2941 /** @rsvd: MBZ */
2942 __u32 rsvd[3];
2943
2944 /** @engines: Marker for drm_i915_engine_info structures. */
2945 struct drm_i915_engine_info engines[];
2946};
2947
2948/*
2949 * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG.
2950 */
2951struct drm_i915_query_perf_config {
2952 union {
2953 /*
2954 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets
2955 * this fields to the number of configurations available.
2956 */
2957 __u64 n_configs;
2958
2959 /*
2960 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID,
2961 * i915 will use the value in this field as configuration
2962 * identifier to decide what data to write into config_ptr.
2963 */
2964 __u64 config;
2965
2966 /*
2967 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
2968 * i915 will use the value in this field as configuration
2969 * identifier to decide what data to write into config_ptr.
2970 *
2971 * String formatted like "%08x-%04x-%04x-%04x-%012x"
2972 */
2973 char uuid[36];
2974 };
2975
2976 /*
2977 * Unused for now. Must be cleared to zero.
2978 */
2979 __u32 flags;
2980
2981 /*
2982 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will
2983 * write an array of __u64 of configuration identifiers.
2984 *
2985 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will
2986 * write a struct drm_i915_perf_oa_config. If the following fields of
2987 * drm_i915_perf_oa_config are set not set to 0, i915 will write into
2988 * the associated pointers the values of submitted when the
2989 * configuration was created :
2990 *
2991 * - n_mux_regs
2992 * - n_boolean_regs
2993 * - n_flex_regs
2994 */
2995 __u8 data[];
2996};
2997
2998/**
2999 * enum drm_i915_gem_memory_class - Supported memory classes
3000 */
3001enum drm_i915_gem_memory_class {
3002 /** @I915_MEMORY_CLASS_SYSTEM: System memory */
3003 I915_MEMORY_CLASS_SYSTEM = 0,
3004 /** @I915_MEMORY_CLASS_DEVICE: Device local-memory */
3005 I915_MEMORY_CLASS_DEVICE,
3006};
3007
3008/**
3009 * struct drm_i915_gem_memory_class_instance - Identify particular memory region
3010 */
3011struct drm_i915_gem_memory_class_instance {
3012 /** @memory_class: See enum drm_i915_gem_memory_class */
3013 __u16 memory_class;
3014
3015 /** @memory_instance: Which instance */
3016 __u16 memory_instance;
3017};
3018
3019/**
3020 * struct drm_i915_memory_region_info - Describes one region as known to the
3021 * driver.
3022 *
3023 * Note that we reserve some stuff here for potential future work. As an example
3024 * we might want expose the capabilities for a given region, which could include
3025 * things like if the region is CPU mappable/accessible, what are the supported
3026 * mapping types etc.
3027 *
3028 * Note that to extend struct drm_i915_memory_region_info and struct
3029 * drm_i915_query_memory_regions in the future the plan is to do the following:
3030 *
3031 * .. code-block:: C
3032 *
3033 * struct drm_i915_memory_region_info {
3034 * struct drm_i915_gem_memory_class_instance region;
3035 * union {
3036 * __u32 rsvd0;
3037 * __u32 new_thing1;
3038 * };
3039 * ...
3040 * union {
3041 * __u64 rsvd1[8];
3042 * struct {
3043 * __u64 new_thing2;
3044 * __u64 new_thing3;
3045 * ...
3046 * };
3047 * };
3048 * };
3049 *
3050 * With this things should remain source compatible between versions for
3051 * userspace, even as we add new fields.
3052 *
3053 * Note this is using both struct drm_i915_query_item and struct drm_i915_query.
3054 * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS
3055 * at &drm_i915_query_item.query_id.
3056 */
3057struct drm_i915_memory_region_info {
3058 /** @region: The class:instance pair encoding */
3059 struct drm_i915_gem_memory_class_instance region;
3060
3061 /** @rsvd0: MBZ */
3062 __u32 rsvd0;
3063
3064 /** @probed_size: Memory probed by the driver (-1 = unknown) */
3065 __u64 probed_size;
3066
3067 /** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
3068 __u64 unallocated_size;
3069
3070 /** @rsvd1: MBZ */
3071 __u64 rsvd1[8];
3072};
3073
3074/**
3075 * struct drm_i915_query_memory_regions
3076 *
3077 * The region info query enumerates all regions known to the driver by filling
3078 * in an array of struct drm_i915_memory_region_info structures.
3079 *
3080 * Example for getting the list of supported regions:
3081 *
3082 * .. code-block:: C
3083 *
3084 * struct drm_i915_query_memory_regions *info;
3085 * struct drm_i915_query_item item = {
3086 * .query_id = DRM_I915_QUERY_MEMORY_REGIONS;
3087 * };
3088 * struct drm_i915_query query = {
3089 * .num_items = 1,
3090 * .items_ptr = (uintptr_t)&item,
3091 * };
3092 * int err, i;
3093 *
3094 * // First query the size of the blob we need, this needs to be large
3095 * // enough to hold our array of regions. The kernel will fill out the
3096 * // item.length for us, which is the number of bytes we need.
3097 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
3098 * if (err) ...
3099 *
3100 * info = calloc(1, item.length);
3101 * // Now that we allocated the required number of bytes, we call the ioctl
3102 * // again, this time with the data_ptr pointing to our newly allocated
3103 * // blob, which the kernel can then populate with the all the region info.
3104 * item.data_ptr = (uintptr_t)&info,
3105 *
3106 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
3107 * if (err) ...
3108 *
3109 * // We can now access each region in the array
3110 * for (i = 0; i < info->num_regions; i++) {
3111 * struct drm_i915_memory_region_info mr = info->regions[i];
3112 * u16 class = mr.region.class;
3113 * u16 instance = mr.region.instance;
3114 *
3115 * ....
3116 * }
3117 *
3118 * free(info);
3119 */
3120struct drm_i915_query_memory_regions {
3121 /** @num_regions: Number of supported regions */
3122 __u32 num_regions;
3123
3124 /** @rsvd: MBZ */
3125 __u32 rsvd[3];
3126
3127 /** @regions: Info about each supported region */
3128 struct drm_i915_memory_region_info regions[];
3129};
3130
3131/**
3132 * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
3133 * extension support using struct i915_user_extension.
3134 *
3135 * Note that in the future we want to have our buffer flags here, at least for
3136 * the stuff that is immutable. Previously we would have two ioctls, one to
3137 * create the object with gem_create, and another to apply various parameters,
3138 * however this creates some ambiguity for the params which are considered
3139 * immutable. Also in general we're phasing out the various SET/GET ioctls.
3140 */
3141struct drm_i915_gem_create_ext {
3142 /**
3143 * @size: Requested size for the object.
3144 *
3145 * The (page-aligned) allocated size for the object will be returned.
3146 *
3147 * Note that for some devices we have might have further minimum
3148 * page-size restrictions(larger than 4K), like for device local-memory.
3149 * However in general the final size here should always reflect any
3150 * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS
3151 * extension to place the object in device local-memory.
3152 */
3153 __u64 size;
3154 /**
3155 * @handle: Returned handle for the object.
3156 *
3157 * Object handles are nonzero.
3158 */
3159 __u32 handle;
3160 /** @flags: MBZ */
3161 __u32 flags;
3162 /**
3163 * @extensions: The chain of extensions to apply to this object.
3164 *
3165 * This will be useful in the future when we need to support several
3166 * different extensions, and we need to apply more than one when
3167 * creating the object. See struct i915_user_extension.
3168 *
3169 * If we don't supply any extensions then we get the same old gem_create
3170 * behaviour.
3171 *
3172 * For I915_GEM_CREATE_EXT_MEMORY_REGIONS usage see
3173 * struct drm_i915_gem_create_ext_memory_regions.
3174 *
3175 * For I915_GEM_CREATE_EXT_PROTECTED_CONTENT usage see
3176 * struct drm_i915_gem_create_ext_protected_content.
3177 */
3178#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
3179#define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
3180 __u64 extensions;
3181};
3182
3183/**
3184 * struct drm_i915_gem_create_ext_memory_regions - The
3185 * I915_GEM_CREATE_EXT_MEMORY_REGIONS extension.
3186 *
3187 * Set the object with the desired set of placements/regions in priority
3188 * order. Each entry must be unique and supported by the device.
3189 *
3190 * This is provided as an array of struct drm_i915_gem_memory_class_instance, or
3191 * an equivalent layout of class:instance pair encodings. See struct
3192 * drm_i915_query_memory_regions and DRM_I915_QUERY_MEMORY_REGIONS for how to
3193 * query the supported regions for a device.
3194 *
3195 * As an example, on discrete devices, if we wish to set the placement as
3196 * device local-memory we can do something like:
3197 *
3198 * .. code-block:: C
3199 *
3200 * struct drm_i915_gem_memory_class_instance region_lmem = {
3201 * .memory_class = I915_MEMORY_CLASS_DEVICE,
3202 * .memory_instance = 0,
3203 * };
3204 * struct drm_i915_gem_create_ext_memory_regions regions = {
3205 * .base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
3206 * .regions = (uintptr_t)&region_lmem,
3207 * .num_regions = 1,
3208 * };
3209 * struct drm_i915_gem_create_ext create_ext = {
3210 * .size = 16 * PAGE_SIZE,
3211 * .extensions = (uintptr_t)&regions,
3212 * };
3213 *
3214 * int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
3215 * if (err) ...
3216 *
3217 * At which point we get the object handle in &drm_i915_gem_create_ext.handle,
3218 * along with the final object size in &drm_i915_gem_create_ext.size, which
3219 * should account for any rounding up, if required.
3220 */
3221struct drm_i915_gem_create_ext_memory_regions {
3222 /** @base: Extension link. See struct i915_user_extension. */
3223 struct i915_user_extension base;
3224
3225 /** @pad: MBZ */
3226 __u32 pad;
3227 /** @num_regions: Number of elements in the @regions array. */
3228 __u32 num_regions;
3229 /**
3230 * @regions: The regions/placements array.
3231 *
3232 * An array of struct drm_i915_gem_memory_class_instance.
3233 */
3234 __u64 regions;
3235};
3236
3237/**
3238 * struct drm_i915_gem_create_ext_protected_content - The
3239 * I915_OBJECT_PARAM_PROTECTED_CONTENT extension.
3240 *
3241 * If this extension is provided, buffer contents are expected to be protected
3242 * by PXP encryption and require decryption for scan out and processing. This
3243 * is only possible on platforms that have PXP enabled, on all other scenarios
3244 * using this extension will cause the ioctl to fail and return -ENODEV. The
3245 * flags parameter is reserved for future expansion and must currently be set
3246 * to zero.
3247 *
3248 * The buffer contents are considered invalid after a PXP session teardown.
3249 *
3250 * The encryption is guaranteed to be processed correctly only if the object
3251 * is submitted with a context created using the
3252 * I915_CONTEXT_PARAM_PROTECTED_CONTENT flag. This will also enable extra checks
3253 * at submission time on the validity of the objects involved.
3254 *
3255 * Below is an example on how to create a protected object:
3256 *
3257 * .. code-block:: C
3258 *
3259 * struct drm_i915_gem_create_ext_protected_content protected_ext = {
3260 * .base = { .name = I915_GEM_CREATE_EXT_PROTECTED_CONTENT },
3261 * .flags = 0,
3262 * };
3263 * struct drm_i915_gem_create_ext create_ext = {
3264 * .size = PAGE_SIZE,
3265 * .extensions = (uintptr_t)&protected_ext,
3266 * };
3267 *
3268 * int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
3269 * if (err) ...
3270 */
3271struct drm_i915_gem_create_ext_protected_content {
3272 /** @base: Extension link. See struct i915_user_extension. */
3273 struct i915_user_extension base;
3274 /** @flags: reserved for future usage, currently MBZ */
3275 __u32 flags;
3276};
3277
3278/* ID of the protected content session managed by i915 when PXP is active */
3279#define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
3280
3281#if defined(__cplusplus)
3282}
3283#endif
3284
3285#endif /* _I915_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/lima_drm.h created+176
...@@ -0,0 +1,176 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/* Copyright 2017-2018 Qiang Yu <yuq825@gmail.com> */
3
4#ifndef __LIMA_DRM_H__
5#define __LIMA_DRM_H__
6
7#include "drm.h"
8
9#if defined(__cplusplus)
10extern "C" {
11#endif
12
13enum drm_lima_param_gpu_id {
14 DRM_LIMA_PARAM_GPU_ID_UNKNOWN,
15 DRM_LIMA_PARAM_GPU_ID_MALI400,
16 DRM_LIMA_PARAM_GPU_ID_MALI450,
17};
18
19enum drm_lima_param {
20 DRM_LIMA_PARAM_GPU_ID,
21 DRM_LIMA_PARAM_NUM_PP,
22 DRM_LIMA_PARAM_GP_VERSION,
23 DRM_LIMA_PARAM_PP_VERSION,
24};
25
26/**
27 * get various information of the GPU
28 */
29struct drm_lima_get_param {
30 __u32 param; /* in, value in enum drm_lima_param */
31 __u32 pad; /* pad, must be zero */
32 __u64 value; /* out, parameter value */
33};
34
35/*
36 * heap buffer dynamically increase backup memory size when GP task fail
37 * due to lack of heap memory. size field of heap buffer is an up bound of
38 * the backup memory which can be set to a fairly large value.
39 */
40#define LIMA_BO_FLAG_HEAP (1 << 0)
41
42/**
43 * create a buffer for used by GPU
44 */
45struct drm_lima_gem_create {
46 __u32 size; /* in, buffer size */
47 __u32 flags; /* in, buffer flags */
48 __u32 handle; /* out, GEM buffer handle */
49 __u32 pad; /* pad, must be zero */
50};
51
52/**
53 * get information of a buffer
54 */
55struct drm_lima_gem_info {
56 __u32 handle; /* in, GEM buffer handle */
57 __u32 va; /* out, virtual address mapped into GPU MMU */
58 __u64 offset; /* out, used to mmap this buffer to CPU */
59};
60
61#define LIMA_SUBMIT_BO_READ 0x01
62#define LIMA_SUBMIT_BO_WRITE 0x02
63
64/* buffer information used by one task */
65struct drm_lima_gem_submit_bo {
66 __u32 handle; /* in, GEM buffer handle */
67 __u32 flags; /* in, buffer read/write by GPU */
68};
69
70#define LIMA_GP_FRAME_REG_NUM 6
71
72/* frame used to setup GP for each task */
73struct drm_lima_gp_frame {
74 __u32 frame[LIMA_GP_FRAME_REG_NUM];
75};
76
77#define LIMA_PP_FRAME_REG_NUM 23
78#define LIMA_PP_WB_REG_NUM 12
79
80/* frame used to setup mali400 GPU PP for each task */
81struct drm_lima_m400_pp_frame {
82 __u32 frame[LIMA_PP_FRAME_REG_NUM];
83 __u32 num_pp;
84 __u32 wb[3 * LIMA_PP_WB_REG_NUM];
85 __u32 plbu_array_address[4];
86 __u32 fragment_stack_address[4];
87};
88
89/* frame used to setup mali450 GPU PP for each task */
90struct drm_lima_m450_pp_frame {
91 __u32 frame[LIMA_PP_FRAME_REG_NUM];
92 __u32 num_pp;
93 __u32 wb[3 * LIMA_PP_WB_REG_NUM];
94 __u32 use_dlbu;
95 __u32 _pad;
96 union {
97 __u32 plbu_array_address[8];
98 __u32 dlbu_regs[4];
99 };
100 __u32 fragment_stack_address[8];
101};
102
103#define LIMA_PIPE_GP 0x00
104#define LIMA_PIPE_PP 0x01
105
106#define LIMA_SUBMIT_FLAG_EXPLICIT_FENCE (1 << 0)
107
108/**
109 * submit a task to GPU
110 *
111 * User can always merge multi sync_file and drm_syncobj
112 * into one drm_syncobj as in_sync[0], but we reserve
113 * in_sync[1] for another task's out_sync to avoid the
114 * export/import/merge pass when explicit sync.
115 */
116struct drm_lima_gem_submit {
117 __u32 ctx; /* in, context handle task is submitted to */
118 __u32 pipe; /* in, which pipe to use, GP/PP */
119 __u32 nr_bos; /* in, array length of bos field */
120 __u32 frame_size; /* in, size of frame field */
121 __u64 bos; /* in, array of drm_lima_gem_submit_bo */
122 __u64 frame; /* in, GP/PP frame */
123 __u32 flags; /* in, submit flags */
124 __u32 out_sync; /* in, drm_syncobj handle used to wait task finish after submission */
125 __u32 in_sync[2]; /* in, drm_syncobj handle used to wait before start this task */
126};
127
128#define LIMA_GEM_WAIT_READ 0x01
129#define LIMA_GEM_WAIT_WRITE 0x02
130
131/**
132 * wait pending GPU task finish of a buffer
133 */
134struct drm_lima_gem_wait {
135 __u32 handle; /* in, GEM buffer handle */
136 __u32 op; /* in, CPU want to read/write this buffer */
137 __s64 timeout_ns; /* in, wait timeout in absulute time */
138};
139
140/**
141 * create a context
142 */
143struct drm_lima_ctx_create {
144 __u32 id; /* out, context handle */
145 __u32 _pad; /* pad, must be zero */
146};
147
148/**
149 * free a context
150 */
151struct drm_lima_ctx_free {
152 __u32 id; /* in, context handle */
153 __u32 _pad; /* pad, must be zero */
154};
155
156#define DRM_LIMA_GET_PARAM 0x00
157#define DRM_LIMA_GEM_CREATE 0x01
158#define DRM_LIMA_GEM_INFO 0x02
159#define DRM_LIMA_GEM_SUBMIT 0x03
160#define DRM_LIMA_GEM_WAIT 0x04
161#define DRM_LIMA_CTX_CREATE 0x05
162#define DRM_LIMA_CTX_FREE 0x06
163
164#define DRM_IOCTL_LIMA_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GET_PARAM, struct drm_lima_get_param)
165#define DRM_IOCTL_LIMA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GEM_CREATE, struct drm_lima_gem_create)
166#define DRM_IOCTL_LIMA_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GEM_INFO, struct drm_lima_gem_info)
167#define DRM_IOCTL_LIMA_GEM_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_GEM_SUBMIT, struct drm_lima_gem_submit)
168#define DRM_IOCTL_LIMA_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_GEM_WAIT, struct drm_lima_gem_wait)
169#define DRM_IOCTL_LIMA_CTX_CREATE DRM_IOR(DRM_COMMAND_BASE + DRM_LIMA_CTX_CREATE, struct drm_lima_ctx_create)
170#define DRM_IOCTL_LIMA_CTX_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_CTX_FREE, struct drm_lima_ctx_free)
171
172#if defined(__cplusplus)
173}
174#endif
175
176#endif /* __LIMA_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/mga_drm.h created+429
...@@ -0,0 +1,429 @@
1/* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*-
2 * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
3 *
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Jeff Hartmann <jhartmann@valinux.com>
29 * Keith Whitwell <keith@tungstengraphics.com>
30 *
31 * Rewritten by:
32 * Gareth Hughes <gareth@valinux.com>
33 */
34
35#ifndef __MGA_DRM_H__
36#define __MGA_DRM_H__
37
38#include "drm.h"
39
40#if defined(__cplusplus)
41extern "C" {
42#endif
43
44/* WARNING: If you change any of these defines, make sure to change the
45 * defines in the Xserver file (mga_sarea.h)
46 */
47
48#ifndef __MGA_SAREA_DEFINES__
49#define __MGA_SAREA_DEFINES__
50
51/* WARP pipe flags
52 */
53#define MGA_F 0x1 /* fog */
54#define MGA_A 0x2 /* alpha */
55#define MGA_S 0x4 /* specular */
56#define MGA_T2 0x8 /* multitexture */
57
58#define MGA_WARP_TGZ 0
59#define MGA_WARP_TGZF (MGA_F)
60#define MGA_WARP_TGZA (MGA_A)
61#define MGA_WARP_TGZAF (MGA_F|MGA_A)
62#define MGA_WARP_TGZS (MGA_S)
63#define MGA_WARP_TGZSF (MGA_S|MGA_F)
64#define MGA_WARP_TGZSA (MGA_S|MGA_A)
65#define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A)
66#define MGA_WARP_T2GZ (MGA_T2)
67#define MGA_WARP_T2GZF (MGA_T2|MGA_F)
68#define MGA_WARP_T2GZA (MGA_T2|MGA_A)
69#define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F)
70#define MGA_WARP_T2GZS (MGA_T2|MGA_S)
71#define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F)
72#define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A)
73#define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A)
74
75#define MGA_MAX_G200_PIPES 8 /* no multitex */
76#define MGA_MAX_G400_PIPES 16
77#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
78#define MGA_WARP_UCODE_SIZE 32768 /* in bytes */
79
80#define MGA_CARD_TYPE_G200 1
81#define MGA_CARD_TYPE_G400 2
82#define MGA_CARD_TYPE_G450 3 /* not currently used */
83#define MGA_CARD_TYPE_G550 4
84
85#define MGA_FRONT 0x1
86#define MGA_BACK 0x2
87#define MGA_DEPTH 0x4
88
89/* What needs to be changed for the current vertex dma buffer?
90 */
91#define MGA_UPLOAD_CONTEXT 0x1
92#define MGA_UPLOAD_TEX0 0x2
93#define MGA_UPLOAD_TEX1 0x4
94#define MGA_UPLOAD_PIPE 0x8
95#define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
96#define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
97#define MGA_UPLOAD_2D 0x40
98#define MGA_WAIT_AGE 0x80 /* handled client-side */
99#define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
100#if 0
101#define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock
102 quiescent */
103#endif
104
105/* 32 buffers of 64k each, total 2 meg.
106 */
107#define MGA_BUFFER_SIZE (1 << 16)
108#define MGA_NUM_BUFFERS 128
109
110/* Keep these small for testing.
111 */
112#define MGA_NR_SAREA_CLIPRECTS 8
113
114/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
115 * regions, subject to a minimum region size of (1<<16) == 64k.
116 *
117 * Clients may subdivide regions internally, but when sharing between
118 * clients, the region size is the minimum granularity.
119 */
120
121#define MGA_CARD_HEAP 0
122#define MGA_AGP_HEAP 1
123#define MGA_NR_TEX_HEAPS 2
124#define MGA_NR_TEX_REGIONS 16
125#define MGA_LOG_MIN_TEX_REGION_SIZE 16
126
127#define DRM_MGA_IDLE_RETRY 2048
128
129#endif /* __MGA_SAREA_DEFINES__ */
130
131/* Setup registers for 3D context
132 */
133typedef struct {
134 unsigned int dstorg;
135 unsigned int maccess;
136 unsigned int plnwt;
137 unsigned int dwgctl;
138 unsigned int alphactrl;
139 unsigned int fogcolor;
140 unsigned int wflag;
141 unsigned int tdualstage0;
142 unsigned int tdualstage1;
143 unsigned int fcol;
144 unsigned int stencil;
145 unsigned int stencilctl;
146} drm_mga_context_regs_t;
147
148/* Setup registers for 2D, X server
149 */
150typedef struct {
151 unsigned int pitch;
152} drm_mga_server_regs_t;
153
154/* Setup registers for each texture unit
155 */
156typedef struct {
157 unsigned int texctl;
158 unsigned int texctl2;
159 unsigned int texfilter;
160 unsigned int texbordercol;
161 unsigned int texorg;
162 unsigned int texwidth;
163 unsigned int texheight;
164 unsigned int texorg1;
165 unsigned int texorg2;
166 unsigned int texorg3;
167 unsigned int texorg4;
168} drm_mga_texture_regs_t;
169
170/* General aging mechanism
171 */
172typedef struct {
173 unsigned int head; /* Position of head pointer */
174 unsigned int wrap; /* Primary DMA wrap count */
175} drm_mga_age_t;
176
177typedef struct _drm_mga_sarea {
178 /* The channel for communication of state information to the kernel
179 * on firing a vertex dma buffer.
180 */
181 drm_mga_context_regs_t context_state;
182 drm_mga_server_regs_t server_state;
183 drm_mga_texture_regs_t tex_state[2];
184 unsigned int warp_pipe;
185 unsigned int dirty;
186 unsigned int vertsize;
187
188 /* The current cliprects, or a subset thereof.
189 */
190 struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS];
191 unsigned int nbox;
192
193 /* Information about the most recently used 3d drawable. The
194 * client fills in the req_* fields, the server fills in the
195 * exported_ fields and puts the cliprects into boxes, above.
196 *
197 * The client clears the exported_drawable field before
198 * clobbering the boxes data.
199 */
200 unsigned int req_drawable; /* the X drawable id */
201 unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */
202
203 unsigned int exported_drawable;
204 unsigned int exported_index;
205 unsigned int exported_stamp;
206 unsigned int exported_buffers;
207 unsigned int exported_nfront;
208 unsigned int exported_nback;
209 int exported_back_x, exported_front_x, exported_w;
210 int exported_back_y, exported_front_y, exported_h;
211 struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS];
212
213 /* Counters for aging textures and for client-side throttling.
214 */
215 unsigned int status[4];
216 unsigned int last_wrap;
217
218 drm_mga_age_t last_frame;
219 unsigned int last_enqueue; /* last time a buffer was enqueued */
220 unsigned int last_dispatch; /* age of the most recently dispatched buffer */
221 unsigned int last_quiescent; /* */
222
223 /* LRU lists for texture memory in agp space and on the card.
224 */
225 struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1];
226 unsigned int texAge[MGA_NR_TEX_HEAPS];
227
228 /* Mechanism to validate card state.
229 */
230 int ctxOwner;
231} drm_mga_sarea_t;
232
233/* MGA specific ioctls
234 * The device specific ioctl range is 0x40 to 0x79.
235 */
236#define DRM_MGA_INIT 0x00
237#define DRM_MGA_FLUSH 0x01
238#define DRM_MGA_RESET 0x02
239#define DRM_MGA_SWAP 0x03
240#define DRM_MGA_CLEAR 0x04
241#define DRM_MGA_VERTEX 0x05
242#define DRM_MGA_INDICES 0x06
243#define DRM_MGA_ILOAD 0x07
244#define DRM_MGA_BLIT 0x08
245#define DRM_MGA_GETPARAM 0x09
246
247/* 3.2:
248 * ioctls for operating on fences.
249 */
250#define DRM_MGA_SET_FENCE 0x0a
251#define DRM_MGA_WAIT_FENCE 0x0b
252#define DRM_MGA_DMA_BOOTSTRAP 0x0c
253
254#define DRM_IOCTL_MGA_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
255#define DRM_IOCTL_MGA_FLUSH DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, struct drm_lock)
256#define DRM_IOCTL_MGA_RESET DRM_IO( DRM_COMMAND_BASE + DRM_MGA_RESET)
257#define DRM_IOCTL_MGA_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_MGA_SWAP)
258#define DRM_IOCTL_MGA_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
259#define DRM_IOCTL_MGA_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
260#define DRM_IOCTL_MGA_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
261#define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
262#define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
263#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
264#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
265#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
266#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
267
268typedef struct _drm_mga_warp_index {
269 int installed;
270 unsigned long phys_addr;
271 int size;
272} drm_mga_warp_index_t;
273
274typedef struct drm_mga_init {
275 enum {
276 MGA_INIT_DMA = 0x01,
277 MGA_CLEANUP_DMA = 0x02
278 } func;
279
280 unsigned long sarea_priv_offset;
281
282 __struct_group(/* no tag */, always32bit, /* no attrs */,
283 int chipset;
284 int sgram;
285
286 unsigned int maccess;
287
288 unsigned int fb_cpp;
289 unsigned int front_offset, front_pitch;
290 unsigned int back_offset, back_pitch;
291
292 unsigned int depth_cpp;
293 unsigned int depth_offset, depth_pitch;
294
295 unsigned int texture_offset[MGA_NR_TEX_HEAPS];
296 unsigned int texture_size[MGA_NR_TEX_HEAPS];
297 );
298
299 unsigned long fb_offset;
300 unsigned long mmio_offset;
301 unsigned long status_offset;
302 unsigned long warp_offset;
303 unsigned long primary_offset;
304 unsigned long buffers_offset;
305} drm_mga_init_t;
306
307typedef struct drm_mga_dma_bootstrap {
308 /**
309 * \name AGP texture region
310 *
311 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, these fields will
312 * be filled in with the actual AGP texture settings.
313 *
314 * \warning
315 * If these fields are non-zero, but dma_mga_dma_bootstrap::agp_mode
316 * is zero, it means that PCI memory (most likely through the use of
317 * an IOMMU) is being used for "AGP" textures.
318 */
319 /*@{ */
320 unsigned long texture_handle; /**< Handle used to map AGP textures. */
321 __u32 texture_size; /**< Size of the AGP texture region. */
322 /*@} */
323
324 /**
325 * Requested size of the primary DMA region.
326 *
327 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
328 * filled in with the actual AGP mode. If AGP was not available
329 */
330 __u32 primary_size;
331
332 /**
333 * Requested number of secondary DMA buffers.
334 *
335 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
336 * filled in with the actual number of secondary DMA buffers
337 * allocated. Particularly when PCI DMA is used, this may be
338 * (subtantially) less than the number requested.
339 */
340 __u32 secondary_bin_count;
341
342 /**
343 * Requested size of each secondary DMA buffer.
344 *
345 * While the kernel \b is free to reduce
346 * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
347 * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
348 */
349 __u32 secondary_bin_size;
350
351 /**
352 * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X,
353 * \c AGPSTAT2_2X, and \c AGPSTAT2_4X are supported. If this value is
354 * zero, it means that PCI DMA should be used, even if AGP is
355 * possible.
356 *
357 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
358 * filled in with the actual AGP mode. If AGP was not available
359 * (i.e., PCI DMA was used), this value will be zero.
360 */
361 __u32 agp_mode;
362
363 /**
364 * Desired AGP GART size, measured in megabytes.
365 */
366 __u8 agp_size;
367} drm_mga_dma_bootstrap_t;
368
369typedef struct drm_mga_clear {
370 unsigned int flags;
371 unsigned int clear_color;
372 unsigned int clear_depth;
373 unsigned int color_mask;
374 unsigned int depth_mask;
375} drm_mga_clear_t;
376
377typedef struct drm_mga_vertex {
378 int idx; /* buffer to queue */
379 int used; /* bytes in use */
380 int discard; /* client finished with buffer? */
381} drm_mga_vertex_t;
382
383typedef struct drm_mga_indices {
384 int idx; /* buffer to queue */
385 unsigned int start;
386 unsigned int end;
387 int discard; /* client finished with buffer? */
388} drm_mga_indices_t;
389
390typedef struct drm_mga_iload {
391 int idx;
392 unsigned int dstorg;
393 unsigned int length;
394} drm_mga_iload_t;
395
396typedef struct _drm_mga_blit {
397 unsigned int planemask;
398 unsigned int srcorg;
399 unsigned int dstorg;
400 int src_pitch, dst_pitch;
401 int delta_sx, delta_sy;
402 int delta_dx, delta_dy;
403 int height, ydir; /* flip image vertically */
404 int source_pitch, dest_pitch;
405} drm_mga_blit_t;
406
407/* 3.1: An ioctl to get parameters that aren't available to the 3d
408 * client any other way.
409 */
410#define MGA_PARAM_IRQ_NR 1
411
412/* 3.2: Query the actual card type. The DDX only distinguishes between
413 * G200 chips and non-G200 chips, which it calls G400. It turns out that
414 * there are some very sublte differences between the G4x0 chips and the G550
415 * chips. Using this parameter query, a client-side driver can detect the
416 * difference between a G4x0 and a G550.
417 */
418#define MGA_PARAM_CARD_TYPE 2
419
420typedef struct drm_mga_getparam {
421 int param;
422 void *value;
423} drm_mga_getparam_t;
424
425#if defined(__cplusplus)
426}
427#endif
428
429#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/msm_drm.h created+369
...@@ -0,0 +1,369 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef __MSM_DRM_H__
26#define __MSM_DRM_H__
27
28#include "drm.h"
29
30#if defined(__cplusplus)
31extern "C" {
32#endif
33
34/* Please note that modifications to all structs defined here are
35 * subject to backwards-compatibility constraints:
36 * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
37 * user/kernel compatibility
38 * 2) Keep fields aligned to their size
39 * 3) Because of how drm_ioctl() works, we can add new fields at
40 * the end of an ioctl if some care is taken: drm_ioctl() will
41 * zero out the new fields at the tail of the ioctl, so a zero
42 * value should have a backwards compatible meaning. And for
43 * output params, userspace won't see the newly added output
44 * fields.. so that has to be somehow ok.
45 */
46
47#define MSM_PIPE_NONE 0x00
48#define MSM_PIPE_2D0 0x01
49#define MSM_PIPE_2D1 0x02
50#define MSM_PIPE_3D0 0x10
51
52/* The pipe-id just uses the lower bits, so can be OR'd with flags in
53 * the upper 16 bits (which could be extended further, if needed, maybe
54 * we extend/overload the pipe-id some day to deal with multiple rings,
55 * but even then I don't think we need the full lower 16 bits).
56 */
57#define MSM_PIPE_ID_MASK 0xffff
58#define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK)
59#define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)
60
61/* timeouts are specified in clock-monotonic absolute times (to simplify
62 * restarting interrupted ioctls). The following struct is logically the
63 * same as 'struct timespec' but 32/64b ABI safe.
64 */
65struct drm_msm_timespec {
66 __s64 tv_sec; /* seconds */
67 __s64 tv_nsec; /* nanoseconds */
68};
69
70#define MSM_PARAM_GPU_ID 0x01
71#define MSM_PARAM_GMEM_SIZE 0x02
72#define MSM_PARAM_CHIP_ID 0x03
73#define MSM_PARAM_MAX_FREQ 0x04
74#define MSM_PARAM_TIMESTAMP 0x05
75#define MSM_PARAM_GMEM_BASE 0x06
76#define MSM_PARAM_PRIORITIES 0x07 /* The # of priority levels */
77#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
78#define MSM_PARAM_FAULTS 0x09
79#define MSM_PARAM_SUSPENDS 0x0a
80
81/* For backwards compat. The original support for preemption was based on
82 * a single ring per priority level so # of priority levels equals the #
83 * of rings. With drm/scheduler providing additional levels of priority,
84 * the number of priorities is greater than the # of rings. The param is
85 * renamed to better reflect this.
86 */
87#define MSM_PARAM_NR_RINGS MSM_PARAM_PRIORITIES
88
89struct drm_msm_param {
90 __u32 pipe; /* in, MSM_PIPE_x */
91 __u32 param; /* in, MSM_PARAM_x */
92 __u64 value; /* out (get_param) or in (set_param) */
93};
94
95/*
96 * GEM buffers:
97 */
98
99#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
100#define MSM_BO_GPU_READONLY 0x00000002
101#define MSM_BO_CACHE_MASK 0x000f0000
102/* cache modes */
103#define MSM_BO_CACHED 0x00010000
104#define MSM_BO_WC 0x00020000
105#define MSM_BO_UNCACHED 0x00040000 /* deprecated, use MSM_BO_WC */
106#define MSM_BO_CACHED_COHERENT 0x080000
107
108#define MSM_BO_FLAGS (MSM_BO_SCANOUT | \
109 MSM_BO_GPU_READONLY | \
110 MSM_BO_CACHE_MASK)
111
112struct drm_msm_gem_new {
113 __u64 size; /* in */
114 __u32 flags; /* in, mask of MSM_BO_x */
115 __u32 handle; /* out */
116};
117
118/* Get or set GEM buffer info. The requested value can be passed
119 * directly in 'value', or for data larger than 64b 'value' is a
120 * pointer to userspace buffer, with 'len' specifying the number of
121 * bytes copied into that buffer. For info returned by pointer,
122 * calling the GEM_INFO ioctl with null 'value' will return the
123 * required buffer size in 'len'
124 */
125#define MSM_INFO_GET_OFFSET 0x00 /* get mmap() offset, returned by value */
126#define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */
127#define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */
128#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */
129
130struct drm_msm_gem_info {
131 __u32 handle; /* in */
132 __u32 info; /* in - one of MSM_INFO_* */
133 __u64 value; /* in or out */
134 __u32 len; /* in or out */
135 __u32 pad;
136};
137
138#define MSM_PREP_READ 0x01
139#define MSM_PREP_WRITE 0x02
140#define MSM_PREP_NOSYNC 0x04
141
142#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
143
144struct drm_msm_gem_cpu_prep {
145 __u32 handle; /* in */
146 __u32 op; /* in, mask of MSM_PREP_x */
147 struct drm_msm_timespec timeout; /* in */
148};
149
150struct drm_msm_gem_cpu_fini {
151 __u32 handle; /* in */
152};
153
154/*
155 * Cmdstream Submission:
156 */
157
158/* The value written into the cmdstream is logically:
159 *
160 * ((relocbuf->gpuaddr + reloc_offset) << shift) | or
161 *
162 * When we have GPU's w/ >32bit ptrs, it should be possible to deal
163 * with this by emit'ing two reloc entries with appropriate shift
164 * values. Or a new MSM_SUBMIT_CMD_x type would also be an option.
165 *
166 * NOTE that reloc's must be sorted by order of increasing submit_offset,
167 * otherwise EINVAL.
168 */
169struct drm_msm_gem_submit_reloc {
170 __u32 submit_offset; /* in, offset from submit_bo */
171 __u32 or; /* in, value OR'd with result */
172 __s32 shift; /* in, amount of left shift (can be negative) */
173 __u32 reloc_idx; /* in, index of reloc_bo buffer */
174 __u64 reloc_offset; /* in, offset from start of reloc_bo */
175};
176
177/* submit-types:
178 * BUF - this cmd buffer is executed normally.
179 * IB_TARGET_BUF - this cmd buffer is an IB target. Reloc's are
180 * processed normally, but the kernel does not setup an IB to
181 * this buffer in the first-level ringbuffer
182 * CTX_RESTORE_BUF - only executed if there has been a GPU context
183 * switch since the last SUBMIT ioctl
184 */
185#define MSM_SUBMIT_CMD_BUF 0x0001
186#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
187#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
188struct drm_msm_gem_submit_cmd {
189 __u32 type; /* in, one of MSM_SUBMIT_CMD_x */
190 __u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
191 __u32 submit_offset; /* in, offset into submit_bo */
192 __u32 size; /* in, cmdstream size */
193 __u32 pad;
194 __u32 nr_relocs; /* in, number of submit_reloc's */
195 __u64 relocs; /* in, ptr to array of submit_reloc's */
196};
197
198/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
199 * cmdstream buffer(s) themselves or reloc entries) has one (and only
200 * one) entry in the submit->bos[] table.
201 *
202 * As a optimization, the current buffer (gpu virtual address) can be
203 * passed back through the 'presumed' field. If on a subsequent reloc,
204 * userspace passes back a 'presumed' address that is still valid,
205 * then patching the cmdstream for this entry is skipped. This can
206 * avoid kernel needing to map/access the cmdstream bo in the common
207 * case.
208 */
209#define MSM_SUBMIT_BO_READ 0x0001
210#define MSM_SUBMIT_BO_WRITE 0x0002
211#define MSM_SUBMIT_BO_DUMP 0x0004
212
213#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \
214 MSM_SUBMIT_BO_WRITE | \
215 MSM_SUBMIT_BO_DUMP)
216
217struct drm_msm_gem_submit_bo {
218 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
219 __u32 handle; /* in, GEM handle */
220 __u64 presumed; /* in/out, presumed buffer address */
221};
222
223/* Valid submit ioctl flags: */
224#define MSM_SUBMIT_NO_IMPLICIT 0x80000000 /* disable implicit sync */
225#define MSM_SUBMIT_FENCE_FD_IN 0x40000000 /* enable input fence_fd */
226#define MSM_SUBMIT_FENCE_FD_OUT 0x20000000 /* enable output fence_fd */
227#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */
228#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */
229#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */
230#define MSM_SUBMIT_FLAGS ( \
231 MSM_SUBMIT_NO_IMPLICIT | \
232 MSM_SUBMIT_FENCE_FD_IN | \
233 MSM_SUBMIT_FENCE_FD_OUT | \
234 MSM_SUBMIT_SUDO | \
235 MSM_SUBMIT_SYNCOBJ_IN | \
236 MSM_SUBMIT_SYNCOBJ_OUT | \
237 0)
238
239#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
240#define MSM_SUBMIT_SYNCOBJ_FLAGS ( \
241 MSM_SUBMIT_SYNCOBJ_RESET | \
242 0)
243
244struct drm_msm_gem_submit_syncobj {
245 __u32 handle; /* in, syncobj handle. */
246 __u32 flags; /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */
247 __u64 point; /* in, timepoint for timeline syncobjs. */
248};
249
250/* Each cmdstream submit consists of a table of buffers involved, and
251 * one or more cmdstream buffers. This allows for conditional execution
252 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
253 */
254struct drm_msm_gem_submit {
255 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
256 __u32 fence; /* out */
257 __u32 nr_bos; /* in, number of submit_bo's */
258 __u32 nr_cmds; /* in, number of submit_cmd's */
259 __u64 bos; /* in, ptr to array of submit_bo's */
260 __u64 cmds; /* in, ptr to array of submit_cmd's */
261 __s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
262 __u32 queueid; /* in, submitqueue id */
263 __u64 in_syncobjs; /* in, ptr to array of drm_msm_gem_submit_syncobj */
264 __u64 out_syncobjs; /* in, ptr to array of drm_msm_gem_submit_syncobj */
265 __u32 nr_in_syncobjs; /* in, number of entries in in_syncobj */
266 __u32 nr_out_syncobjs; /* in, number of entries in out_syncobj. */
267 __u32 syncobj_stride; /* in, stride of syncobj arrays. */
268 __u32 pad; /*in, reserved for future use, always 0. */
269
270};
271
272/* The normal way to synchronize with the GPU is just to CPU_PREP on
273 * a buffer if you need to access it from the CPU (other cmdstream
274 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
275 * handle the required synchronization under the hood). This ioctl
276 * mainly just exists as a way to implement the gallium pipe_fence
277 * APIs without requiring a dummy bo to synchronize on.
278 */
279struct drm_msm_wait_fence {
280 __u32 fence; /* in */
281 __u32 pad;
282 struct drm_msm_timespec timeout; /* in */
283 __u32 queueid; /* in, submitqueue id */
284};
285
286/* madvise provides a way to tell the kernel in case a buffers contents
287 * can be discarded under memory pressure, which is useful for userspace
288 * bo cache where we want to optimistically hold on to buffer allocate
289 * and potential mmap, but allow the pages to be discarded under memory
290 * pressure.
291 *
292 * Typical usage would involve madvise(DONTNEED) when buffer enters BO
293 * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
294 * In the WILLNEED case, 'retained' indicates to userspace whether the
295 * backing pages still exist.
296 */
297#define MSM_MADV_WILLNEED 0 /* backing pages are needed, status returned in 'retained' */
298#define MSM_MADV_DONTNEED 1 /* backing pages not needed */
299#define __MSM_MADV_PURGED 2 /* internal state */
300
301struct drm_msm_gem_madvise {
302 __u32 handle; /* in, GEM handle */
303 __u32 madv; /* in, MSM_MADV_x */
304 __u32 retained; /* out, whether backing store still exists */
305};
306
307/*
308 * Draw queues allow the user to set specific submission parameter. Command
309 * submissions specify a specific submitqueue to use. ID 0 is reserved for
310 * backwards compatibility as a "default" submitqueue
311 */
312
313#define MSM_SUBMITQUEUE_FLAGS (0)
314
315/*
316 * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,
317 * a lower numeric value is higher priority.
318 */
319struct drm_msm_submitqueue {
320 __u32 flags; /* in, MSM_SUBMITQUEUE_x */
321 __u32 prio; /* in, Priority level */
322 __u32 id; /* out, identifier */
323};
324
325#define MSM_SUBMITQUEUE_PARAM_FAULTS 0
326
327struct drm_msm_submitqueue_query {
328 __u64 data;
329 __u32 id;
330 __u32 param;
331 __u32 len;
332 __u32 pad;
333};
334
335#define DRM_MSM_GET_PARAM 0x00
336/* placeholder:
337#define DRM_MSM_SET_PARAM 0x01
338 */
339#define DRM_MSM_GEM_NEW 0x02
340#define DRM_MSM_GEM_INFO 0x03
341#define DRM_MSM_GEM_CPU_PREP 0x04
342#define DRM_MSM_GEM_CPU_FINI 0x05
343#define DRM_MSM_GEM_SUBMIT 0x06
344#define DRM_MSM_WAIT_FENCE 0x07
345#define DRM_MSM_GEM_MADVISE 0x08
346/* placeholder:
347#define DRM_MSM_GEM_SVM_NEW 0x09
348 */
349#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
350#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
351#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
352
353#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
354#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
355#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
356#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
357#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
358#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
359#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
360#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
361#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
362#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
363#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)
364
365#if defined(__cplusplus)
366}
367#endif
368
369#endif /* __MSM_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/nouveau_drm.h created+204
...@@ -0,0 +1,204 @@
1/*
2 * Copyright 2005 Stephane Marchesin.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef __NOUVEAU_DRM_H__
26#define __NOUVEAU_DRM_H__
27
28#define DRM_NOUVEAU_EVENT_NVIF 0x80000000
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
37#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
38#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
39#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
40#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
41
42#define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */
43#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
44#define NOUVEAU_GEM_TILE_16BPP 0x00000001
45#define NOUVEAU_GEM_TILE_32BPP 0x00000002
46#define NOUVEAU_GEM_TILE_ZETA 0x00000004
47#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
48
49struct drm_nouveau_gem_info {
50 __u32 handle;
51 __u32 domain;
52 __u64 size;
53 __u64 offset;
54 __u64 map_handle;
55 __u32 tile_mode;
56 __u32 tile_flags;
57};
58
59struct drm_nouveau_gem_new {
60 struct drm_nouveau_gem_info info;
61 __u32 channel_hint;
62 __u32 align;
63};
64
65#define NOUVEAU_GEM_MAX_BUFFERS 1024
66struct drm_nouveau_gem_pushbuf_bo_presumed {
67 __u32 valid;
68 __u32 domain;
69 __u64 offset;
70};
71
72struct drm_nouveau_gem_pushbuf_bo {
73 __u64 user_priv;
74 __u32 handle;
75 __u32 read_domains;
76 __u32 write_domains;
77 __u32 valid_domains;
78 struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
79};
80
81#define NOUVEAU_GEM_RELOC_LOW (1 << 0)
82#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
83#define NOUVEAU_GEM_RELOC_OR (1 << 2)
84#define NOUVEAU_GEM_MAX_RELOCS 1024
85struct drm_nouveau_gem_pushbuf_reloc {
86 __u32 reloc_bo_index;
87 __u32 reloc_bo_offset;
88 __u32 bo_index;
89 __u32 flags;
90 __u32 data;
91 __u32 vor;
92 __u32 tor;
93};
94
95#define NOUVEAU_GEM_MAX_PUSH 512
96struct drm_nouveau_gem_pushbuf_push {
97 __u32 bo_index;
98 __u32 pad;
99 __u64 offset;
100 __u64 length;
101};
102
103struct drm_nouveau_gem_pushbuf {
104 __u32 channel;
105 __u32 nr_buffers;
106 __u64 buffers;
107 __u32 nr_relocs;
108 __u32 nr_push;
109 __u64 relocs;
110 __u64 push;
111 __u32 suffix0;
112 __u32 suffix1;
113#define NOUVEAU_GEM_PUSHBUF_SYNC (1ULL << 0)
114 __u64 vram_available;
115 __u64 gart_available;
116};
117
118#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
119#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
120struct drm_nouveau_gem_cpu_prep {
121 __u32 handle;
122 __u32 flags;
123};
124
125struct drm_nouveau_gem_cpu_fini {
126 __u32 handle;
127};
128
129#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */
130#define DRM_NOUVEAU_SETPARAM 0x01 /* deprecated */
131#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02 /* deprecated */
132#define DRM_NOUVEAU_CHANNEL_FREE 0x03 /* deprecated */
133#define DRM_NOUVEAU_GROBJ_ALLOC 0x04 /* deprecated */
134#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05 /* deprecated */
135#define DRM_NOUVEAU_GPUOBJ_FREE 0x06 /* deprecated */
136#define DRM_NOUVEAU_NVIF 0x07
137#define DRM_NOUVEAU_SVM_INIT 0x08
138#define DRM_NOUVEAU_SVM_BIND 0x09
139#define DRM_NOUVEAU_GEM_NEW 0x40
140#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
141#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
142#define DRM_NOUVEAU_GEM_CPU_FINI 0x43
143#define DRM_NOUVEAU_GEM_INFO 0x44
144
145struct drm_nouveau_svm_init {
146 __u64 unmanaged_addr;
147 __u64 unmanaged_size;
148};
149
150struct drm_nouveau_svm_bind {
151 __u64 header;
152 __u64 va_start;
153 __u64 va_end;
154 __u64 npages;
155 __u64 stride;
156 __u64 result;
157 __u64 reserved0;
158 __u64 reserved1;
159};
160
161#define NOUVEAU_SVM_BIND_COMMAND_SHIFT 0
162#define NOUVEAU_SVM_BIND_COMMAND_BITS 8
163#define NOUVEAU_SVM_BIND_COMMAND_MASK ((1 << 8) - 1)
164#define NOUVEAU_SVM_BIND_PRIORITY_SHIFT 8
165#define NOUVEAU_SVM_BIND_PRIORITY_BITS 8
166#define NOUVEAU_SVM_BIND_PRIORITY_MASK ((1 << 8) - 1)
167#define NOUVEAU_SVM_BIND_TARGET_SHIFT 16
168#define NOUVEAU_SVM_BIND_TARGET_BITS 32
169#define NOUVEAU_SVM_BIND_TARGET_MASK 0xffffffff
170
171/*
172 * Below is use to validate ioctl argument, userspace can also use it to make
173 * sure that no bit are set beyond known fields for a given kernel version.
174 */
175#define NOUVEAU_SVM_BIND_VALID_BITS 48
176#define NOUVEAU_SVM_BIND_VALID_MASK ((1ULL << NOUVEAU_SVM_BIND_VALID_BITS) - 1)
177
178
179/*
180 * NOUVEAU_BIND_COMMAND__MIGRATE: synchronous migrate to target memory.
181 * result: number of page successfuly migrate to the target memory.
182 */
183#define NOUVEAU_SVM_BIND_COMMAND__MIGRATE 0
184
185/*
186 * NOUVEAU_SVM_BIND_HEADER_TARGET__GPU_VRAM: target the GPU VRAM memory.
187 */
188#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM (1UL << 31)
189
190
191#define DRM_IOCTL_NOUVEAU_SVM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_INIT, struct drm_nouveau_svm_init)
192#define DRM_IOCTL_NOUVEAU_SVM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_BIND, struct drm_nouveau_svm_bind)
193
194#define DRM_IOCTL_NOUVEAU_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_NEW, struct drm_nouveau_gem_new)
195#define DRM_IOCTL_NOUVEAU_GEM_PUSHBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_PUSHBUF, struct drm_nouveau_gem_pushbuf)
196#define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep)
197#define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
198#define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
199
200#if defined(__cplusplus)
201}
202#endif
203
204#endif /* __NOUVEAU_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/omap_drm.h created+126
...@@ -0,0 +1,126 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/uapi/drm/omap_drm.h
4 *
5 * Copyright (C) 2011 Texas Instruments
6 * Author: Rob Clark <rob@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __OMAP_DRM_H__
22#define __OMAP_DRM_H__
23
24#include "drm.h"
25
26#if defined(__cplusplus)
27extern "C" {
28#endif
29
30/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints.
32 */
33
34#define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */
35
36struct drm_omap_param {
37 __u64 param; /* in */
38 __u64 value; /* in (set_param), out (get_param) */
39};
40
41/* Scanout buffer, consumable by DSS */
42#define OMAP_BO_SCANOUT 0x00000001
43
44/* Buffer CPU caching mode: cached, write-combining or uncached. */
45#define OMAP_BO_CACHED 0x00000000
46#define OMAP_BO_WC 0x00000002
47#define OMAP_BO_UNCACHED 0x00000004
48#define OMAP_BO_CACHE_MASK 0x00000006
49
50/* Use TILER for the buffer. The TILER container unit can be 8, 16 or 32 bits. */
51#define OMAP_BO_TILED_8 0x00000100
52#define OMAP_BO_TILED_16 0x00000200
53#define OMAP_BO_TILED_32 0x00000300
54#define OMAP_BO_TILED_MASK 0x00000f00
55
56union omap_gem_size {
57 __u32 bytes; /* (for non-tiled formats) */
58 struct {
59 __u16 width;
60 __u16 height;
61 } tiled; /* (for tiled formats) */
62};
63
64struct drm_omap_gem_new {
65 union omap_gem_size size; /* in */
66 __u32 flags; /* in */
67 __u32 handle; /* out */
68 __u32 __pad;
69};
70
71/* mask of operations: */
72enum omap_gem_op {
73 OMAP_GEM_READ = 0x01,
74 OMAP_GEM_WRITE = 0x02,
75};
76
77struct drm_omap_gem_cpu_prep {
78 __u32 handle; /* buffer handle (in) */
79 __u32 op; /* mask of omap_gem_op (in) */
80};
81
82struct drm_omap_gem_cpu_fini {
83 __u32 handle; /* buffer handle (in) */
84 __u32 op; /* mask of omap_gem_op (in) */
85 /* TODO maybe here we pass down info about what regions are touched
86 * by sw so we can be clever about cache ops? For now a placeholder,
87 * set to zero and we just do full buffer flush..
88 */
89 __u32 nregions;
90 __u32 __pad;
91};
92
93struct drm_omap_gem_info {
94 __u32 handle; /* buffer handle (in) */
95 __u32 pad;
96 __u64 offset; /* mmap offset (out) */
97 /* note: in case of tiled buffers, the user virtual size can be
98 * different from the physical size (ie. how many pages are needed
99 * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
100 * This size here is the one that should be used if you want to
101 * mmap() the buffer:
102 */
103 __u32 size; /* virtual size for mmap'ing (out) */
104 __u32 __pad;
105};
106
107#define DRM_OMAP_GET_PARAM 0x00
108#define DRM_OMAP_SET_PARAM 0x01
109#define DRM_OMAP_GEM_NEW 0x03
110#define DRM_OMAP_GEM_CPU_PREP 0x04 /* Deprecated, to be removed */
111#define DRM_OMAP_GEM_CPU_FINI 0x05 /* Deprecated, to be removed */
112#define DRM_OMAP_GEM_INFO 0x06
113#define DRM_OMAP_NUM_IOCTLS 0x07
114
115#define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param)
116#define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param)
117#define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new)
118#define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep)
119#define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
120#define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
121
122#if defined(__cplusplus)
123}
124#endif
125
126#endif /* __OMAP_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/panfrost_drm.h created+231
...@@ -0,0 +1,231 @@
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2014-2018 Broadcom
4 * Copyright © 2019 Collabora ltd.
5 */
6#ifndef _PANFROST_DRM_H_
7#define _PANFROST_DRM_H_
8
9#include "drm.h"
10
11#if defined(__cplusplus)
12extern "C" {
13#endif
14
15#define DRM_PANFROST_SUBMIT 0x00
16#define DRM_PANFROST_WAIT_BO 0x01
17#define DRM_PANFROST_CREATE_BO 0x02
18#define DRM_PANFROST_MMAP_BO 0x03
19#define DRM_PANFROST_GET_PARAM 0x04
20#define DRM_PANFROST_GET_BO_OFFSET 0x05
21#define DRM_PANFROST_PERFCNT_ENABLE 0x06
22#define DRM_PANFROST_PERFCNT_DUMP 0x07
23#define DRM_PANFROST_MADVISE 0x08
24
25#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
26#define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
27#define DRM_IOCTL_PANFROST_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_CREATE_BO, struct drm_panfrost_create_bo)
28#define DRM_IOCTL_PANFROST_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MMAP_BO, struct drm_panfrost_mmap_bo)
29#define DRM_IOCTL_PANFROST_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_PARAM, struct drm_panfrost_get_param)
30#define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
31#define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
32
33/*
34 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
35 * param is set to true.
36 * All these ioctl(s) are subject to deprecation, so please don't rely on
37 * them for anything but debugging purpose.
38 */
39#define DRM_IOCTL_PANFROST_PERFCNT_ENABLE DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_ENABLE, struct drm_panfrost_perfcnt_enable)
40#define DRM_IOCTL_PANFROST_PERFCNT_DUMP DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_DUMP, struct drm_panfrost_perfcnt_dump)
41
42#define PANFROST_JD_REQ_FS (1 << 0)
43/**
44 * struct drm_panfrost_submit - ioctl argument for submitting commands to the 3D
45 * engine.
46 *
47 * This asks the kernel to have the GPU execute a render command list.
48 */
49struct drm_panfrost_submit {
50
51 /** Address to GPU mapping of job descriptor */
52 __u64 jc;
53
54 /** An optional array of sync objects to wait on before starting this job. */
55 __u64 in_syncs;
56
57 /** Number of sync objects to wait on before starting this job. */
58 __u32 in_sync_count;
59
60 /** An optional sync object to place the completion fence in. */
61 __u32 out_sync;
62
63 /** Pointer to a u32 array of the BOs that are referenced by the job. */
64 __u64 bo_handles;
65
66 /** Number of BO handles passed in (size is that times 4). */
67 __u32 bo_handle_count;
68
69 /** A combination of PANFROST_JD_REQ_* */
70 __u32 requirements;
71};
72
73/**
74 * struct drm_panfrost_wait_bo - ioctl argument for waiting for
75 * completion of the last DRM_PANFROST_SUBMIT on a BO.
76 *
77 * This is useful for cases where multiple processes might be
78 * rendering to a BO and you want to wait for all rendering to be
79 * completed.
80 */
81struct drm_panfrost_wait_bo {
82 __u32 handle;
83 __u32 pad;
84 __s64 timeout_ns; /* absolute */
85};
86
87#define PANFROST_BO_NOEXEC 1
88#define PANFROST_BO_HEAP 2
89
90/**
91 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
92 *
93 * There are currently no values for the flags argument, but it may be
94 * used in a future extension.
95 */
96struct drm_panfrost_create_bo {
97 __u32 size;
98 __u32 flags;
99 /** Returned GEM handle for the BO. */
100 __u32 handle;
101 /* Pad, must be zero-filled. */
102 __u32 pad;
103 /**
104 * Returned offset for the BO in the GPU address space. This offset
105 * is private to the DRM fd and is valid for the lifetime of the GEM
106 * handle.
107 *
108 * This offset value will always be nonzero, since various HW
109 * units treat 0 specially.
110 */
111 __u64 offset;
112};
113
114/**
115 * struct drm_panfrost_mmap_bo - ioctl argument for mapping Panfrost BOs.
116 *
117 * This doesn't actually perform an mmap. Instead, it returns the
118 * offset you need to use in an mmap on the DRM device node. This
119 * means that tools like valgrind end up knowing about the mapped
120 * memory.
121 *
122 * There are currently no values for the flags argument, but it may be
123 * used in a future extension.
124 */
125struct drm_panfrost_mmap_bo {
126 /** Handle for the object being mapped. */
127 __u32 handle;
128 __u32 flags;
129 /** offset into the drm node to use for subsequent mmap call. */
130 __u64 offset;
131};
132
133enum drm_panfrost_param {
134 DRM_PANFROST_PARAM_GPU_PROD_ID,
135 DRM_PANFROST_PARAM_GPU_REVISION,
136 DRM_PANFROST_PARAM_SHADER_PRESENT,
137 DRM_PANFROST_PARAM_TILER_PRESENT,
138 DRM_PANFROST_PARAM_L2_PRESENT,
139 DRM_PANFROST_PARAM_STACK_PRESENT,
140 DRM_PANFROST_PARAM_AS_PRESENT,
141 DRM_PANFROST_PARAM_JS_PRESENT,
142 DRM_PANFROST_PARAM_L2_FEATURES,
143 DRM_PANFROST_PARAM_CORE_FEATURES,
144 DRM_PANFROST_PARAM_TILER_FEATURES,
145 DRM_PANFROST_PARAM_MEM_FEATURES,
146 DRM_PANFROST_PARAM_MMU_FEATURES,
147 DRM_PANFROST_PARAM_THREAD_FEATURES,
148 DRM_PANFROST_PARAM_MAX_THREADS,
149 DRM_PANFROST_PARAM_THREAD_MAX_WORKGROUP_SZ,
150 DRM_PANFROST_PARAM_THREAD_MAX_BARRIER_SZ,
151 DRM_PANFROST_PARAM_COHERENCY_FEATURES,
152 DRM_PANFROST_PARAM_TEXTURE_FEATURES0,
153 DRM_PANFROST_PARAM_TEXTURE_FEATURES1,
154 DRM_PANFROST_PARAM_TEXTURE_FEATURES2,
155 DRM_PANFROST_PARAM_TEXTURE_FEATURES3,
156 DRM_PANFROST_PARAM_JS_FEATURES0,
157 DRM_PANFROST_PARAM_JS_FEATURES1,
158 DRM_PANFROST_PARAM_JS_FEATURES2,
159 DRM_PANFROST_PARAM_JS_FEATURES3,
160 DRM_PANFROST_PARAM_JS_FEATURES4,
161 DRM_PANFROST_PARAM_JS_FEATURES5,
162 DRM_PANFROST_PARAM_JS_FEATURES6,
163 DRM_PANFROST_PARAM_JS_FEATURES7,
164 DRM_PANFROST_PARAM_JS_FEATURES8,
165 DRM_PANFROST_PARAM_JS_FEATURES9,
166 DRM_PANFROST_PARAM_JS_FEATURES10,
167 DRM_PANFROST_PARAM_JS_FEATURES11,
168 DRM_PANFROST_PARAM_JS_FEATURES12,
169 DRM_PANFROST_PARAM_JS_FEATURES13,
170 DRM_PANFROST_PARAM_JS_FEATURES14,
171 DRM_PANFROST_PARAM_JS_FEATURES15,
172 DRM_PANFROST_PARAM_NR_CORE_GROUPS,
173 DRM_PANFROST_PARAM_THREAD_TLS_ALLOC,
174 DRM_PANFROST_PARAM_AFBC_FEATURES,
175};
176
177struct drm_panfrost_get_param {
178 __u32 param;
179 __u32 pad;
180 __u64 value;
181};
182
183/**
184 * Returns the offset for the BO in the GPU address space for this DRM fd.
185 * This is the same value returned by drm_panfrost_create_bo, if that was called
186 * from this DRM fd.
187 */
188struct drm_panfrost_get_bo_offset {
189 __u32 handle;
190 __u32 pad;
191 __u64 offset;
192};
193
194struct drm_panfrost_perfcnt_enable {
195 __u32 enable;
196 /*
197 * On bifrost we have 2 sets of counters, this parameter defines the
198 * one to track.
199 */
200 __u32 counterset;
201};
202
203struct drm_panfrost_perfcnt_dump {
204 __u64 buf_ptr;
205};
206
207/* madvise provides a way to tell the kernel in case a buffers contents
208 * can be discarded under memory pressure, which is useful for userspace
209 * bo cache where we want to optimistically hold on to buffer allocate
210 * and potential mmap, but allow the pages to be discarded under memory
211 * pressure.
212 *
213 * Typical usage would involve madvise(DONTNEED) when buffer enters BO
214 * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
215 * In the WILLNEED case, 'retained' indicates to userspace whether the
216 * backing pages still exist.
217 */
218#define PANFROST_MADV_WILLNEED 0 /* backing pages are needed, status returned in 'retained' */
219#define PANFROST_MADV_DONTNEED 1 /* backing pages not needed */
220
221struct drm_panfrost_madvise {
222 __u32 handle; /* in, GEM handle */
223 __u32 madv; /* in, PANFROST_MADV_x */
224 __u32 retained; /* out, whether backing store still exists */
225};
226
227#if defined(__cplusplus)
228}
229#endif
230
231#endif /* _PANFROST_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/qxl_drm.h created+158
...@@ -0,0 +1,158 @@
1/*
2 * Copyright 2013 Red Hat
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef QXL_DRM_H
25#define QXL_DRM_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* Please note that modifications to all structs defined here are
34 * subject to backwards-compatibility constraints.
35 *
36 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
37 * compatibility Keep fields aligned to their size
38 */
39
40#define QXL_GEM_DOMAIN_CPU 0
41#define QXL_GEM_DOMAIN_VRAM 1
42#define QXL_GEM_DOMAIN_SURFACE 2
43
44#define DRM_QXL_ALLOC 0x00
45#define DRM_QXL_MAP 0x01
46#define DRM_QXL_EXECBUFFER 0x02
47#define DRM_QXL_UPDATE_AREA 0x03
48#define DRM_QXL_GETPARAM 0x04
49#define DRM_QXL_CLIENTCAP 0x05
50
51#define DRM_QXL_ALLOC_SURF 0x06
52
53struct drm_qxl_alloc {
54 __u32 size;
55 __u32 handle; /* 0 is an invalid handle */
56};
57
58struct drm_qxl_map {
59 __u64 offset; /* use for mmap system call */
60 __u32 handle;
61 __u32 pad;
62};
63
64/*
65 * dest is the bo we are writing the relocation into
66 * src is bo we are relocating.
67 * *(dest_handle.base_addr + dest_offset) = physical_address(src_handle.addr +
68 * src_offset)
69 */
70#define QXL_RELOC_TYPE_BO 1
71#define QXL_RELOC_TYPE_SURF 2
72
73struct drm_qxl_reloc {
74 __u64 src_offset; /* offset into src_handle or src buffer */
75 __u64 dst_offset; /* offset in dest handle */
76 __u32 src_handle; /* dest handle to compute address from */
77 __u32 dst_handle; /* 0 if to command buffer */
78 __u32 reloc_type;
79 __u32 pad;
80};
81
82struct drm_qxl_command {
83 __u64 command; /* void* */
84 __u64 relocs; /* struct drm_qxl_reloc* */
85 __u32 type;
86 __u32 command_size;
87 __u32 relocs_num;
88 __u32 pad;
89};
90
91struct drm_qxl_execbuffer {
92 __u32 flags; /* for future use */
93 __u32 commands_num;
94 __u64 commands; /* struct drm_qxl_command* */
95};
96
97struct drm_qxl_update_area {
98 __u32 handle;
99 __u32 top;
100 __u32 left;
101 __u32 bottom;
102 __u32 right;
103 __u32 pad;
104};
105
106#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
107#define QXL_PARAM_MAX_RELOCS 2
108struct drm_qxl_getparam {
109 __u64 param;
110 __u64 value;
111};
112
113/* these are one bit values */
114struct drm_qxl_clientcap {
115 __u32 index;
116 __u32 pad;
117};
118
119struct drm_qxl_alloc_surf {
120 __u32 format;
121 __u32 width;
122 __u32 height;
123 __s32 stride;
124 __u32 handle;
125 __u32 pad;
126};
127
128#define DRM_IOCTL_QXL_ALLOC \
129 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc)
130
131#define DRM_IOCTL_QXL_MAP \
132 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map)
133
134#define DRM_IOCTL_QXL_EXECBUFFER \
135 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\
136 struct drm_qxl_execbuffer)
137
138#define DRM_IOCTL_QXL_UPDATE_AREA \
139 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\
140 struct drm_qxl_update_area)
141
142#define DRM_IOCTL_QXL_GETPARAM \
143 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\
144 struct drm_qxl_getparam)
145
146#define DRM_IOCTL_QXL_CLIENTCAP \
147 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\
148 struct drm_qxl_clientcap)
149
150#define DRM_IOCTL_QXL_ALLOC_SURF \
151 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
152 struct drm_qxl_alloc_surf)
153
154#if defined(__cplusplus)
155}
156#endif
157
158#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/r128_drm.h created+336
...@@ -0,0 +1,336 @@
1/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
2 * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
3 */
4/*
5 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
7 * All rights reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 * Authors:
29 * Gareth Hughes <gareth@valinux.com>
30 * Kevin E. Martin <martin@valinux.com>
31 */
32
33#ifndef __R128_DRM_H__
34#define __R128_DRM_H__
35
36#include "drm.h"
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42/* WARNING: If you change any of these defines, make sure to change the
43 * defines in the X server file (r128_sarea.h)
44 */
45#ifndef __R128_SAREA_DEFINES__
46#define __R128_SAREA_DEFINES__
47
48/* What needs to be changed for the current vertex buffer?
49 */
50#define R128_UPLOAD_CONTEXT 0x001
51#define R128_UPLOAD_SETUP 0x002
52#define R128_UPLOAD_TEX0 0x004
53#define R128_UPLOAD_TEX1 0x008
54#define R128_UPLOAD_TEX0IMAGES 0x010
55#define R128_UPLOAD_TEX1IMAGES 0x020
56#define R128_UPLOAD_CORE 0x040
57#define R128_UPLOAD_MASKS 0x080
58#define R128_UPLOAD_WINDOW 0x100
59#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
60#define R128_REQUIRE_QUIESCENCE 0x400
61#define R128_UPLOAD_ALL 0x7ff
62
63#define R128_FRONT 0x1
64#define R128_BACK 0x2
65#define R128_DEPTH 0x4
66
67/* Primitive types
68 */
69#define R128_POINTS 0x1
70#define R128_LINES 0x2
71#define R128_LINE_STRIP 0x3
72#define R128_TRIANGLES 0x4
73#define R128_TRIANGLE_FAN 0x5
74#define R128_TRIANGLE_STRIP 0x6
75
76/* Vertex/indirect buffer size
77 */
78#define R128_BUFFER_SIZE 16384
79
80/* Byte offsets for indirect buffer data
81 */
82#define R128_INDEX_PRIM_OFFSET 20
83#define R128_HOSTDATA_BLIT_OFFSET 32
84
85/* Keep these small for testing.
86 */
87#define R128_NR_SAREA_CLIPRECTS 12
88
89/* There are 2 heaps (local/AGP). Each region within a heap is a
90 * minimum of 64k, and there are at most 64 of them per heap.
91 */
92#define R128_LOCAL_TEX_HEAP 0
93#define R128_AGP_TEX_HEAP 1
94#define R128_NR_TEX_HEAPS 2
95#define R128_NR_TEX_REGIONS 64
96#define R128_LOG_TEX_GRANULARITY 16
97
98#define R128_NR_CONTEXT_REGS 12
99
100#define R128_MAX_TEXTURE_LEVELS 11
101#define R128_MAX_TEXTURE_UNITS 2
102
103#endif /* __R128_SAREA_DEFINES__ */
104
105typedef struct {
106 /* Context state - can be written in one large chunk */
107 unsigned int dst_pitch_offset_c;
108 unsigned int dp_gui_master_cntl_c;
109 unsigned int sc_top_left_c;
110 unsigned int sc_bottom_right_c;
111 unsigned int z_offset_c;
112 unsigned int z_pitch_c;
113 unsigned int z_sten_cntl_c;
114 unsigned int tex_cntl_c;
115 unsigned int misc_3d_state_cntl_reg;
116 unsigned int texture_clr_cmp_clr_c;
117 unsigned int texture_clr_cmp_msk_c;
118 unsigned int fog_color_c;
119
120 /* Texture state */
121 unsigned int tex_size_pitch_c;
122 unsigned int constant_color_c;
123
124 /* Setup state */
125 unsigned int pm4_vc_fpu_setup;
126 unsigned int setup_cntl;
127
128 /* Mask state */
129 unsigned int dp_write_mask;
130 unsigned int sten_ref_mask_c;
131 unsigned int plane_3d_mask_c;
132
133 /* Window state */
134 unsigned int window_xy_offset;
135
136 /* Core state */
137 unsigned int scale_3d_cntl;
138} drm_r128_context_regs_t;
139
140/* Setup registers for each texture unit
141 */
142typedef struct {
143 unsigned int tex_cntl;
144 unsigned int tex_combine_cntl;
145 unsigned int tex_size_pitch;
146 unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
147 unsigned int tex_border_color;
148} drm_r128_texture_regs_t;
149
150typedef struct drm_r128_sarea {
151 /* The channel for communication of state information to the kernel
152 * on firing a vertex buffer.
153 */
154 drm_r128_context_regs_t context_state;
155 drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
156 unsigned int dirty;
157 unsigned int vertsize;
158 unsigned int vc_format;
159
160 /* The current cliprects, or a subset thereof.
161 */
162 struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
163 unsigned int nbox;
164
165 /* Counters for client-side throttling of rendering clients.
166 */
167 unsigned int last_frame;
168 unsigned int last_dispatch;
169
170 struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
171 unsigned int tex_age[R128_NR_TEX_HEAPS];
172 int ctx_owner;
173 int pfAllowPageFlip; /* number of 3d windows (0,1,2 or more) */
174 int pfCurrentPage; /* which buffer is being displayed? */
175} drm_r128_sarea_t;
176
177/* WARNING: If you change any of these defines, make sure to change the
178 * defines in the Xserver file (xf86drmR128.h)
179 */
180
181/* Rage 128 specific ioctls
182 * The device specific ioctl range is 0x40 to 0x79.
183 */
184#define DRM_R128_INIT 0x00
185#define DRM_R128_CCE_START 0x01
186#define DRM_R128_CCE_STOP 0x02
187#define DRM_R128_CCE_RESET 0x03
188#define DRM_R128_CCE_IDLE 0x04
189/* 0x05 not used */
190#define DRM_R128_RESET 0x06
191#define DRM_R128_SWAP 0x07
192#define DRM_R128_CLEAR 0x08
193#define DRM_R128_VERTEX 0x09
194#define DRM_R128_INDICES 0x0a
195#define DRM_R128_BLIT 0x0b
196#define DRM_R128_DEPTH 0x0c
197#define DRM_R128_STIPPLE 0x0d
198/* 0x0e not used */
199#define DRM_R128_INDIRECT 0x0f
200#define DRM_R128_FULLSCREEN 0x10
201#define DRM_R128_CLEAR2 0x11
202#define DRM_R128_GETPARAM 0x12
203#define DRM_R128_FLIP 0x13
204
205#define DRM_IOCTL_R128_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
206#define DRM_IOCTL_R128_CCE_START DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_START)
207#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
208#define DRM_IOCTL_R128_CCE_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
209#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
210/* 0x05 not used */
211#define DRM_IOCTL_R128_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_RESET)
212#define DRM_IOCTL_R128_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_R128_SWAP)
213#define DRM_IOCTL_R128_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
214#define DRM_IOCTL_R128_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
215#define DRM_IOCTL_R128_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
216#define DRM_IOCTL_R128_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
217#define DRM_IOCTL_R128_DEPTH DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
218#define DRM_IOCTL_R128_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
219/* 0x0e not used */
220#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
221#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
222#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
223#define DRM_IOCTL_R128_GETPARAM DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
224#define DRM_IOCTL_R128_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_R128_FLIP)
225
226typedef struct drm_r128_init {
227 enum {
228 R128_INIT_CCE = 0x01,
229 R128_CLEANUP_CCE = 0x02
230 } func;
231 unsigned long sarea_priv_offset;
232 int is_pci;
233 int cce_mode;
234 int cce_secure;
235 int ring_size;
236 int usec_timeout;
237
238 unsigned int fb_bpp;
239 unsigned int front_offset, front_pitch;
240 unsigned int back_offset, back_pitch;
241 unsigned int depth_bpp;
242 unsigned int depth_offset, depth_pitch;
243 unsigned int span_offset;
244
245 unsigned long fb_offset;
246 unsigned long mmio_offset;
247 unsigned long ring_offset;
248 unsigned long ring_rptr_offset;
249 unsigned long buffers_offset;
250 unsigned long agp_textures_offset;
251} drm_r128_init_t;
252
253typedef struct drm_r128_cce_stop {
254 int flush;
255 int idle;
256} drm_r128_cce_stop_t;
257
258typedef struct drm_r128_clear {
259 unsigned int flags;
260 unsigned int clear_color;
261 unsigned int clear_depth;
262 unsigned int color_mask;
263 unsigned int depth_mask;
264} drm_r128_clear_t;
265
266typedef struct drm_r128_vertex {
267 int prim;
268 int idx; /* Index of vertex buffer */
269 int count; /* Number of vertices in buffer */
270 int discard; /* Client finished with buffer? */
271} drm_r128_vertex_t;
272
273typedef struct drm_r128_indices {
274 int prim;
275 int idx;
276 int start;
277 int end;
278 int discard; /* Client finished with buffer? */
279} drm_r128_indices_t;
280
281typedef struct drm_r128_blit {
282 int idx;
283 int pitch;
284 int offset;
285 int format;
286 unsigned short x, y;
287 unsigned short width, height;
288} drm_r128_blit_t;
289
290typedef struct drm_r128_depth {
291 enum {
292 R128_WRITE_SPAN = 0x01,
293 R128_WRITE_PIXELS = 0x02,
294 R128_READ_SPAN = 0x03,
295 R128_READ_PIXELS = 0x04
296 } func;
297 int n;
298 int *x;
299 int *y;
300 unsigned int *buffer;
301 unsigned char *mask;
302} drm_r128_depth_t;
303
304typedef struct drm_r128_stipple {
305 unsigned int *mask;
306} drm_r128_stipple_t;
307
308typedef struct drm_r128_indirect {
309 int idx;
310 int start;
311 int end;
312 int discard;
313} drm_r128_indirect_t;
314
315typedef struct drm_r128_fullscreen {
316 enum {
317 R128_INIT_FULLSCREEN = 0x01,
318 R128_CLEANUP_FULLSCREEN = 0x02
319 } func;
320} drm_r128_fullscreen_t;
321
322/* 2.3: An ioctl to get parameters that aren't available to the 3d
323 * client any other way.
324 */
325#define R128_PARAM_IRQ_NR 1
326
327typedef struct drm_r128_getparam {
328 int param;
329 void *value;
330} drm_r128_getparam_t;
331
332#if defined(__cplusplus)
333}
334#endif
335
336#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/radeon_drm.h created+1078
...@@ -0,0 +1,1078 @@
1/* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*-
2 *
3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
5 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Kevin E. Martin <martin@valinux.com>
29 * Gareth Hughes <gareth@valinux.com>
30 * Keith Whitwell <keith@tungstengraphics.com>
31 */
32
33#ifndef __RADEON_DRM_H__
34#define __RADEON_DRM_H__
35
36#include "drm.h"
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42/* WARNING: If you change any of these defines, make sure to change the
43 * defines in the X server file (radeon_sarea.h)
44 */
45#ifndef __RADEON_SAREA_DEFINES__
46#define __RADEON_SAREA_DEFINES__
47
48/* Old style state flags, required for sarea interface (1.1 and 1.2
49 * clears) and 1.2 drm_vertex2 ioctl.
50 */
51#define RADEON_UPLOAD_CONTEXT 0x00000001
52#define RADEON_UPLOAD_VERTFMT 0x00000002
53#define RADEON_UPLOAD_LINE 0x00000004
54#define RADEON_UPLOAD_BUMPMAP 0x00000008
55#define RADEON_UPLOAD_MASKS 0x00000010
56#define RADEON_UPLOAD_VIEWPORT 0x00000020
57#define RADEON_UPLOAD_SETUP 0x00000040
58#define RADEON_UPLOAD_TCL 0x00000080
59#define RADEON_UPLOAD_MISC 0x00000100
60#define RADEON_UPLOAD_TEX0 0x00000200
61#define RADEON_UPLOAD_TEX1 0x00000400
62#define RADEON_UPLOAD_TEX2 0x00000800
63#define RADEON_UPLOAD_TEX0IMAGES 0x00001000
64#define RADEON_UPLOAD_TEX1IMAGES 0x00002000
65#define RADEON_UPLOAD_TEX2IMAGES 0x00004000
66#define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */
67#define RADEON_REQUIRE_QUIESCENCE 0x00010000
68#define RADEON_UPLOAD_ZBIAS 0x00020000 /* version 1.2 and newer */
69#define RADEON_UPLOAD_ALL 0x003effff
70#define RADEON_UPLOAD_CONTEXT_ALL 0x003e01ff
71
72/* New style per-packet identifiers for use in cmd_buffer ioctl with
73 * the RADEON_EMIT_PACKET command. Comments relate new packets to old
74 * state bits and the packet size:
75 */
76#define RADEON_EMIT_PP_MISC 0 /* context/7 */
77#define RADEON_EMIT_PP_CNTL 1 /* context/3 */
78#define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
79#define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
80#define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
81#define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
82#define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
83#define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
84#define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
85#define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
86#define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
87#define RADEON_EMIT_RE_MISC 11 /* misc/1 */
88#define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
89#define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
90#define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
91#define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
92#define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
93#define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
94#define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
95#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
96#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
97#define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
98#define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
99#define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
100#define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
101#define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
102#define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
103#define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
104#define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
105#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/7 */
106#define R200_EMIT_TFACTOR_0 30 /* tf/7 */
107#define R200_EMIT_VTX_FMT_0 31 /* vtx/5 */
108#define R200_EMIT_VAP_CTL 32 /* vap/1 */
109#define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
110#define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
111#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
112#define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
113#define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
114#define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
115#define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
116#define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
117#define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
118#define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
119#define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
120#define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
121#define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
122#define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
123#define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
124#define R200_EMIT_VTE_CNTL 48 /* vte/1 */
125#define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
126#define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
127#define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
128#define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
129#define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
130#define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
131#define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
132#define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
133#define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
134#define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
135#define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
136#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
137#define R200_EMIT_PP_CUBIC_FACES_0 61
138#define R200_EMIT_PP_CUBIC_OFFSETS_0 62
139#define R200_EMIT_PP_CUBIC_FACES_1 63
140#define R200_EMIT_PP_CUBIC_OFFSETS_1 64
141#define R200_EMIT_PP_CUBIC_FACES_2 65
142#define R200_EMIT_PP_CUBIC_OFFSETS_2 66
143#define R200_EMIT_PP_CUBIC_FACES_3 67
144#define R200_EMIT_PP_CUBIC_OFFSETS_3 68
145#define R200_EMIT_PP_CUBIC_FACES_4 69
146#define R200_EMIT_PP_CUBIC_OFFSETS_4 70
147#define R200_EMIT_PP_CUBIC_FACES_5 71
148#define R200_EMIT_PP_CUBIC_OFFSETS_5 72
149#define RADEON_EMIT_PP_TEX_SIZE_0 73
150#define RADEON_EMIT_PP_TEX_SIZE_1 74
151#define RADEON_EMIT_PP_TEX_SIZE_2 75
152#define R200_EMIT_RB3D_BLENDCOLOR 76
153#define R200_EMIT_TCL_POINT_SPRITE_CNTL 77
154#define RADEON_EMIT_PP_CUBIC_FACES_0 78
155#define RADEON_EMIT_PP_CUBIC_OFFSETS_T0 79
156#define RADEON_EMIT_PP_CUBIC_FACES_1 80
157#define RADEON_EMIT_PP_CUBIC_OFFSETS_T1 81
158#define RADEON_EMIT_PP_CUBIC_FACES_2 82
159#define RADEON_EMIT_PP_CUBIC_OFFSETS_T2 83
160#define R200_EMIT_PP_TRI_PERF_CNTL 84
161#define R200_EMIT_PP_AFS_0 85
162#define R200_EMIT_PP_AFS_1 86
163#define R200_EMIT_ATF_TFACTOR 87
164#define R200_EMIT_PP_TXCTLALL_0 88
165#define R200_EMIT_PP_TXCTLALL_1 89
166#define R200_EMIT_PP_TXCTLALL_2 90
167#define R200_EMIT_PP_TXCTLALL_3 91
168#define R200_EMIT_PP_TXCTLALL_4 92
169#define R200_EMIT_PP_TXCTLALL_5 93
170#define R200_EMIT_VAP_PVS_CNTL 94
171#define RADEON_MAX_STATE_PACKETS 95
172
173/* Commands understood by cmd_buffer ioctl. More can be added but
174 * obviously these can't be removed or changed:
175 */
176#define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
177#define RADEON_CMD_SCALARS 2 /* emit scalar data */
178#define RADEON_CMD_VECTORS 3 /* emit vector data */
179#define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
180#define RADEON_CMD_PACKET3 5 /* emit hw packet */
181#define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
182#define RADEON_CMD_SCALARS2 7 /* r200 stopgap */
183#define RADEON_CMD_WAIT 8 /* emit hw wait commands -- note:
184 * doesn't make the cpu wait, just
185 * the graphics hardware */
186#define RADEON_CMD_VECLINEAR 9 /* another r200 stopgap */
187
188typedef union {
189 int i;
190 struct {
191 unsigned char cmd_type, pad0, pad1, pad2;
192 } header;
193 struct {
194 unsigned char cmd_type, packet_id, pad0, pad1;
195 } packet;
196 struct {
197 unsigned char cmd_type, offset, stride, count;
198 } scalars;
199 struct {
200 unsigned char cmd_type, offset, stride, count;
201 } vectors;
202 struct {
203 unsigned char cmd_type, addr_lo, addr_hi, count;
204 } veclinear;
205 struct {
206 unsigned char cmd_type, buf_idx, pad0, pad1;
207 } dma;
208 struct {
209 unsigned char cmd_type, flags, pad0, pad1;
210 } wait;
211} drm_radeon_cmd_header_t;
212
213#define RADEON_WAIT_2D 0x1
214#define RADEON_WAIT_3D 0x2
215
216/* Allowed parameters for R300_CMD_PACKET3
217 */
218#define R300_CMD_PACKET3_CLEAR 0
219#define R300_CMD_PACKET3_RAW 1
220
221/* Commands understood by cmd_buffer ioctl for R300.
222 * The interface has not been stabilized, so some of these may be removed
223 * and eventually reordered before stabilization.
224 */
225#define R300_CMD_PACKET0 1
226#define R300_CMD_VPU 2 /* emit vertex program upload */
227#define R300_CMD_PACKET3 3 /* emit a packet3 */
228#define R300_CMD_END3D 4 /* emit sequence ending 3d rendering */
229#define R300_CMD_CP_DELAY 5
230#define R300_CMD_DMA_DISCARD 6
231#define R300_CMD_WAIT 7
232# define R300_WAIT_2D 0x1
233# define R300_WAIT_3D 0x2
234/* these two defines are DOING IT WRONG - however
235 * we have userspace which relies on using these.
236 * The wait interface is backwards compat new
237 * code should use the NEW_WAIT defines below
238 * THESE ARE NOT BIT FIELDS
239 */
240# define R300_WAIT_2D_CLEAN 0x3
241# define R300_WAIT_3D_CLEAN 0x4
242
243# define R300_NEW_WAIT_2D_3D 0x3
244# define R300_NEW_WAIT_2D_2D_CLEAN 0x4
245# define R300_NEW_WAIT_3D_3D_CLEAN 0x6
246# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8
247
248#define R300_CMD_SCRATCH 8
249#define R300_CMD_R500FP 9
250
251typedef union {
252 unsigned int u;
253 struct {
254 unsigned char cmd_type, pad0, pad1, pad2;
255 } header;
256 struct {
257 unsigned char cmd_type, count, reglo, reghi;
258 } packet0;
259 struct {
260 unsigned char cmd_type, count, adrlo, adrhi;
261 } vpu;
262 struct {
263 unsigned char cmd_type, packet, pad0, pad1;
264 } packet3;
265 struct {
266 unsigned char cmd_type, packet;
267 unsigned short count; /* amount of packet2 to emit */
268 } delay;
269 struct {
270 unsigned char cmd_type, buf_idx, pad0, pad1;
271 } dma;
272 struct {
273 unsigned char cmd_type, flags, pad0, pad1;
274 } wait;
275 struct {
276 unsigned char cmd_type, reg, n_bufs, flags;
277 } scratch;
278 struct {
279 unsigned char cmd_type, count, adrlo, adrhi_flags;
280 } r500fp;
281} drm_r300_cmd_header_t;
282
283#define RADEON_FRONT 0x1
284#define RADEON_BACK 0x2
285#define RADEON_DEPTH 0x4
286#define RADEON_STENCIL 0x8
287#define RADEON_CLEAR_FASTZ 0x80000000
288#define RADEON_USE_HIERZ 0x40000000
289#define RADEON_USE_COMP_ZBUF 0x20000000
290
291#define R500FP_CONSTANT_TYPE (1 << 1)
292#define R500FP_CONSTANT_CLAMP (1 << 2)
293
294/* Primitive types
295 */
296#define RADEON_POINTS 0x1
297#define RADEON_LINES 0x2
298#define RADEON_LINE_STRIP 0x3
299#define RADEON_TRIANGLES 0x4
300#define RADEON_TRIANGLE_FAN 0x5
301#define RADEON_TRIANGLE_STRIP 0x6
302
303/* Vertex/indirect buffer size
304 */
305#define RADEON_BUFFER_SIZE 65536
306
307/* Byte offsets for indirect buffer data
308 */
309#define RADEON_INDEX_PRIM_OFFSET 20
310
311#define RADEON_SCRATCH_REG_OFFSET 32
312
313#define R600_SCRATCH_REG_OFFSET 256
314
315#define RADEON_NR_SAREA_CLIPRECTS 12
316
317/* There are 2 heaps (local/GART). Each region within a heap is a
318 * minimum of 64k, and there are at most 64 of them per heap.
319 */
320#define RADEON_LOCAL_TEX_HEAP 0
321#define RADEON_GART_TEX_HEAP 1
322#define RADEON_NR_TEX_HEAPS 2
323#define RADEON_NR_TEX_REGIONS 64
324#define RADEON_LOG_TEX_GRANULARITY 16
325
326#define RADEON_MAX_TEXTURE_LEVELS 12
327#define RADEON_MAX_TEXTURE_UNITS 3
328
329#define RADEON_MAX_SURFACES 8
330
331/* Blits have strict offset rules. All blit offset must be aligned on
332 * a 1K-byte boundary.
333 */
334#define RADEON_OFFSET_SHIFT 10
335#define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT)
336#define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1)
337
338#endif /* __RADEON_SAREA_DEFINES__ */
339
340typedef struct {
341 unsigned int red;
342 unsigned int green;
343 unsigned int blue;
344 unsigned int alpha;
345} radeon_color_regs_t;
346
347typedef struct {
348 /* Context state */
349 unsigned int pp_misc; /* 0x1c14 */
350 unsigned int pp_fog_color;
351 unsigned int re_solid_color;
352 unsigned int rb3d_blendcntl;
353 unsigned int rb3d_depthoffset;
354 unsigned int rb3d_depthpitch;
355 unsigned int rb3d_zstencilcntl;
356
357 unsigned int pp_cntl; /* 0x1c38 */
358 unsigned int rb3d_cntl;
359 unsigned int rb3d_coloroffset;
360 unsigned int re_width_height;
361 unsigned int rb3d_colorpitch;
362 unsigned int se_cntl;
363
364 /* Vertex format state */
365 unsigned int se_coord_fmt; /* 0x1c50 */
366
367 /* Line state */
368 unsigned int re_line_pattern; /* 0x1cd0 */
369 unsigned int re_line_state;
370
371 unsigned int se_line_width; /* 0x1db8 */
372
373 /* Bumpmap state */
374 unsigned int pp_lum_matrix; /* 0x1d00 */
375
376 unsigned int pp_rot_matrix_0; /* 0x1d58 */
377 unsigned int pp_rot_matrix_1;
378
379 /* Mask state */
380 unsigned int rb3d_stencilrefmask; /* 0x1d7c */
381 unsigned int rb3d_ropcntl;
382 unsigned int rb3d_planemask;
383
384 /* Viewport state */
385 unsigned int se_vport_xscale; /* 0x1d98 */
386 unsigned int se_vport_xoffset;
387 unsigned int se_vport_yscale;
388 unsigned int se_vport_yoffset;
389 unsigned int se_vport_zscale;
390 unsigned int se_vport_zoffset;
391
392 /* Setup state */
393 unsigned int se_cntl_status; /* 0x2140 */
394
395 /* Misc state */
396 unsigned int re_top_left; /* 0x26c0 */
397 unsigned int re_misc;
398} drm_radeon_context_regs_t;
399
400typedef struct {
401 /* Zbias state */
402 unsigned int se_zbias_factor; /* 0x1dac */
403 unsigned int se_zbias_constant;
404} drm_radeon_context2_regs_t;
405
406/* Setup registers for each texture unit
407 */
408typedef struct {
409 unsigned int pp_txfilter;
410 unsigned int pp_txformat;
411 unsigned int pp_txoffset;
412 unsigned int pp_txcblend;
413 unsigned int pp_txablend;
414 unsigned int pp_tfactor;
415 unsigned int pp_border_color;
416} drm_radeon_texture_regs_t;
417
418typedef struct {
419 unsigned int start;
420 unsigned int finish;
421 unsigned int prim:8;
422 unsigned int stateidx:8;
423 unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
424 unsigned int vc_format; /* vertex format */
425} drm_radeon_prim_t;
426
427typedef struct {
428 drm_radeon_context_regs_t context;
429 drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS];
430 drm_radeon_context2_regs_t context2;
431 unsigned int dirty;
432} drm_radeon_state_t;
433
434typedef struct {
435 /* The channel for communication of state information to the
436 * kernel on firing a vertex buffer with either of the
437 * obsoleted vertex/index ioctls.
438 */
439 drm_radeon_context_regs_t context_state;
440 drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS];
441 unsigned int dirty;
442 unsigned int vertsize;
443 unsigned int vc_format;
444
445 /* The current cliprects, or a subset thereof.
446 */
447 struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
448 unsigned int nbox;
449
450 /* Counters for client-side throttling of rendering clients.
451 */
452 unsigned int last_frame;
453 unsigned int last_dispatch;
454 unsigned int last_clear;
455
456 struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
457 1];
458 unsigned int tex_age[RADEON_NR_TEX_HEAPS];
459 int ctx_owner;
460 int pfState; /* number of 3d windows (0,1,2ormore) */
461 int pfCurrentPage; /* which buffer is being displayed? */
462 int crtc2_base; /* CRTC2 frame offset */
463 int tiling_enabled; /* set by drm, read by 2d + 3d clients */
464} drm_radeon_sarea_t;
465
466/* WARNING: If you change any of these defines, make sure to change the
467 * defines in the Xserver file (xf86drmRadeon.h)
468 *
469 * KW: actually it's illegal to change any of this (backwards compatibility).
470 */
471
472/* Radeon specific ioctls
473 * The device specific ioctl range is 0x40 to 0x79.
474 */
475#define DRM_RADEON_CP_INIT 0x00
476#define DRM_RADEON_CP_START 0x01
477#define DRM_RADEON_CP_STOP 0x02
478#define DRM_RADEON_CP_RESET 0x03
479#define DRM_RADEON_CP_IDLE 0x04
480#define DRM_RADEON_RESET 0x05
481#define DRM_RADEON_FULLSCREEN 0x06
482#define DRM_RADEON_SWAP 0x07
483#define DRM_RADEON_CLEAR 0x08
484#define DRM_RADEON_VERTEX 0x09
485#define DRM_RADEON_INDICES 0x0A
486#define DRM_RADEON_NOT_USED
487#define DRM_RADEON_STIPPLE 0x0C
488#define DRM_RADEON_INDIRECT 0x0D
489#define DRM_RADEON_TEXTURE 0x0E
490#define DRM_RADEON_VERTEX2 0x0F
491#define DRM_RADEON_CMDBUF 0x10
492#define DRM_RADEON_GETPARAM 0x11
493#define DRM_RADEON_FLIP 0x12
494#define DRM_RADEON_ALLOC 0x13
495#define DRM_RADEON_FREE 0x14
496#define DRM_RADEON_INIT_HEAP 0x15
497#define DRM_RADEON_IRQ_EMIT 0x16
498#define DRM_RADEON_IRQ_WAIT 0x17
499#define DRM_RADEON_CP_RESUME 0x18
500#define DRM_RADEON_SETPARAM 0x19
501#define DRM_RADEON_SURF_ALLOC 0x1a
502#define DRM_RADEON_SURF_FREE 0x1b
503/* KMS ioctl */
504#define DRM_RADEON_GEM_INFO 0x1c
505#define DRM_RADEON_GEM_CREATE 0x1d
506#define DRM_RADEON_GEM_MMAP 0x1e
507#define DRM_RADEON_GEM_PREAD 0x21
508#define DRM_RADEON_GEM_PWRITE 0x22
509#define DRM_RADEON_GEM_SET_DOMAIN 0x23
510#define DRM_RADEON_GEM_WAIT_IDLE 0x24
511#define DRM_RADEON_CS 0x26
512#define DRM_RADEON_INFO 0x27
513#define DRM_RADEON_GEM_SET_TILING 0x28
514#define DRM_RADEON_GEM_GET_TILING 0x29
515#define DRM_RADEON_GEM_BUSY 0x2a
516#define DRM_RADEON_GEM_VA 0x2b
517#define DRM_RADEON_GEM_OP 0x2c
518#define DRM_RADEON_GEM_USERPTR 0x2d
519
520#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
521#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
522#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
523#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
524#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
525#define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
526#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
527#define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP)
528#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
529#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
530#define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
531#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
532#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
533#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
534#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
535#define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
536#define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
537#define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
538#define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
539#define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
540#define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
541#define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
542#define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
543#define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
544#define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
545#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
546#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
547/* KMS */
548#define DRM_IOCTL_RADEON_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
549#define DRM_IOCTL_RADEON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
550#define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
551#define DRM_IOCTL_RADEON_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
552#define DRM_IOCTL_RADEON_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
553#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
554#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
555#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
556#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
557#define DRM_IOCTL_RADEON_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
558#define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
559#define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
560#define DRM_IOCTL_RADEON_GEM_VA DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_VA, struct drm_radeon_gem_va)
561#define DRM_IOCTL_RADEON_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_OP, struct drm_radeon_gem_op)
562#define DRM_IOCTL_RADEON_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_USERPTR, struct drm_radeon_gem_userptr)
563
564typedef struct drm_radeon_init {
565 enum {
566 RADEON_INIT_CP = 0x01,
567 RADEON_CLEANUP_CP = 0x02,
568 RADEON_INIT_R200_CP = 0x03,
569 RADEON_INIT_R300_CP = 0x04,
570 RADEON_INIT_R600_CP = 0x05
571 } func;
572 unsigned long sarea_priv_offset;
573 int is_pci;
574 int cp_mode;
575 int gart_size;
576 int ring_size;
577 int usec_timeout;
578
579 unsigned int fb_bpp;
580 unsigned int front_offset, front_pitch;
581 unsigned int back_offset, back_pitch;
582 unsigned int depth_bpp;
583 unsigned int depth_offset, depth_pitch;
584
585 unsigned long fb_offset;
586 unsigned long mmio_offset;
587 unsigned long ring_offset;
588 unsigned long ring_rptr_offset;
589 unsigned long buffers_offset;
590 unsigned long gart_textures_offset;
591} drm_radeon_init_t;
592
593typedef struct drm_radeon_cp_stop {
594 int flush;
595 int idle;
596} drm_radeon_cp_stop_t;
597
598typedef struct drm_radeon_fullscreen {
599 enum {
600 RADEON_INIT_FULLSCREEN = 0x01,
601 RADEON_CLEANUP_FULLSCREEN = 0x02
602 } func;
603} drm_radeon_fullscreen_t;
604
605#define CLEAR_X1 0
606#define CLEAR_Y1 1
607#define CLEAR_X2 2
608#define CLEAR_Y2 3
609#define CLEAR_DEPTH 4
610
611typedef union drm_radeon_clear_rect {
612 float f[5];
613 unsigned int ui[5];
614} drm_radeon_clear_rect_t;
615
616typedef struct drm_radeon_clear {
617 unsigned int flags;
618 unsigned int clear_color;
619 unsigned int clear_depth;
620 unsigned int color_mask;
621 unsigned int depth_mask; /* misnamed field: should be stencil */
622 drm_radeon_clear_rect_t *depth_boxes;
623} drm_radeon_clear_t;
624
625typedef struct drm_radeon_vertex {
626 int prim;
627 int idx; /* Index of vertex buffer */
628 int count; /* Number of vertices in buffer */
629 int discard; /* Client finished with buffer? */
630} drm_radeon_vertex_t;
631
632typedef struct drm_radeon_indices {
633 int prim;
634 int idx;
635 int start;
636 int end;
637 int discard; /* Client finished with buffer? */
638} drm_radeon_indices_t;
639
640/* v1.2 - obsoletes drm_radeon_vertex and drm_radeon_indices
641 * - allows multiple primitives and state changes in a single ioctl
642 * - supports driver change to emit native primitives
643 */
644typedef struct drm_radeon_vertex2 {
645 int idx; /* Index of vertex buffer */
646 int discard; /* Client finished with buffer? */
647 int nr_states;
648 drm_radeon_state_t *state;
649 int nr_prims;
650 drm_radeon_prim_t *prim;
651} drm_radeon_vertex2_t;
652
653/* v1.3 - obsoletes drm_radeon_vertex2
654 * - allows arbitrarily large cliprect list
655 * - allows updating of tcl packet, vector and scalar state
656 * - allows memory-efficient description of state updates
657 * - allows state to be emitted without a primitive
658 * (for clears, ctx switches)
659 * - allows more than one dma buffer to be referenced per ioctl
660 * - supports tcl driver
661 * - may be extended in future versions with new cmd types, packets
662 */
663typedef struct drm_radeon_cmd_buffer {
664 int bufsz;
665 char *buf;
666 int nbox;
667 struct drm_clip_rect *boxes;
668} drm_radeon_cmd_buffer_t;
669
670typedef struct drm_radeon_tex_image {
671 unsigned int x, y; /* Blit coordinates */
672 unsigned int width, height;
673 const void *data;
674} drm_radeon_tex_image_t;
675
676typedef struct drm_radeon_texture {
677 unsigned int offset;
678 int pitch;
679 int format;
680 int width; /* Texture image coordinates */
681 int height;
682 drm_radeon_tex_image_t *image;
683} drm_radeon_texture_t;
684
685typedef struct drm_radeon_stipple {
686 unsigned int *mask;
687} drm_radeon_stipple_t;
688
689typedef struct drm_radeon_indirect {
690 int idx;
691 int start;
692 int end;
693 int discard;
694} drm_radeon_indirect_t;
695
696/* enum for card type parameters */
697#define RADEON_CARD_PCI 0
698#define RADEON_CARD_AGP 1
699#define RADEON_CARD_PCIE 2
700
701/* 1.3: An ioctl to get parameters that aren't available to the 3d
702 * client any other way.
703 */
704#define RADEON_PARAM_GART_BUFFER_OFFSET 1 /* card offset of 1st GART buffer */
705#define RADEON_PARAM_LAST_FRAME 2
706#define RADEON_PARAM_LAST_DISPATCH 3
707#define RADEON_PARAM_LAST_CLEAR 4
708/* Added with DRM version 1.6. */
709#define RADEON_PARAM_IRQ_NR 5
710#define RADEON_PARAM_GART_BASE 6 /* card offset of GART base */
711/* Added with DRM version 1.8. */
712#define RADEON_PARAM_REGISTER_HANDLE 7 /* for drmMap() */
713#define RADEON_PARAM_STATUS_HANDLE 8
714#define RADEON_PARAM_SAREA_HANDLE 9
715#define RADEON_PARAM_GART_TEX_HANDLE 10
716#define RADEON_PARAM_SCRATCH_OFFSET 11
717#define RADEON_PARAM_CARD_TYPE 12
718#define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */
719#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
720#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
721#define RADEON_PARAM_DEVICE_ID 16
722#define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */
723
724typedef struct drm_radeon_getparam {
725 int param;
726 void *value;
727} drm_radeon_getparam_t;
728
729/* 1.6: Set up a memory manager for regions of shared memory:
730 */
731#define RADEON_MEM_REGION_GART 1
732#define RADEON_MEM_REGION_FB 2
733
734typedef struct drm_radeon_mem_alloc {
735 int region;
736 int alignment;
737 int size;
738 int *region_offset; /* offset from start of fb or GART */
739} drm_radeon_mem_alloc_t;
740
741typedef struct drm_radeon_mem_free {
742 int region;
743 int region_offset;
744} drm_radeon_mem_free_t;
745
746typedef struct drm_radeon_mem_init_heap {
747 int region;
748 int size;
749 int start;
750} drm_radeon_mem_init_heap_t;
751
752/* 1.6: Userspace can request & wait on irq's:
753 */
754typedef struct drm_radeon_irq_emit {
755 int *irq_seq;
756} drm_radeon_irq_emit_t;
757
758typedef struct drm_radeon_irq_wait {
759 int irq_seq;
760} drm_radeon_irq_wait_t;
761
762/* 1.10: Clients tell the DRM where they think the framebuffer is located in
763 * the card's address space, via a new generic ioctl to set parameters
764 */
765
766typedef struct drm_radeon_setparam {
767 unsigned int param;
768 __s64 value;
769} drm_radeon_setparam_t;
770
771#define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */
772#define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */
773#define RADEON_SETPARAM_PCIGART_LOCATION 3 /* PCI Gart Location */
774#define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
775#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
776#define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
777/* 1.14: Clients can allocate/free a surface
778 */
779typedef struct drm_radeon_surface_alloc {
780 unsigned int address;
781 unsigned int size;
782 unsigned int flags;
783} drm_radeon_surface_alloc_t;
784
785typedef struct drm_radeon_surface_free {
786 unsigned int address;
787} drm_radeon_surface_free_t;
788
789#define DRM_RADEON_VBLANK_CRTC1 1
790#define DRM_RADEON_VBLANK_CRTC2 2
791
792/*
793 * Kernel modesetting world below.
794 */
795#define RADEON_GEM_DOMAIN_CPU 0x1
796#define RADEON_GEM_DOMAIN_GTT 0x2
797#define RADEON_GEM_DOMAIN_VRAM 0x4
798
799struct drm_radeon_gem_info {
800 __u64 gart_size;
801 __u64 vram_size;
802 __u64 vram_visible;
803};
804
805#define RADEON_GEM_NO_BACKING_STORE (1 << 0)
806#define RADEON_GEM_GTT_UC (1 << 1)
807#define RADEON_GEM_GTT_WC (1 << 2)
808/* BO is expected to be accessed by the CPU */
809#define RADEON_GEM_CPU_ACCESS (1 << 3)
810/* CPU access is not expected to work for this BO */
811#define RADEON_GEM_NO_CPU_ACCESS (1 << 4)
812
813struct drm_radeon_gem_create {
814 __u64 size;
815 __u64 alignment;
816 __u32 handle;
817 __u32 initial_domain;
818 __u32 flags;
819};
820
821/*
822 * This is not a reliable API and you should expect it to fail for any
823 * number of reasons and have fallback path that do not use userptr to
824 * perform any operation.
825 */
826#define RADEON_GEM_USERPTR_READONLY (1 << 0)
827#define RADEON_GEM_USERPTR_ANONONLY (1 << 1)
828#define RADEON_GEM_USERPTR_VALIDATE (1 << 2)
829#define RADEON_GEM_USERPTR_REGISTER (1 << 3)
830
831struct drm_radeon_gem_userptr {
832 __u64 addr;
833 __u64 size;
834 __u32 flags;
835 __u32 handle;
836};
837
838#define RADEON_TILING_MACRO 0x1
839#define RADEON_TILING_MICRO 0x2
840#define RADEON_TILING_SWAP_16BIT 0x4
841#define RADEON_TILING_SWAP_32BIT 0x8
842/* this object requires a surface when mapped - i.e. front buffer */
843#define RADEON_TILING_SURFACE 0x10
844#define RADEON_TILING_MICRO_SQUARE 0x20
845#define RADEON_TILING_EG_BANKW_SHIFT 8
846#define RADEON_TILING_EG_BANKW_MASK 0xf
847#define RADEON_TILING_EG_BANKH_SHIFT 12
848#define RADEON_TILING_EG_BANKH_MASK 0xf
849#define RADEON_TILING_EG_MACRO_TILE_ASPECT_SHIFT 16
850#define RADEON_TILING_EG_MACRO_TILE_ASPECT_MASK 0xf
851#define RADEON_TILING_EG_TILE_SPLIT_SHIFT 24
852#define RADEON_TILING_EG_TILE_SPLIT_MASK 0xf
853#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_SHIFT 28
854#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf
855
856struct drm_radeon_gem_set_tiling {
857 __u32 handle;
858 __u32 tiling_flags;
859 __u32 pitch;
860};
861
862struct drm_radeon_gem_get_tiling {
863 __u32 handle;
864 __u32 tiling_flags;
865 __u32 pitch;
866};
867
868struct drm_radeon_gem_mmap {
869 __u32 handle;
870 __u32 pad;
871 __u64 offset;
872 __u64 size;
873 __u64 addr_ptr;
874};
875
876struct drm_radeon_gem_set_domain {
877 __u32 handle;
878 __u32 read_domains;
879 __u32 write_domain;
880};
881
882struct drm_radeon_gem_wait_idle {
883 __u32 handle;
884 __u32 pad;
885};
886
887struct drm_radeon_gem_busy {
888 __u32 handle;
889 __u32 domain;
890};
891
892struct drm_radeon_gem_pread {
893 /** Handle for the object being read. */
894 __u32 handle;
895 __u32 pad;
896 /** Offset into the object to read from */
897 __u64 offset;
898 /** Length of data to read */
899 __u64 size;
900 /** Pointer to write the data into. */
901 /* void *, but pointers are not 32/64 compatible */
902 __u64 data_ptr;
903};
904
905struct drm_radeon_gem_pwrite {
906 /** Handle for the object being written to. */
907 __u32 handle;
908 __u32 pad;
909 /** Offset into the object to write to */
910 __u64 offset;
911 /** Length of data to write */
912 __u64 size;
913 /** Pointer to read the data from. */
914 /* void *, but pointers are not 32/64 compatible */
915 __u64 data_ptr;
916};
917
918/* Sets or returns a value associated with a buffer. */
919struct drm_radeon_gem_op {
920 __u32 handle; /* buffer */
921 __u32 op; /* RADEON_GEM_OP_* */
922 __u64 value; /* input or return value */
923};
924
925#define RADEON_GEM_OP_GET_INITIAL_DOMAIN 0
926#define RADEON_GEM_OP_SET_INITIAL_DOMAIN 1
927
928#define RADEON_VA_MAP 1
929#define RADEON_VA_UNMAP 2
930
931#define RADEON_VA_RESULT_OK 0
932#define RADEON_VA_RESULT_ERROR 1
933#define RADEON_VA_RESULT_VA_EXIST 2
934
935#define RADEON_VM_PAGE_VALID (1 << 0)
936#define RADEON_VM_PAGE_READABLE (1 << 1)
937#define RADEON_VM_PAGE_WRITEABLE (1 << 2)
938#define RADEON_VM_PAGE_SYSTEM (1 << 3)
939#define RADEON_VM_PAGE_SNOOPED (1 << 4)
940
941struct drm_radeon_gem_va {
942 __u32 handle;
943 __u32 operation;
944 __u32 vm_id;
945 __u32 flags;
946 __u64 offset;
947};
948
949#define RADEON_CHUNK_ID_RELOCS 0x01
950#define RADEON_CHUNK_ID_IB 0x02
951#define RADEON_CHUNK_ID_FLAGS 0x03
952#define RADEON_CHUNK_ID_CONST_IB 0x04
953
954/* The first dword of RADEON_CHUNK_ID_FLAGS is a uint32 of these flags: */
955#define RADEON_CS_KEEP_TILING_FLAGS 0x01
956#define RADEON_CS_USE_VM 0x02
957#define RADEON_CS_END_OF_FRAME 0x04 /* a hint from userspace which CS is the last one */
958/* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */
959#define RADEON_CS_RING_GFX 0
960#define RADEON_CS_RING_COMPUTE 1
961#define RADEON_CS_RING_DMA 2
962#define RADEON_CS_RING_UVD 3
963#define RADEON_CS_RING_VCE 4
964/* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */
965/* 0 = normal, + = higher priority, - = lower priority */
966
967struct drm_radeon_cs_chunk {
968 __u32 chunk_id;
969 __u32 length_dw;
970 __u64 chunk_data;
971};
972
973/* drm_radeon_cs_reloc.flags */
974#define RADEON_RELOC_PRIO_MASK (0xf << 0)
975
976struct drm_radeon_cs_reloc {
977 __u32 handle;
978 __u32 read_domains;
979 __u32 write_domain;
980 __u32 flags;
981};
982
983struct drm_radeon_cs {
984 __u32 num_chunks;
985 __u32 cs_id;
986 /* this points to __u64 * which point to cs chunks */
987 __u64 chunks;
988 /* updates to the limits after this CS ioctl */
989 __u64 gart_limit;
990 __u64 vram_limit;
991};
992
993#define RADEON_INFO_DEVICE_ID 0x00
994#define RADEON_INFO_NUM_GB_PIPES 0x01
995#define RADEON_INFO_NUM_Z_PIPES 0x02
996#define RADEON_INFO_ACCEL_WORKING 0x03
997#define RADEON_INFO_CRTC_FROM_ID 0x04
998#define RADEON_INFO_ACCEL_WORKING2 0x05
999#define RADEON_INFO_TILING_CONFIG 0x06
1000#define RADEON_INFO_WANT_HYPERZ 0x07
1001#define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */
1002#define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */
1003#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */
1004#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */
1005#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */
1006#define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */
1007/* virtual address start, va < start are reserved by the kernel */
1008#define RADEON_INFO_VA_START 0x0e
1009/* maximum size of ib using the virtual memory cs */
1010#define RADEON_INFO_IB_VM_MAX_SIZE 0x0f
1011/* max pipes - needed for compute shaders */
1012#define RADEON_INFO_MAX_PIPES 0x10
1013/* timestamp for GL_ARB_timer_query (OpenGL), returns the current GPU clock */
1014#define RADEON_INFO_TIMESTAMP 0x11
1015/* max shader engines (SE) - needed for geometry shaders, etc. */
1016#define RADEON_INFO_MAX_SE 0x12
1017/* max SH per SE */
1018#define RADEON_INFO_MAX_SH_PER_SE 0x13
1019/* fast fb access is enabled */
1020#define RADEON_INFO_FASTFB_WORKING 0x14
1021/* query if a RADEON_CS_RING_* submission is supported */
1022#define RADEON_INFO_RING_WORKING 0x15
1023/* SI tile mode array */
1024#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16
1025/* query if CP DMA is supported on the compute ring */
1026#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
1027/* CIK macrotile mode array */
1028#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18
1029/* query the number of render backends */
1030#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19
1031/* max engine clock - needed for OpenCL */
1032#define RADEON_INFO_MAX_SCLK 0x1a
1033/* version of VCE firmware */
1034#define RADEON_INFO_VCE_FW_VERSION 0x1b
1035/* version of VCE feedback */
1036#define RADEON_INFO_VCE_FB_VERSION 0x1c
1037#define RADEON_INFO_NUM_BYTES_MOVED 0x1d
1038#define RADEON_INFO_VRAM_USAGE 0x1e
1039#define RADEON_INFO_GTT_USAGE 0x1f
1040#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
1041#define RADEON_INFO_CURRENT_GPU_TEMP 0x21
1042#define RADEON_INFO_CURRENT_GPU_SCLK 0x22
1043#define RADEON_INFO_CURRENT_GPU_MCLK 0x23
1044#define RADEON_INFO_READ_REG 0x24
1045#define RADEON_INFO_VA_UNMAP_WORKING 0x25
1046#define RADEON_INFO_GPU_RESET_COUNTER 0x26
1047
1048struct drm_radeon_info {
1049 __u32 request;
1050 __u32 pad;
1051 __u64 value;
1052};
1053
1054/* Those correspond to the tile index to use, this is to explicitly state
1055 * the API that is implicitly defined by the tile mode array.
1056 */
1057#define SI_TILE_MODE_COLOR_LINEAR_ALIGNED 8
1058#define SI_TILE_MODE_COLOR_1D 13
1059#define SI_TILE_MODE_COLOR_1D_SCANOUT 9
1060#define SI_TILE_MODE_COLOR_2D_8BPP 14
1061#define SI_TILE_MODE_COLOR_2D_16BPP 15
1062#define SI_TILE_MODE_COLOR_2D_32BPP 16
1063#define SI_TILE_MODE_COLOR_2D_64BPP 17
1064#define SI_TILE_MODE_COLOR_2D_SCANOUT_16BPP 11
1065#define SI_TILE_MODE_COLOR_2D_SCANOUT_32BPP 12
1066#define SI_TILE_MODE_DEPTH_STENCIL_1D 4
1067#define SI_TILE_MODE_DEPTH_STENCIL_2D 0
1068#define SI_TILE_MODE_DEPTH_STENCIL_2D_2AA 3
1069#define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA 3
1070#define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA 2
1071
1072#define CIK_TILE_MODE_DEPTH_STENCIL_1D 5
1073
1074#if defined(__cplusplus)
1075}
1076#endif
1077
1078#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/savage_drm.h created+220
...@@ -0,0 +1,220 @@
1/* savage_drm.h -- Public header for the savage driver
2 *
3 * Copyright 2004 Felix Kuehling
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sub license,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef __SAVAGE_DRM_H__
27#define __SAVAGE_DRM_H__
28
29#include "drm.h"
30
31#if defined(__cplusplus)
32extern "C" {
33#endif
34
35#ifndef __SAVAGE_SAREA_DEFINES__
36#define __SAVAGE_SAREA_DEFINES__
37
38/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
39 * regions, subject to a minimum region size of (1<<16) == 64k.
40 *
41 * Clients may subdivide regions internally, but when sharing between
42 * clients, the region size is the minimum granularity.
43 */
44
45#define SAVAGE_CARD_HEAP 0
46#define SAVAGE_AGP_HEAP 1
47#define SAVAGE_NR_TEX_HEAPS 2
48#define SAVAGE_NR_TEX_REGIONS 16
49#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16
50
51#endif /* __SAVAGE_SAREA_DEFINES__ */
52
53typedef struct _drm_savage_sarea {
54 /* LRU lists for texture memory in agp space and on the card.
55 */
56 struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
57 1];
58 unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
59
60 /* Mechanism to validate card state.
61 */
62 int ctxOwner;
63} drm_savage_sarea_t, *drm_savage_sarea_ptr;
64
65/* Savage-specific ioctls
66 */
67#define DRM_SAVAGE_BCI_INIT 0x00
68#define DRM_SAVAGE_BCI_CMDBUF 0x01
69#define DRM_SAVAGE_BCI_EVENT_EMIT 0x02
70#define DRM_SAVAGE_BCI_EVENT_WAIT 0x03
71
72#define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
73#define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
74#define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
75#define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
76
77#define SAVAGE_DMA_PCI 1
78#define SAVAGE_DMA_AGP 3
79typedef struct drm_savage_init {
80 enum {
81 SAVAGE_INIT_BCI = 1,
82 SAVAGE_CLEANUP_BCI = 2
83 } func;
84 unsigned int sarea_priv_offset;
85
86 /* some parameters */
87 unsigned int cob_size;
88 unsigned int bci_threshold_lo, bci_threshold_hi;
89 unsigned int dma_type;
90
91 /* frame buffer layout */
92 unsigned int fb_bpp;
93 unsigned int front_offset, front_pitch;
94 unsigned int back_offset, back_pitch;
95 unsigned int depth_bpp;
96 unsigned int depth_offset, depth_pitch;
97
98 /* local textures */
99 unsigned int texture_offset;
100 unsigned int texture_size;
101
102 /* physical locations of non-permanent maps */
103 unsigned long status_offset;
104 unsigned long buffers_offset;
105 unsigned long agp_textures_offset;
106 unsigned long cmd_dma_offset;
107} drm_savage_init_t;
108
109typedef union drm_savage_cmd_header drm_savage_cmd_header_t;
110typedef struct drm_savage_cmdbuf {
111 /* command buffer in client's address space */
112 drm_savage_cmd_header_t *cmd_addr;
113 unsigned int size; /* size of the command buffer in 64bit units */
114
115 unsigned int dma_idx; /* DMA buffer index to use */
116 int discard; /* discard DMA buffer when done */
117 /* vertex buffer in client's address space */
118 unsigned int *vb_addr;
119 unsigned int vb_size; /* size of client vertex buffer in bytes */
120 unsigned int vb_stride; /* stride of vertices in 32bit words */
121 /* boxes in client's address space */
122 struct drm_clip_rect *box_addr;
123 unsigned int nbox; /* number of clipping boxes */
124} drm_savage_cmdbuf_t;
125
126#define SAVAGE_WAIT_2D 0x1 /* wait for 2D idle before updating event tag */
127#define SAVAGE_WAIT_3D 0x2 /* wait for 3D idle before updating event tag */
128#define SAVAGE_WAIT_IRQ 0x4 /* emit or wait for IRQ, not implemented yet */
129typedef struct drm_savage_event {
130 unsigned int count;
131 unsigned int flags;
132} drm_savage_event_emit_t, drm_savage_event_wait_t;
133
134/* Commands for the cmdbuf ioctl
135 */
136#define SAVAGE_CMD_STATE 0 /* a range of state registers */
137#define SAVAGE_CMD_DMA_PRIM 1 /* vertices from DMA buffer */
138#define SAVAGE_CMD_VB_PRIM 2 /* vertices from client vertex buffer */
139#define SAVAGE_CMD_DMA_IDX 3 /* indexed vertices from DMA buffer */
140#define SAVAGE_CMD_VB_IDX 4 /* indexed vertices client vertex buffer */
141#define SAVAGE_CMD_CLEAR 5 /* clear buffers */
142#define SAVAGE_CMD_SWAP 6 /* swap buffers */
143
144/* Primitive types
145*/
146#define SAVAGE_PRIM_TRILIST 0 /* triangle list */
147#define SAVAGE_PRIM_TRISTRIP 1 /* triangle strip */
148#define SAVAGE_PRIM_TRIFAN 2 /* triangle fan */
149#define SAVAGE_PRIM_TRILIST_201 3 /* reorder verts for correct flat
150 * shading on s3d */
151
152/* Skip flags (vertex format)
153 */
154#define SAVAGE_SKIP_Z 0x01
155#define SAVAGE_SKIP_W 0x02
156#define SAVAGE_SKIP_C0 0x04
157#define SAVAGE_SKIP_C1 0x08
158#define SAVAGE_SKIP_S0 0x10
159#define SAVAGE_SKIP_T0 0x20
160#define SAVAGE_SKIP_ST0 0x30
161#define SAVAGE_SKIP_S1 0x40
162#define SAVAGE_SKIP_T1 0x80
163#define SAVAGE_SKIP_ST1 0xc0
164#define SAVAGE_SKIP_ALL_S3D 0x3f
165#define SAVAGE_SKIP_ALL_S4 0xff
166
167/* Buffer names for clear command
168 */
169#define SAVAGE_FRONT 0x1
170#define SAVAGE_BACK 0x2
171#define SAVAGE_DEPTH 0x4
172
173/* 64-bit command header
174 */
175union drm_savage_cmd_header {
176 struct {
177 unsigned char cmd; /* command */
178 unsigned char pad0;
179 unsigned short pad1;
180 unsigned short pad2;
181 unsigned short pad3;
182 } cmd; /* generic */
183 struct {
184 unsigned char cmd;
185 unsigned char global; /* need idle engine? */
186 unsigned short count; /* number of consecutive registers */
187 unsigned short start; /* first register */
188 unsigned short pad3;
189 } state; /* SAVAGE_CMD_STATE */
190 struct {
191 unsigned char cmd;
192 unsigned char prim; /* primitive type */
193 unsigned short skip; /* vertex format (skip flags) */
194 unsigned short count; /* number of vertices */
195 unsigned short start; /* first vertex in DMA/vertex buffer */
196 } prim; /* SAVAGE_CMD_DMA_PRIM, SAVAGE_CMD_VB_PRIM */
197 struct {
198 unsigned char cmd;
199 unsigned char prim;
200 unsigned short skip;
201 unsigned short count; /* number of indices that follow */
202 unsigned short pad3;
203 } idx; /* SAVAGE_CMD_DMA_IDX, SAVAGE_CMD_VB_IDX */
204 struct {
205 unsigned char cmd;
206 unsigned char pad0;
207 unsigned short pad1;
208 unsigned int flags;
209 } clear0; /* SAVAGE_CMD_CLEAR */
210 struct {
211 unsigned int mask;
212 unsigned int value;
213 } clear1; /* SAVAGE_CMD_CLEAR data */
214};
215
216#if defined(__cplusplus)
217}
218#endif
219
220#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/sis_drm.h created+77
...@@ -0,0 +1,77 @@
1/* sis_drv.h -- Private header for sis driver -*- linux-c -*- */
2/*
3 * Copyright 2005 Eric Anholt
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27#ifndef __SIS_DRM_H__
28#define __SIS_DRM_H__
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* SiS specific ioctls */
37#define NOT_USED_0_3
38#define DRM_SIS_FB_ALLOC 0x04
39#define DRM_SIS_FB_FREE 0x05
40#define NOT_USED_6_12
41#define DRM_SIS_AGP_INIT 0x13
42#define DRM_SIS_AGP_ALLOC 0x14
43#define DRM_SIS_AGP_FREE 0x15
44#define DRM_SIS_FB_INIT 0x16
45
46#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t)
47#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t)
48#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t)
49#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t)
50#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t)
51#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t)
52/*
53#define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
54#define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49)
55#define DRM_IOCTL_SIS_FLIP_FINAL DRM_IO( 0x50)
56*/
57
58typedef struct {
59 int context;
60 unsigned long offset;
61 unsigned long size;
62 unsigned long free;
63} drm_sis_mem_t;
64
65typedef struct {
66 unsigned long offset, size;
67} drm_sis_agp_t;
68
69typedef struct {
70 unsigned long offset, size;
71} drm_sis_fb_t;
72
73#if defined(__cplusplus)
74}
75#endif
76
77#endif /* __SIS_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/tegra_drm.h created+1060
...@@ -0,0 +1,1060 @@
1/* SPDX-License-Identifier: MIT */
2/* Copyright (c) 2012-2020 NVIDIA Corporation */
3
4#ifndef _TEGRA_DRM_H_
5#define _TEGRA_DRM_H_
6
7#include "drm.h"
8
9#if defined(__cplusplus)
10extern "C" {
11#endif
12
13/* Tegra DRM legacy UAPI. Only enabled with STAGING */
14
15#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
16#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
17
18/**
19 * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL
20 */
21struct drm_tegra_gem_create {
22 /**
23 * @size:
24 *
25 * The size, in bytes, of the buffer object to be created.
26 */
27 __u64 size;
28
29 /**
30 * @flags:
31 *
32 * A bitmask of flags that influence the creation of GEM objects:
33 *
34 * DRM_TEGRA_GEM_CREATE_TILED
35 * Use the 16x16 tiling format for this buffer.
36 *
37 * DRM_TEGRA_GEM_CREATE_BOTTOM_UP
38 * The buffer has a bottom-up layout.
39 */
40 __u32 flags;
41
42 /**
43 * @handle:
44 *
45 * The handle of the created GEM object. Set by the kernel upon
46 * successful completion of the IOCTL.
47 */
48 __u32 handle;
49};
50
51/**
52 * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL
53 */
54struct drm_tegra_gem_mmap {
55 /**
56 * @handle:
57 *
58 * Handle of the GEM object to obtain an mmap offset for.
59 */
60 __u32 handle;
61
62 /**
63 * @pad:
64 *
65 * Structure padding that may be used in the future. Must be 0.
66 */
67 __u32 pad;
68
69 /**
70 * @offset:
71 *
72 * The mmap offset for the given GEM object. Set by the kernel upon
73 * successful completion of the IOCTL.
74 */
75 __u64 offset;
76};
77
78/**
79 * struct drm_tegra_syncpt_read - parameters for the read syncpoint IOCTL
80 */
81struct drm_tegra_syncpt_read {
82 /**
83 * @id:
84 *
85 * ID of the syncpoint to read the current value from.
86 */
87 __u32 id;
88
89 /**
90 * @value:
91 *
92 * The current syncpoint value. Set by the kernel upon successful
93 * completion of the IOCTL.
94 */
95 __u32 value;
96};
97
98/**
99 * struct drm_tegra_syncpt_incr - parameters for the increment syncpoint IOCTL
100 */
101struct drm_tegra_syncpt_incr {
102 /**
103 * @id:
104 *
105 * ID of the syncpoint to increment.
106 */
107 __u32 id;
108
109 /**
110 * @pad:
111 *
112 * Structure padding that may be used in the future. Must be 0.
113 */
114 __u32 pad;
115};
116
117/**
118 * struct drm_tegra_syncpt_wait - parameters for the wait syncpoint IOCTL
119 */
120struct drm_tegra_syncpt_wait {
121 /**
122 * @id:
123 *
124 * ID of the syncpoint to wait on.
125 */
126 __u32 id;
127
128 /**
129 * @thresh:
130 *
131 * Threshold value for which to wait.
132 */
133 __u32 thresh;
134
135 /**
136 * @timeout:
137 *
138 * Timeout, in milliseconds, to wait.
139 */
140 __u32 timeout;
141
142 /**
143 * @value:
144 *
145 * The new syncpoint value after the wait. Set by the kernel upon
146 * successful completion of the IOCTL.
147 */
148 __u32 value;
149};
150
151#define DRM_TEGRA_NO_TIMEOUT (0xffffffff)
152
153/**
154 * struct drm_tegra_open_channel - parameters for the open channel IOCTL
155 */
156struct drm_tegra_open_channel {
157 /**
158 * @client:
159 *
160 * The client ID for this channel.
161 */
162 __u32 client;
163
164 /**
165 * @pad:
166 *
167 * Structure padding that may be used in the future. Must be 0.
168 */
169 __u32 pad;
170
171 /**
172 * @context:
173 *
174 * The application context of this channel. Set by the kernel upon
175 * successful completion of the IOCTL. This context needs to be passed
176 * to the DRM_TEGRA_CHANNEL_CLOSE or the DRM_TEGRA_SUBMIT IOCTLs.
177 */
178 __u64 context;
179};
180
181/**
182 * struct drm_tegra_close_channel - parameters for the close channel IOCTL
183 */
184struct drm_tegra_close_channel {
185 /**
186 * @context:
187 *
188 * The application context of this channel. This is obtained from the
189 * DRM_TEGRA_OPEN_CHANNEL IOCTL.
190 */
191 __u64 context;
192};
193
194/**
195 * struct drm_tegra_get_syncpt - parameters for the get syncpoint IOCTL
196 */
197struct drm_tegra_get_syncpt {
198 /**
199 * @context:
200 *
201 * The application context identifying the channel for which to obtain
202 * the syncpoint ID.
203 */
204 __u64 context;
205
206 /**
207 * @index:
208 *
209 * Index of the client syncpoint for which to obtain the ID.
210 */
211 __u32 index;
212
213 /**
214 * @id:
215 *
216 * The ID of the given syncpoint. Set by the kernel upon successful
217 * completion of the IOCTL.
218 */
219 __u32 id;
220};
221
222/**
223 * struct drm_tegra_get_syncpt_base - parameters for the get wait base IOCTL
224 */
225struct drm_tegra_get_syncpt_base {
226 /**
227 * @context:
228 *
229 * The application context identifying for which channel to obtain the
230 * wait base.
231 */
232 __u64 context;
233
234 /**
235 * @syncpt:
236 *
237 * ID of the syncpoint for which to obtain the wait base.
238 */
239 __u32 syncpt;
240
241 /**
242 * @id:
243 *
244 * The ID of the wait base corresponding to the client syncpoint. Set
245 * by the kernel upon successful completion of the IOCTL.
246 */
247 __u32 id;
248};
249
250/**
251 * struct drm_tegra_syncpt - syncpoint increment operation
252 */
253struct drm_tegra_syncpt {
254 /**
255 * @id:
256 *
257 * ID of the syncpoint to operate on.
258 */
259 __u32 id;
260
261 /**
262 * @incrs:
263 *
264 * Number of increments to perform for the syncpoint.
265 */
266 __u32 incrs;
267};
268
269/**
270 * struct drm_tegra_cmdbuf - structure describing a command buffer
271 */
272struct drm_tegra_cmdbuf {
273 /**
274 * @handle:
275 *
276 * Handle to a GEM object containing the command buffer.
277 */
278 __u32 handle;
279
280 /**
281 * @offset:
282 *
283 * Offset, in bytes, into the GEM object identified by @handle at
284 * which the command buffer starts.
285 */
286 __u32 offset;
287
288 /**
289 * @words:
290 *
291 * Number of 32-bit words in this command buffer.
292 */
293 __u32 words;
294
295 /**
296 * @pad:
297 *
298 * Structure padding that may be used in the future. Must be 0.
299 */
300 __u32 pad;
301};
302
303/**
304 * struct drm_tegra_reloc - GEM object relocation structure
305 */
306struct drm_tegra_reloc {
307 struct {
308 /**
309 * @cmdbuf.handle:
310 *
311 * Handle to the GEM object containing the command buffer for
312 * which to perform this GEM object relocation.
313 */
314 __u32 handle;
315
316 /**
317 * @cmdbuf.offset:
318 *
319 * Offset, in bytes, into the command buffer at which to
320 * insert the relocated address.
321 */
322 __u32 offset;
323 } cmdbuf;
324 struct {
325 /**
326 * @target.handle:
327 *
328 * Handle to the GEM object to be relocated.
329 */
330 __u32 handle;
331
332 /**
333 * @target.offset:
334 *
335 * Offset, in bytes, into the target GEM object at which the
336 * relocated data starts.
337 */
338 __u32 offset;
339 } target;
340
341 /**
342 * @shift:
343 *
344 * The number of bits by which to shift relocated addresses.
345 */
346 __u32 shift;
347
348 /**
349 * @pad:
350 *
351 * Structure padding that may be used in the future. Must be 0.
352 */
353 __u32 pad;
354};
355
356/**
357 * struct drm_tegra_waitchk - wait check structure
358 */
359struct drm_tegra_waitchk {
360 /**
361 * @handle:
362 *
363 * Handle to the GEM object containing a command stream on which to
364 * perform the wait check.
365 */
366 __u32 handle;
367
368 /**
369 * @offset:
370 *
371 * Offset, in bytes, of the location in the command stream to perform
372 * the wait check on.
373 */
374 __u32 offset;
375
376 /**
377 * @syncpt:
378 *
379 * ID of the syncpoint to wait check.
380 */
381 __u32 syncpt;
382
383 /**
384 * @thresh:
385 *
386 * Threshold value for which to check.
387 */
388 __u32 thresh;
389};
390
391/**
392 * struct drm_tegra_submit - job submission structure
393 */
394struct drm_tegra_submit {
395 /**
396 * @context:
397 *
398 * The application context identifying the channel to use for the
399 * execution of this job.
400 */
401 __u64 context;
402
403 /**
404 * @num_syncpts:
405 *
406 * The number of syncpoints operated on by this job. This defines the
407 * length of the array pointed to by @syncpts.
408 */
409 __u32 num_syncpts;
410
411 /**
412 * @num_cmdbufs:
413 *
414 * The number of command buffers to execute as part of this job. This
415 * defines the length of the array pointed to by @cmdbufs.
416 */
417 __u32 num_cmdbufs;
418
419 /**
420 * @num_relocs:
421 *
422 * The number of relocations to perform before executing this job.
423 * This defines the length of the array pointed to by @relocs.
424 */
425 __u32 num_relocs;
426
427 /**
428 * @num_waitchks:
429 *
430 * The number of wait checks to perform as part of this job. This
431 * defines the length of the array pointed to by @waitchks.
432 */
433 __u32 num_waitchks;
434
435 /**
436 * @waitchk_mask:
437 *
438 * Bitmask of valid wait checks.
439 */
440 __u32 waitchk_mask;
441
442 /**
443 * @timeout:
444 *
445 * Timeout, in milliseconds, before this job is cancelled.
446 */
447 __u32 timeout;
448
449 /**
450 * @syncpts:
451 *
452 * A pointer to an array of &struct drm_tegra_syncpt structures that
453 * specify the syncpoint operations performed as part of this job.
454 * The number of elements in the array must be equal to the value
455 * given by @num_syncpts.
456 */
457 __u64 syncpts;
458
459 /**
460 * @cmdbufs:
461 *
462 * A pointer to an array of &struct drm_tegra_cmdbuf structures that
463 * define the command buffers to execute as part of this job. The
464 * number of elements in the array must be equal to the value given
465 * by @num_syncpts.
466 */
467 __u64 cmdbufs;
468
469 /**
470 * @relocs:
471 *
472 * A pointer to an array of &struct drm_tegra_reloc structures that
473 * specify the relocations that need to be performed before executing
474 * this job. The number of elements in the array must be equal to the
475 * value given by @num_relocs.
476 */
477 __u64 relocs;
478
479 /**
480 * @waitchks:
481 *
482 * A pointer to an array of &struct drm_tegra_waitchk structures that
483 * specify the wait checks to be performed while executing this job.
484 * The number of elements in the array must be equal to the value
485 * given by @num_waitchks.
486 */
487 __u64 waitchks;
488
489 /**
490 * @fence:
491 *
492 * The threshold of the syncpoint associated with this job after it
493 * has been completed. Set by the kernel upon successful completion of
494 * the IOCTL. This can be used with the DRM_TEGRA_SYNCPT_WAIT IOCTL to
495 * wait for this job to be finished.
496 */
497 __u32 fence;
498
499 /**
500 * @reserved:
501 *
502 * This field is reserved for future use. Must be 0.
503 */
504 __u32 reserved[5];
505};
506
507#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
508#define DRM_TEGRA_GEM_TILING_MODE_TILED 1
509#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
510
511/**
512 * struct drm_tegra_gem_set_tiling - parameters for the set tiling IOCTL
513 */
514struct drm_tegra_gem_set_tiling {
515 /**
516 * @handle:
517 *
518 * Handle to the GEM object for which to set the tiling parameters.
519 */
520 __u32 handle;
521
522 /**
523 * @mode:
524 *
525 * The tiling mode to set. Must be one of:
526 *
527 * DRM_TEGRA_GEM_TILING_MODE_PITCH
528 * pitch linear format
529 *
530 * DRM_TEGRA_GEM_TILING_MODE_TILED
531 * 16x16 tiling format
532 *
533 * DRM_TEGRA_GEM_TILING_MODE_BLOCK
534 * 16Bx2 tiling format
535 */
536 __u32 mode;
537
538 /**
539 * @value:
540 *
541 * The value to set for the tiling mode parameter.
542 */
543 __u32 value;
544
545 /**
546 * @pad:
547 *
548 * Structure padding that may be used in the future. Must be 0.
549 */
550 __u32 pad;
551};
552
553/**
554 * struct drm_tegra_gem_get_tiling - parameters for the get tiling IOCTL
555 */
556struct drm_tegra_gem_get_tiling {
557 /**
558 * @handle:
559 *
560 * Handle to the GEM object for which to query the tiling parameters.
561 */
562 __u32 handle;
563
564 /**
565 * @mode:
566 *
567 * The tiling mode currently associated with the GEM object. Set by
568 * the kernel upon successful completion of the IOCTL.
569 */
570 __u32 mode;
571
572 /**
573 * @value:
574 *
575 * The tiling mode parameter currently associated with the GEM object.
576 * Set by the kernel upon successful completion of the IOCTL.
577 */
578 __u32 value;
579
580 /**
581 * @pad:
582 *
583 * Structure padding that may be used in the future. Must be 0.
584 */
585 __u32 pad;
586};
587
588#define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0)
589#define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP)
590
591/**
592 * struct drm_tegra_gem_set_flags - parameters for the set flags IOCTL
593 */
594struct drm_tegra_gem_set_flags {
595 /**
596 * @handle:
597 *
598 * Handle to the GEM object for which to set the flags.
599 */
600 __u32 handle;
601
602 /**
603 * @flags:
604 *
605 * The flags to set for the GEM object.
606 */
607 __u32 flags;
608};
609
610/**
611 * struct drm_tegra_gem_get_flags - parameters for the get flags IOCTL
612 */
613struct drm_tegra_gem_get_flags {
614 /**
615 * @handle:
616 *
617 * Handle to the GEM object for which to query the flags.
618 */
619 __u32 handle;
620
621 /**
622 * @flags:
623 *
624 * The flags currently associated with the GEM object. Set by the
625 * kernel upon successful completion of the IOCTL.
626 */
627 __u32 flags;
628};
629
630#define DRM_TEGRA_GEM_CREATE 0x00
631#define DRM_TEGRA_GEM_MMAP 0x01
632#define DRM_TEGRA_SYNCPT_READ 0x02
633#define DRM_TEGRA_SYNCPT_INCR 0x03
634#define DRM_TEGRA_SYNCPT_WAIT 0x04
635#define DRM_TEGRA_OPEN_CHANNEL 0x05
636#define DRM_TEGRA_CLOSE_CHANNEL 0x06
637#define DRM_TEGRA_GET_SYNCPT 0x07
638#define DRM_TEGRA_SUBMIT 0x08
639#define DRM_TEGRA_GET_SYNCPT_BASE 0x09
640#define DRM_TEGRA_GEM_SET_TILING 0x0a
641#define DRM_TEGRA_GEM_GET_TILING 0x0b
642#define DRM_TEGRA_GEM_SET_FLAGS 0x0c
643#define DRM_TEGRA_GEM_GET_FLAGS 0x0d
644
645#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
646#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
647#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
648#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
649#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
650#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
651#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel)
652#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
653#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
654#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
655#define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling)
656#define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
657#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
658#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
659
660/* New Tegra DRM UAPI */
661
662/*
663 * Reported by the driver in the `capabilities` field.
664 *
665 * DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT: If set, the engine is cache coherent
666 * with regard to the system memory.
667 */
668#define DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT (1 << 0)
669
670struct drm_tegra_channel_open {
671 /**
672 * @host1x_class: [in]
673 *
674 * Host1x class of the engine that will be programmed using this
675 * channel.
676 */
677 __u32 host1x_class;
678
679 /**
680 * @flags: [in]
681 *
682 * Flags.
683 */
684 __u32 flags;
685
686 /**
687 * @context: [out]
688 *
689 * Opaque identifier corresponding to the opened channel.
690 */
691 __u32 context;
692
693 /**
694 * @version: [out]
695 *
696 * Version of the engine hardware. This can be used by userspace
697 * to determine how the engine needs to be programmed.
698 */
699 __u32 version;
700
701 /**
702 * @capabilities: [out]
703 *
704 * Flags describing the hardware capabilities.
705 */
706 __u32 capabilities;
707 __u32 padding;
708};
709
710struct drm_tegra_channel_close {
711 /**
712 * @context: [in]
713 *
714 * Identifier of the channel to close.
715 */
716 __u32 context;
717 __u32 padding;
718};
719
720/*
721 * Mapping flags that can be used to influence how the mapping is created.
722 *
723 * DRM_TEGRA_CHANNEL_MAP_READ: create mapping that allows HW read access
724 * DRM_TEGRA_CHANNEL_MAP_WRITE: create mapping that allows HW write access
725 */
726#define DRM_TEGRA_CHANNEL_MAP_READ (1 << 0)
727#define DRM_TEGRA_CHANNEL_MAP_WRITE (1 << 1)
728#define DRM_TEGRA_CHANNEL_MAP_READ_WRITE (DRM_TEGRA_CHANNEL_MAP_READ | \
729 DRM_TEGRA_CHANNEL_MAP_WRITE)
730
731struct drm_tegra_channel_map {
732 /**
733 * @context: [in]
734 *
735 * Identifier of the channel to which make memory available for.
736 */
737 __u32 context;
738
739 /**
740 * @handle: [in]
741 *
742 * GEM handle of the memory to map.
743 */
744 __u32 handle;
745
746 /**
747 * @flags: [in]
748 *
749 * Flags.
750 */
751 __u32 flags;
752
753 /**
754 * @mapping: [out]
755 *
756 * Identifier corresponding to the mapping, to be used for
757 * relocations or unmapping later.
758 */
759 __u32 mapping;
760};
761
762struct drm_tegra_channel_unmap {
763 /**
764 * @context: [in]
765 *
766 * Channel identifier of the channel to unmap memory from.
767 */
768 __u32 context;
769
770 /**
771 * @mapping: [in]
772 *
773 * Mapping identifier of the memory mapping to unmap.
774 */
775 __u32 mapping;
776};
777
778/* Submission */
779
780/**
781 * Specify that bit 39 of the patched-in address should be set to switch
782 * swizzling between Tegra and non-Tegra sector layout on systems that store
783 * surfaces in system memory in non-Tegra sector layout.
784 */
785#define DRM_TEGRA_SUBMIT_RELOC_SECTOR_LAYOUT (1 << 0)
786
787struct drm_tegra_submit_buf {
788 /**
789 * @mapping: [in]
790 *
791 * Identifier of the mapping to use in the submission.
792 */
793 __u32 mapping;
794
795 /**
796 * @flags: [in]
797 *
798 * Flags.
799 */
800 __u32 flags;
801
802 /**
803 * Information for relocation patching.
804 */
805 struct {
806 /**
807 * @target_offset: [in]
808 *
809 * Offset from the start of the mapping of the data whose
810 * address is to be patched into the gather.
811 */
812 __u64 target_offset;
813
814 /**
815 * @gather_offset_words: [in]
816 *
817 * Offset in words from the start of the gather data to
818 * where the address should be patched into.
819 */
820 __u32 gather_offset_words;
821
822 /**
823 * @shift: [in]
824 *
825 * Number of bits the address should be shifted right before
826 * patching in.
827 */
828 __u32 shift;
829 } reloc;
830};
831
832/**
833 * Execute `words` words of Host1x opcodes specified in the `gather_data_ptr`
834 * buffer. Each GATHER_UPTR command uses successive words from the buffer.
835 */
836#define DRM_TEGRA_SUBMIT_CMD_GATHER_UPTR 0
837/**
838 * Wait for a syncpoint to reach a value before continuing with further
839 * commands.
840 */
841#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT 1
842/**
843 * Wait for a syncpoint to reach a value before continuing with further
844 * commands. The threshold is calculated relative to the start of the job.
845 */
846#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT_RELATIVE 2
847
848struct drm_tegra_submit_cmd_gather_uptr {
849 __u32 words;
850 __u32 reserved[3];
851};
852
853struct drm_tegra_submit_cmd_wait_syncpt {
854 __u32 id;
855 __u32 value;
856 __u32 reserved[2];
857};
858
859struct drm_tegra_submit_cmd {
860 /**
861 * @type: [in]
862 *
863 * Command type to execute. One of the DRM_TEGRA_SUBMIT_CMD*
864 * defines.
865 */
866 __u32 type;
867
868 /**
869 * @flags: [in]
870 *
871 * Flags.
872 */
873 __u32 flags;
874
875 union {
876 struct drm_tegra_submit_cmd_gather_uptr gather_uptr;
877 struct drm_tegra_submit_cmd_wait_syncpt wait_syncpt;
878 __u32 reserved[4];
879 };
880};
881
882struct drm_tegra_submit_syncpt {
883 /**
884 * @id: [in]
885 *
886 * ID of the syncpoint that the job will increment.
887 */
888 __u32 id;
889
890 /**
891 * @flags: [in]
892 *
893 * Flags.
894 */
895 __u32 flags;
896
897 /**
898 * @increments: [in]
899 *
900 * Number of times the job will increment this syncpoint.
901 */
902 __u32 increments;
903
904 /**
905 * @value: [out]
906 *
907 * Value the syncpoint will have once the job has completed all
908 * its specified syncpoint increments.
909 *
910 * Note that the kernel may increment the syncpoint before or after
911 * the job. These increments are not reflected in this field.
912 *
913 * If the job hangs or times out, not all of the increments may
914 * get executed.
915 */
916 __u32 value;
917};
918
919struct drm_tegra_channel_submit {
920 /**
921 * @context: [in]
922 *
923 * Identifier of the channel to submit this job to.
924 */
925 __u32 context;
926
927 /**
928 * @num_bufs: [in]
929 *
930 * Number of elements in the `bufs_ptr` array.
931 */
932 __u32 num_bufs;
933
934 /**
935 * @num_cmds: [in]
936 *
937 * Number of elements in the `cmds_ptr` array.
938 */
939 __u32 num_cmds;
940
941 /**
942 * @gather_data_words: [in]
943 *
944 * Number of 32-bit words in the `gather_data_ptr` array.
945 */
946 __u32 gather_data_words;
947
948 /**
949 * @bufs_ptr: [in]
950 *
951 * Pointer to an array of drm_tegra_submit_buf structures.
952 */
953 __u64 bufs_ptr;
954
955 /**
956 * @cmds_ptr: [in]
957 *
958 * Pointer to an array of drm_tegra_submit_cmd structures.
959 */
960 __u64 cmds_ptr;
961
962 /**
963 * @gather_data_ptr: [in]
964 *
965 * Pointer to an array of Host1x opcodes to be used by GATHER_UPTR
966 * commands.
967 */
968 __u64 gather_data_ptr;
969
970 /**
971 * @syncobj_in: [in]
972 *
973 * Handle for DRM syncobj that will be waited before submission.
974 * Ignored if zero.
975 */
976 __u32 syncobj_in;
977
978 /**
979 * @syncobj_out: [in]
980 *
981 * Handle for DRM syncobj that will have its fence replaced with
982 * the job's completion fence. Ignored if zero.
983 */
984 __u32 syncobj_out;
985
986 /**
987 * @syncpt_incr: [in,out]
988 *
989 * Information about the syncpoint the job will increment.
990 */
991 struct drm_tegra_submit_syncpt syncpt;
992};
993
994struct drm_tegra_syncpoint_allocate {
995 /**
996 * @id: [out]
997 *
998 * ID of allocated syncpoint.
999 */
1000 __u32 id;
1001 __u32 padding;
1002};
1003
1004struct drm_tegra_syncpoint_free {
1005 /**
1006 * @id: [in]
1007 *
1008 * ID of syncpoint to free.
1009 */
1010 __u32 id;
1011 __u32 padding;
1012};
1013
1014struct drm_tegra_syncpoint_wait {
1015 /**
1016 * @timeout: [in]
1017 *
1018 * Absolute timestamp at which the wait will time out.
1019 */
1020 __s64 timeout_ns;
1021
1022 /**
1023 * @id: [in]
1024 *
1025 * ID of syncpoint to wait on.
1026 */
1027 __u32 id;
1028
1029 /**
1030 * @threshold: [in]
1031 *
1032 * Threshold to wait for.
1033 */
1034 __u32 threshold;
1035
1036 /**
1037 * @value: [out]
1038 *
1039 * Value of the syncpoint upon wait completion.
1040 */
1041 __u32 value;
1042
1043 __u32 padding;
1044};
1045
1046#define DRM_IOCTL_TEGRA_CHANNEL_OPEN DRM_IOWR(DRM_COMMAND_BASE + 0x10, struct drm_tegra_channel_open)
1047#define DRM_IOCTL_TEGRA_CHANNEL_CLOSE DRM_IOWR(DRM_COMMAND_BASE + 0x11, struct drm_tegra_channel_close)
1048#define DRM_IOCTL_TEGRA_CHANNEL_MAP DRM_IOWR(DRM_COMMAND_BASE + 0x12, struct drm_tegra_channel_map)
1049#define DRM_IOCTL_TEGRA_CHANNEL_UNMAP DRM_IOWR(DRM_COMMAND_BASE + 0x13, struct drm_tegra_channel_unmap)
1050#define DRM_IOCTL_TEGRA_CHANNEL_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + 0x14, struct drm_tegra_channel_submit)
1051
1052#define DRM_IOCTL_TEGRA_SYNCPOINT_ALLOCATE DRM_IOWR(DRM_COMMAND_BASE + 0x20, struct drm_tegra_syncpoint_allocate)
1053#define DRM_IOCTL_TEGRA_SYNCPOINT_FREE DRM_IOWR(DRM_COMMAND_BASE + 0x21, struct drm_tegra_syncpoint_free)
1054#define DRM_IOCTL_TEGRA_SYNCPOINT_WAIT DRM_IOWR(DRM_COMMAND_BASE + 0x22, struct drm_tegra_syncpoint_wait)
1055
1056#if defined(__cplusplus)
1057}
1058#endif
1059
1060#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/v3d_drm.h created+481
...@@ -0,0 +1,481 @@
1/*
2 * Copyright © 2014-2018 Broadcom
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef _V3D_DRM_H_
25#define _V3D_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33#define DRM_V3D_SUBMIT_CL 0x00
34#define DRM_V3D_WAIT_BO 0x01
35#define DRM_V3D_CREATE_BO 0x02
36#define DRM_V3D_MMAP_BO 0x03
37#define DRM_V3D_GET_PARAM 0x04
38#define DRM_V3D_GET_BO_OFFSET 0x05
39#define DRM_V3D_SUBMIT_TFU 0x06
40#define DRM_V3D_SUBMIT_CSD 0x07
41#define DRM_V3D_PERFMON_CREATE 0x08
42#define DRM_V3D_PERFMON_DESTROY 0x09
43#define DRM_V3D_PERFMON_GET_VALUES 0x0a
44
45#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
46#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
47#define DRM_IOCTL_V3D_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
48#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
49#define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
50#define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
51#define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
52#define DRM_IOCTL_V3D_SUBMIT_CSD DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CSD, struct drm_v3d_submit_csd)
53#define DRM_IOCTL_V3D_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_CREATE, \
54 struct drm_v3d_perfmon_create)
55#define DRM_IOCTL_V3D_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_DESTROY, \
56 struct drm_v3d_perfmon_destroy)
57#define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, \
58 struct drm_v3d_perfmon_get_values)
59
60#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
61#define DRM_V3D_SUBMIT_EXTENSION 0x02
62
63/* struct drm_v3d_extension - ioctl extensions
64 *
65 * Linked-list of generic extensions where the id identify which struct is
66 * pointed by ext_data. Therefore, DRM_V3D_EXT_ID_* is used on id to identify
67 * the extension type.
68 */
69struct drm_v3d_extension {
70 __u64 next;
71 __u32 id;
72#define DRM_V3D_EXT_ID_MULTI_SYNC 0x01
73 __u32 flags; /* mbz */
74};
75
76/* struct drm_v3d_sem - wait/signal semaphore
77 *
78 * If binary semaphore, it only takes syncobj handle and ignores flags and
79 * point fields. Point is defined for timeline syncobj feature.
80 */
81struct drm_v3d_sem {
82 __u32 handle; /* syncobj */
83 /* rsv below, for future uses */
84 __u32 flags;
85 __u64 point; /* for timeline sem support */
86 __u64 mbz[2]; /* must be zero, rsv */
87};
88
89/* Enum for each of the V3D queues. */
90enum v3d_queue {
91 V3D_BIN,
92 V3D_RENDER,
93 V3D_TFU,
94 V3D_CSD,
95 V3D_CACHE_CLEAN,
96};
97
98/**
99 * struct drm_v3d_multi_sync - ioctl extension to add support multiples
100 * syncobjs for commands submission.
101 *
102 * When an extension of DRM_V3D_EXT_ID_MULTI_SYNC id is defined, it points to
103 * this extension to define wait and signal dependencies, instead of single
104 * in/out sync entries on submitting commands. The field flags is used to
105 * determine the stage to set wait dependencies.
106 */
107struct drm_v3d_multi_sync {
108 struct drm_v3d_extension base;
109 /* Array of wait and signal semaphores */
110 __u64 in_syncs;
111 __u64 out_syncs;
112
113 /* Number of entries */
114 __u32 in_sync_count;
115 __u32 out_sync_count;
116
117 /* set the stage (v3d_queue) to sync */
118 __u32 wait_stage;
119
120 __u32 pad; /* mbz */
121};
122
123/**
124 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
125 * engine.
126 *
127 * This asks the kernel to have the GPU execute an optional binner
128 * command list, and a render command list.
129 *
130 * The L1T, slice, L2C, L2T, and GCA caches will be flushed before
131 * each CL executes. The VCD cache should be flushed (if necessary)
132 * by the submitted CLs. The TLB writes are guaranteed to have been
133 * flushed by the time the render done IRQ happens, which is the
134 * trigger for out_sync. Any dirtying of cachelines by the job (only
135 * possible using TMU writes) must be flushed by the caller using the
136 * DRM_V3D_SUBMIT_CL_FLUSH_CACHE_FLAG flag.
137 */
138struct drm_v3d_submit_cl {
139 /* Pointer to the binner command list.
140 *
141 * This is the first set of commands executed, which runs the
142 * coordinate shader to determine where primitives land on the screen,
143 * then writes out the state updates and draw calls necessary per tile
144 * to the tile allocation BO.
145 *
146 * This BCL will block on any previous BCL submitted on the
147 * same FD, but not on any RCL or BCLs submitted by other
148 * clients -- that is left up to the submitter to control
149 * using in_sync_bcl if necessary.
150 */
151 __u32 bcl_start;
152
153 /** End address of the BCL (first byte after the BCL) */
154 __u32 bcl_end;
155
156 /* Offset of the render command list.
157 *
158 * This is the second set of commands executed, which will either
159 * execute the tiles that have been set up by the BCL, or a fixed set
160 * of tiles (in the case of RCL-only blits).
161 *
162 * This RCL will block on this submit's BCL, and any previous
163 * RCL submitted on the same FD, but not on any RCL or BCLs
164 * submitted by other clients -- that is left up to the
165 * submitter to control using in_sync_rcl if necessary.
166 */
167 __u32 rcl_start;
168
169 /** End address of the RCL (first byte after the RCL) */
170 __u32 rcl_end;
171
172 /** An optional sync object to wait on before starting the BCL. */
173 __u32 in_sync_bcl;
174 /** An optional sync object to wait on before starting the RCL. */
175 __u32 in_sync_rcl;
176 /** An optional sync object to place the completion fence in. */
177 __u32 out_sync;
178
179 /* Offset of the tile alloc memory
180 *
181 * This is optional on V3D 3.3 (where the CL can set the value) but
182 * required on V3D 4.1.
183 */
184 __u32 qma;
185
186 /** Size of the tile alloc memory. */
187 __u32 qms;
188
189 /** Offset of the tile state data array. */
190 __u32 qts;
191
192 /* Pointer to a u32 array of the BOs that are referenced by the job.
193 */
194 __u64 bo_handles;
195
196 /* Number of BO handles passed in (size is that times 4). */
197 __u32 bo_handle_count;
198
199 /* DRM_V3D_SUBMIT_* properties */
200 __u32 flags;
201
202 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
203 __u32 perfmon_id;
204
205 __u32 pad;
206
207 /* Pointer to an array of ioctl extensions*/
208 __u64 extensions;
209};
210
211/**
212 * struct drm_v3d_wait_bo - ioctl argument for waiting for
213 * completion of the last DRM_V3D_SUBMIT_CL on a BO.
214 *
215 * This is useful for cases where multiple processes might be
216 * rendering to a BO and you want to wait for all rendering to be
217 * completed.
218 */
219struct drm_v3d_wait_bo {
220 __u32 handle;
221 __u32 pad;
222 __u64 timeout_ns;
223};
224
225/**
226 * struct drm_v3d_create_bo - ioctl argument for creating V3D BOs.
227 *
228 * There are currently no values for the flags argument, but it may be
229 * used in a future extension.
230 */
231struct drm_v3d_create_bo {
232 __u32 size;
233 __u32 flags;
234 /** Returned GEM handle for the BO. */
235 __u32 handle;
236 /**
237 * Returned offset for the BO in the V3D address space. This offset
238 * is private to the DRM fd and is valid for the lifetime of the GEM
239 * handle.
240 *
241 * This offset value will always be nonzero, since various HW
242 * units treat 0 specially.
243 */
244 __u32 offset;
245};
246
247/**
248 * struct drm_v3d_mmap_bo - ioctl argument for mapping V3D BOs.
249 *
250 * This doesn't actually perform an mmap. Instead, it returns the
251 * offset you need to use in an mmap on the DRM device node. This
252 * means that tools like valgrind end up knowing about the mapped
253 * memory.
254 *
255 * There are currently no values for the flags argument, but it may be
256 * used in a future extension.
257 */
258struct drm_v3d_mmap_bo {
259 /** Handle for the object being mapped. */
260 __u32 handle;
261 __u32 flags;
262 /** offset into the drm node to use for subsequent mmap call. */
263 __u64 offset;
264};
265
266enum drm_v3d_param {
267 DRM_V3D_PARAM_V3D_UIFCFG,
268 DRM_V3D_PARAM_V3D_HUB_IDENT1,
269 DRM_V3D_PARAM_V3D_HUB_IDENT2,
270 DRM_V3D_PARAM_V3D_HUB_IDENT3,
271 DRM_V3D_PARAM_V3D_CORE0_IDENT0,
272 DRM_V3D_PARAM_V3D_CORE0_IDENT1,
273 DRM_V3D_PARAM_V3D_CORE0_IDENT2,
274 DRM_V3D_PARAM_SUPPORTS_TFU,
275 DRM_V3D_PARAM_SUPPORTS_CSD,
276 DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH,
277 DRM_V3D_PARAM_SUPPORTS_PERFMON,
278 DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
279};
280
281struct drm_v3d_get_param {
282 __u32 param;
283 __u32 pad;
284 __u64 value;
285};
286
287/**
288 * Returns the offset for the BO in the V3D address space for this DRM fd.
289 * This is the same value returned by drm_v3d_create_bo, if that was called
290 * from this DRM fd.
291 */
292struct drm_v3d_get_bo_offset {
293 __u32 handle;
294 __u32 offset;
295};
296
297struct drm_v3d_submit_tfu {
298 __u32 icfg;
299 __u32 iia;
300 __u32 iis;
301 __u32 ica;
302 __u32 iua;
303 __u32 ioa;
304 __u32 ios;
305 __u32 coef[4];
306 /* First handle is the output BO, following are other inputs.
307 * 0 for unused.
308 */
309 __u32 bo_handles[4];
310 /* sync object to block on before running the TFU job. Each TFU
311 * job will execute in the order submitted to its FD. Synchronization
312 * against rendering jobs requires using sync objects.
313 */
314 __u32 in_sync;
315 /* Sync object to signal when the TFU job is done. */
316 __u32 out_sync;
317
318 __u32 flags;
319
320 /* Pointer to an array of ioctl extensions*/
321 __u64 extensions;
322};
323
324/* Submits a compute shader for dispatch. This job will block on any
325 * previous compute shaders submitted on this fd, and any other
326 * synchronization must be performed with in_sync/out_sync.
327 */
328struct drm_v3d_submit_csd {
329 __u32 cfg[7];
330 __u32 coef[4];
331
332 /* Pointer to a u32 array of the BOs that are referenced by the job.
333 */
334 __u64 bo_handles;
335
336 /* Number of BO handles passed in (size is that times 4). */
337 __u32 bo_handle_count;
338
339 /* sync object to block on before running the CSD job. Each
340 * CSD job will execute in the order submitted to its FD.
341 * Synchronization against rendering/TFU jobs or CSD from
342 * other fds requires using sync objects.
343 */
344 __u32 in_sync;
345 /* Sync object to signal when the CSD job is done. */
346 __u32 out_sync;
347
348 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
349 __u32 perfmon_id;
350
351 /* Pointer to an array of ioctl extensions*/
352 __u64 extensions;
353
354 __u32 flags;
355
356 __u32 pad;
357};
358
359enum {
360 V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS,
361 V3D_PERFCNT_FEP_VALID_PRIMS,
362 V3D_PERFCNT_FEP_EZ_NFCLIP_QUADS,
363 V3D_PERFCNT_FEP_VALID_QUADS,
364 V3D_PERFCNT_TLB_QUADS_STENCIL_FAIL,
365 V3D_PERFCNT_TLB_QUADS_STENCILZ_FAIL,
366 V3D_PERFCNT_TLB_QUADS_STENCILZ_PASS,
367 V3D_PERFCNT_TLB_QUADS_ZERO_COV,
368 V3D_PERFCNT_TLB_QUADS_NONZERO_COV,
369 V3D_PERFCNT_TLB_QUADS_WRITTEN,
370 V3D_PERFCNT_PTB_PRIM_VIEWPOINT_DISCARD,
371 V3D_PERFCNT_PTB_PRIM_CLIP,
372 V3D_PERFCNT_PTB_PRIM_REV,
373 V3D_PERFCNT_QPU_IDLE_CYCLES,
374 V3D_PERFCNT_QPU_ACTIVE_CYCLES_VERTEX_COORD_USER,
375 V3D_PERFCNT_QPU_ACTIVE_CYCLES_FRAG,
376 V3D_PERFCNT_QPU_CYCLES_VALID_INSTR,
377 V3D_PERFCNT_QPU_CYCLES_TMU_STALL,
378 V3D_PERFCNT_QPU_CYCLES_SCOREBOARD_STALL,
379 V3D_PERFCNT_QPU_CYCLES_VARYINGS_STALL,
380 V3D_PERFCNT_QPU_IC_HIT,
381 V3D_PERFCNT_QPU_IC_MISS,
382 V3D_PERFCNT_QPU_UC_HIT,
383 V3D_PERFCNT_QPU_UC_MISS,
384 V3D_PERFCNT_TMU_TCACHE_ACCESS,
385 V3D_PERFCNT_TMU_TCACHE_MISS,
386 V3D_PERFCNT_VPM_VDW_STALL,
387 V3D_PERFCNT_VPM_VCD_STALL,
388 V3D_PERFCNT_BIN_ACTIVE,
389 V3D_PERFCNT_RDR_ACTIVE,
390 V3D_PERFCNT_L2T_HITS,
391 V3D_PERFCNT_L2T_MISSES,
392 V3D_PERFCNT_CYCLE_COUNT,
393 V3D_PERFCNT_QPU_CYCLES_STALLED_VERTEX_COORD_USER,
394 V3D_PERFCNT_QPU_CYCLES_STALLED_FRAGMENT,
395 V3D_PERFCNT_PTB_PRIMS_BINNED,
396 V3D_PERFCNT_AXI_WRITES_WATCH_0,
397 V3D_PERFCNT_AXI_READS_WATCH_0,
398 V3D_PERFCNT_AXI_WRITE_STALLS_WATCH_0,
399 V3D_PERFCNT_AXI_READ_STALLS_WATCH_0,
400 V3D_PERFCNT_AXI_WRITE_BYTES_WATCH_0,
401 V3D_PERFCNT_AXI_READ_BYTES_WATCH_0,
402 V3D_PERFCNT_AXI_WRITES_WATCH_1,
403 V3D_PERFCNT_AXI_READS_WATCH_1,
404 V3D_PERFCNT_AXI_WRITE_STALLS_WATCH_1,
405 V3D_PERFCNT_AXI_READ_STALLS_WATCH_1,
406 V3D_PERFCNT_AXI_WRITE_BYTES_WATCH_1,
407 V3D_PERFCNT_AXI_READ_BYTES_WATCH_1,
408 V3D_PERFCNT_TLB_PARTIAL_QUADS,
409 V3D_PERFCNT_TMU_CONFIG_ACCESSES,
410 V3D_PERFCNT_L2T_NO_ID_STALL,
411 V3D_PERFCNT_L2T_COM_QUE_STALL,
412 V3D_PERFCNT_L2T_TMU_WRITES,
413 V3D_PERFCNT_TMU_ACTIVE_CYCLES,
414 V3D_PERFCNT_TMU_STALLED_CYCLES,
415 V3D_PERFCNT_CLE_ACTIVE,
416 V3D_PERFCNT_L2T_TMU_READS,
417 V3D_PERFCNT_L2T_CLE_READS,
418 V3D_PERFCNT_L2T_VCD_READS,
419 V3D_PERFCNT_L2T_TMUCFG_READS,
420 V3D_PERFCNT_L2T_SLC0_READS,
421 V3D_PERFCNT_L2T_SLC1_READS,
422 V3D_PERFCNT_L2T_SLC2_READS,
423 V3D_PERFCNT_L2T_TMU_W_MISSES,
424 V3D_PERFCNT_L2T_TMU_R_MISSES,
425 V3D_PERFCNT_L2T_CLE_MISSES,
426 V3D_PERFCNT_L2T_VCD_MISSES,
427 V3D_PERFCNT_L2T_TMUCFG_MISSES,
428 V3D_PERFCNT_L2T_SLC0_MISSES,
429 V3D_PERFCNT_L2T_SLC1_MISSES,
430 V3D_PERFCNT_L2T_SLC2_MISSES,
431 V3D_PERFCNT_CORE_MEM_WRITES,
432 V3D_PERFCNT_L2T_MEM_WRITES,
433 V3D_PERFCNT_PTB_MEM_WRITES,
434 V3D_PERFCNT_TLB_MEM_WRITES,
435 V3D_PERFCNT_CORE_MEM_READS,
436 V3D_PERFCNT_L2T_MEM_READS,
437 V3D_PERFCNT_PTB_MEM_READS,
438 V3D_PERFCNT_PSE_MEM_READS,
439 V3D_PERFCNT_TLB_MEM_READS,
440 V3D_PERFCNT_GMP_MEM_READS,
441 V3D_PERFCNT_PTB_W_MEM_WORDS,
442 V3D_PERFCNT_TLB_W_MEM_WORDS,
443 V3D_PERFCNT_PSE_R_MEM_WORDS,
444 V3D_PERFCNT_TLB_R_MEM_WORDS,
445 V3D_PERFCNT_TMU_MRU_HITS,
446 V3D_PERFCNT_COMPUTE_ACTIVE,
447 V3D_PERFCNT_NUM,
448};
449
450#define DRM_V3D_MAX_PERF_COUNTERS 32
451
452struct drm_v3d_perfmon_create {
453 __u32 id;
454 __u32 ncounters;
455 __u8 counters[DRM_V3D_MAX_PERF_COUNTERS];
456};
457
458struct drm_v3d_perfmon_destroy {
459 __u32 id;
460};
461
462/*
463 * Returns the values of the performance counters tracked by this
464 * perfmon (as an array of ncounters u64 values).
465 *
466 * No implicit synchronization is performed, so the user has to
467 * guarantee that any jobs using this perfmon have already been
468 * completed (probably by blocking on the seqno returned by the
469 * last exec that used the perfmon).
470 */
471struct drm_v3d_perfmon_get_values {
472 __u32 id;
473 __u32 pad;
474 __u64 values_ptr;
475};
476
477#if defined(__cplusplus)
478}
479#endif
480
481#endif /* _V3D_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/vc4_drm.h created+442
...@@ -0,0 +1,442 @@
1/*
2 * Copyright © 2014-2015 Broadcom
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef _VC4_DRM_H_
25#define _VC4_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33#define DRM_VC4_SUBMIT_CL 0x00
34#define DRM_VC4_WAIT_SEQNO 0x01
35#define DRM_VC4_WAIT_BO 0x02
36#define DRM_VC4_CREATE_BO 0x03
37#define DRM_VC4_MMAP_BO 0x04
38#define DRM_VC4_CREATE_SHADER_BO 0x05
39#define DRM_VC4_GET_HANG_STATE 0x06
40#define DRM_VC4_GET_PARAM 0x07
41#define DRM_VC4_SET_TILING 0x08
42#define DRM_VC4_GET_TILING 0x09
43#define DRM_VC4_LABEL_BO 0x0a
44#define DRM_VC4_GEM_MADVISE 0x0b
45#define DRM_VC4_PERFMON_CREATE 0x0c
46#define DRM_VC4_PERFMON_DESTROY 0x0d
47#define DRM_VC4_PERFMON_GET_VALUES 0x0e
48
49#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl)
50#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno)
51#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo)
52#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo)
53#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
54#define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo)
55#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state)
56#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param)
57#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling)
58#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling)
59#define DRM_IOCTL_VC4_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_LABEL_BO, struct drm_vc4_label_bo)
60#define DRM_IOCTL_VC4_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GEM_MADVISE, struct drm_vc4_gem_madvise)
61#define DRM_IOCTL_VC4_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_CREATE, struct drm_vc4_perfmon_create)
62#define DRM_IOCTL_VC4_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_DESTROY, struct drm_vc4_perfmon_destroy)
63#define DRM_IOCTL_VC4_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_GET_VALUES, struct drm_vc4_perfmon_get_values)
64
65struct drm_vc4_submit_rcl_surface {
66 __u32 hindex; /* Handle index, or ~0 if not present. */
67 __u32 offset; /* Offset to start of buffer. */
68 /*
69 * Bits for either render config (color_write) or load/store packet.
70 * Bits should all be 0 for MSAA load/stores.
71 */
72 __u16 bits;
73
74#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES (1 << 0)
75 __u16 flags;
76};
77
78/**
79 * struct drm_vc4_submit_cl - ioctl argument for submitting commands to the 3D
80 * engine.
81 *
82 * Drivers typically use GPU BOs to store batchbuffers / command lists and
83 * their associated state. However, because the VC4 lacks an MMU, we have to
84 * do validation of memory accesses by the GPU commands. If we were to store
85 * our commands in BOs, we'd need to do uncached readback from them to do the
86 * validation process, which is too expensive. Instead, userspace accumulates
87 * commands and associated state in plain memory, then the kernel copies the
88 * data to its own address space, and then validates and stores it in a GPU
89 * BO.
90 */
91struct drm_vc4_submit_cl {
92 /* Pointer to the binner command list.
93 *
94 * This is the first set of commands executed, which runs the
95 * coordinate shader to determine where primitives land on the screen,
96 * then writes out the state updates and draw calls necessary per tile
97 * to the tile allocation BO.
98 */
99 __u64 bin_cl;
100
101 /* Pointer to the shader records.
102 *
103 * Shader records are the structures read by the hardware that contain
104 * pointers to uniforms, shaders, and vertex attributes. The
105 * reference to the shader record has enough information to determine
106 * how many pointers are necessary (fixed number for shaders/uniforms,
107 * and an attribute count), so those BO indices into bo_handles are
108 * just stored as __u32s before each shader record passed in.
109 */
110 __u64 shader_rec;
111
112 /* Pointer to uniform data and texture handles for the textures
113 * referenced by the shader.
114 *
115 * For each shader state record, there is a set of uniform data in the
116 * order referenced by the record (FS, VS, then CS). Each set of
117 * uniform data has a __u32 index into bo_handles per texture
118 * sample operation, in the order the QPU_W_TMUn_S writes appear in
119 * the program. Following the texture BO handle indices is the actual
120 * uniform data.
121 *
122 * The individual uniform state blocks don't have sizes passed in,
123 * because the kernel has to determine the sizes anyway during shader
124 * code validation.
125 */
126 __u64 uniforms;
127 __u64 bo_handles;
128
129 /* Size in bytes of the binner command list. */
130 __u32 bin_cl_size;
131 /* Size in bytes of the set of shader records. */
132 __u32 shader_rec_size;
133 /* Number of shader records.
134 *
135 * This could just be computed from the contents of shader_records and
136 * the address bits of references to them from the bin CL, but it
137 * keeps the kernel from having to resize some allocations it makes.
138 */
139 __u32 shader_rec_count;
140 /* Size in bytes of the uniform state. */
141 __u32 uniforms_size;
142
143 /* Number of BO handles passed in (size is that times 4). */
144 __u32 bo_handle_count;
145
146 /* RCL setup: */
147 __u16 width;
148 __u16 height;
149 __u8 min_x_tile;
150 __u8 min_y_tile;
151 __u8 max_x_tile;
152 __u8 max_y_tile;
153 struct drm_vc4_submit_rcl_surface color_read;
154 struct drm_vc4_submit_rcl_surface color_write;
155 struct drm_vc4_submit_rcl_surface zs_read;
156 struct drm_vc4_submit_rcl_surface zs_write;
157 struct drm_vc4_submit_rcl_surface msaa_color_write;
158 struct drm_vc4_submit_rcl_surface msaa_zs_write;
159 __u32 clear_color[2];
160 __u32 clear_z;
161 __u8 clear_s;
162
163 __u32 pad:24;
164
165#define VC4_SUBMIT_CL_USE_CLEAR_COLOR (1 << 0)
166/* By default, the kernel gets to choose the order that the tiles are
167 * rendered in. If this is set, then the tiles will be rendered in a
168 * raster order, with the right-to-left vs left-to-right and
169 * top-to-bottom vs bottom-to-top dictated by
170 * VC4_SUBMIT_CL_RCL_ORDER_INCREASING_*. This allows overlapping
171 * blits to be implemented using the 3D engine.
172 */
173#define VC4_SUBMIT_CL_FIXED_RCL_ORDER (1 << 1)
174#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_X (1 << 2)
175#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_Y (1 << 3)
176 __u32 flags;
177
178 /* Returned value of the seqno of this render job (for the
179 * wait ioctl).
180 */
181 __u64 seqno;
182
183 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
184 __u32 perfmonid;
185
186 /* Syncobj handle to wait on. If set, processing of this render job
187 * will not start until the syncobj is signaled. 0 means ignore.
188 */
189 __u32 in_sync;
190
191 /* Syncobj handle to export fence to. If set, the fence in the syncobj
192 * will be replaced with a fence that signals upon completion of this
193 * render job. 0 means ignore.
194 */
195 __u32 out_sync;
196
197 __u32 pad2;
198};
199
200/**
201 * struct drm_vc4_wait_seqno - ioctl argument for waiting for
202 * DRM_VC4_SUBMIT_CL completion using its returned seqno.
203 *
204 * timeout_ns is the timeout in nanoseconds, where "0" means "don't
205 * block, just return the status."
206 */
207struct drm_vc4_wait_seqno {
208 __u64 seqno;
209 __u64 timeout_ns;
210};
211
212/**
213 * struct drm_vc4_wait_bo - ioctl argument for waiting for
214 * completion of the last DRM_VC4_SUBMIT_CL on a BO.
215 *
216 * This is useful for cases where multiple processes might be
217 * rendering to a BO and you want to wait for all rendering to be
218 * completed.
219 */
220struct drm_vc4_wait_bo {
221 __u32 handle;
222 __u32 pad;
223 __u64 timeout_ns;
224};
225
226/**
227 * struct drm_vc4_create_bo - ioctl argument for creating VC4 BOs.
228 *
229 * There are currently no values for the flags argument, but it may be
230 * used in a future extension.
231 */
232struct drm_vc4_create_bo {
233 __u32 size;
234 __u32 flags;
235 /** Returned GEM handle for the BO. */
236 __u32 handle;
237 __u32 pad;
238};
239
240/**
241 * struct drm_vc4_mmap_bo - ioctl argument for mapping VC4 BOs.
242 *
243 * This doesn't actually perform an mmap. Instead, it returns the
244 * offset you need to use in an mmap on the DRM device node. This
245 * means that tools like valgrind end up knowing about the mapped
246 * memory.
247 *
248 * There are currently no values for the flags argument, but it may be
249 * used in a future extension.
250 */
251struct drm_vc4_mmap_bo {
252 /** Handle for the object being mapped. */
253 __u32 handle;
254 __u32 flags;
255 /** offset into the drm node to use for subsequent mmap call. */
256 __u64 offset;
257};
258
259/**
260 * struct drm_vc4_create_shader_bo - ioctl argument for creating VC4
261 * shader BOs.
262 *
263 * Since allowing a shader to be overwritten while it's also being
264 * executed from would allow privlege escalation, shaders must be
265 * created using this ioctl, and they can't be mmapped later.
266 */
267struct drm_vc4_create_shader_bo {
268 /* Size of the data argument. */
269 __u32 size;
270 /* Flags, currently must be 0. */
271 __u32 flags;
272
273 /* Pointer to the data. */
274 __u64 data;
275
276 /** Returned GEM handle for the BO. */
277 __u32 handle;
278 /* Pad, must be 0. */
279 __u32 pad;
280};
281
282struct drm_vc4_get_hang_state_bo {
283 __u32 handle;
284 __u32 paddr;
285 __u32 size;
286 __u32 pad;
287};
288
289/**
290 * struct drm_vc4_hang_state - ioctl argument for collecting state
291 * from a GPU hang for analysis.
292*/
293struct drm_vc4_get_hang_state {
294 /** Pointer to array of struct drm_vc4_get_hang_state_bo. */
295 __u64 bo;
296 /**
297 * On input, the size of the bo array. Output is the number
298 * of bos to be returned.
299 */
300 __u32 bo_count;
301
302 __u32 start_bin, start_render;
303
304 __u32 ct0ca, ct0ea;
305 __u32 ct1ca, ct1ea;
306 __u32 ct0cs, ct1cs;
307 __u32 ct0ra0, ct1ra0;
308
309 __u32 bpca, bpcs;
310 __u32 bpoa, bpos;
311
312 __u32 vpmbase;
313
314 __u32 dbge;
315 __u32 fdbgo;
316 __u32 fdbgb;
317 __u32 fdbgr;
318 __u32 fdbgs;
319 __u32 errstat;
320
321 /* Pad that we may save more registers into in the future. */
322 __u32 pad[16];
323};
324
325#define DRM_VC4_PARAM_V3D_IDENT0 0
326#define DRM_VC4_PARAM_V3D_IDENT1 1
327#define DRM_VC4_PARAM_V3D_IDENT2 2
328#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3
329#define DRM_VC4_PARAM_SUPPORTS_ETC1 4
330#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5
331#define DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER 6
332#define DRM_VC4_PARAM_SUPPORTS_MADVISE 7
333#define DRM_VC4_PARAM_SUPPORTS_PERFMON 8
334
335struct drm_vc4_get_param {
336 __u32 param;
337 __u32 pad;
338 __u64 value;
339};
340
341struct drm_vc4_get_tiling {
342 __u32 handle;
343 __u32 flags;
344 __u64 modifier;
345};
346
347struct drm_vc4_set_tiling {
348 __u32 handle;
349 __u32 flags;
350 __u64 modifier;
351};
352
353/**
354 * struct drm_vc4_label_bo - Attach a name to a BO for debug purposes.
355 */
356struct drm_vc4_label_bo {
357 __u32 handle;
358 __u32 len;
359 __u64 name;
360};
361
362/*
363 * States prefixed with '__' are internal states and cannot be passed to the
364 * DRM_IOCTL_VC4_GEM_MADVISE ioctl.
365 */
366#define VC4_MADV_WILLNEED 0
367#define VC4_MADV_DONTNEED 1
368#define __VC4_MADV_PURGED 2
369#define __VC4_MADV_NOTSUPP 3
370
371struct drm_vc4_gem_madvise {
372 __u32 handle;
373 __u32 madv;
374 __u32 retained;
375 __u32 pad;
376};
377
378enum {
379 VC4_PERFCNT_FEP_VALID_PRIMS_NO_RENDER,
380 VC4_PERFCNT_FEP_VALID_PRIMS_RENDER,
381 VC4_PERFCNT_FEP_CLIPPED_QUADS,
382 VC4_PERFCNT_FEP_VALID_QUADS,
383 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_STENCIL,
384 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_Z_AND_STENCIL,
385 VC4_PERFCNT_TLB_QUADS_PASSING_Z_AND_STENCIL,
386 VC4_PERFCNT_TLB_QUADS_ZERO_COVERAGE,
387 VC4_PERFCNT_TLB_QUADS_NON_ZERO_COVERAGE,
388 VC4_PERFCNT_TLB_QUADS_WRITTEN_TO_COLOR_BUF,
389 VC4_PERFCNT_PLB_PRIMS_OUTSIDE_VIEWPORT,
390 VC4_PERFCNT_PLB_PRIMS_NEED_CLIPPING,
391 VC4_PERFCNT_PSE_PRIMS_REVERSED,
392 VC4_PERFCNT_QPU_TOTAL_IDLE_CYCLES,
393 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_VERTEX_COORD_SHADING,
394 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_FRAGMENT_SHADING,
395 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_EXEC_VALID_INST,
396 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_TMUS,
397 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_SCOREBOARD,
398 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_VARYINGS,
399 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_HIT,
400 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_MISS,
401 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_HIT,
402 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_MISS,
403 VC4_PERFCNT_TMU_TOTAL_TEXT_QUADS_PROCESSED,
404 VC4_PERFCNT_TMU_TOTAL_TEXT_CACHE_MISS,
405 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VDW_STALLED,
406 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VCD_STALLED,
407 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_HIT,
408 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_MISS,
409 VC4_PERFCNT_NUM_EVENTS,
410};
411
412#define DRM_VC4_MAX_PERF_COUNTERS 16
413
414struct drm_vc4_perfmon_create {
415 __u32 id;
416 __u32 ncounters;
417 __u8 events[DRM_VC4_MAX_PERF_COUNTERS];
418};
419
420struct drm_vc4_perfmon_destroy {
421 __u32 id;
422};
423
424/*
425 * Returns the values of the performance counters tracked by this
426 * perfmon (as an array of ncounters u64 values).
427 *
428 * No implicit synchronization is performed, so the user has to
429 * guarantee that any jobs using this perfmon have already been
430 * completed (probably by blocking on the seqno returned by the
431 * last exec that used the perfmon).
432 */
433struct drm_vc4_perfmon_get_values {
434 __u32 id;
435 __u64 values_ptr;
436};
437
438#if defined(__cplusplus)
439}
440#endif
441
442#endif /* _VC4_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/vgem_drm.h created+62
...@@ -0,0 +1,62 @@
1/*
2 * Copyright 2016 Intel Corporation
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#ifndef _VGEM_DRM_H_
28#define _VGEM_DRM_H_
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* Please note that modifications to all structs defined here are
37 * subject to backwards-compatibility constraints.
38 */
39#define DRM_VGEM_FENCE_ATTACH 0x1
40#define DRM_VGEM_FENCE_SIGNAL 0x2
41
42#define DRM_IOCTL_VGEM_FENCE_ATTACH DRM_IOWR( DRM_COMMAND_BASE + DRM_VGEM_FENCE_ATTACH, struct drm_vgem_fence_attach)
43#define DRM_IOCTL_VGEM_FENCE_SIGNAL DRM_IOW( DRM_COMMAND_BASE + DRM_VGEM_FENCE_SIGNAL, struct drm_vgem_fence_signal)
44
45struct drm_vgem_fence_attach {
46 __u32 handle;
47 __u32 flags;
48#define VGEM_FENCE_WRITE 0x1
49 __u32 out_fence;
50 __u32 pad;
51};
52
53struct drm_vgem_fence_signal {
54 __u32 fence;
55 __u32 flags;
56};
57
58#if defined(__cplusplus)
59}
60#endif
61
62#endif /* _VGEM_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/via_drm.h created+282
...@@ -0,0 +1,282 @@
1/*
2 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24#ifndef _VIA_DRM_H_
25#define _VIA_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* WARNING: These defines must be the same as what the Xserver uses.
34 * if you change them, you must change the defines in the Xserver.
35 */
36
37#ifndef _VIA_DEFINES_
38#define _VIA_DEFINES_
39
40
41#define VIA_NR_SAREA_CLIPRECTS 8
42#define VIA_NR_XVMC_PORTS 10
43#define VIA_NR_XVMC_LOCKS 5
44#define VIA_MAX_CACHELINE_SIZE 64
45#define XVMCLOCKPTR(saPriv,lockNo) \
46 ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
47 (VIA_MAX_CACHELINE_SIZE - 1)) & \
48 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
49 VIA_MAX_CACHELINE_SIZE*(lockNo)))
50
51/* Each region is a minimum of 64k, and there are at most 64 of them.
52 */
53#define VIA_NR_TEX_REGIONS 64
54#define VIA_LOG_MIN_TEX_REGION_SIZE 16
55#endif
56
57#define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
58#define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
59#define VIA_UPLOAD_CTX 0x4
60#define VIA_UPLOAD_BUFFERS 0x8
61#define VIA_UPLOAD_TEX0 0x10
62#define VIA_UPLOAD_TEX1 0x20
63#define VIA_UPLOAD_CLIPRECTS 0x40
64#define VIA_UPLOAD_ALL 0xff
65
66/* VIA specific ioctls */
67#define DRM_VIA_ALLOCMEM 0x00
68#define DRM_VIA_FREEMEM 0x01
69#define DRM_VIA_AGP_INIT 0x02
70#define DRM_VIA_FB_INIT 0x03
71#define DRM_VIA_MAP_INIT 0x04
72#define DRM_VIA_DEC_FUTEX 0x05
73#define NOT_USED
74#define DRM_VIA_DMA_INIT 0x07
75#define DRM_VIA_CMDBUFFER 0x08
76#define DRM_VIA_FLUSH 0x09
77#define DRM_VIA_PCICMD 0x0a
78#define DRM_VIA_CMDBUF_SIZE 0x0b
79#define NOT_USED
80#define DRM_VIA_WAIT_IRQ 0x0d
81#define DRM_VIA_DMA_BLIT 0x0e
82#define DRM_VIA_BLIT_SYNC 0x0f
83
84#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
85#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
86#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
87#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
88#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
89#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
90#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
91#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
92#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
93#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
94#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
95 drm_via_cmdbuf_size_t)
96#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
97#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
98#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
99
100/* Indices into buf.Setup where various bits of state are mirrored per
101 * context and per buffer. These can be fired at the card as a unit,
102 * or in a piecewise fashion as required.
103 */
104
105#define VIA_TEX_SETUP_SIZE 8
106
107/* Flags for clear ioctl
108 */
109#define VIA_FRONT 0x1
110#define VIA_BACK 0x2
111#define VIA_DEPTH 0x4
112#define VIA_STENCIL 0x8
113#define VIA_MEM_VIDEO 0 /* matches drm constant */
114#define VIA_MEM_AGP 1 /* matches drm constant */
115#define VIA_MEM_SYSTEM 2
116#define VIA_MEM_MIXED 3
117#define VIA_MEM_UNKNOWN 4
118
119typedef struct {
120 __u32 offset;
121 __u32 size;
122} drm_via_agp_t;
123
124typedef struct {
125 __u32 offset;
126 __u32 size;
127} drm_via_fb_t;
128
129typedef struct {
130 __u32 context;
131 __u32 type;
132 __u32 size;
133 unsigned long index;
134 unsigned long offset;
135} drm_via_mem_t;
136
137typedef struct _drm_via_init {
138 enum {
139 VIA_INIT_MAP = 0x01,
140 VIA_CLEANUP_MAP = 0x02
141 } func;
142
143 unsigned long sarea_priv_offset;
144 unsigned long fb_offset;
145 unsigned long mmio_offset;
146 unsigned long agpAddr;
147} drm_via_init_t;
148
149typedef struct _drm_via_futex {
150 enum {
151 VIA_FUTEX_WAIT = 0x00,
152 VIA_FUTEX_WAKE = 0X01
153 } func;
154 __u32 ms;
155 __u32 lock;
156 __u32 val;
157} drm_via_futex_t;
158
159typedef struct _drm_via_dma_init {
160 enum {
161 VIA_INIT_DMA = 0x01,
162 VIA_CLEANUP_DMA = 0x02,
163 VIA_DMA_INITIALIZED = 0x03
164 } func;
165
166 unsigned long offset;
167 unsigned long size;
168 unsigned long reg_pause_addr;
169} drm_via_dma_init_t;
170
171typedef struct _drm_via_cmdbuffer {
172 char *buf;
173 unsigned long size;
174} drm_via_cmdbuffer_t;
175
176/* Warning: If you change the SAREA structure you must change the Xserver
177 * structure as well */
178
179typedef struct _drm_via_tex_region {
180 unsigned char next, prev; /* indices to form a circular LRU */
181 unsigned char inUse; /* owned by a client, or free? */
182 int age; /* tracked by clients to update local LRU's */
183} drm_via_tex_region_t;
184
185typedef struct _drm_via_sarea {
186 unsigned int dirty;
187 unsigned int nbox;
188 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
189 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
190 int texAge; /* last time texture was uploaded */
191 int ctxOwner; /* last context to upload state */
192 int vertexPrim;
193
194 /*
195 * Below is for XvMC.
196 * We want the lock integers alone on, and aligned to, a cache line.
197 * Therefore this somewhat strange construct.
198 */
199
200 char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
201
202 unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
203 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
204 unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
205
206 /* Used by the 3d driver only at this point, for pageflipping:
207 */
208 unsigned int pfCurrentOffset;
209} drm_via_sarea_t;
210
211typedef struct _drm_via_cmdbuf_size {
212 enum {
213 VIA_CMDBUF_SPACE = 0x01,
214 VIA_CMDBUF_LAG = 0x02
215 } func;
216 int wait;
217 __u32 size;
218} drm_via_cmdbuf_size_t;
219
220typedef enum {
221 VIA_IRQ_ABSOLUTE = 0x0,
222 VIA_IRQ_RELATIVE = 0x1,
223 VIA_IRQ_SIGNAL = 0x10000000,
224 VIA_IRQ_FORCE_SEQUENCE = 0x20000000
225} via_irq_seq_type_t;
226
227#define VIA_IRQ_FLAGS_MASK 0xF0000000
228
229enum drm_via_irqs {
230 drm_via_irq_hqv0 = 0,
231 drm_via_irq_hqv1,
232 drm_via_irq_dma0_dd,
233 drm_via_irq_dma0_td,
234 drm_via_irq_dma1_dd,
235 drm_via_irq_dma1_td,
236 drm_via_irq_num
237};
238
239struct drm_via_wait_irq_request {
240 unsigned irq;
241 via_irq_seq_type_t type;
242 __u32 sequence;
243 __u32 signal;
244};
245
246typedef union drm_via_irqwait {
247 struct drm_via_wait_irq_request request;
248 struct drm_wait_vblank_reply reply;
249} drm_via_irqwait_t;
250
251typedef struct drm_via_blitsync {
252 __u32 sync_handle;
253 unsigned engine;
254} drm_via_blitsync_t;
255
256/* - * Below,"flags" is currently unused but will be used for possible future
257 * extensions like kernel space bounce buffers for bad alignments and
258 * blit engine busy-wait polling for better latency in the absence of
259 * interrupts.
260 */
261
262typedef struct drm_via_dmablit {
263 __u32 num_lines;
264 __u32 line_length;
265
266 __u32 fb_addr;
267 __u32 fb_stride;
268
269 unsigned char *mem_addr;
270 __u32 mem_stride;
271
272 __u32 flags;
273 int to_fb;
274
275 drm_via_blitsync_t sync;
276} drm_via_dmablit_t;
277
278#if defined(__cplusplus)
279}
280#endif
281
282#endif /* _VIA_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/virtgpu_drm.h created+246
...@@ -0,0 +1,246 @@
1/*
2 * Copyright 2013 Red Hat
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef VIRTGPU_DRM_H
25#define VIRTGPU_DRM_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* Please note that modifications to all structs defined here are
34 * subject to backwards-compatibility constraints.
35 *
36 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
37 * compatibility Keep fields aligned to their size
38 */
39
40#define DRM_VIRTGPU_MAP 0x01
41#define DRM_VIRTGPU_EXECBUFFER 0x02
42#define DRM_VIRTGPU_GETPARAM 0x03
43#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
44#define DRM_VIRTGPU_RESOURCE_INFO 0x05
45#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
46#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
47#define DRM_VIRTGPU_WAIT 0x08
48#define DRM_VIRTGPU_GET_CAPS 0x09
49#define DRM_VIRTGPU_RESOURCE_CREATE_BLOB 0x0a
50#define DRM_VIRTGPU_CONTEXT_INIT 0x0b
51
52#define VIRTGPU_EXECBUF_FENCE_FD_IN 0x01
53#define VIRTGPU_EXECBUF_FENCE_FD_OUT 0x02
54#define VIRTGPU_EXECBUF_RING_IDX 0x04
55#define VIRTGPU_EXECBUF_FLAGS (\
56 VIRTGPU_EXECBUF_FENCE_FD_IN |\
57 VIRTGPU_EXECBUF_FENCE_FD_OUT |\
58 VIRTGPU_EXECBUF_RING_IDX |\
59 0)
60
61struct drm_virtgpu_map {
62 __u64 offset; /* use for mmap system call */
63 __u32 handle;
64 __u32 pad;
65};
66
67struct drm_virtgpu_execbuffer {
68 __u32 flags;
69 __u32 size;
70 __u64 command; /* void* */
71 __u64 bo_handles;
72 __u32 num_bo_handles;
73 __s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
74 __u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
75 __u32 pad;
76};
77
78#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
79#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
80#define VIRTGPU_PARAM_RESOURCE_BLOB 3 /* DRM_VIRTGPU_RESOURCE_CREATE_BLOB */
81#define VIRTGPU_PARAM_HOST_VISIBLE 4 /* Host blob resources are mappable */
82#define VIRTGPU_PARAM_CROSS_DEVICE 5 /* Cross virtio-device resource sharing */
83#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
84#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
85
86struct drm_virtgpu_getparam {
87 __u64 param;
88 __u64 value;
89};
90
91/* NO_BO flags? NO resource flag? */
92/* resource flag for y_0_top */
93struct drm_virtgpu_resource_create {
94 __u32 target;
95 __u32 format;
96 __u32 bind;
97 __u32 width;
98 __u32 height;
99 __u32 depth;
100 __u32 array_size;
101 __u32 last_level;
102 __u32 nr_samples;
103 __u32 flags;
104 __u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
105 __u32 res_handle; /* returned by kernel */
106 __u32 size; /* validate transfer in the host */
107 __u32 stride; /* validate transfer in the host */
108};
109
110struct drm_virtgpu_resource_info {
111 __u32 bo_handle;
112 __u32 res_handle;
113 __u32 size;
114 __u32 blob_mem;
115};
116
117struct drm_virtgpu_3d_box {
118 __u32 x;
119 __u32 y;
120 __u32 z;
121 __u32 w;
122 __u32 h;
123 __u32 d;
124};
125
126struct drm_virtgpu_3d_transfer_to_host {
127 __u32 bo_handle;
128 struct drm_virtgpu_3d_box box;
129 __u32 level;
130 __u32 offset;
131 __u32 stride;
132 __u32 layer_stride;
133};
134
135struct drm_virtgpu_3d_transfer_from_host {
136 __u32 bo_handle;
137 struct drm_virtgpu_3d_box box;
138 __u32 level;
139 __u32 offset;
140 __u32 stride;
141 __u32 layer_stride;
142};
143
144#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
145struct drm_virtgpu_3d_wait {
146 __u32 handle; /* 0 is an invalid handle */
147 __u32 flags;
148};
149
150struct drm_virtgpu_get_caps {
151 __u32 cap_set_id;
152 __u32 cap_set_ver;
153 __u64 addr;
154 __u32 size;
155 __u32 pad;
156};
157
158struct drm_virtgpu_resource_create_blob {
159#define VIRTGPU_BLOB_MEM_GUEST 0x0001
160#define VIRTGPU_BLOB_MEM_HOST3D 0x0002
161#define VIRTGPU_BLOB_MEM_HOST3D_GUEST 0x0003
162
163#define VIRTGPU_BLOB_FLAG_USE_MAPPABLE 0x0001
164#define VIRTGPU_BLOB_FLAG_USE_SHAREABLE 0x0002
165#define VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
166 /* zero is invalid blob_mem */
167 __u32 blob_mem;
168 __u32 blob_flags;
169 __u32 bo_handle;
170 __u32 res_handle;
171 __u64 size;
172
173 /*
174 * for 3D contexts with VIRTGPU_BLOB_MEM_HOST3D_GUEST and
175 * VIRTGPU_BLOB_MEM_HOST3D otherwise, must be zero.
176 */
177 __u32 pad;
178 __u32 cmd_size;
179 __u64 cmd;
180 __u64 blob_id;
181};
182
183#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001
184#define VIRTGPU_CONTEXT_PARAM_NUM_RINGS 0x0002
185#define VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK 0x0003
186struct drm_virtgpu_context_set_param {
187 __u64 param;
188 __u64 value;
189};
190
191struct drm_virtgpu_context_init {
192 __u32 num_params;
193 __u32 pad;
194
195 /* pointer to drm_virtgpu_context_set_param array */
196 __u64 ctx_set_params;
197};
198
199#define DRM_IOCTL_VIRTGPU_MAP \
200 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
201
202#define DRM_IOCTL_VIRTGPU_EXECBUFFER \
203 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
204 struct drm_virtgpu_execbuffer)
205
206#define DRM_IOCTL_VIRTGPU_GETPARAM \
207 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
208 struct drm_virtgpu_getparam)
209
210#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE \
211 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, \
212 struct drm_virtgpu_resource_create)
213
214#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
215 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
216 struct drm_virtgpu_resource_info)
217
218#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
219 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST, \
220 struct drm_virtgpu_3d_transfer_from_host)
221
222#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
223 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST, \
224 struct drm_virtgpu_3d_transfer_to_host)
225
226#define DRM_IOCTL_VIRTGPU_WAIT \
227 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, \
228 struct drm_virtgpu_3d_wait)
229
230#define DRM_IOCTL_VIRTGPU_GET_CAPS \
231 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
232 struct drm_virtgpu_get_caps)
233
234#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_BLOB \
235 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE_BLOB, \
236 struct drm_virtgpu_resource_create_blob)
237
238#define DRM_IOCTL_VIRTGPU_CONTEXT_INIT \
239 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_CONTEXT_INIT, \
240 struct drm_virtgpu_context_init)
241
242#if defined(__cplusplus)
243}
244#endif
245
246#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/vmwgfx_drm.h created+1284
...@@ -0,0 +1,1284 @@
1/**************************************************************************
2 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28#ifndef __VMWGFX_DRM_H__
29#define __VMWGFX_DRM_H__
30
31#include "drm.h"
32
33#if defined(__cplusplus)
34extern "C" {
35#endif
36
37#define DRM_VMW_MAX_SURFACE_FACES 6
38#define DRM_VMW_MAX_MIP_LEVELS 24
39
40
41#define DRM_VMW_GET_PARAM 0
42#define DRM_VMW_ALLOC_DMABUF 1
43#define DRM_VMW_ALLOC_BO 1
44#define DRM_VMW_UNREF_DMABUF 2
45#define DRM_VMW_HANDLE_CLOSE 2
46#define DRM_VMW_CURSOR_BYPASS 3
47/* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
48#define DRM_VMW_CONTROL_STREAM 4
49#define DRM_VMW_CLAIM_STREAM 5
50#define DRM_VMW_UNREF_STREAM 6
51/* guarded by DRM_VMW_PARAM_3D == 1 */
52#define DRM_VMW_CREATE_CONTEXT 7
53#define DRM_VMW_UNREF_CONTEXT 8
54#define DRM_VMW_CREATE_SURFACE 9
55#define DRM_VMW_UNREF_SURFACE 10
56#define DRM_VMW_REF_SURFACE 11
57#define DRM_VMW_EXECBUF 12
58#define DRM_VMW_GET_3D_CAP 13
59#define DRM_VMW_FENCE_WAIT 14
60#define DRM_VMW_FENCE_SIGNALED 15
61#define DRM_VMW_FENCE_UNREF 16
62#define DRM_VMW_FENCE_EVENT 17
63#define DRM_VMW_PRESENT 18
64#define DRM_VMW_PRESENT_READBACK 19
65#define DRM_VMW_UPDATE_LAYOUT 20
66#define DRM_VMW_CREATE_SHADER 21
67#define DRM_VMW_UNREF_SHADER 22
68#define DRM_VMW_GB_SURFACE_CREATE 23
69#define DRM_VMW_GB_SURFACE_REF 24
70#define DRM_VMW_SYNCCPU 25
71#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
72#define DRM_VMW_GB_SURFACE_CREATE_EXT 27
73#define DRM_VMW_GB_SURFACE_REF_EXT 28
74#define DRM_VMW_MSG 29
75#define DRM_VMW_MKSSTAT_RESET 30
76#define DRM_VMW_MKSSTAT_ADD 31
77#define DRM_VMW_MKSSTAT_REMOVE 32
78
79/*************************************************************************/
80/**
81 * DRM_VMW_GET_PARAM - get device information.
82 *
83 * DRM_VMW_PARAM_FIFO_OFFSET:
84 * Offset to use to map the first page of the FIFO read-only.
85 * The fifo is mapped using the mmap() system call on the drm device.
86 *
87 * DRM_VMW_PARAM_OVERLAY_IOCTL:
88 * Does the driver support the overlay ioctl.
89 *
90 * DRM_VMW_PARAM_SM4_1
91 * SM4_1 support is enabled.
92 *
93 * DRM_VMW_PARAM_SM5
94 * SM5 support is enabled.
95 */
96
97#define DRM_VMW_PARAM_NUM_STREAMS 0
98#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
99#define DRM_VMW_PARAM_3D 2
100#define DRM_VMW_PARAM_HW_CAPS 3
101#define DRM_VMW_PARAM_FIFO_CAPS 4
102#define DRM_VMW_PARAM_MAX_FB_SIZE 5
103#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
104#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
105#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
106#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
107#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
108#define DRM_VMW_PARAM_SCREEN_TARGET 11
109#define DRM_VMW_PARAM_DX 12
110#define DRM_VMW_PARAM_HW_CAPS2 13
111#define DRM_VMW_PARAM_SM4_1 14
112#define DRM_VMW_PARAM_SM5 15
113
114/**
115 * enum drm_vmw_handle_type - handle type for ref ioctls
116 *
117 */
118enum drm_vmw_handle_type {
119 DRM_VMW_HANDLE_LEGACY = 0,
120 DRM_VMW_HANDLE_PRIME = 1
121};
122
123/**
124 * struct drm_vmw_getparam_arg
125 *
126 * @value: Returned value. //Out
127 * @param: Parameter to query. //In.
128 *
129 * Argument to the DRM_VMW_GET_PARAM Ioctl.
130 */
131
132struct drm_vmw_getparam_arg {
133 __u64 value;
134 __u32 param;
135 __u32 pad64;
136};
137
138/*************************************************************************/
139/**
140 * DRM_VMW_CREATE_CONTEXT - Create a host context.
141 *
142 * Allocates a device unique context id, and queues a create context command
143 * for the host. Does not wait for host completion.
144 */
145
146/**
147 * struct drm_vmw_context_arg
148 *
149 * @cid: Device unique context ID.
150 *
151 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
152 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
153 */
154
155struct drm_vmw_context_arg {
156 __s32 cid;
157 __u32 pad64;
158};
159
160/*************************************************************************/
161/**
162 * DRM_VMW_UNREF_CONTEXT - Create a host context.
163 *
164 * Frees a global context id, and queues a destroy host command for the host.
165 * Does not wait for host completion. The context ID can be used directly
166 * in the command stream and shows up as the same context ID on the host.
167 */
168
169/*************************************************************************/
170/**
171 * DRM_VMW_CREATE_SURFACE - Create a host suface.
172 *
173 * Allocates a device unique surface id, and queues a create surface command
174 * for the host. Does not wait for host completion. The surface ID can be
175 * used directly in the command stream and shows up as the same surface
176 * ID on the host.
177 */
178
179/**
180 * struct drm_wmv_surface_create_req
181 *
182 * @flags: Surface flags as understood by the host.
183 * @format: Surface format as understood by the host.
184 * @mip_levels: Number of mip levels for each face.
185 * An unused face should have 0 encoded.
186 * @size_addr: Address of a user-space array of sruct drm_vmw_size
187 * cast to an __u64 for 32-64 bit compatibility.
188 * The size of the array should equal the total number of mipmap levels.
189 * @shareable: Boolean whether other clients (as identified by file descriptors)
190 * may reference this surface.
191 * @scanout: Boolean whether the surface is intended to be used as a
192 * scanout.
193 *
194 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
195 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
196 */
197
198struct drm_vmw_surface_create_req {
199 __u32 flags;
200 __u32 format;
201 __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
202 __u64 size_addr;
203 __s32 shareable;
204 __s32 scanout;
205};
206
207/**
208 * struct drm_wmv_surface_arg
209 *
210 * @sid: Surface id of created surface or surface to destroy or reference.
211 * @handle_type: Handle type for DRM_VMW_REF_SURFACE Ioctl.
212 *
213 * Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
214 * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
215 * Input argument to the DRM_VMW_REF_SURFACE Ioctl.
216 */
217
218struct drm_vmw_surface_arg {
219 __s32 sid;
220 enum drm_vmw_handle_type handle_type;
221};
222
223/**
224 * struct drm_vmw_size ioctl.
225 *
226 * @width - mip level width
227 * @height - mip level height
228 * @depth - mip level depth
229 *
230 * Description of a mip level.
231 * Input data to the DRM_WMW_CREATE_SURFACE Ioctl.
232 */
233
234struct drm_vmw_size {
235 __u32 width;
236 __u32 height;
237 __u32 depth;
238 __u32 pad64;
239};
240
241/**
242 * union drm_vmw_surface_create_arg
243 *
244 * @rep: Output data as described above.
245 * @req: Input data as described above.
246 *
247 * Argument to the DRM_VMW_CREATE_SURFACE Ioctl.
248 */
249
250union drm_vmw_surface_create_arg {
251 struct drm_vmw_surface_arg rep;
252 struct drm_vmw_surface_create_req req;
253};
254
255/*************************************************************************/
256/**
257 * DRM_VMW_REF_SURFACE - Reference a host surface.
258 *
259 * Puts a reference on a host surface with a give sid, as previously
260 * returned by the DRM_VMW_CREATE_SURFACE ioctl.
261 * A reference will make sure the surface isn't destroyed while we hold
262 * it and will allow the calling client to use the surface ID in the command
263 * stream.
264 *
265 * On successful return, the Ioctl returns the surface information given
266 * in the DRM_VMW_CREATE_SURFACE ioctl.
267 */
268
269/**
270 * union drm_vmw_surface_reference_arg
271 *
272 * @rep: Output data as described above.
273 * @req: Input data as described above.
274 *
275 * Argument to the DRM_VMW_REF_SURFACE Ioctl.
276 */
277
278union drm_vmw_surface_reference_arg {
279 struct drm_vmw_surface_create_req rep;
280 struct drm_vmw_surface_arg req;
281};
282
283/*************************************************************************/
284/**
285 * DRM_VMW_UNREF_SURFACE - Unreference a host surface.
286 *
287 * Clear a reference previously put on a host surface.
288 * When all references are gone, including the one implicitly placed
289 * on creation,
290 * a destroy surface command will be queued for the host.
291 * Does not wait for completion.
292 */
293
294/*************************************************************************/
295/**
296 * DRM_VMW_EXECBUF
297 *
298 * Submit a command buffer for execution on the host, and return a
299 * fence seqno that when signaled, indicates that the command buffer has
300 * executed.
301 */
302
303/**
304 * struct drm_vmw_execbuf_arg
305 *
306 * @commands: User-space address of a command buffer cast to an __u64.
307 * @command-size: Size in bytes of the command buffer.
308 * @throttle-us: Sleep until software is less than @throttle_us
309 * microseconds ahead of hardware. The driver may round this value
310 * to the nearest kernel tick.
311 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
312 * __u64.
313 * @version: Allows expanding the execbuf ioctl parameters without breaking
314 * backwards compatibility, since user-space will always tell the kernel
315 * which version it uses.
316 * @flags: Execbuf flags.
317 * @imported_fence_fd: FD for a fence imported from another device
318 *
319 * Argument to the DRM_VMW_EXECBUF Ioctl.
320 */
321
322#define DRM_VMW_EXECBUF_VERSION 2
323
324#define DRM_VMW_EXECBUF_FLAG_IMPORT_FENCE_FD (1 << 0)
325#define DRM_VMW_EXECBUF_FLAG_EXPORT_FENCE_FD (1 << 1)
326
327struct drm_vmw_execbuf_arg {
328 __u64 commands;
329 __u32 command_size;
330 __u32 throttle_us;
331 __u64 fence_rep;
332 __u32 version;
333 __u32 flags;
334 __u32 context_handle;
335 __s32 imported_fence_fd;
336};
337
338/**
339 * struct drm_vmw_fence_rep
340 *
341 * @handle: Fence object handle for fence associated with a command submission.
342 * @mask: Fence flags relevant for this fence object.
343 * @seqno: Fence sequence number in fifo. A fence object with a lower
344 * seqno will signal the EXEC flag before a fence object with a higher
345 * seqno. This can be used by user-space to avoid kernel calls to determine
346 * whether a fence has signaled the EXEC flag. Note that @seqno will
347 * wrap at 32-bit.
348 * @passed_seqno: The highest seqno number processed by the hardware
349 * so far. This can be used to mark user-space fence objects as signaled, and
350 * to determine whether a fence seqno might be stale.
351 * @fd: FD associated with the fence, -1 if not exported
352 * @error: This member should've been set to -EFAULT on submission.
353 * The following actions should be take on completion:
354 * error == -EFAULT: Fence communication failed. The host is synchronized.
355 * Use the last fence id read from the FIFO fence register.
356 * error != 0 && error != -EFAULT:
357 * Fence submission failed. The host is synchronized. Use the fence_seq member.
358 * error == 0: All is OK, The host may not be synchronized.
359 * Use the fence_seq member.
360 *
361 * Input / Output data to the DRM_VMW_EXECBUF Ioctl.
362 */
363
364struct drm_vmw_fence_rep {
365 __u32 handle;
366 __u32 mask;
367 __u32 seqno;
368 __u32 passed_seqno;
369 __s32 fd;
370 __s32 error;
371};
372
373/*************************************************************************/
374/**
375 * DRM_VMW_ALLOC_BO
376 *
377 * Allocate a buffer object that is visible also to the host.
378 * NOTE: The buffer is
379 * identified by a handle and an offset, which are private to the guest, but
380 * useable in the command stream. The guest kernel may translate these
381 * and patch up the command stream accordingly. In the future, the offset may
382 * be zero at all times, or it may disappear from the interface before it is
383 * fixed.
384 *
385 * The buffer object may stay user-space mapped in the guest at all times,
386 * and is thus suitable for sub-allocation.
387 *
388 * Buffer objects are mapped using the mmap() syscall on the drm device.
389 */
390
391/**
392 * struct drm_vmw_alloc_bo_req
393 *
394 * @size: Required minimum size of the buffer.
395 *
396 * Input data to the DRM_VMW_ALLOC_BO Ioctl.
397 */
398
399struct drm_vmw_alloc_bo_req {
400 __u32 size;
401 __u32 pad64;
402};
403#define drm_vmw_alloc_dmabuf_req drm_vmw_alloc_bo_req
404
405/**
406 * struct drm_vmw_bo_rep
407 *
408 * @map_handle: Offset to use in the mmap() call used to map the buffer.
409 * @handle: Handle unique to this buffer. Used for unreferencing.
410 * @cur_gmr_id: GMR id to use in the command stream when this buffer is
411 * referenced. See not above.
412 * @cur_gmr_offset: Offset to use in the command stream when this buffer is
413 * referenced. See note above.
414 *
415 * Output data from the DRM_VMW_ALLOC_BO Ioctl.
416 */
417
418struct drm_vmw_bo_rep {
419 __u64 map_handle;
420 __u32 handle;
421 __u32 cur_gmr_id;
422 __u32 cur_gmr_offset;
423 __u32 pad64;
424};
425#define drm_vmw_dmabuf_rep drm_vmw_bo_rep
426
427/**
428 * union drm_vmw_alloc_bo_arg
429 *
430 * @req: Input data as described above.
431 * @rep: Output data as described above.
432 *
433 * Argument to the DRM_VMW_ALLOC_BO Ioctl.
434 */
435
436union drm_vmw_alloc_bo_arg {
437 struct drm_vmw_alloc_bo_req req;
438 struct drm_vmw_bo_rep rep;
439};
440#define drm_vmw_alloc_dmabuf_arg drm_vmw_alloc_bo_arg
441
442/*************************************************************************/
443/**
444 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
445 *
446 * This IOCTL controls the overlay units of the svga device.
447 * The SVGA overlay units does not work like regular hardware units in
448 * that they do not automaticaly read back the contents of the given dma
449 * buffer. But instead only read back for each call to this ioctl, and
450 * at any point between this call being made and a following call that
451 * either changes the buffer or disables the stream.
452 */
453
454/**
455 * struct drm_vmw_rect
456 *
457 * Defines a rectangle. Used in the overlay ioctl to define
458 * source and destination rectangle.
459 */
460
461struct drm_vmw_rect {
462 __s32 x;
463 __s32 y;
464 __u32 w;
465 __u32 h;
466};
467
468/**
469 * struct drm_vmw_control_stream_arg
470 *
471 * @stream_id: Stearm to control
472 * @enabled: If false all following arguments are ignored.
473 * @handle: Handle to buffer for getting data from.
474 * @format: Format of the overlay as understood by the host.
475 * @width: Width of the overlay.
476 * @height: Height of the overlay.
477 * @size: Size of the overlay in bytes.
478 * @pitch: Array of pitches, the two last are only used for YUV12 formats.
479 * @offset: Offset from start of dma buffer to overlay.
480 * @src: Source rect, must be within the defined area above.
481 * @dst: Destination rect, x and y may be negative.
482 *
483 * Argument to the DRM_VMW_CONTROL_STREAM Ioctl.
484 */
485
486struct drm_vmw_control_stream_arg {
487 __u32 stream_id;
488 __u32 enabled;
489
490 __u32 flags;
491 __u32 color_key;
492
493 __u32 handle;
494 __u32 offset;
495 __s32 format;
496 __u32 size;
497 __u32 width;
498 __u32 height;
499 __u32 pitch[3];
500
501 __u32 pad64;
502 struct drm_vmw_rect src;
503 struct drm_vmw_rect dst;
504};
505
506/*************************************************************************/
507/**
508 * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
509 *
510 */
511
512#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
513#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
514
515/**
516 * struct drm_vmw_cursor_bypass_arg
517 *
518 * @flags: Flags.
519 * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
520 * @xpos: X position of cursor.
521 * @ypos: Y position of cursor.
522 * @xhot: X hotspot.
523 * @yhot: Y hotspot.
524 *
525 * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
526 */
527
528struct drm_vmw_cursor_bypass_arg {
529 __u32 flags;
530 __u32 crtc_id;
531 __s32 xpos;
532 __s32 ypos;
533 __s32 xhot;
534 __s32 yhot;
535};
536
537/*************************************************************************/
538/**
539 * DRM_VMW_CLAIM_STREAM - Claim a single stream.
540 */
541
542/**
543 * struct drm_vmw_context_arg
544 *
545 * @stream_id: Device unique context ID.
546 *
547 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
548 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
549 */
550
551struct drm_vmw_stream_arg {
552 __u32 stream_id;
553 __u32 pad64;
554};
555
556/*************************************************************************/
557/**
558 * DRM_VMW_UNREF_STREAM - Unclaim a stream.
559 *
560 * Return a single stream that was claimed by this process. Also makes
561 * sure that the stream has been stopped.
562 */
563
564/*************************************************************************/
565/**
566 * DRM_VMW_GET_3D_CAP
567 *
568 * Read 3D capabilities from the FIFO
569 *
570 */
571
572/**
573 * struct drm_vmw_get_3d_cap_arg
574 *
575 * @buffer: Pointer to a buffer for capability data, cast to an __u64
576 * @size: Max size to copy
577 *
578 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
579 * ioctls.
580 */
581
582struct drm_vmw_get_3d_cap_arg {
583 __u64 buffer;
584 __u32 max_size;
585 __u32 pad64;
586};
587
588/*************************************************************************/
589/**
590 * DRM_VMW_FENCE_WAIT
591 *
592 * Waits for a fence object to signal. The wait is interruptible, so that
593 * signals may be delivered during the interrupt. The wait may timeout,
594 * in which case the calls returns -EBUSY. If the wait is restarted,
595 * that is restarting without resetting @cookie_valid to zero,
596 * the timeout is computed from the first call.
597 *
598 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
599 * on:
600 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
601 * stream
602 * have executed.
603 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
604 * commands
605 * in the buffer given to the EXECBUF ioctl returning the fence object handle
606 * are available to user-space.
607 *
608 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
609 * fenc wait ioctl returns 0, the fence object has been unreferenced after
610 * the wait.
611 */
612
613#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
614#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
615
616#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
617
618/**
619 * struct drm_vmw_fence_wait_arg
620 *
621 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
622 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
623 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
624 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
625 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
626 * before returning.
627 * @flags: Fence flags to wait on.
628 * @wait_options: Options that control the behaviour of the wait ioctl.
629 *
630 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
631 */
632
633struct drm_vmw_fence_wait_arg {
634 __u32 handle;
635 __s32 cookie_valid;
636 __u64 kernel_cookie;
637 __u64 timeout_us;
638 __s32 lazy;
639 __s32 flags;
640 __s32 wait_options;
641 __s32 pad64;
642};
643
644/*************************************************************************/
645/**
646 * DRM_VMW_FENCE_SIGNALED
647 *
648 * Checks if a fence object is signaled..
649 */
650
651/**
652 * struct drm_vmw_fence_signaled_arg
653 *
654 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
655 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
656 * @signaled: Out: Flags signaled.
657 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
658 * EXEC flag of user-space fence objects.
659 *
660 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
661 * ioctls.
662 */
663
664struct drm_vmw_fence_signaled_arg {
665 __u32 handle;
666 __u32 flags;
667 __s32 signaled;
668 __u32 passed_seqno;
669 __u32 signaled_flags;
670 __u32 pad64;
671};
672
673/*************************************************************************/
674/**
675 * DRM_VMW_FENCE_UNREF
676 *
677 * Unreferences a fence object, and causes it to be destroyed if there are no
678 * other references to it.
679 *
680 */
681
682/**
683 * struct drm_vmw_fence_arg
684 *
685 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
686 *
687 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
688 */
689
690struct drm_vmw_fence_arg {
691 __u32 handle;
692 __u32 pad64;
693};
694
695
696/*************************************************************************/
697/**
698 * DRM_VMW_FENCE_EVENT
699 *
700 * Queues an event on a fence to be delivered on the drm character device
701 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
702 * Optionally the approximate time when the fence signaled is
703 * given by the event.
704 */
705
706/*
707 * The event type
708 */
709#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
710
711struct drm_vmw_event_fence {
712 struct drm_event base;
713 __u64 user_data;
714 __u32 tv_sec;
715 __u32 tv_usec;
716};
717
718/*
719 * Flags that may be given to the command.
720 */
721/* Request fence signaled time on the event. */
722#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
723
724/**
725 * struct drm_vmw_fence_event_arg
726 *
727 * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
728 * the fence is not supposed to be referenced by user-space.
729 * @user_info: Info to be delivered with the event.
730 * @handle: Attach the event to this fence only.
731 * @flags: A set of flags as defined above.
732 */
733struct drm_vmw_fence_event_arg {
734 __u64 fence_rep;
735 __u64 user_data;
736 __u32 handle;
737 __u32 flags;
738};
739
740
741/*************************************************************************/
742/**
743 * DRM_VMW_PRESENT
744 *
745 * Executes an SVGA present on a given fb for a given surface. The surface
746 * is placed on the framebuffer. Cliprects are given relative to the given
747 * point (the point disignated by dest_{x|y}).
748 *
749 */
750
751/**
752 * struct drm_vmw_present_arg
753 * @fb_id: framebuffer id to present / read back from.
754 * @sid: Surface id to present from.
755 * @dest_x: X placement coordinate for surface.
756 * @dest_y: Y placement coordinate for surface.
757 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
758 * @num_clips: Number of cliprects given relative to the framebuffer origin,
759 * in the same coordinate space as the frame buffer.
760 * @pad64: Unused 64-bit padding.
761 *
762 * Input argument to the DRM_VMW_PRESENT ioctl.
763 */
764
765struct drm_vmw_present_arg {
766 __u32 fb_id;
767 __u32 sid;
768 __s32 dest_x;
769 __s32 dest_y;
770 __u64 clips_ptr;
771 __u32 num_clips;
772 __u32 pad64;
773};
774
775
776/*************************************************************************/
777/**
778 * DRM_VMW_PRESENT_READBACK
779 *
780 * Executes an SVGA present readback from a given fb to the dma buffer
781 * currently bound as the fb. If there is no dma buffer bound to the fb,
782 * an error will be returned.
783 *
784 */
785
786/**
787 * struct drm_vmw_present_arg
788 * @fb_id: fb_id to present / read back from.
789 * @num_clips: Number of cliprects.
790 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
791 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
792 * If this member is NULL, then the ioctl should not return a fence.
793 */
794
795struct drm_vmw_present_readback_arg {
796 __u32 fb_id;
797 __u32 num_clips;
798 __u64 clips_ptr;
799 __u64 fence_rep;
800};
801
802/*************************************************************************/
803/**
804 * DRM_VMW_UPDATE_LAYOUT - Update layout
805 *
806 * Updates the preferred modes and connection status for connectors. The
807 * command consists of one drm_vmw_update_layout_arg pointing to an array
808 * of num_outputs drm_vmw_rect's.
809 */
810
811/**
812 * struct drm_vmw_update_layout_arg
813 *
814 * @num_outputs: number of active connectors
815 * @rects: pointer to array of drm_vmw_rect cast to an __u64
816 *
817 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
818 */
819struct drm_vmw_update_layout_arg {
820 __u32 num_outputs;
821 __u32 pad64;
822 __u64 rects;
823};
824
825
826/*************************************************************************/
827/**
828 * DRM_VMW_CREATE_SHADER - Create shader
829 *
830 * Creates a shader and optionally binds it to a dma buffer containing
831 * the shader byte-code.
832 */
833
834/**
835 * enum drm_vmw_shader_type - Shader types
836 */
837enum drm_vmw_shader_type {
838 drm_vmw_shader_type_vs = 0,
839 drm_vmw_shader_type_ps,
840};
841
842
843/**
844 * struct drm_vmw_shader_create_arg
845 *
846 * @shader_type: Shader type of the shader to create.
847 * @size: Size of the byte-code in bytes.
848 * where the shader byte-code starts
849 * @buffer_handle: Buffer handle identifying the buffer containing the
850 * shader byte-code
851 * @shader_handle: On successful completion contains a handle that
852 * can be used to subsequently identify the shader.
853 * @offset: Offset in bytes into the buffer given by @buffer_handle,
854 *
855 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
856 */
857struct drm_vmw_shader_create_arg {
858 enum drm_vmw_shader_type shader_type;
859 __u32 size;
860 __u32 buffer_handle;
861 __u32 shader_handle;
862 __u64 offset;
863};
864
865/*************************************************************************/
866/**
867 * DRM_VMW_UNREF_SHADER - Unreferences a shader
868 *
869 * Destroys a user-space reference to a shader, optionally destroying
870 * it.
871 */
872
873/**
874 * struct drm_vmw_shader_arg
875 *
876 * @handle: Handle identifying the shader to destroy.
877 *
878 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
879 */
880struct drm_vmw_shader_arg {
881 __u32 handle;
882 __u32 pad64;
883};
884
885/*************************************************************************/
886/**
887 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
888 *
889 * Allocates a surface handle and queues a create surface command
890 * for the host on the first use of the surface. The surface ID can
891 * be used as the surface ID in commands referencing the surface.
892 */
893
894/**
895 * enum drm_vmw_surface_flags
896 *
897 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
898 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
899 * surface.
900 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
901 * given.
902 * @drm_vmw_surface_flag_coherent: Back surface with coherent memory.
903 */
904enum drm_vmw_surface_flags {
905 drm_vmw_surface_flag_shareable = (1 << 0),
906 drm_vmw_surface_flag_scanout = (1 << 1),
907 drm_vmw_surface_flag_create_buffer = (1 << 2),
908 drm_vmw_surface_flag_coherent = (1 << 3),
909};
910
911/**
912 * struct drm_vmw_gb_surface_create_req
913 *
914 * @svga3d_flags: SVGA3d surface flags for the device.
915 * @format: SVGA3d format.
916 * @mip_level: Number of mip levels for all faces.
917 * @drm_surface_flags Flags as described above.
918 * @multisample_count Future use. Set to 0.
919 * @autogen_filter Future use. Set to 0.
920 * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
921 * if none.
922 * @base_size Size of the base mip level for all faces.
923 * @array_size Must be zero for non-DX hardware, and if non-zero
924 * svga3d_flags must have proper bind flags setup.
925 *
926 * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
927 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
928 */
929struct drm_vmw_gb_surface_create_req {
930 __u32 svga3d_flags;
931 __u32 format;
932 __u32 mip_levels;
933 enum drm_vmw_surface_flags drm_surface_flags;
934 __u32 multisample_count;
935 __u32 autogen_filter;
936 __u32 buffer_handle;
937 __u32 array_size;
938 struct drm_vmw_size base_size;
939};
940
941/**
942 * struct drm_vmw_gb_surface_create_rep
943 *
944 * @handle: Surface handle.
945 * @backup_size: Size of backup buffers for this surface.
946 * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
947 * @buffer_size: Actual size of the buffer identified by
948 * @buffer_handle
949 * @buffer_map_handle: Offset into device address space for the buffer
950 * identified by @buffer_handle.
951 *
952 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
953 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
954 */
955struct drm_vmw_gb_surface_create_rep {
956 __u32 handle;
957 __u32 backup_size;
958 __u32 buffer_handle;
959 __u32 buffer_size;
960 __u64 buffer_map_handle;
961};
962
963/**
964 * union drm_vmw_gb_surface_create_arg
965 *
966 * @req: Input argument as described above.
967 * @rep: Output argument as described above.
968 *
969 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
970 */
971union drm_vmw_gb_surface_create_arg {
972 struct drm_vmw_gb_surface_create_rep rep;
973 struct drm_vmw_gb_surface_create_req req;
974};
975
976/*************************************************************************/
977/**
978 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
979 *
980 * Puts a reference on a host surface with a given handle, as previously
981 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
982 * A reference will make sure the surface isn't destroyed while we hold
983 * it and will allow the calling client to use the surface handle in
984 * the command stream.
985 *
986 * On successful return, the Ioctl returns the surface information given
987 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
988 */
989
990/**
991 * struct drm_vmw_gb_surface_reference_arg
992 *
993 * @creq: The data used as input when the surface was created, as described
994 * above at "struct drm_vmw_gb_surface_create_req"
995 * @crep: Additional data output when the surface was created, as described
996 * above at "struct drm_vmw_gb_surface_create_rep"
997 *
998 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
999 */
1000struct drm_vmw_gb_surface_ref_rep {
1001 struct drm_vmw_gb_surface_create_req creq;
1002 struct drm_vmw_gb_surface_create_rep crep;
1003};
1004
1005/**
1006 * union drm_vmw_gb_surface_reference_arg
1007 *
1008 * @req: Input data as described above at "struct drm_vmw_surface_arg"
1009 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
1010 *
1011 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1012 */
1013union drm_vmw_gb_surface_reference_arg {
1014 struct drm_vmw_gb_surface_ref_rep rep;
1015 struct drm_vmw_surface_arg req;
1016};
1017
1018
1019/*************************************************************************/
1020/**
1021 * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
1022 *
1023 * Idles any previously submitted GPU operations on the buffer and
1024 * by default blocks command submissions that reference the buffer.
1025 * If the file descriptor used to grab a blocking CPU sync is closed, the
1026 * cpu sync is released.
1027 * The flags argument indicates how the grab / release operation should be
1028 * performed:
1029 */
1030
1031/**
1032 * enum drm_vmw_synccpu_flags - Synccpu flags:
1033 *
1034 * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
1035 * hint to the kernel to allow command submissions that references the buffer
1036 * for read-only.
1037 * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
1038 * referencing this buffer.
1039 * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
1040 * -EBUSY should the buffer be busy.
1041 * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
1042 * while the buffer is synced for CPU. This is similar to the GEM bo idle
1043 * behavior.
1044 */
1045enum drm_vmw_synccpu_flags {
1046 drm_vmw_synccpu_read = (1 << 0),
1047 drm_vmw_synccpu_write = (1 << 1),
1048 drm_vmw_synccpu_dontblock = (1 << 2),
1049 drm_vmw_synccpu_allow_cs = (1 << 3)
1050};
1051
1052/**
1053 * enum drm_vmw_synccpu_op - Synccpu operations:
1054 *
1055 * @drm_vmw_synccpu_grab: Grab the buffer for CPU operations
1056 * @drm_vmw_synccpu_release: Release a previous grab.
1057 */
1058enum drm_vmw_synccpu_op {
1059 drm_vmw_synccpu_grab,
1060 drm_vmw_synccpu_release
1061};
1062
1063/**
1064 * struct drm_vmw_synccpu_arg
1065 *
1066 * @op: The synccpu operation as described above.
1067 * @handle: Handle identifying the buffer object.
1068 * @flags: Flags as described above.
1069 */
1070struct drm_vmw_synccpu_arg {
1071 enum drm_vmw_synccpu_op op;
1072 enum drm_vmw_synccpu_flags flags;
1073 __u32 handle;
1074 __u32 pad64;
1075};
1076
1077/*************************************************************************/
1078/**
1079 * DRM_VMW_CREATE_EXTENDED_CONTEXT - Create a host context.
1080 *
1081 * Allocates a device unique context id, and queues a create context command
1082 * for the host. Does not wait for host completion.
1083 */
1084enum drm_vmw_extended_context {
1085 drm_vmw_context_legacy,
1086 drm_vmw_context_dx
1087};
1088
1089/**
1090 * union drm_vmw_extended_context_arg
1091 *
1092 * @req: Context type.
1093 * @rep: Context identifier.
1094 *
1095 * Argument to the DRM_VMW_CREATE_EXTENDED_CONTEXT Ioctl.
1096 */
1097union drm_vmw_extended_context_arg {
1098 enum drm_vmw_extended_context req;
1099 struct drm_vmw_context_arg rep;
1100};
1101
1102/*************************************************************************/
1103/*
1104 * DRM_VMW_HANDLE_CLOSE - Close a user-space handle and release its
1105 * underlying resource.
1106 *
1107 * Note that this ioctl is overlaid on the deprecated DRM_VMW_UNREF_DMABUF
1108 * Ioctl.
1109 */
1110
1111/**
1112 * struct drm_vmw_handle_close_arg
1113 *
1114 * @handle: Handle to close.
1115 *
1116 * Argument to the DRM_VMW_HANDLE_CLOSE Ioctl.
1117 */
1118struct drm_vmw_handle_close_arg {
1119 __u32 handle;
1120 __u32 pad64;
1121};
1122#define drm_vmw_unref_dmabuf_arg drm_vmw_handle_close_arg
1123
1124/*************************************************************************/
1125/**
1126 * DRM_VMW_GB_SURFACE_CREATE_EXT - Create a host guest-backed surface.
1127 *
1128 * Allocates a surface handle and queues a create surface command
1129 * for the host on the first use of the surface. The surface ID can
1130 * be used as the surface ID in commands referencing the surface.
1131 *
1132 * This new command extends DRM_VMW_GB_SURFACE_CREATE by adding version
1133 * parameter and 64 bit svga flag.
1134 */
1135
1136/**
1137 * enum drm_vmw_surface_version
1138 *
1139 * @drm_vmw_surface_gb_v1: Corresponds to current gb surface format with
1140 * svga3d surface flags split into 2, upper half and lower half.
1141 */
1142enum drm_vmw_surface_version {
1143 drm_vmw_gb_surface_v1,
1144};
1145
1146/**
1147 * struct drm_vmw_gb_surface_create_ext_req
1148 *
1149 * @base: Surface create parameters.
1150 * @version: Version of surface create ioctl.
1151 * @svga3d_flags_upper_32_bits: Upper 32 bits of svga3d flags.
1152 * @multisample_pattern: Multisampling pattern when msaa is supported.
1153 * @quality_level: Precision settings for each sample.
1154 * @buffer_byte_stride: Buffer byte stride.
1155 * @must_be_zero: Reserved for future usage.
1156 *
1157 * Input argument to the DRM_VMW_GB_SURFACE_CREATE_EXT Ioctl.
1158 * Part of output argument for the DRM_VMW_GB_SURFACE_REF_EXT Ioctl.
1159 */
1160struct drm_vmw_gb_surface_create_ext_req {
1161 struct drm_vmw_gb_surface_create_req base;
1162 enum drm_vmw_surface_version version;
1163 __u32 svga3d_flags_upper_32_bits;
1164 __u32 multisample_pattern;
1165 __u32 quality_level;
1166 __u32 buffer_byte_stride;
1167 __u32 must_be_zero;
1168};
1169
1170/**
1171 * union drm_vmw_gb_surface_create_ext_arg
1172 *
1173 * @req: Input argument as described above.
1174 * @rep: Output argument as described above.
1175 *
1176 * Argument to the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1177 */
1178union drm_vmw_gb_surface_create_ext_arg {
1179 struct drm_vmw_gb_surface_create_rep rep;
1180 struct drm_vmw_gb_surface_create_ext_req req;
1181};
1182
1183/*************************************************************************/
1184/**
1185 * DRM_VMW_GB_SURFACE_REF_EXT - Reference a host surface.
1186 *
1187 * Puts a reference on a host surface with a given handle, as previously
1188 * returned by the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1189 * A reference will make sure the surface isn't destroyed while we hold
1190 * it and will allow the calling client to use the surface handle in
1191 * the command stream.
1192 *
1193 * On successful return, the Ioctl returns the surface information given
1194 * to and returned from the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1195 */
1196
1197/**
1198 * struct drm_vmw_gb_surface_ref_ext_rep
1199 *
1200 * @creq: The data used as input when the surface was created, as described
1201 * above at "struct drm_vmw_gb_surface_create_ext_req"
1202 * @crep: Additional data output when the surface was created, as described
1203 * above at "struct drm_vmw_gb_surface_create_rep"
1204 *
1205 * Output Argument to the DRM_VMW_GB_SURFACE_REF_EXT ioctl.
1206 */
1207struct drm_vmw_gb_surface_ref_ext_rep {
1208 struct drm_vmw_gb_surface_create_ext_req creq;
1209 struct drm_vmw_gb_surface_create_rep crep;
1210};
1211
1212/**
1213 * union drm_vmw_gb_surface_reference_ext_arg
1214 *
1215 * @req: Input data as described above at "struct drm_vmw_surface_arg"
1216 * @rep: Output data as described above at
1217 * "struct drm_vmw_gb_surface_ref_ext_rep"
1218 *
1219 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1220 */
1221union drm_vmw_gb_surface_reference_ext_arg {
1222 struct drm_vmw_gb_surface_ref_ext_rep rep;
1223 struct drm_vmw_surface_arg req;
1224};
1225
1226/**
1227 * struct drm_vmw_msg_arg
1228 *
1229 * @send: Pointer to user-space msg string (null terminated).
1230 * @receive: Pointer to user-space receive buffer.
1231 * @send_only: Boolean whether this is only sending or receiving too.
1232 *
1233 * Argument to the DRM_VMW_MSG ioctl.
1234 */
1235struct drm_vmw_msg_arg {
1236 __u64 send;
1237 __u64 receive;
1238 __s32 send_only;
1239 __u32 receive_len;
1240};
1241
1242/**
1243 * struct drm_vmw_mksstat_add_arg
1244 *
1245 * @stat: Pointer to user-space stat-counters array, page-aligned.
1246 * @info: Pointer to user-space counter-infos array, page-aligned.
1247 * @strs: Pointer to user-space stat strings, page-aligned.
1248 * @stat_len: Length in bytes of stat-counters array.
1249 * @info_len: Length in bytes of counter-infos array.
1250 * @strs_len: Length in bytes of the stat strings, terminators included.
1251 * @description: Pointer to instance descriptor string; will be truncated
1252 * to MKS_GUEST_STAT_INSTANCE_DESC_LENGTH chars.
1253 * @id: Output identifier of the produced record; -1 if error.
1254 *
1255 * Argument to the DRM_VMW_MKSSTAT_ADD ioctl.
1256 */
1257struct drm_vmw_mksstat_add_arg {
1258 __u64 stat;
1259 __u64 info;
1260 __u64 strs;
1261 __u64 stat_len;
1262 __u64 info_len;
1263 __u64 strs_len;
1264 __u64 description;
1265 __u64 id;
1266};
1267
1268/**
1269 * struct drm_vmw_mksstat_remove_arg
1270 *
1271 * @id: Identifier of the record being disposed, originally obtained through
1272 * DRM_VMW_MKSSTAT_ADD ioctl.
1273 *
1274 * Argument to the DRM_VMW_MKSSTAT_REMOVE ioctl.
1275 */
1276struct drm_vmw_mksstat_remove_arg {
1277 __u64 id;
1278};
1279
1280#if defined(__cplusplus)
1281}
1282#endif
1283
1284#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/acct.h+2
...@@ -49,6 +49,7 @@ struct acct...@@ -49,6 +49,7 @@ struct acct
49 __u16 ac_uid16; /* LSB of Real User ID */49 __u16 ac_uid16; /* LSB of Real User ID */
50 __u16 ac_gid16; /* LSB of Real Group ID */50 __u16 ac_gid16; /* LSB of Real Group ID */
51 __u16 ac_tty; /* Control Terminal */51 __u16 ac_tty; /* Control Terminal */
52 /* __u32 range means times from 1970 to 2106 */
52 __u32 ac_btime; /* Process Creation Time */53 __u32 ac_btime; /* Process Creation Time */
53 comp_t ac_utime; /* User Time */54 comp_t ac_utime; /* User Time */
54 comp_t ac_stime; /* System Time */55 comp_t ac_stime; /* System Time */
...@@ -79,6 +80,7 @@ struct acct_v3...@@ -79,6 +80,7 @@ struct acct_v3
79 __u32 ac_gid; /* Real Group ID */80 __u32 ac_gid; /* Real Group ID */
80 __u32 ac_pid; /* Process ID */81 __u32 ac_pid; /* Process ID */
81 __u32 ac_ppid; /* Parent Process ID */82 __u32 ac_ppid; /* Parent Process ID */
83 /* __u32 range means times from 1970 to 2106 */
82 __u32 ac_btime; /* Process Creation Time */84 __u32 ac_btime; /* Process Creation Time */
83 float ac_etime; /* Elapsed Time */85 float ac_etime; /* Elapsed Time */
84 comp_t ac_utime; /* User Time */86 comp_t ac_utime; /* User Time */
lib/libc/include/any-linux-any/linux/acrn.h created+650
...@@ -0,0 +1,650 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Userspace interface for /dev/acrn_hsm - ACRN Hypervisor Service Module
4 *
5 * This file can be used by applications that need to communicate with the HSM
6 * via the ioctl interface.
7 *
8 * Copyright (C) 2021 Intel Corporation. All rights reserved.
9 */
10
11#ifndef _ACRN_H
12#define _ACRN_H
13
14#include <linux/types.h>
15#include <linux/uuid.h>
16
17#define ACRN_IO_REQUEST_MAX 16
18
19#define ACRN_IOREQ_STATE_PENDING 0
20#define ACRN_IOREQ_STATE_COMPLETE 1
21#define ACRN_IOREQ_STATE_PROCESSING 2
22#define ACRN_IOREQ_STATE_FREE 3
23
24#define ACRN_IOREQ_TYPE_PORTIO 0
25#define ACRN_IOREQ_TYPE_MMIO 1
26#define ACRN_IOREQ_TYPE_PCICFG 2
27
28#define ACRN_IOREQ_DIR_READ 0
29#define ACRN_IOREQ_DIR_WRITE 1
30
31/**
32 * struct acrn_mmio_request - Info of a MMIO I/O request
33 * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
34 * @reserved: Reserved for alignment and should be 0
35 * @address: Access address of this MMIO I/O request
36 * @size: Access size of this MMIO I/O request
37 * @value: Read/write value of this MMIO I/O request
38 */
39struct acrn_mmio_request {
40 __u32 direction;
41 __u32 reserved;
42 __u64 address;
43 __u64 size;
44 __u64 value;
45};
46
47/**
48 * struct acrn_pio_request - Info of a PIO I/O request
49 * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
50 * @reserved: Reserved for alignment and should be 0
51 * @address: Access address of this PIO I/O request
52 * @size: Access size of this PIO I/O request
53 * @value: Read/write value of this PIO I/O request
54 */
55struct acrn_pio_request {
56 __u32 direction;
57 __u32 reserved;
58 __u64 address;
59 __u64 size;
60 __u32 value;
61};
62
63/**
64 * struct acrn_pci_request - Info of a PCI I/O request
65 * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
66 * @reserved: Reserved for alignment and should be 0
67 * @size: Access size of this PCI I/O request
68 * @value: Read/write value of this PIO I/O request
69 * @bus: PCI bus value of this PCI I/O request
70 * @dev: PCI device value of this PCI I/O request
71 * @func: PCI function value of this PCI I/O request
72 * @reg: PCI config space offset of this PCI I/O request
73 *
74 * Need keep same header layout with &struct acrn_pio_request.
75 */
76struct acrn_pci_request {
77 __u32 direction;
78 __u32 reserved[3];
79 __u64 size;
80 __u32 value;
81 __u32 bus;
82 __u32 dev;
83 __u32 func;
84 __u32 reg;
85};
86
87/**
88 * struct acrn_io_request - 256-byte ACRN I/O request
89 * @type: Type of this request (ACRN_IOREQ_TYPE_*).
90 * @completion_polling: Polling flag. Hypervisor will poll completion of the
91 * I/O request if this flag set.
92 * @reserved0: Reserved fields.
93 * @reqs: Union of different types of request. Byte offset: 64.
94 * @reqs.pio_request: PIO request data of the I/O request.
95 * @reqs.pci_request: PCI configuration space request data of the I/O request.
96 * @reqs.mmio_request: MMIO request data of the I/O request.
97 * @reqs.data: Raw data of the I/O request.
98 * @reserved1: Reserved fields.
99 * @kernel_handled: Flag indicates this request need be handled in kernel.
100 * @processed: The status of this request (ACRN_IOREQ_STATE_*).
101 *
102 * The state transitions of ACRN I/O request:
103 *
104 * FREE -> PENDING -> PROCESSING -> COMPLETE -> FREE -> ...
105 *
106 * An I/O request in COMPLETE or FREE state is owned by the hypervisor. HSM and
107 * ACRN userspace are in charge of processing the others.
108 *
109 * On basis of the states illustrated above, a typical lifecycle of ACRN IO
110 * request would look like:
111 *
112 * Flow (assume the initial state is FREE)
113 * |
114 * | Service VM vCPU 0 Service VM vCPU x User vCPU y
115 * |
116 * | hypervisor:
117 * | fills in type, addr, etc.
118 * | pauses the User VM vCPU y
119 * | sets the state to PENDING (a)
120 * | fires an upcall to Service VM
121 * |
122 * | HSM:
123 * | scans for PENDING requests
124 * | sets the states to PROCESSING (b)
125 * | assigns the requests to clients (c)
126 * V
127 * | client:
128 * | scans for the assigned requests
129 * | handles the requests (d)
130 * | HSM:
131 * | sets states to COMPLETE
132 * | notifies the hypervisor
133 * |
134 * | hypervisor:
135 * | resumes User VM vCPU y (e)
136 * |
137 * | hypervisor:
138 * | post handling (f)
139 * V sets states to FREE
140 *
141 * Note that the procedures (a) to (f) in the illustration above require to be
142 * strictly processed in the order. One vCPU cannot trigger another request of
143 * I/O emulation before completing the previous one.
144 *
145 * Atomic and barriers are required when HSM and hypervisor accessing the state
146 * of &struct acrn_io_request.
147 *
148 */
149struct acrn_io_request {
150 __u32 type;
151 __u32 completion_polling;
152 __u32 reserved0[14];
153 union {
154 struct acrn_pio_request pio_request;
155 struct acrn_pci_request pci_request;
156 struct acrn_mmio_request mmio_request;
157 __u64 data[8];
158 } reqs;
159 __u32 reserved1;
160 __u32 kernel_handled;
161 __u32 processed;
162} __attribute__((aligned(256)));
163
164struct acrn_io_request_buffer {
165 union {
166 struct acrn_io_request req_slot[ACRN_IO_REQUEST_MAX];
167 __u8 reserved[4096];
168 };
169};
170
171/**
172 * struct acrn_ioreq_notify - The structure of ioreq completion notification
173 * @vmid: User VM ID
174 * @reserved: Reserved and should be 0
175 * @vcpu: vCPU ID
176 */
177struct acrn_ioreq_notify {
178 __u16 vmid;
179 __u16 reserved;
180 __u32 vcpu;
181};
182
183/**
184 * struct acrn_vm_creation - Info to create a User VM
185 * @vmid: User VM ID returned from the hypervisor
186 * @reserved0: Reserved and must be 0
187 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor.
188 * @reserved1: Reserved and must be 0
189 * @uuid: UUID of the VM. Pass to hypervisor directly.
190 * @vm_flag: Flag of the VM creating. Pass to hypervisor directly.
191 * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to
192 * hypervisor directly.
193 * @cpu_affinity: CPU affinity of the VM. Pass to hypervisor directly.
194 * It's a bitmap which indicates CPUs used by the VM.
195 */
196struct acrn_vm_creation {
197 __u16 vmid;
198 __u16 reserved0;
199 __u16 vcpu_num;
200 __u16 reserved1;
201 guid_t uuid;
202 __u64 vm_flag;
203 __u64 ioreq_buf;
204 __u64 cpu_affinity;
205};
206
207/**
208 * struct acrn_gp_regs - General registers of a User VM
209 * @rax: Value of register RAX
210 * @rcx: Value of register RCX
211 * @rdx: Value of register RDX
212 * @rbx: Value of register RBX
213 * @rsp: Value of register RSP
214 * @rbp: Value of register RBP
215 * @rsi: Value of register RSI
216 * @rdi: Value of register RDI
217 * @r8: Value of register R8
218 * @r9: Value of register R9
219 * @r10: Value of register R10
220 * @r11: Value of register R11
221 * @r12: Value of register R12
222 * @r13: Value of register R13
223 * @r14: Value of register R14
224 * @r15: Value of register R15
225 */
226struct acrn_gp_regs {
227 __le64 rax;
228 __le64 rcx;
229 __le64 rdx;
230 __le64 rbx;
231 __le64 rsp;
232 __le64 rbp;
233 __le64 rsi;
234 __le64 rdi;
235 __le64 r8;
236 __le64 r9;
237 __le64 r10;
238 __le64 r11;
239 __le64 r12;
240 __le64 r13;
241 __le64 r14;
242 __le64 r15;
243};
244
245/**
246 * struct acrn_descriptor_ptr - Segment descriptor table of a User VM.
247 * @limit: Limit field.
248 * @base: Base field.
249 * @reserved: Reserved and must be 0.
250 */
251struct acrn_descriptor_ptr {
252 __le16 limit;
253 __le64 base;
254 __le16 reserved[3];
255} __attribute__ ((__packed__));
256
257/**
258 * struct acrn_regs - Registers structure of a User VM
259 * @gprs: General registers
260 * @gdt: Global Descriptor Table
261 * @idt: Interrupt Descriptor Table
262 * @rip: Value of register RIP
263 * @cs_base: Base of code segment selector
264 * @cr0: Value of register CR0
265 * @cr4: Value of register CR4
266 * @cr3: Value of register CR3
267 * @ia32_efer: Value of IA32_EFER MSR
268 * @rflags: Value of regsiter RFLAGS
269 * @reserved_64: Reserved and must be 0
270 * @cs_ar: Attribute field of code segment selector
271 * @cs_limit: Limit field of code segment selector
272 * @reserved_32: Reserved and must be 0
273 * @cs_sel: Value of code segment selector
274 * @ss_sel: Value of stack segment selector
275 * @ds_sel: Value of data segment selector
276 * @es_sel: Value of extra segment selector
277 * @fs_sel: Value of FS selector
278 * @gs_sel: Value of GS selector
279 * @ldt_sel: Value of LDT descriptor selector
280 * @tr_sel: Value of TSS descriptor selector
281 */
282struct acrn_regs {
283 struct acrn_gp_regs gprs;
284 struct acrn_descriptor_ptr gdt;
285 struct acrn_descriptor_ptr idt;
286
287 __le64 rip;
288 __le64 cs_base;
289 __le64 cr0;
290 __le64 cr4;
291 __le64 cr3;
292 __le64 ia32_efer;
293 __le64 rflags;
294 __le64 reserved_64[4];
295
296 __le32 cs_ar;
297 __le32 cs_limit;
298 __le32 reserved_32[3];
299
300 __le16 cs_sel;
301 __le16 ss_sel;
302 __le16 ds_sel;
303 __le16 es_sel;
304 __le16 fs_sel;
305 __le16 gs_sel;
306 __le16 ldt_sel;
307 __le16 tr_sel;
308};
309
310/**
311 * struct acrn_vcpu_regs - Info of vCPU registers state
312 * @vcpu_id: vCPU ID
313 * @reserved: Reserved and must be 0
314 * @vcpu_regs: vCPU registers state
315 *
316 * This structure will be passed to hypervisor directly.
317 */
318struct acrn_vcpu_regs {
319 __u16 vcpu_id;
320 __u16 reserved[3];
321 struct acrn_regs vcpu_regs;
322};
323
324#define ACRN_MEM_ACCESS_RIGHT_MASK 0x00000007U
325#define ACRN_MEM_ACCESS_READ 0x00000001U
326#define ACRN_MEM_ACCESS_WRITE 0x00000002U
327#define ACRN_MEM_ACCESS_EXEC 0x00000004U
328#define ACRN_MEM_ACCESS_RWX (ACRN_MEM_ACCESS_READ | \
329 ACRN_MEM_ACCESS_WRITE | \
330 ACRN_MEM_ACCESS_EXEC)
331
332#define ACRN_MEM_TYPE_MASK 0x000007C0U
333#define ACRN_MEM_TYPE_WB 0x00000040U
334#define ACRN_MEM_TYPE_WT 0x00000080U
335#define ACRN_MEM_TYPE_UC 0x00000100U
336#define ACRN_MEM_TYPE_WC 0x00000200U
337#define ACRN_MEM_TYPE_WP 0x00000400U
338
339/* Memory mapping types */
340#define ACRN_MEMMAP_RAM 0
341#define ACRN_MEMMAP_MMIO 1
342
343/**
344 * struct acrn_vm_memmap - A EPT memory mapping info for a User VM.
345 * @type: Type of the memory mapping (ACRM_MEMMAP_*).
346 * Pass to hypervisor directly.
347 * @attr: Attribute of the memory mapping.
348 * Pass to hypervisor directly.
349 * @user_vm_pa: Physical address of User VM.
350 * Pass to hypervisor directly.
351 * @service_vm_pa: Physical address of Service VM.
352 * Pass to hypervisor directly.
353 * @vma_base: VMA address of Service VM. Pass to hypervisor directly.
354 * @len: Length of the memory mapping.
355 * Pass to hypervisor directly.
356 */
357struct acrn_vm_memmap {
358 __u32 type;
359 __u32 attr;
360 __u64 user_vm_pa;
361 union {
362 __u64 service_vm_pa;
363 __u64 vma_base;
364 };
365 __u64 len;
366};
367
368/* Type of interrupt of a passthrough device */
369#define ACRN_PTDEV_IRQ_INTX 0
370#define ACRN_PTDEV_IRQ_MSI 1
371#define ACRN_PTDEV_IRQ_MSIX 2
372/**
373 * struct acrn_ptdev_irq - Interrupt data of a passthrough device.
374 * @type: Type (ACRN_PTDEV_IRQ_*)
375 * @virt_bdf: Virtual Bus/Device/Function
376 * @phys_bdf: Physical Bus/Device/Function
377 * @intx: Info of interrupt
378 * @intx.virt_pin: Virtual IOAPIC pin
379 * @intx.phys_pin: Physical IOAPIC pin
380 * @intx.is_pic_pin: Is PIC pin or not
381 *
382 * This structure will be passed to hypervisor directly.
383 */
384struct acrn_ptdev_irq {
385 __u32 type;
386 __u16 virt_bdf;
387 __u16 phys_bdf;
388
389 struct {
390 __u32 virt_pin;
391 __u32 phys_pin;
392 __u32 is_pic_pin;
393 } intx;
394};
395
396/* Type of PCI device assignment */
397#define ACRN_PTDEV_QUIRK_ASSIGN (1U << 0)
398
399#define ACRN_MMIODEV_RES_NUM 3
400#define ACRN_PCI_NUM_BARS 6
401/**
402 * struct acrn_pcidev - Info for assigning or de-assigning a PCI device
403 * @type: Type of the assignment
404 * @virt_bdf: Virtual Bus/Device/Function
405 * @phys_bdf: Physical Bus/Device/Function
406 * @intr_line: PCI interrupt line
407 * @intr_pin: PCI interrupt pin
408 * @bar: PCI BARs.
409 *
410 * This structure will be passed to hypervisor directly.
411 */
412struct acrn_pcidev {
413 __u32 type;
414 __u16 virt_bdf;
415 __u16 phys_bdf;
416 __u8 intr_line;
417 __u8 intr_pin;
418 __u32 bar[ACRN_PCI_NUM_BARS];
419};
420
421/**
422 * struct acrn_mmiodev - Info for assigning or de-assigning a MMIO device
423 * @name: Name of the MMIO device.
424 * @res[].user_vm_pa: Physical address of User VM of the MMIO region
425 * for the MMIO device.
426 * @res[].service_vm_pa: Physical address of Service VM of the MMIO
427 * region for the MMIO device.
428 * @res[].size: Size of the MMIO region for the MMIO device.
429 * @res[].mem_type: Memory type of the MMIO region for the MMIO
430 * device.
431 *
432 * This structure will be passed to hypervisor directly.
433 */
434struct acrn_mmiodev {
435 __u8 name[8];
436 struct {
437 __u64 user_vm_pa;
438 __u64 service_vm_pa;
439 __u64 size;
440 __u64 mem_type;
441 } res[ACRN_MMIODEV_RES_NUM];
442};
443
444/**
445 * struct acrn_vdev - Info for creating or destroying a virtual device
446 * @id: Union of identifier of the virtual device
447 * @id.value: Raw data of the identifier
448 * @id.fields.vendor: Vendor id of the virtual PCI device
449 * @id.fields.device: Device id of the virtual PCI device
450 * @id.fields.legacy_id: ID of the virtual device if not a PCI device
451 * @slot: Virtual Bus/Device/Function of the virtual
452 * device
453 * @io_base: IO resource base address of the virtual device
454 * @io_size: IO resource size of the virtual device
455 * @args: Arguments for the virtual device creation
456 *
457 * The created virtual device can be a PCI device or a legacy device (e.g.
458 * a virtual UART controller) and it is emulated by the hypervisor. This
459 * structure will be passed to hypervisor directly.
460 */
461struct acrn_vdev {
462 /*
463 * the identifier of the device, the low 32 bits represent the vendor
464 * id and device id of PCI device and the high 32 bits represent the
465 * device number of the legacy device
466 */
467 union {
468 __u64 value;
469 struct {
470 __le16 vendor;
471 __le16 device;
472 __le32 legacy_id;
473 } fields;
474 } id;
475
476 __u64 slot;
477 __u32 io_addr[ACRN_PCI_NUM_BARS];
478 __u32 io_size[ACRN_PCI_NUM_BARS];
479 __u8 args[128];
480};
481
482/**
483 * struct acrn_msi_entry - Info for injecting a MSI interrupt to a VM
484 * @msi_addr: MSI addr[19:12] with dest vCPU ID
485 * @msi_data: MSI data[7:0] with vector
486 */
487struct acrn_msi_entry {
488 __u64 msi_addr;
489 __u64 msi_data;
490};
491
492struct acrn_acpi_generic_address {
493 __u8 space_id;
494 __u8 bit_width;
495 __u8 bit_offset;
496 __u8 access_size;
497 __u64 address;
498} __attribute__ ((__packed__));
499
500/**
501 * struct acrn_cstate_data - A C state package defined in ACPI
502 * @cx_reg: Register of the C state object
503 * @type: Type of the C state object
504 * @latency: The worst-case latency to enter and exit this C state
505 * @power: The average power consumption when in this C state
506 */
507struct acrn_cstate_data {
508 struct acrn_acpi_generic_address cx_reg;
509 __u8 type;
510 __u32 latency;
511 __u64 power;
512};
513
514/**
515 * struct acrn_pstate_data - A P state package defined in ACPI
516 * @core_frequency: CPU frequency (in MHz).
517 * @power: Power dissipation (in milliwatts).
518 * @transition_latency: The worst-case latency in microseconds that CPU is
519 * unavailable during a transition from any P state to
520 * this P state.
521 * @bus_master_latency: The worst-case latency in microseconds that Bus Masters
522 * are prevented from accessing memory during a transition
523 * from any P state to this P state.
524 * @control: The value to be written to Performance Control Register
525 * @status: Transition status.
526 */
527struct acrn_pstate_data {
528 __u64 core_frequency;
529 __u64 power;
530 __u64 transition_latency;
531 __u64 bus_master_latency;
532 __u64 control;
533 __u64 status;
534};
535
536#define PMCMD_TYPE_MASK 0x000000ff
537enum acrn_pm_cmd_type {
538 ACRN_PMCMD_GET_PX_CNT,
539 ACRN_PMCMD_GET_PX_DATA,
540 ACRN_PMCMD_GET_CX_CNT,
541 ACRN_PMCMD_GET_CX_DATA,
542};
543
544#define ACRN_IOEVENTFD_FLAG_PIO 0x01
545#define ACRN_IOEVENTFD_FLAG_DATAMATCH 0x02
546#define ACRN_IOEVENTFD_FLAG_DEASSIGN 0x04
547/**
548 * struct acrn_ioeventfd - Data to operate a &struct hsm_ioeventfd
549 * @fd: The fd of eventfd associated with a hsm_ioeventfd
550 * @flags: Logical-OR of ACRN_IOEVENTFD_FLAG_*
551 * @addr: The start address of IO range of ioeventfd
552 * @len: The length of IO range of ioeventfd
553 * @reserved: Reserved and should be 0
554 * @data: Data for data matching
555 *
556 * Without flag ACRN_IOEVENTFD_FLAG_DEASSIGN, ioctl ACRN_IOCTL_IOEVENTFD
557 * creates a &struct hsm_ioeventfd with properties originated from &struct
558 * acrn_ioeventfd. With flag ACRN_IOEVENTFD_FLAG_DEASSIGN, ioctl
559 * ACRN_IOCTL_IOEVENTFD destroys the &struct hsm_ioeventfd matching the fd.
560 */
561struct acrn_ioeventfd {
562 __u32 fd;
563 __u32 flags;
564 __u64 addr;
565 __u32 len;
566 __u32 reserved;
567 __u64 data;
568};
569
570#define ACRN_IRQFD_FLAG_DEASSIGN 0x01
571/**
572 * struct acrn_irqfd - Data to operate a &struct hsm_irqfd
573 * @fd: The fd of eventfd associated with a hsm_irqfd
574 * @flags: Logical-OR of ACRN_IRQFD_FLAG_*
575 * @msi: Info of MSI associated with the irqfd
576 */
577struct acrn_irqfd {
578 __s32 fd;
579 __u32 flags;
580 struct acrn_msi_entry msi;
581};
582
583/* The ioctl type, documented in ioctl-number.rst */
584#define ACRN_IOCTL_TYPE 0xA2
585
586/*
587 * Common IOCTL IDs definition for ACRN userspace
588 */
589#define ACRN_IOCTL_CREATE_VM \
590 _IOWR(ACRN_IOCTL_TYPE, 0x10, struct acrn_vm_creation)
591#define ACRN_IOCTL_DESTROY_VM \
592 _IO(ACRN_IOCTL_TYPE, 0x11)
593#define ACRN_IOCTL_START_VM \
594 _IO(ACRN_IOCTL_TYPE, 0x12)
595#define ACRN_IOCTL_PAUSE_VM \
596 _IO(ACRN_IOCTL_TYPE, 0x13)
597#define ACRN_IOCTL_RESET_VM \
598 _IO(ACRN_IOCTL_TYPE, 0x15)
599#define ACRN_IOCTL_SET_VCPU_REGS \
600 _IOW(ACRN_IOCTL_TYPE, 0x16, struct acrn_vcpu_regs)
601
602#define ACRN_IOCTL_INJECT_MSI \
603 _IOW(ACRN_IOCTL_TYPE, 0x23, struct acrn_msi_entry)
604#define ACRN_IOCTL_VM_INTR_MONITOR \
605 _IOW(ACRN_IOCTL_TYPE, 0x24, unsigned long)
606#define ACRN_IOCTL_SET_IRQLINE \
607 _IOW(ACRN_IOCTL_TYPE, 0x25, __u64)
608
609#define ACRN_IOCTL_NOTIFY_REQUEST_FINISH \
610 _IOW(ACRN_IOCTL_TYPE, 0x31, struct acrn_ioreq_notify)
611#define ACRN_IOCTL_CREATE_IOREQ_CLIENT \
612 _IO(ACRN_IOCTL_TYPE, 0x32)
613#define ACRN_IOCTL_ATTACH_IOREQ_CLIENT \
614 _IO(ACRN_IOCTL_TYPE, 0x33)
615#define ACRN_IOCTL_DESTROY_IOREQ_CLIENT \
616 _IO(ACRN_IOCTL_TYPE, 0x34)
617#define ACRN_IOCTL_CLEAR_VM_IOREQ \
618 _IO(ACRN_IOCTL_TYPE, 0x35)
619
620#define ACRN_IOCTL_SET_MEMSEG \
621 _IOW(ACRN_IOCTL_TYPE, 0x41, struct acrn_vm_memmap)
622#define ACRN_IOCTL_UNSET_MEMSEG \
623 _IOW(ACRN_IOCTL_TYPE, 0x42, struct acrn_vm_memmap)
624
625#define ACRN_IOCTL_SET_PTDEV_INTR \
626 _IOW(ACRN_IOCTL_TYPE, 0x53, struct acrn_ptdev_irq)
627#define ACRN_IOCTL_RESET_PTDEV_INTR \
628 _IOW(ACRN_IOCTL_TYPE, 0x54, struct acrn_ptdev_irq)
629#define ACRN_IOCTL_ASSIGN_PCIDEV \
630 _IOW(ACRN_IOCTL_TYPE, 0x55, struct acrn_pcidev)
631#define ACRN_IOCTL_DEASSIGN_PCIDEV \
632 _IOW(ACRN_IOCTL_TYPE, 0x56, struct acrn_pcidev)
633#define ACRN_IOCTL_ASSIGN_MMIODEV \
634 _IOW(ACRN_IOCTL_TYPE, 0x57, struct acrn_mmiodev)
635#define ACRN_IOCTL_DEASSIGN_MMIODEV \
636 _IOW(ACRN_IOCTL_TYPE, 0x58, struct acrn_mmiodev)
637#define ACRN_IOCTL_CREATE_VDEV \
638 _IOW(ACRN_IOCTL_TYPE, 0x59, struct acrn_vdev)
639#define ACRN_IOCTL_DESTROY_VDEV \
640 _IOW(ACRN_IOCTL_TYPE, 0x5A, struct acrn_vdev)
641
642#define ACRN_IOCTL_PM_GET_CPU_STATE \
643 _IOWR(ACRN_IOCTL_TYPE, 0x60, __u64)
644
645#define ACRN_IOCTL_IOEVENTFD \
646 _IOW(ACRN_IOCTL_TYPE, 0x70, struct acrn_ioeventfd)
647#define ACRN_IOCTL_IRQFD \
648 _IOW(ACRN_IOCTL_TYPE, 0x71, struct acrn_irqfd)
649
650#endif /* _ACRN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/adfs_fs.h+3-3
...@@ -29,17 +29,17 @@ struct adfs_discrecord {...@@ -29,17 +29,17 @@ struct adfs_discrecord {
29 __u8 log2sharesize:4;29 __u8 log2sharesize:4;
30 __u8 unused40:4;30 __u8 unused40:4;
31 __u8 big_flag:1;31 __u8 big_flag:1;
32 __u8 unused41:1;32 __u8 unused41:7;
33 __u8 nzones_high;33 __u8 nzones_high;
34 __u8 reserved43;
34 __le32 format_version;35 __le32 format_version;
35 __le32 root_size;36 __le32 root_size;
36 __u8 unused52[60 - 52];37 __u8 unused52[60 - 52];
37};38} __attribute__((packed, aligned(4)));
3839
39#define ADFS_DISCRECORD (0xc00)40#define ADFS_DISCRECORD (0xc00)
40#define ADFS_DR_OFFSET (0x1c0)41#define ADFS_DR_OFFSET (0x1c0)
41#define ADFS_DR_SIZE 6042#define ADFS_DR_SIZE 60
42#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)43#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
4344
44
45#endif /* _ADFS_FS_H */45#endif /* _ADFS_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/aio_abi.h+2
...@@ -50,6 +50,8 @@ enum {...@@ -50,6 +50,8 @@ enum {
50 *50 *
51 * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"51 * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
52 * is valid.52 * is valid.
53 * IOCB_FLAG_IOPRIO - Set if the "aio_reqprio" member of the "struct iocb"
54 * is valid.
53 */55 */
54#define IOCB_FLAG_RESFD (1 << 0)56#define IOCB_FLAG_RESFD (1 << 0)
55#define IOCB_FLAG_IOPRIO (1 << 1)57#define IOCB_FLAG_IOPRIO (1 << 1)
lib/libc/include/any-linux-any/linux/amt.h created+62
...@@ -0,0 +1,62 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2021 Taehee Yoo <ap420073@gmail.com>
4 */
5#ifndef _AMT_H_
6#define _AMT_H_
7
8enum ifla_amt_mode {
9 /* AMT interface works as Gateway mode.
10 * The Gateway mode encapsulates IGMP/MLD traffic and decapsulates
11 * multicast traffic.
12 */
13 AMT_MODE_GATEWAY = 0,
14 /* AMT interface works as Relay mode.
15 * The Relay mode encapsulates multicast traffic and decapsulates
16 * IGMP/MLD traffic.
17 */
18 AMT_MODE_RELAY,
19 __AMT_MODE_MAX,
20};
21
22#define AMT_MODE_MAX (__AMT_MODE_MAX - 1)
23
24enum {
25 IFLA_AMT_UNSPEC,
26 /* This attribute specify mode etier Gateway or Relay. */
27 IFLA_AMT_MODE,
28 /* This attribute specify Relay port.
29 * AMT interface is created as Gateway mode, this attribute is used
30 * to specify relay(remote) port.
31 * AMT interface is created as Relay mode, this attribute is used
32 * as local port.
33 */
34 IFLA_AMT_RELAY_PORT,
35 /* This attribute specify Gateway port.
36 * AMT interface is created as Gateway mode, this attribute is used
37 * as local port.
38 * AMT interface is created as Relay mode, this attribute is not used.
39 */
40 IFLA_AMT_GATEWAY_PORT,
41 /* This attribute specify physical device */
42 IFLA_AMT_LINK,
43 /* This attribute specify local ip address */
44 IFLA_AMT_LOCAL_IP,
45 /* This attribute specify Relay ip address.
46 * So, this is not used by Relay.
47 */
48 IFLA_AMT_REMOTE_IP,
49 /* This attribute specify Discovery ip address.
50 * When Gateway get started, it send discovery message to find the
51 * Relay's ip address.
52 * So, this is not used by Relay.
53 */
54 IFLA_AMT_DISCOVERY_IP,
55 /* This attribute specify number of maximum tunnel. */
56 IFLA_AMT_MAX_TUNNELS,
57 __IFLA_AMT_MAX,
58};
59
60#define IFLA_AMT_MAX (__IFLA_AMT_MAX - 1)
61
62#endif /* _AMT_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/android/binder.h+66-1
...@@ -41,6 +41,14 @@ enum {...@@ -41,6 +41,14 @@ enum {
41enum {41enum {
42 FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,42 FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
43 FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,43 FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
44
45 /**
46 * @FLAT_BINDER_FLAG_TXN_SECURITY_CTX: request security contexts
47 *
48 * Only when set, causes senders to include their security
49 * context
50 */
51 FLAT_BINDER_FLAG_TXN_SECURITY_CTX = 0x1000,
44};52};
4553
46#ifdef BINDER_IPC_32BIT54#ifdef BINDER_IPC_32BIT
...@@ -200,6 +208,34 @@ struct binder_node_debug_info {...@@ -200,6 +208,34 @@ struct binder_node_debug_info {
200 __u32 has_weak_ref;208 __u32 has_weak_ref;
201};209};
202210
211struct binder_node_info_for_ref {
212 __u32 handle;
213 __u32 strong_count;
214 __u32 weak_count;
215 __u32 reserved1;
216 __u32 reserved2;
217 __u32 reserved3;
218};
219
220struct binder_freeze_info {
221 __u32 pid;
222 __u32 enable;
223 __u32 timeout_ms;
224};
225
226struct binder_frozen_status_info {
227 __u32 pid;
228
229 /* process received sync transactions since last frozen
230 * bit 0: received sync transaction after being frozen
231 * bit 1: new pending sync transaction during freezing
232 */
233 __u32 sync_recv;
234
235 /* process received async transactions since last frozen */
236 __u32 async_recv;
237};
238
203#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)239#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
204#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)240#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
205#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)241#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
...@@ -208,6 +244,11 @@ struct binder_node_debug_info {...@@ -208,6 +244,11 @@ struct binder_node_debug_info {
208#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)244#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
209#define BINDER_VERSION _IOWR('b', 9, struct binder_version)245#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
210#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)246#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
247#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
248#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
249#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
250#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
251#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
211252
212/*253/*
213 * NOTE: Two special error codes you should check for when calling254 * NOTE: Two special error codes you should check for when calling
...@@ -229,6 +270,7 @@ enum transaction_flags {...@@ -229,6 +270,7 @@ enum transaction_flags {
229 TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */270 TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
230 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */271 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
231 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */272 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
273 TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */
232};274};
233275
234struct binder_transaction_data {276struct binder_transaction_data {
...@@ -266,6 +308,11 @@ struct binder_transaction_data {...@@ -266,6 +308,11 @@ struct binder_transaction_data {
266 } data;308 } data;
267};309};
268310
311struct binder_transaction_data_secctx {
312 struct binder_transaction_data transaction_data;
313 binder_uintptr_t secctx;
314};
315
269struct binder_transaction_data_sg {316struct binder_transaction_data_sg {
270 struct binder_transaction_data transaction_data;317 struct binder_transaction_data transaction_data;
271 binder_size_t buffers_size;318 binder_size_t buffers_size;
...@@ -301,6 +348,11 @@ enum binder_driver_return_protocol {...@@ -301,6 +348,11 @@ enum binder_driver_return_protocol {
301 BR_OK = _IO('r', 1),348 BR_OK = _IO('r', 1),
302 /* No parameters! */349 /* No parameters! */
303350
351 BR_TRANSACTION_SEC_CTX = _IOR('r', 2,
352 struct binder_transaction_data_secctx),
353 /*
354 * binder_transaction_data_secctx: the received command.
355 */
304 BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),356 BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
305 BR_REPLY = _IOR('r', 3, struct binder_transaction_data),357 BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
306 /*358 /*
...@@ -375,9 +427,22 @@ enum binder_driver_return_protocol {...@@ -375,9 +427,22 @@ enum binder_driver_return_protocol {
375427
376 BR_FAILED_REPLY = _IO('r', 17),428 BR_FAILED_REPLY = _IO('r', 17),
377 /*429 /*
378 * The the last transaction (either a bcTRANSACTION or430 * The last transaction (either a bcTRANSACTION or
379 * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.431 * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
380 */432 */
433
434 BR_FROZEN_REPLY = _IO('r', 18),
435 /*
436 * The target of the last transaction (either a bcTRANSACTION or
437 * a bcATTEMPT_ACQUIRE) is frozen. No parameters.
438 */
439
440 BR_ONEWAY_SPAM_SUSPECT = _IO('r', 19),
441 /*
442 * Current process sent too many oneway calls to target, and the last
443 * asynchronous transaction makes the allocated async buffer size exceed
444 * detection threshold. No parameters.
445 */
381};446};
382447
383enum binder_driver_command_protocol {448enum binder_driver_command_protocol {
lib/libc/include/any-linux-any/linux/android/binderfs.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2018 Canonical Ltd.
4 *
5 */
6
7#ifndef _LINUX_BINDERFS_H
8#define _LINUX_BINDERFS_H
9
10#include <linux/android/binder.h>
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14#define BINDERFS_MAX_NAME 255
15
16/**
17 * struct binderfs_device - retrieve information about a new binder device
18 * @name: the name to use for the new binderfs binder device
19 * @major: major number allocated for binderfs binder devices
20 * @minor: minor number allocated for the new binderfs binder device
21 *
22 */
23struct binderfs_device {
24 char name[BINDERFS_MAX_NAME + 1];
25 __u32 major;
26 __u32 minor;
27};
28
29/**
30 * Allocate a new binder device.
31 */
32#define BINDER_CTL_ADD _IOWR('b', 1, struct binderfs_device)
33
34#endif /* _LINUX_BINDERFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/aspeed-p2a-ctrl.h created+62
...@@ -0,0 +1,62 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright 2019 Google Inc
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Provides a simple driver to control the ASPEED P2A interface which allows
11 * the host to read and write to various regions of the BMC's memory.
12 */
13
14#ifndef _LINUX_ASPEED_P2A_CTRL_H
15#define _LINUX_ASPEED_P2A_CTRL_H
16
17#include <linux/ioctl.h>
18#include <linux/types.h>
19
20#define ASPEED_P2A_CTRL_READ_ONLY 0
21#define ASPEED_P2A_CTRL_READWRITE 1
22
23/*
24 * This driver provides a mechanism for enabling or disabling the read-write
25 * property of specific windows into the ASPEED BMC's memory.
26 *
27 * A user can map a region of the BMC's memory as read-only or read-write, with
28 * the caveat that once any region is mapped, all regions are unlocked for
29 * reading.
30 */
31
32/*
33 * Unlock a region of BMC physical memory for access from the host.
34 *
35 * Also used to read back the optional memory-region configuration for the
36 * driver.
37 */
38struct aspeed_p2a_ctrl_mapping {
39 __u64 addr;
40 __u32 length;
41 __u32 flags;
42};
43
44#define __ASPEED_P2A_CTRL_IOCTL_MAGIC 0xb3
45
46/*
47 * This IOCTL is meant to configure a region or regions of memory given a
48 * starting address and length to be readable by the host, or
49 * readable-writeable.
50 */
51#define ASPEED_P2A_CTRL_IOCTL_SET_WINDOW _IOW(__ASPEED_P2A_CTRL_IOCTL_MAGIC, \
52 0x00, struct aspeed_p2a_ctrl_mapping)
53
54/*
55 * This IOCTL is meant to read back to the user the base address and length of
56 * the memory-region specified to the driver for use with mmap.
57 */
58#define ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG \
59 _IOWR(__ASPEED_P2A_CTRL_IOCTL_MAGIC, \
60 0x01, struct aspeed_p2a_ctrl_mapping)
61
62#endif /* _LINUX_ASPEED_P2A_CTRL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/atmioc.h+1-1
...@@ -5,7 +5,7 @@...@@ -5,7 +5,7 @@
55
66
7/*7/*
8 * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of8 * See https://icawww1.epfl.ch/linux-atm/magic.html for the complete list of
9 * "magic" ioctl numbers.9 * "magic" ioctl numbers.
10 */10 */
1111
lib/libc/include/any-linux-any/linux/audit.h+41-10
...@@ -48,7 +48,7 @@...@@ -48,7 +48,7 @@
48 * 2500 - 2999 future user space (maybe integrity labels and related events)48 * 2500 - 2999 future user space (maybe integrity labels and related events)
49 *49 *
50 * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are50 * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
51 * exclusively user space. 1300-2099 is kernel --> user space 51 * exclusively user space. 1300-2099 is kernel --> user space
52 * communication.52 * communication.
53 */53 */
54#define AUDIT_GET 1000 /* Get status */54#define AUDIT_GET 1000 /* Get status */
...@@ -78,7 +78,7 @@...@@ -78,7 +78,7 @@
78#define AUDIT_LAST_USER_MSG 119978#define AUDIT_LAST_USER_MSG 1199
79#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */79#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
80#define AUDIT_LAST_USER_MSG2 299980#define AUDIT_LAST_USER_MSG2 2999
81 81
82#define AUDIT_DAEMON_START 1200 /* Daemon startup record */82#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
83#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */83#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
84#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */84#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
...@@ -114,6 +114,14 @@...@@ -114,6 +114,14 @@
114#define AUDIT_REPLACE 1329 /* Replace auditd if this packet unanswerd */114#define AUDIT_REPLACE 1329 /* Replace auditd if this packet unanswerd */
115#define AUDIT_KERN_MODULE 1330 /* Kernel Module events */115#define AUDIT_KERN_MODULE 1330 /* Kernel Module events */
116#define AUDIT_FANOTIFY 1331 /* Fanotify access decision */116#define AUDIT_FANOTIFY 1331 /* Fanotify access decision */
117#define AUDIT_TIME_INJOFFSET 1332 /* Timekeeping offset injected */
118#define AUDIT_TIME_ADJNTPVAL 1333 /* NTP value adjustment */
119#define AUDIT_BPF 1334 /* BPF subsystem */
120#define AUDIT_EVENT_LISTENER 1335 /* Task joined multicast read socket */
121#define AUDIT_URINGOP 1336 /* io_uring operation */
122#define AUDIT_OPENAT2 1337 /* Record showing openat2 how args */
123#define AUDIT_DM_CTRL 1338 /* Device Mapper target control */
124#define AUDIT_DM_EVENT 1339 /* Device Mapper events */
117125
118#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */126#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
119#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */127#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
...@@ -141,6 +149,7 @@...@@ -141,6 +149,7 @@
141#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */149#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
142#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */150#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
143#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */151#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
152#define AUDIT_ANOM_CREAT 1703 /* Suspicious file creation */
144#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */153#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
145#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */154#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
146#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */155#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
...@@ -161,8 +170,9 @@...@@ -161,8 +170,9 @@
161#define AUDIT_FILTER_EXCLUDE 0x05 /* Apply rule before record creation */170#define AUDIT_FILTER_EXCLUDE 0x05 /* Apply rule before record creation */
162#define AUDIT_FILTER_TYPE AUDIT_FILTER_EXCLUDE /* obsolete misleading naming */171#define AUDIT_FILTER_TYPE AUDIT_FILTER_EXCLUDE /* obsolete misleading naming */
163#define AUDIT_FILTER_FS 0x06 /* Apply rule at __audit_inode_child */172#define AUDIT_FILTER_FS 0x06 /* Apply rule at __audit_inode_child */
173#define AUDIT_FILTER_URING_EXIT 0x07 /* Apply rule at io_uring op exit */
164174
165#define AUDIT_NR_FILTERS 7175#define AUDIT_NR_FILTERS 8
166176
167#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */177#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
168178
...@@ -279,6 +289,7 @@...@@ -279,6 +289,7 @@
279#define AUDIT_OBJ_GID 110289#define AUDIT_OBJ_GID 110
280#define AUDIT_FIELD_COMPARE 111290#define AUDIT_FIELD_COMPARE 111
281#define AUDIT_EXE 112291#define AUDIT_EXE 112
292#define AUDIT_SADDR_FAM 113
282293
283#define AUDIT_ARG0 200294#define AUDIT_ARG0 200
284#define AUDIT_ARG1 (AUDIT_ARG0+1)295#define AUDIT_ARG1 (AUDIT_ARG0+1)
...@@ -327,14 +338,15 @@ enum {...@@ -327,14 +338,15 @@ enum {
327};338};
328339
329/* Status symbols */340/* Status symbols */
330 /* Mask values */341 /* Mask values */
331#define AUDIT_STATUS_ENABLED 0x0001342#define AUDIT_STATUS_ENABLED 0x0001
332#define AUDIT_STATUS_FAILURE 0x0002343#define AUDIT_STATUS_FAILURE 0x0002
333#define AUDIT_STATUS_PID 0x0004344#define AUDIT_STATUS_PID 0x0004
334#define AUDIT_STATUS_RATE_LIMIT 0x0008345#define AUDIT_STATUS_RATE_LIMIT 0x0008
335#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010346#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
336#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020347#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020
337#define AUDIT_STATUS_LOST 0x0040348#define AUDIT_STATUS_LOST 0x0040
349#define AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL 0x0080
338350
339#define AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT 0x00000001351#define AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT 0x00000001
340#define AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME 0x00000002352#define AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME 0x00000002
...@@ -375,10 +387,19 @@ enum {...@@ -375,10 +387,19 @@ enum {
375387
376#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)388#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
377#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)389#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
390#define AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT|__AUDIT_ARCH_LE)
391#define AUDIT_ARCH_ARCOMPACTBE (EM_ARCOMPACT)
392#define AUDIT_ARCH_ARCV2 (EM_ARCV2|__AUDIT_ARCH_LE)
393#define AUDIT_ARCH_ARCV2BE (EM_ARCV2)
378#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)394#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
379#define AUDIT_ARCH_ARMEB (EM_ARM)395#define AUDIT_ARCH_ARMEB (EM_ARM)
396#define AUDIT_ARCH_C6X (EM_TI_C6000|__AUDIT_ARCH_LE)
397#define AUDIT_ARCH_C6XBE (EM_TI_C6000)
380#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)398#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
399#define AUDIT_ARCH_CSKY (EM_CSKY|__AUDIT_ARCH_LE)
381#define AUDIT_ARCH_FRV (EM_FRV)400#define AUDIT_ARCH_FRV (EM_FRV)
401#define AUDIT_ARCH_H8300 (EM_H8_300)
402#define AUDIT_ARCH_HEXAGON (EM_HEXAGON)
382#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)403#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
383#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)404#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
384#define AUDIT_ARCH_M32R (EM_M32R)405#define AUDIT_ARCH_M32R (EM_M32R)
...@@ -392,6 +413,9 @@ enum {...@@ -392,6 +413,9 @@ enum {
392#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)413#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
393#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\414#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
394 __AUDIT_ARCH_CONVENTION_MIPS64_N32)415 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
416#define AUDIT_ARCH_NDS32 (EM_NDS32|__AUDIT_ARCH_LE)
417#define AUDIT_ARCH_NDS32BE (EM_NDS32)
418#define AUDIT_ARCH_NIOS2 (EM_ALTERA_NIOS2|__AUDIT_ARCH_LE)
395#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)419#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
396#define AUDIT_ARCH_PARISC (EM_PARISC)420#define AUDIT_ARCH_PARISC (EM_PARISC)
397#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)421#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
...@@ -399,6 +423,8 @@ enum {...@@ -399,6 +423,8 @@ enum {
399/* do not define AUDIT_ARCH_PPCLE since it is not supported by audit */423/* do not define AUDIT_ARCH_PPCLE since it is not supported by audit */
400#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)424#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
401#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)425#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
426#define AUDIT_ARCH_RISCV32 (EM_RISCV|__AUDIT_ARCH_LE)
427#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
402#define AUDIT_ARCH_S390 (EM_S390)428#define AUDIT_ARCH_S390 (EM_S390)
403#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)429#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
404#define AUDIT_ARCH_SH (EM_SH)430#define AUDIT_ARCH_SH (EM_SH)
...@@ -410,7 +436,9 @@ enum {...@@ -410,7 +436,9 @@ enum {
410#define AUDIT_ARCH_TILEGX (EM_TILEGX|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)436#define AUDIT_ARCH_TILEGX (EM_TILEGX|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
411#define AUDIT_ARCH_TILEGX32 (EM_TILEGX|__AUDIT_ARCH_LE)437#define AUDIT_ARCH_TILEGX32 (EM_TILEGX|__AUDIT_ARCH_LE)
412#define AUDIT_ARCH_TILEPRO (EM_TILEPRO|__AUDIT_ARCH_LE)438#define AUDIT_ARCH_TILEPRO (EM_TILEPRO|__AUDIT_ARCH_LE)
439#define AUDIT_ARCH_UNICORE (EM_UNICORE|__AUDIT_ARCH_LE)
413#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)440#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
441#define AUDIT_ARCH_XTENSA (EM_XTENSA)
414442
415#define AUDIT_PERM_EXEC 1443#define AUDIT_PERM_EXEC 1
416#define AUDIT_PERM_WRITE 2444#define AUDIT_PERM_WRITE 2
...@@ -445,6 +473,9 @@ struct audit_status {...@@ -445,6 +473,9 @@ struct audit_status {
445 __u32 feature_bitmap; /* bitmap of kernel audit features */473 __u32 feature_bitmap; /* bitmap of kernel audit features */
446 };474 };
447 __u32 backlog_wait_time;/* message queue wait timeout */475 __u32 backlog_wait_time;/* message queue wait timeout */
476 __u32 backlog_wait_time_actual;/* time spent waiting while
477 * message limit exceeded
478 */
448};479};
449480
450struct audit_features {481struct audit_features {
lib/libc/include/any-linux-any/linux/auto_dev-ioctl.h+1-1
...@@ -82,7 +82,7 @@ struct args_ismountpoint {...@@ -82,7 +82,7 @@ struct args_ismountpoint {
82/*82/*
83 * All the ioctls use this structure.83 * All the ioctls use this structure.
84 * When sending a path size must account for the total length84 * When sending a path size must account for the total length
85 * of the chunk of memory otherwise is is the size of the85 * of the chunk of memory otherwise it is the size of the
86 * structure.86 * structure.
87 */87 */
8888
lib/libc/include/any-linux-any/linux/auto_fs.h+1-1
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21#define AUTOFS_MIN_PROTO_VERSION 321#define AUTOFS_MIN_PROTO_VERSION 3
22#define AUTOFS_MAX_PROTO_VERSION 522#define AUTOFS_MAX_PROTO_VERSION 5
2323
24#define AUTOFS_PROTO_SUBVERSION 324#define AUTOFS_PROTO_SUBVERSION 5
2525
26/*26/*
27 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed27 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
lib/libc/include/any-linux-any/linux/auxvec.h+3
...@@ -33,5 +33,8 @@...@@ -33,5 +33,8 @@
3333
34#define AT_EXECFN 31 /* filename of program */34#define AT_EXECFN 31 /* filename of program */
3535
36#ifndef AT_MINSIGSTKSZ
37#define AT_MINSIGSTKSZ 51 /* minimal stack size for signal delivery */
38#endif
3639
37#endif /* _LINUX_AUXVEC_H */40#endif /* _LINUX_AUXVEC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/b1lli.h deleted-74
...@@ -1,74 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
3 *
4 * ISDN lowlevel-module for AVM B1-card.
5 *
6 * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13#ifndef _B1LLI_H_
14#define _B1LLI_H_
15/*
16 * struct for loading t4 file
17 */
18typedef struct avmb1_t4file {
19 int len;
20 unsigned char *data;
21} avmb1_t4file;
22
23typedef struct avmb1_loaddef {
24 int contr;
25 avmb1_t4file t4file;
26} avmb1_loaddef;
27
28typedef struct avmb1_loadandconfigdef {
29 int contr;
30 avmb1_t4file t4file;
31 avmb1_t4file t4config;
32} avmb1_loadandconfigdef;
33
34typedef struct avmb1_resetdef {
35 int contr;
36} avmb1_resetdef;
37
38typedef struct avmb1_getdef {
39 int contr;
40 int cardtype;
41 int cardstate;
42} avmb1_getdef;
43
44/*
45 * struct for adding new cards
46 */
47typedef struct avmb1_carddef {
48 int port;
49 int irq;
50} avmb1_carddef;
51
52#define AVM_CARDTYPE_B1 0
53#define AVM_CARDTYPE_T1 1
54#define AVM_CARDTYPE_M1 2
55#define AVM_CARDTYPE_M2 3
56
57typedef struct avmb1_extcarddef {
58 int port;
59 int irq;
60 int cardtype;
61 int cardnr; /* for HEMA/T1 */
62} avmb1_extcarddef;
63
64#define AVMB1_LOAD 0 /* load image to card */
65#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
66#define AVMB1_RESETCARD 2 /* reset a card */
67#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
68#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
69#define AVMB1_GET_CARDINFO 5 /* get cardtype */
70#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
71
72#define AVMB1_REGISTERCARD_IS_OBSOLETE
73
74#endif /* _B1LLI_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/batadv_packet.h+35-39
...@@ -1,19 +1,7 @@...@@ -1,19 +1,7 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */
2/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors:2/* Copyright (C) B.A.T.M.A.N. contributors:
3 *3 *
4 * Marek Lindner, Simon Wunderlich4 * Marek Lindner, Simon Wunderlich
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */5 */
186
19#ifndef _LINUX_BATADV_PACKET_H_7#ifndef _LINUX_BATADV_PACKET_H_
...@@ -84,8 +72,8 @@ enum batadv_subtype {...@@ -84,8 +72,8 @@ enum batadv_subtype {
8472
85/**73/**
86 * enum batadv_iv_flags - flags used in B.A.T.M.A.N. IV OGM packets74 * enum batadv_iv_flags - flags used in B.A.T.M.A.N. IV OGM packets
87 * @BATADV_NOT_BEST_NEXT_HOP: flag is set when ogm packet is forwarded and was75 * @BATADV_NOT_BEST_NEXT_HOP: flag is set when the ogm packet is forwarded and
88 * previously received from someone else than the best neighbor.76 * was previously received from someone other than the best neighbor.
89 * @BATADV_PRIMARIES_FIRST_HOP: flag unused.77 * @BATADV_PRIMARIES_FIRST_HOP: flag unused.
90 * @BATADV_DIRECTLINK: flag is for the first hop or if rebroadcasted from a78 * @BATADV_DIRECTLINK: flag is for the first hop or if rebroadcasted from a
91 * one hop neighbor on the interface where it was originally received.79 * one hop neighbor on the interface where it was originally received.
...@@ -119,12 +107,20 @@ enum batadv_icmp_packettype {...@@ -119,12 +107,20 @@ enum batadv_icmp_packettype {
119 * @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for107 * @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for
120 * 224.0.0.0/24 or ff02::1108 * 224.0.0.0/24 or ff02::1
121 * @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets109 * @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets
110 * (both link-local and routable ones)
122 * @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets111 * @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets
112 * (both link-local and routable ones)
113 * @BATADV_MCAST_WANT_NO_RTR4: we have no IPv4 multicast router and therefore
114 * only need routable IPv4 multicast packets we signed up for explicitly
115 * @BATADV_MCAST_WANT_NO_RTR6: we have no IPv6 multicast router and therefore
116 * only need routable IPv6 multicast packets we signed up for explicitly
123 */117 */
124enum batadv_mcast_flags {118enum batadv_mcast_flags {
125 BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0,119 BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0,
126 BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1,120 BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1,
127 BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2,121 BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2,
122 BATADV_MCAST_WANT_NO_RTR4 = 1UL << 3,
123 BATADV_MCAST_WANT_NO_RTR6 = 1UL << 4,
128};124};
129125
130/* tt data subtypes */126/* tt data subtypes */
...@@ -199,8 +195,8 @@ struct batadv_bla_claim_dst {...@@ -199,8 +195,8 @@ struct batadv_bla_claim_dst {
199/**195/**
200 * struct batadv_ogm_packet - ogm (routing protocol) packet196 * struct batadv_ogm_packet - ogm (routing protocol) packet
201 * @packet_type: batman-adv packet type, part of the general header197 * @packet_type: batman-adv packet type, part of the general header
202 * @version: batman-adv protocol version, part of the genereal header198 * @version: batman-adv protocol version, part of the general header
203 * @ttl: time to live for this packet, part of the genereal header199 * @ttl: time to live for this packet, part of the general header
204 * @flags: contains routing relevant flags - see enum batadv_iv_flags200 * @flags: contains routing relevant flags - see enum batadv_iv_flags
205 * @seqno: sequence identification201 * @seqno: sequence identification
206 * @orig: address of the source node202 * @orig: address of the source node
...@@ -229,7 +225,7 @@ struct batadv_ogm_packet {...@@ -229,7 +225,7 @@ struct batadv_ogm_packet {
229 * @packet_type: batman-adv packet type, part of the general header225 * @packet_type: batman-adv packet type, part of the general header
230 * @version: batman-adv protocol version, part of the general header226 * @version: batman-adv protocol version, part of the general header
231 * @ttl: time to live for this packet, part of the general header227 * @ttl: time to live for this packet, part of the general header
232 * @flags: reseved for routing relevant flags - currently always 0228 * @flags: reserved for routing relevant flags - currently always 0
233 * @seqno: sequence number229 * @seqno: sequence number
234 * @orig: originator mac address230 * @orig: originator mac address
235 * @tvlv_len: length of the appended tvlv buffer (in bytes)231 * @tvlv_len: length of the appended tvlv buffer (in bytes)
...@@ -251,7 +247,7 @@ struct batadv_ogm2_packet {...@@ -251,7 +247,7 @@ struct batadv_ogm2_packet {
251/**247/**
252 * struct batadv_elp_packet - elp (neighbor discovery) packet248 * struct batadv_elp_packet - elp (neighbor discovery) packet
253 * @packet_type: batman-adv packet type, part of the general header249 * @packet_type: batman-adv packet type, part of the general header
254 * @version: batman-adv protocol version, part of the genereal header250 * @version: batman-adv protocol version, part of the general header
255 * @orig: originator mac address251 * @orig: originator mac address
256 * @seqno: sequence number252 * @seqno: sequence number
257 * @elp_interval: currently used ELP sending interval in ms253 * @elp_interval: currently used ELP sending interval in ms
...@@ -269,15 +265,15 @@ struct batadv_elp_packet {...@@ -269,15 +265,15 @@ struct batadv_elp_packet {
269/**265/**
270 * struct batadv_icmp_header - common members among all the ICMP packets266 * struct batadv_icmp_header - common members among all the ICMP packets
271 * @packet_type: batman-adv packet type, part of the general header267 * @packet_type: batman-adv packet type, part of the general header
272 * @version: batman-adv protocol version, part of the genereal header268 * @version: batman-adv protocol version, part of the general header
273 * @ttl: time to live for this packet, part of the genereal header269 * @ttl: time to live for this packet, part of the general header
274 * @msg_type: ICMP packet type270 * @msg_type: ICMP packet type
275 * @dst: address of the destination node271 * @dst: address of the destination node
276 * @orig: address of the source node272 * @orig: address of the source node
277 * @uid: local ICMP socket identifier273 * @uid: local ICMP socket identifier
278 * @align: not used - useful for alignment purposes only274 * @align: not used - useful for alignment purposes only
279 *275 *
280 * This structure is used for ICMP packets parsing only and it is never sent276 * This structure is used for ICMP packet parsing only and it is never sent
281 * over the wire. The alignment field at the end is there to ensure that277 * over the wire. The alignment field at the end is there to ensure that
282 * members are padded the same way as they are in real packets.278 * members are padded the same way as they are in real packets.
283 */279 */
...@@ -295,8 +291,8 @@ struct batadv_icmp_header {...@@ -295,8 +291,8 @@ struct batadv_icmp_header {
295/**291/**
296 * struct batadv_icmp_packet - ICMP packet292 * struct batadv_icmp_packet - ICMP packet
297 * @packet_type: batman-adv packet type, part of the general header293 * @packet_type: batman-adv packet type, part of the general header
298 * @version: batman-adv protocol version, part of the genereal header294 * @version: batman-adv protocol version, part of the general header
299 * @ttl: time to live for this packet, part of the genereal header295 * @ttl: time to live for this packet, part of the general header
300 * @msg_type: ICMP packet type296 * @msg_type: ICMP packet type
301 * @dst: address of the destination node297 * @dst: address of the destination node
302 * @orig: address of the source node298 * @orig: address of the source node
...@@ -319,8 +315,8 @@ struct batadv_icmp_packet {...@@ -319,8 +315,8 @@ struct batadv_icmp_packet {
319/**315/**
320 * struct batadv_icmp_tp_packet - ICMP TP Meter packet316 * struct batadv_icmp_tp_packet - ICMP TP Meter packet
321 * @packet_type: batman-adv packet type, part of the general header317 * @packet_type: batman-adv packet type, part of the general header
322 * @version: batman-adv protocol version, part of the genereal header318 * @version: batman-adv protocol version, part of the general header
323 * @ttl: time to live for this packet, part of the genereal header319 * @ttl: time to live for this packet, part of the general header
324 * @msg_type: ICMP packet type320 * @msg_type: ICMP packet type
325 * @dst: address of the destination node321 * @dst: address of the destination node
326 * @orig: address of the source node322 * @orig: address of the source node
...@@ -362,8 +358,8 @@ enum batadv_icmp_tp_subtype {...@@ -362,8 +358,8 @@ enum batadv_icmp_tp_subtype {
362/**358/**
363 * struct batadv_icmp_packet_rr - ICMP RouteRecord packet359 * struct batadv_icmp_packet_rr - ICMP RouteRecord packet
364 * @packet_type: batman-adv packet type, part of the general header360 * @packet_type: batman-adv packet type, part of the general header
365 * @version: batman-adv protocol version, part of the genereal header361 * @version: batman-adv protocol version, part of the general header
366 * @ttl: time to live for this packet, part of the genereal header362 * @ttl: time to live for this packet, part of the general header
367 * @msg_type: ICMP packet type363 * @msg_type: ICMP packet type
368 * @dst: address of the destination node364 * @dst: address of the destination node
369 * @orig: address of the source node365 * @orig: address of the source node
...@@ -401,8 +397,8 @@ struct batadv_icmp_packet_rr {...@@ -401,8 +397,8 @@ struct batadv_icmp_packet_rr {
401/**397/**
402 * struct batadv_unicast_packet - unicast packet for network payload398 * struct batadv_unicast_packet - unicast packet for network payload
403 * @packet_type: batman-adv packet type, part of the general header399 * @packet_type: batman-adv packet type, part of the general header
404 * @version: batman-adv protocol version, part of the genereal header400 * @version: batman-adv protocol version, part of the general header
405 * @ttl: time to live for this packet, part of the genereal header401 * @ttl: time to live for this packet, part of the general header
406 * @ttvn: translation table version number402 * @ttvn: translation table version number
407 * @dest: originator destination of the unicast packet403 * @dest: originator destination of the unicast packet
408 */404 */
...@@ -437,8 +433,8 @@ struct batadv_unicast_4addr_packet {...@@ -437,8 +433,8 @@ struct batadv_unicast_4addr_packet {
437/**433/**
438 * struct batadv_frag_packet - fragmented packet434 * struct batadv_frag_packet - fragmented packet
439 * @packet_type: batman-adv packet type, part of the general header435 * @packet_type: batman-adv packet type, part of the general header
440 * @version: batman-adv protocol version, part of the genereal header436 * @version: batman-adv protocol version, part of the general header
441 * @ttl: time to live for this packet, part of the genereal header437 * @ttl: time to live for this packet, part of the general header
442 * @dest: final destination used when routing fragments438 * @dest: final destination used when routing fragments
443 * @orig: originator of the fragment used when merging the packet439 * @orig: originator of the fragment used when merging the packet
444 * @no: fragment number within this sequence440 * @no: fragment number within this sequence
...@@ -471,8 +467,8 @@ struct batadv_frag_packet {...@@ -471,8 +467,8 @@ struct batadv_frag_packet {
471/**467/**
472 * struct batadv_bcast_packet - broadcast packet for network payload468 * struct batadv_bcast_packet - broadcast packet for network payload
473 * @packet_type: batman-adv packet type, part of the general header469 * @packet_type: batman-adv packet type, part of the general header
474 * @version: batman-adv protocol version, part of the genereal header470 * @version: batman-adv protocol version, part of the general header
475 * @ttl: time to live for this packet, part of the genereal header471 * @ttl: time to live for this packet, part of the general header
476 * @reserved: reserved byte for alignment472 * @reserved: reserved byte for alignment
477 * @seqno: sequence identification473 * @seqno: sequence identification
478 * @orig: originator of the broadcast packet474 * @orig: originator of the broadcast packet
...@@ -492,10 +488,10 @@ struct batadv_bcast_packet {...@@ -492,10 +488,10 @@ struct batadv_bcast_packet {
492/**488/**
493 * struct batadv_coded_packet - network coded packet489 * struct batadv_coded_packet - network coded packet
494 * @packet_type: batman-adv packet type, part of the general header490 * @packet_type: batman-adv packet type, part of the general header
495 * @version: batman-adv protocol version, part of the genereal header491 * @version: batman-adv protocol version, part of the general header
496 * @ttl: time to live for this packet, part of the genereal header492 * @ttl: time to live for this packet, part of the general header
497 * @first_source: original source of first included packet493 * @first_source: original source of first included packet
498 * @first_orig_dest: original destinal of first included packet494 * @first_orig_dest: original destination of first included packet
499 * @first_crc: checksum of first included packet495 * @first_crc: checksum of first included packet
500 * @first_ttvn: tt-version number of first included packet496 * @first_ttvn: tt-version number of first included packet
501 * @second_ttl: ttl of second packet497 * @second_ttl: ttl of second packet
...@@ -527,8 +523,8 @@ struct batadv_coded_packet {...@@ -527,8 +523,8 @@ struct batadv_coded_packet {
527/**523/**
528 * struct batadv_unicast_tvlv_packet - generic unicast packet with tvlv payload524 * struct batadv_unicast_tvlv_packet - generic unicast packet with tvlv payload
529 * @packet_type: batman-adv packet type, part of the general header525 * @packet_type: batman-adv packet type, part of the general header
530 * @version: batman-adv protocol version, part of the genereal header526 * @version: batman-adv protocol version, part of the general header
531 * @ttl: time to live for this packet, part of the genereal header527 * @ttl: time to live for this packet, part of the general header
532 * @reserved: reserved field (for packet alignment)528 * @reserved: reserved field (for packet alignment)
533 * @src: address of the source529 * @src: address of the source
534 * @dst: address of the destination530 * @dst: address of the destination
lib/libc/include/any-linux-any/linux/batman_adv.h+221-25
...@@ -1,25 +1,7 @@...@@ -1,25 +1,7 @@
1/* SPDX-License-Identifier: MIT */1/* SPDX-License-Identifier: MIT */
2/* Copyright (C) 2016-2018 B.A.T.M.A.N. contributors:2/* Copyright (C) B.A.T.M.A.N. contributors:
3 *3 *
4 * Matthias Schiffer4 * Matthias Schiffer
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */5 */
246
25#ifndef _LINUX_BATMAN_ADV_H_7#ifndef _LINUX_BATMAN_ADV_H_
...@@ -27,6 +9,7 @@...@@ -27,6 +9,7 @@
279
28#define BATADV_NL_NAME "batadv"10#define BATADV_NL_NAME "batadv"
2911
12#define BATADV_NL_MCAST_GROUP_CONFIG "config"
30#define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"13#define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"
3114
32/**15/**
...@@ -86,7 +69,7 @@ enum batadv_tt_client_flags {...@@ -86,7 +69,7 @@ enum batadv_tt_client_flags {
8669
87 /**70 /**
88 * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be71 * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be
89 * part of the network but no nnode has already announced it72 * part of the network but no node has already announced it
90 */73 */
91 BATADV_TT_CLIENT_TEMP = (1 << 11),74 BATADV_TT_CLIENT_TEMP = (1 << 11),
92};75};
...@@ -138,6 +121,20 @@ enum batadv_mcast_flags_priv {...@@ -138,6 +121,20 @@ enum batadv_mcast_flags_priv {
138 BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4),121 BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4),
139};122};
140123
124/**
125 * enum batadv_gw_modes - gateway mode of node
126 */
127enum batadv_gw_modes {
128 /** @BATADV_GW_MODE_OFF: gw mode disabled */
129 BATADV_GW_MODE_OFF,
130
131 /** @BATADV_GW_MODE_CLIENT: send DHCP requests to gw servers */
132 BATADV_GW_MODE_CLIENT,
133
134 /** @BATADV_GW_MODE_SERVER: announce itself as gateway server */
135 BATADV_GW_MODE_SERVER,
136};
137
141/**138/**
142 * enum batadv_nl_attrs - batman-adv netlink attributes139 * enum batadv_nl_attrs - batman-adv netlink attributes
143 */140 */
...@@ -344,6 +341,146 @@ enum batadv_nl_attrs {...@@ -344,6 +341,146 @@ enum batadv_nl_attrs {
344 */341 */
345 BATADV_ATTR_MCAST_FLAGS_PRIV,342 BATADV_ATTR_MCAST_FLAGS_PRIV,
346343
344 /**
345 * @BATADV_ATTR_VLANID: VLAN id on top of soft interface
346 */
347 BATADV_ATTR_VLANID,
348
349 /**
350 * @BATADV_ATTR_AGGREGATED_OGMS_ENABLED: whether the batman protocol
351 * messages of the mesh interface shall be aggregated or not.
352 */
353 BATADV_ATTR_AGGREGATED_OGMS_ENABLED,
354
355 /**
356 * @BATADV_ATTR_AP_ISOLATION_ENABLED: whether the data traffic going
357 * from a wireless client to another wireless client will be silently
358 * dropped.
359 */
360 BATADV_ATTR_AP_ISOLATION_ENABLED,
361
362 /**
363 * @BATADV_ATTR_ISOLATION_MARK: the isolation mark which is used to
364 * classify clients as "isolated" by the Extended Isolation feature.
365 */
366 BATADV_ATTR_ISOLATION_MARK,
367
368 /**
369 * @BATADV_ATTR_ISOLATION_MASK: the isolation (bit)mask which is used to
370 * classify clients as "isolated" by the Extended Isolation feature.
371 */
372 BATADV_ATTR_ISOLATION_MASK,
373
374 /**
375 * @BATADV_ATTR_BONDING_ENABLED: whether the data traffic going through
376 * the mesh will be sent using multiple interfaces at the same time.
377 */
378 BATADV_ATTR_BONDING_ENABLED,
379
380 /**
381 * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop
382 * avoidance feature is enabled. This feature detects and avoids loops
383 * between the mesh and devices bridged with the soft interface
384 */
385 BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED,
386
387 /**
388 * @BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED: whether the distributed
389 * arp table feature is enabled. This feature uses a distributed hash
390 * table to answer ARP requests without flooding the request through
391 * the whole mesh.
392 */
393 BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED,
394
395 /**
396 * @BATADV_ATTR_FRAGMENTATION_ENABLED: whether the data traffic going
397 * through the mesh will be fragmented or silently discarded if the
398 * packet size exceeds the outgoing interface MTU.
399 */
400 BATADV_ATTR_FRAGMENTATION_ENABLED,
401
402 /**
403 * @BATADV_ATTR_GW_BANDWIDTH_DOWN: defines the download bandwidth which
404 * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
405 * to 'server'.
406 */
407 BATADV_ATTR_GW_BANDWIDTH_DOWN,
408
409 /**
410 * @BATADV_ATTR_GW_BANDWIDTH_UP: defines the upload bandwidth which
411 * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
412 * to 'server'.
413 */
414 BATADV_ATTR_GW_BANDWIDTH_UP,
415
416 /**
417 * @BATADV_ATTR_GW_MODE: defines the state of the gateway features.
418 * Possible values are specified in enum batadv_gw_modes
419 */
420 BATADV_ATTR_GW_MODE,
421
422 /**
423 * @BATADV_ATTR_GW_SEL_CLASS: defines the selection criteria this node
424 * will use to choose a gateway if gw_mode was set to 'client'.
425 */
426 BATADV_ATTR_GW_SEL_CLASS,
427
428 /**
429 * @BATADV_ATTR_HOP_PENALTY: defines the penalty which will be applied
430 * to an originator message's tq-field on every hop and/or per
431 * hard interface
432 */
433 BATADV_ATTR_HOP_PENALTY,
434
435 /**
436 * @BATADV_ATTR_LOG_LEVEL: bitmask with to define which debug messages
437 * should be send to the debug log/trace ring buffer
438 */
439 BATADV_ATTR_LOG_LEVEL,
440
441 /**
442 * @BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED: whether multicast
443 * optimizations should be replaced by simple broadcast-like flooding
444 * of multicast packets. If set to non-zero then all nodes in the mesh
445 * are going to use classic flooding for any multicast packet with no
446 * optimizations.
447 */
448 BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED,
449
450 /**
451 * @BATADV_ATTR_NETWORK_CODING_ENABLED: whether Network Coding (using
452 * some magic to send fewer wifi packets but still the same content) is
453 * enabled or not.
454 */
455 BATADV_ATTR_NETWORK_CODING_ENABLED,
456
457 /**
458 * @BATADV_ATTR_ORIG_INTERVAL: defines the interval in milliseconds in
459 * which batman sends its protocol messages.
460 */
461 BATADV_ATTR_ORIG_INTERVAL,
462
463 /**
464 * @BATADV_ATTR_ELP_INTERVAL: defines the interval in milliseconds in
465 * which batman emits probing packets for neighbor sensing (ELP).
466 */
467 BATADV_ATTR_ELP_INTERVAL,
468
469 /**
470 * @BATADV_ATTR_THROUGHPUT_OVERRIDE: defines the throughput value to be
471 * used by B.A.T.M.A.N. V when estimating the link throughput using
472 * this interface. If the value is set to 0 then batman-adv will try to
473 * estimate the throughput by itself.
474 */
475 BATADV_ATTR_THROUGHPUT_OVERRIDE,
476
477 /**
478 * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet
479 * copies that may be generated for a multicast-to-unicast conversion.
480 * Once this limit is exceeded distribution will fall back to broadcast.
481 */
482 BATADV_ATTR_MULTICAST_FANOUT,
483
347 /* add attributes above here, update the policy in netlink.c */484 /* add attributes above here, update the policy in netlink.c */
348485
349 /**486 /**
...@@ -372,10 +509,14 @@ enum batadv_nl_commands {...@@ -372,10 +509,14 @@ enum batadv_nl_commands {
372 BATADV_CMD_UNSPEC,509 BATADV_CMD_UNSPEC,
373510
374 /**511 /**
375 * @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv512 * @BATADV_CMD_GET_MESH: Get attributes from softif/mesh
376 * device
377 */513 */
378 BATADV_CMD_GET_MESH_INFO,514 BATADV_CMD_GET_MESH,
515
516 /**
517 * @BATADV_CMD_GET_MESH_INFO: Alias for @BATADV_CMD_GET_MESH
518 */
519 BATADV_CMD_GET_MESH_INFO = BATADV_CMD_GET_MESH,
379520
380 /**521 /**
381 * @BATADV_CMD_TP_METER: Start a tp meter session522 * @BATADV_CMD_TP_METER: Start a tp meter session
...@@ -393,9 +534,15 @@ enum batadv_nl_commands {...@@ -393,9 +534,15 @@ enum batadv_nl_commands {
393 BATADV_CMD_GET_ROUTING_ALGOS,534 BATADV_CMD_GET_ROUTING_ALGOS,
394535
395 /**536 /**
396 * @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces537 * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the
538 * current softif
539 */
540 BATADV_CMD_GET_HARDIF,
541
542 /**
543 * @BATADV_CMD_GET_HARDIFS: Alias for @BATADV_CMD_GET_HARDIF
397 */544 */
398 BATADV_CMD_GET_HARDIFS,545 BATADV_CMD_GET_HARDIFS = BATADV_CMD_GET_HARDIF,
399546
400 /**547 /**
401 * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations548 * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations
...@@ -443,6 +590,29 @@ enum batadv_nl_commands {...@@ -443,6 +590,29 @@ enum batadv_nl_commands {
443 */590 */
444 BATADV_CMD_GET_MCAST_FLAGS,591 BATADV_CMD_GET_MCAST_FLAGS,
445592
593 /**
594 * @BATADV_CMD_SET_MESH: Set attributes for softif/mesh
595 */
596 BATADV_CMD_SET_MESH,
597
598 /**
599 * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the
600 * current softif
601 */
602 BATADV_CMD_SET_HARDIF,
603
604 /**
605 * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the
606 * current softif
607 */
608 BATADV_CMD_GET_VLAN,
609
610 /**
611 * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the
612 * current softif
613 */
614 BATADV_CMD_SET_VLAN,
615
446 /* add new commands above here */616 /* add new commands above here */
447617
448 /**618 /**
...@@ -505,4 +675,30 @@ enum batadv_tp_meter_reason {...@@ -505,4 +675,30 @@ enum batadv_tp_meter_reason {
505 BATADV_TP_REASON_TOO_MANY = 133,675 BATADV_TP_REASON_TOO_MANY = 133,
506};676};
507677
678/**
679 * enum batadv_ifla_attrs - batman-adv ifla nested attributes
680 */
681enum batadv_ifla_attrs {
682 /**
683 * @IFLA_BATADV_UNSPEC: unspecified attribute which is not parsed by
684 * rtnetlink
685 */
686 IFLA_BATADV_UNSPEC,
687
688 /**
689 * @IFLA_BATADV_ALGO_NAME: routing algorithm (name) which should be
690 * used by the newly registered batadv net_device.
691 */
692 IFLA_BATADV_ALGO_NAME,
693
694 /* add attributes above here, update the policy in soft-interface.c */
695
696 /**
697 * @__IFLA_BATADV_MAX: internal use
698 */
699 __IFLA_BATADV_MAX,
700};
701
702#define IFLA_BATADV_MAX (__IFLA_BATADV_MAX - 1)
703
508#endif /* _LINUX_BATMAN_ADV_H_ */704#endif /* _LINUX_BATMAN_ADV_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bcache.h deleted-377
...@@ -1,377 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_BCACHE_H
3#define _LINUX_BCACHE_H
4
5/*
6 * Bcache on disk data structures
7 */
8
9#include <linux/types.h>
10
11#define BITMASK(name, type, field, offset, size) \
12static __inline__ __u64 name(const type *k) \
13{ return (k->field >> offset) & ~(~0ULL << size); } \
14 \
15static __inline__ void SET_##name(type *k, __u64 v) \
16{ \
17 k->field &= ~(~(~0ULL << size) << offset); \
18 k->field |= (v & ~(~0ULL << size)) << offset; \
19}
20
21/* Btree keys - all units are in sectors */
22
23struct bkey {
24 __u64 high;
25 __u64 low;
26 __u64 ptr[];
27};
28
29#define KEY_FIELD(name, field, offset, size) \
30 BITMASK(name, struct bkey, field, offset, size)
31
32#define PTR_FIELD(name, offset, size) \
33static __inline__ __u64 name(const struct bkey *k, unsigned int i) \
34{ return (k->ptr[i] >> offset) & ~(~0ULL << size); } \
35 \
36static __inline__ void SET_##name(struct bkey *k, unsigned int i, __u64 v) \
37{ \
38 k->ptr[i] &= ~(~(~0ULL << size) << offset); \
39 k->ptr[i] |= (v & ~(~0ULL << size)) << offset; \
40}
41
42#define KEY_SIZE_BITS 16
43#define KEY_MAX_U64S 8
44
45KEY_FIELD(KEY_PTRS, high, 60, 3)
46KEY_FIELD(HEADER_SIZE, high, 58, 2)
47KEY_FIELD(KEY_CSUM, high, 56, 2)
48KEY_FIELD(KEY_PINNED, high, 55, 1)
49KEY_FIELD(KEY_DIRTY, high, 36, 1)
50
51KEY_FIELD(KEY_SIZE, high, 20, KEY_SIZE_BITS)
52KEY_FIELD(KEY_INODE, high, 0, 20)
53
54/* Next time I change the on disk format, KEY_OFFSET() won't be 64 bits */
55
56static __inline__ __u64 KEY_OFFSET(const struct bkey *k)
57{
58 return k->low;
59}
60
61static __inline__ void SET_KEY_OFFSET(struct bkey *k, __u64 v)
62{
63 k->low = v;
64}
65
66/*
67 * The high bit being set is a relic from when we used it to do binary
68 * searches - it told you where a key started. It's not used anymore,
69 * and can probably be safely dropped.
70 */
71#define KEY(inode, offset, size) \
72((struct bkey) { \
73 .high = (1ULL << 63) | ((__u64) (size) << 20) | (inode), \
74 .low = (offset) \
75})
76
77#define ZERO_KEY KEY(0, 0, 0)
78
79#define MAX_KEY_INODE (~(~0 << 20))
80#define MAX_KEY_OFFSET (~0ULL >> 1)
81#define MAX_KEY KEY(MAX_KEY_INODE, MAX_KEY_OFFSET, 0)
82
83#define KEY_START(k) (KEY_OFFSET(k) - KEY_SIZE(k))
84#define START_KEY(k) KEY(KEY_INODE(k), KEY_START(k), 0)
85
86#define PTR_DEV_BITS 12
87
88PTR_FIELD(PTR_DEV, 51, PTR_DEV_BITS)
89PTR_FIELD(PTR_OFFSET, 8, 43)
90PTR_FIELD(PTR_GEN, 0, 8)
91
92#define PTR_CHECK_DEV ((1 << PTR_DEV_BITS) - 1)
93
94#define MAKE_PTR(gen, offset, dev) \
95 ((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen)
96
97/* Bkey utility code */
98
99static __inline__ unsigned long bkey_u64s(const struct bkey *k)
100{
101 return (sizeof(struct bkey) / sizeof(__u64)) + KEY_PTRS(k);
102}
103
104static __inline__ unsigned long bkey_bytes(const struct bkey *k)
105{
106 return bkey_u64s(k) * sizeof(__u64);
107}
108
109#define bkey_copy(_dest, _src) memcpy(_dest, _src, bkey_bytes(_src))
110
111static __inline__ void bkey_copy_key(struct bkey *dest, const struct bkey *src)
112{
113 SET_KEY_INODE(dest, KEY_INODE(src));
114 SET_KEY_OFFSET(dest, KEY_OFFSET(src));
115}
116
117static __inline__ struct bkey *bkey_next(const struct bkey *k)
118{
119 __u64 *d = (void *) k;
120
121 return (struct bkey *) (d + bkey_u64s(k));
122}
123
124static __inline__ struct bkey *bkey_idx(const struct bkey *k, unsigned int nr_keys)
125{
126 __u64 *d = (void *) k;
127
128 return (struct bkey *) (d + nr_keys);
129}
130/* Enough for a key with 6 pointers */
131#define BKEY_PAD 8
132
133#define BKEY_PADDED(key) \
134 union { struct bkey key; __u64 key ## _pad[BKEY_PAD]; }
135
136/* Superblock */
137
138/* Version 0: Cache device
139 * Version 1: Backing device
140 * Version 2: Seed pointer into btree node checksum
141 * Version 3: Cache device with new UUID format
142 * Version 4: Backing device with data offset
143 */
144#define BCACHE_SB_VERSION_CDEV 0
145#define BCACHE_SB_VERSION_BDEV 1
146#define BCACHE_SB_VERSION_CDEV_WITH_UUID 3
147#define BCACHE_SB_VERSION_BDEV_WITH_OFFSET 4
148#define BCACHE_SB_MAX_VERSION 4
149
150#define SB_SECTOR 8
151#define SB_SIZE 4096
152#define SB_LABEL_SIZE 32
153#define SB_JOURNAL_BUCKETS 256U
154/* SB_JOURNAL_BUCKETS must be divisible by BITS_PER_LONG */
155#define MAX_CACHES_PER_SET 8
156
157#define BDEV_DATA_START_DEFAULT 16 /* sectors */
158
159struct cache_sb {
160 __u64 csum;
161 __u64 offset; /* sector where this sb was written */
162 __u64 version;
163
164 __u8 magic[16];
165
166 __u8 uuid[16];
167 union {
168 __u8 set_uuid[16];
169 __u64 set_magic;
170 };
171 __u8 label[SB_LABEL_SIZE];
172
173 __u64 flags;
174 __u64 seq;
175 __u64 pad[8];
176
177 union {
178 struct {
179 /* Cache devices */
180 __u64 nbuckets; /* device size */
181
182 __u16 block_size; /* sectors */
183 __u16 bucket_size; /* sectors */
184
185 __u16 nr_in_set;
186 __u16 nr_this_dev;
187 };
188 struct {
189 /* Backing devices */
190 __u64 data_offset;
191
192 /*
193 * block_size from the cache device section is still used by
194 * backing devices, so don't add anything here until we fix
195 * things to not need it for backing devices anymore
196 */
197 };
198 };
199
200 __u32 last_mount; /* time overflow in y2106 */
201
202 __u16 first_bucket;
203 union {
204 __u16 njournal_buckets;
205 __u16 keys;
206 };
207 __u64 d[SB_JOURNAL_BUCKETS]; /* journal buckets */
208};
209
210static __inline__ _Bool SB_IS_BDEV(const struct cache_sb *sb)
211{
212 return sb->version == BCACHE_SB_VERSION_BDEV
213 || sb->version == BCACHE_SB_VERSION_BDEV_WITH_OFFSET;
214}
215
216BITMASK(CACHE_SYNC, struct cache_sb, flags, 0, 1);
217BITMASK(CACHE_DISCARD, struct cache_sb, flags, 1, 1);
218BITMASK(CACHE_REPLACEMENT, struct cache_sb, flags, 2, 3);
219#define CACHE_REPLACEMENT_LRU 0U
220#define CACHE_REPLACEMENT_FIFO 1U
221#define CACHE_REPLACEMENT_RANDOM 2U
222
223BITMASK(BDEV_CACHE_MODE, struct cache_sb, flags, 0, 4);
224#define CACHE_MODE_WRITETHROUGH 0U
225#define CACHE_MODE_WRITEBACK 1U
226#define CACHE_MODE_WRITEAROUND 2U
227#define CACHE_MODE_NONE 3U
228BITMASK(BDEV_STATE, struct cache_sb, flags, 61, 2);
229#define BDEV_STATE_NONE 0U
230#define BDEV_STATE_CLEAN 1U
231#define BDEV_STATE_DIRTY 2U
232#define BDEV_STATE_STALE 3U
233
234/*
235 * Magic numbers
236 *
237 * The various other data structures have their own magic numbers, which are
238 * xored with the first part of the cache set's UUID
239 */
240
241#define JSET_MAGIC 0x245235c1a3625032ULL
242#define PSET_MAGIC 0x6750e15f87337f91ULL
243#define BSET_MAGIC 0x90135c78b99e07f5ULL
244
245static __inline__ __u64 jset_magic(struct cache_sb *sb)
246{
247 return sb->set_magic ^ JSET_MAGIC;
248}
249
250static __inline__ __u64 pset_magic(struct cache_sb *sb)
251{
252 return sb->set_magic ^ PSET_MAGIC;
253}
254
255static __inline__ __u64 bset_magic(struct cache_sb *sb)
256{
257 return sb->set_magic ^ BSET_MAGIC;
258}
259
260/*
261 * Journal
262 *
263 * On disk format for a journal entry:
264 * seq is monotonically increasing; every journal entry has its own unique
265 * sequence number.
266 *
267 * last_seq is the oldest journal entry that still has keys the btree hasn't
268 * flushed to disk yet.
269 *
270 * version is for on disk format changes.
271 */
272
273#define BCACHE_JSET_VERSION_UUIDv1 1
274#define BCACHE_JSET_VERSION_UUID 1 /* Always latest UUID format */
275#define BCACHE_JSET_VERSION 1
276
277struct jset {
278 __u64 csum;
279 __u64 magic;
280 __u64 seq;
281 __u32 version;
282 __u32 keys;
283
284 __u64 last_seq;
285
286 BKEY_PADDED(uuid_bucket);
287 BKEY_PADDED(btree_root);
288 __u16 btree_level;
289 __u16 pad[3];
290
291 __u64 prio_bucket[MAX_CACHES_PER_SET];
292
293 union {
294 struct bkey start[0];
295 __u64 d[0];
296 };
297};
298
299/* Bucket prios/gens */
300
301struct prio_set {
302 __u64 csum;
303 __u64 magic;
304 __u64 seq;
305 __u32 version;
306 __u32 pad;
307
308 __u64 next_bucket;
309
310 struct bucket_disk {
311 __u16 prio;
312 __u8 gen;
313 } __attribute((packed)) data[];
314};
315
316/* UUIDS - per backing device/flash only volume metadata */
317
318struct uuid_entry {
319 union {
320 struct {
321 __u8 uuid[16];
322 __u8 label[32];
323 __u32 first_reg; /* time overflow in y2106 */
324 __u32 last_reg;
325 __u32 invalidated;
326
327 __u32 flags;
328 /* Size of flash only volumes */
329 __u64 sectors;
330 };
331
332 __u8 pad[128];
333 };
334};
335
336BITMASK(UUID_FLASH_ONLY, struct uuid_entry, flags, 0, 1);
337
338/* Btree nodes */
339
340/* Version 1: Seed pointer into btree node checksum
341 */
342#define BCACHE_BSET_CSUM 1
343#define BCACHE_BSET_VERSION 1
344
345/*
346 * Btree nodes
347 *
348 * On disk a btree node is a list/log of these; within each set the keys are
349 * sorted
350 */
351struct bset {
352 __u64 csum;
353 __u64 magic;
354 __u64 seq;
355 __u32 version;
356 __u32 keys;
357
358 union {
359 struct bkey start[0];
360 __u64 d[0];
361 };
362};
363
364/* OBSOLETE */
365
366/* UUIDS - per backing device/flash only volume metadata */
367
368struct uuid_entry_v0 {
369 __u8 uuid[16];
370 __u8 label[32];
371 __u32 first_reg;
372 __u32 last_reg;
373 __u32 invalidated;
374 __u32 pad;
375};
376
377#endif /* _LINUX_BCACHE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bfs_fs.h+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*2/*
3 * include/linux/bfs_fs.h - BFS data structures on disk.3 * include/linux/bfs_fs.h - BFS data structures on disk.
4 * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>4 * Copyright (C) 1999-2018 Tigran Aivazian <aivazian.tigran@gmail.com>
5 */5 */
66
7#ifndef _LINUX_BFS_FS_H7#ifndef _LINUX_BFS_FS_H
lib/libc/include/any-linux-any/linux/binfmts.h+5-1
...@@ -16,6 +16,10 @@ struct pt_regs;...@@ -16,6 +16,10 @@ struct pt_regs;
16#define MAX_ARG_STRINGS 0x7FFFFFFF16#define MAX_ARG_STRINGS 0x7FFFFFFF
1717
18/* sizeof(linux_binprm->buf) */18/* sizeof(linux_binprm->buf) */
19#define BINPRM_BUF_SIZE 12819#define BINPRM_BUF_SIZE 256
20
21/* preserve argv0 for the interpreter */
22#define AT_FLAGS_PRESERVE_ARGV0_BIT 0
23#define AT_FLAGS_PRESERVE_ARGV0 (1 << AT_FLAGS_PRESERVE_ARGV0_BIT)
2024
21#endif /* _LINUX_BINFMTS_H */25#endif /* _LINUX_BINFMTS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blkpg.h+2-26
...@@ -2,29 +2,6 @@...@@ -2,29 +2,6 @@
2#ifndef __LINUX_BLKPG_H2#ifndef __LINUX_BLKPG_H
3#define __LINUX_BLKPG_H3#define __LINUX_BLKPG_H
44
5/*
6 * Partition table and disk geometry handling
7 *
8 * A single ioctl with lots of subfunctions:
9 *
10 * Device number stuff:
11 * get_whole_disk() (given the device number of a partition,
12 * find the device number of the encompassing disk)
13 * get_all_partitions() (given the device number of a disk, return the
14 * device numbers of all its known partitions)
15 *
16 * Partition stuff:
17 * add_partition()
18 * delete_partition()
19 * test_partition_in_use() (also for test_disk_in_use)
20 *
21 * Geometry stuff:
22 * get_geometry()
23 * set_geometry()
24 * get_bios_drivedata()
25 *
26 * For today, only the partition stuff - aeb, 990515
27 */
285
29#include <linux/ioctl.h>6#include <linux/ioctl.h>
307
...@@ -52,9 +29,8 @@ struct blkpg_partition {...@@ -52,9 +29,8 @@ struct blkpg_partition {
52 long long start; /* starting offset in bytes */29 long long start; /* starting offset in bytes */
53 long long length; /* length in bytes */30 long long length; /* length in bytes */
54 int pno; /* partition number */31 int pno; /* partition number */
55 char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,32 char devname[BLKPG_DEVNAMELTH]; /* unused / ignored */
56 to be used in kernel messages */33 char volname[BLKPG_VOLNAMELTH]; /* unused / ignore */
57 char volname[BLKPG_VOLNAMELTH]; /* volume label */
58};34};
5935
60#endif /* __LINUX_BLKPG_H */36#endif /* __LINUX_BLKPG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blkzoned.h+40-11
...@@ -73,6 +73,15 @@ enum blk_zone_cond {...@@ -73,6 +73,15 @@ enum blk_zone_cond {
73 BLK_ZONE_COND_OFFLINE = 0xF,73 BLK_ZONE_COND_OFFLINE = 0xF,
74};74};
7575
76/**
77 * enum blk_zone_report_flags - Feature flags of reported zone descriptors.
78 *
79 * @BLK_ZONE_REP_CAPACITY: Zone descriptor has capacity field.
80 */
81enum blk_zone_report_flags {
82 BLK_ZONE_REP_CAPACITY = (1 << 0),
83};
84
76/**85/**
77 * struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl.86 * struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl.
78 *87 *
...@@ -84,12 +93,15 @@ enum blk_zone_cond {...@@ -84,12 +93,15 @@ enum blk_zone_cond {
84 * @non_seq: Flag indicating that the zone is using non-sequential resources93 * @non_seq: Flag indicating that the zone is using non-sequential resources
85 * (for host-aware zoned block devices only).94 * (for host-aware zoned block devices only).
86 * @reset: Flag indicating that a zone reset is recommended.95 * @reset: Flag indicating that a zone reset is recommended.
87 * @reserved: Padding to 64 B to match the ZBC/ZAC defined zone descriptor size.96 * @resv: Padding for 8B alignment.
97 * @capacity: Zone usable capacity in 512 B sector units
98 * @reserved: Padding to 64 B to match the ZBC, ZAC and ZNS defined zone
99 * descriptor size.
88 *100 *
89 * start, len and wp use the regular 512 B sector unit, regardless of the101 * start, len, capacity and wp use the regular 512 B sector unit, regardless
90 * device logical block size. The overall structure size is 64 B to match the102 * of the device logical block size. The overall structure size is 64 B to
91 * ZBC/ZAC defined zone descriptor and allow support for future additional103 * match the ZBC, ZAC and ZNS defined zone descriptor and allow support for
92 * zone information.104 * future additional zone information.
93 */105 */
94struct blk_zone {106struct blk_zone {
95 __u64 start; /* Zone start sector */107 __u64 start; /* Zone start sector */
...@@ -99,7 +111,9 @@ struct blk_zone {...@@ -99,7 +111,9 @@ struct blk_zone {
99 __u8 cond; /* Zone condition */111 __u8 cond; /* Zone condition */
100 __u8 non_seq; /* Non-sequential write resources active */112 __u8 non_seq; /* Non-sequential write resources active */
101 __u8 reset; /* Reset write pointer recommended */113 __u8 reset; /* Reset write pointer recommended */
102 __u8 reserved[36];114 __u8 resv[4];
115 __u64 capacity; /* Zone capacity in number of sectors */
116 __u8 reserved[24];
103};117};
104118
105/**119/**
...@@ -107,7 +121,7 @@ struct blk_zone {...@@ -107,7 +121,7 @@ struct blk_zone {
107 *121 *
108 * @sector: starting sector of report122 * @sector: starting sector of report
109 * @nr_zones: IN maximum / OUT actual123 * @nr_zones: IN maximum / OUT actual
110 * @reserved: padding to 16 byte alignment124 * @flags: one or more flags as defined by enum blk_zone_report_flags.
111 * @zones: Space to hold @nr_zones @zones entries on reply.125 * @zones: Space to hold @nr_zones @zones entries on reply.
112 *126 *
113 * The array of at most @nr_zones must follow this structure in memory.127 * The array of at most @nr_zones must follow this structure in memory.
...@@ -115,14 +129,16 @@ struct blk_zone {...@@ -115,14 +129,16 @@ struct blk_zone {
115struct blk_zone_report {129struct blk_zone_report {
116 __u64 sector;130 __u64 sector;
117 __u32 nr_zones;131 __u32 nr_zones;
118 __u8 reserved[4];132 __u32 flags;
119 struct blk_zone zones[0];133 struct blk_zone zones[0];
120};134};
121135
122/**136/**
123 * struct blk_zone_range - BLKRESETZONE ioctl request137 * struct blk_zone_range - BLKRESETZONE/BLKOPENZONE/
124 * @sector: starting sector of the first zone to issue reset write pointer138 * BLKCLOSEZONE/BLKFINISHZONE ioctl
125 * @nr_sectors: Total number of sectors of 1 or more zones to reset139 * requests
140 * @sector: Starting sector of the first zone to operate on.
141 * @nr_sectors: Total number of sectors of all zones to operate on.
126 */142 */
127struct blk_zone_range {143struct blk_zone_range {
128 __u64 sector;144 __u64 sector;
...@@ -137,8 +153,21 @@ struct blk_zone_range {...@@ -137,8 +153,21 @@ struct blk_zone_range {
137 * sector specified in the report request structure.153 * sector specified in the report request structure.
138 * @BLKRESETZONE: Reset the write pointer of the zones in the specified154 * @BLKRESETZONE: Reset the write pointer of the zones in the specified
139 * sector range. The sector range must be zone aligned.155 * sector range. The sector range must be zone aligned.
156 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
157 * @BLKGETNRZONES: Get the total number of zones of the device.
158 * @BLKOPENZONE: Open the zones in the specified sector range.
159 * The 512 B sector range must be zone aligned.
160 * @BLKCLOSEZONE: Close the zones in the specified sector range.
161 * The 512 B sector range must be zone aligned.
162 * @BLKFINISHZONE: Mark the zones as full in the specified sector range.
163 * The 512 B sector range must be zone aligned.
140 */164 */
141#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)165#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
142#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)166#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
167#define BLKGETZONESZ _IOR(0x12, 132, __u32)
168#define BLKGETNRZONES _IOR(0x12, 133, __u32)
169#define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range)
170#define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range)
171#define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range)
143172
144#endif /* _BLKZONED_H */173#endif /* _BLKZONED_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bpf.h+3880-330
...@@ -14,11 +14,13 @@...@@ -14,11 +14,13 @@
14/* Extended instruction set based on top of classic BPF */14/* Extended instruction set based on top of classic BPF */
1515
16/* instruction classes */16/* instruction classes */
17#define BPF_JMP32 0x06 /* jmp mode in word width */
17#define BPF_ALU64 0x07 /* alu mode in double word width */18#define BPF_ALU64 0x07 /* alu mode in double word width */
1819
19/* ld/ldx fields */20/* ld/ldx fields */
20#define BPF_DW 0x18 /* double word (64-bit) */21#define BPF_DW 0x18 /* double word (64-bit) */
21#define BPF_XADD 0xc0 /* exclusive add */22#define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */
23#define BPF_XADD 0xc0 /* exclusive add - legacy name */
2224
23/* alu/jmp fields */25/* alu/jmp fields */
24#define BPF_MOV 0xb0 /* mov reg to reg */26#define BPF_MOV 0xb0 /* mov reg to reg */
...@@ -42,6 +44,11 @@...@@ -42,6 +44,11 @@
42#define BPF_CALL 0x80 /* function call */44#define BPF_CALL 0x80 /* function call */
43#define BPF_EXIT 0x90 /* function return */45#define BPF_EXIT 0x90 /* function return */
4446
47/* atomic op type fields (stored in immediate) */
48#define BPF_FETCH 0x01 /* not an opcode on its own, used to build others */
49#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
50#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
51
45/* Register numbers */52/* Register numbers */
46enum {53enum {
47 BPF_REG_0 = 0,54 BPF_REG_0 = 0,
...@@ -77,10 +84,757 @@ struct bpf_lpm_trie_key {...@@ -77,10 +84,757 @@ struct bpf_lpm_trie_key {
7784
78struct bpf_cgroup_storage_key {85struct bpf_cgroup_storage_key {
79 __u64 cgroup_inode_id; /* cgroup inode id */86 __u64 cgroup_inode_id; /* cgroup inode id */
80 __u32 attach_type; /* program attach type */87 __u32 attach_type; /* program attach type (enum bpf_attach_type) */
88};
89
90union bpf_iter_link_info {
91 struct {
92 __u32 map_fd;
93 } map;
81};94};
8295
83/* BPF syscall commands, see bpf(2) man-page for details. */96/* BPF syscall commands, see bpf(2) man-page for more details. */
97/**
98 * DOC: eBPF Syscall Preamble
99 *
100 * The operation to be performed by the **bpf**\ () system call is determined
101 * by the *cmd* argument. Each operation takes an accompanying argument,
102 * provided via *attr*, which is a pointer to a union of type *bpf_attr* (see
103 * below). The size argument is the size of the union pointed to by *attr*.
104 */
105/**
106 * DOC: eBPF Syscall Commands
107 *
108 * BPF_MAP_CREATE
109 * Description
110 * Create a map and return a file descriptor that refers to the
111 * map. The close-on-exec file descriptor flag (see **fcntl**\ (2))
112 * is automatically enabled for the new file descriptor.
113 *
114 * Applying **close**\ (2) to the file descriptor returned by
115 * **BPF_MAP_CREATE** will delete the map (but see NOTES).
116 *
117 * Return
118 * A new file descriptor (a nonnegative integer), or -1 if an
119 * error occurred (in which case, *errno* is set appropriately).
120 *
121 * BPF_MAP_LOOKUP_ELEM
122 * Description
123 * Look up an element with a given *key* in the map referred to
124 * by the file descriptor *map_fd*.
125 *
126 * The *flags* argument may be specified as one of the
127 * following:
128 *
129 * **BPF_F_LOCK**
130 * Look up the value of a spin-locked map without
131 * returning the lock. This must be specified if the
132 * elements contain a spinlock.
133 *
134 * Return
135 * Returns zero on success. On error, -1 is returned and *errno*
136 * is set appropriately.
137 *
138 * BPF_MAP_UPDATE_ELEM
139 * Description
140 * Create or update an element (key/value pair) in a specified map.
141 *
142 * The *flags* argument should be specified as one of the
143 * following:
144 *
145 * **BPF_ANY**
146 * Create a new element or update an existing element.
147 * **BPF_NOEXIST**
148 * Create a new element only if it did not exist.
149 * **BPF_EXIST**
150 * Update an existing element.
151 * **BPF_F_LOCK**
152 * Update a spin_lock-ed map element.
153 *
154 * Return
155 * Returns zero on success. On error, -1 is returned and *errno*
156 * is set appropriately.
157 *
158 * May set *errno* to **EINVAL**, **EPERM**, **ENOMEM**,
159 * **E2BIG**, **EEXIST**, or **ENOENT**.
160 *
161 * **E2BIG**
162 * The number of elements in the map reached the
163 * *max_entries* limit specified at map creation time.
164 * **EEXIST**
165 * If *flags* specifies **BPF_NOEXIST** and the element
166 * with *key* already exists in the map.
167 * **ENOENT**
168 * If *flags* specifies **BPF_EXIST** and the element with
169 * *key* does not exist in the map.
170 *
171 * BPF_MAP_DELETE_ELEM
172 * Description
173 * Look up and delete an element by key in a specified map.
174 *
175 * Return
176 * Returns zero on success. On error, -1 is returned and *errno*
177 * is set appropriately.
178 *
179 * BPF_MAP_GET_NEXT_KEY
180 * Description
181 * Look up an element by key in a specified map and return the key
182 * of the next element. Can be used to iterate over all elements
183 * in the map.
184 *
185 * Return
186 * Returns zero on success. On error, -1 is returned and *errno*
187 * is set appropriately.
188 *
189 * The following cases can be used to iterate over all elements of
190 * the map:
191 *
192 * * If *key* is not found, the operation returns zero and sets
193 * the *next_key* pointer to the key of the first element.
194 * * If *key* is found, the operation returns zero and sets the
195 * *next_key* pointer to the key of the next element.
196 * * If *key* is the last element, returns -1 and *errno* is set
197 * to **ENOENT**.
198 *
199 * May set *errno* to **ENOMEM**, **EFAULT**, **EPERM**, or
200 * **EINVAL** on error.
201 *
202 * BPF_PROG_LOAD
203 * Description
204 * Verify and load an eBPF program, returning a new file
205 * descriptor associated with the program.
206 *
207 * Applying **close**\ (2) to the file descriptor returned by
208 * **BPF_PROG_LOAD** will unload the eBPF program (but see NOTES).
209 *
210 * The close-on-exec file descriptor flag (see **fcntl**\ (2)) is
211 * automatically enabled for the new file descriptor.
212 *
213 * Return
214 * A new file descriptor (a nonnegative integer), or -1 if an
215 * error occurred (in which case, *errno* is set appropriately).
216 *
217 * BPF_OBJ_PIN
218 * Description
219 * Pin an eBPF program or map referred by the specified *bpf_fd*
220 * to the provided *pathname* on the filesystem.
221 *
222 * The *pathname* argument must not contain a dot (".").
223 *
224 * On success, *pathname* retains a reference to the eBPF object,
225 * preventing deallocation of the object when the original
226 * *bpf_fd* is closed. This allow the eBPF object to live beyond
227 * **close**\ (\ *bpf_fd*\ ), and hence the lifetime of the parent
228 * process.
229 *
230 * Applying **unlink**\ (2) or similar calls to the *pathname*
231 * unpins the object from the filesystem, removing the reference.
232 * If no other file descriptors or filesystem nodes refer to the
233 * same object, it will be deallocated (see NOTES).
234 *
235 * The filesystem type for the parent directory of *pathname* must
236 * be **BPF_FS_MAGIC**.
237 *
238 * Return
239 * Returns zero on success. On error, -1 is returned and *errno*
240 * is set appropriately.
241 *
242 * BPF_OBJ_GET
243 * Description
244 * Open a file descriptor for the eBPF object pinned to the
245 * specified *pathname*.
246 *
247 * Return
248 * A new file descriptor (a nonnegative integer), or -1 if an
249 * error occurred (in which case, *errno* is set appropriately).
250 *
251 * BPF_PROG_ATTACH
252 * Description
253 * Attach an eBPF program to a *target_fd* at the specified
254 * *attach_type* hook.
255 *
256 * The *attach_type* specifies the eBPF attachment point to
257 * attach the program to, and must be one of *bpf_attach_type*
258 * (see below).
259 *
260 * The *attach_bpf_fd* must be a valid file descriptor for a
261 * loaded eBPF program of a cgroup, flow dissector, LIRC, sockmap
262 * or sock_ops type corresponding to the specified *attach_type*.
263 *
264 * The *target_fd* must be a valid file descriptor for a kernel
265 * object which depends on the attach type of *attach_bpf_fd*:
266 *
267 * **BPF_PROG_TYPE_CGROUP_DEVICE**,
268 * **BPF_PROG_TYPE_CGROUP_SKB**,
269 * **BPF_PROG_TYPE_CGROUP_SOCK**,
270 * **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
271 * **BPF_PROG_TYPE_CGROUP_SOCKOPT**,
272 * **BPF_PROG_TYPE_CGROUP_SYSCTL**,
273 * **BPF_PROG_TYPE_SOCK_OPS**
274 *
275 * Control Group v2 hierarchy with the eBPF controller
276 * enabled. Requires the kernel to be compiled with
277 * **CONFIG_CGROUP_BPF**.
278 *
279 * **BPF_PROG_TYPE_FLOW_DISSECTOR**
280 *
281 * Network namespace (eg /proc/self/ns/net).
282 *
283 * **BPF_PROG_TYPE_LIRC_MODE2**
284 *
285 * LIRC device path (eg /dev/lircN). Requires the kernel
286 * to be compiled with **CONFIG_BPF_LIRC_MODE2**.
287 *
288 * **BPF_PROG_TYPE_SK_SKB**,
289 * **BPF_PROG_TYPE_SK_MSG**
290 *
291 * eBPF map of socket type (eg **BPF_MAP_TYPE_SOCKHASH**).
292 *
293 * Return
294 * Returns zero on success. On error, -1 is returned and *errno*
295 * is set appropriately.
296 *
297 * BPF_PROG_DETACH
298 * Description
299 * Detach the eBPF program associated with the *target_fd* at the
300 * hook specified by *attach_type*. The program must have been
301 * previously attached using **BPF_PROG_ATTACH**.
302 *
303 * Return
304 * Returns zero on success. On error, -1 is returned and *errno*
305 * is set appropriately.
306 *
307 * BPF_PROG_TEST_RUN
308 * Description
309 * Run the eBPF program associated with the *prog_fd* a *repeat*
310 * number of times against a provided program context *ctx_in* and
311 * data *data_in*, and return the modified program context
312 * *ctx_out*, *data_out* (for example, packet data), result of the
313 * execution *retval*, and *duration* of the test run.
314 *
315 * The sizes of the buffers provided as input and output
316 * parameters *ctx_in*, *ctx_out*, *data_in*, and *data_out* must
317 * be provided in the corresponding variables *ctx_size_in*,
318 * *ctx_size_out*, *data_size_in*, and/or *data_size_out*. If any
319 * of these parameters are not provided (ie set to NULL), the
320 * corresponding size field must be zero.
321 *
322 * Some program types have particular requirements:
323 *
324 * **BPF_PROG_TYPE_SK_LOOKUP**
325 * *data_in* and *data_out* must be NULL.
326 *
327 * **BPF_PROG_TYPE_RAW_TRACEPOINT**,
328 * **BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE**
329 *
330 * *ctx_out*, *data_in* and *data_out* must be NULL.
331 * *repeat* must be zero.
332 *
333 * Return
334 * Returns zero on success. On error, -1 is returned and *errno*
335 * is set appropriately.
336 *
337 * **ENOSPC**
338 * Either *data_size_out* or *ctx_size_out* is too small.
339 * **ENOTSUPP**
340 * This command is not supported by the program type of
341 * the program referred to by *prog_fd*.
342 *
343 * BPF_PROG_GET_NEXT_ID
344 * Description
345 * Fetch the next eBPF program currently loaded into the kernel.
346 *
347 * Looks for the eBPF program with an id greater than *start_id*
348 * and updates *next_id* on success. If no other eBPF programs
349 * remain with ids higher than *start_id*, returns -1 and sets
350 * *errno* to **ENOENT**.
351 *
352 * Return
353 * Returns zero on success. On error, or when no id remains, -1
354 * is returned and *errno* is set appropriately.
355 *
356 * BPF_MAP_GET_NEXT_ID
357 * Description
358 * Fetch the next eBPF map currently loaded into the kernel.
359 *
360 * Looks for the eBPF map with an id greater than *start_id*
361 * and updates *next_id* on success. If no other eBPF maps
362 * remain with ids higher than *start_id*, returns -1 and sets
363 * *errno* to **ENOENT**.
364 *
365 * Return
366 * Returns zero on success. On error, or when no id remains, -1
367 * is returned and *errno* is set appropriately.
368 *
369 * BPF_PROG_GET_FD_BY_ID
370 * Description
371 * Open a file descriptor for the eBPF program corresponding to
372 * *prog_id*.
373 *
374 * Return
375 * A new file descriptor (a nonnegative integer), or -1 if an
376 * error occurred (in which case, *errno* is set appropriately).
377 *
378 * BPF_MAP_GET_FD_BY_ID
379 * Description
380 * Open a file descriptor for the eBPF map corresponding to
381 * *map_id*.
382 *
383 * Return
384 * A new file descriptor (a nonnegative integer), or -1 if an
385 * error occurred (in which case, *errno* is set appropriately).
386 *
387 * BPF_OBJ_GET_INFO_BY_FD
388 * Description
389 * Obtain information about the eBPF object corresponding to
390 * *bpf_fd*.
391 *
392 * Populates up to *info_len* bytes of *info*, which will be in
393 * one of the following formats depending on the eBPF object type
394 * of *bpf_fd*:
395 *
396 * * **struct bpf_prog_info**
397 * * **struct bpf_map_info**
398 * * **struct bpf_btf_info**
399 * * **struct bpf_link_info**
400 *
401 * Return
402 * Returns zero on success. On error, -1 is returned and *errno*
403 * is set appropriately.
404 *
405 * BPF_PROG_QUERY
406 * Description
407 * Obtain information about eBPF programs associated with the
408 * specified *attach_type* hook.
409 *
410 * The *target_fd* must be a valid file descriptor for a kernel
411 * object which depends on the attach type of *attach_bpf_fd*:
412 *
413 * **BPF_PROG_TYPE_CGROUP_DEVICE**,
414 * **BPF_PROG_TYPE_CGROUP_SKB**,
415 * **BPF_PROG_TYPE_CGROUP_SOCK**,
416 * **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
417 * **BPF_PROG_TYPE_CGROUP_SOCKOPT**,
418 * **BPF_PROG_TYPE_CGROUP_SYSCTL**,
419 * **BPF_PROG_TYPE_SOCK_OPS**
420 *
421 * Control Group v2 hierarchy with the eBPF controller
422 * enabled. Requires the kernel to be compiled with
423 * **CONFIG_CGROUP_BPF**.
424 *
425 * **BPF_PROG_TYPE_FLOW_DISSECTOR**
426 *
427 * Network namespace (eg /proc/self/ns/net).
428 *
429 * **BPF_PROG_TYPE_LIRC_MODE2**
430 *
431 * LIRC device path (eg /dev/lircN). Requires the kernel
432 * to be compiled with **CONFIG_BPF_LIRC_MODE2**.
433 *
434 * **BPF_PROG_QUERY** always fetches the number of programs
435 * attached and the *attach_flags* which were used to attach those
436 * programs. Additionally, if *prog_ids* is nonzero and the number
437 * of attached programs is less than *prog_cnt*, populates
438 * *prog_ids* with the eBPF program ids of the programs attached
439 * at *target_fd*.
440 *
441 * The following flags may alter the result:
442 *
443 * **BPF_F_QUERY_EFFECTIVE**
444 * Only return information regarding programs which are
445 * currently effective at the specified *target_fd*.
446 *
447 * Return
448 * Returns zero on success. On error, -1 is returned and *errno*
449 * is set appropriately.
450 *
451 * BPF_RAW_TRACEPOINT_OPEN
452 * Description
453 * Attach an eBPF program to a tracepoint *name* to access kernel
454 * internal arguments of the tracepoint in their raw form.
455 *
456 * The *prog_fd* must be a valid file descriptor associated with
457 * a loaded eBPF program of type **BPF_PROG_TYPE_RAW_TRACEPOINT**.
458 *
459 * No ABI guarantees are made about the content of tracepoint
460 * arguments exposed to the corresponding eBPF program.
461 *
462 * Applying **close**\ (2) to the file descriptor returned by
463 * **BPF_RAW_TRACEPOINT_OPEN** will delete the map (but see NOTES).
464 *
465 * Return
466 * A new file descriptor (a nonnegative integer), or -1 if an
467 * error occurred (in which case, *errno* is set appropriately).
468 *
469 * BPF_BTF_LOAD
470 * Description
471 * Verify and load BPF Type Format (BTF) metadata into the kernel,
472 * returning a new file descriptor associated with the metadata.
473 * BTF is described in more detail at
474 * https://www.kernel.org/doc/html/latest/bpf/btf.html.
475 *
476 * The *btf* parameter must point to valid memory providing
477 * *btf_size* bytes of BTF binary metadata.
478 *
479 * The returned file descriptor can be passed to other **bpf**\ ()
480 * subcommands such as **BPF_PROG_LOAD** or **BPF_MAP_CREATE** to
481 * associate the BTF with those objects.
482 *
483 * Similar to **BPF_PROG_LOAD**, **BPF_BTF_LOAD** has optional
484 * parameters to specify a *btf_log_buf*, *btf_log_size* and
485 * *btf_log_level* which allow the kernel to return freeform log
486 * output regarding the BTF verification process.
487 *
488 * Return
489 * A new file descriptor (a nonnegative integer), or -1 if an
490 * error occurred (in which case, *errno* is set appropriately).
491 *
492 * BPF_BTF_GET_FD_BY_ID
493 * Description
494 * Open a file descriptor for the BPF Type Format (BTF)
495 * corresponding to *btf_id*.
496 *
497 * Return
498 * A new file descriptor (a nonnegative integer), or -1 if an
499 * error occurred (in which case, *errno* is set appropriately).
500 *
501 * BPF_TASK_FD_QUERY
502 * Description
503 * Obtain information about eBPF programs associated with the
504 * target process identified by *pid* and *fd*.
505 *
506 * If the *pid* and *fd* are associated with a tracepoint, kprobe
507 * or uprobe perf event, then the *prog_id* and *fd_type* will
508 * be populated with the eBPF program id and file descriptor type
509 * of type **bpf_task_fd_type**. If associated with a kprobe or
510 * uprobe, the *probe_offset* and *probe_addr* will also be
511 * populated. Optionally, if *buf* is provided, then up to
512 * *buf_len* bytes of *buf* will be populated with the name of
513 * the tracepoint, kprobe or uprobe.
514 *
515 * The resulting *prog_id* may be introspected in deeper detail
516 * using **BPF_PROG_GET_FD_BY_ID** and **BPF_OBJ_GET_INFO_BY_FD**.
517 *
518 * Return
519 * Returns zero on success. On error, -1 is returned and *errno*
520 * is set appropriately.
521 *
522 * BPF_MAP_LOOKUP_AND_DELETE_ELEM
523 * Description
524 * Look up an element with the given *key* in the map referred to
525 * by the file descriptor *fd*, and if found, delete the element.
526 *
527 * For **BPF_MAP_TYPE_QUEUE** and **BPF_MAP_TYPE_STACK** map
528 * types, the *flags* argument needs to be set to 0, but for other
529 * map types, it may be specified as:
530 *
531 * **BPF_F_LOCK**
532 * Look up and delete the value of a spin-locked map
533 * without returning the lock. This must be specified if
534 * the elements contain a spinlock.
535 *
536 * The **BPF_MAP_TYPE_QUEUE** and **BPF_MAP_TYPE_STACK** map types
537 * implement this command as a "pop" operation, deleting the top
538 * element rather than one corresponding to *key*.
539 * The *key* and *key_len* parameters should be zeroed when
540 * issuing this operation for these map types.
541 *
542 * This command is only valid for the following map types:
543 * * **BPF_MAP_TYPE_QUEUE**
544 * * **BPF_MAP_TYPE_STACK**
545 * * **BPF_MAP_TYPE_HASH**
546 * * **BPF_MAP_TYPE_PERCPU_HASH**
547 * * **BPF_MAP_TYPE_LRU_HASH**
548 * * **BPF_MAP_TYPE_LRU_PERCPU_HASH**
549 *
550 * Return
551 * Returns zero on success. On error, -1 is returned and *errno*
552 * is set appropriately.
553 *
554 * BPF_MAP_FREEZE
555 * Description
556 * Freeze the permissions of the specified map.
557 *
558 * Write permissions may be frozen by passing zero *flags*.
559 * Upon success, no future syscall invocations may alter the
560 * map state of *map_fd*. Write operations from eBPF programs
561 * are still possible for a frozen map.
562 *
563 * Not supported for maps of type **BPF_MAP_TYPE_STRUCT_OPS**.
564 *
565 * Return
566 * Returns zero on success. On error, -1 is returned and *errno*
567 * is set appropriately.
568 *
569 * BPF_BTF_GET_NEXT_ID
570 * Description
571 * Fetch the next BPF Type Format (BTF) object currently loaded
572 * into the kernel.
573 *
574 * Looks for the BTF object with an id greater than *start_id*
575 * and updates *next_id* on success. If no other BTF objects
576 * remain with ids higher than *start_id*, returns -1 and sets
577 * *errno* to **ENOENT**.
578 *
579 * Return
580 * Returns zero on success. On error, or when no id remains, -1
581 * is returned and *errno* is set appropriately.
582 *
583 * BPF_MAP_LOOKUP_BATCH
584 * Description
585 * Iterate and fetch multiple elements in a map.
586 *
587 * Two opaque values are used to manage batch operations,
588 * *in_batch* and *out_batch*. Initially, *in_batch* must be set
589 * to NULL to begin the batched operation. After each subsequent
590 * **BPF_MAP_LOOKUP_BATCH**, the caller should pass the resultant
591 * *out_batch* as the *in_batch* for the next operation to
592 * continue iteration from the current point.
593 *
594 * The *keys* and *values* are output parameters which must point
595 * to memory large enough to hold *count* items based on the key
596 * and value size of the map *map_fd*. The *keys* buffer must be
597 * of *key_size* * *count*. The *values* buffer must be of
598 * *value_size* * *count*.
599 *
600 * The *elem_flags* argument may be specified as one of the
601 * following:
602 *
603 * **BPF_F_LOCK**
604 * Look up the value of a spin-locked map without
605 * returning the lock. This must be specified if the
606 * elements contain a spinlock.
607 *
608 * On success, *count* elements from the map are copied into the
609 * user buffer, with the keys copied into *keys* and the values
610 * copied into the corresponding indices in *values*.
611 *
612 * If an error is returned and *errno* is not **EFAULT**, *count*
613 * is set to the number of successfully processed elements.
614 *
615 * Return
616 * Returns zero on success. On error, -1 is returned and *errno*
617 * is set appropriately.
618 *
619 * May set *errno* to **ENOSPC** to indicate that *keys* or
620 * *values* is too small to dump an entire bucket during
621 * iteration of a hash-based map type.
622 *
623 * BPF_MAP_LOOKUP_AND_DELETE_BATCH
624 * Description
625 * Iterate and delete all elements in a map.
626 *
627 * This operation has the same behavior as
628 * **BPF_MAP_LOOKUP_BATCH** with two exceptions:
629 *
630 * * Every element that is successfully returned is also deleted
631 * from the map. This is at least *count* elements. Note that
632 * *count* is both an input and an output parameter.
633 * * Upon returning with *errno* set to **EFAULT**, up to
634 * *count* elements may be deleted without returning the keys
635 * and values of the deleted elements.
636 *
637 * Return
638 * Returns zero on success. On error, -1 is returned and *errno*
639 * is set appropriately.
640 *
641 * BPF_MAP_UPDATE_BATCH
642 * Description
643 * Update multiple elements in a map by *key*.
644 *
645 * The *keys* and *values* are input parameters which must point
646 * to memory large enough to hold *count* items based on the key
647 * and value size of the map *map_fd*. The *keys* buffer must be
648 * of *key_size* * *count*. The *values* buffer must be of
649 * *value_size* * *count*.
650 *
651 * Each element specified in *keys* is sequentially updated to the
652 * value in the corresponding index in *values*. The *in_batch*
653 * and *out_batch* parameters are ignored and should be zeroed.
654 *
655 * The *elem_flags* argument should be specified as one of the
656 * following:
657 *
658 * **BPF_ANY**
659 * Create new elements or update a existing elements.
660 * **BPF_NOEXIST**
661 * Create new elements only if they do not exist.
662 * **BPF_EXIST**
663 * Update existing elements.
664 * **BPF_F_LOCK**
665 * Update spin_lock-ed map elements. This must be
666 * specified if the map value contains a spinlock.
667 *
668 * On success, *count* elements from the map are updated.
669 *
670 * If an error is returned and *errno* is not **EFAULT**, *count*
671 * is set to the number of successfully processed elements.
672 *
673 * Return
674 * Returns zero on success. On error, -1 is returned and *errno*
675 * is set appropriately.
676 *
677 * May set *errno* to **EINVAL**, **EPERM**, **ENOMEM**, or
678 * **E2BIG**. **E2BIG** indicates that the number of elements in
679 * the map reached the *max_entries* limit specified at map
680 * creation time.
681 *
682 * May set *errno* to one of the following error codes under
683 * specific circumstances:
684 *
685 * **EEXIST**
686 * If *flags* specifies **BPF_NOEXIST** and the element
687 * with *key* already exists in the map.
688 * **ENOENT**
689 * If *flags* specifies **BPF_EXIST** and the element with
690 * *key* does not exist in the map.
691 *
692 * BPF_MAP_DELETE_BATCH
693 * Description
694 * Delete multiple elements in a map by *key*.
695 *
696 * The *keys* parameter is an input parameter which must point
697 * to memory large enough to hold *count* items based on the key
698 * size of the map *map_fd*, that is, *key_size* * *count*.
699 *
700 * Each element specified in *keys* is sequentially deleted. The
701 * *in_batch*, *out_batch*, and *values* parameters are ignored
702 * and should be zeroed.
703 *
704 * The *elem_flags* argument may be specified as one of the
705 * following:
706 *
707 * **BPF_F_LOCK**
708 * Look up the value of a spin-locked map without
709 * returning the lock. This must be specified if the
710 * elements contain a spinlock.
711 *
712 * On success, *count* elements from the map are updated.
713 *
714 * If an error is returned and *errno* is not **EFAULT**, *count*
715 * is set to the number of successfully processed elements. If
716 * *errno* is **EFAULT**, up to *count* elements may be been
717 * deleted.
718 *
719 * Return
720 * Returns zero on success. On error, -1 is returned and *errno*
721 * is set appropriately.
722 *
723 * BPF_LINK_CREATE
724 * Description
725 * Attach an eBPF program to a *target_fd* at the specified
726 * *attach_type* hook and return a file descriptor handle for
727 * managing the link.
728 *
729 * Return
730 * A new file descriptor (a nonnegative integer), or -1 if an
731 * error occurred (in which case, *errno* is set appropriately).
732 *
733 * BPF_LINK_UPDATE
734 * Description
735 * Update the eBPF program in the specified *link_fd* to
736 * *new_prog_fd*.
737 *
738 * Return
739 * Returns zero on success. On error, -1 is returned and *errno*
740 * is set appropriately.
741 *
742 * BPF_LINK_GET_FD_BY_ID
743 * Description
744 * Open a file descriptor for the eBPF Link corresponding to
745 * *link_id*.
746 *
747 * Return
748 * A new file descriptor (a nonnegative integer), or -1 if an
749 * error occurred (in which case, *errno* is set appropriately).
750 *
751 * BPF_LINK_GET_NEXT_ID
752 * Description
753 * Fetch the next eBPF link currently loaded into the kernel.
754 *
755 * Looks for the eBPF link with an id greater than *start_id*
756 * and updates *next_id* on success. If no other eBPF links
757 * remain with ids higher than *start_id*, returns -1 and sets
758 * *errno* to **ENOENT**.
759 *
760 * Return
761 * Returns zero on success. On error, or when no id remains, -1
762 * is returned and *errno* is set appropriately.
763 *
764 * BPF_ENABLE_STATS
765 * Description
766 * Enable eBPF runtime statistics gathering.
767 *
768 * Runtime statistics gathering for the eBPF runtime is disabled
769 * by default to minimize the corresponding performance overhead.
770 * This command enables statistics globally.
771 *
772 * Multiple programs may independently enable statistics.
773 * After gathering the desired statistics, eBPF runtime statistics
774 * may be disabled again by calling **close**\ (2) for the file
775 * descriptor returned by this function. Statistics will only be
776 * disabled system-wide when all outstanding file descriptors
777 * returned by prior calls for this subcommand are closed.
778 *
779 * Return
780 * A new file descriptor (a nonnegative integer), or -1 if an
781 * error occurred (in which case, *errno* is set appropriately).
782 *
783 * BPF_ITER_CREATE
784 * Description
785 * Create an iterator on top of the specified *link_fd* (as
786 * previously created using **BPF_LINK_CREATE**) and return a
787 * file descriptor that can be used to trigger the iteration.
788 *
789 * If the resulting file descriptor is pinned to the filesystem
790 * using **BPF_OBJ_PIN**, then subsequent **read**\ (2) syscalls
791 * for that path will trigger the iterator to read kernel state
792 * using the eBPF program attached to *link_fd*.
793 *
794 * Return
795 * A new file descriptor (a nonnegative integer), or -1 if an
796 * error occurred (in which case, *errno* is set appropriately).
797 *
798 * BPF_LINK_DETACH
799 * Description
800 * Forcefully detach the specified *link_fd* from its
801 * corresponding attachment point.
802 *
803 * Return
804 * Returns zero on success. On error, -1 is returned and *errno*
805 * is set appropriately.
806 *
807 * BPF_PROG_BIND_MAP
808 * Description
809 * Bind a map to the lifetime of an eBPF program.
810 *
811 * The map identified by *map_fd* is bound to the program
812 * identified by *prog_fd* and only released when *prog_fd* is
813 * released. This may be used in cases where metadata should be
814 * associated with a program which otherwise does not contain any
815 * references to the map (for example, embedded in the eBPF
816 * program instructions).
817 *
818 * Return
819 * Returns zero on success. On error, -1 is returned and *errno*
820 * is set appropriately.
821 *
822 * NOTES
823 * eBPF objects (maps and programs) can be shared between processes.
824 *
825 * * After **fork**\ (2), the child inherits file descriptors
826 * referring to the same eBPF objects.
827 * * File descriptors referring to eBPF objects can be transferred over
828 * **unix**\ (7) domain sockets.
829 * * File descriptors referring to eBPF objects can be duplicated in the
830 * usual way, using **dup**\ (2) and similar calls.
831 * * File descriptors referring to eBPF objects can be pinned to the
832 * filesystem using the **BPF_OBJ_PIN** command of **bpf**\ (2).
833 *
834 * An eBPF object is deallocated only after all file descriptors referring
835 * to the object have been closed and no references remain pinned to the
836 * filesystem or attached (for example, bound to a program or device).
837 */
84enum bpf_cmd {838enum bpf_cmd {
85 BPF_MAP_CREATE,839 BPF_MAP_CREATE,
86 BPF_MAP_LOOKUP_ELEM,840 BPF_MAP_LOOKUP_ELEM,
...@@ -93,6 +847,7 @@ enum bpf_cmd {...@@ -93,6 +847,7 @@ enum bpf_cmd {
93 BPF_PROG_ATTACH,847 BPF_PROG_ATTACH,
94 BPF_PROG_DETACH,848 BPF_PROG_DETACH,
95 BPF_PROG_TEST_RUN,849 BPF_PROG_TEST_RUN,
850 BPF_PROG_RUN = BPF_PROG_TEST_RUN,
96 BPF_PROG_GET_NEXT_ID,851 BPF_PROG_GET_NEXT_ID,
97 BPF_MAP_GET_NEXT_ID,852 BPF_MAP_GET_NEXT_ID,
98 BPF_PROG_GET_FD_BY_ID,853 BPF_PROG_GET_FD_BY_ID,
...@@ -103,6 +858,21 @@ enum bpf_cmd {...@@ -103,6 +858,21 @@ enum bpf_cmd {
103 BPF_BTF_LOAD,858 BPF_BTF_LOAD,
104 BPF_BTF_GET_FD_BY_ID,859 BPF_BTF_GET_FD_BY_ID,
105 BPF_TASK_FD_QUERY,860 BPF_TASK_FD_QUERY,
861 BPF_MAP_LOOKUP_AND_DELETE_ELEM,
862 BPF_MAP_FREEZE,
863 BPF_BTF_GET_NEXT_ID,
864 BPF_MAP_LOOKUP_BATCH,
865 BPF_MAP_LOOKUP_AND_DELETE_BATCH,
866 BPF_MAP_UPDATE_BATCH,
867 BPF_MAP_DELETE_BATCH,
868 BPF_LINK_CREATE,
869 BPF_LINK_UPDATE,
870 BPF_LINK_GET_FD_BY_ID,
871 BPF_LINK_GET_NEXT_ID,
872 BPF_ENABLE_STATS,
873 BPF_ITER_CREATE,
874 BPF_LINK_DETACH,
875 BPF_PROG_BIND_MAP,
106};876};
107877
108enum bpf_map_type {878enum bpf_map_type {
...@@ -127,8 +897,26 @@ enum bpf_map_type {...@@ -127,8 +897,26 @@ enum bpf_map_type {
127 BPF_MAP_TYPE_SOCKHASH,897 BPF_MAP_TYPE_SOCKHASH,
128 BPF_MAP_TYPE_CGROUP_STORAGE,898 BPF_MAP_TYPE_CGROUP_STORAGE,
129 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,899 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
900 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
901 BPF_MAP_TYPE_QUEUE,
902 BPF_MAP_TYPE_STACK,
903 BPF_MAP_TYPE_SK_STORAGE,
904 BPF_MAP_TYPE_DEVMAP_HASH,
905 BPF_MAP_TYPE_STRUCT_OPS,
906 BPF_MAP_TYPE_RINGBUF,
907 BPF_MAP_TYPE_INODE_STORAGE,
908 BPF_MAP_TYPE_TASK_STORAGE,
909 BPF_MAP_TYPE_BLOOM_FILTER,
130};910};
131911
912/* Note that tracing related programs such as
913 * BPF_PROG_TYPE_{KPROBE,TRACEPOINT,PERF_EVENT,RAW_TRACEPOINT}
914 * are not subject to a stable API since kernel internal data
915 * structures can change from release to release and may
916 * therefore break existing tracing BPF programs. Tracing BPF
917 * programs correspond to /a/ specific kernel which is to be
918 * analyzed, and not /a/ specific kernel /and/ all future ones.
919 */
132enum bpf_prog_type {920enum bpf_prog_type {
133 BPF_PROG_TYPE_UNSPEC,921 BPF_PROG_TYPE_UNSPEC,
134 BPF_PROG_TYPE_SOCKET_FILTER,922 BPF_PROG_TYPE_SOCKET_FILTER,
...@@ -152,6 +940,16 @@ enum bpf_prog_type {...@@ -152,6 +940,16 @@ enum bpf_prog_type {
152 BPF_PROG_TYPE_LWT_SEG6LOCAL,940 BPF_PROG_TYPE_LWT_SEG6LOCAL,
153 BPF_PROG_TYPE_LIRC_MODE2,941 BPF_PROG_TYPE_LIRC_MODE2,
154 BPF_PROG_TYPE_SK_REUSEPORT,942 BPF_PROG_TYPE_SK_REUSEPORT,
943 BPF_PROG_TYPE_FLOW_DISSECTOR,
944 BPF_PROG_TYPE_CGROUP_SYSCTL,
945 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
946 BPF_PROG_TYPE_CGROUP_SOCKOPT,
947 BPF_PROG_TYPE_TRACING,
948 BPF_PROG_TYPE_STRUCT_OPS,
949 BPF_PROG_TYPE_EXT,
950 BPF_PROG_TYPE_LSM,
951 BPF_PROG_TYPE_SK_LOOKUP,
952 BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
155};953};
156954
157enum bpf_attach_type {955enum bpf_attach_type {
...@@ -172,11 +970,49 @@ enum bpf_attach_type {...@@ -172,11 +970,49 @@ enum bpf_attach_type {
172 BPF_CGROUP_UDP4_SENDMSG,970 BPF_CGROUP_UDP4_SENDMSG,
173 BPF_CGROUP_UDP6_SENDMSG,971 BPF_CGROUP_UDP6_SENDMSG,
174 BPF_LIRC_MODE2,972 BPF_LIRC_MODE2,
973 BPF_FLOW_DISSECTOR,
974 BPF_CGROUP_SYSCTL,
975 BPF_CGROUP_UDP4_RECVMSG,
976 BPF_CGROUP_UDP6_RECVMSG,
977 BPF_CGROUP_GETSOCKOPT,
978 BPF_CGROUP_SETSOCKOPT,
979 BPF_TRACE_RAW_TP,
980 BPF_TRACE_FENTRY,
981 BPF_TRACE_FEXIT,
982 BPF_MODIFY_RETURN,
983 BPF_LSM_MAC,
984 BPF_TRACE_ITER,
985 BPF_CGROUP_INET4_GETPEERNAME,
986 BPF_CGROUP_INET6_GETPEERNAME,
987 BPF_CGROUP_INET4_GETSOCKNAME,
988 BPF_CGROUP_INET6_GETSOCKNAME,
989 BPF_XDP_DEVMAP,
990 BPF_CGROUP_INET_SOCK_RELEASE,
991 BPF_XDP_CPUMAP,
992 BPF_SK_LOOKUP,
993 BPF_XDP,
994 BPF_SK_SKB_VERDICT,
995 BPF_SK_REUSEPORT_SELECT,
996 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE,
997 BPF_PERF_EVENT,
175 __MAX_BPF_ATTACH_TYPE998 __MAX_BPF_ATTACH_TYPE
176};999};
1771000
178#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE1001#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
1791002
1003enum bpf_link_type {
1004 BPF_LINK_TYPE_UNSPEC = 0,
1005 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
1006 BPF_LINK_TYPE_TRACING = 2,
1007 BPF_LINK_TYPE_CGROUP = 3,
1008 BPF_LINK_TYPE_ITER = 4,
1009 BPF_LINK_TYPE_NETNS = 5,
1010 BPF_LINK_TYPE_XDP = 6,
1011 BPF_LINK_TYPE_PERF_EVENT = 7,
1012
1013 MAX_BPF_LINK_TYPE,
1014};
1015
180/* cgroup-bpf attach flags used in BPF_PROG_ATTACH command1016/* cgroup-bpf attach flags used in BPF_PROG_ATTACH command
181 *1017 *
182 * NONE(default): No further bpf programs allowed in the subtree.1018 * NONE(default): No further bpf programs allowed in the subtree.
...@@ -200,6 +1036,11 @@ enum bpf_attach_type {...@@ -200,6 +1036,11 @@ enum bpf_attach_type {
200 * When children program makes decision (like picking TCP CA or sock bind)1036 * When children program makes decision (like picking TCP CA or sock bind)
201 * parent program has a chance to override it.1037 * parent program has a chance to override it.
202 *1038 *
1039 * With BPF_F_ALLOW_MULTI a new program is added to the end of the list of
1040 * programs for a cgroup. Though it's possible to replace an old program at
1041 * any position by also specifying BPF_F_REPLACE flag and position itself in
1042 * replace_bpf_fd attribute. Old program at this position will be released.
1043 *
203 * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups.1044 * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups.
204 * A cgroup with NONE doesn't allow any programs in sub-cgroups.1045 * A cgroup with NONE doesn't allow any programs in sub-cgroups.
205 * Ex1:1046 * Ex1:
...@@ -218,6 +1059,7 @@ enum bpf_attach_type {...@@ -218,6 +1059,7 @@ enum bpf_attach_type {
218 */1059 */
219#define BPF_F_ALLOW_OVERRIDE (1U << 0)1060#define BPF_F_ALLOW_OVERRIDE (1U << 0)
220#define BPF_F_ALLOW_MULTI (1U << 1)1061#define BPF_F_ALLOW_MULTI (1U << 1)
1062#define BPF_F_REPLACE (1U << 2)
2211063
222/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the1064/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
223 * verifier will perform strict alignment checking as if the kernel1065 * verifier will perform strict alignment checking as if the kernel
...@@ -226,42 +1068,169 @@ enum bpf_attach_type {...@@ -226,42 +1068,169 @@ enum bpf_attach_type {
226 */1068 */
227#define BPF_F_STRICT_ALIGNMENT (1U << 0)1069#define BPF_F_STRICT_ALIGNMENT (1U << 0)
2281070
229/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */1071/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the
230#define BPF_PSEUDO_MAP_FD 11072 * verifier will allow any alignment whatsoever. On platforms
1073 * with strict alignment requirements for loads ands stores (such
1074 * as sparc and mips) the verifier validates that all loads and
1075 * stores provably follow this requirement. This flag turns that
1076 * checking and enforcement off.
1077 *
1078 * It is mostly used for testing when we want to validate the
1079 * context and memory access aspects of the verifier, but because
1080 * of an unaligned access the alignment check would trigger before
1081 * the one we are interested in.
1082 */
1083#define BPF_F_ANY_ALIGNMENT (1U << 1)
2311084
232/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative1085/* BPF_F_TEST_RND_HI32 is used in BPF_PROG_LOAD command for testing purpose.
233 * offset to another bpf function1086 * Verifier does sub-register def/use analysis and identifies instructions whose
1087 * def only matters for low 32-bit, high 32-bit is never referenced later
1088 * through implicit zero extension. Therefore verifier notifies JIT back-ends
1089 * that it is safe to ignore clearing high 32-bit for these instructions. This
1090 * saves some back-ends a lot of code-gen. However such optimization is not
1091 * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends
1092 * hence hasn't used verifier's analysis result. But, we really want to have a
1093 * way to be able to verify the correctness of the described optimization on
1094 * x86_64 on which testsuites are frequently exercised.
1095 *
1096 * So, this flag is introduced. Once it is set, verifier will randomize high
1097 * 32-bit for those instructions who has been identified as safe to ignore them.
1098 * Then, if verifier is not doing correct analysis, such randomization will
1099 * regress tests to expose bugs.
234 */1100 */
235#define BPF_PSEUDO_CALL 11101#define BPF_F_TEST_RND_HI32 (1U << 2)
2361102
237/* flags for BPF_MAP_UPDATE_ELEM command */1103/* The verifier internal test flag. Behavior is undefined */
238#define BPF_ANY 0 /* create new element or update existing */1104#define BPF_F_TEST_STATE_FREQ (1U << 3)
239#define BPF_NOEXIST 1 /* create new element if it didn't exist */
240#define BPF_EXIST 2 /* update existing element */
2411105
242/* flags for BPF_MAP_CREATE command */1106/* If BPF_F_SLEEPABLE is used in BPF_PROG_LOAD command, the verifier will
243#define BPF_F_NO_PREALLOC (1U << 0)1107 * restrict map and helper usage for such programs. Sleepable BPF programs can
244/* Instead of having one common LRU list in the1108 * only be attached to hooks where kernel execution context allows sleeping.
245 * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list1109 * Such programs are allowed to use helpers that may sleep like
246 * which can scale and perform better.1110 * bpf_copy_from_user().
247 * Note, the LRU nodes (including free nodes) cannot be moved1111 */
1112#define BPF_F_SLEEPABLE (1U << 4)
1113
1114/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
1115 * the following extensions:
1116 *
1117 * insn[0].src_reg: BPF_PSEUDO_MAP_[FD|IDX]
1118 * insn[0].imm: map fd or fd_idx
1119 * insn[1].imm: 0
1120 * insn[0].off: 0
1121 * insn[1].off: 0
1122 * ldimm64 rewrite: address of map
1123 * verifier type: CONST_PTR_TO_MAP
1124 */
1125#define BPF_PSEUDO_MAP_FD 1
1126#define BPF_PSEUDO_MAP_IDX 5
1127
1128/* insn[0].src_reg: BPF_PSEUDO_MAP_[IDX_]VALUE
1129 * insn[0].imm: map fd or fd_idx
1130 * insn[1].imm: offset into value
1131 * insn[0].off: 0
1132 * insn[1].off: 0
1133 * ldimm64 rewrite: address of map[0]+offset
1134 * verifier type: PTR_TO_MAP_VALUE
1135 */
1136#define BPF_PSEUDO_MAP_VALUE 2
1137#define BPF_PSEUDO_MAP_IDX_VALUE 6
1138
1139/* insn[0].src_reg: BPF_PSEUDO_BTF_ID
1140 * insn[0].imm: kernel btd id of VAR
1141 * insn[1].imm: 0
1142 * insn[0].off: 0
1143 * insn[1].off: 0
1144 * ldimm64 rewrite: address of the kernel variable
1145 * verifier type: PTR_TO_BTF_ID or PTR_TO_MEM, depending on whether the var
1146 * is struct/union.
1147 */
1148#define BPF_PSEUDO_BTF_ID 3
1149/* insn[0].src_reg: BPF_PSEUDO_FUNC
1150 * insn[0].imm: insn offset to the func
1151 * insn[1].imm: 0
1152 * insn[0].off: 0
1153 * insn[1].off: 0
1154 * ldimm64 rewrite: address of the function
1155 * verifier type: PTR_TO_FUNC.
1156 */
1157#define BPF_PSEUDO_FUNC 4
1158
1159/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
1160 * offset to another bpf function
1161 */
1162#define BPF_PSEUDO_CALL 1
1163/* when bpf_call->src_reg == BPF_PSEUDO_KFUNC_CALL,
1164 * bpf_call->imm == btf_id of a BTF_KIND_FUNC in the running kernel
1165 */
1166#define BPF_PSEUDO_KFUNC_CALL 2
1167
1168/* flags for BPF_MAP_UPDATE_ELEM command */
1169enum {
1170 BPF_ANY = 0, /* create new element or update existing */
1171 BPF_NOEXIST = 1, /* create new element if it didn't exist */
1172 BPF_EXIST = 2, /* update existing element */
1173 BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
1174};
1175
1176/* flags for BPF_MAP_CREATE command */
1177enum {
1178 BPF_F_NO_PREALLOC = (1U << 0),
1179/* Instead of having one common LRU list in the
1180 * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list
1181 * which can scale and perform better.
1182 * Note, the LRU nodes (including free nodes) cannot be moved
248 * across different LRU lists.1183 * across different LRU lists.
249 */1184 */
250#define BPF_F_NO_COMMON_LRU (1U << 1)1185 BPF_F_NO_COMMON_LRU = (1U << 1),
251/* Specify numa node during map creation */1186/* Specify numa node during map creation */
252#define BPF_F_NUMA_NODE (1U << 2)1187 BPF_F_NUMA_NODE = (1U << 2),
1188
1189/* Flags for accessing BPF object from syscall side. */
1190 BPF_F_RDONLY = (1U << 3),
1191 BPF_F_WRONLY = (1U << 4),
1192
1193/* Flag for stack_map, store build_id+offset instead of pointer */
1194 BPF_F_STACK_BUILD_ID = (1U << 5),
1195
1196/* Zero-initialize hash function seed. This should only be used for testing. */
1197 BPF_F_ZERO_SEED = (1U << 6),
1198
1199/* Flags for accessing BPF object from program side. */
1200 BPF_F_RDONLY_PROG = (1U << 7),
1201 BPF_F_WRONLY_PROG = (1U << 8),
1202
1203/* Clone map from listener for newly accepted socket */
1204 BPF_F_CLONE = (1U << 9),
2531205
254/* flags for BPF_PROG_QUERY */1206/* Enable memory-mapping BPF map */
1207 BPF_F_MMAPABLE = (1U << 10),
1208
1209/* Share perf_event among processes */
1210 BPF_F_PRESERVE_ELEMS = (1U << 11),
1211
1212/* Create a map that is suitable to be an inner map with dynamic max entries */
1213 BPF_F_INNER_MAP = (1U << 12),
1214};
1215
1216/* Flags for BPF_PROG_QUERY. */
1217
1218/* Query effective (directly attached + inherited from ancestor cgroups)
1219 * programs that will be executed for events within a cgroup.
1220 * attach_flags with this flag are returned only for directly attached programs.
1221 */
255#define BPF_F_QUERY_EFFECTIVE (1U << 0)1222#define BPF_F_QUERY_EFFECTIVE (1U << 0)
2561223
257#define BPF_OBJ_NAME_LEN 16U1224/* Flags for BPF_PROG_TEST_RUN */
2581225
259/* Flags for accessing BPF object */1226/* If set, run the test on the cpu specified by bpf_attr.test.cpu */
260#define BPF_F_RDONLY (1U << 3)1227#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
261#define BPF_F_WRONLY (1U << 4)
2621228
263/* Flag for stack_map, store build_id+offset instead of pointer */1229/* type for BPF_ENABLE_STATS */
264#define BPF_F_STACK_BUILD_ID (1U << 5)1230enum bpf_stats_type {
1231 /* enabled run_time_ns and run_cnt */
1232 BPF_STATS_RUN_TIME = 0,
1233};
2651234
266enum bpf_stack_build_id_status {1235enum bpf_stack_build_id_status {
267 /* user space need an empty entry to identify end of a trace */1236 /* user space need an empty entry to identify end of a trace */
...@@ -282,6 +1251,8 @@ struct bpf_stack_build_id {...@@ -282,6 +1251,8 @@ struct bpf_stack_build_id {
282 };1251 };
283};1252};
2841253
1254#define BPF_OBJ_NAME_LEN 16U
1255
285union bpf_attr {1256union bpf_attr {
286 struct { /* anonymous struct used by BPF_MAP_CREATE command */1257 struct { /* anonymous struct used by BPF_MAP_CREATE command */
287 __u32 map_type; /* one of enum bpf_map_type */1258 __u32 map_type; /* one of enum bpf_map_type */
...@@ -300,6 +1271,17 @@ union bpf_attr {...@@ -300,6 +1271,17 @@ union bpf_attr {
300 __u32 btf_fd; /* fd pointing to a BTF type data */1271 __u32 btf_fd; /* fd pointing to a BTF type data */
301 __u32 btf_key_type_id; /* BTF type_id of the key */1272 __u32 btf_key_type_id; /* BTF type_id of the key */
302 __u32 btf_value_type_id; /* BTF type_id of the value */1273 __u32 btf_value_type_id; /* BTF type_id of the value */
1274 __u32 btf_vmlinux_value_type_id;/* BTF type_id of a kernel-
1275 * struct stored as the
1276 * map value
1277 */
1278 /* Any per-map-type extra fields
1279 *
1280 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
1281 * number of hash functions (if 0, the bloom filter will default
1282 * to using 5 hash functions).
1283 */
1284 __u64 map_extra;
303 };1285 };
3041286
305 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */1287 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
...@@ -312,6 +1294,23 @@ union bpf_attr {...@@ -312,6 +1294,23 @@ union bpf_attr {
312 __u64 flags;1294 __u64 flags;
313 };1295 };
3141296
1297 struct { /* struct used by BPF_MAP_*_BATCH commands */
1298 __aligned_u64 in_batch; /* start batch,
1299 * NULL to start from beginning
1300 */
1301 __aligned_u64 out_batch; /* output: next start batch */
1302 __aligned_u64 keys;
1303 __aligned_u64 values;
1304 __u32 count; /* input/output:
1305 * input: # of key/value
1306 * elements
1307 * output: # of filled elements
1308 */
1309 __u32 map_fd;
1310 __u64 elem_flags;
1311 __u64 flags;
1312 } batch;
1313
315 struct { /* anonymous struct used by BPF_PROG_LOAD command */1314 struct { /* anonymous struct used by BPF_PROG_LOAD command */
316 __u32 prog_type; /* one of enum bpf_prog_type */1315 __u32 prog_type; /* one of enum bpf_prog_type */
317 __u32 insn_cnt;1316 __u32 insn_cnt;
...@@ -320,7 +1319,7 @@ union bpf_attr {...@@ -320,7 +1319,7 @@ union bpf_attr {
320 __u32 log_level; /* verbosity level of verifier */1319 __u32 log_level; /* verbosity level of verifier */
321 __u32 log_size; /* size of user buffer */1320 __u32 log_size; /* size of user buffer */
322 __aligned_u64 log_buf; /* user supplied buffer */1321 __aligned_u64 log_buf; /* user supplied buffer */
323 __u32 kern_version; /* checked when prog_type=kprobe */1322 __u32 kern_version; /* not used */
324 __u32 prog_flags;1323 __u32 prog_flags;
325 char prog_name[BPF_OBJ_NAME_LEN];1324 char prog_name[BPF_OBJ_NAME_LEN];
326 __u32 prog_ifindex; /* ifindex of netdev to prep for */1325 __u32 prog_ifindex; /* ifindex of netdev to prep for */
...@@ -329,6 +1328,22 @@ union bpf_attr {...@@ -329,6 +1328,22 @@ union bpf_attr {
329 * (context accesses, allowed helpers, etc).1328 * (context accesses, allowed helpers, etc).
330 */1329 */
331 __u32 expected_attach_type;1330 __u32 expected_attach_type;
1331 __u32 prog_btf_fd; /* fd pointing to BTF type data */
1332 __u32 func_info_rec_size; /* userspace bpf_func_info size */
1333 __aligned_u64 func_info; /* func info */
1334 __u32 func_info_cnt; /* number of bpf_func_info records */
1335 __u32 line_info_rec_size; /* userspace bpf_line_info size */
1336 __aligned_u64 line_info; /* line info */
1337 __u32 line_info_cnt; /* number of bpf_line_info records */
1338 __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
1339 union {
1340 /* valid prog_fd to attach to bpf prog */
1341 __u32 attach_prog_fd;
1342 /* or valid module BTF object fd or 0 to attach to vmlinux */
1343 __u32 attach_btf_obj_fd;
1344 };
1345 __u32 :32; /* pad */
1346 __aligned_u64 fd_array; /* array of FDs */
332 };1347 };
3331348
334 struct { /* anonymous struct used by BPF_OBJ_* commands */1349 struct { /* anonymous struct used by BPF_OBJ_* commands */
...@@ -342,17 +1357,33 @@ union bpf_attr {...@@ -342,17 +1357,33 @@ union bpf_attr {
342 __u32 attach_bpf_fd; /* eBPF program to attach */1357 __u32 attach_bpf_fd; /* eBPF program to attach */
343 __u32 attach_type;1358 __u32 attach_type;
344 __u32 attach_flags;1359 __u32 attach_flags;
1360 __u32 replace_bpf_fd; /* previously attached eBPF
1361 * program to replace if
1362 * BPF_F_REPLACE is used
1363 */
345 };1364 };
3461365
347 struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */1366 struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */
348 __u32 prog_fd;1367 __u32 prog_fd;
349 __u32 retval;1368 __u32 retval;
350 __u32 data_size_in;1369 __u32 data_size_in; /* input: len of data_in */
351 __u32 data_size_out;1370 __u32 data_size_out; /* input/output: len of data_out
1371 * returns ENOSPC if data_out
1372 * is too small.
1373 */
352 __aligned_u64 data_in;1374 __aligned_u64 data_in;
353 __aligned_u64 data_out;1375 __aligned_u64 data_out;
354 __u32 repeat;1376 __u32 repeat;
355 __u32 duration;1377 __u32 duration;
1378 __u32 ctx_size_in; /* input: len of ctx_in */
1379 __u32 ctx_size_out; /* input/output: len of ctx_out
1380 * returns ENOSPC if ctx_out
1381 * is too small.
1382 */
1383 __aligned_u64 ctx_in;
1384 __aligned_u64 ctx_out;
1385 __u32 flags;
1386 __u32 cpu;
356 } test;1387 } test;
3571388
358 struct { /* anonymous struct used by BPF_*_GET_*_ID */1389 struct { /* anonymous struct used by BPF_*_GET_*_ID */
...@@ -361,6 +1392,7 @@ union bpf_attr {...@@ -361,6 +1392,7 @@ union bpf_attr {
361 __u32 prog_id;1392 __u32 prog_id;
362 __u32 map_id;1393 __u32 map_id;
363 __u32 btf_id;1394 __u32 btf_id;
1395 __u32 link_id;
364 };1396 };
365 __u32 next_id;1397 __u32 next_id;
366 __u32 open_flags;1398 __u32 open_flags;
...@@ -381,7 +1413,7 @@ union bpf_attr {...@@ -381,7 +1413,7 @@ union bpf_attr {
381 __u32 prog_cnt;1413 __u32 prog_cnt;
382 } query;1414 } query;
3831415
384 struct {1416 struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */
385 __u64 name;1417 __u64 name;
386 __u32 prog_fd;1418 __u32 prog_fd;
387 } raw_tracepoint;1419 } raw_tracepoint;
...@@ -409,6 +1441,60 @@ union bpf_attr {...@@ -409,6 +1441,60 @@ union bpf_attr {
409 __u64 probe_offset; /* output: probe_offset */1441 __u64 probe_offset; /* output: probe_offset */
410 __u64 probe_addr; /* output: probe_addr */1442 __u64 probe_addr; /* output: probe_addr */
411 } task_fd_query;1443 } task_fd_query;
1444
1445 struct { /* struct used by BPF_LINK_CREATE command */
1446 __u32 prog_fd; /* eBPF program to attach */
1447 union {
1448 __u32 target_fd; /* object to attach to */
1449 __u32 target_ifindex; /* target ifindex */
1450 };
1451 __u32 attach_type; /* attach type */
1452 __u32 flags; /* extra flags */
1453 union {
1454 __u32 target_btf_id; /* btf_id of target to attach to */
1455 struct {
1456 __aligned_u64 iter_info; /* extra bpf_iter_link_info */
1457 __u32 iter_info_len; /* iter_info length */
1458 };
1459 struct {
1460 /* black box user-provided value passed through
1461 * to BPF program at the execution time and
1462 * accessible through bpf_get_attach_cookie() BPF helper
1463 */
1464 __u64 bpf_cookie;
1465 } perf_event;
1466 };
1467 } link_create;
1468
1469 struct { /* struct used by BPF_LINK_UPDATE command */
1470 __u32 link_fd; /* link fd */
1471 /* new program fd to update link with */
1472 __u32 new_prog_fd;
1473 __u32 flags; /* extra flags */
1474 /* expected link's program fd; is specified only if
1475 * BPF_F_REPLACE flag is set in flags */
1476 __u32 old_prog_fd;
1477 } link_update;
1478
1479 struct {
1480 __u32 link_fd;
1481 } link_detach;
1482
1483 struct { /* struct used by BPF_ENABLE_STATS command */
1484 __u32 type;
1485 } enable_stats;
1486
1487 struct { /* struct used by BPF_ITER_CREATE command */
1488 __u32 link_fd;
1489 __u32 flags;
1490 } iter_create;
1491
1492 struct { /* struct used by BPF_PROG_BIND_MAP command */
1493 __u32 prog_fd;
1494 __u32 map_fd;
1495 __u32 flags; /* extra flags */
1496 } prog_bind_map;
1497
412} __attribute__((aligned(8)));1498} __attribute__((aligned(8)));
4131499
414/* The description below is an attempt at providing documentation to eBPF1500/* The description below is an attempt at providing documentation to eBPF
...@@ -416,7 +1502,7 @@ union bpf_attr {...@@ -416,7 +1502,7 @@ union bpf_attr {
416 * parsed and used to produce a manual page. The workflow is the following,1502 * parsed and used to produce a manual page. The workflow is the following,
417 * and requires the rst2man utility:1503 * and requires the rst2man utility:
418 *1504 *
419 * $ ./scripts/bpf_helpers_doc.py \1505 * $ ./scripts/bpf_doc.py \
420 * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst1506 * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst
421 * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.71507 * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7
422 * $ man /tmp/bpf-helpers.71508 * $ man /tmp/bpf-helpers.7
...@@ -435,7 +1521,7 @@ union bpf_attr {...@@ -435,7 +1521,7 @@ union bpf_attr {
435 * Map value associated to *key*, or **NULL** if no entry was1521 * Map value associated to *key*, or **NULL** if no entry was
436 * found.1522 * found.
437 *1523 *
438 * int bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)1524 * long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
439 * Description1525 * Description
440 * Add or update the value of the entry associated to *key* in1526 * Add or update the value of the entry associated to *key* in
441 * *map* with *value*. *flags* is one of:1527 * *map* with *value*. *flags* is one of:
...@@ -453,26 +1539,31 @@ union bpf_attr {...@@ -453,26 +1539,31 @@ union bpf_attr {
453 * Return1539 * Return
454 * 0 on success, or a negative error in case of failure.1540 * 0 on success, or a negative error in case of failure.
455 *1541 *
456 * int bpf_map_delete_elem(struct bpf_map *map, const void *key)1542 * long bpf_map_delete_elem(struct bpf_map *map, const void *key)
457 * Description1543 * Description
458 * Delete entry with *key* from *map*.1544 * Delete entry with *key* from *map*.
459 * Return1545 * Return
460 * 0 on success, or a negative error in case of failure.1546 * 0 on success, or a negative error in case of failure.
461 *1547 *
462 * int bpf_probe_read(void *dst, u32 size, const void *src)1548 * long bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr)
463 * Description1549 * Description
464 * For tracing programs, safely attempt to read *size* bytes from1550 * For tracing programs, safely attempt to read *size* bytes from
465 * address *src* and store the data in *dst*.1551 * kernel space address *unsafe_ptr* and store the data in *dst*.
1552 *
1553 * Generally, use **bpf_probe_read_user**\ () or
1554 * **bpf_probe_read_kernel**\ () instead.
466 * Return1555 * Return
467 * 0 on success, or a negative error in case of failure.1556 * 0 on success, or a negative error in case of failure.
468 *1557 *
469 * u64 bpf_ktime_get_ns(void)1558 * u64 bpf_ktime_get_ns(void)
470 * Description1559 * Description
471 * Return the time elapsed since system boot, in nanoseconds.1560 * Return the time elapsed since system boot, in nanoseconds.
1561 * Does not include time the system was suspended.
1562 * See: **clock_gettime**\ (**CLOCK_MONOTONIC**)
472 * Return1563 * Return
473 * Current *ktime*.1564 * Current *ktime*.
474 *1565 *
475 * int bpf_trace_printk(const char *fmt, u32 fmt_size, ...)1566 * long bpf_trace_printk(const char *fmt, u32 fmt_size, ...)
476 * Description1567 * Description
477 * This helper is a "printk()-like" facility for debugging. It1568 * This helper is a "printk()-like" facility for debugging. It
478 * prints a message defined by format *fmt* (of size *fmt_size*)1569 * prints a message defined by format *fmt* (of size *fmt_size*)
...@@ -482,6 +1573,8 @@ union bpf_attr {...@@ -482,6 +1573,8 @@ union bpf_attr {
482 * limited to five).1573 * limited to five).
483 *1574 *
484 * Each time the helper is called, it appends a line to the trace.1575 * Each time the helper is called, it appends a line to the trace.
1576 * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is
1577 * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this.
485 * The format of the trace is customizable, and the exact output1578 * The format of the trace is customizable, and the exact output
486 * one will get depends on the options set in1579 * one will get depends on the options set in
487 * *\/sys/kernel/debug/tracing/trace_options* (see also the1580 * *\/sys/kernel/debug/tracing/trace_options* (see also the
...@@ -520,7 +1613,7 @@ union bpf_attr {...@@ -520,7 +1613,7 @@ union bpf_attr {
520 *1613 *
521 * Also, note that **bpf_trace_printk**\ () is slow, and should1614 * Also, note that **bpf_trace_printk**\ () is slow, and should
522 * only be used for debugging purposes. For this reason, a notice1615 * only be used for debugging purposes. For this reason, a notice
523 * bloc (spanning several lines) is printed to kernel logs and1616 * block (spanning several lines) is printed to kernel logs and
524 * states that the helper should not be used "for production use"1617 * states that the helper should not be used "for production use"
525 * the first time this helper is used (or more precisely, when1618 * the first time this helper is used (or more precisely, when
526 * **trace_printk**\ () buffers are allocated). For passing values1619 * **trace_printk**\ () buffers are allocated). For passing values
...@@ -544,13 +1637,13 @@ union bpf_attr {...@@ -544,13 +1637,13 @@ union bpf_attr {
544 * u32 bpf_get_smp_processor_id(void)1637 * u32 bpf_get_smp_processor_id(void)
545 * Description1638 * Description
546 * Get the SMP (symmetric multiprocessing) processor id. Note that1639 * Get the SMP (symmetric multiprocessing) processor id. Note that
547 * all programs run with preemption disabled, which means that the1640 * all programs run with migration disabled, which means that the
548 * SMP processor id is stable during all the execution of the1641 * SMP processor id is stable during all the execution of the
549 * program.1642 * program.
550 * Return1643 * Return
551 * The SMP id of the processor running the program.1644 * The SMP id of the processor running the program.
552 *1645 *
553 * int bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)1646 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
554 * Description1647 * Description
555 * Store *len* bytes from address *from* into the packet1648 * Store *len* bytes from address *from* into the packet
556 * associated to *skb*, at *offset*. *flags* are a combination of1649 * associated to *skb*, at *offset*. *flags* are a combination of
...@@ -559,7 +1652,7 @@ union bpf_attr {...@@ -559,7 +1652,7 @@ union bpf_attr {
559 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\1652 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
560 * **->swhash** and *skb*\ **->l4hash** to 0).1653 * **->swhash** and *skb*\ **->l4hash** to 0).
561 *1654 *
562 * A call to this helper is susceptible to change the underlaying1655 * A call to this helper is susceptible to change the underlying
563 * packet buffer. Therefore, at load time, all checks on pointers1656 * packet buffer. Therefore, at load time, all checks on pointers
564 * previously done by the verifier are invalidated and must be1657 * previously done by the verifier are invalidated and must be
565 * performed again, if the helper is used in combination with1658 * performed again, if the helper is used in combination with
...@@ -567,7 +1660,7 @@ union bpf_attr {...@@ -567,7 +1660,7 @@ union bpf_attr {
567 * Return1660 * Return
568 * 0 on success, or a negative error in case of failure.1661 * 0 on success, or a negative error in case of failure.
569 *1662 *
570 * int bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size)1663 * long bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size)
571 * Description1664 * Description
572 * Recompute the layer 3 (e.g. IP) checksum for the packet1665 * Recompute the layer 3 (e.g. IP) checksum for the packet
573 * associated to *skb*. Computation is incremental, so the helper1666 * associated to *skb*. Computation is incremental, so the helper
...@@ -584,7 +1677,7 @@ union bpf_attr {...@@ -584,7 +1677,7 @@ union bpf_attr {
584 * flexibility and can handle sizes larger than 2 or 4 for the1677 * flexibility and can handle sizes larger than 2 or 4 for the
585 * checksum to update.1678 * checksum to update.
586 *1679 *
587 * A call to this helper is susceptible to change the underlaying1680 * A call to this helper is susceptible to change the underlying
588 * packet buffer. Therefore, at load time, all checks on pointers1681 * packet buffer. Therefore, at load time, all checks on pointers
589 * previously done by the verifier are invalidated and must be1682 * previously done by the verifier are invalidated and must be
590 * performed again, if the helper is used in combination with1683 * performed again, if the helper is used in combination with
...@@ -592,7 +1685,7 @@ union bpf_attr {...@@ -592,7 +1685,7 @@ union bpf_attr {
592 * Return1685 * Return
593 * 0 on success, or a negative error in case of failure.1686 * 0 on success, or a negative error in case of failure.
594 *1687 *
595 * int bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags)1688 * long bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags)
596 * Description1689 * Description
597 * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the1690 * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the
598 * packet associated to *skb*. Computation is incremental, so the1691 * packet associated to *skb*. Computation is incremental, so the
...@@ -616,7 +1709,7 @@ union bpf_attr {...@@ -616,7 +1709,7 @@ union bpf_attr {
616 * flexibility and can handle sizes larger than 2 or 4 for the1709 * flexibility and can handle sizes larger than 2 or 4 for the
617 * checksum to update.1710 * checksum to update.
618 *1711 *
619 * A call to this helper is susceptible to change the underlaying1712 * A call to this helper is susceptible to change the underlying
620 * packet buffer. Therefore, at load time, all checks on pointers1713 * packet buffer. Therefore, at load time, all checks on pointers
621 * previously done by the verifier are invalidated and must be1714 * previously done by the verifier are invalidated and must be
622 * performed again, if the helper is used in combination with1715 * performed again, if the helper is used in combination with
...@@ -624,7 +1717,7 @@ union bpf_attr {...@@ -624,7 +1717,7 @@ union bpf_attr {
624 * Return1717 * Return
625 * 0 on success, or a negative error in case of failure.1718 * 0 on success, or a negative error in case of failure.
626 *1719 *
627 * int bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index)1720 * long bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index)
628 * Description1721 * Description
629 * This special helper is used to trigger a "tail call", or in1722 * This special helper is used to trigger a "tail call", or in
630 * other words, to jump into another eBPF program. The same stack1723 * other words, to jump into another eBPF program. The same stack
...@@ -655,7 +1748,7 @@ union bpf_attr {...@@ -655,7 +1748,7 @@ union bpf_attr {
655 * Return1748 * Return
656 * 0 on success, or a negative error in case of failure.1749 * 0 on success, or a negative error in case of failure.
657 *1750 *
658 * int bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags)1751 * long bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags)
659 * Description1752 * Description
660 * Clone and redirect the packet associated to *skb* to another1753 * Clone and redirect the packet associated to *skb* to another
661 * net device of index *ifindex*. Both ingress and egress1754 * net device of index *ifindex*. Both ingress and egress
...@@ -671,7 +1764,7 @@ union bpf_attr {...@@ -671,7 +1764,7 @@ union bpf_attr {
671 * efficient, but it is handled through an action code where the1764 * efficient, but it is handled through an action code where the
672 * redirection happens only after the eBPF program has returned.1765 * redirection happens only after the eBPF program has returned.
673 *1766 *
674 * A call to this helper is susceptible to change the underlaying1767 * A call to this helper is susceptible to change the underlying
675 * packet buffer. Therefore, at load time, all checks on pointers1768 * packet buffer. Therefore, at load time, all checks on pointers
676 * previously done by the verifier are invalidated and must be1769 * previously done by the verifier are invalidated and must be
677 * performed again, if the helper is used in combination with1770 * performed again, if the helper is used in combination with
...@@ -691,7 +1784,7 @@ union bpf_attr {...@@ -691,7 +1784,7 @@ union bpf_attr {
691 * A 64-bit integer containing the current GID and UID, and1784 * A 64-bit integer containing the current GID and UID, and
692 * created as such: *current_gid* **<< 32 \|** *current_uid*.1785 * created as such: *current_gid* **<< 32 \|** *current_uid*.
693 *1786 *
694 * int bpf_get_current_comm(char *buf, u32 size_of_buf)1787 * long bpf_get_current_comm(void *buf, u32 size_of_buf)
695 * Description1788 * Description
696 * Copy the **comm** attribute of the current task into *buf* of1789 * Copy the **comm** attribute of the current task into *buf* of
697 * *size_of_buf*. The **comm** attribute contains the name of1790 * *size_of_buf*. The **comm** attribute contains the name of
...@@ -713,7 +1806,7 @@ union bpf_attr {...@@ -713,7 +1806,7 @@ union bpf_attr {
713 * based on a user-provided identifier for all traffic coming from1806 * based on a user-provided identifier for all traffic coming from
714 * the tasks belonging to the related cgroup. See also the related1807 * the tasks belonging to the related cgroup. See also the related
715 * kernel documentation, available from the Linux sources in file1808 * kernel documentation, available from the Linux sources in file
716 * *Documentation/cgroup-v1/net_cls.txt*.1809 * *Documentation/admin-guide/cgroup-v1/net_cls.rst*.
717 *1810 *
718 * The Linux kernel has two versions for cgroups: there are1811 * The Linux kernel has two versions for cgroups: there are
719 * cgroups v1 and cgroups v2. Both are available to users, who can1812 * cgroups v1 and cgroups v2. Both are available to users, who can
...@@ -728,7 +1821,7 @@ union bpf_attr {...@@ -728,7 +1821,7 @@ union bpf_attr {
728 * Return1821 * Return
729 * The classid, or 0 for the default unconfigured classid.1822 * The classid, or 0 for the default unconfigured classid.
730 *1823 *
731 * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)1824 * long bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
732 * Description1825 * Description
733 * Push a *vlan_tci* (VLAN tag control information) of protocol1826 * Push a *vlan_tci* (VLAN tag control information) of protocol
734 * *vlan_proto* to the packet associated to *skb*, then update1827 * *vlan_proto* to the packet associated to *skb*, then update
...@@ -736,7 +1829,7 @@ union bpf_attr {...@@ -736,7 +1829,7 @@ union bpf_attr {
736 * **ETH_P_8021Q** and **ETH_P_8021AD**, it is considered to1829 * **ETH_P_8021Q** and **ETH_P_8021AD**, it is considered to
737 * be **ETH_P_8021Q**.1830 * be **ETH_P_8021Q**.
738 *1831 *
739 * A call to this helper is susceptible to change the underlaying1832 * A call to this helper is susceptible to change the underlying
740 * packet buffer. Therefore, at load time, all checks on pointers1833 * packet buffer. Therefore, at load time, all checks on pointers
741 * previously done by the verifier are invalidated and must be1834 * previously done by the verifier are invalidated and must be
742 * performed again, if the helper is used in combination with1835 * performed again, if the helper is used in combination with
...@@ -744,11 +1837,11 @@ union bpf_attr {...@@ -744,11 +1837,11 @@ union bpf_attr {
744 * Return1837 * Return
745 * 0 on success, or a negative error in case of failure.1838 * 0 on success, or a negative error in case of failure.
746 *1839 *
747 * int bpf_skb_vlan_pop(struct sk_buff *skb)1840 * long bpf_skb_vlan_pop(struct sk_buff *skb)
748 * Description1841 * Description
749 * Pop a VLAN header from the packet associated to *skb*.1842 * Pop a VLAN header from the packet associated to *skb*.
750 *1843 *
751 * A call to this helper is susceptible to change the underlaying1844 * A call to this helper is susceptible to change the underlying
752 * packet buffer. Therefore, at load time, all checks on pointers1845 * packet buffer. Therefore, at load time, all checks on pointers
753 * previously done by the verifier are invalidated and must be1846 * previously done by the verifier are invalidated and must be
754 * performed again, if the helper is used in combination with1847 * performed again, if the helper is used in combination with
...@@ -756,7 +1849,7 @@ union bpf_attr {...@@ -756,7 +1849,7 @@ union bpf_attr {
756 * Return1849 * Return
757 * 0 on success, or a negative error in case of failure.1850 * 0 on success, or a negative error in case of failure.
758 *1851 *
759 * int bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)1852 * long bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)
760 * Description1853 * Description
761 * Get tunnel metadata. This helper takes a pointer *key* to an1854 * Get tunnel metadata. This helper takes a pointer *key* to an
762 * empty **struct bpf_tunnel_key** of **size**, that will be1855 * empty **struct bpf_tunnel_key** of **size**, that will be
...@@ -786,14 +1879,14 @@ union bpf_attr {...@@ -786,14 +1879,14 @@ union bpf_attr {
786 *1879 *
787 * int ret;1880 * int ret;
788 * struct bpf_tunnel_key key = {};1881 * struct bpf_tunnel_key key = {};
789 * 1882 *
790 * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0);1883 * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0);
791 * if (ret < 0)1884 * if (ret < 0)
792 * return TC_ACT_SHOT; // drop packet1885 * return TC_ACT_SHOT; // drop packet
793 * 1886 *
794 * if (key.remote_ipv4 != 0x0a000001)1887 * if (key.remote_ipv4 != 0x0a000001)
795 * return TC_ACT_SHOT; // drop packet1888 * return TC_ACT_SHOT; // drop packet
796 * 1889 *
797 * return TC_ACT_OK; // accept packet1890 * return TC_ACT_OK; // accept packet
798 *1891 *
799 * This interface can also be used with all encapsulation devices1892 * This interface can also be used with all encapsulation devices
...@@ -807,7 +1900,7 @@ union bpf_attr {...@@ -807,7 +1900,7 @@ union bpf_attr {
807 * Return1900 * Return
808 * 0 on success, or a negative error in case of failure.1901 * 0 on success, or a negative error in case of failure.
809 *1902 *
810 * int bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)1903 * long bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)
811 * Description1904 * Description
812 * Populate tunnel metadata for packet associated to *skb.* The1905 * Populate tunnel metadata for packet associated to *skb.* The
813 * tunnel metadata is set to the contents of *key*, of *size*. The1906 * tunnel metadata is set to the contents of *key*, of *size*. The
...@@ -873,7 +1966,7 @@ union bpf_attr {...@@ -873,7 +1966,7 @@ union bpf_attr {
873 * The value of the perf event counter read from the map, or a1966 * The value of the perf event counter read from the map, or a
874 * negative error code in case of failure.1967 * negative error code in case of failure.
875 *1968 *
876 * int bpf_redirect(u32 ifindex, u64 flags)1969 * long bpf_redirect(u32 ifindex, u64 flags)
877 * Description1970 * Description
878 * Redirect the packet to another net device of index *ifindex*.1971 * Redirect the packet to another net device of index *ifindex*.
879 * This helper is somewhat similar to **bpf_clone_redirect**\1972 * This helper is somewhat similar to **bpf_clone_redirect**\
...@@ -887,9 +1980,9 @@ union bpf_attr {...@@ -887,9 +1980,9 @@ union bpf_attr {
887 * supports redirection to the egress interface, and accepts no1980 * supports redirection to the egress interface, and accepts no
888 * flag at all.1981 * flag at all.
889 *1982 *
890 * The same effect can be attained with the more generic1983 * The same effect can also be attained with the more generic
891 * **bpf_redirect_map**\ (), which requires specific maps to be1984 * **bpf_redirect_map**\ (), which uses a BPF map to store the
892 * used but offers better performance.1985 * redirect target instead of providing it directly to the helper.
893 * Return1986 * Return
894 * For XDP, the helper returns **XDP_REDIRECT** on success or1987 * For XDP, the helper returns **XDP_REDIRECT** on success or
895 * **XDP_ABORTED** on error. For other program types, the values1988 * **XDP_ABORTED** on error. For other program types, the values
...@@ -900,7 +1993,7 @@ union bpf_attr {...@@ -900,7 +1993,7 @@ union bpf_attr {
900 * Description1993 * Description
901 * Retrieve the realm or the route, that is to say the1994 * Retrieve the realm or the route, that is to say the
902 * **tclassid** field of the destination for the *skb*. The1995 * **tclassid** field of the destination for the *skb*. The
903 * indentifier retrieved is a user-provided tag, similar to the1996 * identifier retrieved is a user-provided tag, similar to the
904 * one used with the net_cls cgroup (see description for1997 * one used with the net_cls cgroup (see description for
905 * **bpf_get_cgroup_classid**\ () helper), but here this tag is1998 * **bpf_get_cgroup_classid**\ () helper), but here this tag is
906 * held by a route (a destination entry), not by a task.1999 * held by a route (a destination entry), not by a task.
...@@ -920,7 +2013,7 @@ union bpf_attr {...@@ -920,7 +2013,7 @@ union bpf_attr {
920 * The realm of the route for the packet associated to *skb*, or 02013 * The realm of the route for the packet associated to *skb*, or 0
921 * if none was found.2014 * if none was found.
922 *2015 *
923 * int bpf_perf_event_output(struct pt_reg *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)2016 * long bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
924 * Description2017 * Description
925 * Write raw *data* blob into a special BPF perf event held by2018 * Write raw *data* blob into a special BPF perf event held by
926 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf2019 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
...@@ -965,7 +2058,7 @@ union bpf_attr {...@@ -965,7 +2058,7 @@ union bpf_attr {
965 * Return2058 * Return
966 * 0 on success, or a negative error in case of failure.2059 * 0 on success, or a negative error in case of failure.
967 *2060 *
968 * int bpf_skb_load_bytes(const struct sk_buff *skb, u32 offset, void *to, u32 len)2061 * long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len)
969 * Description2062 * Description
970 * This helper was provided as an easy way to load data from a2063 * This helper was provided as an easy way to load data from a
971 * packet. It can be used to load *len* bytes from *offset* from2064 * packet. It can be used to load *len* bytes from *offset* from
...@@ -982,7 +2075,7 @@ union bpf_attr {...@@ -982,7 +2075,7 @@ union bpf_attr {
982 * Return2075 * Return
983 * 0 on success, or a negative error in case of failure.2076 * 0 on success, or a negative error in case of failure.
984 *2077 *
985 * int bpf_get_stackid(struct pt_reg *ctx, struct bpf_map *map, u64 flags)2078 * long bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags)
986 * Description2079 * Description
987 * Walk a user or a kernel stack and return its id. To achieve2080 * Walk a user or a kernel stack and return its id. To achieve
988 * this, the helper needs *ctx*, which is a pointer to the context2081 * this, the helper needs *ctx*, which is a pointer to the context
...@@ -1051,7 +2144,7 @@ union bpf_attr {...@@ -1051,7 +2144,7 @@ union bpf_attr {
1051 * The checksum result, or a negative error code in case of2144 * The checksum result, or a negative error code in case of
1052 * failure.2145 * failure.
1053 *2146 *
1054 * int bpf_skb_get_tunnel_opt(struct sk_buff *skb, u8 *opt, u32 size)2147 * long bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)
1055 * Description2148 * Description
1056 * Retrieve tunnel options metadata for the packet associated to2149 * Retrieve tunnel options metadata for the packet associated to
1057 * *skb*, and store the raw tunnel option data to the buffer *opt*2150 * *skb*, and store the raw tunnel option data to the buffer *opt*
...@@ -1069,7 +2162,7 @@ union bpf_attr {...@@ -1069,7 +2162,7 @@ union bpf_attr {
1069 * Return2162 * Return
1070 * The size of the option data retrieved.2163 * The size of the option data retrieved.
1071 *2164 *
1072 * int bpf_skb_set_tunnel_opt(struct sk_buff *skb, u8 *opt, u32 size)2165 * long bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)
1073 * Description2166 * Description
1074 * Set tunnel options metadata for the packet associated to *skb*2167 * Set tunnel options metadata for the packet associated to *skb*
1075 * to the option data contained in the raw buffer *opt* of *size*.2168 * to the option data contained in the raw buffer *opt* of *size*.
...@@ -1079,7 +2172,7 @@ union bpf_attr {...@@ -1079,7 +2172,7 @@ union bpf_attr {
1079 * Return2172 * Return
1080 * 0 on success, or a negative error in case of failure.2173 * 0 on success, or a negative error in case of failure.
1081 *2174 *
1082 * int bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags)2175 * long bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags)
1083 * Description2176 * Description
1084 * Change the protocol of the *skb* to *proto*. Currently2177 * Change the protocol of the *skb* to *proto*. Currently
1085 * supported are transition from IPv4 to IPv6, and from IPv6 to2178 * supported are transition from IPv4 to IPv6, and from IPv6 to
...@@ -1098,7 +2191,7 @@ union bpf_attr {...@@ -1098,7 +2191,7 @@ union bpf_attr {
1098 * All values for *flags* are reserved for future usage, and must2191 * All values for *flags* are reserved for future usage, and must
1099 * be left at zero.2192 * be left at zero.
1100 *2193 *
1101 * A call to this helper is susceptible to change the underlaying2194 * A call to this helper is susceptible to change the underlying
1102 * packet buffer. Therefore, at load time, all checks on pointers2195 * packet buffer. Therefore, at load time, all checks on pointers
1103 * previously done by the verifier are invalidated and must be2196 * previously done by the verifier are invalidated and must be
1104 * performed again, if the helper is used in combination with2197 * performed again, if the helper is used in combination with
...@@ -1106,7 +2199,7 @@ union bpf_attr {...@@ -1106,7 +2199,7 @@ union bpf_attr {
1106 * Return2199 * Return
1107 * 0 on success, or a negative error in case of failure.2200 * 0 on success, or a negative error in case of failure.
1108 *2201 *
1109 * int bpf_skb_change_type(struct sk_buff *skb, u32 type)2202 * long bpf_skb_change_type(struct sk_buff *skb, u32 type)
1110 * Description2203 * Description
1111 * Change the packet type for the packet associated to *skb*. This2204 * Change the packet type for the packet associated to *skb*. This
1112 * comes down to setting *skb*\ **->pkt_type** to *type*, except2205 * comes down to setting *skb*\ **->pkt_type** to *type*, except
...@@ -1133,7 +2226,7 @@ union bpf_attr {...@@ -1133,7 +2226,7 @@ union bpf_attr {
1133 * Return2226 * Return
1134 * 0 on success, or a negative error in case of failure.2227 * 0 on success, or a negative error in case of failure.
1135 *2228 *
1136 * int bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index)2229 * long bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index)
1137 * Description2230 * Description
1138 * Check whether *skb* is a descendant of the cgroup2 held by2231 * Check whether *skb* is a descendant of the cgroup2 held by
1139 * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*.2232 * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*.
...@@ -1164,7 +2257,7 @@ union bpf_attr {...@@ -1164,7 +2257,7 @@ union bpf_attr {
1164 * Return2257 * Return
1165 * A pointer to the current task struct.2258 * A pointer to the current task struct.
1166 *2259 *
1167 * int bpf_probe_write_user(void *dst, const void *src, u32 len)2260 * long bpf_probe_write_user(void *dst, const void *src, u32 len)
1168 * Description2261 * Description
1169 * Attempt in a safe way to write *len* bytes from the buffer2262 * Attempt in a safe way to write *len* bytes from the buffer
1170 * *src* to *dst* in memory. It only works for threads that are in2263 * *src* to *dst* in memory. It only works for threads that are in
...@@ -1183,7 +2276,7 @@ union bpf_attr {...@@ -1183,7 +2276,7 @@ union bpf_attr {
1183 * Return2276 * Return
1184 * 0 on success, or a negative error in case of failure.2277 * 0 on success, or a negative error in case of failure.
1185 *2278 *
1186 * int bpf_current_task_under_cgroup(struct bpf_map *map, u32 index)2279 * long bpf_current_task_under_cgroup(struct bpf_map *map, u32 index)
1187 * Description2280 * Description
1188 * Check whether the probe is being run is the context of a given2281 * Check whether the probe is being run is the context of a given
1189 * subset of the cgroup2 hierarchy. The cgroup2 to test is held by2282 * subset of the cgroup2 hierarchy. The cgroup2 to test is held by
...@@ -1191,11 +2284,11 @@ union bpf_attr {...@@ -1191,11 +2284,11 @@ union bpf_attr {
1191 * Return2284 * Return
1192 * The return value depends on the result of the test, and can be:2285 * The return value depends on the result of the test, and can be:
1193 *2286 *
1194 * * 0, if the *skb* task belongs to the cgroup2.2287 * * 0, if current task belongs to the cgroup2.
1195 * * 1, if the *skb* task does not belong to the cgroup2.2288 * * 1, if current task does not belong to the cgroup2.
1196 * * A negative error code, if an error occurred.2289 * * A negative error code, if an error occurred.
1197 *2290 *
1198 * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)2291 * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
1199 * Description2292 * Description
1200 * Resize (trim or grow) the packet associated to *skb* to the2293 * Resize (trim or grow) the packet associated to *skb* to the
1201 * new *len*. The *flags* are reserved for future usage, and must2294 * new *len*. The *flags* are reserved for future usage, and must
...@@ -1211,7 +2304,7 @@ union bpf_attr {...@@ -1211,7 +2304,7 @@ union bpf_attr {
1211 * implicitly linearizes, unclones and drops offloads from the2304 * implicitly linearizes, unclones and drops offloads from the
1212 * *skb*.2305 * *skb*.
1213 *2306 *
1214 * A call to this helper is susceptible to change the underlaying2307 * A call to this helper is susceptible to change the underlying
1215 * packet buffer. Therefore, at load time, all checks on pointers2308 * packet buffer. Therefore, at load time, all checks on pointers
1216 * previously done by the verifier are invalidated and must be2309 * previously done by the verifier are invalidated and must be
1217 * performed again, if the helper is used in combination with2310 * performed again, if the helper is used in combination with
...@@ -1219,7 +2312,7 @@ union bpf_attr {...@@ -1219,7 +2312,7 @@ union bpf_attr {
1219 * Return2312 * Return
1220 * 0 on success, or a negative error in case of failure.2313 * 0 on success, or a negative error in case of failure.
1221 *2314 *
1222 * int bpf_skb_pull_data(struct sk_buff *skb, u32 len)2315 * long bpf_skb_pull_data(struct sk_buff *skb, u32 len)
1223 * Description2316 * Description
1224 * Pull in non-linear data in case the *skb* is non-linear and not2317 * Pull in non-linear data in case the *skb* is non-linear and not
1225 * all of *len* are part of the linear section. Make *len* bytes2318 * all of *len* are part of the linear section. Make *len* bytes
...@@ -1247,7 +2340,7 @@ union bpf_attr {...@@ -1247,7 +2340,7 @@ union bpf_attr {
1247 * **bpf_skb_pull_data()** to effectively unclone the *skb* from2340 * **bpf_skb_pull_data()** to effectively unclone the *skb* from
1248 * the very beginning in case it is indeed cloned.2341 * the very beginning in case it is indeed cloned.
1249 *2342 *
1250 * A call to this helper is susceptible to change the underlaying2343 * A call to this helper is susceptible to change the underlying
1251 * packet buffer. Therefore, at load time, all checks on pointers2344 * packet buffer. Therefore, at load time, all checks on pointers
1252 * previously done by the verifier are invalidated and must be2345 * previously done by the verifier are invalidated and must be
1253 * performed again, if the helper is used in combination with2346 * performed again, if the helper is used in combination with
...@@ -1275,7 +2368,7 @@ union bpf_attr {...@@ -1275,7 +2368,7 @@ union bpf_attr {
1275 * recalculation the next time the kernel tries to access this2368 * recalculation the next time the kernel tries to access this
1276 * hash or when the **bpf_get_hash_recalc**\ () helper is called.2369 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
1277 *2370 *
1278 * int bpf_get_numa_node_id(void)2371 * long bpf_get_numa_node_id(void)
1279 * Description2372 * Description
1280 * Return the id of the current NUMA node. The primary use case2373 * Return the id of the current NUMA node. The primary use case
1281 * for this helper is the selection of sockets for the local NUMA2374 * for this helper is the selection of sockets for the local NUMA
...@@ -1286,7 +2379,7 @@ union bpf_attr {...@@ -1286,7 +2379,7 @@ union bpf_attr {
1286 * Return2379 * Return
1287 * The id of current NUMA node.2380 * The id of current NUMA node.
1288 *2381 *
1289 * int bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags)2382 * long bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags)
1290 * Description2383 * Description
1291 * Grows headroom of packet associated to *skb* and adjusts the2384 * Grows headroom of packet associated to *skb* and adjusts the
1292 * offset of the MAC header accordingly, adding *len* bytes of2385 * offset of the MAC header accordingly, adding *len* bytes of
...@@ -1299,7 +2392,7 @@ union bpf_attr {...@@ -1299,7 +2392,7 @@ union bpf_attr {
1299 * All values for *flags* are reserved for future usage, and must2392 * All values for *flags* are reserved for future usage, and must
1300 * be left at zero.2393 * be left at zero.
1301 *2394 *
1302 * A call to this helper is susceptible to change the underlaying2395 * A call to this helper is susceptible to change the underlying
1303 * packet buffer. Therefore, at load time, all checks on pointers2396 * packet buffer. Therefore, at load time, all checks on pointers
1304 * previously done by the verifier are invalidated and must be2397 * previously done by the verifier are invalidated and must be
1305 * performed again, if the helper is used in combination with2398 * performed again, if the helper is used in combination with
...@@ -1307,14 +2400,14 @@ union bpf_attr {...@@ -1307,14 +2400,14 @@ union bpf_attr {
1307 * Return2400 * Return
1308 * 0 on success, or a negative error in case of failure.2401 * 0 on success, or a negative error in case of failure.
1309 *2402 *
1310 * int bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta)2403 * long bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta)
1311 * Description2404 * Description
1312 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that2405 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that
1313 * it is possible to use a negative value for *delta*. This helper2406 * it is possible to use a negative value for *delta*. This helper
1314 * can be used to prepare the packet for pushing or popping2407 * can be used to prepare the packet for pushing or popping
1315 * headers.2408 * headers.
1316 *2409 *
1317 * A call to this helper is susceptible to change the underlaying2410 * A call to this helper is susceptible to change the underlying
1318 * packet buffer. Therefore, at load time, all checks on pointers2411 * packet buffer. Therefore, at load time, all checks on pointers
1319 * previously done by the verifier are invalidated and must be2412 * previously done by the verifier are invalidated and must be
1320 * performed again, if the helper is used in combination with2413 * performed again, if the helper is used in combination with
...@@ -1322,45 +2415,14 @@ union bpf_attr {...@@ -1322,45 +2415,14 @@ union bpf_attr {
1322 * Return2415 * Return
1323 * 0 on success, or a negative error in case of failure.2416 * 0 on success, or a negative error in case of failure.
1324 *2417 *
1325 * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)2418 * long bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr)
1326 * Description2419 * Description
1327 * Copy a NUL terminated string from an unsafe address2420 * Copy a NUL terminated string from an unsafe kernel address
1328 * *unsafe_ptr* to *dst*. The *size* should include the2421 * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for
1329 * terminating NUL byte. In case the string length is smaller than2422 * more details.
1330 * *size*, the target is not padded with further NUL bytes. If the
1331 * string length is larger than *size*, just *size*-1 bytes are
1332 * copied and the last byte is set to NUL.
1333 *
1334 * On success, the length of the copied string is returned. This
1335 * makes this helper useful in tracing programs for reading
1336 * strings, and more importantly to get its length at runtime. See
1337 * the following snippet:
1338 *2423 *
1339 * ::2424 * Generally, use **bpf_probe_read_user_str**\ () or
1340 *2425 * **bpf_probe_read_kernel_str**\ () instead.
1341 * SEC("kprobe/sys_open")
1342 * void bpf_sys_open(struct pt_regs *ctx)
1343 * {
1344 * char buf[PATHLEN]; // PATHLEN is defined to 256
1345 * int res = bpf_probe_read_str(buf, sizeof(buf),
1346 * ctx->di);
1347 *
1348 * // Consume buf, for example push it to
1349 * // userspace via bpf_perf_event_output(); we
1350 * // can use res (the string length) as event
1351 * // size, after checking its boundaries.
1352 * }
1353 *
1354 * In comparison, using **bpf_probe_read()** helper here instead
1355 * to read the string would require to estimate the length at
1356 * compile time, and would often result in copying more memory
1357 * than necessary.
1358 *
1359 * Another useful use case is when parsing individual process
1360 * arguments or individual environment variables navigating
1361 * *current*\ **->mm->arg_start** and *current*\
1362 * **->mm->env_start**: using this helper and the return value,
1363 * one can quickly iterate at the right offset of the memory area.
1364 * Return2426 * Return
1365 * On success, the strictly positive length of the string,2427 * On success, the strictly positive length of the string,
1366 * including the trailing NUL character. On error, a negative2428 * including the trailing NUL character. On error, a negative
...@@ -1373,25 +2435,33 @@ union bpf_attr {...@@ -1373,25 +2435,33 @@ union bpf_attr {
1373 * If no cookie has been set yet, generate a new cookie. Once2435 * If no cookie has been set yet, generate a new cookie. Once
1374 * generated, the socket cookie remains stable for the life of the2436 * generated, the socket cookie remains stable for the life of the
1375 * socket. This helper can be useful for monitoring per socket2437 * socket. This helper can be useful for monitoring per socket
1376 * networking traffic statistics as it provides a unique socket2438 * networking traffic statistics as it provides a global socket
1377 * identifier per namespace.2439 * identifier that can be assumed unique.
1378 * Return2440 * Return
1379 * A 8-byte long non-decreasing number on success, or 0 if the2441 * A 8-byte long unique number on success, or 0 if the socket
1380 * socket field is missing inside *skb*.2442 * field is missing inside *skb*.
1381 *2443 *
1382 * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)2444 * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
1383 * Description2445 * Description
1384 * Equivalent to bpf_get_socket_cookie() helper that accepts2446 * Equivalent to bpf_get_socket_cookie() helper that accepts
1385 * *skb*, but gets socket from **struct bpf_sock_addr** contex.2447 * *skb*, but gets socket from **struct bpf_sock_addr** context.
1386 * Return2448 * Return
1387 * A 8-byte long non-decreasing number.2449 * A 8-byte long unique number.
1388 *2450 *
1389 * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)2451 * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
1390 * Description2452 * Description
1391 * Equivalent to bpf_get_socket_cookie() helper that accepts2453 * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
1392 * *skb*, but gets socket from **struct bpf_sock_ops** contex.2454 * *skb*, but gets socket from **struct bpf_sock_ops** context.
2455 * Return
2456 * A 8-byte long unique number.
2457 *
2458 * u64 bpf_get_socket_cookie(struct sock *sk)
2459 * Description
2460 * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
2461 * *sk*, but gets socket from a BTF **struct sock**. This helper
2462 * also works for sleepable programs.
1393 * Return2463 * Return
1394 * A 8-byte long non-decreasing number.2464 * A 8-byte long unique number or 0 if *sk* is NULL.
1395 *2465 *
1396 * u32 bpf_get_socket_uid(struct sk_buff *skb)2466 * u32 bpf_get_socket_uid(struct sk_buff *skb)
1397 * Return2467 * Return
...@@ -1401,14 +2471,14 @@ union bpf_attr {...@@ -1401,14 +2471,14 @@ union bpf_attr {
1401 * is returned (note that **overflowuid** might also be the actual2471 * is returned (note that **overflowuid** might also be the actual
1402 * UID value for the socket).2472 * UID value for the socket).
1403 *2473 *
1404 * u32 bpf_set_hash(struct sk_buff *skb, u32 hash)2474 * long bpf_set_hash(struct sk_buff *skb, u32 hash)
1405 * Description2475 * Description
1406 * Set the full hash for *skb* (set the field *skb*\ **->hash**)2476 * Set the full hash for *skb* (set the field *skb*\ **->hash**)
1407 * to value *hash*.2477 * to value *hash*.
1408 * Return2478 * Return
1409 * 02479 * 0
1410 *2480 *
1411 * int bpf_setsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, char *optval, int optlen)2481 * long bpf_setsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)
1412 * Description2482 * Description
1413 * Emulate a call to **setsockopt()** on the socket associated to2483 * Emulate a call to **setsockopt()** on the socket associated to
1414 * *bpf_socket*, which must be a full socket. The *level* at2484 * *bpf_socket*, which must be a full socket. The *level* at
...@@ -1416,34 +2486,72 @@ union bpf_attr {...@@ -1416,34 +2486,72 @@ union bpf_attr {
1416 * must be specified, see **setsockopt(2)** for more information.2486 * must be specified, see **setsockopt(2)** for more information.
1417 * The option value of length *optlen* is pointed by *optval*.2487 * The option value of length *optlen* is pointed by *optval*.
1418 *2488 *
2489 * *bpf_socket* should be one of the following:
2490 *
2491 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2492 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2493 * and **BPF_CGROUP_INET6_CONNECT**.
2494 *
1419 * This helper actually implements a subset of **setsockopt()**.2495 * This helper actually implements a subset of **setsockopt()**.
1420 * It supports the following *level*\ s:2496 * It supports the following *level*\ s:
1421 *2497 *
1422 * * **SOL_SOCKET**, which supports the following *optname*\ s:2498 * * **SOL_SOCKET**, which supports the following *optname*\ s:
1423 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,2499 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
1424 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**.2500 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
2501 * **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
1425 * * **IPPROTO_TCP**, which supports the following *optname*\ s:2502 * * **IPPROTO_TCP**, which supports the following *optname*\ s:
1426 * **TCP_CONGESTION**, **TCP_BPF_IW**,2503 * **TCP_CONGESTION**, **TCP_BPF_IW**,
1427 * **TCP_BPF_SNDCWND_CLAMP**.2504 * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
2505 * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
2506 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
1428 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.2507 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
1429 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.2508 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
1430 * Return2509 * Return
1431 * 0 on success, or a negative error in case of failure.2510 * 0 on success, or a negative error in case of failure.
1432 *2511 *
1433 * int bpf_skb_adjust_room(struct sk_buff *skb, u32 len_diff, u32 mode, u64 flags)2512 * long bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags)
1434 * Description2513 * Description
1435 * Grow or shrink the room for data in the packet associated to2514 * Grow or shrink the room for data in the packet associated to
1436 * *skb* by *len_diff*, and according to the selected *mode*.2515 * *skb* by *len_diff*, and according to the selected *mode*.
1437 *2516 *
1438 * There is a single supported mode at this time:2517 * By default, the helper will reset any offloaded checksum
2518 * indicator of the skb to CHECKSUM_NONE. This can be avoided
2519 * by the following flag:
2520 *
2521 * * **BPF_F_ADJ_ROOM_NO_CSUM_RESET**: Do not reset offloaded
2522 * checksum data of the skb to CHECKSUM_NONE.
2523 *
2524 * There are two supported modes at this time:
2525 *
2526 * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
2527 * (room space is added or removed below the layer 2 header).
1439 *2528 *
1440 * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer2529 * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
1441 * (room space is added or removed below the layer 3 header).2530 * (room space is added or removed below the layer 3 header).
1442 *2531 *
1443 * All values for *flags* are reserved for future usage, and must2532 * The following flags are supported at this time:
1444 * be left at zero.2533 *
2534 * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size.
2535 * Adjusting mss in this way is not allowed for datagrams.
1445 *2536 *
1446 * A call to this helper is susceptible to change the underlaying2537 * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4**,
2538 * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6**:
2539 * Any new space is reserved to hold a tunnel header.
2540 * Configure skb offsets and other fields accordingly.
2541 *
2542 * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE**,
2543 * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP**:
2544 * Use with ENCAP_L3 flags to further specify the tunnel type.
2545 *
2546 * * **BPF_F_ADJ_ROOM_ENCAP_L2**\ (*len*):
2547 * Use with ENCAP_L3/L4 flags to further specify the tunnel
2548 * type; *len* is the length of the inner MAC header.
2549 *
2550 * * **BPF_F_ADJ_ROOM_ENCAP_L2_ETH**:
2551 * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
2552 * L2 type as Ethernet.
2553 *
2554 * A call to this helper is susceptible to change the underlying
1447 * packet buffer. Therefore, at load time, all checks on pointers2555 * packet buffer. Therefore, at load time, all checks on pointers
1448 * previously done by the verifier are invalidated and must be2556 * previously done by the verifier are invalidated and must be
1449 * performed again, if the helper is used in combination with2557 * performed again, if the helper is used in combination with
...@@ -1451,7 +2559,7 @@ union bpf_attr {...@@ -1451,7 +2559,7 @@ union bpf_attr {
1451 * Return2559 * Return
1452 * 0 on success, or a negative error in case of failure.2560 * 0 on success, or a negative error in case of failure.
1453 *2561 *
1454 * int bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)2562 * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
1455 * Description2563 * Description
1456 * Redirect the packet to the endpoint referenced by *map* at2564 * Redirect the packet to the endpoint referenced by *map* at
1457 * index *key*. Depending on its type, this *map* can contain2565 * index *key*. Depending on its type, this *map* can contain
...@@ -1460,18 +2568,23 @@ union bpf_attr {...@@ -1460,18 +2568,23 @@ union bpf_attr {
1460 * but this is only implemented for native XDP (with driver2568 * but this is only implemented for native XDP (with driver
1461 * support) as of this writing).2569 * support) as of this writing).
1462 *2570 *
1463 * All values for *flags* are reserved for future usage, and must2571 * The lower two bits of *flags* are used as the return code if
1464 * be left at zero.2572 * the map lookup fails. This is so that the return value can be
2573 * one of the XDP program return codes up to **XDP_TX**, as chosen
2574 * by the caller. The higher bits of *flags* can be set to
2575 * BPF_F_BROADCAST or BPF_F_EXCLUDE_INGRESS as defined below.
1465 *2576 *
1466 * When used to redirect packets to net devices, this helper2577 * With BPF_F_BROADCAST the packet will be broadcasted to all the
1467 * provides a high performance increase over **bpf_redirect**\ ().2578 * interfaces in the map, with BPF_F_EXCLUDE_INGRESS the ingress
1468 * This is due to various implementation details of the underlying2579 * interface will be excluded when do broadcasting.
1469 * mechanisms, one of which is the fact that **bpf_redirect_map**\2580 *
1470 * () tries to send packet as a "bulk" to the device.2581 * See also **bpf_redirect**\ (), which only supports redirecting
2582 * to an ifindex, but doesn't require a map to do so.
1471 * Return2583 * Return
1472 * **XDP_REDIRECT** on success, or **XDP_ABORTED** on error.2584 * **XDP_REDIRECT** on success, or the value of the two lower bits
2585 * of the *flags* argument on error.
1473 *2586 *
1474 * int bpf_sk_redirect_map(struct bpf_map *map, u32 key, u64 flags)2587 * long bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags)
1475 * Description2588 * Description
1476 * Redirect the packet to the socket referenced by *map* (of type2589 * Redirect the packet to the socket referenced by *map* (of type
1477 * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and2590 * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and
...@@ -1482,7 +2595,7 @@ union bpf_attr {...@@ -1482,7 +2595,7 @@ union bpf_attr {
1482 * Return2595 * Return
1483 * **SK_PASS** on success, or **SK_DROP** on error.2596 * **SK_PASS** on success, or **SK_DROP** on error.
1484 *2597 *
1485 * int bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)2598 * long bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)
1486 * Description2599 * Description
1487 * Add an entry to, or update a *map* referencing sockets. The2600 * Add an entry to, or update a *map* referencing sockets. The
1488 * *skops* is used as a new value for the entry associated to2601 * *skops* is used as a new value for the entry associated to
...@@ -1501,7 +2614,7 @@ union bpf_attr {...@@ -1501,7 +2614,7 @@ union bpf_attr {
1501 * Return2614 * Return
1502 * 0 on success, or a negative error in case of failure.2615 * 0 on success, or a negative error in case of failure.
1503 *2616 *
1504 * int bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta)2617 * long bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta)
1505 * Description2618 * Description
1506 * Adjust the address pointed by *xdp_md*\ **->data_meta** by2619 * Adjust the address pointed by *xdp_md*\ **->data_meta** by
1507 * *delta* (which can be positive or negative). Note that this2620 * *delta* (which can be positive or negative). Note that this
...@@ -1522,7 +2635,7 @@ union bpf_attr {...@@ -1522,7 +2635,7 @@ union bpf_attr {
1522 * more flexibility as the user is free to store whatever meta2635 * more flexibility as the user is free to store whatever meta
1523 * data they need.2636 * data they need.
1524 *2637 *
1525 * A call to this helper is susceptible to change the underlaying2638 * A call to this helper is susceptible to change the underlying
1526 * packet buffer. Therefore, at load time, all checks on pointers2639 * packet buffer. Therefore, at load time, all checks on pointers
1527 * previously done by the verifier are invalidated and must be2640 * previously done by the verifier are invalidated and must be
1528 * performed again, if the helper is used in combination with2641 * performed again, if the helper is used in combination with
...@@ -1530,7 +2643,7 @@ union bpf_attr {...@@ -1530,7 +2643,7 @@ union bpf_attr {
1530 * Return2643 * Return
1531 * 0 on success, or a negative error in case of failure.2644 * 0 on success, or a negative error in case of failure.
1532 *2645 *
1533 * int bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size)2646 * long bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size)
1534 * Description2647 * Description
1535 * Read the value of a perf event counter, and store it into *buf*2648 * Read the value of a perf event counter, and store it into *buf*
1536 * of size *buf_size*. This helper relies on a *map* of type2649 * of size *buf_size*. This helper relies on a *map* of type
...@@ -1574,13 +2687,13 @@ union bpf_attr {...@@ -1574,13 +2687,13 @@ union bpf_attr {
1574 * the time running for event since last normalization. The2687 * the time running for event since last normalization. The
1575 * enabled and running times are accumulated since the perf event2688 * enabled and running times are accumulated since the perf event
1576 * open. To achieve scaling factor between two invocations of an2689 * open. To achieve scaling factor between two invocations of an
1577 * eBPF program, users can can use CPU id as the key (which is2690 * eBPF program, users can use CPU id as the key (which is
1578 * typical for perf array usage model) to remember the previous2691 * typical for perf array usage model) to remember the previous
1579 * value and do the calculation inside the eBPF program.2692 * value and do the calculation inside the eBPF program.
1580 * Return2693 * Return
1581 * 0 on success, or a negative error in case of failure.2694 * 0 on success, or a negative error in case of failure.
1582 *2695 *
1583 * int bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)2696 * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)
1584 * Description2697 * Description
1585 * For en eBPF program attached to a perf event, retrieve the2698 * For en eBPF program attached to a perf event, retrieve the
1586 * value of the event counter associated to *ctx* and store it in2699 * value of the event counter associated to *ctx* and store it in
...@@ -1591,7 +2704,7 @@ union bpf_attr {...@@ -1591,7 +2704,7 @@ union bpf_attr {
1591 * Return2704 * Return
1592 * 0 on success, or a negative error in case of failure.2705 * 0 on success, or a negative error in case of failure.
1593 *2706 *
1594 * int bpf_getsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, char *optval, int optlen)2707 * long bpf_getsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)
1595 * Description2708 * Description
1596 * Emulate a call to **getsockopt()** on the socket associated to2709 * Emulate a call to **getsockopt()** on the socket associated to
1597 * *bpf_socket*, which must be a full socket. The *level* at2710 * *bpf_socket*, which must be a full socket. The *level* at
...@@ -1600,6 +2713,12 @@ union bpf_attr {...@@ -1600,6 +2713,12 @@ union bpf_attr {
1600 * The retrieved value is stored in the structure pointed by2713 * The retrieved value is stored in the structure pointed by
1601 * *opval* and of length *optlen*.2714 * *opval* and of length *optlen*.
1602 *2715 *
2716 * *bpf_socket* should be one of the following:
2717 *
2718 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2719 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2720 * and **BPF_CGROUP_INET6_CONNECT**.
2721 *
1603 * This helper actually implements a subset of **getsockopt()**.2722 * This helper actually implements a subset of **getsockopt()**.
1604 * It supports the following *level*\ s:2723 * It supports the following *level*\ s:
1605 *2724 *
...@@ -1610,14 +2729,14 @@ union bpf_attr {...@@ -1610,14 +2729,14 @@ union bpf_attr {
1610 * Return2729 * Return
1611 * 0 on success, or a negative error in case of failure.2730 * 0 on success, or a negative error in case of failure.
1612 *2731 *
1613 * int bpf_override_return(struct pt_reg *regs, u64 rc)2732 * long bpf_override_return(struct pt_regs *regs, u64 rc)
1614 * Description2733 * Description
1615 * Used for error injection, this helper uses kprobes to override2734 * Used for error injection, this helper uses kprobes to override
1616 * the return value of the probed function, and to set it to *rc*.2735 * the return value of the probed function, and to set it to *rc*.
1617 * The first argument is the context *regs* on which the kprobe2736 * The first argument is the context *regs* on which the kprobe
1618 * works.2737 * works.
1619 *2738 *
1620 * This helper works by setting setting the PC (program counter)2739 * This helper works by setting the PC (program counter)
1621 * to an override function which is run in place of the original2740 * to an override function which is run in place of the original
1622 * probed function. This means the probed function is not run at2741 * probed function. This means the probed function is not run at
1623 * all. The replacement function just returns with the required2742 * all. The replacement function just returns with the required
...@@ -1635,7 +2754,7 @@ union bpf_attr {...@@ -1635,7 +2754,7 @@ union bpf_attr {
1635 * Return2754 * Return
1636 * 02755 * 0
1637 *2756 *
1638 * int bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval)2757 * long bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval)
1639 * Description2758 * Description
1640 * Attempt to set the value of the **bpf_sock_ops_cb_flags** field2759 * Attempt to set the value of the **bpf_sock_ops_cb_flags** field
1641 * for the full TCP socket associated to *bpf_sock_ops* to2760 * for the full TCP socket associated to *bpf_sock_ops* to
...@@ -1651,11 +2770,19 @@ union bpf_attr {...@@ -1651,11 +2770,19 @@ union bpf_attr {
1651 * error if an eBPF program tries to set a callback that is not2770 * error if an eBPF program tries to set a callback that is not
1652 * supported in the current kernel.2771 * supported in the current kernel.
1653 *2772 *
1654 * The supported callback values that *argval* can combine are:2773 * *argval* is a flag array which can combine these flags:
1655 *2774 *
1656 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)2775 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)
1657 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)2776 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)
1658 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)2777 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)
2778 * * **BPF_SOCK_OPS_RTT_CB_FLAG** (every RTT)
2779 *
2780 * Therefore, this function can be used to clear a callback flag by
2781 * setting the appropriate bit to zero. e.g. to disable the RTO
2782 * callback:
2783 *
2784 * **bpf_sock_ops_cb_flags_set(bpf_sock,**
2785 * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
1659 *2786 *
1660 * Here are some examples of where one could call such eBPF2787 * Here are some examples of where one could call such eBPF
1661 * program:2788 * program:
...@@ -1671,7 +2798,7 @@ union bpf_attr {...@@ -1671,7 +2798,7 @@ union bpf_attr {
1671 * be set is returned (which comes down to 0 if all bits were set2798 * be set is returned (which comes down to 0 if all bits were set
1672 * as required).2799 * as required).
1673 *2800 *
1674 * int bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags)2801 * long bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags)
1675 * Description2802 * Description
1676 * This helper is used in programs implementing policies at the2803 * This helper is used in programs implementing policies at the
1677 * socket level. If the message *msg* is allowed to pass (i.e. if2804 * socket level. If the message *msg* is allowed to pass (i.e. if
...@@ -1685,7 +2812,7 @@ union bpf_attr {...@@ -1685,7 +2812,7 @@ union bpf_attr {
1685 * Return2812 * Return
1686 * **SK_PASS** on success, or **SK_DROP** on error.2813 * **SK_PASS** on success, or **SK_DROP** on error.
1687 *2814 *
1688 * int bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes)2815 * long bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes)
1689 * Description2816 * Description
1690 * For socket policies, apply the verdict of the eBPF program to2817 * For socket policies, apply the verdict of the eBPF program to
1691 * the next *bytes* (number of bytes) of message *msg*.2818 * the next *bytes* (number of bytes) of message *msg*.
...@@ -1719,7 +2846,7 @@ union bpf_attr {...@@ -1719,7 +2846,7 @@ union bpf_attr {
1719 * Return2846 * Return
1720 * 02847 * 0
1721 *2848 *
1722 * int bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes)2849 * long bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes)
1723 * Description2850 * Description
1724 * For socket policies, prevent the execution of the verdict eBPF2851 * For socket policies, prevent the execution of the verdict eBPF
1725 * program for message *msg* until *bytes* (byte number) have been2852 * program for message *msg* until *bytes* (byte number) have been
...@@ -1737,7 +2864,7 @@ union bpf_attr {...@@ -1737,7 +2864,7 @@ union bpf_attr {
1737 * Return2864 * Return
1738 * 02865 * 0
1739 *2866 *
1740 * int bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags)2867 * long bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags)
1741 * Description2868 * Description
1742 * For socket policies, pull in non-linear data from user space2869 * For socket policies, pull in non-linear data from user space
1743 * for *msg* and set pointers *msg*\ **->data** and *msg*\2870 * for *msg* and set pointers *msg*\ **->data** and *msg*\
...@@ -1757,7 +2884,7 @@ union bpf_attr {...@@ -1757,7 +2884,7 @@ union bpf_attr {
1757 * copied if necessary (i.e. if data was not linear and if start2884 * copied if necessary (i.e. if data was not linear and if start
1758 * and end pointers do not point to the same chunk).2885 * and end pointers do not point to the same chunk).
1759 *2886 *
1760 * A call to this helper is susceptible to change the underlaying2887 * A call to this helper is susceptible to change the underlying
1761 * packet buffer. Therefore, at load time, all checks on pointers2888 * packet buffer. Therefore, at load time, all checks on pointers
1762 * previously done by the verifier are invalidated and must be2889 * previously done by the verifier are invalidated and must be
1763 * performed again, if the helper is used in combination with2890 * performed again, if the helper is used in combination with
...@@ -1768,7 +2895,7 @@ union bpf_attr {...@@ -1768,7 +2895,7 @@ union bpf_attr {
1768 * Return2895 * Return
1769 * 0 on success, or a negative error in case of failure.2896 * 0 on success, or a negative error in case of failure.
1770 *2897 *
1771 * int bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len)2898 * long bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len)
1772 * Description2899 * Description
1773 * Bind the socket associated to *ctx* to the address pointed by2900 * Bind the socket associated to *ctx* to the address pointed by
1774 * *addr*, of length *addr_len*. This allows for making outgoing2901 * *addr*, of length *addr_len*. This allows for making outgoing
...@@ -1778,20 +2905,21 @@ union bpf_attr {...@@ -1778,20 +2905,21 @@ union bpf_attr {
1778 *2905 *
1779 * This helper works for IPv4 and IPv6, TCP and UDP sockets. The2906 * This helper works for IPv4 and IPv6, TCP and UDP sockets. The
1780 * domain (*addr*\ **->sa_family**) must be **AF_INET** (or2907 * domain (*addr*\ **->sa_family**) must be **AF_INET** (or
1781 * **AF_INET6**). Looking for a free port to bind to can be2908 * **AF_INET6**). It's advised to pass zero port (**sin_port**
1782 * expensive, therefore binding to port is not permitted by the2909 * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like
1783 * helper: *addr*\ **->sin_port** (or **sin6_port**, respectively)2910 * behavior and lets the kernel efficiently pick up an unused
1784 * must be set to zero.2911 * port as long as 4-tuple is unique. Passing non-zero port might
2912 * lead to degraded performance.
1785 * Return2913 * Return
1786 * 0 on success, or a negative error in case of failure.2914 * 0 on success, or a negative error in case of failure.
1787 *2915 *
1788 * int bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta)2916 * long bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta)
1789 * Description2917 * Description
1790 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is2918 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is
1791 * only possible to shrink the packet as of this writing,2919 * possible to both shrink and grow the packet tail.
1792 * therefore *delta* must be a negative integer.2920 * Shrink done via *delta* being a negative integer.
1793 *2921 *
1794 * A call to this helper is susceptible to change the underlaying2922 * A call to this helper is susceptible to change the underlying
1795 * packet buffer. Therefore, at load time, all checks on pointers2923 * packet buffer. Therefore, at load time, all checks on pointers
1796 * previously done by the verifier are invalidated and must be2924 * previously done by the verifier are invalidated and must be
1797 * performed again, if the helper is used in combination with2925 * performed again, if the helper is used in combination with
...@@ -1799,7 +2927,7 @@ union bpf_attr {...@@ -1799,7 +2927,7 @@ union bpf_attr {
1799 * Return2927 * Return
1800 * 0 on success, or a negative error in case of failure.2928 * 0 on success, or a negative error in case of failure.
1801 *2929 *
1802 * int bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags)2930 * long bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags)
1803 * Description2931 * Description
1804 * Retrieve the XFRM state (IP transform framework, see also2932 * Retrieve the XFRM state (IP transform framework, see also
1805 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.2933 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.
...@@ -1815,7 +2943,7 @@ union bpf_attr {...@@ -1815,7 +2943,7 @@ union bpf_attr {
1815 * Return2943 * Return
1816 * 0 on success, or a negative error in case of failure.2944 * 0 on success, or a negative error in case of failure.
1817 *2945 *
1818 * int bpf_get_stack(struct pt_regs *regs, void *buf, u32 size, u64 flags)2946 * long bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags)
1819 * Description2947 * Description
1820 * Return a user or a kernel stack in bpf program provided buffer.2948 * Return a user or a kernel stack in bpf program provided buffer.
1821 * To achieve this, the helper needs *ctx*, which is a pointer2949 * To achieve this, the helper needs *ctx*, which is a pointer
...@@ -1848,7 +2976,7 @@ union bpf_attr {...@@ -1848,7 +2976,7 @@ union bpf_attr {
1848 * A non-negative value equal to or less than *size* on success,2976 * A non-negative value equal to or less than *size* on success,
1849 * or a negative error in case of failure.2977 * or a negative error in case of failure.
1850 *2978 *
1851 * int bpf_skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header)2979 * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)
1852 * Description2980 * Description
1853 * This helper is similar to **bpf_skb_load_bytes**\ () in that2981 * This helper is similar to **bpf_skb_load_bytes**\ () in that
1854 * it provides an easy way to load *len* bytes from *offset*2982 * it provides an easy way to load *len* bytes from *offset*
...@@ -1870,7 +2998,7 @@ union bpf_attr {...@@ -1870,7 +2998,7 @@ union bpf_attr {
1870 * Return2998 * Return
1871 * 0 on success, or a negative error in case of failure.2999 * 0 on success, or a negative error in case of failure.
1872 *3000 *
1873 * int bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags)3001 * long bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags)
1874 * Description3002 * Description
1875 * Do FIB lookup in kernel tables using parameters in *params*.3003 * Do FIB lookup in kernel tables using parameters in *params*.
1876 * If lookup is successful and result shows packet is to be3004 * If lookup is successful and result shows packet is to be
...@@ -1882,9 +3010,9 @@ union bpf_attr {...@@ -1882,9 +3010,9 @@ union bpf_attr {
1882 * is set to metric from route (IPv4/IPv6 only), and ifindex3010 * is set to metric from route (IPv4/IPv6 only), and ifindex
1883 * is set to the device index of the nexthop from the FIB lookup.3011 * is set to the device index of the nexthop from the FIB lookup.
1884 *3012 *
1885 * *plen* argument is the size of the passed in struct.3013 * *plen* argument is the size of the passed in struct.
1886 * *flags* argument can be a combination of one or more of the3014 * *flags* argument can be a combination of one or more of the
1887 * following values:3015 * following values:
1888 *3016 *
1889 * **BPF_FIB_LOOKUP_DIRECT**3017 * **BPF_FIB_LOOKUP_DIRECT**
1890 * Do a direct table lookup vs full lookup using FIB3018 * Do a direct table lookup vs full lookup using FIB
...@@ -1893,15 +3021,18 @@ union bpf_attr {...@@ -1893,15 +3021,18 @@ union bpf_attr {
1893 * Perform lookup from an egress perspective (default is3021 * Perform lookup from an egress perspective (default is
1894 * ingress).3022 * ingress).
1895 *3023 *
1896 * *ctx* is either **struct xdp_md** for XDP programs or3024 * *ctx* is either **struct xdp_md** for XDP programs or
1897 * **struct sk_buff** tc cls_act programs.3025 * **struct sk_buff** tc cls_act programs.
1898 * Return3026 * Return
1899 * * < 0 if any input argument is invalid3027 * * < 0 if any input argument is invalid
1900 * * 0 on success (packet is forwarded, nexthop neighbor exists)3028 * * 0 on success (packet is forwarded, nexthop neighbor exists)
1901 * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the3029 * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
1902 * packet is not forwarded or needs assist from full stack3030 * packet is not forwarded or needs assist from full stack
1903 *3031 *
1904 * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags)3032 * If lookup fails with BPF_FIB_LKUP_RET_FRAG_NEEDED, then the MTU
3033 * was exceeded and output params->mtu_result contains the MTU.
3034 *
3035 * long bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)
1905 * Description3036 * Description
1906 * Add an entry to, or update a sockhash *map* referencing sockets.3037 * Add an entry to, or update a sockhash *map* referencing sockets.
1907 * The *skops* is used as a new value for the entry associated to3038 * The *skops* is used as a new value for the entry associated to
...@@ -1920,7 +3051,7 @@ union bpf_attr {...@@ -1920,7 +3051,7 @@ union bpf_attr {
1920 * Return3051 * Return
1921 * 0 on success, or a negative error in case of failure.3052 * 0 on success, or a negative error in case of failure.
1922 *3053 *
1923 * int bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags)3054 * long bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags)
1924 * Description3055 * Description
1925 * This helper is used in programs implementing policies at the3056 * This helper is used in programs implementing policies at the
1926 * socket level. If the message *msg* is allowed to pass (i.e. if3057 * socket level. If the message *msg* is allowed to pass (i.e. if
...@@ -1934,11 +3065,11 @@ union bpf_attr {...@@ -1934,11 +3065,11 @@ union bpf_attr {
1934 * Return3065 * Return
1935 * **SK_PASS** on success, or **SK_DROP** on error.3066 * **SK_PASS** on success, or **SK_DROP** on error.
1936 *3067 *
1937 * int bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags)3068 * long bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags)
1938 * Description3069 * Description
1939 * This helper is used in programs implementing policies at the3070 * This helper is used in programs implementing policies at the
1940 * skb socket level. If the sk_buff *skb* is allowed to pass (i.e.3071 * skb socket level. If the sk_buff *skb* is allowed to pass (i.e.
1941 * if the verdeict eBPF program returns **SK_PASS**), redirect it3072 * if the verdict eBPF program returns **SK_PASS**), redirect it
1942 * to the socket referenced by *map* (of type3073 * to the socket referenced by *map* (of type
1943 * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and3074 * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and
1944 * egress interfaces can be used for redirection. The3075 * egress interfaces can be used for redirection. The
...@@ -1948,7 +3079,7 @@ union bpf_attr {...@@ -1948,7 +3079,7 @@ union bpf_attr {
1948 * Return3079 * Return
1949 * **SK_PASS** on success, or **SK_DROP** on error.3080 * **SK_PASS** on success, or **SK_DROP** on error.
1950 *3081 *
1951 * int bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len)3082 * long bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len)
1952 * Description3083 * Description
1953 * Encapsulate the packet associated to *skb* within a Layer 33084 * Encapsulate the packet associated to *skb* within a Layer 3
1954 * protocol header. This header is provided in the buffer at3085 * protocol header. This header is provided in the buffer at
...@@ -1963,8 +3094,21 @@ union bpf_attr {...@@ -1963,8 +3094,21 @@ union bpf_attr {
1963 * Only works if *skb* contains an IPv6 packet. Insert a3094 * Only works if *skb* contains an IPv6 packet. Insert a
1964 * Segment Routing Header (**struct ipv6_sr_hdr**) inside3095 * Segment Routing Header (**struct ipv6_sr_hdr**) inside
1965 * the IPv6 header.3096 * the IPv6 header.
1966 *3097 * **BPF_LWT_ENCAP_IP**
1967 * A call to this helper is susceptible to change the underlaying3098 * IP encapsulation (GRE/GUE/IPIP/etc). The outer header
3099 * must be IPv4 or IPv6, followed by zero or more
3100 * additional headers, up to **LWT_BPF_MAX_HEADROOM**
3101 * total bytes in all prepended headers. Please note that
3102 * if **skb_is_gso**\ (*skb*) is true, no more than two
3103 * headers can be prepended, and the inner header, if
3104 * present, should be either GRE or UDP/GUE.
3105 *
3106 * **BPF_LWT_ENCAP_SEG6**\ \* types can be called by BPF programs
3107 * of type **BPF_PROG_TYPE_LWT_IN**; **BPF_LWT_ENCAP_IP** type can
3108 * be called by bpf programs of types **BPF_PROG_TYPE_LWT_IN** and
3109 * **BPF_PROG_TYPE_LWT_XMIT**.
3110 *
3111 * A call to this helper is susceptible to change the underlying
1968 * packet buffer. Therefore, at load time, all checks on pointers3112 * packet buffer. Therefore, at load time, all checks on pointers
1969 * previously done by the verifier are invalidated and must be3113 * previously done by the verifier are invalidated and must be
1970 * performed again, if the helper is used in combination with3114 * performed again, if the helper is used in combination with
...@@ -1972,14 +3116,14 @@ union bpf_attr {...@@ -1972,14 +3116,14 @@ union bpf_attr {
1972 * Return3116 * Return
1973 * 0 on success, or a negative error in case of failure.3117 * 0 on success, or a negative error in case of failure.
1974 *3118 *
1975 * int bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len)3119 * long bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len)
1976 * Description3120 * Description
1977 * Store *len* bytes from address *from* into the packet3121 * Store *len* bytes from address *from* into the packet
1978 * associated to *skb*, at *offset*. Only the flags, tag and TLVs3122 * associated to *skb*, at *offset*. Only the flags, tag and TLVs
1979 * inside the outermost IPv6 Segment Routing Header can be3123 * inside the outermost IPv6 Segment Routing Header can be
1980 * modified through this helper.3124 * modified through this helper.
1981 *3125 *
1982 * A call to this helper is susceptible to change the underlaying3126 * A call to this helper is susceptible to change the underlying
1983 * packet buffer. Therefore, at load time, all checks on pointers3127 * packet buffer. Therefore, at load time, all checks on pointers
1984 * previously done by the verifier are invalidated and must be3128 * previously done by the verifier are invalidated and must be
1985 * performed again, if the helper is used in combination with3129 * performed again, if the helper is used in combination with
...@@ -1987,7 +3131,7 @@ union bpf_attr {...@@ -1987,7 +3131,7 @@ union bpf_attr {
1987 * Return3131 * Return
1988 * 0 on success, or a negative error in case of failure.3132 * 0 on success, or a negative error in case of failure.
1989 *3133 *
1990 * int bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta)3134 * long bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta)
1991 * Description3135 * Description
1992 * Adjust the size allocated to TLVs in the outermost IPv63136 * Adjust the size allocated to TLVs in the outermost IPv6
1993 * Segment Routing Header contained in the packet associated to3137 * Segment Routing Header contained in the packet associated to
...@@ -1995,7 +3139,7 @@ union bpf_attr {...@@ -1995,7 +3139,7 @@ union bpf_attr {
1995 * after the segments are accepted. *delta* can be as well3139 * after the segments are accepted. *delta* can be as well
1996 * positive (growing) as negative (shrinking).3140 * positive (growing) as negative (shrinking).
1997 *3141 *
1998 * A call to this helper is susceptible to change the underlaying3142 * A call to this helper is susceptible to change the underlying
1999 * packet buffer. Therefore, at load time, all checks on pointers3143 * packet buffer. Therefore, at load time, all checks on pointers
2000 * previously done by the verifier are invalidated and must be3144 * previously done by the verifier are invalidated and must be
2001 * performed again, if the helper is used in combination with3145 * performed again, if the helper is used in combination with
...@@ -2003,7 +3147,7 @@ union bpf_attr {...@@ -2003,7 +3147,7 @@ union bpf_attr {
2003 * Return3147 * Return
2004 * 0 on success, or a negative error in case of failure.3148 * 0 on success, or a negative error in case of failure.
2005 *3149 *
2006 * int bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len)3150 * long bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len)
2007 * Description3151 * Description
2008 * Apply an IPv6 Segment Routing action of type *action* to the3152 * Apply an IPv6 Segment Routing action of type *action* to the
2009 * packet associated to *skb*. Each action takes a parameter3153 * packet associated to *skb*. Each action takes a parameter
...@@ -2018,13 +3162,13 @@ union bpf_attr {...@@ -2018,13 +3162,13 @@ union bpf_attr {
2018 * Type of *param*: **int**.3162 * Type of *param*: **int**.
2019 * **SEG6_LOCAL_ACTION_END_B6**3163 * **SEG6_LOCAL_ACTION_END_B6**
2020 * End.B6 action: Endpoint bound to an SRv6 policy.3164 * End.B6 action: Endpoint bound to an SRv6 policy.
2021 * Type of param: **struct ipv6_sr_hdr**.3165 * Type of *param*: **struct ipv6_sr_hdr**.
2022 * **SEG6_LOCAL_ACTION_END_B6_ENCAP**3166 * **SEG6_LOCAL_ACTION_END_B6_ENCAP**
2023 * End.B6.Encap action: Endpoint bound to an SRv63167 * End.B6.Encap action: Endpoint bound to an SRv6
2024 * encapsulation policy.3168 * encapsulation policy.
2025 * Type of param: **struct ipv6_sr_hdr**.3169 * Type of *param*: **struct ipv6_sr_hdr**.
2026 *3170 *
2027 * A call to this helper is susceptible to change the underlaying3171 * A call to this helper is susceptible to change the underlying
2028 * packet buffer. Therefore, at load time, all checks on pointers3172 * packet buffer. Therefore, at load time, all checks on pointers
2029 * previously done by the verifier are invalidated and must be3173 * previously done by the verifier are invalidated and must be
2030 * performed again, if the helper is used in combination with3174 * performed again, if the helper is used in combination with
...@@ -2032,7 +3176,26 @@ union bpf_attr {...@@ -2032,7 +3176,26 @@ union bpf_attr {
2032 * Return3176 * Return
2033 * 0 on success, or a negative error in case of failure.3177 * 0 on success, or a negative error in case of failure.
2034 *3178 *
2035 * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)3179 * long bpf_rc_repeat(void *ctx)
3180 * Description
3181 * This helper is used in programs implementing IR decoding, to
3182 * report a successfully decoded repeat key message. This delays
3183 * the generation of a key up event for previously generated
3184 * key down event.
3185 *
3186 * Some IR protocols like NEC have a special IR message for
3187 * repeating last button, for when a button is held down.
3188 *
3189 * The *ctx* should point to the lirc sample as passed into
3190 * the program.
3191 *
3192 * This helper is only available is the kernel was compiled with
3193 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
3194 * "**y**".
3195 * Return
3196 * 0
3197 *
3198 * long bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
2036 * Description3199 * Description
2037 * This helper is used in programs implementing IR decoding, to3200 * This helper is used in programs implementing IR decoding, to
2038 * report a successfully decoded key press with *scancode*,3201 * report a successfully decoded key press with *scancode*,
...@@ -2040,107 +3203,1741 @@ union bpf_attr {...@@ -2040,107 +3203,1741 @@ union bpf_attr {
2040 * translated to a keycode using the rc keymap, and reported as3203 * translated to a keycode using the rc keymap, and reported as
2041 * an input key down event. After a period a key up event is3204 * an input key down event. After a period a key up event is
2042 * generated. This period can be extended by calling either3205 * generated. This period can be extended by calling either
2043 * **bpf_rc_keydown** () again with the same values, or calling3206 * **bpf_rc_keydown**\ () again with the same values, or calling
2044 * **bpf_rc_repeat** ().3207 * **bpf_rc_repeat**\ ().
2045 *3208 *
2046 * Some protocols include a toggle bit, in case the button was3209 * Some protocols include a toggle bit, in case the button was
2047 * released and pressed again between consecutive scancodes.3210 * released and pressed again between consecutive scancodes.
2048 *3211 *
2049 * The *ctx* should point to the lirc sample as passed into3212 * The *ctx* should point to the lirc sample as passed into
2050 * the program.3213 * the program.
3214 *
3215 * The *protocol* is the decoded protocol number (see
3216 * **enum rc_proto** for some predefined values).
3217 *
3218 * This helper is only available is the kernel was compiled with
3219 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
3220 * "**y**".
3221 * Return
3222 * 0
3223 *
3224 * u64 bpf_skb_cgroup_id(struct sk_buff *skb)
3225 * Description
3226 * Return the cgroup v2 id of the socket associated with the *skb*.
3227 * This is roughly similar to the **bpf_get_cgroup_classid**\ ()
3228 * helper for cgroup v1 by providing a tag resp. identifier that
3229 * can be matched on or used for map lookups e.g. to implement
3230 * policy. The cgroup v2 id of a given path in the hierarchy is
3231 * exposed in user space through the f_handle API in order to get
3232 * to the same 64-bit id.
3233 *
3234 * This helper can be used on TC egress path, but not on ingress,
3235 * and is available only if the kernel was compiled with the
3236 * **CONFIG_SOCK_CGROUP_DATA** configuration option.
3237 * Return
3238 * The id is returned or 0 in case the id could not be retrieved.
3239 *
3240 * u64 bpf_get_current_cgroup_id(void)
3241 * Return
3242 * A 64-bit integer containing the current cgroup id based
3243 * on the cgroup within which the current task is running.
3244 *
3245 * void *bpf_get_local_storage(void *map, u64 flags)
3246 * Description
3247 * Get the pointer to the local storage area.
3248 * The type and the size of the local storage is defined
3249 * by the *map* argument.
3250 * The *flags* meaning is specific for each map type,
3251 * and has to be 0 for cgroup local storage.
3252 *
3253 * Depending on the BPF program type, a local storage area
3254 * can be shared between multiple instances of the BPF program,
3255 * running simultaneously.
3256 *
3257 * A user should care about the synchronization by himself.
3258 * For example, by using the **BPF_ATOMIC** instructions to alter
3259 * the shared data.
3260 * Return
3261 * A pointer to the local storage area.
3262 *
3263 * long bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags)
3264 * Description
3265 * Select a **SO_REUSEPORT** socket from a
3266 * **BPF_MAP_TYPE_REUSEPORT_SOCKARRAY** *map*.
3267 * It checks the selected socket is matching the incoming
3268 * request in the socket buffer.
3269 * Return
3270 * 0 on success, or a negative error in case of failure.
3271 *
3272 * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
3273 * Description
3274 * Return id of cgroup v2 that is ancestor of cgroup associated
3275 * with the *skb* at the *ancestor_level*. The root cgroup is at
3276 * *ancestor_level* zero and each step down the hierarchy
3277 * increments the level. If *ancestor_level* == level of cgroup
3278 * associated with *skb*, then return value will be same as that
3279 * of **bpf_skb_cgroup_id**\ ().
3280 *
3281 * The helper is useful to implement policies based on cgroups
3282 * that are upper in hierarchy than immediate cgroup associated
3283 * with *skb*.
3284 *
3285 * The format of returned id and helper limitations are same as in
3286 * **bpf_skb_cgroup_id**\ ().
3287 * Return
3288 * The id is returned or 0 in case the id could not be retrieved.
3289 *
3290 * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
3291 * Description
3292 * Look for TCP socket matching *tuple*, optionally in a child
3293 * network namespace *netns*. The return value must be checked,
3294 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3295 *
3296 * The *ctx* should point to the context of the program, such as
3297 * the skb or socket (depending on the hook in use). This is used
3298 * to determine the base network namespace for the lookup.
3299 *
3300 * *tuple_size* must be one of:
3301 *
3302 * **sizeof**\ (*tuple*\ **->ipv4**)
3303 * Look for an IPv4 socket.
3304 * **sizeof**\ (*tuple*\ **->ipv6**)
3305 * Look for an IPv6 socket.
3306 *
3307 * If the *netns* is a negative signed 32-bit integer, then the
3308 * socket lookup table in the netns associated with the *ctx*
3309 * will be used. For the TC hooks, this is the netns of the device
3310 * in the skb. For socket hooks, this is the netns of the socket.
3311 * If *netns* is any other signed 32-bit value greater than or
3312 * equal to zero then it specifies the ID of the netns relative to
3313 * the netns associated with the *ctx*. *netns* values beyond the
3314 * range of 32-bit integers are reserved for future use.
3315 *
3316 * All values for *flags* are reserved for future usage, and must
3317 * be left at zero.
3318 *
3319 * This helper is available only if the kernel was compiled with
3320 * **CONFIG_NET** configuration option.
3321 * Return
3322 * Pointer to **struct bpf_sock**, or **NULL** in case of failure.
3323 * For sockets with reuseport option, the **struct bpf_sock**
3324 * result is from *reuse*\ **->socks**\ [] using the hash of the
3325 * tuple.
3326 *
3327 * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
3328 * Description
3329 * Look for UDP socket matching *tuple*, optionally in a child
3330 * network namespace *netns*. The return value must be checked,
3331 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3332 *
3333 * The *ctx* should point to the context of the program, such as
3334 * the skb or socket (depending on the hook in use). This is used
3335 * to determine the base network namespace for the lookup.
3336 *
3337 * *tuple_size* must be one of:
3338 *
3339 * **sizeof**\ (*tuple*\ **->ipv4**)
3340 * Look for an IPv4 socket.
3341 * **sizeof**\ (*tuple*\ **->ipv6**)
3342 * Look for an IPv6 socket.
3343 *
3344 * If the *netns* is a negative signed 32-bit integer, then the
3345 * socket lookup table in the netns associated with the *ctx*
3346 * will be used. For the TC hooks, this is the netns of the device
3347 * in the skb. For socket hooks, this is the netns of the socket.
3348 * If *netns* is any other signed 32-bit value greater than or
3349 * equal to zero then it specifies the ID of the netns relative to
3350 * the netns associated with the *ctx*. *netns* values beyond the
3351 * range of 32-bit integers are reserved for future use.
3352 *
3353 * All values for *flags* are reserved for future usage, and must
3354 * be left at zero.
3355 *
3356 * This helper is available only if the kernel was compiled with
3357 * **CONFIG_NET** configuration option.
3358 * Return
3359 * Pointer to **struct bpf_sock**, or **NULL** in case of failure.
3360 * For sockets with reuseport option, the **struct bpf_sock**
3361 * result is from *reuse*\ **->socks**\ [] using the hash of the
3362 * tuple.
3363 *
3364 * long bpf_sk_release(void *sock)
3365 * Description
3366 * Release the reference held by *sock*. *sock* must be a
3367 * non-**NULL** pointer that was returned from
3368 * **bpf_sk_lookup_xxx**\ ().
3369 * Return
3370 * 0 on success, or a negative error in case of failure.
3371 *
3372 * long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
3373 * Description
3374 * Push an element *value* in *map*. *flags* is one of:
3375 *
3376 * **BPF_EXIST**
3377 * If the queue/stack is full, the oldest element is
3378 * removed to make room for this.
3379 * Return
3380 * 0 on success, or a negative error in case of failure.
3381 *
3382 * long bpf_map_pop_elem(struct bpf_map *map, void *value)
3383 * Description
3384 * Pop an element from *map*.
3385 * Return
3386 * 0 on success, or a negative error in case of failure.
3387 *
3388 * long bpf_map_peek_elem(struct bpf_map *map, void *value)
3389 * Description
3390 * Get an element from *map* without removing it.
3391 * Return
3392 * 0 on success, or a negative error in case of failure.
3393 *
3394 * long bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)
3395 * Description
3396 * For socket policies, insert *len* bytes into *msg* at offset
3397 * *start*.
3398 *
3399 * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a
3400 * *msg* it may want to insert metadata or options into the *msg*.
3401 * This can later be read and used by any of the lower layer BPF
3402 * hooks.
3403 *
3404 * This helper may fail if under memory pressure (a malloc
3405 * fails) in these cases BPF programs will get an appropriate
3406 * error and BPF programs will need to handle them.
3407 * Return
3408 * 0 on success, or a negative error in case of failure.
3409 *
3410 * long bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)
3411 * Description
3412 * Will remove *len* bytes from a *msg* starting at byte *start*.
3413 * This may result in **ENOMEM** errors under certain situations if
3414 * an allocation and copy are required due to a full ring buffer.
3415 * However, the helper will try to avoid doing the allocation
3416 * if possible. Other errors can occur if input parameters are
3417 * invalid either due to *start* byte not being valid part of *msg*
3418 * payload and/or *pop* value being to large.
3419 * Return
3420 * 0 on success, or a negative error in case of failure.
3421 *
3422 * long bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y)
3423 * Description
3424 * This helper is used in programs implementing IR decoding, to
3425 * report a successfully decoded pointer movement.
3426 *
3427 * The *ctx* should point to the lirc sample as passed into
3428 * the program.
3429 *
3430 * This helper is only available is the kernel was compiled with
3431 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
3432 * "**y**".
3433 * Return
3434 * 0
3435 *
3436 * long bpf_spin_lock(struct bpf_spin_lock *lock)
3437 * Description
3438 * Acquire a spinlock represented by the pointer *lock*, which is
3439 * stored as part of a value of a map. Taking the lock allows to
3440 * safely update the rest of the fields in that value. The
3441 * spinlock can (and must) later be released with a call to
3442 * **bpf_spin_unlock**\ (\ *lock*\ ).
3443 *
3444 * Spinlocks in BPF programs come with a number of restrictions
3445 * and constraints:
3446 *
3447 * * **bpf_spin_lock** objects are only allowed inside maps of
3448 * types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this
3449 * list could be extended in the future).
3450 * * BTF description of the map is mandatory.
3451 * * The BPF program can take ONE lock at a time, since taking two
3452 * or more could cause dead locks.
3453 * * Only one **struct bpf_spin_lock** is allowed per map element.
3454 * * When the lock is taken, calls (either BPF to BPF or helpers)
3455 * are not allowed.
3456 * * The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not
3457 * allowed inside a spinlock-ed region.
3458 * * The BPF program MUST call **bpf_spin_unlock**\ () to release
3459 * the lock, on all execution paths, before it returns.
3460 * * The BPF program can access **struct bpf_spin_lock** only via
3461 * the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ ()
3462 * helpers. Loading or storing data into the **struct
3463 * bpf_spin_lock** *lock*\ **;** field of a map is not allowed.
3464 * * To use the **bpf_spin_lock**\ () helper, the BTF description
3465 * of the map value must be a struct and have **struct
3466 * bpf_spin_lock** *anyname*\ **;** field at the top level.
3467 * Nested lock inside another struct is not allowed.
3468 * * The **struct bpf_spin_lock** *lock* field in a map value must
3469 * be aligned on a multiple of 4 bytes in that value.
3470 * * Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy
3471 * the **bpf_spin_lock** field to user space.
3472 * * Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from
3473 * a BPF program, do not update the **bpf_spin_lock** field.
3474 * * **bpf_spin_lock** cannot be on the stack or inside a
3475 * networking packet (it can only be inside of a map values).
3476 * * **bpf_spin_lock** is available to root only.
3477 * * Tracing programs and socket filter programs cannot use
3478 * **bpf_spin_lock**\ () due to insufficient preemption checks
3479 * (but this may change in the future).
3480 * * **bpf_spin_lock** is not allowed in inner maps of map-in-map.
3481 * Return
3482 * 0
3483 *
3484 * long bpf_spin_unlock(struct bpf_spin_lock *lock)
3485 * Description
3486 * Release the *lock* previously locked by a call to
3487 * **bpf_spin_lock**\ (\ *lock*\ ).
3488 * Return
3489 * 0
3490 *
3491 * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk)
3492 * Description
3493 * This helper gets a **struct bpf_sock** pointer such
3494 * that all the fields in this **bpf_sock** can be accessed.
3495 * Return
3496 * A **struct bpf_sock** pointer on success, or **NULL** in
3497 * case of failure.
3498 *
3499 * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk)
3500 * Description
3501 * This helper gets a **struct bpf_tcp_sock** pointer from a
3502 * **struct bpf_sock** pointer.
3503 * Return
3504 * A **struct bpf_tcp_sock** pointer on success, or **NULL** in
3505 * case of failure.
3506 *
3507 * long bpf_skb_ecn_set_ce(struct sk_buff *skb)
3508 * Description
3509 * Set ECN (Explicit Congestion Notification) field of IP header
3510 * to **CE** (Congestion Encountered) if current value is **ECT**
3511 * (ECN Capable Transport). Otherwise, do nothing. Works with IPv6
3512 * and IPv4.
3513 * Return
3514 * 1 if the **CE** flag is set (either by the current helper call
3515 * or because it was already present), 0 if it is not set.
3516 *
3517 * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk)
3518 * Description
3519 * Return a **struct bpf_sock** pointer in **TCP_LISTEN** state.
3520 * **bpf_sk_release**\ () is unnecessary and not allowed.
3521 * Return
3522 * A **struct bpf_sock** pointer on success, or **NULL** in
3523 * case of failure.
3524 *
3525 * struct bpf_sock *bpf_skc_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
3526 * Description
3527 * Look for TCP socket matching *tuple*, optionally in a child
3528 * network namespace *netns*. The return value must be checked,
3529 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3530 *
3531 * This function is identical to **bpf_sk_lookup_tcp**\ (), except
3532 * that it also returns timewait or request sockets. Use
3533 * **bpf_sk_fullsock**\ () or **bpf_tcp_sock**\ () to access the
3534 * full structure.
3535 *
3536 * This helper is available only if the kernel was compiled with
3537 * **CONFIG_NET** configuration option.
3538 * Return
3539 * Pointer to **struct bpf_sock**, or **NULL** in case of failure.
3540 * For sockets with reuseport option, the **struct bpf_sock**
3541 * result is from *reuse*\ **->socks**\ [] using the hash of the
3542 * tuple.
3543 *
3544 * long bpf_tcp_check_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len)
3545 * Description
3546 * Check whether *iph* and *th* contain a valid SYN cookie ACK for
3547 * the listening socket in *sk*.
3548 *
3549 * *iph* points to the start of the IPv4 or IPv6 header, while
3550 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3551 * **sizeof**\ (**struct ip6hdr**).
3552 *
3553 * *th* points to the start of the TCP header, while *th_len*
3554 * contains **sizeof**\ (**struct tcphdr**).
3555 * Return
3556 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative
3557 * error otherwise.
3558 *
3559 * long bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags)
3560 * Description
3561 * Get name of sysctl in /proc/sys/ and copy it into provided by
3562 * program buffer *buf* of size *buf_len*.
3563 *
3564 * The buffer is always NUL terminated, unless it's zero-sized.
3565 *
3566 * If *flags* is zero, full name (e.g. "net/ipv4/tcp_mem") is
3567 * copied. Use **BPF_F_SYSCTL_BASE_NAME** flag to copy base name
3568 * only (e.g. "tcp_mem").
3569 * Return
3570 * Number of character copied (not including the trailing NUL).
3571 *
3572 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3573 * truncated name in this case).
3574 *
3575 * long bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)
3576 * Description
3577 * Get current value of sysctl as it is presented in /proc/sys
3578 * (incl. newline, etc), and copy it as a string into provided
3579 * by program buffer *buf* of size *buf_len*.
3580 *
3581 * The whole value is copied, no matter what file position user
3582 * space issued e.g. sys_read at.
3583 *
3584 * The buffer is always NUL terminated, unless it's zero-sized.
3585 * Return
3586 * Number of character copied (not including the trailing NUL).
3587 *
3588 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3589 * truncated name in this case).
3590 *
3591 * **-EINVAL** if current value was unavailable, e.g. because
3592 * sysctl is uninitialized and read returns -EIO for it.
3593 *
3594 * long bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)
3595 * Description
3596 * Get new value being written by user space to sysctl (before
3597 * the actual write happens) and copy it as a string into
3598 * provided by program buffer *buf* of size *buf_len*.
3599 *
3600 * User space may write new value at file position > 0.
3601 *
3602 * The buffer is always NUL terminated, unless it's zero-sized.
3603 * Return
3604 * Number of character copied (not including the trailing NUL).
3605 *
3606 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3607 * truncated name in this case).
3608 *
3609 * **-EINVAL** if sysctl is being read.
3610 *
3611 * long bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len)
3612 * Description
3613 * Override new value being written by user space to sysctl with
3614 * value provided by program in buffer *buf* of size *buf_len*.
3615 *
3616 * *buf* should contain a string in same form as provided by user
3617 * space on sysctl write.
3618 *
3619 * User space may write new value at file position > 0. To override
3620 * the whole sysctl value file position should be set to zero.
3621 * Return
3622 * 0 on success.
3623 *
3624 * **-E2BIG** if the *buf_len* is too big.
3625 *
3626 * **-EINVAL** if sysctl is being read.
3627 *
3628 * long bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res)
3629 * Description
3630 * Convert the initial part of the string from buffer *buf* of
3631 * size *buf_len* to a long integer according to the given base
3632 * and save the result in *res*.
3633 *
3634 * The string may begin with an arbitrary amount of white space
3635 * (as determined by **isspace**\ (3)) followed by a single
3636 * optional '**-**' sign.
3637 *
3638 * Five least significant bits of *flags* encode base, other bits
3639 * are currently unused.
3640 *
3641 * Base must be either 8, 10, 16 or 0 to detect it automatically
3642 * similar to user space **strtol**\ (3).
3643 * Return
3644 * Number of characters consumed on success. Must be positive but
3645 * no more than *buf_len*.
3646 *
3647 * **-EINVAL** if no valid digits were found or unsupported base
3648 * was provided.
3649 *
3650 * **-ERANGE** if resulting value was out of range.
3651 *
3652 * long bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res)
3653 * Description
3654 * Convert the initial part of the string from buffer *buf* of
3655 * size *buf_len* to an unsigned long integer according to the
3656 * given base and save the result in *res*.
3657 *
3658 * The string may begin with an arbitrary amount of white space
3659 * (as determined by **isspace**\ (3)).
3660 *
3661 * Five least significant bits of *flags* encode base, other bits
3662 * are currently unused.
3663 *
3664 * Base must be either 8, 10, 16 or 0 to detect it automatically
3665 * similar to user space **strtoul**\ (3).
3666 * Return
3667 * Number of characters consumed on success. Must be positive but
3668 * no more than *buf_len*.
3669 *
3670 * **-EINVAL** if no valid digits were found or unsupported base
3671 * was provided.
3672 *
3673 * **-ERANGE** if resulting value was out of range.
3674 *
3675 * void *bpf_sk_storage_get(struct bpf_map *map, void *sk, void *value, u64 flags)
3676 * Description
3677 * Get a bpf-local-storage from a *sk*.
3678 *
3679 * Logically, it could be thought of getting the value from
3680 * a *map* with *sk* as the **key**. From this
3681 * perspective, the usage is not much different from
3682 * **bpf_map_lookup_elem**\ (*map*, **&**\ *sk*) except this
3683 * helper enforces the key must be a full socket and the map must
3684 * be a **BPF_MAP_TYPE_SK_STORAGE** also.
3685 *
3686 * Underneath, the value is stored locally at *sk* instead of
3687 * the *map*. The *map* is used as the bpf-local-storage
3688 * "type". The bpf-local-storage "type" (i.e. the *map*) is
3689 * searched against all bpf-local-storages residing at *sk*.
3690 *
3691 * *sk* is a kernel **struct sock** pointer for LSM program.
3692 * *sk* is a **struct bpf_sock** pointer for other program types.
3693 *
3694 * An optional *flags* (**BPF_SK_STORAGE_GET_F_CREATE**) can be
3695 * used such that a new bpf-local-storage will be
3696 * created if one does not exist. *value* can be used
3697 * together with **BPF_SK_STORAGE_GET_F_CREATE** to specify
3698 * the initial value of a bpf-local-storage. If *value* is
3699 * **NULL**, the new bpf-local-storage will be zero initialized.
3700 * Return
3701 * A bpf-local-storage pointer is returned on success.
3702 *
3703 * **NULL** if not found or there was an error in adding
3704 * a new bpf-local-storage.
3705 *
3706 * long bpf_sk_storage_delete(struct bpf_map *map, void *sk)
3707 * Description
3708 * Delete a bpf-local-storage from a *sk*.
3709 * Return
3710 * 0 on success.
3711 *
3712 * **-ENOENT** if the bpf-local-storage cannot be found.
3713 * **-EINVAL** if sk is not a fullsock (e.g. a request_sock).
3714 *
3715 * long bpf_send_signal(u32 sig)
3716 * Description
3717 * Send signal *sig* to the process of the current task.
3718 * The signal may be delivered to any of this process's threads.
3719 * Return
3720 * 0 on success or successfully queued.
3721 *
3722 * **-EBUSY** if work queue under nmi is full.
3723 *
3724 * **-EINVAL** if *sig* is invalid.
3725 *
3726 * **-EPERM** if no permission to send the *sig*.
3727 *
3728 * **-EAGAIN** if bpf program can try again.
3729 *
3730 * s64 bpf_tcp_gen_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len)
3731 * Description
3732 * Try to issue a SYN cookie for the packet with corresponding
3733 * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*.
3734 *
3735 * *iph* points to the start of the IPv4 or IPv6 header, while
3736 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3737 * **sizeof**\ (**struct ip6hdr**).
3738 *
3739 * *th* points to the start of the TCP header, while *th_len*
3740 * contains the length of the TCP header.
3741 * Return
3742 * On success, lower 32 bits hold the generated SYN cookie in
3743 * followed by 16 bits which hold the MSS value for that cookie,
3744 * and the top 16 bits are unused.
3745 *
3746 * On failure, the returned value is one of the following:
3747 *
3748 * **-EINVAL** SYN cookie cannot be issued due to error
3749 *
3750 * **-ENOENT** SYN cookie should not be issued (no SYN flood)
3751 *
3752 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies
3753 *
3754 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
3755 *
3756 * long bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
3757 * Description
3758 * Write raw *data* blob into a special BPF perf event held by
3759 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
3760 * event must have the following attributes: **PERF_SAMPLE_RAW**
3761 * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and
3762 * **PERF_COUNT_SW_BPF_OUTPUT** as **config**.
3763 *
3764 * The *flags* are used to indicate the index in *map* for which
3765 * the value must be put, masked with **BPF_F_INDEX_MASK**.
3766 * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU**
3767 * to indicate that the index of the current CPU core should be
3768 * used.
3769 *
3770 * The value to write, of *size*, is passed through eBPF stack and
3771 * pointed by *data*.
3772 *
3773 * *ctx* is a pointer to in-kernel struct sk_buff.
3774 *
3775 * This helper is similar to **bpf_perf_event_output**\ () but
3776 * restricted to raw_tracepoint bpf programs.
3777 * Return
3778 * 0 on success, or a negative error in case of failure.
3779 *
3780 * long bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr)
3781 * Description
3782 * Safely attempt to read *size* bytes from user space address
3783 * *unsafe_ptr* and store the data in *dst*.
3784 * Return
3785 * 0 on success, or a negative error in case of failure.
3786 *
3787 * long bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
3788 * Description
3789 * Safely attempt to read *size* bytes from kernel space address
3790 * *unsafe_ptr* and store the data in *dst*.
3791 * Return
3792 * 0 on success, or a negative error in case of failure.
3793 *
3794 * long bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr)
3795 * Description
3796 * Copy a NUL terminated string from an unsafe user address
3797 * *unsafe_ptr* to *dst*. The *size* should include the
3798 * terminating NUL byte. In case the string length is smaller than
3799 * *size*, the target is not padded with further NUL bytes. If the
3800 * string length is larger than *size*, just *size*-1 bytes are
3801 * copied and the last byte is set to NUL.
3802 *
3803 * On success, returns the number of bytes that were written,
3804 * including the terminal NUL. This makes this helper useful in
3805 * tracing programs for reading strings, and more importantly to
3806 * get its length at runtime. See the following snippet:
3807 *
3808 * ::
3809 *
3810 * SEC("kprobe/sys_open")
3811 * void bpf_sys_open(struct pt_regs *ctx)
3812 * {
3813 * char buf[PATHLEN]; // PATHLEN is defined to 256
3814 * int res = bpf_probe_read_user_str(buf, sizeof(buf),
3815 * ctx->di);
3816 *
3817 * // Consume buf, for example push it to
3818 * // userspace via bpf_perf_event_output(); we
3819 * // can use res (the string length) as event
3820 * // size, after checking its boundaries.
3821 * }
3822 *
3823 * In comparison, using **bpf_probe_read_user**\ () helper here
3824 * instead to read the string would require to estimate the length
3825 * at compile time, and would often result in copying more memory
3826 * than necessary.
3827 *
3828 * Another useful use case is when parsing individual process
3829 * arguments or individual environment variables navigating
3830 * *current*\ **->mm->arg_start** and *current*\
3831 * **->mm->env_start**: using this helper and the return value,
3832 * one can quickly iterate at the right offset of the memory area.
3833 * Return
3834 * On success, the strictly positive length of the output string,
3835 * including the trailing NUL character. On error, a negative
3836 * value.
3837 *
3838 * long bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr)
3839 * Description
3840 * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr*
3841 * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply.
3842 * Return
3843 * On success, the strictly positive length of the string, including
3844 * the trailing NUL character. On error, a negative value.
3845 *
3846 * long bpf_tcp_send_ack(void *tp, u32 rcv_nxt)
3847 * Description
3848 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.
3849 * *rcv_nxt* is the ack_seq to be sent out.
3850 * Return
3851 * 0 on success, or a negative error in case of failure.
3852 *
3853 * long bpf_send_signal_thread(u32 sig)
3854 * Description
3855 * Send signal *sig* to the thread corresponding to the current task.
3856 * Return
3857 * 0 on success or successfully queued.
3858 *
3859 * **-EBUSY** if work queue under nmi is full.
3860 *
3861 * **-EINVAL** if *sig* is invalid.
3862 *
3863 * **-EPERM** if no permission to send the *sig*.
3864 *
3865 * **-EAGAIN** if bpf program can try again.
3866 *
3867 * u64 bpf_jiffies64(void)
3868 * Description
3869 * Obtain the 64bit jiffies
3870 * Return
3871 * The 64 bit jiffies
3872 *
3873 * long bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags)
3874 * Description
3875 * For an eBPF program attached to a perf event, retrieve the
3876 * branch records (**struct perf_branch_entry**) associated to *ctx*
3877 * and store it in the buffer pointed by *buf* up to size
3878 * *size* bytes.
3879 * Return
3880 * On success, number of bytes written to *buf*. On error, a
3881 * negative value.
3882 *
3883 * The *flags* can be set to **BPF_F_GET_BRANCH_RECORDS_SIZE** to
3884 * instead return the number of bytes required to store all the
3885 * branch entries. If this flag is set, *buf* may be NULL.
3886 *
3887 * **-EINVAL** if arguments invalid or **size** not a multiple
3888 * of **sizeof**\ (**struct perf_branch_entry**\ ).
3889 *
3890 * **-ENOENT** if architecture does not support branch records.
3891 *
3892 * long bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info *nsdata, u32 size)
3893 * Description
3894 * Returns 0 on success, values for *pid* and *tgid* as seen from the current
3895 * *namespace* will be returned in *nsdata*.
3896 * Return
3897 * 0 on success, or one of the following in case of failure:
3898 *
3899 * **-EINVAL** if dev and inum supplied don't match dev_t and inode number
3900 * with nsfs of current task, or if dev conversion to dev_t lost high bits.
3901 *
3902 * **-ENOENT** if pidns does not exists for the current task.
3903 *
3904 * long bpf_xdp_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
3905 * Description
3906 * Write raw *data* blob into a special BPF perf event held by
3907 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
3908 * event must have the following attributes: **PERF_SAMPLE_RAW**
3909 * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and
3910 * **PERF_COUNT_SW_BPF_OUTPUT** as **config**.
3911 *
3912 * The *flags* are used to indicate the index in *map* for which
3913 * the value must be put, masked with **BPF_F_INDEX_MASK**.
3914 * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU**
3915 * to indicate that the index of the current CPU core should be
3916 * used.
3917 *
3918 * The value to write, of *size*, is passed through eBPF stack and
3919 * pointed by *data*.
3920 *
3921 * *ctx* is a pointer to in-kernel struct xdp_buff.
3922 *
3923 * This helper is similar to **bpf_perf_eventoutput**\ () but
3924 * restricted to raw_tracepoint bpf programs.
3925 * Return
3926 * 0 on success, or a negative error in case of failure.
3927 *
3928 * u64 bpf_get_netns_cookie(void *ctx)
3929 * Description
3930 * Retrieve the cookie (generated by the kernel) of the network
3931 * namespace the input *ctx* is associated with. The network
3932 * namespace cookie remains stable for its lifetime and provides
3933 * a global identifier that can be assumed unique. If *ctx* is
3934 * NULL, then the helper returns the cookie for the initial
3935 * network namespace. The cookie itself is very similar to that
3936 * of **bpf_get_socket_cookie**\ () helper, but for network
3937 * namespaces instead of sockets.
3938 * Return
3939 * A 8-byte long opaque number.
3940 *
3941 * u64 bpf_get_current_ancestor_cgroup_id(int ancestor_level)
3942 * Description
3943 * Return id of cgroup v2 that is ancestor of the cgroup associated
3944 * with the current task at the *ancestor_level*. The root cgroup
3945 * is at *ancestor_level* zero and each step down the hierarchy
3946 * increments the level. If *ancestor_level* == level of cgroup
3947 * associated with the current task, then return value will be the
3948 * same as that of **bpf_get_current_cgroup_id**\ ().
3949 *
3950 * The helper is useful to implement policies based on cgroups
3951 * that are upper in hierarchy than immediate cgroup associated
3952 * with the current task.
3953 *
3954 * The format of returned id and helper limitations are same as in
3955 * **bpf_get_current_cgroup_id**\ ().
3956 * Return
3957 * The id is returned or 0 in case the id could not be retrieved.
3958 *
3959 * long bpf_sk_assign(struct sk_buff *skb, void *sk, u64 flags)
3960 * Description
3961 * Helper is overloaded depending on BPF program type. This
3962 * description applies to **BPF_PROG_TYPE_SCHED_CLS** and
3963 * **BPF_PROG_TYPE_SCHED_ACT** programs.
3964 *
3965 * Assign the *sk* to the *skb*. When combined with appropriate
3966 * routing configuration to receive the packet towards the socket,
3967 * will cause *skb* to be delivered to the specified socket.
3968 * Subsequent redirection of *skb* via **bpf_redirect**\ (),
3969 * **bpf_clone_redirect**\ () or other methods outside of BPF may
3970 * interfere with successful delivery to the socket.
3971 *
3972 * This operation is only valid from TC ingress path.
3973 *
3974 * The *flags* argument must be zero.
3975 * Return
3976 * 0 on success, or a negative error in case of failure:
3977 *
3978 * **-EINVAL** if specified *flags* are not supported.
3979 *
3980 * **-ENOENT** if the socket is unavailable for assignment.
3981 *
3982 * **-ENETUNREACH** if the socket is unreachable (wrong netns).
3983 *
3984 * **-EOPNOTSUPP** if the operation is not supported, for example
3985 * a call from outside of TC ingress.
3986 *
3987 * **-ESOCKTNOSUPPORT** if the socket type is not supported
3988 * (reuseport).
3989 *
3990 * long bpf_sk_assign(struct bpf_sk_lookup *ctx, struct bpf_sock *sk, u64 flags)
3991 * Description
3992 * Helper is overloaded depending on BPF program type. This
3993 * description applies to **BPF_PROG_TYPE_SK_LOOKUP** programs.
3994 *
3995 * Select the *sk* as a result of a socket lookup.
3996 *
3997 * For the operation to succeed passed socket must be compatible
3998 * with the packet description provided by the *ctx* object.
3999 *
4000 * L4 protocol (**IPPROTO_TCP** or **IPPROTO_UDP**) must
4001 * be an exact match. While IP family (**AF_INET** or
4002 * **AF_INET6**) must be compatible, that is IPv6 sockets
4003 * that are not v6-only can be selected for IPv4 packets.
4004 *
4005 * Only TCP listeners and UDP unconnected sockets can be
4006 * selected. *sk* can also be NULL to reset any previous
4007 * selection.
4008 *
4009 * *flags* argument can combination of following values:
4010 *
4011 * * **BPF_SK_LOOKUP_F_REPLACE** to override the previous
4012 * socket selection, potentially done by a BPF program
4013 * that ran before us.
4014 *
4015 * * **BPF_SK_LOOKUP_F_NO_REUSEPORT** to skip
4016 * load-balancing within reuseport group for the socket
4017 * being selected.
4018 *
4019 * On success *ctx->sk* will point to the selected socket.
4020 *
4021 * Return
4022 * 0 on success, or a negative errno in case of failure.
4023 *
4024 * * **-EAFNOSUPPORT** if socket family (*sk->family*) is
4025 * not compatible with packet family (*ctx->family*).
4026 *
4027 * * **-EEXIST** if socket has been already selected,
4028 * potentially by another program, and
4029 * **BPF_SK_LOOKUP_F_REPLACE** flag was not specified.
4030 *
4031 * * **-EINVAL** if unsupported flags were specified.
4032 *
4033 * * **-EPROTOTYPE** if socket L4 protocol
4034 * (*sk->protocol*) doesn't match packet protocol
4035 * (*ctx->protocol*).
4036 *
4037 * * **-ESOCKTNOSUPPORT** if socket is not in allowed
4038 * state (TCP listening or UDP unconnected).
4039 *
4040 * u64 bpf_ktime_get_boot_ns(void)
4041 * Description
4042 * Return the time elapsed since system boot, in nanoseconds.
4043 * Does include the time the system was suspended.
4044 * See: **clock_gettime**\ (**CLOCK_BOOTTIME**)
4045 * Return
4046 * Current *ktime*.
4047 *
4048 * long bpf_seq_printf(struct seq_file *m, const char *fmt, u32 fmt_size, const void *data, u32 data_len)
4049 * Description
4050 * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print
4051 * out the format string.
4052 * The *m* represents the seq_file. The *fmt* and *fmt_size* are for
4053 * the format string itself. The *data* and *data_len* are format string
4054 * arguments. The *data* are a **u64** array and corresponding format string
4055 * values are stored in the array. For strings and pointers where pointees
4056 * are accessed, only the pointer values are stored in the *data* array.
4057 * The *data_len* is the size of *data* in bytes - must be a multiple of 8.
4058 *
4059 * Formats **%s**, **%p{i,I}{4,6}** requires to read kernel memory.
4060 * Reading kernel memory may fail due to either invalid address or
4061 * valid address but requiring a major memory fault. If reading kernel memory
4062 * fails, the string for **%s** will be an empty string, and the ip
4063 * address for **%p{i,I}{4,6}** will be 0. Not returning error to
4064 * bpf program is consistent with what **bpf_trace_printk**\ () does for now.
4065 * Return
4066 * 0 on success, or a negative error in case of failure:
4067 *
4068 * **-EBUSY** if per-CPU memory copy buffer is busy, can try again
4069 * by returning 1 from bpf program.
4070 *
4071 * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported.
4072 *
4073 * **-E2BIG** if *fmt* contains too many format specifiers.
4074 *
4075 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4076 *
4077 * long bpf_seq_write(struct seq_file *m, const void *data, u32 len)
4078 * Description
4079 * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data.
4080 * The *m* represents the seq_file. The *data* and *len* represent the
4081 * data to write in bytes.
4082 * Return
4083 * 0 on success, or a negative error in case of failure:
4084 *
4085 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4086 *
4087 * u64 bpf_sk_cgroup_id(void *sk)
4088 * Description
4089 * Return the cgroup v2 id of the socket *sk*.
4090 *
4091 * *sk* must be a non-**NULL** pointer to a socket, e.g. one
4092 * returned from **bpf_sk_lookup_xxx**\ (),
4093 * **bpf_sk_fullsock**\ (), etc. The format of returned id is
4094 * same as in **bpf_skb_cgroup_id**\ ().
4095 *
4096 * This helper is available only if the kernel was compiled with
4097 * the **CONFIG_SOCK_CGROUP_DATA** configuration option.
4098 * Return
4099 * The id is returned or 0 in case the id could not be retrieved.
4100 *
4101 * u64 bpf_sk_ancestor_cgroup_id(void *sk, int ancestor_level)
4102 * Description
4103 * Return id of cgroup v2 that is ancestor of cgroup associated
4104 * with the *sk* at the *ancestor_level*. The root cgroup is at
4105 * *ancestor_level* zero and each step down the hierarchy
4106 * increments the level. If *ancestor_level* == level of cgroup
4107 * associated with *sk*, then return value will be same as that
4108 * of **bpf_sk_cgroup_id**\ ().
4109 *
4110 * The helper is useful to implement policies based on cgroups
4111 * that are upper in hierarchy than immediate cgroup associated
4112 * with *sk*.
4113 *
4114 * The format of returned id and helper limitations are same as in
4115 * **bpf_sk_cgroup_id**\ ().
4116 * Return
4117 * The id is returned or 0 in case the id could not be retrieved.
4118 *
4119 * long bpf_ringbuf_output(void *ringbuf, void *data, u64 size, u64 flags)
4120 * Description
4121 * Copy *size* bytes from *data* into a ring buffer *ringbuf*.
4122 * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification
4123 * of new data availability is sent.
4124 * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification
4125 * of new data availability is sent unconditionally.
4126 * If **0** is specified in *flags*, an adaptive notification
4127 * of new data availability is sent.
4128 *
4129 * An adaptive notification is a notification sent whenever the user-space
4130 * process has caught up and consumed all available payloads. In case the user-space
4131 * process is still processing a previous payload, then no notification is needed
4132 * as it will process the newly added payload automatically.
4133 * Return
4134 * 0 on success, or a negative error in case of failure.
4135 *
4136 * void *bpf_ringbuf_reserve(void *ringbuf, u64 size, u64 flags)
4137 * Description
4138 * Reserve *size* bytes of payload in a ring buffer *ringbuf*.
4139 * *flags* must be 0.
4140 * Return
4141 * Valid pointer with *size* bytes of memory available; NULL,
4142 * otherwise.
4143 *
4144 * void bpf_ringbuf_submit(void *data, u64 flags)
4145 * Description
4146 * Submit reserved ring buffer sample, pointed to by *data*.
4147 * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification
4148 * of new data availability is sent.
4149 * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification
4150 * of new data availability is sent unconditionally.
4151 * If **0** is specified in *flags*, an adaptive notification
4152 * of new data availability is sent.
4153 *
4154 * See 'bpf_ringbuf_output()' for the definition of adaptive notification.
4155 * Return
4156 * Nothing. Always succeeds.
4157 *
4158 * void bpf_ringbuf_discard(void *data, u64 flags)
4159 * Description
4160 * Discard reserved ring buffer sample, pointed to by *data*.
4161 * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification
4162 * of new data availability is sent.
4163 * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification
4164 * of new data availability is sent unconditionally.
4165 * If **0** is specified in *flags*, an adaptive notification
4166 * of new data availability is sent.
4167 *
4168 * See 'bpf_ringbuf_output()' for the definition of adaptive notification.
4169 * Return
4170 * Nothing. Always succeeds.
4171 *
4172 * u64 bpf_ringbuf_query(void *ringbuf, u64 flags)
4173 * Description
4174 * Query various characteristics of provided ring buffer. What
4175 * exactly is queries is determined by *flags*:
4176 *
4177 * * **BPF_RB_AVAIL_DATA**: Amount of data not yet consumed.
4178 * * **BPF_RB_RING_SIZE**: The size of ring buffer.
4179 * * **BPF_RB_CONS_POS**: Consumer position (can wrap around).
4180 * * **BPF_RB_PROD_POS**: Producer(s) position (can wrap around).
4181 *
4182 * Data returned is just a momentary snapshot of actual values
4183 * and could be inaccurate, so this facility should be used to
4184 * power heuristics and for reporting, not to make 100% correct
4185 * calculation.
4186 * Return
4187 * Requested value, or 0, if *flags* are not recognized.
4188 *
4189 * long bpf_csum_level(struct sk_buff *skb, u64 level)
4190 * Description
4191 * Change the skbs checksum level by one layer up or down, or
4192 * reset it entirely to none in order to have the stack perform
4193 * checksum validation. The level is applicable to the following
4194 * protocols: TCP, UDP, GRE, SCTP, FCOE. For example, a decap of
4195 * | ETH | IP | UDP | GUE | IP | TCP | into | ETH | IP | TCP |
4196 * through **bpf_skb_adjust_room**\ () helper with passing in
4197 * **BPF_F_ADJ_ROOM_NO_CSUM_RESET** flag would require one call
4198 * to **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_DEC** since
4199 * the UDP header is removed. Similarly, an encap of the latter
4200 * into the former could be accompanied by a helper call to
4201 * **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_INC** if the
4202 * skb is still intended to be processed in higher layers of the
4203 * stack instead of just egressing at tc.
4204 *
4205 * There are three supported level settings at this time:
4206 *
4207 * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs
4208 * with CHECKSUM_UNNECESSARY.
4209 * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs
4210 * with CHECKSUM_UNNECESSARY.
4211 * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and
4212 * sets CHECKSUM_NONE to force checksum validation by the stack.
4213 * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current
4214 * skb->csum_level.
4215 * Return
4216 * 0 on success, or a negative error in case of failure. In the
4217 * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level
4218 * is returned or the error code -EACCES in case the skb is not
4219 * subject to CHECKSUM_UNNECESSARY.
4220 *
4221 * struct tcp6_sock *bpf_skc_to_tcp6_sock(void *sk)
4222 * Description
4223 * Dynamically cast a *sk* pointer to a *tcp6_sock* pointer.
4224 * Return
4225 * *sk* if casting is valid, or **NULL** otherwise.
4226 *
4227 * struct tcp_sock *bpf_skc_to_tcp_sock(void *sk)
4228 * Description
4229 * Dynamically cast a *sk* pointer to a *tcp_sock* pointer.
4230 * Return
4231 * *sk* if casting is valid, or **NULL** otherwise.
4232 *
4233 * struct tcp_timewait_sock *bpf_skc_to_tcp_timewait_sock(void *sk)
4234 * Description
4235 * Dynamically cast a *sk* pointer to a *tcp_timewait_sock* pointer.
4236 * Return
4237 * *sk* if casting is valid, or **NULL** otherwise.
4238 *
4239 * struct tcp_request_sock *bpf_skc_to_tcp_request_sock(void *sk)
4240 * Description
4241 * Dynamically cast a *sk* pointer to a *tcp_request_sock* pointer.
4242 * Return
4243 * *sk* if casting is valid, or **NULL** otherwise.
4244 *
4245 * struct udp6_sock *bpf_skc_to_udp6_sock(void *sk)
4246 * Description
4247 * Dynamically cast a *sk* pointer to a *udp6_sock* pointer.
4248 * Return
4249 * *sk* if casting is valid, or **NULL** otherwise.
4250 *
4251 * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
4252 * Description
4253 * Return a user or a kernel stack in bpf program provided buffer.
4254 * To achieve this, the helper needs *task*, which is a valid
4255 * pointer to **struct task_struct**. To store the stacktrace, the
4256 * bpf program provides *buf* with a nonnegative *size*.
4257 *
4258 * The last argument, *flags*, holds the number of stack frames to
4259 * skip (from 0 to 255), masked with
4260 * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set
4261 * the following flags:
4262 *
4263 * **BPF_F_USER_STACK**
4264 * Collect a user space stack instead of a kernel stack.
4265 * **BPF_F_USER_BUILD_ID**
4266 * Collect buildid+offset instead of ips for user stack,
4267 * only valid if **BPF_F_USER_STACK** is also specified.
4268 *
4269 * **bpf_get_task_stack**\ () can collect up to
4270 * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject
4271 * to sufficient large buffer size. Note that
4272 * this limit can be controlled with the **sysctl** program, and
4273 * that it should be manually increased in order to profile long
4274 * user stacks (such as stacks for Java programs). To do so, use:
4275 *
4276 * ::
4277 *
4278 * # sysctl kernel.perf_event_max_stack=<new value>
4279 * Return
4280 * A non-negative value equal to or less than *size* on success,
4281 * or a negative error in case of failure.
4282 *
4283 * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags)
4284 * Description
4285 * Load header option. Support reading a particular TCP header
4286 * option for bpf program (**BPF_PROG_TYPE_SOCK_OPS**).
4287 *
4288 * If *flags* is 0, it will search the option from the
4289 * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops**
4290 * has details on what skb_data contains under different
4291 * *skops*\ **->op**.
4292 *
4293 * The first byte of the *searchby_res* specifies the
4294 * kind that it wants to search.
4295 *
4296 * If the searching kind is an experimental kind
4297 * (i.e. 253 or 254 according to RFC6994). It also
4298 * needs to specify the "magic" which is either
4299 * 2 bytes or 4 bytes. It then also needs to
4300 * specify the size of the magic by using
4301 * the 2nd byte which is "kind-length" of a TCP
4302 * header option and the "kind-length" also
4303 * includes the first 2 bytes "kind" and "kind-length"
4304 * itself as a normal TCP header option also does.
4305 *
4306 * For example, to search experimental kind 254 with
4307 * 2 byte magic 0xeB9F, the searchby_res should be
4308 * [ 254, 4, 0xeB, 0x9F, 0, 0, .... 0 ].
4309 *
4310 * To search for the standard window scale option (3),
4311 * the *searchby_res* should be [ 3, 0, 0, .... 0 ].
4312 * Note, kind-length must be 0 for regular option.
4313 *
4314 * Searching for No-Op (0) and End-of-Option-List (1) are
4315 * not supported.
4316 *
4317 * *len* must be at least 2 bytes which is the minimal size
4318 * of a header option.
4319 *
4320 * Supported flags:
4321 *
4322 * * **BPF_LOAD_HDR_OPT_TCP_SYN** to search from the
4323 * saved_syn packet or the just-received syn packet.
4324 *
4325 * Return
4326 * > 0 when found, the header option is copied to *searchby_res*.
4327 * The return value is the total length copied. On failure, a
4328 * negative error code is returned:
4329 *
4330 * **-EINVAL** if a parameter is invalid.
4331 *
4332 * **-ENOMSG** if the option is not found.
4333 *
4334 * **-ENOENT** if no syn packet is available when
4335 * **BPF_LOAD_HDR_OPT_TCP_SYN** is used.
4336 *
4337 * **-ENOSPC** if there is not enough space. Only *len* number of
4338 * bytes are copied.
4339 *
4340 * **-EFAULT** on failure to parse the header options in the
4341 * packet.
4342 *
4343 * **-EPERM** if the helper cannot be used under the current
4344 * *skops*\ **->op**.
4345 *
4346 * long bpf_store_hdr_opt(struct bpf_sock_ops *skops, const void *from, u32 len, u64 flags)
4347 * Description
4348 * Store header option. The data will be copied
4349 * from buffer *from* with length *len* to the TCP header.
4350 *
4351 * The buffer *from* should have the whole option that
4352 * includes the kind, kind-length, and the actual
4353 * option data. The *len* must be at least kind-length
4354 * long. The kind-length does not have to be 4 byte
4355 * aligned. The kernel will take care of the padding
4356 * and setting the 4 bytes aligned value to th->doff.
4357 *
4358 * This helper will check for duplicated option
4359 * by searching the same option in the outgoing skb.
4360 *
4361 * This helper can only be called during
4362 * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**.
4363 *
4364 * Return
4365 * 0 on success, or negative error in case of failure:
4366 *
4367 * **-EINVAL** If param is invalid.
4368 *
4369 * **-ENOSPC** if there is not enough space in the header.
4370 * Nothing has been written
4371 *
4372 * **-EEXIST** if the option already exists.
4373 *
4374 * **-EFAULT** on failrue to parse the existing header options.
4375 *
4376 * **-EPERM** if the helper cannot be used under the current
4377 * *skops*\ **->op**.
4378 *
4379 * long bpf_reserve_hdr_opt(struct bpf_sock_ops *skops, u32 len, u64 flags)
4380 * Description
4381 * Reserve *len* bytes for the bpf header option. The
4382 * space will be used by **bpf_store_hdr_opt**\ () later in
4383 * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**.
4384 *
4385 * If **bpf_reserve_hdr_opt**\ () is called multiple times,
4386 * the total number of bytes will be reserved.
4387 *
4388 * This helper can only be called during
4389 * **BPF_SOCK_OPS_HDR_OPT_LEN_CB**.
4390 *
4391 * Return
4392 * 0 on success, or negative error in case of failure:
4393 *
4394 * **-EINVAL** if a parameter is invalid.
4395 *
4396 * **-ENOSPC** if there is not enough space in the header.
4397 *
4398 * **-EPERM** if the helper cannot be used under the current
4399 * *skops*\ **->op**.
4400 *
4401 * void *bpf_inode_storage_get(struct bpf_map *map, void *inode, void *value, u64 flags)
4402 * Description
4403 * Get a bpf_local_storage from an *inode*.
4404 *
4405 * Logically, it could be thought of as getting the value from
4406 * a *map* with *inode* as the **key**. From this
4407 * perspective, the usage is not much different from
4408 * **bpf_map_lookup_elem**\ (*map*, **&**\ *inode*) except this
4409 * helper enforces the key must be an inode and the map must also
4410 * be a **BPF_MAP_TYPE_INODE_STORAGE**.
4411 *
4412 * Underneath, the value is stored locally at *inode* instead of
4413 * the *map*. The *map* is used as the bpf-local-storage
4414 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4415 * searched against all bpf_local_storage residing at *inode*.
4416 *
4417 * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be
4418 * used such that a new bpf_local_storage will be
4419 * created if one does not exist. *value* can be used
4420 * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify
4421 * the initial value of a bpf_local_storage. If *value* is
4422 * **NULL**, the new bpf_local_storage will be zero initialized.
4423 * Return
4424 * A bpf_local_storage pointer is returned on success.
4425 *
4426 * **NULL** if not found or there was an error in adding
4427 * a new bpf_local_storage.
4428 *
4429 * int bpf_inode_storage_delete(struct bpf_map *map, void *inode)
4430 * Description
4431 * Delete a bpf_local_storage from an *inode*.
4432 * Return
4433 * 0 on success.
4434 *
4435 * **-ENOENT** if the bpf_local_storage cannot be found.
4436 *
4437 * long bpf_d_path(struct path *path, char *buf, u32 sz)
4438 * Description
4439 * Return full path for given **struct path** object, which
4440 * needs to be the kernel BTF *path* object. The path is
4441 * returned in the provided buffer *buf* of size *sz* and
4442 * is zero terminated.
4443 *
4444 * Return
4445 * On success, the strictly positive length of the string,
4446 * including the trailing NUL character. On error, a negative
4447 * value.
4448 *
4449 * long bpf_copy_from_user(void *dst, u32 size, const void *user_ptr)
4450 * Description
4451 * Read *size* bytes from user space address *user_ptr* and store
4452 * the data in *dst*. This is a wrapper of **copy_from_user**\ ().
4453 * Return
4454 * 0 on success, or a negative error in case of failure.
4455 *
4456 * long bpf_snprintf_btf(char *str, u32 str_size, struct btf_ptr *ptr, u32 btf_ptr_size, u64 flags)
4457 * Description
4458 * Use BTF to store a string representation of *ptr*->ptr in *str*,
4459 * using *ptr*->type_id. This value should specify the type
4460 * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1)
4461 * can be used to look up vmlinux BTF type ids. Traversing the
4462 * data structure using BTF, the type information and values are
4463 * stored in the first *str_size* - 1 bytes of *str*. Safe copy of
4464 * the pointer data is carried out to avoid kernel crashes during
4465 * operation. Smaller types can use string space on the stack;
4466 * larger programs can use map data to store the string
4467 * representation.
4468 *
4469 * The string can be subsequently shared with userspace via
4470 * bpf_perf_event_output() or ring buffer interfaces.
4471 * bpf_trace_printk() is to be avoided as it places too small
4472 * a limit on string size to be useful.
4473 *
4474 * *flags* is a combination of
4475 *
4476 * **BTF_F_COMPACT**
4477 * no formatting around type information
4478 * **BTF_F_NONAME**
4479 * no struct/union member names/types
4480 * **BTF_F_PTR_RAW**
4481 * show raw (unobfuscated) pointer values;
4482 * equivalent to printk specifier %px.
4483 * **BTF_F_ZERO**
4484 * show zero-valued struct/union members; they
4485 * are not displayed by default
4486 *
4487 * Return
4488 * The number of bytes that were written (or would have been
4489 * written if output had to be truncated due to string size),
4490 * or a negative error in cases of failure.
4491 *
4492 * long bpf_seq_printf_btf(struct seq_file *m, struct btf_ptr *ptr, u32 ptr_size, u64 flags)
4493 * Description
4494 * Use BTF to write to seq_write a string representation of
4495 * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf().
4496 * *flags* are identical to those used for bpf_snprintf_btf.
4497 * Return
4498 * 0 on success or a negative error in case of failure.
4499 *
4500 * u64 bpf_skb_cgroup_classid(struct sk_buff *skb)
4501 * Description
4502 * See **bpf_get_cgroup_classid**\ () for the main description.
4503 * This helper differs from **bpf_get_cgroup_classid**\ () in that
4504 * the cgroup v1 net_cls class is retrieved only from the *skb*'s
4505 * associated socket instead of the current process.
4506 * Return
4507 * The id is returned or 0 in case the id could not be retrieved.
4508 *
4509 * long bpf_redirect_neigh(u32 ifindex, struct bpf_redir_neigh *params, int plen, u64 flags)
4510 * Description
4511 * Redirect the packet to another net device of index *ifindex*
4512 * and fill in L2 addresses from neighboring subsystem. This helper
4513 * is somewhat similar to **bpf_redirect**\ (), except that it
4514 * populates L2 addresses as well, meaning, internally, the helper
4515 * relies on the neighbor lookup for the L2 address of the nexthop.
4516 *
4517 * The helper will perform a FIB lookup based on the skb's
4518 * networking header to get the address of the next hop, unless
4519 * this is supplied by the caller in the *params* argument. The
4520 * *plen* argument indicates the len of *params* and should be set
4521 * to 0 if *params* is NULL.
4522 *
4523 * The *flags* argument is reserved and must be 0. The helper is
4524 * currently only supported for tc BPF program types, and enabled
4525 * for IPv4 and IPv6 protocols.
4526 * Return
4527 * The helper returns **TC_ACT_REDIRECT** on success or
4528 * **TC_ACT_SHOT** on error.
4529 *
4530 * void *bpf_per_cpu_ptr(const void *percpu_ptr, u32 cpu)
4531 * Description
4532 * Take a pointer to a percpu ksym, *percpu_ptr*, and return a
4533 * pointer to the percpu kernel variable on *cpu*. A ksym is an
4534 * extern variable decorated with '__ksym'. For ksym, there is a
4535 * global var (either static or global) defined of the same name
4536 * in the kernel. The ksym is percpu if the global var is percpu.
4537 * The returned pointer points to the global percpu var on *cpu*.
4538 *
4539 * bpf_per_cpu_ptr() has the same semantic as per_cpu_ptr() in the
4540 * kernel, except that bpf_per_cpu_ptr() may return NULL. This
4541 * happens if *cpu* is larger than nr_cpu_ids. The caller of
4542 * bpf_per_cpu_ptr() must check the returned value.
4543 * Return
4544 * A pointer pointing to the kernel percpu variable on *cpu*, or
4545 * NULL, if *cpu* is invalid.
4546 *
4547 * void *bpf_this_cpu_ptr(const void *percpu_ptr)
4548 * Description
4549 * Take a pointer to a percpu ksym, *percpu_ptr*, and return a
4550 * pointer to the percpu kernel variable on this cpu. See the
4551 * description of 'ksym' in **bpf_per_cpu_ptr**\ ().
4552 *
4553 * bpf_this_cpu_ptr() has the same semantic as this_cpu_ptr() in
4554 * the kernel. Different from **bpf_per_cpu_ptr**\ (), it would
4555 * never return NULL.
4556 * Return
4557 * A pointer pointing to the kernel percpu variable on this cpu.
4558 *
4559 * long bpf_redirect_peer(u32 ifindex, u64 flags)
4560 * Description
4561 * Redirect the packet to another net device of index *ifindex*.
4562 * This helper is somewhat similar to **bpf_redirect**\ (), except
4563 * that the redirection happens to the *ifindex*' peer device and
4564 * the netns switch takes place from ingress to ingress without
4565 * going through the CPU's backlog queue.
4566 *
4567 * The *flags* argument is reserved and must be 0. The helper is
4568 * currently only supported for tc BPF program types at the ingress
4569 * hook and for veth device types. The peer device must reside in a
4570 * different network namespace.
4571 * Return
4572 * The helper returns **TC_ACT_REDIRECT** on success or
4573 * **TC_ACT_SHOT** on error.
4574 *
4575 * void *bpf_task_storage_get(struct bpf_map *map, struct task_struct *task, void *value, u64 flags)
4576 * Description
4577 * Get a bpf_local_storage from the *task*.
4578 *
4579 * Logically, it could be thought of as getting the value from
4580 * a *map* with *task* as the **key**. From this
4581 * perspective, the usage is not much different from
4582 * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this
4583 * helper enforces the key must be an task_struct and the map must also
4584 * be a **BPF_MAP_TYPE_TASK_STORAGE**.
4585 *
4586 * Underneath, the value is stored locally at *task* instead of
4587 * the *map*. The *map* is used as the bpf-local-storage
4588 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4589 * searched against all bpf_local_storage residing at *task*.
4590 *
4591 * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be
4592 * used such that a new bpf_local_storage will be
4593 * created if one does not exist. *value* can be used
4594 * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify
4595 * the initial value of a bpf_local_storage. If *value* is
4596 * **NULL**, the new bpf_local_storage will be zero initialized.
4597 * Return
4598 * A bpf_local_storage pointer is returned on success.
4599 *
4600 * **NULL** if not found or there was an error in adding
4601 * a new bpf_local_storage.
4602 *
4603 * long bpf_task_storage_delete(struct bpf_map *map, struct task_struct *task)
4604 * Description
4605 * Delete a bpf_local_storage from a *task*.
4606 * Return
4607 * 0 on success.
4608 *
4609 * **-ENOENT** if the bpf_local_storage cannot be found.
4610 *
4611 * struct task_struct *bpf_get_current_task_btf(void)
4612 * Description
4613 * Return a BTF pointer to the "current" task.
4614 * This pointer can also be used in helpers that accept an
4615 * *ARG_PTR_TO_BTF_ID* of type *task_struct*.
4616 * Return
4617 * Pointer to the current task.
4618 *
4619 * long bpf_bprm_opts_set(struct linux_binprm *bprm, u64 flags)
4620 * Description
4621 * Set or clear certain options on *bprm*:
4622 *
4623 * **BPF_F_BPRM_SECUREEXEC** Set the secureexec bit
4624 * which sets the **AT_SECURE** auxv for glibc. The bit
4625 * is cleared if the flag is not specified.
4626 * Return
4627 * **-EINVAL** if invalid *flags* are passed, zero otherwise.
4628 *
4629 * u64 bpf_ktime_get_coarse_ns(void)
4630 * Description
4631 * Return a coarse-grained version of the time elapsed since
4632 * system boot, in nanoseconds. Does not include time the system
4633 * was suspended.
4634 *
4635 * See: **clock_gettime**\ (**CLOCK_MONOTONIC_COARSE**)
4636 * Return
4637 * Current *ktime*.
4638 *
4639 * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)
4640 * Description
4641 * Returns the stored IMA hash of the *inode* (if it's avaialable).
4642 * If the hash is larger than *size*, then only *size*
4643 * bytes will be copied to *dst*
4644 * Return
4645 * The **hash_algo** is returned on success,
4646 * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if
4647 * invalid arguments are passed.
4648 *
4649 * struct socket *bpf_sock_from_file(struct file *file)
4650 * Description
4651 * If the given file represents a socket, returns the associated
4652 * socket.
4653 * Return
4654 * A pointer to a struct socket on success or NULL if the file is
4655 * not a socket.
4656 *
4657 * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags)
4658 * Description
4659 * Check packet size against exceeding MTU of net device (based
4660 * on *ifindex*). This helper will likely be used in combination
4661 * with helpers that adjust/change the packet size.
4662 *
4663 * The argument *len_diff* can be used for querying with a planned
4664 * size change. This allows to check MTU prior to changing packet
4665 * ctx. Providing an *len_diff* adjustment that is larger than the
4666 * actual packet size (resulting in negative packet size) will in
4667 * principle not exceed the MTU, why it is not considered a
4668 * failure. Other BPF-helpers are needed for performing the
4669 * planned size change, why the responsability for catch a negative
4670 * packet size belong in those helpers.
4671 *
4672 * Specifying *ifindex* zero means the MTU check is performed
4673 * against the current net device. This is practical if this isn't
4674 * used prior to redirect.
4675 *
4676 * On input *mtu_len* must be a valid pointer, else verifier will
4677 * reject BPF program. If the value *mtu_len* is initialized to
4678 * zero then the ctx packet size is use. When value *mtu_len* is
4679 * provided as input this specify the L3 length that the MTU check
4680 * is done against. Remember XDP and TC length operate at L2, but
4681 * this value is L3 as this correlate to MTU and IP-header tot_len
4682 * values which are L3 (similar behavior as bpf_fib_lookup).
4683 *
4684 * The Linux kernel route table can configure MTUs on a more
4685 * specific per route level, which is not provided by this helper.
4686 * For route level MTU checks use the **bpf_fib_lookup**\ ()
4687 * helper.
4688 *
4689 * *ctx* is either **struct xdp_md** for XDP programs or
4690 * **struct sk_buff** for tc cls_act programs.
4691 *
4692 * The *flags* argument can be a combination of one or more of the
4693 * following values:
4694 *
4695 * **BPF_MTU_CHK_SEGS**
4696 * This flag will only works for *ctx* **struct sk_buff**.
4697 * If packet context contains extra packet segment buffers
4698 * (often knows as GSO skb), then MTU check is harder to
4699 * check at this point, because in transmit path it is
4700 * possible for the skb packet to get re-segmented
4701 * (depending on net device features). This could still be
4702 * a MTU violation, so this flag enables performing MTU
4703 * check against segments, with a different violation
4704 * return code to tell it apart. Check cannot use len_diff.
4705 *
4706 * On return *mtu_len* pointer contains the MTU value of the net
4707 * device. Remember the net device configured MTU is the L3 size,
4708 * which is returned here and XDP and TC length operate at L2.
4709 * Helper take this into account for you, but remember when using
4710 * MTU value in your BPF-code.
4711 *
4712 * Return
4713 * * 0 on success, and populate MTU value in *mtu_len* pointer.
4714 *
4715 * * < 0 if any input argument is invalid (*mtu_len* not updated)
4716 *
4717 * MTU violations return positive values, but also populate MTU
4718 * value in *mtu_len* pointer, as this can be needed for
4719 * implementing PMTU handing:
4720 *
4721 * * **BPF_MTU_CHK_RET_FRAG_NEEDED**
4722 * * **BPF_MTU_CHK_RET_SEGS_TOOBIG**
4723 *
4724 * long bpf_for_each_map_elem(struct bpf_map *map, void *callback_fn, void *callback_ctx, u64 flags)
4725 * Description
4726 * For each element in **map**, call **callback_fn** function with
4727 * **map**, **callback_ctx** and other map-specific parameters.
4728 * The **callback_fn** should be a static function and
4729 * the **callback_ctx** should be a pointer to the stack.
4730 * The **flags** is used to control certain aspects of the helper.
4731 * Currently, the **flags** must be 0.
4732 *
4733 * The following are a list of supported map types and their
4734 * respective expected callback signatures:
4735 *
4736 * BPF_MAP_TYPE_HASH, BPF_MAP_TYPE_PERCPU_HASH,
4737 * BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH,
4738 * BPF_MAP_TYPE_ARRAY, BPF_MAP_TYPE_PERCPU_ARRAY
4739 *
4740 * long (\*callback_fn)(struct bpf_map \*map, const void \*key, void \*value, void \*ctx);
4741 *
4742 * For per_cpu maps, the map_value is the value on the cpu where the
4743 * bpf_prog is running.
4744 *
4745 * If **callback_fn** return 0, the helper will continue to the next
4746 * element. If return value is 1, the helper will skip the rest of
4747 * elements and return. Other return values are not used now.
4748 *
4749 * Return
4750 * The number of traversed map elements for success, **-EINVAL** for
4751 * invalid **flags**.
4752 *
4753 * long bpf_snprintf(char *str, u32 str_size, const char *fmt, u64 *data, u32 data_len)
4754 * Description
4755 * Outputs a string into the **str** buffer of size **str_size**
4756 * based on a format string stored in a read-only map pointed by
4757 * **fmt**.
4758 *
4759 * Each format specifier in **fmt** corresponds to one u64 element
4760 * in the **data** array. For strings and pointers where pointees
4761 * are accessed, only the pointer values are stored in the *data*
4762 * array. The *data_len* is the size of *data* in bytes - must be
4763 * a multiple of 8.
4764 *
4765 * Formats **%s** and **%p{i,I}{4,6}** require to read kernel
4766 * memory. Reading kernel memory may fail due to either invalid
4767 * address or valid address but requiring a major memory fault. If
4768 * reading kernel memory fails, the string for **%s** will be an
4769 * empty string, and the ip address for **%p{i,I}{4,6}** will be 0.
4770 * Not returning error to bpf program is consistent with what
4771 * **bpf_trace_printk**\ () does for now.
4772 *
4773 * Return
4774 * The strictly positive length of the formatted string, including
4775 * the trailing zero character. If the return value is greater than
4776 * **str_size**, **str** contains a truncated string, guaranteed to
4777 * be zero-terminated except when **str_size** is 0.
4778 *
4779 * Or **-EBUSY** if the per-CPU memory copy buffer is busy.
4780 *
4781 * long bpf_sys_bpf(u32 cmd, void *attr, u32 attr_size)
4782 * Description
4783 * Execute bpf syscall with given arguments.
4784 * Return
4785 * A syscall result.
4786 *
4787 * long bpf_btf_find_by_name_kind(char *name, int name_sz, u32 kind, int flags)
4788 * Description
4789 * Find BTF type with given name and kind in vmlinux BTF or in module's BTFs.
4790 * Return
4791 * Returns btf_id and btf_obj_fd in lower and upper 32 bits.
2051 *4792 *
2052 * The *protocol* is the decoded protocol number (see4793 * long bpf_sys_close(u32 fd)
2053 * **enum rc_proto** for some predefined values).4794 * Description
4795 * Execute close syscall for given FD.
4796 * Return
4797 * A syscall result.
2054 *4798 *
2055 * This helper is only available is the kernel was compiled with4799 * long bpf_timer_init(struct bpf_timer *timer, struct bpf_map *map, u64 flags)
2056 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to4800 * Description
2057 * "**y**".4801 * Initialize the timer.
4802 * First 4 bits of *flags* specify clockid.
4803 * Only CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_BOOTTIME are allowed.
4804 * All other bits of *flags* are reserved.
4805 * The verifier will reject the program if *timer* is not from
4806 * the same *map*.
2058 * Return4807 * Return
2059 * 04808 * 0 on success.
2060 *4809 * **-EBUSY** if *timer* is already initialized.
2061 * int bpf_rc_repeat(void *ctx)4810 * **-EINVAL** if invalid *flags* are passed.
4811 * **-EPERM** if *timer* is in a map that doesn't have any user references.
4812 * The user space should either hold a file descriptor to a map with timers
4813 * or pin such map in bpffs. When map is unpinned or file descriptor is
4814 * closed all timers in the map will be cancelled and freed.
4815 *
4816 * long bpf_timer_set_callback(struct bpf_timer *timer, void *callback_fn)
2062 * Description4817 * Description
2063 * This helper is used in programs implementing IR decoding, to4818 * Configure the timer to call *callback_fn* static function.
2064 * report a successfully decoded repeat key message. This delays4819 * Return
2065 * the generation of a key up event for previously generated4820 * 0 on success.
2066 * key down event.4821 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
2067 *4822 * **-EPERM** if *timer* is in a map that doesn't have any user references.
2068 * Some IR protocols like NEC have a special IR message for4823 * The user space should either hold a file descriptor to a map with timers
2069 * repeating last button, for when a button is held down.4824 * or pin such map in bpffs. When map is unpinned or file descriptor is
4825 * closed all timers in the map will be cancelled and freed.
4826 *
4827 * long bpf_timer_start(struct bpf_timer *timer, u64 nsecs, u64 flags)
4828 * Description
4829 * Set timer expiration N nanoseconds from the current time. The
4830 * configured callback will be invoked in soft irq context on some cpu
4831 * and will not repeat unless another bpf_timer_start() is made.
4832 * In such case the next invocation can migrate to a different cpu.
4833 * Since struct bpf_timer is a field inside map element the map
4834 * owns the timer. The bpf_timer_set_callback() will increment refcnt
4835 * of BPF program to make sure that callback_fn code stays valid.
4836 * When user space reference to a map reaches zero all timers
4837 * in a map are cancelled and corresponding program's refcnts are
4838 * decremented. This is done to make sure that Ctrl-C of a user
4839 * process doesn't leave any timers running. If map is pinned in
4840 * bpffs the callback_fn can re-arm itself indefinitely.
4841 * bpf_map_update/delete_elem() helpers and user space sys_bpf commands
4842 * cancel and free the timer in the given map element.
4843 * The map can contain timers that invoke callback_fn-s from different
4844 * programs. The same callback_fn can serve different timers from
4845 * different maps if key/value layout matches across maps.
4846 * Every bpf_timer_set_callback() can have different callback_fn.
2070 *4847 *
2071 * The *ctx* should point to the lirc sample as passed into4848 * Return
2072 * the program.4849 * 0 on success.
4850 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
4851 * or invalid *flags* are passed.
2073 *4852 *
2074 * This helper is only available is the kernel was compiled with4853 * long bpf_timer_cancel(struct bpf_timer *timer)
2075 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to4854 * Description
2076 * "**y**".4855 * Cancel the timer and wait for callback_fn to finish if it was running.
2077 * Return4856 * Return
2078 * 04857 * 0 if the timer was not active.
4858 * 1 if the timer was active.
4859 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
4860 * **-EDEADLK** if callback_fn tried to call bpf_timer_cancel() on its
4861 * own timer which would have led to a deadlock otherwise.
2079 *4862 *
2080 * uint64_t bpf_skb_cgroup_id(struct sk_buff *skb)4863 * u64 bpf_get_func_ip(void *ctx)
2081 * Description4864 * Description
2082 * Return the cgroup v2 id of the socket associated with the *skb*.4865 * Get address of the traced function (for tracing and kprobe programs).
2083 * This is roughly similar to the **bpf_get_cgroup_classid**\ ()4866 * Return
2084 * helper for cgroup v1 by providing a tag resp. identifier that4867 * Address of the traced function.
2085 * can be matched on or used for map lookups e.g. to implement
2086 * policy. The cgroup v2 id of a given path in the hierarchy is
2087 * exposed in user space through the f_handle API in order to get
2088 * to the same 64-bit id.
2089 *4868 *
2090 * This helper can be used on TC egress path, but not on ingress,4869 * u64 bpf_get_attach_cookie(void *ctx)
2091 * and is available only if the kernel was compiled with the4870 * Description
2092 * **CONFIG_SOCK_CGROUP_DATA** configuration option.4871 * Get bpf_cookie value provided (optionally) during the program
4872 * attachment. It might be different for each individual
4873 * attachment, even if BPF program itself is the same.
4874 * Expects BPF program context *ctx* as a first argument.
4875 *
4876 * Supported for the following program types:
4877 * - kprobe/uprobe;
4878 * - tracepoint;
4879 * - perf_event.
2093 * Return4880 * Return
2094 * The id is returned or 0 in case the id could not be retrieved.4881 * Value specified by user at BPF link creation/attachment time
4882 * or 0, if it was not specified.
2095 *4883 *
2096 * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)4884 * long bpf_task_pt_regs(struct task_struct *task)
2097 * Description4885 * Description
2098 * Return id of cgroup v2 that is ancestor of cgroup associated4886 * Get the struct pt_regs associated with **task**.
2099 * with the *skb* at the *ancestor_level*. The root cgroup is at4887 * Return
2100 * *ancestor_level* zero and each step down the hierarchy4888 * A pointer to struct pt_regs.
2101 * increments the level. If *ancestor_level* == level of cgroup
2102 * associated with *skb*, then return value will be same as that
2103 * of **bpf_skb_cgroup_id**\ ().
2104 *4889 *
2105 * The helper is useful to implement policies based on cgroups4890 * long bpf_get_branch_snapshot(void *entries, u32 size, u64 flags)
2106 * that are upper in hierarchy than immediate cgroup associated4891 * Description
2107 * with *skb*.4892 * Get branch trace from hardware engines like Intel LBR. The
4893 * hardware engine is stopped shortly after the helper is
4894 * called. Therefore, the user need to filter branch entries
4895 * based on the actual use case. To capture branch trace
4896 * before the trigger point of the BPF program, the helper
4897 * should be called at the beginning of the BPF program.
4898 *
4899 * The data is stored as struct perf_branch_entry into output
4900 * buffer *entries*. *size* is the size of *entries* in bytes.
4901 * *flags* is reserved for now and must be zero.
2108 *4902 *
2109 * The format of returned id and helper limitations are same as in
2110 * **bpf_skb_cgroup_id**\ ().
2111 * Return4903 * Return
2112 * The id is returned or 0 in case the id could not be retrieved.4904 * On success, number of bytes written to *buf*. On error, a
4905 * negative value.
2113 *4906 *
2114 * u64 bpf_get_current_cgroup_id(void)4907 * **-EINVAL** if *flags* is not zero.
2115 * Return
2116 * A 64-bit integer containing the current cgroup id based
2117 * on the cgroup within which the current task is running.
2118 *4908 *
2119 * void* get_local_storage(void *map, u64 flags)4909 * **-ENOENT** if architecture does not support branch records.
4910 *
4911 * long bpf_trace_vprintk(const char *fmt, u32 fmt_size, const void *data, u32 data_len)
2120 * Description4912 * Description
2121 * Get the pointer to the local storage area.4913 * Behaves like **bpf_trace_printk**\ () helper, but takes an array of u64
2122 * The type and the size of the local storage is defined4914 * to format and can handle more format args as a result.
2123 * by the *map* argument.
2124 * The *flags* meaning is specific for each map type,
2125 * and has to be 0 for cgroup local storage.
2126 *4915 *
2127 * Depending on the bpf program type, a local storage area4916 * Arguments are to be used as in **bpf_seq_printf**\ () helper.
2128 * can be shared between multiple instances of the bpf program,4917 * Return
2129 * running simultaneously.4918 * The number of bytes written to the buffer, or a negative error
4919 * in case of failure.
2130 *4920 *
2131 * A user should care about the synchronization by himself.4921 * struct unix_sock *bpf_skc_to_unix_sock(void *sk)
2132 * For example, by using the BPF_STX_XADD instruction to alter4922 * Description
2133 * the shared data.4923 * Dynamically cast a *sk* pointer to a *unix_sock* pointer.
2134 * Return4924 * Return
2135 * Pointer to the local storage area.4925 * *sk* if casting is valid, or **NULL** otherwise.
2136 *4926 *
2137 * int bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags)4927 * long bpf_kallsyms_lookup_name(const char *name, int name_sz, int flags, u64 *res)
2138 * Description4928 * Description
2139 * Select a SO_REUSEPORT sk from a BPF_MAP_TYPE_REUSEPORT_ARRAY map4929 * Get the address of a kernel symbol, returned in *res*. *res* is
2140 * It checks the selected sk is matching the incoming4930 * set to 0 if the symbol is not found.
2141 * request in the skb.
2142 * Return4931 * Return
2143 * 0 on success, or a negative error in case of failure.4932 * On success, zero. On error, a negative value.
4933 *
4934 * **-EINVAL** if *flags* is not zero.
4935 *
4936 * **-EINVAL** if string *name* is not the same size as *name_sz*.
4937 *
4938 * **-ENOENT** if symbol is not found.
4939 *
4940 * **-EPERM** if caller does not have permission to obtain kernel address.
2144 */4941 */
2145#define __BPF_FUNC_MAPPER(FN) \4942#define __BPF_FUNC_MAPPER(FN) \
2146 FN(unspec), \4943 FN(unspec), \
...@@ -2226,7 +5023,104 @@ union bpf_attr {...@@ -2226,7 +5023,104 @@ union bpf_attr {
2226 FN(get_current_cgroup_id), \5023 FN(get_current_cgroup_id), \
2227 FN(get_local_storage), \5024 FN(get_local_storage), \
2228 FN(sk_select_reuseport), \5025 FN(sk_select_reuseport), \
2229 FN(skb_ancestor_cgroup_id),5026 FN(skb_ancestor_cgroup_id), \
5027 FN(sk_lookup_tcp), \
5028 FN(sk_lookup_udp), \
5029 FN(sk_release), \
5030 FN(map_push_elem), \
5031 FN(map_pop_elem), \
5032 FN(map_peek_elem), \
5033 FN(msg_push_data), \
5034 FN(msg_pop_data), \
5035 FN(rc_pointer_rel), \
5036 FN(spin_lock), \
5037 FN(spin_unlock), \
5038 FN(sk_fullsock), \
5039 FN(tcp_sock), \
5040 FN(skb_ecn_set_ce), \
5041 FN(get_listener_sock), \
5042 FN(skc_lookup_tcp), \
5043 FN(tcp_check_syncookie), \
5044 FN(sysctl_get_name), \
5045 FN(sysctl_get_current_value), \
5046 FN(sysctl_get_new_value), \
5047 FN(sysctl_set_new_value), \
5048 FN(strtol), \
5049 FN(strtoul), \
5050 FN(sk_storage_get), \
5051 FN(sk_storage_delete), \
5052 FN(send_signal), \
5053 FN(tcp_gen_syncookie), \
5054 FN(skb_output), \
5055 FN(probe_read_user), \
5056 FN(probe_read_kernel), \
5057 FN(probe_read_user_str), \
5058 FN(probe_read_kernel_str), \
5059 FN(tcp_send_ack), \
5060 FN(send_signal_thread), \
5061 FN(jiffies64), \
5062 FN(read_branch_records), \
5063 FN(get_ns_current_pid_tgid), \
5064 FN(xdp_output), \
5065 FN(get_netns_cookie), \
5066 FN(get_current_ancestor_cgroup_id), \
5067 FN(sk_assign), \
5068 FN(ktime_get_boot_ns), \
5069 FN(seq_printf), \
5070 FN(seq_write), \
5071 FN(sk_cgroup_id), \
5072 FN(sk_ancestor_cgroup_id), \
5073 FN(ringbuf_output), \
5074 FN(ringbuf_reserve), \
5075 FN(ringbuf_submit), \
5076 FN(ringbuf_discard), \
5077 FN(ringbuf_query), \
5078 FN(csum_level), \
5079 FN(skc_to_tcp6_sock), \
5080 FN(skc_to_tcp_sock), \
5081 FN(skc_to_tcp_timewait_sock), \
5082 FN(skc_to_tcp_request_sock), \
5083 FN(skc_to_udp6_sock), \
5084 FN(get_task_stack), \
5085 FN(load_hdr_opt), \
5086 FN(store_hdr_opt), \
5087 FN(reserve_hdr_opt), \
5088 FN(inode_storage_get), \
5089 FN(inode_storage_delete), \
5090 FN(d_path), \
5091 FN(copy_from_user), \
5092 FN(snprintf_btf), \
5093 FN(seq_printf_btf), \
5094 FN(skb_cgroup_classid), \
5095 FN(redirect_neigh), \
5096 FN(per_cpu_ptr), \
5097 FN(this_cpu_ptr), \
5098 FN(redirect_peer), \
5099 FN(task_storage_get), \
5100 FN(task_storage_delete), \
5101 FN(get_current_task_btf), \
5102 FN(bprm_opts_set), \
5103 FN(ktime_get_coarse_ns), \
5104 FN(ima_inode_hash), \
5105 FN(sock_from_file), \
5106 FN(check_mtu), \
5107 FN(for_each_map_elem), \
5108 FN(snprintf), \
5109 FN(sys_bpf), \
5110 FN(btf_find_by_name_kind), \
5111 FN(sys_close), \
5112 FN(timer_init), \
5113 FN(timer_set_callback), \
5114 FN(timer_start), \
5115 FN(timer_cancel), \
5116 FN(get_func_ip), \
5117 FN(get_attach_cookie), \
5118 FN(task_pt_regs), \
5119 FN(get_branch_snapshot), \
5120 FN(trace_vprintk), \
5121 FN(skc_to_unix_sock), \
5122 FN(kallsyms_lookup_name), \
5123 /* */
22305124
2231/* integer value in 'imm' field of BPF_CALL instruction selects which helper5125/* integer value in 'imm' field of BPF_CALL instruction selects which helper
2232 * function eBPF program intends to call5126 * function eBPF program intends to call
...@@ -2241,50 +5135,148 @@ enum bpf_func_id {...@@ -2241,50 +5135,148 @@ enum bpf_func_id {
2241/* All flags used by eBPF helper functions, placed here. */5135/* All flags used by eBPF helper functions, placed here. */
22425136
2243/* BPF_FUNC_skb_store_bytes flags. */5137/* BPF_FUNC_skb_store_bytes flags. */
2244#define BPF_F_RECOMPUTE_CSUM (1ULL << 0)5138enum {
2245#define BPF_F_INVALIDATE_HASH (1ULL << 1)5139 BPF_F_RECOMPUTE_CSUM = (1ULL << 0),
5140 BPF_F_INVALIDATE_HASH = (1ULL << 1),
5141};
22465142
2247/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.5143/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.
2248 * First 4 bits are for passing the header field size.5144 * First 4 bits are for passing the header field size.
2249 */5145 */
2250#define BPF_F_HDR_FIELD_MASK 0xfULL5146enum {
5147 BPF_F_HDR_FIELD_MASK = 0xfULL,
5148};
22515149
2252/* BPF_FUNC_l4_csum_replace flags. */5150/* BPF_FUNC_l4_csum_replace flags. */
2253#define BPF_F_PSEUDO_HDR (1ULL << 4)5151enum {
2254#define BPF_F_MARK_MANGLED_0 (1ULL << 5)5152 BPF_F_PSEUDO_HDR = (1ULL << 4),
2255#define BPF_F_MARK_ENFORCE (1ULL << 6)5153 BPF_F_MARK_MANGLED_0 = (1ULL << 5),
5154 BPF_F_MARK_ENFORCE = (1ULL << 6),
5155};
22565156
2257/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */5157/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
2258#define BPF_F_INGRESS (1ULL << 0)5158enum {
5159 BPF_F_INGRESS = (1ULL << 0),
5160};
22595161
2260/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */5162/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
2261#define BPF_F_TUNINFO_IPV6 (1ULL << 0)5163enum {
5164 BPF_F_TUNINFO_IPV6 = (1ULL << 0),
5165};
22625166
2263/* flags for both BPF_FUNC_get_stackid and BPF_FUNC_get_stack. */5167/* flags for both BPF_FUNC_get_stackid and BPF_FUNC_get_stack. */
2264#define BPF_F_SKIP_FIELD_MASK 0xffULL5168enum {
2265#define BPF_F_USER_STACK (1ULL << 8)5169 BPF_F_SKIP_FIELD_MASK = 0xffULL,
5170 BPF_F_USER_STACK = (1ULL << 8),
2266/* flags used by BPF_FUNC_get_stackid only. */5171/* flags used by BPF_FUNC_get_stackid only. */
2267#define BPF_F_FAST_STACK_CMP (1ULL << 9)5172 BPF_F_FAST_STACK_CMP = (1ULL << 9),
2268#define BPF_F_REUSE_STACKID (1ULL << 10)5173 BPF_F_REUSE_STACKID = (1ULL << 10),
2269/* flags used by BPF_FUNC_get_stack only. */5174/* flags used by BPF_FUNC_get_stack only. */
2270#define BPF_F_USER_BUILD_ID (1ULL << 11)5175 BPF_F_USER_BUILD_ID = (1ULL << 11),
5176};
22715177
2272/* BPF_FUNC_skb_set_tunnel_key flags. */5178/* BPF_FUNC_skb_set_tunnel_key flags. */
2273#define BPF_F_ZERO_CSUM_TX (1ULL << 1)5179enum {
2274#define BPF_F_DONT_FRAGMENT (1ULL << 2)5180 BPF_F_ZERO_CSUM_TX = (1ULL << 1),
2275#define BPF_F_SEQ_NUMBER (1ULL << 3)5181 BPF_F_DONT_FRAGMENT = (1ULL << 2),
5182 BPF_F_SEQ_NUMBER = (1ULL << 3),
5183};
22765184
2277/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and5185/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and
2278 * BPF_FUNC_perf_event_read_value flags.5186 * BPF_FUNC_perf_event_read_value flags.
2279 */5187 */
2280#define BPF_F_INDEX_MASK 0xffffffffULL5188enum {
2281#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK5189 BPF_F_INDEX_MASK = 0xffffffffULL,
5190 BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK,
2282/* BPF_FUNC_perf_event_output for sk_buff input context. */5191/* BPF_FUNC_perf_event_output for sk_buff input context. */
2283#define BPF_F_CTXLEN_MASK (0xfffffULL << 32)5192 BPF_F_CTXLEN_MASK = (0xfffffULL << 32),
5193};
5194
5195/* Current network namespace */
5196enum {
5197 BPF_F_CURRENT_NETNS = (-1L),
5198};
5199
5200/* BPF_FUNC_csum_level level values. */
5201enum {
5202 BPF_CSUM_LEVEL_QUERY,
5203 BPF_CSUM_LEVEL_INC,
5204 BPF_CSUM_LEVEL_DEC,
5205 BPF_CSUM_LEVEL_RESET,
5206};
5207
5208/* BPF_FUNC_skb_adjust_room flags. */
5209enum {
5210 BPF_F_ADJ_ROOM_FIXED_GSO = (1ULL << 0),
5211 BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = (1ULL << 1),
5212 BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = (1ULL << 2),
5213 BPF_F_ADJ_ROOM_ENCAP_L4_GRE = (1ULL << 3),
5214 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
5215 BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
5216 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
5217};
5218
5219enum {
5220 BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff,
5221 BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 56,
5222};
5223
5224#define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64)len & \
5225 BPF_ADJ_ROOM_ENCAP_L2_MASK) \
5226 << BPF_ADJ_ROOM_ENCAP_L2_SHIFT)
5227
5228/* BPF_FUNC_sysctl_get_name flags. */
5229enum {
5230 BPF_F_SYSCTL_BASE_NAME = (1ULL << 0),
5231};
5232
5233/* BPF_FUNC_<kernel_obj>_storage_get flags */
5234enum {
5235 BPF_LOCAL_STORAGE_GET_F_CREATE = (1ULL << 0),
5236 /* BPF_SK_STORAGE_GET_F_CREATE is only kept for backward compatibility
5237 * and BPF_LOCAL_STORAGE_GET_F_CREATE must be used instead.
5238 */
5239 BPF_SK_STORAGE_GET_F_CREATE = BPF_LOCAL_STORAGE_GET_F_CREATE,
5240};
5241
5242/* BPF_FUNC_read_branch_records flags. */
5243enum {
5244 BPF_F_GET_BRANCH_RECORDS_SIZE = (1ULL << 0),
5245};
5246
5247/* BPF_FUNC_bpf_ringbuf_commit, BPF_FUNC_bpf_ringbuf_discard, and
5248 * BPF_FUNC_bpf_ringbuf_output flags.
5249 */
5250enum {
5251 BPF_RB_NO_WAKEUP = (1ULL << 0),
5252 BPF_RB_FORCE_WAKEUP = (1ULL << 1),
5253};
5254
5255/* BPF_FUNC_bpf_ringbuf_query flags */
5256enum {
5257 BPF_RB_AVAIL_DATA = 0,
5258 BPF_RB_RING_SIZE = 1,
5259 BPF_RB_CONS_POS = 2,
5260 BPF_RB_PROD_POS = 3,
5261};
5262
5263/* BPF ring buffer constants */
5264enum {
5265 BPF_RINGBUF_BUSY_BIT = (1U << 31),
5266 BPF_RINGBUF_DISCARD_BIT = (1U << 30),
5267 BPF_RINGBUF_HDR_SZ = 8,
5268};
5269
5270/* BPF_FUNC_sk_assign flags in bpf_sk_lookup context. */
5271enum {
5272 BPF_SK_LOOKUP_F_REPLACE = (1ULL << 0),
5273 BPF_SK_LOOKUP_F_NO_REUSEPORT = (1ULL << 1),
5274};
22845275
2285/* Mode for BPF_FUNC_skb_adjust_room helper. */5276/* Mode for BPF_FUNC_skb_adjust_room helper. */
2286enum bpf_adj_room_mode {5277enum bpf_adj_room_mode {
2287 BPF_ADJ_ROOM_NET,5278 BPF_ADJ_ROOM_NET,
5279 BPF_ADJ_ROOM_MAC,
2288};5280};
22895281
2290/* Mode for BPF_FUNC_skb_load_bytes_relative helper. */5282/* Mode for BPF_FUNC_skb_load_bytes_relative helper. */
...@@ -2296,9 +5288,27 @@ enum bpf_hdr_start_off {...@@ -2296,9 +5288,27 @@ enum bpf_hdr_start_off {
2296/* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */5288/* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */
2297enum bpf_lwt_encap_mode {5289enum bpf_lwt_encap_mode {
2298 BPF_LWT_ENCAP_SEG6,5290 BPF_LWT_ENCAP_SEG6,
2299 BPF_LWT_ENCAP_SEG6_INLINE5291 BPF_LWT_ENCAP_SEG6_INLINE,
5292 BPF_LWT_ENCAP_IP,
5293};
5294
5295/* Flags for bpf_bprm_opts_set helper */
5296enum {
5297 BPF_F_BPRM_SECUREEXEC = (1ULL << 0),
5298};
5299
5300/* Flags for bpf_redirect_map helper */
5301enum {
5302 BPF_F_BROADCAST = (1ULL << 3),
5303 BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
2300};5304};
23015305
5306#define __bpf_md_ptr(type, name) \
5307union { \
5308 type name; \
5309 __u64 :64; \
5310} __attribute__((aligned(8)))
5311
2302/* user accessible mirror of in-kernel sk_buff.5312/* user accessible mirror of in-kernel sk_buff.
2303 * new fields can only be added to the end of this structure5313 * new fields can only be added to the end of this structure
2304 */5314 */
...@@ -2333,6 +5343,14 @@ struct __sk_buff {...@@ -2333,6 +5343,14 @@ struct __sk_buff {
2333 /* ... here. */5343 /* ... here. */
23345344
2335 __u32 data_meta;5345 __u32 data_meta;
5346 __bpf_md_ptr(struct bpf_flow_keys *, flow_keys);
5347 __u64 tstamp;
5348 __u32 wire_len;
5349 __u32 gso_segs;
5350 __bpf_md_ptr(struct bpf_sock *, sk);
5351 __u32 gso_size;
5352 __u32 :32; /* Padding, future use. */
5353 __u64 hwtstamp;
2336};5354};
23375355
2338struct bpf_tunnel_key {5356struct bpf_tunnel_key {
...@@ -2374,7 +5392,15 @@ enum bpf_ret_code {...@@ -2374,7 +5392,15 @@ enum bpf_ret_code {
2374 BPF_DROP = 2,5392 BPF_DROP = 2,
2375 /* 3-6 reserved */5393 /* 3-6 reserved */
2376 BPF_REDIRECT = 7,5394 BPF_REDIRECT = 7,
2377 /* >127 are reserved for prog type specific return codes */5395 /* >127 are reserved for prog type specific return codes.
5396 *
5397 * BPF_LWT_REROUTE: used by BPF_PROG_TYPE_LWT_IN and
5398 * BPF_PROG_TYPE_LWT_XMIT to indicate that skb had been
5399 * changed and should be routed based on its new L3 header.
5400 * (This is an L3 redirect, as opposed to L2 redirect
5401 * represented by BPF_REDIRECT above).
5402 */
5403 BPF_LWT_REROUTE = 128,
2378};5404};
23795405
2380struct bpf_sock {5406struct bpf_sock {
...@@ -2384,15 +5410,81 @@ struct bpf_sock {...@@ -2384,15 +5410,81 @@ struct bpf_sock {
2384 __u32 protocol;5410 __u32 protocol;
2385 __u32 mark;5411 __u32 mark;
2386 __u32 priority;5412 __u32 priority;
2387 __u32 src_ip4; /* Allows 1,2,4-byte read.5413 /* IP address also allows 1 and 2 bytes access */
2388 * Stored in network byte order.5414 __u32 src_ip4;
5415 __u32 src_ip6[4];
5416 __u32 src_port; /* host byte order */
5417 __u32 dst_port; /* network byte order */
5418 __u32 dst_ip4;
5419 __u32 dst_ip6[4];
5420 __u32 state;
5421 __s32 rx_queue_mapping;
5422};
5423
5424struct bpf_tcp_sock {
5425 __u32 snd_cwnd; /* Sending congestion window */
5426 __u32 srtt_us; /* smoothed round trip time << 3 in usecs */
5427 __u32 rtt_min;
5428 __u32 snd_ssthresh; /* Slow start size threshold */
5429 __u32 rcv_nxt; /* What we want to receive next */
5430 __u32 snd_nxt; /* Next sequence we send */
5431 __u32 snd_una; /* First byte we want an ack for */
5432 __u32 mss_cache; /* Cached effective mss, not including SACKS */
5433 __u32 ecn_flags; /* ECN status bits. */
5434 __u32 rate_delivered; /* saved rate sample: packets delivered */
5435 __u32 rate_interval_us; /* saved rate sample: time elapsed */
5436 __u32 packets_out; /* Packets which are "in flight" */
5437 __u32 retrans_out; /* Retransmitted packets out */
5438 __u32 total_retrans; /* Total retransmits for entire connection */
5439 __u32 segs_in; /* RFC4898 tcpEStatsPerfSegsIn
5440 * total number of segments in.
2389 */5441 */
2390 __u32 src_ip6[4]; /* Allows 1,2,4-byte read.5442 __u32 data_segs_in; /* RFC4898 tcpEStatsPerfDataSegsIn
2391 * Stored in network byte order.5443 * total number of data segments in.
5444 */
5445 __u32 segs_out; /* RFC4898 tcpEStatsPerfSegsOut
5446 * The total number of segments sent.
5447 */
5448 __u32 data_segs_out; /* RFC4898 tcpEStatsPerfDataSegsOut
5449 * total number of data segments sent.
2392 */5450 */
2393 __u32 src_port; /* Allows 4-byte read.5451 __u32 lost_out; /* Lost packets */
2394 * Stored in host byte order5452 __u32 sacked_out; /* SACK'd packets */
5453 __u64 bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived
5454 * sum(delta(rcv_nxt)), or how many bytes
5455 * were acked.
2395 */5456 */
5457 __u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked
5458 * sum(delta(snd_una)), or how many bytes
5459 * were acked.
5460 */
5461 __u32 dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups
5462 * total number of DSACK blocks received
5463 */
5464 __u32 delivered; /* Total data packets delivered incl. rexmits */
5465 __u32 delivered_ce; /* Like the above but only ECE marked packets */
5466 __u32 icsk_retransmits; /* Number of unrecovered [RTO] timeouts */
5467};
5468
5469struct bpf_sock_tuple {
5470 union {
5471 struct {
5472 __be32 saddr;
5473 __be32 daddr;
5474 __be16 sport;
5475 __be16 dport;
5476 } ipv4;
5477 struct {
5478 __be32 saddr[4];
5479 __be32 daddr[4];
5480 __be16 sport;
5481 __be16 dport;
5482 } ipv6;
5483 };
5484};
5485
5486struct bpf_xdp_sock {
5487 __u32 queue_id;
2396};5488};
23975489
2398#define XDP_PACKET_HEADROOM 2565490#define XDP_PACKET_HEADROOM 256
...@@ -2420,6 +5512,34 @@ struct xdp_md {...@@ -2420,6 +5512,34 @@ struct xdp_md {
2420 /* Below access go through struct xdp_rxq_info */5512 /* Below access go through struct xdp_rxq_info */
2421 __u32 ingress_ifindex; /* rxq->dev->ifindex */5513 __u32 ingress_ifindex; /* rxq->dev->ifindex */
2422 __u32 rx_queue_index; /* rxq->queue_index */5514 __u32 rx_queue_index; /* rxq->queue_index */
5515
5516 __u32 egress_ifindex; /* txq->dev->ifindex */
5517};
5518
5519/* DEVMAP map-value layout
5520 *
5521 * The struct data-layout of map-value is a configuration interface.
5522 * New members can only be added to the end of this structure.
5523 */
5524struct bpf_devmap_val {
5525 __u32 ifindex; /* device index */
5526 union {
5527 int fd; /* prog fd on map write */
5528 __u32 id; /* prog id on map read */
5529 } bpf_prog;
5530};
5531
5532/* CPUMAP map-value layout
5533 *
5534 * The struct data-layout of map-value is a configuration interface.
5535 * New members can only be added to the end of this structure.
5536 */
5537struct bpf_cpumap_val {
5538 __u32 qsize; /* queue size to remote target CPU */
5539 union {
5540 int fd; /* prog fd on map write */
5541 __u32 id; /* prog id on map read */
5542 } bpf_prog;
2423};5543};
24245544
2425enum sk_action {5545enum sk_action {
...@@ -2431,8 +5551,8 @@ enum sk_action {...@@ -2431,8 +5551,8 @@ enum sk_action {
2431 * be added to the end of this structure5551 * be added to the end of this structure
2432 */5552 */
2433struct sk_msg_md {5553struct sk_msg_md {
2434 void *data;5554 __bpf_md_ptr(void *, data);
2435 void *data_end;5555 __bpf_md_ptr(void *, data_end);
24365556
2437 __u32 family;5557 __u32 family;
2438 __u32 remote_ip4; /* Stored in network byte order */5558 __u32 remote_ip4; /* Stored in network byte order */
...@@ -2441,6 +5561,9 @@ struct sk_msg_md {...@@ -2441,6 +5561,9 @@ struct sk_msg_md {
2441 __u32 local_ip6[4]; /* Stored in network byte order */5561 __u32 local_ip6[4]; /* Stored in network byte order */
2442 __u32 remote_port; /* Stored in network byte order */5562 __u32 remote_port; /* Stored in network byte order */
2443 __u32 local_port; /* stored in host byte order */5563 __u32 local_port; /* stored in host byte order */
5564 __u32 size; /* Total size of sk_msg */
5565
5566 __bpf_md_ptr(struct bpf_sock *, sk); /* current socket */
2444};5567};
24455568
2446struct sk_reuseport_md {5569struct sk_reuseport_md {
...@@ -2448,8 +5571,9 @@ struct sk_reuseport_md {...@@ -2448,8 +5571,9 @@ struct sk_reuseport_md {
2448 * Start of directly accessible data. It begins from5571 * Start of directly accessible data. It begins from
2449 * the tcp/udp header.5572 * the tcp/udp header.
2450 */5573 */
2451 void *data;5574 __bpf_md_ptr(void *, data);
2452 void *data_end; /* End of directly accessible data */5575 /* End of directly accessible data */
5576 __bpf_md_ptr(void *, data_end);
2453 /*5577 /*
2454 * Total length of packet (starting from the tcp/udp header).5578 * Total length of packet (starting from the tcp/udp header).
2455 * Note that the directly accessible bytes (data_end - data)5579 * Note that the directly accessible bytes (data_end - data)
...@@ -2465,6 +5589,20 @@ struct sk_reuseport_md {...@@ -2465,6 +5589,20 @@ struct sk_reuseport_md {
2465 __u32 ip_protocol; /* IP protocol. e.g. IPPROTO_TCP, IPPROTO_UDP */5589 __u32 ip_protocol; /* IP protocol. e.g. IPPROTO_TCP, IPPROTO_UDP */
2466 __u32 bind_inany; /* Is sock bound to an INANY address? */5590 __u32 bind_inany; /* Is sock bound to an INANY address? */
2467 __u32 hash; /* A hash of the packet 4 tuples */5591 __u32 hash; /* A hash of the packet 4 tuples */
5592 /* When reuse->migrating_sk is NULL, it is selecting a sk for the
5593 * new incoming connection request (e.g. selecting a listen sk for
5594 * the received SYN in the TCP case). reuse->sk is one of the sk
5595 * in the reuseport group. The bpf prog can use reuse->sk to learn
5596 * the local listening ip/port without looking into the skb.
5597 *
5598 * When reuse->migrating_sk is not NULL, reuse->sk is closed and
5599 * reuse->migrating_sk is the socket that needs to be migrated
5600 * to another listening socket. migrating_sk could be a fullsock
5601 * sk that is fully established or a reqsk that is in-the-middle
5602 * of 3-way handshake.
5603 */
5604 __bpf_md_ptr(struct bpf_sock *, sk);
5605 __bpf_md_ptr(struct bpf_sock *, migrating_sk);
2468};5606};
24695607
2470#define BPF_TAG_SIZE 85608#define BPF_TAG_SIZE 8
...@@ -2484,12 +5622,29 @@ struct bpf_prog_info {...@@ -2484,12 +5622,29 @@ struct bpf_prog_info {
2484 char name[BPF_OBJ_NAME_LEN];5622 char name[BPF_OBJ_NAME_LEN];
2485 __u32 ifindex;5623 __u32 ifindex;
2486 __u32 gpl_compatible:1;5624 __u32 gpl_compatible:1;
5625 __u32 :31; /* alignment pad */
2487 __u64 netns_dev;5626 __u64 netns_dev;
2488 __u64 netns_ino;5627 __u64 netns_ino;
2489 __u32 nr_jited_ksyms;5628 __u32 nr_jited_ksyms;
2490 __u32 nr_jited_func_lens;5629 __u32 nr_jited_func_lens;
2491 __aligned_u64 jited_ksyms;5630 __aligned_u64 jited_ksyms;
2492 __aligned_u64 jited_func_lens;5631 __aligned_u64 jited_func_lens;
5632 __u32 btf_id;
5633 __u32 func_info_rec_size;
5634 __aligned_u64 func_info;
5635 __u32 nr_func_info;
5636 __u32 nr_line_info;
5637 __aligned_u64 line_info;
5638 __aligned_u64 jited_line_info;
5639 __u32 nr_jited_line_info;
5640 __u32 line_info_rec_size;
5641 __u32 jited_line_info_rec_size;
5642 __u32 nr_prog_tags;
5643 __aligned_u64 prog_tags;
5644 __u64 run_time_ns;
5645 __u64 run_cnt;
5646 __u64 recursion_misses;
5647 __u32 verified_insns;
2493} __attribute__((aligned(8)));5648} __attribute__((aligned(8)));
24945649
2495struct bpf_map_info {5650struct bpf_map_info {
...@@ -2501,44 +5656,87 @@ struct bpf_map_info {...@@ -2501,44 +5656,87 @@ struct bpf_map_info {
2501 __u32 map_flags;5656 __u32 map_flags;
2502 char name[BPF_OBJ_NAME_LEN];5657 char name[BPF_OBJ_NAME_LEN];
2503 __u32 ifindex;5658 __u32 ifindex;
2504 __u32 :32;5659 __u32 btf_vmlinux_value_type_id;
2505 __u64 netns_dev;5660 __u64 netns_dev;
2506 __u64 netns_ino;5661 __u64 netns_ino;
2507 __u32 btf_id;5662 __u32 btf_id;
2508 __u32 btf_key_type_id;5663 __u32 btf_key_type_id;
2509 __u32 btf_value_type_id;5664 __u32 btf_value_type_id;
5665 __u32 :32; /* alignment pad */
5666 __u64 map_extra;
2510} __attribute__((aligned(8)));5667} __attribute__((aligned(8)));
25115668
2512struct bpf_btf_info {5669struct bpf_btf_info {
2513 __aligned_u64 btf;5670 __aligned_u64 btf;
2514 __u32 btf_size;5671 __u32 btf_size;
2515 __u32 id;5672 __u32 id;
5673 __aligned_u64 name;
5674 __u32 name_len;
5675 __u32 kernel_btf;
5676} __attribute__((aligned(8)));
5677
5678struct bpf_link_info {
5679 __u32 type;
5680 __u32 id;
5681 __u32 prog_id;
5682 union {
5683 struct {
5684 __aligned_u64 tp_name; /* in/out: tp_name buffer ptr */
5685 __u32 tp_name_len; /* in/out: tp_name buffer len */
5686 } raw_tracepoint;
5687 struct {
5688 __u32 attach_type;
5689 __u32 target_obj_id; /* prog_id for PROG_EXT, otherwise btf object id */
5690 __u32 target_btf_id; /* BTF type id inside the object */
5691 } tracing;
5692 struct {
5693 __u64 cgroup_id;
5694 __u32 attach_type;
5695 } cgroup;
5696 struct {
5697 __aligned_u64 target_name; /* in/out: target_name buffer ptr */
5698 __u32 target_name_len; /* in/out: target_name buffer len */
5699 union {
5700 struct {
5701 __u32 map_id;
5702 } map;
5703 };
5704 } iter;
5705 struct {
5706 __u32 netns_ino;
5707 __u32 attach_type;
5708 } netns;
5709 struct {
5710 __u32 ifindex;
5711 } xdp;
5712 };
2516} __attribute__((aligned(8)));5713} __attribute__((aligned(8)));
25175714
2518/* User bpf_sock_addr struct to access socket fields and sockaddr struct passed5715/* User bpf_sock_addr struct to access socket fields and sockaddr struct passed
2519 * by user and intended to be used by socket (e.g. to bind to, depends on5716 * by user and intended to be used by socket (e.g. to bind to, depends on
2520 * attach attach type).5717 * attach type).
2521 */5718 */
2522struct bpf_sock_addr {5719struct bpf_sock_addr {
2523 __u32 user_family; /* Allows 4-byte read, but no write. */5720 __u32 user_family; /* Allows 4-byte read, but no write. */
2524 __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write.5721 __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write.
2525 * Stored in network byte order.5722 * Stored in network byte order.
2526 */5723 */
2527 __u32 user_ip6[4]; /* Allows 1,2,4-byte read an 4-byte write.5724 __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
2528 * Stored in network byte order.5725 * Stored in network byte order.
2529 */5726 */
2530 __u32 user_port; /* Allows 4-byte read and write.5727 __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write.
2531 * Stored in network byte order5728 * Stored in network byte order
2532 */5729 */
2533 __u32 family; /* Allows 4-byte read, but no write */5730 __u32 family; /* Allows 4-byte read, but no write */
2534 __u32 type; /* Allows 4-byte read, but no write */5731 __u32 type; /* Allows 4-byte read, but no write */
2535 __u32 protocol; /* Allows 4-byte read, but no write */5732 __u32 protocol; /* Allows 4-byte read, but no write */
2536 __u32 msg_src_ip4; /* Allows 1,2,4-byte read an 4-byte write.5733 __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write.
2537 * Stored in network byte order.5734 * Stored in network byte order.
2538 */5735 */
2539 __u32 msg_src_ip6[4]; /* Allows 1,2,4-byte read an 4-byte write.5736 __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
2540 * Stored in network byte order.5737 * Stored in network byte order.
2541 */5738 */
5739 __bpf_md_ptr(struct bpf_sock *, sk);
2542};5740};
25435741
2544/* User bpf_sock_ops struct to access socket values and specify request ops5742/* User bpf_sock_ops struct to access socket values and specify request ops
...@@ -2590,15 +5788,91 @@ struct bpf_sock_ops {...@@ -2590,15 +5788,91 @@ struct bpf_sock_ops {
2590 __u32 sk_txhash;5788 __u32 sk_txhash;
2591 __u64 bytes_received;5789 __u64 bytes_received;
2592 __u64 bytes_acked;5790 __u64 bytes_acked;
5791 __bpf_md_ptr(struct bpf_sock *, sk);
5792 /* [skb_data, skb_data_end) covers the whole TCP header.
5793 *
5794 * BPF_SOCK_OPS_PARSE_HDR_OPT_CB: The packet received
5795 * BPF_SOCK_OPS_HDR_OPT_LEN_CB: Not useful because the
5796 * header has not been written.
5797 * BPF_SOCK_OPS_WRITE_HDR_OPT_CB: The header and options have
5798 * been written so far.
5799 * BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB: The SYNACK that concludes
5800 * the 3WHS.
5801 * BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB: The ACK that concludes
5802 * the 3WHS.
5803 *
5804 * bpf_load_hdr_opt() can also be used to read a particular option.
5805 */
5806 __bpf_md_ptr(void *, skb_data);
5807 __bpf_md_ptr(void *, skb_data_end);
5808 __u32 skb_len; /* The total length of a packet.
5809 * It includes the header, options,
5810 * and payload.
5811 */
5812 __u32 skb_tcp_flags; /* tcp_flags of the header. It provides
5813 * an easy way to check for tcp_flags
5814 * without parsing skb_data.
5815 *
5816 * In particular, the skb_tcp_flags
5817 * will still be available in
5818 * BPF_SOCK_OPS_HDR_OPT_LEN even though
5819 * the outgoing header has not
5820 * been written yet.
5821 */
2593};5822};
25945823
2595/* Definitions for bpf_sock_ops_cb_flags */5824/* Definitions for bpf_sock_ops_cb_flags */
2596#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)5825enum {
2597#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1)5826 BPF_SOCK_OPS_RTO_CB_FLAG = (1<<0),
2598#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2)5827 BPF_SOCK_OPS_RETRANS_CB_FLAG = (1<<1),
2599#define BPF_SOCK_OPS_ALL_CB_FLAGS 0x7 /* Mask of all currently5828 BPF_SOCK_OPS_STATE_CB_FLAG = (1<<2),
2600 * supported cb flags5829 BPF_SOCK_OPS_RTT_CB_FLAG = (1<<3),
2601 */5830 /* Call bpf for all received TCP headers. The bpf prog will be
5831 * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB
5832 *
5833 * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB
5834 * for the header option related helpers that will be useful
5835 * to the bpf programs.
5836 *
5837 * It could be used at the client/active side (i.e. connect() side)
5838 * when the server told it that the server was in syncookie
5839 * mode and required the active side to resend the bpf-written
5840 * options. The active side can keep writing the bpf-options until
5841 * it received a valid packet from the server side to confirm
5842 * the earlier packet (and options) has been received. The later
5843 * example patch is using it like this at the active side when the
5844 * server is in syncookie mode.
5845 *
5846 * The bpf prog will usually turn this off in the common cases.
5847 */
5848 BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG = (1<<4),
5849 /* Call bpf when kernel has received a header option that
5850 * the kernel cannot handle. The bpf prog will be called under
5851 * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB.
5852 *
5853 * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB
5854 * for the header option related helpers that will be useful
5855 * to the bpf programs.
5856 */
5857 BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG = (1<<5),
5858 /* Call bpf when the kernel is writing header options for the
5859 * outgoing packet. The bpf prog will first be called
5860 * to reserve space in a skb under
5861 * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then
5862 * the bpf prog will be called to write the header option(s)
5863 * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
5864 *
5865 * Please refer to the comment in BPF_SOCK_OPS_HDR_OPT_LEN_CB
5866 * and BPF_SOCK_OPS_WRITE_HDR_OPT_CB for the header option
5867 * related helpers that will be useful to the bpf programs.
5868 *
5869 * The kernel gets its chance to reserve space and write
5870 * options first before the BPF program does.
5871 */
5872 BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = (1<<6),
5873/* Mask of all currently supported cb flags */
5874 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
5875};
26025876
2603/* List of known BPF sock_ops operators.5877/* List of known BPF sock_ops operators.
2604 * New entries can only be added at the end5878 * New entries can only be added at the end
...@@ -2651,6 +5925,65 @@ enum {...@@ -2651,6 +5925,65 @@ enum {
2651 BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after5925 BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after
2652 * socket transition to LISTEN state.5926 * socket transition to LISTEN state.
2653 */5927 */
5928 BPF_SOCK_OPS_RTT_CB, /* Called on every RTT.
5929 */
5930 BPF_SOCK_OPS_PARSE_HDR_OPT_CB, /* Parse the header option.
5931 * It will be called to handle
5932 * the packets received at
5933 * an already established
5934 * connection.
5935 *
5936 * sock_ops->skb_data:
5937 * Referring to the received skb.
5938 * It covers the TCP header only.
5939 *
5940 * bpf_load_hdr_opt() can also
5941 * be used to search for a
5942 * particular option.
5943 */
5944 BPF_SOCK_OPS_HDR_OPT_LEN_CB, /* Reserve space for writing the
5945 * header option later in
5946 * BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
5947 * Arg1: bool want_cookie. (in
5948 * writing SYNACK only)
5949 *
5950 * sock_ops->skb_data:
5951 * Not available because no header has
5952 * been written yet.
5953 *
5954 * sock_ops->skb_tcp_flags:
5955 * The tcp_flags of the
5956 * outgoing skb. (e.g. SYN, ACK, FIN).
5957 *
5958 * bpf_reserve_hdr_opt() should
5959 * be used to reserve space.
5960 */
5961 BPF_SOCK_OPS_WRITE_HDR_OPT_CB, /* Write the header options
5962 * Arg1: bool want_cookie. (in
5963 * writing SYNACK only)
5964 *
5965 * sock_ops->skb_data:
5966 * Referring to the outgoing skb.
5967 * It covers the TCP header
5968 * that has already been written
5969 * by the kernel and the
5970 * earlier bpf-progs.
5971 *
5972 * sock_ops->skb_tcp_flags:
5973 * The tcp_flags of the outgoing
5974 * skb. (e.g. SYN, ACK, FIN).
5975 *
5976 * bpf_store_hdr_opt() should
5977 * be used to write the
5978 * option.
5979 *
5980 * bpf_load_hdr_opt() can also
5981 * be used to search for a
5982 * particular option that
5983 * has already been written
5984 * by the kernel or the
5985 * earlier bpf-progs.
5986 */
2654};5987};
26555988
2656/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect5989/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
...@@ -2675,8 +6008,67 @@ enum {...@@ -2675,8 +6008,67 @@ enum {
2675 BPF_TCP_MAX_STATES /* Leave at the end! */6008 BPF_TCP_MAX_STATES /* Leave at the end! */
2676};6009};
26776010
2678#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */6011enum {
2679#define TCP_BPF_SNDCWND_CLAMP 1002 /* Set sndcwnd_clamp */6012 TCP_BPF_IW = 1001, /* Set TCP initial congestion window */
6013 TCP_BPF_SNDCWND_CLAMP = 1002, /* Set sndcwnd_clamp */
6014 TCP_BPF_DELACK_MAX = 1003, /* Max delay ack in usecs */
6015 TCP_BPF_RTO_MIN = 1004, /* Min delay ack in usecs */
6016 /* Copy the SYN pkt to optval
6017 *
6018 * BPF_PROG_TYPE_SOCK_OPS only. It is similar to the
6019 * bpf_getsockopt(TCP_SAVED_SYN) but it does not limit
6020 * to only getting from the saved_syn. It can either get the
6021 * syn packet from:
6022 *
6023 * 1. the just-received SYN packet (only available when writing the
6024 * SYNACK). It will be useful when it is not necessary to
6025 * save the SYN packet for latter use. It is also the only way
6026 * to get the SYN during syncookie mode because the syn
6027 * packet cannot be saved during syncookie.
6028 *
6029 * OR
6030 *
6031 * 2. the earlier saved syn which was done by
6032 * bpf_setsockopt(TCP_SAVE_SYN).
6033 *
6034 * The bpf_getsockopt(TCP_BPF_SYN*) option will hide where the
6035 * SYN packet is obtained.
6036 *
6037 * If the bpf-prog does not need the IP[46] header, the
6038 * bpf-prog can avoid parsing the IP header by using
6039 * TCP_BPF_SYN. Otherwise, the bpf-prog can get both
6040 * IP[46] and TCP header by using TCP_BPF_SYN_IP.
6041 *
6042 * >0: Total number of bytes copied
6043 * -ENOSPC: Not enough space in optval. Only optlen number of
6044 * bytes is copied.
6045 * -ENOENT: The SYN skb is not available now and the earlier SYN pkt
6046 * is not saved by setsockopt(TCP_SAVE_SYN).
6047 */
6048 TCP_BPF_SYN = 1005, /* Copy the TCP header */
6049 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
6050 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
6051};
6052
6053enum {
6054 BPF_LOAD_HDR_OPT_TCP_SYN = (1ULL << 0),
6055};
6056
6057/* args[0] value during BPF_SOCK_OPS_HDR_OPT_LEN_CB and
6058 * BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
6059 */
6060enum {
6061 BPF_WRITE_HDR_TCP_CURRENT_MSS = 1, /* Kernel is finding the
6062 * total option spaces
6063 * required for an established
6064 * sk in order to calculate the
6065 * MSS. No skb is actually
6066 * sent.
6067 */
6068 BPF_WRITE_HDR_TCP_SYNACK_COOKIE = 2, /* Kernel is in syncookie mode
6069 * when sending a SYN.
6070 */
6071};
26806072
2681struct bpf_perf_event_value {6073struct bpf_perf_event_value {
2682 __u64 counter;6074 __u64 counter;
...@@ -2684,12 +6076,16 @@ struct bpf_perf_event_value {...@@ -2684,12 +6076,16 @@ struct bpf_perf_event_value {
2684 __u64 running;6076 __u64 running;
2685};6077};
26866078
2687#define BPF_DEVCG_ACC_MKNOD (1ULL << 0)6079enum {
2688#define BPF_DEVCG_ACC_READ (1ULL << 1)6080 BPF_DEVCG_ACC_MKNOD = (1ULL << 0),
2689#define BPF_DEVCG_ACC_WRITE (1ULL << 2)6081 BPF_DEVCG_ACC_READ = (1ULL << 1),
6082 BPF_DEVCG_ACC_WRITE = (1ULL << 2),
6083};
26906084
2691#define BPF_DEVCG_DEV_BLOCK (1ULL << 0)6085enum {
2692#define BPF_DEVCG_DEV_CHAR (1ULL << 1)6086 BPF_DEVCG_DEV_BLOCK = (1ULL << 0),
6087 BPF_DEVCG_DEV_CHAR = (1ULL << 1),
6088};
26936089
2694struct bpf_cgroup_dev_ctx {6090struct bpf_cgroup_dev_ctx {
2695 /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */6091 /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */
...@@ -2705,8 +6101,10 @@ struct bpf_raw_tracepoint_args {...@@ -2705,8 +6101,10 @@ struct bpf_raw_tracepoint_args {
2705/* DIRECT: Skip the FIB rules and go to FIB table associated with device6101/* DIRECT: Skip the FIB rules and go to FIB table associated with device
2706 * OUTPUT: Do lookup from egress perspective; default is ingress6102 * OUTPUT: Do lookup from egress perspective; default is ingress
2707 */6103 */
2708#define BPF_FIB_LOOKUP_DIRECT BIT(0)6104enum {
2709#define BPF_FIB_LOOKUP_OUTPUT BIT(1)6105 BPF_FIB_LOOKUP_DIRECT = (1U << 0),
6106 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
6107};
27106108
2711enum {6109enum {
2712 BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */6110 BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */
...@@ -2731,9 +6129,13 @@ struct bpf_fib_lookup {...@@ -2731,9 +6129,13 @@ struct bpf_fib_lookup {
2731 __be16 sport;6129 __be16 sport;
2732 __be16 dport;6130 __be16 dport;
27336131
2734 /* total length of packet from network header - used for MTU check */6132 union { /* used for MTU check */
2735 __u16 tot_len;6133 /* input to lookup */
6134 __u16 tot_len; /* L3 length from network hdr (iph->tot_len) */
27366135
6136 /* output: MTU value */
6137 __u16 mtu_result;
6138 };
2737 /* input: L3 device index for lookup6139 /* input: L3 device index for lookup
2738 * output: device index from FIB lookup6140 * output: device index from FIB lookup
2739 */6141 */
...@@ -2769,6 +6171,27 @@ struct bpf_fib_lookup {...@@ -2769,6 +6171,27 @@ struct bpf_fib_lookup {
2769 __u8 dmac[6]; /* ETH_ALEN */6171 __u8 dmac[6]; /* ETH_ALEN */
2770};6172};
27716173
6174struct bpf_redir_neigh {
6175 /* network family for lookup (AF_INET, AF_INET6) */
6176 __u32 nh_family;
6177 /* network address of nexthop; skips fib lookup to find gateway */
6178 union {
6179 __be32 ipv4_nh;
6180 __u32 ipv6_nh[4]; /* in6_addr; network order */
6181 };
6182};
6183
6184/* bpf_check_mtu flags*/
6185enum bpf_check_mtu_flags {
6186 BPF_MTU_CHK_SEGS = (1U << 0),
6187};
6188
6189enum bpf_check_mtu_ret {
6190 BPF_MTU_CHK_RET_SUCCESS, /* check and lookup successful */
6191 BPF_MTU_CHK_RET_FRAG_NEEDED, /* fragmentation required to fwd */
6192 BPF_MTU_CHK_RET_SEGS_TOOBIG, /* GSO re-segmentation needed to fwd */
6193};
6194
2772enum bpf_task_fd_type {6195enum bpf_task_fd_type {
2773 BPF_FD_TYPE_RAW_TRACEPOINT, /* tp name */6196 BPF_FD_TYPE_RAW_TRACEPOINT, /* tp name */
2774 BPF_FD_TYPE_TRACEPOINT, /* tp name */6197 BPF_FD_TYPE_TRACEPOINT, /* tp name */
...@@ -2778,4 +6201,131 @@ enum bpf_task_fd_type {...@@ -2778,4 +6201,131 @@ enum bpf_task_fd_type {
2778 BPF_FD_TYPE_URETPROBE, /* filename + offset */6201 BPF_FD_TYPE_URETPROBE, /* filename + offset */
2779};6202};
27806203
6204enum {
6205 BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = (1U << 0),
6206 BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = (1U << 1),
6207 BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = (1U << 2),
6208};
6209
6210struct bpf_flow_keys {
6211 __u16 nhoff;
6212 __u16 thoff;
6213 __u16 addr_proto; /* ETH_P_* of valid addrs */
6214 __u8 is_frag;
6215 __u8 is_first_frag;
6216 __u8 is_encap;
6217 __u8 ip_proto;
6218 __be16 n_proto;
6219 __be16 sport;
6220 __be16 dport;
6221 union {
6222 struct {
6223 __be32 ipv4_src;
6224 __be32 ipv4_dst;
6225 };
6226 struct {
6227 __u32 ipv6_src[4]; /* in6_addr; network order */
6228 __u32 ipv6_dst[4]; /* in6_addr; network order */
6229 };
6230 };
6231 __u32 flags;
6232 __be32 flow_label;
6233};
6234
6235struct bpf_func_info {
6236 __u32 insn_off;
6237 __u32 type_id;
6238};
6239
6240#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10)
6241#define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)
6242
6243struct bpf_line_info {
6244 __u32 insn_off;
6245 __u32 file_name_off;
6246 __u32 line_off;
6247 __u32 line_col;
6248};
6249
6250struct bpf_spin_lock {
6251 __u32 val;
6252};
6253
6254struct bpf_timer {
6255 __u64 :64;
6256 __u64 :64;
6257} __attribute__((aligned(8)));
6258
6259struct bpf_sysctl {
6260 __u32 write; /* Sysctl is being read (= 0) or written (= 1).
6261 * Allows 1,2,4-byte read, but no write.
6262 */
6263 __u32 file_pos; /* Sysctl file position to read from, write to.
6264 * Allows 1,2,4-byte read an 4-byte write.
6265 */
6266};
6267
6268struct bpf_sockopt {
6269 __bpf_md_ptr(struct bpf_sock *, sk);
6270 __bpf_md_ptr(void *, optval);
6271 __bpf_md_ptr(void *, optval_end);
6272
6273 __s32 level;
6274 __s32 optname;
6275 __s32 optlen;
6276 __s32 retval;
6277};
6278
6279struct bpf_pidns_info {
6280 __u32 pid;
6281 __u32 tgid;
6282};
6283
6284/* User accessible data for SK_LOOKUP programs. Add new fields at the end. */
6285struct bpf_sk_lookup {
6286 union {
6287 __bpf_md_ptr(struct bpf_sock *, sk); /* Selected socket */
6288 __u64 cookie; /* Non-zero if socket was selected in PROG_TEST_RUN */
6289 };
6290
6291 __u32 family; /* Protocol family (AF_INET, AF_INET6) */
6292 __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */
6293 __u32 remote_ip4; /* Network byte order */
6294 __u32 remote_ip6[4]; /* Network byte order */
6295 __u32 remote_port; /* Network byte order */
6296 __u32 local_ip4; /* Network byte order */
6297 __u32 local_ip6[4]; /* Network byte order */
6298 __u32 local_port; /* Host byte order */
6299};
6300
6301/*
6302 * struct btf_ptr is used for typed pointer representation; the
6303 * type id is used to render the pointer data as the appropriate type
6304 * via the bpf_snprintf_btf() helper described above. A flags field -
6305 * potentially to specify additional details about the BTF pointer
6306 * (rather than its mode of display) - is included for future use.
6307 * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
6308 */
6309struct btf_ptr {
6310 void *ptr;
6311 __u32 type_id;
6312 __u32 flags; /* BTF ptr flags; unused at present. */
6313};
6314
6315/*
6316 * Flags to control bpf_snprintf_btf() behaviour.
6317 * - BTF_F_COMPACT: no formatting around type information
6318 * - BTF_F_NONAME: no struct/union member names/types
6319 * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values;
6320 * equivalent to %px.
6321 * - BTF_F_ZERO: show zero-valued struct/union members; they
6322 * are not displayed by default
6323 */
6324enum {
6325 BTF_F_COMPACT = (1ULL << 0),
6326 BTF_F_NONAME = (1ULL << 1),
6327 BTF_F_PTR_RAW = (1ULL << 2),
6328 BTF_F_ZERO = (1ULL << 3),
6329};
6330
2781#endif /* __LINUX_BPF_H__ */6331#endif /* __LINUX_BPF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bpfilter.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_BPFILTER_H2#ifndef _LINUX_BPFILTER_H
3#define _LINUX_BPFILTER_H3#define _LINUX_BPFILTER_H
44
lib/libc/include/any-linux-any/linux/btf.h+97-22
...@@ -22,9 +22,9 @@ struct btf_header {...@@ -22,9 +22,9 @@ struct btf_header {
22};22};
2323
24/* Max # of type identifier */24/* Max # of type identifier */
25#define BTF_MAX_TYPE 0x0000ffff25#define BTF_MAX_TYPE 0x000fffff
26/* Max offset into the string section */26/* Max offset into the string section */
27#define BTF_MAX_NAME_OFFSET 0x0000ffff27#define BTF_MAX_NAME_OFFSET 0x00ffffff
28/* Max # of struct/union/enum members or func args */28/* Max # of struct/union/enum members or func args */
29#define BTF_MAX_VLEN 0xffff29#define BTF_MAX_VLEN 0xffff
3030
...@@ -34,13 +34,16 @@ struct btf_type {...@@ -34,13 +34,16 @@ struct btf_type {
34 * bits 0-15: vlen (e.g. # of struct's members)34 * bits 0-15: vlen (e.g. # of struct's members)
35 * bits 16-23: unused35 * bits 16-23: unused
36 * bits 24-27: kind (e.g. int, ptr, array...etc)36 * bits 24-27: kind (e.g. int, ptr, array...etc)
37 * bits 28-31: unused37 * bits 28-30: unused
38 * bit 31: kind_flag, currently used by
39 * struct, union and fwd
38 */40 */
39 __u32 info;41 __u32 info;
40 /* "size" is used by INT, ENUM, STRUCT and UNION.42 /* "size" is used by INT, ENUM, STRUCT, UNION and DATASEC.
41 * "size" tells the size of the type it is describing.43 * "size" tells the size of the type it is describing.
42 *44 *
43 * "type" is used by PTR, TYPEDEF, VOLATILE, CONST and RESTRICT.45 * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
46 * FUNC, FUNC_PROTO, VAR and DECL_TAG.
44 * "type" is a type_id referring to another type.47 * "type" is a type_id referring to another type.
45 */48 */
46 union {49 union {
...@@ -49,23 +52,33 @@ struct btf_type {...@@ -49,23 +52,33 @@ struct btf_type {
49 };52 };
50};53};
5154
52#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)55#define BTF_INFO_KIND(info) (((info) >> 24) & 0x1f)
53#define BTF_INFO_VLEN(info) ((info) & 0xffff)56#define BTF_INFO_VLEN(info) ((info) & 0xffff)
57#define BTF_INFO_KFLAG(info) ((info) >> 31)
5458
55#define BTF_KIND_UNKN 0 /* Unknown */59enum {
56#define BTF_KIND_INT 1 /* Integer */60 BTF_KIND_UNKN = 0, /* Unknown */
57#define BTF_KIND_PTR 2 /* Pointer */61 BTF_KIND_INT = 1, /* Integer */
58#define BTF_KIND_ARRAY 3 /* Array */62 BTF_KIND_PTR = 2, /* Pointer */
59#define BTF_KIND_STRUCT 4 /* Struct */63 BTF_KIND_ARRAY = 3, /* Array */
60#define BTF_KIND_UNION 5 /* Union */64 BTF_KIND_STRUCT = 4, /* Struct */
61#define BTF_KIND_ENUM 6 /* Enumeration */65 BTF_KIND_UNION = 5, /* Union */
62#define BTF_KIND_FWD 7 /* Forward */66 BTF_KIND_ENUM = 6, /* Enumeration */
63#define BTF_KIND_TYPEDEF 8 /* Typedef */67 BTF_KIND_FWD = 7, /* Forward */
64#define BTF_KIND_VOLATILE 9 /* Volatile */68 BTF_KIND_TYPEDEF = 8, /* Typedef */
65#define BTF_KIND_CONST 10 /* Const */69 BTF_KIND_VOLATILE = 9, /* Volatile */
66#define BTF_KIND_RESTRICT 11 /* Restrict */70 BTF_KIND_CONST = 10, /* Const */
67#define BTF_KIND_MAX 1171 BTF_KIND_RESTRICT = 11, /* Restrict */
68#define NR_BTF_KINDS 1272 BTF_KIND_FUNC = 12, /* Function */
73 BTF_KIND_FUNC_PROTO = 13, /* Function Proto */
74 BTF_KIND_VAR = 14, /* Variable */
75 BTF_KIND_DATASEC = 15, /* Section */
76 BTF_KIND_FLOAT = 16, /* Floating point */
77 BTF_KIND_DECL_TAG = 17, /* Decl Tag */
78
79 NR_BTF_KINDS,
80 BTF_KIND_MAX = NR_BTF_KINDS - 1,
81};
6982
70/* For some specific BTF_KIND, "struct btf_type" is immediately83/* For some specific BTF_KIND, "struct btf_type" is immediately
71 * followed by extra data.84 * followed by extra data.
...@@ -75,7 +88,7 @@ struct btf_type {...@@ -75,7 +88,7 @@ struct btf_type {
75 * is the 32 bits arrangement:88 * is the 32 bits arrangement:
76 */89 */
77#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)90#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
78#define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16)91#define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16)
79#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)92#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
8093
81/* Attributes stored in the BTF_INT_ENCODING */94/* Attributes stored in the BTF_INT_ENCODING */
...@@ -107,7 +120,69 @@ struct btf_array {...@@ -107,7 +120,69 @@ struct btf_array {
107struct btf_member {120struct btf_member {
108 __u32 name_off;121 __u32 name_off;
109 __u32 type;122 __u32 type;
110 __u32 offset; /* offset in bits */123 /* If the type info kind_flag is set, the btf_member offset
124 * contains both member bitfield size and bit offset. The
125 * bitfield size is set for bitfield members. If the type
126 * info kind_flag is not set, the offset contains only bit
127 * offset.
128 */
129 __u32 offset;
130};
131
132/* If the struct/union type info kind_flag is set, the
133 * following two macros are used to access bitfield_size
134 * and bit_offset from btf_member.offset.
135 */
136#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24)
137#define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)
138
139/* BTF_KIND_FUNC_PROTO is followed by multiple "struct btf_param".
140 * The exact number of btf_param is stored in the vlen (of the
141 * info in "struct btf_type").
142 */
143struct btf_param {
144 __u32 name_off;
145 __u32 type;
146};
147
148enum {
149 BTF_VAR_STATIC = 0,
150 BTF_VAR_GLOBAL_ALLOCATED = 1,
151 BTF_VAR_GLOBAL_EXTERN = 2,
152};
153
154enum btf_func_linkage {
155 BTF_FUNC_STATIC = 0,
156 BTF_FUNC_GLOBAL = 1,
157 BTF_FUNC_EXTERN = 2,
158};
159
160/* BTF_KIND_VAR is followed by a single "struct btf_var" to describe
161 * additional information related to the variable such as its linkage.
162 */
163struct btf_var {
164 __u32 linkage;
165};
166
167/* BTF_KIND_DATASEC is followed by multiple "struct btf_var_secinfo"
168 * to describe all BTF_KIND_VAR types it contains along with it's
169 * in-section offset as well as size.
170 */
171struct btf_var_secinfo {
172 __u32 type;
173 __u32 offset;
174 __u32 size;
175};
176
177/* BTF_KIND_DECL_TAG is followed by a single "struct btf_decl_tag" to describe
178 * additional information related to the tag applied location.
179 * If component_idx == -1, the tag is applied to a struct, union,
180 * variable or function. Otherwise, it is applied to a struct/union
181 * member or a func argument, and component_idx indicates which member
182 * or argument (0 ... vlen-1).
183 */
184struct btf_decl_tag {
185 __s32 component_idx;
111};186};
112187
113#endif /* __LINUX_BTF_H__ */188#endif /* __LINUX_BTF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs.h+73-19
...@@ -36,17 +36,20 @@ struct btrfs_ioctl_vol_args {...@@ -36,17 +36,20 @@ struct btrfs_ioctl_vol_args {
36#define BTRFS_DEVICE_PATH_NAME_MAX 102436#define BTRFS_DEVICE_PATH_NAME_MAX 1024
37#define BTRFS_SUBVOL_NAME_MAX 403937#define BTRFS_SUBVOL_NAME_MAX 4039
3838
39#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)39/* Deprecated since 5.7 */
40# define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
40#define BTRFS_SUBVOL_RDONLY (1ULL << 1)41#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
41#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)42#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
4243
43#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)44#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
4445
46#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
47
45#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \48#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
46 (BTRFS_SUBVOL_CREATE_ASYNC | \49 (BTRFS_SUBVOL_RDONLY | \
47 BTRFS_SUBVOL_RDONLY | \
48 BTRFS_SUBVOL_QGROUP_INHERIT | \50 BTRFS_SUBVOL_QGROUP_INHERIT | \
49 BTRFS_DEVICE_SPEC_BY_ID)51 BTRFS_DEVICE_SPEC_BY_ID | \
52 BTRFS_SUBVOL_SPEC_BY_ID)
5053
51#define BTRFS_FSID_SIZE 1654#define BTRFS_FSID_SIZE 16
52#define BTRFS_UUID_SIZE 1655#define BTRFS_UUID_SIZE 16
...@@ -97,16 +100,29 @@ struct btrfs_ioctl_qgroup_limit_args {...@@ -97,16 +100,29 @@ struct btrfs_ioctl_qgroup_limit_args {
97};100};
98101
99/*102/*
100 * flags for subvolumes103 * Arguments for specification of subvolumes or devices, supporting by-name or
104 * by-id and flags
101 *105 *
102 * Used by:106 * The set of supported flags depends on the ioctl
103 * struct btrfs_ioctl_vol_args_v2.flags
104 *107 *
105 * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:108 * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:
106 * - BTRFS_IOC_SUBVOL_GETFLAGS109 * - BTRFS_IOC_SUBVOL_GETFLAGS
107 * - BTRFS_IOC_SUBVOL_SETFLAGS110 * - BTRFS_IOC_SUBVOL_SETFLAGS
108 */111 */
109112
113/* Supported flags for BTRFS_IOC_RM_DEV_V2 */
114#define BTRFS_DEVICE_REMOVE_ARGS_MASK \
115 (BTRFS_DEVICE_SPEC_BY_ID)
116
117/* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */
118#define BTRFS_SUBVOL_CREATE_ARGS_MASK \
119 (BTRFS_SUBVOL_RDONLY | \
120 BTRFS_SUBVOL_QGROUP_INHERIT)
121
122/* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */
123#define BTRFS_SUBVOL_DELETE_ARGS_MASK \
124 (BTRFS_SUBVOL_SPEC_BY_ID)
125
110struct btrfs_ioctl_vol_args_v2 {126struct btrfs_ioctl_vol_args_v2 {
111 __s64 fd;127 __s64 fd;
112 __u64 transid;128 __u64 transid;
...@@ -121,6 +137,7 @@ struct btrfs_ioctl_vol_args_v2 {...@@ -121,6 +137,7 @@ struct btrfs_ioctl_vol_args_v2 {
121 union {137 union {
122 char name[BTRFS_SUBVOL_NAME_MAX + 1];138 char name[BTRFS_SUBVOL_NAME_MAX + 1];
123 __u64 devid;139 __u64 devid;
140 __u64 subvolid;
124 };141 };
125};142};
126143
...@@ -135,7 +152,7 @@ struct btrfs_scrub_progress {...@@ -135,7 +152,7 @@ struct btrfs_scrub_progress {
135 __u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */152 __u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */
136 __u64 read_errors; /* # of read errors encountered (EIO) */153 __u64 read_errors; /* # of read errors encountered (EIO) */
137 __u64 csum_errors; /* # of failed csum checks */154 __u64 csum_errors; /* # of failed csum checks */
138 __u64 verify_errors; /* # of occurences, where the metadata155 __u64 verify_errors; /* # of occurrences, where the metadata
139 * of a tree block did not match the156 * of a tree block did not match the
140 * expected values, like generation or157 * expected values, like generation or
141 * logical */158 * logical */
...@@ -155,7 +172,7 @@ struct btrfs_scrub_progress {...@@ -155,7 +172,7 @@ struct btrfs_scrub_progress {
155 __u64 last_physical; /* last physical address scrubbed. In172 __u64 last_physical; /* last physical address scrubbed. In
156 * case a scrub was aborted, this can173 * case a scrub was aborted, this can
157 * be used to restart the scrub */174 * be used to restart the scrub */
158 __u64 unverified_errors; /* # of occurences where a read for a175 __u64 unverified_errors; /* # of occurrences where a read for a
159 * full (64k) bio failed, but the re-176 * full (64k) bio failed, but the re-
160 * check succeeded for each 4k piece.177 * check succeeded for each 4k piece.
161 * Intermittent error. */178 * Intermittent error. */
...@@ -224,6 +241,18 @@ struct btrfs_ioctl_dev_info_args {...@@ -224,6 +241,18 @@ struct btrfs_ioctl_dev_info_args {
224 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */241 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
225};242};
226243
244/*
245 * Retrieve information about the filesystem
246 */
247
248/* Request information about checksum type and size */
249#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0)
250
251/* Request information about filesystem generation */
252#define BTRFS_FS_INFO_FLAG_GENERATION (1 << 1)
253/* Request information about filesystem metadata UUID */
254#define BTRFS_FS_INFO_FLAG_METADATA_UUID (1 << 2)
255
227struct btrfs_ioctl_fs_info_args {256struct btrfs_ioctl_fs_info_args {
228 __u64 max_id; /* out */257 __u64 max_id; /* out */
229 __u64 num_devices; /* out */258 __u64 num_devices; /* out */
...@@ -231,8 +260,13 @@ struct btrfs_ioctl_fs_info_args {...@@ -231,8 +260,13 @@ struct btrfs_ioctl_fs_info_args {
231 __u32 nodesize; /* out */260 __u32 nodesize; /* out */
232 __u32 sectorsize; /* out */261 __u32 sectorsize; /* out */
233 __u32 clone_alignment; /* out */262 __u32 clone_alignment; /* out */
234 __u32 reserved32;263 /* See BTRFS_FS_INFO_FLAG_* */
235 __u64 reserved[122]; /* pad to 1k */264 __u16 csum_type; /* out */
265 __u16 csum_size; /* out */
266 __u64 flags; /* in/out */
267 __u64 generation; /* out */
268 __u8 metadata_uuid[BTRFS_FSID_SIZE]; /* out */
269 __u8 reserved[944]; /* pad to 1k */
236};270};
237271
238/*272/*
...@@ -252,6 +286,7 @@ struct btrfs_ioctl_fs_info_args {...@@ -252,6 +286,7 @@ struct btrfs_ioctl_fs_info_args {
252 * first mount when booting older kernel versions.286 * first mount when booting older kernel versions.
253 */287 */
254#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)288#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
289#define BTRFS_FEATURE_COMPAT_RO_VERITY (1ULL << 2)
255290
256#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)291#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
257#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)292#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
...@@ -269,6 +304,9 @@ struct btrfs_ioctl_fs_info_args {...@@ -269,6 +304,9 @@ struct btrfs_ioctl_fs_info_args {
269#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)304#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
270#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)305#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
271#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)306#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
307#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
308#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
309#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
272310
273struct btrfs_ioctl_feature_flags {311struct btrfs_ioctl_feature_flags {
274 __u64 compat_flags;312 __u64 compat_flags;
...@@ -664,7 +702,12 @@ struct btrfs_ioctl_get_dev_stats {...@@ -664,7 +702,12 @@ struct btrfs_ioctl_get_dev_stats {
664 /* out values: */702 /* out values: */
665 __u64 values[BTRFS_DEV_STAT_VALUES_MAX];703 __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
666704
667 __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */705 /*
706 * This pads the struct to 1032 bytes. It was originally meant to pad to
707 * 1024 bytes, but when adding the flags field, the padding calculation
708 * was not adjusted.
709 */
710 __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX];
668};711};
669712
670#define BTRFS_QUOTA_CTL_ENABLE 1713#define BTRFS_QUOTA_CTL_ENABLE 1
...@@ -726,10 +769,16 @@ struct btrfs_ioctl_received_subvol_args {...@@ -726,10 +769,16 @@ struct btrfs_ioctl_received_subvol_args {
726 */769 */
727#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4770#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
728771
772/*
773 * Read the protocol version in the structure
774 */
775#define BTRFS_SEND_FLAG_VERSION 0x8
776
729#define BTRFS_SEND_FLAG_MASK \777#define BTRFS_SEND_FLAG_MASK \
730 (BTRFS_SEND_FLAG_NO_FILE_DATA | \778 (BTRFS_SEND_FLAG_NO_FILE_DATA | \
731 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \779 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \
732 BTRFS_SEND_FLAG_OMIT_END_CMD)780 BTRFS_SEND_FLAG_OMIT_END_CMD | \
781 BTRFS_SEND_FLAG_VERSION)
733782
734struct btrfs_ioctl_send_args {783struct btrfs_ioctl_send_args {
735 __s64 send_fd; /* in */784 __s64 send_fd; /* in */
...@@ -737,7 +786,8 @@ struct btrfs_ioctl_send_args {...@@ -737,7 +786,8 @@ struct btrfs_ioctl_send_args {
737 __u64 *clone_sources; /* in */786 __u64 *clone_sources; /* in */
738 __u64 parent_root; /* in */787 __u64 parent_root; /* in */
739 __u64 flags; /* in */788 __u64 flags; /* in */
740 __u64 reserved[4]; /* in */789 __u32 version; /* in */
790 __u8 reserved[28]; /* in */
741};791};
742792
743/*793/*
...@@ -825,7 +875,9 @@ enum btrfs_err_code {...@@ -825,7 +875,9 @@ enum btrfs_err_code {
825 BTRFS_ERROR_DEV_TGT_REPLACE,875 BTRFS_ERROR_DEV_TGT_REPLACE,
826 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,876 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
827 BTRFS_ERROR_DEV_ONLY_WRITABLE,877 BTRFS_ERROR_DEV_ONLY_WRITABLE,
828 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS878 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS,
879 BTRFS_ERROR_DEV_RAID1C3_MIN_NOT_MET,
880 BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET,
829};881};
830882
831#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \883#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
...@@ -836,6 +888,8 @@ enum btrfs_err_code {...@@ -836,6 +888,8 @@ enum btrfs_err_code {
836 struct btrfs_ioctl_vol_args)888 struct btrfs_ioctl_vol_args)
837#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \889#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \
838 struct btrfs_ioctl_vol_args)890 struct btrfs_ioctl_vol_args)
891#define BTRFS_IOC_FORGET_DEV _IOW(BTRFS_IOCTL_MAGIC, 5, \
892 struct btrfs_ioctl_vol_args)
839/* trans start and trans end are dangerous, and only for893/* trans start and trans end are dangerous, and only for
840 * use by applications that know how to avoid the894 * use by applications that know how to avoid the
841 * resulting deadlocks895 * resulting deadlocks
...@@ -914,10 +968,8 @@ enum btrfs_err_code {...@@ -914,10 +968,8 @@ enum btrfs_err_code {
914#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \968#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
915 struct btrfs_ioctl_quota_rescan_args)969 struct btrfs_ioctl_quota_rescan_args)
916#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)970#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
917#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \971#define BTRFS_IOC_GET_FSLABEL FS_IOC_GETFSLABEL
918 char[BTRFS_LABEL_SIZE])972#define BTRFS_IOC_SET_FSLABEL FS_IOC_SETFSLABEL
919#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
920 char[BTRFS_LABEL_SIZE])
921#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \973#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
922 struct btrfs_ioctl_get_dev_stats)974 struct btrfs_ioctl_get_dev_stats)
923#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \975#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
...@@ -940,5 +992,7 @@ enum btrfs_err_code {...@@ -940,5 +992,7 @@ enum btrfs_err_code {
940 struct btrfs_ioctl_get_subvol_rootref_args)992 struct btrfs_ioctl_get_subvol_rootref_args)
941#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \993#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \
942 struct btrfs_ioctl_ino_lookup_user_args)994 struct btrfs_ioctl_ino_lookup_user_args)
995#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
996 struct btrfs_ioctl_vol_args_v2)
943997
944#endif /* _LINUX_BTRFS_H */998#endif /* _LINUX_BTRFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs_tree.h+76-24
...@@ -4,6 +4,7 @@...@@ -4,6 +4,7 @@
44
5#include <linux/btrfs.h>5#include <linux/btrfs.h>
6#include <linux/types.h>6#include <linux/types.h>
7#include <stddef.h>
78
8/*9/*
9 * This header contains the structure definitions and constants used10 * This header contains the structure definitions and constants used
...@@ -54,7 +55,7 @@...@@ -54,7 +55,7 @@
54/* for storing balance parameters in the root tree */55/* for storing balance parameters in the root tree */
55#define BTRFS_BALANCE_OBJECTID -4ULL56#define BTRFS_BALANCE_OBJECTID -4ULL
5657
57/* orhpan objectid for tracking unlinked/truncated files */58/* orphan objectid for tracking unlinked/truncated files */
58#define BTRFS_ORPHAN_OBJECTID -5ULL59#define BTRFS_ORPHAN_OBJECTID -5ULL
5960
60/* does write ahead logging to speed up fsyncs */61/* does write ahead logging to speed up fsyncs */
...@@ -113,6 +114,29 @@...@@ -113,6 +114,29 @@
113#define BTRFS_INODE_REF_KEY 12114#define BTRFS_INODE_REF_KEY 12
114#define BTRFS_INODE_EXTREF_KEY 13115#define BTRFS_INODE_EXTREF_KEY 13
115#define BTRFS_XATTR_ITEM_KEY 24116#define BTRFS_XATTR_ITEM_KEY 24
117
118/*
119 * fs verity items are stored under two different key types on disk.
120 * The descriptor items:
121 * [ inode objectid, BTRFS_VERITY_DESC_ITEM_KEY, offset ]
122 *
123 * At offset 0, we store a btrfs_verity_descriptor_item which tracks the size
124 * of the descriptor item and some extra data for encryption.
125 * Starting at offset 1, these hold the generic fs verity descriptor. The
126 * latter are opaque to btrfs, we just read and write them as a blob for the
127 * higher level verity code. The most common descriptor size is 256 bytes.
128 *
129 * The merkle tree items:
130 * [ inode objectid, BTRFS_VERITY_MERKLE_ITEM_KEY, offset ]
131 *
132 * These also start at offset 0, and correspond to the merkle tree bytes. When
133 * fsverity asks for page 0 of the merkle tree, we pull up one page starting at
134 * offset 0 for this key type. These are also opaque to btrfs, we're blindly
135 * storing whatever fsverity sends down.
136 */
137#define BTRFS_VERITY_DESC_ITEM_KEY 36
138#define BTRFS_VERITY_MERKLE_ITEM_KEY 37
139
116#define BTRFS_ORPHAN_ITEM_KEY 48140#define BTRFS_ORPHAN_ITEM_KEY 48
117/* reserve 2-15 close to the inode for later flexibility */141/* reserve 2-15 close to the inode for later flexibility */
118142
...@@ -270,7 +294,7 @@...@@ -270,7 +294,7 @@
270#define BTRFS_PERSISTENT_ITEM_KEY 249294#define BTRFS_PERSISTENT_ITEM_KEY 249
271295
272/*296/*
273 * Persistantly stores the device replace state in the device tree.297 * Persistently stores the device replace state in the device tree.
274 * The key is built like this: (0, BTRFS_DEV_REPLACE_KEY, 0).298 * The key is built like this: (0, BTRFS_DEV_REPLACE_KEY, 0).
275 */299 */
276#define BTRFS_DEV_REPLACE_KEY 250300#define BTRFS_DEV_REPLACE_KEY 250
...@@ -294,19 +318,27 @@...@@ -294,19 +318,27 @@
294 */318 */
295#define BTRFS_STRING_ITEM_KEY 253319#define BTRFS_STRING_ITEM_KEY 253
296320
297321/* Maximum metadata block size (nodesize) */
322#define BTRFS_MAX_METADATA_BLOCKSIZE 65536
298323
299/* 32 bytes in various csum fields */324/* 32 bytes in various csum fields */
300#define BTRFS_CSUM_SIZE 32325#define BTRFS_CSUM_SIZE 32
301326
302/* csum types */327/* csum types */
303#define BTRFS_CSUM_TYPE_CRC32 0328enum btrfs_csum_type {
329 BTRFS_CSUM_TYPE_CRC32 = 0,
330 BTRFS_CSUM_TYPE_XXHASH = 1,
331 BTRFS_CSUM_TYPE_SHA256 = 2,
332 BTRFS_CSUM_TYPE_BLAKE2 = 3,
333};
304334
305/*335/*
306 * flags definitions for directory entry item type336 * flags definitions for directory entry item type
307 *337 *
308 * Used by:338 * Used by:
309 * struct btrfs_dir_item.type339 * struct btrfs_dir_item.type
340 *
341 * Values 0..7 must match common file type values in fs_types.h.
310 */342 */
311#define BTRFS_FT_UNKNOWN 0343#define BTRFS_FT_UNKNOWN 0
312#define BTRFS_FT_REG_FILE 1344#define BTRFS_FT_REG_FILE 1
...@@ -458,6 +490,7 @@ struct btrfs_free_space_header {...@@ -458,6 +490,7 @@ struct btrfs_free_space_header {
458#define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)490#define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
459#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)491#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
460#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)492#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
493#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)
461494
462495
463/*496/*
...@@ -511,15 +544,6 @@ struct btrfs_extent_inline_ref {...@@ -511,15 +544,6 @@ struct btrfs_extent_inline_ref {
511 __le64 offset;544 __le64 offset;
512} __attribute__ ((__packed__));545} __attribute__ ((__packed__));
513546
514/* old style backrefs item */
515struct btrfs_extent_ref_v0 {
516 __le64 root;
517 __le64 generation;
518 __le64 objectid;
519 __le32 count;
520} __attribute__ ((__packed__));
521
522
523/* dev extents record free space on individual devices. The owner547/* dev extents record free space on individual devices. The owner
524 * field points back to the chunk allocation mapping tree that allocated548 * field points back to the chunk allocation mapping tree that allocated
525 * the extent. The chunk tree uuid field is a way to double check the owner549 * the extent. The chunk tree uuid field is a way to double check the owner
...@@ -645,6 +669,15 @@ struct btrfs_root_item {...@@ -645,6 +669,15 @@ struct btrfs_root_item {
645 __le64 reserved[8]; /* for future */669 __le64 reserved[8]; /* for future */
646} __attribute__ ((__packed__));670} __attribute__ ((__packed__));
647671
672/*
673 * Btrfs root item used to be smaller than current size. The old format ends
674 * at where member generation_v2 is.
675 */
676static __inline__ __u32 btrfs_legacy_root_item_size(void)
677{
678 return offsetof(struct btrfs_root_item, generation_v2);
679}
680
648/*681/*
649 * this is used for both forward and backward root refs682 * this is used for both forward and backward root refs
650 */683 */
...@@ -732,10 +765,12 @@ struct btrfs_balance_item {...@@ -732,10 +765,12 @@ struct btrfs_balance_item {
732 __le64 unused[4];765 __le64 unused[4];
733} __attribute__ ((__packed__));766} __attribute__ ((__packed__));
734767
735#define BTRFS_FILE_EXTENT_INLINE 0768enum {
736#define BTRFS_FILE_EXTENT_REG 1769 BTRFS_FILE_EXTENT_INLINE = 0,
737#define BTRFS_FILE_EXTENT_PREALLOC 2770 BTRFS_FILE_EXTENT_REG = 1,
738#define BTRFS_FILE_EXTENT_TYPES 2771 BTRFS_FILE_EXTENT_PREALLOC = 2,
772 BTRFS_NR_FILE_EXTENT_TYPES = 3,
773};
739774
740struct btrfs_file_extent_item {775struct btrfs_file_extent_item {
741 /*776 /*
...@@ -803,11 +838,6 @@ struct btrfs_dev_stats_item {...@@ -803,11 +838,6 @@ struct btrfs_dev_stats_item {
803838
804#define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0839#define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
805#define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_AVOID 1840#define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
806#define BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED 0
807#define BTRFS_DEV_REPLACE_ITEM_STATE_STARTED 1
808#define BTRFS_DEV_REPLACE_ITEM_STATE_SUSPENDED 2
809#define BTRFS_DEV_REPLACE_ITEM_STATE_FINISHED 3
810#define BTRFS_DEV_REPLACE_ITEM_STATE_CANCELED 4
811841
812struct btrfs_dev_replace_item {842struct btrfs_dev_replace_item {
813 /*843 /*
...@@ -836,6 +866,8 @@ struct btrfs_dev_replace_item {...@@ -836,6 +866,8 @@ struct btrfs_dev_replace_item {
836#define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)866#define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)
837#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)867#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
838#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)868#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
869#define BTRFS_BLOCK_GROUP_RAID1C3 (1ULL << 9)
870#define BTRFS_BLOCK_GROUP_RAID1C4 (1ULL << 10)
839#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \871#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
840 BTRFS_SPACE_INFO_GLOBAL_RSV)872 BTRFS_SPACE_INFO_GLOBAL_RSV)
841873
...@@ -847,6 +879,8 @@ enum btrfs_raid_types {...@@ -847,6 +879,8 @@ enum btrfs_raid_types {
847 BTRFS_RAID_SINGLE,879 BTRFS_RAID_SINGLE,
848 BTRFS_RAID_RAID5,880 BTRFS_RAID_RAID5,
849 BTRFS_RAID_RAID6,881 BTRFS_RAID_RAID6,
882 BTRFS_RAID_RAID1C3,
883 BTRFS_RAID_RAID1C4,
850 BTRFS_NR_RAID_TYPES884 BTRFS_NR_RAID_TYPES
851};885};
852886
...@@ -856,6 +890,8 @@ enum btrfs_raid_types {...@@ -856,6 +890,8 @@ enum btrfs_raid_types {
856890
857#define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \891#define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \
858 BTRFS_BLOCK_GROUP_RAID1 | \892 BTRFS_BLOCK_GROUP_RAID1 | \
893 BTRFS_BLOCK_GROUP_RAID1C3 | \
894 BTRFS_BLOCK_GROUP_RAID1C4 | \
859 BTRFS_BLOCK_GROUP_RAID5 | \895 BTRFS_BLOCK_GROUP_RAID5 | \
860 BTRFS_BLOCK_GROUP_RAID6 | \896 BTRFS_BLOCK_GROUP_RAID6 | \
861 BTRFS_BLOCK_GROUP_DUP | \897 BTRFS_BLOCK_GROUP_DUP | \
...@@ -863,6 +899,10 @@ enum btrfs_raid_types {...@@ -863,6 +899,10 @@ enum btrfs_raid_types {
863#define BTRFS_BLOCK_GROUP_RAID56_MASK (BTRFS_BLOCK_GROUP_RAID5 | \899#define BTRFS_BLOCK_GROUP_RAID56_MASK (BTRFS_BLOCK_GROUP_RAID5 | \
864 BTRFS_BLOCK_GROUP_RAID6)900 BTRFS_BLOCK_GROUP_RAID6)
865901
902#define BTRFS_BLOCK_GROUP_RAID1_MASK (BTRFS_BLOCK_GROUP_RAID1 | \
903 BTRFS_BLOCK_GROUP_RAID1C3 | \
904 BTRFS_BLOCK_GROUP_RAID1C4)
905
866/*906/*
867 * We need a bit for restriper to be able to tell when chunks of type907 * We need a bit for restriper to be able to tell when chunks of type
868 * SINGLE are available. This "extended" profile format is used in908 * SINGLE are available. This "extended" profile format is used in
...@@ -907,9 +947,9 @@ struct btrfs_free_space_info {...@@ -907,9 +947,9 @@ struct btrfs_free_space_info {
907#define BTRFS_FREE_SPACE_USING_BITMAPS (1ULL << 0)947#define BTRFS_FREE_SPACE_USING_BITMAPS (1ULL << 0)
908948
909#define BTRFS_QGROUP_LEVEL_SHIFT 48949#define BTRFS_QGROUP_LEVEL_SHIFT 48
910static __inline__ __u64 btrfs_qgroup_level(__u64 qgroupid)950static __inline__ __u16 btrfs_qgroup_level(__u64 qgroupid)
911{951{
912 return qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT;952 return (__u16)(qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT);
913}953}
914954
915/*955/*
...@@ -970,4 +1010,16 @@ struct btrfs_qgroup_limit_item {...@@ -970,4 +1010,16 @@ struct btrfs_qgroup_limit_item {
970 __le64 rsv_excl;1010 __le64 rsv_excl;
971} __attribute__ ((__packed__));1011} __attribute__ ((__packed__));
9721012
1013struct btrfs_verity_descriptor_item {
1014 /* Size of the verity descriptor in bytes */
1015 __le64 size;
1016 /*
1017 * When we implement support for fscrypt, we will need to encrypt the
1018 * Merkle tree for encrypted verity files. These 128 bits are for the
1019 * eventual storage of an fscrypt initialization vector.
1020 */
1021 __le64 reserved[2];
1022 __u8 encryption;
1023} __attribute__ ((__packed__));
1024
973#endif /* _BTRFS_CTREE_H_ */1025#endif /* _BTRFS_CTREE_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/caif/caif_socket.h+1-1
...@@ -169,7 +169,7 @@ struct sockaddr_caif {...@@ -169,7 +169,7 @@ struct sockaddr_caif {
169 * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are169 * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are
170 * available. Either a high bandwidth170 * available. Either a high bandwidth
171 * link can be selected (CAIF_LINK_HIGH_BANDW) or171 * link can be selected (CAIF_LINK_HIGH_BANDW) or
172 * or a low latency link (CAIF_LINK_LOW_LATENCY).172 * a low latency link (CAIF_LINK_LOW_LATENCY).
173 * This option is of type __u32.173 * This option is of type __u32.
174 * Alternatively SO_BINDTODEVICE can be used.174 * Alternatively SO_BINDTODEVICE can be used.
175 *175 *
lib/libc/include/any-linux-any/linux/can.h+55-18
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*2/*
3 * linux/can.h3 * linux/can.h
4 *4 *
...@@ -84,6 +84,7 @@ typedef __u32 can_err_mask_t;...@@ -84,6 +84,7 @@ typedef __u32 can_err_mask_t;
8484
85/* CAN payload length and DLC definitions according to ISO 11898-1 */85/* CAN payload length and DLC definitions according to ISO 11898-1 */
86#define CAN_MAX_DLC 886#define CAN_MAX_DLC 8
87#define CAN_MAX_RAW_DLC 15
87#define CAN_MAX_DLEN 888#define CAN_MAX_DLEN 8
8889
89/* CAN FD payload length and DLC definitions according to ISO 11898-7 */90/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
...@@ -91,30 +92,39 @@ typedef __u32 can_err_mask_t;...@@ -91,30 +92,39 @@ typedef __u32 can_err_mask_t;
91#define CANFD_MAX_DLEN 6492#define CANFD_MAX_DLEN 64
9293
93/**94/**
94 * struct can_frame - basic CAN frame structure95 * struct can_frame - Classical CAN frame structure (aka CAN 2.0B)
95 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition96 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
96 * @can_dlc: frame payload length in byte (0 .. 8) aka data length code97 * @len: CAN frame payload length in byte (0 .. 8)
97 * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:198 * @can_dlc: deprecated name for CAN frame payload length in byte (0 .. 8)
98 * mapping of the 'data length code' to the real payload length99 * @__pad: padding
99 * @__pad: padding100 * @__res0: reserved / padding
100 * @__res0: reserved / padding101 * @len8_dlc: optional DLC value (9 .. 15) at 8 byte payload length
101 * @__res1: reserved / padding102 * len8_dlc contains values from 9 .. 15 when the payload length is
102 * @data: CAN frame payload (up to 8 byte)103 * 8 bytes but the DLC value (see ISO 11898-1) is greater then 8.
104 * CAN_CTRLMODE_CC_LEN8_DLC flag has to be enabled in CAN driver.
105 * @data: CAN frame payload (up to 8 byte)
103 */106 */
104struct can_frame {107struct can_frame {
105 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */108 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
106 __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */109 union {
107 __u8 __pad; /* padding */110 /* CAN frame payload length in byte (0 .. CAN_MAX_DLEN)
108 __u8 __res0; /* reserved / padding */111 * was previously named can_dlc so we need to carry that
109 __u8 __res1; /* reserved / padding */112 * name for legacy support
110 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));113 */
114 __u8 len;
115 __u8 can_dlc; /* deprecated */
116 } __attribute__((packed)); /* disable padding added in some ABIs */
117 __u8 __pad; /* padding */
118 __u8 __res0; /* reserved / padding */
119 __u8 len8_dlc; /* optional DLC for 8 byte payload length (9 .. 15) */
120 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
111};121};
112122
113/*123/*
114 * defined bits for canfd_frame.flags124 * defined bits for canfd_frame.flags
115 *125 *
116 * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to126 * The use of struct canfd_frame implies the FD Frame (FDF) bit to
117 * be set in the CAN frame bitstream on the wire. The EDL bit switch turns127 * be set in the CAN frame bitstream on the wire. The FDF bit switch turns
118 * the CAN controllers bitstream processor into the CAN FD mode which creates128 * the CAN controllers bitstream processor into the CAN FD mode which creates
119 * two new options within the CAN FD frame specification:129 * two new options within the CAN FD frame specification:
120 *130 *
...@@ -125,9 +135,18 @@ struct can_frame {...@@ -125,9 +135,18 @@ struct can_frame {
125 * controller only the CANFD_BRS bit is relevant for real CAN controllers when135 * controller only the CANFD_BRS bit is relevant for real CAN controllers when
126 * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make136 * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
127 * sense for virtual CAN interfaces to test applications with echoed frames.137 * sense for virtual CAN interfaces to test applications with echoed frames.
138 *
139 * The struct can_frame and struct canfd_frame intentionally share the same
140 * layout to be able to write CAN frame content into a CAN FD frame structure.
141 * When this is done the former differentiation via CAN_MTU / CANFD_MTU gets
142 * lost. CANFD_FDF allows programmers to mark CAN FD frames in the case of
143 * using struct canfd_frame for mixed CAN / CAN FD content (dual use).
144 * N.B. the Kernel APIs do NOT provide mixed CAN / CAN FD content inside of
145 * struct canfd_frame therefore the CANFD_FDF flag is disregarded by Linux.
128 */146 */
129#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */147#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
130#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */148#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
149#define CANFD_FDF 0x04 /* mark CAN FD for dual use of struct canfd_frame */
131150
132/**151/**
133 * struct canfd_frame - CAN flexible data rate frame structure152 * struct canfd_frame - CAN flexible data rate frame structure
...@@ -157,7 +176,8 @@ struct canfd_frame {...@@ -157,7 +176,8 @@ struct canfd_frame {
157#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */176#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
158#define CAN_MCNET 5 /* Bosch MCNet */177#define CAN_MCNET 5 /* Bosch MCNet */
159#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */178#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
160#define CAN_NPROTO 7179#define CAN_J1939 7 /* SAE J1939 */
180#define CAN_NPROTO 8
161181
162#define SOL_CAN_BASE 100182#define SOL_CAN_BASE 100
163183
...@@ -174,6 +194,23 @@ struct sockaddr_can {...@@ -174,6 +194,23 @@ struct sockaddr_can {
174 /* transport protocol class address information (e.g. ISOTP) */194 /* transport protocol class address information (e.g. ISOTP) */
175 struct { canid_t rx_id, tx_id; } tp;195 struct { canid_t rx_id, tx_id; } tp;
176196
197 /* J1939 address information */
198 struct {
199 /* 8 byte name when using dynamic addressing */
200 __u64 name;
201
202 /* pgn:
203 * 8 bit: PS in PDU2 case, else 0
204 * 8 bit: PF
205 * 1 bit: DP
206 * 1 bit: reserved
207 */
208 __u32 pgn;
209
210 /* 1 byte address */
211 __u8 addr;
212 } j1939;
213
177 /* reserved for future CAN protocols address information */214 /* reserved for future CAN protocols address information */
178 } can_addr;215 } can_addr;
179};216};
lib/libc/include/any-linux-any/linux/can/bcm.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*2/*
3 * linux/can/bcm.h3 * linux/can/bcm.h
4 *4 *
lib/libc/include/any-linux-any/linux/can/error.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*2/*
3 * linux/can/error.h3 * linux/can/error.h
4 *4 *
lib/libc/include/any-linux-any/linux/can/gw.h+16-3
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*2/*
3 * linux/can/gw.h3 * linux/can/gw.h
4 *4 *
...@@ -80,6 +80,10 @@ enum {...@@ -80,6 +80,10 @@ enum {
80 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */80 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
81 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */81 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
82 CGW_MOD_UID, /* user defined identifier for modification updates */82 CGW_MOD_UID, /* user defined identifier for modification updates */
83 CGW_FDMOD_AND, /* CAN FD frame modification binary AND */
84 CGW_FDMOD_OR, /* CAN FD frame modification binary OR */
85 CGW_FDMOD_XOR, /* CAN FD frame modification binary XOR */
86 CGW_FDMOD_SET, /* CAN FD frame modification set alternate values */
83 __CGW_MAX87 __CGW_MAX
84};88};
8589
...@@ -88,15 +92,18 @@ enum {...@@ -88,15 +92,18 @@ enum {
88#define CGW_FLAGS_CAN_ECHO 0x0192#define CGW_FLAGS_CAN_ECHO 0x01
89#define CGW_FLAGS_CAN_SRC_TSTAMP 0x0293#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
90#define CGW_FLAGS_CAN_IIF_TX_OK 0x0494#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
95#define CGW_FLAGS_CAN_FD 0x08
9196
92#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */97#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
9398
94/* CAN frame elements that are affected by curr. 3 CAN frame modifications */99/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
95#define CGW_MOD_ID 0x01100#define CGW_MOD_ID 0x01
96#define CGW_MOD_DLC 0x02101#define CGW_MOD_DLC 0x02 /* Classical CAN data length code */
102#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD (plain) data length */
97#define CGW_MOD_DATA 0x04103#define CGW_MOD_DATA 0x04
104#define CGW_MOD_FLAGS 0x08 /* CAN FD flags */
98105
99#define CGW_FRAME_MODS 3 /* ID DLC DATA */106#define CGW_FRAME_MODS 4 /* ID DLC/LEN DATA FLAGS */
100107
101#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)108#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
102109
...@@ -105,7 +112,13 @@ struct cgw_frame_mod {...@@ -105,7 +112,13 @@ struct cgw_frame_mod {
105 __u8 modtype;112 __u8 modtype;
106} __attribute__((packed));113} __attribute__((packed));
107114
115struct cgw_fdframe_mod {
116 struct canfd_frame cf;
117 __u8 modtype;
118} __attribute__((packed));
119
108#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)120#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
121#define CGW_FDMODATTR_LEN sizeof(struct cgw_fdframe_mod)
109122
110struct cgw_csum_xor {123struct cgw_csum_xor {
111 __s8 from_idx;124 __s8 from_idx;
lib/libc/include/any-linux-any/linux/can/isotp.h created+165
...@@ -0,0 +1,165 @@
1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * linux/can/isotp.h
4 *
5 * Definitions for isotp CAN sockets (ISO 15765-2:2016)
6 *
7 * Copyright (c) 2020 Volkswagen Group Electronic Research
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of Volkswagen nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * Alternatively, provided that this notice is retained in full, this
23 * software may be distributed under the terms of the GNU General
24 * Public License ("GPL") version 2, in which case the provisions of the
25 * GPL apply INSTEAD OF those given above.
26 *
27 * The provided data structures and external interfaces from this code
28 * are not restricted to be used by modules with a GPL compatible license.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
41 * DAMAGE.
42 */
43
44#ifndef _CAN_ISOTP_H
45#define _CAN_ISOTP_H
46
47#include <linux/types.h>
48#include <linux/can.h>
49
50#define SOL_CAN_ISOTP (SOL_CAN_BASE + CAN_ISOTP)
51
52/* for socket options affecting the socket (not the global system) */
53
54#define CAN_ISOTP_OPTS 1 /* pass struct can_isotp_options */
55
56#define CAN_ISOTP_RECV_FC 2 /* pass struct can_isotp_fc_options */
57
58/* sockopts to force stmin timer values for protocol regression tests */
59
60#define CAN_ISOTP_TX_STMIN 3 /* pass __u32 value in nano secs */
61 /* use this time instead of value */
62 /* provided in FC from the receiver */
63
64#define CAN_ISOTP_RX_STMIN 4 /* pass __u32 value in nano secs */
65 /* ignore received CF frames which */
66 /* timestamps differ less than val */
67
68#define CAN_ISOTP_LL_OPTS 5 /* pass struct can_isotp_ll_options */
69
70struct can_isotp_options {
71
72 __u32 flags; /* set flags for isotp behaviour. */
73 /* __u32 value : flags see below */
74
75 __u32 frame_txtime; /* frame transmission time (N_As/N_Ar) */
76 /* __u32 value : time in nano secs */
77
78 __u8 ext_address; /* set address for extended addressing */
79 /* __u8 value : extended address */
80
81 __u8 txpad_content; /* set content of padding byte (tx) */
82 /* __u8 value : content on tx path */
83
84 __u8 rxpad_content; /* set content of padding byte (rx) */
85 /* __u8 value : content on rx path */
86
87 __u8 rx_ext_address; /* set address for extended addressing */
88 /* __u8 value : extended address (rx) */
89};
90
91struct can_isotp_fc_options {
92
93 __u8 bs; /* blocksize provided in FC frame */
94 /* __u8 value : blocksize. 0 = off */
95
96 __u8 stmin; /* separation time provided in FC frame */
97 /* __u8 value : */
98 /* 0x00 - 0x7F : 0 - 127 ms */
99 /* 0x80 - 0xF0 : reserved */
100 /* 0xF1 - 0xF9 : 100 us - 900 us */
101 /* 0xFA - 0xFF : reserved */
102
103 __u8 wftmax; /* max. number of wait frame transmiss. */
104 /* __u8 value : 0 = omit FC N_PDU WT */
105};
106
107struct can_isotp_ll_options {
108
109 __u8 mtu; /* generated & accepted CAN frame type */
110 /* __u8 value : */
111 /* CAN_MTU (16) -> standard CAN 2.0 */
112 /* CANFD_MTU (72) -> CAN FD frame */
113
114 __u8 tx_dl; /* tx link layer data length in bytes */
115 /* (configured maximum payload length) */
116 /* __u8 value : 8,12,16,20,24,32,48,64 */
117 /* => rx path supports all LL_DL values */
118
119 __u8 tx_flags; /* set into struct canfd_frame.flags */
120 /* at frame creation: e.g. CANFD_BRS */
121 /* Obsolete when the BRS flag is fixed */
122 /* by the CAN netdriver configuration */
123};
124
125/* flags for isotp behaviour */
126
127#define CAN_ISOTP_LISTEN_MODE 0x001 /* listen only (do not send FC) */
128#define CAN_ISOTP_EXTEND_ADDR 0x002 /* enable extended addressing */
129#define CAN_ISOTP_TX_PADDING 0x004 /* enable CAN frame padding tx path */
130#define CAN_ISOTP_RX_PADDING 0x008 /* enable CAN frame padding rx path */
131#define CAN_ISOTP_CHK_PAD_LEN 0x010 /* check received CAN frame padding */
132#define CAN_ISOTP_CHK_PAD_DATA 0x020 /* check received CAN frame padding */
133#define CAN_ISOTP_HALF_DUPLEX 0x040 /* half duplex error state handling */
134#define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */
135#define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */
136#define CAN_ISOTP_RX_EXT_ADDR 0x200 /* different rx extended addressing */
137#define CAN_ISOTP_WAIT_TX_DONE 0x400 /* wait for tx completion */
138#define CAN_ISOTP_SF_BROADCAST 0x800 /* 1-to-N functional addressing */
139
140/* default values */
141
142#define CAN_ISOTP_DEFAULT_FLAGS 0
143#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00
144#define CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */
145#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0
146#define CAN_ISOTP_DEFAULT_RECV_BS 0
147#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00
148#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0
149
150#define CAN_ISOTP_DEFAULT_LL_MTU CAN_MTU
151#define CAN_ISOTP_DEFAULT_LL_TX_DL CAN_MAX_DLEN
152#define CAN_ISOTP_DEFAULT_LL_TX_FLAGS 0
153
154/*
155 * Remark on CAN_ISOTP_DEFAULT_RECV_* values:
156 *
157 * We can strongly assume, that the Linux Kernel implementation of
158 * CAN_ISOTP is capable to run with BS=0, STmin=0 and WFTmax=0.
159 * But as we like to be able to behave as a commonly available ECU,
160 * these default settings can be changed via sockopts.
161 * For that reason the STmin value is intentionally _not_ checked for
162 * consistency and copied directly into the flow control (FC) frame.
163 */
164
165#endif /* !_UAPI_CAN_ISOTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can/j1939.h created+108
...@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * j1939.h
4 *
5 * Copyright (c) 2010-2011 EIA Electronics
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _CAN_J1939_H_
13#define _CAN_J1939_H_
14
15#include <linux/types.h>
16#include <linux/socket.h>
17#include <linux/can.h>
18
19#define J1939_MAX_UNICAST_ADDR 0xfd
20#define J1939_IDLE_ADDR 0xfe
21#define J1939_NO_ADDR 0xff /* == broadcast or no addr */
22#define J1939_NO_NAME 0
23#define J1939_PGN_REQUEST 0x0ea00 /* Request PG */
24#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00 /* Address Claimed */
25#define J1939_PGN_ADDRESS_COMMANDED 0x0fed8 /* Commanded Address */
26#define J1939_PGN_PDU1_MAX 0x3ff00
27#define J1939_PGN_MAX 0x3ffff
28#define J1939_NO_PGN 0x40000
29
30/* J1939 Parameter Group Number
31 *
32 * bit 0-7 : PDU Specific (PS)
33 * bit 8-15 : PDU Format (PF)
34 * bit 16 : Data Page (DP)
35 * bit 17 : Reserved (R)
36 * bit 19-31 : set to zero
37 */
38typedef __u32 pgn_t;
39
40/* J1939 Priority
41 *
42 * bit 0-2 : Priority (P)
43 * bit 3-7 : set to zero
44 */
45typedef __u8 priority_t;
46
47/* J1939 NAME
48 *
49 * bit 0-20 : Identity Number
50 * bit 21-31 : Manufacturer Code
51 * bit 32-34 : ECU Instance
52 * bit 35-39 : Function Instance
53 * bit 40-47 : Function
54 * bit 48 : Reserved
55 * bit 49-55 : Vehicle System
56 * bit 56-59 : Vehicle System Instance
57 * bit 60-62 : Industry Group
58 * bit 63 : Arbitrary Address Capable
59 */
60typedef __u64 name_t;
61
62/* J1939 socket options */
63#define SOL_CAN_J1939 (SOL_CAN_BASE + CAN_J1939)
64enum {
65 SO_J1939_FILTER = 1, /* set filters */
66 SO_J1939_PROMISC = 2, /* set/clr promiscuous mode */
67 SO_J1939_SEND_PRIO = 3,
68 SO_J1939_ERRQUEUE = 4,
69};
70
71enum {
72 SCM_J1939_DEST_ADDR = 1,
73 SCM_J1939_DEST_NAME = 2,
74 SCM_J1939_PRIO = 3,
75 SCM_J1939_ERRQUEUE = 4,
76};
77
78enum {
79 J1939_NLA_PAD,
80 J1939_NLA_BYTES_ACKED,
81 J1939_NLA_TOTAL_SIZE,
82 J1939_NLA_PGN,
83 J1939_NLA_SRC_NAME,
84 J1939_NLA_DEST_NAME,
85 J1939_NLA_SRC_ADDR,
86 J1939_NLA_DEST_ADDR,
87};
88
89enum {
90 J1939_EE_INFO_NONE,
91 J1939_EE_INFO_TX_ABORT,
92 J1939_EE_INFO_RX_RTS,
93 J1939_EE_INFO_RX_DPO,
94 J1939_EE_INFO_RX_ABORT,
95};
96
97struct j1939_filter {
98 name_t name;
99 name_t name_mask;
100 pgn_t pgn;
101 pgn_t pgn_mask;
102 __u8 addr;
103 __u8 addr_mask;
104};
105
106#define J1939_FILTER_MAX 512 /* maximum number of j1939_filter set via setsockopt() */
107
108#endif /* !_UAPI_CAN_J1939_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can/netlink.h+34-6
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*2/*
3 * linux/can/netlink.h3 * linux/can/netlink.h
4 *4 *
...@@ -40,15 +40,15 @@ struct can_bittiming {...@@ -40,15 +40,15 @@ struct can_bittiming {
40};40};
4141
42/*42/*
43 * CAN harware-dependent bit-timing constant43 * CAN hardware-dependent bit-timing constant
44 *44 *
45 * Used for calculating and checking bit-timing parameters45 * Used for calculating and checking bit-timing parameters
46 */46 */
47struct can_bittiming_const {47struct can_bittiming_const {
48 char name[16]; /* Name of the CAN controller hardware */48 char name[16]; /* Name of the CAN controller hardware */
49 __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */49 __u32 tseg1_min; /* Time segment 1 = prop_seg + phase_seg1 */
50 __u32 tseg1_max;50 __u32 tseg1_max;
51 __u32 tseg2_min; /* Time segement 2 = phase_seg2 */51 __u32 tseg2_min; /* Time segment 2 = phase_seg2 */
52 __u32 tseg2_max;52 __u32 tseg2_max;
53 __u32 sjw_max; /* Synchronisation jump width */53 __u32 sjw_max; /* Synchronisation jump width */
54 __u32 brp_min; /* Bit-rate prescaler */54 __u32 brp_min; /* Bit-rate prescaler */
...@@ -100,6 +100,9 @@ struct can_ctrlmode {...@@ -100,6 +100,9 @@ struct can_ctrlmode {
100#define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */100#define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */
101#define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */101#define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */
102#define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */102#define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */
103#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 */
103106
104/*107/*
105 * CAN device statistics108 * CAN device statistics
...@@ -133,10 +136,35 @@ enum {...@@ -133,10 +136,35 @@ enum {
133 IFLA_CAN_BITRATE_CONST,136 IFLA_CAN_BITRATE_CONST,
134 IFLA_CAN_DATA_BITRATE_CONST,137 IFLA_CAN_DATA_BITRATE_CONST,
135 IFLA_CAN_BITRATE_MAX,138 IFLA_CAN_BITRATE_MAX,
136 __IFLA_CAN_MAX139 IFLA_CAN_TDC,
140
141 /* add new constants above here */
142 __IFLA_CAN_MAX,
143 IFLA_CAN_MAX = __IFLA_CAN_MAX - 1
137};144};
138145
139#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)146/*
147 * CAN FD Transmitter Delay Compensation (TDC)
148 *
149 * Please refer to struct can_tdc_const and can_tdc in
150 * include/linux/can/bittiming.h for further details.
151 */
152enum {
153 IFLA_CAN_TDC_UNSPEC,
154 IFLA_CAN_TDC_TDCV_MIN, /* u32 */
155 IFLA_CAN_TDC_TDCV_MAX, /* u32 */
156 IFLA_CAN_TDC_TDCO_MIN, /* u32 */
157 IFLA_CAN_TDC_TDCO_MAX, /* u32 */
158 IFLA_CAN_TDC_TDCF_MIN, /* u32 */
159 IFLA_CAN_TDC_TDCF_MAX, /* u32 */
160 IFLA_CAN_TDC_TDCV, /* u32 */
161 IFLA_CAN_TDC_TDCO, /* u32 */
162 IFLA_CAN_TDC_TDCF, /* u32 */
163
164 /* add new constants above here */
165 __IFLA_CAN_TDC,
166 IFLA_CAN_TDC_MAX = __IFLA_CAN_TDC - 1
167};
140168
141/* u16 termination range: 1..65535 Ohms */169/* u16 termination range: 1..65535 Ohms */
142#define CAN_TERMINATION_DISABLED 0170#define CAN_TERMINATION_DISABLED 0
lib/libc/include/any-linux-any/linux/can/raw.h+4-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*2/*
3 * linux/can/raw.h3 * linux/can/raw.h
4 *4 *
...@@ -49,6 +49,9 @@...@@ -49,6 +49,9 @@
49#include <linux/can.h>49#include <linux/can.h>
5050
51#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)51#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
52enum {
53 SCM_CAN_RAW_ERRQUEUE = 1,
54};
5255
53/* for socket options affecting the socket (not the global system) */56/* for socket options affecting the socket (not the global system) */
5457
lib/libc/include/any-linux-any/linux/can/vxcan.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2#ifndef _CAN_VXCAN_H2#ifndef _CAN_VXCAN_H
3#define _CAN_VXCAN_H3#define _CAN_VXCAN_H
44
lib/libc/include/any-linux-any/linux/capability.h+52-2
...@@ -241,7 +241,6 @@ struct vfs_ns_cap_data {...@@ -241,7 +241,6 @@ struct vfs_ns_cap_data {
241/* Allow examination and configuration of disk quotas */241/* Allow examination and configuration of disk quotas */
242/* Allow setting the domainname */242/* Allow setting the domainname */
243/* Allow setting the hostname */243/* Allow setting the hostname */
244/* Allow calling bdflush() */
245/* Allow mount() and umount(), setting up new smb connection */244/* Allow mount() and umount(), setting up new smb connection */
246/* Allow some autofs root ioctls */245/* Allow some autofs root ioctls */
247/* Allow nfsservctl */246/* Allow nfsservctl */
...@@ -272,6 +271,7 @@ struct vfs_ns_cap_data {...@@ -272,6 +271,7 @@ struct vfs_ns_cap_data {
272 arbitrary SCSI commands */271 arbitrary SCSI commands */
273/* Allow setting encryption key on loopback filesystem */272/* Allow setting encryption key on loopback filesystem */
274/* Allow setting zone reclaim policy */273/* Allow setting zone reclaim policy */
274/* Allow everything under CAP_BPF and CAP_PERFMON for backward compatibility */
275275
276#define CAP_SYS_ADMIN 21276#define CAP_SYS_ADMIN 21
277277
...@@ -285,6 +285,8 @@ struct vfs_ns_cap_data {...@@ -285,6 +285,8 @@ struct vfs_ns_cap_data {
285 processes and setting the scheduling algorithm used by another285 processes and setting the scheduling algorithm used by another
286 process. */286 process. */
287/* Allow setting cpu affinity on other processes */287/* Allow setting cpu affinity on other processes */
288/* Allow setting realtime ioprio class */
289/* Allow setting ioprio class on other processes */
288290
289#define CAP_SYS_NICE 23291#define CAP_SYS_NICE 23
290292
...@@ -299,6 +301,7 @@ struct vfs_ns_cap_data {...@@ -299,6 +301,7 @@ struct vfs_ns_cap_data {
299/* Allow more than 64hz interrupts from the real-time clock */301/* Allow more than 64hz interrupts from the real-time clock */
300/* Override max number of consoles on console allocation */302/* Override max number of consoles on console allocation */
301/* Override max number of keymaps */303/* Override max number of keymaps */
304/* Control memory reclaim behavior */
302305
303#define CAP_SYS_RESOURCE 24306#define CAP_SYS_RESOURCE 24
304307
...@@ -329,6 +332,9 @@ struct vfs_ns_cap_data {...@@ -329,6 +332,9 @@ struct vfs_ns_cap_data {
329332
330#define CAP_AUDIT_CONTROL 30333#define CAP_AUDIT_CONTROL 30
331334
335/* Set or remove capabilities on files.
336 Map uid=0 into a child user namespace. */
337
332#define CAP_SETFCAP 31338#define CAP_SETFCAP 31
333339
334/* Override MAC access.340/* Override MAC access.
...@@ -364,8 +370,52 @@ struct vfs_ns_cap_data {...@@ -364,8 +370,52 @@ struct vfs_ns_cap_data {
364370
365#define CAP_AUDIT_READ 37371#define CAP_AUDIT_READ 37
366372
373/*
374 * Allow system performance and observability privileged operations
375 * using perf_events, i915_perf and other kernel subsystems
376 */
377
378#define CAP_PERFMON 38
379
380/*
381 * CAP_BPF allows the following BPF operations:
382 * - Creating all types of BPF maps
383 * - Advanced verifier features
384 * - Indirect variable access
385 * - Bounded loops
386 * - BPF to BPF function calls
387 * - Scalar precision tracking
388 * - Larger complexity limits
389 * - Dead code elimination
390 * - And potentially other features
391 * - Loading BPF Type Format (BTF) data
392 * - Retrieve xlated and JITed code of BPF programs
393 * - Use bpf_spin_lock() helper
394 *
395 * CAP_PERFMON relaxes the verifier checks further:
396 * - BPF progs can use of pointer-to-integer conversions
397 * - speculation attack hardening measures are bypassed
398 * - bpf_probe_read to read arbitrary kernel memory is allowed
399 * - bpf_trace_printk to print kernel memory is allowed
400 *
401 * CAP_SYS_ADMIN is required to use bpf_probe_write_user.
402 *
403 * CAP_SYS_ADMIN is required to iterate system wide loaded
404 * programs, maps, links, BTFs and convert their IDs to file descriptors.
405 *
406 * CAP_PERFMON and CAP_BPF are required to load tracing programs.
407 * CAP_NET_ADMIN and CAP_BPF are required to load networking programs.
408 */
409#define CAP_BPF 39
410
411
412/* Allow checkpoint/restore related operations */
413/* Allow PID selection during clone3() */
414/* Allow writing to ns_last_pid */
415
416#define CAP_CHECKPOINT_RESTORE 40
367417
368#define CAP_LAST_CAP CAP_AUDIT_READ418#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
369419
370#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)420#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
371421
lib/libc/include/any-linux-any/linux/ccs.h created+18
...@@ -0,0 +1,18 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/* Copyright (C) 2020 Intel Corporation */
3
4#ifndef __UAPI_CCS_H__
5#define __UAPI_CCS_H__
6
7#include <linux/v4l2-controls.h>
8
9#define V4L2_CID_CCS_ANALOGUE_GAIN_M0 (V4L2_CID_USER_CCS_BASE + 1)
10#define V4L2_CID_CCS_ANALOGUE_GAIN_C0 (V4L2_CID_USER_CCS_BASE + 2)
11#define V4L2_CID_CCS_ANALOGUE_GAIN_M1 (V4L2_CID_USER_CCS_BASE + 3)
12#define V4L2_CID_CCS_ANALOGUE_GAIN_C1 (V4L2_CID_USER_CCS_BASE + 4)
13#define V4L2_CID_CCS_ANALOGUE_LINEAR_GAIN (V4L2_CID_USER_CCS_BASE + 5)
14#define V4L2_CID_CCS_ANALOGUE_EXPONENTIAL_GAIN (V4L2_CID_USER_CCS_BASE + 6)
15#define V4L2_CID_CCS_SHADING_CORRECTION (V4L2_CID_USER_CCS_BASE + 8)
16#define V4L2_CID_CCS_LUMINANCE_CORRECTION_LEVEL (V4L2_CID_USER_CCS_BASE + 9)
17
18#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cdrom.h+24-2
...@@ -147,6 +147,8 @@...@@ -147,6 +147,8 @@
147#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */147#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
148#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */148#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
149149
150#define CDROM_TIMED_MEDIA_CHANGE 0x5396 /* get the timestamp of the last media change */
151
150/*******************************************************152/*******************************************************
151 * CDROM IOCTL structures153 * CDROM IOCTL structures
152 *******************************************************/154 *******************************************************/
...@@ -289,8 +291,28 @@ struct cdrom_generic_command...@@ -289,8 +291,28 @@ struct cdrom_generic_command
289 unsigned char data_direction;291 unsigned char data_direction;
290 int quiet;292 int quiet;
291 int timeout;293 int timeout;
292 void *reserved[1]; /* unused, actually */294 union {
293};295 void *reserved[1]; /* unused, actually */
296 void *unused;
297 };
298};
299
300/* This struct is used by CDROM_TIMED_MEDIA_CHANGE */
301struct cdrom_timed_media_change_info {
302 __s64 last_media_change; /* Timestamp of the last detected media
303 * change in ms. May be set by caller,
304 * updated upon successful return of
305 * ioctl.
306 */
307 __u64 media_flags; /* Flags returned by ioctl to indicate
308 * media status.
309 */
310};
311#define MEDIA_CHANGED_FLAG 0x1 /* Last detected media change was more
312 * recent than last_media_change set by
313 * caller.
314 */
315/* other bits of media_flags available for future use */
294316
295/*317/*
296 * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 318 * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
lib/libc/include/any-linux-any/linux/cec-funcs.h+19-17
...@@ -923,7 +923,8 @@ static __inline__ void cec_msg_give_deck_status(struct cec_msg *msg,...@@ -923,7 +923,8 @@ static __inline__ void cec_msg_give_deck_status(struct cec_msg *msg,
923 msg->len = 3;923 msg->len = 3;
924 msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS;924 msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS;
925 msg->msg[2] = status_req;925 msg->msg[2] = status_req;
926 msg->reply = reply ? CEC_MSG_DECK_STATUS : 0;926 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ?
927 CEC_MSG_DECK_STATUS : 0;
927}928}
928929
929static __inline__ void cec_ops_give_deck_status(const struct cec_msg *msg,930static __inline__ void cec_ops_give_deck_status(const struct cec_msg *msg,
...@@ -1027,7 +1028,8 @@ static __inline__ void cec_msg_give_tuner_device_status(struct cec_msg *msg,...@@ -1027,7 +1028,8 @@ static __inline__ void cec_msg_give_tuner_device_status(struct cec_msg *msg,
1027 msg->len = 3;1028 msg->len = 3;
1028 msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS;1029 msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS;
1029 msg->msg[2] = status_req;1030 msg->msg[2] = status_req;
1030 msg->reply = reply ? CEC_MSG_TUNER_DEVICE_STATUS : 0;1031 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ?
1032 CEC_MSG_TUNER_DEVICE_STATUS : 0;
1031}1033}
10321034
1033static __inline__ void cec_ops_give_tuner_device_status(const struct cec_msg *msg,1035static __inline__ void cec_ops_give_tuner_device_status(const struct cec_msg *msg,
...@@ -1302,17 +1304,17 @@ static __inline__ void cec_msg_user_control_pressed(struct cec_msg *msg,...@@ -1302,17 +1304,17 @@ static __inline__ void cec_msg_user_control_pressed(struct cec_msg *msg,
1302 if (!ui_cmd->has_opt_arg)1304 if (!ui_cmd->has_opt_arg)
1303 return;1305 return;
1304 switch (ui_cmd->ui_cmd) {1306 switch (ui_cmd->ui_cmd) {
1305 case 0x56:1307 case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
1306 case 0x57:1308 case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
1307 case 0x60:1309 case CEC_OP_UI_CMD_PLAY_FUNCTION:
1308 case 0x68:1310 case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
1309 case 0x69:1311 case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
1310 case 0x6a:1312 case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
1311 /* The optional operand is one byte for all these ui commands */1313 /* The optional operand is one byte for all these ui commands */
1312 msg->len++;1314 msg->len++;
1313 msg->msg[3] = ui_cmd->play_mode;1315 msg->msg[3] = ui_cmd->play_mode;
1314 break;1316 break;
1315 case 0x67:1317 case CEC_OP_UI_CMD_TUNE_FUNCTION:
1316 msg->len += 4;1318 msg->len += 4;
1317 msg->msg[3] = (ui_cmd->channel_identifier.channel_number_fmt << 2) |1319 msg->msg[3] = (ui_cmd->channel_identifier.channel_number_fmt << 2) |
1318 (ui_cmd->channel_identifier.major >> 8);1320 (ui_cmd->channel_identifier.major >> 8);
...@@ -1331,17 +1333,17 @@ static __inline__ void cec_ops_user_control_pressed(const struct cec_msg *msg,...@@ -1331,17 +1333,17 @@ static __inline__ void cec_ops_user_control_pressed(const struct cec_msg *msg,
1331 if (msg->len == 3)1333 if (msg->len == 3)
1332 return;1334 return;
1333 switch (ui_cmd->ui_cmd) {1335 switch (ui_cmd->ui_cmd) {
1334 case 0x56:1336 case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
1335 case 0x57:1337 case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
1336 case 0x60:1338 case CEC_OP_UI_CMD_PLAY_FUNCTION:
1337 case 0x68:1339 case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
1338 case 0x69:1340 case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
1339 case 0x6a:1341 case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
1340 /* The optional operand is one byte for all these ui commands */1342 /* The optional operand is one byte for all these ui commands */
1341 ui_cmd->play_mode = msg->msg[3];1343 ui_cmd->play_mode = msg->msg[3];
1342 ui_cmd->has_opt_arg = 1;1344 ui_cmd->has_opt_arg = 1;
1343 break;1345 break;
1344 case 0x67:1346 case CEC_OP_UI_CMD_TUNE_FUNCTION:
1345 if (msg->len < 7)1347 if (msg->len < 7)
1346 break;1348 break;
1347 ui_cmd->has_opt_arg = 1;1349 ui_cmd->has_opt_arg = 1;
...@@ -1663,7 +1665,7 @@ static __inline__ void cec_ops_report_current_latency(const struct cec_msg *msg,...@@ -1663,7 +1665,7 @@ static __inline__ void cec_ops_report_current_latency(const struct cec_msg *msg,
1663 if (*audio_out_compensated == 3 && msg->len >= 7)1665 if (*audio_out_compensated == 3 && msg->len >= 7)
1664 *audio_out_delay = msg->msg[6];1666 *audio_out_delay = msg->msg[6];
1665 else1667 else
1666 *audio_out_delay = 0;1668 *audio_out_delay = 1;
1667}1669}
16681670
1669static __inline__ void cec_msg_request_current_latency(struct cec_msg *msg,1671static __inline__ void cec_msg_request_current_latency(struct cec_msg *msg,
lib/libc/include/any-linux-any/linux/cec.h+135-4
...@@ -144,6 +144,7 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,...@@ -144,6 +144,7 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
144144
145/* cec_msg flags field */145/* cec_msg flags field */
146#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)146#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
147#define CEC_MSG_FL_RAW (1 << 1)
147148
148/* cec_msg tx/rx_status field */149/* cec_msg tx/rx_status field */
149#define CEC_TX_STATUS_OK (1 << 0)150#define CEC_TX_STATUS_OK (1 << 0)
...@@ -316,6 +317,8 @@ static __inline__ int cec_is_unconfigured(__u16 log_addr_mask)...@@ -316,6 +317,8 @@ static __inline__ int cec_is_unconfigured(__u16 log_addr_mask)
316#define CEC_CAP_NEEDS_HPD (1 << 6)317#define CEC_CAP_NEEDS_HPD (1 << 6)
317/* Hardware can monitor CEC pin transitions */318/* Hardware can monitor CEC pin transitions */
318#define CEC_CAP_MONITOR_PIN (1 << 7)319#define CEC_CAP_MONITOR_PIN (1 << 7)
320/* CEC_ADAP_G_CONNECTOR_INFO is available */
321#define CEC_CAP_CONNECTOR_INFO (1 << 8)
319322
320/**323/**
321 * struct cec_caps - CEC capabilities structure.324 * struct cec_caps - CEC capabilities structure.
...@@ -374,6 +377,35 @@ struct cec_log_addrs {...@@ -374,6 +377,35 @@ struct cec_log_addrs {
374/* CDC-Only device: supports only CDC messages */377/* CDC-Only device: supports only CDC messages */
375#define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)378#define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)
376379
380/**
381 * struct cec_drm_connector_info - tells which drm connector is
382 * associated with the CEC adapter.
383 * @card_no: drm card number
384 * @connector_id: drm connector ID
385 */
386struct cec_drm_connector_info {
387 __u32 card_no;
388 __u32 connector_id;
389};
390
391#define CEC_CONNECTOR_TYPE_NO_CONNECTOR 0
392#define CEC_CONNECTOR_TYPE_DRM 1
393
394/**
395 * struct cec_connector_info - tells if and which connector is
396 * associated with the CEC adapter.
397 * @type: connector type (if any)
398 * @drm: drm connector info
399 * @raw: array to pad the union
400 */
401struct cec_connector_info {
402 __u32 type;
403 union {
404 struct cec_drm_connector_info drm;
405 __u32 raw[16];
406 };
407};
408
377/* Events */409/* Events */
378410
379/* Event that occurs when the adapter state changes */411/* Event that occurs when the adapter state changes */
...@@ -397,10 +429,17 @@ struct cec_log_addrs {...@@ -397,10 +429,17 @@ struct cec_log_addrs {
397 * struct cec_event_state_change - used when the CEC adapter changes state.429 * struct cec_event_state_change - used when the CEC adapter changes state.
398 * @phys_addr: the current physical address430 * @phys_addr: the current physical address
399 * @log_addr_mask: the current logical address mask431 * @log_addr_mask: the current logical address mask
432 * @have_conn_info: if non-zero, then HDMI connector information is available.
433 * This field is only valid if CEC_CAP_CONNECTOR_INFO is set. If that
434 * capability is set and @have_conn_info is zero, then that indicates
435 * that the HDMI connector device is not instantiated, either because
436 * the HDMI driver is still configuring the device or because the HDMI
437 * device was unbound.
400 */438 */
401struct cec_event_state_change {439struct cec_event_state_change {
402 __u16 phys_addr;440 __u16 phys_addr;
403 __u16 log_addr_mask;441 __u16 log_addr_mask;
442 __u16 have_conn_info;
404};443};
405444
406/**445/**
...@@ -415,7 +454,7 @@ struct cec_event_lost_msgs {...@@ -415,7 +454,7 @@ struct cec_event_lost_msgs {
415 * struct cec_event - CEC event structure454 * struct cec_event - CEC event structure
416 * @ts: the timestamp of when the event was sent.455 * @ts: the timestamp of when the event was sent.
417 * @event: the event.456 * @event: the event.
418 * array.457 * @flags: event flags.
419 * @state_change: the event payload for CEC_EVENT_STATE_CHANGE.458 * @state_change: the event payload for CEC_EVENT_STATE_CHANGE.
420 * @lost_msgs: the event payload for CEC_EVENT_LOST_MSGS.459 * @lost_msgs: the event payload for CEC_EVENT_LOST_MSGS.
421 * @raw: array to pad the union.460 * @raw: array to pad the union.
...@@ -475,6 +514,9 @@ struct cec_event {...@@ -475,6 +514,9 @@ struct cec_event {
475#define CEC_G_MODE _IOR('a', 8, __u32)514#define CEC_G_MODE _IOR('a', 8, __u32)
476#define CEC_S_MODE _IOW('a', 9, __u32)515#define CEC_S_MODE _IOW('a', 9, __u32)
477516
517/* Get the connector info */
518#define CEC_ADAP_G_CONNECTOR_INFO _IOR('a', 10, struct cec_connector_info)
519
478/*520/*
479 * The remainder of this header defines all CEC messages and operands.521 * The remainder of this header defines all CEC messages and operands.
480 * The format matters since it the cec-ctl utility parses it to generate522 * The format matters since it the cec-ctl utility parses it to generate
...@@ -600,7 +642,7 @@ struct cec_event {...@@ -600,7 +642,7 @@ struct cec_event {
600#define CEC_OP_REC_SEQ_WEDNESDAY 0x08642#define CEC_OP_REC_SEQ_WEDNESDAY 0x08
601#define CEC_OP_REC_SEQ_THURSDAY 0x10643#define CEC_OP_REC_SEQ_THURSDAY 0x10
602#define CEC_OP_REC_SEQ_FRIDAY 0x20644#define CEC_OP_REC_SEQ_FRIDAY 0x20
603#define CEC_OP_REC_SEQ_SATERDAY 0x40645#define CEC_OP_REC_SEQ_SATURDAY 0x40
604#define CEC_OP_REC_SEQ_ONCE_ONLY 0x00646#define CEC_OP_REC_SEQ_ONCE_ONLY 0x00
605647
606#define CEC_MSG_CLEAR_DIGITAL_TIMER 0x99648#define CEC_MSG_CLEAR_DIGITAL_TIMER 0x99
...@@ -767,8 +809,8 @@ struct cec_event {...@@ -767,8 +809,8 @@ struct cec_event {
767#define CEC_MSG_SELECT_DIGITAL_SERVICE 0x93809#define CEC_MSG_SELECT_DIGITAL_SERVICE 0x93
768#define CEC_MSG_TUNER_DEVICE_STATUS 0x07810#define CEC_MSG_TUNER_DEVICE_STATUS 0x07
769/* Recording Flag Operand (rec_flag) */811/* Recording Flag Operand (rec_flag) */
770#define CEC_OP_REC_FLAG_USED 0812#define CEC_OP_REC_FLAG_NOT_USED 0
771#define CEC_OP_REC_FLAG_NOT_USED 1813#define CEC_OP_REC_FLAG_USED 1
772/* Tuner Display Info Operand (tuner_display_info) */814/* Tuner Display Info Operand (tuner_display_info) */
773#define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL 0815#define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL 0
774#define CEC_OP_TUNER_DISPLAY_INFO_NONE 1816#define CEC_OP_TUNER_DISPLAY_INFO_NONE 1
...@@ -819,6 +861,95 @@ struct cec_event {...@@ -819,6 +861,95 @@ struct cec_event {
819#define CEC_OP_MENU_STATE_DEACTIVATED 0x01861#define CEC_OP_MENU_STATE_DEACTIVATED 0x01
820862
821#define CEC_MSG_USER_CONTROL_PRESSED 0x44863#define CEC_MSG_USER_CONTROL_PRESSED 0x44
864/* UI Command Operand (ui_cmd) */
865#define CEC_OP_UI_CMD_SELECT 0x00
866#define CEC_OP_UI_CMD_UP 0x01
867#define CEC_OP_UI_CMD_DOWN 0x02
868#define CEC_OP_UI_CMD_LEFT 0x03
869#define CEC_OP_UI_CMD_RIGHT 0x04
870#define CEC_OP_UI_CMD_RIGHT_UP 0x05
871#define CEC_OP_UI_CMD_RIGHT_DOWN 0x06
872#define CEC_OP_UI_CMD_LEFT_UP 0x07
873#define CEC_OP_UI_CMD_LEFT_DOWN 0x08
874#define CEC_OP_UI_CMD_DEVICE_ROOT_MENU 0x09
875#define CEC_OP_UI_CMD_DEVICE_SETUP_MENU 0x0a
876#define CEC_OP_UI_CMD_CONTENTS_MENU 0x0b
877#define CEC_OP_UI_CMD_FAVORITE_MENU 0x0c
878#define CEC_OP_UI_CMD_BACK 0x0d
879#define CEC_OP_UI_CMD_MEDIA_TOP_MENU 0x10
880#define CEC_OP_UI_CMD_MEDIA_CONTEXT_SENSITIVE_MENU 0x11
881#define CEC_OP_UI_CMD_NUMBER_ENTRY_MODE 0x1d
882#define CEC_OP_UI_CMD_NUMBER_11 0x1e
883#define CEC_OP_UI_CMD_NUMBER_12 0x1f
884#define CEC_OP_UI_CMD_NUMBER_0_OR_NUMBER_10 0x20
885#define CEC_OP_UI_CMD_NUMBER_1 0x21
886#define CEC_OP_UI_CMD_NUMBER_2 0x22
887#define CEC_OP_UI_CMD_NUMBER_3 0x23
888#define CEC_OP_UI_CMD_NUMBER_4 0x24
889#define CEC_OP_UI_CMD_NUMBER_5 0x25
890#define CEC_OP_UI_CMD_NUMBER_6 0x26
891#define CEC_OP_UI_CMD_NUMBER_7 0x27
892#define CEC_OP_UI_CMD_NUMBER_8 0x28
893#define CEC_OP_UI_CMD_NUMBER_9 0x29
894#define CEC_OP_UI_CMD_DOT 0x2a
895#define CEC_OP_UI_CMD_ENTER 0x2b
896#define CEC_OP_UI_CMD_CLEAR 0x2c
897#define CEC_OP_UI_CMD_NEXT_FAVORITE 0x2f
898#define CEC_OP_UI_CMD_CHANNEL_UP 0x30
899#define CEC_OP_UI_CMD_CHANNEL_DOWN 0x31
900#define CEC_OP_UI_CMD_PREVIOUS_CHANNEL 0x32
901#define CEC_OP_UI_CMD_SOUND_SELECT 0x33
902#define CEC_OP_UI_CMD_INPUT_SELECT 0x34
903#define CEC_OP_UI_CMD_DISPLAY_INFORMATION 0x35
904#define CEC_OP_UI_CMD_HELP 0x36
905#define CEC_OP_UI_CMD_PAGE_UP 0x37
906#define CEC_OP_UI_CMD_PAGE_DOWN 0x38
907#define CEC_OP_UI_CMD_POWER 0x40
908#define CEC_OP_UI_CMD_VOLUME_UP 0x41
909#define CEC_OP_UI_CMD_VOLUME_DOWN 0x42
910#define CEC_OP_UI_CMD_MUTE 0x43
911#define CEC_OP_UI_CMD_PLAY 0x44
912#define CEC_OP_UI_CMD_STOP 0x45
913#define CEC_OP_UI_CMD_PAUSE 0x46
914#define CEC_OP_UI_CMD_RECORD 0x47
915#define CEC_OP_UI_CMD_REWIND 0x48
916#define CEC_OP_UI_CMD_FAST_FORWARD 0x49
917#define CEC_OP_UI_CMD_EJECT 0x4a
918#define CEC_OP_UI_CMD_SKIP_FORWARD 0x4b
919#define CEC_OP_UI_CMD_SKIP_BACKWARD 0x4c
920#define CEC_OP_UI_CMD_STOP_RECORD 0x4d
921#define CEC_OP_UI_CMD_PAUSE_RECORD 0x4e
922#define CEC_OP_UI_CMD_ANGLE 0x50
923#define CEC_OP_UI_CMD_SUB_PICTURE 0x51
924#define CEC_OP_UI_CMD_VIDEO_ON_DEMAND 0x52
925#define CEC_OP_UI_CMD_ELECTRONIC_PROGRAM_GUIDE 0x53
926#define CEC_OP_UI_CMD_TIMER_PROGRAMMING 0x54
927#define CEC_OP_UI_CMD_INITIAL_CONFIGURATION 0x55
928#define CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE 0x56
929#define CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION 0x57
930#define CEC_OP_UI_CMD_AUDIO_DESCRIPTION 0x58
931#define CEC_OP_UI_CMD_INTERNET 0x59
932#define CEC_OP_UI_CMD_3D_MODE 0x5a
933#define CEC_OP_UI_CMD_PLAY_FUNCTION 0x60
934#define CEC_OP_UI_CMD_PAUSE_PLAY_FUNCTION 0x61
935#define CEC_OP_UI_CMD_RECORD_FUNCTION 0x62
936#define CEC_OP_UI_CMD_PAUSE_RECORD_FUNCTION 0x63
937#define CEC_OP_UI_CMD_STOP_FUNCTION 0x64
938#define CEC_OP_UI_CMD_MUTE_FUNCTION 0x65
939#define CEC_OP_UI_CMD_RESTORE_VOLUME_FUNCTION 0x66
940#define CEC_OP_UI_CMD_TUNE_FUNCTION 0x67
941#define CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION 0x68
942#define CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION 0x69
943#define CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION 0x6a
944#define CEC_OP_UI_CMD_POWER_TOGGLE_FUNCTION 0x6b
945#define CEC_OP_UI_CMD_POWER_OFF_FUNCTION 0x6c
946#define CEC_OP_UI_CMD_POWER_ON_FUNCTION 0x6d
947#define CEC_OP_UI_CMD_F1_BLUE 0x71
948#define CEC_OP_UI_CMD_F2_RED 0x72
949#define CEC_OP_UI_CMD_F3_GREEN 0x73
950#define CEC_OP_UI_CMD_F4_YELLOW 0x74
951#define CEC_OP_UI_CMD_F5 0x75
952#define CEC_OP_UI_CMD_DATA 0x76
822/* UI Broadcast Type Operand (ui_bcast_type) */953/* UI Broadcast Type Operand (ui_bcast_type) */
823#define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL 0x00954#define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL 0x00
824#define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA 0x01955#define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA 0x01
lib/libc/include/any-linux-any/linux/cfm_bridge.h created+64
...@@ -0,0 +1,64 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2
3#ifndef _LINUX_CFM_BRIDGE_H_
4#define _LINUX_CFM_BRIDGE_H_
5
6#include <linux/types.h>
7#include <linux/if_ether.h>
8
9#define ETHER_HEADER_LENGTH (6+6+4+2)
10#define CFM_MAID_LENGTH 48
11#define CFM_CCM_PDU_LENGTH 75
12#define CFM_PORT_STATUS_TLV_LENGTH 4
13#define CFM_IF_STATUS_TLV_LENGTH 4
14#define CFM_IF_STATUS_TLV_TYPE 4
15#define CFM_PORT_STATUS_TLV_TYPE 2
16#define CFM_ENDE_TLV_TYPE 0
17#define CFM_CCM_MAX_FRAME_LENGTH (ETHER_HEADER_LENGTH+\
18 CFM_CCM_PDU_LENGTH+\
19 CFM_PORT_STATUS_TLV_LENGTH+\
20 CFM_IF_STATUS_TLV_LENGTH)
21#define CFM_FRAME_PRIO 7
22#define CFM_CCM_TLV_OFFSET 70
23#define CFM_CCM_PDU_MAID_OFFSET 10
24#define CFM_CCM_PDU_MEPID_OFFSET 8
25#define CFM_CCM_PDU_SEQNR_OFFSET 4
26#define CFM_CCM_PDU_TLV_OFFSET 74
27#define CFM_CCM_ITU_RESERVED_SIZE 16
28
29struct br_cfm_common_hdr {
30 __u8 mdlevel_version;
31 __u8 opcode;
32 __u8 flags;
33 __u8 tlv_offset;
34};
35
36enum br_cfm_opcodes {
37 BR_CFM_OPCODE_CCM = 0x1,
38};
39
40/* MEP domain */
41enum br_cfm_domain {
42 BR_CFM_PORT,
43 BR_CFM_VLAN,
44};
45
46/* MEP direction */
47enum br_cfm_mep_direction {
48 BR_CFM_MEP_DIRECTION_DOWN,
49 BR_CFM_MEP_DIRECTION_UP,
50};
51
52/* CCM interval supported. */
53enum br_cfm_ccm_interval {
54 BR_CFM_CCM_INTERVAL_NONE,
55 BR_CFM_CCM_INTERVAL_3_3_MS,
56 BR_CFM_CCM_INTERVAL_10_MS,
57 BR_CFM_CCM_INTERVAL_100_MS,
58 BR_CFM_CCM_INTERVAL_1_SEC,
59 BR_CFM_CCM_INTERVAL_10_SEC,
60 BR_CFM_CCM_INTERVAL_1_MIN,
61 BR_CFM_CCM_INTERVAL_10_MIN,
62};
63
64#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/chio.h+4-7
...@@ -3,6 +3,9 @@...@@ -3,6 +3,9 @@
3 * ioctl interface for the scsi media changer driver3 * ioctl interface for the scsi media changer driver
4 */4 */
55
6#ifndef _LINUX_CHIO_H
7#define _LINUX_CHIO_H
8
6/* changer element types */9/* changer element types */
7#define CHET_MT 0 /* media transport element (robot) */10#define CHET_MT 0 /* media transport element (robot) */
8#define CHET_ST 1 /* storage element (media slots) */11#define CHET_ST 1 /* storage element (media slots) */
...@@ -160,10 +163,4 @@ struct changer_set_voltag {...@@ -160,10 +163,4 @@ struct changer_set_voltag {
160#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)163#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
161#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)164#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
162165
163/* ---------------------------------------------------------------------- */
164
165/*
166 * Local variables:
167 * c-basic-offset: 8
168 * End:
169 */
\ No newline at end of file
166#endif /* _LINUX_CHIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cifs/cifs_mount.h-1
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
2/*2/*
3 * include/uapi/linux/cifs/cifs_mount.h
4 *3 *
5 * Author(s): Scott Lovenberg (scott.lovenberg@gmail.com)4 * Author(s): Scott Lovenberg (scott.lovenberg@gmail.com)
6 *5 *
lib/libc/include/any-linux-any/linux/cifs/cifs_netlink.h created+63
...@@ -0,0 +1,63 @@
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
2/*
3 * Netlink routines for CIFS
4 *
5 * Copyright (c) 2020 Samuel Cabrero <scabrero@suse.de>
6 */
7
8
9#ifndef LINUX_CIFS_NETLINK_H
10#define LINUX_CIFS_NETLINK_H
11
12#define CIFS_GENL_NAME "cifs"
13#define CIFS_GENL_VERSION 0x1
14
15#define CIFS_GENL_MCGRP_SWN_NAME "cifs_mcgrp_swn"
16
17enum cifs_genl_multicast_groups {
18 CIFS_GENL_MCGRP_SWN,
19};
20
21enum cifs_genl_attributes {
22 CIFS_GENL_ATTR_UNSPEC,
23 CIFS_GENL_ATTR_SWN_REGISTRATION_ID,
24 CIFS_GENL_ATTR_SWN_NET_NAME,
25 CIFS_GENL_ATTR_SWN_SHARE_NAME,
26 CIFS_GENL_ATTR_SWN_IP,
27 CIFS_GENL_ATTR_SWN_NET_NAME_NOTIFY,
28 CIFS_GENL_ATTR_SWN_SHARE_NAME_NOTIFY,
29 CIFS_GENL_ATTR_SWN_IP_NOTIFY,
30 CIFS_GENL_ATTR_SWN_KRB_AUTH,
31 CIFS_GENL_ATTR_SWN_USER_NAME,
32 CIFS_GENL_ATTR_SWN_PASSWORD,
33 CIFS_GENL_ATTR_SWN_DOMAIN_NAME,
34 CIFS_GENL_ATTR_SWN_NOTIFICATION_TYPE,
35 CIFS_GENL_ATTR_SWN_RESOURCE_STATE,
36 CIFS_GENL_ATTR_SWN_RESOURCE_NAME,
37 __CIFS_GENL_ATTR_MAX,
38};
39#define CIFS_GENL_ATTR_MAX (__CIFS_GENL_ATTR_MAX - 1)
40
41enum cifs_genl_commands {
42 CIFS_GENL_CMD_UNSPEC,
43 CIFS_GENL_CMD_SWN_REGISTER,
44 CIFS_GENL_CMD_SWN_UNREGISTER,
45 CIFS_GENL_CMD_SWN_NOTIFY,
46 __CIFS_GENL_CMD_MAX
47};
48#define CIFS_GENL_CMD_MAX (__CIFS_GENL_CMD_MAX - 1)
49
50enum cifs_swn_notification_type {
51 CIFS_SWN_NOTIFICATION_RESOURCE_CHANGE = 0x01,
52 CIFS_SWN_NOTIFICATION_CLIENT_MOVE = 0x02,
53 CIFS_SWN_NOTIFICATION_SHARE_MOVE = 0x03,
54 CIFS_SWN_NOTIFICATION_IP_CHANGE = 0x04,
55};
56
57enum cifs_swn_resource_state {
58 CIFS_SWN_RESOURCE_STATE_UNKNOWN = 0x00,
59 CIFS_SWN_RESOURCE_STATE_AVAILABLE = 0x01,
60 CIFS_SWN_RESOURCE_STATE_UNAVAILABLE = 0xFF
61};
62
63#endif /* LINUX_CIFS_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/close_range.h created+11
...@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_CLOSE_RANGE_H
3#define _LINUX_CLOSE_RANGE_H
4
5/* Unshare the file descriptor table before closing file descriptors. */
6#define CLOSE_RANGE_UNSHARE (1U << 1)
7
8/* Set the FD_CLOEXEC bit instead of closing the file descriptor. */
9#define CLOSE_RANGE_CLOEXEC (1U << 2)
10
11#endif /* _LINUX_CLOSE_RANGE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/coda.h+38-18
...@@ -86,10 +86,6 @@ typedef unsigned long long u_quad_t;...@@ -86,10 +86,6 @@ typedef unsigned long long u_quad_t;
8686
87#define __inline__87#define __inline__
8888
89struct timespec {
90 long ts_sec;
91 long ts_nsec;
92};
93#else /* DJGPP but not KERNEL */89#else /* DJGPP but not KERNEL */
94#include <sys/time.h>90#include <sys/time.h>
95typedef unsigned long long u_quad_t;91typedef unsigned long long u_quad_t;
...@@ -108,13 +104,6 @@ typedef unsigned long long u_quad_t;...@@ -108,13 +104,6 @@ typedef unsigned long long u_quad_t;
108#define cdev_t dev_t104#define cdev_t dev_t
109#endif105#endif
110106
111#ifdef __CYGWIN32__
112struct timespec {
113 time_t tv_sec; /* seconds */
114 long tv_nsec; /* nanoseconds */
115};
116#endif
117
118#ifndef __BIT_TYPES_DEFINED__107#ifndef __BIT_TYPES_DEFINED__
119#define __BIT_TYPES_DEFINED__108#define __BIT_TYPES_DEFINED__
120typedef signed char int8_t;109typedef signed char int8_t;
...@@ -209,6 +198,11 @@ struct CodaFid {...@@ -209,6 +198,11 @@ struct CodaFid {
209 */198 */
210enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };199enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
211200
201struct coda_timespec {
202 int64_t tv_sec; /* seconds */
203 long tv_nsec; /* nanoseconds */
204};
205
212struct coda_vattr {206struct coda_vattr {
213 long va_type; /* vnode type (for create) */207 long va_type; /* vnode type (for create) */
214 u_short va_mode; /* files access mode and type */208 u_short va_mode; /* files access mode and type */
...@@ -218,9 +212,9 @@ struct coda_vattr {...@@ -218,9 +212,9 @@ struct coda_vattr {
218 long va_fileid; /* file id */212 long va_fileid; /* file id */
219 u_quad_t va_size; /* file size in bytes */213 u_quad_t va_size; /* file size in bytes */
220 long va_blocksize; /* blocksize preferred for i/o */214 long va_blocksize; /* blocksize preferred for i/o */
221 struct timespec va_atime; /* time of last access */215 struct coda_timespec va_atime; /* time of last access */
222 struct timespec va_mtime; /* time of last modification */216 struct coda_timespec va_mtime; /* time of last modification */
223 struct timespec va_ctime; /* time file changed */217 struct coda_timespec va_ctime; /* time file changed */
224 u_long va_gen; /* generation number of file */218 u_long va_gen; /* generation number of file */
225 u_long va_flags; /* flags defined for file */219 u_long va_flags; /* flags defined for file */
226 cdev_t va_rdev; /* device special file represents */220 cdev_t va_rdev; /* device special file represents */
...@@ -275,7 +269,8 @@ struct coda_statfs {...@@ -275,7 +269,8 @@ struct coda_statfs {
275#define CODA_STATFS 34269#define CODA_STATFS 34
276#define CODA_STORE 35270#define CODA_STORE 35
277#define CODA_RELEASE 36271#define CODA_RELEASE 36
278#define CODA_NCALLS 37272#define CODA_ACCESS_INTENT 37
273#define CODA_NCALLS 38
279274
280#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)275#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
281276
...@@ -285,7 +280,12 @@ struct coda_statfs {...@@ -285,7 +280,12 @@ struct coda_statfs {
285280
286#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)281#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
287282
288#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */283// CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
284// CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
285// CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */
286// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
287// CODA_KERNEL_VERSION 4 /* 64-bit timespec */
288#define CODA_KERNEL_VERSION 5 /* access intent support */
289289
290/*290/*
291 * Venus <-> Coda RPC arguments291 * Venus <-> Coda RPC arguments
...@@ -293,8 +293,8 @@ struct coda_statfs {...@@ -293,8 +293,8 @@ struct coda_statfs {
293struct coda_in_hdr {293struct coda_in_hdr {
294 u_int32_t opcode;294 u_int32_t opcode;
295 u_int32_t unique; /* Keep multiple outstanding msgs distinct */295 u_int32_t unique; /* Keep multiple outstanding msgs distinct */
296 pid_t pid;296 __kernel_pid_t pid;
297 pid_t pgid;297 __kernel_pid_t pgid;
298 vuid_t uid;298 vuid_t uid;
299};299};
300300
...@@ -637,6 +637,25 @@ struct coda_statfs_out {...@@ -637,6 +637,25 @@ struct coda_statfs_out {
637 struct coda_statfs stat;637 struct coda_statfs stat;
638};638};
639639
640#define CODA_ACCESS_TYPE_READ 1
641#define CODA_ACCESS_TYPE_WRITE 2
642#define CODA_ACCESS_TYPE_MMAP 3
643#define CODA_ACCESS_TYPE_READ_FINISH 4
644#define CODA_ACCESS_TYPE_WRITE_FINISH 5
645
646/* coda_access_intent: NO_OUT */
647struct coda_access_intent_in {
648 struct coda_in_hdr ih;
649 struct CodaFid VFid;
650 int count;
651 int pos;
652 int type;
653};
654
655struct coda_access_intent_out {
656 struct coda_out_hdr out;
657};
658
640/* 659/*
641 * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 660 * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
642 * For instance, if the fid is inconsistent. 661 * For instance, if the fid is inconsistent.
...@@ -668,6 +687,7 @@ union inputArgs {...@@ -668,6 +687,7 @@ union inputArgs {
668 struct coda_open_by_fd_in coda_open_by_fd;687 struct coda_open_by_fd_in coda_open_by_fd;
669 struct coda_open_by_path_in coda_open_by_path;688 struct coda_open_by_path_in coda_open_by_path;
670 struct coda_statfs_in coda_statfs;689 struct coda_statfs_in coda_statfs;
690 struct coda_access_intent_in coda_access_intent;
671};691};
672692
673union outputArgs {693union outputArgs {
lib/libc/include/any-linux-any/linux/coda_psdev.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __CODA_PSDEV_H
3#define __CODA_PSDEV_H
4
5#include <linux/magic.h>
6
7#define CODA_PSDEV_MAJOR 67
8#define MAX_CODADEVS 5 /* how many do we allow */
9
10
11/* messages between coda filesystem in kernel and Venus */
12struct upc_req {
13 struct list_head uc_chain;
14 caddr_t uc_data;
15 u_short uc_flags;
16 u_short uc_inSize; /* Size is at most 5000 bytes */
17 u_short uc_outSize;
18 u_short uc_opcode; /* copied from data to save lookup */
19 int uc_unique;
20 wait_queue_head_t uc_sleep; /* process' wait queue */
21};
22
23#define CODA_REQ_ASYNC 0x1
24#define CODA_REQ_READ 0x2
25#define CODA_REQ_WRITE 0x4
26#define CODA_REQ_ABORT 0x8
27
28#endif /* __CODA_PSDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/coff.h+6-1
...@@ -11,6 +11,9 @@...@@ -11,6 +11,9 @@
11 more information about COFF, then O'Reilly has a very excellent book.11 more information about COFF, then O'Reilly has a very excellent book.
12*/12*/
1313
14#ifndef _LINUX_COFF_H
15#define _LINUX_COFF_H
16
14#define E_SYMNMLEN 8 /* Number of characters in a symbol name */17#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
15#define E_FILNMLEN 14 /* Number of characters in a file name */18#define E_FILNMLEN 14 /* Number of characters in a file name */
16#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */19#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */
...@@ -349,4 +352,6 @@ struct COFF_reloc {...@@ -349,4 +352,6 @@ struct COFF_reloc {
349#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4352#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4
350353
351/* For new sections we haven't heard of before */354/* For new sections we haven't heard of before */
352#define COFF_DEF_SECTION_ALIGNMENT 4
\ No newline at end of file
355#define COFF_DEF_SECTION_ALIGNMENT 4
356
357#endif /* _LINUX_COFF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/const.h+5
...@@ -28,4 +28,9 @@...@@ -28,4 +28,9 @@
28#define _BITUL(x) (_UL(1) << (x))28#define _BITUL(x) (_UL(1) << (x))
29#define _BITULL(x) (_ULL(1) << (x))29#define _BITULL(x) (_ULL(1) << (x))
3030
31#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
32#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
33
34#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
35
31#endif /* _LINUX_CONST_H */36#endif /* _LINUX_CONST_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/coresight-stm.h+5-2
...@@ -2,8 +2,11 @@...@@ -2,8 +2,11 @@
2#ifndef __UAPI_CORESIGHT_STM_H_2#ifndef __UAPI_CORESIGHT_STM_H_
3#define __UAPI_CORESIGHT_STM_H_3#define __UAPI_CORESIGHT_STM_H_
44
5#define STM_FLAG_TIMESTAMPED BIT(3)5#include <linux/const.h>
6#define STM_FLAG_GUARANTEED BIT(7)6
7#define STM_FLAG_TIMESTAMPED _BITUL(3)
8#define STM_FLAG_MARKED _BITUL(4)
9#define STM_FLAG_GUARANTEED _BITUL(7)
710
8/*11/*
9 * The CoreSight STM supports guaranteed and invariant timing12 * The CoreSight STM supports guaranteed and invariant timing
lib/libc/include/any-linux-any/linux/counter.h created+154
...@@ -0,0 +1,154 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Userspace ABI for Counter character devices
4 * Copyright (C) 2020 William Breathitt Gray
5 */
6#ifndef _COUNTER_H_
7#define _COUNTER_H_
8
9#include <linux/ioctl.h>
10#include <linux/types.h>
11
12/* Component type definitions */
13enum counter_component_type {
14 COUNTER_COMPONENT_NONE,
15 COUNTER_COMPONENT_SIGNAL,
16 COUNTER_COMPONENT_COUNT,
17 COUNTER_COMPONENT_FUNCTION,
18 COUNTER_COMPONENT_SYNAPSE_ACTION,
19 COUNTER_COMPONENT_EXTENSION,
20};
21
22/* Component scope definitions */
23enum counter_scope {
24 COUNTER_SCOPE_DEVICE,
25 COUNTER_SCOPE_SIGNAL,
26 COUNTER_SCOPE_COUNT,
27};
28
29/**
30 * struct counter_component - Counter component identification
31 * @type: component type (one of enum counter_component_type)
32 * @scope: component scope (one of enum counter_scope)
33 * @parent: parent ID (matching the ID suffix of the respective parent sysfs
34 * path as described by the ABI documentation file
35 * Documentation/ABI/testing/sysfs-bus-counter)
36 * @id: component ID (matching the ID provided by the respective *_component_id
37 * sysfs attribute of the desired component)
38 *
39 * For example, if the Count 2 ceiling extension of Counter device 4 is desired,
40 * set type equal to COUNTER_COMPONENT_EXTENSION, scope equal to
41 * COUNTER_COUNT_SCOPE, parent equal to 2, and id equal to the value provided by
42 * the respective /sys/bus/counter/devices/counter4/count2/ceiling_component_id
43 * sysfs attribute.
44 */
45struct counter_component {
46 __u8 type;
47 __u8 scope;
48 __u8 parent;
49 __u8 id;
50};
51
52/* Event type definitions */
53enum counter_event_type {
54 /* Count value increased past ceiling */
55 COUNTER_EVENT_OVERFLOW,
56 /* Count value decreased past floor */
57 COUNTER_EVENT_UNDERFLOW,
58 /* Count value increased past ceiling, or decreased past floor */
59 COUNTER_EVENT_OVERFLOW_UNDERFLOW,
60 /* Count value reached threshold */
61 COUNTER_EVENT_THRESHOLD,
62 /* Index signal detected */
63 COUNTER_EVENT_INDEX,
64};
65
66/**
67 * struct counter_watch - Counter component watch configuration
68 * @component: component to watch when event triggers
69 * @event: event that triggers (one of enum counter_event_type)
70 * @channel: event channel (typically 0 unless the device supports concurrent
71 * events of the same type)
72 */
73struct counter_watch {
74 struct counter_component component;
75 __u8 event;
76 __u8 channel;
77};
78
79/*
80 * Queues a Counter watch for the specified event.
81 *
82 * The queued watches will not be applied until COUNTER_ENABLE_EVENTS_IOCTL is
83 * called.
84 */
85#define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch)
86/*
87 * Enables monitoring the events specified by the Counter watches that were
88 * queued by COUNTER_ADD_WATCH_IOCTL.
89 *
90 * If events are already enabled, the new set of watches replaces the old one.
91 * Calling this ioctl also has the effect of clearing the queue of watches added
92 * by COUNTER_ADD_WATCH_IOCTL.
93 */
94#define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01)
95/*
96 * Stops monitoring the previously enabled events.
97 */
98#define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02)
99
100/**
101 * struct counter_event - Counter event data
102 * @timestamp: best estimate of time of event occurrence, in nanoseconds
103 * @value: component value
104 * @watch: component watch configuration
105 * @status: return status (system error number)
106 */
107struct counter_event {
108 __aligned_u64 timestamp;
109 __aligned_u64 value;
110 struct counter_watch watch;
111 __u8 status;
112};
113
114/* Count direction values */
115enum counter_count_direction {
116 COUNTER_COUNT_DIRECTION_FORWARD,
117 COUNTER_COUNT_DIRECTION_BACKWARD,
118};
119
120/* Count mode values */
121enum counter_count_mode {
122 COUNTER_COUNT_MODE_NORMAL,
123 COUNTER_COUNT_MODE_RANGE_LIMIT,
124 COUNTER_COUNT_MODE_NON_RECYCLE,
125 COUNTER_COUNT_MODE_MODULO_N,
126};
127
128/* Count function values */
129enum counter_function {
130 COUNTER_FUNCTION_INCREASE,
131 COUNTER_FUNCTION_DECREASE,
132 COUNTER_FUNCTION_PULSE_DIRECTION,
133 COUNTER_FUNCTION_QUADRATURE_X1_A,
134 COUNTER_FUNCTION_QUADRATURE_X1_B,
135 COUNTER_FUNCTION_QUADRATURE_X2_A,
136 COUNTER_FUNCTION_QUADRATURE_X2_B,
137 COUNTER_FUNCTION_QUADRATURE_X4,
138};
139
140/* Signal values */
141enum counter_signal_level {
142 COUNTER_SIGNAL_LEVEL_LOW,
143 COUNTER_SIGNAL_LEVEL_HIGH,
144};
145
146/* Action mode values */
147enum counter_synapse_action {
148 COUNTER_SYNAPSE_ACTION_NONE,
149 COUNTER_SYNAPSE_ACTION_RISING_EDGE,
150 COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
151 COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
152};
153
154#endif /* _COUNTER_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cryptouser.h+82-1
...@@ -19,6 +19,9 @@...@@ -19,6 +19,9 @@
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 */20 */
2121
22#ifndef _LINUX_CRYPTOUSER_H
23#define _LINUX_CRYPTOUSER_H
24
22#include <linux/types.h>25#include <linux/types.h>
2326
24/* Netlink configuration messages. */27/* Netlink configuration messages. */
...@@ -29,6 +32,7 @@ enum {...@@ -29,6 +32,7 @@ enum {
29 CRYPTO_MSG_UPDATEALG,32 CRYPTO_MSG_UPDATEALG,
30 CRYPTO_MSG_GETALG,33 CRYPTO_MSG_GETALG,
31 CRYPTO_MSG_DELRNG,34 CRYPTO_MSG_DELRNG,
35 CRYPTO_MSG_GETSTAT,
32 __CRYPTO_MSG_MAX36 __CRYPTO_MSG_MAX
33};37};
34#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)38#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
...@@ -50,6 +54,16 @@ enum crypto_attr_type_t {...@@ -50,6 +54,16 @@ enum crypto_attr_type_t {
50 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */54 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
51 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */55 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
52 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */56 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
57 CRYPTOCFGA_STAT_LARVAL, /* struct crypto_stat */
58 CRYPTOCFGA_STAT_HASH, /* struct crypto_stat */
59 CRYPTOCFGA_STAT_BLKCIPHER, /* struct crypto_stat */
60 CRYPTOCFGA_STAT_AEAD, /* struct crypto_stat */
61 CRYPTOCFGA_STAT_COMPRESS, /* struct crypto_stat */
62 CRYPTOCFGA_STAT_RNG, /* struct crypto_stat */
63 CRYPTOCFGA_STAT_CIPHER, /* struct crypto_stat */
64 CRYPTOCFGA_STAT_AKCIPHER, /* struct crypto_stat */
65 CRYPTOCFGA_STAT_KPP, /* struct crypto_stat */
66 CRYPTOCFGA_STAT_ACOMP, /* struct crypto_stat */
53 __CRYPTOCFGA_MAX67 __CRYPTOCFGA_MAX
5468
55#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)69#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
...@@ -65,6 +79,71 @@ struct crypto_user_alg {...@@ -65,6 +79,71 @@ struct crypto_user_alg {
65 __u32 cru_flags;79 __u32 cru_flags;
66};80};
6781
82struct crypto_stat_aead {
83 char type[CRYPTO_MAX_NAME];
84 __u64 stat_encrypt_cnt;
85 __u64 stat_encrypt_tlen;
86 __u64 stat_decrypt_cnt;
87 __u64 stat_decrypt_tlen;
88 __u64 stat_err_cnt;
89};
90
91struct crypto_stat_akcipher {
92 char type[CRYPTO_MAX_NAME];
93 __u64 stat_encrypt_cnt;
94 __u64 stat_encrypt_tlen;
95 __u64 stat_decrypt_cnt;
96 __u64 stat_decrypt_tlen;
97 __u64 stat_verify_cnt;
98 __u64 stat_sign_cnt;
99 __u64 stat_err_cnt;
100};
101
102struct crypto_stat_cipher {
103 char type[CRYPTO_MAX_NAME];
104 __u64 stat_encrypt_cnt;
105 __u64 stat_encrypt_tlen;
106 __u64 stat_decrypt_cnt;
107 __u64 stat_decrypt_tlen;
108 __u64 stat_err_cnt;
109};
110
111struct crypto_stat_compress {
112 char type[CRYPTO_MAX_NAME];
113 __u64 stat_compress_cnt;
114 __u64 stat_compress_tlen;
115 __u64 stat_decompress_cnt;
116 __u64 stat_decompress_tlen;
117 __u64 stat_err_cnt;
118};
119
120struct crypto_stat_hash {
121 char type[CRYPTO_MAX_NAME];
122 __u64 stat_hash_cnt;
123 __u64 stat_hash_tlen;
124 __u64 stat_err_cnt;
125};
126
127struct crypto_stat_kpp {
128 char type[CRYPTO_MAX_NAME];
129 __u64 stat_setsecret_cnt;
130 __u64 stat_generate_public_key_cnt;
131 __u64 stat_compute_shared_secret_cnt;
132 __u64 stat_err_cnt;
133};
134
135struct crypto_stat_rng {
136 char type[CRYPTO_MAX_NAME];
137 __u64 stat_generate_cnt;
138 __u64 stat_generate_tlen;
139 __u64 stat_seed_cnt;
140 __u64 stat_err_cnt;
141};
142
143struct crypto_stat_larval {
144 char type[CRYPTO_MAX_NAME];
145};
146
68struct crypto_report_larval {147struct crypto_report_larval {
69 char type[CRYPTO_MAX_NAME];148 char type[CRYPTO_MAX_NAME];
70};149};
...@@ -121,4 +200,6 @@ struct crypto_report_acomp {...@@ -121,4 +200,6 @@ struct crypto_report_acomp {
121};200};
122201
123#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \202#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
124 sizeof(struct crypto_report_blkcipher))
\ No newline at end of file
203 sizeof(struct crypto_report_blkcipher))
204
205#endif /* _LINUX_CRYPTOUSER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cxl_mem.h created+184
...@@ -0,0 +1,184 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * CXL IOCTLs for Memory Devices
4 */
5
6#ifndef _CXL_MEM_H_
7#define _CXL_MEM_H_
8
9#include <linux/types.h>
10
11/**
12 * DOC: UAPI
13 *
14 * Not all of all commands that the driver supports are always available for use
15 * by userspace. Userspace must check the results from the QUERY command in
16 * order to determine the live set of commands.
17 */
18
19#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
20#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
21
22#define CXL_CMDS \
23 ___C(INVALID, "Invalid Command"), \
24 ___C(IDENTIFY, "Identify Command"), \
25 ___C(RAW, "Raw device command"), \
26 ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), \
27 ___C(GET_FW_INFO, "Get FW Info"), \
28 ___C(GET_PARTITION_INFO, "Get Partition Information"), \
29 ___C(GET_LSA, "Get Label Storage Area"), \
30 ___C(GET_HEALTH_INFO, "Get Health Info"), \
31 ___C(GET_LOG, "Get Log"), \
32 ___C(SET_PARTITION_INFO, "Set Partition Information"), \
33 ___C(SET_LSA, "Set Label Storage Area"), \
34 ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), \
35 ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), \
36 ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), \
37 ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), \
38 ___C(GET_POISON, "Get Poison List"), \
39 ___C(INJECT_POISON, "Inject Poison"), \
40 ___C(CLEAR_POISON, "Clear Poison"), \
41 ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), \
42 ___C(SCAN_MEDIA, "Scan Media"), \
43 ___C(GET_SCAN_MEDIA, "Get Scan Media Results"), \
44 ___C(MAX, "invalid / last command")
45
46#define ___C(a, b) CXL_MEM_COMMAND_ID_##a
47enum { CXL_CMDS };
48
49#undef ___C
50#define ___C(a, b) { b }
51static const struct {
52 const char *name;
53} cxl_command_names[] __attribute__((__unused__)) = { CXL_CMDS };
54
55/*
56 * Here's how this actually breaks out:
57 * cxl_command_names[] = {
58 * [CXL_MEM_COMMAND_ID_INVALID] = { "Invalid Command" },
59 * [CXL_MEM_COMMAND_ID_IDENTIFY] = { "Identify Command" },
60 * ...
61 * [CXL_MEM_COMMAND_ID_MAX] = { "invalid / last command" },
62 * };
63 */
64
65#undef ___C
66
67/**
68 * struct cxl_command_info - Command information returned from a query.
69 * @id: ID number for the command.
70 * @flags: Flags that specify command behavior.
71 * @size_in: Expected input size, or -1 if variable length.
72 * @size_out: Expected output size, or -1 if variable length.
73 *
74 * Represents a single command that is supported by both the driver and the
75 * hardware. This is returned as part of an array from the query ioctl. The
76 * following would be a command that takes a variable length input and returns 0
77 * bytes of output.
78 *
79 * - @id = 10
80 * - @flags = 0
81 * - @size_in = -1
82 * - @size_out = 0
83 *
84 * See struct cxl_mem_query_commands.
85 */
86struct cxl_command_info {
87 __u32 id;
88
89 __u32 flags;
90#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(0, 0)
91
92 __s32 size_in;
93 __s32 size_out;
94};
95
96/**
97 * struct cxl_mem_query_commands - Query supported commands.
98 * @n_commands: In/out parameter. When @n_commands is > 0, the driver will
99 * return min(num_support_commands, n_commands). When @n_commands
100 * is 0, driver will return the number of total supported commands.
101 * @rsvd: Reserved for future use.
102 * @commands: Output array of supported commands. This array must be allocated
103 * by userspace to be at least min(num_support_commands, @n_commands)
104 *
105 * Allow userspace to query the available commands supported by both the driver,
106 * and the hardware. Commands that aren't supported by either the driver, or the
107 * hardware are not returned in the query.
108 *
109 * Examples:
110 *
111 * - { .n_commands = 0 } // Get number of supported commands
112 * - { .n_commands = 15, .commands = buf } // Return first 15 (or less)
113 * supported commands
114 *
115 * See struct cxl_command_info.
116 */
117struct cxl_mem_query_commands {
118 /*
119 * Input: Number of commands to return (space allocated by user)
120 * Output: Number of commands supported by the driver/hardware
121 *
122 * If n_commands is 0, kernel will only return number of commands and
123 * not try to populate commands[], thus allowing userspace to know how
124 * much space to allocate
125 */
126 __u32 n_commands;
127 __u32 rsvd;
128
129 struct cxl_command_info commands[]; /* out: supported commands */
130};
131
132/**
133 * struct cxl_send_command - Send a command to a memory device.
134 * @id: The command to send to the memory device. This must be one of the
135 * commands returned by the query command.
136 * @flags: Flags for the command (input).
137 * @raw: Special fields for raw commands
138 * @raw.opcode: Opcode passed to hardware when using the RAW command.
139 * @raw.rsvd: Must be zero.
140 * @rsvd: Must be zero.
141 * @retval: Return value from the memory device (output).
142 * @in: Parameters associated with input payload.
143 * @in.size: Size of the payload to provide to the device (input).
144 * @in.rsvd: Must be zero.
145 * @in.payload: Pointer to memory for payload input, payload is little endian.
146 * @out: Parameters associated with output payload.
147 * @out.size: Size of the payload received from the device (input/output). This
148 * field is filled in by userspace to let the driver know how much
149 * space was allocated for output. It is populated by the driver to
150 * let userspace know how large the output payload actually was.
151 * @out.rsvd: Must be zero.
152 * @out.payload: Pointer to memory for payload output, payload is little endian.
153 *
154 * Mechanism for userspace to send a command to the hardware for processing. The
155 * driver will do basic validation on the command sizes. In some cases even the
156 * payload may be introspected. Userspace is required to allocate large enough
157 * buffers for size_out which can be variable length in certain situations.
158 */
159struct cxl_send_command {
160 __u32 id;
161 __u32 flags;
162 union {
163 struct {
164 __u16 opcode;
165 __u16 rsvd;
166 } raw;
167 __u32 rsvd;
168 };
169 __u32 retval;
170
171 struct {
172 __s32 size;
173 __u32 rsvd;
174 __u64 payload;
175 } in;
176
177 struct {
178 __s32 size;
179 __u32 rsvd;
180 __u64 payload;
181 } out;
182};
183
184#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cyclades.h deleted-494
...@@ -1,494 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
3 * linux/include/linux/cyclades.h
4 *
5 * This file was initially written by
6 * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
7 * Ivan Passos <ivan@cyclades.com>.
8 *
9 * This file contains the general definitions for the cyclades.c driver
10 *$Log: cyclades.h,v $
11 *Revision 3.1 2002/01/29 11:36:16 henrique
12 *added throttle field on struct cyclades_port to indicate whether the
13 *port is throttled or not
14 *
15 *Revision 3.1 2000/04/19 18:52:52 ivan
16 *converted address fields to unsigned long and added fields for physical
17 *addresses on cyclades_card structure;
18 *
19 *Revision 3.0 1998/11/02 14:20:59 ivan
20 *added nports field on cyclades_card structure;
21 *
22 *Revision 2.5 1998/08/03 16:57:01 ivan
23 *added cyclades_idle_stats structure;
24 *
25 *Revision 2.4 1998/06/01 12:09:53 ivan
26 *removed closing_wait2 from cyclades_port structure;
27 *
28 *Revision 2.3 1998/03/16 18:01:12 ivan
29 *changes in the cyclades_port structure to get it closer to the
30 *standard serial port structure;
31 *added constants for new ioctls;
32 *
33 *Revision 2.2 1998/02/17 16:50:00 ivan
34 *changes in the cyclades_port structure (addition of shutdown_wait and
35 *chip_rev variables);
36 *added constants for new ioctls and for CD1400 rev. numbers.
37 *
38 *Revision 2.1 1997/10/24 16:03:00 ivan
39 *added rflow (which allows enabling the CD1400 special flow control
40 *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
41 *cyclades_port structure;
42 *added Alpha support
43 *
44 *Revision 2.0 1997/06/30 10:30:00 ivan
45 *added some new doorbell command constants related to IOCTLW and
46 *UART error signaling
47 *
48 *Revision 1.8 1997/06/03 15:30:00 ivan
49 *added constant ZFIRM_HLT
50 *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
51 *
52 *Revision 1.7 1997/03/26 10:30:00 daniel
53 *new entries at the end of cyclades_port struct to reallocate
54 *variables illegally allocated within card memory.
55 *
56 *Revision 1.6 1996/09/09 18:35:30 bentson
57 *fold in changes for Cyclom-Z -- including structures for
58 *communicating with board as well modest changes to original
59 *structures to support new features.
60 *
61 *Revision 1.5 1995/11/13 21:13:31 bentson
62 *changes suggested by Michael Chastain <mec@duracef.shout.net>
63 *to support use of this file in non-kernel applications
64 *
65 *
66 */
67
68#ifndef _LINUX_CYCLADES_H
69#define _LINUX_CYCLADES_H
70
71#include <linux/types.h>
72
73struct cyclades_monitor {
74 unsigned long int_count;
75 unsigned long char_count;
76 unsigned long char_max;
77 unsigned long char_last;
78};
79
80/*
81 * These stats all reflect activity since the device was last initialized.
82 * (i.e., since the port was opened with no other processes already having it
83 * open)
84 */
85struct cyclades_idle_stats {
86 __kernel_time_t in_use; /* Time device has been in use (secs) */
87 __kernel_time_t recv_idle; /* Time since last char received (secs) */
88 __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
89 unsigned long recv_bytes; /* Bytes received */
90 unsigned long xmit_bytes; /* Bytes transmitted */
91 unsigned long overruns; /* Input overruns */
92 unsigned long frame_errs; /* Input framing errors */
93 unsigned long parity_errs; /* Input parity errors */
94};
95
96#define CYCLADES_MAGIC 0x4359
97
98#define CYGETMON 0x435901
99#define CYGETTHRESH 0x435902
100#define CYSETTHRESH 0x435903
101#define CYGETDEFTHRESH 0x435904
102#define CYSETDEFTHRESH 0x435905
103#define CYGETTIMEOUT 0x435906
104#define CYSETTIMEOUT 0x435907
105#define CYGETDEFTIMEOUT 0x435908
106#define CYSETDEFTIMEOUT 0x435909
107#define CYSETRFLOW 0x43590a
108#define CYGETRFLOW 0x43590b
109#define CYSETRTSDTR_INV 0x43590c
110#define CYGETRTSDTR_INV 0x43590d
111#define CYZSETPOLLCYCLE 0x43590e
112#define CYZGETPOLLCYCLE 0x43590f
113#define CYGETCD1400VER 0x435910
114#define CYSETWAIT 0x435912
115#define CYGETWAIT 0x435913
116
117/*************** CYCLOM-Z ADDITIONS ***************/
118
119#define CZIOC ('M' << 8)
120#define CZ_NBOARDS (CZIOC|0xfa)
121#define CZ_BOOT_START (CZIOC|0xfb)
122#define CZ_BOOT_DATA (CZIOC|0xfc)
123#define CZ_BOOT_END (CZIOC|0xfd)
124#define CZ_TEST (CZIOC|0xfe)
125
126#define CZ_DEF_POLL (HZ/25)
127
128#define MAX_BOARD 4 /* Max number of boards */
129#define MAX_DEV 256 /* Max number of ports total */
130#define CYZ_MAX_SPEED 921600
131
132#define CYZ_FIFO_SIZE 16
133
134#define CYZ_BOOT_NWORDS 0x100
135struct CYZ_BOOT_CTRL {
136 unsigned short nboard;
137 int status[MAX_BOARD];
138 int nchannel[MAX_BOARD];
139 int fw_rev[MAX_BOARD];
140 unsigned long offset;
141 unsigned long data[CYZ_BOOT_NWORDS];
142};
143
144
145#ifndef DP_WINDOW_SIZE
146/*
147 * Memory Window Sizes
148 */
149
150#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
151#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
152 8Zo V.2 */
153#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
154
155/*
156 * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
157 * normally will access only interested on the fpga_id, fpga_version,
158 * start_cpu and stop_cpu.
159 */
160
161struct CUSTOM_REG {
162 __u32 fpga_id; /* FPGA Identification Register */
163 __u32 fpga_version; /* FPGA Version Number Register */
164 __u32 cpu_start; /* CPU start Register (write) */
165 __u32 cpu_stop; /* CPU stop Register (write) */
166 __u32 misc_reg; /* Miscellaneous Register */
167 __u32 idt_mode; /* IDT mode Register */
168 __u32 uart_irq_status; /* UART IRQ status Register */
169 __u32 clear_timer0_irq; /* Clear timer interrupt Register */
170 __u32 clear_timer1_irq; /* Clear timer interrupt Register */
171 __u32 clear_timer2_irq; /* Clear timer interrupt Register */
172 __u32 test_register; /* Test Register */
173 __u32 test_count; /* Test Count Register */
174 __u32 timer_select; /* Timer select register */
175 __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
176 __u32 ram_wait_state; /* RAM wait-state Register */
177 __u32 uart_wait_state; /* UART wait-state Register */
178 __u32 timer_wait_state; /* timer wait-state Register */
179 __u32 ack_wait_state; /* ACK wait State Register */
180};
181
182/*
183 * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
184 * registers. This structure can be used to access the 9060 registers
185 * (memory mapped).
186 */
187
188struct RUNTIME_9060 {
189 __u32 loc_addr_range; /* 00h - Local Address Range */
190 __u32 loc_addr_base; /* 04h - Local Address Base */
191 __u32 loc_arbitr; /* 08h - Local Arbitration */
192 __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
193 __u32 loc_rom_range; /* 10h - Local ROM Range */
194 __u32 loc_rom_base; /* 14h - Local ROM Base */
195 __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
196 __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
197 __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
198 __u32 loc_range_io; /* 24h - Local Range for Master IO */
199 __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
200 __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
201 __u32 filler1; /* 30h */
202 __u32 filler2; /* 34h */
203 __u32 filler3; /* 38h */
204 __u32 filler4; /* 3Ch */
205 __u32 mail_box_0; /* 40h - Mail Box 0 */
206 __u32 mail_box_1; /* 44h - Mail Box 1 */
207 __u32 mail_box_2; /* 48h - Mail Box 2 */
208 __u32 mail_box_3; /* 4Ch - Mail Box 3 */
209 __u32 filler5; /* 50h */
210 __u32 filler6; /* 54h */
211 __u32 filler7; /* 58h */
212 __u32 filler8; /* 5Ch */
213 __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
214 __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
215 __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
216 __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
217};
218
219/* Values for the Local Base Address re-map register */
220
221#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
222#define WIN_CREG 0x14000001L /* set the window to custom Registers */
223
224/* Values timer select registers */
225
226#define TIMER_BY_1M 0x00 /* clock divided by 1M */
227#define TIMER_BY_256K 0x01 /* clock divided by 256k */
228#define TIMER_BY_128K 0x02 /* clock divided by 128k */
229#define TIMER_BY_32K 0x03 /* clock divided by 32k */
230
231/****************** ****************** *******************/
232#endif
233
234#ifndef ZFIRM_ID
235/* #include "zfwint.h" */
236/****************** ****************** *******************/
237/*
238 * This file contains the definitions for interfacing with the
239 * Cyclom-Z ZFIRM Firmware.
240 */
241
242/* General Constant definitions */
243
244#define MAX_CHAN 64 /* max number of channels per board */
245
246/* firmware id structure (set after boot) */
247
248#define ID_ADDRESS 0x00000180L /* signature/pointer address */
249#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
250#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
251#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
252
253#define ZF_TINACT_DEF 1000 /* default inactivity timeout
254 (1000 ms) */
255#define ZF_TINACT ZF_TINACT_DEF
256
257struct FIRM_ID {
258 __u32 signature; /* ZFIRM/U signature */
259 __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
260};
261
262/* Op. System id */
263
264#define C_OS_LINUX 0x00000030 /* generic Linux system */
265
266/* channel op_mode */
267
268#define C_CH_DISABLE 0x00000000 /* channel is disabled */
269#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
270#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
271#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
272#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
273
274/* comm_parity - parity */
275
276#define C_PR_NONE 0x00000000 /* None */
277#define C_PR_ODD 0x00000001 /* Odd */
278#define C_PR_EVEN 0x00000002 /* Even */
279#define C_PR_MARK 0x00000004 /* Mark */
280#define C_PR_SPACE 0x00000008 /* Space */
281#define C_PR_PARITY 0x000000ff
282
283#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
284#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
285
286/* comm_data_l - data length and stop bits */
287
288#define C_DL_CS5 0x00000001
289#define C_DL_CS6 0x00000002
290#define C_DL_CS7 0x00000004
291#define C_DL_CS8 0x00000008
292#define C_DL_CS 0x0000000f
293#define C_DL_1STOP 0x00000010
294#define C_DL_15STOP 0x00000020
295#define C_DL_2STOP 0x00000040
296#define C_DL_STOP 0x000000f0
297
298/* interrupt enabling/status */
299
300#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
301#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
302#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
303#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
304#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
305#define C_IN_MDCD 0x00000100 /* modem DCD change */
306#define C_IN_MDSR 0x00000200 /* modem DSR change */
307#define C_IN_MRI 0x00000400 /* modem RI change */
308#define C_IN_MCTS 0x00000800 /* modem CTS change */
309#define C_IN_RXBRK 0x00001000 /* Break received */
310#define C_IN_PR_ERROR 0x00002000 /* parity error */
311#define C_IN_FR_ERROR 0x00004000 /* frame error */
312#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
313#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
314#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
315#define C_IN_MRTS 0x00040000 /* modem RTS drop */
316#define C_IN_ICHAR 0x00080000
317
318/* flow control */
319
320#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
321#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
322#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
323#define C_FL_SWFLOW 0x0000000f
324
325/* flow status */
326
327#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
328#define C_FS_SENDING 0x00000001 /* UART is sending data */
329#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
330
331/* rs_control/rs_status RS-232 signals */
332
333#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
334 IOCTLM command */
335#define C_RS_RTS 0x00000001 /* RTS */
336#define C_RS_DTR 0x00000004 /* DTR */
337#define C_RS_DCD 0x00000100 /* CD */
338#define C_RS_DSR 0x00000200 /* DSR */
339#define C_RS_RI 0x00000400 /* RI */
340#define C_RS_CTS 0x00000800 /* CTS */
341
342/* commands Host <-> Board */
343
344#define C_CM_RESET 0x01 /* reset/flush buffers */
345#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
346#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
347#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
348#define C_CM_SENDXOFF 0x10 /* send Xoff */
349#define C_CM_SENDXON 0x11 /* send Xon */
350#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
351#define C_CM_SENDBRK 0x41 /* send break */
352#define C_CM_INTBACK 0x42 /* Interrupt back */
353#define C_CM_SET_BREAK 0x43 /* Tx break on */
354#define C_CM_CLR_BREAK 0x44 /* Tx break off */
355#define C_CM_CMD_DONE 0x45 /* Previous command done */
356#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
357#define C_CM_TINACT 0x51 /* set inactivity detection */
358#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
359#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
360#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
361#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
362#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
363#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
364#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
365 driver */
366#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
367 driver */
368
369#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
370#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
371#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
372#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
373#define C_CM_TXFEMPTY 0x64
374#define C_CM_ICHAR 0x65
375#define C_CM_MDCD 0x70 /* modem DCD change */
376#define C_CM_MDSR 0x71 /* modem DSR change */
377#define C_CM_MRI 0x72 /* modem RI change */
378#define C_CM_MCTS 0x73 /* modem CTS change */
379#define C_CM_MRTS 0x74 /* modem RTS drop */
380#define C_CM_RXBRK 0x84 /* Break received */
381#define C_CM_PR_ERROR 0x85 /* Parity error */
382#define C_CM_FR_ERROR 0x86 /* Frame error */
383#define C_CM_OVR_ERROR 0x87 /* Overrun error */
384#define C_CM_RXOFL 0x88 /* RX buffer overflow */
385#define C_CM_CMDERROR 0x90 /* command error */
386#define C_CM_FATAL 0x91 /* fatal error */
387#define C_CM_HW_RESET 0x92 /* reset board */
388
389/*
390 * CH_CTRL - This per port structure contains all parameters
391 * that control an specific port. It can be seen as the
392 * configuration registers of a "super-serial-controller".
393 */
394
395struct CH_CTRL {
396 __u32 op_mode; /* operation mode */
397 __u32 intr_enable; /* interrupt masking */
398 __u32 sw_flow; /* SW flow control */
399 __u32 flow_status; /* output flow status */
400 __u32 comm_baud; /* baud rate - numerically specified */
401 __u32 comm_parity; /* parity */
402 __u32 comm_data_l; /* data length/stop */
403 __u32 comm_flags; /* other flags */
404 __u32 hw_flow; /* HW flow control */
405 __u32 rs_control; /* RS-232 outputs */
406 __u32 rs_status; /* RS-232 inputs */
407 __u32 flow_xon; /* xon char */
408 __u32 flow_xoff; /* xoff char */
409 __u32 hw_overflow; /* hw overflow counter */
410 __u32 sw_overflow; /* sw overflow counter */
411 __u32 comm_error; /* frame/parity error counter */
412 __u32 ichar;
413 __u32 filler[7];
414};
415
416
417/*
418 * BUF_CTRL - This per channel structure contains
419 * all Tx and Rx buffer control for a given channel.
420 */
421
422struct BUF_CTRL {
423 __u32 flag_dma; /* buffers are in Host memory */
424 __u32 tx_bufaddr; /* address of the tx buffer */
425 __u32 tx_bufsize; /* tx buffer size */
426 __u32 tx_threshold; /* tx low water mark */
427 __u32 tx_get; /* tail index tx buf */
428 __u32 tx_put; /* head index tx buf */
429 __u32 rx_bufaddr; /* address of the rx buffer */
430 __u32 rx_bufsize; /* rx buffer size */
431 __u32 rx_threshold; /* rx high water mark */
432 __u32 rx_get; /* tail index rx buf */
433 __u32 rx_put; /* head index rx buf */
434 __u32 filler[5]; /* filler to align structures */
435};
436
437/*
438 * BOARD_CTRL - This per board structure contains all global
439 * control fields related to the board.
440 */
441
442struct BOARD_CTRL {
443
444 /* static info provided by the on-board CPU */
445 __u32 n_channel; /* number of channels */
446 __u32 fw_version; /* firmware version */
447
448 /* static info provided by the driver */
449 __u32 op_system; /* op_system id */
450 __u32 dr_version; /* driver version */
451
452 /* board control area */
453 __u32 inactivity; /* inactivity control */
454
455 /* host to FW commands */
456 __u32 hcmd_channel; /* channel number */
457 __u32 hcmd_param; /* pointer to parameters */
458
459 /* FW to Host commands */
460 __u32 fwcmd_channel; /* channel number */
461 __u32 fwcmd_param; /* pointer to parameters */
462 __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
463
464 /* filler so the structures are aligned */
465 __u32 filler[6];
466};
467
468/* Host Interrupt Queue */
469
470#define QUEUE_SIZE (10*MAX_CHAN)
471
472struct INT_QUEUE {
473 unsigned char intr_code[QUEUE_SIZE];
474 unsigned long channel[QUEUE_SIZE];
475 unsigned long param[QUEUE_SIZE];
476 unsigned long put;
477 unsigned long get;
478};
479
480/*
481 * ZFW_CTRL - This is the data structure that includes all other
482 * data structures used by the Firmware.
483 */
484
485struct ZFW_CTRL {
486 struct BOARD_CTRL board_ctrl;
487 struct CH_CTRL ch_ctrl[MAX_CHAN];
488 struct BUF_CTRL buf_ctrl[MAX_CHAN];
489};
490
491/****************** ****************** *******************/
492#endif
493
494#endif /* _LINUX_CYCLADES_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dcbnl.h+1-1
...@@ -286,7 +286,7 @@ struct dcbmsg {...@@ -286,7 +286,7 @@ struct dcbmsg {
286 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported286 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
287 * @DCB_CMD_SNUMTCS: set the number of traffic classes287 * @DCB_CMD_SNUMTCS: set the number of traffic classes
288 * @DCB_CMD_GBCN: set backward congestion notification configuration288 * @DCB_CMD_GBCN: set backward congestion notification configuration
289 * @DCB_CMD_SBCN: get backward congestion notification configration.289 * @DCB_CMD_SBCN: get backward congestion notification configuration.
290 * @DCB_CMD_GAPP: get application protocol configuration290 * @DCB_CMD_GAPP: get application protocol configuration
291 * @DCB_CMD_SAPP: set application protocol configuration291 * @DCB_CMD_SAPP: set application protocol configuration
292 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration292 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
lib/libc/include/any-linux-any/linux/devlink.h+301
...@@ -13,6 +13,8 @@...@@ -13,6 +13,8 @@
13#ifndef _LINUX_DEVLINK_H_13#ifndef _LINUX_DEVLINK_H_
14#define _LINUX_DEVLINK_H_14#define _LINUX_DEVLINK_H_
1515
16#include <linux/const.h>
17
16#define DEVLINK_GENL_NAME "devlink"18#define DEVLINK_GENL_NAME "devlink"
17#define DEVLINK_GENL_VERSION 0x119#define DEVLINK_GENL_VERSION 0x1
18#define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"20#define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"
...@@ -89,6 +91,46 @@ enum devlink_command {...@@ -89,6 +91,46 @@ enum devlink_command {
89 DEVLINK_CMD_REGION_DEL,91 DEVLINK_CMD_REGION_DEL,
90 DEVLINK_CMD_REGION_READ,92 DEVLINK_CMD_REGION_READ,
9193
94 DEVLINK_CMD_PORT_PARAM_GET, /* can dump */
95 DEVLINK_CMD_PORT_PARAM_SET,
96 DEVLINK_CMD_PORT_PARAM_NEW,
97 DEVLINK_CMD_PORT_PARAM_DEL,
98
99 DEVLINK_CMD_INFO_GET, /* can dump */
100
101 DEVLINK_CMD_HEALTH_REPORTER_GET,
102 DEVLINK_CMD_HEALTH_REPORTER_SET,
103 DEVLINK_CMD_HEALTH_REPORTER_RECOVER,
104 DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE,
105 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
106 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR,
107
108 DEVLINK_CMD_FLASH_UPDATE,
109 DEVLINK_CMD_FLASH_UPDATE_END, /* notification only */
110 DEVLINK_CMD_FLASH_UPDATE_STATUS, /* notification only */
111
112 DEVLINK_CMD_TRAP_GET, /* can dump */
113 DEVLINK_CMD_TRAP_SET,
114 DEVLINK_CMD_TRAP_NEW,
115 DEVLINK_CMD_TRAP_DEL,
116
117 DEVLINK_CMD_TRAP_GROUP_GET, /* can dump */
118 DEVLINK_CMD_TRAP_GROUP_SET,
119 DEVLINK_CMD_TRAP_GROUP_NEW,
120 DEVLINK_CMD_TRAP_GROUP_DEL,
121
122 DEVLINK_CMD_TRAP_POLICER_GET, /* can dump */
123 DEVLINK_CMD_TRAP_POLICER_SET,
124 DEVLINK_CMD_TRAP_POLICER_NEW,
125 DEVLINK_CMD_TRAP_POLICER_DEL,
126
127 DEVLINK_CMD_HEALTH_REPORTER_TEST,
128
129 DEVLINK_CMD_RATE_GET, /* can dump */
130 DEVLINK_CMD_RATE_SET,
131 DEVLINK_CMD_RATE_NEW,
132 DEVLINK_CMD_RATE_DEL,
133
92 /* add new commands above here */134 /* add new commands above here */
93 __DEVLINK_CMD_MAX,135 __DEVLINK_CMD_MAX,
94 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1136 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
...@@ -151,6 +193,27 @@ enum devlink_port_flavour {...@@ -151,6 +193,27 @@ enum devlink_port_flavour {
151 DEVLINK_PORT_FLAVOUR_DSA, /* Distributed switch architecture193 DEVLINK_PORT_FLAVOUR_DSA, /* Distributed switch architecture
152 * interconnect port.194 * interconnect port.
153 */195 */
196 DEVLINK_PORT_FLAVOUR_PCI_PF, /* Represents eswitch port for
197 * the PCI PF. It is an internal
198 * port that faces the PCI PF.
199 */
200 DEVLINK_PORT_FLAVOUR_PCI_VF, /* Represents eswitch port
201 * for the PCI VF. It is an internal
202 * port that faces the PCI VF.
203 */
204 DEVLINK_PORT_FLAVOUR_VIRTUAL, /* Any virtual port facing the user. */
205 DEVLINK_PORT_FLAVOUR_UNUSED, /* Port which exists in the switch, but
206 * is not used in any way.
207 */
208 DEVLINK_PORT_FLAVOUR_PCI_SF, /* Represents eswitch port
209 * for the PCI SF. It is an internal
210 * port that faces the PCI SF.
211 */
212};
213
214enum devlink_rate_type {
215 DEVLINK_RATE_TYPE_LEAF,
216 DEVLINK_RATE_TYPE_NODE,
154};217};
155218
156enum devlink_param_cmode {219enum devlink_param_cmode {
...@@ -163,6 +226,118 @@ enum devlink_param_cmode {...@@ -163,6 +226,118 @@ enum devlink_param_cmode {
163 DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1226 DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1
164};227};
165228
229enum devlink_param_fw_load_policy_value {
230 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
231 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
232 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK,
233 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN,
234};
235
236enum devlink_param_reset_dev_on_drv_probe_value {
237 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN,
238 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS,
239 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER,
240 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK,
241};
242
243enum {
244 DEVLINK_ATTR_STATS_RX_PACKETS, /* u64 */
245 DEVLINK_ATTR_STATS_RX_BYTES, /* u64 */
246 DEVLINK_ATTR_STATS_RX_DROPPED, /* u64 */
247
248 __DEVLINK_ATTR_STATS_MAX,
249 DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1
250};
251
252/* Specify what sections of a flash component can be overwritten when
253 * performing an update. Overwriting of firmware binary sections is always
254 * implicitly assumed to be allowed.
255 *
256 * Each section must be documented in
257 * Documentation/networking/devlink/devlink-flash.rst
258 *
259 */
260enum {
261 DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT,
262 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT,
263
264 __DEVLINK_FLASH_OVERWRITE_MAX_BIT,
265 DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DEVLINK_FLASH_OVERWRITE_MAX_BIT - 1
266};
267
268#define DEVLINK_FLASH_OVERWRITE_SETTINGS _BITUL(DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT)
269#define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS _BITUL(DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT)
270
271#define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \
272 (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1)
273
274/**
275 * enum devlink_trap_action - Packet trap action.
276 * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not
277 * sent to the CPU.
278 * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of the packet is sent to the CPU.
279 * @DEVLINK_TRAP_ACTION_MIRROR: Packet is forwarded by the device and a copy is
280 * sent to the CPU.
281 */
282enum devlink_trap_action {
283 DEVLINK_TRAP_ACTION_DROP,
284 DEVLINK_TRAP_ACTION_TRAP,
285 DEVLINK_TRAP_ACTION_MIRROR,
286};
287
288/**
289 * enum devlink_trap_type - Packet trap type.
290 * @DEVLINK_TRAP_TYPE_DROP: Trap reason is a drop. Trapped packets are only
291 * processed by devlink and not injected to the
292 * kernel's Rx path.
293 * @DEVLINK_TRAP_TYPE_EXCEPTION: Trap reason is an exception. Packet was not
294 * forwarded as intended due to an exception
295 * (e.g., missing neighbour entry) and trapped to
296 * control plane for resolution. Trapped packets
297 * are processed by devlink and injected to
298 * the kernel's Rx path.
299 * @DEVLINK_TRAP_TYPE_CONTROL: Packet was trapped because it is required for
300 * the correct functioning of the control plane.
301 * For example, an ARP request packet. Trapped
302 * packets are injected to the kernel's Rx path,
303 * but not reported to drop monitor.
304 */
305enum devlink_trap_type {
306 DEVLINK_TRAP_TYPE_DROP,
307 DEVLINK_TRAP_TYPE_EXCEPTION,
308 DEVLINK_TRAP_TYPE_CONTROL,
309};
310
311enum {
312 /* Trap can report input port as metadata */
313 DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_PORT,
314 /* Trap can report flow action cookie as metadata */
315 DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COOKIE,
316};
317
318enum devlink_reload_action {
319 DEVLINK_RELOAD_ACTION_UNSPEC,
320 DEVLINK_RELOAD_ACTION_DRIVER_REINIT, /* Driver entities re-instantiation */
321 DEVLINK_RELOAD_ACTION_FW_ACTIVATE, /* FW activate */
322
323 /* Add new reload actions above */
324 __DEVLINK_RELOAD_ACTION_MAX,
325 DEVLINK_RELOAD_ACTION_MAX = __DEVLINK_RELOAD_ACTION_MAX - 1
326};
327
328enum devlink_reload_limit {
329 DEVLINK_RELOAD_LIMIT_UNSPEC, /* unspecified, no constraints */
330 DEVLINK_RELOAD_LIMIT_NO_RESET, /* No reset allowed, no down time allowed,
331 * no link flap and no configuration is lost.
332 */
333
334 /* Add new reload limit above */
335 __DEVLINK_RELOAD_LIMIT_MAX,
336 DEVLINK_RELOAD_LIMIT_MAX = __DEVLINK_RELOAD_LIMIT_MAX - 1
337};
338
339#define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BITUL(__DEVLINK_RELOAD_LIMIT_MAX) - 1)
340
166enum devlink_attr {341enum devlink_attr {
167 /* don't change the order or add anything between, this is ABI! */342 /* don't change the order or add anything between, this is ABI! */
168 DEVLINK_ATTR_UNSPEC,343 DEVLINK_ATTR_UNSPEC,
...@@ -280,6 +455,104 @@ enum devlink_attr {...@@ -280,6 +455,104 @@ enum devlink_attr {
280 DEVLINK_ATTR_REGION_CHUNK_ADDR, /* u64 */455 DEVLINK_ATTR_REGION_CHUNK_ADDR, /* u64 */
281 DEVLINK_ATTR_REGION_CHUNK_LEN, /* u64 */456 DEVLINK_ATTR_REGION_CHUNK_LEN, /* u64 */
282457
458 DEVLINK_ATTR_INFO_DRIVER_NAME, /* string */
459 DEVLINK_ATTR_INFO_SERIAL_NUMBER, /* string */
460 DEVLINK_ATTR_INFO_VERSION_FIXED, /* nested */
461 DEVLINK_ATTR_INFO_VERSION_RUNNING, /* nested */
462 DEVLINK_ATTR_INFO_VERSION_STORED, /* nested */
463 DEVLINK_ATTR_INFO_VERSION_NAME, /* string */
464 DEVLINK_ATTR_INFO_VERSION_VALUE, /* string */
465
466 DEVLINK_ATTR_SB_POOL_CELL_SIZE, /* u32 */
467
468 DEVLINK_ATTR_FMSG, /* nested */
469 DEVLINK_ATTR_FMSG_OBJ_NEST_START, /* flag */
470 DEVLINK_ATTR_FMSG_PAIR_NEST_START, /* flag */
471 DEVLINK_ATTR_FMSG_ARR_NEST_START, /* flag */
472 DEVLINK_ATTR_FMSG_NEST_END, /* flag */
473 DEVLINK_ATTR_FMSG_OBJ_NAME, /* string */
474 DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE, /* u8 */
475 DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA, /* dynamic */
476
477 DEVLINK_ATTR_HEALTH_REPORTER, /* nested */
478 DEVLINK_ATTR_HEALTH_REPORTER_NAME, /* string */
479 DEVLINK_ATTR_HEALTH_REPORTER_STATE, /* u8 */
480 DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT, /* u64 */
481 DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT, /* u64 */
482 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS, /* u64 */
483 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD, /* u64 */
484 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, /* u8 */
485
486 DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME, /* string */
487 DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, /* string */
488 DEVLINK_ATTR_FLASH_UPDATE_STATUS_MSG, /* string */
489 DEVLINK_ATTR_FLASH_UPDATE_STATUS_DONE, /* u64 */
490 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TOTAL, /* u64 */
491
492 DEVLINK_ATTR_PORT_PCI_PF_NUMBER, /* u16 */
493 DEVLINK_ATTR_PORT_PCI_VF_NUMBER, /* u16 */
494
495 DEVLINK_ATTR_STATS, /* nested */
496
497 DEVLINK_ATTR_TRAP_NAME, /* string */
498 /* enum devlink_trap_action */
499 DEVLINK_ATTR_TRAP_ACTION, /* u8 */
500 /* enum devlink_trap_type */
501 DEVLINK_ATTR_TRAP_TYPE, /* u8 */
502 DEVLINK_ATTR_TRAP_GENERIC, /* flag */
503 DEVLINK_ATTR_TRAP_METADATA, /* nested */
504 DEVLINK_ATTR_TRAP_GROUP_NAME, /* string */
505
506 DEVLINK_ATTR_RELOAD_FAILED, /* u8 0 or 1 */
507
508 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS, /* u64 */
509
510 DEVLINK_ATTR_NETNS_FD, /* u32 */
511 DEVLINK_ATTR_NETNS_PID, /* u32 */
512 DEVLINK_ATTR_NETNS_ID, /* u32 */
513
514 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP, /* u8 */
515
516 DEVLINK_ATTR_TRAP_POLICER_ID, /* u32 */
517 DEVLINK_ATTR_TRAP_POLICER_RATE, /* u64 */
518 DEVLINK_ATTR_TRAP_POLICER_BURST, /* u64 */
519
520 DEVLINK_ATTR_PORT_FUNCTION, /* nested */
521
522 DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER, /* string */
523
524 DEVLINK_ATTR_PORT_LANES, /* u32 */
525 DEVLINK_ATTR_PORT_SPLITTABLE, /* u8 */
526
527 DEVLINK_ATTR_PORT_EXTERNAL, /* u8 */
528 DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, /* u32 */
529
530 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TIMEOUT, /* u64 */
531 DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK, /* bitfield32 */
532
533 DEVLINK_ATTR_RELOAD_ACTION, /* u8 */
534 DEVLINK_ATTR_RELOAD_ACTIONS_PERFORMED, /* bitfield32 */
535 DEVLINK_ATTR_RELOAD_LIMITS, /* bitfield32 */
536
537 DEVLINK_ATTR_DEV_STATS, /* nested */
538 DEVLINK_ATTR_RELOAD_STATS, /* nested */
539 DEVLINK_ATTR_RELOAD_STATS_ENTRY, /* nested */
540 DEVLINK_ATTR_RELOAD_STATS_LIMIT, /* u8 */
541 DEVLINK_ATTR_RELOAD_STATS_VALUE, /* u32 */
542 DEVLINK_ATTR_REMOTE_RELOAD_STATS, /* nested */
543 DEVLINK_ATTR_RELOAD_ACTION_INFO, /* nested */
544 DEVLINK_ATTR_RELOAD_ACTION_STATS, /* nested */
545
546 DEVLINK_ATTR_PORT_PCI_SF_NUMBER, /* u32 */
547
548 DEVLINK_ATTR_RATE_TYPE, /* u16 */
549 DEVLINK_ATTR_RATE_TX_SHARE, /* u64 */
550 DEVLINK_ATTR_RATE_TX_MAX, /* u64 */
551 DEVLINK_ATTR_RATE_NODE_NAME, /* string */
552 DEVLINK_ATTR_RATE_PARENT_NODE_NAME, /* string */
553
554 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */
555
283 /* add new attributes above here, update the policy in devlink.c */556 /* add new attributes above here, update the policy in devlink.c */
284557
285 __DEVLINK_ATTR_MAX,558 __DEVLINK_ATTR_MAX,
...@@ -326,4 +599,32 @@ enum devlink_resource_unit {...@@ -326,4 +599,32 @@ enum devlink_resource_unit {
326 DEVLINK_RESOURCE_UNIT_ENTRY,599 DEVLINK_RESOURCE_UNIT_ENTRY,
327};600};
328601
602enum devlink_port_function_attr {
603 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
604 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */
605 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */
606 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */
607
608 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
609 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
610};
611
612enum devlink_port_fn_state {
613 DEVLINK_PORT_FN_STATE_INACTIVE,
614 DEVLINK_PORT_FN_STATE_ACTIVE,
615};
616
617/**
618 * enum devlink_port_fn_opstate - indicates operational state of the function
619 * @DEVLINK_PORT_FN_OPSTATE_ATTACHED: Driver is attached to the function.
620 * For graceful tear down of the function, after inactivation of the
621 * function, user should wait for operational state to turn DETACHED.
622 * @DEVLINK_PORT_FN_OPSTATE_DETACHED: Driver is detached from the function.
623 * It is safe to delete the port.
624 */
625enum devlink_port_fn_opstate {
626 DEVLINK_PORT_FN_OPSTATE_DETACHED,
627 DEVLINK_PORT_FN_OPSTATE_ATTACHED,
628};
629
329#endif /* _LINUX_DEVLINK_H_ */630#endif /* _LINUX_DEVLINK_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dlm_device.h+2-2
...@@ -45,13 +45,13 @@ struct dlm_lock_params {...@@ -45,13 +45,13 @@ struct dlm_lock_params {
45 void *bastaddr;45 void *bastaddr;
46 struct dlm_lksb *lksb;46 struct dlm_lksb *lksb;
47 char lvb[DLM_USER_LVB_LEN];47 char lvb[DLM_USER_LVB_LEN];
48 char name[0];48 char name[];
49};49};
5050
51struct dlm_lspace_params {51struct dlm_lspace_params {
52 __u32 flags;52 __u32 flags;
53 __u32 minor;53 __u32 minor;
54 char name[0];54 char name[];
55};55};
5656
57struct dlm_purge_params {57struct dlm_purge_params {
lib/libc/include/any-linux-any/linux/dm-ioctl.h+24-2
...@@ -193,8 +193,22 @@ struct dm_name_list {...@@ -193,8 +193,22 @@ struct dm_name_list {
193 __u32 next; /* offset to the next record from193 __u32 next; /* offset to the next record from
194 the _start_ of this */194 the _start_ of this */
195 char name[0];195 char name[0];
196
197 /*
198 * The following members can be accessed by taking a pointer that
199 * points immediately after the terminating zero character in "name"
200 * and aligning this pointer to next 8-byte boundary.
201 * Uuid is present if the flag DM_NAME_LIST_FLAG_HAS_UUID is set.
202 *
203 * __u32 event_nr;
204 * __u32 flags;
205 * char uuid[0];
206 */
196};207};
197208
209#define DM_NAME_LIST_FLAG_HAS_UUID 1
210#define DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID 2
211
198/*212/*
199 * Used to retrieve the target versions213 * Used to retrieve the target versions
200 */214 */
...@@ -243,6 +257,7 @@ enum {...@@ -243,6 +257,7 @@ enum {
243 DM_TARGET_MSG_CMD,257 DM_TARGET_MSG_CMD,
244 DM_DEV_SET_GEOMETRY_CMD,258 DM_DEV_SET_GEOMETRY_CMD,
245 DM_DEV_ARM_POLL_CMD,259 DM_DEV_ARM_POLL_CMD,
260 DM_GET_TARGET_VERSION_CMD,
246};261};
247262
248#define DM_IOCTL 0xfd263#define DM_IOCTL 0xfd
...@@ -265,14 +280,15 @@ enum {...@@ -265,14 +280,15 @@ enum {
265#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)280#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
266281
267#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)282#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
283#define DM_GET_TARGET_VERSION _IOWR(DM_IOCTL, DM_GET_TARGET_VERSION_CMD, struct dm_ioctl)
268284
269#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)285#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
270#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)286#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
271287
272#define DM_VERSION_MAJOR 4288#define DM_VERSION_MAJOR 4
273#define DM_VERSION_MINOR 39289#define DM_VERSION_MINOR 45
274#define DM_VERSION_PATCHLEVEL 0290#define DM_VERSION_PATCHLEVEL 0
275#define DM_VERSION_EXTRA "-ioctl (2018-04-03)"291#define DM_VERSION_EXTRA "-ioctl (2021-03-22)"
276292
277/* Status bits */293/* Status bits */
278#define DM_READONLY_FLAG (1 << 0) /* In/Out */294#define DM_READONLY_FLAG (1 << 0) /* In/Out */
...@@ -360,4 +376,10 @@ enum {...@@ -360,4 +376,10 @@ enum {
360 */376 */
361#define DM_INTERNAL_SUSPEND_FLAG (1 << 18) /* Out */377#define DM_INTERNAL_SUSPEND_FLAG (1 << 18) /* Out */
362378
379/*
380 * If set, returns in the in buffer passed by UM, the raw table information
381 * that would be measured by IMA subsystem on device state change.
382 */
383#define DM_IMA_MEASUREMENT_FLAG (1 << 19) /* In */
384
363#endif /* _LINUX_DM_IOCTL_H */385#endif /* _LINUX_DM_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dma-buf.h+58-1
...@@ -22,8 +22,56 @@...@@ -22,8 +22,56 @@
2222
23#include <linux/types.h>23#include <linux/types.h>
2424
25/* begin/end dma-buf functions used for userspace mmap. */25/**
26 * struct dma_buf_sync - Synchronize with CPU access.
27 *
28 * When a DMA buffer is accessed from the CPU via mmap, it is not always
29 * possible to guarantee coherency between the CPU-visible map and underlying
30 * memory. To manage coherency, DMA_BUF_IOCTL_SYNC must be used to bracket
31 * any CPU access to give the kernel the chance to shuffle memory around if
32 * needed.
33 *
34 * Prior to accessing the map, the client must call DMA_BUF_IOCTL_SYNC
35 * with DMA_BUF_SYNC_START and the appropriate read/write flags. Once the
36 * access is complete, the client should call DMA_BUF_IOCTL_SYNC with
37 * DMA_BUF_SYNC_END and the same read/write flags.
38 *
39 * The synchronization provided via DMA_BUF_IOCTL_SYNC only provides cache
40 * coherency. It does not prevent other processes or devices from
41 * accessing the memory at the same time. If synchronization with a GPU or
42 * other device driver is required, it is the client's responsibility to
43 * wait for buffer to be ready for reading or writing before calling this
44 * ioctl with DMA_BUF_SYNC_START. Likewise, the client must ensure that
45 * follow-up work is not submitted to GPU or other device driver until
46 * after this ioctl has been called with DMA_BUF_SYNC_END?
47 *
48 * If the driver or API with which the client is interacting uses implicit
49 * synchronization, waiting for prior work to complete can be done via
50 * poll() on the DMA buffer file descriptor. If the driver or API requires
51 * explicit synchronization, the client may have to wait on a sync_file or
52 * other synchronization primitive outside the scope of the DMA buffer API.
53 */
26struct dma_buf_sync {54struct dma_buf_sync {
55 /**
56 * @flags: Set of access flags
57 *
58 * DMA_BUF_SYNC_START:
59 * Indicates the start of a map access session.
60 *
61 * DMA_BUF_SYNC_END:
62 * Indicates the end of a map access session.
63 *
64 * DMA_BUF_SYNC_READ:
65 * Indicates that the mapped DMA buffer will be read by the
66 * client via the CPU map.
67 *
68 * DMA_BUF_SYNC_WRITE:
69 * Indicates that the mapped DMA buffer will be written by the
70 * client via the CPU map.
71 *
72 * DMA_BUF_SYNC_RW:
73 * An alias for DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE.
74 */
27 __u64 flags;75 __u64 flags;
28};76};
2977
...@@ -35,7 +83,16 @@ struct dma_buf_sync {...@@ -35,7 +83,16 @@ struct dma_buf_sync {
35#define DMA_BUF_SYNC_VALID_FLAGS_MASK \83#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
36 (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)84 (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
3785
86#define DMA_BUF_NAME_LEN 32
87
38#define DMA_BUF_BASE 'b'88#define DMA_BUF_BASE 'b'
39#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)89#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
4090
91/* 32/64bitness of this uapi was botched in android, there's no difference
92 * between them in actual uapi, they're just different numbers.
93 */
94#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
95#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32)
96#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64)
97
41#endif98#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dma-heap.h created+53
...@@ -0,0 +1,53 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * DMABUF Heaps Userspace API
4 *
5 * Copyright (C) 2011 Google, Inc.
6 * Copyright (C) 2019 Linaro Ltd.
7 */
8#ifndef _LINUX_DMABUF_POOL_H
9#define _LINUX_DMABUF_POOL_H
10
11#include <linux/ioctl.h>
12#include <linux/types.h>
13
14/**
15 * DOC: DMABUF Heaps Userspace API
16 */
17
18/* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */
19#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)
20
21/* Currently no heap flags */
22#define DMA_HEAP_VALID_HEAP_FLAGS (0)
23
24/**
25 * struct dma_heap_allocation_data - metadata passed from userspace for
26 * allocations
27 * @len: size of the allocation
28 * @fd: will be populated with a fd which provides the
29 * handle to the allocated dma-buf
30 * @fd_flags: file descriptor flags used when allocating
31 * @heap_flags: flags passed to heap
32 *
33 * Provided by userspace as an argument to the ioctl
34 */
35struct dma_heap_allocation_data {
36 __u64 len;
37 __u32 fd;
38 __u32 fd_flags;
39 __u64 heap_flags;
40};
41
42#define DMA_HEAP_IOC_MAGIC 'H'
43
44/**
45 * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool
46 *
47 * Takes a dma_heap_allocation_data struct and returns it with the fd field
48 * populated with the dmabuf handle of the allocation.
49 */
50#define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
51 struct dma_heap_allocation_data)
52
53#endif /* _LINUX_DMABUF_POOL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dns_resolver.h created+116
...@@ -0,0 +1,116 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* DNS resolver interface definitions.
3 *
4 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public Licence
9 * as published by the Free Software Foundation; either version
10 * 2 of the Licence, or (at your option) any later version.
11 */
12
13#ifndef _LINUX_DNS_RESOLVER_H
14#define _LINUX_DNS_RESOLVER_H
15
16#include <linux/types.h>
17
18/*
19 * Type of payload.
20 */
21enum dns_payload_content_type {
22 DNS_PAYLOAD_IS_SERVER_LIST = 0, /* List of servers, requested by srv=1 */
23};
24
25/*
26 * Type of address that might be found in an address record.
27 */
28enum dns_payload_address_type {
29 DNS_ADDRESS_IS_IPV4 = 0, /* 4-byte AF_INET address */
30 DNS_ADDRESS_IS_IPV6 = 1, /* 16-byte AF_INET6 address */
31};
32
33/*
34 * Type of protocol used to access a server.
35 */
36enum dns_payload_protocol_type {
37 DNS_SERVER_PROTOCOL_UNSPECIFIED = 0,
38 DNS_SERVER_PROTOCOL_UDP = 1, /* Use UDP to talk to the server */
39 DNS_SERVER_PROTOCOL_TCP = 2, /* Use TCP to talk to the server */
40};
41
42/*
43 * Source of record included in DNS resolver payload.
44 */
45enum dns_record_source {
46 DNS_RECORD_UNAVAILABLE = 0, /* No source available (empty record) */
47 DNS_RECORD_FROM_CONFIG = 1, /* From local configuration data */
48 DNS_RECORD_FROM_DNS_A = 2, /* From DNS A or AAAA record */
49 DNS_RECORD_FROM_DNS_AFSDB = 3, /* From DNS AFSDB record */
50 DNS_RECORD_FROM_DNS_SRV = 4, /* From DNS SRV record */
51 DNS_RECORD_FROM_NSS = 5, /* From NSS */
52 NR__dns_record_source
53};
54
55/*
56 * Status of record included in DNS resolver payload.
57 */
58enum dns_lookup_status {
59 DNS_LOOKUP_NOT_DONE = 0, /* No lookup has been made */
60 DNS_LOOKUP_GOOD = 1, /* Good records obtained */
61 DNS_LOOKUP_GOOD_WITH_BAD = 2, /* Good records, some decoding errors */
62 DNS_LOOKUP_BAD = 3, /* Couldn't decode results */
63 DNS_LOOKUP_GOT_NOT_FOUND = 4, /* Got a "Not Found" result */
64 DNS_LOOKUP_GOT_LOCAL_FAILURE = 5, /* Local failure during lookup */
65 DNS_LOOKUP_GOT_TEMP_FAILURE = 6, /* Temporary failure during lookup */
66 DNS_LOOKUP_GOT_NS_FAILURE = 7, /* Name server failure */
67 NR__dns_lookup_status
68};
69
70/*
71 * Header at the beginning of binary format payload.
72 */
73struct dns_payload_header {
74 __u8 zero; /* Zero byte: marks this as not being text */
75 __u8 content; /* enum dns_payload_content_type */
76 __u8 version; /* Encoding version */
77} __attribute__((packed));
78
79/*
80 * Header at the beginning of a V1 server list. This is followed directly by
81 * the server records. Each server records begins with a struct of type
82 * dns_server_list_v1_server.
83 */
84struct dns_server_list_v1_header {
85 struct dns_payload_header hdr;
86 __u8 source; /* enum dns_record_source */
87 __u8 status; /* enum dns_lookup_status */
88 __u8 nr_servers; /* Number of server records following this */
89} __attribute__((packed));
90
91/*
92 * Header at the beginning of each V1 server record. This is followed by the
93 * characters of the name with no NUL-terminator, followed by the address
94 * records for that server. Each address record begins with a struct of type
95 * struct dns_server_list_v1_address.
96 */
97struct dns_server_list_v1_server {
98 __u16 name_len; /* Length of name (LE) */
99 __u16 priority; /* Priority (as SRV record) (LE) */
100 __u16 weight; /* Weight (as SRV record) (LE) */
101 __u16 port; /* UDP/TCP port number (LE) */
102 __u8 source; /* enum dns_record_source */
103 __u8 status; /* enum dns_lookup_status */
104 __u8 protocol; /* enum dns_payload_protocol_type */
105 __u8 nr_addrs;
106} __attribute__((packed));
107
108/*
109 * Header at the beginning of each V1 address record. This is followed by the
110 * bytes of the address, 4 for IPV4 and 16 for IPV6.
111 */
112struct dns_server_list_v1_address {
113 __u8 address_type; /* enum dns_payload_address_type */
114} __attribute__((packed));
115
116#endif /* _LINUX_DNS_RESOLVER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dqblk_xfs.h+17-4
...@@ -61,12 +61,16 @@ typedef struct fs_disk_quota {...@@ -61,12 +61,16 @@ typedef struct fs_disk_quota {
61 __u64 d_ino_softlimit;/* preferred inode limit */61 __u64 d_ino_softlimit;/* preferred inode limit */
62 __u64 d_bcount; /* # disk blocks owned by the user */62 __u64 d_bcount; /* # disk blocks owned by the user */
63 __u64 d_icount; /* # inodes owned by the user */63 __u64 d_icount; /* # inodes owned by the user */
64 __s32 d_itimer; /* zero if within inode limits */64 __s32 d_itimer; /* Zero if within inode limits. If
65 /* if not, we refuse service */65 * not, we refuse service at this time
66 * (in seconds since Unix epoch) */
66 __s32 d_btimer; /* similar to above; for disk blocks */67 __s32 d_btimer; /* similar to above; for disk blocks */
67 __u16 d_iwarns; /* # warnings issued wrt num inodes */68 __u16 d_iwarns; /* # warnings issued wrt num inodes */
68 __u16 d_bwarns; /* # warnings issued wrt disk blocks */69 __u16 d_bwarns; /* # warnings issued wrt disk blocks */
69 __s32 d_padding2; /* padding2 - for future use */70 __s8 d_itimer_hi; /* upper 8 bits of timer values */
71 __s8 d_btimer_hi;
72 __s8 d_rtbtimer_hi;
73 __s8 d_padding2; /* padding2 - for future use */
70 __u64 d_rtb_hardlimit;/* absolute limit on realtime blks */74 __u64 d_rtb_hardlimit;/* absolute limit on realtime blks */
71 __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */75 __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */
72 __u64 d_rtbcount; /* # realtime blocks owned */76 __u64 d_rtbcount; /* # realtime blocks owned */
...@@ -121,6 +125,12 @@ typedef struct fs_disk_quota {...@@ -121,6 +125,12 @@ typedef struct fs_disk_quota {
121#define FS_DQ_RTBCOUNT (1<<14)125#define FS_DQ_RTBCOUNT (1<<14)
122#define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT)126#define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT)
123127
128/*
129 * Quota expiration timestamps are 40-bit signed integers, with the upper 8
130 * bits encoded in the _hi fields.
131 */
132#define FS_DQ_BIGTIME (1<<15)
133
124/*134/*
125 * Various flags related to quotactl(2).135 * Various flags related to quotactl(2).
126 */136 */
...@@ -209,7 +219,10 @@ struct fs_quota_statv {...@@ -209,7 +219,10 @@ struct fs_quota_statv {
209 __s32 qs_rtbtimelimit;/* limit for rt blks timer */219 __s32 qs_rtbtimelimit;/* limit for rt blks timer */
210 __u16 qs_bwarnlimit; /* limit for num warnings */220 __u16 qs_bwarnlimit; /* limit for num warnings */
211 __u16 qs_iwarnlimit; /* limit for num warnings */221 __u16 qs_iwarnlimit; /* limit for num warnings */
212 __u64 qs_pad2[8]; /* for future proofing */222 __u16 qs_rtbwarnlimit;/* limit for rt blks warnings */
223 __u16 qs_pad3;
224 __u32 qs_pad4;
225 __u64 qs_pad2[7]; /* for future proofing */
213};226};
214227
215#endif /* _LINUX_DQBLK_XFS_H */228#endif /* _LINUX_DQBLK_XFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dvb/audio.h+4-2
...@@ -1,6 +1,8 @@...@@ -1,6 +1,8 @@
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
2/*2/*
3 * audio.h3 * audio.h - DEPRECATED MPEG-TS audio decoder API
4 *
5 * NOTE: should not be used on future drivers
4 *6 *
5 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>7 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
6 * & Marcus Metzler <marcus@convergence.de>8 * & Marcus Metzler <marcus@convergence.de>
...@@ -52,7 +54,7 @@ typedef enum {...@@ -52,7 +54,7 @@ typedef enum {
52typedef struct audio_mixer {54typedef struct audio_mixer {
53 unsigned int volume_left;55 unsigned int volume_left;
54 unsigned int volume_right;56 unsigned int volume_right;
55 // what else do we need? bass, pass-through, ...57 /* what else do we need? bass, pass-through, ... */
56} audio_mixer_t;58} audio_mixer_t;
5759
5860
lib/libc/include/any-linux-any/linux/dvb/osd.h+105-69
...@@ -1,6 +1,8 @@...@@ -1,6 +1,8 @@
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
2/*2/*
3 * osd.h3 * osd.h - DEPRECATED On Screen Display API
4 *
5 * NOTE: should not be used on future drivers
4 *6 *
5 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>7 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
6 * & Marcus Metzler <marcus@convergence.de>8 * & Marcus Metzler <marcus@convergence.de>
...@@ -28,74 +30,108 @@...@@ -28,74 +30,108 @@
2830
2931
30typedef enum {32typedef enum {
31 // All functions return -2 on "not open"33 /* All functions return -2 on "not open" */
32 OSD_Close=1, // ()34 OSD_Close = 1, /* () */
33 // Disables OSD and releases the buffers35 /*
34 // returns 0 on success36 * Disables OSD and releases the buffers
35 OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))37 * returns 0 on success
36 // Opens OSD with this size and bit depth38 */
37 // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"39 OSD_Open, /* (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) */
38 OSD_Show, // ()40 /*
39 // enables OSD mode41 * Opens OSD with this size and bit depth
40 // returns 0 on success42 * returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
41 OSD_Hide, // ()43 */
42 // disables OSD mode44 OSD_Show, /* () */
43 // returns 0 on success45 /*
44 OSD_Clear, // ()46 * enables OSD mode
45 // Sets all pixel to color 047 * returns 0 on success
46 // returns 0 on success48 */
47 OSD_Fill, // (color)49 OSD_Hide, /* () */
48 // Sets all pixel to color <col>50 /*
49 // returns 0 on success51 * disables OSD mode
50 OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})52 * returns 0 on success
51 // set palette entry <num> to <r,g,b>, <mix> and <trans> apply53 */
52 // R,G,B: 0..25554 OSD_Clear, /* () */
53 // R=Red, G=Green, B=Blue55 /*
54 // opacity=0: pixel opacity 0% (only video pixel shows)56 * Sets all pixel to color 0
55 // opacity=1..254: pixel opacity as specified in header57 * returns 0 on success
56 // opacity=255: pixel opacity 100% (only OSD pixel shows)58 */
57 // returns 0 on success, -1 on error59 OSD_Fill, /* (color) */
58 OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)60 /*
59 // Set a number of entries in the palette61 * Sets all pixel to color <col>
60 // sets the entries "firstcolor" through "lastcolor" from the array "data"62 * returns 0 on success
61 // data has 4 byte for each color:63 */
62 // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel64 OSD_SetColor, /* (color,R{x0},G{y0},B{x1},opacity{y1}) */
63 OSD_SetTrans, // (transparency{color})65 /*
64 // Sets transparency of mixed pixel (0..15)66 * set palette entry <num> to <r,g,b>, <mix> and <trans> apply
65 // returns 0 on success67 * R,G,B: 0..255
66 OSD_SetPixel, // (x0,y0,color)68 * R=Red, G=Green, B=Blue
67 // sets pixel <x>,<y> to color number <col>69 * opacity=0: pixel opacity 0% (only video pixel shows)
68 // returns 0 on success, -1 on error70 * opacity=1..254: pixel opacity as specified in header
69 OSD_GetPixel, // (x0,y0)71 * opacity=255: pixel opacity 100% (only OSD pixel shows)
70 // returns color number of pixel <x>,<y>, or -172 * returns 0 on success, -1 on error
71 OSD_SetRow, // (x0,y0,x1,data)73 */
72 // fills pixels x0,y through x1,y with the content of data[]74 OSD_SetPalette, /* (firstcolor{color},lastcolor{x0},data) */
73 // returns 0 on success, -1 on clipping all pixel (no pixel drawn)75 /*
74 OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)76 * Set a number of entries in the palette
75 // fills pixels x0,y0 through x1,y1 with the content of data[]77 * sets the entries "firstcolor" through "lastcolor" from the array "data"
76 // inc contains the width of one line in the data block,78 * data has 4 byte for each color:
77 // inc<=0 uses blockwidth as linewidth79 * R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
78 // returns 0 on success, -1 on clipping all pixel80 */
79 OSD_FillRow, // (x0,y0,x1,color)81 OSD_SetTrans, /* (transparency{color}) */
80 // fills pixels x0,y through x1,y with the color <col>82 /*
81 // returns 0 on success, -1 on clipping all pixel83 * Sets transparency of mixed pixel (0..15)
82 OSD_FillBlock, // (x0,y0,x1,y1,color)84 * returns 0 on success
83 // fills pixels x0,y0 through x1,y1 with the color <col>85 */
84 // returns 0 on success, -1 on clipping all pixel86 OSD_SetPixel, /* (x0,y0,color) */
85 OSD_Line, // (x0,y0,x1,y1,color)87 /*
86 // draw a line from x0,y0 to x1,y1 with the color <col>88 * sets pixel <x>,<y> to color number <col>
87 // returns 0 on success89 * returns 0 on success, -1 on error
88 OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=1190 */
89 // fills parameters with the picture dimensions and the pixel aspect ratio91 OSD_GetPixel, /* (x0,y0) */
90 // returns 0 on success92 /* returns color number of pixel <x>,<y>, or -1 */
91 OSD_Test, // ()93 OSD_SetRow, /* (x0,y0,x1,data) */
92 // draws a test picture. for debugging purposes only94 /*
93 // returns 0 on success95 * fills pixels x0,y through x1,y with the content of data[]
94// TODO: remove "test" in final version96 * returns 0 on success, -1 on clipping all pixel (no pixel drawn)
95 OSD_Text, // (x0,y0,size,color,text)97 */
96 OSD_SetWindow, // (x0) set window with number 0<x0<8 as current98 OSD_SetBlock, /* (x0,y0,x1,y1,increment{color},data) */
97 OSD_MoveWindow, // move current window to (x0, y0)99 /*
98 OSD_OpenRaw, // Open other types of OSD windows100 * fills pixels x0,y0 through x1,y1 with the content of data[]
101 * inc contains the width of one line in the data block,
102 * inc<=0 uses blockwidth as linewidth
103 * returns 0 on success, -1 on clipping all pixel
104 */
105 OSD_FillRow, /* (x0,y0,x1,color) */
106 /*
107 * fills pixels x0,y through x1,y with the color <col>
108 * returns 0 on success, -1 on clipping all pixel
109 */
110 OSD_FillBlock, /* (x0,y0,x1,y1,color) */
111 /*
112 * fills pixels x0,y0 through x1,y1 with the color <col>
113 * returns 0 on success, -1 on clipping all pixel
114 */
115 OSD_Line, /* (x0,y0,x1,y1,color) */
116 /*
117 * draw a line from x0,y0 to x1,y1 with the color <col>
118 * returns 0 on success
119 */
120 OSD_Query, /* (x0,y0,x1,y1,xasp{color}}), yasp=11 */
121 /*
122 * fills parameters with the picture dimensions and the pixel aspect ratio
123 * returns 0 on success
124 */
125 OSD_Test, /* () */
126 /*
127 * draws a test picture. for debugging purposes only
128 * returns 0 on success
129 * TODO: remove "test" in final version
130 */
131 OSD_Text, /* (x0,y0,size,color,text) */
132 OSD_SetWindow, /* (x0) set window with number 0<x0<8 as current */
133 OSD_MoveWindow, /* move current window to (x0, y0) */
134 OSD_OpenRaw, /* Open other types of OSD windows */
99} OSD_Command;135} OSD_Command;
100136
101typedef struct osd_cmd_s {137typedef struct osd_cmd_s {
lib/libc/include/any-linux-any/linux/dvb/video.h+3-1
...@@ -1,6 +1,8 @@...@@ -1,6 +1,8 @@
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
2/*2/*
3 * video.h3 * video.h - DEPRECATED MPEG-TS video decoder API
4 *
5 * NOTE: should not be used on future drivers
4 *6 *
5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>7 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
6 * & Ralph Metzler <ralph@convergence.de>8 * & Ralph Metzler <ralph@convergence.de>
lib/libc/include/any-linux-any/linux/elf-em.h+9
...@@ -34,14 +34,23 @@...@@ -34,14 +34,23 @@
34#define EM_M32R 88 /* Renesas M32R */34#define EM_M32R 88 /* Renesas M32R */
35#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */35#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */
36#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */36#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
37#define EM_ARCOMPACT 93 /* ARCompact processor */
38#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
37#define EM_BLACKFIN 106 /* ADI Blackfin Processor */39#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
40#define EM_UNICORE 110 /* UniCore-32 */
38#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */41#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
39#define EM_TI_C6000 140 /* TI C6X DSPs */42#define EM_TI_C6000 140 /* TI C6X DSPs */
43#define EM_HEXAGON 164 /* QUALCOMM Hexagon */
44#define EM_NDS32 167 /* Andes Technology compact code size
45 embedded RISC processor family */
40#define EM_AARCH64 183 /* ARM 64 bit */46#define EM_AARCH64 183 /* ARM 64 bit */
41#define EM_TILEPRO 188 /* Tilera TILEPro */47#define EM_TILEPRO 188 /* Tilera TILEPro */
42#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */48#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
43#define EM_TILEGX 191 /* Tilera TILE-Gx */49#define EM_TILEGX 191 /* Tilera TILE-Gx */
50#define EM_ARCV2 195 /* ARCv2 Cores */
51#define EM_RISCV 243 /* RISC-V */
44#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */52#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */
53#define EM_CSKY 252 /* C-SKY */
45#define EM_FRV 0x5441 /* Fujitsu FR-V */54#define EM_FRV 0x5441 /* Fujitsu FR-V */
4655
47/*56/*
lib/libc/include/any-linux-any/linux/elf.h+18-1
...@@ -36,6 +36,7 @@ typedef __s64 Elf64_Sxword;...@@ -36,6 +36,7 @@ typedef __s64 Elf64_Sxword;
36#define PT_LOPROC 0x7000000036#define PT_LOPROC 0x70000000
37#define PT_HIPROC 0x7fffffff37#define PT_HIPROC 0x7fffffff
38#define PT_GNU_EH_FRAME 0x6474e55038#define PT_GNU_EH_FRAME 0x6474e550
39#define PT_GNU_PROPERTY 0x6474e553
3940
40#define PT_GNU_STACK (PT_LOOS + 0x474e551)41#define PT_GNU_STACK (PT_LOOS + 0x474e551)
4142
...@@ -52,7 +53,7 @@ typedef __s64 Elf64_Sxword;...@@ -52,7 +53,7 @@ typedef __s64 Elf64_Sxword;
52 *53 *
53 * - Oracle: Linker and Libraries.54 * - Oracle: Linker and Libraries.
54 * Part No: 817–1984–19, August 2011.55 * Part No: 817–1984–19, August 2011.
55 * http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf56 * https://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
56 *57 *
57 * - System V ABI AMD64 Architecture Processor Supplement58 * - System V ABI AMD64 Architecture Processor Supplement
58 * Draft Version 0.99.4,59 * Draft Version 0.99.4,
...@@ -367,6 +368,7 @@ typedef struct elf64_shdr {...@@ -367,6 +368,7 @@ typedef struct elf64_shdr {
367 * Notes used in ET_CORE. Architectures export some of the arch register sets368 * Notes used in ET_CORE. Architectures export some of the arch register sets
368 * using the corresponding note types via the PTRACE_GETREGSET and369 * using the corresponding note types via the PTRACE_GETREGSET and
369 * PTRACE_SETREGSET requests.370 * PTRACE_SETREGSET requests.
371 * The note name for all these is "LINUX".
370 */372 */
371#define NT_PRSTATUS 1373#define NT_PRSTATUS 1
372#define NT_PRFPREG 2374#define NT_PRFPREG 2
...@@ -420,10 +422,19 @@ typedef struct elf64_shdr {...@@ -420,10 +422,19 @@ typedef struct elf64_shdr {
420#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */422#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
421#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */423#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
422#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */424#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
425#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */
426#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication address keys */
427#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */
428#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */
429#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */
423#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */430#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
424#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */431#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
425#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */432#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
426#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */433#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
434#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
435
436/* Note types with note name "GNU" */
437#define NT_GNU_PROPERTY_TYPE_0 5
427438
428/* Note header in a PT_NOTE section */439/* Note header in a PT_NOTE section */
429typedef struct elf32_note {440typedef struct elf32_note {
...@@ -439,4 +450,10 @@ typedef struct elf64_note {...@@ -439,4 +450,10 @@ typedef struct elf64_note {
439 Elf64_Word n_type; /* Content type */450 Elf64_Word n_type; /* Content type */
440} Elf64_Nhdr;451} Elf64_Nhdr;
441452
453/* .note.gnu.property types for EM_AARCH64: */
454#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
455
456/* Bits for GNU_PROPERTY_AARCH64_FEATURE_1_BTI */
457#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
458
442#endif /* _LINUX_ELF_H */459#endif /* _LINUX_ELF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/elfcore.h deleted-97
...@@ -1,97 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_ELFCORE_H
3#define _LINUX_ELFCORE_H
4
5#include <linux/types.h>
6#include <linux/signal.h>
7#include <linux/time.h>
8#include <linux/ptrace.h>
9#include <linux/elf.h>
10#include <linux/fs.h>
11
12struct elf_siginfo
13{
14 int si_signo; /* signal number */
15 int si_code; /* extra code */
16 int si_errno; /* errno */
17};
18
19
20typedef elf_greg_t greg_t;
21typedef elf_gregset_t gregset_t;
22typedef elf_fpregset_t fpregset_t;
23typedef elf_fpxregset_t fpxregset_t;
24#define NGREG ELF_NGREG
25
26/*
27 * Definitions to generate Intel SVR4-like core files.
28 * These mostly have the same names as the SVR4 types with "elf_"
29 * tacked on the front to prevent clashes with linux definitions,
30 * and the typedef forms have been avoided. This is mostly like
31 * the SVR4 structure, but more Linuxy, with things that Linux does
32 * not support and which gdb doesn't really use excluded.
33 * Fields present but not used are marked with "XXX".
34 */
35struct elf_prstatus
36{
37#if 0
38 long pr_flags; /* XXX Process flags */
39 short pr_why; /* XXX Reason for process halt */
40 short pr_what; /* XXX More detailed reason */
41#endif
42 struct elf_siginfo pr_info; /* Info associated with signal */
43 short pr_cursig; /* Current signal */
44 unsigned long pr_sigpend; /* Set of pending signals */
45 unsigned long pr_sighold; /* Set of held signals */
46#if 0
47 struct sigaltstack pr_altstack; /* Alternate stack info */
48 struct sigaction pr_action; /* Signal action for current sig */
49#endif
50 pid_t pr_pid;
51 pid_t pr_ppid;
52 pid_t pr_pgrp;
53 pid_t pr_sid;
54 struct timeval pr_utime; /* User time */
55 struct timeval pr_stime; /* System time */
56 struct timeval pr_cutime; /* Cumulative user time */
57 struct timeval pr_cstime; /* Cumulative system time */
58#if 0
59 long pr_instr; /* Current instruction */
60#endif
61 elf_gregset_t pr_reg; /* GP registers */
62#ifdef CONFIG_BINFMT_ELF_FDPIC
63 /* When using FDPIC, the loadmap addresses need to be communicated
64 * to GDB in order for GDB to do the necessary relocations. The
65 * fields (below) used to communicate this information are placed
66 * immediately after ``pr_reg'', so that the loadmap addresses may
67 * be viewed as part of the register set if so desired.
68 */
69 unsigned long pr_exec_fdpic_loadmap;
70 unsigned long pr_interp_fdpic_loadmap;
71#endif
72 int pr_fpvalid; /* True if math co-processor being used. */
73};
74
75#define ELF_PRARGSZ (80) /* Number of chars for args */
76
77struct elf_prpsinfo
78{
79 char pr_state; /* numeric process state */
80 char pr_sname; /* char for pr_state */
81 char pr_zomb; /* zombie */
82 char pr_nice; /* nice val */
83 unsigned long pr_flag; /* flags */
84 __kernel_uid_t pr_uid;
85 __kernel_gid_t pr_gid;
86 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
87 /* Lots missing */
88 char pr_fname[16]; /* filename of executable */
89 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
90};
91
92typedef struct elf_prstatus prstatus_t;
93typedef struct elf_prpsinfo prpsinfo_t;
94#define PRARGSZ ELF_PRARGSZ
95
96
97#endif /* _LINUX_ELFCORE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/errqueue.h+22-2
...@@ -3,6 +3,14 @@...@@ -3,6 +3,14 @@
3#define _LINUX_ERRQUEUE_H3#define _LINUX_ERRQUEUE_H
44
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/time_types.h>
7
8/* RFC 4884: return offset to extension struct + validation */
9struct sock_ee_data_rfc4884 {
10 __u16 len;
11 __u8 flags;
12 __u8 reserved;
13};
614
7struct sock_extended_err {15struct sock_extended_err {
8 __u32 ee_errno; 16 __u32 ee_errno;
...@@ -11,7 +19,10 @@ struct sock_extended_err {...@@ -11,7 +19,10 @@ struct sock_extended_err {
11 __u8 ee_code;19 __u8 ee_code;
12 __u8 ee_pad;20 __u8 ee_pad;
13 __u32 ee_info;21 __u32 ee_info;
14 __u32 ee_data;22 union {
23 __u32 ee_data;
24 struct sock_ee_data_rfc4884 ee_rfc4884;
25 };
15};26};
1627
17#define SO_EE_ORIGIN_NONE 028#define SO_EE_ORIGIN_NONE 0
...@@ -30,17 +41,26 @@ struct sock_extended_err {...@@ -30,17 +41,26 @@ struct sock_extended_err {
30#define SO_EE_CODE_TXTIME_INVALID_PARAM 141#define SO_EE_CODE_TXTIME_INVALID_PARAM 1
31#define SO_EE_CODE_TXTIME_MISSED 242#define SO_EE_CODE_TXTIME_MISSED 2
3243
44#define SO_EE_RFC4884_FLAG_INVALID 1
45
33/**46/**
34 * struct scm_timestamping - timestamps exposed through cmsg47 * struct scm_timestamping - timestamps exposed through cmsg
35 *48 *
36 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*49 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*
37 * communicate network timestamps by passing this struct in a cmsg with50 * communicate network timestamps by passing this struct in a cmsg with
38 * recvmsg(). See Documentation/networking/timestamping.txt for details.51 * recvmsg(). See Documentation/networking/timestamping.rst for details.
52 * User space sees a timespec definition that matches either
53 * __kernel_timespec or __kernel_old_timespec, in the kernel we
54 * require two structure definitions to provide both.
39 */55 */
40struct scm_timestamping {56struct scm_timestamping {
41 struct timespec ts[3];57 struct timespec ts[3];
42};58};
4359
60struct scm_timestamping64 {
61 struct __kernel_timespec ts[3];
62};
63
44/* The type of scm_timestamping, passed in sock_extended_err ee_info.64/* The type of scm_timestamping, passed in sock_extended_err ee_info.
45 * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0]65 * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0]
46 * is zero, then this is a hardware timestamp and recorded in ts[2].66 * is zero, then this is a hardware timestamp and recorded in ts[2].
lib/libc/include/any-linux-any/linux/ethtool.h+287-40
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14#ifndef _LINUX_ETHTOOL_H14#ifndef _LINUX_ETHTOOL_H
15#define _LINUX_ETHTOOL_H15#define _LINUX_ETHTOOL_H
1616
17#include <linux/kernel.h>17#include <linux/const.h>
18#include <linux/types.h>18#include <linux/types.h>
19#include <linux/if_ether.h>19#include <linux/if_ether.h>
2020
...@@ -24,6 +24,14 @@...@@ -24,6 +24,14 @@
24 * have the same layout for 32-bit and 64-bit userland.24 * have the same layout for 32-bit and 64-bit userland.
25 */25 */
2626
27/* Note on reserved space.
28 * Reserved fields must not be accessed directly by user space because
29 * they may be replaced by a different field in the future. They must
30 * be initialized to zero before making the request, e.g. via memset
31 * of the entire structure or implicitly by not being set in a structure
32 * initializer.
33 */
34
27/**35/**
28 * struct ethtool_cmd - DEPRECATED, link control and status36 * struct ethtool_cmd - DEPRECATED, link control and status
29 * This structure is DEPRECATED, please use struct ethtool_link_settings.37 * This structure is DEPRECATED, please use struct ethtool_link_settings.
...@@ -65,6 +73,7 @@...@@ -65,6 +73,7 @@
65 * and other link features that the link partner advertised73 * and other link features that the link partner advertised
66 * through autonegotiation; 0 if unknown or not applicable.74 * through autonegotiation; 0 if unknown or not applicable.
67 * Read-only.75 * Read-only.
76 * @reserved: Reserved for future use; see the note on reserved space.
68 *77 *
69 * The link speed in Mbps is split between @speed and @speed_hi. Use78 * The link speed in Mbps is split between @speed and @speed_hi. Use
70 * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to79 * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
...@@ -89,10 +98,6 @@...@@ -89,10 +98,6 @@
89 * %ETHTOOL_GSET to get the current values before making specific98 * %ETHTOOL_GSET to get the current values before making specific
90 * changes and then applying them with %ETHTOOL_SSET.99 * changes and then applying them with %ETHTOOL_SSET.
91 *100 *
92 * Drivers that implement set_settings() should validate all fields
93 * other than @cmd that are not described as read-only or deprecated,
94 * and must ignore all fields described as read-only.
95 *
96 * Deprecated fields should be ignored by both users and drivers.101 * Deprecated fields should be ignored by both users and drivers.
97 */102 */
98struct ethtool_cmd {103struct ethtool_cmd {
...@@ -157,6 +162,7 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)...@@ -157,6 +162,7 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
157 * @bus_info: Device bus address. This should match the dev_name()162 * @bus_info: Device bus address. This should match the dev_name()
158 * string for the underlying bus device, if there is one. May be163 * string for the underlying bus device, if there is one. May be
159 * an empty string.164 * an empty string.
165 * @reserved2: Reserved for future use; see the note on reserved space.
160 * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and166 * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
161 * %ETHTOOL_SPFLAGS commands; also the number of strings in the167 * %ETHTOOL_SPFLAGS commands; also the number of strings in the
162 * %ETH_SS_PRIV_FLAGS set168 * %ETH_SS_PRIV_FLAGS set
...@@ -225,7 +231,7 @@ enum tunable_id {...@@ -225,7 +231,7 @@ enum tunable_id {
225 ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */231 ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
226 /*232 /*
227 * Add your fresh new tunable attribute above and remember to update233 * Add your fresh new tunable attribute above and remember to update
228 * tunable_strings[] in net/core/ethtool.c234 * tunable_strings[] in net/ethtool/common.c
229 */235 */
230 __ETHTOOL_TUNABLE_COUNT,236 __ETHTOOL_TUNABLE_COUNT,
231};237};
...@@ -254,12 +260,42 @@ struct ethtool_tunable {...@@ -254,12 +260,42 @@ struct ethtool_tunable {
254#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff260#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
255#define DOWNSHIFT_DEV_DISABLE 0261#define DOWNSHIFT_DEV_DISABLE 0
256262
263/* Time in msecs after which link is reported as down
264 * 0 = lowest time supported by the PHY
265 * 0xff = off, link down detection according to standard
266 */
267#define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0
268#define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff
269
270/* Energy Detect Power Down (EDPD) is a feature supported by some PHYs, where
271 * the PHY's RX & TX blocks are put into a low-power mode when there is no
272 * link detected (typically cable is un-plugged). For RX, only a minimal
273 * link-detection is available, and for TX the PHY wakes up to send link pulses
274 * to avoid any lock-ups in case the peer PHY may also be running in EDPD mode.
275 *
276 * Some PHYs may support configuration of the wake-up interval for TX pulses,
277 * and some PHYs may support only disabling TX pulses entirely. For the latter
278 * a special value is required (ETHTOOL_PHY_EDPD_NO_TX) so that this can be
279 * configured from userspace (should the user want it).
280 *
281 * The interval units for TX wake-up are in milliseconds, since this should
282 * cover a reasonable range of intervals:
283 * - from 1 millisecond, which does not sound like much of a power-saver
284 * - to ~65 seconds which is quite a lot to wait for a link to come up when
285 * plugging a cable
286 */
287#define ETHTOOL_PHY_EDPD_DFLT_TX_MSECS 0xffff
288#define ETHTOOL_PHY_EDPD_NO_TX 0xfffe
289#define ETHTOOL_PHY_EDPD_DISABLE 0
290
257enum phy_tunable_id {291enum phy_tunable_id {
258 ETHTOOL_PHY_ID_UNSPEC,292 ETHTOOL_PHY_ID_UNSPEC,
259 ETHTOOL_PHY_DOWNSHIFT,293 ETHTOOL_PHY_DOWNSHIFT,
294 ETHTOOL_PHY_FAST_LINK_DOWN,
295 ETHTOOL_PHY_EDPD,
260 /*296 /*
261 * Add your fresh new phy tunable attribute above and remember to update297 * Add your fresh new phy tunable attribute above and remember to update
262 * phy_tunable_strings[] in net/core/ethtool.c298 * phy_tunable_strings[] in net/ethtool/common.c
263 */299 */
264 __ETHTOOL_PHY_TUNABLE_COUNT,300 __ETHTOOL_PHY_TUNABLE_COUNT,
265};301};
...@@ -328,6 +364,7 @@ struct ethtool_eeprom {...@@ -328,6 +364,7 @@ struct ethtool_eeprom {
328 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting364 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
329 * its tx lpi (after reaching 'idle' state). Effective only when eee365 * its tx lpi (after reaching 'idle' state). Effective only when eee
330 * was negotiated and tx_lpi_enabled was set.366 * was negotiated and tx_lpi_enabled was set.
367 * @reserved: Reserved for future use; see the note on reserved space.
331 */368 */
332struct ethtool_eee {369struct ethtool_eee {
333 __u32 cmd;370 __u32 cmd;
...@@ -346,6 +383,7 @@ struct ethtool_eee {...@@ -346,6 +383,7 @@ struct ethtool_eee {
346 * @cmd: %ETHTOOL_GMODULEINFO383 * @cmd: %ETHTOOL_GMODULEINFO
347 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx384 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
348 * @eeprom_len: Length of the eeprom385 * @eeprom_len: Length of the eeprom
386 * @reserved: Reserved for future use; see the note on reserved space.
349 *387 *
350 * This structure is used to return the information to388 * This structure is used to return the information to
351 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.389 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
...@@ -551,6 +589,70 @@ struct ethtool_pauseparam {...@@ -551,6 +589,70 @@ struct ethtool_pauseparam {
551 __u32 tx_pause;589 __u32 tx_pause;
552};590};
553591
592/* Link extended state */
593enum ethtool_link_ext_state {
594 ETHTOOL_LINK_EXT_STATE_AUTONEG,
595 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,
596 ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH,
597 ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY,
598 ETHTOOL_LINK_EXT_STATE_NO_CABLE,
599 ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE,
600 ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE,
601 ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE,
602 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
603 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
604 ETHTOOL_LINK_EXT_STATE_MODULE,
605};
606
607/* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */
608enum ethtool_link_ext_substate_autoneg {
609 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
610 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
611 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED,
612 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE,
613 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE,
614 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
615};
616
617/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE.
618 */
619enum ethtool_link_ext_substate_link_training {
620 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
621 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT,
622 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY,
623 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
624};
625
626/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH.
627 */
628enum ethtool_link_ext_substate_link_logical_mismatch {
629 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
630 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK,
631 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS,
632 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED,
633 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
634};
635
636/* More information in addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY.
637 */
638enum ethtool_link_ext_substate_bad_signal_integrity {
639 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
640 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
641 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST,
642 ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS,
643};
644
645/* More information in addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE. */
646enum ethtool_link_ext_substate_cable_issue {
647 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
648 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
649};
650
651/* More information in addition to ETHTOOL_LINK_EXT_STATE_MODULE. */
652enum ethtool_link_ext_substate_module {
653 ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1,
654};
655
554#define ETH_GSTRING_LEN 32656#define ETH_GSTRING_LEN 32
555657
556/**658/**
...@@ -563,8 +665,23 @@ struct ethtool_pauseparam {...@@ -563,8 +665,23 @@ struct ethtool_pauseparam {
563 * now deprecated665 * now deprecated
564 * @ETH_SS_FEATURES: Device feature names666 * @ETH_SS_FEATURES: Device feature names
565 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names667 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
668 * @ETH_SS_TUNABLES: tunable names
566 * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS669 * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
567 * @ETH_SS_PHY_TUNABLES: PHY tunable names670 * @ETH_SS_PHY_TUNABLES: PHY tunable names
671 * @ETH_SS_LINK_MODES: link mode names
672 * @ETH_SS_MSG_CLASSES: debug message class names
673 * @ETH_SS_WOL_MODES: wake-on-lan modes
674 * @ETH_SS_SOF_TIMESTAMPING: SOF_TIMESTAMPING_* flags
675 * @ETH_SS_TS_TX_TYPES: timestamping Tx types
676 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
677 * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types
678 * @ETH_SS_STATS_STD: standardized stats
679 * @ETH_SS_STATS_ETH_PHY: names of IEEE 802.3 PHY statistics
680 * @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics
681 * @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics
682 * @ETH_SS_STATS_RMON: names of RMON statistics
683 *
684 * @ETH_SS_COUNT: number of defined string sets
568 */685 */
569enum ethtool_stringset {686enum ethtool_stringset {
570 ETH_SS_TEST = 0,687 ETH_SS_TEST = 0,
...@@ -576,6 +693,44 @@ enum ethtool_stringset {...@@ -576,6 +693,44 @@ enum ethtool_stringset {
576 ETH_SS_TUNABLES,693 ETH_SS_TUNABLES,
577 ETH_SS_PHY_STATS,694 ETH_SS_PHY_STATS,
578 ETH_SS_PHY_TUNABLES,695 ETH_SS_PHY_TUNABLES,
696 ETH_SS_LINK_MODES,
697 ETH_SS_MSG_CLASSES,
698 ETH_SS_WOL_MODES,
699 ETH_SS_SOF_TIMESTAMPING,
700 ETH_SS_TS_TX_TYPES,
701 ETH_SS_TS_RX_FILTERS,
702 ETH_SS_UDP_TUNNEL_TYPES,
703 ETH_SS_STATS_STD,
704 ETH_SS_STATS_ETH_PHY,
705 ETH_SS_STATS_ETH_MAC,
706 ETH_SS_STATS_ETH_CTRL,
707 ETH_SS_STATS_RMON,
708
709 /* add new constants above here */
710 ETH_SS_COUNT
711};
712
713/**
714 * enum ethtool_module_power_mode_policy - plug-in module power mode policy
715 * @ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: Module is always in high power mode.
716 * @ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO: Module is transitioned by the host
717 * to high power mode when the first port using it is put administratively
718 * up and to low power mode when the last port using it is put
719 * administratively down.
720 */
721enum ethtool_module_power_mode_policy {
722 ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
723 ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO,
724};
725
726/**
727 * enum ethtool_module_power_mode - plug-in module power mode
728 * @ETHTOOL_MODULE_POWER_MODE_LOW: Module is in low power mode.
729 * @ETHTOOL_MODULE_POWER_MODE_HIGH: Module is in high power mode.
730 */
731enum ethtool_module_power_mode {
732 ETHTOOL_MODULE_POWER_MODE_LOW = 1,
733 ETHTOOL_MODULE_POWER_MODE_HIGH,
579};734};
580735
581/**736/**
...@@ -600,6 +755,7 @@ struct ethtool_gstrings {...@@ -600,6 +755,7 @@ struct ethtool_gstrings {
600/**755/**
601 * struct ethtool_sset_info - string set information756 * struct ethtool_sset_info - string set information
602 * @cmd: Command number = %ETHTOOL_GSSET_INFO757 * @cmd: Command number = %ETHTOOL_GSSET_INFO
758 * @reserved: Reserved for future use; see the note on reserved space.
603 * @sset_mask: On entry, a bitmask of string sets to query, with bits759 * @sset_mask: On entry, a bitmask of string sets to query, with bits
604 * numbered according to &enum ethtool_stringset. On return, a760 * numbered according to &enum ethtool_stringset. On return, a
605 * bitmask of those string sets queried that are supported.761 * bitmask of those string sets queried that are supported.
...@@ -644,6 +800,7 @@ enum ethtool_test_flags {...@@ -644,6 +800,7 @@ enum ethtool_test_flags {
644 * @flags: A bitmask of flags from &enum ethtool_test_flags. Some800 * @flags: A bitmask of flags from &enum ethtool_test_flags. Some
645 * flags may be set by the user on entry; others may be set by801 * flags may be set by the user on entry; others may be set by
646 * the driver on return.802 * the driver on return.
803 * @reserved: Reserved for future use; see the note on reserved space.
647 * @len: On return, the number of test results804 * @len: On return, the number of test results
648 * @data: Array of test results805 * @data: Array of test results
649 *806 *
...@@ -844,6 +1001,7 @@ union ethtool_flow_union {...@@ -844,6 +1001,7 @@ union ethtool_flow_union {
844 * @vlan_etype: VLAN EtherType1001 * @vlan_etype: VLAN EtherType
845 * @vlan_tci: VLAN tag control information1002 * @vlan_tci: VLAN tag control information
846 * @data: user defined data1003 * @data: user defined data
1004 * @padding: Reserved for future use; see the note on reserved space.
847 *1005 *
848 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT1006 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT
849 * is set in &struct ethtool_rx_flow_spec @flow_type.1007 * is set in &struct ethtool_rx_flow_spec @flow_type.
...@@ -884,7 +1042,7 @@ struct ethtool_rx_flow_spec {...@@ -884,7 +1042,7 @@ struct ethtool_rx_flow_spec {
884 __u32 location;1042 __u32 location;
885};1043};
8861044
887/* How rings are layed out when accessing virtual functions or1045/* How rings are laid out when accessing virtual functions or
888 * offloaded queues is device specific. To allow users to do flow1046 * offloaded queues is device specific. To allow users to do flow
889 * steering and specify these queues the ring cookie is partitioned1047 * steering and specify these queues the ring cookie is partitioned
890 * into a 32bit queue index with an 8 bit virtual function id.1048 * into a 32bit queue index with an 8 bit virtual function id.
...@@ -893,7 +1051,7 @@ struct ethtool_rx_flow_spec {...@@ -893,7 +1051,7 @@ struct ethtool_rx_flow_spec {
893 * devices start supporting PCIe w/ARI. However at the moment I1051 * devices start supporting PCIe w/ARI. However at the moment I
894 * do not know of any devices that support this so I do not reserve1052 * do not know of any devices that support this so I do not reserve
895 * space for this at this time. If a future patch consumes the next1053 * space for this at this time. If a future patch consumes the next
896 * byte it should be aware of this possiblity.1054 * byte it should be aware of this possibility.
897 */1055 */
898#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL1056#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
899#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL1057#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
...@@ -1019,7 +1177,8 @@ struct ethtool_rxfh_indir {...@@ -1019,7 +1177,8 @@ struct ethtool_rxfh_indir {
1019 * hardware hash key.1177 * hardware hash key.
1020 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).1178 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
1021 * Valid values are one of the %ETH_RSS_HASH_*.1179 * Valid values are one of the %ETH_RSS_HASH_*.
1022 * @rsvd: Reserved for future extensions.1180 * @rsvd8: Reserved for future use; see the note on reserved space.
1181 * @rsvd32: Reserved for future use; see the note on reserved space.
1023 * @rss_config: RX ring/queue index for each hash value i.e., indirection table1182 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
1024 * of @indir_size __u32 elements, followed by hash key of @key_size1183 * of @indir_size __u32 elements, followed by hash key of @key_size
1025 * bytes.1184 * bytes.
...@@ -1187,7 +1346,9 @@ struct ethtool_sfeatures {...@@ -1187,7 +1346,9 @@ struct ethtool_sfeatures {
1187 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags1346 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
1188 * @phc_index: device index of the associated PHC, or -1 if there is none1347 * @phc_index: device index of the associated PHC, or -1 if there is none
1189 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values1348 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
1349 * @tx_reserved: Reserved for future use; see the note on reserved space.
1190 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values1350 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
1351 * @rx_reserved: Reserved for future use; see the note on reserved space.
1191 *1352 *
1192 * The bits in the 'tx_types' and 'rx_filters' fields correspond to1353 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
1193 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,1354 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
...@@ -1261,15 +1422,33 @@ struct ethtool_per_queue_op {...@@ -1261,15 +1422,33 @@ struct ethtool_per_queue_op {
1261};1422};
12621423
1263/**1424/**
1264 * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters1425 * struct ethtool_fecparam - Ethernet Forward Error Correction parameters
1265 * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM1426 * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM
1266 * @active_fec: FEC mode which is active on porte1427 * @active_fec: FEC mode which is active on the port, single bit set, GET only.
1267 * @fec: Bitmask of supported/configured FEC modes1428 * @fec: Bitmask of configured FEC modes.
1268 * @rsvd: Reserved for future extensions. i.e FEC bypass feature.1429 * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET.
1269 *1430 *
1270 * Drivers should reject a non-zero setting of @autoneg when1431 * Note that @reserved was never validated on input and ethtool user space
1271 * autoneogotiation is disabled (or not supported) for the link.1432 * left it uninitialized when calling SET. Hence going forward it can only be
1433 * used to return a value to userspace with GET.
1434 *
1435 * FEC modes supported by the device can be read via %ETHTOOL_GLINKSETTINGS.
1436 * FEC settings are configured by link autonegotiation whenever it's enabled.
1437 * With autoneg on %ETHTOOL_GFECPARAM can be used to read the current mode.
1438 *
1439 * When autoneg is disabled %ETHTOOL_SFECPARAM controls the FEC settings.
1440 * It is recommended that drivers only accept a single bit set in @fec.
1441 * When multiple bits are set in @fec drivers may pick mode in an implementation
1442 * dependent way. Drivers should reject mixing %ETHTOOL_FEC_AUTO_BIT with other
1443 * FEC modes, because it's unclear whether in this case other modes constrain
1444 * AUTO or are independent choices.
1445 * Drivers must reject SET requests if they support none of the requested modes.
1446 *
1447 * If device does not support FEC drivers may use %ETHTOOL_FEC_NONE instead
1448 * of returning %EOPNOTSUPP from %ETHTOOL_GFECPARAM.
1272 *1449 *
1450 * See enum ethtool_fec_config_bits for definition of valid bits for both
1451 * @fec and @active_fec.
1273 */1452 */
1274struct ethtool_fecparam {1453struct ethtool_fecparam {
1275 __u32 cmd;1454 __u32 cmd;
...@@ -1281,11 +1460,16 @@ struct ethtool_fecparam {...@@ -1281,11 +1460,16 @@ struct ethtool_fecparam {
12811460
1282/**1461/**
1283 * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration1462 * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration
1284 * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported1463 * @ETHTOOL_FEC_NONE_BIT: FEC mode configuration is not supported. Should not
1285 * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver1464 * be used together with other bits. GET only.
1286 * @ETHTOOL_FEC_OFF: No FEC Mode1465 * @ETHTOOL_FEC_AUTO_BIT: Select default/best FEC mode automatically, usually
1287 * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode1466 * based link mode and SFP parameters read from module's
1288 * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode1467 * EEPROM. This bit does _not_ mean autonegotiation.
1468 * @ETHTOOL_FEC_OFF_BIT: No FEC Mode
1469 * @ETHTOOL_FEC_RS_BIT: Reed-Solomon FEC Mode
1470 * @ETHTOOL_FEC_BASER_BIT: Base-R/Reed-Solomon FEC Mode
1471 * @ETHTOOL_FEC_LLRS_BIT: Low Latency Reed Solomon FEC Mode (25G/50G Ethernet
1472 * Consortium)
1289 */1473 */
1290enum ethtool_fec_config_bits {1474enum ethtool_fec_config_bits {
1291 ETHTOOL_FEC_NONE_BIT,1475 ETHTOOL_FEC_NONE_BIT,
...@@ -1293,6 +1477,7 @@ enum ethtool_fec_config_bits {...@@ -1293,6 +1477,7 @@ enum ethtool_fec_config_bits {
1293 ETHTOOL_FEC_OFF_BIT,1477 ETHTOOL_FEC_OFF_BIT,
1294 ETHTOOL_FEC_RS_BIT,1478 ETHTOOL_FEC_RS_BIT,
1295 ETHTOOL_FEC_BASER_BIT,1479 ETHTOOL_FEC_BASER_BIT,
1480 ETHTOOL_FEC_LLRS_BIT,
1296};1481};
12971482
1298#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)1483#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
...@@ -1300,6 +1485,7 @@ enum ethtool_fec_config_bits {...@@ -1300,6 +1485,7 @@ enum ethtool_fec_config_bits {
1300#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)1485#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT)
1301#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)1486#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT)
1302#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)1487#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT)
1488#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT)
13031489
1304/* CMDs currently supported */1490/* CMDs currently supported */
1305#define ETHTOOL_GSET 0x00000001 /* DEPRECATED, Get settings.1491#define ETHTOOL_GSET 0x00000001 /* DEPRECATED, Get settings.
...@@ -1434,6 +1620,13 @@ enum ethtool_link_mode_bit_indices {...@@ -1434,6 +1620,13 @@ enum ethtool_link_mode_bit_indices {
1434 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,1620 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
1435 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,1621 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
1436 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,1622 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
1623
1624 /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
1625 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
1626 * macro for bits > 31. The only way to use indices > 31 is to
1627 * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
1628 */
1629
1437 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,1630 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
1438 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,1631 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
1439 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,1632 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
...@@ -1455,15 +1648,48 @@ enum ethtool_link_mode_bit_indices {...@@ -1455,15 +1648,48 @@ enum ethtool_link_mode_bit_indices {
1455 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,1648 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49,
1456 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,1649 ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
1457 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,1650 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
14581651 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52,
1459 /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit1652 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53,
1460 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*1653 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54,
1461 * macro for bits > 31. The only way to use indices > 31 is to1654 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55,
1462 * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.1655 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56,
1463 */1656 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57,
14641657 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58,
1465 __ETHTOOL_LINK_MODE_LAST1658 ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59,
1466 = ETHTOOL_LINK_MODE_FEC_BASER_BIT,1659 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
1660 ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61,
1661 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62,
1662 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63,
1663 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
1664 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
1665 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
1666 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67,
1667 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68,
1668 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69,
1669 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70,
1670 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
1671 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72,
1672 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73,
1673 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74,
1674 ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 75,
1675 ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 76,
1676 ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 77,
1677 ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 78,
1678 ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 79,
1679 ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 80,
1680 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 81,
1681 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 82,
1682 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 83,
1683 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 84,
1684 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 85,
1685 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 86,
1686 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
1687 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
1688 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
1689 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
1690 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
1691 /* must be last entry */
1692 __ETHTOOL_LINK_MODE_MASK_NBITS
1467};1693};
14681694
1469#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \1695#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \
...@@ -1571,12 +1797,14 @@ enum ethtool_link_mode_bit_indices {...@@ -1571,12 +1797,14 @@ enum ethtool_link_mode_bit_indices {
1571#define SPEED_50000 500001797#define SPEED_50000 50000
1572#define SPEED_56000 560001798#define SPEED_56000 56000
1573#define SPEED_100000 1000001799#define SPEED_100000 100000
1800#define SPEED_200000 200000
1801#define SPEED_400000 400000
15741802
1575#define SPEED_UNKNOWN -11803#define SPEED_UNKNOWN -1
15761804
1577static __inline__ int ethtool_validate_speed(__u32 speed)1805static __inline__ int ethtool_validate_speed(__u32 speed)
1578{1806{
1579 return speed <= INT_MAX || speed == SPEED_UNKNOWN;1807 return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
1580}1808}
15811809
1582/* Duplex, half or full. */1810/* Duplex, half or full. */
...@@ -1596,6 +1824,18 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)...@@ -1596,6 +1824,18 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
1596 return 0;1824 return 0;
1597}1825}
15981826
1827#define MASTER_SLAVE_CFG_UNSUPPORTED 0
1828#define MASTER_SLAVE_CFG_UNKNOWN 1
1829#define MASTER_SLAVE_CFG_MASTER_PREFERRED 2
1830#define MASTER_SLAVE_CFG_SLAVE_PREFERRED 3
1831#define MASTER_SLAVE_CFG_MASTER_FORCE 4
1832#define MASTER_SLAVE_CFG_SLAVE_FORCE 5
1833#define MASTER_SLAVE_STATE_UNSUPPORTED 0
1834#define MASTER_SLAVE_STATE_UNKNOWN 1
1835#define MASTER_SLAVE_STATE_MASTER 2
1836#define MASTER_SLAVE_STATE_SLAVE 3
1837#define MASTER_SLAVE_STATE_ERR 4
1838
1599/* Which connector port. */1839/* Which connector port. */
1600#define PORT_TP 0x001840#define PORT_TP 0x00
1601#define PORT_AUI 0x011841#define PORT_AUI 0x01
...@@ -1635,6 +1875,8 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)...@@ -1635,6 +1875,8 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
1635#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */1875#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1636#define WAKE_FILTER (1 << 7)1876#define WAKE_FILTER (1 << 7)
16371877
1878#define WOL_MODE_COUNT 8
1879
1638/* L2-L4 network traffic flow types */1880/* L2-L4 network traffic flow types */
1639#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */1881#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
1640#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */1882#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
...@@ -1689,6 +1931,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)...@@ -1689,6 +1931,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
1689#define ETH_MODULE_SFF_8436 0x41931#define ETH_MODULE_SFF_8436 0x4
1690#define ETH_MODULE_SFF_8436_LEN 2561932#define ETH_MODULE_SFF_8436_LEN 256
16911933
1934#define ETH_MODULE_SFF_8636_MAX_LEN 640
1935#define ETH_MODULE_SFF_8436_MAX_LEN 640
1936
1692/* Reset flags */1937/* Reset flags */
1693/* The reset() operation must clear the flags for the components which1938/* The reset() operation must clear the flags for the components which
1694 * were actually reset. On successful return, the flags indicate the1939 * were actually reset. On successful return, the flags indicate the
...@@ -1782,6 +2027,11 @@ enum ethtool_reset_flags {...@@ -1782,6 +2027,11 @@ enum ethtool_reset_flags {
1782 * autonegotiation; 0 if unknown or not applicable. Read-only.2027 * autonegotiation; 0 if unknown or not applicable. Read-only.
1783 * @transceiver: Used to distinguish different possible PHY types,2028 * @transceiver: Used to distinguish different possible PHY types,
1784 * reported consistently by PHYLIB. Read-only.2029 * reported consistently by PHYLIB. Read-only.
2030 * @master_slave_cfg: Master/slave port mode.
2031 * @master_slave_state: Master/slave port state.
2032 * @reserved: Reserved for future use; see the note on reserved space.
2033 * @reserved1: Reserved for future use; see the note on reserved space.
2034 * @link_mode_masks: Variable length bitmaps.
1785 *2035 *
1786 * If autonegotiation is disabled, the speed and @duplex represent the2036 * If autonegotiation is disabled, the speed and @duplex represent the
1787 * fixed link mode and are writable if the driver supports multiple2037 * fixed link mode and are writable if the driver supports multiple
...@@ -1798,14 +2048,9 @@ enum ethtool_reset_flags {...@@ -1798,14 +2048,9 @@ enum ethtool_reset_flags {
1798 * rejected.2048 * rejected.
1799 *2049 *
1800 * Deprecated %ethtool_cmd fields transceiver, maxtxpkt and maxrxpkt2050 * Deprecated %ethtool_cmd fields transceiver, maxtxpkt and maxrxpkt
1801 * are not available in %ethtool_link_settings. Until all drivers are2051 * are not available in %ethtool_link_settings. These fields will be
1802 * converted to ignore them or to the new %ethtool_link_settings API,2052 * always set to zero in %ETHTOOL_GSET reply and %ETHTOOL_SSET will
1803 * for both queries and changes, users should always try2053 * fail if any of them is set to non-zero value.
1804 * %ETHTOOL_GLINKSETTINGS first, and if it fails with -ENOTSUPP stick
1805 * only to %ETHTOOL_GSET and %ETHTOOL_SSET consistently. If it
1806 * succeeds, then users should stick to %ETHTOOL_GLINKSETTINGS and
1807 * %ETHTOOL_SLINKSETTINGS (which would support drivers implementing
1808 * either %ethtool_cmd or %ethtool_link_settings).
1809 *2054 *
1810 * Users should assume that all fields not marked read-only are2055 * Users should assume that all fields not marked read-only are
1811 * writable and subject to validation by the driver. They should use2056 * writable and subject to validation by the driver. They should use
...@@ -1834,7 +2079,9 @@ struct ethtool_link_settings {...@@ -1834,7 +2079,9 @@ struct ethtool_link_settings {
1834 __u8 eth_tp_mdix_ctrl;2079 __u8 eth_tp_mdix_ctrl;
1835 __s8 link_mode_masks_nwords;2080 __s8 link_mode_masks_nwords;
1836 __u8 transceiver;2081 __u8 transceiver;
1837 __u8 reserved1[3];2082 __u8 master_slave_cfg;
2083 __u8 master_slave_state;
2084 __u8 reserved1[1];
1838 __u32 reserved[7];2085 __u32 reserved[7];
1839 __u32 link_mode_masks[0];2086 __u32 link_mode_masks[0];
1840 /* layout of link_mode_masks fields:2087 /* layout of link_mode_masks fields:
lib/libc/include/any-linux-any/linux/ethtool_netlink.h created+861
...@@ -0,0 +1,861 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * include/uapi/linux/ethtool_netlink.h - netlink interface for ethtool
4 *
5 * See Documentation/networking/ethtool-netlink.rst in kernel source tree for
6 * doucumentation of the interface.
7 */
8
9#ifndef _LINUX_ETHTOOL_NETLINK_H_
10#define _LINUX_ETHTOOL_NETLINK_H_
11
12#include <linux/ethtool.h>
13
14/* message types - userspace to kernel */
15enum {
16 ETHTOOL_MSG_USER_NONE,
17 ETHTOOL_MSG_STRSET_GET,
18 ETHTOOL_MSG_LINKINFO_GET,
19 ETHTOOL_MSG_LINKINFO_SET,
20 ETHTOOL_MSG_LINKMODES_GET,
21 ETHTOOL_MSG_LINKMODES_SET,
22 ETHTOOL_MSG_LINKSTATE_GET,
23 ETHTOOL_MSG_DEBUG_GET,
24 ETHTOOL_MSG_DEBUG_SET,
25 ETHTOOL_MSG_WOL_GET,
26 ETHTOOL_MSG_WOL_SET,
27 ETHTOOL_MSG_FEATURES_GET,
28 ETHTOOL_MSG_FEATURES_SET,
29 ETHTOOL_MSG_PRIVFLAGS_GET,
30 ETHTOOL_MSG_PRIVFLAGS_SET,
31 ETHTOOL_MSG_RINGS_GET,
32 ETHTOOL_MSG_RINGS_SET,
33 ETHTOOL_MSG_CHANNELS_GET,
34 ETHTOOL_MSG_CHANNELS_SET,
35 ETHTOOL_MSG_COALESCE_GET,
36 ETHTOOL_MSG_COALESCE_SET,
37 ETHTOOL_MSG_PAUSE_GET,
38 ETHTOOL_MSG_PAUSE_SET,
39 ETHTOOL_MSG_EEE_GET,
40 ETHTOOL_MSG_EEE_SET,
41 ETHTOOL_MSG_TSINFO_GET,
42 ETHTOOL_MSG_CABLE_TEST_ACT,
43 ETHTOOL_MSG_CABLE_TEST_TDR_ACT,
44 ETHTOOL_MSG_TUNNEL_INFO_GET,
45 ETHTOOL_MSG_FEC_GET,
46 ETHTOOL_MSG_FEC_SET,
47 ETHTOOL_MSG_MODULE_EEPROM_GET,
48 ETHTOOL_MSG_STATS_GET,
49 ETHTOOL_MSG_PHC_VCLOCKS_GET,
50 ETHTOOL_MSG_MODULE_GET,
51 ETHTOOL_MSG_MODULE_SET,
52
53 /* add new constants above here */
54 __ETHTOOL_MSG_USER_CNT,
55 ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1
56};
57
58/* message types - kernel to userspace */
59enum {
60 ETHTOOL_MSG_KERNEL_NONE,
61 ETHTOOL_MSG_STRSET_GET_REPLY,
62 ETHTOOL_MSG_LINKINFO_GET_REPLY,
63 ETHTOOL_MSG_LINKINFO_NTF,
64 ETHTOOL_MSG_LINKMODES_GET_REPLY,
65 ETHTOOL_MSG_LINKMODES_NTF,
66 ETHTOOL_MSG_LINKSTATE_GET_REPLY,
67 ETHTOOL_MSG_DEBUG_GET_REPLY,
68 ETHTOOL_MSG_DEBUG_NTF,
69 ETHTOOL_MSG_WOL_GET_REPLY,
70 ETHTOOL_MSG_WOL_NTF,
71 ETHTOOL_MSG_FEATURES_GET_REPLY,
72 ETHTOOL_MSG_FEATURES_SET_REPLY,
73 ETHTOOL_MSG_FEATURES_NTF,
74 ETHTOOL_MSG_PRIVFLAGS_GET_REPLY,
75 ETHTOOL_MSG_PRIVFLAGS_NTF,
76 ETHTOOL_MSG_RINGS_GET_REPLY,
77 ETHTOOL_MSG_RINGS_NTF,
78 ETHTOOL_MSG_CHANNELS_GET_REPLY,
79 ETHTOOL_MSG_CHANNELS_NTF,
80 ETHTOOL_MSG_COALESCE_GET_REPLY,
81 ETHTOOL_MSG_COALESCE_NTF,
82 ETHTOOL_MSG_PAUSE_GET_REPLY,
83 ETHTOOL_MSG_PAUSE_NTF,
84 ETHTOOL_MSG_EEE_GET_REPLY,
85 ETHTOOL_MSG_EEE_NTF,
86 ETHTOOL_MSG_TSINFO_GET_REPLY,
87 ETHTOOL_MSG_CABLE_TEST_NTF,
88 ETHTOOL_MSG_CABLE_TEST_TDR_NTF,
89 ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY,
90 ETHTOOL_MSG_FEC_GET_REPLY,
91 ETHTOOL_MSG_FEC_NTF,
92 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
93 ETHTOOL_MSG_STATS_GET_REPLY,
94 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
95 ETHTOOL_MSG_MODULE_GET_REPLY,
96 ETHTOOL_MSG_MODULE_NTF,
97
98 /* add new constants above here */
99 __ETHTOOL_MSG_KERNEL_CNT,
100 ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
101};
102
103/* request header */
104
105/* use compact bitsets in reply */
106#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0)
107/* provide optional reply for SET or ACT requests */
108#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1)
109/* request statistics, if supported by the driver */
110#define ETHTOOL_FLAG_STATS (1 << 2)
111
112#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
113 ETHTOOL_FLAG_OMIT_REPLY | \
114 ETHTOOL_FLAG_STATS)
115
116enum {
117 ETHTOOL_A_HEADER_UNSPEC,
118 ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */
119 ETHTOOL_A_HEADER_DEV_NAME, /* string */
120 ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */
121
122 /* add new constants above here */
123 __ETHTOOL_A_HEADER_CNT,
124 ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1
125};
126
127/* bit sets */
128
129enum {
130 ETHTOOL_A_BITSET_BIT_UNSPEC,
131 ETHTOOL_A_BITSET_BIT_INDEX, /* u32 */
132 ETHTOOL_A_BITSET_BIT_NAME, /* string */
133 ETHTOOL_A_BITSET_BIT_VALUE, /* flag */
134
135 /* add new constants above here */
136 __ETHTOOL_A_BITSET_BIT_CNT,
137 ETHTOOL_A_BITSET_BIT_MAX = __ETHTOOL_A_BITSET_BIT_CNT - 1
138};
139
140enum {
141 ETHTOOL_A_BITSET_BITS_UNSPEC,
142 ETHTOOL_A_BITSET_BITS_BIT, /* nest - _A_BITSET_BIT_* */
143
144 /* add new constants above here */
145 __ETHTOOL_A_BITSET_BITS_CNT,
146 ETHTOOL_A_BITSET_BITS_MAX = __ETHTOOL_A_BITSET_BITS_CNT - 1
147};
148
149enum {
150 ETHTOOL_A_BITSET_UNSPEC,
151 ETHTOOL_A_BITSET_NOMASK, /* flag */
152 ETHTOOL_A_BITSET_SIZE, /* u32 */
153 ETHTOOL_A_BITSET_BITS, /* nest - _A_BITSET_BITS_* */
154 ETHTOOL_A_BITSET_VALUE, /* binary */
155 ETHTOOL_A_BITSET_MASK, /* binary */
156
157 /* add new constants above here */
158 __ETHTOOL_A_BITSET_CNT,
159 ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
160};
161
162/* string sets */
163
164enum {
165 ETHTOOL_A_STRING_UNSPEC,
166 ETHTOOL_A_STRING_INDEX, /* u32 */
167 ETHTOOL_A_STRING_VALUE, /* string */
168
169 /* add new constants above here */
170 __ETHTOOL_A_STRING_CNT,
171 ETHTOOL_A_STRING_MAX = __ETHTOOL_A_STRING_CNT - 1
172};
173
174enum {
175 ETHTOOL_A_STRINGS_UNSPEC,
176 ETHTOOL_A_STRINGS_STRING, /* nest - _A_STRINGS_* */
177
178 /* add new constants above here */
179 __ETHTOOL_A_STRINGS_CNT,
180 ETHTOOL_A_STRINGS_MAX = __ETHTOOL_A_STRINGS_CNT - 1
181};
182
183enum {
184 ETHTOOL_A_STRINGSET_UNSPEC,
185 ETHTOOL_A_STRINGSET_ID, /* u32 */
186 ETHTOOL_A_STRINGSET_COUNT, /* u32 */
187 ETHTOOL_A_STRINGSET_STRINGS, /* nest - _A_STRINGS_* */
188
189 /* add new constants above here */
190 __ETHTOOL_A_STRINGSET_CNT,
191 ETHTOOL_A_STRINGSET_MAX = __ETHTOOL_A_STRINGSET_CNT - 1
192};
193
194enum {
195 ETHTOOL_A_STRINGSETS_UNSPEC,
196 ETHTOOL_A_STRINGSETS_STRINGSET, /* nest - _A_STRINGSET_* */
197
198 /* add new constants above here */
199 __ETHTOOL_A_STRINGSETS_CNT,
200 ETHTOOL_A_STRINGSETS_MAX = __ETHTOOL_A_STRINGSETS_CNT - 1
201};
202
203/* STRSET */
204
205enum {
206 ETHTOOL_A_STRSET_UNSPEC,
207 ETHTOOL_A_STRSET_HEADER, /* nest - _A_HEADER_* */
208 ETHTOOL_A_STRSET_STRINGSETS, /* nest - _A_STRINGSETS_* */
209 ETHTOOL_A_STRSET_COUNTS_ONLY, /* flag */
210
211 /* add new constants above here */
212 __ETHTOOL_A_STRSET_CNT,
213 ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
214};
215
216/* LINKINFO */
217
218enum {
219 ETHTOOL_A_LINKINFO_UNSPEC,
220 ETHTOOL_A_LINKINFO_HEADER, /* nest - _A_HEADER_* */
221 ETHTOOL_A_LINKINFO_PORT, /* u8 */
222 ETHTOOL_A_LINKINFO_PHYADDR, /* u8 */
223 ETHTOOL_A_LINKINFO_TP_MDIX, /* u8 */
224 ETHTOOL_A_LINKINFO_TP_MDIX_CTRL, /* u8 */
225 ETHTOOL_A_LINKINFO_TRANSCEIVER, /* u8 */
226
227 /* add new constants above here */
228 __ETHTOOL_A_LINKINFO_CNT,
229 ETHTOOL_A_LINKINFO_MAX = __ETHTOOL_A_LINKINFO_CNT - 1
230};
231
232/* LINKMODES */
233
234enum {
235 ETHTOOL_A_LINKMODES_UNSPEC,
236 ETHTOOL_A_LINKMODES_HEADER, /* nest - _A_HEADER_* */
237 ETHTOOL_A_LINKMODES_AUTONEG, /* u8 */
238 ETHTOOL_A_LINKMODES_OURS, /* bitset */
239 ETHTOOL_A_LINKMODES_PEER, /* bitset */
240 ETHTOOL_A_LINKMODES_SPEED, /* u32 */
241 ETHTOOL_A_LINKMODES_DUPLEX, /* u8 */
242 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */
243 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */
244 ETHTOOL_A_LINKMODES_LANES, /* u32 */
245
246 /* add new constants above here */
247 __ETHTOOL_A_LINKMODES_CNT,
248 ETHTOOL_A_LINKMODES_MAX = __ETHTOOL_A_LINKMODES_CNT - 1
249};
250
251/* LINKSTATE */
252
253enum {
254 ETHTOOL_A_LINKSTATE_UNSPEC,
255 ETHTOOL_A_LINKSTATE_HEADER, /* nest - _A_HEADER_* */
256 ETHTOOL_A_LINKSTATE_LINK, /* u8 */
257 ETHTOOL_A_LINKSTATE_SQI, /* u32 */
258 ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */
259 ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */
260 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */
261
262 /* add new constants above here */
263 __ETHTOOL_A_LINKSTATE_CNT,
264 ETHTOOL_A_LINKSTATE_MAX = __ETHTOOL_A_LINKSTATE_CNT - 1
265};
266
267/* DEBUG */
268
269enum {
270 ETHTOOL_A_DEBUG_UNSPEC,
271 ETHTOOL_A_DEBUG_HEADER, /* nest - _A_HEADER_* */
272 ETHTOOL_A_DEBUG_MSGMASK, /* bitset */
273
274 /* add new constants above here */
275 __ETHTOOL_A_DEBUG_CNT,
276 ETHTOOL_A_DEBUG_MAX = __ETHTOOL_A_DEBUG_CNT - 1
277};
278
279/* WOL */
280
281enum {
282 ETHTOOL_A_WOL_UNSPEC,
283 ETHTOOL_A_WOL_HEADER, /* nest - _A_HEADER_* */
284 ETHTOOL_A_WOL_MODES, /* bitset */
285 ETHTOOL_A_WOL_SOPASS, /* binary */
286
287 /* add new constants above here */
288 __ETHTOOL_A_WOL_CNT,
289 ETHTOOL_A_WOL_MAX = __ETHTOOL_A_WOL_CNT - 1
290};
291
292/* FEATURES */
293
294enum {
295 ETHTOOL_A_FEATURES_UNSPEC,
296 ETHTOOL_A_FEATURES_HEADER, /* nest - _A_HEADER_* */
297 ETHTOOL_A_FEATURES_HW, /* bitset */
298 ETHTOOL_A_FEATURES_WANTED, /* bitset */
299 ETHTOOL_A_FEATURES_ACTIVE, /* bitset */
300 ETHTOOL_A_FEATURES_NOCHANGE, /* bitset */
301
302 /* add new constants above here */
303 __ETHTOOL_A_FEATURES_CNT,
304 ETHTOOL_A_FEATURES_MAX = __ETHTOOL_A_FEATURES_CNT - 1
305};
306
307/* PRIVFLAGS */
308
309enum {
310 ETHTOOL_A_PRIVFLAGS_UNSPEC,
311 ETHTOOL_A_PRIVFLAGS_HEADER, /* nest - _A_HEADER_* */
312 ETHTOOL_A_PRIVFLAGS_FLAGS, /* bitset */
313
314 /* add new constants above here */
315 __ETHTOOL_A_PRIVFLAGS_CNT,
316 ETHTOOL_A_PRIVFLAGS_MAX = __ETHTOOL_A_PRIVFLAGS_CNT - 1
317};
318
319/* RINGS */
320
321enum {
322 ETHTOOL_A_RINGS_UNSPEC,
323 ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
324 ETHTOOL_A_RINGS_RX_MAX, /* u32 */
325 ETHTOOL_A_RINGS_RX_MINI_MAX, /* u32 */
326 ETHTOOL_A_RINGS_RX_JUMBO_MAX, /* u32 */
327 ETHTOOL_A_RINGS_TX_MAX, /* u32 */
328 ETHTOOL_A_RINGS_RX, /* u32 */
329 ETHTOOL_A_RINGS_RX_MINI, /* u32 */
330 ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
331 ETHTOOL_A_RINGS_TX, /* u32 */
332
333 /* add new constants above here */
334 __ETHTOOL_A_RINGS_CNT,
335 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
336};
337
338/* CHANNELS */
339
340enum {
341 ETHTOOL_A_CHANNELS_UNSPEC,
342 ETHTOOL_A_CHANNELS_HEADER, /* nest - _A_HEADER_* */
343 ETHTOOL_A_CHANNELS_RX_MAX, /* u32 */
344 ETHTOOL_A_CHANNELS_TX_MAX, /* u32 */
345 ETHTOOL_A_CHANNELS_OTHER_MAX, /* u32 */
346 ETHTOOL_A_CHANNELS_COMBINED_MAX, /* u32 */
347 ETHTOOL_A_CHANNELS_RX_COUNT, /* u32 */
348 ETHTOOL_A_CHANNELS_TX_COUNT, /* u32 */
349 ETHTOOL_A_CHANNELS_OTHER_COUNT, /* u32 */
350 ETHTOOL_A_CHANNELS_COMBINED_COUNT, /* u32 */
351
352 /* add new constants above here */
353 __ETHTOOL_A_CHANNELS_CNT,
354 ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
355};
356
357/* COALESCE */
358
359enum {
360 ETHTOOL_A_COALESCE_UNSPEC,
361 ETHTOOL_A_COALESCE_HEADER, /* nest - _A_HEADER_* */
362 ETHTOOL_A_COALESCE_RX_USECS, /* u32 */
363 ETHTOOL_A_COALESCE_RX_MAX_FRAMES, /* u32 */
364 ETHTOOL_A_COALESCE_RX_USECS_IRQ, /* u32 */
365 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ, /* u32 */
366 ETHTOOL_A_COALESCE_TX_USECS, /* u32 */
367 ETHTOOL_A_COALESCE_TX_MAX_FRAMES, /* u32 */
368 ETHTOOL_A_COALESCE_TX_USECS_IRQ, /* u32 */
369 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ, /* u32 */
370 ETHTOOL_A_COALESCE_STATS_BLOCK_USECS, /* u32 */
371 ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX, /* u8 */
372 ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX, /* u8 */
373 ETHTOOL_A_COALESCE_PKT_RATE_LOW, /* u32 */
374 ETHTOOL_A_COALESCE_RX_USECS_LOW, /* u32 */
375 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW, /* u32 */
376 ETHTOOL_A_COALESCE_TX_USECS_LOW, /* u32 */
377 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW, /* u32 */
378 ETHTOOL_A_COALESCE_PKT_RATE_HIGH, /* u32 */
379 ETHTOOL_A_COALESCE_RX_USECS_HIGH, /* u32 */
380 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH, /* u32 */
381 ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */
382 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */
383 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
384 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */
385 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */
386
387 /* add new constants above here */
388 __ETHTOOL_A_COALESCE_CNT,
389 ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
390};
391
392/* PAUSE */
393
394enum {
395 ETHTOOL_A_PAUSE_UNSPEC,
396 ETHTOOL_A_PAUSE_HEADER, /* nest - _A_HEADER_* */
397 ETHTOOL_A_PAUSE_AUTONEG, /* u8 */
398 ETHTOOL_A_PAUSE_RX, /* u8 */
399 ETHTOOL_A_PAUSE_TX, /* u8 */
400 ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */
401
402 /* add new constants above here */
403 __ETHTOOL_A_PAUSE_CNT,
404 ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
405};
406
407enum {
408 ETHTOOL_A_PAUSE_STAT_UNSPEC,
409 ETHTOOL_A_PAUSE_STAT_PAD,
410
411 ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
412 ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
413
414 /* add new constants above here
415 * adjust ETHTOOL_PAUSE_STAT_CNT if adding non-stats!
416 */
417 __ETHTOOL_A_PAUSE_STAT_CNT,
418 ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
419};
420
421/* EEE */
422
423enum {
424 ETHTOOL_A_EEE_UNSPEC,
425 ETHTOOL_A_EEE_HEADER, /* nest - _A_HEADER_* */
426 ETHTOOL_A_EEE_MODES_OURS, /* bitset */
427 ETHTOOL_A_EEE_MODES_PEER, /* bitset */
428 ETHTOOL_A_EEE_ACTIVE, /* u8 */
429 ETHTOOL_A_EEE_ENABLED, /* u8 */
430 ETHTOOL_A_EEE_TX_LPI_ENABLED, /* u8 */
431 ETHTOOL_A_EEE_TX_LPI_TIMER, /* u32 */
432
433 /* add new constants above here */
434 __ETHTOOL_A_EEE_CNT,
435 ETHTOOL_A_EEE_MAX = (__ETHTOOL_A_EEE_CNT - 1)
436};
437
438/* TSINFO */
439
440enum {
441 ETHTOOL_A_TSINFO_UNSPEC,
442 ETHTOOL_A_TSINFO_HEADER, /* nest - _A_HEADER_* */
443 ETHTOOL_A_TSINFO_TIMESTAMPING, /* bitset */
444 ETHTOOL_A_TSINFO_TX_TYPES, /* bitset */
445 ETHTOOL_A_TSINFO_RX_FILTERS, /* bitset */
446 ETHTOOL_A_TSINFO_PHC_INDEX, /* u32 */
447
448 /* add new constants above here */
449 __ETHTOOL_A_TSINFO_CNT,
450 ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
451};
452
453/* PHC VCLOCKS */
454
455enum {
456 ETHTOOL_A_PHC_VCLOCKS_UNSPEC,
457 ETHTOOL_A_PHC_VCLOCKS_HEADER, /* nest - _A_HEADER_* */
458 ETHTOOL_A_PHC_VCLOCKS_NUM, /* u32 */
459 ETHTOOL_A_PHC_VCLOCKS_INDEX, /* array, s32 */
460
461 /* add new constants above here */
462 __ETHTOOL_A_PHC_VCLOCKS_CNT,
463 ETHTOOL_A_PHC_VCLOCKS_MAX = (__ETHTOOL_A_PHC_VCLOCKS_CNT - 1)
464};
465
466/* CABLE TEST */
467
468enum {
469 ETHTOOL_A_CABLE_TEST_UNSPEC,
470 ETHTOOL_A_CABLE_TEST_HEADER, /* nest - _A_HEADER_* */
471
472 /* add new constants above here */
473 __ETHTOOL_A_CABLE_TEST_CNT,
474 ETHTOOL_A_CABLE_TEST_MAX = __ETHTOOL_A_CABLE_TEST_CNT - 1
475};
476
477/* CABLE TEST NOTIFY */
478enum {
479 ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC,
480 ETHTOOL_A_CABLE_RESULT_CODE_OK,
481 ETHTOOL_A_CABLE_RESULT_CODE_OPEN,
482 ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT,
483 ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT,
484};
485
486enum {
487 ETHTOOL_A_CABLE_PAIR_A,
488 ETHTOOL_A_CABLE_PAIR_B,
489 ETHTOOL_A_CABLE_PAIR_C,
490 ETHTOOL_A_CABLE_PAIR_D,
491};
492
493enum {
494 ETHTOOL_A_CABLE_RESULT_UNSPEC,
495 ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
496 ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */
497
498 __ETHTOOL_A_CABLE_RESULT_CNT,
499 ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
500};
501
502enum {
503 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
504 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
505 ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */
506
507 __ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
508 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)
509};
510
511enum {
512 ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC,
513 ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED,
514 ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED
515};
516
517enum {
518 ETHTOOL_A_CABLE_NEST_UNSPEC,
519 ETHTOOL_A_CABLE_NEST_RESULT, /* nest - ETHTOOL_A_CABLE_RESULT_ */
520 ETHTOOL_A_CABLE_NEST_FAULT_LENGTH, /* nest - ETHTOOL_A_CABLE_FAULT_LENGTH_ */
521 __ETHTOOL_A_CABLE_NEST_CNT,
522 ETHTOOL_A_CABLE_NEST_MAX = (__ETHTOOL_A_CABLE_NEST_CNT - 1)
523};
524
525enum {
526 ETHTOOL_A_CABLE_TEST_NTF_UNSPEC,
527 ETHTOOL_A_CABLE_TEST_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
528 ETHTOOL_A_CABLE_TEST_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
529 ETHTOOL_A_CABLE_TEST_NTF_NEST, /* nest - of results: */
530
531 __ETHTOOL_A_CABLE_TEST_NTF_CNT,
532 ETHTOOL_A_CABLE_TEST_NTF_MAX = (__ETHTOOL_A_CABLE_TEST_NTF_CNT - 1)
533};
534
535/* CABLE TEST TDR */
536
537enum {
538 ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC,
539 ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST, /* u32 */
540 ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST, /* u32 */
541 ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP, /* u32 */
542 ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR, /* u8 */
543
544 /* add new constants above here */
545 __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT,
546 ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT - 1
547};
548
549enum {
550 ETHTOOL_A_CABLE_TEST_TDR_UNSPEC,
551 ETHTOOL_A_CABLE_TEST_TDR_HEADER, /* nest - _A_HEADER_* */
552 ETHTOOL_A_CABLE_TEST_TDR_CFG, /* nest - *_TDR_CFG_* */
553
554 /* add new constants above here */
555 __ETHTOOL_A_CABLE_TEST_TDR_CNT,
556 ETHTOOL_A_CABLE_TEST_TDR_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CNT - 1
557};
558
559/* CABLE TEST TDR NOTIFY */
560
561enum {
562 ETHTOOL_A_CABLE_AMPLITUDE_UNSPEC,
563 ETHTOOL_A_CABLE_AMPLITUDE_PAIR, /* u8 */
564 ETHTOOL_A_CABLE_AMPLITUDE_mV, /* s16 */
565
566 __ETHTOOL_A_CABLE_AMPLITUDE_CNT,
567 ETHTOOL_A_CABLE_AMPLITUDE_MAX = (__ETHTOOL_A_CABLE_AMPLITUDE_CNT - 1)
568};
569
570enum {
571 ETHTOOL_A_CABLE_PULSE_UNSPEC,
572 ETHTOOL_A_CABLE_PULSE_mV, /* s16 */
573
574 __ETHTOOL_A_CABLE_PULSE_CNT,
575 ETHTOOL_A_CABLE_PULSE_MAX = (__ETHTOOL_A_CABLE_PULSE_CNT - 1)
576};
577
578enum {
579 ETHTOOL_A_CABLE_STEP_UNSPEC,
580 ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE, /* u32 */
581 ETHTOOL_A_CABLE_STEP_LAST_DISTANCE, /* u32 */
582 ETHTOOL_A_CABLE_STEP_STEP_DISTANCE, /* u32 */
583
584 __ETHTOOL_A_CABLE_STEP_CNT,
585 ETHTOOL_A_CABLE_STEP_MAX = (__ETHTOOL_A_CABLE_STEP_CNT - 1)
586};
587
588enum {
589 ETHTOOL_A_CABLE_TDR_NEST_UNSPEC,
590 ETHTOOL_A_CABLE_TDR_NEST_STEP, /* nest - ETHTTOOL_A_CABLE_STEP */
591 ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE, /* nest - ETHTOOL_A_CABLE_AMPLITUDE */
592 ETHTOOL_A_CABLE_TDR_NEST_PULSE, /* nest - ETHTOOL_A_CABLE_PULSE */
593
594 __ETHTOOL_A_CABLE_TDR_NEST_CNT,
595 ETHTOOL_A_CABLE_TDR_NEST_MAX = (__ETHTOOL_A_CABLE_TDR_NEST_CNT - 1)
596};
597
598enum {
599 ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC,
600 ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
601 ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
602 ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST, /* nest - of results: */
603
604 /* add new constants above here */
605 __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT,
606 ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT - 1
607};
608
609/* TUNNEL INFO */
610
611enum {
612 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN,
613 ETHTOOL_UDP_TUNNEL_TYPE_GENEVE,
614 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE,
615
616 __ETHTOOL_UDP_TUNNEL_TYPE_CNT
617};
618
619enum {
620 ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC,
621
622 ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, /* be16 */
623 ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE, /* u32 */
624
625 /* add new constants above here */
626 __ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT,
627 ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = (__ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT - 1)
628};
629
630enum {
631 ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC,
632
633 ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE, /* u32 */
634 ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES, /* bitset */
635 ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY, /* nest - _UDP_ENTRY_* */
636
637 /* add new constants above here */
638 __ETHTOOL_A_TUNNEL_UDP_TABLE_CNT,
639 ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = (__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT - 1)
640};
641
642enum {
643 ETHTOOL_A_TUNNEL_UDP_UNSPEC,
644
645 ETHTOOL_A_TUNNEL_UDP_TABLE, /* nest - _UDP_TABLE_* */
646
647 /* add new constants above here */
648 __ETHTOOL_A_TUNNEL_UDP_CNT,
649 ETHTOOL_A_TUNNEL_UDP_MAX = (__ETHTOOL_A_TUNNEL_UDP_CNT - 1)
650};
651
652enum {
653 ETHTOOL_A_TUNNEL_INFO_UNSPEC,
654 ETHTOOL_A_TUNNEL_INFO_HEADER, /* nest - _A_HEADER_* */
655
656 ETHTOOL_A_TUNNEL_INFO_UDP_PORTS, /* nest - _UDP_TABLE */
657
658 /* add new constants above here */
659 __ETHTOOL_A_TUNNEL_INFO_CNT,
660 ETHTOOL_A_TUNNEL_INFO_MAX = (__ETHTOOL_A_TUNNEL_INFO_CNT - 1)
661};
662
663/* FEC */
664
665enum {
666 ETHTOOL_A_FEC_UNSPEC,
667 ETHTOOL_A_FEC_HEADER, /* nest - _A_HEADER_* */
668 ETHTOOL_A_FEC_MODES, /* bitset */
669 ETHTOOL_A_FEC_AUTO, /* u8 */
670 ETHTOOL_A_FEC_ACTIVE, /* u32 */
671 ETHTOOL_A_FEC_STATS, /* nest - _A_FEC_STAT */
672
673 __ETHTOOL_A_FEC_CNT,
674 ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)
675};
676
677enum {
678 ETHTOOL_A_FEC_STAT_UNSPEC,
679 ETHTOOL_A_FEC_STAT_PAD,
680
681 ETHTOOL_A_FEC_STAT_CORRECTED, /* array, u64 */
682 ETHTOOL_A_FEC_STAT_UNCORR, /* array, u64 */
683 ETHTOOL_A_FEC_STAT_CORR_BITS, /* array, u64 */
684
685 /* add new constants above here */
686 __ETHTOOL_A_FEC_STAT_CNT,
687 ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
688};
689
690/* MODULE EEPROM */
691
692enum {
693 ETHTOOL_A_MODULE_EEPROM_UNSPEC,
694 ETHTOOL_A_MODULE_EEPROM_HEADER, /* nest - _A_HEADER_* */
695
696 ETHTOOL_A_MODULE_EEPROM_OFFSET, /* u32 */
697 ETHTOOL_A_MODULE_EEPROM_LENGTH, /* u32 */
698 ETHTOOL_A_MODULE_EEPROM_PAGE, /* u8 */
699 ETHTOOL_A_MODULE_EEPROM_BANK, /* u8 */
700 ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS, /* u8 */
701 ETHTOOL_A_MODULE_EEPROM_DATA, /* binary */
702
703 __ETHTOOL_A_MODULE_EEPROM_CNT,
704 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
705};
706
707/* STATS */
708
709enum {
710 ETHTOOL_A_STATS_UNSPEC,
711 ETHTOOL_A_STATS_PAD,
712 ETHTOOL_A_STATS_HEADER, /* nest - _A_HEADER_* */
713 ETHTOOL_A_STATS_GROUPS, /* bitset */
714
715 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
716
717 /* add new constants above here */
718 __ETHTOOL_A_STATS_CNT,
719 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
720};
721
722enum {
723 ETHTOOL_STATS_ETH_PHY,
724 ETHTOOL_STATS_ETH_MAC,
725 ETHTOOL_STATS_ETH_CTRL,
726 ETHTOOL_STATS_RMON,
727
728 /* add new constants above here */
729 __ETHTOOL_STATS_CNT
730};
731
732enum {
733 ETHTOOL_A_STATS_GRP_UNSPEC,
734 ETHTOOL_A_STATS_GRP_PAD,
735
736 ETHTOOL_A_STATS_GRP_ID, /* u32 */
737 ETHTOOL_A_STATS_GRP_SS_ID, /* u32 */
738
739 ETHTOOL_A_STATS_GRP_STAT, /* nest */
740
741 ETHTOOL_A_STATS_GRP_HIST_RX, /* nest */
742 ETHTOOL_A_STATS_GRP_HIST_TX, /* nest */
743
744 ETHTOOL_A_STATS_GRP_HIST_BKT_LOW, /* u32 */
745 ETHTOOL_A_STATS_GRP_HIST_BKT_HI, /* u32 */
746 ETHTOOL_A_STATS_GRP_HIST_VAL, /* u64 */
747
748 /* add new constants above here */
749 __ETHTOOL_A_STATS_GRP_CNT,
750 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
751};
752
753enum {
754 /* 30.3.2.1.5 aSymbolErrorDuringCarrier */
755 ETHTOOL_A_STATS_ETH_PHY_5_SYM_ERR,
756
757 /* add new constants above here */
758 __ETHTOOL_A_STATS_ETH_PHY_CNT,
759 ETHTOOL_A_STATS_ETH_PHY_MAX = (__ETHTOOL_A_STATS_ETH_PHY_CNT - 1)
760};
761
762enum {
763 /* 30.3.1.1.2 aFramesTransmittedOK */
764 ETHTOOL_A_STATS_ETH_MAC_2_TX_PKT,
765 /* 30.3.1.1.3 aSingleCollisionFrames */
766 ETHTOOL_A_STATS_ETH_MAC_3_SINGLE_COL,
767 /* 30.3.1.1.4 aMultipleCollisionFrames */
768 ETHTOOL_A_STATS_ETH_MAC_4_MULTI_COL,
769 /* 30.3.1.1.5 aFramesReceivedOK */
770 ETHTOOL_A_STATS_ETH_MAC_5_RX_PKT,
771 /* 30.3.1.1.6 aFrameCheckSequenceErrors */
772 ETHTOOL_A_STATS_ETH_MAC_6_FCS_ERR,
773 /* 30.3.1.1.7 aAlignmentErrors */
774 ETHTOOL_A_STATS_ETH_MAC_7_ALIGN_ERR,
775 /* 30.3.1.1.8 aOctetsTransmittedOK */
776 ETHTOOL_A_STATS_ETH_MAC_8_TX_BYTES,
777 /* 30.3.1.1.9 aFramesWithDeferredXmissions */
778 ETHTOOL_A_STATS_ETH_MAC_9_TX_DEFER,
779 /* 30.3.1.1.10 aLateCollisions */
780 ETHTOOL_A_STATS_ETH_MAC_10_LATE_COL,
781 /* 30.3.1.1.11 aFramesAbortedDueToXSColls */
782 ETHTOOL_A_STATS_ETH_MAC_11_XS_COL,
783 /* 30.3.1.1.12 aFramesLostDueToIntMACXmitError */
784 ETHTOOL_A_STATS_ETH_MAC_12_TX_INT_ERR,
785 /* 30.3.1.1.13 aCarrierSenseErrors */
786 ETHTOOL_A_STATS_ETH_MAC_13_CS_ERR,
787 /* 30.3.1.1.14 aOctetsReceivedOK */
788 ETHTOOL_A_STATS_ETH_MAC_14_RX_BYTES,
789 /* 30.3.1.1.15 aFramesLostDueToIntMACRcvError */
790 ETHTOOL_A_STATS_ETH_MAC_15_RX_INT_ERR,
791
792 /* 30.3.1.1.18 aMulticastFramesXmittedOK */
793 ETHTOOL_A_STATS_ETH_MAC_18_TX_MCAST,
794 /* 30.3.1.1.19 aBroadcastFramesXmittedOK */
795 ETHTOOL_A_STATS_ETH_MAC_19_TX_BCAST,
796 /* 30.3.1.1.20 aFramesWithExcessiveDeferral */
797 ETHTOOL_A_STATS_ETH_MAC_20_XS_DEFER,
798 /* 30.3.1.1.21 aMulticastFramesReceivedOK */
799 ETHTOOL_A_STATS_ETH_MAC_21_RX_MCAST,
800 /* 30.3.1.1.22 aBroadcastFramesReceivedOK */
801 ETHTOOL_A_STATS_ETH_MAC_22_RX_BCAST,
802 /* 30.3.1.1.23 aInRangeLengthErrors */
803 ETHTOOL_A_STATS_ETH_MAC_23_IR_LEN_ERR,
804 /* 30.3.1.1.24 aOutOfRangeLengthField */
805 ETHTOOL_A_STATS_ETH_MAC_24_OOR_LEN,
806 /* 30.3.1.1.25 aFrameTooLongErrors */
807 ETHTOOL_A_STATS_ETH_MAC_25_TOO_LONG_ERR,
808
809 /* add new constants above here */
810 __ETHTOOL_A_STATS_ETH_MAC_CNT,
811 ETHTOOL_A_STATS_ETH_MAC_MAX = (__ETHTOOL_A_STATS_ETH_MAC_CNT - 1)
812};
813
814enum {
815 /* 30.3.3.3 aMACControlFramesTransmitted */
816 ETHTOOL_A_STATS_ETH_CTRL_3_TX,
817 /* 30.3.3.4 aMACControlFramesReceived */
818 ETHTOOL_A_STATS_ETH_CTRL_4_RX,
819 /* 30.3.3.5 aUnsupportedOpcodesReceived */
820 ETHTOOL_A_STATS_ETH_CTRL_5_RX_UNSUP,
821
822 /* add new constants above here */
823 __ETHTOOL_A_STATS_ETH_CTRL_CNT,
824 ETHTOOL_A_STATS_ETH_CTRL_MAX = (__ETHTOOL_A_STATS_ETH_CTRL_CNT - 1)
825};
826
827enum {
828 /* etherStatsUndersizePkts */
829 ETHTOOL_A_STATS_RMON_UNDERSIZE,
830 /* etherStatsOversizePkts */
831 ETHTOOL_A_STATS_RMON_OVERSIZE,
832 /* etherStatsFragments */
833 ETHTOOL_A_STATS_RMON_FRAG,
834 /* etherStatsJabbers */
835 ETHTOOL_A_STATS_RMON_JABBER,
836
837 /* add new constants above here */
838 __ETHTOOL_A_STATS_RMON_CNT,
839 ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1)
840};
841
842/* MODULE */
843
844enum {
845 ETHTOOL_A_MODULE_UNSPEC,
846 ETHTOOL_A_MODULE_HEADER, /* nest - _A_HEADER_* */
847 ETHTOOL_A_MODULE_POWER_MODE_POLICY, /* u8 */
848 ETHTOOL_A_MODULE_POWER_MODE, /* u8 */
849
850 /* add new constants above here */
851 __ETHTOOL_A_MODULE_CNT,
852 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
853};
854
855/* generic netlink info */
856#define ETHTOOL_GENL_NAME "ethtool"
857#define ETHTOOL_GENL_VERSION 1
858
859#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
860
861#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/f2fs.h created+98
...@@ -0,0 +1,98 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_F2FS_H
4#define _LINUX_F2FS_H
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8/*
9 * f2fs-specific ioctl commands
10 */
11#define F2FS_IOCTL_MAGIC 0xf5
12#define F2FS_IOC_START_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 1)
13#define F2FS_IOC_COMMIT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 2)
14#define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)
15#define F2FS_IOC_RELEASE_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 4)
16#define F2FS_IOC_ABORT_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 5)
17#define F2FS_IOC_GARBAGE_COLLECT _IOW(F2FS_IOCTL_MAGIC, 6, __u32)
18#define F2FS_IOC_WRITE_CHECKPOINT _IO(F2FS_IOCTL_MAGIC, 7)
19#define F2FS_IOC_DEFRAGMENT _IOWR(F2FS_IOCTL_MAGIC, 8, \
20 struct f2fs_defragment)
21#define F2FS_IOC_MOVE_RANGE _IOWR(F2FS_IOCTL_MAGIC, 9, \
22 struct f2fs_move_range)
23#define F2FS_IOC_FLUSH_DEVICE _IOW(F2FS_IOCTL_MAGIC, 10, \
24 struct f2fs_flush_device)
25#define F2FS_IOC_GARBAGE_COLLECT_RANGE _IOW(F2FS_IOCTL_MAGIC, 11, \
26 struct f2fs_gc_range)
27#define F2FS_IOC_GET_FEATURES _IOR(F2FS_IOCTL_MAGIC, 12, __u32)
28#define F2FS_IOC_SET_PIN_FILE _IOW(F2FS_IOCTL_MAGIC, 13, __u32)
29#define F2FS_IOC_GET_PIN_FILE _IOR(F2FS_IOCTL_MAGIC, 14, __u32)
30#define F2FS_IOC_PRECACHE_EXTENTS _IO(F2FS_IOCTL_MAGIC, 15)
31#define F2FS_IOC_RESIZE_FS _IOW(F2FS_IOCTL_MAGIC, 16, __u64)
32#define F2FS_IOC_GET_COMPRESS_BLOCKS _IOR(F2FS_IOCTL_MAGIC, 17, __u64)
33#define F2FS_IOC_RELEASE_COMPRESS_BLOCKS \
34 _IOR(F2FS_IOCTL_MAGIC, 18, __u64)
35#define F2FS_IOC_RESERVE_COMPRESS_BLOCKS \
36 _IOR(F2FS_IOCTL_MAGIC, 19, __u64)
37#define F2FS_IOC_SEC_TRIM_FILE _IOW(F2FS_IOCTL_MAGIC, 20, \
38 struct f2fs_sectrim_range)
39#define F2FS_IOC_GET_COMPRESS_OPTION _IOR(F2FS_IOCTL_MAGIC, 21, \
40 struct f2fs_comp_option)
41#define F2FS_IOC_SET_COMPRESS_OPTION _IOW(F2FS_IOCTL_MAGIC, 22, \
42 struct f2fs_comp_option)
43#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)
44#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
45
46/*
47 * should be same as XFS_IOC_GOINGDOWN.
48 * Flags for going down operation used by FS_IOC_GOINGDOWN
49 */
50#define F2FS_IOC_SHUTDOWN _IOR('X', 125, __u32) /* Shutdown */
51#define F2FS_GOING_DOWN_FULLSYNC 0x0 /* going down with full sync */
52#define F2FS_GOING_DOWN_METASYNC 0x1 /* going down with metadata */
53#define F2FS_GOING_DOWN_NOSYNC 0x2 /* going down */
54#define F2FS_GOING_DOWN_METAFLUSH 0x3 /* going down with meta flush */
55#define F2FS_GOING_DOWN_NEED_FSCK 0x4 /* going down to trigger fsck */
56
57/*
58 * Flags used by F2FS_IOC_SEC_TRIM_FILE
59 */
60#define F2FS_TRIM_FILE_DISCARD 0x1 /* send discard command */
61#define F2FS_TRIM_FILE_ZEROOUT 0x2 /* zero out */
62#define F2FS_TRIM_FILE_MASK 0x3
63
64struct f2fs_gc_range {
65 __u32 sync;
66 __u64 start;
67 __u64 len;
68};
69
70struct f2fs_defragment {
71 __u64 start;
72 __u64 len;
73};
74
75struct f2fs_move_range {
76 __u32 dst_fd; /* destination fd */
77 __u64 pos_in; /* start position in src_fd */
78 __u64 pos_out; /* start position in dst_fd */
79 __u64 len; /* size to move */
80};
81
82struct f2fs_flush_device {
83 __u32 dev_num; /* device number to flush */
84 __u32 segments; /* # of segments to flush */
85};
86
87struct f2fs_sectrim_range {
88 __u64 start;
89 __u64 len;
90 __u64 flags;
91};
92
93struct f2fs_comp_option {
94 __u8 algorithm;
95 __u8 log_cluster_size;
96};
97
98#endif /* _LINUX_F2FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fanotify.h+85-9
...@@ -7,30 +7,43 @@...@@ -7,30 +7,43 @@
7/* the following events that user-space can register for */7/* the following events that user-space can register for */
8#define FAN_ACCESS 0x00000001 /* File was accessed */8#define FAN_ACCESS 0x00000001 /* File was accessed */
9#define FAN_MODIFY 0x00000002 /* File was modified */9#define FAN_MODIFY 0x00000002 /* File was modified */
10#define FAN_ATTRIB 0x00000004 /* Metadata changed */
10#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */11#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
11#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */12#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
12#define FAN_OPEN 0x00000020 /* File was opened */13#define FAN_OPEN 0x00000020 /* File was opened */
14#define FAN_MOVED_FROM 0x00000040 /* File was moved from X */
15#define FAN_MOVED_TO 0x00000080 /* File was moved to Y */
16#define FAN_CREATE 0x00000100 /* Subfile was created */
17#define FAN_DELETE 0x00000200 /* Subfile was deleted */
18#define FAN_DELETE_SELF 0x00000400 /* Self was deleted */
19#define FAN_MOVE_SELF 0x00000800 /* Self was moved */
20#define FAN_OPEN_EXEC 0x00001000 /* File was opened for exec */
1321
14#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */22#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
23#define FAN_FS_ERROR 0x00008000 /* Filesystem error */
1524
16#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */25#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
17#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */26#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
27#define FAN_OPEN_EXEC_PERM 0x00040000 /* File open/exec in perm check */
1828
19#define FAN_ONDIR 0x40000000 /* event occurred against dir */29#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
2030
21#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */31#define FAN_ONDIR 0x40000000 /* Event occurred against dir */
2232
23/* helper events */33/* helper events */
24#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */34#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
35#define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO) /* moves */
2536
26/* flags used for fanotify_init() */37/* flags used for fanotify_init() */
27#define FAN_CLOEXEC 0x0000000138#define FAN_CLOEXEC 0x00000001
28#define FAN_NONBLOCK 0x0000000239#define FAN_NONBLOCK 0x00000002
2940
30/* These are NOT bitwise flags. Both bits are used togther. */41/* These are NOT bitwise flags. Both bits are used together. */
31#define FAN_CLASS_NOTIF 0x0000000042#define FAN_CLASS_NOTIF 0x00000000
32#define FAN_CLASS_CONTENT 0x0000000443#define FAN_CLASS_CONTENT 0x00000004
33#define FAN_CLASS_PRE_CONTENT 0x0000000844#define FAN_CLASS_PRE_CONTENT 0x00000008
45
46/* Deprecated - do not use this in programs and do not add new flags here! */
34#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \47#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
35 FAN_CLASS_PRE_CONTENT)48 FAN_CLASS_PRE_CONTENT)
3649
...@@ -38,6 +51,17 @@...@@ -38,6 +51,17 @@
38#define FAN_UNLIMITED_MARKS 0x0000002051#define FAN_UNLIMITED_MARKS 0x00000020
39#define FAN_ENABLE_AUDIT 0x0000004052#define FAN_ENABLE_AUDIT 0x00000040
4053
54/* Flags to determine fanotify event format */
55#define FAN_REPORT_PIDFD 0x00000080 /* Report pidfd for event->pid */
56#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
57#define FAN_REPORT_FID 0x00000200 /* Report unique file id */
58#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */
59#define FAN_REPORT_NAME 0x00000800 /* Report events with name */
60
61/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */
62#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)
63
64/* Deprecated - do not use this in programs and do not add new flags here! */
41#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \65#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
42 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\66 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
43 FAN_UNLIMITED_MARKS)67 FAN_UNLIMITED_MARKS)
...@@ -47,11 +71,18 @@...@@ -47,11 +71,18 @@
47#define FAN_MARK_REMOVE 0x0000000271#define FAN_MARK_REMOVE 0x00000002
48#define FAN_MARK_DONT_FOLLOW 0x0000000472#define FAN_MARK_DONT_FOLLOW 0x00000004
49#define FAN_MARK_ONLYDIR 0x0000000873#define FAN_MARK_ONLYDIR 0x00000008
50#define FAN_MARK_MOUNT 0x0000001074/* FAN_MARK_MOUNT is 0x00000010 */
51#define FAN_MARK_IGNORED_MASK 0x0000002075#define FAN_MARK_IGNORED_MASK 0x00000020
52#define FAN_MARK_IGNORED_SURV_MODIFY 0x0000004076#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
53#define FAN_MARK_FLUSH 0x0000008077#define FAN_MARK_FLUSH 0x00000080
78/* FAN_MARK_FILESYSTEM is 0x00000100 */
79
80/* These are NOT bitwise flags. Both bits can be used togther. */
81#define FAN_MARK_INODE 0x00000000
82#define FAN_MARK_MOUNT 0x00000010
83#define FAN_MARK_FILESYSTEM 0x00000100
5484
85/* Deprecated - do not use this in programs and do not add new flags here! */
55#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\86#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
56 FAN_MARK_REMOVE |\87 FAN_MARK_REMOVE |\
57 FAN_MARK_DONT_FOLLOW |\88 FAN_MARK_DONT_FOLLOW |\
...@@ -61,11 +92,7 @@...@@ -61,11 +92,7 @@
61 FAN_MARK_IGNORED_SURV_MODIFY |\92 FAN_MARK_IGNORED_SURV_MODIFY |\
62 FAN_MARK_FLUSH)93 FAN_MARK_FLUSH)
6394
64/*95/* Deprecated - do not use this in programs and do not add new flags here! */
65 * All of the events - we build the list by hand so that we can add flags in
66 * the future and not break backward compatibility. Apps will get only the
67 * events that they originally wanted. Be sure to add new events here!
68 */
69#define FAN_ALL_EVENTS (FAN_ACCESS |\96#define FAN_ALL_EVENTS (FAN_ACCESS |\
70 FAN_MODIFY |\97 FAN_MODIFY |\
71 FAN_CLOSE |\98 FAN_CLOSE |\
...@@ -74,9 +101,11 @@...@@ -74,9 +101,11 @@
74/*101/*
75 * All events which require a permission response from userspace102 * All events which require a permission response from userspace
76 */103 */
104/* Deprecated - do not use this in programs and do not add new flags here! */
77#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\105#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
78 FAN_ACCESS_PERM)106 FAN_ACCESS_PERM)
79107
108/* Deprecated - do not use this in programs and do not add new flags here! */
80#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\109#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
81 FAN_ALL_PERM_EVENTS |\110 FAN_ALL_PERM_EVENTS |\
82 FAN_Q_OVERFLOW)111 FAN_Q_OVERFLOW)
...@@ -93,6 +122,51 @@ struct fanotify_event_metadata {...@@ -93,6 +122,51 @@ struct fanotify_event_metadata {
93 __s32 pid;122 __s32 pid;
94};123};
95124
125#define FAN_EVENT_INFO_TYPE_FID 1
126#define FAN_EVENT_INFO_TYPE_DFID_NAME 2
127#define FAN_EVENT_INFO_TYPE_DFID 3
128#define FAN_EVENT_INFO_TYPE_PIDFD 4
129#define FAN_EVENT_INFO_TYPE_ERROR 5
130
131/* Variable length info record following event metadata */
132struct fanotify_event_info_header {
133 __u8 info_type;
134 __u8 pad;
135 __u16 len;
136};
137
138/*
139 * Unique file identifier info record.
140 * This structure is used for records of types FAN_EVENT_INFO_TYPE_FID,
141 * FAN_EVENT_INFO_TYPE_DFID and FAN_EVENT_INFO_TYPE_DFID_NAME.
142 * For FAN_EVENT_INFO_TYPE_DFID_NAME there is additionally a null terminated
143 * name immediately after the file handle.
144 */
145struct fanotify_event_info_fid {
146 struct fanotify_event_info_header hdr;
147 __kernel_fsid_t fsid;
148 /*
149 * Following is an opaque struct file_handle that can be passed as
150 * an argument to open_by_handle_at(2).
151 */
152 unsigned char handle[0];
153};
154
155/*
156 * This structure is used for info records of type FAN_EVENT_INFO_TYPE_PIDFD.
157 * It holds a pidfd for the pid that was responsible for generating an event.
158 */
159struct fanotify_event_info_pidfd {
160 struct fanotify_event_info_header hdr;
161 __s32 pidfd;
162};
163
164struct fanotify_event_info_error {
165 struct fanotify_event_info_header hdr;
166 __s32 error;
167 __u32 error_count;
168};
169
96struct fanotify_response {170struct fanotify_response {
97 __s32 fd;171 __s32 fd;
98 __u32 response;172 __u32 response;
...@@ -105,6 +179,8 @@ struct fanotify_response {...@@ -105,6 +179,8 @@ struct fanotify_response {
105179
106/* No fd set in event */180/* No fd set in event */
107#define FAN_NOFD -1181#define FAN_NOFD -1
182#define FAN_NOPIDFD FAN_NOFD
183#define FAN_EPIDFD -2
108184
109/* Helper functions to deal with fanotify_event_metadata buffers */185/* Helper functions to deal with fanotify_event_metadata buffers */
110#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))186#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
lib/libc/include/any-linux-any/linux/fb.h+1-2
...@@ -203,6 +203,7 @@ struct fb_bitfield {...@@ -203,6 +203,7 @@ struct fb_bitfield {
203#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */203#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
204#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/204#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
205#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */205#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
206#define FB_ACTIVATE_KD_TEXT 512 /* for KDSET vt ioctl */
206207
207#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */208#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
208209
...@@ -391,11 +392,9 @@ struct fb_cursor {...@@ -391,11 +392,9 @@ struct fb_cursor {
391 struct fb_image image; /* Cursor image */392 struct fb_image image; /* Cursor image */
392};393};
393394
394#ifdef CONFIG_FB_BACKLIGHT
395/* Settings for the generic backlight code */395/* Settings for the generic backlight code */
396#define FB_BACKLIGHT_LEVELS 128396#define FB_BACKLIGHT_LEVELS 128
397#define FB_BACKLIGHT_MAX 0xFF397#define FB_BACKLIGHT_MAX 0xFF
398#endif
399398
400399
401#endif /* _LINUX_FB_H */400#endif /* _LINUX_FB_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fcntl.h+21-1
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3#define _LINUX_FCNTL_H3#define _LINUX_FCNTL_H
44
5#include <asm/fcntl.h>5#include <asm/fcntl.h>
6#include <linux/openat2.h>
67
7#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)8#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
8#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)9#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
...@@ -41,6 +42,7 @@...@@ -41,6 +42,7 @@
41#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */42#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
42#define F_SEAL_GROW 0x0004 /* prevent file from growing */43#define F_SEAL_GROW 0x0004 /* prevent file from growing */
43#define F_SEAL_WRITE 0x0008 /* prevent writes */44#define F_SEAL_WRITE 0x0008 /* prevent writes */
45#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
44/* (1U << 31) is reserved for signed error codes */46/* (1U << 31) is reserved for signed error codes */
4547
46/*48/*
...@@ -57,13 +59,20 @@...@@ -57,13 +59,20 @@
57 * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be59 * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
58 * used to clear any hints previously set.60 * used to clear any hints previously set.
59 */61 */
60#define RWF_WRITE_LIFE_NOT_SET 062#define RWH_WRITE_LIFE_NOT_SET 0
61#define RWH_WRITE_LIFE_NONE 163#define RWH_WRITE_LIFE_NONE 1
62#define RWH_WRITE_LIFE_SHORT 264#define RWH_WRITE_LIFE_SHORT 2
63#define RWH_WRITE_LIFE_MEDIUM 365#define RWH_WRITE_LIFE_MEDIUM 3
64#define RWH_WRITE_LIFE_LONG 466#define RWH_WRITE_LIFE_LONG 4
65#define RWH_WRITE_LIFE_EXTREME 567#define RWH_WRITE_LIFE_EXTREME 5
6668
69/*
70 * The originally introduced spelling is remained from the first
71 * versions of the patch set that introduced the feature, see commit
72 * v4.13-rc1~212^2~51.
73 */
74#define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
75
67/*76/*
68 * Types of directory notifications that may be requested.77 * Types of directory notifications that may be requested.
69 */78 */
...@@ -75,10 +84,20 @@...@@ -75,10 +84,20 @@
75#define DN_ATTRIB 0x00000020 /* File changed attibutes */84#define DN_ATTRIB 0x00000020 /* File changed attibutes */
76#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */85#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
7786
87/*
88 * The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EACCESS is
89 * meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
90 * unlinkat. The two functions do completely different things and therefore,
91 * the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to
92 * faccessat would be undefined behavior and thus treating it equivalent to
93 * AT_EACCESS is valid undefined behavior.
94 */
78#define AT_FDCWD -100 /* Special value used to indicate95#define AT_FDCWD -100 /* Special value used to indicate
79 openat should use the current96 openat should use the current
80 working directory. */97 working directory. */
81#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */98#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
99#define AT_EACCESS 0x200 /* Test access permitted for
100 effective IDs, not real IDs. */
82#define AT_REMOVEDIR 0x200 /* Remove directory instead of101#define AT_REMOVEDIR 0x200 /* Remove directory instead of
83 unlinking file. */102 unlinking file. */
84#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */103#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
...@@ -90,5 +109,6 @@...@@ -90,5 +109,6 @@
90#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */109#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
91#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */110#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
92111
112#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
93113
94#endif /* _LINUX_FCNTL_H */114#endif /* _LINUX_FCNTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fd.h+45-27
...@@ -49,11 +49,11 @@ struct floppy_struct {...@@ -49,11 +49,11 @@ struct floppy_struct {
49#define FDCLRPRM _IO(2, 0x41)49#define FDCLRPRM _IO(2, 0x41)
50/* clear user-defined parameters */50/* clear user-defined parameters */
5151
52#define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 52#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
53#define FDSETMEDIAPRM FDSETPRM53#define FDSETMEDIAPRM FDSETPRM
54/* set user-defined parameters for current media */54/* set user-defined parameters for current media */
5555
56#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 56#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
57#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)57#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
58#define FDDEFMEDIAPRM FDDEFPRM58#define FDDEFMEDIAPRM FDDEFPRM
59#define FDGETMEDIAPRM FDGETPRM59#define FDGETMEDIAPRM FDGETPRM
...@@ -65,7 +65,7 @@ struct floppy_struct {...@@ -65,7 +65,7 @@ struct floppy_struct {
65/* issue/don't issue kernel messages on media type change */65/* issue/don't issue kernel messages on media type change */
6666
6767
68/* 68/*
69 * Formatting (obsolete)69 * Formatting (obsolete)
70 */70 */
71#define FD_FILL_BYTE 0xF6 /* format fill byte. */71#define FD_FILL_BYTE 0xF6 /* format fill byte. */
...@@ -126,13 +126,13 @@ typedef char floppy_drive_name[16];...@@ -126,13 +126,13 @@ typedef char floppy_drive_name[16];
126 */126 */
127struct floppy_drive_params {127struct floppy_drive_params {
128 signed char cmos; /* CMOS type */128 signed char cmos; /* CMOS type */
129 129
130 /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms 130 /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
131 * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).131 * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
132 */132 */
133 unsigned long max_dtr; /* Step rate, usec */133 unsigned long max_dtr; /* Step rate, usec */
134 unsigned long hlt; /* Head load/settle time, msec */134 unsigned long hlt; /* Head load/settle time, msec */
135 unsigned long hut; /* Head unload time (remnant of 135 unsigned long hut; /* Head unload time (remnant of
136 * 8" drives) */136 * 8" drives) */
137 unsigned long srt; /* Step rate, usec */137 unsigned long srt; /* Step rate, usec */
138138
...@@ -145,12 +145,12 @@ struct floppy_drive_params {...@@ -145,12 +145,12 @@ struct floppy_drive_params {
145 unsigned char rps; /* rotations per second */145 unsigned char rps; /* rotations per second */
146 unsigned char tracks; /* maximum number of tracks */146 unsigned char tracks; /* maximum number of tracks */
147 unsigned long timeout; /* timeout for interrupt requests */147 unsigned long timeout; /* timeout for interrupt requests */
148 148
149 unsigned char interleave_sect; /* if there are more sectors, use 149 unsigned char interleave_sect; /* if there are more sectors, use
150 * interleave */150 * interleave */
151 151
152 struct floppy_max_errors max_errors;152 struct floppy_max_errors max_errors;
153 153
154 char flags; /* various flags, including ftd_msg */154 char flags; /* various flags, including ftd_msg */
155/*155/*
156 * Announce successful media type detection and media information loss after156 * Announce successful media type detection and media information loss after
...@@ -162,7 +162,7 @@ struct floppy_drive_params {...@@ -162,7 +162,7 @@ struct floppy_drive_params {
162#define FD_BROKEN_DCL 0x20162#define FD_BROKEN_DCL 0x20
163#define FD_DEBUG 0x02163#define FD_DEBUG 0x02
164#define FD_SILENT_DCL_CLEAR 0x4164#define FD_SILENT_DCL_CLEAR 0x4
165#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware 165#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
166 considerations */166 considerations */
167167
168 char read_track; /* use readtrack during probing? */168 char read_track; /* use readtrack during probing? */
...@@ -172,9 +172,12 @@ struct floppy_drive_params {...@@ -172,9 +172,12 @@ struct floppy_drive_params {
172 * used in succession to try to read the disk. If the FDC cannot lock onto172 * used in succession to try to read the disk. If the FDC cannot lock onto
173 * the disk, the next format is tried. This uses the variable 'probing'.173 * the disk, the next format is tried. This uses the variable 'probing'.
174 */174 */
175 short autodetect[8]; /* autodetected formats */175
176 176#define FD_AUTODETECT_SIZE 8
177 int checkfreq; /* how often should the drive be checked for disk 177
178 short autodetect[FD_AUTODETECT_SIZE]; /* autodetected formats */
179
180 int checkfreq; /* how often should the drive be checked for disk
178 * changes */181 * changes */
179 int native_format; /* native format of this drive */182 int native_format; /* native format of this drive */
180};183};
...@@ -222,13 +225,13 @@ struct floppy_drive_struct {...@@ -222,13 +225,13 @@ struct floppy_drive_struct {
222 * decremented after each probe.225 * decremented after each probe.
223 */226 */
224 int keep_data;227 int keep_data;
225 228
226 /* Prevent "aliased" accesses. */229 /* Prevent "aliased" accesses. */
227 int fd_ref;230 int fd_ref;
228 int fd_device;231 int fd_device;
229 unsigned long last_checked; /* when was the drive last checked for a disk 232 unsigned long last_checked; /* when was the drive last checked for a disk
230 * change? */233 * change? */
231 234
232 char *dmabuf;235 char *dmabuf;
233 int bufblocks;236 int bufblocks;
234};237};
...@@ -252,7 +255,7 @@ enum reset_mode {...@@ -252,7 +255,7 @@ enum reset_mode {
252/*255/*
253 * FDC state256 * FDC state
254 */257 */
255struct floppy_fdc_state { 258struct floppy_fdc_state {
256 int spec1; /* spec1 value last used */259 int spec1; /* spec1 value last used */
257 int spec2; /* spec2 value last used */260 int spec2; /* spec2 value last used */
258 int dtr;261 int dtr;
...@@ -299,16 +302,16 @@ struct floppy_write_errors {...@@ -299,16 +302,16 @@ struct floppy_write_errors {
299 * to the user process are not counted.302 * to the user process are not counted.
300 */303 */
301304
302 unsigned int write_errors; /* number of physical write errors 305 unsigned int write_errors; /* number of physical write errors
303 * encountered */306 * encountered */
304 307
305 /* position of first and last write errors */308 /* position of first and last write errors */
306 unsigned long first_error_sector;309 unsigned long first_error_sector;
307 int first_error_generation;310 int first_error_generation;
308 unsigned long last_error_sector;311 unsigned long last_error_sector;
309 int last_error_generation;312 int last_error_generation;
310 313
311 unsigned int badness; /* highest retry count for a read or write 314 unsigned int badness; /* highest retry count for a read or write
312 * operation */315 * operation */
313};316};
314317
...@@ -332,7 +335,7 @@ struct floppy_raw_cmd {...@@ -332,7 +335,7 @@ struct floppy_raw_cmd {
332#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */335#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
333#define FD_RAW_INTR 8 /* wait for an interrupt */336#define FD_RAW_INTR 8 /* wait for an interrupt */
334#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */337#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
335#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command 338#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
336 * completion */339 * completion */
337#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */340#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
338#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */341#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
...@@ -350,17 +353,32 @@ struct floppy_raw_cmd {...@@ -350,17 +353,32 @@ struct floppy_raw_cmd {
350353
351 void *data;354 void *data;
352 char *kernel_data; /* location of data buffer in the kernel */355 char *kernel_data; /* location of data buffer in the kernel */
353 struct floppy_raw_cmd *next; /* used for chaining of raw cmd's 356 struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
354 * within the kernel */357 * within the kernel */
355 long length; /* in: length of dma transfer. out: remaining bytes */358 long length; /* in: length of dma transfer. out: remaining bytes */
356 long phys_length; /* physical length, if different from dma length */359 long phys_length; /* physical length, if different from dma length */
357 int buffer_length; /* length of allocated buffer */360 int buffer_length; /* length of allocated buffer */
358361
359 unsigned char rate;362 unsigned char rate;
363
364#define FD_RAW_CMD_SIZE 16
365#define FD_RAW_REPLY_SIZE 16
366#define FD_RAW_CMD_FULLSIZE (FD_RAW_CMD_SIZE + 1 + FD_RAW_REPLY_SIZE)
367
368 /* The command may take up the space initially intended for the reply
369 * and the reply count. Needed for long 82078 commands such as RESTORE,
370 * which takes 17 command bytes.
371 */
372
360 unsigned char cmd_count;373 unsigned char cmd_count;
361 unsigned char cmd[16];374 union {
362 unsigned char reply_count;375 struct {
363 unsigned char reply[16];376 unsigned char cmd[FD_RAW_CMD_SIZE];
377 unsigned char reply_count;
378 unsigned char reply[FD_RAW_REPLY_SIZE];
379 };
380 unsigned char fullcmd[FD_RAW_CMD_FULLSIZE];
381 };
364 int track;382 int track;
365 int resultcode;383 int resultcode;
366384
lib/libc/include/any-linux-any/linux/fdreg.h+16-14
...@@ -7,26 +7,28 @@...@@ -7,26 +7,28 @@
7 * Handbook", Sanches and Canton.7 * Handbook", Sanches and Canton.
8 */8 */
99
10#ifdef FDPATCHES10/* 82077's auxiliary status registers A & B (R) */
11#define FD_IOPORT fdc_state[fdc].address11#define FD_SRA 0
12#else12#define FD_SRB 1
13/* It would be a lot saner just to force fdc_state[fdc].address to always
14 be set ! FIXME */
15#define FD_IOPORT 0x3f0
16#endif
17
18/* Fd controller regs. S&C, about page 340 */
19#define FD_STATUS (4 + FD_IOPORT )
20#define FD_DATA (5 + FD_IOPORT )
2113
22/* Digital Output Register */14/* Digital Output Register */
23#define FD_DOR (2 + FD_IOPORT )15#define FD_DOR 2
16
17/* 82077's tape drive register (R/W) */
18#define FD_TDR 3
19
20/* 82077's data rate select register (W) */
21#define FD_DSR 4
22
23/* Fd controller regs. S&C, about page 340 */
24#define FD_STATUS 4
25#define FD_DATA 5
2426
25/* Digital Input Register (read) */27/* Digital Input Register (read) */
26#define FD_DIR (7 + FD_IOPORT )28#define FD_DIR 7
2729
28/* Diskette Control Register (write)*/30/* Diskette Control Register (write)*/
29#define FD_DCR (7 + FD_IOPORT )31#define FD_DCR 7
3032
31/* Bits of main status register */33/* Bits of main status register */
32#define STATUS_BUSYMASK 0x0F /* drive busy mask */34#define STATUS_BUSYMASK 0x0F /* drive busy mask */
lib/libc/include/any-linux-any/linux/firewire-cdev.h+16-10
...@@ -47,11 +47,11 @@...@@ -47,11 +47,11 @@
47#define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x0947#define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
4848
49/**49/**
50 * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types50 * struct fw_cdev_event_common - Common part of all fw_cdev_event_* types
51 * @closure: For arbitrary use by userspace51 * @closure: For arbitrary use by userspace
52 * @type: Discriminates the fw_cdev_event_ types52 * @type: Discriminates the fw_cdev_event_* types
53 *53 *
54 * This struct may be used to access generic members of all fw_cdev_event_54 * This struct may be used to access generic members of all fw_cdev_event_*
55 * types regardless of the specific type.55 * types regardless of the specific type.
56 *56 *
57 * Data passed in the @closure field for a request will be returned in the57 * Data passed in the @closure field for a request will be returned in the
...@@ -123,7 +123,13 @@ struct fw_cdev_event_response {...@@ -123,7 +123,13 @@ struct fw_cdev_event_response {
123123
124/**124/**
125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2
126 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
126 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST127 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
128 * @tcode: Transaction code of the incoming request
129 * @offset: The offset into the 48-bit per-node address space
130 * @handle: Reference to the kernel-side pending request
131 * @length: Data length, i.e. the request's payload size in bytes
132 * @data: Incoming data, if any
127 *133 *
128 * This event is sent instead of &fw_cdev_event_request2 if the kernel or134 * This event is sent instead of &fw_cdev_event_request2 if the kernel or
129 * the client implements ABI version <= 3. &fw_cdev_event_request lacks135 * the client implements ABI version <= 3. &fw_cdev_event_request lacks
...@@ -302,7 +308,7 @@ struct fw_cdev_event_iso_interrupt_mc {...@@ -302,7 +308,7 @@ struct fw_cdev_event_iso_interrupt_mc {
302/**308/**
303 * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed309 * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed
304 * @closure: See &fw_cdev_event_common;310 * @closure: See &fw_cdev_event_common;
305 * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl311 * set by``FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE)`` ioctl
306 * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or312 * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
307 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED313 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
308 * @handle: Reference by which an allocated resource can be deallocated314 * @handle: Reference by which an allocated resource can be deallocated
...@@ -353,7 +359,7 @@ struct fw_cdev_event_phy_packet {...@@ -353,7 +359,7 @@ struct fw_cdev_event_phy_packet {
353};359};
354360
355/**361/**
356 * union fw_cdev_event - Convenience union of fw_cdev_event_ types362 * union fw_cdev_event - Convenience union of fw_cdev_event_* types
357 * @common: Valid for all types363 * @common: Valid for all types
358 * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET364 * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
359 * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE365 * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
...@@ -735,7 +741,7 @@ struct fw_cdev_set_iso_channels {...@@ -735,7 +741,7 @@ struct fw_cdev_set_iso_channels {
735 * @header: Header and payload in case of a transmit context.741 * @header: Header and payload in case of a transmit context.
736 *742 *
737 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.743 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
738 * Use the FW_CDEV_ISO_ macros to fill in @control.744 * Use the FW_CDEV_ISO_* macros to fill in @control.
739 * The @header array is empty in case of receive contexts.745 * The @header array is empty in case of receive contexts.
740 *746 *
741 * Context type %FW_CDEV_ISO_CONTEXT_TRANSMIT:747 * Context type %FW_CDEV_ISO_CONTEXT_TRANSMIT:
...@@ -838,11 +844,11 @@ struct fw_cdev_queue_iso {...@@ -838,11 +844,11 @@ struct fw_cdev_queue_iso {
838 * struct fw_cdev_start_iso - Start an isochronous transmission or reception844 * struct fw_cdev_start_iso - Start an isochronous transmission or reception
839 * @cycle: Cycle in which to start I/O. If @cycle is greater than or845 * @cycle: Cycle in which to start I/O. If @cycle is greater than or
840 * equal to 0, the I/O will start on that cycle.846 * equal to 0, the I/O will start on that cycle.
841 * @sync: Determines the value to wait for for receive packets that have847 * @sync: Determines the value to wait for receive packets that have
842 * the %FW_CDEV_ISO_SYNC bit set848 * the %FW_CDEV_ISO_SYNC bit set
843 * @tags: Tag filter bit mask. Only valid for isochronous reception.849 * @tags: Tag filter bit mask. Only valid for isochronous reception.
844 * Determines the tag values for which packets will be accepted.850 * Determines the tag values for which packets will be accepted.
845 * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.851 * Use FW_CDEV_ISO_CONTEXT_MATCH_* macros to set @tags.
846 * @handle: Isochronous context handle within which to transmit or receive852 * @handle: Isochronous context handle within which to transmit or receive
847 */853 */
848struct fw_cdev_start_iso {854struct fw_cdev_start_iso {
...@@ -1009,8 +1015,8 @@ struct fw_cdev_send_stream_packet {...@@ -1009,8 +1015,8 @@ struct fw_cdev_send_stream_packet {
1009 * on the same card as this device. After transmission, an1015 * on the same card as this device. After transmission, an
1010 * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated.1016 * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated.
1011 *1017 *
1012 * The payload @data[] shall be specified in host byte order. Usually,1018 * The payload @data\[\] shall be specified in host byte order. Usually,
1013 * @data[1] needs to be the bitwise inverse of @data[0]. VersaPHY packets1019 * @data\[1\] needs to be the bitwise inverse of @data\[0\]. VersaPHY packets
1014 * are an exception to this rule.1020 * are an exception to this rule.
1015 *1021 *
1016 * The ioctl is only permitted on device files which represent a local node.1022 * The ioctl is only permitted on device files which represent a local node.
lib/libc/include/any-linux-any/linux/flat.h deleted-59
...@@ -1,59 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
4 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
5 * The Silver Hammer Group, Ltd.
6 *
7 * This file provides the definitions and structures needed to
8 * support uClinux flat-format executables.
9 */
10
11#ifndef _LINUX_FLAT_H
12#define _LINUX_FLAT_H
13
14
15#define FLAT_VERSION 0x00000004L
16
17#ifdef CONFIG_BINFMT_SHARED_FLAT
18#define MAX_SHARED_LIBS (4)
19#else
20#define MAX_SHARED_LIBS (1)
21#endif
22
23/*
24 * To make everything easier to port and manage cross platform
25 * development, all fields are in network byte order.
26 */
27
28struct flat_hdr {
29 char magic[4];
30 unsigned long rev; /* version (as above) */
31 unsigned long entry; /* Offset of first executable instruction
32 with text segment from beginning of file */
33 unsigned long data_start; /* Offset of data segment from beginning of
34 file */
35 unsigned long data_end; /* Offset of end of data segment
36 from beginning of file */
37 unsigned long bss_end; /* Offset of end of bss segment from beginning
38 of file */
39
40 /* (It is assumed that data_end through bss_end forms the bss segment.) */
41
42 unsigned long stack_size; /* Size of stack, in bytes */
43 unsigned long reloc_start; /* Offset of relocation records from
44 beginning of file */
45 unsigned long reloc_count; /* Number of relocation records */
46 unsigned long flags;
47 unsigned long build_date; /* When the program/library was built */
48 unsigned long filler[5]; /* Reservered, set to zero */
49};
50
51#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
52#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
53#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
54#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
55#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
56
57
58
59#endif /* _LINUX_FLAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fou.h+6
...@@ -16,6 +16,12 @@ enum {...@@ -16,6 +16,12 @@ enum {
16 FOU_ATTR_IPPROTO, /* u8 */16 FOU_ATTR_IPPROTO, /* u8 */
17 FOU_ATTR_TYPE, /* u8 */17 FOU_ATTR_TYPE, /* u8 */
18 FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */18 FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */
19 FOU_ATTR_LOCAL_V4, /* u32 */
20 FOU_ATTR_LOCAL_V6, /* in6_addr */
21 FOU_ATTR_PEER_V4, /* u32 */
22 FOU_ATTR_PEER_V6, /* in6_addr */
23 FOU_ATTR_PEER_PORT, /* u16 */
24 FOU_ATTR_IFINDEX, /* s32 */
1925
20 __FOU_ATTR_MAX,26 __FOU_ATTR_MAX,
21};27};
lib/libc/include/any-linux-any/linux/fpga-dfl.h+100
...@@ -151,6 +151,65 @@ struct dfl_fpga_port_dma_unmap {...@@ -151,6 +151,65 @@ struct dfl_fpga_port_dma_unmap {
151151
152#define DFL_FPGA_PORT_DMA_UNMAP _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 4)152#define DFL_FPGA_PORT_DMA_UNMAP _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 4)
153153
154/**
155 * struct dfl_fpga_irq_set - the argument for DFL_FPGA_XXX_SET_IRQ ioctl.
156 *
157 * @start: Index of the first irq.
158 * @count: The number of eventfd handler.
159 * @evtfds: Eventfd handlers.
160 */
161struct dfl_fpga_irq_set {
162 __u32 start;
163 __u32 count;
164 __s32 evtfds[];
165};
166
167/**
168 * DFL_FPGA_PORT_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_PORT_BASE + 5,
169 * __u32 num_irqs)
170 *
171 * Get the number of irqs supported by the fpga port error reporting private
172 * feature. Currently hardware supports up to 1 irq.
173 * Return: 0 on success, -errno on failure.
174 */
175#define DFL_FPGA_PORT_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
176 DFL_PORT_BASE + 5, __u32)
177
178/**
179 * DFL_FPGA_PORT_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_PORT_BASE + 6,
180 * struct dfl_fpga_irq_set)
181 *
182 * Set fpga port error reporting interrupt trigger if evtfds[n] is valid.
183 * Unset related interrupt trigger if evtfds[n] is a negative value.
184 * Return: 0 on success, -errno on failure.
185 */
186#define DFL_FPGA_PORT_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
187 DFL_PORT_BASE + 6, \
188 struct dfl_fpga_irq_set)
189
190/**
191 * DFL_FPGA_PORT_UINT_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_PORT_BASE + 7,
192 * __u32 num_irqs)
193 *
194 * Get the number of irqs supported by the fpga AFU interrupt private
195 * feature.
196 * Return: 0 on success, -errno on failure.
197 */
198#define DFL_FPGA_PORT_UINT_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
199 DFL_PORT_BASE + 7, __u32)
200
201/**
202 * DFL_FPGA_PORT_UINT_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_PORT_BASE + 8,
203 * struct dfl_fpga_irq_set)
204 *
205 * Set fpga AFU interrupt trigger if evtfds[n] is valid.
206 * Unset related interrupt trigger if evtfds[n] is a negative value.
207 * Return: 0 on success, -errno on failure.
208 */
209#define DFL_FPGA_PORT_UINT_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
210 DFL_PORT_BASE + 8, \
211 struct dfl_fpga_irq_set)
212
154/* IOCTLs for FME file descriptor */213/* IOCTLs for FME file descriptor */
155214
156/**215/**
...@@ -176,4 +235,45 @@ struct dfl_fpga_fme_port_pr {...@@ -176,4 +235,45 @@ struct dfl_fpga_fme_port_pr {
176235
177#define DFL_FPGA_FME_PORT_PR _IO(DFL_FPGA_MAGIC, DFL_FME_BASE + 0)236#define DFL_FPGA_FME_PORT_PR _IO(DFL_FPGA_MAGIC, DFL_FME_BASE + 0)
178237
238/**
239 * DFL_FPGA_FME_PORT_RELEASE - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 1,
240 * int port_id)
241 *
242 * Driver releases the port per Port ID provided by caller.
243 * Return: 0 on success, -errno on failure.
244 */
245#define DFL_FPGA_FME_PORT_RELEASE _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 1, int)
246
247/**
248 * DFL_FPGA_FME_PORT_ASSIGN - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 2,
249 * int port_id)
250 *
251 * Driver assigns the port back per Port ID provided by caller.
252 * Return: 0 on success, -errno on failure.
253 */
254#define DFL_FPGA_FME_PORT_ASSIGN _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 2, int)
255
256/**
257 * DFL_FPGA_FME_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_FME_BASE + 3,
258 * __u32 num_irqs)
259 *
260 * Get the number of irqs supported by the fpga fme error reporting private
261 * feature. Currently hardware supports up to 1 irq.
262 * Return: 0 on success, -errno on failure.
263 */
264#define DFL_FPGA_FME_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
265 DFL_FME_BASE + 3, __u32)
266
267/**
268 * DFL_FPGA_FME_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 4,
269 * struct dfl_fpga_irq_set)
270 *
271 * Set fpga fme error reporting interrupt trigger if evtfds[n] is valid.
272 * Unset related interrupt trigger if evtfds[n] is a negative value.
273 * Return: 0 on success, -errno on failure.
274 */
275#define DFL_FPGA_FME_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
276 DFL_FME_BASE + 4, \
277 struct dfl_fpga_irq_set)
278
179#endif /* _LINUX_FPGA_DFL_H */279#endif /* _LINUX_FPGA_DFL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fs.h+12-101
...@@ -13,6 +13,10 @@...@@ -13,6 +13,10 @@
13#include <linux/limits.h>13#include <linux/limits.h>
14#include <linux/ioctl.h>14#include <linux/ioctl.h>
15#include <linux/types.h>15#include <linux/types.h>
16#include <linux/fscrypt.h>
17
18/* Use of MS_* flags within the kernel is restricted to core mount(2) code. */
19#include <linux/mount.h>
1620
17/*21/*
18 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change22 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
...@@ -101,57 +105,6 @@ struct inodes_stat_t {...@@ -101,57 +105,6 @@ struct inodes_stat_t {
101105
102#define NR_FILE 8192 /* this can well be larger on a larger system */106#define NR_FILE 8192 /* this can well be larger on a larger system */
103107
104
105/*
106 * These are the fs-independent mount-flags: up to 32 flags are supported
107 */
108#define MS_RDONLY 1 /* Mount read-only */
109#define MS_NOSUID 2 /* Ignore suid and sgid bits */
110#define MS_NODEV 4 /* Disallow access to device special files */
111#define MS_NOEXEC 8 /* Disallow program execution */
112#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
113#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
114#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
115#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
116#define MS_NOATIME 1024 /* Do not update access times. */
117#define MS_NODIRATIME 2048 /* Do not update directory access times */
118#define MS_BIND 4096
119#define MS_MOVE 8192
120#define MS_REC 16384
121#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
122 MS_VERBOSE is deprecated. */
123#define MS_SILENT 32768
124#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
125#define MS_UNBINDABLE (1<<17) /* change to unbindable */
126#define MS_PRIVATE (1<<18) /* change to private */
127#define MS_SLAVE (1<<19) /* change to slave */
128#define MS_SHARED (1<<20) /* change to shared */
129#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
130#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
131#define MS_I_VERSION (1<<23) /* Update inode I_version field */
132#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
133#define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
134
135/* These sb flags are internal to the kernel */
136#define MS_SUBMOUNT (1<<26)
137#define MS_NOREMOTELOCK (1<<27)
138#define MS_NOSEC (1<<28)
139#define MS_BORN (1<<29)
140#define MS_ACTIVE (1<<30)
141#define MS_NOUSER (1<<31)
142
143/*
144 * Superblock flags that can be altered by MS_REMOUNT
145 */
146#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\
147 MS_LAZYTIME)
148
149/*
150 * Old magic mount flag and mask
151 */
152#define MS_MGC_VAL 0xC0ED0000
153#define MS_MGC_MSK 0xffff0000
154
155/*108/*
156 * Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.109 * Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.
157 */110 */
...@@ -227,8 +180,9 @@ struct fsxattr {...@@ -227,8 +180,9 @@ struct fsxattr {
227#define BLKSECDISCARD _IO(0x12,125)180#define BLKSECDISCARD _IO(0x12,125)
228#define BLKROTATIONAL _IO(0x12,126)181#define BLKROTATIONAL _IO(0x12,126)
229#define BLKZEROOUT _IO(0x12,127)182#define BLKZEROOUT _IO(0x12,127)
183#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
230/*184/*
231 * A jump here: 130-131 are reserved for zoned block devices185 * A jump here: 130-136 are reserved for zoned block devices
232 * (see uapi/linux/blkzoned.h)186 * (see uapi/linux/blkzoned.h)
233 */187 */
234188
...@@ -258,55 +212,6 @@ struct fsxattr {...@@ -258,55 +212,6 @@ struct fsxattr {
258#define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX])212#define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX])
259#define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX])213#define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX])
260214
261/*
262 * File system encryption support
263 */
264/* Policy provided via an ioctl on the topmost directory */
265#define FS_KEY_DESCRIPTOR_SIZE 8
266
267#define FS_POLICY_FLAGS_PAD_4 0x00
268#define FS_POLICY_FLAGS_PAD_8 0x01
269#define FS_POLICY_FLAGS_PAD_16 0x02
270#define FS_POLICY_FLAGS_PAD_32 0x03
271#define FS_POLICY_FLAGS_PAD_MASK 0x03
272#define FS_POLICY_FLAGS_VALID 0x03
273
274/* Encryption algorithms */
275#define FS_ENCRYPTION_MODE_INVALID 0
276#define FS_ENCRYPTION_MODE_AES_256_XTS 1
277#define FS_ENCRYPTION_MODE_AES_256_GCM 2
278#define FS_ENCRYPTION_MODE_AES_256_CBC 3
279#define FS_ENCRYPTION_MODE_AES_256_CTS 4
280#define FS_ENCRYPTION_MODE_AES_128_CBC 5
281#define FS_ENCRYPTION_MODE_AES_128_CTS 6
282#define FS_ENCRYPTION_MODE_SPECK128_256_XTS 7 /* Removed, do not use. */
283#define FS_ENCRYPTION_MODE_SPECK128_256_CTS 8 /* Removed, do not use. */
284
285struct fscrypt_policy {
286 __u8 version;
287 __u8 contents_encryption_mode;
288 __u8 filenames_encryption_mode;
289 __u8 flags;
290 __u8 master_key_descriptor[FS_KEY_DESCRIPTOR_SIZE];
291};
292
293#define FS_IOC_SET_ENCRYPTION_POLICY _IOR('f', 19, struct fscrypt_policy)
294#define FS_IOC_GET_ENCRYPTION_PWSALT _IOW('f', 20, __u8[16])
295#define FS_IOC_GET_ENCRYPTION_POLICY _IOW('f', 21, struct fscrypt_policy)
296
297/* Parameters for passing an encryption key into the kernel keyring */
298#define FS_KEY_DESC_PREFIX "fscrypt:"
299#define FS_KEY_DESC_PREFIX_SIZE 8
300
301/* Structure that userspace passes to the kernel keyring */
302#define FS_MAX_KEY_SIZE 64
303
304struct fscrypt_key {
305 __u32 mode;
306 __u8 raw[FS_MAX_KEY_SIZE];
307 __u32 size;
308};
309
310/*215/*
311 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)216 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
312 *217 *
...@@ -350,11 +255,14 @@ struct fscrypt_key {...@@ -350,11 +255,14 @@ struct fscrypt_key {
350#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/255#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
351#define FS_HUGE_FILE_FL 0x00040000 /* Reserved for ext4 */256#define FS_HUGE_FILE_FL 0x00040000 /* Reserved for ext4 */
352#define FS_EXTENT_FL 0x00080000 /* Extents */257#define FS_EXTENT_FL 0x00080000 /* Extents */
258#define FS_VERITY_FL 0x00100000 /* Verity protected inode */
353#define FS_EA_INODE_FL 0x00200000 /* Inode used for large EA */259#define FS_EA_INODE_FL 0x00200000 /* Inode used for large EA */
354#define FS_EOFBLOCKS_FL 0x00400000 /* Reserved for ext4 */260#define FS_EOFBLOCKS_FL 0x00400000 /* Reserved for ext4 */
355#define FS_NOCOW_FL 0x00800000 /* Do not cow file */261#define FS_NOCOW_FL 0x00800000 /* Do not cow file */
262#define FS_DAX_FL 0x02000000 /* Inode is DAX */
356#define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */263#define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */
357#define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */264#define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
265#define FS_CASEFOLD_FL 0x40000000 /* Folder is case insensitive */
358#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */266#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
359267
360#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */268#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
...@@ -364,6 +272,9 @@ struct fscrypt_key {...@@ -364,6 +272,9 @@ struct fscrypt_key {
364#define SYNC_FILE_RANGE_WAIT_BEFORE 1272#define SYNC_FILE_RANGE_WAIT_BEFORE 1
365#define SYNC_FILE_RANGE_WRITE 2273#define SYNC_FILE_RANGE_WRITE 2
366#define SYNC_FILE_RANGE_WAIT_AFTER 4274#define SYNC_FILE_RANGE_WAIT_AFTER 4
275#define SYNC_FILE_RANGE_WRITE_AND_WAIT (SYNC_FILE_RANGE_WRITE | \
276 SYNC_FILE_RANGE_WAIT_BEFORE | \
277 SYNC_FILE_RANGE_WAIT_AFTER)
367278
368/*279/*
369 * Flags for preadv2/pwritev2:280 * Flags for preadv2/pwritev2:
lib/libc/include/any-linux-any/linux/fscrypt.h created+193
...@@ -0,0 +1,193 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * fscrypt user API
4 *
5 * These ioctls can be used on filesystems that support fscrypt. See the
6 * "User API" section of Documentation/filesystems/fscrypt.rst.
7 */
8#ifndef _LINUX_FSCRYPT_H
9#define _LINUX_FSCRYPT_H
10
11#include <linux/ioctl.h>
12#include <linux/types.h>
13
14/* Encryption policy flags */
15#define FSCRYPT_POLICY_FLAGS_PAD_4 0x00
16#define FSCRYPT_POLICY_FLAGS_PAD_8 0x01
17#define FSCRYPT_POLICY_FLAGS_PAD_16 0x02
18#define FSCRYPT_POLICY_FLAGS_PAD_32 0x03
19#define FSCRYPT_POLICY_FLAGS_PAD_MASK 0x03
20#define FSCRYPT_POLICY_FLAG_DIRECT_KEY 0x04
21#define FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 0x08
22#define FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32 0x10
23
24/* Encryption algorithms */
25#define FSCRYPT_MODE_AES_256_XTS 1
26#define FSCRYPT_MODE_AES_256_CTS 4
27#define FSCRYPT_MODE_AES_128_CBC 5
28#define FSCRYPT_MODE_AES_128_CTS 6
29#define FSCRYPT_MODE_ADIANTUM 9
30/* If adding a mode number > 9, update FSCRYPT_MODE_MAX in fscrypt_private.h */
31
32/*
33 * Legacy policy version; ad-hoc KDF and no key verification.
34 * For new encrypted directories, use fscrypt_policy_v2 instead.
35 *
36 * Careful: the .version field for this is actually 0, not 1.
37 */
38#define FSCRYPT_POLICY_V1 0
39#define FSCRYPT_KEY_DESCRIPTOR_SIZE 8
40struct fscrypt_policy_v1 {
41 __u8 version;
42 __u8 contents_encryption_mode;
43 __u8 filenames_encryption_mode;
44 __u8 flags;
45 __u8 master_key_descriptor[FSCRYPT_KEY_DESCRIPTOR_SIZE];
46};
47
48/*
49 * Process-subscribed "logon" key description prefix and payload format.
50 * Deprecated; prefer FS_IOC_ADD_ENCRYPTION_KEY instead.
51 */
52#define FSCRYPT_KEY_DESC_PREFIX "fscrypt:"
53#define FSCRYPT_KEY_DESC_PREFIX_SIZE 8
54#define FSCRYPT_MAX_KEY_SIZE 64
55struct fscrypt_key {
56 __u32 mode;
57 __u8 raw[FSCRYPT_MAX_KEY_SIZE];
58 __u32 size;
59};
60
61/*
62 * New policy version with HKDF and key verification (recommended).
63 */
64#define FSCRYPT_POLICY_V2 2
65#define FSCRYPT_KEY_IDENTIFIER_SIZE 16
66struct fscrypt_policy_v2 {
67 __u8 version;
68 __u8 contents_encryption_mode;
69 __u8 filenames_encryption_mode;
70 __u8 flags;
71 __u8 __reserved[4];
72 __u8 master_key_identifier[FSCRYPT_KEY_IDENTIFIER_SIZE];
73};
74
75/* Struct passed to FS_IOC_GET_ENCRYPTION_POLICY_EX */
76struct fscrypt_get_policy_ex_arg {
77 __u64 policy_size; /* input/output */
78 union {
79 __u8 version;
80 struct fscrypt_policy_v1 v1;
81 struct fscrypt_policy_v2 v2;
82 } policy; /* output */
83};
84
85/*
86 * v1 policy keys are specified by an arbitrary 8-byte key "descriptor",
87 * matching fscrypt_policy_v1::master_key_descriptor.
88 */
89#define FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR 1
90
91/*
92 * v2 policy keys are specified by a 16-byte key "identifier" which the kernel
93 * calculates as a cryptographic hash of the key itself,
94 * matching fscrypt_policy_v2::master_key_identifier.
95 */
96#define FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER 2
97
98/*
99 * Specifies a key, either for v1 or v2 policies. This doesn't contain the
100 * actual key itself; this is just the "name" of the key.
101 */
102struct fscrypt_key_specifier {
103 __u32 type; /* one of FSCRYPT_KEY_SPEC_TYPE_* */
104 __u32 __reserved;
105 union {
106 __u8 __reserved[32]; /* reserve some extra space */
107 __u8 descriptor[FSCRYPT_KEY_DESCRIPTOR_SIZE];
108 __u8 identifier[FSCRYPT_KEY_IDENTIFIER_SIZE];
109 } u;
110};
111
112/*
113 * Payload of Linux keyring key of type "fscrypt-provisioning", referenced by
114 * fscrypt_add_key_arg::key_id as an alternative to fscrypt_add_key_arg::raw.
115 */
116struct fscrypt_provisioning_key_payload {
117 __u32 type;
118 __u32 __reserved;
119 __u8 raw[];
120};
121
122/* Struct passed to FS_IOC_ADD_ENCRYPTION_KEY */
123struct fscrypt_add_key_arg {
124 struct fscrypt_key_specifier key_spec;
125 __u32 raw_size;
126 __u32 key_id;
127 __u32 __reserved[8];
128 __u8 raw[];
129};
130
131/* Struct passed to FS_IOC_REMOVE_ENCRYPTION_KEY */
132struct fscrypt_remove_key_arg {
133 struct fscrypt_key_specifier key_spec;
134#define FSCRYPT_KEY_REMOVAL_STATUS_FLAG_FILES_BUSY 0x00000001
135#define FSCRYPT_KEY_REMOVAL_STATUS_FLAG_OTHER_USERS 0x00000002
136 __u32 removal_status_flags; /* output */
137 __u32 __reserved[5];
138};
139
140/* Struct passed to FS_IOC_GET_ENCRYPTION_KEY_STATUS */
141struct fscrypt_get_key_status_arg {
142 /* input */
143 struct fscrypt_key_specifier key_spec;
144 __u32 __reserved[6];
145
146 /* output */
147#define FSCRYPT_KEY_STATUS_ABSENT 1
148#define FSCRYPT_KEY_STATUS_PRESENT 2
149#define FSCRYPT_KEY_STATUS_INCOMPLETELY_REMOVED 3
150 __u32 status;
151#define FSCRYPT_KEY_STATUS_FLAG_ADDED_BY_SELF 0x00000001
152 __u32 status_flags;
153 __u32 user_count;
154 __u32 __out_reserved[13];
155};
156
157#define FS_IOC_SET_ENCRYPTION_POLICY _IOR('f', 19, struct fscrypt_policy_v1)
158#define FS_IOC_GET_ENCRYPTION_PWSALT _IOW('f', 20, __u8[16])
159#define FS_IOC_GET_ENCRYPTION_POLICY _IOW('f', 21, struct fscrypt_policy_v1)
160#define FS_IOC_GET_ENCRYPTION_POLICY_EX _IOWR('f', 22, __u8[9]) /* size + version */
161#define FS_IOC_ADD_ENCRYPTION_KEY _IOWR('f', 23, struct fscrypt_add_key_arg)
162#define FS_IOC_REMOVE_ENCRYPTION_KEY _IOWR('f', 24, struct fscrypt_remove_key_arg)
163#define FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS _IOWR('f', 25, struct fscrypt_remove_key_arg)
164#define FS_IOC_GET_ENCRYPTION_KEY_STATUS _IOWR('f', 26, struct fscrypt_get_key_status_arg)
165#define FS_IOC_GET_ENCRYPTION_NONCE _IOR('f', 27, __u8[16])
166
167/**********************************************************************/
168
169/* old names; don't add anything new here! */
170#define fscrypt_policy fscrypt_policy_v1
171#define FS_KEY_DESCRIPTOR_SIZE FSCRYPT_KEY_DESCRIPTOR_SIZE
172#define FS_POLICY_FLAGS_PAD_4 FSCRYPT_POLICY_FLAGS_PAD_4
173#define FS_POLICY_FLAGS_PAD_8 FSCRYPT_POLICY_FLAGS_PAD_8
174#define FS_POLICY_FLAGS_PAD_16 FSCRYPT_POLICY_FLAGS_PAD_16
175#define FS_POLICY_FLAGS_PAD_32 FSCRYPT_POLICY_FLAGS_PAD_32
176#define FS_POLICY_FLAGS_PAD_MASK FSCRYPT_POLICY_FLAGS_PAD_MASK
177#define FS_POLICY_FLAG_DIRECT_KEY FSCRYPT_POLICY_FLAG_DIRECT_KEY
178#define FS_POLICY_FLAGS_VALID 0x07 /* contains old flags only */
179#define FS_ENCRYPTION_MODE_INVALID 0 /* never used */
180#define FS_ENCRYPTION_MODE_AES_256_XTS FSCRYPT_MODE_AES_256_XTS
181#define FS_ENCRYPTION_MODE_AES_256_GCM 2 /* never used */
182#define FS_ENCRYPTION_MODE_AES_256_CBC 3 /* never used */
183#define FS_ENCRYPTION_MODE_AES_256_CTS FSCRYPT_MODE_AES_256_CTS
184#define FS_ENCRYPTION_MODE_AES_128_CBC FSCRYPT_MODE_AES_128_CBC
185#define FS_ENCRYPTION_MODE_AES_128_CTS FSCRYPT_MODE_AES_128_CTS
186#define FS_ENCRYPTION_MODE_SPECK128_256_XTS 7 /* removed */
187#define FS_ENCRYPTION_MODE_SPECK128_256_CTS 8 /* removed */
188#define FS_ENCRYPTION_MODE_ADIANTUM FSCRYPT_MODE_ADIANTUM
189#define FS_KEY_DESC_PREFIX FSCRYPT_KEY_DESC_PREFIX
190#define FS_KEY_DESC_PREFIX_SIZE FSCRYPT_KEY_DESC_PREFIX_SIZE
191#define FS_MAX_KEY_SIZE FSCRYPT_MAX_KEY_SIZE
192
193#endif /* _LINUX_FSCRYPT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fsl_mc.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Management Complex (MC) userspace public interface
4 *
5 * Copyright 2021 NXP
6 *
7 */
8#ifndef _FSL_MC_H_
9#define _FSL_MC_H_
10
11#include <linux/types.h>
12
13#define MC_CMD_NUM_OF_PARAMS 7
14
15/**
16 * struct fsl_mc_command - Management Complex (MC) command structure
17 * @header: MC command header
18 * @params: MC command parameters
19 *
20 * Used by FSL_MC_SEND_MC_COMMAND
21 */
22struct fsl_mc_command {
23 __le64 header;
24 __le64 params[MC_CMD_NUM_OF_PARAMS];
25};
26
27#define FSL_MC_SEND_CMD_IOCTL_TYPE 'R'
28#define FSL_MC_SEND_CMD_IOCTL_SEQ 0xE0
29
30#define FSL_MC_SEND_MC_COMMAND \
31 _IOWR(FSL_MC_SEND_CMD_IOCTL_TYPE, FSL_MC_SEND_CMD_IOCTL_SEQ, \
32 struct fsl_mc_command)
33
34#endif /* _FSL_MC_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fsverity.h created+96
...@@ -0,0 +1,96 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * fs-verity user API
4 *
5 * These ioctls can be used on filesystems that support fs-verity. See the
6 * "User API" section of Documentation/filesystems/fsverity.rst.
7 *
8 * Copyright 2019 Google LLC
9 */
10#ifndef _LINUX_FSVERITY_H
11#define _LINUX_FSVERITY_H
12
13#include <linux/ioctl.h>
14#include <linux/types.h>
15
16#define FS_VERITY_HASH_ALG_SHA256 1
17#define FS_VERITY_HASH_ALG_SHA512 2
18
19struct fsverity_enable_arg {
20 __u32 version;
21 __u32 hash_algorithm;
22 __u32 block_size;
23 __u32 salt_size;
24 __u64 salt_ptr;
25 __u32 sig_size;
26 __u32 __reserved1;
27 __u64 sig_ptr;
28 __u64 __reserved2[11];
29};
30
31struct fsverity_digest {
32 __u16 digest_algorithm;
33 __u16 digest_size; /* input/output */
34 __u8 digest[];
35};
36
37/*
38 * Struct containing a file's Merkle tree properties. The fs-verity file digest
39 * is the hash of this struct. A userspace program needs this struct only if it
40 * needs to compute fs-verity file digests itself, e.g. in order to sign files.
41 * It isn't needed just to enable fs-verity on a file.
42 *
43 * Note: when computing the file digest, 'sig_size' and 'signature' must be left
44 * zero and empty, respectively. These fields are present only because some
45 * filesystems reuse this struct as part of their on-disk format.
46 */
47struct fsverity_descriptor {
48 __u8 version; /* must be 1 */
49 __u8 hash_algorithm; /* Merkle tree hash algorithm */
50 __u8 log_blocksize; /* log2 of size of data and tree blocks */
51 __u8 salt_size; /* size of salt in bytes; 0 if none */
52 __le32 __reserved_0x04; /* must be 0 */
53 __le64 data_size; /* size of file the Merkle tree is built over */
54 __u8 root_hash[64]; /* Merkle tree root hash */
55 __u8 salt[32]; /* salt prepended to each hashed block */
56 __u8 __reserved[144]; /* must be 0's */
57};
58
59/*
60 * Format in which fs-verity file digests are signed in built-in signatures.
61 * This is the same as 'struct fsverity_digest', except here some magic bytes
62 * are prepended to provide some context about what is being signed in case the
63 * same key is used for non-fsverity purposes, and here the fields have fixed
64 * endianness.
65 *
66 * This struct is specific to the built-in signature verification support, which
67 * is optional. fs-verity users may also verify signatures in userspace, in
68 * which case userspace is responsible for deciding on what bytes are signed.
69 * This struct may still be used, but it doesn't have to be. For example,
70 * userspace could instead use a string like "sha256:$digest_as_hex_string".
71 */
72struct fsverity_formatted_digest {
73 char magic[8]; /* must be "FSVerity" */
74 __le16 digest_algorithm;
75 __le16 digest_size;
76 __u8 digest[];
77};
78
79#define FS_VERITY_METADATA_TYPE_MERKLE_TREE 1
80#define FS_VERITY_METADATA_TYPE_DESCRIPTOR 2
81#define FS_VERITY_METADATA_TYPE_SIGNATURE 3
82
83struct fsverity_read_metadata_arg {
84 __u64 metadata_type;
85 __u64 offset;
86 __u64 length;
87 __u64 buf_ptr;
88 __u64 __reserved;
89};
90
91#define FS_IOC_ENABLE_VERITY _IOW('f', 133, struct fsverity_enable_arg)
92#define FS_IOC_MEASURE_VERITY _IOWR('f', 134, struct fsverity_digest)
93#define FS_IOC_READ_VERITY_METADATA \
94 _IOWR('f', 135, struct fsverity_read_metadata_arg)
95
96#endif /* _LINUX_FSVERITY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fuse.h+244-52
...@@ -38,12 +38,50 @@...@@ -38,12 +38,50 @@
38 *38 *
39 * Protocol changelog:39 * Protocol changelog:
40 *40 *
41 * 7.1:
42 * - add the following messages:
43 * FUSE_SETATTR, FUSE_SYMLINK, FUSE_MKNOD, FUSE_MKDIR, FUSE_UNLINK,
44 * FUSE_RMDIR, FUSE_RENAME, FUSE_LINK, FUSE_OPEN, FUSE_READ, FUSE_WRITE,
45 * FUSE_RELEASE, FUSE_FSYNC, FUSE_FLUSH, FUSE_SETXATTR, FUSE_GETXATTR,
46 * FUSE_LISTXATTR, FUSE_REMOVEXATTR, FUSE_OPENDIR, FUSE_READDIR,
47 * FUSE_RELEASEDIR
48 * - add padding to messages to accommodate 32-bit servers on 64-bit kernels
49 *
50 * 7.2:
51 * - add FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE flags
52 * - add FUSE_FSYNCDIR message
53 *
54 * 7.3:
55 * - add FUSE_ACCESS message
56 * - add FUSE_CREATE message
57 * - add filehandle to fuse_setattr_in
58 *
59 * 7.4:
60 * - add frsize to fuse_kstatfs
61 * - clean up request size limit checking
62 *
63 * 7.5:
64 * - add flags and max_write to fuse_init_out
65 *
66 * 7.6:
67 * - add max_readahead to fuse_init_in and fuse_init_out
68 *
69 * 7.7:
70 * - add FUSE_INTERRUPT message
71 * - add POSIX file lock support
72 *
73 * 7.8:
74 * - add lock_owner and flags fields to fuse_release_in
75 * - add FUSE_BMAP message
76 * - add FUSE_DESTROY message
77 *
41 * 7.9:78 * 7.9:
42 * - new fuse_getattr_in input argument of GETATTR79 * - new fuse_getattr_in input argument of GETATTR
43 * - add lk_flags in fuse_lk_in80 * - add lk_flags in fuse_lk_in
44 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in81 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
45 * - add blksize field to fuse_attr82 * - add blksize field to fuse_attr
46 * - add file flags field to fuse_read_in and fuse_write_in83 * - add file flags field to fuse_read_in and fuse_write_in
84 * - Add ATIME_NOW and MTIME_NOW flags to fuse_setattr_in
47 *85 *
48 * 7.1086 * 7.10
49 * - add nonseekable open flag87 * - add nonseekable open flag
...@@ -54,7 +92,7 @@...@@ -54,7 +92,7 @@
54 * - add POLL message and NOTIFY_POLL notification92 * - add POLL message and NOTIFY_POLL notification
55 *93 *
56 * 7.1294 * 7.12
57 * - add umask flag to input argument of open, mknod and mkdir95 * - add umask flag to input argument of create, mknod and mkdir
58 * - add notification messages for invalidation of inodes and96 * - add notification messages for invalidation of inodes and
59 * directory entries97 * directory entries
60 *98 *
...@@ -116,6 +154,39 @@...@@ -116,6 +154,39 @@
116 *154 *
117 * 7.27155 * 7.27
118 * - add FUSE_ABORT_ERROR156 * - add FUSE_ABORT_ERROR
157 *
158 * 7.28
159 * - add FUSE_COPY_FILE_RANGE
160 * - add FOPEN_CACHE_DIR
161 * - add FUSE_MAX_PAGES, add max_pages to init_out
162 * - add FUSE_CACHE_SYMLINKS
163 *
164 * 7.29
165 * - add FUSE_NO_OPENDIR_SUPPORT flag
166 *
167 * 7.30
168 * - add FUSE_EXPLICIT_INVAL_DATA
169 * - add FUSE_IOCTL_COMPAT_X32
170 *
171 * 7.31
172 * - add FUSE_WRITE_KILL_PRIV flag
173 * - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
174 * - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
175 *
176 * 7.32
177 * - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS
178 *
179 * 7.33
180 * - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID
181 * - add FUSE_OPEN_KILL_SUIDGID
182 * - extend fuse_setxattr_in, add FUSE_SETXATTR_EXT
183 * - add FUSE_SETXATTR_ACL_KILL_SGID
184 *
185 * 7.34
186 * - add FUSE_SYNCFS
187 *
188 * 7.35
189 * - add FOPEN_NOFLUSH
119 */190 */
120191
121#ifndef _LINUX_FUSE_H192#ifndef _LINUX_FUSE_H
...@@ -147,7 +218,7 @@...@@ -147,7 +218,7 @@
147#define FUSE_KERNEL_VERSION 7218#define FUSE_KERNEL_VERSION 7
148219
149/** Minor version number of this interface */220/** Minor version number of this interface */
150#define FUSE_KERNEL_MINOR_VERSION 27221#define FUSE_KERNEL_MINOR_VERSION 35
151222
152/** The node ID of the root inode */223/** The node ID of the root inode */
153#define FUSE_ROOT_ID 1224#define FUSE_ROOT_ID 1
...@@ -171,7 +242,7 @@ struct fuse_attr {...@@ -171,7 +242,7 @@ struct fuse_attr {
171 uint32_t gid;242 uint32_t gid;
172 uint32_t rdev;243 uint32_t rdev;
173 uint32_t blksize;244 uint32_t blksize;
174 uint32_t padding;245 uint32_t flags;
175};246};
176247
177struct fuse_kstatfs {248struct fuse_kstatfs {
...@@ -208,6 +279,7 @@ struct fuse_file_lock {...@@ -208,6 +279,7 @@ struct fuse_file_lock {
208#define FATTR_MTIME_NOW (1 << 8)279#define FATTR_MTIME_NOW (1 << 8)
209#define FATTR_LOCKOWNER (1 << 9)280#define FATTR_LOCKOWNER (1 << 9)
210#define FATTR_CTIME (1 << 10)281#define FATTR_CTIME (1 << 10)
282#define FATTR_KILL_SUIDGID (1 << 11)
211283
212/**284/**
213 * Flags returned by the OPEN request285 * Flags returned by the OPEN request
...@@ -215,10 +287,16 @@ struct fuse_file_lock {...@@ -215,10 +287,16 @@ struct fuse_file_lock {
215 * FOPEN_DIRECT_IO: bypass page cache for this open file287 * FOPEN_DIRECT_IO: bypass page cache for this open file
216 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open288 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
217 * FOPEN_NONSEEKABLE: the file is not seekable289 * FOPEN_NONSEEKABLE: the file is not seekable
290 * FOPEN_CACHE_DIR: allow caching this directory
291 * FOPEN_STREAM: the file is stream-like (no file position at all)
292 * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE)
218 */293 */
219#define FOPEN_DIRECT_IO (1 << 0)294#define FOPEN_DIRECT_IO (1 << 0)
220#define FOPEN_KEEP_CACHE (1 << 1)295#define FOPEN_KEEP_CACHE (1 << 1)
221#define FOPEN_NONSEEKABLE (1 << 2)296#define FOPEN_NONSEEKABLE (1 << 2)
297#define FOPEN_CACHE_DIR (1 << 3)
298#define FOPEN_STREAM (1 << 4)
299#define FOPEN_NOFLUSH (1 << 5)
222300
223/**301/**
224 * INIT request/reply flags302 * INIT request/reply flags
...@@ -245,6 +323,20 @@ struct fuse_file_lock {...@@ -245,6 +323,20 @@ struct fuse_file_lock {
245 * FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc323 * FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc
246 * FUSE_POSIX_ACL: filesystem supports posix acls324 * FUSE_POSIX_ACL: filesystem supports posix acls
247 * FUSE_ABORT_ERROR: reading the device after abort returns ECONNABORTED325 * FUSE_ABORT_ERROR: reading the device after abort returns ECONNABORTED
326 * FUSE_MAX_PAGES: init_out.max_pages contains the max number of req pages
327 * FUSE_CACHE_SYMLINKS: cache READLINK responses
328 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
329 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
330 * FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for
331 * foffset and moffset fields in struct
332 * fuse_setupmapping_out and fuse_removemapping_one.
333 * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
334 * FUSE_HANDLE_KILLPRIV_V2: fs kills suid/sgid/cap on write/chown/trunc.
335 * Upon write/truncate suid/sgid is only killed if caller
336 * does not have CAP_FSETID. Additionally upon
337 * write/truncate sgid is killed only if file has group
338 * execute permission. (Same as Linux VFS behavior).
339 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in
248 */340 */
249#define FUSE_ASYNC_READ (1 << 0)341#define FUSE_ASYNC_READ (1 << 0)
250#define FUSE_POSIX_LOCKS (1 << 1)342#define FUSE_POSIX_LOCKS (1 << 1)
...@@ -268,6 +360,14 @@ struct fuse_file_lock {...@@ -268,6 +360,14 @@ struct fuse_file_lock {
268#define FUSE_HANDLE_KILLPRIV (1 << 19)360#define FUSE_HANDLE_KILLPRIV (1 << 19)
269#define FUSE_POSIX_ACL (1 << 20)361#define FUSE_POSIX_ACL (1 << 20)
270#define FUSE_ABORT_ERROR (1 << 21)362#define FUSE_ABORT_ERROR (1 << 21)
363#define FUSE_MAX_PAGES (1 << 22)
364#define FUSE_CACHE_SYMLINKS (1 << 23)
365#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
366#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
367#define FUSE_MAP_ALIGNMENT (1 << 26)
368#define FUSE_SUBMOUNTS (1 << 27)
369#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
370#define FUSE_SETXATTR_EXT (1 << 29)
271371
272/**372/**
273 * CUSE INIT request/reply flags373 * CUSE INIT request/reply flags
...@@ -297,9 +397,14 @@ struct fuse_file_lock {...@@ -297,9 +397,14 @@ struct fuse_file_lock {
297 *397 *
298 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed398 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
299 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid399 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
400 * FUSE_WRITE_KILL_SUIDGID: kill suid and sgid bits
300 */401 */
301#define FUSE_WRITE_CACHE (1 << 0)402#define FUSE_WRITE_CACHE (1 << 0)
302#define FUSE_WRITE_LOCKOWNER (1 << 1)403#define FUSE_WRITE_LOCKOWNER (1 << 1)
404#define FUSE_WRITE_KILL_SUIDGID (1 << 2)
405
406/* Obsolete alias; this flag implies killing suid/sgid only. */
407#define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
303408
304/**409/**
305 * Read flags410 * Read flags
...@@ -314,6 +419,7 @@ struct fuse_file_lock {...@@ -314,6 +419,7 @@ struct fuse_file_lock {
314 * FUSE_IOCTL_RETRY: retry with new iovecs419 * FUSE_IOCTL_RETRY: retry with new iovecs
315 * FUSE_IOCTL_32BIT: 32bit ioctl420 * FUSE_IOCTL_32BIT: 32bit ioctl
316 * FUSE_IOCTL_DIR: is a directory421 * FUSE_IOCTL_DIR: is a directory
422 * FUSE_IOCTL_COMPAT_X32: x32 compat ioctl on 64bit machine (64bit time_t)
317 *423 *
318 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs424 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
319 */425 */
...@@ -322,6 +428,7 @@ struct fuse_file_lock {...@@ -322,6 +428,7 @@ struct fuse_file_lock {
322#define FUSE_IOCTL_RETRY (1 << 2)428#define FUSE_IOCTL_RETRY (1 << 2)
323#define FUSE_IOCTL_32BIT (1 << 3)429#define FUSE_IOCTL_32BIT (1 << 3)
324#define FUSE_IOCTL_DIR (1 << 4)430#define FUSE_IOCTL_DIR (1 << 4)
431#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
325432
326#define FUSE_IOCTL_MAX_IOV 256433#define FUSE_IOCTL_MAX_IOV 256
327434
...@@ -332,54 +439,88 @@ struct fuse_file_lock {...@@ -332,54 +439,88 @@ struct fuse_file_lock {
332 */439 */
333#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)440#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
334441
442/**
443 * Fsync flags
444 *
445 * FUSE_FSYNC_FDATASYNC: Sync data only, not metadata
446 */
447#define FUSE_FSYNC_FDATASYNC (1 << 0)
448
449/**
450 * fuse_attr flags
451 *
452 * FUSE_ATTR_SUBMOUNT: Object is a submount root
453 */
454#define FUSE_ATTR_SUBMOUNT (1 << 0)
455
456/**
457 * Open flags
458 * FUSE_OPEN_KILL_SUIDGID: Kill suid and sgid if executable
459 */
460#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
461
462/**
463 * setxattr flags
464 * FUSE_SETXATTR_ACL_KILL_SGID: Clear SGID when system.posix_acl_access is set
465 */
466#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
467
335enum fuse_opcode {468enum fuse_opcode {
336 FUSE_LOOKUP = 1,469 FUSE_LOOKUP = 1,
337 FUSE_FORGET = 2, /* no reply */470 FUSE_FORGET = 2, /* no reply */
338 FUSE_GETATTR = 3,471 FUSE_GETATTR = 3,
339 FUSE_SETATTR = 4,472 FUSE_SETATTR = 4,
340 FUSE_READLINK = 5,473 FUSE_READLINK = 5,
341 FUSE_SYMLINK = 6,474 FUSE_SYMLINK = 6,
342 FUSE_MKNOD = 8,475 FUSE_MKNOD = 8,
343 FUSE_MKDIR = 9,476 FUSE_MKDIR = 9,
344 FUSE_UNLINK = 10,477 FUSE_UNLINK = 10,
345 FUSE_RMDIR = 11,478 FUSE_RMDIR = 11,
346 FUSE_RENAME = 12,479 FUSE_RENAME = 12,
347 FUSE_LINK = 13,480 FUSE_LINK = 13,
348 FUSE_OPEN = 14,481 FUSE_OPEN = 14,
349 FUSE_READ = 15,482 FUSE_READ = 15,
350 FUSE_WRITE = 16,483 FUSE_WRITE = 16,
351 FUSE_STATFS = 17,484 FUSE_STATFS = 17,
352 FUSE_RELEASE = 18,485 FUSE_RELEASE = 18,
353 FUSE_FSYNC = 20,486 FUSE_FSYNC = 20,
354 FUSE_SETXATTR = 21,487 FUSE_SETXATTR = 21,
355 FUSE_GETXATTR = 22,488 FUSE_GETXATTR = 22,
356 FUSE_LISTXATTR = 23,489 FUSE_LISTXATTR = 23,
357 FUSE_REMOVEXATTR = 24,490 FUSE_REMOVEXATTR = 24,
358 FUSE_FLUSH = 25,491 FUSE_FLUSH = 25,
359 FUSE_INIT = 26,492 FUSE_INIT = 26,
360 FUSE_OPENDIR = 27,493 FUSE_OPENDIR = 27,
361 FUSE_READDIR = 28,494 FUSE_READDIR = 28,
362 FUSE_RELEASEDIR = 29,495 FUSE_RELEASEDIR = 29,
363 FUSE_FSYNCDIR = 30,496 FUSE_FSYNCDIR = 30,
364 FUSE_GETLK = 31,497 FUSE_GETLK = 31,
365 FUSE_SETLK = 32,498 FUSE_SETLK = 32,
366 FUSE_SETLKW = 33,499 FUSE_SETLKW = 33,
367 FUSE_ACCESS = 34,500 FUSE_ACCESS = 34,
368 FUSE_CREATE = 35,501 FUSE_CREATE = 35,
369 FUSE_INTERRUPT = 36,502 FUSE_INTERRUPT = 36,
370 FUSE_BMAP = 37,503 FUSE_BMAP = 37,
371 FUSE_DESTROY = 38,504 FUSE_DESTROY = 38,
372 FUSE_IOCTL = 39,505 FUSE_IOCTL = 39,
373 FUSE_POLL = 40,506 FUSE_POLL = 40,
374 FUSE_NOTIFY_REPLY = 41,507 FUSE_NOTIFY_REPLY = 41,
375 FUSE_BATCH_FORGET = 42,508 FUSE_BATCH_FORGET = 42,
376 FUSE_FALLOCATE = 43,509 FUSE_FALLOCATE = 43,
377 FUSE_READDIRPLUS = 44,510 FUSE_READDIRPLUS = 44,
378 FUSE_RENAME2 = 45,511 FUSE_RENAME2 = 45,
379 FUSE_LSEEK = 46,512 FUSE_LSEEK = 46,
513 FUSE_COPY_FILE_RANGE = 47,
514 FUSE_SETUPMAPPING = 48,
515 FUSE_REMOVEMAPPING = 49,
516 FUSE_SYNCFS = 50,
380517
381 /* CUSE specific operations */518 /* CUSE specific operations */
382 CUSE_INIT = 4096,519 CUSE_INIT = 4096,
520
521 /* Reserved opcodes: helpful to detect structure endian-ness */
522 CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */
523 FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */
383};524};
384525
385enum fuse_notify_code {526enum fuse_notify_code {
...@@ -486,14 +627,14 @@ struct fuse_setattr_in {...@@ -486,14 +627,14 @@ struct fuse_setattr_in {
486627
487struct fuse_open_in {628struct fuse_open_in {
488 uint32_t flags;629 uint32_t flags;
489 uint32_t unused;630 uint32_t open_flags; /* FUSE_OPEN_... */
490};631};
491632
492struct fuse_create_in {633struct fuse_create_in {
493 uint32_t flags;634 uint32_t flags;
494 uint32_t mode;635 uint32_t mode;
495 uint32_t umask;636 uint32_t umask;
496 uint32_t padding;637 uint32_t open_flags; /* FUSE_OPEN_... */
497};638};
498639
499struct fuse_open_out {640struct fuse_open_out {
...@@ -555,9 +696,13 @@ struct fuse_fsync_in {...@@ -555,9 +696,13 @@ struct fuse_fsync_in {
555 uint32_t padding;696 uint32_t padding;
556};697};
557698
699#define FUSE_COMPAT_SETXATTR_IN_SIZE 8
700
558struct fuse_setxattr_in {701struct fuse_setxattr_in {
559 uint32_t size;702 uint32_t size;
560 uint32_t flags;703 uint32_t flags;
704 uint32_t setxattr_flags;
705 uint32_t padding;
561};706};
562707
563struct fuse_getxattr_in {708struct fuse_getxattr_in {
...@@ -606,7 +751,9 @@ struct fuse_init_out {...@@ -606,7 +751,9 @@ struct fuse_init_out {
606 uint16_t congestion_threshold;751 uint16_t congestion_threshold;
607 uint32_t max_write;752 uint32_t max_write;
608 uint32_t time_gran;753 uint32_t time_gran;
609 uint32_t unused[9];754 uint16_t max_pages;
755 uint16_t map_alignment;
756 uint32_t unused[8];
610};757};
611758
612#define CUSE_INIT_INFO_MAX 4096759#define CUSE_INIT_INFO_MAX 4096
...@@ -775,7 +922,8 @@ struct fuse_notify_retrieve_in {...@@ -775,7 +922,8 @@ struct fuse_notify_retrieve_in {
775};922};
776923
777/* Device ioctls: */924/* Device ioctls: */
778#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t)925#define FUSE_DEV_IOC_MAGIC 229
926#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
779927
780struct fuse_lseek_in {928struct fuse_lseek_in {
781 uint64_t fh;929 uint64_t fh;
...@@ -788,4 +936,48 @@ struct fuse_lseek_out {...@@ -788,4 +936,48 @@ struct fuse_lseek_out {
788 uint64_t offset;936 uint64_t offset;
789};937};
790938
939struct fuse_copy_file_range_in {
940 uint64_t fh_in;
941 uint64_t off_in;
942 uint64_t nodeid_out;
943 uint64_t fh_out;
944 uint64_t off_out;
945 uint64_t len;
946 uint64_t flags;
947};
948
949#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
950#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
951struct fuse_setupmapping_in {
952 /* An already open handle */
953 uint64_t fh;
954 /* Offset into the file to start the mapping */
955 uint64_t foffset;
956 /* Length of mapping required */
957 uint64_t len;
958 /* Flags, FUSE_SETUPMAPPING_FLAG_* */
959 uint64_t flags;
960 /* Offset in Memory Window */
961 uint64_t moffset;
962};
963
964struct fuse_removemapping_in {
965 /* number of fuse_removemapping_one follows */
966 uint32_t count;
967};
968
969struct fuse_removemapping_one {
970 /* Offset into the dax window start the unmapping */
971 uint64_t moffset;
972 /* Length of mapping required */
973 uint64_t len;
974};
975
976#define FUSE_REMOVEMAPPING_MAX_ENTRY \
977 (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
978
979struct fuse_syncfs_in {
980 uint64_t padding;
981};
982
791#endif /* _LINUX_FUSE_H */983#endif /* _LINUX_FUSE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/futex.h+27
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#define FUTEX_WAKE_BITSET 1021#define FUTEX_WAKE_BITSET 10
22#define FUTEX_WAIT_REQUEUE_PI 1122#define FUTEX_WAIT_REQUEUE_PI 11
23#define FUTEX_CMP_REQUEUE_PI 1223#define FUTEX_CMP_REQUEUE_PI 12
24#define FUTEX_LOCK_PI2 13
2425
25#define FUTEX_PRIVATE_FLAG 12826#define FUTEX_PRIVATE_FLAG 128
26#define FUTEX_CLOCK_REALTIME 25627#define FUTEX_CLOCK_REALTIME 256
...@@ -32,6 +33,7 @@...@@ -32,6 +33,7 @@
32#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)33#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
33#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)34#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
34#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)35#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
36#define FUTEX_LOCK_PI2_PRIVATE (FUTEX_LOCK_PI2 | FUTEX_PRIVATE_FLAG)
35#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)37#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
36#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)38#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
37#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)39#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
...@@ -41,6 +43,31 @@...@@ -41,6 +43,31 @@
41#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \43#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
42 FUTEX_PRIVATE_FLAG)44 FUTEX_PRIVATE_FLAG)
4345
46/*
47 * Flags to specify the bit length of the futex word for futex2 syscalls.
48 * Currently, only 32 is supported.
49 */
50#define FUTEX_32 2
51
52/*
53 * Max numbers of elements in a futex_waitv array
54 */
55#define FUTEX_WAITV_MAX 128
56
57/**
58 * struct futex_waitv - A waiter for vectorized wait
59 * @val: Expected value at uaddr
60 * @uaddr: User address to wait on
61 * @flags: Flags for this waiter
62 * @__reserved: Reserved member to preserve data alignment. Should be 0.
63 */
64struct futex_waitv {
65 __u64 val;
66 __u64 uaddr;
67 __u32 flags;
68 __u32 __reserved;
69};
70
44/*71/*
45 * Support for robust futexes: the kernel cleans up held futexes at72 * Support for robust futexes: the kernel cleans up held futexes at
46 * thread exit time.73 * thread exit time.
lib/libc/include/any-linux-any/linux/gen_stats.h+2-4
...@@ -12,6 +12,8 @@ enum {...@@ -12,6 +12,8 @@ enum {
12 TCA_STATS_APP,12 TCA_STATS_APP,
13 TCA_STATS_RATE_EST64,13 TCA_STATS_RATE_EST64,
14 TCA_STATS_PAD,14 TCA_STATS_PAD,
15 TCA_STATS_BASIC_HW,
16 TCA_STATS_PKT64,
15 __TCA_STATS_MAX,17 __TCA_STATS_MAX,
16};18};
17#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)19#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
...@@ -25,10 +27,6 @@ struct gnet_stats_basic {...@@ -25,10 +27,6 @@ struct gnet_stats_basic {
25 __u64 bytes;27 __u64 bytes;
26 __u32 packets;28 __u32 packets;
27};29};
28struct gnet_stats_basic_packed {
29 __u64 bytes;
30 __u32 packets;
31} __attribute__ ((packed));
3230
33/**31/**
34 * struct gnet_stats_rate_est - rate estimator32 * struct gnet_stats_rate_est - rate estimator
lib/libc/include/any-linux-any/linux/genetlink.h+13
...@@ -48,6 +48,7 @@ enum {...@@ -48,6 +48,7 @@ enum {
48 CTRL_CMD_NEWMCAST_GRP,48 CTRL_CMD_NEWMCAST_GRP,
49 CTRL_CMD_DELMCAST_GRP,49 CTRL_CMD_DELMCAST_GRP,
50 CTRL_CMD_GETMCAST_GRP, /* unused */50 CTRL_CMD_GETMCAST_GRP, /* unused */
51 CTRL_CMD_GETPOLICY,
51 __CTRL_CMD_MAX,52 __CTRL_CMD_MAX,
52};53};
5354
...@@ -62,6 +63,9 @@ enum {...@@ -62,6 +63,9 @@ enum {
62 CTRL_ATTR_MAXATTR,63 CTRL_ATTR_MAXATTR,
63 CTRL_ATTR_OPS,64 CTRL_ATTR_OPS,
64 CTRL_ATTR_MCAST_GROUPS,65 CTRL_ATTR_MCAST_GROUPS,
66 CTRL_ATTR_POLICY,
67 CTRL_ATTR_OP_POLICY,
68 CTRL_ATTR_OP,
65 __CTRL_ATTR_MAX,69 __CTRL_ATTR_MAX,
66};70};
6771
...@@ -83,6 +87,15 @@ enum {...@@ -83,6 +87,15 @@ enum {
83 __CTRL_ATTR_MCAST_GRP_MAX,87 __CTRL_ATTR_MCAST_GRP_MAX,
84};88};
8589
90enum {
91 CTRL_ATTR_POLICY_UNSPEC,
92 CTRL_ATTR_POLICY_DO,
93 CTRL_ATTR_POLICY_DUMP,
94
95 __CTRL_ATTR_POLICY_DUMP_MAX,
96 CTRL_ATTR_POLICY_DUMP_MAX = __CTRL_ATTR_POLICY_DUMP_MAX - 1
97};
98
86#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)99#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
87100
88101
lib/libc/include/any-linux-any/linux/gfs2_ondisk.h+9-2
...@@ -47,7 +47,7 @@...@@ -47,7 +47,7 @@
47#define GFS2_FORMAT_DE 120047#define GFS2_FORMAT_DE 1200
48#define GFS2_FORMAT_QU 150048#define GFS2_FORMAT_QU 1500
49/* These are part of the superblock */49/* These are part of the superblock */
50#define GFS2_FORMAT_FS 180150#define GFS2_FORMAT_FS 1802
51#define GFS2_FORMAT_MULTI 190051#define GFS2_FORMAT_MULTI 1900
5252
53/*53/*
...@@ -171,6 +171,12 @@ struct gfs2_rindex {...@@ -171,6 +171,12 @@ struct gfs2_rindex {
171#define GFS2_RGF_NOALLOC 0x00000008171#define GFS2_RGF_NOALLOC 0x00000008
172#define GFS2_RGF_TRIMMED 0x00000010172#define GFS2_RGF_TRIMMED 0x00000010
173173
174struct gfs2_inode_lvb {
175 __be32 ri_magic;
176 __be32 __pad;
177 __be64 ri_generation_deleted;
178};
179
174struct gfs2_rgrp_lvb {180struct gfs2_rgrp_lvb {
175 __be32 rl_magic;181 __be32 rl_magic;
176 __be32 rl_flags;182 __be32 rl_flags;
...@@ -383,8 +389,9 @@ struct gfs2_leaf {...@@ -383,8 +389,9 @@ struct gfs2_leaf {
383#define GFS2_EATYPE_USR 1389#define GFS2_EATYPE_USR 1
384#define GFS2_EATYPE_SYS 2390#define GFS2_EATYPE_SYS 2
385#define GFS2_EATYPE_SECURITY 3391#define GFS2_EATYPE_SECURITY 3
392#define GFS2_EATYPE_TRUSTED 4
386393
387#define GFS2_EATYPE_LAST 3394#define GFS2_EATYPE_LAST 4
388#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)395#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
389396
390#define GFS2_EAFLAG_LAST 0x01 /* last ea in block */397#define GFS2_EAFLAG_LAST 0x01 /* last ea in block */
lib/libc/include/any-linux-any/linux/gigaset_dev.h deleted-39
...@@ -1,39 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * interface to user space for the gigaset driver
4 *
5 * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de>
6 *
7 * =====================================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 * =====================================================================
13 */
14
15#ifndef GIGASET_INTERFACE_H
16#define GIGASET_INTERFACE_H
17
18#include <linux/ioctl.h>
19
20/* The magic IOCTL value for this interface. */
21#define GIGASET_IOCTL 0x47
22
23/* enable/disable device control via character device (lock out ISDN subsys) */
24#define GIGASET_REDIR _IOWR(GIGASET_IOCTL, 0, int)
25
26/* enable adapter configuration mode (M10x only) */
27#define GIGASET_CONFIG _IOWR(GIGASET_IOCTL, 1, int)
28
29/* set break characters (M105 only) */
30#define GIGASET_BRKCHARS _IOW(GIGASET_IOCTL, 2, unsigned char[6])
31
32/* get version information selected by arg[0] */
33#define GIGASET_VERSION _IOWR(GIGASET_IOCTL, 3, unsigned[4])
34/* values for GIGASET_VERSION arg[0] */
35#define GIGVER_DRIVER 0 /* get driver version */
36#define GIGVER_COMPAT 1 /* get interface compatibility version */
37#define GIGVER_FWBASE 2 /* get base station firmware version */
38
39#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gpio.h+392-22
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*2/*
3 * <linux/gpio.h> - userspace ABI for the GPIO character devices3 * <linux/gpio.h> - userspace ABI for the GPIO character devices
4 *4 *
...@@ -11,28 +11,308 @@...@@ -11,28 +11,308 @@
11#ifndef _GPIO_H_11#ifndef _GPIO_H_
12#define _GPIO_H_12#define _GPIO_H_
1313
14#include <linux/const.h>
14#include <linux/ioctl.h>15#include <linux/ioctl.h>
15#include <linux/types.h>16#include <linux/types.h>
1617
18/*
19 * The maximum size of name and label arrays.
20 *
21 * Must be a multiple of 8 to ensure 32/64-bit alignment of structs.
22 */
23#define GPIO_MAX_NAME_SIZE 32
24
17/**25/**
18 * struct gpiochip_info - Information about a certain GPIO chip26 * struct gpiochip_info - Information about a certain GPIO chip
19 * @name: the Linux kernel name of this GPIO chip27 * @name: the Linux kernel name of this GPIO chip
20 * @label: a functional name for this GPIO chip, such as a product28 * @label: a functional name for this GPIO chip, such as a product
21 * number, may be NULL29 * number, may be empty (i.e. label[0] == '\0')
22 * @lines: number of GPIO lines on this chip30 * @lines: number of GPIO lines on this chip
23 */31 */
24struct gpiochip_info {32struct gpiochip_info {
25 char name[32];33 char name[GPIO_MAX_NAME_SIZE];
26 char label[32];34 char label[GPIO_MAX_NAME_SIZE];
27 __u32 lines;35 __u32 lines;
28};36};
2937
38/*
39 * Maximum number of requested lines.
40 *
41 * Must be no greater than 64, as bitmaps are restricted here to 64-bits
42 * for simplicity, and a multiple of 2 to ensure 32/64-bit alignment of
43 * structs.
44 */
45#define GPIO_V2_LINES_MAX 64
46
47/*
48 * The maximum number of configuration attributes associated with a line
49 * request.
50 */
51#define GPIO_V2_LINE_NUM_ATTRS_MAX 10
52
53/**
54 * enum gpio_v2_line_flag - &struct gpio_v2_line_attribute.flags values
55 * @GPIO_V2_LINE_FLAG_USED: line is not available for request
56 * @GPIO_V2_LINE_FLAG_ACTIVE_LOW: line active state is physical low
57 * @GPIO_V2_LINE_FLAG_INPUT: line is an input
58 * @GPIO_V2_LINE_FLAG_OUTPUT: line is an output
59 * @GPIO_V2_LINE_FLAG_EDGE_RISING: line detects rising (inactive to active)
60 * edges
61 * @GPIO_V2_LINE_FLAG_EDGE_FALLING: line detects falling (active to
62 * inactive) edges
63 * @GPIO_V2_LINE_FLAG_OPEN_DRAIN: line is an open drain output
64 * @GPIO_V2_LINE_FLAG_OPEN_SOURCE: line is an open source output
65 * @GPIO_V2_LINE_FLAG_BIAS_PULL_UP: line has pull-up bias enabled
66 * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled
67 * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
68 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps
69 */
70enum gpio_v2_line_flag {
71 GPIO_V2_LINE_FLAG_USED = _BITULL(0),
72 GPIO_V2_LINE_FLAG_ACTIVE_LOW = _BITULL(1),
73 GPIO_V2_LINE_FLAG_INPUT = _BITULL(2),
74 GPIO_V2_LINE_FLAG_OUTPUT = _BITULL(3),
75 GPIO_V2_LINE_FLAG_EDGE_RISING = _BITULL(4),
76 GPIO_V2_LINE_FLAG_EDGE_FALLING = _BITULL(5),
77 GPIO_V2_LINE_FLAG_OPEN_DRAIN = _BITULL(6),
78 GPIO_V2_LINE_FLAG_OPEN_SOURCE = _BITULL(7),
79 GPIO_V2_LINE_FLAG_BIAS_PULL_UP = _BITULL(8),
80 GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN = _BITULL(9),
81 GPIO_V2_LINE_FLAG_BIAS_DISABLED = _BITULL(10),
82 GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME = _BITULL(11),
83};
84
85/**
86 * struct gpio_v2_line_values - Values of GPIO lines
87 * @bits: a bitmap containing the value of the lines, set to 1 for active
88 * and 0 for inactive.
89 * @mask: a bitmap identifying the lines to get or set, with each bit
90 * number corresponding to the index into &struct
91 * gpio_v2_line_request.offsets.
92 */
93struct gpio_v2_line_values {
94 __aligned_u64 bits;
95 __aligned_u64 mask;
96};
97
98/**
99 * enum gpio_v2_line_attr_id - &struct gpio_v2_line_attribute.id values
100 * identifying which field of the attribute union is in use.
101 * @GPIO_V2_LINE_ATTR_ID_FLAGS: flags field is in use
102 * @GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES: values field is in use
103 * @GPIO_V2_LINE_ATTR_ID_DEBOUNCE: debounce_period_us field is in use
104 */
105enum gpio_v2_line_attr_id {
106 GPIO_V2_LINE_ATTR_ID_FLAGS = 1,
107 GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES = 2,
108 GPIO_V2_LINE_ATTR_ID_DEBOUNCE = 3,
109};
110
111/**
112 * struct gpio_v2_line_attribute - a configurable attribute of a line
113 * @id: attribute identifier with value from &enum gpio_v2_line_attr_id
114 * @padding: reserved for future use and must be zero filled
115 * @flags: if id is %GPIO_V2_LINE_ATTR_ID_FLAGS, the flags for the GPIO
116 * line, with values from &enum gpio_v2_line_flag, such as
117 * %GPIO_V2_LINE_FLAG_ACTIVE_LOW, %GPIO_V2_LINE_FLAG_OUTPUT etc, added
118 * together. This overrides the default flags contained in the &struct
119 * gpio_v2_line_config for the associated line.
120 * @values: if id is %GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, a bitmap
121 * containing the values to which the lines will be set, with each bit
122 * number corresponding to the index into &struct
123 * gpio_v2_line_request.offsets.
124 * @debounce_period_us: if id is %GPIO_V2_LINE_ATTR_ID_DEBOUNCE, the
125 * desired debounce period, in microseconds
126 */
127struct gpio_v2_line_attribute {
128 __u32 id;
129 __u32 padding;
130 union {
131 __aligned_u64 flags;
132 __aligned_u64 values;
133 __u32 debounce_period_us;
134 };
135};
136
137/**
138 * struct gpio_v2_line_config_attribute - a configuration attribute
139 * associated with one or more of the requested lines.
140 * @attr: the configurable attribute
141 * @mask: a bitmap identifying the lines to which the attribute applies,
142 * with each bit number corresponding to the index into &struct
143 * gpio_v2_line_request.offsets.
144 */
145struct gpio_v2_line_config_attribute {
146 struct gpio_v2_line_attribute attr;
147 __aligned_u64 mask;
148};
149
150/**
151 * struct gpio_v2_line_config - Configuration for GPIO lines
152 * @flags: flags for the GPIO lines, with values from &enum
153 * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,
154 * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together. This is the default for
155 * all requested lines but may be overridden for particular lines using
156 * @attrs.
157 * @num_attrs: the number of attributes in @attrs
158 * @padding: reserved for future use and must be zero filled
159 * @attrs: the configuration attributes associated with the requested
160 * lines. Any attribute should only be associated with a particular line
161 * once. If an attribute is associated with a line multiple times then the
162 * first occurrence (i.e. lowest index) has precedence.
163 */
164struct gpio_v2_line_config {
165 __aligned_u64 flags;
166 __u32 num_attrs;
167 /* Pad to fill implicit padding and reserve space for future use. */
168 __u32 padding[5];
169 struct gpio_v2_line_config_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
170};
171
172/**
173 * struct gpio_v2_line_request - Information about a request for GPIO lines
174 * @offsets: an array of desired lines, specified by offset index for the
175 * associated GPIO chip
176 * @consumer: a desired consumer label for the selected GPIO lines such as
177 * "my-bitbanged-relay"
178 * @config: requested configuration for the lines.
179 * @num_lines: number of lines requested in this request, i.e. the number
180 * of valid fields in the %GPIO_V2_LINES_MAX sized arrays, set to 1 to
181 * request a single line
182 * @event_buffer_size: a suggested minimum number of line events that the
183 * kernel should buffer. This is only relevant if edge detection is
184 * enabled in the configuration. Note that this is only a suggested value
185 * and the kernel may allocate a larger buffer or cap the size of the
186 * buffer. If this field is zero then the buffer size defaults to a minimum
187 * of @num_lines * 16.
188 * @padding: reserved for future use and must be zero filled
189 * @fd: if successful this field will contain a valid anonymous file handle
190 * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means
191 * error
192 */
193struct gpio_v2_line_request {
194 __u32 offsets[GPIO_V2_LINES_MAX];
195 char consumer[GPIO_MAX_NAME_SIZE];
196 struct gpio_v2_line_config config;
197 __u32 num_lines;
198 __u32 event_buffer_size;
199 /* Pad to fill implicit padding and reserve space for future use. */
200 __u32 padding[5];
201 __s32 fd;
202};
203
204/**
205 * struct gpio_v2_line_info - Information about a certain GPIO line
206 * @name: the name of this GPIO line, such as the output pin of the line on
207 * the chip, a rail or a pin header name on a board, as specified by the
208 * GPIO chip, may be empty (i.e. name[0] == '\0')
209 * @consumer: a functional name for the consumer of this GPIO line as set
210 * by whatever is using it, will be empty if there is no current user but
211 * may also be empty if the consumer doesn't set this up
212 * @offset: the local offset on this GPIO chip, fill this in when
213 * requesting the line information from the kernel
214 * @num_attrs: the number of attributes in @attrs
215 * @flags: flags for this GPIO line, with values from &enum
216 * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,
217 * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together.
218 * @attrs: the configuration attributes associated with the line
219 * @padding: reserved for future use
220 */
221struct gpio_v2_line_info {
222 char name[GPIO_MAX_NAME_SIZE];
223 char consumer[GPIO_MAX_NAME_SIZE];
224 __u32 offset;
225 __u32 num_attrs;
226 __aligned_u64 flags;
227 struct gpio_v2_line_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
228 /* Space reserved for future use. */
229 __u32 padding[4];
230};
231
232/**
233 * enum gpio_v2_line_changed_type - &struct gpio_v2_line_changed.event_type
234 * values
235 * @GPIO_V2_LINE_CHANGED_REQUESTED: line has been requested
236 * @GPIO_V2_LINE_CHANGED_RELEASED: line has been released
237 * @GPIO_V2_LINE_CHANGED_CONFIG: line has been reconfigured
238 */
239enum gpio_v2_line_changed_type {
240 GPIO_V2_LINE_CHANGED_REQUESTED = 1,
241 GPIO_V2_LINE_CHANGED_RELEASED = 2,
242 GPIO_V2_LINE_CHANGED_CONFIG = 3,
243};
244
245/**
246 * struct gpio_v2_line_info_changed - Information about a change in status
247 * of a GPIO line
248 * @info: updated line information
249 * @timestamp_ns: estimate of time of status change occurrence, in nanoseconds
250 * @event_type: the type of change with a value from &enum
251 * gpio_v2_line_changed_type
252 * @padding: reserved for future use
253 */
254struct gpio_v2_line_info_changed {
255 struct gpio_v2_line_info info;
256 __aligned_u64 timestamp_ns;
257 __u32 event_type;
258 /* Pad struct to 64-bit boundary and reserve space for future use. */
259 __u32 padding[5];
260};
261
262/**
263 * enum gpio_v2_line_event_id - &struct gpio_v2_line_event.id values
264 * @GPIO_V2_LINE_EVENT_RISING_EDGE: event triggered by a rising edge
265 * @GPIO_V2_LINE_EVENT_FALLING_EDGE: event triggered by a falling edge
266 */
267enum gpio_v2_line_event_id {
268 GPIO_V2_LINE_EVENT_RISING_EDGE = 1,
269 GPIO_V2_LINE_EVENT_FALLING_EDGE = 2,
270};
271
272/**
273 * struct gpio_v2_line_event - The actual event being pushed to userspace
274 * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds.
275 * @id: event identifier with value from &enum gpio_v2_line_event_id
276 * @offset: the offset of the line that triggered the event
277 * @seqno: the sequence number for this event in the sequence of events for
278 * all the lines in this line request
279 * @line_seqno: the sequence number for this event in the sequence of
280 * events on this particular line
281 * @padding: reserved for future use
282 *
283 * By default the @timestamp_ns is read from %CLOCK_MONOTONIC and is
284 * intended to allow the accurate measurement of the time between events.
285 * It does not provide the wall-clock time.
286 *
287 * If the %GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag is set then the
288 * @timestamp_ns is read from %CLOCK_REALTIME.
289 */
290struct gpio_v2_line_event {
291 __aligned_u64 timestamp_ns;
292 __u32 id;
293 __u32 offset;
294 __u32 seqno;
295 __u32 line_seqno;
296 /* Space reserved for future use. */
297 __u32 padding[6];
298};
299
300/*
301 * ABI v1
302 *
303 * This version of the ABI is deprecated.
304 * Use the latest version of the ABI, defined above, instead.
305 */
306
30/* Informational flags */307/* Informational flags */
31#define GPIOLINE_FLAG_KERNEL (1UL << 0) /* Line used by the kernel */308#define GPIOLINE_FLAG_KERNEL (1UL << 0) /* Line used by the kernel */
32#define GPIOLINE_FLAG_IS_OUT (1UL << 1)309#define GPIOLINE_FLAG_IS_OUT (1UL << 1)
33#define GPIOLINE_FLAG_ACTIVE_LOW (1UL << 2)310#define GPIOLINE_FLAG_ACTIVE_LOW (1UL << 2)
34#define GPIOLINE_FLAG_OPEN_DRAIN (1UL << 3)311#define GPIOLINE_FLAG_OPEN_DRAIN (1UL << 3)
35#define GPIOLINE_FLAG_OPEN_SOURCE (1UL << 4)312#define GPIOLINE_FLAG_OPEN_SOURCE (1UL << 4)
313#define GPIOLINE_FLAG_BIAS_PULL_UP (1UL << 5)
314#define GPIOLINE_FLAG_BIAS_PULL_DOWN (1UL << 6)
315#define GPIOLINE_FLAG_BIAS_DISABLE (1UL << 7)
36316
37/**317/**
38 * struct gpioline_info - Information about a certain GPIO line318 * struct gpioline_info - Information about a certain GPIO line
...@@ -41,40 +321,78 @@ struct gpiochip_info {...@@ -41,40 +321,78 @@ struct gpiochip_info {
41 * @flags: various flags for this line321 * @flags: various flags for this line
42 * @name: the name of this GPIO line, such as the output pin of the line on the322 * @name: the name of this GPIO line, such as the output pin of the line on the
43 * chip, a rail or a pin header name on a board, as specified by the gpio323 * chip, a rail or a pin header name on a board, as specified by the gpio
44 * chip, may be NULL324 * chip, may be empty (i.e. name[0] == '\0')
45 * @consumer: a functional name for the consumer of this GPIO line as set by325 * @consumer: a functional name for the consumer of this GPIO line as set by
46 * whatever is using it, will be NULL if there is no current user but may326 * whatever is using it, will be empty if there is no current user but may
47 * also be NULL if the consumer doesn't set this up327 * also be empty if the consumer doesn't set this up
328 *
329 * Note: This struct is part of ABI v1 and is deprecated.
330 * Use &struct gpio_v2_line_info instead.
48 */331 */
49struct gpioline_info {332struct gpioline_info {
50 __u32 line_offset;333 __u32 line_offset;
51 __u32 flags;334 __u32 flags;
52 char name[32];335 char name[GPIO_MAX_NAME_SIZE];
53 char consumer[32];336 char consumer[GPIO_MAX_NAME_SIZE];
54};337};
55338
56/* Maximum number of requested handles */339/* Maximum number of requested handles */
57#define GPIOHANDLES_MAX 64340#define GPIOHANDLES_MAX 64
58341
342/* Possible line status change events */
343enum {
344 GPIOLINE_CHANGED_REQUESTED = 1,
345 GPIOLINE_CHANGED_RELEASED,
346 GPIOLINE_CHANGED_CONFIG,
347};
348
349/**
350 * struct gpioline_info_changed - Information about a change in status
351 * of a GPIO line
352 * @info: updated line information
353 * @timestamp: estimate of time of status change occurrence, in nanoseconds
354 * @event_type: one of %GPIOLINE_CHANGED_REQUESTED,
355 * %GPIOLINE_CHANGED_RELEASED and %GPIOLINE_CHANGED_CONFIG
356 * @padding: reserved for future use
357 *
358 * The &struct gpioline_info embedded here has 32-bit alignment on its own,
359 * but it works fine with 64-bit alignment too. With its 72 byte size, we can
360 * guarantee there are no implicit holes between it and subsequent members.
361 * The 20-byte padding at the end makes sure we don't add any implicit padding
362 * at the end of the structure on 64-bit architectures.
363 *
364 * Note: This struct is part of ABI v1 and is deprecated.
365 * Use &struct gpio_v2_line_info_changed instead.
366 */
367struct gpioline_info_changed {
368 struct gpioline_info info;
369 __u64 timestamp;
370 __u32 event_type;
371 __u32 padding[5]; /* for future use */
372};
373
59/* Linerequest flags */374/* Linerequest flags */
60#define GPIOHANDLE_REQUEST_INPUT (1UL << 0)375#define GPIOHANDLE_REQUEST_INPUT (1UL << 0)
61#define GPIOHANDLE_REQUEST_OUTPUT (1UL << 1)376#define GPIOHANDLE_REQUEST_OUTPUT (1UL << 1)
62#define GPIOHANDLE_REQUEST_ACTIVE_LOW (1UL << 2)377#define GPIOHANDLE_REQUEST_ACTIVE_LOW (1UL << 2)
63#define GPIOHANDLE_REQUEST_OPEN_DRAIN (1UL << 3)378#define GPIOHANDLE_REQUEST_OPEN_DRAIN (1UL << 3)
64#define GPIOHANDLE_REQUEST_OPEN_SOURCE (1UL << 4)379#define GPIOHANDLE_REQUEST_OPEN_SOURCE (1UL << 4)
380#define GPIOHANDLE_REQUEST_BIAS_PULL_UP (1UL << 5)
381#define GPIOHANDLE_REQUEST_BIAS_PULL_DOWN (1UL << 6)
382#define GPIOHANDLE_REQUEST_BIAS_DISABLE (1UL << 7)
65383
66/**384/**
67 * struct gpiohandle_request - Information about a GPIO handle request385 * struct gpiohandle_request - Information about a GPIO handle request
68 * @lineoffsets: an array desired lines, specified by offset index for the386 * @lineoffsets: an array of desired lines, specified by offset index for the
69 * associated GPIO device387 * associated GPIO device
70 * @flags: desired flags for the desired GPIO lines, such as388 * @flags: desired flags for the desired GPIO lines, such as
71 * GPIOHANDLE_REQUEST_OUTPUT, GPIOHANDLE_REQUEST_ACTIVE_LOW etc, OR:ed389 * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
72 * together. Note that even if multiple lines are requested, the same flags390 * together. Note that even if multiple lines are requested, the same flags
73 * must be applicable to all of them, if you want lines with individual391 * must be applicable to all of them, if you want lines with individual
74 * flags set, request them one by one. It is possible to select392 * flags set, request them one by one. It is possible to select
75 * a batch of input or output lines, but they must all have the same393 * a batch of input or output lines, but they must all have the same
76 * characteristics, i.e. all inputs or all outputs, all active low etc394 * characteristics, i.e. all inputs or all outputs, all active low etc
77 * @default_values: if the GPIOHANDLE_REQUEST_OUTPUT is set for a requested395 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested
78 * line, this specifies the default output value, should be 0 (low) or396 * line, this specifies the default output value, should be 0 (low) or
79 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)397 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
80 * @consumer_label: a desired consumer label for the selected GPIO line(s)398 * @consumer_label: a desired consumer label for the selected GPIO line(s)
...@@ -82,31 +400,53 @@ struct gpioline_info {...@@ -82,31 +400,53 @@ struct gpioline_info {
82 * @lines: number of lines requested in this request, i.e. the number of400 * @lines: number of lines requested in this request, i.e. the number of
83 * valid fields in the above arrays, set to 1 to request a single line401 * valid fields in the above arrays, set to 1 to request a single line
84 * @fd: if successful this field will contain a valid anonymous file handle402 * @fd: if successful this field will contain a valid anonymous file handle
85 * after a GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value403 * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value
86 * means error404 * means error
405 *
406 * Note: This struct is part of ABI v1 and is deprecated.
407 * Use &struct gpio_v2_line_request instead.
87 */408 */
88struct gpiohandle_request {409struct gpiohandle_request {
89 __u32 lineoffsets[GPIOHANDLES_MAX];410 __u32 lineoffsets[GPIOHANDLES_MAX];
90 __u32 flags;411 __u32 flags;
91 __u8 default_values[GPIOHANDLES_MAX];412 __u8 default_values[GPIOHANDLES_MAX];
92 char consumer_label[32];413 char consumer_label[GPIO_MAX_NAME_SIZE];
93 __u32 lines;414 __u32 lines;
94 int fd;415 int fd;
95};416};
96417
418/**
419 * struct gpiohandle_config - Configuration for a GPIO handle request
420 * @flags: updated flags for the requested GPIO lines, such as
421 * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
422 * together
423 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,
424 * this specifies the default output value, should be 0 (low) or
425 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
426 * @padding: reserved for future use and should be zero filled
427 *
428 * Note: This struct is part of ABI v1 and is deprecated.
429 * Use &struct gpio_v2_line_config instead.
430 */
431struct gpiohandle_config {
432 __u32 flags;
433 __u8 default_values[GPIOHANDLES_MAX];
434 __u32 padding[4]; /* padding for future use */
435};
436
97/**437/**
98 * struct gpiohandle_data - Information of values on a GPIO handle438 * struct gpiohandle_data - Information of values on a GPIO handle
99 * @values: when getting the state of lines this contains the current439 * @values: when getting the state of lines this contains the current
100 * state of a line, when setting the state of lines these should contain440 * state of a line, when setting the state of lines these should contain
101 * the desired target state441 * the desired target state
442 *
443 * Note: This struct is part of ABI v1 and is deprecated.
444 * Use &struct gpio_v2_line_values instead.
102 */445 */
103struct gpiohandle_data {446struct gpiohandle_data {
104 __u8 values[GPIOHANDLES_MAX];447 __u8 values[GPIOHANDLES_MAX];
105};448};
106449
107#define GPIOHANDLE_GET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x08, struct gpiohandle_data)
108#define GPIOHANDLE_SET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x09, struct gpiohandle_data)
109
110/* Eventrequest flags */450/* Eventrequest flags */
111#define GPIOEVENT_REQUEST_RISING_EDGE (1UL << 0)451#define GPIOEVENT_REQUEST_RISING_EDGE (1UL << 0)
112#define GPIOEVENT_REQUEST_FALLING_EDGE (1UL << 1)452#define GPIOEVENT_REQUEST_FALLING_EDGE (1UL << 1)
...@@ -117,24 +457,27 @@ struct gpiohandle_data {...@@ -117,24 +457,27 @@ struct gpiohandle_data {
117 * @lineoffset: the desired line to subscribe to events from, specified by457 * @lineoffset: the desired line to subscribe to events from, specified by
118 * offset index for the associated GPIO device458 * offset index for the associated GPIO device
119 * @handleflags: desired handle flags for the desired GPIO line, such as459 * @handleflags: desired handle flags for the desired GPIO line, such as
120 * GPIOHANDLE_REQUEST_ACTIVE_LOW or GPIOHANDLE_REQUEST_OPEN_DRAIN460 * %GPIOHANDLE_REQUEST_ACTIVE_LOW or %GPIOHANDLE_REQUEST_OPEN_DRAIN
121 * @eventflags: desired flags for the desired GPIO event line, such as461 * @eventflags: desired flags for the desired GPIO event line, such as
122 * GPIOEVENT_REQUEST_RISING_EDGE or GPIOEVENT_REQUEST_FALLING_EDGE462 * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE
123 * @consumer_label: a desired consumer label for the selected GPIO line(s)463 * @consumer_label: a desired consumer label for the selected GPIO line(s)
124 * such as "my-listener"464 * such as "my-listener"
125 * @fd: if successful this field will contain a valid anonymous file handle465 * @fd: if successful this field will contain a valid anonymous file handle
126 * after a GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value466 * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value
127 * means error467 * means error
468 *
469 * Note: This struct is part of ABI v1 and is deprecated.
470 * Use &struct gpio_v2_line_request instead.
128 */471 */
129struct gpioevent_request {472struct gpioevent_request {
130 __u32 lineoffset;473 __u32 lineoffset;
131 __u32 handleflags;474 __u32 handleflags;
132 __u32 eventflags;475 __u32 eventflags;
133 char consumer_label[32];476 char consumer_label[GPIO_MAX_NAME_SIZE];
134 int fd;477 int fd;
135};478};
136479
137/**480/*
138 * GPIO event types481 * GPIO event types
139 */482 */
140#define GPIOEVENT_EVENT_RISING_EDGE 0x01483#define GPIOEVENT_EVENT_RISING_EDGE 0x01
...@@ -144,15 +487,42 @@ struct gpioevent_request {...@@ -144,15 +487,42 @@ struct gpioevent_request {
144 * struct gpioevent_data - The actual event being pushed to userspace487 * struct gpioevent_data - The actual event being pushed to userspace
145 * @timestamp: best estimate of time of event occurrence, in nanoseconds488 * @timestamp: best estimate of time of event occurrence, in nanoseconds
146 * @id: event identifier489 * @id: event identifier
490 *
491 * Note: This struct is part of ABI v1 and is deprecated.
492 * Use &struct gpio_v2_line_event instead.
147 */493 */
148struct gpioevent_data {494struct gpioevent_data {
149 __u64 timestamp;495 __u64 timestamp;
150 __u32 id;496 __u32 id;
151};497};
152498
499/*
500 * v1 and v2 ioctl()s
501 */
153#define GPIO_GET_CHIPINFO_IOCTL _IOR(0xB4, 0x01, struct gpiochip_info)502#define GPIO_GET_CHIPINFO_IOCTL _IOR(0xB4, 0x01, struct gpiochip_info)
503#define GPIO_GET_LINEINFO_UNWATCH_IOCTL _IOWR(0xB4, 0x0C, __u32)
504
505/*
506 * v2 ioctl()s
507 */
508#define GPIO_V2_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x05, struct gpio_v2_line_info)
509#define GPIO_V2_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x06, struct gpio_v2_line_info)
510#define GPIO_V2_GET_LINE_IOCTL _IOWR(0xB4, 0x07, struct gpio_v2_line_request)
511#define GPIO_V2_LINE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0D, struct gpio_v2_line_config)
512#define GPIO_V2_LINE_GET_VALUES_IOCTL _IOWR(0xB4, 0x0E, struct gpio_v2_line_values)
513#define GPIO_V2_LINE_SET_VALUES_IOCTL _IOWR(0xB4, 0x0F, struct gpio_v2_line_values)
514
515/*
516 * v1 ioctl()s
517 *
518 * These ioctl()s are deprecated. Use the v2 equivalent instead.
519 */
154#define GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct gpioline_info)520#define GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct gpioline_info)
155#define GPIO_GET_LINEHANDLE_IOCTL _IOWR(0xB4, 0x03, struct gpiohandle_request)521#define GPIO_GET_LINEHANDLE_IOCTL _IOWR(0xB4, 0x03, struct gpiohandle_request)
156#define GPIO_GET_LINEEVENT_IOCTL _IOWR(0xB4, 0x04, struct gpioevent_request)522#define GPIO_GET_LINEEVENT_IOCTL _IOWR(0xB4, 0x04, struct gpioevent_request)
523#define GPIOHANDLE_GET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x08, struct gpiohandle_data)
524#define GPIOHANDLE_SET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x09, struct gpiohandle_data)
525#define GPIOHANDLE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0A, struct gpiohandle_config)
526#define GPIO_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x0B, struct gpioline_info)
157527
158#endif /* _GPIO_H_ */528#endif /* _GPIO_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gsmmux.h+2
...@@ -37,5 +37,7 @@ struct gsm_netconfig {...@@ -37,5 +37,7 @@ struct gsm_netconfig {
37#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)37#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
38#define GSMIOC_DISABLE_NET _IO('G', 3)38#define GSMIOC_DISABLE_NET _IO('G', 3)
3939
40/* get the base tty number for a configured gsmmux tty */
41#define GSMIOC_GETFIRST _IOR('G', 4, __u32)
4042
41#endif43#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gtp.h+2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef _LINUX_GTP_H_2#ifndef _LINUX_GTP_H_
3#define _LINUX_GTP_H_3#define _LINUX_GTP_H_
44
5#define GTP_GENL_MCGRP_NAME "gtp"
6
5enum gtp_genl_cmds {7enum gtp_genl_cmds {
6 GTP_CMD_NEWPDP,8 GTP_CMD_NEWPDP,
7 GTP_CMD_DELPDP,9 GTP_CMD_DELPDP,
lib/libc/include/any-linux-any/linux/hash_info.h+2
...@@ -33,6 +33,8 @@ enum hash_algo {...@@ -33,6 +33,8 @@ enum hash_algo {
33 HASH_ALGO_TGR_160,33 HASH_ALGO_TGR_160,
34 HASH_ALGO_TGR_192,34 HASH_ALGO_TGR_192,
35 HASH_ALGO_SM3_256,35 HASH_ALGO_SM3_256,
36 HASH_ALGO_STREEBOG_256,
37 HASH_ALGO_STREEBOG_512,
36 HASH_ALGO__LAST38 HASH_ALGO__LAST
37};39};
3840
lib/libc/include/any-linux-any/linux/hdlc/ioctl.h+9
...@@ -79,6 +79,15 @@ typedef struct {...@@ -79,6 +79,15 @@ typedef struct {
79 unsigned int timeout;79 unsigned int timeout;
80} cisco_proto;80} cisco_proto;
8181
82typedef struct {
83 unsigned short dce; /* 1 for DCE (network side) operation */
84 unsigned int modulo; /* modulo (8 = basic / 128 = extended) */
85 unsigned int window; /* frame window size */
86 unsigned int t1; /* timeout t1 */
87 unsigned int t2; /* timeout t2 */
88 unsigned int n2; /* frame retry counter */
89} x25_hdlc_proto;
90
82/* PPP doesn't need any info now - supply length = 0 to ioctl */91/* PPP doesn't need any info now - supply length = 0 to ioctl */
8392
84#endif /* __ASSEMBLY__ */93#endif /* __ASSEMBLY__ */
lib/libc/include/any-linux-any/linux/hidraw.h+7
...@@ -39,6 +39,13 @@ struct hidraw_devinfo {...@@ -39,6 +39,13 @@ struct hidraw_devinfo {
39/* The first byte of SFEATURE and GFEATURE is the report number */39/* The first byte of SFEATURE and GFEATURE is the report number */
40#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)40#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
41#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)41#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
42#define HIDIOCGRAWUNIQ(len) _IOC(_IOC_READ, 'H', 0x08, len)
43/* The first byte of SINPUT and GINPUT is the report number */
44#define HIDIOCSINPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x09, len)
45#define HIDIOCGINPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0A, len)
46/* The first byte of SOUTPUT and GOUTPUT is the report number */
47#define HIDIOCSOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0B, len)
48#define HIDIOCGOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0C, len)
4249
43#define HIDRAW_FIRST_MINOR 050#define HIDRAW_FIRST_MINOR 0
44#define HIDRAW_MAX_DEVICES 6451#define HIDRAW_MAX_DEVICES 64
lib/libc/include/any-linux-any/linux/hsr_netlink.h+1-1
...@@ -17,7 +17,7 @@...@@ -17,7 +17,7 @@
17/* Generic Netlink HSR family definition17/* Generic Netlink HSR family definition
18 */18 */
1919
20/* attributes */20/* attributes for HSR or PRP node */
21enum {21enum {
22 HSR_A_UNSPEC,22 HSR_A_UNSPEC,
23 HSR_A_NODE_ADDR,23 HSR_A_NODE_ADDR,
lib/libc/include/any-linux-any/linux/hyperv.h+4-4
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
26#ifndef _HYPERV_H26#ifndef _HYPERV_H
27#define _HYPERV_H27#define _HYPERV_H
2828
29#include <linux/uuid.h>29#include <linux/types.h>
3030
31/*31/*
32 * Framework version for util services.32 * Framework version for util services.
...@@ -119,8 +119,8 @@ enum hv_fcopy_op {...@@ -119,8 +119,8 @@ enum hv_fcopy_op {
119119
120struct hv_fcopy_hdr {120struct hv_fcopy_hdr {
121 __u32 operation;121 __u32 operation;
122 uuid_le service_id0; /* currently unused */122 __u8 service_id0[16]; /* currently unused */
123 uuid_le service_id1; /* currently unused */123 __u8 service_id1[16]; /* currently unused */
124} __attribute__((packed));124} __attribute__((packed));
125125
126#define OVER_WRITE 0x1126#define OVER_WRITE 0x1
...@@ -219,7 +219,7 @@ struct hv_do_fcopy {...@@ -219,7 +219,7 @@ struct hv_do_fcopy {
219 * kernel and user-level daemon communicate using a connector channel.219 * kernel and user-level daemon communicate using a connector channel.
220 *220 *
221 * The user mode component first registers with the221 * The user mode component first registers with the
222 * the kernel component. Subsequently, the kernel component requests, data222 * kernel component. Subsequently, the kernel component requests, data
223 * for the specified keys. In response to this message the user mode component223 * for the specified keys. In response to this message the user mode component
224 * fills in the value corresponding to the specified key. We overload the224 * fills in the value corresponding to the specified key. We overload the
225 * sequence field in the cn_msg header to define our KVP message types.225 * sequence field in the cn_msg header to define our KVP message types.
lib/libc/include/any-linux-any/linux/hysdn_if.h deleted-30
...@@ -1,30 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
3 *
4 * Linux driver for HYSDN cards
5 * ioctl definitions shared by hynetmgr and driver.
6 *
7 * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
8 * Copyright 1999 by Werner Cornelius (werner@titro.de)
9 *
10 * This software may be used and distributed according to the terms
11 * of the GNU General Public License, incorporated herein by reference.
12 *
13 */
14
15/****************/
16/* error values */
17/****************/
18#define ERR_NONE 0 /* no error occurred */
19#define ERR_ALREADY_BOOT 1000 /* we are already booting */
20#define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */
21#define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */
22#define EPOF_INTERNAL 1003 /* internal POF handler error */
23#define EPOF_BAD_IMG_SIZE 1004 /* POF boot image size invalid */
24#define ERR_BOOTIMG_FAIL 1005 /* 1. stage boot image did not start */
25#define ERR_BOOTSEQ_FAIL 1006 /* 2. stage boot seq handshake timeout */
26#define ERR_POF_TIMEOUT 1007 /* timeout waiting for card pof ready */
27#define ERR_NOT_BOOTED 1008 /* operation only allowed when booted */
28#define ERR_CONF_LONG 1009 /* conf line is too long */
29#define ERR_INV_CHAN 1010 /* invalid channel number */
30#define ERR_ASYNC_TIME 1011 /* timeout sending async data */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/i2c-dev.h+5-20
...@@ -1,25 +1,10 @@...@@ -1,25 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 i2c-dev.h - i2c-bus driver, char device interface3 * i2c-dev.h - I2C bus char device interface
44 *
5 Copyright (C) 1995-97 Simon G. Vogl5 * Copyright (C) 1995-97 Simon G. Vogl
6 Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>6 * Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
77 */
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 MA 02110-1301 USA.
22*/
238
24#ifndef _LINUX_I2C_DEV_H9#ifndef _LINUX_I2C_DEV_H
25#define _LINUX_I2C_DEV_H10#define _LINUX_I2C_DEV_H
lib/libc/include/any-linux-any/linux/i2c.h+67-61
...@@ -1,29 +1,11 @@...@@ -1,29 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* ------------------------------------------------------------------------- */2/*
3/* */3 * i2c.h - definitions for the I2C bus interface
4/* i2c.h - definitions for the i2c-bus interface */4 *
5/* */5 * Copyright (C) 1995-2000 Simon G. Vogl
6/* ------------------------------------------------------------------------- */6 * With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
7/* Copyright (C) 1995-2000 Simon G. Vogl7 * Frodo Looijaard <frodol@dds.nl>
88 */
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 MA 02110-1301 USA. */
23/* ------------------------------------------------------------------------- */
24
25/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
26 Frodo Looijaard <frodol@dds.nl> */
279
28#ifndef _LINUX_I2C_H10#ifndef _LINUX_I2C_H
29#define _LINUX_I2C_H11#define _LINUX_I2C_H
...@@ -32,18 +14,41 @@...@@ -32,18 +14,41 @@
3214
33/**15/**
34 * struct i2c_msg - an I2C transaction segment beginning with START16 * struct i2c_msg - an I2C transaction segment beginning with START
35 * @addr: Slave address, either seven or ten bits. When this is a ten17 *
36 * bit address, I2C_M_TEN must be set in @flags and the adapter18 * @addr: Slave address, either 7 or 10 bits. When this is a 10 bit address,
37 * must support I2C_FUNC_10BIT_ADDR.19 * %I2C_M_TEN must be set in @flags and the adapter must support
38 * @flags: I2C_M_RD is handled by all adapters. No other flags may be20 * %I2C_FUNC_10BIT_ADDR.
39 * provided unless the adapter exported the relevant I2C_FUNC_*21 *
40 * flags through i2c_check_functionality().22 * @flags:
41 * @len: Number of data bytes in @buf being read from or written to the23 * Supported by all adapters:
42 * I2C slave address. For read transactions where I2C_M_RECV_LEN24 * %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001!
43 * is set, the caller guarantees that this buffer can hold up to25 *
44 * 32 bytes in addition to the initial length byte sent by the26 * Optional:
45 * slave (plus, if used, the SMBus PEC); and this value will be27 * %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes only sense
46 * incremented by the number of block data bytes received.28 * in kernelspace, because userspace buffers are copied anyway
29 *
30 * Only if I2C_FUNC_10BIT_ADDR is set:
31 * %I2C_M_TEN: this is a 10 bit chip address
32 *
33 * Only if I2C_FUNC_SMBUS_READ_BLOCK_DATA is set:
34 * %I2C_M_RECV_LEN: message length will be first received byte
35 *
36 * Only if I2C_FUNC_NOSTART is set:
37 * %I2C_M_NOSTART: skip repeated start sequence
38
39 * Only if I2C_FUNC_PROTOCOL_MANGLING is set:
40 * %I2C_M_NO_RD_ACK: in a read message, master ACK/NACK bit is skipped
41 * %I2C_M_IGNORE_NAK: treat NACK from client as ACK
42 * %I2C_M_REV_DIR_ADDR: toggles the Rd/Wr bit
43 * %I2C_M_STOP: force a STOP condition after the message
44 *
45 * @len: Number of data bytes in @buf being read from or written to the I2C
46 * slave address. For read transactions where %I2C_M_RECV_LEN is set, the
47 * caller guarantees that this buffer can hold up to %I2C_SMBUS_BLOCK_MAX
48 * bytes in addition to the initial length byte sent by the slave (plus,
49 * if used, the SMBus PEC); and this value will be incremented by the number
50 * of block data bytes received.
51 *
47 * @buf: The buffer into which data is read, or from which it's written.52 * @buf: The buffer into which data is read, or from which it's written.
48 *53 *
49 * An i2c_msg is the low level representation of one segment of an I2C54 * An i2c_msg is the low level representation of one segment of an I2C
...@@ -60,40 +65,36 @@...@@ -60,40 +65,36 @@
60 * group, it is followed by a STOP. Otherwise it is followed by the next65 * group, it is followed by a STOP. Otherwise it is followed by the next
61 * @i2c_msg transaction segment, beginning with a (repeated) START.66 * @i2c_msg transaction segment, beginning with a (repeated) START.
62 *67 *
63 * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then68 * Alternatively, when the adapter supports %I2C_FUNC_PROTOCOL_MANGLING then
64 * passing certain @flags may have changed those standard protocol behaviors.69 * passing certain @flags may have changed those standard protocol behaviors.
65 * Those flags are only for use with broken/nonconforming slaves, and with70 * Those flags are only for use with broken/nonconforming slaves, and with
66 * adapters which are known to support the specific mangling options they71 * adapters which are known to support the specific mangling options they need.
67 * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
68 */72 */
69struct i2c_msg {73struct i2c_msg {
70 __u16 addr; /* slave address */74 __u16 addr;
71 __u16 flags;75 __u16 flags;
72#define I2C_M_RD 0x0001 /* read data, from slave to master */76#define I2C_M_RD 0x0001 /* guaranteed to be 0x0001! */
73 /* I2C_M_RD is guaranteed to be 0x0001! */77#define I2C_M_TEN 0x0010 /* use only if I2C_FUNC_10BIT_ADDR */
74#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */78#define I2C_M_DMA_SAFE 0x0200 /* use only in kernel space */
75#define I2C_M_DMA_SAFE 0x0200 /* the buffer of this message is DMA safe */79#define I2C_M_RECV_LEN 0x0400 /* use only if I2C_FUNC_SMBUS_READ_BLOCK_DATA */
76 /* makes only sense in kernelspace */80#define I2C_M_NO_RD_ACK 0x0800 /* use only if I2C_FUNC_PROTOCOL_MANGLING */
77 /* userspace buffers are copied anyway */81#define I2C_M_IGNORE_NAK 0x1000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */
78#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */82#define I2C_M_REV_DIR_ADDR 0x2000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */
79#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */83#define I2C_M_NOSTART 0x4000 /* use only if I2C_FUNC_NOSTART */
80#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */84#define I2C_M_STOP 0x8000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */
81#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */85 __u16 len;
82#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */86 __u8 *buf;
83#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
84 __u16 len; /* msg length */
85 __u8 *buf; /* pointer to msg data */
86};87};
8788
88/* To determine what functionality is present */89/* To determine what functionality is present */
8990
90#define I2C_FUNC_I2C 0x0000000191#define I2C_FUNC_I2C 0x00000001
91#define I2C_FUNC_10BIT_ADDR 0x0000000292#define I2C_FUNC_10BIT_ADDR 0x00000002 /* required for I2C_M_TEN */
92#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_IGNORE_NAK etc. */93#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* required for I2C_M_IGNORE_NAK etc. */
93#define I2C_FUNC_SMBUS_PEC 0x0000000894#define I2C_FUNC_SMBUS_PEC 0x00000008
94#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */95#define I2C_FUNC_NOSTART 0x00000010 /* required for I2C_M_NOSTART */
95#define I2C_FUNC_SLAVE 0x0000002096#define I2C_FUNC_SLAVE 0x00000020
96#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */97#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 or later */
97#define I2C_FUNC_SMBUS_QUICK 0x0001000098#define I2C_FUNC_SMBUS_QUICK 0x00010000
98#define I2C_FUNC_SMBUS_READ_BYTE 0x0002000099#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
99#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000100#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
...@@ -102,11 +103,11 @@ struct i2c_msg {...@@ -102,11 +103,11 @@ struct i2c_msg {
102#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000103#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
103#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000104#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
104#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000105#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
105#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000106#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 /* required for I2C_M_RECV_LEN */
106#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000107#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
107#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */108#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
108#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */109#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
109#define I2C_FUNC_SMBUS_HOST_NOTIFY 0x10000000110#define I2C_FUNC_SMBUS_HOST_NOTIFY 0x10000000 /* SMBus 2.0 or later */
110111
111#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \112#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
112 I2C_FUNC_SMBUS_WRITE_BYTE)113 I2C_FUNC_SMBUS_WRITE_BYTE)
...@@ -128,6 +129,11 @@ struct i2c_msg {...@@ -128,6 +129,11 @@ struct i2c_msg {
128 I2C_FUNC_SMBUS_I2C_BLOCK | \129 I2C_FUNC_SMBUS_I2C_BLOCK | \
129 I2C_FUNC_SMBUS_PEC)130 I2C_FUNC_SMBUS_PEC)
130131
132/* if I2C_M_RECV_LEN is also supported */
133#define I2C_FUNC_SMBUS_EMUL_ALL (I2C_FUNC_SMBUS_EMUL | \
134 I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
135 I2C_FUNC_SMBUS_BLOCK_PROC_CALL)
136
131/*137/*
132 * Data for SMBus Messages138 * Data for SMBus Messages
133 */139 */
lib/libc/include/any-linux-any/linux/icmp.h+63
...@@ -19,6 +19,9 @@...@@ -19,6 +19,9 @@
19#define _LINUX_ICMP_H19#define _LINUX_ICMP_H
2020
21#include <linux/types.h>21#include <linux/types.h>
22#include <asm/byteorder.h>
23#include <linux/if.h>
24#include <linux/in6.h>
2225
23#define ICMP_ECHOREPLY 0 /* Echo Reply */26#define ICMP_ECHOREPLY 0 /* Echo Reply */
24#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */27#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
...@@ -65,6 +68,23 @@...@@ -65,6 +68,23 @@
65#define ICMP_EXC_TTL 0 /* TTL count exceeded */68#define ICMP_EXC_TTL 0 /* TTL count exceeded */
66#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */69#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
6770
71/* Codes for EXT_ECHO (PROBE) */
72#define ICMP_EXT_ECHO 42
73#define ICMP_EXT_ECHOREPLY 43
74#define ICMP_EXT_CODE_MAL_QUERY 1 /* Malformed Query */
75#define ICMP_EXT_CODE_NO_IF 2 /* No such Interface */
76#define ICMP_EXT_CODE_NO_TABLE_ENT 3 /* No such Table Entry */
77#define ICMP_EXT_CODE_MULT_IFS 4 /* Multiple Interfaces Satisfy Query */
78
79/* Constants for EXT_ECHO (PROBE) */
80#define ICMP_EXT_ECHOREPLY_ACTIVE (1 << 2)/* active bit in reply message */
81#define ICMP_EXT_ECHOREPLY_IPV4 (1 << 1)/* ipv4 bit in reply message */
82#define ICMP_EXT_ECHOREPLY_IPV6 1 /* ipv6 bit in reply message */
83#define ICMP_EXT_ECHO_CTYPE_NAME 1
84#define ICMP_EXT_ECHO_CTYPE_INDEX 2
85#define ICMP_EXT_ECHO_CTYPE_ADDR 3
86#define ICMP_AFI_IP 1 /* Address Family Identifier for ipv4 */
87#define ICMP_AFI_IP6 2 /* Address Family Identifier for ipv6 */
6888
69struct icmphdr {89struct icmphdr {
70 __u8 type;90 __u8 type;
...@@ -95,5 +115,48 @@ struct icmp_filter {...@@ -95,5 +115,48 @@ struct icmp_filter {
95 __u32 data;115 __u32 data;
96};116};
97117
118/* RFC 4884 extension struct: one per message */
119struct icmp_ext_hdr {
120#if defined(__LITTLE_ENDIAN_BITFIELD)
121 __u8 reserved1:4,
122 version:4;
123#elif defined(__BIG_ENDIAN_BITFIELD)
124 __u8 version:4,
125 reserved1:4;
126#else
127#error "Please fix <asm/byteorder.h>"
128#endif
129 __u8 reserved2;
130 __sum16 checksum;
131};
132
133/* RFC 4884 extension object header: one for each object */
134struct icmp_extobj_hdr {
135 __be16 length;
136 __u8 class_num;
137 __u8 class_type;
138};
98139
140/* RFC 8335: 2.1 Header for c-type 3 payload */
141struct icmp_ext_echo_ctype3_hdr {
142 __be16 afi;
143 __u8 addrlen;
144 __u8 reserved;
145};
146
147/* RFC 8335: 2.1 Interface Identification Object */
148struct icmp_ext_echo_iio {
149 struct icmp_extobj_hdr extobj_hdr;
150 union {
151 char name[IFNAMSIZ];
152 __be32 ifindex;
153 struct {
154 struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
155 union {
156 __be32 ipv4_addr;
157 struct in6_addr ipv6_addr;
158 } ip_addr;
159 } addr;
160 } ident;
161};
99#endif /* _LINUX_ICMP_H */162#endif /* _LINUX_ICMP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/icmpv6.h+11
...@@ -68,6 +68,7 @@ struct icmp6hdr {...@@ -68,6 +68,7 @@ struct icmp6hdr {
68#define icmp6_mtu icmp6_dataun.un_data32[0]68#define icmp6_mtu icmp6_dataun.un_data32[0]
69#define icmp6_unused icmp6_dataun.un_data32[0]69#define icmp6_unused icmp6_dataun.un_data32[0]
70#define icmp6_maxdelay icmp6_dataun.un_data16[0]70#define icmp6_maxdelay icmp6_dataun.un_data16[0]
71#define icmp6_datagram_len icmp6_dataun.un_data8[0]
71#define icmp6_router icmp6_dataun.u_nd_advt.router72#define icmp6_router icmp6_dataun.u_nd_advt.router
72#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited73#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
73#define icmp6_override icmp6_dataun.u_nd_advt.override74#define icmp6_override icmp6_dataun.u_nd_advt.override
...@@ -90,6 +91,8 @@ struct icmp6hdr {...@@ -90,6 +91,8 @@ struct icmp6hdr {
90#define ICMPV6_TIME_EXCEED 391#define ICMPV6_TIME_EXCEED 3
91#define ICMPV6_PARAMPROB 492#define ICMPV6_PARAMPROB 4
9293
94#define ICMPV6_ERRMSG_MAX 127
95
93#define ICMPV6_INFOMSG_MASK 0x8096#define ICMPV6_INFOMSG_MASK 0x80
9497
95#define ICMPV6_ECHO_REQUEST 12898#define ICMPV6_ECHO_REQUEST 128
...@@ -108,6 +111,10 @@ struct icmp6hdr {...@@ -108,6 +111,10 @@ struct icmp6hdr {
108#define ICMPV6_MOBILE_PREFIX_SOL 146111#define ICMPV6_MOBILE_PREFIX_SOL 146
109#define ICMPV6_MOBILE_PREFIX_ADV 147112#define ICMPV6_MOBILE_PREFIX_ADV 147
110113
114#define ICMPV6_MRDISC_ADV 151
115
116#define ICMPV6_MSG_MAX 255
117
111/*118/*
112 * Codes for Destination Unreachable119 * Codes for Destination Unreachable
113 */120 */
...@@ -131,7 +138,11 @@ struct icmp6hdr {...@@ -131,7 +138,11 @@ struct icmp6hdr {
131#define ICMPV6_HDR_FIELD 0138#define ICMPV6_HDR_FIELD 0
132#define ICMPV6_UNK_NEXTHDR 1139#define ICMPV6_UNK_NEXTHDR 1
133#define ICMPV6_UNK_OPTION 2140#define ICMPV6_UNK_OPTION 2
141#define ICMPV6_HDR_INCOMP 3
134142
143/* Codes for EXT_ECHO (PROBE) */
144#define ICMPV6_EXT_ECHO_REQUEST 160
145#define ICMPV6_EXT_ECHO_REPLY 161
135/*146/*
136 * constants for (set|get)sockopt147 * constants for (set|get)sockopt
137 */148 */
lib/libc/include/any-linux-any/linux/idxd.h created+325
...@@ -0,0 +1,325 @@
1/* SPDX-License-Identifier: LGPL-2.1 WITH Linux-syscall-note */
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#ifndef _USR_IDXD_H_
4#define _USR_IDXD_H_
5
6#include <stdint.h>
7
8/* Driver command error status */
9enum idxd_scmd_stat {
10 IDXD_SCMD_DEV_ENABLED = 0x80000010,
11 IDXD_SCMD_DEV_NOT_ENABLED = 0x80000020,
12 IDXD_SCMD_WQ_ENABLED = 0x80000021,
13 IDXD_SCMD_DEV_DMA_ERR = 0x80020000,
14 IDXD_SCMD_WQ_NO_GRP = 0x80030000,
15 IDXD_SCMD_WQ_NO_NAME = 0x80040000,
16 IDXD_SCMD_WQ_NO_SVM = 0x80050000,
17 IDXD_SCMD_WQ_NO_THRESH = 0x80060000,
18 IDXD_SCMD_WQ_PORTAL_ERR = 0x80070000,
19 IDXD_SCMD_WQ_RES_ALLOC_ERR = 0x80080000,
20 IDXD_SCMD_PERCPU_ERR = 0x80090000,
21 IDXD_SCMD_DMA_CHAN_ERR = 0x800a0000,
22 IDXD_SCMD_CDEV_ERR = 0x800b0000,
23 IDXD_SCMD_WQ_NO_SWQ_SUPPORT = 0x800c0000,
24 IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,
25 IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,
26 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
27};
28
29#define IDXD_SCMD_SOFTERR_MASK 0x80000000
30#define IDXD_SCMD_SOFTERR_SHIFT 16
31
32/* Descriptor flags */
33#define IDXD_OP_FLAG_FENCE 0x0001
34#define IDXD_OP_FLAG_BOF 0x0002
35#define IDXD_OP_FLAG_CRAV 0x0004
36#define IDXD_OP_FLAG_RCR 0x0008
37#define IDXD_OP_FLAG_RCI 0x0010
38#define IDXD_OP_FLAG_CRSTS 0x0020
39#define IDXD_OP_FLAG_CR 0x0080
40#define IDXD_OP_FLAG_CC 0x0100
41#define IDXD_OP_FLAG_ADDR1_TCS 0x0200
42#define IDXD_OP_FLAG_ADDR2_TCS 0x0400
43#define IDXD_OP_FLAG_ADDR3_TCS 0x0800
44#define IDXD_OP_FLAG_CR_TCS 0x1000
45#define IDXD_OP_FLAG_STORD 0x2000
46#define IDXD_OP_FLAG_DRDBK 0x4000
47#define IDXD_OP_FLAG_DSTS 0x8000
48
49/* IAX */
50#define IDXD_OP_FLAG_RD_SRC2_AECS 0x010000
51
52/* Opcode */
53enum dsa_opcode {
54 DSA_OPCODE_NOOP = 0,
55 DSA_OPCODE_BATCH,
56 DSA_OPCODE_DRAIN,
57 DSA_OPCODE_MEMMOVE,
58 DSA_OPCODE_MEMFILL,
59 DSA_OPCODE_COMPARE,
60 DSA_OPCODE_COMPVAL,
61 DSA_OPCODE_CR_DELTA,
62 DSA_OPCODE_AP_DELTA,
63 DSA_OPCODE_DUALCAST,
64 DSA_OPCODE_CRCGEN = 0x10,
65 DSA_OPCODE_COPY_CRC,
66 DSA_OPCODE_DIF_CHECK,
67 DSA_OPCODE_DIF_INS,
68 DSA_OPCODE_DIF_STRP,
69 DSA_OPCODE_DIF_UPDT,
70 DSA_OPCODE_CFLUSH = 0x20,
71};
72
73enum iax_opcode {
74 IAX_OPCODE_NOOP = 0,
75 IAX_OPCODE_DRAIN = 2,
76 IAX_OPCODE_MEMMOVE,
77 IAX_OPCODE_DECOMPRESS = 0x42,
78 IAX_OPCODE_COMPRESS,
79};
80
81/* Completion record status */
82enum dsa_completion_status {
83 DSA_COMP_NONE = 0,
84 DSA_COMP_SUCCESS,
85 DSA_COMP_SUCCESS_PRED,
86 DSA_COMP_PAGE_FAULT_NOBOF,
87 DSA_COMP_PAGE_FAULT_IR,
88 DSA_COMP_BATCH_FAIL,
89 DSA_COMP_BATCH_PAGE_FAULT,
90 DSA_COMP_DR_OFFSET_NOINC,
91 DSA_COMP_DR_OFFSET_ERANGE,
92 DSA_COMP_DIF_ERR,
93 DSA_COMP_BAD_OPCODE = 0x10,
94 DSA_COMP_INVALID_FLAGS,
95 DSA_COMP_NOZERO_RESERVE,
96 DSA_COMP_XFER_ERANGE,
97 DSA_COMP_DESC_CNT_ERANGE,
98 DSA_COMP_DR_ERANGE,
99 DSA_COMP_OVERLAP_BUFFERS,
100 DSA_COMP_DCAST_ERR,
101 DSA_COMP_DESCLIST_ALIGN,
102 DSA_COMP_INT_HANDLE_INVAL,
103 DSA_COMP_CRA_XLAT,
104 DSA_COMP_CRA_ALIGN,
105 DSA_COMP_ADDR_ALIGN,
106 DSA_COMP_PRIV_BAD,
107 DSA_COMP_TRAFFIC_CLASS_CONF,
108 DSA_COMP_PFAULT_RDBA,
109 DSA_COMP_HW_ERR1,
110 DSA_COMP_HW_ERR_DRB,
111 DSA_COMP_TRANSLATION_FAIL,
112};
113
114enum iax_completion_status {
115 IAX_COMP_NONE = 0,
116 IAX_COMP_SUCCESS,
117 IAX_COMP_PAGE_FAULT_IR = 0x04,
118 IAX_COMP_OUTBUF_OVERFLOW,
119 IAX_COMP_BAD_OPCODE = 0x10,
120 IAX_COMP_INVALID_FLAGS,
121 IAX_COMP_NOZERO_RESERVE,
122 IAX_COMP_INVALID_SIZE,
123 IAX_COMP_OVERLAP_BUFFERS = 0x16,
124 IAX_COMP_INT_HANDLE_INVAL = 0x19,
125 IAX_COMP_CRA_XLAT,
126 IAX_COMP_CRA_ALIGN,
127 IAX_COMP_ADDR_ALIGN,
128 IAX_COMP_PRIV_BAD,
129 IAX_COMP_TRAFFIC_CLASS_CONF,
130 IAX_COMP_PFAULT_RDBA,
131 IAX_COMP_HW_ERR1,
132 IAX_COMP_HW_ERR_DRB,
133 IAX_COMP_TRANSLATION_FAIL,
134 IAX_COMP_PRS_TIMEOUT,
135 IAX_COMP_WATCHDOG,
136 IAX_COMP_INVALID_COMP_FLAG = 0x30,
137 IAX_COMP_INVALID_FILTER_FLAG,
138 IAX_COMP_INVALID_NUM_ELEMS = 0x33,
139};
140
141#define DSA_COMP_STATUS_MASK 0x7f
142#define DSA_COMP_STATUS_WRITE 0x80
143
144struct dsa_hw_desc {
145 uint32_t pasid:20;
146 uint32_t rsvd:11;
147 uint32_t priv:1;
148 uint32_t flags:24;
149 uint32_t opcode:8;
150 uint64_t completion_addr;
151 union {
152 uint64_t src_addr;
153 uint64_t rdback_addr;
154 uint64_t pattern;
155 uint64_t desc_list_addr;
156 };
157 union {
158 uint64_t dst_addr;
159 uint64_t rdback_addr2;
160 uint64_t src2_addr;
161 uint64_t comp_pattern;
162 };
163 union {
164 uint32_t xfer_size;
165 uint32_t desc_count;
166 };
167 uint16_t int_handle;
168 uint16_t rsvd1;
169 union {
170 uint8_t expected_res;
171 /* create delta record */
172 struct {
173 uint64_t delta_addr;
174 uint32_t max_delta_size;
175 uint32_t delt_rsvd;
176 uint8_t expected_res_mask;
177 };
178 uint32_t delta_rec_size;
179 uint64_t dest2;
180 /* CRC */
181 struct {
182 uint32_t crc_seed;
183 uint32_t crc_rsvd;
184 uint64_t seed_addr;
185 };
186 /* DIF check or strip */
187 struct {
188 uint8_t src_dif_flags;
189 uint8_t dif_chk_res;
190 uint8_t dif_chk_flags;
191 uint8_t dif_chk_res2[5];
192 uint32_t chk_ref_tag_seed;
193 uint16_t chk_app_tag_mask;
194 uint16_t chk_app_tag_seed;
195 };
196 /* DIF insert */
197 struct {
198 uint8_t dif_ins_res;
199 uint8_t dest_dif_flag;
200 uint8_t dif_ins_flags;
201 uint8_t dif_ins_res2[13];
202 uint32_t ins_ref_tag_seed;
203 uint16_t ins_app_tag_mask;
204 uint16_t ins_app_tag_seed;
205 };
206 /* DIF update */
207 struct {
208 uint8_t src_upd_flags;
209 uint8_t upd_dest_flags;
210 uint8_t dif_upd_flags;
211 uint8_t dif_upd_res[5];
212 uint32_t src_ref_tag_seed;
213 uint16_t src_app_tag_mask;
214 uint16_t src_app_tag_seed;
215 uint32_t dest_ref_tag_seed;
216 uint16_t dest_app_tag_mask;
217 uint16_t dest_app_tag_seed;
218 };
219
220 uint8_t op_specific[24];
221 };
222} __attribute__((packed));
223
224struct iax_hw_desc {
225 uint32_t pasid:20;
226 uint32_t rsvd:11;
227 uint32_t priv:1;
228 uint32_t flags:24;
229 uint32_t opcode:8;
230 uint64_t completion_addr;
231 uint64_t src1_addr;
232 uint64_t dst_addr;
233 uint32_t src1_size;
234 uint16_t int_handle;
235 union {
236 uint16_t compr_flags;
237 uint16_t decompr_flags;
238 };
239 uint64_t src2_addr;
240 uint32_t max_dst_size;
241 uint32_t src2_size;
242 uint32_t filter_flags;
243 uint32_t num_inputs;
244} __attribute__((packed));
245
246struct dsa_raw_desc {
247 uint64_t field[8];
248} __attribute__((packed));
249
250/*
251 * The status field will be modified by hardware, therefore it should be
252 * __volatile__ and prevent the compiler from optimize the read.
253 */
254struct dsa_completion_record {
255 __volatile__ uint8_t status;
256 union {
257 uint8_t result;
258 uint8_t dif_status;
259 };
260 uint16_t rsvd;
261 uint32_t bytes_completed;
262 uint64_t fault_addr;
263 union {
264 /* common record */
265 struct {
266 uint32_t invalid_flags:24;
267 uint32_t rsvd2:8;
268 };
269
270 uint32_t delta_rec_size;
271 uint32_t crc_val;
272
273 /* DIF check & strip */
274 struct {
275 uint32_t dif_chk_ref_tag;
276 uint16_t dif_chk_app_tag_mask;
277 uint16_t dif_chk_app_tag;
278 };
279
280 /* DIF insert */
281 struct {
282 uint64_t dif_ins_res;
283 uint32_t dif_ins_ref_tag;
284 uint16_t dif_ins_app_tag_mask;
285 uint16_t dif_ins_app_tag;
286 };
287
288 /* DIF update */
289 struct {
290 uint32_t dif_upd_src_ref_tag;
291 uint16_t dif_upd_src_app_tag_mask;
292 uint16_t dif_upd_src_app_tag;
293 uint32_t dif_upd_dest_ref_tag;
294 uint16_t dif_upd_dest_app_tag_mask;
295 uint16_t dif_upd_dest_app_tag;
296 };
297
298 uint8_t op_specific[16];
299 };
300} __attribute__((packed));
301
302struct dsa_raw_completion_record {
303 uint64_t field[4];
304} __attribute__((packed));
305
306struct iax_completion_record {
307 __volatile__ uint8_t status;
308 uint8_t error_code;
309 uint16_t rsvd;
310 uint32_t bytes_completed;
311 uint64_t fault_addr;
312 uint32_t invalid_flags;
313 uint32_t rsvd2;
314 uint32_t output_size;
315 uint8_t output_bits;
316 uint8_t rsvd3;
317 uint16_t rsvd4;
318 uint64_t rsvd5[4];
319} __attribute__((packed));
320
321struct iax_raw_completion_record {
322 uint64_t field[8];
323} __attribute__((packed));
324
325#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if.h+3
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
31#define IFNAMSIZ 1631#define IFNAMSIZ 16
32#endif /* __UAPI_DEF_IF_IFNAMSIZ */32#endif /* __UAPI_DEF_IF_IFNAMSIZ */
33#define IFALIASZ 25633#define IFALIASZ 256
34#define ALTIFNAMSIZ 128
34#include <linux/hdlc/ioctl.h>35#include <linux/hdlc/ioctl.h>
3536
36/* For glibc compatibility. An empty enum does not compile. */37/* For glibc compatibility. An empty enum does not compile. */
...@@ -175,6 +176,7 @@ enum {...@@ -175,6 +176,7 @@ enum {
175enum {176enum {
176 IF_LINK_MODE_DEFAULT,177 IF_LINK_MODE_DEFAULT,
177 IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */178 IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
179 IF_LINK_MODE_TESTING, /* limit upward transition to testing */
178};180};
179181
180/*182/*
...@@ -210,6 +212,7 @@ struct if_settings {...@@ -210,6 +212,7 @@ struct if_settings {
210 fr_proto *fr;212 fr_proto *fr;
211 fr_proto_pvc *fr_pvc;213 fr_proto_pvc *fr_pvc;
212 fr_proto_pvc_info *fr_pvc_info;214 fr_proto_pvc_info *fr_pvc_info;
215 x25_hdlc_proto *x25;
213216
214 /* interface settings */217 /* interface settings */
215 sync_serial_settings *sync;218 sync_serial_settings *sync;
lib/libc/include/any-linux-any/linux/if_addr.h+1
...@@ -34,6 +34,7 @@ enum {...@@ -34,6 +34,7 @@ enum {
34 IFA_MULTICAST,34 IFA_MULTICAST,
35 IFA_FLAGS,35 IFA_FLAGS,
36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */
37 IFA_TARGET_NETNSID,
37 __IFA_MAX,38 __IFA_MAX,
38};39};
3940
lib/libc/include/any-linux-any/linux/if_alg.h+17
...@@ -24,6 +24,22 @@ struct sockaddr_alg {...@@ -24,6 +24,22 @@ struct sockaddr_alg {
24 __u8 salg_name[64];24 __u8 salg_name[64];
25};25};
2626
27/*
28 * Linux v4.12 and later removed the 64-byte limit on salg_name[]; it's now an
29 * arbitrary-length field. We had to keep the original struct above for source
30 * compatibility with existing userspace programs, though. Use the new struct
31 * below if support for very long algorithm names is needed. To do this,
32 * allocate 'sizeof(struct sockaddr_alg_new) + strlen(algname) + 1' bytes, and
33 * copy algname (including the null terminator) into salg_name.
34 */
35struct sockaddr_alg_new {
36 __u16 salg_family;
37 __u8 salg_type[14];
38 __u32 salg_feat;
39 __u32 salg_mask;
40 __u8 salg_name[];
41};
42
27struct af_alg_iv {43struct af_alg_iv {
28 __u32 ivlen;44 __u32 ivlen;
29 __u8 iv[0];45 __u8 iv[0];
...@@ -35,6 +51,7 @@ struct af_alg_iv {...@@ -35,6 +51,7 @@ struct af_alg_iv {
35#define ALG_SET_OP 351#define ALG_SET_OP 3
36#define ALG_SET_AEAD_ASSOCLEN 452#define ALG_SET_AEAD_ASSOCLEN 4
37#define ALG_SET_AEAD_AUTHSIZE 553#define ALG_SET_AEAD_AUTHSIZE 5
54#define ALG_SET_DRBG_ENTROPY 6
3855
39/* Operations */56/* Operations */
40#define ALG_OP_DECRYPT 057#define ALG_OP_DECRYPT 0
lib/libc/include/any-linux-any/linux/if_arp.h+10-9
...@@ -54,6 +54,7 @@...@@ -54,6 +54,7 @@
54#define ARPHRD_X25 271 /* CCITT X.25 */54#define ARPHRD_X25 271 /* CCITT X.25 */
55#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */55#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
56#define ARPHRD_CAN 280 /* Controller Area Network */56#define ARPHRD_CAN 280 /* Controller Area Network */
57#define ARPHRD_MCTP 290
57#define ARPHRD_PPP 51258#define ARPHRD_PPP 512
58#define ARPHRD_CISCO 513 /* Cisco HDLC */59#define ARPHRD_CISCO 513 /* Cisco HDLC */
59#define ARPHRD_HDLC ARPHRD_CISCO60#define ARPHRD_HDLC ARPHRD_CISCO
...@@ -114,18 +115,18 @@...@@ -114,18 +115,18 @@
114115
115/* ARP ioctl request. */116/* ARP ioctl request. */
116struct arpreq {117struct arpreq {
117 struct sockaddr arp_pa; /* protocol address */118 struct sockaddr arp_pa; /* protocol address */
118 struct sockaddr arp_ha; /* hardware address */119 struct sockaddr arp_ha; /* hardware address */
119 int arp_flags; /* flags */120 int arp_flags; /* flags */
120 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */121 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
121 char arp_dev[16];122 char arp_dev[IFNAMSIZ];
122};123};
123124
124struct arpreq_old {125struct arpreq_old {
125 struct sockaddr arp_pa; /* protocol address */126 struct sockaddr arp_pa; /* protocol address */
126 struct sockaddr arp_ha; /* hardware address */127 struct sockaddr arp_ha; /* hardware address */
127 int arp_flags; /* flags */128 int arp_flags; /* flags */
128 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */129 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
129};130};
130131
131/* ARP Flag values. */132/* ARP Flag values. */
lib/libc/include/any-linux-any/linux/if_bonding.h+35-10
...@@ -94,6 +94,17 @@...@@ -94,6 +94,17 @@
94#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */94#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
95#define BOND_XMIT_POLICY_ENCAP23 3 /* encapsulated layer 2+3 */95#define BOND_XMIT_POLICY_ENCAP23 3 /* encapsulated layer 2+3 */
96#define BOND_XMIT_POLICY_ENCAP34 4 /* encapsulated layer 3+4 */96#define BOND_XMIT_POLICY_ENCAP34 4 /* encapsulated layer 3+4 */
97#define BOND_XMIT_POLICY_VLAN_SRCMAC 5 /* vlan + source MAC */
98
99/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */
100#define LACP_STATE_LACP_ACTIVITY 0x1
101#define LACP_STATE_LACP_TIMEOUT 0x2
102#define LACP_STATE_AGGREGATION 0x4
103#define LACP_STATE_SYNCHRONIZATION 0x8
104#define LACP_STATE_COLLECTING 0x10
105#define LACP_STATE_DISTRIBUTING 0x20
106#define LACP_STATE_DEFAULTED 0x40
107#define LACP_STATE_EXPIRED 0x80
97108
98typedef struct ifbond {109typedef struct ifbond {
99 __s32 bond_mode;110 __s32 bond_mode;
...@@ -117,14 +128,28 @@ struct ad_info {...@@ -117,14 +128,28 @@ struct ad_info {
117 __u8 partner_system[ETH_ALEN];128 __u8 partner_system[ETH_ALEN];
118};129};
119130
120#endif /* _LINUX_IF_BONDING_H */131/* Embedded inside LINK_XSTATS_TYPE_BOND */
132enum {
133 BOND_XSTATS_UNSPEC,
134 BOND_XSTATS_3AD,
135 __BOND_XSTATS_MAX
136};
137#define BOND_XSTATS_MAX (__BOND_XSTATS_MAX - 1)
138
139/* Embedded inside BOND_XSTATS_3AD */
140enum {
141 BOND_3AD_STAT_LACPDU_RX,
142 BOND_3AD_STAT_LACPDU_TX,
143 BOND_3AD_STAT_LACPDU_UNKNOWN_RX,
144 BOND_3AD_STAT_LACPDU_ILLEGAL_RX,
145 BOND_3AD_STAT_MARKER_RX,
146 BOND_3AD_STAT_MARKER_TX,
147 BOND_3AD_STAT_MARKER_RESP_RX,
148 BOND_3AD_STAT_MARKER_RESP_TX,
149 BOND_3AD_STAT_MARKER_UNKNOWN_RX,
150 BOND_3AD_STAT_PAD,
151 __BOND_3AD_STAT_MAX
152};
153#define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1)
121154
122/*
123 * Local variables:
124 * version-control: t
125 * kept-new-versions: 5
126 * c-indent-level: 8
127 * c-basic-offset: 8
128 * tab-width: 8
129 * End:
130 */
\ No newline at end of file
155#endif /* _LINUX_IF_BONDING_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_bridge.h+492
...@@ -120,6 +120,8 @@ enum {...@@ -120,6 +120,8 @@ enum {
120 IFLA_BRIDGE_MODE,120 IFLA_BRIDGE_MODE,
121 IFLA_BRIDGE_VLAN_INFO,121 IFLA_BRIDGE_VLAN_INFO,
122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,
123 IFLA_BRIDGE_MRP,
124 IFLA_BRIDGE_CFM,
123 __IFLA_BRIDGE_MAX,125 __IFLA_BRIDGE_MAX,
124};126};
125#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)127#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
...@@ -130,6 +132,7 @@ enum {...@@ -130,6 +132,7 @@ enum {
130#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */132#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */
131#define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */133#define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */
132#define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */134#define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */
135#define BRIDGE_VLAN_INFO_ONLY_OPTS (1<<6) /* Skip create/delete/flags */
133136
134struct bridge_vlan_info {137struct bridge_vlan_info {
135 __u16 flags;138 __u16 flags;
...@@ -156,6 +159,415 @@ struct bridge_vlan_xstats {...@@ -156,6 +159,415 @@ struct bridge_vlan_xstats {
156 __u32 pad2;159 __u32 pad2;
157};160};
158161
162enum {
163 IFLA_BRIDGE_MRP_UNSPEC,
164 IFLA_BRIDGE_MRP_INSTANCE,
165 IFLA_BRIDGE_MRP_PORT_STATE,
166 IFLA_BRIDGE_MRP_PORT_ROLE,
167 IFLA_BRIDGE_MRP_RING_STATE,
168 IFLA_BRIDGE_MRP_RING_ROLE,
169 IFLA_BRIDGE_MRP_START_TEST,
170 IFLA_BRIDGE_MRP_INFO,
171 IFLA_BRIDGE_MRP_IN_ROLE,
172 IFLA_BRIDGE_MRP_IN_STATE,
173 IFLA_BRIDGE_MRP_START_IN_TEST,
174 __IFLA_BRIDGE_MRP_MAX,
175};
176
177#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
178
179enum {
180 IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
181 IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
182 IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
183 IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
184 IFLA_BRIDGE_MRP_INSTANCE_PRIO,
185 __IFLA_BRIDGE_MRP_INSTANCE_MAX,
186};
187
188#define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
189
190enum {
191 IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
192 IFLA_BRIDGE_MRP_PORT_STATE_STATE,
193 __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
194};
195
196#define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
197
198enum {
199 IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
200 IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
201 __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
202};
203
204#define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
205
206enum {
207 IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
208 IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
209 IFLA_BRIDGE_MRP_RING_STATE_STATE,
210 __IFLA_BRIDGE_MRP_RING_STATE_MAX,
211};
212
213#define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
214
215enum {
216 IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
217 IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
218 IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
219 __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
220};
221
222#define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
223
224enum {
225 IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
226 IFLA_BRIDGE_MRP_START_TEST_RING_ID,
227 IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
228 IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
229 IFLA_BRIDGE_MRP_START_TEST_PERIOD,
230 IFLA_BRIDGE_MRP_START_TEST_MONITOR,
231 __IFLA_BRIDGE_MRP_START_TEST_MAX,
232};
233
234#define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
235
236enum {
237 IFLA_BRIDGE_MRP_INFO_UNSPEC,
238 IFLA_BRIDGE_MRP_INFO_RING_ID,
239 IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
240 IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
241 IFLA_BRIDGE_MRP_INFO_PRIO,
242 IFLA_BRIDGE_MRP_INFO_RING_STATE,
243 IFLA_BRIDGE_MRP_INFO_RING_ROLE,
244 IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
245 IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
246 IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
247 IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
248 IFLA_BRIDGE_MRP_INFO_IN_STATE,
249 IFLA_BRIDGE_MRP_INFO_IN_ROLE,
250 IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
251 IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
252 __IFLA_BRIDGE_MRP_INFO_MAX,
253};
254
255#define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
256
257enum {
258 IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
259 IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
260 IFLA_BRIDGE_MRP_IN_STATE_STATE,
261 __IFLA_BRIDGE_MRP_IN_STATE_MAX,
262};
263
264#define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
265
266enum {
267 IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
268 IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
269 IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
270 IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
271 IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
272 __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
273};
274
275#define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
276
277enum {
278 IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
279 IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
280 IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
281 IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
282 IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
283 __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
284};
285
286#define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
287
288struct br_mrp_instance {
289 __u32 ring_id;
290 __u32 p_ifindex;
291 __u32 s_ifindex;
292 __u16 prio;
293};
294
295struct br_mrp_ring_state {
296 __u32 ring_id;
297 __u32 ring_state;
298};
299
300struct br_mrp_ring_role {
301 __u32 ring_id;
302 __u32 ring_role;
303};
304
305struct br_mrp_start_test {
306 __u32 ring_id;
307 __u32 interval;
308 __u32 max_miss;
309 __u32 period;
310 __u32 monitor;
311};
312
313struct br_mrp_in_state {
314 __u32 in_state;
315 __u16 in_id;
316};
317
318struct br_mrp_in_role {
319 __u32 ring_id;
320 __u32 in_role;
321 __u32 i_ifindex;
322 __u16 in_id;
323};
324
325struct br_mrp_start_in_test {
326 __u32 interval;
327 __u32 max_miss;
328 __u32 period;
329 __u16 in_id;
330};
331
332enum {
333 IFLA_BRIDGE_CFM_UNSPEC,
334 IFLA_BRIDGE_CFM_MEP_CREATE,
335 IFLA_BRIDGE_CFM_MEP_DELETE,
336 IFLA_BRIDGE_CFM_MEP_CONFIG,
337 IFLA_BRIDGE_CFM_CC_CONFIG,
338 IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
339 IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
340 IFLA_BRIDGE_CFM_CC_RDI,
341 IFLA_BRIDGE_CFM_CC_CCM_TX,
342 IFLA_BRIDGE_CFM_MEP_CREATE_INFO,
343 IFLA_BRIDGE_CFM_MEP_CONFIG_INFO,
344 IFLA_BRIDGE_CFM_CC_CONFIG_INFO,
345 IFLA_BRIDGE_CFM_CC_RDI_INFO,
346 IFLA_BRIDGE_CFM_CC_CCM_TX_INFO,
347 IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO,
348 IFLA_BRIDGE_CFM_MEP_STATUS_INFO,
349 IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO,
350 __IFLA_BRIDGE_CFM_MAX,
351};
352
353#define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)
354
355enum {
356 IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
357 IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
358 IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
359 IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
360 IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
361 __IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
362};
363
364#define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)
365
366enum {
367 IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
368 IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
369 __IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
370};
371
372#define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)
373
374enum {
375 IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
376 IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
377 IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
378 IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
379 IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
380 __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
381};
382
383#define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)
384
385enum {
386 IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
387 IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
388 IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
389 IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
390 IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
391 __IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
392};
393
394#define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)
395
396enum {
397 IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
398 IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
399 IFLA_BRIDGE_CFM_CC_PEER_MEPID,
400 __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
401};
402
403#define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)
404
405enum {
406 IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
407 IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
408 IFLA_BRIDGE_CFM_CC_RDI_RDI,
409 __IFLA_BRIDGE_CFM_CC_RDI_MAX,
410};
411
412#define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)
413
414enum {
415 IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
416 IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
417 IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
418 IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
419 IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
420 IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
421 IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
422 IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
423 IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
424 __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
425};
426
427#define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)
428
429enum {
430 IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC,
431 IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
432 IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
433 IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
434 IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
435 __IFLA_BRIDGE_CFM_MEP_STATUS_MAX,
436};
437
438#define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1)
439
440enum {
441 IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC,
442 IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
443 IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
444 IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
445 IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI,
446 IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE,
447 IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE,
448 IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN,
449 IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN,
450 IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN,
451 __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX,
452};
453
454#define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
455
456struct bridge_stp_xstats {
457 __u64 transition_blk;
458 __u64 transition_fwd;
459 __u64 rx_bpdu;
460 __u64 tx_bpdu;
461 __u64 rx_tcn;
462 __u64 tx_tcn;
463};
464
465/* Bridge vlan RTM header */
466struct br_vlan_msg {
467 __u8 family;
468 __u8 reserved1;
469 __u16 reserved2;
470 __u32 ifindex;
471};
472
473enum {
474 BRIDGE_VLANDB_DUMP_UNSPEC,
475 BRIDGE_VLANDB_DUMP_FLAGS,
476 __BRIDGE_VLANDB_DUMP_MAX,
477};
478#define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
479
480/* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
481#define BRIDGE_VLANDB_DUMPF_STATS (1 << 0) /* Include stats in the dump */
482#define BRIDGE_VLANDB_DUMPF_GLOBAL (1 << 1) /* Dump global vlan options only */
483
484/* Bridge vlan RTM attributes
485 * [BRIDGE_VLANDB_ENTRY] = {
486 * [BRIDGE_VLANDB_ENTRY_INFO]
487 * ...
488 * }
489 * [BRIDGE_VLANDB_GLOBAL_OPTIONS] = {
490 * [BRIDGE_VLANDB_GOPTS_ID]
491 * ...
492 * }
493 */
494enum {
495 BRIDGE_VLANDB_UNSPEC,
496 BRIDGE_VLANDB_ENTRY,
497 BRIDGE_VLANDB_GLOBAL_OPTIONS,
498 __BRIDGE_VLANDB_MAX,
499};
500#define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
501
502enum {
503 BRIDGE_VLANDB_ENTRY_UNSPEC,
504 BRIDGE_VLANDB_ENTRY_INFO,
505 BRIDGE_VLANDB_ENTRY_RANGE,
506 BRIDGE_VLANDB_ENTRY_STATE,
507 BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
508 BRIDGE_VLANDB_ENTRY_STATS,
509 BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
510 __BRIDGE_VLANDB_ENTRY_MAX,
511};
512#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
513
514/* [BRIDGE_VLANDB_ENTRY] = {
515 * [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
516 * [BRIDGE_VLANDB_TINFO_ID]
517 * ...
518 * }
519 * }
520 */
521enum {
522 BRIDGE_VLANDB_TINFO_UNSPEC,
523 BRIDGE_VLANDB_TINFO_ID,
524 BRIDGE_VLANDB_TINFO_CMD,
525 __BRIDGE_VLANDB_TINFO_MAX,
526};
527#define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
528
529/* [BRIDGE_VLANDB_ENTRY] = {
530 * [BRIDGE_VLANDB_ENTRY_STATS] = {
531 * [BRIDGE_VLANDB_STATS_RX_BYTES]
532 * ...
533 * }
534 * ...
535 * }
536 */
537enum {
538 BRIDGE_VLANDB_STATS_UNSPEC,
539 BRIDGE_VLANDB_STATS_RX_BYTES,
540 BRIDGE_VLANDB_STATS_RX_PACKETS,
541 BRIDGE_VLANDB_STATS_TX_BYTES,
542 BRIDGE_VLANDB_STATS_TX_PACKETS,
543 BRIDGE_VLANDB_STATS_PAD,
544 __BRIDGE_VLANDB_STATS_MAX,
545};
546#define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
547
548enum {
549 BRIDGE_VLANDB_GOPTS_UNSPEC,
550 BRIDGE_VLANDB_GOPTS_ID,
551 BRIDGE_VLANDB_GOPTS_RANGE,
552 BRIDGE_VLANDB_GOPTS_MCAST_SNOOPING,
553 BRIDGE_VLANDB_GOPTS_MCAST_IGMP_VERSION,
554 BRIDGE_VLANDB_GOPTS_MCAST_MLD_VERSION,
555 BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_CNT,
556 BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_CNT,
557 BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_INTVL,
558 BRIDGE_VLANDB_GOPTS_PAD,
559 BRIDGE_VLANDB_GOPTS_MCAST_MEMBERSHIP_INTVL,
560 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_INTVL,
561 BRIDGE_VLANDB_GOPTS_MCAST_QUERY_INTVL,
562 BRIDGE_VLANDB_GOPTS_MCAST_QUERY_RESPONSE_INTVL,
563 BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_INTVL,
564 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,
565 BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,
566 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,
567 __BRIDGE_VLANDB_GOPTS_MAX
568};
569#define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
570
159/* Bridge multicast database attributes571/* Bridge multicast database attributes
160 * [MDBA_MDB] = {572 * [MDBA_MDB] = {
161 * [MDBA_MDB_ENTRY] = {573 * [MDBA_MDB_ENTRY] = {
...@@ -198,10 +610,33 @@ enum {...@@ -198,10 +610,33 @@ enum {
198enum {610enum {
199 MDBA_MDB_EATTR_UNSPEC,611 MDBA_MDB_EATTR_UNSPEC,
200 MDBA_MDB_EATTR_TIMER,612 MDBA_MDB_EATTR_TIMER,
613 MDBA_MDB_EATTR_SRC_LIST,
614 MDBA_MDB_EATTR_GROUP_MODE,
615 MDBA_MDB_EATTR_SOURCE,
616 MDBA_MDB_EATTR_RTPROT,
201 __MDBA_MDB_EATTR_MAX617 __MDBA_MDB_EATTR_MAX
202};618};
203#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)619#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
204620
621/* per mdb entry source */
622enum {
623 MDBA_MDB_SRCLIST_UNSPEC,
624 MDBA_MDB_SRCLIST_ENTRY,
625 __MDBA_MDB_SRCLIST_MAX
626};
627#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
628
629/* per mdb entry per source attributes
630 * these are embedded in MDBA_MDB_SRCLIST_ENTRY
631 */
632enum {
633 MDBA_MDB_SRCATTR_UNSPEC,
634 MDBA_MDB_SRCATTR_ADDRESS,
635 MDBA_MDB_SRCATTR_TIMER,
636 __MDBA_MDB_SRCATTR_MAX
637};
638#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
639
205/* multicast router types */640/* multicast router types */
206enum {641enum {
207 MDB_RTR_TYPE_DISABLED,642 MDB_RTR_TYPE_DISABLED,
...@@ -222,6 +657,9 @@ enum {...@@ -222,6 +657,9 @@ enum {
222 MDBA_ROUTER_PATTR_UNSPEC,657 MDBA_ROUTER_PATTR_UNSPEC,
223 MDBA_ROUTER_PATTR_TIMER,658 MDBA_ROUTER_PATTR_TIMER,
224 MDBA_ROUTER_PATTR_TYPE,659 MDBA_ROUTER_PATTR_TYPE,
660 MDBA_ROUTER_PATTR_INET_TIMER,
661 MDBA_ROUTER_PATTR_INET6_TIMER,
662 MDBA_ROUTER_PATTR_VID,
225 __MDBA_ROUTER_PATTR_MAX663 __MDBA_ROUTER_PATTR_MAX
226};664};
227#define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)665#define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
...@@ -237,12 +675,16 @@ struct br_mdb_entry {...@@ -237,12 +675,16 @@ struct br_mdb_entry {
237#define MDB_PERMANENT 1675#define MDB_PERMANENT 1
238 __u8 state;676 __u8 state;
239#define MDB_FLAGS_OFFLOAD (1 << 0)677#define MDB_FLAGS_OFFLOAD (1 << 0)
678#define MDB_FLAGS_FAST_LEAVE (1 << 1)
679#define MDB_FLAGS_STAR_EXCL (1 << 2)
680#define MDB_FLAGS_BLOCKED (1 << 3)
240 __u8 flags;681 __u8 flags;
241 __u16 vid;682 __u16 vid;
242 struct {683 struct {
243 union {684 union {
244 __be32 ip4;685 __be32 ip4;
245 struct in6_addr ip6;686 struct in6_addr ip6;
687 unsigned char mac_addr[ETH_ALEN];
246 } u;688 } u;
247 __be16 proto;689 __be16 proto;
248 } addr;690 } addr;
...@@ -251,16 +693,30 @@ struct br_mdb_entry {...@@ -251,16 +693,30 @@ struct br_mdb_entry {
251enum {693enum {
252 MDBA_SET_ENTRY_UNSPEC,694 MDBA_SET_ENTRY_UNSPEC,
253 MDBA_SET_ENTRY,695 MDBA_SET_ENTRY,
696 MDBA_SET_ENTRY_ATTRS,
254 __MDBA_SET_ENTRY_MAX,697 __MDBA_SET_ENTRY_MAX,
255};698};
256#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)699#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
257700
701/* [MDBA_SET_ENTRY_ATTRS] = {
702 * [MDBE_ATTR_xxx]
703 * ...
704 * }
705 */
706enum {
707 MDBE_ATTR_UNSPEC,
708 MDBE_ATTR_SOURCE,
709 __MDBE_ATTR_MAX,
710};
711#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
712
258/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */713/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
259enum {714enum {
260 BRIDGE_XSTATS_UNSPEC,715 BRIDGE_XSTATS_UNSPEC,
261 BRIDGE_XSTATS_VLAN,716 BRIDGE_XSTATS_VLAN,
262 BRIDGE_XSTATS_MCAST,717 BRIDGE_XSTATS_MCAST,
263 BRIDGE_XSTATS_PAD,718 BRIDGE_XSTATS_PAD,
719 BRIDGE_XSTATS_STP,
264 __BRIDGE_XSTATS_MAX720 __BRIDGE_XSTATS_MAX
265};721};
266#define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)722#define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
...@@ -292,4 +748,40 @@ struct br_mcast_stats {...@@ -292,4 +748,40 @@ struct br_mcast_stats {
292 __u64 mcast_bytes[BR_MCAST_DIR_SIZE];748 __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
293 __u64 mcast_packets[BR_MCAST_DIR_SIZE];749 __u64 mcast_packets[BR_MCAST_DIR_SIZE];
294};750};
751
752/* bridge boolean options
753 * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
754 * BR_BOOLOPT_MCAST_VLAN_SNOOPING - control vlan multicast snooping
755 *
756 * IMPORTANT: if adding a new option do not forget to handle
757 * it in br_boolopt_toggle/get and bridge sysfs
758 */
759enum br_boolopt_id {
760 BR_BOOLOPT_NO_LL_LEARN,
761 BR_BOOLOPT_MCAST_VLAN_SNOOPING,
762 BR_BOOLOPT_MAX
763};
764
765/* struct br_boolopt_multi - change multiple bridge boolean options
766 *
767 * @optval: new option values (bit per option)
768 * @optmask: options to change (bit per option)
769 */
770struct br_boolopt_multi {
771 __u32 optval;
772 __u32 optmask;
773};
774
775enum {
776 BRIDGE_QUERIER_UNSPEC,
777 BRIDGE_QUERIER_IP_ADDRESS,
778 BRIDGE_QUERIER_IP_PORT,
779 BRIDGE_QUERIER_IP_OTHER_TIMER,
780 BRIDGE_QUERIER_PAD,
781 BRIDGE_QUERIER_IPV6_ADDRESS,
782 BRIDGE_QUERIER_IPV6_PORT,
783 BRIDGE_QUERIER_IPV6_OTHER_TIMER,
784 __BRIDGE_QUERIER_MAX
785};
786#define BRIDGE_QUERIER_MAX (__BRIDGE_QUERIER_MAX - 1)
295#endif /* _LINUX_IF_BRIDGE_H */787#endif /* _LINUX_IF_BRIDGE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_ether.h+8
...@@ -86,17 +86,21 @@...@@ -86,17 +86,21 @@
86 * over Ethernet86 * over Ethernet
87 */87 */
88#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */88#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
89#define ETH_P_REALTEK 0x8899 /* Multiple proprietary protocols */
89#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */90#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
90#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */91#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
91#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */92#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
92#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */93#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */
93#define ETH_P_TIPC 0x88CA /* TIPC */94#define ETH_P_TIPC 0x88CA /* TIPC */
95#define ETH_P_LLDP 0x88CC /* Link Layer Discovery Protocol */
96#define ETH_P_MRP 0x88E3 /* Media Redundancy Protocol */
94#define ETH_P_MACSEC 0x88E5 /* 802.1ae MACsec */97#define ETH_P_MACSEC 0x88E5 /* 802.1ae MACsec */
95#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */98#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
96#define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */99#define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */
97#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */100#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
98#define ETH_P_NCSI 0x88F8 /* NCSI protocol */101#define ETH_P_NCSI 0x88F8 /* NCSI protocol */
99#define ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */102#define ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */
103#define ETH_P_CFM 0x8902 /* Connectivity Fault Management */
100#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */104#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
101#define ETH_P_IBOE 0x8915 /* Infiniband over Ethernet */105#define ETH_P_IBOE 0x8915 /* Infiniband over Ethernet */
102#define ETH_P_TDLS 0x890D /* TDLS */106#define ETH_P_TDLS 0x890D /* TDLS */
...@@ -109,6 +113,7 @@...@@ -109,6 +113,7 @@
109#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */113#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
110#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */114#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
111#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */115#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
116#define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
112#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */117#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */
113#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */118#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
114119
...@@ -147,6 +152,9 @@...@@ -147,6 +152,9 @@
147#define ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and152#define ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and
148 * aggregation protocol153 * aggregation protocol
149 */154 */
155#define ETH_P_MCTP 0x00FA /* Management component transport
156 * protocol packets
157 */
150158
151/*159/*
152 * This is an Ethernet frame header.160 * This is an Ethernet frame header.
lib/libc/include/any-linux-any/linux/if_fddi.h+18-3
...@@ -6,9 +6,10 @@...@@ -6,9 +6,10 @@
6 *6 *
7 * Global definitions for the ANSI FDDI interface.7 * Global definitions for the ANSI FDDI interface.
8 *8 *
9 * Version: @(#)if_fddi.h 1.0.2 Sep 29 20049 * Version: @(#)if_fddi.h 1.0.3 Oct 6 2018
10 *10 *
11 * Author: Lawrence V. Stefani, <stefani@lkg.dec.com>11 * Author: Lawrence V. Stefani, <stefani@yahoo.com>
12 * Maintainer: Maciej W. Rozycki, <macro@orcam.me.uk>
12 *13 *
13 * if_fddi.h is based on previous if_ether.h and if_tr.h work by14 * if_fddi.h is based on previous if_ether.h and if_tr.h work by
14 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>15 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
...@@ -45,7 +46,21 @@...@@ -45,7 +46,21 @@
45#define FDDI_K_OUI_LEN 3 /* Octets in OUI in 802.2 SNAP46#define FDDI_K_OUI_LEN 3 /* Octets in OUI in 802.2 SNAP
46 header */47 header */
4748
48/* Define FDDI Frame Control (FC) Byte values */49/* Define FDDI Frame Control (FC) Byte masks */
50#define FDDI_FC_K_CLASS_MASK 0x80 /* class bit */
51#define FDDI_FC_K_CLASS_SYNC 0x80
52#define FDDI_FC_K_CLASS_ASYNC 0x00
53#define FDDI_FC_K_ALEN_MASK 0x40 /* address length bit */
54#define FDDI_FC_K_ALEN_48 0x40
55#define FDDI_FC_K_ALEN_16 0x00
56#define FDDI_FC_K_FORMAT_MASK 0x30 /* format bits */
57#define FDDI_FC_K_FORMAT_FUTURE 0x30
58#define FDDI_FC_K_FORMAT_IMPLEMENTOR 0x20
59#define FDDI_FC_K_FORMAT_LLC 0x10
60#define FDDI_FC_K_FORMAT_MANAGEMENT 0x00
61#define FDDI_FC_K_CONTROL_MASK 0x0f /* control bits */
62
63/* Define FDDI Frame Control (FC) Byte specific values */
49#define FDDI_FC_K_VOID 0x0064#define FDDI_FC_K_VOID 0x00
50#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x8065#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
51#define FDDI_FC_K_RESTRICTED_TOKEN 0xC066#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
lib/libc/include/any-linux-any/linux/if_frad.h deleted-123
...@@ -1,123 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are
4 * created for each DLCI associated with a FRAD. The FRAD driver
5 * is not truly a network device, but the lower level device
6 * handler. This allows other FRAD manufacturers to use the DLCI
7 * code, including its RFC1490 encapsulation alongside the current
8 * implementation for the Sangoma cards.
9 *
10 * Version: @(#)if_ifrad.h 0.15 31 Mar 96
11 *
12 * Author: Mike McLagan <mike.mclagan@linux.org>
13 *
14 * Changes:
15 * 0.15 Mike McLagan changed structure defs (packed)
16 * re-arranged flags
17 * added DLCI_RET vars
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24
25#ifndef _FRAD_H_
26#define _FRAD_H_
27
28#include <linux/if.h>
29
30/* Structures and constants associated with the DLCI device driver */
31
32struct dlci_add
33{
34 char devname[IFNAMSIZ];
35 short dlci;
36};
37
38#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
39#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
40
41/*
42 * These are related to the Sangoma SDLA and should remain in order.
43 * Code within the SDLA module is based on the specifics of this
44 * structure. Change at your own peril.
45 */
46struct dlci_conf {
47 short flags;
48 short CIR_fwd;
49 short Bc_fwd;
50 short Be_fwd;
51 short CIR_bwd;
52 short Bc_bwd;
53 short Be_bwd;
54
55/* these are part of the status read */
56 short Tc_fwd;
57 short Tc_bwd;
58 short Tf_max;
59 short Tb_max;
60
61/* add any new fields here above is a mirror of sdla_dlci_conf */
62};
63
64#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
65
66/* configuration flags for DLCI */
67#define DLCI_IGNORE_CIR_OUT 0x0001
68#define DLCI_ACCOUNT_CIR_IN 0x0002
69#define DLCI_BUFFER_IF 0x0008
70
71#define DLCI_VALID_FLAGS 0x000B
72
73/* defines for the actual Frame Relay hardware */
74#define FRAD_GET_CONF (SIOCDEVPRIVATE)
75#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
76
77#define FRAD_LAST_IOCTL FRAD_SET_CONF
78
79/*
80 * Based on the setup for the Sangoma SDLA. If changes are
81 * necessary to this structure, a routine will need to be
82 * added to that module to copy fields.
83 */
84struct frad_conf
85{
86 short station;
87 short flags;
88 short kbaud;
89 short clocking;
90 short mtu;
91 short T391;
92 short T392;
93 short N391;
94 short N392;
95 short N393;
96 short CIR_fwd;
97 short Bc_fwd;
98 short Be_fwd;
99 short CIR_bwd;
100 short Bc_bwd;
101 short Be_bwd;
102
103/* Add new fields here, above is a mirror of the sdla_conf */
104
105};
106
107#define FRAD_STATION_CPE 0x0000
108#define FRAD_STATION_NODE 0x0001
109
110#define FRAD_TX_IGNORE_CIR 0x0001
111#define FRAD_RX_ACCOUNT_CIR 0x0002
112#define FRAD_DROP_ABORTED 0x0004
113#define FRAD_BUFFERIF 0x0008
114#define FRAD_STATS 0x0010
115#define FRAD_MCI 0x0100
116#define FRAD_AUTODLCI 0x8000
117#define FRAD_VALID_FLAGS 0x811F
118
119#define FRAD_CLOCK_INT 0x0001
120#define FRAD_CLOCK_EXT 0x0000
121
122
123#endif /* _FRAD_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_link.h+309-35
...@@ -7,24 +7,23 @@...@@ -7,24 +7,23 @@
77
8/* This struct should be in sync with struct rtnl_link_stats64 */8/* This struct should be in sync with struct rtnl_link_stats64 */
9struct rtnl_link_stats {9struct rtnl_link_stats {
10 __u32 rx_packets; /* total packets received */10 __u32 rx_packets;
11 __u32 tx_packets; /* total packets transmitted */11 __u32 tx_packets;
12 __u32 rx_bytes; /* total bytes received */12 __u32 rx_bytes;
13 __u32 tx_bytes; /* total bytes transmitted */13 __u32 tx_bytes;
14 __u32 rx_errors; /* bad packets received */14 __u32 rx_errors;
15 __u32 tx_errors; /* packet transmit problems */15 __u32 tx_errors;
16 __u32 rx_dropped; /* no space in linux buffers */16 __u32 rx_dropped;
17 __u32 tx_dropped; /* no space available in linux */17 __u32 tx_dropped;
18 __u32 multicast; /* multicast packets received */18 __u32 multicast;
19 __u32 collisions;19 __u32 collisions;
20
21 /* detailed rx_errors: */20 /* detailed rx_errors: */
22 __u32 rx_length_errors;21 __u32 rx_length_errors;
23 __u32 rx_over_errors; /* receiver ring buff overflow */22 __u32 rx_over_errors;
24 __u32 rx_crc_errors; /* recved pkt with crc error */23 __u32 rx_crc_errors;
25 __u32 rx_frame_errors; /* recv'd frame alignment error */24 __u32 rx_frame_errors;
26 __u32 rx_fifo_errors; /* recv'r fifo overrun */25 __u32 rx_fifo_errors;
27 __u32 rx_missed_errors; /* receiver missed packet */26 __u32 rx_missed_errors;
2827
29 /* detailed tx_errors */28 /* detailed tx_errors */
30 __u32 tx_aborted_errors;29 __u32 tx_aborted_errors;
...@@ -37,29 +36,201 @@ struct rtnl_link_stats {...@@ -37,29 +36,201 @@ struct rtnl_link_stats {
37 __u32 rx_compressed;36 __u32 rx_compressed;
38 __u32 tx_compressed;37 __u32 tx_compressed;
3938
40 __u32 rx_nohandler; /* dropped, no handler found */39 __u32 rx_nohandler;
41};40};
4241
43/* The main device statistics structure */42/**
43 * struct rtnl_link_stats64 - The main device statistics structure.
44 *
45 * @rx_packets: Number of good packets received by the interface.
46 * For hardware interfaces counts all good packets received from the device
47 * by the host, including packets which host had to drop at various stages
48 * of processing (even in the driver).
49 *
50 * @tx_packets: Number of packets successfully transmitted.
51 * For hardware interfaces counts packets which host was able to successfully
52 * hand over to the device, which does not necessarily mean that packets
53 * had been successfully transmitted out of the device, only that device
54 * acknowledged it copied them out of host memory.
55 *
56 * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
57 *
58 * For IEEE 802.3 devices should count the length of Ethernet Frames
59 * excluding the FCS.
60 *
61 * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
62 *
63 * For IEEE 802.3 devices should count the length of Ethernet Frames
64 * excluding the FCS.
65 *
66 * @rx_errors: Total number of bad packets received on this network device.
67 * This counter must include events counted by @rx_length_errors,
68 * @rx_crc_errors, @rx_frame_errors and other errors not otherwise
69 * counted.
70 *
71 * @tx_errors: Total number of transmit problems.
72 * This counter must include events counter by @tx_aborted_errors,
73 * @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
74 * @tx_window_errors and other errors not otherwise counted.
75 *
76 * @rx_dropped: Number of packets received but not processed,
77 * e.g. due to lack of resources or unsupported protocol.
78 * For hardware interfaces this counter may include packets discarded
79 * due to L2 address filtering but should not include packets dropped
80 * by the device due to buffer exhaustion which are counted separately in
81 * @rx_missed_errors (since procfs folds those two counters together).
82 *
83 * @tx_dropped: Number of packets dropped on their way to transmission,
84 * e.g. due to lack of resources.
85 *
86 * @multicast: Multicast packets received.
87 * For hardware interfaces this statistic is commonly calculated
88 * at the device level (unlike @rx_packets) and therefore may include
89 * packets which did not reach the host.
90 *
91 * For IEEE 802.3 devices this counter may be equivalent to:
92 *
93 * - 30.3.1.1.21 aMulticastFramesReceivedOK
94 *
95 * @collisions: Number of collisions during packet transmissions.
96 *
97 * @rx_length_errors: Number of packets dropped due to invalid length.
98 * Part of aggregate "frame" errors in `/proc/net/dev`.
99 *
100 * For IEEE 802.3 devices this counter should be equivalent to a sum
101 * of the following attributes:
102 *
103 * - 30.3.1.1.23 aInRangeLengthErrors
104 * - 30.3.1.1.24 aOutOfRangeLengthField
105 * - 30.3.1.1.25 aFrameTooLongErrors
106 *
107 * @rx_over_errors: Receiver FIFO overflow event counter.
108 *
109 * Historically the count of overflow events. Such events may be
110 * reported in the receive descriptors or via interrupts, and may
111 * not correspond one-to-one with dropped packets.
112 *
113 * The recommended interpretation for high speed interfaces is -
114 * number of packets dropped because they did not fit into buffers
115 * provided by the host, e.g. packets larger than MTU or next buffer
116 * in the ring was not available for a scatter transfer.
117 *
118 * Part of aggregate "frame" errors in `/proc/net/dev`.
119 *
120 * This statistics was historically used interchangeably with
121 * @rx_fifo_errors.
122 *
123 * This statistic corresponds to hardware events and is not commonly used
124 * on software devices.
125 *
126 * @rx_crc_errors: Number of packets received with a CRC error.
127 * Part of aggregate "frame" errors in `/proc/net/dev`.
128 *
129 * For IEEE 802.3 devices this counter must be equivalent to:
130 *
131 * - 30.3.1.1.6 aFrameCheckSequenceErrors
132 *
133 * @rx_frame_errors: Receiver frame alignment errors.
134 * Part of aggregate "frame" errors in `/proc/net/dev`.
135 *
136 * For IEEE 802.3 devices this counter should be equivalent to:
137 *
138 * - 30.3.1.1.7 aAlignmentErrors
139 *
140 * @rx_fifo_errors: Receiver FIFO error counter.
141 *
142 * Historically the count of overflow events. Those events may be
143 * reported in the receive descriptors or via interrupts, and may
144 * not correspond one-to-one with dropped packets.
145 *
146 * This statistics was used interchangeably with @rx_over_errors.
147 * Not recommended for use in drivers for high speed interfaces.
148 *
149 * This statistic is used on software devices, e.g. to count software
150 * packet queue overflow (can) or sequencing errors (GRE).
151 *
152 * @rx_missed_errors: Count of packets missed by the host.
153 * Folded into the "drop" counter in `/proc/net/dev`.
154 *
155 * Counts number of packets dropped by the device due to lack
156 * of buffer space. This usually indicates that the host interface
157 * is slower than the network interface, or host is not keeping up
158 * with the receive packet rate.
159 *
160 * This statistic corresponds to hardware events and is not used
161 * on software devices.
162 *
163 * @tx_aborted_errors:
164 * Part of aggregate "carrier" errors in `/proc/net/dev`.
165 * For IEEE 802.3 devices capable of half-duplex operation this counter
166 * must be equivalent to:
167 *
168 * - 30.3.1.1.11 aFramesAbortedDueToXSColls
169 *
170 * High speed interfaces may use this counter as a general device
171 * discard counter.
172 *
173 * @tx_carrier_errors: Number of frame transmission errors due to loss
174 * of carrier during transmission.
175 * Part of aggregate "carrier" errors in `/proc/net/dev`.
176 *
177 * For IEEE 802.3 devices this counter must be equivalent to:
178 *
179 * - 30.3.1.1.13 aCarrierSenseErrors
180 *
181 * @tx_fifo_errors: Number of frame transmission errors due to device
182 * FIFO underrun / underflow. This condition occurs when the device
183 * begins transmission of a frame but is unable to deliver the
184 * entire frame to the transmitter in time for transmission.
185 * Part of aggregate "carrier" errors in `/proc/net/dev`.
186 *
187 * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
188 * old half-duplex Ethernet.
189 * Part of aggregate "carrier" errors in `/proc/net/dev`.
190 *
191 * For IEEE 802.3 devices possibly equivalent to:
192 *
193 * - 30.3.2.1.4 aSQETestErrors
194 *
195 * @tx_window_errors: Number of frame transmission errors due
196 * to late collisions (for Ethernet - after the first 64B of transmission).
197 * Part of aggregate "carrier" errors in `/proc/net/dev`.
198 *
199 * For IEEE 802.3 devices this counter must be equivalent to:
200 *
201 * - 30.3.1.1.10 aLateCollisions
202 *
203 * @rx_compressed: Number of correctly received compressed packets.
204 * This counters is only meaningful for interfaces which support
205 * packet compression (e.g. CSLIP, PPP).
206 *
207 * @tx_compressed: Number of transmitted compressed packets.
208 * This counters is only meaningful for interfaces which support
209 * packet compression (e.g. CSLIP, PPP).
210 *
211 * @rx_nohandler: Number of packets received on the interface
212 * but dropped by the networking stack because the device is
213 * not designated to receive packets (e.g. backup link in a bond).
214 */
44struct rtnl_link_stats64 {215struct rtnl_link_stats64 {
45 __u64 rx_packets; /* total packets received */216 __u64 rx_packets;
46 __u64 tx_packets; /* total packets transmitted */217 __u64 tx_packets;
47 __u64 rx_bytes; /* total bytes received */218 __u64 rx_bytes;
48 __u64 tx_bytes; /* total bytes transmitted */219 __u64 tx_bytes;
49 __u64 rx_errors; /* bad packets received */220 __u64 rx_errors;
50 __u64 tx_errors; /* packet transmit problems */221 __u64 tx_errors;
51 __u64 rx_dropped; /* no space in linux buffers */222 __u64 rx_dropped;
52 __u64 tx_dropped; /* no space available in linux */223 __u64 tx_dropped;
53 __u64 multicast; /* multicast packets received */224 __u64 multicast;
54 __u64 collisions;225 __u64 collisions;
55226
56 /* detailed rx_errors: */227 /* detailed rx_errors: */
57 __u64 rx_length_errors;228 __u64 rx_length_errors;
58 __u64 rx_over_errors; /* receiver ring buff overflow */229 __u64 rx_over_errors;
59 __u64 rx_crc_errors; /* recved pkt with crc error */230 __u64 rx_crc_errors;
60 __u64 rx_frame_errors; /* recv'd frame alignment error */231 __u64 rx_frame_errors;
61 __u64 rx_fifo_errors; /* recv'r fifo overrun */232 __u64 rx_fifo_errors;
62 __u64 rx_missed_errors; /* receiver missed packet */233 __u64 rx_missed_errors;
63234
64 /* detailed tx_errors */235 /* detailed tx_errors */
65 __u64 tx_aborted_errors;236 __u64 tx_aborted_errors;
...@@ -71,8 +242,7 @@ struct rtnl_link_stats64 {...@@ -71,8 +242,7 @@ struct rtnl_link_stats64 {
71 /* for cslip etc */242 /* for cslip etc */
72 __u64 rx_compressed;243 __u64 rx_compressed;
73 __u64 tx_compressed;244 __u64 tx_compressed;
74245 __u64 rx_nohandler;
75 __u64 rx_nohandler; /* dropped, no handler found */
76};246};
77247
78/* The struct should be in sync with struct ifmap */248/* The struct should be in sync with struct ifmap */
...@@ -161,17 +331,38 @@ enum {...@@ -161,17 +331,38 @@ enum {
161 IFLA_EVENT,331 IFLA_EVENT,
162 IFLA_NEW_NETNSID,332 IFLA_NEW_NETNSID,
163 IFLA_IF_NETNSID,333 IFLA_IF_NETNSID,
334 IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, /* new alias */
164 IFLA_CARRIER_UP_COUNT,335 IFLA_CARRIER_UP_COUNT,
165 IFLA_CARRIER_DOWN_COUNT,336 IFLA_CARRIER_DOWN_COUNT,
166 IFLA_NEW_IFINDEX,337 IFLA_NEW_IFINDEX,
167 IFLA_MIN_MTU,338 IFLA_MIN_MTU,
168 IFLA_MAX_MTU,339 IFLA_MAX_MTU,
340 IFLA_PROP_LIST,
341 IFLA_ALT_IFNAME, /* Alternative ifname */
342 IFLA_PERM_ADDRESS,
343 IFLA_PROTO_DOWN_REASON,
344
345 /* device (sysfs) name as parent, used instead
346 * of IFLA_LINK where there's no parent netdev
347 */
348 IFLA_PARENT_DEV_NAME,
349 IFLA_PARENT_DEV_BUS_NAME,
350
169 __IFLA_MAX351 __IFLA_MAX
170};352};
171353
172354
173#define IFLA_MAX (__IFLA_MAX - 1)355#define IFLA_MAX (__IFLA_MAX - 1)
174356
357enum {
358 IFLA_PROTO_DOWN_REASON_UNSPEC,
359 IFLA_PROTO_DOWN_REASON_MASK, /* u32, mask for reason bits */
360 IFLA_PROTO_DOWN_REASON_VALUE, /* u32, reason bit value */
361
362 __IFLA_PROTO_DOWN_REASON_CNT,
363 IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
364};
365
175/* backwards compatibility for userspace */366/* backwards compatibility for userspace */
176#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))367#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
177#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))368#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
...@@ -224,6 +415,7 @@ enum {...@@ -224,6 +415,7 @@ enum {
224 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */415 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
225 IFLA_INET6_TOKEN, /* device token */416 IFLA_INET6_TOKEN, /* device token */
226 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */417 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
418 IFLA_INET6_RA_MTU, /* mtu carried in the RA message */
227 __IFLA_INET6_MAX419 __IFLA_INET6_MAX
228};420};
229421
...@@ -284,6 +476,9 @@ enum {...@@ -284,6 +476,9 @@ enum {
284 IFLA_BR_MCAST_STATS_ENABLED,476 IFLA_BR_MCAST_STATS_ENABLED,
285 IFLA_BR_MCAST_IGMP_VERSION,477 IFLA_BR_MCAST_IGMP_VERSION,
286 IFLA_BR_MCAST_MLD_VERSION,478 IFLA_BR_MCAST_MLD_VERSION,
479 IFLA_BR_VLAN_STATS_PER_PORT,
480 IFLA_BR_MULTI_BOOLOPT,
481 IFLA_BR_MCAST_QUERIER_STATE,
287 __IFLA_BR_MAX,482 __IFLA_BR_MAX,
288};483};
289484
...@@ -335,6 +530,10 @@ enum {...@@ -335,6 +530,10 @@ enum {
335 IFLA_BRPORT_NEIGH_SUPPRESS,530 IFLA_BRPORT_NEIGH_SUPPRESS,
336 IFLA_BRPORT_ISOLATED,531 IFLA_BRPORT_ISOLATED,
337 IFLA_BRPORT_BACKUP_PORT,532 IFLA_BRPORT_BACKUP_PORT,
533 IFLA_BRPORT_MRP_RING_OPEN,
534 IFLA_BRPORT_MRP_IN_OPEN,
535 IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
536 IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
338 __IFLA_BRPORT_MAX537 __IFLA_BRPORT_MAX
339};538};
340#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)539#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
...@@ -399,6 +598,8 @@ enum {...@@ -399,6 +598,8 @@ enum {
399 IFLA_MACVLAN_MACADDR,598 IFLA_MACVLAN_MACADDR,
400 IFLA_MACVLAN_MACADDR_DATA,599 IFLA_MACVLAN_MACADDR_DATA,
401 IFLA_MACVLAN_MACADDR_COUNT,600 IFLA_MACVLAN_MACADDR_COUNT,
601 IFLA_MACVLAN_BC_QUEUE_LEN,
602 IFLA_MACVLAN_BC_QUEUE_LEN_USED,
402 __IFLA_MACVLAN_MAX,603 __IFLA_MACVLAN_MAX,
403};604};
404605
...@@ -420,6 +621,7 @@ enum macvlan_macaddr_mode {...@@ -420,6 +621,7 @@ enum macvlan_macaddr_mode {
420};621};
421622
422#define MACVLAN_FLAG_NOPROMISC 1623#define MACVLAN_FLAG_NOPROMISC 1
624#define MACVLAN_FLAG_NODST 2 /* skip dst macvlan if matching src macvlan */
423625
424/* VRF section */626/* VRF section */
425enum {627enum {
...@@ -455,6 +657,7 @@ enum {...@@ -455,6 +657,7 @@ enum {
455 IFLA_MACSEC_REPLAY_PROTECT,657 IFLA_MACSEC_REPLAY_PROTECT,
456 IFLA_MACSEC_VALIDATION,658 IFLA_MACSEC_VALIDATION,
457 IFLA_MACSEC_PAD,659 IFLA_MACSEC_PAD,
660 IFLA_MACSEC_OFFLOAD,
458 __IFLA_MACSEC_MAX,661 __IFLA_MACSEC_MAX,
459};662};
460663
...@@ -478,6 +681,14 @@ enum macsec_validation_type {...@@ -478,6 +681,14 @@ enum macsec_validation_type {
478 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,681 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
479};682};
480683
684enum macsec_offload {
685 MACSEC_OFFLOAD_OFF = 0,
686 MACSEC_OFFLOAD_PHY = 1,
687 MACSEC_OFFLOAD_MAC = 2,
688 __MACSEC_OFFLOAD_END,
689 MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
690};
691
481/* IPVLAN section */692/* IPVLAN section */
482enum {693enum {
483 IFLA_IPVLAN_UNSPEC,694 IFLA_IPVLAN_UNSPEC,
...@@ -529,6 +740,7 @@ enum {...@@ -529,6 +740,7 @@ enum {
529 IFLA_VXLAN_LABEL,740 IFLA_VXLAN_LABEL,
530 IFLA_VXLAN_GPE,741 IFLA_VXLAN_GPE,
531 IFLA_VXLAN_TTL_INHERIT,742 IFLA_VXLAN_TTL_INHERIT,
743 IFLA_VXLAN_DF,
532 __IFLA_VXLAN_MAX744 __IFLA_VXLAN_MAX
533};745};
534#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)746#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
...@@ -538,6 +750,14 @@ struct ifla_vxlan_port_range {...@@ -538,6 +750,14 @@ struct ifla_vxlan_port_range {
538 __be16 high;750 __be16 high;
539};751};
540752
753enum ifla_vxlan_df {
754 VXLAN_DF_UNSET = 0,
755 VXLAN_DF_SET,
756 VXLAN_DF_INHERIT,
757 __VXLAN_DF_END,
758 VXLAN_DF_MAX = __VXLAN_DF_END - 1,
759};
760
541/* GENEVE section */761/* GENEVE section */
542enum {762enum {
543 IFLA_GENEVE_UNSPEC,763 IFLA_GENEVE_UNSPEC,
...@@ -552,10 +772,32 @@ enum {...@@ -552,10 +772,32 @@ enum {
552 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,772 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
553 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,773 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
554 IFLA_GENEVE_LABEL,774 IFLA_GENEVE_LABEL,
775 IFLA_GENEVE_TTL_INHERIT,
776 IFLA_GENEVE_DF,
555 __IFLA_GENEVE_MAX777 __IFLA_GENEVE_MAX
556};778};
557#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)779#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
558780
781enum ifla_geneve_df {
782 GENEVE_DF_UNSET = 0,
783 GENEVE_DF_SET,
784 GENEVE_DF_INHERIT,
785 __GENEVE_DF_END,
786 GENEVE_DF_MAX = __GENEVE_DF_END - 1,
787};
788
789/* Bareudp section */
790enum {
791 IFLA_BAREUDP_UNSPEC,
792 IFLA_BAREUDP_PORT,
793 IFLA_BAREUDP_ETHERTYPE,
794 IFLA_BAREUDP_SRCPORT_MIN,
795 IFLA_BAREUDP_MULTIPROTO_MODE,
796 __IFLA_BAREUDP_MAX
797};
798
799#define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
800
559/* PPP section */801/* PPP section */
560enum {802enum {
561 IFLA_PPP_UNSPEC,803 IFLA_PPP_UNSPEC,
...@@ -612,6 +854,8 @@ enum {...@@ -612,6 +854,8 @@ enum {
612 IFLA_BOND_AD_USER_PORT_KEY,854 IFLA_BOND_AD_USER_PORT_KEY,
613 IFLA_BOND_AD_ACTOR_SYSTEM,855 IFLA_BOND_AD_ACTOR_SYSTEM,
614 IFLA_BOND_TLB_DYNAMIC_LB,856 IFLA_BOND_TLB_DYNAMIC_LB,
857 IFLA_BOND_PEER_NOTIF_DELAY,
858 IFLA_BOND_AD_LACP_ACTIVE,
615 __IFLA_BOND_MAX,859 __IFLA_BOND_MAX,
616};860};
617861
...@@ -670,6 +914,7 @@ enum {...@@ -670,6 +914,7 @@ enum {
670 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */914 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
671 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */915 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
672 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */916 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
917 IFLA_VF_BROADCAST, /* VF broadcast */
673 __IFLA_VF_MAX,918 __IFLA_VF_MAX,
674};919};
675920
...@@ -680,6 +925,10 @@ struct ifla_vf_mac {...@@ -680,6 +925,10 @@ struct ifla_vf_mac {
680 __u8 mac[32]; /* MAX_ADDR_LEN */925 __u8 mac[32]; /* MAX_ADDR_LEN */
681};926};
682927
928struct ifla_vf_broadcast {
929 __u8 broadcast[32];
930};
931
683struct ifla_vf_vlan {932struct ifla_vf_vlan {
684 __u32 vf;933 __u32 vf;
685 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */934 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
...@@ -851,7 +1100,14 @@ enum {...@@ -851,7 +1100,14 @@ enum {
851#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)1100#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
8521101
8531102
854/* HSR section */1103/* HSR/PRP section, both uses same interface */
1104
1105/* Different redundancy protocols for hsr device */
1106enum {
1107 HSR_PROTOCOL_HSR,
1108 HSR_PROTOCOL_PRP,
1109 HSR_PROTOCOL_MAX,
1110};
8551111
856enum {1112enum {
857 IFLA_HSR_UNSPEC,1113 IFLA_HSR_UNSPEC,
...@@ -861,6 +1117,9 @@ enum {...@@ -861,6 +1117,9 @@ enum {
861 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */1117 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
862 IFLA_HSR_SEQ_NR,1118 IFLA_HSR_SEQ_NR,
863 IFLA_HSR_VERSION, /* HSR version */1119 IFLA_HSR_VERSION, /* HSR version */
1120 IFLA_HSR_PROTOCOL, /* Indicate different protocol than
1121 * HSR. For example PRP.
1122 */
864 __IFLA_HSR_MAX,1123 __IFLA_HSR_MAX,
865};1124};
8661125
...@@ -901,6 +1160,7 @@ enum {...@@ -901,6 +1160,7 @@ enum {
901enum {1160enum {
902 LINK_XSTATS_TYPE_UNSPEC,1161 LINK_XSTATS_TYPE_UNSPEC,
903 LINK_XSTATS_TYPE_BRIDGE,1162 LINK_XSTATS_TYPE_BRIDGE,
1163 LINK_XSTATS_TYPE_BOND,
904 __LINK_XSTATS_TYPE_MAX1164 __LINK_XSTATS_TYPE_MAX
905};1165};
906#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)1166#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
...@@ -919,11 +1179,12 @@ enum {...@@ -919,11 +1179,12 @@ enum {
919#define XDP_FLAGS_SKB_MODE (1U << 1)1179#define XDP_FLAGS_SKB_MODE (1U << 1)
920#define XDP_FLAGS_DRV_MODE (1U << 2)1180#define XDP_FLAGS_DRV_MODE (1U << 2)
921#define XDP_FLAGS_HW_MODE (1U << 3)1181#define XDP_FLAGS_HW_MODE (1U << 3)
1182#define XDP_FLAGS_REPLACE (1U << 4)
922#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \1183#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
923 XDP_FLAGS_DRV_MODE | \1184 XDP_FLAGS_DRV_MODE | \
924 XDP_FLAGS_HW_MODE)1185 XDP_FLAGS_HW_MODE)
925#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \1186#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
926 XDP_FLAGS_MODES)1187 XDP_FLAGS_MODES | XDP_FLAGS_REPLACE)
9271188
928/* These are stored into IFLA_XDP_ATTACHED on dump. */1189/* These are stored into IFLA_XDP_ATTACHED on dump. */
929enum {1190enum {
...@@ -943,6 +1204,7 @@ enum {...@@ -943,6 +1204,7 @@ enum {
943 IFLA_XDP_DRV_PROG_ID,1204 IFLA_XDP_DRV_PROG_ID,
944 IFLA_XDP_SKB_PROG_ID,1205 IFLA_XDP_SKB_PROG_ID,
945 IFLA_XDP_HW_PROG_ID,1206 IFLA_XDP_HW_PROG_ID,
1207 IFLA_XDP_EXPECTED_FD,
946 __IFLA_XDP_MAX,1208 __IFLA_XDP_MAX,
947};1209};
9481210
...@@ -982,6 +1244,8 @@ enum {...@@ -982,6 +1244,8 @@ enum {
982#define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)1244#define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)
983#define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)1245#define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)
984#define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)1246#define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)
1247#define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4)
1248#define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5)
9851249
986enum {1250enum {
987 IFLA_RMNET_UNSPEC,1251 IFLA_RMNET_UNSPEC,
...@@ -997,4 +1261,14 @@ struct ifla_rmnet_flags {...@@ -997,4 +1261,14 @@ struct ifla_rmnet_flags {
997 __u32 mask;1261 __u32 mask;
998};1262};
9991263
1264/* MCTP section */
1265
1266enum {
1267 IFLA_MCTP_UNSPEC,
1268 IFLA_MCTP_NET,
1269 __IFLA_MCTP_MAX,
1270};
1271
1272#define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)
1273
1000#endif /* _LINUX_IF_LINK_H */1274#endif /* _LINUX_IF_LINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_macsec.h+17-2
...@@ -22,9 +22,11 @@...@@ -22,9 +22,11 @@
2222
23#define MACSEC_KEYID_LEN 1623#define MACSEC_KEYID_LEN 16
2424
25/* cipher IDs as per IEEE802.1AEbn-2011 */25/* cipher IDs as per IEEE802.1AE-2018 (Table 14-1) */
26#define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL26#define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL
27#define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL27#define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL
28#define MACSEC_CIPHER_ID_GCM_AES_XPN_128 0x0080C20001000003ULL
29#define MACSEC_CIPHER_ID_GCM_AES_XPN_256 0x0080C20001000004ULL
2830
29/* deprecated cipher ID for GCM-AES-128 */31/* deprecated cipher ID for GCM-AES-128 */
30#define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL32#define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL
...@@ -45,6 +47,7 @@ enum macsec_attrs {...@@ -45,6 +47,7 @@ enum macsec_attrs {
45 MACSEC_ATTR_RXSC_LIST, /* dump, nested, macsec_rxsc_attrs for each RXSC */47 MACSEC_ATTR_RXSC_LIST, /* dump, nested, macsec_rxsc_attrs for each RXSC */
46 MACSEC_ATTR_TXSC_STATS, /* dump, nested, macsec_txsc_stats_attr */48 MACSEC_ATTR_TXSC_STATS, /* dump, nested, macsec_txsc_stats_attr */
47 MACSEC_ATTR_SECY_STATS, /* dump, nested, macsec_secy_stats_attr */49 MACSEC_ATTR_SECY_STATS, /* dump, nested, macsec_secy_stats_attr */
50 MACSEC_ATTR_OFFLOAD, /* config, nested, macsec_offload_attrs */
48 __MACSEC_ATTR_END,51 __MACSEC_ATTR_END,
49 NUM_MACSEC_ATTR = __MACSEC_ATTR_END,52 NUM_MACSEC_ATTR = __MACSEC_ATTR_END,
50 MACSEC_ATTR_MAX = __MACSEC_ATTR_END - 1,53 MACSEC_ATTR_MAX = __MACSEC_ATTR_END - 1,
...@@ -87,16 +90,27 @@ enum macsec_sa_attrs {...@@ -87,16 +90,27 @@ enum macsec_sa_attrs {
87 MACSEC_SA_ATTR_UNSPEC,90 MACSEC_SA_ATTR_UNSPEC,
88 MACSEC_SA_ATTR_AN, /* config/dump, u8 0..3 */91 MACSEC_SA_ATTR_AN, /* config/dump, u8 0..3 */
89 MACSEC_SA_ATTR_ACTIVE, /* config/dump, u8 0..1 */92 MACSEC_SA_ATTR_ACTIVE, /* config/dump, u8 0..1 */
90 MACSEC_SA_ATTR_PN, /* config/dump, u32 */93 MACSEC_SA_ATTR_PN, /* config/dump, u32/u64 (u64 if XPN) */
91 MACSEC_SA_ATTR_KEY, /* config, data */94 MACSEC_SA_ATTR_KEY, /* config, data */
92 MACSEC_SA_ATTR_KEYID, /* config/dump, 128-bit */95 MACSEC_SA_ATTR_KEYID, /* config/dump, 128-bit */
93 MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */96 MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */
94 MACSEC_SA_ATTR_PAD,97 MACSEC_SA_ATTR_PAD,
98 MACSEC_SA_ATTR_SSCI, /* config/dump, u32 - XPN only */
99 MACSEC_SA_ATTR_SALT, /* config, 96-bit - XPN only */
95 __MACSEC_SA_ATTR_END,100 __MACSEC_SA_ATTR_END,
96 NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END,101 NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END,
97 MACSEC_SA_ATTR_MAX = __MACSEC_SA_ATTR_END - 1,102 MACSEC_SA_ATTR_MAX = __MACSEC_SA_ATTR_END - 1,
98};103};
99104
105enum macsec_offload_attrs {
106 MACSEC_OFFLOAD_ATTR_UNSPEC,
107 MACSEC_OFFLOAD_ATTR_TYPE, /* config/dump, u8 0..2 */
108 MACSEC_OFFLOAD_ATTR_PAD,
109 __MACSEC_OFFLOAD_ATTR_END,
110 NUM_MACSEC_OFFLOAD_ATTR = __MACSEC_OFFLOAD_ATTR_END,
111 MACSEC_OFFLOAD_ATTR_MAX = __MACSEC_OFFLOAD_ATTR_END - 1,
112};
113
100enum macsec_nl_commands {114enum macsec_nl_commands {
101 MACSEC_CMD_GET_TXSC,115 MACSEC_CMD_GET_TXSC,
102 MACSEC_CMD_ADD_RXSC,116 MACSEC_CMD_ADD_RXSC,
...@@ -108,6 +122,7 @@ enum macsec_nl_commands {...@@ -108,6 +122,7 @@ enum macsec_nl_commands {
108 MACSEC_CMD_ADD_RXSA,122 MACSEC_CMD_ADD_RXSA,
109 MACSEC_CMD_DEL_RXSA,123 MACSEC_CMD_DEL_RXSA,
110 MACSEC_CMD_UPD_RXSA,124 MACSEC_CMD_UPD_RXSA,
125 MACSEC_CMD_UPD_OFFLOAD,
111};126};
112127
113/* u64 per-RXSC stats */128/* u64 per-RXSC stats */
lib/libc/include/any-linux-any/linux/if_packet.h+14-1
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef __LINUX_IF_PACKET_H2#ifndef __LINUX_IF_PACKET_H
3#define __LINUX_IF_PACKET_H3#define __LINUX_IF_PACKET_H
44
5#include <asm/byteorder.h>
5#include <linux/types.h>6#include <linux/types.h>
67
7struct sockaddr_pkt {8struct sockaddr_pkt {
...@@ -57,6 +58,7 @@ struct sockaddr_ll {...@@ -57,6 +58,7 @@ struct sockaddr_ll {
57#define PACKET_QDISC_BYPASS 2058#define PACKET_QDISC_BYPASS 20
58#define PACKET_ROLLOVER_STATS 2159#define PACKET_ROLLOVER_STATS 21
59#define PACKET_FANOUT_DATA 2260#define PACKET_FANOUT_DATA 22
61#define PACKET_IGNORE_OUTGOING 23
6062
61#define PACKET_FANOUT_HASH 063#define PACKET_FANOUT_HASH 0
62#define PACKET_FANOUT_LB 164#define PACKET_FANOUT_LB 1
...@@ -122,7 +124,7 @@ struct tpacket_auxdata {...@@ -122,7 +124,7 @@ struct tpacket_auxdata {
122/* Rx and Tx ring - header status */124/* Rx and Tx ring - header status */
123#define TP_STATUS_TS_SOFTWARE (1 << 29)125#define TP_STATUS_TS_SOFTWARE (1 << 29)
124#define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */126#define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */
125#define TP_STATUS_TS_RAW_HARDWARE (1 << 31)127#define TP_STATUS_TS_RAW_HARDWARE (1U << 31)
126128
127/* Rx ring - feature request bits */129/* Rx ring - feature request bits */
128#define TP_FT_REQ_FILL_RXHASH 0x1130#define TP_FT_REQ_FILL_RXHASH 0x1
...@@ -295,6 +297,17 @@ struct packet_mreq {...@@ -295,6 +297,17 @@ struct packet_mreq {
295 unsigned char mr_address[8];297 unsigned char mr_address[8];
296};298};
297299
300struct fanout_args {
301#if defined(__LITTLE_ENDIAN_BITFIELD)
302 __u16 id;
303 __u16 type_flags;
304#else
305 __u16 type_flags;
306 __u16 id;
307#endif
308 __u32 max_num_members;
309};
310
298#define PACKET_MR_MULTICAST 0311#define PACKET_MR_MULTICAST 0
299#define PACKET_MR_PROMISC 1312#define PACKET_MR_PROMISC 1
300#define PACKET_MR_ALLMULTI 2313#define PACKET_MR_ALLMULTI 2
lib/libc/include/any-linux-any/linux/if_pppol2tp.h+1-1
...@@ -75,7 +75,7 @@ struct pppol2tpv3in6_addr {...@@ -75,7 +75,7 @@ struct pppol2tpv3in6_addr {
75};75};
7676
77/* Socket options:77/* Socket options:
78 * DEBUG - bitmask of debug message categories78 * DEBUG - bitmask of debug message categories (not used)
79 * SENDSEQ - 0 => don't send packets with sequence numbers79 * SENDSEQ - 0 => don't send packets with sequence numbers
80 * 1 => send packets with sequence numbers80 * 1 => send packets with sequence numbers
81 * RECVSEQ - 0 => receive packet sequence numbers are optional81 * RECVSEQ - 0 => receive packet sequence numbers are optional
lib/libc/include/any-linux-any/linux/if_tun.h+2
...@@ -59,6 +59,8 @@...@@ -59,6 +59,8 @@
59#define TUNGETVNETBE _IOR('T', 223, int)59#define TUNGETVNETBE _IOR('T', 223, int)
60#define TUNSETSTEERINGEBPF _IOR('T', 224, int)60#define TUNSETSTEERINGEBPF _IOR('T', 224, int)
61#define TUNSETFILTEREBPF _IOR('T', 225, int)61#define TUNSETFILTEREBPF _IOR('T', 225, int)
62#define TUNSETCARRIER _IOW('T', 226, int)
63#define TUNGETDEVNETNS _IO('T', 227)
6264
63/* TUNSETIFF ifr flags */65/* TUNSETIFF ifr flags */
64#define IFF_TUN 0x000166#define IFF_TUN 0x0001
lib/libc/include/any-linux-any/linux/if_tunnel.h+20
...@@ -160,4 +160,24 @@ enum {...@@ -160,4 +160,24 @@ enum {
160};160};
161161
162#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)162#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
163
164#define TUNNEL_CSUM __cpu_to_be16(0x01)
165#define TUNNEL_ROUTING __cpu_to_be16(0x02)
166#define TUNNEL_KEY __cpu_to_be16(0x04)
167#define TUNNEL_SEQ __cpu_to_be16(0x08)
168#define TUNNEL_STRICT __cpu_to_be16(0x10)
169#define TUNNEL_REC __cpu_to_be16(0x20)
170#define TUNNEL_VERSION __cpu_to_be16(0x40)
171#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
172#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
173#define TUNNEL_OAM __cpu_to_be16(0x0200)
174#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
175#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
179
180#define TUNNEL_OPTIONS_PRESENT \
181 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
182
163#endif /* _IF_TUNNEL_H_ */183#endif /* _IF_TUNNEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_vlan.h+5-4
...@@ -32,10 +32,11 @@ enum vlan_ioctl_cmds {...@@ -32,10 +32,11 @@ enum vlan_ioctl_cmds {
32};32};
3333
34enum vlan_flags {34enum vlan_flags {
35 VLAN_FLAG_REORDER_HDR = 0x1,35 VLAN_FLAG_REORDER_HDR = 0x1,
36 VLAN_FLAG_GVRP = 0x2,36 VLAN_FLAG_GVRP = 0x2,
37 VLAN_FLAG_LOOSE_BINDING = 0x4,37 VLAN_FLAG_LOOSE_BINDING = 0x4,
38 VLAN_FLAG_MVRP = 0x8,38 VLAN_FLAG_MVRP = 0x8,
39 VLAN_FLAG_BRIDGE_BINDING = 0x10,
39};40};
4041
41enum vlan_name_types {42enum vlan_name_types {
lib/libc/include/any-linux-any/linux/if_x25.h+1-1
...@@ -18,7 +18,7 @@...@@ -18,7 +18,7 @@
1818
19#include <linux/types.h>19#include <linux/types.h>
2020
21/* Documentation/networking/x25-iface.txt */21/* Documentation/networking/x25-iface.rst */
22#define X25_IFACE_DATA 0x0022#define X25_IFACE_DATA 0x00
23#define X25_IFACE_CONNECT 0x0123#define X25_IFACE_CONNECT 0x01
24#define X25_IFACE_DISCONNECT 0x0224#define X25_IFACE_DISCONNECT 0x02
lib/libc/include/any-linux-any/linux/if_xdp.h+34-1
...@@ -16,6 +16,18 @@...@@ -16,6 +16,18 @@
16#define XDP_SHARED_UMEM (1 << 0)16#define XDP_SHARED_UMEM (1 << 0)
17#define XDP_COPY (1 << 1) /* Force copy-mode */17#define XDP_COPY (1 << 1) /* Force copy-mode */
18#define XDP_ZEROCOPY (1 << 2) /* Force zero-copy mode */18#define XDP_ZEROCOPY (1 << 2) /* Force zero-copy mode */
19/* If this option is set, the driver might go sleep and in that case
20 * the XDP_RING_NEED_WAKEUP flag in the fill and/or Tx rings will be
21 * set. If it is set, the application need to explicitly wake up the
22 * driver with a poll() (Rx and Tx) or sendto() (Tx only). If you are
23 * running the driver and the application on the same core, you should
24 * use this option so that the kernel will yield to the user space
25 * application.
26 */
27#define XDP_USE_NEED_WAKEUP (1 << 3)
28
29/* Flags for xsk_umem_config flags */
30#define XDP_UMEM_UNALIGNED_CHUNK_FLAG (1 << 0)
1931
20struct sockaddr_xdp {32struct sockaddr_xdp {
21 __u16 sxdp_family;33 __u16 sxdp_family;
...@@ -25,10 +37,14 @@ struct sockaddr_xdp {...@@ -25,10 +37,14 @@ struct sockaddr_xdp {
25 __u32 sxdp_shared_umem_fd;37 __u32 sxdp_shared_umem_fd;
26};38};
2739
40/* XDP_RING flags */
41#define XDP_RING_NEED_WAKEUP (1 << 0)
42
28struct xdp_ring_offset {43struct xdp_ring_offset {
29 __u64 producer;44 __u64 producer;
30 __u64 consumer;45 __u64 consumer;
31 __u64 desc;46 __u64 desc;
47 __u64 flags;
32};48};
3349
34struct xdp_mmap_offsets {50struct xdp_mmap_offsets {
...@@ -46,26 +62,43 @@ struct xdp_mmap_offsets {...@@ -46,26 +62,43 @@ struct xdp_mmap_offsets {
46#define XDP_UMEM_FILL_RING 562#define XDP_UMEM_FILL_RING 5
47#define XDP_UMEM_COMPLETION_RING 663#define XDP_UMEM_COMPLETION_RING 6
48#define XDP_STATISTICS 764#define XDP_STATISTICS 7
65#define XDP_OPTIONS 8
4966
50struct xdp_umem_reg {67struct xdp_umem_reg {
51 __u64 addr; /* Start of packet data area */68 __u64 addr; /* Start of packet data area */
52 __u64 len; /* Length of packet data area */69 __u64 len; /* Length of packet data area */
53 __u32 chunk_size;70 __u32 chunk_size;
54 __u32 headroom;71 __u32 headroom;
72 __u32 flags;
55};73};
5674
57struct xdp_statistics {75struct xdp_statistics {
58 __u64 rx_dropped; /* Dropped for reasons other than invalid desc */76 __u64 rx_dropped; /* Dropped for other reasons */
59 __u64 rx_invalid_descs; /* Dropped due to invalid descriptor */77 __u64 rx_invalid_descs; /* Dropped due to invalid descriptor */
60 __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */78 __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */
79 __u64 rx_ring_full; /* Dropped due to rx ring being full */
80 __u64 rx_fill_ring_empty_descs; /* Failed to retrieve item from fill ring */
81 __u64 tx_ring_empty_descs; /* Failed to retrieve item from tx ring */
61};82};
6283
84struct xdp_options {
85 __u32 flags;
86};
87
88/* Flags for the flags field of struct xdp_options */
89#define XDP_OPTIONS_ZEROCOPY (1 << 0)
90
63/* Pgoff for mmaping the rings */91/* Pgoff for mmaping the rings */
64#define XDP_PGOFF_RX_RING 092#define XDP_PGOFF_RX_RING 0
65#define XDP_PGOFF_TX_RING 0x8000000093#define XDP_PGOFF_TX_RING 0x80000000
66#define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL94#define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL
67#define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL95#define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL
6896
97/* Masks for unaligned chunks mode */
98#define XSK_UNALIGNED_BUF_OFFSET_SHIFT 48
99#define XSK_UNALIGNED_BUF_ADDR_MASK \
100 ((1ULL << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1)
101
69/* Rx/Tx descriptor */102/* Rx/Tx descriptor */
70struct xdp_desc {103struct xdp_desc {
71 __u64 addr;104 __u64 addr;
lib/libc/include/any-linux-any/linux/igmp.h+1
...@@ -93,6 +93,7 @@ struct igmpv3_query {...@@ -93,6 +93,7 @@ struct igmpv3_query {
93#define IGMP_MTRACE_RESP 0x1e93#define IGMP_MTRACE_RESP 0x1e
94#define IGMP_MTRACE 0x1f94#define IGMP_MTRACE 0x1f
9595
96#define IGMP_MRDISC_ADV 0x30 /* From RFC4286 */
9697
97/*98/*
98 * Use the BSD names for these for compatibility99 * Use the BSD names for these for compatibility
lib/libc/include/any-linux-any/linux/iio/buffer.h created+10
...@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* industrial I/O buffer definitions needed both in and out of kernel
3 */
4
5#ifndef _IIO_BUFFER_H_
6#define _IIO_BUFFER_H_
7
8#define IIO_BUFFER_GET_FD_IOCTL _IOWR('i', 0x91, int)
9
10#endif /* _IIO_BUFFER_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iio/types.h+8
...@@ -46,6 +46,7 @@ enum iio_chan_type {...@@ -46,6 +46,7 @@ enum iio_chan_type {
46 IIO_GRAVITY,46 IIO_GRAVITY,
47 IIO_POSITIONRELATIVE,47 IIO_POSITIONRELATIVE,
48 IIO_PHASE,48 IIO_PHASE,
49 IIO_MASSCONCENTRATION,
49};50};
5051
51enum iio_modifier {52enum iio_modifier {
...@@ -87,6 +88,13 @@ enum iio_modifier {...@@ -87,6 +88,13 @@ enum iio_modifier {
87 IIO_MOD_VOC,88 IIO_MOD_VOC,
88 IIO_MOD_LIGHT_UV,89 IIO_MOD_LIGHT_UV,
89 IIO_MOD_LIGHT_DUV,90 IIO_MOD_LIGHT_DUV,
91 IIO_MOD_PM1,
92 IIO_MOD_PM2P5,
93 IIO_MOD_PM4,
94 IIO_MOD_PM10,
95 IIO_MOD_ETHANOL,
96 IIO_MOD_H2,
97 IIO_MOD_O2,
90};98};
9199
92enum iio_event_type {100enum iio_event_type {
lib/libc/include/any-linux-any/linux/in.h+53-18
...@@ -74,8 +74,12 @@ enum {...@@ -74,8 +74,12 @@ enum {
74#define IPPROTO_UDPLITE IPPROTO_UDPLITE74#define IPPROTO_UDPLITE IPPROTO_UDPLITE
75 IPPROTO_MPLS = 137, /* MPLS in IP (RFC 4023) */75 IPPROTO_MPLS = 137, /* MPLS in IP (RFC 4023) */
76#define IPPROTO_MPLS IPPROTO_MPLS76#define IPPROTO_MPLS IPPROTO_MPLS
77 IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation */
78#define IPPROTO_ETHERNET IPPROTO_ETHERNET
77 IPPROTO_RAW = 255, /* Raw IP packets */79 IPPROTO_RAW = 255, /* Raw IP packets */
78#define IPPROTO_RAW IPPROTO_RAW80#define IPPROTO_RAW IPPROTO_RAW
81 IPPROTO_MPTCP = 262, /* Multipath TCP connection */
82#define IPPROTO_MPTCP IPPROTO_MPTCP
79 IPPROTO_MAX83 IPPROTO_MAX
80};84};
81#endif85#endif
...@@ -119,6 +123,7 @@ struct in_addr {...@@ -119,6 +123,7 @@ struct in_addr {
119#define IP_CHECKSUM 23123#define IP_CHECKSUM 23
120#define IP_BIND_ADDRESS_NO_PORT 24124#define IP_BIND_ADDRESS_NO_PORT 24
121#define IP_RECVFRAGSIZE 25125#define IP_RECVFRAGSIZE 25
126#define IP_RECVERR_RFC4884 26
122127
123/* IP_MTU_DISCOVER values */128/* IP_MTU_DISCOVER values */
124#define IP_PMTUDISC_DONT 0 /* Never send DF frames */129#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
...@@ -130,7 +135,7 @@ struct in_addr {...@@ -130,7 +135,7 @@ struct in_addr {
130 * this socket to prevent accepting spoofed ones.135 * this socket to prevent accepting spoofed ones.
131 */136 */
132#define IP_PMTUDISC_INTERFACE 4137#define IP_PMTUDISC_INTERFACE 4
133/* weaker version of IP_PMTUDISC_INTERFACE, which allos packets to get138/* weaker version of IP_PMTUDISC_INTERFACE, which allows packets to get
134 * fragmented if they exeed the interface mtu139 * fragmented if they exeed the interface mtu
135 */140 */
136#define IP_PMTUDISC_OMIT 5141#define IP_PMTUDISC_OMIT 5
...@@ -183,11 +188,22 @@ struct ip_mreq_source {...@@ -183,11 +188,22 @@ struct ip_mreq_source {
183};188};
184189
185struct ip_msfilter {190struct ip_msfilter {
186 __be32 imsf_multiaddr;191 union {
187 __be32 imsf_interface;192 struct {
188 __u32 imsf_fmode;193 __be32 imsf_multiaddr_aux;
189 __u32 imsf_numsrc;194 __be32 imsf_interface_aux;
190 __be32 imsf_slist[1];195 __u32 imsf_fmode_aux;
196 __u32 imsf_numsrc_aux;
197 __be32 imsf_slist[1];
198 };
199 struct {
200 __be32 imsf_multiaddr;
201 __be32 imsf_interface;
202 __u32 imsf_fmode;
203 __u32 imsf_numsrc;
204 __be32 imsf_slist_flex[];
205 };
206 };
191};207};
192208
193#define IP_MSFILTER_SIZE(numsrc) \209#define IP_MSFILTER_SIZE(numsrc) \
...@@ -206,11 +222,22 @@ struct group_source_req {...@@ -206,11 +222,22 @@ struct group_source_req {
206};222};
207223
208struct group_filter {224struct group_filter {
209 __u32 gf_interface; /* interface index */225 union {
210 struct __kernel_sockaddr_storage gf_group; /* multicast address */226 struct {
211 __u32 gf_fmode; /* filter mode */227 __u32 gf_interface_aux; /* interface index */
212 __u32 gf_numsrc; /* number of sources */228 struct __kernel_sockaddr_storage gf_group_aux; /* multicast address */
213 struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */229 __u32 gf_fmode_aux; /* filter mode */
230 __u32 gf_numsrc_aux; /* number of sources */
231 struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
232 };
233 struct {
234 __u32 gf_interface; /* interface index */
235 struct __kernel_sockaddr_storage gf_group; /* multicast address */
236 __u32 gf_fmode; /* filter mode */
237 __u32 gf_numsrc; /* number of sources */
238 struct __kernel_sockaddr_storage gf_slist_flex[]; /* interface index */
239 };
240 };
214};241};
215242
216#define GROUP_FILTER_SIZE(numsrc) \243#define GROUP_FILTER_SIZE(numsrc) \
...@@ -266,10 +293,14 @@ struct sockaddr_in {...@@ -266,10 +293,14 @@ struct sockaddr_in {
266293
267#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)294#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
268#define IN_MULTICAST(a) IN_CLASSD(a)295#define IN_MULTICAST(a) IN_CLASSD(a)
269#define IN_MULTICAST_NET 0xF0000000296#define IN_MULTICAST_NET 0xe0000000
270297
271#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)298#define IN_BADCLASS(a) (((long int) (a) ) == (long int)0xffffffff)
272#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))299#define IN_EXPERIMENTAL(a) IN_BADCLASS((a))
300
301#define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
302#define IN_CLASSE_NET 0xffffffff
303#define IN_CLASSE_NSHIFT 0
273304
274/* Address to accept any incoming messages. */305/* Address to accept any incoming messages. */
275#define INADDR_ANY ((unsigned long int) 0x00000000)306#define INADDR_ANY ((unsigned long int) 0x00000000)
...@@ -280,6 +311,9 @@ struct sockaddr_in {...@@ -280,6 +311,9 @@ struct sockaddr_in {
280/* Address indicating an error return. */311/* Address indicating an error return. */
281#define INADDR_NONE ((unsigned long int) 0xffffffff)312#define INADDR_NONE ((unsigned long int) 0xffffffff)
282313
314/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */
315#define INADDR_DUMMY ((unsigned long int) 0xc0000008)
316
283/* Network number for local host loopback. */317/* Network number for local host loopback. */
284#define IN_LOOPBACKNET 127318#define IN_LOOPBACKNET 127
285319
...@@ -288,10 +322,11 @@ struct sockaddr_in {...@@ -288,10 +322,11 @@ struct sockaddr_in {
288#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)322#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
289323
290/* Defines for Multicast INADDR */324/* Defines for Multicast INADDR */
291#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */325#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
292#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */326#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
293#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */327#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
294#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */328#define INADDR_ALLSNOOPERS_GROUP 0xe000006aU /* 224.0.0.106 */
329#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
295#endif330#endif
296331
297/* <asm/byteorder.h> contains the htonl type stuff.. */332/* <asm/byteorder.h> contains the htonl type stuff.. */
lib/libc/include/any-linux-any/linux/in6.h+4
...@@ -145,6 +145,7 @@ struct in6_flowlabel_req {...@@ -145,6 +145,7 @@ struct in6_flowlabel_req {
145#define IPV6_TLV_PADN 1145#define IPV6_TLV_PADN 1
146#define IPV6_TLV_ROUTERALERT 5146#define IPV6_TLV_ROUTERALERT 5
147#define IPV6_TLV_CALIPSO 7 /* RFC 5570 */147#define IPV6_TLV_CALIPSO 7 /* RFC 5570 */
148#define IPV6_TLV_IOAM 49 /* TEMPORARY IANA allocation for IOAM */
148#define IPV6_TLV_JUMBO 194149#define IPV6_TLV_JUMBO 194
149#define IPV6_TLV_HAO 201 /* home address option */150#define IPV6_TLV_HAO 201 /* home address option */
150151
...@@ -177,6 +178,9 @@ struct in6_flowlabel_req {...@@ -177,6 +178,9 @@ struct in6_flowlabel_req {
177#define IPV6_V6ONLY 26178#define IPV6_V6ONLY 26
178#define IPV6_JOIN_ANYCAST 27179#define IPV6_JOIN_ANYCAST 27
179#define IPV6_LEAVE_ANYCAST 28180#define IPV6_LEAVE_ANYCAST 28
181#define IPV6_MULTICAST_ALL 29
182#define IPV6_ROUTER_ALERT_ISOLATE 30
183#define IPV6_RECVERR_RFC4884 31
180184
181/* IPV6_MTU_DISCOVER values */185/* IPV6_MTU_DISCOVER values */
182#define IPV6_PMTUDISC_DONT 0186#define IPV6_PMTUDISC_DONT 0
lib/libc/include/any-linux-any/linux/inet_diag.h+35-1
...@@ -64,9 +64,12 @@ struct inet_diag_req_raw {...@@ -64,9 +64,12 @@ struct inet_diag_req_raw {
64enum {64enum {
65 INET_DIAG_REQ_NONE,65 INET_DIAG_REQ_NONE,
66 INET_DIAG_REQ_BYTECODE,66 INET_DIAG_REQ_BYTECODE,
67 INET_DIAG_REQ_SK_BPF_STORAGES,
68 INET_DIAG_REQ_PROTOCOL,
69 __INET_DIAG_REQ_MAX,
67};70};
6871
69#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE72#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
7073
71/* Bytecode is sequence of 4 byte commands followed by variable arguments.74/* Bytecode is sequence of 4 byte commands followed by variable arguments.
72 * All the commands identified by "code" are conditional jumps forward:75 * All the commands identified by "code" are conditional jumps forward:
...@@ -94,6 +97,7 @@ enum {...@@ -94,6 +97,7 @@ enum {
94 INET_DIAG_BC_MARK_COND,97 INET_DIAG_BC_MARK_COND,
95 INET_DIAG_BC_S_EQ,98 INET_DIAG_BC_S_EQ,
96 INET_DIAG_BC_D_EQ,99 INET_DIAG_BC_D_EQ,
100 INET_DIAG_BC_CGROUP_COND, /* u64 cgroup v2 ID */
97};101};
98102
99struct inet_diag_hostcond {103struct inet_diag_hostcond {
...@@ -153,11 +157,24 @@ enum {...@@ -153,11 +157,24 @@ enum {
153 INET_DIAG_BBRINFO, /* request as INET_DIAG_VEGASINFO */157 INET_DIAG_BBRINFO, /* request as INET_DIAG_VEGASINFO */
154 INET_DIAG_CLASS_ID, /* request as INET_DIAG_TCLASS */158 INET_DIAG_CLASS_ID, /* request as INET_DIAG_TCLASS */
155 INET_DIAG_MD5SIG,159 INET_DIAG_MD5SIG,
160 INET_DIAG_ULP_INFO,
161 INET_DIAG_SK_BPF_STORAGES,
162 INET_DIAG_CGROUP_ID,
163 INET_DIAG_SOCKOPT,
156 __INET_DIAG_MAX,164 __INET_DIAG_MAX,
157};165};
158166
159#define INET_DIAG_MAX (__INET_DIAG_MAX - 1)167#define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
160168
169enum {
170 INET_ULP_INFO_UNSPEC,
171 INET_ULP_INFO_NAME,
172 INET_ULP_INFO_TLS,
173 INET_ULP_INFO_MPTCP,
174 __INET_ULP_INFO_MAX,
175};
176#define INET_ULP_INFO_MAX (__INET_ULP_INFO_MAX - 1)
177
161/* INET_DIAG_MEM */178/* INET_DIAG_MEM */
162179
163struct inet_diag_meminfo {180struct inet_diag_meminfo {
...@@ -167,6 +184,23 @@ struct inet_diag_meminfo {...@@ -167,6 +184,23 @@ struct inet_diag_meminfo {
167 __u32 idiag_tmem;184 __u32 idiag_tmem;
168};185};
169186
187/* INET_DIAG_SOCKOPT */
188
189struct inet_diag_sockopt {
190 __u8 recverr:1,
191 is_icsk:1,
192 freebind:1,
193 hdrincl:1,
194 mc_loop:1,
195 transparent:1,
196 mc_all:1,
197 nodefrag:1;
198 __u8 bind_address_no_port:1,
199 recverr_rfc4884:1,
200 defer_connect:1,
201 unused:5;
202};
203
170/* INET_DIAG_VEGASINFO */204/* INET_DIAG_VEGASINFO */
171205
172struct tcpvegas_info {206struct tcpvegas_info {
lib/libc/include/any-linux-any/linux/input-event-codes.h+103-4
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*2/*
3 * Input event codes3 * Input event codes
4 *4 *
...@@ -439,10 +439,12 @@...@@ -439,10 +439,12 @@
439#define KEY_TITLE 0x171439#define KEY_TITLE 0x171
440#define KEY_SUBTITLE 0x172440#define KEY_SUBTITLE 0x172
441#define KEY_ANGLE 0x173441#define KEY_ANGLE 0x173
442#define KEY_ZOOM 0x174442#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */
443#define KEY_ZOOM KEY_FULL_SCREEN
443#define KEY_MODE 0x175444#define KEY_MODE 0x175
444#define KEY_KEYBOARD 0x176445#define KEY_KEYBOARD 0x176
445#define KEY_SCREEN 0x177446#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */
447#define KEY_SCREEN KEY_ASPECT_RATIO
446#define KEY_PC 0x178 /* Media Select Computer */448#define KEY_PC 0x178 /* Media Select Computer */
447#define KEY_TV 0x179 /* Media Select TV */449#define KEY_TV 0x179 /* Media Select TV */
448#define KEY_TV2 0x17a /* Media Select Cable */450#define KEY_TV2 0x17a /* Media Select Cable */
...@@ -513,6 +515,9 @@...@@ -513,6 +515,9 @@
513#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */515#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
514#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */516#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
515#define KEY_IMAGES 0x1ba /* AL Image Browser */517#define KEY_IMAGES 0x1ba /* AL Image Browser */
518#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
519#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */
520#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */
516521
517#define KEY_DEL_EOL 0x1c0522#define KEY_DEL_EOL 0x1c0
518#define KEY_DEL_EOS 0x1c1523#define KEY_DEL_EOS 0x1c1
...@@ -540,6 +545,7 @@...@@ -540,6 +545,7 @@
540#define KEY_FN_F 0x1e2545#define KEY_FN_F 0x1e2
541#define KEY_FN_S 0x1e3546#define KEY_FN_S 0x1e3
542#define KEY_FN_B 0x1e4547#define KEY_FN_B 0x1e4
548#define KEY_FN_RIGHT_SHIFT 0x1e5
543549
544#define KEY_BRL_DOT1 0x1f1550#define KEY_BRL_DOT1 0x1f1
545#define KEY_BRL_DOT2 0x1f2551#define KEY_BRL_DOT2 0x1f2
...@@ -604,6 +610,8 @@...@@ -604,6 +610,8 @@
604#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */610#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */
605#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */611#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
606#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */612#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
613#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
614#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
607615
608#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */616#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
609#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */617#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
...@@ -646,6 +654,86 @@...@@ -646,6 +654,86 @@
646 */654 */
647#define KEY_DATA 0x277655#define KEY_DATA 0x277
648#define KEY_ONSCREEN_KEYBOARD 0x278656#define KEY_ONSCREEN_KEYBOARD 0x278
657/* Electronic privacy screen control */
658#define KEY_PRIVACY_SCREEN_TOGGLE 0x279
659
660/* Select an area of screen to be copied */
661#define KEY_SELECTIVE_SCREENSHOT 0x27a
662
663/*
664 * Some keyboards have keys which do not have a defined meaning, these keys
665 * are intended to be programmed / bound to macros by the user. For most
666 * keyboards with these macro-keys the key-sequence to inject, or action to
667 * take, is all handled by software on the host side. So from the kernel's
668 * point of view these are just normal keys.
669 *
670 * The KEY_MACRO# codes below are intended for such keys, which may be labeled
671 * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
672 * where the marking on the key does indicate a defined meaning / purpose.
673 *
674 * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
675 * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
676 * define MUST be added.
677 */
678#define KEY_MACRO1 0x290
679#define KEY_MACRO2 0x291
680#define KEY_MACRO3 0x292
681#define KEY_MACRO4 0x293
682#define KEY_MACRO5 0x294
683#define KEY_MACRO6 0x295
684#define KEY_MACRO7 0x296
685#define KEY_MACRO8 0x297
686#define KEY_MACRO9 0x298
687#define KEY_MACRO10 0x299
688#define KEY_MACRO11 0x29a
689#define KEY_MACRO12 0x29b
690#define KEY_MACRO13 0x29c
691#define KEY_MACRO14 0x29d
692#define KEY_MACRO15 0x29e
693#define KEY_MACRO16 0x29f
694#define KEY_MACRO17 0x2a0
695#define KEY_MACRO18 0x2a1
696#define KEY_MACRO19 0x2a2
697#define KEY_MACRO20 0x2a3
698#define KEY_MACRO21 0x2a4
699#define KEY_MACRO22 0x2a5
700#define KEY_MACRO23 0x2a6
701#define KEY_MACRO24 0x2a7
702#define KEY_MACRO25 0x2a8
703#define KEY_MACRO26 0x2a9
704#define KEY_MACRO27 0x2aa
705#define KEY_MACRO28 0x2ab
706#define KEY_MACRO29 0x2ac
707#define KEY_MACRO30 0x2ad
708
709/*
710 * Some keyboards with the macro-keys described above have some extra keys
711 * for controlling the host-side software responsible for the macro handling:
712 * -A macro recording start/stop key. Note that not all keyboards which emit
713 * KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
714 * KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START
715 * should be interpreted as a recording start/stop toggle;
716 * -Keys for switching between different macro (pre)sets, either a key for
717 * cycling through the configured presets or keys to directly select a preset.
718 */
719#define KEY_MACRO_RECORD_START 0x2b0
720#define KEY_MACRO_RECORD_STOP 0x2b1
721#define KEY_MACRO_PRESET_CYCLE 0x2b2
722#define KEY_MACRO_PRESET1 0x2b3
723#define KEY_MACRO_PRESET2 0x2b4
724#define KEY_MACRO_PRESET3 0x2b5
725
726/*
727 * Some keyboards have a buildin LCD panel where the contents are controlled
728 * by the host. Often these have a number of keys directly below the LCD
729 * intended for controlling a menu shown on the LCD. These keys often don't
730 * have any labeling so we just name them KEY_KBD_LCD_MENU#
731 */
732#define KEY_KBD_LCD_MENU1 0x2b8
733#define KEY_KBD_LCD_MENU2 0x2b9
734#define KEY_KBD_LCD_MENU3 0x2ba
735#define KEY_KBD_LCD_MENU4 0x2bb
736#define KEY_KBD_LCD_MENU5 0x2bc
649737
650#define BTN_TRIGGER_HAPPY 0x2c0738#define BTN_TRIGGER_HAPPY 0x2c0
651#define BTN_TRIGGER_HAPPY1 0x2c0739#define BTN_TRIGGER_HAPPY1 0x2c0
...@@ -708,6 +796,16 @@...@@ -708,6 +796,16 @@
708#define REL_DIAL 0x07796#define REL_DIAL 0x07
709#define REL_WHEEL 0x08797#define REL_WHEEL 0x08
710#define REL_MISC 0x09798#define REL_MISC 0x09
799/*
800 * 0x0a is reserved and should not be used in input drivers.
801 * It was used by HID as REL_MISC+1 and userspace needs to detect if
802 * the next REL_* event is correct or is just REL_MISC + n.
803 * We define here REL_RESERVED so userspace can rely on it and detect
804 * the situation described above.
805 */
806#define REL_RESERVED 0x0a
807#define REL_WHEEL_HI_RES 0x0b
808#define REL_HWHEEL_HI_RES 0x0c
711#define REL_MAX 0x0f809#define REL_MAX 0x0f
712#define REL_CNT (REL_MAX+1)810#define REL_CNT (REL_MAX+1)
713811
...@@ -795,7 +893,8 @@...@@ -795,7 +893,8 @@
795#define SW_LINEIN_INSERT 0x0d /* set = inserted */893#define SW_LINEIN_INSERT 0x0d /* set = inserted */
796#define SW_MUTE_DEVICE 0x0e /* set = device disabled */894#define SW_MUTE_DEVICE 0x0e /* set = device disabled */
797#define SW_PEN_INSERTED 0x0f /* set = pen inserted */895#define SW_PEN_INSERTED 0x0f /* set = pen inserted */
798#define SW_MAX 0x0f896#define SW_MACHINE_COVER 0x10 /* set = cover closed */
897#define SW_MAX 0x10
799#define SW_CNT (SW_MAX+1)898#define SW_CNT (SW_MAX+1)
800899
801/*900/*
lib/libc/include/any-linux-any/linux/input.h+2-1
...@@ -32,6 +32,7 @@ struct input_event {...@@ -32,6 +32,7 @@ struct input_event {
32 __kernel_ulong_t __sec;32 __kernel_ulong_t __sec;
33#if defined(__sparc__) && defined(__arch64__)33#if defined(__sparc__) && defined(__arch64__)
34 unsigned int __usec;34 unsigned int __usec;
35 unsigned int __pad;
35#else36#else
36 __kernel_ulong_t __usec;37 __kernel_ulong_t __usec;
37#endif38#endif
...@@ -81,7 +82,7 @@ struct input_id {...@@ -81,7 +82,7 @@ struct input_id {
81 * in units per radian.82 * in units per radian.
82 * When INPUT_PROP_ACCELEROMETER is set the resolution changes.83 * When INPUT_PROP_ACCELEROMETER is set the resolution changes.
83 * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in84 * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in
84 * in units per g (units/g) and in units per degree per second85 * units per g (units/g) and in units per degree per second
85 * (units/deg/s) for rotational axes (ABS_RX, ABS_RY, ABS_RZ).86 * (units/deg/s) for rotational axes (ABS_RX, ABS_RY, ABS_RZ).
86 */87 */
87struct input_absinfo {88struct input_absinfo {
lib/libc/include/any-linux-any/linux/io_uring.h created+421
...@@ -0,0 +1,421 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/*
3 * Header file for the io_uring interface.
4 *
5 * Copyright (C) 2019 Jens Axboe
6 * Copyright (C) 2019 Christoph Hellwig
7 */
8#ifndef LINUX_IO_URING_H
9#define LINUX_IO_URING_H
10
11#include <linux/fs.h>
12#include <linux/types.h>
13
14/*
15 * IO submission data structure (Submission Queue Entry)
16 */
17struct io_uring_sqe {
18 __u8 opcode; /* type of operation for this sqe */
19 __u8 flags; /* IOSQE_ flags */
20 __u16 ioprio; /* ioprio for the request */
21 __s32 fd; /* file descriptor to do IO on */
22 union {
23 __u64 off; /* offset into file */
24 __u64 addr2;
25 };
26 union {
27 __u64 addr; /* pointer to buffer or iovecs */
28 __u64 splice_off_in;
29 };
30 __u32 len; /* buffer size or number of iovecs */
31 union {
32 __kernel_rwf_t rw_flags;
33 __u32 fsync_flags;
34 __u16 poll_events; /* compatibility */
35 __u32 poll32_events; /* word-reversed for BE */
36 __u32 sync_range_flags;
37 __u32 msg_flags;
38 __u32 timeout_flags;
39 __u32 accept_flags;
40 __u32 cancel_flags;
41 __u32 open_flags;
42 __u32 statx_flags;
43 __u32 fadvise_advice;
44 __u32 splice_flags;
45 __u32 rename_flags;
46 __u32 unlink_flags;
47 __u32 hardlink_flags;
48 };
49 __u64 user_data; /* data to be passed back at completion time */
50 /* pack this to avoid bogus arm OABI complaints */
51 union {
52 /* index into fixed buffers, if used */
53 __u16 buf_index;
54 /* for grouped buffer selection */
55 __u16 buf_group;
56 } __attribute__((packed));
57 /* personality to use, if used */
58 __u16 personality;
59 union {
60 __s32 splice_fd_in;
61 __u32 file_index;
62 };
63 __u64 __pad2[2];
64};
65
66enum {
67 IOSQE_FIXED_FILE_BIT,
68 IOSQE_IO_DRAIN_BIT,
69 IOSQE_IO_LINK_BIT,
70 IOSQE_IO_HARDLINK_BIT,
71 IOSQE_ASYNC_BIT,
72 IOSQE_BUFFER_SELECT_BIT,
73};
74
75/*
76 * sqe->flags
77 */
78/* use fixed fileset */
79#define IOSQE_FIXED_FILE (1U << IOSQE_FIXED_FILE_BIT)
80/* issue after inflight IO */
81#define IOSQE_IO_DRAIN (1U << IOSQE_IO_DRAIN_BIT)
82/* links next sqe */
83#define IOSQE_IO_LINK (1U << IOSQE_IO_LINK_BIT)
84/* like LINK, but stronger */
85#define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT)
86/* always go async */
87#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
88/* select buffer from sqe->buf_group */
89#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)
90
91/*
92 * io_uring_setup() flags
93 */
94#define IORING_SETUP_IOPOLL (1U << 0) /* io_context is polled */
95#define IORING_SETUP_SQPOLL (1U << 1) /* SQ poll thread */
96#define IORING_SETUP_SQ_AFF (1U << 2) /* sq_thread_cpu is valid */
97#define IORING_SETUP_CQSIZE (1U << 3) /* app defines CQ size */
98#define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */
99#define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
100#define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */
101
102enum {
103 IORING_OP_NOP,
104 IORING_OP_READV,
105 IORING_OP_WRITEV,
106 IORING_OP_FSYNC,
107 IORING_OP_READ_FIXED,
108 IORING_OP_WRITE_FIXED,
109 IORING_OP_POLL_ADD,
110 IORING_OP_POLL_REMOVE,
111 IORING_OP_SYNC_FILE_RANGE,
112 IORING_OP_SENDMSG,
113 IORING_OP_RECVMSG,
114 IORING_OP_TIMEOUT,
115 IORING_OP_TIMEOUT_REMOVE,
116 IORING_OP_ACCEPT,
117 IORING_OP_ASYNC_CANCEL,
118 IORING_OP_LINK_TIMEOUT,
119 IORING_OP_CONNECT,
120 IORING_OP_FALLOCATE,
121 IORING_OP_OPENAT,
122 IORING_OP_CLOSE,
123 IORING_OP_FILES_UPDATE,
124 IORING_OP_STATX,
125 IORING_OP_READ,
126 IORING_OP_WRITE,
127 IORING_OP_FADVISE,
128 IORING_OP_MADVISE,
129 IORING_OP_SEND,
130 IORING_OP_RECV,
131 IORING_OP_OPENAT2,
132 IORING_OP_EPOLL_CTL,
133 IORING_OP_SPLICE,
134 IORING_OP_PROVIDE_BUFFERS,
135 IORING_OP_REMOVE_BUFFERS,
136 IORING_OP_TEE,
137 IORING_OP_SHUTDOWN,
138 IORING_OP_RENAMEAT,
139 IORING_OP_UNLINKAT,
140 IORING_OP_MKDIRAT,
141 IORING_OP_SYMLINKAT,
142 IORING_OP_LINKAT,
143
144 /* this goes last, obviously */
145 IORING_OP_LAST,
146};
147
148/*
149 * sqe->fsync_flags
150 */
151#define IORING_FSYNC_DATASYNC (1U << 0)
152
153/*
154 * sqe->timeout_flags
155 */
156#define IORING_TIMEOUT_ABS (1U << 0)
157#define IORING_TIMEOUT_UPDATE (1U << 1)
158#define IORING_TIMEOUT_BOOTTIME (1U << 2)
159#define IORING_TIMEOUT_REALTIME (1U << 3)
160#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
161#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
162#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
163#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
164/*
165 * sqe->splice_flags
166 * extends splice(2) flags
167 */
168#define SPLICE_F_FD_IN_FIXED (1U << 31) /* the last bit of __u32 */
169
170/*
171 * POLL_ADD flags. Note that since sqe->poll_events is the flag space, the
172 * command flags for POLL_ADD are stored in sqe->len.
173 *
174 * IORING_POLL_ADD_MULTI Multishot poll. Sets IORING_CQE_F_MORE if
175 * the poll handler will continue to report
176 * CQEs on behalf of the same SQE.
177 *
178 * IORING_POLL_UPDATE Update existing poll request, matching
179 * sqe->addr as the old user_data field.
180 */
181#define IORING_POLL_ADD_MULTI (1U << 0)
182#define IORING_POLL_UPDATE_EVENTS (1U << 1)
183#define IORING_POLL_UPDATE_USER_DATA (1U << 2)
184
185/*
186 * IO completion data structure (Completion Queue Entry)
187 */
188struct io_uring_cqe {
189 __u64 user_data; /* sqe->data submission passed back */
190 __s32 res; /* result code for this event */
191 __u32 flags;
192};
193
194/*
195 * cqe->flags
196 *
197 * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
198 * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries
199 */
200#define IORING_CQE_F_BUFFER (1U << 0)
201#define IORING_CQE_F_MORE (1U << 1)
202
203enum {
204 IORING_CQE_BUFFER_SHIFT = 16,
205};
206
207/*
208 * Magic offsets for the application to mmap the data it needs
209 */
210#define IORING_OFF_SQ_RING 0ULL
211#define IORING_OFF_CQ_RING 0x8000000ULL
212#define IORING_OFF_SQES 0x10000000ULL
213
214/*
215 * Filled with the offset for mmap(2)
216 */
217struct io_sqring_offsets {
218 __u32 head;
219 __u32 tail;
220 __u32 ring_mask;
221 __u32 ring_entries;
222 __u32 flags;
223 __u32 dropped;
224 __u32 array;
225 __u32 resv1;
226 __u64 resv2;
227};
228
229/*
230 * sq_ring->flags
231 */
232#define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */
233#define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */
234
235struct io_cqring_offsets {
236 __u32 head;
237 __u32 tail;
238 __u32 ring_mask;
239 __u32 ring_entries;
240 __u32 overflow;
241 __u32 cqes;
242 __u32 flags;
243 __u32 resv1;
244 __u64 resv2;
245};
246
247/*
248 * cq_ring->flags
249 */
250
251/* disable eventfd notifications */
252#define IORING_CQ_EVENTFD_DISABLED (1U << 0)
253
254/*
255 * io_uring_enter(2) flags
256 */
257#define IORING_ENTER_GETEVENTS (1U << 0)
258#define IORING_ENTER_SQ_WAKEUP (1U << 1)
259#define IORING_ENTER_SQ_WAIT (1U << 2)
260#define IORING_ENTER_EXT_ARG (1U << 3)
261
262/*
263 * Passed in for io_uring_setup(2). Copied back with updated info on success
264 */
265struct io_uring_params {
266 __u32 sq_entries;
267 __u32 cq_entries;
268 __u32 flags;
269 __u32 sq_thread_cpu;
270 __u32 sq_thread_idle;
271 __u32 features;
272 __u32 wq_fd;
273 __u32 resv[3];
274 struct io_sqring_offsets sq_off;
275 struct io_cqring_offsets cq_off;
276};
277
278/*
279 * io_uring_params->features flags
280 */
281#define IORING_FEAT_SINGLE_MMAP (1U << 0)
282#define IORING_FEAT_NODROP (1U << 1)
283#define IORING_FEAT_SUBMIT_STABLE (1U << 2)
284#define IORING_FEAT_RW_CUR_POS (1U << 3)
285#define IORING_FEAT_CUR_PERSONALITY (1U << 4)
286#define IORING_FEAT_FAST_POLL (1U << 5)
287#define IORING_FEAT_POLL_32BITS (1U << 6)
288#define IORING_FEAT_SQPOLL_NONFIXED (1U << 7)
289#define IORING_FEAT_EXT_ARG (1U << 8)
290#define IORING_FEAT_NATIVE_WORKERS (1U << 9)
291#define IORING_FEAT_RSRC_TAGS (1U << 10)
292
293/*
294 * io_uring_register(2) opcodes and arguments
295 */
296enum {
297 IORING_REGISTER_BUFFERS = 0,
298 IORING_UNREGISTER_BUFFERS = 1,
299 IORING_REGISTER_FILES = 2,
300 IORING_UNREGISTER_FILES = 3,
301 IORING_REGISTER_EVENTFD = 4,
302 IORING_UNREGISTER_EVENTFD = 5,
303 IORING_REGISTER_FILES_UPDATE = 6,
304 IORING_REGISTER_EVENTFD_ASYNC = 7,
305 IORING_REGISTER_PROBE = 8,
306 IORING_REGISTER_PERSONALITY = 9,
307 IORING_UNREGISTER_PERSONALITY = 10,
308 IORING_REGISTER_RESTRICTIONS = 11,
309 IORING_REGISTER_ENABLE_RINGS = 12,
310
311 /* extended with tagging */
312 IORING_REGISTER_FILES2 = 13,
313 IORING_REGISTER_FILES_UPDATE2 = 14,
314 IORING_REGISTER_BUFFERS2 = 15,
315 IORING_REGISTER_BUFFERS_UPDATE = 16,
316
317 /* set/clear io-wq thread affinities */
318 IORING_REGISTER_IOWQ_AFF = 17,
319 IORING_UNREGISTER_IOWQ_AFF = 18,
320
321 /* set/get max number of io-wq workers */
322 IORING_REGISTER_IOWQ_MAX_WORKERS = 19,
323
324 /* this goes last */
325 IORING_REGISTER_LAST
326};
327
328/* io-wq worker categories */
329enum {
330 IO_WQ_BOUND,
331 IO_WQ_UNBOUND,
332};
333
334/* deprecated, see struct io_uring_rsrc_update */
335struct io_uring_files_update {
336 __u32 offset;
337 __u32 resv;
338 __aligned_u64 /* __s32 * */ fds;
339};
340
341struct io_uring_rsrc_register {
342 __u32 nr;
343 __u32 resv;
344 __u64 resv2;
345 __aligned_u64 data;
346 __aligned_u64 tags;
347};
348
349struct io_uring_rsrc_update {
350 __u32 offset;
351 __u32 resv;
352 __aligned_u64 data;
353};
354
355struct io_uring_rsrc_update2 {
356 __u32 offset;
357 __u32 resv;
358 __aligned_u64 data;
359 __aligned_u64 tags;
360 __u32 nr;
361 __u32 resv2;
362};
363
364/* Skip updating fd indexes set to this value in the fd table */
365#define IORING_REGISTER_FILES_SKIP (-2)
366
367#define IO_URING_OP_SUPPORTED (1U << 0)
368
369struct io_uring_probe_op {
370 __u8 op;
371 __u8 resv;
372 __u16 flags; /* IO_URING_OP_* flags */
373 __u32 resv2;
374};
375
376struct io_uring_probe {
377 __u8 last_op; /* last opcode supported */
378 __u8 ops_len; /* length of ops[] array below */
379 __u16 resv;
380 __u32 resv2[3];
381 struct io_uring_probe_op ops[0];
382};
383
384struct io_uring_restriction {
385 __u16 opcode;
386 union {
387 __u8 register_op; /* IORING_RESTRICTION_REGISTER_OP */
388 __u8 sqe_op; /* IORING_RESTRICTION_SQE_OP */
389 __u8 sqe_flags; /* IORING_RESTRICTION_SQE_FLAGS_* */
390 };
391 __u8 resv;
392 __u32 resv2[3];
393};
394
395/*
396 * io_uring_restriction->opcode values
397 */
398enum {
399 /* Allow an io_uring_register(2) opcode */
400 IORING_RESTRICTION_REGISTER_OP = 0,
401
402 /* Allow an sqe opcode */
403 IORING_RESTRICTION_SQE_OP = 1,
404
405 /* Allow sqe flags */
406 IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2,
407
408 /* Require sqe flags (these flags must be set on each submission) */
409 IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3,
410
411 IORING_RESTRICTION_LAST
412};
413
414struct io_uring_getevents_arg {
415 __u64 sigmask;
416 __u32 sigmask_sz;
417 __u32 pad;
418 __u64 ts;
419};
420
421#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioam6.h created+133
...@@ -0,0 +1,133 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * IPv6 IOAM implementation
4 *
5 * Author:
6 * Justin Iurman <justin.iurman@uliege.be>
7 */
8
9#ifndef _LINUX_IOAM6_H
10#define _LINUX_IOAM6_H
11
12#include <asm/byteorder.h>
13#include <linux/types.h>
14
15#define IOAM6_U16_UNAVAILABLE U16_MAX
16#define IOAM6_U32_UNAVAILABLE U32_MAX
17#define IOAM6_U64_UNAVAILABLE U64_MAX
18
19#define IOAM6_DEFAULT_ID (IOAM6_U32_UNAVAILABLE >> 8)
20#define IOAM6_DEFAULT_ID_WIDE (IOAM6_U64_UNAVAILABLE >> 8)
21#define IOAM6_DEFAULT_IF_ID IOAM6_U16_UNAVAILABLE
22#define IOAM6_DEFAULT_IF_ID_WIDE IOAM6_U32_UNAVAILABLE
23
24/*
25 * IPv6 IOAM Option Header
26 */
27struct ioam6_hdr {
28 __u8 opt_type;
29 __u8 opt_len;
30 __u8 :8; /* reserved */
31#define IOAM6_TYPE_PREALLOC 0
32 __u8 type;
33} __attribute__((packed));
34
35/*
36 * IOAM Trace Header
37 */
38struct ioam6_trace_hdr {
39 __be16 namespace_id;
40
41#if defined(__LITTLE_ENDIAN_BITFIELD)
42
43 __u8 :1, /* unused */
44 :1, /* unused */
45 overflow:1,
46 nodelen:5;
47
48 __u8 remlen:7,
49 :1; /* unused */
50
51 union {
52 __be32 type_be32;
53
54 struct {
55 __u32 bit7:1,
56 bit6:1,
57 bit5:1,
58 bit4:1,
59 bit3:1,
60 bit2:1,
61 bit1:1,
62 bit0:1,
63 bit15:1, /* unused */
64 bit14:1, /* unused */
65 bit13:1, /* unused */
66 bit12:1, /* unused */
67 bit11:1,
68 bit10:1,
69 bit9:1,
70 bit8:1,
71 bit23:1, /* reserved */
72 bit22:1,
73 bit21:1, /* unused */
74 bit20:1, /* unused */
75 bit19:1, /* unused */
76 bit18:1, /* unused */
77 bit17:1, /* unused */
78 bit16:1, /* unused */
79 :8; /* reserved */
80 } type;
81 };
82
83#elif defined(__BIG_ENDIAN_BITFIELD)
84
85 __u8 nodelen:5,
86 overflow:1,
87 :1, /* unused */
88 :1; /* unused */
89
90 __u8 :1, /* unused */
91 remlen:7;
92
93 union {
94 __be32 type_be32;
95
96 struct {
97 __u32 bit0:1,
98 bit1:1,
99 bit2:1,
100 bit3:1,
101 bit4:1,
102 bit5:1,
103 bit6:1,
104 bit7:1,
105 bit8:1,
106 bit9:1,
107 bit10:1,
108 bit11:1,
109 bit12:1, /* unused */
110 bit13:1, /* unused */
111 bit14:1, /* unused */
112 bit15:1, /* unused */
113 bit16:1, /* unused */
114 bit17:1, /* unused */
115 bit18:1, /* unused */
116 bit19:1, /* unused */
117 bit20:1, /* unused */
118 bit21:1, /* unused */
119 bit22:1,
120 bit23:1, /* reserved */
121 :8; /* reserved */
122 } type;
123 };
124
125#else
126#error "Please fix <asm/byteorder.h>"
127#endif
128
129#define IOAM6_TRACE_DATA_SIZE_MAX 244
130 __u8 data[0];
131} __attribute__((packed));
132
133#endif /* _LINUX_IOAM6_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioam6_genl.h created+52
...@@ -0,0 +1,52 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * IPv6 IOAM Generic Netlink API
4 *
5 * Author:
6 * Justin Iurman <justin.iurman@uliege.be>
7 */
8
9#ifndef _LINUX_IOAM6_GENL_H
10#define _LINUX_IOAM6_GENL_H
11
12#define IOAM6_GENL_NAME "IOAM6"
13#define IOAM6_GENL_VERSION 0x1
14
15enum {
16 IOAM6_ATTR_UNSPEC,
17
18 IOAM6_ATTR_NS_ID, /* u16 */
19 IOAM6_ATTR_NS_DATA, /* u32 */
20 IOAM6_ATTR_NS_DATA_WIDE,/* u64 */
21
22#define IOAM6_MAX_SCHEMA_DATA_LEN (255 * 4)
23 IOAM6_ATTR_SC_ID, /* u32 */
24 IOAM6_ATTR_SC_DATA, /* Binary */
25 IOAM6_ATTR_SC_NONE, /* Flag */
26
27 IOAM6_ATTR_PAD,
28
29 __IOAM6_ATTR_MAX,
30};
31
32#define IOAM6_ATTR_MAX (__IOAM6_ATTR_MAX - 1)
33
34enum {
35 IOAM6_CMD_UNSPEC,
36
37 IOAM6_CMD_ADD_NAMESPACE,
38 IOAM6_CMD_DEL_NAMESPACE,
39 IOAM6_CMD_DUMP_NAMESPACES,
40
41 IOAM6_CMD_ADD_SCHEMA,
42 IOAM6_CMD_DEL_SCHEMA,
43 IOAM6_CMD_DUMP_SCHEMAS,
44
45 IOAM6_CMD_NS_SET_SCHEMA,
46
47 __IOAM6_CMD_MAX,
48};
49
50#define IOAM6_CMD_MAX (__IOAM6_CMD_MAX - 1)
51
52#endif /* _LINUX_IOAM6_GENL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioam6_iptunnel.h created+49
...@@ -0,0 +1,49 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * IPv6 IOAM Lightweight Tunnel API
4 *
5 * Author:
6 * Justin Iurman <justin.iurman@uliege.be>
7 */
8
9#ifndef _LINUX_IOAM6_IPTUNNEL_H
10#define _LINUX_IOAM6_IPTUNNEL_H
11
12/* Encap modes:
13 * - inline: direct insertion
14 * - encap: ip6ip6 encapsulation
15 * - auto: __inline__ for local packets, encap for in-transit packets
16 */
17enum {
18 __IOAM6_IPTUNNEL_MODE_MIN,
19
20 IOAM6_IPTUNNEL_MODE_INLINE,
21 IOAM6_IPTUNNEL_MODE_ENCAP,
22 IOAM6_IPTUNNEL_MODE_AUTO,
23
24 __IOAM6_IPTUNNEL_MODE_MAX,
25};
26
27#define IOAM6_IPTUNNEL_MODE_MIN (__IOAM6_IPTUNNEL_MODE_MIN + 1)
28#define IOAM6_IPTUNNEL_MODE_MAX (__IOAM6_IPTUNNEL_MODE_MAX - 1)
29
30enum {
31 IOAM6_IPTUNNEL_UNSPEC,
32
33 /* Encap mode */
34 IOAM6_IPTUNNEL_MODE, /* u8 */
35
36 /* Tunnel dst address.
37 * For encap,auto modes.
38 */
39 IOAM6_IPTUNNEL_DST, /* struct in6_addr */
40
41 /* IOAM Trace Header */
42 IOAM6_IPTUNNEL_TRACE, /* struct ioam6_trace_hdr */
43
44 __IOAM6_IPTUNNEL_MAX,
45};
46
47#define IOAM6_IPTUNNEL_MAX (__IOAM6_IPTUNNEL_MAX - 1)
48
49#endif /* _LINUX_IOAM6_IPTUNNEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommu.h created+342
...@@ -0,0 +1,342 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * IOMMU user API definitions
4 */
5
6#ifndef _IOMMU_H
7#define _IOMMU_H
8
9#include <linux/types.h>
10
11#define IOMMU_FAULT_PERM_READ (1 << 0) /* read */
12#define IOMMU_FAULT_PERM_WRITE (1 << 1) /* write */
13#define IOMMU_FAULT_PERM_EXEC (1 << 2) /* exec */
14#define IOMMU_FAULT_PERM_PRIV (1 << 3) /* privileged */
15
16/* Generic fault types, can be expanded IRQ remapping fault */
17enum iommu_fault_type {
18 IOMMU_FAULT_DMA_UNRECOV = 1, /* unrecoverable fault */
19 IOMMU_FAULT_PAGE_REQ, /* page request fault */
20};
21
22enum iommu_fault_reason {
23 IOMMU_FAULT_REASON_UNKNOWN = 0,
24
25 /* Could not access the PASID table (fetch caused external abort) */
26 IOMMU_FAULT_REASON_PASID_FETCH,
27
28 /* PASID entry is invalid or has configuration errors */
29 IOMMU_FAULT_REASON_BAD_PASID_ENTRY,
30
31 /*
32 * PASID is out of range (e.g. exceeds the maximum PASID
33 * supported by the IOMMU) or disabled.
34 */
35 IOMMU_FAULT_REASON_PASID_INVALID,
36
37 /*
38 * An external abort occurred fetching (or updating) a translation
39 * table descriptor
40 */
41 IOMMU_FAULT_REASON_WALK_EABT,
42
43 /*
44 * Could not access the page table entry (Bad address),
45 * actual translation fault
46 */
47 IOMMU_FAULT_REASON_PTE_FETCH,
48
49 /* Protection flag check failed */
50 IOMMU_FAULT_REASON_PERMISSION,
51
52 /* access flag check failed */
53 IOMMU_FAULT_REASON_ACCESS,
54
55 /* Output address of a translation stage caused Address Size fault */
56 IOMMU_FAULT_REASON_OOR_ADDRESS,
57};
58
59/**
60 * struct iommu_fault_unrecoverable - Unrecoverable fault data
61 * @reason: reason of the fault, from &enum iommu_fault_reason
62 * @flags: parameters of this fault (IOMMU_FAULT_UNRECOV_* values)
63 * @pasid: Process Address Space ID
64 * @perm: requested permission access using by the incoming transaction
65 * (IOMMU_FAULT_PERM_* values)
66 * @addr: offending page address
67 * @fetch_addr: address that caused a fetch abort, if any
68 */
69struct iommu_fault_unrecoverable {
70 __u32 reason;
71#define IOMMU_FAULT_UNRECOV_PASID_VALID (1 << 0)
72#define IOMMU_FAULT_UNRECOV_ADDR_VALID (1 << 1)
73#define IOMMU_FAULT_UNRECOV_FETCH_ADDR_VALID (1 << 2)
74 __u32 flags;
75 __u32 pasid;
76 __u32 perm;
77 __u64 addr;
78 __u64 fetch_addr;
79};
80
81/**
82 * struct iommu_fault_page_request - Page Request data
83 * @flags: encodes whether the corresponding fields are valid and whether this
84 * is the last page in group (IOMMU_FAULT_PAGE_REQUEST_* values).
85 * When IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID is set, the page response
86 * must have the same PASID value as the page request. When it is clear,
87 * the page response should not have a PASID.
88 * @pasid: Process Address Space ID
89 * @grpid: Page Request Group Index
90 * @perm: requested page permissions (IOMMU_FAULT_PERM_* values)
91 * @addr: page address
92 * @private_data: device-specific private information
93 */
94struct iommu_fault_page_request {
95#define IOMMU_FAULT_PAGE_REQUEST_PASID_VALID (1 << 0)
96#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
97#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
98#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
99 __u32 flags;
100 __u32 pasid;
101 __u32 grpid;
102 __u32 perm;
103 __u64 addr;
104 __u64 private_data[2];
105};
106
107/**
108 * struct iommu_fault - Generic fault data
109 * @type: fault type from &enum iommu_fault_type
110 * @padding: reserved for future use (should be zero)
111 * @event: fault event, when @type is %IOMMU_FAULT_DMA_UNRECOV
112 * @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
113 * @padding2: sets the fault size to allow for future extensions
114 */
115struct iommu_fault {
116 __u32 type;
117 __u32 padding;
118 union {
119 struct iommu_fault_unrecoverable event;
120 struct iommu_fault_page_request prm;
121 __u8 padding2[56];
122 };
123};
124
125/**
126 * enum iommu_page_response_code - Return status of fault handlers
127 * @IOMMU_PAGE_RESP_SUCCESS: Fault has been handled and the page tables
128 * populated, retry the access. This is "Success" in PCI PRI.
129 * @IOMMU_PAGE_RESP_FAILURE: General error. Drop all subsequent faults from
130 * this device if possible. This is "Response Failure" in PCI PRI.
131 * @IOMMU_PAGE_RESP_INVALID: Could not handle this fault, don't retry the
132 * access. This is "Invalid Request" in PCI PRI.
133 */
134enum iommu_page_response_code {
135 IOMMU_PAGE_RESP_SUCCESS = 0,
136 IOMMU_PAGE_RESP_INVALID,
137 IOMMU_PAGE_RESP_FAILURE,
138};
139
140/**
141 * struct iommu_page_response - Generic page response information
142 * @argsz: User filled size of this data
143 * @version: API version of this structure
144 * @flags: encodes whether the corresponding fields are valid
145 * (IOMMU_FAULT_PAGE_RESPONSE_* values)
146 * @pasid: Process Address Space ID
147 * @grpid: Page Request Group Index
148 * @code: response code from &enum iommu_page_response_code
149 */
150struct iommu_page_response {
151 __u32 argsz;
152#define IOMMU_PAGE_RESP_VERSION_1 1
153 __u32 version;
154#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
155 __u32 flags;
156 __u32 pasid;
157 __u32 grpid;
158 __u32 code;
159};
160
161/* defines the granularity of the invalidation */
162enum iommu_inv_granularity {
163 IOMMU_INV_GRANU_DOMAIN, /* domain-selective invalidation */
164 IOMMU_INV_GRANU_PASID, /* PASID-selective invalidation */
165 IOMMU_INV_GRANU_ADDR, /* page-selective invalidation */
166 IOMMU_INV_GRANU_NR, /* number of invalidation granularities */
167};
168
169/**
170 * struct iommu_inv_addr_info - Address Selective Invalidation Structure
171 *
172 * @flags: indicates the granularity of the address-selective invalidation
173 * - If the PASID bit is set, the @pasid field is populated and the invalidation
174 * relates to cache entries tagged with this PASID and matching the address
175 * range.
176 * - If ARCHID bit is set, @archid is populated and the invalidation relates
177 * to cache entries tagged with this architecture specific ID and matching
178 * the address range.
179 * - Both PASID and ARCHID can be set as they may tag different caches.
180 * - If neither PASID or ARCHID is set, global addr invalidation applies.
181 * - The LEAF flag indicates whether only the leaf PTE caching needs to be
182 * invalidated and other paging structure caches can be preserved.
183 * @pasid: process address space ID
184 * @archid: architecture-specific ID
185 * @addr: first stage/level input address
186 * @granule_size: page/block size of the mapping in bytes
187 * @nb_granules: number of contiguous granules to be invalidated
188 */
189struct iommu_inv_addr_info {
190#define IOMMU_INV_ADDR_FLAGS_PASID (1 << 0)
191#define IOMMU_INV_ADDR_FLAGS_ARCHID (1 << 1)
192#define IOMMU_INV_ADDR_FLAGS_LEAF (1 << 2)
193 __u32 flags;
194 __u32 archid;
195 __u64 pasid;
196 __u64 addr;
197 __u64 granule_size;
198 __u64 nb_granules;
199};
200
201/**
202 * struct iommu_inv_pasid_info - PASID Selective Invalidation Structure
203 *
204 * @flags: indicates the granularity of the PASID-selective invalidation
205 * - If the PASID bit is set, the @pasid field is populated and the invalidation
206 * relates to cache entries tagged with this PASID and matching the address
207 * range.
208 * - If the ARCHID bit is set, the @archid is populated and the invalidation
209 * relates to cache entries tagged with this architecture specific ID and
210 * matching the address range.
211 * - Both PASID and ARCHID can be set as they may tag different caches.
212 * - At least one of PASID or ARCHID must be set.
213 * @pasid: process address space ID
214 * @archid: architecture-specific ID
215 */
216struct iommu_inv_pasid_info {
217#define IOMMU_INV_PASID_FLAGS_PASID (1 << 0)
218#define IOMMU_INV_PASID_FLAGS_ARCHID (1 << 1)
219 __u32 flags;
220 __u32 archid;
221 __u64 pasid;
222};
223
224/**
225 * struct iommu_cache_invalidate_info - First level/stage invalidation
226 * information
227 * @argsz: User filled size of this data
228 * @version: API version of this structure
229 * @cache: bitfield that allows to select which caches to invalidate
230 * @granularity: defines the lowest granularity used for the invalidation:
231 * domain > PASID > addr
232 * @padding: reserved for future use (should be zero)
233 * @pasid_info: invalidation data when @granularity is %IOMMU_INV_GRANU_PASID
234 * @addr_info: invalidation data when @granularity is %IOMMU_INV_GRANU_ADDR
235 *
236 * Not all the combinations of cache/granularity are valid:
237 *
238 * +--------------+---------------+---------------+---------------+
239 * | type / | DEV_IOTLB | IOTLB | PASID |
240 * | granularity | | | cache |
241 * +==============+===============+===============+===============+
242 * | DOMAIN | N/A | Y | Y |
243 * +--------------+---------------+---------------+---------------+
244 * | PASID | Y | Y | Y |
245 * +--------------+---------------+---------------+---------------+
246 * | ADDR | Y | Y | N/A |
247 * +--------------+---------------+---------------+---------------+
248 *
249 * Invalidations by %IOMMU_INV_GRANU_DOMAIN don't take any argument other than
250 * @version and @cache.
251 *
252 * If multiple cache types are invalidated simultaneously, they all
253 * must support the used granularity.
254 */
255struct iommu_cache_invalidate_info {
256 __u32 argsz;
257#define IOMMU_CACHE_INVALIDATE_INFO_VERSION_1 1
258 __u32 version;
259/* IOMMU paging structure cache */
260#define IOMMU_CACHE_INV_TYPE_IOTLB (1 << 0) /* IOMMU IOTLB */
261#define IOMMU_CACHE_INV_TYPE_DEV_IOTLB (1 << 1) /* Device IOTLB */
262#define IOMMU_CACHE_INV_TYPE_PASID (1 << 2) /* PASID cache */
263#define IOMMU_CACHE_INV_TYPE_NR (3)
264 __u8 cache;
265 __u8 granularity;
266 __u8 padding[6];
267 union {
268 struct iommu_inv_pasid_info pasid_info;
269 struct iommu_inv_addr_info addr_info;
270 } granu;
271};
272
273/**
274 * struct iommu_gpasid_bind_data_vtd - Intel VT-d specific data on device and guest
275 * SVA binding.
276 *
277 * @flags: VT-d PASID table entry attributes
278 * @pat: Page attribute table data to compute effective memory type
279 * @emt: Extended memory type
280 *
281 * Only guest vIOMMU selectable and effective options are passed down to
282 * the host IOMMU.
283 */
284struct iommu_gpasid_bind_data_vtd {
285#define IOMMU_SVA_VTD_GPASID_SRE (1 << 0) /* supervisor request */
286#define IOMMU_SVA_VTD_GPASID_EAFE (1 << 1) /* extended access enable */
287#define IOMMU_SVA_VTD_GPASID_PCD (1 << 2) /* page-level cache disable */
288#define IOMMU_SVA_VTD_GPASID_PWT (1 << 3) /* page-level write through */
289#define IOMMU_SVA_VTD_GPASID_EMTE (1 << 4) /* extended mem type enable */
290#define IOMMU_SVA_VTD_GPASID_CD (1 << 5) /* PASID-level cache disable */
291#define IOMMU_SVA_VTD_GPASID_WPE (1 << 6) /* Write protect enable */
292#define IOMMU_SVA_VTD_GPASID_LAST (1 << 7)
293 __u64 flags;
294 __u32 pat;
295 __u32 emt;
296};
297
298#define IOMMU_SVA_VTD_GPASID_MTS_MASK (IOMMU_SVA_VTD_GPASID_CD | \
299 IOMMU_SVA_VTD_GPASID_EMTE | \
300 IOMMU_SVA_VTD_GPASID_PCD | \
301 IOMMU_SVA_VTD_GPASID_PWT)
302
303/**
304 * struct iommu_gpasid_bind_data - Information about device and guest PASID binding
305 * @argsz: User filled size of this data
306 * @version: Version of this data structure
307 * @format: PASID table entry format
308 * @flags: Additional information on guest bind request
309 * @gpgd: Guest page directory base of the guest mm to bind
310 * @hpasid: Process address space ID used for the guest mm in host IOMMU
311 * @gpasid: Process address space ID used for the guest mm in guest IOMMU
312 * @addr_width: Guest virtual address width
313 * @padding: Reserved for future use (should be zero)
314 * @vtd: Intel VT-d specific data
315 *
316 * Guest to host PASID mapping can be an identity or non-identity, where guest
317 * has its own PASID space. For non-identify mapping, guest to host PASID lookup
318 * is needed when VM programs guest PASID into an assigned device. VMM may
319 * trap such PASID programming then request host IOMMU driver to convert guest
320 * PASID to host PASID based on this bind data.
321 */
322struct iommu_gpasid_bind_data {
323 __u32 argsz;
324#define IOMMU_GPASID_BIND_VERSION_1 1
325 __u32 version;
326#define IOMMU_PASID_FORMAT_INTEL_VTD 1
327#define IOMMU_PASID_FORMAT_LAST 2
328 __u32 format;
329 __u32 addr_width;
330#define IOMMU_SVA_GPASID_VAL (1 << 0) /* guest PASID valid */
331 __u64 flags;
332 __u64 gpgd;
333 __u64 hpasid;
334 __u64 gpasid;
335 __u8 padding[8];
336 /* Vendor specific data */
337 union {
338 struct iommu_gpasid_bind_data_vtd vtd;
339 } vendor;
340};
341
342#endif /* _IOMMU_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioprio.h created+52
...@@ -0,0 +1,52 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_IOPRIO_H
3#define _LINUX_IOPRIO_H
4
5/*
6 * Gives us 8 prio classes with 13-bits of data for each class
7 */
8#define IOPRIO_CLASS_SHIFT 13
9#define IOPRIO_CLASS_MASK 0x07
10#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
11
12#define IOPRIO_PRIO_CLASS(ioprio) \
13 (((ioprio) >> IOPRIO_CLASS_SHIFT) & IOPRIO_CLASS_MASK)
14#define IOPRIO_PRIO_DATA(ioprio) ((ioprio) & IOPRIO_PRIO_MASK)
15#define IOPRIO_PRIO_VALUE(class, data) \
16 ((((class) & IOPRIO_CLASS_MASK) << IOPRIO_CLASS_SHIFT) | \
17 ((data) & IOPRIO_PRIO_MASK))
18
19/*
20 * These are the io priority groups as implemented by the BFQ and mq-deadline
21 * schedulers. RT is the realtime class, it always gets premium service. For
22 * ATA disks supporting NCQ IO priority, RT class IOs will be processed using
23 * high priority NCQ commands. BE is the best-effort scheduling class, the
24 * default for any process. IDLE is the idle scheduling class, it is only
25 * served when no one else is using the disk.
26 */
27enum {
28 IOPRIO_CLASS_NONE,
29 IOPRIO_CLASS_RT,
30 IOPRIO_CLASS_BE,
31 IOPRIO_CLASS_IDLE,
32};
33
34/*
35 * The RT and BE priority classes both support up to 8 priority levels.
36 */
37#define IOPRIO_NR_LEVELS 8
38#define IOPRIO_BE_NR IOPRIO_NR_LEVELS
39
40enum {
41 IOPRIO_WHO_PROCESS = 1,
42 IOPRIO_WHO_PGRP,
43 IOPRIO_WHO_USER,
44};
45
46/*
47 * Fallback BE priority level.
48 */
49#define IOPRIO_NORM 4
50#define IOPRIO_BE_NORM IOPRIO_NORM
51
52#endif /* _LINUX_IOPRIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ip.h+1
...@@ -169,6 +169,7 @@ enum...@@ -169,6 +169,7 @@ enum
169 IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,169 IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
170 IPV4_DEVCONF_DROP_GRATUITOUS_ARP,170 IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
171 IPV4_DEVCONF_BC_FORWARDING,171 IPV4_DEVCONF_BC_FORWARDING,
172 IPV4_DEVCONF_ARP_EVICT_NOCARRIER,
172 __IPV4_DEVCONF_MAX173 __IPV4_DEVCONF_MAX
173};174};
174175
lib/libc/include/any-linux-any/linux/ip_vs.h+19
...@@ -124,6 +124,19 @@...@@ -124,6 +124,19 @@
124124
125#define IP_VS_PEDATA_MAXLEN 255125#define IP_VS_PEDATA_MAXLEN 255
126126
127/* Tunnel types */
128enum {
129 IP_VS_CONN_F_TUNNEL_TYPE_IPIP = 0, /* IPIP */
130 IP_VS_CONN_F_TUNNEL_TYPE_GUE, /* GUE */
131 IP_VS_CONN_F_TUNNEL_TYPE_GRE, /* GRE */
132 IP_VS_CONN_F_TUNNEL_TYPE_MAX,
133};
134
135/* Tunnel encapsulation flags */
136#define IP_VS_TUNNEL_ENCAP_FLAG_NOCSUM (0)
137#define IP_VS_TUNNEL_ENCAP_FLAG_CSUM (1 << 0)
138#define IP_VS_TUNNEL_ENCAP_FLAG_REMCSUM (1 << 1)
139
127/*140/*
128 * The struct ip_vs_service_user and struct ip_vs_dest_user are141 * The struct ip_vs_service_user and struct ip_vs_dest_user are
129 * used to set IPVS rules through setsockopt.142 * used to set IPVS rules through setsockopt.
...@@ -392,6 +405,12 @@ enum {...@@ -392,6 +405,12 @@ enum {
392405
393 IPVS_DEST_ATTR_STATS64, /* nested attribute for dest stats */406 IPVS_DEST_ATTR_STATS64, /* nested attribute for dest stats */
394407
408 IPVS_DEST_ATTR_TUN_TYPE, /* tunnel type */
409
410 IPVS_DEST_ATTR_TUN_PORT, /* tunnel port */
411
412 IPVS_DEST_ATTR_TUN_FLAGS, /* tunnel flags */
413
395 __IPVS_DEST_ATTR_MAX,414 __IPVS_DEST_ATTR_MAX,
396};415};
397416
lib/libc/include/any-linux-any/linux/ipmi.h+15-1
...@@ -80,6 +80,20 @@ struct ipmi_ipmb_addr {...@@ -80,6 +80,20 @@ struct ipmi_ipmb_addr {
80 unsigned char lun;80 unsigned char lun;
81};81};
8282
83/*
84 * Used for messages received directly from an IPMB that have not gone
85 * through a MC. This is for systems that sit right on an IPMB so
86 * they can receive commands and respond to them.
87 */
88#define IPMI_IPMB_DIRECT_ADDR_TYPE 0x81
89struct ipmi_ipmb_direct_addr {
90 int addr_type;
91 short channel;
92 unsigned char slave_addr;
93 unsigned char rs_lun;
94 unsigned char rq_lun;
95};
96
83/*97/*
84 * A LAN Address. This is an address to/from a LAN interface bridged98 * A LAN Address. This is an address to/from a LAN interface bridged
85 * by the BMC, not an address actually out on the LAN.99 * by the BMC, not an address actually out on the LAN.
...@@ -158,7 +172,7 @@ struct kernel_ipmi_msg {...@@ -158,7 +172,7 @@ struct kernel_ipmi_msg {
158 * is used for the receive in-kernel interface and in the receive172 * is used for the receive in-kernel interface and in the receive
159 * IOCTL.173 * IOCTL.
160 *174 *
161 * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but175 * The "IPMI_RESPONSE_RESPONSE_TYPE" is a little strange sounding, but
162 * it allows you to get the message results when you send a response176 * it allows you to get the message results when you send a response
163 * message.177 * message.
164 */178 */
lib/libc/include/any-linux-any/linux/ipmi_bmc.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2015-2018, Intel Corporation.3 * Copyright (c) 2015-2018, Intel Corporation.
4 */4 */
lib/libc/include/any-linux-any/linux/ipmi_msgdefs.h+2
...@@ -69,6 +69,8 @@...@@ -69,6 +69,8 @@
69#define IPMI_ERR_MSG_TRUNCATED 0xc669#define IPMI_ERR_MSG_TRUNCATED 0xc6
70#define IPMI_REQ_LEN_INVALID_ERR 0xc770#define IPMI_REQ_LEN_INVALID_ERR 0xc7
71#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc871#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc8
72#define IPMI_DEVICE_IN_FW_UPDATE_ERR 0xd1
73#define IPMI_DEVICE_IN_INIT_ERR 0xd2
72#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */74#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */
73#define IPMI_LOST_ARBITRATION_ERR 0x8175#define IPMI_LOST_ARBITRATION_ERR 0x81
74#define IPMI_BUS_ERR 0x8276#define IPMI_BUS_ERR 0x82
lib/libc/include/any-linux-any/linux/ipv6.h+7
...@@ -40,6 +40,7 @@ struct in6_ifreq {...@@ -40,6 +40,7 @@ struct in6_ifreq {
40#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */40#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
41#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */41#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
42#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */42#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
43#define IPV6_SRCRT_TYPE_3 3 /* RPL Segment Routing with IPv6 */
43#define IPV6_SRCRT_TYPE_4 4 /* Segment Routing with IPv6 */44#define IPV6_SRCRT_TYPE_4 4 /* Segment Routing with IPv6 */
4445
45/*46/*
...@@ -187,6 +188,12 @@ enum {...@@ -187,6 +188,12 @@ enum {
187 DEVCONF_DISABLE_POLICY,188 DEVCONF_DISABLE_POLICY,
188 DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN,189 DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN,
189 DEVCONF_NDISC_TCLASS,190 DEVCONF_NDISC_TCLASS,
191 DEVCONF_RPL_SEG_ENABLED,
192 DEVCONF_RA_DEFRTR_METRIC,
193 DEVCONF_IOAM6_ENABLED,
194 DEVCONF_IOAM6_ID,
195 DEVCONF_IOAM6_ID_WIDE,
196 DEVCONF_NDISC_EVICT_NOCARRIER,
190 DEVCONF_MAX197 DEVCONF_MAX
191};198};
192199
lib/libc/include/any-linux-any/linux/ipx.h deleted-87
...@@ -1,87 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _IPX_H_
3#define _IPX_H_
4#include <linux/libc-compat.h> /* for compatibility with glibc netipx/ipx.h */
5#include <linux/types.h>
6#include <linux/sockios.h>
7#include <linux/socket.h>
8#define IPX_NODE_LEN 6
9#define IPX_MTU 576
10
11#if __UAPI_DEF_SOCKADDR_IPX
12struct sockaddr_ipx {
13 __kernel_sa_family_t sipx_family;
14 __be16 sipx_port;
15 __be32 sipx_network;
16 unsigned char sipx_node[IPX_NODE_LEN];
17 __u8 sipx_type;
18 unsigned char sipx_zero; /* 16 byte fill */
19};
20#endif /* __UAPI_DEF_SOCKADDR_IPX */
21
22/*
23 * So we can fit the extra info for SIOCSIFADDR into the address nicely
24 */
25#define sipx_special sipx_port
26#define sipx_action sipx_zero
27#define IPX_DLTITF 0
28#define IPX_CRTITF 1
29
30#if __UAPI_DEF_IPX_ROUTE_DEFINITION
31struct ipx_route_definition {
32 __be32 ipx_network;
33 __be32 ipx_router_network;
34 unsigned char ipx_router_node[IPX_NODE_LEN];
35};
36#endif /* __UAPI_DEF_IPX_ROUTE_DEFINITION */
37
38#if __UAPI_DEF_IPX_INTERFACE_DEFINITION
39struct ipx_interface_definition {
40 __be32 ipx_network;
41 unsigned char ipx_device[16];
42 unsigned char ipx_dlink_type;
43#define IPX_FRAME_NONE 0
44#define IPX_FRAME_SNAP 1
45#define IPX_FRAME_8022 2
46#define IPX_FRAME_ETHERII 3
47#define IPX_FRAME_8023 4
48#define IPX_FRAME_TR_8022 5 /* obsolete */
49 unsigned char ipx_special;
50#define IPX_SPECIAL_NONE 0
51#define IPX_PRIMARY 1
52#define IPX_INTERNAL 2
53 unsigned char ipx_node[IPX_NODE_LEN];
54};
55#endif /* __UAPI_DEF_IPX_INTERFACE_DEFINITION */
56
57#if __UAPI_DEF_IPX_CONFIG_DATA
58struct ipx_config_data {
59 unsigned char ipxcfg_auto_select_primary;
60 unsigned char ipxcfg_auto_create_interfaces;
61};
62#endif /* __UAPI_DEF_IPX_CONFIG_DATA */
63
64/*
65 * OLD Route Definition for backward compatibility.
66 */
67
68#if __UAPI_DEF_IPX_ROUTE_DEF
69struct ipx_route_def {
70 __be32 ipx_network;
71 __be32 ipx_router_network;
72#define IPX_ROUTE_NO_ROUTER 0
73 unsigned char ipx_router_node[IPX_NODE_LEN];
74 unsigned char ipx_device[16];
75 unsigned short ipx_flags;
76#define IPX_RT_SNAP 8
77#define IPX_RT_8022 4
78#define IPX_RT_BLUEBOOK 2
79#define IPX_RT_ROUTED 1
80};
81#endif /* __UAPI_DEF_IPX_ROUTE_DEF */
82
83#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
84#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
85#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
86#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
87#endif /* _IPX_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/isdn.h deleted-144
...@@ -1,144 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
3 *
4 * Main header for the Linux ISDN subsystem (linklevel).
5 *
6 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
7 * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
8 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
9 *
10 * This software may be used and distributed according to the terms
11 * of the GNU General Public License, incorporated herein by reference.
12 *
13 */
14
15#ifndef __ISDN_H__
16#define __ISDN_H__
17
18#include <linux/ioctl.h>
19#include <linux/tty.h>
20
21#define ISDN_MAX_DRIVERS 32
22#define ISDN_MAX_CHANNELS 64
23
24/* New ioctl-codes */
25#define IIOCNETAIF _IO('I',1)
26#define IIOCNETDIF _IO('I',2)
27#define IIOCNETSCF _IO('I',3)
28#define IIOCNETGCF _IO('I',4)
29#define IIOCNETANM _IO('I',5)
30#define IIOCNETDNM _IO('I',6)
31#define IIOCNETGNM _IO('I',7)
32#define IIOCGETSET _IO('I',8) /* no longer supported */
33#define IIOCSETSET _IO('I',9) /* no longer supported */
34#define IIOCSETVER _IO('I',10)
35#define IIOCNETHUP _IO('I',11)
36#define IIOCSETGST _IO('I',12)
37#define IIOCSETBRJ _IO('I',13)
38#define IIOCSIGPRF _IO('I',14)
39#define IIOCGETPRF _IO('I',15)
40#define IIOCSETPRF _IO('I',16)
41#define IIOCGETMAP _IO('I',17)
42#define IIOCSETMAP _IO('I',18)
43#define IIOCNETASL _IO('I',19)
44#define IIOCNETDIL _IO('I',20)
45#define IIOCGETCPS _IO('I',21)
46#define IIOCGETDVR _IO('I',22)
47#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
48#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
49
50#define IIOCNETALN _IO('I',32)
51#define IIOCNETDLN _IO('I',33)
52
53#define IIOCNETGPN _IO('I',34)
54
55#define IIOCDBGVAR _IO('I',127)
56
57#define IIOCDRVCTL _IO('I',128)
58
59/* cisco hdlck device private ioctls */
60#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
61#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
62#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
63#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
64
65/* Packet encapsulations for net-interfaces */
66#define ISDN_NET_ENCAP_ETHER 0
67#define ISDN_NET_ENCAP_RAWIP 1
68#define ISDN_NET_ENCAP_IPTYP 2
69#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
70#define ISDN_NET_ENCAP_SYNCPPP 4
71#define ISDN_NET_ENCAP_UIHDLC 5
72#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
73#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
74#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
75
76/* Facility which currently uses an ISDN-channel */
77#define ISDN_USAGE_NONE 0
78#define ISDN_USAGE_RAW 1
79#define ISDN_USAGE_MODEM 2
80#define ISDN_USAGE_NET 3
81#define ISDN_USAGE_VOICE 4
82#define ISDN_USAGE_FAX 5
83#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
84#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
85#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
86#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
87
88#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
89#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
90#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
91
92#define ISDN_MSNLEN 32
93#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
94#define TTY_DV 0x06 /* Data version for iprofd etc. */
95
96#define INF_DV 0x01 /* Data version for /dev/isdninfo */
97
98typedef struct {
99 char drvid[25];
100 unsigned long arg;
101} isdn_ioctl_struct;
102
103typedef struct {
104 char name[10];
105 char phone[ISDN_MSNLEN];
106 int outgoing;
107} isdn_net_ioctl_phone;
108
109typedef struct {
110 char name[10]; /* Name of interface */
111 char master[10]; /* Name of Master for Bundling */
112 char slave[10]; /* Name of Slave for Bundling */
113 char eaz[256]; /* EAZ/MSN */
114 char drvid[25]; /* DriverId for Bindings */
115 int onhtime; /* Hangup-Timeout */
116 int charge; /* Charge-Units */
117 int l2_proto; /* Layer-2 protocol */
118 int l3_proto; /* Layer-3 protocol */
119 int p_encap; /* Encapsulation */
120 int exclusive; /* Channel, if bound exclusive */
121 int dialmax; /* Dial Retry-Counter */
122 int slavedelay; /* Delay until slave starts up */
123 int cbdelay; /* Delay before Callback */
124 int chargehup; /* Flag: Charge-Hangup */
125 int ihup; /* Flag: Hangup-Timeout on incoming line */
126 int secure; /* Flag: Secure */
127 int callback; /* Flag: Callback */
128 int cbhup; /* Flag: Reject Call before Callback */
129 int pppbind; /* ippp device for bindings */
130 int chargeint; /* Use fixed charge interval length */
131 int triggercps; /* BogoCPS needed for triggering slave */
132 int dialtimeout; /* Dial-Timeout */
133 int dialwait; /* Time to wait after failed dial */
134 int dialmode; /* Flag: off / on / auto */
135} isdn_net_ioctl_cfg;
136
137#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
138#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
139#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
140#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
141#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
142
143
144#endif /* __ISDN_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/isdn/capicmd.h+1
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#define CAPI_MSG_BASELEN 816#define CAPI_MSG_BASELEN 8
17#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)17#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)
18#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2)18#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2)
19#define CAPI_DISCONNECT_B3_RESP_LEN (CAPI_MSG_BASELEN+4)
1920
20/*----- CAPI commands -----*/21/*----- CAPI commands -----*/
21#define CAPI_ALERT 0x0122#define CAPI_ALERT 0x01
lib/libc/include/any-linux-any/linux/isdn_divertif.h deleted-31
...@@ -1,31 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
3 *
4 * Header for the diversion supplementary interface for i4l.
5 *
6 * Author Werner Cornelius (werner@titro.de)
7 * Copyright by Werner Cornelius (werner@titro.de)
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13
14#ifndef _LINUX_ISDN_DIVERTIF_H
15#define _LINUX_ISDN_DIVERTIF_H
16
17/***********************************************************/
18/* magic value is also used to control version information */
19/***********************************************************/
20#define DIVERT_IF_MAGIC 0x25873401
21#define DIVERT_CMD_REG 0x00 /* register command */
22#define DIVERT_CMD_REL 0x01 /* release command */
23#define DIVERT_NO_ERR 0x00 /* return value no error */
24#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
25#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
26#define DIVERT_REG_ERR 0x03 /* module already registered */
27#define DIVERT_REL_ERR 0x04 /* module not registered */
28#define DIVERT_REG_NAME isdn_register_divert
29
30
31#endif /* _LINUX_ISDN_DIVERTIF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/isdn_ppp.h deleted-68
...@@ -1,68 +0,0 @@
1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2/* Linux ISDN subsystem, sync PPP, interface to ipppd
3 *
4 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
5 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
6 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
7 * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13
14#ifndef _LINUX_ISDN_PPP_H
15#define _LINUX_ISDN_PPP_H
16
17#define CALLTYPE_INCOMING 0x1
18#define CALLTYPE_OUTGOING 0x2
19#define CALLTYPE_CALLBACK 0x4
20
21#define IPPP_VERSION "2.2.0"
22
23struct pppcallinfo
24{
25 int calltype;
26 unsigned char local_num[64];
27 unsigned char remote_num[64];
28 int charge_units;
29};
30
31#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
32#define PPPIOCBUNDLE _IOW('t',129,int)
33#define PPPIOCGMPFLAGS _IOR('t',130,int)
34#define PPPIOCSMPFLAGS _IOW('t',131,int)
35#define PPPIOCSMPMTU _IOW('t',132,int)
36#define PPPIOCSMPMRU _IOW('t',133,int)
37#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
38#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
39#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
40
41
42#define SC_MP_PROT 0x00000200
43#define SC_REJ_MP_PROT 0x00000400
44#define SC_OUT_SHORT_SEQ 0x00000800
45#define SC_IN_SHORT_SEQ 0x00004000
46
47#define SC_DECOMP_ON 0x01
48#define SC_COMP_ON 0x02
49#define SC_DECOMP_DISCARD 0x04
50#define SC_COMP_DISCARD 0x08
51#define SC_LINK_DECOMP_ON 0x10
52#define SC_LINK_COMP_ON 0x20
53#define SC_LINK_DECOMP_DISCARD 0x40
54#define SC_LINK_COMP_DISCARD 0x80
55
56#define ISDN_PPP_COMP_MAX_OPTIONS 16
57
58#define IPPP_COMP_FLAG_XMIT 0x1
59#define IPPP_COMP_FLAG_LINK 0x2
60
61struct isdn_ppp_comp_data {
62 int num;
63 unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
64 int optlen;
65 int flags;
66};
67
68#endif /* _LINUX_ISDN_PPP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/isdnif.h deleted-57
...@@ -1,57 +0,0 @@
1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
3 *
4 * Linux ISDN subsystem
5 * Definition of the interface between the subsystem and its low-level drivers.
6 *
7 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
8 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
9 *
10 * This software may be used and distributed according to the terms
11 * of the GNU General Public License, incorporated herein by reference.
12 *
13 */
14
15#ifndef __ISDNIF_H__
16#define __ISDNIF_H__
17
18
19/*
20 * Values for general protocol-selection
21 */
22#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
23#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
24#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
25#define ISDN_PTYPE_LEASED 3 /* for leased lines */
26#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
27#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
28
29/*
30 * Values for Layer-2-protocol-selection
31 */
32#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
33#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
34#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
35#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
36#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
37#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
38#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
39#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
40#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
41#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
42#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
43#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
44#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
45#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
46
47/*
48 * Values for Layer-3-protocol-selection
49 */
50#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
51#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
52#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
53#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
54#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
55
56
57#endif /* __ISDNIF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/isst_if.h created+172
...@@ -0,0 +1,172 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Intel Speed Select Interface: OS to hardware Interface
4 * Copyright (c) 2019, Intel Corporation.
5 * All rights reserved.
6 *
7 * Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
8 */
9
10#ifndef __ISST_IF_H
11#define __ISST_IF_H
12
13#include <linux/types.h>
14
15/**
16 * struct isst_if_platform_info - Define platform information
17 * @api_version: Version of the firmware document, which this driver
18 * can communicate
19 * @driver_version: Driver version, which will help user to send right
20 * commands. Even if the firmware is capable, driver may
21 * not be ready
22 * @max_cmds_per_ioctl: Returns the maximum number of commands driver will
23 * accept in a single ioctl
24 * @mbox_supported: Support of mail box interface
25 * @mmio_supported: Support of mmio interface for core-power feature
26 *
27 * Used to return output of IOCTL ISST_IF_GET_PLATFORM_INFO. This
28 * information can be used by the user space, to get the driver, firmware
29 * support and also number of commands to send in a single IOCTL request.
30 */
31struct isst_if_platform_info {
32 __u16 api_version;
33 __u16 driver_version;
34 __u16 max_cmds_per_ioctl;
35 __u8 mbox_supported;
36 __u8 mmio_supported;
37};
38
39/**
40 * struct isst_if_cpu_map - CPU mapping between logical and physical CPU
41 * @logical_cpu: Linux logical CPU number
42 * @physical_cpu: PUNIT CPU number
43 *
44 * Used to convert from Linux logical CPU to PUNIT CPU numbering scheme.
45 * The PUNIT CPU number is different than APIC ID based CPU numbering.
46 */
47struct isst_if_cpu_map {
48 __u32 logical_cpu;
49 __u32 physical_cpu;
50};
51
52/**
53 * struct isst_if_cpu_maps - structure for CPU map IOCTL
54 * @cmd_count: Number of CPU mapping command in cpu_map[]
55 * @cpu_map[]: Holds one or more CPU map data structure
56 *
57 * This structure used with ioctl ISST_IF_GET_PHY_ID to send
58 * one or more CPU mapping commands. Here IOCTL return value indicates
59 * number of commands sent or error number if no commands have been sent.
60 */
61struct isst_if_cpu_maps {
62 __u32 cmd_count;
63 struct isst_if_cpu_map cpu_map[1];
64};
65
66/**
67 * struct isst_if_io_reg - Read write PUNIT IO register
68 * @read_write: Value 0: Read, 1: Write
69 * @logical_cpu: Logical CPU number to get target PCI device.
70 * @reg: PUNIT register offset
71 * @value: For write operation value to write and for
72 * read placeholder read value
73 *
74 * Structure to specify read/write data to PUNIT registers.
75 */
76struct isst_if_io_reg {
77 __u32 read_write; /* Read:0, Write:1 */
78 __u32 logical_cpu;
79 __u32 reg;
80 __u32 value;
81};
82
83/**
84 * 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
87 *
88 * This structure used with ioctl ISST_IF_IO_CMD to send
89 * one or more read/write commands to PUNIT. Here IOCTL return value
90 * indicates number of requests sent or error number if no requests have
91 * been sent.
92 */
93struct isst_if_io_regs {
94 __u32 req_count;
95 struct isst_if_io_reg io_reg[1];
96};
97
98/**
99 * struct isst_if_mbox_cmd - Structure to define mail box command
100 * @logical_cpu: Logical CPU number to get target PCI device
101 * @parameter: Mailbox parameter value
102 * @req_data: Request data for the mailbox
103 * @resp_data: Response data for mailbox command response
104 * @command: Mailbox command value
105 * @sub_command: Mailbox sub command value
106 * @reserved: Unused, set to 0
107 *
108 * Structure to specify mailbox command to be sent to PUNIT.
109 */
110struct isst_if_mbox_cmd {
111 __u32 logical_cpu;
112 __u32 parameter;
113 __u32 req_data;
114 __u32 resp_data;
115 __u16 command;
116 __u16 sub_command;
117 __u32 reserved;
118};
119
120/**
121 * struct isst_if_mbox_cmds - structure for mailbox commands
122 * @cmd_count: Number of mailbox commands in mbox_cmd[]
123 * @mbox_cmd[]: Holds one or more mbox commands
124 *
125 * This structure used with ioctl ISST_IF_MBOX_COMMAND to send
126 * one or more mailbox commands to PUNIT. Here IOCTL return value
127 * indicates number of commands sent or error number if no commands have
128 * been sent.
129 */
130struct isst_if_mbox_cmds {
131 __u32 cmd_count;
132 struct isst_if_mbox_cmd mbox_cmd[1];
133};
134
135/**
136 * struct isst_if_msr_cmd - Structure to define msr command
137 * @read_write: Value 0: Read, 1: Write
138 * @logical_cpu: Logical CPU number
139 * @msr: MSR number
140 * @data: For write operation, data to write, for read
141 * place holder
142 *
143 * Structure to specify MSR command related to PUNIT.
144 */
145struct isst_if_msr_cmd {
146 __u32 read_write; /* Read:0, Write:1 */
147 __u32 logical_cpu;
148 __u64 msr;
149 __u64 data;
150};
151
152/**
153 * struct isst_if_msr_cmds - structure for msr commands
154 * @cmd_count: Number of mailbox commands in msr_cmd[]
155 * @msr_cmd[]: Holds one or more msr commands
156 *
157 * This structure used with ioctl ISST_IF_MSR_COMMAND to send
158 * one or more MSR commands. IOCTL return value indicates number of
159 * commands sent or error number if no commands have been sent.
160 */
161struct isst_if_msr_cmds {
162 __u32 cmd_count;
163 struct isst_if_msr_cmd msr_cmd[1];
164};
165
166#define ISST_IF_MAGIC 0xFE
167#define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *)
168#define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *)
169#define ISST_IF_IO_CMD _IOW(ISST_IF_MAGIC, 2, struct isst_if_io_regs *)
170#define ISST_IF_MBOX_COMMAND _IOWR(ISST_IF_MAGIC, 3, struct isst_if_mbox_cmds *)
171#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *)
172#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/jffs2.h-5
...@@ -77,11 +77,6 @@...@@ -77,11 +77,6 @@
7777
78#define JFFS2_ACL_VERSION 0x000178#define JFFS2_ACL_VERSION 0x0001
7979
80// Maybe later...
81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
83
84
85#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at80#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
86 mount time, don't wait for it to81 mount time, don't wait for it to
87 happen later */82 happen later */
lib/libc/include/any-linux-any/linux/kcov.h+28
...@@ -4,9 +4,24 @@...@@ -4,9 +4,24 @@
44
5#include <linux/types.h>5#include <linux/types.h>
66
7/*
8 * Argument for KCOV_REMOTE_ENABLE ioctl, see Documentation/dev-tools/kcov.rst
9 * and the comment before kcov_remote_start() for usage details.
10 */
11struct kcov_remote_arg {
12 __u32 trace_mode; /* KCOV_TRACE_PC or KCOV_TRACE_CMP */
13 __u32 area_size; /* Length of coverage buffer in words */
14 __u32 num_handles; /* Size of handles array */
15 __aligned_u64 common_handle;
16 __aligned_u64 handles[0];
17};
18
19#define KCOV_REMOTE_MAX_HANDLES 0x100
20
7#define KCOV_INIT_TRACE _IOR('c', 1, unsigned long)21#define KCOV_INIT_TRACE _IOR('c', 1, unsigned long)
8#define KCOV_ENABLE _IO('c', 100)22#define KCOV_ENABLE _IO('c', 100)
9#define KCOV_DISABLE _IO('c', 101)23#define KCOV_DISABLE _IO('c', 101)
24#define KCOV_REMOTE_ENABLE _IOW('c', 102, struct kcov_remote_arg)
1025
11enum {26enum {
12 /*27 /*
...@@ -32,4 +47,17 @@ enum {...@@ -32,4 +47,17 @@ enum {
32#define KCOV_CMP_SIZE(n) ((n) << 1)47#define KCOV_CMP_SIZE(n) ((n) << 1)
33#define KCOV_CMP_MASK KCOV_CMP_SIZE(3)48#define KCOV_CMP_MASK KCOV_CMP_SIZE(3)
3449
50#define KCOV_SUBSYSTEM_COMMON (0x00ull << 56)
51#define KCOV_SUBSYSTEM_USB (0x01ull << 56)
52
53#define KCOV_SUBSYSTEM_MASK (0xffull << 56)
54#define KCOV_INSTANCE_MASK (0xffffffffull)
55
56static __inline__ __u64 kcov_remote_handle(__u64 subsys, __u64 inst)
57{
58 if (subsys & ~KCOV_SUBSYSTEM_MASK || inst & ~KCOV_INSTANCE_MASK)
59 return 0;
60 return subsys | inst;
61}
62
35#endif /* _LINUX_KCOV_IOCTLS_H */63#endif /* _LINUX_KCOV_IOCTLS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kd.h+1-1
...@@ -173,7 +173,7 @@ struct console_font {...@@ -173,7 +173,7 @@ struct console_font {
173#define KD_FONT_OP_SET 0 /* Set font */173#define KD_FONT_OP_SET 0 /* Set font */
174#define KD_FONT_OP_GET 1 /* Get font */174#define KD_FONT_OP_GET 1 /* Get font */
175#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */175#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
176#define KD_FONT_OP_COPY 3 /* Copy from another console */176#define KD_FONT_OP_COPY 3 /* Obsolete, do not use */
177177
178#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */178#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
179179
lib/libc/include/any-linux-any/linux/kernel-page-flags.h+1-1
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
3232
33#define KPF_KSM 2133#define KPF_KSM 21
34#define KPF_THP 2234#define KPF_THP 22
35#define KPF_BALLOON 2335#define KPF_OFFLINE 23
36#define KPF_ZERO_PAGE 2436#define KPF_ZERO_PAGE 24
37#define KPF_IDLE 2537#define KPF_IDLE 25
38#define KPF_PGTABLE 2638#define KPF_PGTABLE 26
lib/libc/include/any-linux-any/linux/kernel.h+1-8
...@@ -3,13 +3,6 @@...@@ -3,13 +3,6 @@
3#define _LINUX_KERNEL_H3#define _LINUX_KERNEL_H
44
5#include <linux/sysinfo.h>5#include <linux/sysinfo.h>
66#include <linux/const.h>
7/*
8 * 'kernel.h' contains some often-used function prototypes etc
9 */
10#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
11#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
12
13#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
147
15#endif /* _LINUX_KERNEL_H */8#endif /* _LINUX_KERNEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kexec.h+2
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
31#define KEXEC_ARCH_DEFAULT ( 0 << 16)31#define KEXEC_ARCH_DEFAULT ( 0 << 16)
32#define KEXEC_ARCH_386 ( 3 << 16)32#define KEXEC_ARCH_386 ( 3 << 16)
33#define KEXEC_ARCH_68K ( 4 << 16)33#define KEXEC_ARCH_68K ( 4 << 16)
34#define KEXEC_ARCH_PARISC (15 << 16)
34#define KEXEC_ARCH_X86_64 (62 << 16)35#define KEXEC_ARCH_X86_64 (62 << 16)
35#define KEXEC_ARCH_PPC (20 << 16)36#define KEXEC_ARCH_PPC (20 << 16)
36#define KEXEC_ARCH_PPC64 (21 << 16)37#define KEXEC_ARCH_PPC64 (21 << 16)
...@@ -41,6 +42,7 @@...@@ -41,6 +42,7 @@
41#define KEXEC_ARCH_MIPS_LE (10 << 16)42#define KEXEC_ARCH_MIPS_LE (10 << 16)
42#define KEXEC_ARCH_MIPS ( 8 << 16)43#define KEXEC_ARCH_MIPS ( 8 << 16)
43#define KEXEC_ARCH_AARCH64 (183 << 16)44#define KEXEC_ARCH_AARCH64 (183 << 16)
45#define KEXEC_ARCH_RISCV (243 << 16)
4446
45/* The artificial cap on the number of segments passed to kexec_load. */47/* The artificial cap on the number of segments passed to kexec_load. */
46#define KEXEC_SEGMENT_MAX 1648#define KEXEC_SEGMENT_MAX 16
lib/libc/include/any-linux-any/linux/keyboard.h+1-1
...@@ -27,7 +27,6 @@...@@ -27,7 +27,6 @@
27#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */27#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
2828
29#define KT_LATIN 0 /* we depend on this being zero */29#define KT_LATIN 0 /* we depend on this being zero */
30#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
31#define KT_FN 130#define KT_FN 1
32#define KT_SPEC 231#define KT_SPEC 2
33#define KT_PAD 332#define KT_PAD 3
...@@ -38,6 +37,7 @@...@@ -38,6 +37,7 @@
38#define KT_META 837#define KT_META 8
39#define KT_ASCII 938#define KT_ASCII 9
40#define KT_LOCK 1039#define KT_LOCK 10
40#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
41#define KT_SLOCK 1241#define KT_SLOCK 12
42#define KT_DEAD2 1342#define KT_DEAD2 13
43#define KT_BRL 1443#define KT_BRL 14
lib/libc/include/any-linux-any/linux/keyctl.h+57-1
...@@ -61,11 +61,24 @@...@@ -61,11 +61,24 @@
61#define KEYCTL_INVALIDATE 21 /* invalidate a key */61#define KEYCTL_INVALIDATE 21 /* invalidate a key */
62#define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */62#define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */
63#define KEYCTL_DH_COMPUTE 23 /* Compute Diffie-Hellman values */63#define KEYCTL_DH_COMPUTE 23 /* Compute Diffie-Hellman values */
64#define KEYCTL_PKEY_QUERY 24 /* Query public key parameters */
65#define KEYCTL_PKEY_ENCRYPT 25 /* Encrypt a blob using a public key */
66#define KEYCTL_PKEY_DECRYPT 26 /* Decrypt a blob using a public key */
67#define KEYCTL_PKEY_SIGN 27 /* Create a public key signature */
68#define KEYCTL_PKEY_VERIFY 28 /* Verify a public key signature */
64#define KEYCTL_RESTRICT_KEYRING 29 /* Restrict keys allowed to link to a keyring */69#define KEYCTL_RESTRICT_KEYRING 29 /* Restrict keys allowed to link to a keyring */
70#define KEYCTL_MOVE 30 /* Move keys between keyrings */
71#define KEYCTL_CAPABILITIES 31 /* Find capabilities of keyrings subsystem */
72#define KEYCTL_WATCH_KEY 32 /* Watch a key or ring of keys for changes */
6573
66/* keyctl structures */74/* keyctl structures */
67struct keyctl_dh_params {75struct keyctl_dh_params {
68 __s32 private;76 union {
77#ifndef __cplusplus
78 __s32 private;
79#endif
80 __s32 priv;
81 };
69 __s32 prime;82 __s32 prime;
70 __s32 base;83 __s32 base;
71};84};
...@@ -77,4 +90,47 @@ struct keyctl_kdf_params {...@@ -77,4 +90,47 @@ struct keyctl_kdf_params {
77 __u32 __spare[8];90 __u32 __spare[8];
78};91};
7992
93#define KEYCTL_SUPPORTS_ENCRYPT 0x01
94#define KEYCTL_SUPPORTS_DECRYPT 0x02
95#define KEYCTL_SUPPORTS_SIGN 0x04
96#define KEYCTL_SUPPORTS_VERIFY 0x08
97
98struct keyctl_pkey_query {
99 __u32 supported_ops; /* Which ops are supported */
100 __u32 key_size; /* Size of the key in bits */
101 __u16 max_data_size; /* Maximum size of raw data to sign in bytes */
102 __u16 max_sig_size; /* Maximum size of signature in bytes */
103 __u16 max_enc_size; /* Maximum size of encrypted blob in bytes */
104 __u16 max_dec_size; /* Maximum size of decrypted blob in bytes */
105 __u32 __spare[10];
106};
107
108struct keyctl_pkey_params {
109 __s32 key_id; /* Serial no. of public key to use */
110 __u32 in_len; /* Input data size */
111 union {
112 __u32 out_len; /* Output buffer size (encrypt/decrypt/sign) */
113 __u32 in2_len; /* 2nd input data size (verify) */
114 };
115 __u32 __spare[7];
116};
117
118#define KEYCTL_MOVE_EXCL 0x00000001 /* Do not displace from the to-keyring */
119
120/*
121 * Capabilities flags. The capabilities list is an array of 8-bit integers;
122 * each integer can carry up to 8 flags.
123 */
124#define KEYCTL_CAPS0_CAPABILITIES 0x01 /* KEYCTL_CAPABILITIES supported */
125#define KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02 /* Persistent keyrings enabled */
126#define KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04 /* Diffie-Hellman computation enabled */
127#define KEYCTL_CAPS0_PUBLIC_KEY 0x08 /* Public key ops enabled */
128#define KEYCTL_CAPS0_BIG_KEY 0x10 /* big_key-type enabled */
129#define KEYCTL_CAPS0_INVALIDATE 0x20 /* KEYCTL_INVALIDATE supported */
130#define KEYCTL_CAPS0_RESTRICT_KEYRING 0x40 /* KEYCTL_RESTRICT_KEYRING supported */
131#define KEYCTL_CAPS0_MOVE 0x80 /* KEYCTL_MOVE supported */
132#define KEYCTL_CAPS1_NS_KEYRING_NAME 0x01 /* Keyring names are per-user_namespace */
133#define KEYCTL_CAPS1_NS_KEY_TAG 0x02 /* Key indexing can include a namespace tag */
134#define KEYCTL_CAPS1_NOTIFICATIONS 0x04 /* Keys generate watchable notifications */
135
80#endif /* _LINUX_KEYCTL_H */136#endif /* _LINUX_KEYCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+274-7
...@@ -26,8 +26,15 @@...@@ -26,8 +26,15 @@
26#include <drm/drm.h>26#include <drm/drm.h>
27#include <linux/ioctl.h>27#include <linux/ioctl.h>
2828
29/*
30 * - 1.1 - initial version
31 * - 1.3 - Add SMI events support
32 * - 1.4 - Indicate new SRAM EDC bit in device properties
33 * - 1.5 - Add SVM API
34 * - 1.6 - Query clear flags in SVM get_attr API
35 */
29#define KFD_IOCTL_MAJOR_VERSION 136#define KFD_IOCTL_MAJOR_VERSION 1
30#define KFD_IOCTL_MINOR_VERSION 137#define KFD_IOCTL_MINOR_VERSION 6
3138
32struct kfd_ioctl_get_version_args {39struct kfd_ioctl_get_version_args {
33 __u32 major_version; /* from KFD */40 __u32 major_version; /* from KFD */
...@@ -35,9 +42,10 @@ struct kfd_ioctl_get_version_args {...@@ -35,9 +42,10 @@ struct kfd_ioctl_get_version_args {
35};42};
3643
37/* For kfd_ioctl_create_queue_args.queue_type. */44/* For kfd_ioctl_create_queue_args.queue_type. */
38#define KFD_IOC_QUEUE_TYPE_COMPUTE 045#define KFD_IOC_QUEUE_TYPE_COMPUTE 0x0
39#define KFD_IOC_QUEUE_TYPE_SDMA 146#define KFD_IOC_QUEUE_TYPE_SDMA 0x1
40#define KFD_IOC_QUEUE_TYPE_COMPUTE_AQL 247#define KFD_IOC_QUEUE_TYPE_COMPUTE_AQL 0x2
48#define KFD_IOC_QUEUE_TYPE_SDMA_XGMI 0x3
4149
42#define KFD_MAX_QUEUE_PERCENTAGE 10050#define KFD_MAX_QUEUE_PERCENTAGE 100
43#define KFD_MAX_QUEUE_PRIORITY 1551#define KFD_MAX_QUEUE_PRIORITY 15
...@@ -82,6 +90,14 @@ struct kfd_ioctl_set_cu_mask_args {...@@ -82,6 +90,14 @@ struct kfd_ioctl_set_cu_mask_args {
82 __u64 cu_mask_ptr; /* to KFD */90 __u64 cu_mask_ptr; /* to KFD */
83};91};
8492
93struct kfd_ioctl_get_queue_wave_state_args {
94 __u64 ctl_stack_address; /* to KFD */
95 __u32 ctl_stack_used_size; /* from KFD */
96 __u32 save_area_used_size; /* from KFD */
97 __u32 queue_id; /* to KFD */
98 __u32 pad;
99};
100
85/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */101/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
86#define KFD_IOC_CACHE_POLICY_COHERENT 0102#define KFD_IOC_CACHE_POLICY_COHERENT 0
87#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1103#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
...@@ -203,6 +219,11 @@ struct kfd_ioctl_dbg_wave_control_args {...@@ -203,6 +219,11 @@ struct kfd_ioctl_dbg_wave_control_args {
203#define KFD_HW_EXCEPTION_GPU_HANG 0219#define KFD_HW_EXCEPTION_GPU_HANG 0
204#define KFD_HW_EXCEPTION_ECC 1220#define KFD_HW_EXCEPTION_ECC 1
205221
222/* For kfd_hsa_memory_exception_data.ErrorType */
223#define KFD_MEM_ERR_NO_RAS 0
224#define KFD_MEM_ERR_SRAM_ECC 1
225#define KFD_MEM_ERR_POISON_CONSUMED 2
226#define KFD_MEM_ERR_GPU_HANG 3
206227
207struct kfd_ioctl_create_event_args {228struct kfd_ioctl_create_event_args {
208 __u64 event_page_offset; /* from KFD */229 __u64 event_page_offset; /* from KFD */
...@@ -237,12 +258,17 @@ struct kfd_memory_exception_failure {...@@ -237,12 +258,17 @@ struct kfd_memory_exception_failure {
237 __u32 imprecise; /* Can't determine the exact fault address */258 __u32 imprecise; /* Can't determine the exact fault address */
238};259};
239260
240/* memory exception data*/261/* memory exception data */
241struct kfd_hsa_memory_exception_data {262struct kfd_hsa_memory_exception_data {
242 struct kfd_memory_exception_failure failure;263 struct kfd_memory_exception_failure failure;
243 __u64 va;264 __u64 va;
244 __u32 gpu_id;265 __u32 gpu_id;
245 __u32 pad;266 __u32 ErrorType; /* 0 = no RAS error,
267 * 1 = ECC_SRAM,
268 * 2 = Link_SYNFLOOD (poison),
269 * 3 = GPU hang (not attributable to a specific cause),
270 * other values reserved
271 */
246};272};
247273
248/* hw exception data */274/* hw exception data */
...@@ -320,6 +346,7 @@ struct kfd_ioctl_acquire_vm_args {...@@ -320,6 +346,7 @@ struct kfd_ioctl_acquire_vm_args {
320#define KFD_IOC_ALLOC_MEM_FLAGS_GTT (1 << 1)346#define KFD_IOC_ALLOC_MEM_FLAGS_GTT (1 << 1)
321#define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2)347#define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2)
322#define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3)348#define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3)
349#define KFD_IOC_ALLOC_MEM_FLAGS_MMIO_REMAP (1 << 4)
323/* Allocation flags: attributes/access options */350/* Allocation flags: attributes/access options */
324#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31)351#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31)
325#define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30)352#define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30)
...@@ -327,6 +354,7 @@ struct kfd_ioctl_acquire_vm_args {...@@ -327,6 +354,7 @@ struct kfd_ioctl_acquire_vm_args {
327#define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28)354#define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28)
328#define KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM (1 << 27)355#define KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM (1 << 27)
329#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)356#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)
357#define KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED (1 << 25)
330358
331/* Allocate memory for later SVM (shared virtual memory) mapping.359/* Allocate memory for later SVM (shared virtual memory) mapping.
332 *360 *
...@@ -390,6 +418,225 @@ struct kfd_ioctl_unmap_memory_from_gpu_args {...@@ -390,6 +418,225 @@ struct kfd_ioctl_unmap_memory_from_gpu_args {
390 __u32 n_success; /* to/from KFD */418 __u32 n_success; /* to/from KFD */
391};419};
392420
421/* Allocate GWS for specific queue
422 *
423 * @queue_id: queue's id that GWS is allocated for
424 * @num_gws: how many GWS to allocate
425 * @first_gws: index of the first GWS allocated.
426 * only support contiguous GWS allocation
427 */
428struct kfd_ioctl_alloc_queue_gws_args {
429 __u32 queue_id; /* to KFD */
430 __u32 num_gws; /* to KFD */
431 __u32 first_gws; /* from KFD */
432 __u32 pad;
433};
434
435struct kfd_ioctl_get_dmabuf_info_args {
436 __u64 size; /* from KFD */
437 __u64 metadata_ptr; /* to KFD */
438 __u32 metadata_size; /* to KFD (space allocated by user)
439 * from KFD (actual metadata size)
440 */
441 __u32 gpu_id; /* from KFD */
442 __u32 flags; /* from KFD (KFD_IOC_ALLOC_MEM_FLAGS) */
443 __u32 dmabuf_fd; /* to KFD */
444};
445
446struct kfd_ioctl_import_dmabuf_args {
447 __u64 va_addr; /* to KFD */
448 __u64 handle; /* from KFD */
449 __u32 gpu_id; /* to KFD */
450 __u32 dmabuf_fd; /* to KFD */
451};
452
453/*
454 * KFD SMI(System Management Interface) events
455 */
456enum kfd_smi_event {
457 KFD_SMI_EVENT_NONE = 0, /* not used */
458 KFD_SMI_EVENT_VMFAULT = 1, /* event start counting at 1 */
459 KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
460 KFD_SMI_EVENT_GPU_PRE_RESET = 3,
461 KFD_SMI_EVENT_GPU_POST_RESET = 4,
462};
463
464#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
465
466struct kfd_ioctl_smi_events_args {
467 __u32 gpuid; /* to KFD */
468 __u32 anon_fd; /* from KFD */
469};
470
471/* Register offset inside the remapped mmio page
472 */
473enum kfd_mmio_remap {
474 KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL = 0,
475 KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL = 4,
476};
477
478/* Guarantee host access to memory */
479#define KFD_IOCTL_SVM_FLAG_HOST_ACCESS 0x00000001
480/* Fine grained coherency between all devices with access */
481#define KFD_IOCTL_SVM_FLAG_COHERENT 0x00000002
482/* Use any GPU in same hive as preferred device */
483#define KFD_IOCTL_SVM_FLAG_HIVE_LOCAL 0x00000004
484/* GPUs only read, allows replication */
485#define KFD_IOCTL_SVM_FLAG_GPU_RO 0x00000008
486/* Allow execution on GPU */
487#define KFD_IOCTL_SVM_FLAG_GPU_EXEC 0x00000010
488/* GPUs mostly read, may allow similar optimizations as RO, but writes fault */
489#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
490
491/**
492 * kfd_ioctl_svm_op - SVM ioctl operations
493 *
494 * @KFD_IOCTL_SVM_OP_SET_ATTR: Modify one or more attributes
495 * @KFD_IOCTL_SVM_OP_GET_ATTR: Query one or more attributes
496 */
497enum kfd_ioctl_svm_op {
498 KFD_IOCTL_SVM_OP_SET_ATTR,
499 KFD_IOCTL_SVM_OP_GET_ATTR
500};
501
502/** kfd_ioctl_svm_location - Enum for preferred and prefetch locations
503 *
504 * GPU IDs are used to specify GPUs as preferred and prefetch locations.
505 * Below definitions are used for system memory or for leaving the preferred
506 * location unspecified.
507 */
508enum kfd_ioctl_svm_location {
509 KFD_IOCTL_SVM_LOCATION_SYSMEM = 0,
510 KFD_IOCTL_SVM_LOCATION_UNDEFINED = 0xffffffff
511};
512
513/**
514 * kfd_ioctl_svm_attr_type - SVM attribute types
515 *
516 * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC: gpuid of the preferred location, 0 for
517 * system memory
518 * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC: gpuid of the prefetch location, 0 for
519 * system memory. Setting this triggers an
520 * immediate prefetch (migration).
521 * @KFD_IOCTL_SVM_ATTR_ACCESS:
522 * @KFD_IOCTL_SVM_ATTR_ACCESS_IN_PLACE:
523 * @KFD_IOCTL_SVM_ATTR_NO_ACCESS: specify memory access for the gpuid given
524 * by the attribute value
525 * @KFD_IOCTL_SVM_ATTR_SET_FLAGS: bitmask of flags to set (see
526 * KFD_IOCTL_SVM_FLAG_...)
527 * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS: bitmask of flags to clear
528 * @KFD_IOCTL_SVM_ATTR_GRANULARITY: migration granularity
529 * (log2 num pages)
530 */
531enum kfd_ioctl_svm_attr_type {
532 KFD_IOCTL_SVM_ATTR_PREFERRED_LOC,
533 KFD_IOCTL_SVM_ATTR_PREFETCH_LOC,
534 KFD_IOCTL_SVM_ATTR_ACCESS,
535 KFD_IOCTL_SVM_ATTR_ACCESS_IN_PLACE,
536 KFD_IOCTL_SVM_ATTR_NO_ACCESS,
537 KFD_IOCTL_SVM_ATTR_SET_FLAGS,
538 KFD_IOCTL_SVM_ATTR_CLR_FLAGS,
539 KFD_IOCTL_SVM_ATTR_GRANULARITY
540};
541
542/**
543 * kfd_ioctl_svm_attribute - Attributes as pairs of type and value
544 *
545 * The meaning of the @value depends on the attribute type.
546 *
547 * @type: attribute type (see enum @kfd_ioctl_svm_attr_type)
548 * @value: attribute value
549 */
550struct kfd_ioctl_svm_attribute {
551 __u32 type;
552 __u32 value;
553};
554
555/**
556 * kfd_ioctl_svm_args - Arguments for SVM ioctl
557 *
558 * @op specifies the operation to perform (see enum
559 * @kfd_ioctl_svm_op). @start_addr and @size are common for all
560 * operations.
561 *
562 * A variable number of attributes can be given in @attrs.
563 * @nattr specifies the number of attributes. New attributes can be
564 * added in the future without breaking the ABI. If unknown attributes
565 * are given, the function returns -EINVAL.
566 *
567 * @KFD_IOCTL_SVM_OP_SET_ATTR sets attributes for a virtual address
568 * range. It may overlap existing virtual address ranges. If it does,
569 * the existing ranges will be split such that the attribute changes
570 * only apply to the specified address range.
571 *
572 * @KFD_IOCTL_SVM_OP_GET_ATTR returns the intersection of attributes
573 * over all memory in the given range and returns the result as the
574 * attribute value. If different pages have different preferred or
575 * prefetch locations, 0xffffffff will be returned for
576 * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or
577 * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For
578 * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be
579 * aggregated by bitwise AND. That means, a flag will be set in the
580 * output, if that flag is set for all pages in the range. For
581 * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS, flags of all pages will be
582 * aggregated by bitwise NOR. That means, a flag will be set in the
583 * output, if that flag is clear for all pages in the range.
584 * The minimum migration granularity throughout the range will be
585 * returned for @KFD_IOCTL_SVM_ATTR_GRANULARITY.
586 *
587 * Querying of accessibility attributes works by initializing the
588 * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the
589 * GPUID being queried. Multiple attributes can be given to allow
590 * querying multiple GPUIDs. The ioctl function overwrites the
591 * attribute type to indicate the access for the specified GPU.
592 */
593struct kfd_ioctl_svm_args {
594 __u64 start_addr;
595 __u64 size;
596 __u32 op;
597 __u32 nattr;
598 /* Variable length array of attributes */
599 struct kfd_ioctl_svm_attribute attrs[0];
600};
601
602/**
603 * kfd_ioctl_set_xnack_mode_args - Arguments for set_xnack_mode
604 *
605 * @xnack_enabled: [in/out] Whether to enable XNACK mode for this process
606 *
607 * @xnack_enabled indicates whether recoverable page faults should be
608 * enabled for the current process. 0 means disabled, positive means
609 * enabled, negative means leave unchanged. If enabled, virtual address
610 * translations on GFXv9 and later AMD GPUs can return XNACK and retry
611 * the access until a valid PTE is available. This is used to implement
612 * device page faults.
613 *
614 * On output, @xnack_enabled returns the (new) current mode (0 or
615 * positive). Therefore, a negative input value can be used to query
616 * the current mode without changing it.
617 *
618 * The XNACK mode fundamentally changes the way SVM managed memory works
619 * in the driver, with subtle effects on application performance and
620 * functionality.
621 *
622 * Enabling XNACK mode requires shader programs to be compiled
623 * differently. Furthermore, not all GPUs support changing the mode
624 * per-process. Therefore changing the mode is only allowed while no
625 * user mode queues exist in the process. This ensure that no shader
626 * code is running that may be compiled for the wrong mode. And GPUs
627 * that cannot change to the requested mode will prevent the XNACK
628 * mode from occurring. All GPUs used by the process must be in the
629 * same XNACK mode.
630 *
631 * GFXv8 or older GPUs do not support 48 bit virtual addresses or SVM.
632 * Therefore those GPUs are not considered for the XNACK mode switch.
633 *
634 * Return: 0 on success, -errno on failure
635 */
636struct kfd_ioctl_set_xnack_mode_args {
637 __s32 xnack_enabled;
638};
639
393#define AMDKFD_IOCTL_BASE 'K'640#define AMDKFD_IOCTL_BASE 'K'
394#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)641#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
395#define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type)642#define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
...@@ -475,7 +722,27 @@ struct kfd_ioctl_unmap_memory_from_gpu_args {...@@ -475,7 +722,27 @@ struct kfd_ioctl_unmap_memory_from_gpu_args {
475#define AMDKFD_IOC_SET_CU_MASK \722#define AMDKFD_IOC_SET_CU_MASK \
476 AMDKFD_IOW(0x1A, struct kfd_ioctl_set_cu_mask_args)723 AMDKFD_IOW(0x1A, struct kfd_ioctl_set_cu_mask_args)
477724
725#define AMDKFD_IOC_GET_QUEUE_WAVE_STATE \
726 AMDKFD_IOWR(0x1B, struct kfd_ioctl_get_queue_wave_state_args)
727
728#define AMDKFD_IOC_GET_DMABUF_INFO \
729 AMDKFD_IOWR(0x1C, struct kfd_ioctl_get_dmabuf_info_args)
730
731#define AMDKFD_IOC_IMPORT_DMABUF \
732 AMDKFD_IOWR(0x1D, struct kfd_ioctl_import_dmabuf_args)
733
734#define AMDKFD_IOC_ALLOC_QUEUE_GWS \
735 AMDKFD_IOWR(0x1E, struct kfd_ioctl_alloc_queue_gws_args)
736
737#define AMDKFD_IOC_SMI_EVENTS \
738 AMDKFD_IOWR(0x1F, struct kfd_ioctl_smi_events_args)
739
740#define AMDKFD_IOC_SVM AMDKFD_IOWR(0x20, struct kfd_ioctl_svm_args)
741
742#define AMDKFD_IOC_SET_XNACK_MODE \
743 AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args)
744
478#define AMDKFD_COMMAND_START 0x01745#define AMDKFD_COMMAND_START 0x01
479#define AMDKFD_COMMAND_END 0x1B746#define AMDKFD_COMMAND_END 0x22
480747
481#endif748#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kvm.h+492-10
...@@ -8,6 +8,7 @@...@@ -8,6 +8,7 @@
8 * Note: you must update KVM_API_VERSION if you change this interface.8 * Note: you must update KVM_API_VERSION if you change this interface.
9 */9 */
1010
11#include <linux/const.h>
11#include <linux/types.h>12#include <linux/types.h>
1213
13#include <linux/ioctl.h>14#include <linux/ioctl.h>
...@@ -116,7 +117,7 @@ struct kvm_irq_level {...@@ -116,7 +117,7 @@ struct kvm_irq_level {
116 * ACPI gsi notion of irq.117 * ACPI gsi notion of irq.
117 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..118 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..
118 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..119 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..
119 * For ARM: See Documentation/virtual/kvm/api.txt120 * For ARM: See Documentation/virt/kvm/api.rst
120 */121 */
121 union {122 union {
122 __u32 irq;123 __u32 irq;
...@@ -188,10 +189,13 @@ struct kvm_s390_cmma_log {...@@ -188,10 +189,13 @@ struct kvm_s390_cmma_log {
188struct kvm_hyperv_exit {189struct kvm_hyperv_exit {
189#define KVM_EXIT_HYPERV_SYNIC 1190#define KVM_EXIT_HYPERV_SYNIC 1
190#define KVM_EXIT_HYPERV_HCALL 2191#define KVM_EXIT_HYPERV_HCALL 2
192#define KVM_EXIT_HYPERV_SYNDBG 3
191 __u32 type;193 __u32 type;
194 __u32 pad1;
192 union {195 union {
193 struct {196 struct {
194 __u32 msr;197 __u32 msr;
198 __u32 pad2;
195 __u64 control;199 __u64 control;
196 __u64 evt_page;200 __u64 evt_page;
197 __u64 msg_page;201 __u64 msg_page;
...@@ -201,6 +205,29 @@ struct kvm_hyperv_exit {...@@ -201,6 +205,29 @@ struct kvm_hyperv_exit {
201 __u64 result;205 __u64 result;
202 __u64 params[2];206 __u64 params[2];
203 } hcall;207 } hcall;
208 struct {
209 __u32 msr;
210 __u32 pad2;
211 __u64 control;
212 __u64 status;
213 __u64 send_page;
214 __u64 recv_page;
215 __u64 pending_page;
216 } syndbg;
217 } u;
218};
219
220struct kvm_xen_exit {
221#define KVM_EXIT_XEN_HCALL 1
222 __u32 type;
223 union {
224 struct {
225 __u32 longmode;
226 __u32 cpl;
227 __u64 input;
228 __u64 result;
229 __u64 params[6];
230 } hcall;
204 } u;231 } u;
205};232};
206233
...@@ -235,6 +262,14 @@ struct kvm_hyperv_exit {...@@ -235,6 +262,14 @@ struct kvm_hyperv_exit {
235#define KVM_EXIT_S390_STSI 25262#define KVM_EXIT_S390_STSI 25
236#define KVM_EXIT_IOAPIC_EOI 26263#define KVM_EXIT_IOAPIC_EOI 26
237#define KVM_EXIT_HYPERV 27264#define KVM_EXIT_HYPERV 27
265#define KVM_EXIT_ARM_NISV 28
266#define KVM_EXIT_X86_RDMSR 29
267#define KVM_EXIT_X86_WRMSR 30
268#define KVM_EXIT_DIRTY_RING_FULL 31
269#define KVM_EXIT_AP_RESET_HOLD 32
270#define KVM_EXIT_X86_BUS_LOCK 33
271#define KVM_EXIT_XEN 34
272#define KVM_EXIT_RISCV_SBI 35
238273
239/* For KVM_EXIT_INTERNAL_ERROR */274/* For KVM_EXIT_INTERNAL_ERROR */
240/* Emulate instruction failed. */275/* Emulate instruction failed. */
...@@ -243,6 +278,11 @@ struct kvm_hyperv_exit {...@@ -243,6 +278,11 @@ struct kvm_hyperv_exit {
243#define KVM_INTERNAL_ERROR_SIMUL_EX 2278#define KVM_INTERNAL_ERROR_SIMUL_EX 2
244/* Encounter unexpected vm-exit due to delivery event. */279/* Encounter unexpected vm-exit due to delivery event. */
245#define KVM_INTERNAL_ERROR_DELIVERY_EV 3280#define KVM_INTERNAL_ERROR_DELIVERY_EV 3
281/* Encounter unexpected vm-exit reason */
282#define KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON 4
283
284/* Flags that describe what fields in emulation_failure hold valid data. */
285#define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0)
246286
247/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */287/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
248struct kvm_run {288struct kvm_run {
...@@ -274,6 +314,7 @@ struct kvm_run {...@@ -274,6 +314,7 @@ struct kvm_run {
274 /* KVM_EXIT_FAIL_ENTRY */314 /* KVM_EXIT_FAIL_ENTRY */
275 struct {315 struct {
276 __u64 hardware_entry_failure_reason;316 __u64 hardware_entry_failure_reason;
317 __u32 cpu;
277 } fail_entry;318 } fail_entry;
278 /* KVM_EXIT_EXCEPTION */319 /* KVM_EXIT_EXCEPTION */
279 struct {320 struct {
...@@ -346,6 +387,35 @@ struct kvm_run {...@@ -346,6 +387,35 @@ struct kvm_run {
346 __u32 ndata;387 __u32 ndata;
347 __u64 data[16];388 __u64 data[16];
348 } internal;389 } internal;
390 /*
391 * KVM_INTERNAL_ERROR_EMULATION
392 *
393 * "struct emulation_failure" is an overlay of "struct internal"
394 * that is used for the KVM_INTERNAL_ERROR_EMULATION sub-type of
395 * KVM_EXIT_INTERNAL_ERROR. Note, unlike other internal error
396 * sub-types, this struct is ABI! It also needs to be backwards
397 * compatible with "struct internal". Take special care that
398 * "ndata" is correct, that new fields are enumerated in "flags",
399 * and that each flag enumerates fields that are 64-bit aligned
400 * and sized (so that ndata+internal.data[] is valid/accurate).
401 *
402 * Space beyond the defined fields may be used to store arbitrary
403 * debug information relating to the emulation failure. It is
404 * accounted for in "ndata" but the format is unspecified and is
405 * not represented in "flags". Any such information is *not* ABI!
406 */
407 struct {
408 __u32 suberror;
409 __u32 ndata;
410 __u64 flags;
411 union {
412 struct {
413 __u8 insn_size;
414 __u8 insn_bytes[15];
415 };
416 };
417 /* Arbitrary debug data may follow. */
418 } emulation_failure;
349 /* KVM_EXIT_OSI */419 /* KVM_EXIT_OSI */
350 struct {420 struct {
351 __u64 gprs[32];421 __u64 gprs[32];
...@@ -392,6 +462,31 @@ struct kvm_run {...@@ -392,6 +462,31 @@ struct kvm_run {
392 } eoi;462 } eoi;
393 /* KVM_EXIT_HYPERV */463 /* KVM_EXIT_HYPERV */
394 struct kvm_hyperv_exit hyperv;464 struct kvm_hyperv_exit hyperv;
465 /* KVM_EXIT_ARM_NISV */
466 struct {
467 __u64 esr_iss;
468 __u64 fault_ipa;
469 } arm_nisv;
470 /* KVM_EXIT_X86_RDMSR / KVM_EXIT_X86_WRMSR */
471 struct {
472 __u8 error; /* user -> kernel */
473 __u8 pad[7];
474#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)
475#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)
476#define KVM_MSR_EXIT_REASON_FILTER (1 << 2)
477 __u32 reason; /* kernel -> user */
478 __u32 index; /* kernel -> user */
479 __u64 data; /* kernel <-> user */
480 } msr;
481 /* KVM_EXIT_XEN */
482 struct kvm_xen_exit xen;
483 /* KVM_EXIT_RISCV_SBI */
484 struct {
485 unsigned long extension_id;
486 unsigned long function_id;
487 unsigned long args[6];
488 unsigned long ret[2];
489 } riscv_sbi;
395 /* Fix the size of the union. */490 /* Fix the size of the union. */
396 char padding[256];491 char padding[256];
397 };492 };
...@@ -420,13 +515,19 @@ struct kvm_run {...@@ -420,13 +515,19 @@ struct kvm_run {
420struct kvm_coalesced_mmio_zone {515struct kvm_coalesced_mmio_zone {
421 __u64 addr;516 __u64 addr;
422 __u32 size;517 __u32 size;
423 __u32 pad;518 union {
519 __u32 pad;
520 __u32 pio;
521 };
424};522};
425523
426struct kvm_coalesced_mmio {524struct kvm_coalesced_mmio {
427 __u64 phys_addr;525 __u64 phys_addr;
428 __u32 len;526 __u32 len;
429 __u32 pad;527 union {
528 __u32 pad;
529 __u32 pio;
530 };
430 __u8 data[8];531 __u8 data[8];
431};532};
432533
...@@ -460,12 +561,17 @@ struct kvm_s390_mem_op {...@@ -460,12 +561,17 @@ struct kvm_s390_mem_op {
460 __u32 size; /* amount of bytes */561 __u32 size; /* amount of bytes */
461 __u32 op; /* type of operation */562 __u32 op; /* type of operation */
462 __u64 buf; /* buffer in userspace */563 __u64 buf; /* buffer in userspace */
463 __u8 ar; /* the access register number */564 union {
464 __u8 reserved[31]; /* should be set to 0 */565 __u8 ar; /* the access register number */
566 __u32 sida_offset; /* offset into the sida */
567 __u8 reserved[32]; /* should be set to 0 */
568 };
465};569};
466/* types for kvm_s390_mem_op->op */570/* types for kvm_s390_mem_op->op */
467#define KVM_S390_MEMOP_LOGICAL_READ 0571#define KVM_S390_MEMOP_LOGICAL_READ 0
468#define KVM_S390_MEMOP_LOGICAL_WRITE 1572#define KVM_S390_MEMOP_LOGICAL_WRITE 1
573#define KVM_S390_MEMOP_SIDA_READ 2
574#define KVM_S390_MEMOP_SIDA_WRITE 3
469/* flags for kvm_s390_mem_op->flags */575/* flags for kvm_s390_mem_op->flags */
470#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)576#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
471#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)577#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
...@@ -486,6 +592,17 @@ struct kvm_dirty_log {...@@ -486,6 +592,17 @@ struct kvm_dirty_log {
486 };592 };
487};593};
488594
595/* for KVM_CLEAR_DIRTY_LOG */
596struct kvm_clear_dirty_log {
597 __u32 slot;
598 __u32 num_pages;
599 __u64 first_page;
600 union {
601 void *dirty_bitmap; /* one bit per page */
602 __u64 padding2;
603 };
604};
605
489/* for KVM_SET_SIGNAL_MASK */606/* for KVM_SET_SIGNAL_MASK */
490struct kvm_signal_mask {607struct kvm_signal_mask {
491 __u32 len;608 __u32 len;
...@@ -516,6 +633,7 @@ struct kvm_vapic_addr {...@@ -516,6 +633,7 @@ struct kvm_vapic_addr {
516#define KVM_MP_STATE_CHECK_STOP 6633#define KVM_MP_STATE_CHECK_STOP 6
517#define KVM_MP_STATE_OPERATING 7634#define KVM_MP_STATE_OPERATING 7
518#define KVM_MP_STATE_LOAD 8635#define KVM_MP_STATE_LOAD 8
636#define KVM_MP_STATE_AP_RESET_HOLD 9
519637
520struct kvm_mp_state {638struct kvm_mp_state {
521 __u32 mp_state;639 __u32 mp_state;
...@@ -679,9 +797,11 @@ struct kvm_ioeventfd {...@@ -679,9 +797,11 @@ struct kvm_ioeventfd {
679#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)797#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
680#define KVM_X86_DISABLE_EXITS_HLT (1 << 1)798#define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
681#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)799#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
800#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
682#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \801#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
683 KVM_X86_DISABLE_EXITS_HLT | \802 KVM_X86_DISABLE_EXITS_HLT | \
684 KVM_X86_DISABLE_EXITS_PAUSE)803 KVM_X86_DISABLE_EXITS_PAUSE | \
804 KVM_X86_DISABLE_EXITS_CSTATE)
685805
686/* for KVM_ENABLE_CAP */806/* for KVM_ENABLE_CAP */
687struct kvm_enable_cap {807struct kvm_enable_cap {
...@@ -719,6 +839,7 @@ struct kvm_ppc_one_seg_page_size {...@@ -719,6 +839,7 @@ struct kvm_ppc_one_seg_page_size {
719839
720#define KVM_PPC_PAGE_SIZES_REAL 0x00000001840#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
721#define KVM_PPC_1T_SEGMENTS 0x00000002841#define KVM_PPC_1T_SEGMENTS 0x00000002
842#define KVM_PPC_NO_HASH 0x00000004
722843
723struct kvm_ppc_smmu_info {844struct kvm_ppc_smmu_info {
724 __u64 flags;845 __u64 flags;
...@@ -744,12 +865,22 @@ struct kvm_ppc_resize_hpt {...@@ -744,12 +865,22 @@ struct kvm_ppc_resize_hpt {
744#define KVM_VM_PPC_HV 1865#define KVM_VM_PPC_HV 1
745#define KVM_VM_PPC_PR 2866#define KVM_VM_PPC_PR 2
746867
747/* on MIPS, 0 forces trap & emulate, 1 forces VZ ASE */868/* on MIPS, 0 indicates auto, 1 forces VZ ASE, 2 forces trap & emulate */
748#define KVM_VM_MIPS_TE 0869#define KVM_VM_MIPS_AUTO 0
749#define KVM_VM_MIPS_VZ 1870#define KVM_VM_MIPS_VZ 1
871#define KVM_VM_MIPS_TE 2
750872
751#define KVM_S390_SIE_PAGE_OFFSET 1873#define KVM_S390_SIE_PAGE_OFFSET 1
752874
875/*
876 * On arm64, machine type can be used to request the physical
877 * address size for the VM. Bits[7-0] are reserved for the guest
878 * PA size shift (i.e, log2(PA_Size)). For backward compatibility,
879 * value 0 implies the default IPA size, 40bits.
880 */
881#define KVM_VM_TYPE_ARM_IPA_SIZE_MASK 0xffULL
882#define KVM_VM_TYPE_ARM_IPA_SIZE(x) \
883 ((x) & KVM_VM_TYPE_ARM_IPA_SIZE_MASK)
753/*884/*
754 * ioctls for /dev/kvm fds:885 * ioctls for /dev/kvm fds:
755 */886 */
...@@ -953,6 +1084,53 @@ struct kvm_ppc_resize_hpt {...@@ -953,6 +1084,53 @@ struct kvm_ppc_resize_hpt {
953#define KVM_CAP_NESTED_STATE 1571084#define KVM_CAP_NESTED_STATE 157
954#define KVM_CAP_ARM_INJECT_SERROR_ESR 1581085#define KVM_CAP_ARM_INJECT_SERROR_ESR 158
955#define KVM_CAP_MSR_PLATFORM_INFO 1591086#define KVM_CAP_MSR_PLATFORM_INFO 159
1087#define KVM_CAP_PPC_NESTED_HV 160
1088#define KVM_CAP_HYPERV_SEND_IPI 161
1089#define KVM_CAP_COALESCED_PIO 162
1090#define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163
1091#define KVM_CAP_EXCEPTION_PAYLOAD 164
1092#define KVM_CAP_ARM_VM_IPA_SIZE 165
1093#define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 /* Obsolete */
1094#define KVM_CAP_HYPERV_CPUID 167
1095#define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 168
1096#define KVM_CAP_PPC_IRQ_XIVE 169
1097#define KVM_CAP_ARM_SVE 170
1098#define KVM_CAP_ARM_PTRAUTH_ADDRESS 171
1099#define KVM_CAP_ARM_PTRAUTH_GENERIC 172
1100#define KVM_CAP_PMU_EVENT_FILTER 173
1101#define KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174
1102#define KVM_CAP_HYPERV_DIRECT_TLBFLUSH 175
1103#define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176
1104#define KVM_CAP_ARM_NISV_TO_USER 177
1105#define KVM_CAP_ARM_INJECT_EXT_DABT 178
1106#define KVM_CAP_S390_VCPU_RESETS 179
1107#define KVM_CAP_S390_PROTECTED 180
1108#define KVM_CAP_PPC_SECURE_GUEST 181
1109#define KVM_CAP_HALT_POLL 182
1110#define KVM_CAP_ASYNC_PF_INT 183
1111#define KVM_CAP_LAST_CPU 184
1112#define KVM_CAP_SMALLER_MAXPHYADDR 185
1113#define KVM_CAP_S390_DIAG318 186
1114#define KVM_CAP_STEAL_TIME 187
1115#define KVM_CAP_X86_USER_SPACE_MSR 188
1116#define KVM_CAP_X86_MSR_FILTER 189
1117#define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190
1118#define KVM_CAP_SYS_HYPERV_CPUID 191
1119#define KVM_CAP_DIRTY_LOG_RING 192
1120#define KVM_CAP_X86_BUS_LOCK_EXIT 193
1121#define KVM_CAP_PPC_DAWR1 194
1122#define KVM_CAP_SET_GUEST_DEBUG2 195
1123#define KVM_CAP_SGX_ATTRIBUTE 196
1124#define KVM_CAP_VM_COPY_ENC_CONTEXT_FROM 197
1125#define KVM_CAP_PTP_KVM 198
1126#define KVM_CAP_HYPERV_ENFORCE_CPUID 199
1127#define KVM_CAP_SREGS2 200
1128#define KVM_CAP_EXIT_HYPERCALL 201
1129#define KVM_CAP_PPC_RPT_INVALIDATE 202
1130#define KVM_CAP_BINARY_STATS_FD 203
1131#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
1132#define KVM_CAP_ARM_MTE 205
1133#define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
9561134
957#ifdef KVM_CAP_IRQ_ROUTING1135#ifdef KVM_CAP_IRQ_ROUTING
9581136
...@@ -1026,6 +1204,11 @@ struct kvm_x86_mce {...@@ -1026,6 +1204,11 @@ struct kvm_x86_mce {
1026#endif1204#endif
10271205
1028#ifdef KVM_CAP_XEN_HVM1206#ifdef KVM_CAP_XEN_HVM
1207#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR (1 << 0)
1208#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
1209#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
1210#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
1211
1029struct kvm_xen_hvm_config {1212struct kvm_xen_hvm_config {
1030 __u32 flags;1213 __u32 flags;
1031 __u32 msr;1214 __u32 msr;
...@@ -1043,7 +1226,7 @@ struct kvm_xen_hvm_config {...@@ -1043,7 +1226,7 @@ struct kvm_xen_hvm_config {
1043 *1226 *
1044 * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies1227 * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies
1045 * the irqfd to operate in resampling mode for level triggered interrupt1228 * the irqfd to operate in resampling mode for level triggered interrupt
1046 * emulation. See Documentation/virtual/kvm/api.txt.1229 * emulation. See Documentation/virt/kvm/api.rst.
1047 */1230 */
1048#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1)1231#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1)
10491232
...@@ -1059,11 +1242,16 @@ struct kvm_irqfd {...@@ -1059,11 +1242,16 @@ struct kvm_irqfd {
10591242
1060/* Do not use 1, KVM_CHECK_EXTENSION returned it before we had flags. */1243/* Do not use 1, KVM_CHECK_EXTENSION returned it before we had flags. */
1061#define KVM_CLOCK_TSC_STABLE 21244#define KVM_CLOCK_TSC_STABLE 2
1245#define KVM_CLOCK_REALTIME (1 << 2)
1246#define KVM_CLOCK_HOST_TSC (1 << 3)
10621247
1063struct kvm_clock_data {1248struct kvm_clock_data {
1064 __u64 clock;1249 __u64 clock;
1065 __u32 flags;1250 __u32 flags;
1066 __u32 pad[9];1251 __u32 pad0;
1252 __u64 realtime;
1253 __u64 host_tsc;
1254 __u32 pad[4];
1067};1255};
10681256
1069/* For KVM_CAP_SW_TLB */1257/* For KVM_CAP_SW_TLB */
...@@ -1099,6 +1287,7 @@ struct kvm_dirty_tlb {...@@ -1099,6 +1287,7 @@ struct kvm_dirty_tlb {
1099#define KVM_REG_S390 0x5000000000000000ULL1287#define KVM_REG_S390 0x5000000000000000ULL
1100#define KVM_REG_ARM64 0x6000000000000000ULL1288#define KVM_REG_ARM64 0x6000000000000000ULL
1101#define KVM_REG_MIPS 0x7000000000000000ULL1289#define KVM_REG_MIPS 0x7000000000000000ULL
1290#define KVM_REG_RISCV 0x8000000000000000ULL
11021291
1103#define KVM_REG_SIZE_SHIFT 521292#define KVM_REG_SIZE_SHIFT 52
1104#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL1293#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
...@@ -1110,6 +1299,7 @@ struct kvm_dirty_tlb {...@@ -1110,6 +1299,7 @@ struct kvm_dirty_tlb {
1110#define KVM_REG_SIZE_U256 0x0050000000000000ULL1299#define KVM_REG_SIZE_U256 0x0050000000000000ULL
1111#define KVM_REG_SIZE_U512 0x0060000000000000ULL1300#define KVM_REG_SIZE_U512 0x0060000000000000ULL
1112#define KVM_REG_SIZE_U1024 0x0070000000000000ULL1301#define KVM_REG_SIZE_U1024 0x0070000000000000ULL
1302#define KVM_REG_SIZE_U2048 0x0080000000000000ULL
11131303
1114struct kvm_reg_list {1304struct kvm_reg_list {
1115 __u64 n; /* number of regs */1305 __u64 n; /* number of regs */
...@@ -1176,6 +1366,10 @@ enum kvm_device_type {...@@ -1176,6 +1366,10 @@ enum kvm_device_type {
1176#define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V31366#define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V3
1177 KVM_DEV_TYPE_ARM_VGIC_ITS,1367 KVM_DEV_TYPE_ARM_VGIC_ITS,
1178#define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS1368#define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
1369 KVM_DEV_TYPE_XIVE,
1370#define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
1371 KVM_DEV_TYPE_ARM_PV_TIME,
1372#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
1179 KVM_DEV_TYPE_MAX,1373 KVM_DEV_TYPE_MAX,
1180};1374};
11811375
...@@ -1284,6 +1478,10 @@ struct kvm_s390_ucas_mapping {...@@ -1284,6 +1478,10 @@ struct kvm_s390_ucas_mapping {
1284#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)1478#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
1285/* Available with KVM_CAP_PPC_GET_CPU_CHAR */1479/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
1286#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)1480#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
1481/* Available with KVM_CAP_PMU_EVENT_FILTER */
1482#define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter)
1483#define KVM_PPC_SVM_OFF _IO(KVMIO, 0xb3)
1484#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
12871485
1288/* ioctl for vm fd */1486/* ioctl for vm fd */
1289#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)1487#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
...@@ -1399,6 +1597,112 @@ struct kvm_enc_region {...@@ -1399,6 +1597,112 @@ struct kvm_enc_region {
1399#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)1597#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)
1400#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)1598#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)
14011599
1600/* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT_2 */
1601#define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log)
1602
1603/* Available with KVM_CAP_HYPERV_CPUID (vcpu) / KVM_CAP_SYS_HYPERV_CPUID (system) */
1604#define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2)
1605
1606/* Available with KVM_CAP_ARM_SVE */
1607#define KVM_ARM_VCPU_FINALIZE _IOW(KVMIO, 0xc2, int)
1608
1609/* Available with KVM_CAP_S390_VCPU_RESETS */
1610#define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3)
1611#define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4)
1612
1613struct kvm_s390_pv_sec_parm {
1614 __u64 origin;
1615 __u64 length;
1616};
1617
1618struct kvm_s390_pv_unp {
1619 __u64 addr;
1620 __u64 size;
1621 __u64 tweak;
1622};
1623
1624enum pv_cmd_id {
1625 KVM_PV_ENABLE,
1626 KVM_PV_DISABLE,
1627 KVM_PV_SET_SEC_PARMS,
1628 KVM_PV_UNPACK,
1629 KVM_PV_VERIFY,
1630 KVM_PV_PREP_RESET,
1631 KVM_PV_UNSHARE_ALL,
1632};
1633
1634struct kvm_pv_cmd {
1635 __u32 cmd; /* Command to be executed */
1636 __u16 rc; /* Ultravisor return code */
1637 __u16 rrc; /* Ultravisor return reason code */
1638 __u64 data; /* Data or address */
1639 __u32 flags; /* flags for future extensions. Must be 0 for now */
1640 __u32 reserved[3];
1641};
1642
1643/* Available with KVM_CAP_S390_PROTECTED */
1644#define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
1645
1646/* Available with KVM_CAP_X86_MSR_FILTER */
1647#define KVM_X86_SET_MSR_FILTER _IOW(KVMIO, 0xc6, struct kvm_msr_filter)
1648
1649/* Available with KVM_CAP_DIRTY_LOG_RING */
1650#define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7)
1651
1652/* Per-VM Xen attributes */
1653#define KVM_XEN_HVM_GET_ATTR _IOWR(KVMIO, 0xc8, struct kvm_xen_hvm_attr)
1654#define KVM_XEN_HVM_SET_ATTR _IOW(KVMIO, 0xc9, struct kvm_xen_hvm_attr)
1655
1656struct kvm_xen_hvm_attr {
1657 __u16 type;
1658 __u16 pad[3];
1659 union {
1660 __u8 long_mode;
1661 __u8 vector;
1662 struct {
1663 __u64 gfn;
1664 } shared_info;
1665 __u64 pad[8];
1666 } u;
1667};
1668
1669/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1670#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
1671#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
1672#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2
1673
1674/* Per-vCPU Xen attributes */
1675#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
1676#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)
1677
1678#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)
1679#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)
1680
1681struct kvm_xen_vcpu_attr {
1682 __u16 type;
1683 __u16 pad[3];
1684 union {
1685 __u64 gpa;
1686 __u64 pad[8];
1687 struct {
1688 __u64 state;
1689 __u64 state_entry_time;
1690 __u64 time_running;
1691 __u64 time_runnable;
1692 __u64 time_blocked;
1693 __u64 time_offline;
1694 } runstate;
1695 } u;
1696};
1697
1698/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1699#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO 0x0
1700#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO 0x1
1701#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR 0x2
1702#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
1703#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
1704#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x5
1705
1402/* Secure Encrypted Virtualization command */1706/* Secure Encrypted Virtualization command */
1403enum sev_cmd_id {1707enum sev_cmd_id {
1404 /* Guest initialization commands */1708 /* Guest initialization commands */
...@@ -1427,6 +1731,10 @@ enum sev_cmd_id {...@@ -1427,6 +1731,10 @@ enum sev_cmd_id {
1427 KVM_SEV_DBG_ENCRYPT,1731 KVM_SEV_DBG_ENCRYPT,
1428 /* Guest certificates commands */1732 /* Guest certificates commands */
1429 KVM_SEV_CERT_EXPORT,1733 KVM_SEV_CERT_EXPORT,
1734 /* Attestation report */
1735 KVM_SEV_GET_ATTESTATION_REPORT,
1736 /* Guest Migration Extension */
1737 KVM_SEV_SEND_CANCEL,
14301738
1431 KVM_SEV_NR_MAX,1739 KVM_SEV_NR_MAX,
1432};1740};
...@@ -1479,6 +1787,51 @@ struct kvm_sev_dbg {...@@ -1479,6 +1787,51 @@ struct kvm_sev_dbg {
1479 __u32 len;1787 __u32 len;
1480};1788};
14811789
1790struct kvm_sev_attestation_report {
1791 __u8 mnonce[16];
1792 __u64 uaddr;
1793 __u32 len;
1794};
1795
1796struct kvm_sev_send_start {
1797 __u32 policy;
1798 __u64 pdh_cert_uaddr;
1799 __u32 pdh_cert_len;
1800 __u64 plat_certs_uaddr;
1801 __u32 plat_certs_len;
1802 __u64 amd_certs_uaddr;
1803 __u32 amd_certs_len;
1804 __u64 session_uaddr;
1805 __u32 session_len;
1806};
1807
1808struct kvm_sev_send_update_data {
1809 __u64 hdr_uaddr;
1810 __u32 hdr_len;
1811 __u64 guest_uaddr;
1812 __u32 guest_len;
1813 __u64 trans_uaddr;
1814 __u32 trans_len;
1815};
1816
1817struct kvm_sev_receive_start {
1818 __u32 handle;
1819 __u32 policy;
1820 __u64 pdh_uaddr;
1821 __u32 pdh_len;
1822 __u64 session_uaddr;
1823 __u32 session_len;
1824};
1825
1826struct kvm_sev_receive_update_data {
1827 __u64 hdr_uaddr;
1828 __u32 hdr_len;
1829 __u64 guest_uaddr;
1830 __u32 guest_len;
1831 __u64 trans_uaddr;
1832 __u32 trans_len;
1833};
1834
1482#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)1835#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1483#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)1836#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
1484#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)1837#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
...@@ -1549,4 +1902,133 @@ struct kvm_hyperv_eventfd {...@@ -1549,4 +1902,133 @@ struct kvm_hyperv_eventfd {
1549#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff1902#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
1550#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)1903#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
15511904
1905#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0)
1906#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1)
1907
1908/*
1909 * Arch needs to define the macro after implementing the dirty ring
1910 * feature. KVM_DIRTY_LOG_PAGE_OFFSET should be defined as the
1911 * starting page offset of the dirty ring structures.
1912 */
1913#ifndef KVM_DIRTY_LOG_PAGE_OFFSET
1914#define KVM_DIRTY_LOG_PAGE_OFFSET 0
1915#endif
1916
1917/*
1918 * KVM dirty GFN flags, defined as:
1919 *
1920 * |---------------+---------------+--------------|
1921 * | bit 1 (reset) | bit 0 (dirty) | Status |
1922 * |---------------+---------------+--------------|
1923 * | 0 | 0 | Invalid GFN |
1924 * | 0 | 1 | Dirty GFN |
1925 * | 1 | X | GFN to reset |
1926 * |---------------+---------------+--------------|
1927 *
1928 * Lifecycle of a dirty GFN goes like:
1929 *
1930 * dirtied harvested reset
1931 * 00 -----------> 01 -------------> 1X -------+
1932 * ^ |
1933 * | |
1934 * +------------------------------------------+
1935 *
1936 * The userspace program is only responsible for the 01->1X state
1937 * conversion after harvesting an entry. Also, it must not skip any
1938 * dirty bits, so that dirty bits are always harvested in sequence.
1939 */
1940#define KVM_DIRTY_GFN_F_DIRTY _BITUL(0)
1941#define KVM_DIRTY_GFN_F_RESET _BITUL(1)
1942#define KVM_DIRTY_GFN_F_MASK 0x3
1943
1944/*
1945 * KVM dirty rings should be mapped at KVM_DIRTY_LOG_PAGE_OFFSET of
1946 * per-vcpu mmaped regions as an array of struct kvm_dirty_gfn. The
1947 * size of the gfn buffer is decided by the first argument when
1948 * enabling KVM_CAP_DIRTY_LOG_RING.
1949 */
1950struct kvm_dirty_gfn {
1951 __u32 flags;
1952 __u32 slot;
1953 __u64 offset;
1954};
1955
1956#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0)
1957#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1)
1958
1959/**
1960 * struct kvm_stats_header - Header of per vm/vcpu binary statistics data.
1961 * @flags: Some extra information for header, always 0 for now.
1962 * @name_size: The size in bytes of the memory which contains statistics
1963 * name string including trailing '\0'. The memory is allocated
1964 * at the send of statistics descriptor.
1965 * @num_desc: The number of statistics the vm or vcpu has.
1966 * @id_offset: The offset of the vm/vcpu stats' id string in the file pointed
1967 * by vm/vcpu stats fd.
1968 * @desc_offset: The offset of the vm/vcpu stats' descriptor block in the file
1969 * pointd by vm/vcpu stats fd.
1970 * @data_offset: The offset of the vm/vcpu stats' data block in the file
1971 * pointed by vm/vcpu stats fd.
1972 *
1973 * This is the header userspace needs to read from stats fd before any other
1974 * readings. It is used by userspace to discover all the information about the
1975 * vm/vcpu's binary statistics.
1976 * Userspace reads this header from the start of the vm/vcpu's stats fd.
1977 */
1978struct kvm_stats_header {
1979 __u32 flags;
1980 __u32 name_size;
1981 __u32 num_desc;
1982 __u32 id_offset;
1983 __u32 desc_offset;
1984 __u32 data_offset;
1985};
1986
1987#define KVM_STATS_TYPE_SHIFT 0
1988#define KVM_STATS_TYPE_MASK (0xF << KVM_STATS_TYPE_SHIFT)
1989#define KVM_STATS_TYPE_CUMULATIVE (0x0 << KVM_STATS_TYPE_SHIFT)
1990#define KVM_STATS_TYPE_INSTANT (0x1 << KVM_STATS_TYPE_SHIFT)
1991#define KVM_STATS_TYPE_PEAK (0x2 << KVM_STATS_TYPE_SHIFT)
1992#define KVM_STATS_TYPE_LINEAR_HIST (0x3 << KVM_STATS_TYPE_SHIFT)
1993#define KVM_STATS_TYPE_LOG_HIST (0x4 << KVM_STATS_TYPE_SHIFT)
1994#define KVM_STATS_TYPE_MAX KVM_STATS_TYPE_LOG_HIST
1995
1996#define KVM_STATS_UNIT_SHIFT 4
1997#define KVM_STATS_UNIT_MASK (0xF << KVM_STATS_UNIT_SHIFT)
1998#define KVM_STATS_UNIT_NONE (0x0 << KVM_STATS_UNIT_SHIFT)
1999#define KVM_STATS_UNIT_BYTES (0x1 << KVM_STATS_UNIT_SHIFT)
2000#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
2001#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
2002#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES
2003
2004#define KVM_STATS_BASE_SHIFT 8
2005#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)
2006#define KVM_STATS_BASE_POW10 (0x0 << KVM_STATS_BASE_SHIFT)
2007#define KVM_STATS_BASE_POW2 (0x1 << KVM_STATS_BASE_SHIFT)
2008#define KVM_STATS_BASE_MAX KVM_STATS_BASE_POW2
2009
2010/**
2011 * struct kvm_stats_desc - Descriptor of a KVM statistics.
2012 * @flags: Annotations of the stats, like type, unit, etc.
2013 * @exponent: Used together with @flags to determine the unit.
2014 * @size: The number of data items for this stats.
2015 * Every data item is of type __u64.
2016 * @offset: The offset of the stats to the start of stat structure in
2017 * structure kvm or kvm_vcpu.
2018 * @bucket_size: A parameter value used for histogram stats. It is only used
2019 * for linear histogram stats, specifying the size of the bucket;
2020 * @name: The name string for the stats. Its size is indicated by the
2021 * &kvm_stats_header->name_size.
2022 */
2023struct kvm_stats_desc {
2024 __u32 flags;
2025 __s16 exponent;
2026 __u16 size;
2027 __u32 offset;
2028 __u32 bucket_size;
2029 char name[];
2030};
2031
2032#define KVM_GET_STATS_FD _IO(KVMIO, 0xce)
2033
1552#endif /* __LINUX_KVM_H */2034#endif /* __LINUX_KVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kvm_para.h+2
...@@ -28,6 +28,8 @@...@@ -28,6 +28,8 @@
28#define KVM_HC_MIPS_CONSOLE_OUTPUT 828#define KVM_HC_MIPS_CONSOLE_OUTPUT 8
29#define KVM_HC_CLOCK_PAIRING 929#define KVM_HC_CLOCK_PAIRING 9
30#define KVM_HC_SEND_IPI 1030#define KVM_HC_SEND_IPI 10
31#define KVM_HC_SCHED_YIELD 11
32#define KVM_HC_MAP_GPA_RANGE 12
3133
32/*34/*
33 * hypercalls use architecture specific35 * hypercalls use architecture specific
lib/libc/include/any-linux-any/linux/l2tp.h+6-2
...@@ -108,7 +108,7 @@ enum {...@@ -108,7 +108,7 @@ enum {
108 L2TP_ATTR_VLAN_ID, /* u16 (not used) */108 L2TP_ATTR_VLAN_ID, /* u16 (not used) */
109 L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */109 L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */
110 L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */110 L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */
111 L2TP_ATTR_DEBUG, /* u32, enum l2tp_debug_flags */111 L2TP_ATTR_DEBUG, /* u32, enum l2tp_debug_flags (not used) */
112 L2TP_ATTR_RECV_SEQ, /* u8 */112 L2TP_ATTR_RECV_SEQ, /* u8 */
113 L2TP_ATTR_SEND_SEQ, /* u8 */113 L2TP_ATTR_SEND_SEQ, /* u8 */
114 L2TP_ATTR_LNS_MODE, /* u8 */114 L2TP_ATTR_LNS_MODE, /* u8 */
...@@ -144,6 +144,8 @@ enum {...@@ -144,6 +144,8 @@ enum {
144 L2TP_ATTR_RX_OOS_PACKETS, /* u64 */144 L2TP_ATTR_RX_OOS_PACKETS, /* u64 */
145 L2TP_ATTR_RX_ERRORS, /* u64 */145 L2TP_ATTR_RX_ERRORS, /* u64 */
146 L2TP_ATTR_STATS_PAD,146 L2TP_ATTR_STATS_PAD,
147 L2TP_ATTR_RX_COOKIE_DISCARDS, /* u64 */
148 L2TP_ATTR_RX_INVALID, /* u64 */
147 __L2TP_ATTR_STATS_MAX,149 __L2TP_ATTR_STATS_MAX,
148};150};
149151
...@@ -177,7 +179,9 @@ enum l2tp_seqmode {...@@ -177,7 +179,9 @@ enum l2tp_seqmode {
177};179};
178180
179/**181/**
180 * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions182 * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions.
183 *
184 * Unused.
181 *185 *
182 * @L2TP_MSG_DEBUG: verbose debug (if compiled in)186 * @L2TP_MSG_DEBUG: verbose debug (if compiled in)
183 * @L2TP_MSG_CONTROL: userspace - kernel interface187 * @L2TP_MSG_CONTROL: userspace - kernel interface
lib/libc/include/any-linux-any/linux/landlock.h created+137
...@@ -0,0 +1,137 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Landlock - User space API
4 *
5 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net>
6 * Copyright © 2018-2020 ANSSI
7 */
8
9#ifndef _LINUX_LANDLOCK_H
10#define _LINUX_LANDLOCK_H
11
12#include <linux/types.h>
13
14/**
15 * struct landlock_ruleset_attr - Ruleset definition
16 *
17 * Argument of sys_landlock_create_ruleset(). This structure can grow in
18 * future versions.
19 */
20struct landlock_ruleset_attr {
21 /**
22 * @handled_access_fs: Bitmask of actions (cf. `Filesystem flags`_)
23 * that is handled by this ruleset and should then be forbidden if no
24 * rule explicitly allow them. This is needed for backward
25 * compatibility reasons.
26 */
27 __u64 handled_access_fs;
28};
29
30/*
31 * sys_landlock_create_ruleset() flags:
32 *
33 * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI
34 * version.
35 */
36#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
37
38/**
39 * enum landlock_rule_type - Landlock rule type
40 *
41 * Argument of sys_landlock_add_rule().
42 */
43enum landlock_rule_type {
44 /**
45 * @LANDLOCK_RULE_PATH_BENEATH: Type of a &struct
46 * landlock_path_beneath_attr .
47 */
48 LANDLOCK_RULE_PATH_BENEATH = 1,
49};
50
51/**
52 * struct landlock_path_beneath_attr - Path hierarchy definition
53 *
54 * Argument of sys_landlock_add_rule().
55 */
56struct landlock_path_beneath_attr {
57 /**
58 * @allowed_access: Bitmask of allowed actions for this file hierarchy
59 * (cf. `Filesystem flags`_).
60 */
61 __u64 allowed_access;
62 /**
63 * @parent_fd: File descriptor, open with ``O_PATH``, which identifies
64 * the parent directory of a file hierarchy, or just a file.
65 */
66 __s32 parent_fd;
67 /*
68 * This struct is packed to avoid trailing reserved members.
69 * Cf. security/landlock/syscalls.c:build_check_abi()
70 */
71} __attribute__((packed));
72
73/**
74 * DOC: fs_access
75 *
76 * A set of actions on kernel objects may be defined by an attribute (e.g.
77 * &struct landlock_path_beneath_attr) including a bitmask of access.
78 *
79 * Filesystem flags
80 * ~~~~~~~~~~~~~~~~
81 *
82 * These flags enable to restrict a sandboxed process to a set of actions on
83 * files and directories. Files or directories opened before the sandboxing
84 * are not subject to these restrictions.
85 *
86 * A file can only receive these access rights:
87 *
88 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.
89 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access.
90 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.
91 *
92 * A directory can receive access rights related to files or directories. The
93 * following access right is applied to the directory itself, and the
94 * directories beneath it:
95 *
96 * - %LANDLOCK_ACCESS_FS_READ_DIR: Open a directory or list its content.
97 *
98 * However, the following access rights only apply to the content of a
99 * directory, not the directory itself:
100 *
101 * - %LANDLOCK_ACCESS_FS_REMOVE_DIR: Remove an empty directory or rename one.
102 * - %LANDLOCK_ACCESS_FS_REMOVE_FILE: Unlink (or rename) a file.
103 * - %LANDLOCK_ACCESS_FS_MAKE_CHAR: Create (or rename or link) a character
104 * device.
105 * - %LANDLOCK_ACCESS_FS_MAKE_DIR: Create (or rename) a directory.
106 * - %LANDLOCK_ACCESS_FS_MAKE_REG: Create (or rename or link) a regular file.
107 * - %LANDLOCK_ACCESS_FS_MAKE_SOCK: Create (or rename or link) a UNIX domain
108 * socket.
109 * - %LANDLOCK_ACCESS_FS_MAKE_FIFO: Create (or rename or link) a named pipe.
110 * - %LANDLOCK_ACCESS_FS_MAKE_BLOCK: Create (or rename or link) a block device.
111 * - %LANDLOCK_ACCESS_FS_MAKE_SYM: Create (or rename or link) a symbolic link.
112 *
113 * .. warning::
114 *
115 * It is currently not possible to restrict some file-related actions
116 * accessible through these syscall families: :manpage:`chdir(2)`,
117 * :manpage:`truncate(2)`, :manpage:`stat(2)`, :manpage:`flock(2)`,
118 * :manpage:`chmod(2)`, :manpage:`chown(2)`, :manpage:`setxattr(2)`,
119 * :manpage:`utime(2)`, :manpage:`ioctl(2)`, :manpage:`fcntl(2)`,
120 * :manpage:`access(2)`.
121 * Future Landlock evolutions will enable to restrict them.
122 */
123#define LANDLOCK_ACCESS_FS_EXECUTE (1ULL << 0)
124#define LANDLOCK_ACCESS_FS_WRITE_FILE (1ULL << 1)
125#define LANDLOCK_ACCESS_FS_READ_FILE (1ULL << 2)
126#define LANDLOCK_ACCESS_FS_READ_DIR (1ULL << 3)
127#define LANDLOCK_ACCESS_FS_REMOVE_DIR (1ULL << 4)
128#define LANDLOCK_ACCESS_FS_REMOVE_FILE (1ULL << 5)
129#define LANDLOCK_ACCESS_FS_MAKE_CHAR (1ULL << 6)
130#define LANDLOCK_ACCESS_FS_MAKE_DIR (1ULL << 7)
131#define LANDLOCK_ACCESS_FS_MAKE_REG (1ULL << 8)
132#define LANDLOCK_ACCESS_FS_MAKE_SOCK (1ULL << 9)
133#define LANDLOCK_ACCESS_FS_MAKE_FIFO (1ULL << 10)
134#define LANDLOCK_ACCESS_FS_MAKE_BLOCK (1ULL << 11)
135#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)
136
137#endif /* _LINUX_LANDLOCK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/lightnvm.h deleted-220
...@@ -1,220 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 CNEX Labs. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version
7 * 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
17 * USA.
18 */
19
20#ifndef _LINUX_LIGHTNVM_H
21#define _LINUX_LIGHTNVM_H
22
23#include <stdio.h>
24#include <sys/ioctl.h>
25#define DISK_NAME_LEN 32
26
27#include <linux/types.h>
28#include <linux/ioctl.h>
29
30#define NVM_TTYPE_NAME_MAX 48
31#define NVM_TTYPE_MAX 63
32#define NVM_MMTYPE_LEN 8
33
34#define NVM_CTRL_FILE "/dev/lightnvm/control"
35
36struct nvm_ioctl_info_tgt {
37 __u32 version[3];
38 __u32 reserved;
39 char tgtname[NVM_TTYPE_NAME_MAX];
40};
41
42struct nvm_ioctl_info {
43 __u32 version[3]; /* in/out - major, minor, patch */
44 __u16 tgtsize; /* number of targets */
45 __u16 reserved16; /* pad to 4K page */
46 __u32 reserved[12];
47 struct nvm_ioctl_info_tgt tgts[NVM_TTYPE_MAX];
48};
49
50enum {
51 NVM_DEVICE_ACTIVE = 1 << 0,
52};
53
54struct nvm_ioctl_device_info {
55 char devname[DISK_NAME_LEN];
56 char bmname[NVM_TTYPE_NAME_MAX];
57 __u32 bmversion[3];
58 __u32 flags;
59 __u32 reserved[8];
60};
61
62struct nvm_ioctl_get_devices {
63 __u32 nr_devices;
64 __u32 reserved[31];
65 struct nvm_ioctl_device_info info[31];
66};
67
68struct nvm_ioctl_create_simple {
69 __u32 lun_begin;
70 __u32 lun_end;
71};
72
73struct nvm_ioctl_create_extended {
74 __u16 lun_begin;
75 __u16 lun_end;
76 __u16 op;
77 __u16 rsv;
78};
79
80enum {
81 NVM_CONFIG_TYPE_SIMPLE = 0,
82 NVM_CONFIG_TYPE_EXTENDED = 1,
83};
84
85struct nvm_ioctl_create_conf {
86 __u32 type;
87 union {
88 struct nvm_ioctl_create_simple s;
89 struct nvm_ioctl_create_extended e;
90 };
91};
92
93enum {
94 NVM_TARGET_FACTORY = 1 << 0, /* Init target in factory mode */
95};
96
97struct nvm_ioctl_create {
98 char dev[DISK_NAME_LEN]; /* open-channel SSD device */
99 char tgttype[NVM_TTYPE_NAME_MAX]; /* target type name */
100 char tgtname[DISK_NAME_LEN]; /* dev to expose target as */
101
102 __u32 flags;
103
104 struct nvm_ioctl_create_conf conf;
105};
106
107struct nvm_ioctl_remove {
108 char tgtname[DISK_NAME_LEN];
109
110 __u32 flags;
111};
112
113struct nvm_ioctl_dev_init {
114 char dev[DISK_NAME_LEN]; /* open-channel SSD device */
115 char mmtype[NVM_MMTYPE_LEN]; /* register to media manager */
116
117 __u32 flags;
118};
119
120enum {
121 NVM_FACTORY_ERASE_ONLY_USER = 1 << 0, /* erase only blocks used as
122 * host blks or grown blks */
123 NVM_FACTORY_RESET_HOST_BLKS = 1 << 1, /* remove host blk marks */
124 NVM_FACTORY_RESET_GRWN_BBLKS = 1 << 2, /* remove grown blk marks */
125 NVM_FACTORY_NR_BITS = 1 << 3, /* stops here */
126};
127
128struct nvm_ioctl_dev_factory {
129 char dev[DISK_NAME_LEN];
130
131 __u32 flags;
132};
133
134struct nvm_user_vio {
135 __u8 opcode;
136 __u8 flags;
137 __u16 control;
138 __u16 nppas;
139 __u16 rsvd;
140 __u64 metadata;
141 __u64 addr;
142 __u64 ppa_list;
143 __u32 metadata_len;
144 __u32 data_len;
145 __u64 status;
146 __u32 result;
147 __u32 rsvd3[3];
148};
149
150struct nvm_passthru_vio {
151 __u8 opcode;
152 __u8 flags;
153 __u8 rsvd[2];
154 __u32 nsid;
155 __u32 cdw2;
156 __u32 cdw3;
157 __u64 metadata;
158 __u64 addr;
159 __u32 metadata_len;
160 __u32 data_len;
161 __u64 ppa_list;
162 __u16 nppas;
163 __u16 control;
164 __u32 cdw13;
165 __u32 cdw14;
166 __u32 cdw15;
167 __u64 status;
168 __u32 result;
169 __u32 timeout_ms;
170};
171
172/* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
173enum {
174 /* top level cmds */
175 NVM_INFO_CMD = 0x20,
176 NVM_GET_DEVICES_CMD,
177
178 /* device level cmds */
179 NVM_DEV_CREATE_CMD,
180 NVM_DEV_REMOVE_CMD,
181
182 /* Init a device to support LightNVM media managers */
183 NVM_DEV_INIT_CMD,
184
185 /* Factory reset device */
186 NVM_DEV_FACTORY_CMD,
187
188 /* Vector user I/O */
189 NVM_DEV_VIO_ADMIN_CMD = 0x41,
190 NVM_DEV_VIO_CMD = 0x42,
191 NVM_DEV_VIO_USER_CMD = 0x43,
192};
193
194#define NVM_IOCTL 'L' /* 0x4c */
195
196#define NVM_INFO _IOWR(NVM_IOCTL, NVM_INFO_CMD, \
197 struct nvm_ioctl_info)
198#define NVM_GET_DEVICES _IOR(NVM_IOCTL, NVM_GET_DEVICES_CMD, \
199 struct nvm_ioctl_get_devices)
200#define NVM_DEV_CREATE _IOW(NVM_IOCTL, NVM_DEV_CREATE_CMD, \
201 struct nvm_ioctl_create)
202#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \
203 struct nvm_ioctl_remove)
204#define NVM_DEV_INIT _IOW(NVM_IOCTL, NVM_DEV_INIT_CMD, \
205 struct nvm_ioctl_dev_init)
206#define NVM_DEV_FACTORY _IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
207 struct nvm_ioctl_dev_factory)
208
209#define NVME_NVM_IOCTL_IO_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_USER_CMD, \
210 struct nvm_passthru_vio)
211#define NVME_NVM_IOCTL_ADMIN_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_ADMIN_CMD,\
212 struct nvm_passthru_vio)
213#define NVME_NVM_IOCTL_SUBMIT_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_CMD,\
214 struct nvm_user_vio)
215
216#define NVM_VERSION_MAJOR 1
217#define NVM_VERSION_MINOR 0
218#define NVM_VERSION_PATCHLEVEL 0
219
220#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/lirc.h+11-2
...@@ -1,7 +1,6 @@...@@ -1,7 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*2/*
3 * lirc.h - linux infrared remote control header file3 * lirc.h - linux infrared remote control header file
4 * last modified 2010/07/13 by Jarod Wilson
5 */4 */
65
7#ifndef _LINUX_LIRC_H6#ifndef _LINUX_LIRC_H
...@@ -139,7 +138,7 @@...@@ -139,7 +138,7 @@
139 */138 */
140#define LIRC_GET_REC_TIMEOUT _IOR('i', 0x00000024, __u32)139#define LIRC_GET_REC_TIMEOUT _IOR('i', 0x00000024, __u32)
141140
142/*141/**
143 * struct lirc_scancode - decoded scancode with protocol for use with142 * struct lirc_scancode - decoded scancode with protocol for use with
144 * LIRC_MODE_SCANCODE143 * LIRC_MODE_SCANCODE
145 *144 *
...@@ -192,6 +191,11 @@ struct lirc_scancode {...@@ -192,6 +191,11 @@ struct lirc_scancode {
192 * @RC_PROTO_XMP: XMP protocol191 * @RC_PROTO_XMP: XMP protocol
193 * @RC_PROTO_CEC: CEC protocol192 * @RC_PROTO_CEC: CEC protocol
194 * @RC_PROTO_IMON: iMon Pad protocol193 * @RC_PROTO_IMON: iMon Pad protocol
194 * @RC_PROTO_RCMM12: RC-MM protocol 12 bits
195 * @RC_PROTO_RCMM24: RC-MM protocol 24 bits
196 * @RC_PROTO_RCMM32: RC-MM protocol 32 bits
197 * @RC_PROTO_XBOX_DVD: Xbox DVD Movie Playback Kit protocol
198 * @RC_PROTO_MAX: Maximum value of enum rc_proto
195 */199 */
196enum rc_proto {200enum rc_proto {
197 RC_PROTO_UNKNOWN = 0,201 RC_PROTO_UNKNOWN = 0,
...@@ -218,6 +222,11 @@ enum rc_proto {...@@ -218,6 +222,11 @@ enum rc_proto {
218 RC_PROTO_XMP = 21,222 RC_PROTO_XMP = 21,
219 RC_PROTO_CEC = 22,223 RC_PROTO_CEC = 22,
220 RC_PROTO_IMON = 23,224 RC_PROTO_IMON = 23,
225 RC_PROTO_RCMM12 = 24,
226 RC_PROTO_RCMM24 = 25,
227 RC_PROTO_RCMM32 = 26,
228 RC_PROTO_XBOX_DVD = 27,
229 RC_PROTO_MAX = RC_PROTO_XBOX_DVD,
221};230};
222231
223#endif232#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/loop.h+29-2
...@@ -25,6 +25,16 @@ enum {...@@ -25,6 +25,16 @@ enum {
25 LO_FLAGS_DIRECT_IO = 16,25 LO_FLAGS_DIRECT_IO = 16,
26};26};
2727
28/* LO_FLAGS that can be set using LOOP_SET_STATUS(64) */
29#define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN)
30
31/* LO_FLAGS that can be cleared using LOOP_SET_STATUS(64) */
32#define LOOP_SET_STATUS_CLEARABLE_FLAGS (LO_FLAGS_AUTOCLEAR)
33
34/* LO_FLAGS that can be set using LOOP_CONFIGURE */
35#define LOOP_CONFIGURE_SETTABLE_FLAGS (LO_FLAGS_READ_ONLY | LO_FLAGS_AUTOCLEAR \
36 | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
37
28#include <asm/posix_types.h> /* for __kernel_old_dev_t */38#include <asm/posix_types.h> /* for __kernel_old_dev_t */
29#include <linux/types.h> /* for __u64 */39#include <linux/types.h> /* for __u64 */
3040
...@@ -37,7 +47,7 @@ struct loop_info {...@@ -37,7 +47,7 @@ struct loop_info {
37 int lo_offset;47 int lo_offset;
38 int lo_encrypt_type;48 int lo_encrypt_type;
39 int lo_encrypt_key_size; /* ioctl w/o */49 int lo_encrypt_key_size; /* ioctl w/o */
40 int lo_flags; /* ioctl r/o */50 int lo_flags;
41 char lo_name[LO_NAME_SIZE];51 char lo_name[LO_NAME_SIZE];
42 unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */52 unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
43 unsigned long lo_init[2];53 unsigned long lo_init[2];
...@@ -53,13 +63,29 @@ struct loop_info64 {...@@ -53,13 +63,29 @@ struct loop_info64 {
53 __u32 lo_number; /* ioctl r/o */63 __u32 lo_number; /* ioctl r/o */
54 __u32 lo_encrypt_type;64 __u32 lo_encrypt_type;
55 __u32 lo_encrypt_key_size; /* ioctl w/o */65 __u32 lo_encrypt_key_size; /* ioctl w/o */
56 __u32 lo_flags; /* ioctl r/o */66 __u32 lo_flags;
57 __u8 lo_file_name[LO_NAME_SIZE];67 __u8 lo_file_name[LO_NAME_SIZE];
58 __u8 lo_crypt_name[LO_NAME_SIZE];68 __u8 lo_crypt_name[LO_NAME_SIZE];
59 __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */69 __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
60 __u64 lo_init[2];70 __u64 lo_init[2];
61};71};
6272
73/**
74 * struct loop_config - Complete configuration for a loop device.
75 * @fd: fd of the file to be used as a backing file for the loop device.
76 * @block_size: block size to use; ignored if 0.
77 * @info: struct loop_info64 to configure the loop device with.
78 *
79 * This structure is used with the LOOP_CONFIGURE ioctl, and can be used to
80 * atomically setup and configure all loop device parameters at once.
81 */
82struct loop_config {
83 __u32 fd;
84 __u32 block_size;
85 struct loop_info64 info;
86 __u64 __reserved[8];
87};
88
63/*89/*
64 * Loop filter types90 * Loop filter types
65 */91 */
...@@ -90,6 +116,7 @@ struct loop_info64 {...@@ -90,6 +116,7 @@ struct loop_info64 {
90#define LOOP_SET_CAPACITY 0x4C07116#define LOOP_SET_CAPACITY 0x4C07
91#define LOOP_SET_DIRECT_IO 0x4C08117#define LOOP_SET_DIRECT_IO 0x4C08
92#define LOOP_SET_BLOCK_SIZE 0x4C09118#define LOOP_SET_BLOCK_SIZE 0x4C09
119#define LOOP_CONFIGURE 0x4C0A
93120
94/* /dev/loop-control interface */121/* /dev/loop-control interface */
95#define LOOP_CTL_ADD 0x4C80122#define LOOP_CTL_ADD 0x4C80
lib/libc/include/any-linux-any/linux/lwtunnel.h+43
...@@ -13,6 +13,8 @@ enum lwtunnel_encap_types {...@@ -13,6 +13,8 @@ enum lwtunnel_encap_types {
13 LWTUNNEL_ENCAP_SEG6,13 LWTUNNEL_ENCAP_SEG6,
14 LWTUNNEL_ENCAP_BPF,14 LWTUNNEL_ENCAP_BPF,
15 LWTUNNEL_ENCAP_SEG6_LOCAL,15 LWTUNNEL_ENCAP_SEG6_LOCAL,
16 LWTUNNEL_ENCAP_RPL,
17 LWTUNNEL_ENCAP_IOAM6,
16 __LWTUNNEL_ENCAP_MAX,18 __LWTUNNEL_ENCAP_MAX,
17};19};
1820
...@@ -27,6 +29,7 @@ enum lwtunnel_ip_t {...@@ -27,6 +29,7 @@ enum lwtunnel_ip_t {
27 LWTUNNEL_IP_TOS,29 LWTUNNEL_IP_TOS,
28 LWTUNNEL_IP_FLAGS,30 LWTUNNEL_IP_FLAGS,
29 LWTUNNEL_IP_PAD,31 LWTUNNEL_IP_PAD,
32 LWTUNNEL_IP_OPTS,
30 __LWTUNNEL_IP_MAX,33 __LWTUNNEL_IP_MAX,
31};34};
3235
...@@ -41,11 +44,51 @@ enum lwtunnel_ip6_t {...@@ -41,11 +44,51 @@ enum lwtunnel_ip6_t {
41 LWTUNNEL_IP6_TC,44 LWTUNNEL_IP6_TC,
42 LWTUNNEL_IP6_FLAGS,45 LWTUNNEL_IP6_FLAGS,
43 LWTUNNEL_IP6_PAD,46 LWTUNNEL_IP6_PAD,
47 LWTUNNEL_IP6_OPTS,
44 __LWTUNNEL_IP6_MAX,48 __LWTUNNEL_IP6_MAX,
45};49};
4650
47#define LWTUNNEL_IP6_MAX (__LWTUNNEL_IP6_MAX - 1)51#define LWTUNNEL_IP6_MAX (__LWTUNNEL_IP6_MAX - 1)
4852
53enum {
54 LWTUNNEL_IP_OPTS_UNSPEC,
55 LWTUNNEL_IP_OPTS_GENEVE,
56 LWTUNNEL_IP_OPTS_VXLAN,
57 LWTUNNEL_IP_OPTS_ERSPAN,
58 __LWTUNNEL_IP_OPTS_MAX,
59};
60
61#define LWTUNNEL_IP_OPTS_MAX (__LWTUNNEL_IP_OPTS_MAX - 1)
62
63enum {
64 LWTUNNEL_IP_OPT_GENEVE_UNSPEC,
65 LWTUNNEL_IP_OPT_GENEVE_CLASS,
66 LWTUNNEL_IP_OPT_GENEVE_TYPE,
67 LWTUNNEL_IP_OPT_GENEVE_DATA,
68 __LWTUNNEL_IP_OPT_GENEVE_MAX,
69};
70
71#define LWTUNNEL_IP_OPT_GENEVE_MAX (__LWTUNNEL_IP_OPT_GENEVE_MAX - 1)
72
73enum {
74 LWTUNNEL_IP_OPT_VXLAN_UNSPEC,
75 LWTUNNEL_IP_OPT_VXLAN_GBP,
76 __LWTUNNEL_IP_OPT_VXLAN_MAX,
77};
78
79#define LWTUNNEL_IP_OPT_VXLAN_MAX (__LWTUNNEL_IP_OPT_VXLAN_MAX - 1)
80
81enum {
82 LWTUNNEL_IP_OPT_ERSPAN_UNSPEC,
83 LWTUNNEL_IP_OPT_ERSPAN_VER,
84 LWTUNNEL_IP_OPT_ERSPAN_INDEX,
85 LWTUNNEL_IP_OPT_ERSPAN_DIR,
86 LWTUNNEL_IP_OPT_ERSPAN_HWID,
87 __LWTUNNEL_IP_OPT_ERSPAN_MAX,
88};
89
90#define LWTUNNEL_IP_OPT_ERSPAN_MAX (__LWTUNNEL_IP_OPT_ERSPAN_MAX - 1)
91
49enum {92enum {
50 LWT_BPF_PROG_UNSPEC,93 LWT_BPF_PROG_UNSPEC,
51 LWT_BPF_PROG_FD,94 LWT_BPF_PROG_FD,
lib/libc/include/any-linux-any/linux/magic.h+9
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#define SQUASHFS_MAGIC 0x7371736819#define SQUASHFS_MAGIC 0x73717368
20#define ECRYPTFS_SUPER_MAGIC 0xf15f20#define ECRYPTFS_SUPER_MAGIC 0xf15f
21#define EFS_SUPER_MAGIC 0x414A5321#define EFS_SUPER_MAGIC 0x414A53
22#define EROFS_SUPER_MAGIC_V1 0xE0F5E1E2
22#define EXT2_SUPER_MAGIC 0xEF5323#define EXT2_SUPER_MAGIC 0xEF53
23#define EXT3_SUPER_MAGIC 0xEF5324#define EXT3_SUPER_MAGIC 0xEF53
24#define XENFS_SUPER_MAGIC 0xabba197425#define XENFS_SUPER_MAGIC 0xabba1974
...@@ -29,6 +30,7 @@...@@ -29,6 +30,7 @@
29#define HPFS_SUPER_MAGIC 0xf995e84930#define HPFS_SUPER_MAGIC 0xf995e849
30#define ISOFS_SUPER_MAGIC 0x966031#define ISOFS_SUPER_MAGIC 0x9660
31#define JFFS2_SUPER_MAGIC 0x72b632#define JFFS2_SUPER_MAGIC 0x72b6
33#define XFS_SUPER_MAGIC 0x58465342 /* "XFSB" */
32#define PSTOREFS_MAGIC 0x6165676C34#define PSTOREFS_MAGIC 0x6165676C
33#define EFIVARFS_MAGIC 0xde5e81e435#define EFIVARFS_MAGIC 0xde5e81e4
34#define HOSTFS_SUPER_MAGIC 0x00c0ffee36#define HOSTFS_SUPER_MAGIC 0x00c0ffee
...@@ -72,6 +74,7 @@...@@ -72,6 +74,7 @@
72#define DAXFS_MAGIC 0x6464617874#define DAXFS_MAGIC 0x64646178
73#define BINFMTFS_MAGIC 0x42494e4d75#define BINFMTFS_MAGIC 0x42494e4d
74#define DEVPTS_SUPER_MAGIC 0x1cd176#define DEVPTS_SUPER_MAGIC 0x1cd1
77#define BINDERFS_SUPER_MAGIC 0x6c6f6f70
75#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA78#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
76#define PIPEFS_MAGIC 0x5049504579#define PIPEFS_MAGIC 0x50495045
77#define PROC_SUPER_MAGIC 0x9fa080#define PROC_SUPER_MAGIC 0x9fa0
...@@ -84,10 +87,16 @@...@@ -84,10 +87,16 @@
84#define NSFS_MAGIC 0x6e73667387#define NSFS_MAGIC 0x6e736673
85#define BPF_FS_MAGIC 0xcafe4a1188#define BPF_FS_MAGIC 0xcafe4a11
86#define AAFS_MAGIC 0x5a3c69f089#define AAFS_MAGIC 0x5a3c69f0
90#define ZONEFS_MAGIC 0x5a4f4653
8791
88/* Since UDF 2.01 is ISO 13346 based... */92/* Since UDF 2.01 is ISO 13346 based... */
89#define UDF_SUPER_MAGIC 0x1501334693#define UDF_SUPER_MAGIC 0x15013346
90#define BALLOON_KVM_MAGIC 0x1366136694#define BALLOON_KVM_MAGIC 0x13661366
91#define ZSMALLOC_MAGIC 0x5829582995#define ZSMALLOC_MAGIC 0x58295829
96#define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */
97#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */
98#define Z3FOLD_MAGIC 0x33
99#define PPC_CMM_MAGIC 0xc7571590
100#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
92101
93#endif /* __LINUX_MAGIC_H__ */102#endif /* __LINUX_MAGIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/major.h-2
...@@ -34,8 +34,6 @@...@@ -34,8 +34,6 @@
34#define GOLDSTAR_CDROM_MAJOR 1634#define GOLDSTAR_CDROM_MAJOR 16
35#define OPTICS_CDROM_MAJOR 1735#define OPTICS_CDROM_MAJOR 17
36#define SANYO_CDROM_MAJOR 1836#define SANYO_CDROM_MAJOR 18
37#define CYCLADES_MAJOR 19
38#define CYCLADESAUX_MAJOR 20
39#define MITSUMI_X_CDROM_MAJOR 2037#define MITSUMI_X_CDROM_MAJOR 20
40#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */38#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */
41#define SCSI_GENERIC_MAJOR 2139#define SCSI_GENERIC_MAJOR 21
lib/libc/include/any-linux-any/linux/map_to_14segment.h created+241
...@@ -0,0 +1,241 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2021 Glider bv
4 *
5 * Based on include/uapi/linux/map_to_7segment.h:
6
7 * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>
8 */
9
10#ifndef MAP_TO_14SEGMENT_H
11#define MAP_TO_14SEGMENT_H
12
13/* This file provides translation primitives and tables for the conversion
14 * of (ASCII) characters to a 14-segments notation.
15 *
16 * The 14 segment's wikipedia notation below is used as standard.
17 * See: https://en.wikipedia.org/wiki/Fourteen-segment_display
18 *
19 * Notation: +---a---+
20 * |\ | /|
21 * f h i j b
22 * | \|/ |
23 * +-g1+-g2+
24 * | /|\ |
25 * e k l m c
26 * |/ | \|
27 * +---d---+
28 *
29 * Usage:
30 *
31 * Register a map variable, and fill it with a character set:
32 * static SEG14_DEFAULT_MAP(map_seg14);
33 *
34 *
35 * Then use for conversion:
36 * seg14 = map_to_seg14(&map_seg14, some_char);
37 * ...
38 *
39 * In device drivers it is recommended, if required, to make the char map
40 * accessible via the sysfs interface using the following scheme:
41 *
42 * static ssize_t map_seg14_show(struct device *dev,
43 * struct device_attribute *attr, char *buf)
44 * {
45 * memcpy(buf, &map_seg14, sizeof(map_seg14));
46 * return sizeof(map_seg14);
47 * }
48 * static ssize_t map_seg14_store(struct device *dev,
49 * struct device_attribute *attr,
50 * const char *buf, size_t cnt)
51 * {
52 * if (cnt != sizeof(map_seg14))
53 * return -EINVAL;
54 * memcpy(&map_seg14, buf, cnt);
55 * return cnt;
56 * }
57 * static DEVICE_ATTR_RW(map_seg14);
58 */
59#include <linux/errno.h>
60#include <linux/types.h>
61
62#include <asm/byteorder.h>
63
64#define BIT_SEG14_A 0
65#define BIT_SEG14_B 1
66#define BIT_SEG14_C 2
67#define BIT_SEG14_D 3
68#define BIT_SEG14_E 4
69#define BIT_SEG14_F 5
70#define BIT_SEG14_G1 6
71#define BIT_SEG14_G2 7
72#define BIT_SEG14_H 8
73#define BIT_SEG14_I 9
74#define BIT_SEG14_J 10
75#define BIT_SEG14_K 11
76#define BIT_SEG14_L 12
77#define BIT_SEG14_M 13
78#define BIT_SEG14_RESERVED1 14
79#define BIT_SEG14_RESERVED2 15
80
81struct seg14_conversion_map {
82 __be16 table[128];
83};
84
85static __inline__ int map_to_seg14(struct seg14_conversion_map *map, int c)
86{
87 if (c < 0 || c >= sizeof(map->table) / sizeof(map->table[0]))
88 return -EINVAL;
89
90 return __be16_to_cpu(map->table[c]);
91}
92
93#define SEG14_CONVERSION_MAP(_name, _map) \
94 struct seg14_conversion_map _name = { .table = { _map } }
95
96/*
97 * It is recommended to use a facility that allows user space to redefine
98 * custom character sets for LCD devices. Please use a sysfs interface
99 * as described above.
100 */
101#define MAP_TO_SEG14_SYSFS_FILE "map_seg14"
102
103/*******************************************************************************
104 * ASCII conversion table
105 ******************************************************************************/
106
107#define _SEG14(sym, a, b, c, d, e, f, g1, g2, h, j, k, l, m, n) \
108 __cpu_to_be16( a << BIT_SEG14_A | b << BIT_SEG14_B | \
109 c << BIT_SEG14_C | d << BIT_SEG14_D | \
110 e << BIT_SEG14_E | f << BIT_SEG14_F | \
111 g1 << BIT_SEG14_G1 | g2 << BIT_SEG14_G2 | \
112 h << BIT_SEG14_H | j << BIT_SEG14_I | \
113 k << BIT_SEG14_J | l << BIT_SEG14_K | \
114 m << BIT_SEG14_L | n << BIT_SEG14_M )
115
116#define _MAP_0_32_ASCII_SEG14_NON_PRINTABLE \
117 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
118
119#define _MAP_33_47_ASCII_SEG14_SYMBOL \
120 _SEG14('!', 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), \
121 _SEG14('"', 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), \
122 _SEG14('#', 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0), \
123 _SEG14('$', 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0), \
124 _SEG14('%', 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0), \
125 _SEG14('&', 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1), \
126 _SEG14('\'',0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), \
127 _SEG14('(', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1), \
128 _SEG14(')', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0), \
129 _SEG14('*', 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1), \
130 _SEG14('+', 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0), \
131 _SEG14(',', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0), \
132 _SEG14('-', 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0), \
133 _SEG14('.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), \
134 _SEG14('/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
135
136#define _MAP_48_57_ASCII_SEG14_NUMERIC \
137 _SEG14('0', 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0), \
138 _SEG14('1', 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), \
139 _SEG14('2', 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0), \
140 _SEG14('3', 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), \
141 _SEG14('4', 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
142 _SEG14('5', 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1), \
143 _SEG14('6', 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
144 _SEG14('7', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0), \
145 _SEG14('8', 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
146 _SEG14('9', 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0),
147
148#define _MAP_58_64_ASCII_SEG14_SYMBOL \
149 _SEG14(':', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), \
150 _SEG14(';', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0), \
151 _SEG14('<', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1), \
152 _SEG14('=', 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0), \
153 _SEG14('>', 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0), \
154 _SEG14('?', 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0), \
155 _SEG14('@', 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0),
156
157#define _MAP_65_90_ASCII_SEG14_ALPHA_UPPER \
158 _SEG14('A', 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
159 _SEG14('B', 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0), \
160 _SEG14('C', 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
161 _SEG14('D', 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), \
162 _SEG14('E', 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0), \
163 _SEG14('F', 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0), \
164 _SEG14('G', 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0), \
165 _SEG14('H', 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
166 _SEG14('I', 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), \
167 _SEG14('J', 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), \
168 _SEG14('K', 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1), \
169 _SEG14('L', 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
170 _SEG14('M', 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0), \
171 _SEG14('N', 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1), \
172 _SEG14('O', 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
173 _SEG14('P', 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
174 _SEG14('Q', 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1), \
175 _SEG14('R', 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1), \
176 _SEG14('S', 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0), \
177 _SEG14('T', 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), \
178 _SEG14('U', 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
179 _SEG14('V', 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0), \
180 _SEG14('W', 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1), \
181 _SEG14('X', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1), \
182 _SEG14('Y', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0), \
183 _SEG14('Z', 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
184
185#define _MAP_91_96_ASCII_SEG14_SYMBOL \
186 _SEG14('[', 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
187 _SEG14('\\',0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), \
188 _SEG14(']', 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), \
189 _SEG14('^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1), \
190 _SEG14('_', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), \
191 _SEG14('`', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0),
192
193#define _MAP_97_122_ASCII_SEG14_ALPHA_LOWER \
194 _SEG14('a', 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), \
195 _SEG14('b', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1), \
196 _SEG14('c', 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0), \
197 _SEG14('d', 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0), \
198 _SEG14('e', 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0), \
199 _SEG14('f', 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0), \
200 _SEG14('g', 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0), \
201 _SEG14('h', 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0), \
202 _SEG14('i', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), \
203 _SEG14('j', 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0), \
204 _SEG14('k', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1), \
205 _SEG14('l', 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), \
206 _SEG14('m', 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0), \
207 _SEG14('n', 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), \
208 _SEG14('o', 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0), \
209 _SEG14('p', 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0), \
210 _SEG14('q', 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0), \
211 _SEG14('r', 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0), \
212 _SEG14('s', 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), \
213 _SEG14('t', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0), \
214 _SEG14('u', 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0), \
215 _SEG14('v', 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0), \
216 _SEG14('w', 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1), \
217 _SEG14('x', 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1), \
218 _SEG14('y', 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0), \
219 _SEG14('z', 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0),
220
221#define _MAP_123_126_ASCII_SEG14_SYMBOL \
222 _SEG14('{', 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0), \
223 _SEG14('|', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), \
224 _SEG14('}', 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1), \
225 _SEG14('~', 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0),
226
227/* Maps */
228#define MAP_ASCII14SEG_ALPHANUM \
229 _MAP_0_32_ASCII_SEG14_NON_PRINTABLE \
230 _MAP_33_47_ASCII_SEG14_SYMBOL \
231 _MAP_48_57_ASCII_SEG14_NUMERIC \
232 _MAP_58_64_ASCII_SEG14_SYMBOL \
233 _MAP_65_90_ASCII_SEG14_ALPHA_UPPER \
234 _MAP_91_96_ASCII_SEG14_SYMBOL \
235 _MAP_97_122_ASCII_SEG14_ALPHA_LOWER \
236 _MAP_123_126_ASCII_SEG14_SYMBOL
237
238#define SEG14_DEFAULT_MAP(_name) \
239 SEG14_CONVERSION_MAP(_name, MAP_ASCII14SEG_ALPHANUM)
240
241#endif /* MAP_TO_14SEGMENT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/map_to_7segment.h+9-18
...@@ -1,20 +1,6 @@...@@ -1,20 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>3 * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */4 */
195
20#ifndef MAP_TO_7SEGMENT_H6#ifndef MAP_TO_7SEGMENT_H
...@@ -24,7 +10,7 @@...@@ -24,7 +10,7 @@
24 * of (ASCII) characters to a 7-segments notation.10 * of (ASCII) characters to a 7-segments notation.
25 *11 *
26 * The 7 segment's wikipedia notation below is used as standard.12 * The 7 segment's wikipedia notation below is used as standard.
27 * See: http://en.wikipedia.org/wiki/Seven_segment_display13 * See: https://en.wikipedia.org/wiki/Seven_segment_display
28 *14 *
29 * Notation: +-a-+15 * Notation: +-a-+
30 * f b16 * f b
...@@ -45,17 +31,22 @@...@@ -45,17 +31,22 @@
45 * In device drivers it is recommended, if required, to make the char map31 * In device drivers it is recommended, if required, to make the char map
46 * accessible via the sysfs interface using the following scheme:32 * accessible via the sysfs interface using the following scheme:
47 *33 *
48 * static ssize_t show_map(struct device *dev, char *buf) {34 * static ssize_t map_seg7_show(struct device *dev,
35 * struct device_attribute *attr, char *buf)
36 * {
49 * memcpy(buf, &map_seg7, sizeof(map_seg7));37 * memcpy(buf, &map_seg7, sizeof(map_seg7));
50 * return sizeof(map_seg7);38 * return sizeof(map_seg7);
51 * }39 * }
52 * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) {40 * static ssize_t map_seg7_store(struct device *dev,
41 * struct device_attribute *attr, const char *buf,
42 * size_t cnt)
43 * {
53 * if(cnt != sizeof(map_seg7))44 * if(cnt != sizeof(map_seg7))
54 * return -EINVAL;45 * return -EINVAL;
55 * memcpy(&map_seg7, buf, cnt);46 * memcpy(&map_seg7, buf, cnt);
56 * return cnt;47 * return cnt;
57 * }48 * }
58 * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map);49 * static DEVICE_ATTR_RW(map_seg7);
59 *50 *
60 * History:51 * History:
61 * 2005-05-31 RFC linux-kernel@vger.kernel.org52 * 2005-05-31 RFC linux-kernel@vger.kernel.org
lib/libc/include/any-linux-any/linux/mctp.h created+50
...@@ -0,0 +1,50 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Management Component Transport Protocol (MCTP)
4 *
5 * Copyright (c) 2021 Code Construct
6 * Copyright (c) 2021 Google
7 */
8
9#ifndef __UAPI_MCTP_H
10#define __UAPI_MCTP_H
11
12#include <linux/types.h>
13#include <linux/socket.h>
14#include <linux/netdevice.h>
15
16typedef __u8 mctp_eid_t;
17
18struct mctp_addr {
19 mctp_eid_t s_addr;
20};
21
22struct sockaddr_mctp {
23 __kernel_sa_family_t smctp_family;
24 __u16 __smctp_pad0;
25 unsigned int smctp_network;
26 struct mctp_addr smctp_addr;
27 __u8 smctp_type;
28 __u8 smctp_tag;
29 __u8 __smctp_pad1;
30};
31
32struct sockaddr_mctp_ext {
33 struct sockaddr_mctp smctp_base;
34 int smctp_ifindex;
35 __u8 smctp_halen;
36 __u8 __smctp_pad0[3];
37 __u8 smctp_haddr[MAX_ADDR_LEN];
38};
39
40#define MCTP_NET_ANY 0x0
41
42#define MCTP_ADDR_NULL 0x00
43#define MCTP_ADDR_ANY 0xff
44
45#define MCTP_TAG_MASK 0x07
46#define MCTP_TAG_OWNER 0x08
47
48#define MCTP_OPT_ADDR_EXT 1
49
50#endif /* __UAPI_MCTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mdio.h+66
...@@ -45,16 +45,22 @@...@@ -45,16 +45,22 @@
45#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */45#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
46#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */46#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
47#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */47#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */
48#define MDIO_PCS_EEE_ABLE2 21 /* EEE Capability register 2 */
49#define MDIO_PMA_NG_EXTABLE 21 /* 2.5G/5G PMA/PMD extended ability */
48#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */50#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */
49#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */51#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
50#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */52#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
51#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */53#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */
54#define MDIO_AN_EEE_ADV2 62 /* EEE advertisement 2 */
55#define MDIO_AN_EEE_LPABLE2 63 /* EEE link partner ability 2 */
56#define MDIO_AN_CTRL2 64 /* AN THP bypass request control */
5257
53/* Media-dependent registers. */58/* Media-dependent registers. */
54#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */59#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
55#define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */60#define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */
56#define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A.61#define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A.
57 * Lanes B-D are numbered 134-136. */62 * Lanes B-D are numbered 134-136. */
63#define MDIO_PMA_10GBR_FSRT_CSR 147 /* 10GBASE-R fast retrain status and control */
58#define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */64#define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */
59#define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */65#define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */
60#define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */66#define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */
...@@ -92,6 +98,10 @@...@@ -92,6 +98,10 @@
92#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)98#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
93/* 10PASS-TS/2BASE-TL */99/* 10PASS-TS/2BASE-TL */
94#define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)100#define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)
101/* 2.5 Gb/s */
102#define MDIO_CTRL1_SPEED2_5G (MDIO_CTRL1_SPEEDSELEXT | 0x18)
103/* 5 Gb/s */
104#define MDIO_CTRL1_SPEED5G (MDIO_CTRL1_SPEEDSELEXT | 0x1c)
95105
96/* Status register 1. */106/* Status register 1. */
97#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */107#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */
...@@ -112,9 +122,12 @@...@@ -112,9 +122,12 @@
112#define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */122#define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */
113#define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */123#define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */
114#define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */124#define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */
125#define MDIO_PCS_SPEED_2_5G 0x0040 /* 2.5G capable */
126#define MDIO_PCS_SPEED_5G 0x0080 /* 5G capable */
115127
116/* Device present registers. */128/* Device present registers. */
117#define MDIO_DEVS_PRESENT(devad) (1 << (devad))129#define MDIO_DEVS_PRESENT(devad) (1 << (devad))
130#define MDIO_DEVS_C22PRESENT MDIO_DEVS_PRESENT(0)
118#define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)131#define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
119#define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS)132#define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
120#define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS)133#define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
...@@ -123,6 +136,8 @@...@@ -123,6 +136,8 @@
123#define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC)136#define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC)
124#define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN)137#define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN)
125#define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)138#define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
139#define MDIO_DEVS_VEND1 MDIO_DEVS_PRESENT(MDIO_MMD_VEND1)
140#define MDIO_DEVS_VEND2 MDIO_DEVS_PRESENT(MDIO_MMD_VEND2)
126141
127/* Control register 2. */142/* Control register 2. */
128#define MDIO_PMA_CTRL2_TYPE 0x000f /* PMA/PMD type selection */143#define MDIO_PMA_CTRL2_TYPE 0x000f /* PMA/PMD type selection */
...@@ -142,6 +157,8 @@...@@ -142,6 +157,8 @@
142#define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */157#define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */
143#define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */158#define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */
144#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */159#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */
160#define MDIO_PMA_CTRL2_2_5GBT 0x0030 /* 2.5GBaseT type */
161#define MDIO_PMA_CTRL2_5GBT 0x0031 /* 5GBaseT type */
145#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */162#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */
146#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */163#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */
147#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */164#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */
...@@ -195,6 +212,7 @@...@@ -195,6 +212,7 @@
195#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */212#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */
196#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */213#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */
197#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */214#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */
215#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */
198216
199/* PHY XGXS lane state register. */217/* PHY XGXS lane state register. */
200#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001218#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
...@@ -223,6 +241,9 @@...@@ -223,6 +241,9 @@
223#define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */241#define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */
224#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */242#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */
225243
244/* PMA 10GBASE-R Fast Retrain status and control register. */
245#define MDIO_PMA_10GBR_FSRT_ENABLE 0x0001 /* Fast retrain enable */
246
226/* PCS 10GBASE-R/-T status register 1. */247/* PCS 10GBASE-R/-T status register 1. */
227#define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001 /* Block lock attained */248#define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001 /* Block lock attained */
228249
...@@ -231,9 +252,14 @@...@@ -231,9 +252,14 @@
231#define MDIO_PCS_10GBRT_STAT2_BER 0x3f00252#define MDIO_PCS_10GBRT_STAT2_BER 0x3f00
232253
233/* AN 10GBASE-T control register. */254/* AN 10GBASE-T control register. */
255#define MDIO_AN_10GBT_CTRL_ADVFSRT2_5G 0x0020 /* Advertise 2.5GBASE-T fast retrain */
256#define MDIO_AN_10GBT_CTRL_ADV2_5G 0x0080 /* Advertise 2.5GBASE-T */
257#define MDIO_AN_10GBT_CTRL_ADV5G 0x0100 /* Advertise 5GBASE-T */
234#define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */258#define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */
235259
236/* AN 10GBASE-T status register. */260/* AN 10GBASE-T status register. */
261#define MDIO_AN_10GBT_STAT_LP2_5G 0x0020 /* LP is 2.5GBT capable */
262#define MDIO_AN_10GBT_STAT_LP5G 0x0040 /* LP is 5GBT capable */
237#define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */263#define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */
238#define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */264#define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */
239#define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */265#define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */
...@@ -261,6 +287,20 @@...@@ -261,6 +287,20 @@
261#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */287#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
262#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */288#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
263#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */289#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
290#define MDIO_EEE_40GR_FW 0x0100 /* 40G R fast wake */
291#define MDIO_EEE_40GR_DS 0x0200 /* 40G R deep sleep */
292#define MDIO_EEE_100GR_FW 0x1000 /* 100G R fast wake */
293#define MDIO_EEE_100GR_DS 0x2000 /* 100G R deep sleep */
294
295#define MDIO_EEE_2_5GT 0x0001 /* 2.5GT EEE cap */
296#define MDIO_EEE_5GT 0x0002 /* 5GT EEE cap */
297
298/* AN MultiGBASE-T AN control 2 */
299#define MDIO_AN_THP_BP2_5GT 0x0008 /* 2.5GT THP bypass request */
300
301/* 2.5G/5G Extended abilities register. */
302#define MDIO_PMA_NG_EXTABLE_2_5GBT 0x0001 /* 2.5GBASET ability */
303#define MDIO_PMA_NG_EXTABLE_5GBT 0x0002 /* 5GBASET ability */
264304
265/* LASI RX_ALARM control/status registers. */305/* LASI RX_ALARM control/status registers. */
266#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */306#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
...@@ -295,4 +335,30 @@ static __inline__ __u16 mdio_phy_id_c45(int prtad, int devad)...@@ -295,4 +335,30 @@ static __inline__ __u16 mdio_phy_id_c45(int prtad, int devad)
295 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;335 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
296}336}
297337
338/* UsxgmiiChannelInfo[15:0] for USXGMII in-band auto-negotiation.*/
339#define MDIO_USXGMII_EEE_CLK_STP 0x0080 /* EEE clock stop supported */
340#define MDIO_USXGMII_EEE 0x0100 /* EEE supported */
341#define MDIO_USXGMII_SPD_MASK 0x0e00 /* USXGMII speed mask */
342#define MDIO_USXGMII_FULL_DUPLEX 0x1000 /* USXGMII full duplex */
343#define MDIO_USXGMII_DPX_SPD_MASK 0x1e00 /* USXGMII duplex and speed bits */
344#define MDIO_USXGMII_10 0x0000 /* 10Mbps */
345#define MDIO_USXGMII_10HALF 0x0000 /* 10Mbps half-duplex */
346#define MDIO_USXGMII_10FULL 0x1000 /* 10Mbps full-duplex */
347#define MDIO_USXGMII_100 0x0200 /* 100Mbps */
348#define MDIO_USXGMII_100HALF 0x0200 /* 100Mbps half-duplex */
349#define MDIO_USXGMII_100FULL 0x1200 /* 100Mbps full-duplex */
350#define MDIO_USXGMII_1000 0x0400 /* 1000Mbps */
351#define MDIO_USXGMII_1000HALF 0x0400 /* 1000Mbps half-duplex */
352#define MDIO_USXGMII_1000FULL 0x1400 /* 1000Mbps full-duplex */
353#define MDIO_USXGMII_10G 0x0600 /* 10Gbps */
354#define MDIO_USXGMII_10GHALF 0x0600 /* 10Gbps half-duplex */
355#define MDIO_USXGMII_10GFULL 0x1600 /* 10Gbps full-duplex */
356#define MDIO_USXGMII_2500 0x0800 /* 2500Mbps */
357#define MDIO_USXGMII_2500HALF 0x0800 /* 2500Mbps half-duplex */
358#define MDIO_USXGMII_2500FULL 0x1800 /* 2500Mbps full-duplex */
359#define MDIO_USXGMII_5000 0x0a00 /* 5000Mbps */
360#define MDIO_USXGMII_5000HALF 0x0a00 /* 5000Mbps half-duplex */
361#define MDIO_USXGMII_5000FULL 0x1a00 /* 5000Mbps full-duplex */
362#define MDIO_USXGMII_LINK 0x8000 /* PHY link with copper-side partner */
363
298#endif /* __LINUX_MDIO_H__ */364#endif /* __LINUX_MDIO_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media-bus-format.h+14-2
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
3434
35#define MEDIA_BUS_FMT_FIXED 0x000135#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x101b */37/* RGB - next is 0x101e */
38#define MEDIA_BUS_FMT_RGB444_1X12 0x101638#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
39#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x100139#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
40#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x100240#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
...@@ -50,10 +50,13 @@...@@ -50,10 +50,13 @@
50#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x101550#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
51#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x101051#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
52#define MEDIA_BUS_FMT_BGR888_1X24 0x101352#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
53#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
53#define MEDIA_BUS_FMT_GBR888_1X24 0x101454#define MEDIA_BUS_FMT_GBR888_1X24 0x1014
54#define MEDIA_BUS_FMT_RGB888_1X24 0x100a55#define MEDIA_BUS_FMT_RGB888_1X24 0x100a
55#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b56#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b
56#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c57#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c
58#define MEDIA_BUS_FMT_RGB888_3X8 0x101c
59#define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d
57#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x101160#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011
58#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x101261#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012
59#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d62#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
...@@ -62,7 +65,7 @@...@@ -62,7 +65,7 @@
62#define MEDIA_BUS_FMT_RGB121212_1X36 0x101965#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
63#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a66#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
6467
65/* YUV (including grey) - next is 0x202d */68/* YUV (including grey) - next is 0x202e */
66#define MEDIA_BUS_FMT_Y8_1X8 0x200169#define MEDIA_BUS_FMT_Y8_1X8 0x2001
67#define MEDIA_BUS_FMT_UV8_1X8 0x201570#define MEDIA_BUS_FMT_UV8_1X8 0x2015
68#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x200271#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
...@@ -84,6 +87,7 @@...@@ -84,6 +87,7 @@
84#define MEDIA_BUS_FMT_VYUY12_2X12 0x201d87#define MEDIA_BUS_FMT_VYUY12_2X12 0x201d
85#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e88#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
86#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f89#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
90#define MEDIA_BUS_FMT_Y14_1X14 0x202d
87#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f91#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
88#define MEDIA_BUS_FMT_VYUY8_1X16 0x201092#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
89#define MEDIA_BUS_FMT_YUYV8_1X16 0x201193#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
...@@ -153,4 +157,12 @@...@@ -153,4 +157,12 @@
153/* HSV - next is 0x6002 */157/* HSV - next is 0x6002 */
154#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001158#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001
155159
160/*
161 * This format should be used when the same driver handles
162 * both sides of the link and the bus format is a fixed
163 * metadata format that is not configurable from userspace.
164 * Width and height will be set to 0 for this format.
165 */
166#define MEDIA_BUS_FMT_METADATA_FIXED 0x7001
167
156#endif /* __LINUX_MEDIA_BUS_FORMAT_H */168#endif /* __LINUX_MEDIA_BUS_FORMAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media.h+25-11
...@@ -125,6 +125,7 @@ struct media_device_info {...@@ -125,6 +125,7 @@ struct media_device_info {
125#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)125#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
126#define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007)126#define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007)
127#define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008)127#define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008)
128#define MEDIA_ENT_F_PROC_VIDEO_ISP (MEDIA_ENT_F_BASE + 0x4009)
128129
129/*130/*
130 * Switch and bridge entity functions131 * Switch and bridge entity functions
...@@ -144,7 +145,7 @@ struct media_device_info {...@@ -144,7 +145,7 @@ struct media_device_info {
144#define MEDIA_ENT_FL_CONNECTOR (1 << 1)145#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
145146
146/* OR with the entity id value to find the next entity */147/* OR with the entity id value to find the next entity */
147#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)148#define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
148149
149struct media_entity_desc {150struct media_entity_desc {
150 __u32 id;151 __u32 id;
...@@ -258,6 +259,11 @@ struct media_links_enum {...@@ -258,6 +259,11 @@ struct media_links_enum {
258#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)259#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
259#define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5)260#define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5)
260261
262#define MEDIA_INTF_T_ALSA_BASE 0x00000300
263#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
264#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
265#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
266
261267
262/*268/*
263 * MC next gen API definitions269 * MC next gen API definitions
...@@ -350,6 +356,14 @@ struct media_v2_topology {...@@ -350,6 +356,14 @@ struct media_v2_topology {
350#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)356#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
351#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)357#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
352#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)358#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
359#define MEDIA_IOC_REQUEST_ALLOC _IOR ('|', 0x05, int)
360
361/*
362 * These ioctls are called on the request file descriptor as returned
363 * by MEDIA_IOC_REQUEST_ALLOC.
364 */
365#define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80)
366#define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
353367
354368
355/*369/*
...@@ -385,19 +399,19 @@ struct media_v2_topology {...@@ -385,19 +399,19 @@ struct media_v2_topology {
385#define MEDIA_ENT_F_DTV_DECODER MEDIA_ENT_F_DV_DECODER399#define MEDIA_ENT_F_DTV_DECODER MEDIA_ENT_F_DV_DECODER
386400
387/*401/*
388 * There is still no ALSA support in the media controller. These402 * There is still no full ALSA support in the media controller. These
389 * defines should not have been added and we leave them here only403 * defines should not have been added and we leave them here only
390 * in case some application tries to use these defines.404 * in case some application tries to use these defines.
405 *
406 * The ALSA defines that are in use have been moved into __KERNEL__
407 * scope. As support gets added to these interface types, they should
408 * be moved into __KERNEL__ scope with the code that uses them.
391 */409 */
392#define MEDIA_INTF_T_ALSA_BASE 0x00000300410#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)
393#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)411#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)
394#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)412#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
395#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)413#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
396#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)414#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
397#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)
398#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
399#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
400#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
401415
402/* Obsolete symbol for media_version, no longer used in the kernel */416/* Obsolete symbol for media_version, no longer used in the kernel */
403#define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0)417#define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0)
lib/libc/include/any-linux-any/linux/mei.h+52-64
...@@ -1,70 +1,9 @@...@@ -1,70 +1,9 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/******************************************************************************2/*
3 * Copyright(c) 2003-2015 Intel Corporation. All rights reserved.
3 * Intel Management Engine Interface (Intel MEI) Linux driver4 * Intel Management Engine Interface (Intel MEI) Linux driver
4 * Intel MEI Interface Header5 * Intel MEI Interface Header
5 *6 */
6 * This file is provided under a dual BSD/GPLv2 license. When using or
7 * redistributing this file, you may do so under either license.
8 *
9 * GPL LICENSE SUMMARY
10 *
11 * Copyright(c) 2003 - 2012 Intel Corporation. All rights reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as
15 * published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25 * USA
26 *
27 * The full GNU General Public License is included in this distribution
28 * in the file called LICENSE.GPL.
29 *
30 * Contact Information:
31 * Intel Corporation.
32 * linux-mei@linux.intel.com
33 * http://www.intel.com
34 *
35 * BSD LICENSE
36 *
37 * Copyright(c) 2003 - 2012 Intel Corporation. All rights reserved.
38 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *
66 *****************************************************************************/
67
68#ifndef _LINUX_MEI_H7#ifndef _LINUX_MEI_H
69#define _LINUX_MEI_H8#define _LINUX_MEI_H
709
...@@ -127,4 +66,53 @@ struct mei_connect_client_data {...@@ -127,4 +66,53 @@ struct mei_connect_client_data {
127 */66 */
128#define IOCTL_MEI_NOTIFY_GET _IOR('H', 0x03, __u32)67#define IOCTL_MEI_NOTIFY_GET _IOR('H', 0x03, __u32)
12968
69/**
70 * struct mei_connect_client_vtag - mei client information struct with vtag
71 *
72 * @in_client_uuid: UUID of client to connect
73 * @vtag: virtual tag
74 * @reserved: reserved for future use
75 */
76struct mei_connect_client_vtag {
77 uuid_le in_client_uuid;
78 __u8 vtag;
79 __u8 reserved[3];
80};
81
82/**
83 * struct mei_connect_client_data_vtag - IOCTL connect data union
84 *
85 * @connect: input connect data
86 * @out_client_properties: output client data
87 */
88struct mei_connect_client_data_vtag {
89 union {
90 struct mei_connect_client_vtag connect;
91 struct mei_client out_client_properties;
92 };
93};
94
95/**
96 * DOC:
97 * This IOCTL is used to associate the current file descriptor with a
98 * FW Client (given by UUID), and virtual tag (vtag).
99 * The IOCTL opens a communication channel between a host client and
100 * a FW client on a tagged channel. From this point on, every read
101 * and write will communicate with the associated FW client with
102 * on the tagged channel.
103 * Upone close() the communication is terminated.
104 *
105 * The IOCTL argument is a struct with a union that contains
106 * the input parameter and the output parameter for this IOCTL.
107 *
108 * The input parameter is UUID of the FW Client, a vtag [0,255]
109 * The output parameter is the properties of the FW client
110 * (FW protocool version and max message size).
111 *
112 * Clients that do not support tagged connection
113 * will respond with -EOPNOTSUPP.
114 */
115#define IOCTL_MEI_CONNECT_CLIENT_VTAG \
116 _IOWR('H', 0x04, struct mei_connect_client_data_vtag)
117
130#endif /* _LINUX_MEI_H */118#endif /* _LINUX_MEI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/membarrier.h+26
...@@ -114,6 +114,26 @@...@@ -114,6 +114,26 @@
114 * If this command is not implemented by an114 * If this command is not implemented by an
115 * architecture, -EINVAL is returned.115 * architecture, -EINVAL is returned.
116 * Returns 0 on success.116 * Returns 0 on success.
117 * @MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ:
118 * Ensure the caller thread, upon return from
119 * system call, that all its running thread
120 * siblings have any currently running rseq
121 * critical sections restarted if @flags
122 * parameter is 0; if @flags parameter is
123 * MEMBARRIER_CMD_FLAG_CPU,
124 * then this operation is performed only
125 * on CPU indicated by @cpu_id. If this command is
126 * not implemented by an architecture, -EINVAL
127 * is returned. A process needs to register its
128 * intent to use the private expedited rseq
129 * command prior to using it, otherwise
130 * this command returns -EPERM.
131 * @MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ:
132 * Register the process intent to use
133 * MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ.
134 * If this command is not implemented by an
135 * architecture, -EINVAL is returned.
136 * Returns 0 on success.
117 * @MEMBARRIER_CMD_SHARED:137 * @MEMBARRIER_CMD_SHARED:
118 * Alias to MEMBARRIER_CMD_GLOBAL. Provided for138 * Alias to MEMBARRIER_CMD_GLOBAL. Provided for
119 * header backward compatibility.139 * header backward compatibility.
...@@ -131,9 +151,15 @@ enum membarrier_cmd {...@@ -131,9 +151,15 @@ enum membarrier_cmd {
131 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4),151 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4),
132 MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 5),152 MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 5),
133 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),153 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),
154 MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = (1 << 7),
155 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = (1 << 8),
134156
135 /* Alias for header backward compatibility. */157 /* Alias for header backward compatibility. */
136 MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,158 MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,
137};159};
138160
161enum membarrier_cmd_flag {
162 MEMBARRIER_CMD_FLAG_CPU = (1 << 0),
163};
164
139#endif /* _LINUX_MEMBARRIER_H */165#endif /* _LINUX_MEMBARRIER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mempolicy.h+11-2
...@@ -22,18 +22,21 @@ enum {...@@ -22,18 +22,21 @@ enum {
22 MPOL_BIND,22 MPOL_BIND,
23 MPOL_INTERLEAVE,23 MPOL_INTERLEAVE,
24 MPOL_LOCAL,24 MPOL_LOCAL,
25 MPOL_PREFERRED_MANY,
25 MPOL_MAX, /* always last member of enum */26 MPOL_MAX, /* always last member of enum */
26};27};
2728
28/* Flags for set_mempolicy */29/* Flags for set_mempolicy */
29#define MPOL_F_STATIC_NODES (1 << 15)30#define MPOL_F_STATIC_NODES (1 << 15)
30#define MPOL_F_RELATIVE_NODES (1 << 14)31#define MPOL_F_RELATIVE_NODES (1 << 14)
32#define MPOL_F_NUMA_BALANCING (1 << 13) /* Optimize with NUMA balancing if possible */
3133
32/*34/*
33 * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to35 * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
34 * either set_mempolicy() or mbind().36 * either set_mempolicy() or mbind().
35 */37 */
36#define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)38#define MPOL_MODE_FLAGS \
39 (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES | MPOL_F_NUMA_BALANCING)
3740
38/* Flags for get_mempolicy */41/* Flags for get_mempolicy */
39#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */42#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
...@@ -58,9 +61,15 @@ enum {...@@ -58,9 +61,15 @@ enum {
58 * are never OR'ed into the mode in mempolicy API arguments.61 * are never OR'ed into the mode in mempolicy API arguments.
59 */62 */
60#define MPOL_F_SHARED (1 << 0) /* identify shared policies */63#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
61#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
62#define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */64#define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */
63#define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */65#define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */
6466
67/*
68 * These bit locations are exposed in the vm.zone_reclaim_mode sysctl
69 * ABI. New bits are OK, but existing bits can never change.
70 */
71#define RECLAIM_ZONE (1<<0) /* Run shrink_inactive_list on the zone */
72#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */
73#define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */
6574
66#endif /* _LINUX_MEMPOLICY_H */75#endif /* _LINUX_MEMPOLICY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mic_common.h deleted-235
...@@ -1,235 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Intel MIC Platform Software Stack (MPSS)
4 *
5 * Copyright(c) 2013 Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 2, as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * The full GNU General Public License is included in this distribution in
17 * the file called "COPYING".
18 *
19 * Intel MIC driver.
20 *
21 */
22#ifndef __MIC_COMMON_H_
23#define __MIC_COMMON_H_
24
25#include <linux/virtio_ring.h>
26
27#define __mic_align(a, x) (((a) + (x) - 1) & ~((x) - 1))
28
29/**
30 * struct mic_device_desc: Virtio device information shared between the
31 * virtio driver and userspace backend
32 *
33 * @type: Device type: console/network/disk etc. Type 0/-1 terminates.
34 * @num_vq: Number of virtqueues.
35 * @feature_len: Number of bytes of feature bits. Multiply by 2: one for
36 host features and one for guest acknowledgements.
37 * @config_len: Number of bytes of the config array after virtqueues.
38 * @status: A status byte, written by the Guest.
39 * @config: Start of the following variable length config.
40 */
41struct mic_device_desc {
42 __s8 type;
43 __u8 num_vq;
44 __u8 feature_len;
45 __u8 config_len;
46 __u8 status;
47 __le64 config[0];
48} __attribute__ ((aligned(8)));
49
50/**
51 * struct mic_device_ctrl: Per virtio device information in the device page
52 * used internally by the host and card side drivers.
53 *
54 * @vdev: Used for storing MIC vdev information by the guest.
55 * @config_change: Set to 1 by host when a config change is requested.
56 * @vdev_reset: Set to 1 by guest to indicate virtio device has been reset.
57 * @guest_ack: Set to 1 by guest to ack a command.
58 * @host_ack: Set to 1 by host to ack a command.
59 * @used_address_updated: Set to 1 by guest when the used address should be
60 * updated.
61 * @c2h_vdev_db: The doorbell number to be used by guest. Set by host.
62 * @h2c_vdev_db: The doorbell number to be used by host. Set by guest.
63 */
64struct mic_device_ctrl {
65 __le64 vdev;
66 __u8 config_change;
67 __u8 vdev_reset;
68 __u8 guest_ack;
69 __u8 host_ack;
70 __u8 used_address_updated;
71 __s8 c2h_vdev_db;
72 __s8 h2c_vdev_db;
73} __attribute__ ((aligned(8)));
74
75/**
76 * struct mic_bootparam: Virtio device independent information in device page
77 *
78 * @magic: A magic value used by the card to ensure it can see the host
79 * @h2c_config_db: Host to Card Virtio config doorbell set by card
80 * @node_id: Unique id of the node
81 * @h2c_scif_db - Host to card SCIF doorbell set by card
82 * @c2h_scif_db - Card to host SCIF doorbell set by host
83 * @scif_host_dma_addr - SCIF host queue pair DMA address
84 * @scif_card_dma_addr - SCIF card queue pair DMA address
85 */
86struct mic_bootparam {
87 __le32 magic;
88 __s8 h2c_config_db;
89 __u8 node_id;
90 __u8 h2c_scif_db;
91 __u8 c2h_scif_db;
92 __u64 scif_host_dma_addr;
93 __u64 scif_card_dma_addr;
94} __attribute__ ((aligned(8)));
95
96/**
97 * struct mic_device_page: High level representation of the device page
98 *
99 * @bootparam: The bootparam structure is used for sharing information and
100 * status updates between MIC host and card drivers.
101 * @desc: Array of MIC virtio device descriptors.
102 */
103struct mic_device_page {
104 struct mic_bootparam bootparam;
105 struct mic_device_desc desc[0];
106};
107/**
108 * struct mic_vqconfig: This is how we expect the device configuration field
109 * for a virtqueue to be laid out in config space.
110 *
111 * @address: Guest/MIC physical address of the virtio ring
112 * (avail and desc rings)
113 * @used_address: Guest/MIC physical address of the used ring
114 * @num: The number of entries in the virtio_ring
115 */
116struct mic_vqconfig {
117 __le64 address;
118 __le64 used_address;
119 __le16 num;
120} __attribute__ ((aligned(8)));
121
122/*
123 * The alignment to use between consumer and producer parts of vring.
124 * This is pagesize for historical reasons.
125 */
126#define MIC_VIRTIO_RING_ALIGN 4096
127
128#define MIC_MAX_VRINGS 4
129#define MIC_VRING_ENTRIES 128
130
131/*
132 * Max vring entries (power of 2) to ensure desc and avail rings
133 * fit in a single page
134 */
135#define MIC_MAX_VRING_ENTRIES 128
136
137/**
138 * Max size of the desc block in bytes: includes:
139 * - struct mic_device_desc
140 * - struct mic_vqconfig (num_vq of these)
141 * - host and guest features
142 * - virtio device config space
143 */
144#define MIC_MAX_DESC_BLK_SIZE 256
145
146/**
147 * struct _mic_vring_info - Host vring info exposed to userspace backend
148 * for the avail index and magic for the card.
149 *
150 * @avail_idx: host avail idx
151 * @magic: A magic debug cookie.
152 */
153struct _mic_vring_info {
154 __u16 avail_idx;
155 __le32 magic;
156};
157
158/**
159 * struct mic_vring - Vring information.
160 *
161 * @vr: The virtio ring.
162 * @info: Host vring information exposed to the userspace backend for the
163 * avail index and magic for the card.
164 * @va: The va for the buffer allocated for vr and info.
165 * @len: The length of the buffer required for allocating vr and info.
166 */
167struct mic_vring {
168 struct vring vr;
169 struct _mic_vring_info *info;
170 void *va;
171 int len;
172};
173
174#define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
175
176#ifndef INTEL_MIC_CARD
177static __inline__ unsigned mic_desc_size(const struct mic_device_desc *desc)
178{
179 return sizeof(*desc) + desc->num_vq * sizeof(struct mic_vqconfig)
180 + desc->feature_len * 2 + desc->config_len;
181}
182
183static __inline__ struct mic_vqconfig *
184mic_vq_config(const struct mic_device_desc *desc)
185{
186 return (struct mic_vqconfig *)(desc + 1);
187}
188
189static __inline__ __u8 *mic_vq_features(const struct mic_device_desc *desc)
190{
191 return (__u8 *)(mic_vq_config(desc) + desc->num_vq);
192}
193
194static __inline__ __u8 *mic_vq_configspace(const struct mic_device_desc *desc)
195{
196 return mic_vq_features(desc) + desc->feature_len * 2;
197}
198static __inline__ unsigned mic_total_desc_size(struct mic_device_desc *desc)
199{
200 return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl);
201}
202#endif
203
204/* Device page size */
205#define MIC_DP_SIZE 4096
206
207#define MIC_MAGIC 0xc0ffee00
208
209/**
210 * enum mic_states - MIC states.
211 */
212enum mic_states {
213 MIC_READY = 0,
214 MIC_BOOTING,
215 MIC_ONLINE,
216 MIC_SHUTTING_DOWN,
217 MIC_RESETTING,
218 MIC_RESET_FAILED,
219 MIC_LAST
220};
221
222/**
223 * enum mic_status - MIC status reported by card after
224 * a host or card initiated shutdown or a card crash.
225 */
226enum mic_status {
227 MIC_NOP = 0,
228 MIC_CRASHED,
229 MIC_HALTED,
230 MIC_POWER_OFF,
231 MIC_RESTART,
232 MIC_STATUS_LAST
233};
234
235#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mic_ioctl.h deleted-73
...@@ -1,73 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Intel MIC Platform Software Stack (MPSS)
4 *
5 * Copyright(c) 2013 Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 2, as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * The full GNU General Public License is included in this distribution in
17 * the file called "COPYING".
18 *
19 * Intel MIC Host driver.
20 *
21 */
22#ifndef _MIC_IOCTL_H_
23#define _MIC_IOCTL_H_
24
25#include <linux/types.h>
26
27/*
28 * mic_copy - MIC virtio descriptor copy.
29 *
30 * @iov: An array of IOVEC structures containing user space buffers.
31 * @iovcnt: Number of IOVEC structures in iov.
32 * @vr_idx: The vring index.
33 * @update_used: A non zero value results in used index being updated.
34 * @out_len: The aggregate of the total length written to or read from
35 * the virtio device.
36 */
37struct mic_copy_desc {
38 struct iovec *iov;
39 __u32 iovcnt;
40 __u8 vr_idx;
41 __u8 update_used;
42 __u32 out_len;
43};
44
45/*
46 * Add a new virtio device
47 * The (struct mic_device_desc *) pointer points to a device page entry
48 * for the virtio device consisting of:
49 * - struct mic_device_desc
50 * - struct mic_vqconfig (num_vq of these)
51 * - host and guest features
52 * - virtio device config space
53 * The total size referenced by the pointer should equal the size returned
54 * by desc_size() in mic_common.h
55 */
56#define MIC_VIRTIO_ADD_DEVICE _IOWR('s', 1, struct mic_device_desc *)
57
58/*
59 * Copy the number of entries in the iovec and update the used index
60 * if requested by the user.
61 */
62#define MIC_VIRTIO_COPY_DESC _IOWR('s', 2, struct mic_copy_desc *)
63
64/*
65 * Notify virtio device of a config change
66 * The (__u8 *) pointer points to config space values for the device
67 * as they should be written into the device page. The total size
68 * referenced by the pointer should equal the config_len field of struct
69 * mic_device_desc.
70 */
71#define MIC_VIRTIO_CONFIG_CHANGE _IOWR('s', 5, __u8 *)
72
73#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mii.h+21
...@@ -121,6 +121,8 @@...@@ -121,6 +121,8 @@
121#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */121#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
122#define EXPANSION_RESV 0xffe0 /* Unused... */122#define EXPANSION_RESV 0xffe0 /* Unused... */
123123
124#define ESTATUS_1000_XFULL 0x8000 /* Can do 1000BaseX Full */
125#define ESTATUS_1000_XHALF 0x4000 /* Can do 1000BaseX Half */
124#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */126#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
125#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */127#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
126128
...@@ -129,14 +131,33 @@...@@ -129,14 +131,33 @@
129#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */131#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
130#define NWAYTEST_RESV2 0xfe00 /* Unused... */132#define NWAYTEST_RESV2 0xfe00 /* Unused... */
131133
134/* MAC and PHY tx_config_Reg[15:0] for SGMII in-band auto-negotiation.*/
135#define ADVERTISE_SGMII 0x0001 /* MAC can do SGMII */
136#define LPA_SGMII 0x0001 /* PHY can do SGMII */
137#define LPA_SGMII_SPD_MASK 0x0c00 /* SGMII speed mask */
138#define LPA_SGMII_FULL_DUPLEX 0x1000 /* SGMII full duplex */
139#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */
140#define LPA_SGMII_10 0x0000 /* 10Mbps */
141#define LPA_SGMII_10HALF 0x0000 /* Can do 10mbps half-duplex */
142#define LPA_SGMII_10FULL 0x1000 /* Can do 10mbps full-duplex */
143#define LPA_SGMII_100 0x0400 /* 100Mbps */
144#define LPA_SGMII_100HALF 0x0400 /* Can do 100mbps half-duplex */
145#define LPA_SGMII_100FULL 0x1400 /* Can do 100mbps full-duplex */
146#define LPA_SGMII_1000 0x0800 /* 1000Mbps */
147#define LPA_SGMII_1000HALF 0x0800 /* Can do 1000mbps half-duplex */
148#define LPA_SGMII_1000FULL 0x1800 /* Can do 1000mbps full-duplex */
149#define LPA_SGMII_LINK 0x8000 /* PHY link with copper-side partner */
150
132/* 1000BASE-T Control register */151/* 1000BASE-T Control register */
133#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */152#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
134#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */153#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
154#define CTL1000_PREFER_MASTER 0x0400 /* prefer to operate as master */
135#define CTL1000_AS_MASTER 0x0800155#define CTL1000_AS_MASTER 0x0800
136#define CTL1000_ENABLE_MASTER 0x1000156#define CTL1000_ENABLE_MASTER 0x1000
137157
138/* 1000BASE-T Status register */158/* 1000BASE-T Status register */
139#define LPA_1000MSFAIL 0x8000 /* Master/Slave resolution failure */159#define LPA_1000MSFAIL 0x8000 /* Master/Slave resolution failure */
160#define LPA_1000MSRES 0x4000 /* Master/Slave resolution status */
140#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */161#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
141#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */162#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
142#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */163#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
lib/libc/include/any-linux-any/linux/misc/bcm_vk.h created+84
...@@ -0,0 +1,84 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 2018-2020 Broadcom.
4 */
5
6#ifndef __UAPI_LINUX_MISC_BCM_VK_H
7#define __UAPI_LINUX_MISC_BCM_VK_H
8
9#include <linux/ioctl.h>
10#include <linux/types.h>
11
12#define BCM_VK_MAX_FILENAME 64
13
14struct vk_image {
15 __u32 type; /* Type of image */
16#define VK_IMAGE_TYPE_BOOT1 1 /* 1st stage (load to SRAM) */
17#define VK_IMAGE_TYPE_BOOT2 2 /* 2nd stage (load to DDR) */
18 __u8 filename[BCM_VK_MAX_FILENAME]; /* Filename of image */
19};
20
21struct vk_reset {
22 __u32 arg1;
23 __u32 arg2;
24};
25
26#define VK_MAGIC 0x5e
27
28/* Load image to Valkyrie */
29#define VK_IOCTL_LOAD_IMAGE _IOW(VK_MAGIC, 0x2, struct vk_image)
30
31/* Send Reset to Valkyrie */
32#define VK_IOCTL_RESET _IOW(VK_MAGIC, 0x4, struct vk_reset)
33
34/*
35 * Firmware Status accessed directly via BAR space
36 */
37#define VK_BAR_FWSTS 0x41c
38#define VK_BAR_COP_FWSTS 0x428
39/* VK_FWSTS definitions */
40#define VK_FWSTS_RELOCATION_ENTRY (1UL << 0)
41#define VK_FWSTS_RELOCATION_EXIT (1UL << 1)
42#define VK_FWSTS_INIT_START (1UL << 2)
43#define VK_FWSTS_ARCH_INIT_DONE (1UL << 3)
44#define VK_FWSTS_PRE_KNL1_INIT_DONE (1UL << 4)
45#define VK_FWSTS_PRE_KNL2_INIT_DONE (1UL << 5)
46#define VK_FWSTS_POST_KNL_INIT_DONE (1UL << 6)
47#define VK_FWSTS_INIT_DONE (1UL << 7)
48#define VK_FWSTS_APP_INIT_START (1UL << 8)
49#define VK_FWSTS_APP_INIT_DONE (1UL << 9)
50#define VK_FWSTS_MASK 0xffffffff
51#define VK_FWSTS_READY (VK_FWSTS_INIT_START | \
52 VK_FWSTS_ARCH_INIT_DONE | \
53 VK_FWSTS_PRE_KNL1_INIT_DONE | \
54 VK_FWSTS_PRE_KNL2_INIT_DONE | \
55 VK_FWSTS_POST_KNL_INIT_DONE | \
56 VK_FWSTS_INIT_DONE | \
57 VK_FWSTS_APP_INIT_START | \
58 VK_FWSTS_APP_INIT_DONE)
59/* Deinit */
60#define VK_FWSTS_APP_DEINIT_START (1UL << 23)
61#define VK_FWSTS_APP_DEINIT_DONE (1UL << 24)
62#define VK_FWSTS_DRV_DEINIT_START (1UL << 25)
63#define VK_FWSTS_DRV_DEINIT_DONE (1UL << 26)
64#define VK_FWSTS_RESET_DONE (1UL << 27)
65#define VK_FWSTS_DEINIT_TRIGGERED (VK_FWSTS_APP_DEINIT_START | \
66 VK_FWSTS_APP_DEINIT_DONE | \
67 VK_FWSTS_DRV_DEINIT_START | \
68 VK_FWSTS_DRV_DEINIT_DONE)
69/* Last nibble for reboot reason */
70#define VK_FWSTS_RESET_REASON_SHIFT 28
71#define VK_FWSTS_RESET_REASON_MASK (0xf << VK_FWSTS_RESET_REASON_SHIFT)
72#define VK_FWSTS_RESET_SYS_PWRUP (0x0 << VK_FWSTS_RESET_REASON_SHIFT)
73#define VK_FWSTS_RESET_MBOX_DB (0x1 << VK_FWSTS_RESET_REASON_SHIFT)
74#define VK_FWSTS_RESET_M7_WDOG (0x2 << VK_FWSTS_RESET_REASON_SHIFT)
75#define VK_FWSTS_RESET_TEMP (0x3 << VK_FWSTS_RESET_REASON_SHIFT)
76#define VK_FWSTS_RESET_PCI_FLR (0x4 << VK_FWSTS_RESET_REASON_SHIFT)
77#define VK_FWSTS_RESET_PCI_HOT (0x5 << VK_FWSTS_RESET_REASON_SHIFT)
78#define VK_FWSTS_RESET_PCI_WARM (0x6 << VK_FWSTS_RESET_REASON_SHIFT)
79#define VK_FWSTS_RESET_PCI_COLD (0x7 << VK_FWSTS_RESET_REASON_SHIFT)
80#define VK_FWSTS_RESET_L1 (0x8 << VK_FWSTS_RESET_REASON_SHIFT)
81#define VK_FWSTS_RESET_L0 (0x9 << VK_FWSTS_RESET_REASON_SHIFT)
82#define VK_FWSTS_RESET_UNKNOWN (0xf << VK_FWSTS_RESET_REASON_SHIFT)
83
84#endif /* __UAPI_LINUX_MISC_BCM_VK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mman.h+8-2
...@@ -5,13 +5,18 @@...@@ -5,13 +5,18 @@
5#include <asm/mman.h>5#include <asm/mman.h>
6#include <asm-generic/hugetlb_encode.h>6#include <asm-generic/hugetlb_encode.h>
77
8#define MREMAP_MAYMOVE 18#define MREMAP_MAYMOVE 1
9#define MREMAP_FIXED 29#define MREMAP_FIXED 2
10#define MREMAP_DONTUNMAP 4
1011
11#define OVERCOMMIT_GUESS 012#define OVERCOMMIT_GUESS 0
12#define OVERCOMMIT_ALWAYS 113#define OVERCOMMIT_ALWAYS 1
13#define OVERCOMMIT_NEVER 214#define OVERCOMMIT_NEVER 2
1415
16#define MAP_SHARED 0x01 /* Share changes */
17#define MAP_PRIVATE 0x02 /* Changes are private */
18#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
19
15/*20/*
16 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page21 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
17 * size other than the default is desired. See hugetlb_encode.h.22 * size other than the default is desired. See hugetlb_encode.h.
...@@ -22,6 +27,7 @@...@@ -22,6 +27,7 @@
22#define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT27#define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
23#define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK28#define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK
2429
30#define MAP_HUGE_16KB HUGETLB_FLAG_ENCODE_16KB
25#define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB31#define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB
26#define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB32#define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB
27#define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB33#define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB
lib/libc/include/any-linux-any/linux/mmc/ioctl.h+5-1
...@@ -3,9 +3,13 @@...@@ -3,9 +3,13 @@
3#define LINUX_MMC_IOCTL_H3#define LINUX_MMC_IOCTL_H
44
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/major.h>
67
7struct mmc_ioc_cmd {8struct mmc_ioc_cmd {
8 /* Implies direction of data. true = write, false = read */9 /*
10 * Direction of data: nonzero = write, zero = read.
11 * Bit 31 selects 'Reliable Write' for RPMB.
12 */
9 int write_flag;13 int write_flag;
1014
11 /* Application-specific command. true = precede with CMD55 */15 /* Application-specific command. true = precede with CMD55 */
lib/libc/include/any-linux-any/linux/mount.h created+139
...@@ -0,0 +1,139 @@
1#ifndef _LINUX_MOUNT_H
2#define _LINUX_MOUNT_H
3
4#include <linux/types.h>
5
6/*
7 * These are the fs-independent mount-flags: up to 32 flags are supported
8 *
9 * Usage of these is restricted within the kernel to core mount(2) code and
10 * callers of sys_mount() only. Filesystems should be using the SB_*
11 * equivalent instead.
12 */
13#define MS_RDONLY 1 /* Mount read-only */
14#define MS_NOSUID 2 /* Ignore suid and sgid bits */
15#define MS_NODEV 4 /* Disallow access to device special files */
16#define MS_NOEXEC 8 /* Disallow program execution */
17#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
18#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
19#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
20#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
21#define MS_NOSYMFOLLOW 256 /* Do not follow symlinks */
22#define MS_NOATIME 1024 /* Do not update access times. */
23#define MS_NODIRATIME 2048 /* Do not update directory access times */
24#define MS_BIND 4096
25#define MS_MOVE 8192
26#define MS_REC 16384
27#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
28 MS_VERBOSE is deprecated. */
29#define MS_SILENT 32768
30#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
31#define MS_UNBINDABLE (1<<17) /* change to unbindable */
32#define MS_PRIVATE (1<<18) /* change to private */
33#define MS_SLAVE (1<<19) /* change to slave */
34#define MS_SHARED (1<<20) /* change to shared */
35#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
36#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
37#define MS_I_VERSION (1<<23) /* Update inode I_version field */
38#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
39#define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
40
41/* These sb flags are internal to the kernel */
42#define MS_SUBMOUNT (1<<26)
43#define MS_NOREMOTELOCK (1<<27)
44#define MS_NOSEC (1<<28)
45#define MS_BORN (1<<29)
46#define MS_ACTIVE (1<<30)
47#define MS_NOUSER (1<<31)
48
49/*
50 * Superblock flags that can be altered by MS_REMOUNT
51 */
52#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\
53 MS_LAZYTIME)
54
55/*
56 * Old magic mount flag and mask
57 */
58#define MS_MGC_VAL 0xC0ED0000
59#define MS_MGC_MSK 0xffff0000
60
61/*
62 * open_tree() flags.
63 */
64#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */
65#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
66
67/*
68 * move_mount() flags.
69 */
70#define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
71#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
72#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
73#define MOVE_MOUNT_T_SYMLINKS 0x00000010 /* Follow symlinks on to path */
74#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */
75#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
76#define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
77#define MOVE_MOUNT__MASK 0x00000177
78
79/*
80 * fsopen() flags.
81 */
82#define FSOPEN_CLOEXEC 0x00000001
83
84/*
85 * fspick() flags.
86 */
87#define FSPICK_CLOEXEC 0x00000001
88#define FSPICK_SYMLINK_NOFOLLOW 0x00000002
89#define FSPICK_NO_AUTOMOUNT 0x00000004
90#define FSPICK_EMPTY_PATH 0x00000008
91
92/*
93 * The type of fsconfig() call made.
94 */
95enum fsconfig_command {
96 FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
97 FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
98 FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */
99 FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
100 FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
101 FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
102 FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
103 FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
104};
105
106/*
107 * fsmount() flags.
108 */
109#define FSMOUNT_CLOEXEC 0x00000001
110
111/*
112 * Mount attributes.
113 */
114#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only */
115#define MOUNT_ATTR_NOSUID 0x00000002 /* Ignore suid and sgid bits */
116#define MOUNT_ATTR_NODEV 0x00000004 /* Disallow access to device special files */
117#define MOUNT_ATTR_NOEXEC 0x00000008 /* Disallow program execution */
118#define MOUNT_ATTR__ATIME 0x00000070 /* Setting on how atime should be updated */
119#define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */
120#define MOUNT_ATTR_NOATIME 0x00000010 /* - Do not update access times. */
121#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */
122#define MOUNT_ATTR_NODIRATIME 0x00000080 /* Do not update directory access times */
123#define MOUNT_ATTR_IDMAP 0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */
124#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks */
125
126/*
127 * mount_setattr()
128 */
129struct mount_attr {
130 __u64 attr_set;
131 __u64 attr_clr;
132 __u64 propagation;
133 __u64 userns_fd;
134};
135
136/* List of all mount_attr versions. */
137#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
138
139#endif /* _LINUX_MOUNT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mptcp.h created+229
...@@ -0,0 +1,229 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _MPTCP_H
3#define _MPTCP_H
4
5#include <linux/const.h>
6#include <linux/types.h>
7#include <linux/in.h> /* for sockaddr_in */
8#include <linux/in6.h> /* for sockaddr_in6 */
9#include <linux/socket.h> /* for sockaddr_storage and sa_family */
10
11#include <sys/socket.h> /* for struct sockaddr */
12
13#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
14#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
15#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)
16#define MPTCP_SUBFLOW_FLAG_JOIN_LOC _BITUL(3)
17#define MPTCP_SUBFLOW_FLAG_BKUP_REM _BITUL(4)
18#define MPTCP_SUBFLOW_FLAG_BKUP_LOC _BITUL(5)
19#define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED _BITUL(6)
20#define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7)
21#define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8)
22
23enum {
24 MPTCP_SUBFLOW_ATTR_UNSPEC,
25 MPTCP_SUBFLOW_ATTR_TOKEN_REM,
26 MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
27 MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
28 MPTCP_SUBFLOW_ATTR_MAP_SEQ,
29 MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
30 MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
31 MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
32 MPTCP_SUBFLOW_ATTR_FLAGS,
33 MPTCP_SUBFLOW_ATTR_ID_REM,
34 MPTCP_SUBFLOW_ATTR_ID_LOC,
35 MPTCP_SUBFLOW_ATTR_PAD,
36 __MPTCP_SUBFLOW_ATTR_MAX
37};
38
39#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
40
41/* netlink interface */
42#define MPTCP_PM_NAME "mptcp_pm"
43#define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds"
44#define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
45#define MPTCP_PM_VER 0x1
46
47/*
48 * ATTR types defined for MPTCP
49 */
50enum {
51 MPTCP_PM_ATTR_UNSPEC,
52
53 MPTCP_PM_ATTR_ADDR, /* nested address */
54 MPTCP_PM_ATTR_RCV_ADD_ADDRS, /* u32 */
55 MPTCP_PM_ATTR_SUBFLOWS, /* u32 */
56
57 __MPTCP_PM_ATTR_MAX
58};
59
60#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
61
62enum {
63 MPTCP_PM_ADDR_ATTR_UNSPEC,
64
65 MPTCP_PM_ADDR_ATTR_FAMILY, /* u16 */
66 MPTCP_PM_ADDR_ATTR_ID, /* u8 */
67 MPTCP_PM_ADDR_ATTR_ADDR4, /* struct in_addr */
68 MPTCP_PM_ADDR_ATTR_ADDR6, /* struct in6_addr */
69 MPTCP_PM_ADDR_ATTR_PORT, /* u16 */
70 MPTCP_PM_ADDR_ATTR_FLAGS, /* u32 */
71 MPTCP_PM_ADDR_ATTR_IF_IDX, /* s32 */
72
73 __MPTCP_PM_ADDR_ATTR_MAX
74};
75
76#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
77
78#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
79#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
80#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
81#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
82
83enum {
84 MPTCP_PM_CMD_UNSPEC,
85
86 MPTCP_PM_CMD_ADD_ADDR,
87 MPTCP_PM_CMD_DEL_ADDR,
88 MPTCP_PM_CMD_GET_ADDR,
89 MPTCP_PM_CMD_FLUSH_ADDRS,
90 MPTCP_PM_CMD_SET_LIMITS,
91 MPTCP_PM_CMD_GET_LIMITS,
92 MPTCP_PM_CMD_SET_FLAGS,
93
94 __MPTCP_PM_CMD_AFTER_LAST
95};
96
97#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
98#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
99
100struct mptcp_info {
101 __u8 mptcpi_subflows;
102 __u8 mptcpi_add_addr_signal;
103 __u8 mptcpi_add_addr_accepted;
104 __u8 mptcpi_subflows_max;
105 __u8 mptcpi_add_addr_signal_max;
106 __u8 mptcpi_add_addr_accepted_max;
107 __u32 mptcpi_flags;
108 __u32 mptcpi_token;
109 __u64 mptcpi_write_seq;
110 __u64 mptcpi_snd_una;
111 __u64 mptcpi_rcv_nxt;
112 __u8 mptcpi_local_addr_used;
113 __u8 mptcpi_local_addr_max;
114 __u8 mptcpi_csum_enabled;
115};
116
117/*
118 * MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
119 * sport, dport
120 * A new MPTCP connection has been created. It is the good time to allocate
121 * memory and send ADD_ADDR if needed. Depending on the traffic-patterns
122 * it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent.
123 *
124 * MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
125 * sport, dport
126 * A MPTCP connection is established (can start new subflows).
127 *
128 * MPTCP_EVENT_CLOSED: token
129 * A MPTCP connection has stopped.
130 *
131 * MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport]
132 * A new address has been announced by the peer.
133 *
134 * MPTCP_EVENT_REMOVED: token, rem_id
135 * An address has been lost by the peer.
136 *
137 * MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6,
138 * daddr4 | daddr6, sport, dport, backup,
139 * if_idx [, error]
140 * A new subflow has been established. 'error' should not be set.
141 *
142 * MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6,
143 * sport, dport, backup, if_idx [, error]
144 * A subflow has been closed. An error (copy of sk_err) could be set if an
145 * error has been detected for this subflow.
146 *
147 * MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6,
148 * sport, dport, backup, if_idx [, error]
149 * The priority of a subflow has changed. 'error' should not be set.
150 */
151enum mptcp_event_type {
152 MPTCP_EVENT_UNSPEC = 0,
153 MPTCP_EVENT_CREATED = 1,
154 MPTCP_EVENT_ESTABLISHED = 2,
155 MPTCP_EVENT_CLOSED = 3,
156
157 MPTCP_EVENT_ANNOUNCED = 6,
158 MPTCP_EVENT_REMOVED = 7,
159
160 MPTCP_EVENT_SUB_ESTABLISHED = 10,
161 MPTCP_EVENT_SUB_CLOSED = 11,
162
163 MPTCP_EVENT_SUB_PRIORITY = 13,
164};
165
166enum mptcp_event_attr {
167 MPTCP_ATTR_UNSPEC = 0,
168
169 MPTCP_ATTR_TOKEN, /* u32 */
170 MPTCP_ATTR_FAMILY, /* u16 */
171 MPTCP_ATTR_LOC_ID, /* u8 */
172 MPTCP_ATTR_REM_ID, /* u8 */
173 MPTCP_ATTR_SADDR4, /* be32 */
174 MPTCP_ATTR_SADDR6, /* struct in6_addr */
175 MPTCP_ATTR_DADDR4, /* be32 */
176 MPTCP_ATTR_DADDR6, /* struct in6_addr */
177 MPTCP_ATTR_SPORT, /* be16 */
178 MPTCP_ATTR_DPORT, /* be16 */
179 MPTCP_ATTR_BACKUP, /* u8 */
180 MPTCP_ATTR_ERROR, /* u8 */
181 MPTCP_ATTR_FLAGS, /* u16 */
182 MPTCP_ATTR_TIMEOUT, /* u32 */
183 MPTCP_ATTR_IF_IDX, /* s32 */
184 MPTCP_ATTR_RESET_REASON,/* u32 */
185 MPTCP_ATTR_RESET_FLAGS, /* u32 */
186
187 __MPTCP_ATTR_AFTER_LAST
188};
189
190#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
191
192/* MPTCP Reset reason codes, rfc8684 */
193#define MPTCP_RST_EUNSPEC 0
194#define MPTCP_RST_EMPTCP 1
195#define MPTCP_RST_ERESOURCE 2
196#define MPTCP_RST_EPROHIBIT 3
197#define MPTCP_RST_EWQ2BIG 4
198#define MPTCP_RST_EBADPERF 5
199#define MPTCP_RST_EMIDDLEBOX 6
200
201struct mptcp_subflow_data {
202 __u32 size_subflow_data; /* size of this structure in userspace */
203 __u32 num_subflows; /* must be 0, set by kernel */
204 __u32 size_kernel; /* must be 0, set by kernel */
205 __u32 size_user; /* size of one element in data[] */
206} __attribute__((aligned(8)));
207
208struct mptcp_subflow_addrs {
209 union {
210 __kernel_sa_family_t sa_family;
211 struct sockaddr sa_local;
212 struct sockaddr_in sin_local;
213 struct sockaddr_in6 sin6_local;
214 struct __kernel_sockaddr_storage ss_local;
215 };
216 union {
217 struct sockaddr sa_remote;
218 struct sockaddr_in sin_remote;
219 struct sockaddr_in6 sin6_remote;
220 struct __kernel_sockaddr_storage ss_remote;
221 };
222};
223
224/* MPTCP socket options */
225#define MPTCP_INFO 1
226#define MPTCP_TCPINFO 2
227#define MPTCP_SUBFLOW_ADDRS 3
228
229#endif /* _MPTCP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mroute.h+11-3
...@@ -28,12 +28,19 @@...@@ -28,12 +28,19 @@
28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */
29#define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */29#define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */
30#define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */30#define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */
31#define MRT_MAX (MRT_BASE+11)31#define MRT_FLUSH (MRT_BASE+12) /* Flush all mfc entries and/or vifs */
32#define MRT_MAX (MRT_BASE+12)
3233
33#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */34#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
34#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)35#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
35#define SIOCGETRPF (SIOCPROTOPRIVATE+2)36#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
3637
38/* MRT_FLUSH optional flags */
39#define MRT_FLUSH_MFC 1 /* Flush multicast entries */
40#define MRT_FLUSH_MFC_STATIC 2 /* Flush static multicast entries */
41#define MRT_FLUSH_VIFS 4 /* Flush multicast vifs */
42#define MRT_FLUSH_VIFS_STATIC 8 /* Flush static multicast vifs */
43
37#define MAXVIFS 3244#define MAXVIFS 32
38typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */45typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
39typedef unsigned short vifi_t;46typedef unsigned short vifi_t;
...@@ -106,8 +113,8 @@ struct igmpmsg {...@@ -106,8 +113,8 @@ struct igmpmsg {
106 __u32 unused1,unused2;113 __u32 unused1,unused2;
107 unsigned char im_msgtype; /* What is this */114 unsigned char im_msgtype; /* What is this */
108 unsigned char im_mbz; /* Must be zero */115 unsigned char im_mbz; /* Must be zero */
109 unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */116 unsigned char im_vif; /* Low 8 bits of Interface */
110 unsigned char unused3;117 unsigned char im_vif_hi; /* High 8 bits of Interface */
111 struct in_addr im_src,im_dst;118 struct in_addr im_src,im_dst;
112};119};
113120
...@@ -162,6 +169,7 @@ enum {...@@ -162,6 +169,7 @@ enum {
162 IPMRA_CREPORT_SRC_ADDR,169 IPMRA_CREPORT_SRC_ADDR,
163 IPMRA_CREPORT_DST_ADDR,170 IPMRA_CREPORT_DST_ADDR,
164 IPMRA_CREPORT_PKT,171 IPMRA_CREPORT_PKT,
172 IPMRA_CREPORT_TABLE,
165 __IPMRA_CREPORT_MAX173 __IPMRA_CREPORT_MAX
166};174};
167#define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)175#define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
lib/libc/include/any-linux-any/linux/mroute6.h+9-2
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2#ifndef __LINUX_MROUTE6_H2#ifndef __LINUX_MROUTE6_H
3#define __LINUX_MROUTE6_H3#define __LINUX_MROUTE6_H
44
5#include <linux/kernel.h>5#include <linux/const.h>
6#include <linux/types.h>6#include <linux/types.h>
7#include <linux/sockios.h>7#include <linux/sockios.h>
8#include <linux/in6.h> /* For struct sockaddr_in6. */8#include <linux/in6.h> /* For struct sockaddr_in6. */
...@@ -31,12 +31,19 @@...@@ -31,12 +31,19 @@
31#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */31#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
32#define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */32#define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */
33#define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */33#define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */
34#define MRT6_MAX (MRT6_BASE+11)34#define MRT6_FLUSH (MRT6_BASE+12) /* Flush all mfc entries and/or vifs */
35#define MRT6_MAX (MRT6_BASE+12)
3536
36#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */37#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
37#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)38#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
38#define SIOCGETRPF (SIOCPROTOPRIVATE+2)39#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
3940
41/* MRT6_FLUSH optional flags */
42#define MRT6_FLUSH_MFC 1 /* Flush multicast entries */
43#define MRT6_FLUSH_MFC_STATIC 2 /* Flush static multicast entries */
44#define MRT6_FLUSH_MIFS 4 /* Flushing multicast vifs */
45#define MRT6_FLUSH_MIFS_STATIC 8 /* Flush static multicast vifs */
46
40#define MAXMIFS 3247#define MAXMIFS 32
41typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */48typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
42typedef unsigned short mifi_t;49typedef unsigned short mifi_t;
lib/libc/include/any-linux-any/linux/mrp_bridge.h created+74
...@@ -0,0 +1,74 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2
3#ifndef _LINUX_MRP_BRIDGE_H_
4#define _LINUX_MRP_BRIDGE_H_
5
6#include <linux/types.h>
7#include <linux/if_ether.h>
8
9#define MRP_MAX_FRAME_LENGTH 200
10#define MRP_DEFAULT_PRIO 0x8000
11#define MRP_DOMAIN_UUID_LENGTH 16
12#define MRP_VERSION 1
13#define MRP_FRAME_PRIO 7
14#define MRP_OUI_LENGTH 3
15#define MRP_MANUFACTURE_DATA_LENGTH 2
16
17enum br_mrp_ring_role_type {
18 BR_MRP_RING_ROLE_DISABLED,
19 BR_MRP_RING_ROLE_MRC,
20 BR_MRP_RING_ROLE_MRM,
21 BR_MRP_RING_ROLE_MRA,
22};
23
24enum br_mrp_in_role_type {
25 BR_MRP_IN_ROLE_DISABLED,
26 BR_MRP_IN_ROLE_MIC,
27 BR_MRP_IN_ROLE_MIM,
28};
29
30enum br_mrp_ring_state_type {
31 BR_MRP_RING_STATE_OPEN,
32 BR_MRP_RING_STATE_CLOSED,
33};
34
35enum br_mrp_in_state_type {
36 BR_MRP_IN_STATE_OPEN,
37 BR_MRP_IN_STATE_CLOSED,
38};
39
40enum br_mrp_port_state_type {
41 BR_MRP_PORT_STATE_DISABLED,
42 BR_MRP_PORT_STATE_BLOCKED,
43 BR_MRP_PORT_STATE_FORWARDING,
44 BR_MRP_PORT_STATE_NOT_CONNECTED,
45};
46
47enum br_mrp_port_role_type {
48 BR_MRP_PORT_ROLE_PRIMARY,
49 BR_MRP_PORT_ROLE_SECONDARY,
50 BR_MRP_PORT_ROLE_INTER,
51};
52
53enum br_mrp_tlv_header_type {
54 BR_MRP_TLV_HEADER_END = 0x0,
55 BR_MRP_TLV_HEADER_COMMON = 0x1,
56 BR_MRP_TLV_HEADER_RING_TEST = 0x2,
57 BR_MRP_TLV_HEADER_RING_TOPO = 0x3,
58 BR_MRP_TLV_HEADER_RING_LINK_DOWN = 0x4,
59 BR_MRP_TLV_HEADER_RING_LINK_UP = 0x5,
60 BR_MRP_TLV_HEADER_IN_TEST = 0x6,
61 BR_MRP_TLV_HEADER_IN_TOPO = 0x7,
62 BR_MRP_TLV_HEADER_IN_LINK_DOWN = 0x8,
63 BR_MRP_TLV_HEADER_IN_LINK_UP = 0x9,
64 BR_MRP_TLV_HEADER_IN_LINK_STATUS = 0xa,
65 BR_MRP_TLV_HEADER_OPTION = 0x7f,
66};
67
68enum br_mrp_sub_tlv_header_type {
69 BR_MRP_SUB_TLV_HEADER_TEST_MGR_NACK = 0x1,
70 BR_MRP_SUB_TLV_HEADER_TEST_PROPAGATE = 0x2,
71 BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR = 0x3,
72};
73
74#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/msdos_fs.h+2-7
...@@ -58,9 +58,6 @@...@@ -58,9 +58,6 @@
58#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */58#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
59#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */59#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
6060
61#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
62 MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
63
64/* start of data cluster's entry (number of reserved clusters) */61/* start of data cluster's entry (number of reserved clusters) */
65#define FAT_START_ENT 262#define FAT_START_ENT 2
6663
...@@ -68,8 +65,6 @@...@@ -68,8 +65,6 @@
68#define MAX_FAT12 0xFF465#define MAX_FAT12 0xFF4
69#define MAX_FAT16 0xFFF466#define MAX_FAT16 0xFFF4
70#define MAX_FAT32 0x0FFFFFF667#define MAX_FAT32 0x0FFFFFF6
71#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
72 MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
7368
74/* bad cluster mark */69/* bad cluster mark */
75#define BAD_FAT12 0xFF770#define BAD_FAT12 0xFF7
...@@ -135,7 +130,7 @@ struct fat_boot_sector {...@@ -135,7 +130,7 @@ struct fat_boot_sector {
135 for mount state. */130 for mount state. */
136 __u8 signature; /* extended boot signature */131 __u8 signature; /* extended boot signature */
137 __u8 vol_id[4]; /* volume ID */132 __u8 vol_id[4]; /* volume ID */
138 __u8 vol_label[11]; /* volume label */133 __u8 vol_label[MSDOS_NAME]; /* volume label */
139 __u8 fs_type[8]; /* file system type */134 __u8 fs_type[8]; /* file system type */
140 /* other fields are not added here */135 /* other fields are not added here */
141 } fat16;136 } fat16;
...@@ -158,7 +153,7 @@ struct fat_boot_sector {...@@ -158,7 +153,7 @@ struct fat_boot_sector {
158 for mount state. */153 for mount state. */
159 __u8 signature; /* extended boot signature */154 __u8 signature; /* extended boot signature */
160 __u8 vol_id[4]; /* volume ID */155 __u8 vol_id[4]; /* volume ID */
161 __u8 vol_label[11]; /* volume label */156 __u8 vol_label[MSDOS_NAME]; /* volume label */
162 __u8 fs_type[8]; /* file system type */157 __u8 fs_type[8]; /* file system type */
163 /* other fields are not added here */158 /* other fields are not added here */
164 } fat32;159 } fat32;
lib/libc/include/any-linux-any/linux/msg.h+3-3
...@@ -19,9 +19,9 @@ struct msqid_ds {...@@ -19,9 +19,9 @@ struct msqid_ds {
19 struct ipc_perm msg_perm;19 struct ipc_perm msg_perm;
20 struct msg *msg_first; /* first message on queue,unused */20 struct msg *msg_first; /* first message on queue,unused */
21 struct msg *msg_last; /* last message in queue,unused */21 struct msg *msg_last; /* last message in queue,unused */
22 __kernel_time_t msg_stime; /* last msgsnd time */22 __kernel_old_time_t msg_stime; /* last msgsnd time */
23 __kernel_time_t msg_rtime; /* last msgrcv time */23 __kernel_old_time_t msg_rtime; /* last msgrcv time */
24 __kernel_time_t msg_ctime; /* last change time */24 __kernel_old_time_t msg_ctime; /* last change time */
25 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */25 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
26 unsigned long msg_lqbytes; /* ditto */26 unsigned long msg_lqbytes; /* ditto */
27 unsigned short msg_cbytes; /* current number of bytes on queue */27 unsigned short msg_cbytes; /* current number of bytes on queue */
lib/libc/include/any-linux-any/linux/n_r3964.h deleted-99
...@@ -1,99 +0,0 @@
1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2/* r3964 linediscipline for linux
3 *
4 * -----------------------------------------------------------
5 * Copyright by
6 * Philips Automation Projects
7 * Kassel (Germany)
8 * -----------------------------------------------------------
9 * This software may be used and distributed according to the terms of
10 * the GNU General Public License, incorporated herein by reference.
11 *
12 * Author:
13 * L. Haag
14 *
15 * $Log: r3964.h,v $
16 * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
17 * Fixed HZ usage on 2.6 kernels
18 * Removed unnecessary include
19 *
20 * Revision 1.3 2001/03/18 13:02:24 dwmw2
21 * Fix timer usage, use spinlocks properly.
22 *
23 * Revision 1.2 2001/03/18 12:53:15 dwmw2
24 * Merge changes in 2.4.2
25 *
26 * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
27 * This'll screw the version control
28 *
29 * Revision 1.6 1998/09/30 00:40:38 dwmw2
30 * Updated to use kernel's N_R3964 if available
31 *
32 * Revision 1.4 1998/04/02 20:29:44 lhaag
33 * select, blocking, ...
34 *
35 * Revision 1.3 1998/02/12 18:58:43 root
36 * fixed some memory leaks
37 * calculation of checksum characters
38 *
39 * Revision 1.2 1998/02/07 13:03:17 root
40 * ioctl read_telegram
41 *
42 * Revision 1.1 1998/02/06 19:19:43 root
43 * Initial revision
44 *
45 *
46 */
47
48#ifndef __LINUX_N_R3964_H__
49#define __LINUX_N_R3964_H__
50
51/* line disciplines for r3964 protocol */
52
53
54/*
55 * Ioctl-commands
56 */
57
58#define R3964_ENABLE_SIGNALS 0x5301
59#define R3964_SETPRIORITY 0x5302
60#define R3964_USE_BCC 0x5303
61#define R3964_READ_TELEGRAM 0x5304
62
63/* Options for R3964_SETPRIORITY */
64#define R3964_MASTER 0
65#define R3964_SLAVE 1
66
67/* Options for R3964_ENABLE_SIGNALS */
68#define R3964_SIG_ACK 0x0001
69#define R3964_SIG_DATA 0x0002
70#define R3964_SIG_ALL 0x000f
71#define R3964_SIG_NONE 0x0000
72#define R3964_USE_SIGIO 0x1000
73
74/*
75 * r3964 operation states:
76 */
77
78/* types for msg_id: */
79enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
80
81#define R3964_MAX_MSG_COUNT 32
82
83/* error codes for client messages */
84#define R3964_OK 0 /* no error. */
85#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
86#define R3964_OVERFLOW -2 /* msg queue overflow */
87
88/* the client gets this struct when calling read(fd,...): */
89struct r3964_client_message {
90 int msg_id;
91 int arg;
92 int error_code;
93};
94
95#define R3964_MTU 256
96
97
98
99#endif /* __LINUX_N_R3964_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nbd-netlink.h+1
...@@ -35,6 +35,7 @@ enum {...@@ -35,6 +35,7 @@ enum {
35 NBD_ATTR_SOCKETS,35 NBD_ATTR_SOCKETS,
36 NBD_ATTR_DEAD_CONN_TIMEOUT,36 NBD_ATTR_DEAD_CONN_TIMEOUT,
37 NBD_ATTR_DEVICE_LIST,37 NBD_ATTR_DEVICE_LIST,
38 NBD_ATTR_BACKEND_IDENTIFIER,
38 __NBD_ATTR_MAX,39 __NBD_ATTR_MAX,
39};40};
40#define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)41#define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)
lib/libc/include/any-linux-any/linux/ncsi.h+21
...@@ -23,6 +23,15 @@...@@ -23,6 +23,15 @@
23 * optionally the preferred NCSI_ATTR_CHANNEL_ID.23 * optionally the preferred NCSI_ATTR_CHANNEL_ID.
24 * @NCSI_CMD_CLEAR_INTERFACE: clear any preferred package/channel combination.24 * @NCSI_CMD_CLEAR_INTERFACE: clear any preferred package/channel combination.
25 * Requires NCSI_ATTR_IFINDEX.25 * Requires NCSI_ATTR_IFINDEX.
26 * @NCSI_CMD_SEND_CMD: send NC-SI command to network card.
27 * Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID
28 * and NCSI_ATTR_CHANNEL_ID.
29 * @NCSI_CMD_SET_PACKAGE_MASK: set a whitelist of allowed packages.
30 * Requires NCSI_ATTR_IFINDEX and NCSI_ATTR_PACKAGE_MASK.
31 * @NCSI_CMD_SET_CHANNEL_MASK: set a whitelist of allowed channels.
32 * Requires NCSI_ATTR_IFINDEX, NCSI_ATTR_PACKAGE_ID, and
33 * NCSI_ATTR_CHANNEL_MASK. If NCSI_ATTR_CHANNEL_ID is present it sets
34 * the primary channel.
26 * @NCSI_CMD_MAX: highest command number35 * @NCSI_CMD_MAX: highest command number
27 */36 */
28enum ncsi_nl_commands {37enum ncsi_nl_commands {
...@@ -30,6 +39,9 @@ enum ncsi_nl_commands {...@@ -30,6 +39,9 @@ enum ncsi_nl_commands {
30 NCSI_CMD_PKG_INFO,39 NCSI_CMD_PKG_INFO,
31 NCSI_CMD_SET_INTERFACE,40 NCSI_CMD_SET_INTERFACE,
32 NCSI_CMD_CLEAR_INTERFACE,41 NCSI_CMD_CLEAR_INTERFACE,
42 NCSI_CMD_SEND_CMD,
43 NCSI_CMD_SET_PACKAGE_MASK,
44 NCSI_CMD_SET_CHANNEL_MASK,
3345
34 __NCSI_CMD_AFTER_LAST,46 __NCSI_CMD_AFTER_LAST,
35 NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 147 NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 1
...@@ -43,6 +55,11 @@ enum ncsi_nl_commands {...@@ -43,6 +55,11 @@ enum ncsi_nl_commands {
43 * @NCSI_ATTR_PACKAGE_LIST: nested array of NCSI_PKG_ATTR attributes55 * @NCSI_ATTR_PACKAGE_LIST: nested array of NCSI_PKG_ATTR attributes
44 * @NCSI_ATTR_PACKAGE_ID: package ID56 * @NCSI_ATTR_PACKAGE_ID: package ID
45 * @NCSI_ATTR_CHANNEL_ID: channel ID57 * @NCSI_ATTR_CHANNEL_ID: channel ID
58 * @NCSI_ATTR_DATA: command payload
59 * @NCSI_ATTR_MULTI_FLAG: flag to signal that multi-mode should be enabled with
60 * NCSI_CMD_SET_PACKAGE_MASK or NCSI_CMD_SET_CHANNEL_MASK.
61 * @NCSI_ATTR_PACKAGE_MASK: 32-bit mask of allowed packages.
62 * @NCSI_ATTR_CHANNEL_MASK: 32-bit mask of allowed channels.
46 * @NCSI_ATTR_MAX: highest attribute number63 * @NCSI_ATTR_MAX: highest attribute number
47 */64 */
48enum ncsi_nl_attrs {65enum ncsi_nl_attrs {
...@@ -51,6 +68,10 @@ enum ncsi_nl_attrs {...@@ -51,6 +68,10 @@ enum ncsi_nl_attrs {
51 NCSI_ATTR_PACKAGE_LIST,68 NCSI_ATTR_PACKAGE_LIST,
52 NCSI_ATTR_PACKAGE_ID,69 NCSI_ATTR_PACKAGE_ID,
53 NCSI_ATTR_CHANNEL_ID,70 NCSI_ATTR_CHANNEL_ID,
71 NCSI_ATTR_DATA,
72 NCSI_ATTR_MULTI_FLAG,
73 NCSI_ATTR_PACKAGE_MASK,
74 NCSI_ATTR_CHANNEL_MASK,
5475
55 __NCSI_ATTR_AFTER_LAST,76 __NCSI_ATTR_AFTER_LAST,
56 NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 177 NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 1
lib/libc/include/any-linux-any/linux/ndctl.h+7-4
...@@ -202,10 +202,6 @@ enum nd_driver_flags {...@@ -202,10 +202,6 @@ enum nd_driver_flags {
202 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,202 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
203};203};
204204
205enum {
206 ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
207};
208
209enum ars_masks {205enum ars_masks {
210 ARS_STATUS_MASK = 0x0000FFFF,206 ARS_STATUS_MASK = 0x0000FFFF,
211 ARS_EXT_STATUS_SHIFT = 16,207 ARS_EXT_STATUS_SHIFT = 16,
...@@ -247,6 +243,13 @@ struct nd_cmd_pkg {...@@ -247,6 +243,13 @@ struct nd_cmd_pkg {
247#define NVDIMM_FAMILY_HPE1 1243#define NVDIMM_FAMILY_HPE1 1
248#define NVDIMM_FAMILY_HPE2 2244#define NVDIMM_FAMILY_HPE2 2
249#define NVDIMM_FAMILY_MSFT 3245#define NVDIMM_FAMILY_MSFT 3
246#define NVDIMM_FAMILY_HYPERV 4
247#define NVDIMM_FAMILY_PAPR 5
248#define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_PAPR
249
250#define NVDIMM_BUS_FAMILY_NFIT 0
251#define NVDIMM_BUS_FAMILY_INTEL 1
252#define NVDIMM_BUS_FAMILY_MAX NVDIMM_BUS_FAMILY_INTEL
250253
251#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\254#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
252 struct nd_cmd_pkg)255 struct nd_cmd_pkg)
lib/libc/include/any-linux-any/linux/neighbour.h+53-10
...@@ -28,6 +28,10 @@ enum {...@@ -28,6 +28,10 @@ enum {
28 NDA_MASTER,28 NDA_MASTER,
29 NDA_LINK_NETNSID,29 NDA_LINK_NETNSID,
30 NDA_SRC_VNI,30 NDA_SRC_VNI,
31 NDA_PROTOCOL, /* Originator of entry */
32 NDA_NH_ID,
33 NDA_FDB_EXT_ATTRS,
34 NDA_FLAGS_EXT,
31 __NDA_MAX35 __NDA_MAX
32};36};
3337
...@@ -37,13 +41,16 @@ enum {...@@ -37,13 +41,16 @@ enum {
37 * Neighbor Cache Entry Flags41 * Neighbor Cache Entry Flags
38 */42 */
3943
40#define NTF_USE 0x0144#define NTF_USE (1 << 0)
41#define NTF_SELF 0x0245#define NTF_SELF (1 << 1)
42#define NTF_MASTER 0x0446#define NTF_MASTER (1 << 2)
43#define NTF_PROXY 0x08 /* == ATF_PUBL */47#define NTF_PROXY (1 << 3) /* == ATF_PUBL */
44#define NTF_EXT_LEARNED 0x1048#define NTF_EXT_LEARNED (1 << 4)
45#define NTF_OFFLOADED 0x2049#define NTF_OFFLOADED (1 << 5)
46#define NTF_ROUTER 0x8050#define NTF_STICKY (1 << 6)
51#define NTF_ROUTER (1 << 7)
52/* Extended flags under NDA_FLAGS_EXT: */
53#define NTF_EXT_MANAGED (1 << 0)
4754
48/*55/*
49 * Neighbor Cache Entry States.56 * Neighbor Cache Entry States.
...@@ -61,9 +68,22 @@ enum {...@@ -61,9 +68,22 @@ enum {
61#define NUD_PERMANENT 0x8068#define NUD_PERMANENT 0x80
62#define NUD_NONE 0x0069#define NUD_NONE 0x00
6370
64/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change71/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change and make no
65 and make no address resolution or NUD.72 * address resolution or NUD.
66 NUD_PERMANENT also cannot be deleted by garbage collectors.73 *
74 * NUD_PERMANENT also cannot be deleted by garbage collectors. This holds true
75 * for dynamic entries with NTF_EXT_LEARNED flag as well. However, upon carrier
76 * down event, NUD_PERMANENT entries are not flushed whereas NTF_EXT_LEARNED
77 * flagged entries explicitly are (which is also consistent with the routing
78 * subsystem).
79 *
80 * When NTF_EXT_LEARNED is set for a bridge fdb entry the different cache entry
81 * states don't make sense and thus are ignored. Such entries don't age and
82 * can roam.
83 *
84 * NTF_EXT_MANAGED flagged neigbor entries are managed by the kernel on behalf
85 * of a user space control plane, and automatically refreshed so that (if
86 * possible) they remain in NUD_REACHABLE state.
67 */87 */
6888
69struct nda_cacheinfo {89struct nda_cacheinfo {
...@@ -169,4 +189,27 @@ enum {...@@ -169,4 +189,27 @@ enum {
169};189};
170#define NDTA_MAX (__NDTA_MAX - 1)190#define NDTA_MAX (__NDTA_MAX - 1)
171191
192 /* FDB activity notification bits used in NFEA_ACTIVITY_NOTIFY:
193 * - FDB_NOTIFY_BIT - notify on activity/expire for any entry
194 * - FDB_NOTIFY_INACTIVE_BIT - mark as inactive to avoid multiple notifications
195 */
196enum {
197 FDB_NOTIFY_BIT = (1 << 0),
198 FDB_NOTIFY_INACTIVE_BIT = (1 << 1)
199};
200
201/* embedded into NDA_FDB_EXT_ATTRS:
202 * [NDA_FDB_EXT_ATTRS] = {
203 * [NFEA_ACTIVITY_NOTIFY]
204 * ...
205 * }
206 */
207enum {
208 NFEA_UNSPEC,
209 NFEA_ACTIVITY_NOTIFY,
210 NFEA_DONT_REFRESH,
211 __NFEA_MAX
212};
213#define NFEA_MAX (__NFEA_MAX - 1)
214
172#endif215#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/net_dropmon.h+67
...@@ -53,6 +53,11 @@ enum {...@@ -53,6 +53,11 @@ enum {
53 NET_DM_CMD_CONFIG,53 NET_DM_CMD_CONFIG,
54 NET_DM_CMD_START,54 NET_DM_CMD_START,
55 NET_DM_CMD_STOP,55 NET_DM_CMD_STOP,
56 NET_DM_CMD_PACKET_ALERT,
57 NET_DM_CMD_CONFIG_GET,
58 NET_DM_CMD_CONFIG_NEW,
59 NET_DM_CMD_STATS_GET,
60 NET_DM_CMD_STATS_NEW,
56 _NET_DM_CMD_MAX,61 _NET_DM_CMD_MAX,
57};62};
5863
...@@ -62,4 +67,66 @@ enum {...@@ -62,4 +67,66 @@ enum {
62 * Our group identifiers67 * Our group identifiers
63 */68 */
64#define NET_DM_GRP_ALERT 169#define NET_DM_GRP_ALERT 1
70
71enum net_dm_attr {
72 NET_DM_ATTR_UNSPEC,
73
74 NET_DM_ATTR_ALERT_MODE, /* u8 */
75 NET_DM_ATTR_PC, /* u64 */
76 NET_DM_ATTR_SYMBOL, /* string */
77 NET_DM_ATTR_IN_PORT, /* nested */
78 NET_DM_ATTR_TIMESTAMP, /* u64 */
79 NET_DM_ATTR_PROTO, /* u16 */
80 NET_DM_ATTR_PAYLOAD, /* binary */
81 NET_DM_ATTR_PAD,
82 NET_DM_ATTR_TRUNC_LEN, /* u32 */
83 NET_DM_ATTR_ORIG_LEN, /* u32 */
84 NET_DM_ATTR_QUEUE_LEN, /* u32 */
85 NET_DM_ATTR_STATS, /* nested */
86 NET_DM_ATTR_HW_STATS, /* nested */
87 NET_DM_ATTR_ORIGIN, /* u16 */
88 NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
89 NET_DM_ATTR_HW_TRAP_NAME, /* string */
90 NET_DM_ATTR_HW_ENTRIES, /* nested */
91 NET_DM_ATTR_HW_ENTRY, /* nested */
92 NET_DM_ATTR_HW_TRAP_COUNT, /* u32 */
93 NET_DM_ATTR_SW_DROPS, /* flag */
94 NET_DM_ATTR_HW_DROPS, /* flag */
95 NET_DM_ATTR_FLOW_ACTION_COOKIE, /* binary */
96
97 __NET_DM_ATTR_MAX,
98 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
99};
100
101/**
102 * enum net_dm_alert_mode - Alert mode.
103 * @NET_DM_ALERT_MODE_SUMMARY: A summary of recent drops is sent to user space.
104 * @NET_DM_ALERT_MODE_PACKET: Each dropped packet is sent to user space along
105 * with metadata.
106 */
107enum net_dm_alert_mode {
108 NET_DM_ALERT_MODE_SUMMARY,
109 NET_DM_ALERT_MODE_PACKET,
110};
111
112enum {
113 NET_DM_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
114 NET_DM_ATTR_PORT_NETDEV_NAME, /* string */
115
116 __NET_DM_ATTR_PORT_MAX,
117 NET_DM_ATTR_PORT_MAX = __NET_DM_ATTR_PORT_MAX - 1
118};
119
120enum {
121 NET_DM_ATTR_STATS_DROPPED, /* u64 */
122
123 __NET_DM_ATTR_STATS_MAX,
124 NET_DM_ATTR_STATS_MAX = __NET_DM_ATTR_STATS_MAX - 1
125};
126
127enum net_dm_origin {
128 NET_DM_ORIGIN_SW,
129 NET_DM_ORIGIN_HW,
130};
131
65#endif132#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/net_namespace.h+2
...@@ -16,6 +16,8 @@ enum {...@@ -16,6 +16,8 @@ enum {
16 NETNSA_NSID,16 NETNSA_NSID,
17 NETNSA_PID,17 NETNSA_PID,
18 NETNSA_FD,18 NETNSA_FD,
19 NETNSA_TARGET_NSID,
20 NETNSA_CURRENT_NSID,
19 __NETNSA_MAX,21 __NETNSA_MAX,
20};22};
2123
lib/libc/include/any-linux-any/linux/net_tstamp.h+29-2
...@@ -13,7 +13,7 @@...@@ -13,7 +13,7 @@
13#include <linux/types.h>13#include <linux/types.h>
14#include <linux/socket.h> /* for SO_TIMESTAMPING */14#include <linux/socket.h> /* for SO_TIMESTAMPING */
1515
16/* SO_TIMESTAMPING gets an integer bit field comprised of these values */16/* SO_TIMESTAMPING flags */
17enum {17enum {
18 SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),18 SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),
19 SOF_TIMESTAMPING_TX_SOFTWARE = (1<<1),19 SOF_TIMESTAMPING_TX_SOFTWARE = (1<<1),
...@@ -30,8 +30,9 @@ enum {...@@ -30,8 +30,9 @@ enum {
30 SOF_TIMESTAMPING_OPT_STATS = (1<<12),30 SOF_TIMESTAMPING_OPT_STATS = (1<<12),
31 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),31 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),
32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
33 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),
3334
34 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TX_SWHW,35 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_BIND_PHC,
35 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |36 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
36 SOF_TIMESTAMPING_LAST37 SOF_TIMESTAMPING_LAST
37};38};
...@@ -46,6 +47,18 @@ enum {...@@ -46,6 +47,18 @@ enum {
46 SOF_TIMESTAMPING_TX_SCHED | \47 SOF_TIMESTAMPING_TX_SCHED | \
47 SOF_TIMESTAMPING_TX_ACK)48 SOF_TIMESTAMPING_TX_ACK)
4849
50/**
51 * struct so_timestamping - SO_TIMESTAMPING parameter
52 *
53 * @flags: SO_TIMESTAMPING flags
54 * @bind_phc: Index of PTP virtual clock bound to sock. This is available
55 * if flag SOF_TIMESTAMPING_BIND_PHC is set.
56 */
57struct so_timestamping {
58 int flags;
59 int bind_phc;
60};
61
49/**62/**
50 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter63 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
51 *64 *
...@@ -90,6 +103,17 @@ enum hwtstamp_tx_types {...@@ -90,6 +103,17 @@ enum hwtstamp_tx_types {
90 * queue.103 * queue.
91 */104 */
92 HWTSTAMP_TX_ONESTEP_SYNC,105 HWTSTAMP_TX_ONESTEP_SYNC,
106
107 /*
108 * Same as HWTSTAMP_TX_ONESTEP_SYNC, but also enables time
109 * stamp insertion directly into PDelay_Resp packets. In this
110 * case, neither transmitted Sync nor PDelay_Resp packets will
111 * receive a time stamp via the socket error queue.
112 */
113 HWTSTAMP_TX_ONESTEP_P2P,
114
115 /* add new constants above here */
116 __HWTSTAMP_TX_CNT
93};117};
94118
95/* possible values for hwtstamp_config->rx_filter */119/* possible values for hwtstamp_config->rx_filter */
...@@ -132,6 +156,9 @@ enum hwtstamp_rx_filters {...@@ -132,6 +156,9 @@ enum hwtstamp_rx_filters {
132156
133 /* NTP, UDP, all versions and packet modes */157 /* NTP, UDP, all versions and packet modes */
134 HWTSTAMP_FILTER_NTP_ALL,158 HWTSTAMP_FILTER_NTP_ALL,
159
160 /* add new constants above here */
161 __HWTSTAMP_FILTER_CNT
135};162};
136163
137/* SCM_TIMESTAMPING_PKTINFO control message */164/* SCM_TIMESTAMPING_PKTINFO control message */
lib/libc/include/any-linux-any/linux/netfilter.h+3-5
...@@ -33,10 +33,6 @@...@@ -33,10 +33,6 @@
33#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)33#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
3434
35/* only for userspace compatibility */35/* only for userspace compatibility */
36/* Generic cache responses from hook functions.
37 <= 0x2000 is used for protocol-flags. */
38#define NFC_UNKNOWN 0x4000
39#define NFC_ALTERED 0x8000
4036
41/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */37/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
42#define NF_VERDICT_BITS 1638#define NF_VERDICT_BITS 16
...@@ -47,11 +43,13 @@ enum nf_inet_hooks {...@@ -47,11 +43,13 @@ enum nf_inet_hooks {
47 NF_INET_FORWARD,43 NF_INET_FORWARD,
48 NF_INET_LOCAL_OUT,44 NF_INET_LOCAL_OUT,
49 NF_INET_POST_ROUTING,45 NF_INET_POST_ROUTING,
50 NF_INET_NUMHOOKS46 NF_INET_NUMHOOKS,
47 NF_INET_INGRESS = NF_INET_NUMHOOKS,
51};48};
5249
53enum nf_dev_hooks {50enum nf_dev_hooks {
54 NF_NETDEV_INGRESS,51 NF_NETDEV_INGRESS,
52 NF_NETDEV_EGRESS,
55 NF_NETDEV_NUMHOOKS53 NF_NETDEV_NUMHOOKS
56};54};
5755
lib/libc/include/any-linux-any/linux/netfilter/ipset/ip_set.h+19-10
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>2/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
3 * Patrick Schaaf <bof@bof.de>3 * Patrick Schaaf <bof@bof.de>
4 * Martin Josefsson <gandalf@wlug.westbo.se>4 * Martin Josefsson <gandalf@wlug.westbo.se>
5 * Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>5 * Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@netfilter.org>
6 *6 *
7 * This program is free software; you can redistribute it and/or modify7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as8 * it under the terms of the GNU General Public License version 2 as
...@@ -13,8 +13,9 @@...@@ -13,8 +13,9 @@
1313
14#include <linux/types.h>14#include <linux/types.h>
1515
16/* The protocol version */16/* The protocol versions */
17#define IPSET_PROTOCOL 617#define IPSET_PROTOCOL 7
18#define IPSET_PROTOCOL_MIN 6
1819
19/* The max length of strings including NUL: set and type identifiers */20/* The max length of strings including NUL: set and type identifiers */
20#define IPSET_MAXNAMELEN 3221#define IPSET_MAXNAMELEN 32
...@@ -38,17 +39,19 @@ enum ipset_cmd {...@@ -38,17 +39,19 @@ enum ipset_cmd {
38 IPSET_CMD_TEST, /* 11: Test an element in a set */39 IPSET_CMD_TEST, /* 11: Test an element in a set */
39 IPSET_CMD_HEADER, /* 12: Get set header data only */40 IPSET_CMD_HEADER, /* 12: Get set header data only */
40 IPSET_CMD_TYPE, /* 13: Get set type */41 IPSET_CMD_TYPE, /* 13: Get set type */
42 IPSET_CMD_GET_BYNAME, /* 14: Get set index by name */
43 IPSET_CMD_GET_BYINDEX, /* 15: Get set name by index */
41 IPSET_MSG_MAX, /* Netlink message commands */44 IPSET_MSG_MAX, /* Netlink message commands */
4245
43 /* Commands in userspace: */46 /* Commands in userspace: */
44 IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */47 IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 16: Enter restore mode */
45 IPSET_CMD_HELP, /* 15: Get help */48 IPSET_CMD_HELP, /* 17: Get help */
46 IPSET_CMD_VERSION, /* 16: Get program version */49 IPSET_CMD_VERSION, /* 18: Get program version */
47 IPSET_CMD_QUIT, /* 17: Quit from interactive mode */50 IPSET_CMD_QUIT, /* 19: Quit from interactive mode */
4851
49 IPSET_CMD_MAX,52 IPSET_CMD_MAX,
5053
51 IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */54 IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 20: Commit buffered commands */
52};55};
5356
54/* Attributes at command level */57/* Attributes at command level */
...@@ -66,6 +69,7 @@ enum {...@@ -66,6 +69,7 @@ enum {
66 IPSET_ATTR_LINENO, /* 9: Restore lineno */69 IPSET_ATTR_LINENO, /* 9: Restore lineno */
67 IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */70 IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
68 IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */71 IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
72 IPSET_ATTR_INDEX, /* 11: Kernel index of set */
69 __IPSET_ATTR_CMD_MAX,73 __IPSET_ATTR_CMD_MAX,
70};74};
71#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)75#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
...@@ -88,11 +92,11 @@ enum {...@@ -88,11 +92,11 @@ enum {
88 /* Reserve empty slots */92 /* Reserve empty slots */
89 IPSET_ATTR_CADT_MAX = 16,93 IPSET_ATTR_CADT_MAX = 16,
90 /* Create-only specific attributes */94 /* Create-only specific attributes */
91 IPSET_ATTR_GC,95 IPSET_ATTR_INITVAL, /* was unused IPSET_ATTR_GC */
92 IPSET_ATTR_HASHSIZE,96 IPSET_ATTR_HASHSIZE,
93 IPSET_ATTR_MAXELEM,97 IPSET_ATTR_MAXELEM,
94 IPSET_ATTR_NETMASK,98 IPSET_ATTR_NETMASK,
95 IPSET_ATTR_PROBES,99 IPSET_ATTR_BUCKETSIZE, /* was unused IPSET_ATTR_PROBES */
96 IPSET_ATTR_RESIZE,100 IPSET_ATTR_RESIZE,
97 IPSET_ATTR_SIZE,101 IPSET_ATTR_SIZE,
98 /* Kernel-only */102 /* Kernel-only */
...@@ -201,6 +205,8 @@ enum ipset_cadt_flags {...@@ -201,6 +205,8 @@ enum ipset_cadt_flags {
201 IPSET_FLAG_WITH_FORCEADD = (1 << IPSET_FLAG_BIT_WITH_FORCEADD),205 IPSET_FLAG_WITH_FORCEADD = (1 << IPSET_FLAG_BIT_WITH_FORCEADD),
202 IPSET_FLAG_BIT_WITH_SKBINFO = 6,206 IPSET_FLAG_BIT_WITH_SKBINFO = 6,
203 IPSET_FLAG_WITH_SKBINFO = (1 << IPSET_FLAG_BIT_WITH_SKBINFO),207 IPSET_FLAG_WITH_SKBINFO = (1 << IPSET_FLAG_BIT_WITH_SKBINFO),
208 IPSET_FLAG_BIT_IFACE_WILDCARD = 7,
209 IPSET_FLAG_IFACE_WILDCARD = (1 << IPSET_FLAG_BIT_IFACE_WILDCARD),
204 IPSET_FLAG_CADT_MAX = 15,210 IPSET_FLAG_CADT_MAX = 15,
205};211};
206212
...@@ -208,6 +214,8 @@ enum ipset_cadt_flags {...@@ -208,6 +214,8 @@ enum ipset_cadt_flags {
208enum ipset_create_flags {214enum ipset_create_flags {
209 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,215 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,
210 IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),216 IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),
217 IPSET_CREATE_FLAG_BIT_BUCKETSIZE = 1,
218 IPSET_CREATE_FLAG_BUCKETSIZE = (1 << IPSET_CREATE_FLAG_BIT_BUCKETSIZE),
211 IPSET_CREATE_FLAG_BIT_MAX = 7,219 IPSET_CREATE_FLAG_BIT_MAX = 7,
212};220};
213221
...@@ -223,6 +231,7 @@ enum ipset_adt {...@@ -223,6 +231,7 @@ enum ipset_adt {
223231
224/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t232/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
225 * and IPSET_INVALID_ID if you want to increase the max number of sets.233 * and IPSET_INVALID_ID if you want to increase the max number of sets.
234 * Also, IPSET_ATTR_INDEX must be changed.
226 */235 */
227typedef __u16 ip_set_id_t;236typedef __u16 ip_set_id_t;
228237
lib/libc/include/any-linux-any/linux/netfilter/nf_conntrack_common.h+8-2
...@@ -93,6 +93,7 @@ enum ip_conntrack_status {...@@ -93,6 +93,7 @@ enum ip_conntrack_status {
93 IPS_UNTRACKED_BIT = 12,93 IPS_UNTRACKED_BIT = 12,
94 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),94 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
9595
96
96 /* Conntrack got a helper explicitly attached via CT target. */97 /* Conntrack got a helper explicitly attached via CT target. */
97 IPS_HELPER_BIT = 13,98 IPS_HELPER_BIT = 13,
98 IPS_HELPER = (1 << IPS_HELPER_BIT),99 IPS_HELPER = (1 << IPS_HELPER_BIT),
...@@ -101,14 +102,19 @@ enum ip_conntrack_status {...@@ -101,14 +102,19 @@ enum ip_conntrack_status {
101 IPS_OFFLOAD_BIT = 14,102 IPS_OFFLOAD_BIT = 14,
102 IPS_OFFLOAD = (1 << IPS_OFFLOAD_BIT),103 IPS_OFFLOAD = (1 << IPS_OFFLOAD_BIT),
103104
105 /* Conntrack has been offloaded to hardware. */
106 IPS_HW_OFFLOAD_BIT = 15,
107 IPS_HW_OFFLOAD = (1 << IPS_HW_OFFLOAD_BIT),
108
104 /* Be careful here, modifying these bits can make things messy,109 /* Be careful here, modifying these bits can make things messy,
105 * so don't let users modify them directly.110 * so don't let users modify them directly.
106 */111 */
107 IPS_UNCHANGEABLE_MASK = (IPS_NAT_DONE_MASK | IPS_NAT_MASK |112 IPS_UNCHANGEABLE_MASK = (IPS_NAT_DONE_MASK | IPS_NAT_MASK |
108 IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING |113 IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING |
109 IPS_SEQ_ADJUST | IPS_TEMPLATE | IPS_OFFLOAD),114 IPS_SEQ_ADJUST | IPS_TEMPLATE | IPS_UNTRACKED |
115 IPS_OFFLOAD | IPS_HW_OFFLOAD),
110116
111 __IPS_MAX_BIT = 15,117 __IPS_MAX_BIT = 16,
112};118};
113119
114/* Connection tracking event types */120/* Connection tracking event types */
lib/libc/include/any-linux-any/linux/netfilter/nf_nat.h+3-1
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#define NF_NAT_RANGE_PERSISTENT (1 << 3)11#define NF_NAT_RANGE_PERSISTENT (1 << 3)
12#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)12#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
13#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5)13#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5)
14#define NF_NAT_RANGE_NETMAP (1 << 6)
1415
15#define NF_NAT_RANGE_PROTO_RANDOM_ALL \16#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
16 (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)17 (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
...@@ -18,7 +19,8 @@...@@ -18,7 +19,8 @@
18#define NF_NAT_RANGE_MASK \19#define NF_NAT_RANGE_MASK \
19 (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \20 (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \
20 NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \21 NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \
21 NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET)22 NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \
23 NF_NAT_RANGE_NETMAP)
2224
23struct nf_nat_ipv4_range {25struct nf_nat_ipv4_range {
24 unsigned int flags;26 unsigned int flags;
lib/libc/include/any-linux-any/linux/netfilter/nf_synproxy.h created+23
...@@ -0,0 +1,23 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _NF_SYNPROXY_H
3#define _NF_SYNPROXY_H
4
5#include <linux/types.h>
6
7#define NF_SYNPROXY_OPT_MSS 0x01
8#define NF_SYNPROXY_OPT_WSCALE 0x02
9#define NF_SYNPROXY_OPT_SACK_PERM 0x04
10#define NF_SYNPROXY_OPT_TIMESTAMP 0x08
11#define NF_SYNPROXY_OPT_ECN 0x10
12#define NF_SYNPROXY_OPT_MASK (NF_SYNPROXY_OPT_MSS | \
13 NF_SYNPROXY_OPT_WSCALE | \
14 NF_SYNPROXY_OPT_SACK_PERM | \
15 NF_SYNPROXY_OPT_TIMESTAMP)
16
17struct nf_synproxy_info {
18 __u8 options;
19 __u8 wscale;
20 __u16 mss;
21};
22
23#endif /* _NF_SYNPROXY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+267-11
...@@ -48,6 +48,7 @@ enum nft_registers {...@@ -48,6 +48,7 @@ enum nft_registers {
4848
49#define NFT_REG_SIZE 1649#define NFT_REG_SIZE 16
50#define NFT_REG32_SIZE 450#define NFT_REG32_SIZE 4
51#define NFT_REG32_COUNT (NFT_REG32_15 - NFT_REG32_00 + 1)
5152
52/**53/**
53 * enum nft_verdicts - nf_tables internal verdicts54 * enum nft_verdicts - nf_tables internal verdicts
...@@ -132,7 +133,7 @@ enum nf_tables_msg_types {...@@ -132,7 +133,7 @@ enum nf_tables_msg_types {
132 * @NFTA_LIST_ELEM: list element (NLA_NESTED)133 * @NFTA_LIST_ELEM: list element (NLA_NESTED)
133 */134 */
134enum nft_list_attributes {135enum nft_list_attributes {
135 NFTA_LIST_UNPEC,136 NFTA_LIST_UNSPEC,
136 NFTA_LIST_ELEM,137 NFTA_LIST_ELEM,
137 __NFTA_LIST_MAX138 __NFTA_LIST_MAX
138};139};
...@@ -144,12 +145,14 @@ enum nft_list_attributes {...@@ -144,12 +145,14 @@ enum nft_list_attributes {
144 * @NFTA_HOOK_HOOKNUM: netfilter hook number (NLA_U32)145 * @NFTA_HOOK_HOOKNUM: netfilter hook number (NLA_U32)
145 * @NFTA_HOOK_PRIORITY: netfilter hook priority (NLA_U32)146 * @NFTA_HOOK_PRIORITY: netfilter hook priority (NLA_U32)
146 * @NFTA_HOOK_DEV: netdevice name (NLA_STRING)147 * @NFTA_HOOK_DEV: netdevice name (NLA_STRING)
148 * @NFTA_HOOK_DEVS: list of netdevices (NLA_NESTED)
147 */149 */
148enum nft_hook_attributes {150enum nft_hook_attributes {
149 NFTA_HOOK_UNSPEC,151 NFTA_HOOK_UNSPEC,
150 NFTA_HOOK_HOOKNUM,152 NFTA_HOOK_HOOKNUM,
151 NFTA_HOOK_PRIORITY,153 NFTA_HOOK_PRIORITY,
152 NFTA_HOOK_DEV,154 NFTA_HOOK_DEV,
155 NFTA_HOOK_DEVS,
153 __NFTA_HOOK_MAX156 __NFTA_HOOK_MAX
154};157};
155#define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1)158#define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1)
...@@ -161,7 +164,10 @@ enum nft_hook_attributes {...@@ -161,7 +164,10 @@ enum nft_hook_attributes {
161 */164 */
162enum nft_table_flags {165enum nft_table_flags {
163 NFT_TABLE_F_DORMANT = 0x1,166 NFT_TABLE_F_DORMANT = 0x1,
167 NFT_TABLE_F_OWNER = 0x2,
164};168};
169#define NFT_TABLE_F_MASK (NFT_TABLE_F_DORMANT | \
170 NFT_TABLE_F_OWNER)
165171
166/**172/**
167 * enum nft_table_attributes - nf_tables table netlink attributes173 * enum nft_table_attributes - nf_tables table netlink attributes
...@@ -169,6 +175,8 @@ enum nft_table_flags {...@@ -169,6 +175,8 @@ enum nft_table_flags {
169 * @NFTA_TABLE_NAME: name of the table (NLA_STRING)175 * @NFTA_TABLE_NAME: name of the table (NLA_STRING)
170 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32)176 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32)
171 * @NFTA_TABLE_USE: number of chains in this table (NLA_U32)177 * @NFTA_TABLE_USE: number of chains in this table (NLA_U32)
178 * @NFTA_TABLE_USERDATA: user data (NLA_BINARY)
179 * @NFTA_TABLE_OWNER: owner of this table through netlink portID (NLA_U32)
172 */180 */
173enum nft_table_attributes {181enum nft_table_attributes {
174 NFTA_TABLE_UNSPEC,182 NFTA_TABLE_UNSPEC,
...@@ -177,10 +185,21 @@ enum nft_table_attributes {...@@ -177,10 +185,21 @@ enum nft_table_attributes {
177 NFTA_TABLE_USE,185 NFTA_TABLE_USE,
178 NFTA_TABLE_HANDLE,186 NFTA_TABLE_HANDLE,
179 NFTA_TABLE_PAD,187 NFTA_TABLE_PAD,
188 NFTA_TABLE_USERDATA,
189 NFTA_TABLE_OWNER,
180 __NFTA_TABLE_MAX190 __NFTA_TABLE_MAX
181};191};
182#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)192#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
183193
194enum nft_chain_flags {
195 NFT_CHAIN_BASE = (1 << 0),
196 NFT_CHAIN_HW_OFFLOAD = (1 << 1),
197 NFT_CHAIN_BINDING = (1 << 2),
198};
199#define NFT_CHAIN_FLAGS (NFT_CHAIN_BASE | \
200 NFT_CHAIN_HW_OFFLOAD | \
201 NFT_CHAIN_BINDING)
202
184/**203/**
185 * enum nft_chain_attributes - nf_tables chain netlink attributes204 * enum nft_chain_attributes - nf_tables chain netlink attributes
186 *205 *
...@@ -192,6 +211,9 @@ enum nft_table_attributes {...@@ -192,6 +211,9 @@ enum nft_table_attributes {
192 * @NFTA_CHAIN_USE: number of references to this chain (NLA_U32)211 * @NFTA_CHAIN_USE: number of references to this chain (NLA_U32)
193 * @NFTA_CHAIN_TYPE: type name of the string (NLA_NUL_STRING)212 * @NFTA_CHAIN_TYPE: type name of the string (NLA_NUL_STRING)
194 * @NFTA_CHAIN_COUNTERS: counter specification of the chain (NLA_NESTED: nft_counter_attributes)213 * @NFTA_CHAIN_COUNTERS: counter specification of the chain (NLA_NESTED: nft_counter_attributes)
214 * @NFTA_CHAIN_FLAGS: chain flags
215 * @NFTA_CHAIN_ID: uniquely identifies a chain in a transaction (NLA_U32)
216 * @NFTA_CHAIN_USERDATA: user data (NLA_BINARY)
195 */217 */
196enum nft_chain_attributes {218enum nft_chain_attributes {
197 NFTA_CHAIN_UNSPEC,219 NFTA_CHAIN_UNSPEC,
...@@ -204,6 +226,9 @@ enum nft_chain_attributes {...@@ -204,6 +226,9 @@ enum nft_chain_attributes {
204 NFTA_CHAIN_TYPE,226 NFTA_CHAIN_TYPE,
205 NFTA_CHAIN_COUNTERS,227 NFTA_CHAIN_COUNTERS,
206 NFTA_CHAIN_PAD,228 NFTA_CHAIN_PAD,
229 NFTA_CHAIN_FLAGS,
230 NFTA_CHAIN_ID,
231 NFTA_CHAIN_USERDATA,
207 __NFTA_CHAIN_MAX232 __NFTA_CHAIN_MAX
208};233};
209#define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1)234#define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1)
...@@ -219,6 +244,7 @@ enum nft_chain_attributes {...@@ -219,6 +244,7 @@ enum nft_chain_attributes {
219 * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64)244 * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64)
220 * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN)245 * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN)
221 * @NFTA_RULE_ID: uniquely identifies a rule in a transaction (NLA_U32)246 * @NFTA_RULE_ID: uniquely identifies a rule in a transaction (NLA_U32)
247 * @NFTA_RULE_POSITION_ID: transaction unique identifier of the previous rule (NLA_U32)
222 */248 */
223enum nft_rule_attributes {249enum nft_rule_attributes {
224 NFTA_RULE_UNSPEC,250 NFTA_RULE_UNSPEC,
...@@ -231,6 +257,8 @@ enum nft_rule_attributes {...@@ -231,6 +257,8 @@ enum nft_rule_attributes {
231 NFTA_RULE_USERDATA,257 NFTA_RULE_USERDATA,
232 NFTA_RULE_PAD,258 NFTA_RULE_PAD,
233 NFTA_RULE_ID,259 NFTA_RULE_ID,
260 NFTA_RULE_POSITION_ID,
261 NFTA_RULE_CHAIN_ID,
234 __NFTA_RULE_MAX262 __NFTA_RULE_MAX
235};263};
236#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)264#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)
...@@ -269,6 +297,8 @@ enum nft_rule_compat_attributes {...@@ -269,6 +297,8 @@ enum nft_rule_compat_attributes {
269 * @NFT_SET_TIMEOUT: set uses timeouts297 * @NFT_SET_TIMEOUT: set uses timeouts
270 * @NFT_SET_EVAL: set can be updated from the evaluation path298 * @NFT_SET_EVAL: set can be updated from the evaluation path
271 * @NFT_SET_OBJECT: set contains stateful objects299 * @NFT_SET_OBJECT: set contains stateful objects
300 * @NFT_SET_CONCAT: set contains a concatenation
301 * @NFT_SET_EXPR: set contains expressions
272 */302 */
273enum nft_set_flags {303enum nft_set_flags {
274 NFT_SET_ANONYMOUS = 0x1,304 NFT_SET_ANONYMOUS = 0x1,
...@@ -278,6 +308,8 @@ enum nft_set_flags {...@@ -278,6 +308,8 @@ enum nft_set_flags {
278 NFT_SET_TIMEOUT = 0x10,308 NFT_SET_TIMEOUT = 0x10,
279 NFT_SET_EVAL = 0x20,309 NFT_SET_EVAL = 0x20,
280 NFT_SET_OBJECT = 0x40,310 NFT_SET_OBJECT = 0x40,
311 NFT_SET_CONCAT = 0x80,
312 NFT_SET_EXPR = 0x100,
281};313};
282314
283/**315/**
...@@ -295,14 +327,28 @@ enum nft_set_policies {...@@ -295,14 +327,28 @@ enum nft_set_policies {
295 * enum nft_set_desc_attributes - set element description327 * enum nft_set_desc_attributes - set element description
296 *328 *
297 * @NFTA_SET_DESC_SIZE: number of elements in set (NLA_U32)329 * @NFTA_SET_DESC_SIZE: number of elements in set (NLA_U32)
330 * @NFTA_SET_DESC_CONCAT: description of field concatenation (NLA_NESTED)
298 */331 */
299enum nft_set_desc_attributes {332enum nft_set_desc_attributes {
300 NFTA_SET_DESC_UNSPEC,333 NFTA_SET_DESC_UNSPEC,
301 NFTA_SET_DESC_SIZE,334 NFTA_SET_DESC_SIZE,
335 NFTA_SET_DESC_CONCAT,
302 __NFTA_SET_DESC_MAX336 __NFTA_SET_DESC_MAX
303};337};
304#define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1)338#define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1)
305339
340/**
341 * enum nft_set_field_attributes - attributes of concatenated fields
342 *
343 * @NFTA_SET_FIELD_LEN: length of single field, in bits (NLA_U32)
344 */
345enum nft_set_field_attributes {
346 NFTA_SET_FIELD_UNSPEC,
347 NFTA_SET_FIELD_LEN,
348 __NFTA_SET_FIELD_MAX
349};
350#define NFTA_SET_FIELD_MAX (__NFTA_SET_FIELD_MAX - 1)
351
306/**352/**
307 * enum nft_set_attributes - nf_tables set netlink attributes353 * enum nft_set_attributes - nf_tables set netlink attributes
308 *354 *
...@@ -321,6 +367,8 @@ enum nft_set_desc_attributes {...@@ -321,6 +367,8 @@ enum nft_set_desc_attributes {
321 * @NFTA_SET_USERDATA: user data (NLA_BINARY)367 * @NFTA_SET_USERDATA: user data (NLA_BINARY)
322 * @NFTA_SET_OBJ_TYPE: stateful object type (NLA_U32: NFT_OBJECT_*)368 * @NFTA_SET_OBJ_TYPE: stateful object type (NLA_U32: NFT_OBJECT_*)
323 * @NFTA_SET_HANDLE: set handle (NLA_U64)369 * @NFTA_SET_HANDLE: set handle (NLA_U64)
370 * @NFTA_SET_EXPR: set expression (NLA_NESTED: nft_expr_attributes)
371 * @NFTA_SET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes)
324 */372 */
325enum nft_set_attributes {373enum nft_set_attributes {
326 NFTA_SET_UNSPEC,374 NFTA_SET_UNSPEC,
...@@ -340,6 +388,8 @@ enum nft_set_attributes {...@@ -340,6 +388,8 @@ enum nft_set_attributes {
340 NFTA_SET_PAD,388 NFTA_SET_PAD,
341 NFTA_SET_OBJ_TYPE,389 NFTA_SET_OBJ_TYPE,
342 NFTA_SET_HANDLE,390 NFTA_SET_HANDLE,
391 NFTA_SET_EXPR,
392 NFTA_SET_EXPRESSIONS,
343 __NFTA_SET_MAX393 __NFTA_SET_MAX
344};394};
345#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)395#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
...@@ -348,9 +398,11 @@ enum nft_set_attributes {...@@ -348,9 +398,11 @@ enum nft_set_attributes {
348 * enum nft_set_elem_flags - nf_tables set element flags398 * enum nft_set_elem_flags - nf_tables set element flags
349 *399 *
350 * @NFT_SET_ELEM_INTERVAL_END: element ends the previous interval400 * @NFT_SET_ELEM_INTERVAL_END: element ends the previous interval
401 * @NFT_SET_ELEM_CATCHALL: special catch-all element
351 */402 */
352enum nft_set_elem_flags {403enum nft_set_elem_flags {
353 NFT_SET_ELEM_INTERVAL_END = 0x1,404 NFT_SET_ELEM_INTERVAL_END = 0x1,
405 NFT_SET_ELEM_CATCHALL = 0x2,
354};406};
355407
356/**408/**
...@@ -364,6 +416,8 @@ enum nft_set_elem_flags {...@@ -364,6 +416,8 @@ enum nft_set_elem_flags {
364 * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY)416 * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY)
365 * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes)417 * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes)
366 * @NFTA_SET_ELEM_OBJREF: stateful object reference (NLA_STRING)418 * @NFTA_SET_ELEM_OBJREF: stateful object reference (NLA_STRING)
419 * @NFTA_SET_ELEM_KEY_END: closing key value (NLA_NESTED: nft_data)
420 * @NFTA_SET_ELEM_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes)
367 */421 */
368enum nft_set_elem_attributes {422enum nft_set_elem_attributes {
369 NFTA_SET_ELEM_UNSPEC,423 NFTA_SET_ELEM_UNSPEC,
...@@ -376,6 +430,8 @@ enum nft_set_elem_attributes {...@@ -376,6 +430,8 @@ enum nft_set_elem_attributes {
376 NFTA_SET_ELEM_EXPR,430 NFTA_SET_ELEM_EXPR,
377 NFTA_SET_ELEM_PAD,431 NFTA_SET_ELEM_PAD,
378 NFTA_SET_ELEM_OBJREF,432 NFTA_SET_ELEM_OBJREF,
433 NFTA_SET_ELEM_KEY_END,
434 NFTA_SET_ELEM_EXPRESSIONS,
379 __NFTA_SET_ELEM_MAX435 __NFTA_SET_ELEM_MAX
380};436};
381#define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1)437#define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1)
...@@ -441,11 +497,13 @@ enum nft_data_attributes {...@@ -441,11 +497,13 @@ enum nft_data_attributes {
441 *497 *
442 * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts)498 * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts)
443 * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING)499 * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING)
500 * @NFTA_VERDICT_CHAIN_ID: jump target chain ID (NLA_U32)
444 */501 */
445enum nft_verdict_attributes {502enum nft_verdict_attributes {
446 NFTA_VERDICT_UNSPEC,503 NFTA_VERDICT_UNSPEC,
447 NFTA_VERDICT_CODE,504 NFTA_VERDICT_CODE,
448 NFTA_VERDICT_CHAIN,505 NFTA_VERDICT_CHAIN,
506 NFTA_VERDICT_CHAIN_ID,
449 __NFTA_VERDICT_MAX507 __NFTA_VERDICT_MAX
450};508};
451#define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1)509#define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1)
...@@ -478,6 +536,20 @@ enum nft_immediate_attributes {...@@ -478,6 +536,20 @@ enum nft_immediate_attributes {
478};536};
479#define NFTA_IMMEDIATE_MAX (__NFTA_IMMEDIATE_MAX - 1)537#define NFTA_IMMEDIATE_MAX (__NFTA_IMMEDIATE_MAX - 1)
480538
539/**
540 * enum nft_bitwise_ops - nf_tables bitwise operations
541 *
542 * @NFT_BITWISE_BOOL: mask-and-xor operation used to implement NOT, AND, OR and
543 * XOR boolean operations
544 * @NFT_BITWISE_LSHIFT: left-shift operation
545 * @NFT_BITWISE_RSHIFT: right-shift operation
546 */
547enum nft_bitwise_ops {
548 NFT_BITWISE_BOOL,
549 NFT_BITWISE_LSHIFT,
550 NFT_BITWISE_RSHIFT,
551};
552
481/**553/**
482 * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes554 * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes
483 *555 *
...@@ -486,16 +558,20 @@ enum nft_immediate_attributes {...@@ -486,16 +558,20 @@ enum nft_immediate_attributes {
486 * @NFTA_BITWISE_LEN: length of operands (NLA_U32)558 * @NFTA_BITWISE_LEN: length of operands (NLA_U32)
487 * @NFTA_BITWISE_MASK: mask value (NLA_NESTED: nft_data_attributes)559 * @NFTA_BITWISE_MASK: mask value (NLA_NESTED: nft_data_attributes)
488 * @NFTA_BITWISE_XOR: xor value (NLA_NESTED: nft_data_attributes)560 * @NFTA_BITWISE_XOR: xor value (NLA_NESTED: nft_data_attributes)
561 * @NFTA_BITWISE_OP: type of operation (NLA_U32: nft_bitwise_ops)
562 * @NFTA_BITWISE_DATA: argument for non-boolean operations
563 * (NLA_NESTED: nft_data_attributes)
489 *564 *
490 * The bitwise expression performs the following operation:565 * The bitwise expression supports boolean and shift operations. It implements
566 * the boolean operations by performing the following operation:
491 *567 *
492 * dreg = (sreg & mask) ^ xor568 * dreg = (sreg & mask) ^ xor
493 *569 *
494 * which allow to express all bitwise operations:570 * with these mask and xor values:
495 *571 *
496 * mask xor572 * mask xor
497 * NOT: 1 1573 * NOT: 1 1
498 * OR: 0 x574 * OR: ~x x
499 * XOR: 1 x575 * XOR: 1 x
500 * AND: x 0576 * AND: x 0
501 */577 */
...@@ -506,6 +582,8 @@ enum nft_bitwise_attributes {...@@ -506,6 +582,8 @@ enum nft_bitwise_attributes {
506 NFTA_BITWISE_LEN,582 NFTA_BITWISE_LEN,
507 NFTA_BITWISE_MASK,583 NFTA_BITWISE_MASK,
508 NFTA_BITWISE_XOR,584 NFTA_BITWISE_XOR,
585 NFTA_BITWISE_OP,
586 NFTA_BITWISE_DATA,
509 __NFTA_BITWISE_MAX587 __NFTA_BITWISE_MAX
510};588};
511#define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1)589#define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1)
...@@ -632,10 +710,12 @@ enum nft_lookup_attributes {...@@ -632,10 +710,12 @@ enum nft_lookup_attributes {
632enum nft_dynset_ops {710enum nft_dynset_ops {
633 NFT_DYNSET_OP_ADD,711 NFT_DYNSET_OP_ADD,
634 NFT_DYNSET_OP_UPDATE,712 NFT_DYNSET_OP_UPDATE,
713 NFT_DYNSET_OP_DELETE,
635};714};
636715
637enum nft_dynset_flags {716enum nft_dynset_flags {
638 NFT_DYNSET_F_INV = (1 << 0),717 NFT_DYNSET_F_INV = (1 << 0),
718 NFT_DYNSET_F_EXPR = (1 << 1),
639};719};
640720
641/**721/**
...@@ -649,6 +729,7 @@ enum nft_dynset_flags {...@@ -649,6 +729,7 @@ enum nft_dynset_flags {
649 * @NFTA_DYNSET_TIMEOUT: timeout value for the new element (NLA_U64)729 * @NFTA_DYNSET_TIMEOUT: timeout value for the new element (NLA_U64)
650 * @NFTA_DYNSET_EXPR: expression (NLA_NESTED: nft_expr_attributes)730 * @NFTA_DYNSET_EXPR: expression (NLA_NESTED: nft_expr_attributes)
651 * @NFTA_DYNSET_FLAGS: flags (NLA_U32)731 * @NFTA_DYNSET_FLAGS: flags (NLA_U32)
732 * @NFTA_DYNSET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes)
652 */733 */
653enum nft_dynset_attributes {734enum nft_dynset_attributes {
654 NFTA_DYNSET_UNSPEC,735 NFTA_DYNSET_UNSPEC,
...@@ -661,6 +742,7 @@ enum nft_dynset_attributes {...@@ -661,6 +742,7 @@ enum nft_dynset_attributes {
661 NFTA_DYNSET_EXPR,742 NFTA_DYNSET_EXPR,
662 NFTA_DYNSET_PAD,743 NFTA_DYNSET_PAD,
663 NFTA_DYNSET_FLAGS,744 NFTA_DYNSET_FLAGS,
745 NFTA_DYNSET_EXPRESSIONS,
664 __NFTA_DYNSET_MAX,746 __NFTA_DYNSET_MAX,
665};747};
666#define NFTA_DYNSET_MAX (__NFTA_DYNSET_MAX - 1)748#define NFTA_DYNSET_MAX (__NFTA_DYNSET_MAX - 1)
...@@ -671,11 +753,13 @@ enum nft_dynset_attributes {...@@ -671,11 +753,13 @@ enum nft_dynset_attributes {
671 * @NFT_PAYLOAD_LL_HEADER: link layer header753 * @NFT_PAYLOAD_LL_HEADER: link layer header
672 * @NFT_PAYLOAD_NETWORK_HEADER: network header754 * @NFT_PAYLOAD_NETWORK_HEADER: network header
673 * @NFT_PAYLOAD_TRANSPORT_HEADER: transport header755 * @NFT_PAYLOAD_TRANSPORT_HEADER: transport header
756 * @NFT_PAYLOAD_INNER_HEADER: inner header / payload
674 */757 */
675enum nft_payload_bases {758enum nft_payload_bases {
676 NFT_PAYLOAD_LL_HEADER,759 NFT_PAYLOAD_LL_HEADER,
677 NFT_PAYLOAD_NETWORK_HEADER,760 NFT_PAYLOAD_NETWORK_HEADER,
678 NFT_PAYLOAD_TRANSPORT_HEADER,761 NFT_PAYLOAD_TRANSPORT_HEADER,
762 NFT_PAYLOAD_INNER_HEADER,
679};763};
680764
681/**765/**
...@@ -683,10 +767,12 @@ enum nft_payload_bases {...@@ -683,10 +767,12 @@ enum nft_payload_bases {
683 *767 *
684 * @NFT_PAYLOAD_CSUM_NONE: no checksumming768 * @NFT_PAYLOAD_CSUM_NONE: no checksumming
685 * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791)769 * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791)
770 * @NFT_PAYLOAD_CSUM_SCTP: CRC-32c, for use in SCTP header (RFC 3309)
686 */771 */
687enum nft_payload_csum_types {772enum nft_payload_csum_types {
688 NFT_PAYLOAD_CSUM_NONE,773 NFT_PAYLOAD_CSUM_NONE,
689 NFT_PAYLOAD_CSUM_INET,774 NFT_PAYLOAD_CSUM_INET,
775 NFT_PAYLOAD_CSUM_SCTP,
690};776};
691777
692enum nft_payload_csum_flags {778enum nft_payload_csum_flags {
...@@ -728,10 +814,14 @@ enum nft_exthdr_flags {...@@ -728,10 +814,14 @@ enum nft_exthdr_flags {
728 *814 *
729 * @NFT_EXTHDR_OP_IPV6: match against ipv6 extension headers815 * @NFT_EXTHDR_OP_IPV6: match against ipv6 extension headers
730 * @NFT_EXTHDR_OP_TCP: match against tcp options816 * @NFT_EXTHDR_OP_TCP: match against tcp options
817 * @NFT_EXTHDR_OP_IPV4: match against ipv4 options
818 * @NFT_EXTHDR_OP_SCTP: match against sctp chunks
731 */819 */
732enum nft_exthdr_op {820enum nft_exthdr_op {
733 NFT_EXTHDR_OP_IPV6,821 NFT_EXTHDR_OP_IPV6,
734 NFT_EXTHDR_OP_TCPOPT,822 NFT_EXTHDR_OP_TCPOPT,
823 NFT_EXTHDR_OP_IPV4,
824 NFT_EXTHDR_OP_SCTP,
735 __NFT_EXTHDR_OP_MAX825 __NFT_EXTHDR_OP_MAX
736};826};
737#define NFT_EXTHDR_OP_MAX (__NFT_EXTHDR_OP_MAX - 1)827#define NFT_EXTHDR_OP_MAX (__NFT_EXTHDR_OP_MAX - 1)
...@@ -789,6 +879,15 @@ enum nft_exthdr_attributes {...@@ -789,6 +879,15 @@ enum nft_exthdr_attributes {
789 * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)879 * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)
790 * @NFT_META_PRANDOM: a 32bit pseudo-random number880 * @NFT_META_PRANDOM: a 32bit pseudo-random number
791 * @NFT_META_SECPATH: boolean, secpath_exists (!!skb->sp)881 * @NFT_META_SECPATH: boolean, secpath_exists (!!skb->sp)
882 * @NFT_META_IIFKIND: packet input interface kind name (dev->rtnl_link_ops->kind)
883 * @NFT_META_OIFKIND: packet output interface kind name (dev->rtnl_link_ops->kind)
884 * @NFT_META_BRI_IIFPVID: packet input bridge port pvid
885 * @NFT_META_BRI_IIFVPROTO: packet input bridge vlan proto
886 * @NFT_META_TIME_NS: time since epoch (in nanoseconds)
887 * @NFT_META_TIME_DAY: day of week (from 0 = Sunday to 6 = Saturday)
888 * @NFT_META_TIME_HOUR: hour of day (in seconds)
889 * @NFT_META_SDIF: slave device interface index
890 * @NFT_META_SDIFNAME: slave device interface name
792 */891 */
793enum nft_meta_keys {892enum nft_meta_keys {
794 NFT_META_LEN,893 NFT_META_LEN,
...@@ -799,7 +898,8 @@ enum nft_meta_keys {...@@ -799,7 +898,8 @@ enum nft_meta_keys {
799 NFT_META_OIF,898 NFT_META_OIF,
800 NFT_META_IIFNAME,899 NFT_META_IIFNAME,
801 NFT_META_OIFNAME,900 NFT_META_OIFNAME,
802 NFT_META_IIFTYPE,901 NFT_META_IFTYPE,
902#define NFT_META_IIFTYPE NFT_META_IFTYPE
803 NFT_META_OIFTYPE,903 NFT_META_OIFTYPE,
804 NFT_META_SKUID,904 NFT_META_SKUID,
805 NFT_META_SKGID,905 NFT_META_SKGID,
...@@ -817,6 +917,16 @@ enum nft_meta_keys {...@@ -817,6 +917,16 @@ enum nft_meta_keys {
817 NFT_META_CGROUP,917 NFT_META_CGROUP,
818 NFT_META_PRANDOM,918 NFT_META_PRANDOM,
819 NFT_META_SECPATH,919 NFT_META_SECPATH,
920 NFT_META_IIFKIND,
921 NFT_META_OIFKIND,
922 NFT_META_BRI_IIFPVID,
923 NFT_META_BRI_IIFVPROTO,
924 NFT_META_TIME_NS,
925 NFT_META_TIME_DAY,
926 NFT_META_TIME_HOUR,
927 NFT_META_SDIF,
928 NFT_META_SDIFNAME,
929 __NFT_META_IIFTYPE,
820};930};
821931
822/**932/**
...@@ -826,12 +936,14 @@ enum nft_meta_keys {...@@ -826,12 +936,14 @@ enum nft_meta_keys {
826 * @NFT_RT_NEXTHOP4: routing nexthop for IPv4936 * @NFT_RT_NEXTHOP4: routing nexthop for IPv4
827 * @NFT_RT_NEXTHOP6: routing nexthop for IPv6937 * @NFT_RT_NEXTHOP6: routing nexthop for IPv6
828 * @NFT_RT_TCPMSS: fetch current path tcp mss938 * @NFT_RT_TCPMSS: fetch current path tcp mss
939 * @NFT_RT_XFRM: boolean, skb->dst->xfrm != NULL
829 */940 */
830enum nft_rt_keys {941enum nft_rt_keys {
831 NFT_RT_CLASSID,942 NFT_RT_CLASSID,
832 NFT_RT_NEXTHOP4,943 NFT_RT_NEXTHOP4,
833 NFT_RT_NEXTHOP6,944 NFT_RT_NEXTHOP6,
834 NFT_RT_TCPMSS,945 NFT_RT_TCPMSS,
946 NFT_RT_XFRM,
835 __NFT_RT_MAX947 __NFT_RT_MAX
836};948};
837#define NFT_RT_MAX (__NFT_RT_MAX - 1)949#define NFT_RT_MAX (__NFT_RT_MAX - 1)
...@@ -869,8 +981,8 @@ enum nft_hash_attributes {...@@ -869,8 +981,8 @@ enum nft_hash_attributes {
869 NFTA_HASH_SEED,981 NFTA_HASH_SEED,
870 NFTA_HASH_OFFSET,982 NFTA_HASH_OFFSET,
871 NFTA_HASH_TYPE,983 NFTA_HASH_TYPE,
872 NFTA_HASH_SET_NAME,984 NFTA_HASH_SET_NAME, /* deprecated */
873 NFTA_HASH_SET_ID,985 NFTA_HASH_SET_ID, /* deprecated */
874 __NFTA_HASH_MAX,986 __NFTA_HASH_MAX,
875};987};
876#define NFTA_HASH_MAX (__NFTA_HASH_MAX - 1)988#define NFTA_HASH_MAX (__NFTA_HASH_MAX - 1)
...@@ -910,11 +1022,13 @@ enum nft_rt_attributes {...@@ -910,11 +1022,13 @@ enum nft_rt_attributes {
910 *1022 *
911 * @NFTA_SOCKET_KEY: socket key to match1023 * @NFTA_SOCKET_KEY: socket key to match
912 * @NFTA_SOCKET_DREG: destination register1024 * @NFTA_SOCKET_DREG: destination register
1025 * @NFTA_SOCKET_LEVEL: cgroups2 ancestor level (only for cgroupsv2)
913 */1026 */
914enum nft_socket_attributes {1027enum nft_socket_attributes {
915 NFTA_SOCKET_UNSPEC,1028 NFTA_SOCKET_UNSPEC,
916 NFTA_SOCKET_KEY,1029 NFTA_SOCKET_KEY,
917 NFTA_SOCKET_DREG,1030 NFTA_SOCKET_DREG,
1031 NFTA_SOCKET_LEVEL,
918 __NFTA_SOCKET_MAX1032 __NFTA_SOCKET_MAX
919};1033};
920#define NFTA_SOCKET_MAX (__NFTA_SOCKET_MAX - 1)1034#define NFTA_SOCKET_MAX (__NFTA_SOCKET_MAX - 1)
...@@ -924,10 +1038,14 @@ enum nft_socket_attributes {...@@ -924,10 +1038,14 @@ enum nft_socket_attributes {
924 *1038 *
925 * @NFT_SOCKET_TRANSPARENT: Value of the IP(V6)_TRANSPARENT socket option1039 * @NFT_SOCKET_TRANSPARENT: Value of the IP(V6)_TRANSPARENT socket option
926 * @NFT_SOCKET_MARK: Value of the socket mark1040 * @NFT_SOCKET_MARK: Value of the socket mark
1041 * @NFT_SOCKET_WILDCARD: Whether the socket is zero-bound (e.g. 0.0.0.0 or ::0)
1042 * @NFT_SOCKET_CGROUPV2: Match on cgroups version 2
927 */1043 */
928enum nft_socket_keys {1044enum nft_socket_keys {
929 NFT_SOCKET_TRANSPARENT,1045 NFT_SOCKET_TRANSPARENT,
930 NFT_SOCKET_MARK,1046 NFT_SOCKET_MARK,
1047 NFT_SOCKET_WILDCARD,
1048 NFT_SOCKET_CGROUPV2,
931 __NFT_SOCKET_MAX1049 __NFT_SOCKET_MAX
932};1050};
933#define NFT_SOCKET_MAX (__NFT_SOCKET_MAX - 1)1051#define NFT_SOCKET_MAX (__NFT_SOCKET_MAX - 1)
...@@ -958,7 +1076,7 @@ enum nft_socket_keys {...@@ -958,7 +1076,7 @@ enum nft_socket_keys {
958 * @NFT_CT_DST_IP: conntrack layer 3 protocol destination (IPv4 address)1076 * @NFT_CT_DST_IP: conntrack layer 3 protocol destination (IPv4 address)
959 * @NFT_CT_SRC_IP6: conntrack layer 3 protocol source (IPv6 address)1077 * @NFT_CT_SRC_IP6: conntrack layer 3 protocol source (IPv6 address)
960 * @NFT_CT_DST_IP6: conntrack layer 3 protocol destination (IPv6 address)1078 * @NFT_CT_DST_IP6: conntrack layer 3 protocol destination (IPv6 address)
961 * @NFT_CT_TIMEOUT: connection tracking timeout policy assigned to conntrack1079 * @NFT_CT_ID: conntrack id
962 */1080 */
963enum nft_ct_keys {1081enum nft_ct_keys {
964 NFT_CT_STATE,1082 NFT_CT_STATE,
...@@ -984,7 +1102,7 @@ enum nft_ct_keys {...@@ -984,7 +1102,7 @@ enum nft_ct_keys {
984 NFT_CT_DST_IP,1102 NFT_CT_DST_IP,
985 NFT_CT_SRC_IP6,1103 NFT_CT_SRC_IP6,
986 NFT_CT_DST_IP6,1104 NFT_CT_DST_IP6,
987 NFT_CT_TIMEOUT,1105 NFT_CT_ID,
988 __NFT_CT_MAX1106 __NFT_CT_MAX
989};1107};
990#define NFT_CT_MAX (__NFT_CT_MAX - 1)1108#define NFT_CT_MAX (__NFT_CT_MAX - 1)
...@@ -1081,6 +1199,21 @@ enum nft_counter_attributes {...@@ -1081,6 +1199,21 @@ enum nft_counter_attributes {
1081};1199};
1082#define NFTA_COUNTER_MAX (__NFTA_COUNTER_MAX - 1)1200#define NFTA_COUNTER_MAX (__NFTA_COUNTER_MAX - 1)
10831201
1202/**
1203 * enum nft_last_attributes - nf_tables last expression netlink attributes
1204 *
1205 * @NFTA_LAST_SET: last update has been set, zero means never updated (NLA_U32)
1206 * @NFTA_LAST_MSECS: milliseconds since last update (NLA_U64)
1207 */
1208enum nft_last_attributes {
1209 NFTA_LAST_UNSPEC,
1210 NFTA_LAST_SET,
1211 NFTA_LAST_MSECS,
1212 NFTA_LAST_PAD,
1213 __NFTA_LAST_MAX
1214};
1215#define NFTA_LAST_MAX (__NFTA_LAST_MAX - 1)
1216
1084/**1217/**
1085 * enum nft_log_attributes - nf_tables log expression netlink attributes1218 * enum nft_log_attributes - nf_tables log expression netlink attributes
1086 *1219 *
...@@ -1128,7 +1261,7 @@ enum nft_log_level {...@@ -1128,7 +1261,7 @@ enum nft_log_level {
1128 NFT_LOGLEVEL_AUDIT,1261 NFT_LOGLEVEL_AUDIT,
1129 __NFT_LOGLEVEL_MAX1262 __NFT_LOGLEVEL_MAX
1130};1263};
1131#define NFT_LOGLEVEL_MAX (__NFT_LOGLEVEL_MAX + 1)1264#define NFT_LOGLEVEL_MAX (__NFT_LOGLEVEL_MAX - 1)
11321265
1133/**1266/**
1134 * enum nft_queue_attributes - nf_tables queue expression netlink attributes1267 * enum nft_queue_attributes - nf_tables queue expression netlink attributes
...@@ -1174,6 +1307,21 @@ enum nft_quota_attributes {...@@ -1174,6 +1307,21 @@ enum nft_quota_attributes {
1174};1307};
1175#define NFTA_QUOTA_MAX (__NFTA_QUOTA_MAX - 1)1308#define NFTA_QUOTA_MAX (__NFTA_QUOTA_MAX - 1)
11761309
1310/**
1311 * enum nft_secmark_attributes - nf_tables secmark object netlink attributes
1312 *
1313 * @NFTA_SECMARK_CTX: security context (NLA_STRING)
1314 */
1315enum nft_secmark_attributes {
1316 NFTA_SECMARK_UNSPEC,
1317 NFTA_SECMARK_CTX,
1318 __NFTA_SECMARK_MAX,
1319};
1320#define NFTA_SECMARK_MAX (__NFTA_SECMARK_MAX - 1)
1321
1322/* Max security context length */
1323#define NFT_SECMARK_CTX_MAXLEN 256
1324
1177/**1325/**
1178 * enum nft_reject_types - nf_tables reject expression reject types1326 * enum nft_reject_types - nf_tables reject expression reject types
1179 *1327 *
...@@ -1422,6 +1570,17 @@ enum nft_ct_timeout_timeout_attributes {...@@ -1422,6 +1570,17 @@ enum nft_ct_timeout_timeout_attributes {
1422};1570};
1423#define NFTA_CT_TIMEOUT_MAX (__NFTA_CT_TIMEOUT_MAX - 1)1571#define NFTA_CT_TIMEOUT_MAX (__NFTA_CT_TIMEOUT_MAX - 1)
14241572
1573enum nft_ct_expectation_attributes {
1574 NFTA_CT_EXPECT_UNSPEC,
1575 NFTA_CT_EXPECT_L3PROTO,
1576 NFTA_CT_EXPECT_L4PROTO,
1577 NFTA_CT_EXPECT_DPORT,
1578 NFTA_CT_EXPECT_TIMEOUT,
1579 NFTA_CT_EXPECT_SIZE,
1580 __NFTA_CT_EXPECT_MAX,
1581};
1582#define NFTA_CT_EXPECT_MAX (__NFTA_CT_EXPECT_MAX - 1)
1583
1425#define NFT_OBJECT_UNSPEC 01584#define NFT_OBJECT_UNSPEC 0
1426#define NFT_OBJECT_COUNTER 11585#define NFT_OBJECT_COUNTER 1
1427#define NFT_OBJECT_QUOTA 21586#define NFT_OBJECT_QUOTA 2
...@@ -1430,7 +1589,10 @@ enum nft_ct_timeout_timeout_attributes {...@@ -1430,7 +1589,10 @@ enum nft_ct_timeout_timeout_attributes {
1430#define NFT_OBJECT_CONNLIMIT 51589#define NFT_OBJECT_CONNLIMIT 5
1431#define NFT_OBJECT_TUNNEL 61590#define NFT_OBJECT_TUNNEL 6
1432#define NFT_OBJECT_CT_TIMEOUT 71591#define NFT_OBJECT_CT_TIMEOUT 7
1433#define __NFT_OBJECT_MAX 81592#define NFT_OBJECT_SECMARK 8
1593#define NFT_OBJECT_CT_EXPECT 9
1594#define NFT_OBJECT_SYNPROXY 10
1595#define __NFT_OBJECT_MAX 11
1434#define NFT_OBJECT_MAX (__NFT_OBJECT_MAX - 1)1596#define NFT_OBJECT_MAX (__NFT_OBJECT_MAX - 1)
14351597
1436/**1598/**
...@@ -1442,6 +1604,7 @@ enum nft_ct_timeout_timeout_attributes {...@@ -1442,6 +1604,7 @@ enum nft_ct_timeout_timeout_attributes {
1442 * @NFTA_OBJ_DATA: stateful object data (NLA_NESTED)1604 * @NFTA_OBJ_DATA: stateful object data (NLA_NESTED)
1443 * @NFTA_OBJ_USE: number of references to this expression (NLA_U32)1605 * @NFTA_OBJ_USE: number of references to this expression (NLA_U32)
1444 * @NFTA_OBJ_HANDLE: object handle (NLA_U64)1606 * @NFTA_OBJ_HANDLE: object handle (NLA_U64)
1607 * @NFTA_OBJ_USERDATA: user data (NLA_BINARY)
1445 */1608 */
1446enum nft_object_attributes {1609enum nft_object_attributes {
1447 NFTA_OBJ_UNSPEC,1610 NFTA_OBJ_UNSPEC,
...@@ -1452,10 +1615,24 @@ enum nft_object_attributes {...@@ -1452,10 +1615,24 @@ enum nft_object_attributes {
1452 NFTA_OBJ_USE,1615 NFTA_OBJ_USE,
1453 NFTA_OBJ_HANDLE,1616 NFTA_OBJ_HANDLE,
1454 NFTA_OBJ_PAD,1617 NFTA_OBJ_PAD,
1618 NFTA_OBJ_USERDATA,
1455 __NFTA_OBJ_MAX1619 __NFTA_OBJ_MAX
1456};1620};
1457#define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1)1621#define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1)
14581622
1623/**
1624 * enum nft_flowtable_flags - nf_tables flowtable flags
1625 *
1626 * @NFT_FLOWTABLE_HW_OFFLOAD: flowtable hardware offload is enabled
1627 * @NFT_FLOWTABLE_COUNTER: enable flow counters
1628 */
1629enum nft_flowtable_flags {
1630 NFT_FLOWTABLE_HW_OFFLOAD = 0x1,
1631 NFT_FLOWTABLE_COUNTER = 0x2,
1632 NFT_FLOWTABLE_MASK = (NFT_FLOWTABLE_HW_OFFLOAD |
1633 NFT_FLOWTABLE_COUNTER)
1634};
1635
1459/**1636/**
1460 * enum nft_flowtable_attributes - nf_tables flow table netlink attributes1637 * enum nft_flowtable_attributes - nf_tables flow table netlink attributes
1461 *1638 *
...@@ -1464,6 +1641,7 @@ enum nft_object_attributes {...@@ -1464,6 +1641,7 @@ enum nft_object_attributes {
1464 * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32)1641 * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32)
1465 * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)1642 * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)
1466 * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)1643 * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)
1644 * @NFTA_FLOWTABLE_FLAGS: flags (NLA_U32)
1467 */1645 */
1468enum nft_flowtable_attributes {1646enum nft_flowtable_attributes {
1469 NFTA_FLOWTABLE_UNSPEC,1647 NFTA_FLOWTABLE_UNSPEC,
...@@ -1473,6 +1651,7 @@ enum nft_flowtable_attributes {...@@ -1473,6 +1651,7 @@ enum nft_flowtable_attributes {
1473 NFTA_FLOWTABLE_USE,1651 NFTA_FLOWTABLE_USE,
1474 NFTA_FLOWTABLE_HANDLE,1652 NFTA_FLOWTABLE_HANDLE,
1475 NFTA_FLOWTABLE_PAD,1653 NFTA_FLOWTABLE_PAD,
1654 NFTA_FLOWTABLE_FLAGS,
1476 __NFTA_FLOWTABLE_MAX1655 __NFTA_FLOWTABLE_MAX
1477};1656};
1478#define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1)1657#define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1)
...@@ -1493,13 +1672,42 @@ enum nft_flowtable_hook_attributes {...@@ -1493,13 +1672,42 @@ enum nft_flowtable_hook_attributes {
1493};1672};
1494#define NFTA_FLOWTABLE_HOOK_MAX (__NFTA_FLOWTABLE_HOOK_MAX - 1)1673#define NFTA_FLOWTABLE_HOOK_MAX (__NFTA_FLOWTABLE_HOOK_MAX - 1)
14951674
1675/**
1676 * enum nft_osf_attributes - nftables osf expression netlink attributes
1677 *
1678 * @NFTA_OSF_DREG: destination register (NLA_U32: nft_registers)
1679 * @NFTA_OSF_TTL: Value of the TTL osf option (NLA_U8)
1680 * @NFTA_OSF_FLAGS: flags (NLA_U32)
1681 */
1496enum nft_osf_attributes {1682enum nft_osf_attributes {
1497 NFTA_OSF_UNSPEC,1683 NFTA_OSF_UNSPEC,
1498 NFTA_OSF_DREG,1684 NFTA_OSF_DREG,
1685 NFTA_OSF_TTL,
1686 NFTA_OSF_FLAGS,
1499 __NFTA_OSF_MAX,1687 __NFTA_OSF_MAX,
1500};1688};
1501#define NFTA_OSF_MAX (__NFTA_OSF_MAX - 1)1689#define NFTA_OSF_MAX (__NFTA_OSF_MAX - 1)
15021690
1691enum nft_osf_flags {
1692 NFT_OSF_F_VERSION = (1 << 0),
1693};
1694
1695/**
1696 * enum nft_synproxy_attributes - nf_tables synproxy expression netlink attributes
1697 *
1698 * @NFTA_SYNPROXY_MSS: mss value sent to the backend (NLA_U16)
1699 * @NFTA_SYNPROXY_WSCALE: wscale value sent to the backend (NLA_U8)
1700 * @NFTA_SYNPROXY_FLAGS: flags (NLA_U32)
1701 */
1702enum nft_synproxy_attributes {
1703 NFTA_SYNPROXY_UNSPEC,
1704 NFTA_SYNPROXY_MSS,
1705 NFTA_SYNPROXY_WSCALE,
1706 NFTA_SYNPROXY_FLAGS,
1707 __NFTA_SYNPROXY_MAX,
1708};
1709#define NFTA_SYNPROXY_MAX (__NFTA_SYNPROXY_MAX - 1)
1710
1503/**1711/**
1504 * enum nft_device_attributes - nf_tables device netlink attributes1712 * enum nft_device_attributes - nf_tables device netlink attributes
1505 *1713 *
...@@ -1512,6 +1720,35 @@ enum nft_devices_attributes {...@@ -1512,6 +1720,35 @@ enum nft_devices_attributes {
1512};1720};
1513#define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1)1721#define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1)
15141722
1723/*
1724 * enum nft_xfrm_attributes - nf_tables xfrm expr netlink attributes
1725 *
1726 * @NFTA_XFRM_DREG: destination register (NLA_U32)
1727 * @NFTA_XFRM_KEY: enum nft_xfrm_keys (NLA_U32)
1728 * @NFTA_XFRM_DIR: direction (NLA_U8)
1729 * @NFTA_XFRM_SPNUM: index in secpath array (NLA_U32)
1730 */
1731enum nft_xfrm_attributes {
1732 NFTA_XFRM_UNSPEC,
1733 NFTA_XFRM_DREG,
1734 NFTA_XFRM_KEY,
1735 NFTA_XFRM_DIR,
1736 NFTA_XFRM_SPNUM,
1737 __NFTA_XFRM_MAX
1738};
1739#define NFTA_XFRM_MAX (__NFTA_XFRM_MAX - 1)
1740
1741enum nft_xfrm_keys {
1742 NFT_XFRM_KEY_UNSPEC,
1743 NFT_XFRM_KEY_DADDR_IP4,
1744 NFT_XFRM_KEY_DADDR_IP6,
1745 NFT_XFRM_KEY_SADDR_IP4,
1746 NFT_XFRM_KEY_SADDR_IP6,
1747 NFT_XFRM_KEY_REQID,
1748 NFT_XFRM_KEY_SPI,
1749 __NFT_XFRM_KEY_MAX,
1750};
1751#define NFT_XFRM_KEY_MAX (__NFT_XFRM_KEY_MAX - 1)
15151752
1516/**1753/**
1517 * enum nft_trace_attributes - nf_tables trace netlink attributes1754 * enum nft_trace_attributes - nf_tables trace netlink attributes
...@@ -1615,6 +1852,7 @@ enum nft_tunnel_opts_attributes {...@@ -1615,6 +1852,7 @@ enum nft_tunnel_opts_attributes {
1615 NFTA_TUNNEL_KEY_OPTS_UNSPEC,1852 NFTA_TUNNEL_KEY_OPTS_UNSPEC,
1616 NFTA_TUNNEL_KEY_OPTS_VXLAN,1853 NFTA_TUNNEL_KEY_OPTS_VXLAN,
1617 NFTA_TUNNEL_KEY_OPTS_ERSPAN,1854 NFTA_TUNNEL_KEY_OPTS_ERSPAN,
1855 NFTA_TUNNEL_KEY_OPTS_GENEVE,
1618 __NFTA_TUNNEL_KEY_OPTS_MAX1856 __NFTA_TUNNEL_KEY_OPTS_MAX
1619};1857};
1620#define NFTA_TUNNEL_KEY_OPTS_MAX (__NFTA_TUNNEL_KEY_OPTS_MAX - 1)1858#define NFTA_TUNNEL_KEY_OPTS_MAX (__NFTA_TUNNEL_KEY_OPTS_MAX - 1)
...@@ -1636,6 +1874,15 @@ enum nft_tunnel_opts_erspan_attributes {...@@ -1636,6 +1874,15 @@ enum nft_tunnel_opts_erspan_attributes {
1636};1874};
1637#define NFTA_TUNNEL_KEY_ERSPAN_MAX (__NFTA_TUNNEL_KEY_ERSPAN_MAX - 1)1875#define NFTA_TUNNEL_KEY_ERSPAN_MAX (__NFTA_TUNNEL_KEY_ERSPAN_MAX - 1)
16381876
1877enum nft_tunnel_opts_geneve_attributes {
1878 NFTA_TUNNEL_KEY_GENEVE_UNSPEC,
1879 NFTA_TUNNEL_KEY_GENEVE_CLASS,
1880 NFTA_TUNNEL_KEY_GENEVE_TYPE,
1881 NFTA_TUNNEL_KEY_GENEVE_DATA,
1882 __NFTA_TUNNEL_KEY_GENEVE_MAX
1883};
1884#define NFTA_TUNNEL_KEY_GENEVE_MAX (__NFTA_TUNNEL_KEY_GENEVE_MAX - 1)
1885
1639enum nft_tunnel_flags {1886enum nft_tunnel_flags {
1640 NFT_TUNNEL_F_ZERO_CSUM_TX = (1 << 0),1887 NFT_TUNNEL_F_ZERO_CSUM_TX = (1 << 0),
1641 NFT_TUNNEL_F_DONT_FRAGMENT = (1 << 1),1888 NFT_TUNNEL_F_DONT_FRAGMENT = (1 << 1),
...@@ -1667,10 +1914,19 @@ enum nft_tunnel_keys {...@@ -1667,10 +1914,19 @@ enum nft_tunnel_keys {
1667};1914};
1668#define NFT_TUNNEL_MAX (__NFT_TUNNEL_MAX - 1)1915#define NFT_TUNNEL_MAX (__NFT_TUNNEL_MAX - 1)
16691916
1917enum nft_tunnel_mode {
1918 NFT_TUNNEL_MODE_NONE,
1919 NFT_TUNNEL_MODE_RX,
1920 NFT_TUNNEL_MODE_TX,
1921 __NFT_TUNNEL_MODE_MAX
1922};
1923#define NFT_TUNNEL_MODE_MAX (__NFT_TUNNEL_MODE_MAX - 1)
1924
1670enum nft_tunnel_attributes {1925enum nft_tunnel_attributes {
1671 NFTA_TUNNEL_UNSPEC,1926 NFTA_TUNNEL_UNSPEC,
1672 NFTA_TUNNEL_KEY,1927 NFTA_TUNNEL_KEY,
1673 NFTA_TUNNEL_DREG,1928 NFTA_TUNNEL_DREG,
1929 NFTA_TUNNEL_MODE,
1674 __NFTA_TUNNEL_MAX1930 __NFTA_TUNNEL_MAX
1675};1931};
1676#define NFTA_TUNNEL_MAX (__NFTA_TUNNEL_MAX - 1)1932#define NFTA_TUNNEL_MAX (__NFTA_TUNNEL_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink.h+2-1
...@@ -60,7 +60,8 @@ struct nfgenmsg {...@@ -60,7 +60,8 @@ struct nfgenmsg {
60#define NFNL_SUBSYS_CTHELPER 960#define NFNL_SUBSYS_CTHELPER 9
61#define NFNL_SUBSYS_NFTABLES 1061#define NFNL_SUBSYS_NFTABLES 10
62#define NFNL_SUBSYS_NFT_COMPAT 1162#define NFNL_SUBSYS_NFT_COMPAT 11
63#define NFNL_SUBSYS_COUNT 1263#define NFNL_SUBSYS_HOOK 12
64#define NFNL_SUBSYS_COUNT 13
6465
65/* Reserved control nfnetlink messages */66/* Reserved control nfnetlink messages */
66#define NFNL_MSG_BATCH_BEGIN NLMSG_MIN_TYPE67#define NFNL_MSG_BATCH_BEGIN NLMSG_MIN_TYPE
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_conntrack.h+13-1
...@@ -55,6 +55,8 @@ enum ctattr_type {...@@ -55,6 +55,8 @@ enum ctattr_type {
55 CTA_LABELS,55 CTA_LABELS,
56 CTA_LABELS_MASK,56 CTA_LABELS_MASK,
57 CTA_SYNPROXY,57 CTA_SYNPROXY,
58 CTA_FILTER,
59 CTA_STATUS_MASK,
58 __CTA_MAX60 __CTA_MAX
59};61};
60#define CTA_MAX (__CTA_MAX - 1)62#define CTA_MAX (__CTA_MAX - 1)
...@@ -246,7 +248,7 @@ enum ctattr_stats_cpu {...@@ -246,7 +248,7 @@ enum ctattr_stats_cpu {
246 CTA_STATS_FOUND,248 CTA_STATS_FOUND,
247 CTA_STATS_NEW, /* no longer used */249 CTA_STATS_NEW, /* no longer used */
248 CTA_STATS_INVALID,250 CTA_STATS_INVALID,
249 CTA_STATS_IGNORE,251 CTA_STATS_IGNORE, /* no longer used */
250 CTA_STATS_DELETE, /* no longer used */252 CTA_STATS_DELETE, /* no longer used */
251 CTA_STATS_DELETE_LIST, /* no longer used */253 CTA_STATS_DELETE_LIST, /* no longer used */
252 CTA_STATS_INSERT,254 CTA_STATS_INSERT,
...@@ -255,6 +257,8 @@ enum ctattr_stats_cpu {...@@ -255,6 +257,8 @@ enum ctattr_stats_cpu {
255 CTA_STATS_EARLY_DROP,257 CTA_STATS_EARLY_DROP,
256 CTA_STATS_ERROR,258 CTA_STATS_ERROR,
257 CTA_STATS_SEARCH_RESTART,259 CTA_STATS_SEARCH_RESTART,
260 CTA_STATS_CLASH_RESOLVE,
261 CTA_STATS_CHAIN_TOOLONG,
258 __CTA_STATS_MAX,262 __CTA_STATS_MAX,
259};263};
260#define CTA_STATS_MAX (__CTA_STATS_MAX - 1)264#define CTA_STATS_MAX (__CTA_STATS_MAX - 1)
...@@ -276,4 +280,12 @@ enum ctattr_expect_stats {...@@ -276,4 +280,12 @@ enum ctattr_expect_stats {
276};280};
277#define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1)281#define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1)
278282
283enum ctattr_filter {
284 CTA_FILTER_UNSPEC,
285 CTA_FILTER_ORIG_FLAGS,
286 CTA_FILTER_REPLY_FLAGS,
287 __CTA_FILTER_MAX
288};
289#define CTA_FILTER_MAX (__CTA_FILTER_MAX - 1)
290
279#endif /* _IPCONNTRACK_NETLINK_H */291#endif /* _IPCONNTRACK_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_cthelper.h+1-1
...@@ -5,7 +5,7 @@...@@ -5,7 +5,7 @@
5#define NFCT_HELPER_STATUS_DISABLED 05#define NFCT_HELPER_STATUS_DISABLED 0
6#define NFCT_HELPER_STATUS_ENABLED 16#define NFCT_HELPER_STATUS_ENABLED 1
77
8enum nfnl_acct_msg_types {8enum nfnl_cthelper_msg_types {
9 NFNL_MSG_CTHELPER_NEW,9 NFNL_MSG_CTHELPER_NEW,
10 NFNL_MSG_CTHELPER_GET,10 NFNL_MSG_CTHELPER_GET,
11 NFNL_MSG_CTHELPER_DEL,11 NFNL_MSG_CTHELPER_DEL,
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_hook.h created+64
...@@ -0,0 +1,64 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _NFNL_HOOK_H_
3#define _NFNL_HOOK_H_
4
5enum nfnl_hook_msg_types {
6 NFNL_MSG_HOOK_GET,
7 NFNL_MSG_HOOK_MAX,
8};
9
10/**
11 * enum nfnl_hook_attributes - netfilter hook netlink attributes
12 *
13 * @NFNLA_HOOK_HOOKNUM: netfilter hook number (NLA_U32)
14 * @NFNLA_HOOK_PRIORITY: netfilter hook priority (NLA_U32)
15 * @NFNLA_HOOK_DEV: netdevice name (NLA_STRING)
16 * @NFNLA_HOOK_FUNCTION_NAME: hook function name (NLA_STRING)
17 * @NFNLA_HOOK_MODULE_NAME: kernel module that registered this hook (NLA_STRING)
18 * @NFNLA_HOOK_CHAIN_INFO: basechain hook metadata (NLA_NESTED)
19 */
20enum nfnl_hook_attributes {
21 NFNLA_HOOK_UNSPEC,
22 NFNLA_HOOK_HOOKNUM,
23 NFNLA_HOOK_PRIORITY,
24 NFNLA_HOOK_DEV,
25 NFNLA_HOOK_FUNCTION_NAME,
26 NFNLA_HOOK_MODULE_NAME,
27 NFNLA_HOOK_CHAIN_INFO,
28 __NFNLA_HOOK_MAX
29};
30#define NFNLA_HOOK_MAX (__NFNLA_HOOK_MAX - 1)
31
32/**
33 * enum nfnl_hook_chain_info_attributes - chain description
34 *
35 * NFNLA_HOOK_INFO_DESC: nft chain and table name (enum nft_table_attributes) (NLA_NESTED)
36 * NFNLA_HOOK_INFO_TYPE: chain type (enum nfnl_hook_chaintype) (NLA_U32)
37 */
38enum nfnl_hook_chain_info_attributes {
39 NFNLA_HOOK_INFO_UNSPEC,
40 NFNLA_HOOK_INFO_DESC,
41 NFNLA_HOOK_INFO_TYPE,
42 __NFNLA_HOOK_INFO_MAX,
43};
44#define NFNLA_HOOK_INFO_MAX (__NFNLA_HOOK_INFO_MAX - 1)
45
46enum nfnl_hook_chain_desc_attributes {
47 NFNLA_CHAIN_UNSPEC,
48 NFNLA_CHAIN_TABLE,
49 NFNLA_CHAIN_FAMILY,
50 NFNLA_CHAIN_NAME,
51 __NFNLA_CHAIN_MAX,
52};
53#define NFNLA_CHAIN_MAX (__NFNLA_CHAIN_MAX - 1)
54
55/**
56 * enum nfnl_hook_chaintype - chain type
57 *
58 * @NFNL_HOOK_TYPE_NFTABLES nf_tables base chain
59 */
60enum nfnl_hook_chaintype {
61 NFNL_HOOK_TYPE_NFTABLES = 0x1,
62};
63
64#endif /* _NFNL_HOOK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_log.h+12-1
...@@ -33,6 +33,15 @@ struct nfulnl_msg_packet_timestamp {...@@ -33,6 +33,15 @@ struct nfulnl_msg_packet_timestamp {
33 __aligned_be64 usec;33 __aligned_be64 usec;
34};34};
3535
36enum nfulnl_vlan_attr {
37 NFULA_VLAN_UNSPEC,
38 NFULA_VLAN_PROTO, /* __be16 skb vlan_proto */
39 NFULA_VLAN_TCI, /* __be16 skb htons(vlan_tci) */
40 __NFULA_VLAN_MAX,
41};
42
43#define NFULA_VLAN_MAX (__NFULA_VLAN_MAX + 1)
44
36enum nfulnl_attr_type {45enum nfulnl_attr_type {
37 NFULA_UNSPEC,46 NFULA_UNSPEC,
38 NFULA_PACKET_HDR,47 NFULA_PACKET_HDR,
...@@ -52,8 +61,10 @@ enum nfulnl_attr_type {...@@ -52,8 +61,10 @@ enum nfulnl_attr_type {
52 NFULA_HWTYPE, /* hardware type */61 NFULA_HWTYPE, /* hardware type */
53 NFULA_HWHEADER, /* hardware header */62 NFULA_HWHEADER, /* hardware header */
54 NFULA_HWLEN, /* hardware header length */63 NFULA_HWLEN, /* hardware header length */
55 NFULA_CT, /* nf_conntrack_netlink.h */64 NFULA_CT, /* nfnetlink_conntrack.h */
56 NFULA_CT_INFO, /* enum ip_conntrack_info */65 NFULA_CT_INFO, /* enum ip_conntrack_info */
66 NFULA_VLAN, /* nested attribute: packet vlan info */
67 NFULA_L2HDR, /* full L2 header */
5768
58 __NFULA_MAX69 __NFULA_MAX
59};70};
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_queue.h+2-2
...@@ -51,11 +51,11 @@ enum nfqnl_attr_type {...@@ -51,11 +51,11 @@ enum nfqnl_attr_type {
51 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */51 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
52 NFQA_HWADDR, /* nfqnl_msg_packet_hw */52 NFQA_HWADDR, /* nfqnl_msg_packet_hw */
53 NFQA_PAYLOAD, /* opaque data payload */53 NFQA_PAYLOAD, /* opaque data payload */
54 NFQA_CT, /* nf_conntrack_netlink.h */54 NFQA_CT, /* nfnetlink_conntrack.h */
55 NFQA_CT_INFO, /* enum ip_conntrack_info */55 NFQA_CT_INFO, /* enum ip_conntrack_info */
56 NFQA_CAP_LEN, /* __u32 length of captured packet */56 NFQA_CAP_LEN, /* __u32 length of captured packet */
57 NFQA_SKB_INFO, /* __u32 skb meta information */57 NFQA_SKB_INFO, /* __u32 skb meta information */
58 NFQA_EXP, /* nf_conntrack_netlink.h */58 NFQA_EXP, /* nfnetlink_conntrack.h */
59 NFQA_UID, /* __u32 sk uid */59 NFQA_UID, /* __u32 sk uid */
60 NFQA_GID, /* __u32 sk gid */60 NFQA_GID, /* __u32 sk gid */
61 NFQA_SECCTX, /* security context string */61 NFQA_SECCTX, /* security context string */
lib/libc/include/any-linux-any/linux/netfilter/x_tables.h+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _X_TABLES_H2#ifndef _X_TABLES_H
3#define _X_TABLES_H3#define _X_TABLES_H
4#include <linux/kernel.h>4#include <linux/const.h>
5#include <linux/types.h>5#include <linux/types.h>
66
7#define XT_FUNCTION_MAXNAMELEN 307#define XT_FUNCTION_MAXNAMELEN 30
lib/libc/include/any-linux-any/linux/netfilter/xt_CONNMARK.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XT_CONNMARK_H_target
3#define _XT_CONNMARK_H_target
4
5#include <linux/netfilter/xt_connmark.h>
6
7#endif /*_XT_CONNMARK_H_target*/
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_DSCP.h created+27
...@@ -0,0 +1,27 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* x_tables module for setting the IPv4/IPv6 DSCP field
3 *
4 * (C) 2002 Harald Welte <laforge@gnumonks.org>
5 * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
6 * This software is distributed under GNU GPL v2, 1991
7 *
8 * See RFC2474 for a description of the DSCP field within the IP Header.
9 *
10 * xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
11*/
12#ifndef _XT_DSCP_TARGET_H
13#define _XT_DSCP_TARGET_H
14#include <linux/netfilter/xt_dscp.h>
15#include <linux/types.h>
16
17/* target info */
18struct xt_DSCP_info {
19 __u8 dscp;
20};
21
22struct xt_tos_target_info {
23 __u8 tos_value;
24 __u8 tos_mask;
25};
26
27#endif /* _XT_DSCP_TARGET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_IDLETIMER.h+12-1
...@@ -1,4 +1,3 @@...@@ -1,4 +1,3 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*1/*
3 * linux/include/linux/netfilter/xt_IDLETIMER.h2 * linux/include/linux/netfilter/xt_IDLETIMER.h
4 *3 *
...@@ -33,6 +32,7 @@...@@ -33,6 +32,7 @@
33#include <linux/types.h>32#include <linux/types.h>
3433
35#define MAX_IDLETIMER_LABEL_SIZE 2834#define MAX_IDLETIMER_LABEL_SIZE 28
35#define XT_IDLETIMER_ALARM 0x01
3636
37struct idletimer_tg_info {37struct idletimer_tg_info {
38 __u32 timeout;38 __u32 timeout;
...@@ -43,4 +43,15 @@ struct idletimer_tg_info {...@@ -43,4 +43,15 @@ struct idletimer_tg_info {
43 struct idletimer_tg *timer __attribute__((aligned(8)));43 struct idletimer_tg *timer __attribute__((aligned(8)));
44};44};
4545
46struct idletimer_tg_info_v1 {
47 __u32 timeout;
48
49 char label[MAX_IDLETIMER_LABEL_SIZE];
50
51 __u8 send_nl_msg; /* unused: for compatibility with Android */
52 __u8 timer_type;
53
54 /* for kernel module internal use only */
55 struct idletimer_tg *timer __attribute__((aligned(8)));
56};
46#endif57#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_MARK.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XT_MARK_H_target
3#define _XT_MARK_H_target
4
5#include <linux/netfilter/xt_mark.h>
6
7#endif /*_XT_MARK_H_target */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_RATEEST.h created+17
...@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XT_RATEEST_TARGET_H
3#define _XT_RATEEST_TARGET_H
4
5#include <linux/types.h>
6#include <linux/if.h>
7
8struct xt_rateest_target_info {
9 char name[IFNAMSIZ];
10 __s8 interval;
11 __u8 ewma_log;
12
13 /* Used internally by the kernel */
14 struct xt_rateest *est __attribute__((aligned(8)));
15};
16
17#endif /* _XT_RATEEST_TARGET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_SECMARK.h+6
...@@ -20,4 +20,10 @@ struct xt_secmark_target_info {...@@ -20,4 +20,10 @@ struct xt_secmark_target_info {
20 char secctx[SECMARK_SECCTX_MAX];20 char secctx[SECMARK_SECCTX_MAX];
21};21};
2222
23struct xt_secmark_target_info_v1 {
24 __u8 mode;
25 char secctx[SECMARK_SECCTX_MAX];
26 __u32 secid;
27};
28
23#endif /*_XT_SECMARK_H_target */29#endif /*_XT_SECMARK_H_target */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_SYNPROXY.h+7-11
...@@ -2,18 +2,14 @@...@@ -2,18 +2,14 @@
2#ifndef _XT_SYNPROXY_H2#ifndef _XT_SYNPROXY_H
3#define _XT_SYNPROXY_H3#define _XT_SYNPROXY_H
44
5#include <linux/types.h>5#include <linux/netfilter/nf_synproxy.h>
66
7#define XT_SYNPROXY_OPT_MSS 0x017#define XT_SYNPROXY_OPT_MSS NF_SYNPROXY_OPT_MSS
8#define XT_SYNPROXY_OPT_WSCALE 0x028#define XT_SYNPROXY_OPT_WSCALE NF_SYNPROXY_OPT_WSCALE
9#define XT_SYNPROXY_OPT_SACK_PERM 0x049#define XT_SYNPROXY_OPT_SACK_PERM NF_SYNPROXY_OPT_SACK_PERM
10#define XT_SYNPROXY_OPT_TIMESTAMP 0x0810#define XT_SYNPROXY_OPT_TIMESTAMP NF_SYNPROXY_OPT_TIMESTAMP
11#define XT_SYNPROXY_OPT_ECN 0x1011#define XT_SYNPROXY_OPT_ECN NF_SYNPROXY_OPT_ECN
1212
13struct xt_synproxy_info {13#define xt_synproxy_info nf_synproxy_info
14 __u8 options;
15 __u8 wscale;
16 __u16 mss;
17};
1814
19#endif /* _XT_SYNPROXY_H */15#endif /* _XT_SYNPROXY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_TCPMSS.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XT_TCPMSS_H
3#define _XT_TCPMSS_H
4
5#include <linux/types.h>
6
7struct xt_tcpmss_info {
8 __u16 mss;
9};
10
11#define XT_TCPMSS_CLAMP_PMTU 0xffff
12
13#endif /* _XT_TCPMSS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_cgroup.h+16
...@@ -22,4 +22,20 @@ struct xt_cgroup_info_v1 {...@@ -22,4 +22,20 @@ struct xt_cgroup_info_v1 {
22 void *priv __attribute__((aligned(8)));22 void *priv __attribute__((aligned(8)));
23};23};
2424
25#define XT_CGROUP_PATH_MAX 512
26
27struct xt_cgroup_info_v2 {
28 __u8 has_path;
29 __u8 has_classid;
30 __u8 invert_path;
31 __u8 invert_classid;
32 union {
33 char path[XT_CGROUP_PATH_MAX];
34 __u32 classid;
35 };
36
37 /* kernel internal data */
38 void *priv __attribute__((aligned(8)));
39};
40
25#endif /* _XT_CGROUP_H */41#endif /* _XT_CGROUP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_connlabel.h+7-1
...@@ -1,4 +1,8 @@...@@ -1,4 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _XT_CONNLABEL_H
4#define _XT_CONNLABEL_H
5
2#include <linux/types.h>6#include <linux/types.h>
37
4#define XT_CONNLABEL_MAXBIT 1278#define XT_CONNLABEL_MAXBIT 127
...@@ -10,4 +14,6 @@ enum xt_connlabel_mtopts {...@@ -10,4 +14,6 @@ enum xt_connlabel_mtopts {
10struct xt_connlabel_mtinfo {14struct xt_connlabel_mtinfo {
11 __u16 bit;15 __u16 bit;
12 __u16 options;16 __u16 options;
13};
\ No newline at end of file
17};
18
19#endif /* _XT_CONNLABEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_connmark.h+1-1
...@@ -4,7 +4,7 @@...@@ -4,7 +4,7 @@
44
5#include <linux/types.h>5#include <linux/types.h>
66
7/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>7/* Copyright (C) 2002,2004 MARA Systems AB <https://www.marasystems.com>
8 * by Henrik Nordstrom <hno@marasystems.com>8 * by Henrik Nordstrom <hno@marasystems.com>
9 *9 *
10 * This program is free software; you can redistribute it and/or modify10 * This program is free software; you can redistribute it and/or modify
lib/libc/include/any-linux-any/linux/netfilter/xt_nfacct.h+5
...@@ -11,4 +11,9 @@ struct xt_nfacct_match_info {...@@ -11,4 +11,9 @@ struct xt_nfacct_match_info {
11 struct nf_acct *nfacct;11 struct nf_acct *nfacct;
12};12};
1313
14struct xt_nfacct_match_info_v1 {
15 char name[NFACCT_NAME_MAX];
16 struct nf_acct *nfacct __attribute__((aligned(8)));
17};
18
14#endif /* _XT_NFACCT_MATCH_H */19#endif /* _XT_NFACCT_MATCH_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/xt_owner.h+9-3
...@@ -5,11 +5,17 @@...@@ -5,11 +5,17 @@
5#include <linux/types.h>5#include <linux/types.h>
66
7enum {7enum {
8 XT_OWNER_UID = 1 << 0,8 XT_OWNER_UID = 1 << 0,
9 XT_OWNER_GID = 1 << 1,9 XT_OWNER_GID = 1 << 1,
10 XT_OWNER_SOCKET = 1 << 2,10 XT_OWNER_SOCKET = 1 << 2,
11 XT_OWNER_SUPPL_GROUPS = 1 << 3,
11};12};
1213
14#define XT_OWNER_MASK (XT_OWNER_UID | \
15 XT_OWNER_GID | \
16 XT_OWNER_SOCKET | \
17 XT_OWNER_SUPPL_GROUPS)
18
13struct xt_owner_match_info {19struct xt_owner_match_info {
14 __u32 uid_min, uid_max;20 __u32 uid_min, uid_max;
15 __u32 gid_min, gid_max;21 __u32 gid_min, gid_max;
lib/libc/include/any-linux-any/linux/netfilter/xt_policy.h+1
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef _XT_POLICY_H2#ifndef _XT_POLICY_H
3#define _XT_POLICY_H3#define _XT_POLICY_H
44
5#include <linux/netfilter.h>
5#include <linux/types.h>6#include <linux/types.h>
6#include <linux/in.h>7#include <linux/in.h>
7#include <linux/in6.h>8#include <linux/in6.h>
lib/libc/include/any-linux-any/linux/netfilter/xt_sctp.h+3-3
...@@ -41,19 +41,19 @@ struct xt_sctp_info {...@@ -41,19 +41,19 @@ struct xt_sctp_info {
41#define SCTP_CHUNKMAP_SET(chunkmap, type) \41#define SCTP_CHUNKMAP_SET(chunkmap, type) \
42 do { \42 do { \
43 (chunkmap)[type / bytes(__u32)] |= \43 (chunkmap)[type / bytes(__u32)] |= \
44 1 << (type % bytes(__u32)); \44 1u << (type % bytes(__u32)); \
45 } while (0)45 } while (0)
4646
47#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \47#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
48 do { \48 do { \
49 (chunkmap)[type / bytes(__u32)] &= \49 (chunkmap)[type / bytes(__u32)] &= \
50 ~(1 << (type % bytes(__u32))); \50 ~(1u << (type % bytes(__u32))); \
51 } while (0)51 } while (0)
5252
53#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \53#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
54({ \54({ \
55 ((chunkmap)[type / bytes (__u32)] & \55 ((chunkmap)[type / bytes (__u32)] & \
56 (1 << (type % bytes (__u32)))) ? 1: 0; \56 (1u << (type % bytes (__u32)))) ? 1: 0; \
57})57})
5858
59#define SCTP_CHUNKMAP_RESET(chunkmap) \59#define SCTP_CHUNKMAP_RESET(chunkmap) \
lib/libc/include/any-linux-any/linux/netfilter_arp/arp_tables.h+1-1
...@@ -197,7 +197,7 @@ struct arpt_get_entries {...@@ -197,7 +197,7 @@ struct arpt_get_entries {
197/* Helper functions */197/* Helper functions */
198static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)198static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
199{199{
200 return (void *)e + e->target_offset;200 return (struct xt_entry_target *)((char *)e + e->target_offset);
201}201}
202202
203/*203/*
lib/libc/include/any-linux-any/linux/netfilter_bridge/ebtables.h+4-4
...@@ -123,7 +123,7 @@ struct ebt_entry_match {...@@ -123,7 +123,7 @@ struct ebt_entry_match {
123 union {123 union {
124 struct {124 struct {
125 char name[EBT_EXTENSION_MAXNAMELEN];125 char name[EBT_EXTENSION_MAXNAMELEN];
126 uint8_t revision;126 __u8 revision;
127 };127 };
128 struct xt_match *match;128 struct xt_match *match;
129 } u;129 } u;
...@@ -136,7 +136,7 @@ struct ebt_entry_watcher {...@@ -136,7 +136,7 @@ struct ebt_entry_watcher {
136 union {136 union {
137 struct {137 struct {
138 char name[EBT_EXTENSION_MAXNAMELEN];138 char name[EBT_EXTENSION_MAXNAMELEN];
139 uint8_t revision;139 __u8 revision;
140 };140 };
141 struct xt_target *watcher;141 struct xt_target *watcher;
142 } u;142 } u;
...@@ -149,7 +149,7 @@ struct ebt_entry_target {...@@ -149,7 +149,7 @@ struct ebt_entry_target {
149 union {149 union {
150 struct {150 struct {
151 char name[EBT_EXTENSION_MAXNAMELEN];151 char name[EBT_EXTENSION_MAXNAMELEN];
152 uint8_t revision;152 __u8 revision;
153 };153 };
154 struct xt_target *target;154 struct xt_target *target;
155 } u;155 } u;
...@@ -194,7 +194,7 @@ struct ebt_entry {...@@ -194,7 +194,7 @@ struct ebt_entry {
194static __inline__ struct ebt_entry_target *194static __inline__ struct ebt_entry_target *
195ebt_get_target(struct ebt_entry *e)195ebt_get_target(struct ebt_entry *e)
196{196{
197 return (void *)e + e->target_offset;197 return (struct ebt_entry_target *)((char *)e + e->target_offset);
198}198}
199199
200/* {g,s}etsockopt numbers */200/* {g,s}etsockopt numbers */
lib/libc/include/any-linux-any/linux/netfilter_decnet.h-10
...@@ -14,16 +14,6 @@...@@ -14,16 +14,6 @@
1414
15#include <limits.h> /* for INT_MIN, INT_MAX */15#include <limits.h> /* for INT_MIN, INT_MAX */
1616
17/* IP Cache bits. */
18/* Src IP address. */
19#define NFC_DN_SRC 0x0001
20/* Dest IP address. */
21#define NFC_DN_DST 0x0002
22/* Input device. */
23#define NFC_DN_IF_IN 0x0004
24/* Output device. */
25#define NFC_DN_IF_OUT 0x0008
26
27/* kernel define is in netfilter_defs.h */17/* kernel define is in netfilter_defs.h */
28#define NF_DN_NUMHOOKS 718#define NF_DN_NUMHOOKS 7
2919
lib/libc/include/any-linux-any/linux/netfilter_ipv4.h-28
...@@ -12,34 +12,6 @@...@@ -12,34 +12,6 @@
1212
13#include <limits.h> /* for INT_MIN, INT_MAX */13#include <limits.h> /* for INT_MIN, INT_MAX */
1414
15/* IP Cache bits. */
16/* Src IP address. */
17#define NFC_IP_SRC 0x0001
18/* Dest IP address. */
19#define NFC_IP_DST 0x0002
20/* Input device. */
21#define NFC_IP_IF_IN 0x0004
22/* Output device. */
23#define NFC_IP_IF_OUT 0x0008
24/* TOS. */
25#define NFC_IP_TOS 0x0010
26/* Protocol. */
27#define NFC_IP_PROTO 0x0020
28/* IP options. */
29#define NFC_IP_OPTIONS 0x0040
30/* Frag & flags. */
31#define NFC_IP_FRAG 0x0080
32
33/* Per-protocol information: only matters if proto match. */
34/* TCP flags. */
35#define NFC_IP_TCPFLAGS 0x0100
36/* Source port. */
37#define NFC_IP_SRC_PT 0x0200
38/* Dest port. */
39#define NFC_IP_DST_PT 0x0400
40/* Something else about the proto */
41#define NFC_IP_PROTO_UNKNOWN 0x2000
42
43/* IP Hooks */15/* IP Hooks */
44/* After promisc drops, checksum checks. */16/* After promisc drops, checksum checks. */
45#define NF_IP_PRE_ROUTING 017#define NF_IP_PRE_ROUTING 0
lib/libc/include/any-linux-any/linux/netfilter_ipv4/ip_tables.h+1-1
...@@ -220,7 +220,7 @@ struct ipt_get_entries {...@@ -220,7 +220,7 @@ struct ipt_get_entries {
220static __inline__ struct xt_entry_target *220static __inline__ struct xt_entry_target *
221ipt_get_target(struct ipt_entry *e)221ipt_get_target(struct ipt_entry *e)
222{222{
223 return (void *)e + e->target_offset;223 return (struct xt_entry_target *)((char *)e + e->target_offset);
224}224}
225225
226/*226/*
lib/libc/include/any-linux-any/linux/netfilter_ipv4/ipt_ECN.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Header file for iptables ipt_ECN target
3 *
4 * (C) 2002 by Harald Welte <laforge@gnumonks.org>
5 *
6 * This software is distributed under GNU GPL v2, 1991
7 *
8 * ipt_ECN.h,v 1.3 2002/05/29 12:17:40 laforge Exp
9*/
10#ifndef _IPT_ECN_TARGET_H
11#define _IPT_ECN_TARGET_H
12
13#include <linux/types.h>
14#include <linux/netfilter/xt_DSCP.h>
15
16#define IPT_ECN_IP_MASK (~XT_DSCP_MASK)
17
18#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */
19#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */
20#define IPT_ECN_OP_SET_CWR 0x20 /* set CWR bit of TCP header */
21
22#define IPT_ECN_OP_MASK 0xce
23
24struct ipt_ECN_info {
25 __u8 operation; /* bitset of operations */
26 __u8 ip_ect; /* ECT codepoint of IPv4 header, pre-shifted */
27 union {
28 struct {
29 __u8 ece:1, cwr:1; /* TCP ECT bits */
30 } tcp;
31 } proto;
32};
33
34#endif /* _IPT_ECN_TARGET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter_ipv4/ipt_LOG.h-2
...@@ -2,8 +2,6 @@...@@ -2,8 +2,6 @@
2#ifndef _IPT_LOG_H2#ifndef _IPT_LOG_H
3#define _IPT_LOG_H3#define _IPT_LOG_H
44
5#warning "Please update iptables, this file will be removed soon!"
6
7/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */5/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
8#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */6#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
9#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */7#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
lib/libc/include/any-linux-any/linux/netfilter_ipv4/ipt_TTL.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* TTL modification module for IP tables
3 * (C) 2000 by Harald Welte <laforge@netfilter.org> */
4
5#ifndef _IPT_TTL_H
6#define _IPT_TTL_H
7
8#include <linux/types.h>
9
10enum {
11 IPT_TTL_SET = 0,
12 IPT_TTL_INC,
13 IPT_TTL_DEC
14};
15
16#define IPT_TTL_MAXMODE IPT_TTL_DEC
17
18struct ipt_TTL_info {
19 __u8 mode;
20 __u8 ttl;
21};
22
23
24#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter_ipv6.h-29
...@@ -15,35 +15,6 @@...@@ -15,35 +15,6 @@
1515
16#include <limits.h> /* for INT_MIN, INT_MAX */16#include <limits.h> /* for INT_MIN, INT_MAX */
1717
18/* IP Cache bits. */
19/* Src IP address. */
20#define NFC_IP6_SRC 0x0001
21/* Dest IP address. */
22#define NFC_IP6_DST 0x0002
23/* Input device. */
24#define NFC_IP6_IF_IN 0x0004
25/* Output device. */
26#define NFC_IP6_IF_OUT 0x0008
27/* TOS. */
28#define NFC_IP6_TOS 0x0010
29/* Protocol. */
30#define NFC_IP6_PROTO 0x0020
31/* IP options. */
32#define NFC_IP6_OPTIONS 0x0040
33/* Frag & flags. */
34#define NFC_IP6_FRAG 0x0080
35
36
37/* Per-protocol information: only matters if proto match. */
38/* TCP flags. */
39#define NFC_IP6_TCPFLAGS 0x0100
40/* Source port. */
41#define NFC_IP6_SRC_PT 0x0200
42/* Dest port. */
43#define NFC_IP6_DST_PT 0x0400
44/* Something else about the proto */
45#define NFC_IP6_PROTO_UNKNOWN 0x2000
46
47/* IP6 Hooks */18/* IP6 Hooks */
48/* After promisc drops, checksum checks. */19/* After promisc drops, checksum checks. */
49#define NF_IP6_PRE_ROUTING 020#define NF_IP6_PRE_ROUTING 0
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6_tables.h+1-1
...@@ -260,7 +260,7 @@ struct ip6t_get_entries {...@@ -260,7 +260,7 @@ struct ip6t_get_entries {
260static __inline__ struct xt_entry_target *260static __inline__ struct xt_entry_target *
261ip6t_get_target(struct ip6t_entry *e)261ip6t_get_target(struct ip6t_entry *e)
262{262{
263 return (void *)e + e->target_offset;263 return (struct xt_entry_target *)((char *)e + e->target_offset);
264}264}
265265
266/*266/*
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6t_HL.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Hop Limit modification module for ip6tables
3 * Maciej Soltysiak <solt@dns.toxicfilms.tv>
4 * Based on HW's TTL module */
5
6#ifndef _IP6T_HL_H
7#define _IP6T_HL_H
8
9#include <linux/types.h>
10
11enum {
12 IP6T_HL_SET = 0,
13 IP6T_HL_INC,
14 IP6T_HL_DEC
15};
16
17#define IP6T_HL_MAXMODE IP6T_HL_DEC
18
19struct ip6t_HL_info {
20 __u8 mode;
21 __u8 hop_limit;
22};
23
24
25#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6t_LOG.h-2
...@@ -2,8 +2,6 @@...@@ -2,8 +2,6 @@
2#ifndef _IP6T_LOG_H2#ifndef _IP6T_LOG_H
3#define _IP6T_LOG_H3#define _IP6T_LOG_H
44
5#warning "Please update iptables, this file will be removed soon!"
6
7/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */5/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
8#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */6#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
9#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */7#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
lib/libc/include/any-linux-any/linux/netlink.h+112-3
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2#ifndef __LINUX_NETLINK_H2#ifndef __LINUX_NETLINK_H
3#define __LINUX_NETLINK_H3#define __LINUX_NETLINK_H
44
5#include <linux/kernel.h>5#include <linux/const.h>
6#include <linux/socket.h> /* for __kernel_sa_family_t */6#include <linux/socket.h> /* for __kernel_sa_family_t */
7#include <linux/types.h>7#include <linux/types.h>
88
...@@ -91,9 +91,10 @@ struct nlmsghdr {...@@ -91,9 +91,10 @@ struct nlmsghdr {
91#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))91#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
92#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)92#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
93#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))93#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
94#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))94#define NLMSG_DATA(nlh) ((void *)(((char *)nlh) + NLMSG_HDRLEN))
95#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \95#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))96 (struct nlmsghdr *)(((char *)(nlh)) + \
97 NLMSG_ALIGN((nlh)->nlmsg_len)))
97#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \98#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \99 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
99 (nlh)->nlmsg_len <= (len))100 (nlh)->nlmsg_len <= (len))
...@@ -129,6 +130,7 @@ struct nlmsgerr {...@@ -129,6 +130,7 @@ struct nlmsgerr {
129 * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to130 * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to
130 * be used - in the success case - to identify a created131 * be used - in the success case - to identify a created
131 * object or operation or similar (binary)132 * object or operation or similar (binary)
133 * @NLMSGERR_ATTR_POLICY: policy for a rejected attribute
132 * @__NLMSGERR_ATTR_MAX: number of attributes134 * @__NLMSGERR_ATTR_MAX: number of attributes
133 * @NLMSGERR_ATTR_MAX: highest attribute number135 * @NLMSGERR_ATTR_MAX: highest attribute number
134 */136 */
...@@ -137,6 +139,7 @@ enum nlmsgerr_attrs {...@@ -137,6 +139,7 @@ enum nlmsgerr_attrs {
137 NLMSGERR_ATTR_MSG,139 NLMSGERR_ATTR_MSG,
138 NLMSGERR_ATTR_OFFS,140 NLMSGERR_ATTR_OFFS,
139 NLMSGERR_ATTR_COOKIE,141 NLMSGERR_ATTR_COOKIE,
142 NLMSGERR_ATTR_POLICY,
140143
141 __NLMSGERR_ATTR_MAX,144 __NLMSGERR_ATTR_MAX,
142 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1145 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
...@@ -153,6 +156,7 @@ enum nlmsgerr_attrs {...@@ -153,6 +156,7 @@ enum nlmsgerr_attrs {
153#define NETLINK_LIST_MEMBERSHIPS 9156#define NETLINK_LIST_MEMBERSHIPS 9
154#define NETLINK_CAP_ACK 10157#define NETLINK_CAP_ACK 10
155#define NETLINK_EXT_ACK 11158#define NETLINK_EXT_ACK 11
159#define NETLINK_GET_STRICT_CHK 12
156160
157struct nl_pktinfo {161struct nl_pktinfo {
158 __u32 group;162 __u32 group;
...@@ -244,4 +248,109 @@ struct nla_bitfield32 {...@@ -244,4 +248,109 @@ struct nla_bitfield32 {
244 __u32 selector;248 __u32 selector;
245};249};
246250
251/*
252 * policy descriptions - it's specific to each family how this is used
253 * Normally, it should be retrieved via a dump inside another attribute
254 * specifying where it applies.
255 */
256
257/**
258 * enum netlink_attribute_type - type of an attribute
259 * @NL_ATTR_TYPE_INVALID: unused
260 * @NL_ATTR_TYPE_FLAG: flag attribute (present/not present)
261 * @NL_ATTR_TYPE_U8: 8-bit unsigned attribute
262 * @NL_ATTR_TYPE_U16: 16-bit unsigned attribute
263 * @NL_ATTR_TYPE_U32: 32-bit unsigned attribute
264 * @NL_ATTR_TYPE_U64: 64-bit unsigned attribute
265 * @NL_ATTR_TYPE_S8: 8-bit signed attribute
266 * @NL_ATTR_TYPE_S16: 16-bit signed attribute
267 * @NL_ATTR_TYPE_S32: 32-bit signed attribute
268 * @NL_ATTR_TYPE_S64: 64-bit signed attribute
269 * @NL_ATTR_TYPE_BINARY: binary data, min/max length may be specified
270 * @NL_ATTR_TYPE_STRING: string, min/max length may be specified
271 * @NL_ATTR_TYPE_NUL_STRING: NUL-terminated string,
272 * min/max length may be specified
273 * @NL_ATTR_TYPE_NESTED: nested, i.e. the content of this attribute
274 * consists of sub-attributes. The nested policy and maxtype
275 * inside may be specified.
276 * @NL_ATTR_TYPE_NESTED_ARRAY: nested array, i.e. the content of this
277 * attribute contains sub-attributes whose type is irrelevant
278 * (just used to separate the array entries) and each such array
279 * entry has attributes again, the policy for those inner ones
280 * and the corresponding maxtype may be specified.
281 * @NL_ATTR_TYPE_BITFIELD32: &struct nla_bitfield32 attribute
282 */
283enum netlink_attribute_type {
284 NL_ATTR_TYPE_INVALID,
285
286 NL_ATTR_TYPE_FLAG,
287
288 NL_ATTR_TYPE_U8,
289 NL_ATTR_TYPE_U16,
290 NL_ATTR_TYPE_U32,
291 NL_ATTR_TYPE_U64,
292
293 NL_ATTR_TYPE_S8,
294 NL_ATTR_TYPE_S16,
295 NL_ATTR_TYPE_S32,
296 NL_ATTR_TYPE_S64,
297
298 NL_ATTR_TYPE_BINARY,
299 NL_ATTR_TYPE_STRING,
300 NL_ATTR_TYPE_NUL_STRING,
301
302 NL_ATTR_TYPE_NESTED,
303 NL_ATTR_TYPE_NESTED_ARRAY,
304
305 NL_ATTR_TYPE_BITFIELD32,
306};
307
308/**
309 * enum netlink_policy_type_attr - policy type attributes
310 * @NL_POLICY_TYPE_ATTR_UNSPEC: unused
311 * @NL_POLICY_TYPE_ATTR_TYPE: type of the attribute,
312 * &enum netlink_attribute_type (U32)
313 * @NL_POLICY_TYPE_ATTR_MIN_VALUE_S: minimum value for signed
314 * integers (S64)
315 * @NL_POLICY_TYPE_ATTR_MAX_VALUE_S: maximum value for signed
316 * integers (S64)
317 * @NL_POLICY_TYPE_ATTR_MIN_VALUE_U: minimum value for unsigned
318 * integers (U64)
319 * @NL_POLICY_TYPE_ATTR_MAX_VALUE_U: maximum value for unsigned
320 * integers (U64)
321 * @NL_POLICY_TYPE_ATTR_MIN_LENGTH: minimum length for binary
322 * attributes, no minimum if not given (U32)
323 * @NL_POLICY_TYPE_ATTR_MAX_LENGTH: maximum length for binary
324 * attributes, no maximum if not given (U32)
325 * @NL_POLICY_TYPE_ATTR_POLICY_IDX: sub policy for nested and
326 * nested array types (U32)
327 * @NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE: maximum sub policy
328 * attribute for nested and nested array types, this can
329 * in theory be < the size of the policy pointed to by
330 * the index, if limited inside the nesting (U32)
331 * @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the
332 * bitfield32 type (U32)
333 * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)
334 * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment
335 */
336enum netlink_policy_type_attr {
337 NL_POLICY_TYPE_ATTR_UNSPEC,
338 NL_POLICY_TYPE_ATTR_TYPE,
339 NL_POLICY_TYPE_ATTR_MIN_VALUE_S,
340 NL_POLICY_TYPE_ATTR_MAX_VALUE_S,
341 NL_POLICY_TYPE_ATTR_MIN_VALUE_U,
342 NL_POLICY_TYPE_ATTR_MAX_VALUE_U,
343 NL_POLICY_TYPE_ATTR_MIN_LENGTH,
344 NL_POLICY_TYPE_ATTR_MAX_LENGTH,
345 NL_POLICY_TYPE_ATTR_POLICY_IDX,
346 NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE,
347 NL_POLICY_TYPE_ATTR_BITFIELD32_MASK,
348 NL_POLICY_TYPE_ATTR_PAD,
349 NL_POLICY_TYPE_ATTR_MASK,
350
351 /* keep last */
352 __NL_POLICY_TYPE_ATTR_MAX,
353 NL_POLICY_TYPE_ATTR_MAX = __NL_POLICY_TYPE_ATTR_MAX - 1
354};
355
247#endif /* __LINUX_NETLINK_H */356#endif /* __LINUX_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nexthop.h created+104
...@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_NEXTHOP_H
3#define _LINUX_NEXTHOP_H
4
5#include <linux/types.h>
6
7struct nhmsg {
8 unsigned char nh_family;
9 unsigned char nh_scope; /* return only */
10 unsigned char nh_protocol; /* Routing protocol that installed nh */
11 unsigned char resvd;
12 unsigned int nh_flags; /* RTNH_F flags */
13};
14
15/* entry in a nexthop group */
16struct nexthop_grp {
17 __u32 id; /* nexthop id - must exist */
18 __u8 weight; /* weight of this nexthop */
19 __u8 resvd1;
20 __u16 resvd2;
21};
22
23enum {
24 NEXTHOP_GRP_TYPE_MPATH, /* hash-threshold nexthop group
25 * default type if not specified
26 */
27 NEXTHOP_GRP_TYPE_RES, /* resilient nexthop group */
28 __NEXTHOP_GRP_TYPE_MAX,
29};
30
31#define NEXTHOP_GRP_TYPE_MAX (__NEXTHOP_GRP_TYPE_MAX - 1)
32
33enum {
34 NHA_UNSPEC,
35 NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */
36
37 NHA_GROUP, /* array of nexthop_grp */
38 NHA_GROUP_TYPE, /* u16 one of NEXTHOP_GRP_TYPE */
39 /* if NHA_GROUP attribute is added, no other attributes can be set */
40
41 NHA_BLACKHOLE, /* flag; nexthop used to blackhole packets */
42 /* if NHA_BLACKHOLE is added, OIF, GATEWAY, ENCAP can not be set */
43
44 NHA_OIF, /* u32; nexthop device */
45 NHA_GATEWAY, /* be32 (IPv4) or in6_addr (IPv6) gw address */
46 NHA_ENCAP_TYPE, /* u16; lwt encap type */
47 NHA_ENCAP, /* lwt encap data */
48
49 /* NHA_OIF can be appended to dump request to return only
50 * nexthops using given device
51 */
52 NHA_GROUPS, /* flag; only return nexthop groups in dump */
53 NHA_MASTER, /* u32; only return nexthops with given master dev */
54
55 NHA_FDB, /* flag; nexthop belongs to a bridge fdb */
56 /* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */
57
58 /* nested; resilient nexthop group attributes */
59 NHA_RES_GROUP,
60 /* nested; nexthop bucket attributes */
61 NHA_RES_BUCKET,
62
63 __NHA_MAX,
64};
65
66#define NHA_MAX (__NHA_MAX - 1)
67
68enum {
69 NHA_RES_GROUP_UNSPEC,
70 /* Pad attribute for 64-bit alignment. */
71 NHA_RES_GROUP_PAD = NHA_RES_GROUP_UNSPEC,
72
73 /* u16; number of nexthop buckets in a resilient nexthop group */
74 NHA_RES_GROUP_BUCKETS,
75 /* clock_t as u32; nexthop bucket idle timer (per-group) */
76 NHA_RES_GROUP_IDLE_TIMER,
77 /* clock_t as u32; nexthop unbalanced timer */
78 NHA_RES_GROUP_UNBALANCED_TIMER,
79 /* clock_t as u64; nexthop unbalanced time */
80 NHA_RES_GROUP_UNBALANCED_TIME,
81
82 __NHA_RES_GROUP_MAX,
83};
84
85#define NHA_RES_GROUP_MAX (__NHA_RES_GROUP_MAX - 1)
86
87enum {
88 NHA_RES_BUCKET_UNSPEC,
89 /* Pad attribute for 64-bit alignment. */
90 NHA_RES_BUCKET_PAD = NHA_RES_BUCKET_UNSPEC,
91
92 /* u16; nexthop bucket index */
93 NHA_RES_BUCKET_INDEX,
94 /* clock_t as u64; nexthop bucket idle time */
95 NHA_RES_BUCKET_IDLE_TIME,
96 /* u32; nexthop id assigned to the nexthop bucket */
97 NHA_RES_BUCKET_NH_ID,
98
99 __NHA_RES_BUCKET_MAX,
100};
101
102#define NHA_RES_BUCKET_MAX (__NHA_RES_BUCKET_MAX - 1)
103
104#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfs3.h+6
...@@ -63,6 +63,12 @@ enum nfs3_ftype {...@@ -63,6 +63,12 @@ enum nfs3_ftype {
63 NF3BAD = 863 NF3BAD = 8
64};64};
6565
66enum nfs3_time_how {
67 DONT_CHANGE = 0,
68 SET_TO_SERVER_TIME = 1,
69 SET_TO_CLIENT_TIME = 2,
70};
71
66struct nfs3_fh {72struct nfs3_fh {
67 unsigned short size;73 unsigned short size;
68 unsigned char data[NFS3_FHSIZE];74 unsigned char data[NFS3_FHSIZE];
lib/libc/include/any-linux-any/linux/nfs4.h+7-7
...@@ -33,6 +33,9 @@...@@ -33,6 +33,9 @@
33#define NFS4_ACCESS_EXTEND 0x000833#define NFS4_ACCESS_EXTEND 0x0008
34#define NFS4_ACCESS_DELETE 0x001034#define NFS4_ACCESS_DELETE 0x0010
35#define NFS4_ACCESS_EXECUTE 0x002035#define NFS4_ACCESS_EXECUTE 0x0020
36#define NFS4_ACCESS_XAREAD 0x0040
37#define NFS4_ACCESS_XAWRITE 0x0080
38#define NFS4_ACCESS_XALIST 0x0100
3639
37#define NFS4_FH_PERSISTENT 0x000040#define NFS4_FH_PERSISTENT 0x0000
38#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x000141#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
...@@ -136,6 +139,8 @@...@@ -136,6 +139,8 @@
136139
137#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000140#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
138#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000141#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
142
143#define EXCHGID4_FLAG_SUPP_FENCE_OPS 0x00000004
139/*144/*
140 * Since the validity of these bits depends on whether145 * Since the validity of these bits depends on whether
141 * they're set in the argument or response, have separate146 * they're set in the argument or response, have separate
...@@ -143,6 +148,7 @@...@@ -143,6 +148,7 @@
143 */148 */
144#define EXCHGID4_FLAG_MASK_A 0x40070103149#define EXCHGID4_FLAG_MASK_A 0x40070103
145#define EXCHGID4_FLAG_MASK_R 0x80070103150#define EXCHGID4_FLAG_MASK_R 0x80070103
151#define EXCHGID4_2_FLAG_MASK_R 0x80070107
146152
147#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001153#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
148#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002154#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
...@@ -171,10 +177,4 @@...@@ -171,10 +177,4 @@
171 */177 */
172#define NFS4_MAX_BACK_CHANNEL_OPS 2178#define NFS4_MAX_BACK_CHANNEL_OPS 2
173179
174#endif /* _LINUX_NFS4_H */
175
176/*
177 * Local variables:
178 * c-basic-offset: 8
179 * End:
180 */
\ No newline at end of file
180#endif /* _LINUX_NFS4_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfs_fs.h+1
...@@ -56,6 +56,7 @@...@@ -56,6 +56,7 @@
56#define NFSDBG_PNFS 0x100056#define NFSDBG_PNFS 0x1000
57#define NFSDBG_PNFS_LD 0x200057#define NFSDBG_PNFS_LD 0x2000
58#define NFSDBG_STATE 0x400058#define NFSDBG_STATE 0x4000
59#define NFSDBG_XATTRCACHE 0x8000
59#define NFSDBG_ALL 0xFFFF60#define NFSDBG_ALL 0xFFFF
6061
6162
lib/libc/include/any-linux-any/linux/nfs_mount.h-9
...@@ -66,13 +66,4 @@ struct nfs_mount_data {...@@ -66,13 +66,4 @@ struct nfs_mount_data {
66#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */66#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
67#define NFS_MOUNT_FLAGMASK 0xFFFF67#define NFS_MOUNT_FLAGMASK 0xFFFF
6868
69/* The following are for internal use only */
70#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000
71#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000
72#define NFS_MOUNT_NORESVPORT 0x40000
73#define NFS_MOUNT_LEGACY_INTERFACE 0x80000
74
75#define NFS_MOUNT_LOCAL_FLOCK 0x100000
76#define NFS_MOUNT_LOCAL_FCNTL 0x200000
77
78#endif69#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfsacl.h+2
...@@ -9,11 +9,13 @@...@@ -9,11 +9,13 @@
99
10#define NFS_ACL_PROGRAM 10022710#define NFS_ACL_PROGRAM 100227
1111
12#define ACLPROC2_NULL 0
12#define ACLPROC2_GETACL 113#define ACLPROC2_GETACL 1
13#define ACLPROC2_SETACL 214#define ACLPROC2_SETACL 2
14#define ACLPROC2_GETATTR 315#define ACLPROC2_GETATTR 3
15#define ACLPROC2_ACCESS 416#define ACLPROC2_ACCESS 4
1617
18#define ACLPROC3_NULL 0
17#define ACLPROC3_GETACL 119#define ACLPROC3_GETACL 1
18#define ACLPROC3_SETACL 220#define ACLPROC3_SETACL 2
1921
lib/libc/include/any-linux-any/linux/nfsd/cld.h+39-1
...@@ -26,16 +26,22 @@...@@ -26,16 +26,22 @@
26#include <linux/types.h>26#include <linux/types.h>
2727
28/* latest upcall version available */28/* latest upcall version available */
29#define CLD_UPCALL_VERSION 129#define CLD_UPCALL_VERSION 2
3030
31/* defined by RFC3530 */31/* defined by RFC3530 */
32#define NFS4_OPAQUE_LIMIT 102432#define NFS4_OPAQUE_LIMIT 1024
3333
34#ifndef SHA256_DIGEST_SIZE
35#define SHA256_DIGEST_SIZE 32
36#endif
37
34enum cld_command {38enum cld_command {
35 Cld_Create, /* create a record for this cm_id */39 Cld_Create, /* create a record for this cm_id */
36 Cld_Remove, /* remove record of this cm_id */40 Cld_Remove, /* remove record of this cm_id */
37 Cld_Check, /* is this cm_id allowed? */41 Cld_Check, /* is this cm_id allowed? */
38 Cld_GraceDone, /* grace period is complete */42 Cld_GraceDone, /* grace period is complete */
43 Cld_GraceStart, /* grace start (upload client records) */
44 Cld_GetVersion, /* query max supported upcall version */
39};45};
4046
41/* representation of long-form NFSv4 client ID */47/* representation of long-form NFSv4 client ID */
...@@ -44,6 +50,17 @@ struct cld_name {...@@ -44,6 +50,17 @@ struct cld_name {
44 unsigned char cn_id[NFS4_OPAQUE_LIMIT]; /* client-provided */50 unsigned char cn_id[NFS4_OPAQUE_LIMIT]; /* client-provided */
45} __attribute__((packed));51} __attribute__((packed));
4652
53/* sha256 hash of the kerberos principal */
54struct cld_princhash {
55 __u8 cp_len; /* length of cp_data */
56 unsigned char cp_data[SHA256_DIGEST_SIZE]; /* hash of principal */
57} __attribute__((packed));
58
59struct cld_clntinfo {
60 struct cld_name cc_name;
61 struct cld_princhash cc_princhash;
62} __attribute__((packed));
63
47/* message struct for communication with userspace */64/* message struct for communication with userspace */
48struct cld_msg {65struct cld_msg {
49 __u8 cm_vers; /* upcall version */66 __u8 cm_vers; /* upcall version */
...@@ -53,7 +70,28 @@ struct cld_msg {...@@ -53,7 +70,28 @@ struct cld_msg {
53 union {70 union {
54 __s64 cm_gracetime; /* grace period start time */71 __s64 cm_gracetime; /* grace period start time */
55 struct cld_name cm_name;72 struct cld_name cm_name;
73 __u8 cm_version; /* for getting max version */
74 } __attribute__((packed)) cm_u;
75} __attribute__((packed));
76
77/* version 2 message can include hash of kerberos principal */
78struct cld_msg_v2 {
79 __u8 cm_vers; /* upcall version */
80 __u8 cm_cmd; /* upcall command */
81 __s16 cm_status; /* return code */
82 __u32 cm_xid; /* transaction id */
83 union {
84 struct cld_name cm_name;
85 __u8 cm_version; /* for getting max version */
86 struct cld_clntinfo cm_clntinfo; /* name & princ hash */
56 } __attribute__((packed)) cm_u;87 } __attribute__((packed)) cm_u;
57} __attribute__((packed));88} __attribute__((packed));
5889
90struct cld_msg_hdr {
91 __u8 cm_vers; /* upcall version */
92 __u8 cm_cmd; /* upcall command */
93 __s16 cm_status; /* return code */
94 __u32 cm_xid; /* transaction id */
95} __attribute__((packed));
96
59#endif /* !_NFSD_CLD_H */97#endif /* !_NFSD_CLD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfsd/nfsfh.h deleted-105
...@@ -1,105 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file describes the layout of the file handles as passed
4 * over the wire.
5 *
6 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _LINUX_NFSD_FH_H
10#define _LINUX_NFSD_FH_H
11
12#include <linux/types.h>
13#include <linux/nfs.h>
14#include <linux/nfs2.h>
15#include <linux/nfs3.h>
16#include <linux/nfs4.h>
17
18/*
19 * This is the old "dentry style" Linux NFSv2 file handle.
20 *
21 * The xino and xdev fields are currently used to transport the
22 * ino/dev of the exported inode.
23 */
24struct nfs_fhbase_old {
25 __u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
26 __u32 fb_ino; /* our inode number */
27 __u32 fb_dirino; /* dir inode number, 0 for directories */
28 __u32 fb_dev; /* our device */
29 __u32 fb_xdev;
30 __u32 fb_xino;
31 __u32 fb_generation;
32};
33
34/*
35 * This is the new flexible, extensible style NFSv2/v3/v4 file handle.
36 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
37 *
38 * The file handle starts with a sequence of four-byte words.
39 * The first word contains a version number (1) and three descriptor bytes
40 * that tell how the remaining 3 variable length fields should be handled.
41 * These three bytes are auth_type, fsid_type and fileid_type.
42 *
43 * All four-byte values are in host-byte-order.
44 *
45 * The auth_type field is deprecated and must be set to 0.
46 *
47 * The fsid_type identifies how the filesystem (or export point) is
48 * encoded.
49 * Current values:
50 * 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
51 * NOTE: we cannot use the kdev_t device id value, because kdev_t.h
52 * says we mustn't. We must break it up and reassemble.
53 * 1 - 4 byte user specified identifier
54 * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
55 * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
56 * 4 - 4 byte inode number and 4 byte uuid
57 * 5 - 8 byte uuid
58 * 6 - 16 byte uuid
59 * 7 - 8 byte inode number and 16 byte uuid
60 *
61 * The fileid_type identified how the file within the filesystem is encoded.
62 * The values for this field are filesystem specific, exccept that
63 * filesystems must not use the values '0' or '0xff'. 'See enum fid_type'
64 * in include/linux/exportfs.h for currently registered values.
65 */
66struct nfs_fhbase_new {
67 __u8 fb_version; /* == 1, even => nfs_fhbase_old */
68 __u8 fb_auth_type;
69 __u8 fb_fsid_type;
70 __u8 fb_fileid_type;
71 __u32 fb_auth[1];
72/* __u32 fb_fsid[0]; floating */
73/* __u32 fb_fileid[0]; floating */
74};
75
76struct knfsd_fh {
77 unsigned int fh_size; /* significant for NFSv3.
78 * Points to the current size while building
79 * a new file handle
80 */
81 union {
82 struct nfs_fhbase_old fh_old;
83 __u32 fh_pad[NFS4_FHSIZE/4];
84 struct nfs_fhbase_new fh_new;
85 } fh_base;
86};
87
88#define ofh_dcookie fh_base.fh_old.fb_dcookie
89#define ofh_ino fh_base.fh_old.fb_ino
90#define ofh_dirino fh_base.fh_old.fb_dirino
91#define ofh_dev fh_base.fh_old.fb_dev
92#define ofh_xdev fh_base.fh_old.fb_xdev
93#define ofh_xino fh_base.fh_old.fb_xino
94#define ofh_generation fh_base.fh_old.fb_generation
95
96#define fh_version fh_base.fh_new.fb_version
97#define fh_fsid_type fh_base.fh_new.fb_fsid_type
98#define fh_auth_type fh_base.fh_new.fb_auth_type
99#define fh_fileid_type fh_base.fh_new.fb_fileid_type
100#define fh_fsid fh_base.fh_new.fb_auth
101
102/* Do not use, provided for userspace compatiblity. */
103#define fh_auth fh_base.fh_new.fb_auth
104
105#endif /* _LINUX_NFSD_FH_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nilfs2_ondisk.h+12-12
...@@ -29,7 +29,7 @@...@@ -29,7 +29,7 @@
2929
30#include <linux/types.h>30#include <linux/types.h>
31#include <linux/magic.h>31#include <linux/magic.h>
3232#include <asm/byteorder.h>
3333
34#define NILFS_INODE_BMAP_SIZE 734#define NILFS_INODE_BMAP_SIZE 7
3535
...@@ -533,19 +533,19 @@ enum {...@@ -533,19 +533,19 @@ enum {
533static __inline__ void \533static __inline__ void \
534nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \534nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \
535{ \535{ \
536 cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \536 cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) | \
537 (1UL << NILFS_CHECKPOINT_##flag)); \537 (1UL << NILFS_CHECKPOINT_##flag)); \
538} \538} \
539static __inline__ void \539static __inline__ void \
540nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \540nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \
541{ \541{ \
542 cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \542 cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) & \
543 ~(1UL << NILFS_CHECKPOINT_##flag)); \543 ~(1UL << NILFS_CHECKPOINT_##flag)); \
544} \544} \
545static __inline__ int \545static __inline__ int \
546nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \546nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \
547{ \547{ \
548 return !!(le32_to_cpu(cp->cp_flags) & \548 return !!(__le32_to_cpu(cp->cp_flags) & \
549 (1UL << NILFS_CHECKPOINT_##flag)); \549 (1UL << NILFS_CHECKPOINT_##flag)); \
550}550}
551551
...@@ -595,20 +595,20 @@ enum {...@@ -595,20 +595,20 @@ enum {
595static __inline__ void \595static __inline__ void \
596nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \596nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \
597{ \597{ \
598 su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \598 su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) | \
599 (1UL << NILFS_SEGMENT_USAGE_##flag));\599 (1UL << NILFS_SEGMENT_USAGE_##flag));\
600} \600} \
601static __inline__ void \601static __inline__ void \
602nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \602nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \
603{ \603{ \
604 su->su_flags = \604 su->su_flags = \
605 cpu_to_le32(le32_to_cpu(su->su_flags) & \605 __cpu_to_le32(__le32_to_cpu(su->su_flags) & \
606 ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \606 ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \
607} \607} \
608static __inline__ int \608static __inline__ int \
609nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \609nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \
610{ \610{ \
611 return !!(le32_to_cpu(su->su_flags) & \611 return !!(__le32_to_cpu(su->su_flags) & \
612 (1UL << NILFS_SEGMENT_USAGE_##flag)); \612 (1UL << NILFS_SEGMENT_USAGE_##flag)); \
613}613}
614614
...@@ -619,15 +619,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error)...@@ -619,15 +619,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error)
619static __inline__ void619static __inline__ void
620nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)620nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)
621{621{
622 su->su_lastmod = cpu_to_le64(0);622 su->su_lastmod = __cpu_to_le64(0);
623 su->su_nblocks = cpu_to_le32(0);623 su->su_nblocks = __cpu_to_le32(0);
624 su->su_flags = cpu_to_le32(0);624 su->su_flags = __cpu_to_le32(0);
625}625}
626626
627static __inline__ int627static __inline__ int
628nilfs_segment_usage_clean(const struct nilfs_segment_usage *su)628nilfs_segment_usage_clean(const struct nilfs_segment_usage *su)
629{629{
630 return !le32_to_cpu(su->su_flags);630 return !__le32_to_cpu(su->su_flags);
631}631}
632632
633/**633/**
lib/libc/include/any-linux-any/linux/nitro_enclaves.h created+359
...@@ -0,0 +1,359 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 */
5
6#ifndef _LINUX_NITRO_ENCLAVES_H_
7#define _LINUX_NITRO_ENCLAVES_H_
8
9#include <linux/types.h>
10
11/**
12 * DOC: Nitro Enclaves (NE) Kernel Driver Interface
13 */
14
15/**
16 * NE_CREATE_VM - The command is used to create a slot that is associated with
17 * an enclave VM.
18 * The generated unique slot id is an output parameter.
19 * The ioctl can be invoked on the /dev/nitro_enclaves fd, before
20 * setting any resources, such as memory and vCPUs, for an
21 * enclave. Memory and vCPUs are set for the slot mapped to an enclave.
22 * A NE CPU pool has to be set before calling this function. The
23 * pool can be set after the NE driver load, using
24 * /sys/module/nitro_enclaves/parameters/ne_cpus.
25 * Its format is the detailed in the cpu-lists section:
26 * https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
27 * CPU 0 and its siblings have to remain available for the
28 * primary / parent VM, so they cannot be set for enclaves. Full
29 * CPU core(s), from the same NUMA node, need(s) to be included
30 * in the CPU pool.
31 *
32 * Context: Process context.
33 * Return:
34 * * Enclave file descriptor - Enclave file descriptor used with
35 * ioctl calls to set vCPUs and memory
36 * regions, then start the enclave.
37 * * -1 - There was a failure in the ioctl logic.
38 * On failure, errno is set to:
39 * * EFAULT - copy_to_user() failure.
40 * * ENOMEM - Memory allocation failure for internal
41 * bookkeeping variables.
42 * * NE_ERR_NO_CPUS_AVAIL_IN_POOL - No NE CPU pool set / no CPUs available
43 * in the pool.
44 * * Error codes from get_unused_fd_flags() and anon_inode_getfile().
45 * * Error codes from the NE PCI device request.
46 */
47#define NE_CREATE_VM _IOR(0xAE, 0x20, __u64)
48
49/**
50 * NE_ADD_VCPU - The command is used to set a vCPU for an enclave. The vCPU can
51 * be auto-chosen from the NE CPU pool or it can be set by the
52 * caller, with the note that it needs to be available in the NE
53 * CPU pool. Full CPU core(s), from the same NUMA node, need(s) to
54 * be associated with an enclave.
55 * The vCPU id is an input / output parameter. If its value is 0,
56 * then a CPU is chosen from the enclave CPU pool and returned via
57 * this parameter.
58 * The ioctl can be invoked on the enclave fd, before an enclave
59 * is started.
60 *
61 * Context: Process context.
62 * Return:
63 * * 0 - Logic successfully completed.
64 * * -1 - There was a failure in the ioctl logic.
65 * On failure, errno is set to:
66 * * EFAULT - copy_from_user() / copy_to_user() failure.
67 * * ENOMEM - Memory allocation failure for internal
68 * bookkeeping variables.
69 * * EIO - Current task mm is not the same as the one
70 * that created the enclave.
71 * * NE_ERR_NO_CPUS_AVAIL_IN_POOL - No CPUs available in the NE CPU pool.
72 * * NE_ERR_VCPU_ALREADY_USED - The provided vCPU is already used.
73 * * NE_ERR_VCPU_NOT_IN_CPU_POOL - The provided vCPU is not available in the
74 * NE CPU pool.
75 * * NE_ERR_VCPU_INVALID_CPU_CORE - The core id of the provided vCPU is invalid
76 * or out of range.
77 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
78 * (init = before being started).
79 * * NE_ERR_INVALID_VCPU - The provided vCPU is not in the available
80 * CPUs range.
81 * * Error codes from the NE PCI device request.
82 */
83#define NE_ADD_VCPU _IOWR(0xAE, 0x21, __u32)
84
85/**
86 * NE_GET_IMAGE_LOAD_INFO - The command is used to get information needed for
87 * in-memory enclave image loading e.g. offset in
88 * enclave memory to start placing the enclave image.
89 * The image load info is an input / output parameter.
90 * It includes info provided by the caller - flags -
91 * and returns the offset in enclave memory where to
92 * start placing the enclave image.
93 * The ioctl can be invoked on the enclave fd, before
94 * an enclave is started.
95 *
96 * Context: Process context.
97 * Return:
98 * * 0 - Logic successfully completed.
99 * * -1 - There was a failure in the ioctl logic.
100 * On failure, errno is set to:
101 * * EFAULT - copy_from_user() / copy_to_user() failure.
102 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state (init =
103 * before being started).
104 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
105 */
106#define NE_GET_IMAGE_LOAD_INFO _IOWR(0xAE, 0x22, struct ne_image_load_info)
107
108/**
109 * NE_SET_USER_MEMORY_REGION - The command is used to set a memory region for an
110 * enclave, given the allocated memory from the
111 * userspace. Enclave memory needs to be from the
112 * same NUMA node as the enclave CPUs.
113 * The user memory region is an input parameter. It
114 * includes info provided by the caller - flags,
115 * memory size and userspace address.
116 * The ioctl can be invoked on the enclave fd,
117 * before an enclave is started.
118 *
119 * Context: Process context.
120 * Return:
121 * * 0 - Logic successfully completed.
122 * * -1 - There was a failure in the ioctl logic.
123 * On failure, errno is set to:
124 * * EFAULT - copy_from_user() failure.
125 * * EINVAL - Invalid physical memory region(s) e.g.
126 * unaligned address.
127 * * EIO - Current task mm is not the same as
128 * the one that created the enclave.
129 * * ENOMEM - Memory allocation failure for internal
130 * bookkeeping variables.
131 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
132 * (init = before being started).
133 * * NE_ERR_INVALID_MEM_REGION_SIZE - The memory size of the region is not
134 * multiple of 2 MiB.
135 * * NE_ERR_INVALID_MEM_REGION_ADDR - Invalid user space address given.
136 * * NE_ERR_UNALIGNED_MEM_REGION_ADDR - Unaligned user space address given.
137 * * NE_ERR_MEM_REGION_ALREADY_USED - The memory region is already used.
138 * * NE_ERR_MEM_NOT_HUGE_PAGE - The memory region is not backed by
139 * huge pages.
140 * * NE_ERR_MEM_DIFFERENT_NUMA_NODE - The memory region is not from the same
141 * NUMA node as the CPUs.
142 * * NE_ERR_MEM_MAX_REGIONS - The number of memory regions set for
143 * the enclave reached maximum.
144 * * NE_ERR_INVALID_PAGE_SIZE - The memory region is not backed by
145 * pages multiple of 2 MiB.
146 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
147 * * Error codes from get_user_pages().
148 * * Error codes from the NE PCI device request.
149 */
150#define NE_SET_USER_MEMORY_REGION _IOW(0xAE, 0x23, struct ne_user_memory_region)
151
152/**
153 * NE_START_ENCLAVE - The command is used to trigger enclave start after the
154 * enclave resources, such as memory and CPU, have been set.
155 * The enclave start info is an input / output parameter. It
156 * includes info provided by the caller - enclave cid and
157 * flags - and returns the cid (if input cid is 0).
158 * The ioctl can be invoked on the enclave fd, after an
159 * enclave slot is created and resources, such as memory and
160 * vCPUs are set for an enclave.
161 *
162 * Context: Process context.
163 * Return:
164 * * 0 - Logic successfully completed.
165 * * -1 - There was a failure in the ioctl logic.
166 * On failure, errno is set to:
167 * * EFAULT - copy_from_user() / copy_to_user() failure.
168 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
169 * (init = before being started).
170 * * NE_ERR_NO_MEM_REGIONS_ADDED - No memory regions are set.
171 * * NE_ERR_NO_VCPUS_ADDED - No vCPUs are set.
172 * * NE_ERR_FULL_CORES_NOT_USED - Full core(s) not set for the enclave.
173 * * NE_ERR_ENCLAVE_MEM_MIN_SIZE - Enclave memory is less than minimum
174 * memory size (64 MiB).
175 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
176 * * NE_ERR_INVALID_ENCLAVE_CID - The provided enclave CID is invalid.
177 * * Error codes from the NE PCI device request.
178 */
179#define NE_START_ENCLAVE _IOWR(0xAE, 0x24, struct ne_enclave_start_info)
180
181/**
182 * DOC: NE specific error codes
183 */
184
185/**
186 * NE_ERR_VCPU_ALREADY_USED - The provided vCPU is already used.
187 */
188#define NE_ERR_VCPU_ALREADY_USED (256)
189/**
190 * NE_ERR_VCPU_NOT_IN_CPU_POOL - The provided vCPU is not available in the
191 * NE CPU pool.
192 */
193#define NE_ERR_VCPU_NOT_IN_CPU_POOL (257)
194/**
195 * NE_ERR_VCPU_INVALID_CPU_CORE - The core id of the provided vCPU is invalid
196 * or out of range of the NE CPU pool.
197 */
198#define NE_ERR_VCPU_INVALID_CPU_CORE (258)
199/**
200 * NE_ERR_INVALID_MEM_REGION_SIZE - The user space memory region size is not
201 * multiple of 2 MiB.
202 */
203#define NE_ERR_INVALID_MEM_REGION_SIZE (259)
204/**
205 * NE_ERR_INVALID_MEM_REGION_ADDR - The user space memory region address range
206 * is invalid.
207 */
208#define NE_ERR_INVALID_MEM_REGION_ADDR (260)
209/**
210 * NE_ERR_UNALIGNED_MEM_REGION_ADDR - The user space memory region address is
211 * not aligned.
212 */
213#define NE_ERR_UNALIGNED_MEM_REGION_ADDR (261)
214/**
215 * NE_ERR_MEM_REGION_ALREADY_USED - The user space memory region is already used.
216 */
217#define NE_ERR_MEM_REGION_ALREADY_USED (262)
218/**
219 * NE_ERR_MEM_NOT_HUGE_PAGE - The user space memory region is not backed by
220 * contiguous physical huge page(s).
221 */
222#define NE_ERR_MEM_NOT_HUGE_PAGE (263)
223/**
224 * NE_ERR_MEM_DIFFERENT_NUMA_NODE - The user space memory region is backed by
225 * pages from different NUMA nodes than the CPUs.
226 */
227#define NE_ERR_MEM_DIFFERENT_NUMA_NODE (264)
228/**
229 * NE_ERR_MEM_MAX_REGIONS - The supported max memory regions per enclaves has
230 * been reached.
231 */
232#define NE_ERR_MEM_MAX_REGIONS (265)
233/**
234 * NE_ERR_NO_MEM_REGIONS_ADDED - The command to start an enclave is triggered
235 * and no memory regions are added.
236 */
237#define NE_ERR_NO_MEM_REGIONS_ADDED (266)
238/**
239 * NE_ERR_NO_VCPUS_ADDED - The command to start an enclave is triggered and no
240 * vCPUs are added.
241 */
242#define NE_ERR_NO_VCPUS_ADDED (267)
243/**
244 * NE_ERR_ENCLAVE_MEM_MIN_SIZE - The enclave memory size is lower than the
245 * minimum supported.
246 */
247#define NE_ERR_ENCLAVE_MEM_MIN_SIZE (268)
248/**
249 * NE_ERR_FULL_CORES_NOT_USED - The command to start an enclave is triggered and
250 * full CPU cores are not set.
251 */
252#define NE_ERR_FULL_CORES_NOT_USED (269)
253/**
254 * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state when setting
255 * resources or triggering start.
256 */
257#define NE_ERR_NOT_IN_INIT_STATE (270)
258/**
259 * NE_ERR_INVALID_VCPU - The provided vCPU is out of range of the available CPUs.
260 */
261#define NE_ERR_INVALID_VCPU (271)
262/**
263 * NE_ERR_NO_CPUS_AVAIL_IN_POOL - The command to create an enclave is triggered
264 * and no CPUs are available in the pool.
265 */
266#define NE_ERR_NO_CPUS_AVAIL_IN_POOL (272)
267/**
268 * NE_ERR_INVALID_PAGE_SIZE - The user space memory region is not backed by pages
269 * multiple of 2 MiB.
270 */
271#define NE_ERR_INVALID_PAGE_SIZE (273)
272/**
273 * NE_ERR_INVALID_FLAG_VALUE - The provided flag value is invalid.
274 */
275#define NE_ERR_INVALID_FLAG_VALUE (274)
276/**
277 * NE_ERR_INVALID_ENCLAVE_CID - The provided enclave CID is invalid, either
278 * being a well-known value or the CID of the
279 * parent / primary VM.
280 */
281#define NE_ERR_INVALID_ENCLAVE_CID (275)
282
283/**
284 * DOC: Image load info flags
285 */
286
287/**
288 * NE_EIF_IMAGE - Enclave Image Format (EIF)
289 */
290#define NE_EIF_IMAGE (0x01)
291
292#define NE_IMAGE_LOAD_MAX_FLAG_VAL (0x02)
293
294/**
295 * struct ne_image_load_info - Info necessary for in-memory enclave image
296 * loading (in / out).
297 * @flags: Flags to determine the enclave image type
298 * (e.g. Enclave Image Format - EIF) (in).
299 * @memory_offset: Offset in enclave memory where to start placing the
300 * enclave image (out).
301 */
302struct ne_image_load_info {
303 __u64 flags;
304 __u64 memory_offset;
305};
306
307/**
308 * DOC: User memory region flags
309 */
310
311/**
312 * NE_DEFAULT_MEMORY_REGION - Memory region for enclave general usage.
313 */
314#define NE_DEFAULT_MEMORY_REGION (0x00)
315
316#define NE_MEMORY_REGION_MAX_FLAG_VAL (0x01)
317
318/**
319 * struct ne_user_memory_region - Memory region to be set for an enclave (in).
320 * @flags: Flags to determine the usage for the memory region (in).
321 * @memory_size: The size, in bytes, of the memory region to be set for
322 * an enclave (in).
323 * @userspace_addr: The start address of the userspace allocated memory of
324 * the memory region to set for an enclave (in).
325 */
326struct ne_user_memory_region {
327 __u64 flags;
328 __u64 memory_size;
329 __u64 userspace_addr;
330};
331
332/**
333 * DOC: Enclave start info flags
334 */
335
336/**
337 * NE_ENCLAVE_PRODUCTION_MODE - Start enclave in production mode.
338 */
339#define NE_ENCLAVE_PRODUCTION_MODE (0x00)
340/**
341 * NE_ENCLAVE_DEBUG_MODE - Start enclave in debug mode.
342 */
343#define NE_ENCLAVE_DEBUG_MODE (0x01)
344
345#define NE_ENCLAVE_START_MAX_FLAG_VAL (0x02)
346
347/**
348 * struct ne_enclave_start_info - Setup info necessary for enclave start (in / out).
349 * @flags: Flags for the enclave to start with (e.g. debug mode) (in).
350 * @enclave_cid: Context ID (CID) for the enclave vsock device. If 0 as
351 * input, the CID is autogenerated by the hypervisor and
352 * returned back as output by the driver (in / out).
353 */
354struct ne_enclave_start_info {
355 __u64 flags;
356 __u64 enclave_cid;
357};
358
359#endif /* _LINUX_NITRO_ENCLAVES_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nl80211-vnd-intel.h created+106
...@@ -0,0 +1,106 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#ifndef __VENDOR_CMD_INTEL_H__
8#define __VENDOR_CMD_INTEL_H__
9
10#define INTEL_OUI 0x001735
11
12/**
13 * enum iwl_mvm_vendor_cmd - supported vendor commands
14 * @IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO: reports CSME connection info.
15 * @IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP: asks for ownership on the device.
16 * This is useful when the CSME firmware owns the device and the kernel
17 * wants to use it. In case the CSME firmware has no connection active the
18 * kernel will manage on its own to get ownership of the device.
19 * When the CSME firmware has an active connection, the user space
20 * involvement is required. The kernel will assert the RFKILL signal with
21 * the "device not owned" reason so that nobody can touch the device. Then
22 * the user space can run the following flow to be able to get connected
23 * to the very same AP the CSME firmware is currently connected to:
24 *
25 * 1) The user space (NetworkManager) boots and sees that the device is
26 * in RFKILL because the host doesn't own the device
27 * 2) The user space asks the kernel what AP the CSME firmware is
28 * connected to (with %IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO)
29 * 3) The user space checks if it has a profile that matches the reply
30 * from the CSME firmware
31 * 4) The user space installs a network to the wpa_supplicant with a
32 * specific BSSID and a specific frequency
33 * 5) The user space prevents any type of full scan
34 * 6) The user space asks iwlmei to request ownership on the device (with
35 * this command)
36 * 7) iwlmei requests ownership from the CSME firmware
37 * 8) The CSME firmware grants ownership
38 * 9) iwlmei tells iwlwifi to lift the RFKILL
39 * 10) RFKILL OFF is reported to user space
40 * 11) The host boots the device, loads the firwmare, and connects to a
41 * specific BSSID without scanning including IP as fast as it can
42 * 12) The host reports to the CSME firmware that there is a connection
43 * 13) The TCP connection is preserved and the host has connectivity
44 *
45 * @IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT: notifies if roaming is allowed.
46 * It contains a &IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN and a
47 * &IWL_MVM_VENDOR_ATTR_VIF_ADDR attributes.
48 */
49
50enum iwl_mvm_vendor_cmd {
51 IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO = 0x2d,
52 IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP = 0x30,
53 IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT = 0x32,
54};
55
56enum iwl_vendor_auth_akm_mode {
57 IWL_VENDOR_AUTH_OPEN,
58 IWL_VENDOR_AUTH_RSNA = 0x6,
59 IWL_VENDOR_AUTH_RSNA_PSK,
60 IWL_VENDOR_AUTH_SAE = 0x9,
61 IWL_VENDOR_AUTH_MAX,
62};
63
64/**
65 * enum iwl_mvm_vendor_attr - attributes used in vendor commands
66 * @__IWL_MVM_VENDOR_ATTR_INVALID: attribute 0 is invalid
67 * @IWL_MVM_VENDOR_ATTR_VIF_ADDR: interface MAC address
68 * @IWL_MVM_VENDOR_ATTR_ADDR: MAC address
69 * @IWL_MVM_VENDOR_ATTR_SSID: SSID (binary attribute, 0..32 octets)
70 * @IWL_MVM_VENDOR_ATTR_STA_CIPHER: the cipher to use for the station with the
71 * mac address specified in &IWL_MVM_VENDOR_ATTR_ADDR.
72 * @IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN: u8 attribute. Indicates whether
73 * roaming is forbidden or not. Value 1 means roaming is forbidden,
74 * 0 mean roaming is allowed.
75 * @IWL_MVM_VENDOR_ATTR_AUTH_MODE: u32 attribute. Authentication mode type
76 * as specified in &enum iwl_vendor_auth_akm_mode.
77 * @IWL_MVM_VENDOR_ATTR_CHANNEL_NUM: u8 attribute. Contains channel number.
78 * @IWL_MVM_VENDOR_ATTR_BAND: u8 attribute.
79 * 0 for 2.4 GHz band, 1 for 5.2GHz band and 2 for 6GHz band.
80 * @IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL: u32 attribute. Channel number of
81 * collocated AP. Relevant for 6GHz AP info.
82 * @IWL_MVM_VENDOR_ATTR_COLLOC_ADDR: MAC address of a collocated AP.
83 * Relevant for 6GHz AP info.
84 *
85 * @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes
86 * @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number
87
88 */
89enum iwl_mvm_vendor_attr {
90 __IWL_MVM_VENDOR_ATTR_INVALID = 0x00,
91 IWL_MVM_VENDOR_ATTR_VIF_ADDR = 0x02,
92 IWL_MVM_VENDOR_ATTR_ADDR = 0x0a,
93 IWL_MVM_VENDOR_ATTR_SSID = 0x3d,
94 IWL_MVM_VENDOR_ATTR_STA_CIPHER = 0x51,
95 IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN = 0x64,
96 IWL_MVM_VENDOR_ATTR_AUTH_MODE = 0x65,
97 IWL_MVM_VENDOR_ATTR_CHANNEL_NUM = 0x66,
98 IWL_MVM_VENDOR_ATTR_BAND = 0x69,
99 IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL = 0x70,
100 IWL_MVM_VENDOR_ATTR_COLLOC_ADDR = 0x71,
101
102 NUM_IWL_MVM_VENDOR_ATTR,
103 MAX_IWL_MVM_VENDOR_ATTR = NUM_IWL_MVM_VENDOR_ATTR - 1,
104};
105
106#endif /* __VENDOR_CMD_INTEL_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nl80211.h+1753-89
...@@ -11,7 +11,7 @@...@@ -11,7 +11,7 @@
11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
12 * Copyright 2008 Colin McCabe <colin@cozybit.com>12 * Copyright 2008 Colin McCabe <colin@cozybit.com>
13 * Copyright 2015-2017 Intel Deutschland GmbH13 * Copyright 2015-2017 Intel Deutschland GmbH
14 * Copyright (C) 2018 Intel Corporation14 * Copyright (C) 2018-2021 Intel Corporation
15 *15 *
16 * Permission to use, copy, modify, and/or distribute this software for any16 * Permission to use, copy, modify, and/or distribute this software for any
17 * purpose with or without fee is hereby granted, provided that the above17 * purpose with or without fee is hereby granted, provided that the above
...@@ -52,6 +52,11 @@...@@ -52,6 +52,11 @@
52#define NL80211_MULTICAST_GROUP_NAN "nan"52#define NL80211_MULTICAST_GROUP_NAN "nan"
53#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"53#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
5454
55#define NL80211_EDMG_BW_CONFIG_MIN 4
56#define NL80211_EDMG_BW_CONFIG_MAX 15
57#define NL80211_EDMG_CHANNELS_MIN 1
58#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */
59
55/**60/**
56 * DOC: Station handling61 * DOC: Station handling
57 *62 *
...@@ -178,18 +183,27 @@...@@ -178,18 +183,27 @@
178 *183 *
179 * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers184 * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers
180 * can indicate they support offloading EAPOL handshakes for WPA/WPA2185 * can indicate they support offloading EAPOL handshakes for WPA/WPA2
181 * preshared key authentication. In %NL80211_CMD_CONNECT the preshared186 * preshared key authentication in station mode. In %NL80211_CMD_CONNECT
182 * key should be specified using %NL80211_ATTR_PMK. Drivers supporting187 * the preshared key should be specified using %NL80211_ATTR_PMK. Drivers
183 * this offload may reject the %NL80211_CMD_CONNECT when no preshared188 * supporting this offload may reject the %NL80211_CMD_CONNECT when no
184 * key material is provided, for example when that driver does not189 * preshared key material is provided, for example when that driver does
185 * support setting the temporal keys through %CMD_NEW_KEY.190 * not support setting the temporal keys through %NL80211_CMD_NEW_KEY.
186 *191 *
187 * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be192 * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be
188 * set by drivers indicating offload support of the PTK/GTK EAPOL193 * set by drivers indicating offload support of the PTK/GTK EAPOL
189 * handshakes during 802.1X authentication. In order to use the offload194 * handshakes during 802.1X authentication in station mode. In order to
190 * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS195 * use the offload the %NL80211_CMD_CONNECT should have
191 * attribute flag. Drivers supporting this offload may reject the196 * %NL80211_ATTR_WANT_1X_4WAY_HS attribute flag. Drivers supporting this
192 * %NL80211_CMD_CONNECT when the attribute flag is not present.197 * offload may reject the %NL80211_CMD_CONNECT when the attribute flag is
198 * not present.
199 *
200 * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK flag drivers
201 * can indicate they support offloading EAPOL handshakes for WPA/WPA2
202 * preshared key authentication in AP mode. In %NL80211_CMD_START_AP
203 * the preshared key should be specified using %NL80211_ATTR_PMK. Drivers
204 * supporting this offload may reject the %NL80211_CMD_START_AP when no
205 * preshared key material is provided, for example when that driver does
206 * not support setting the temporal keys through %NL80211_CMD_NEW_KEY.
193 *207 *
194 * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK208 * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK
195 * using %NL80211_CMD_SET_PMK. For offloaded FT support also209 * using %NL80211_CMD_SET_PMK. For offloaded FT support also
...@@ -234,6 +248,81 @@...@@ -234,6 +248,81 @@
234 * use in a FILS shared key connection with PMKSA caching.248 * use in a FILS shared key connection with PMKSA caching.
235 */249 */
236250
251/**
252 * DOC: SAE authentication offload
253 *
254 * By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
255 * support offloading SAE authentication for WPA3-Personal networks in station
256 * mode. Similarly @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP flag can be set by
257 * drivers indicating the offload support in AP mode.
258 *
259 * The password for SAE should be specified using %NL80211_ATTR_SAE_PASSWORD in
260 * %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP for station and AP mode
261 * respectively.
262 */
263
264/**
265 * DOC: VLAN offload support for setting group keys and binding STAs to VLANs
266 *
267 * By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they
268 * support offloading VLAN functionality in a manner where the driver exposes a
269 * single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs
270 * can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet
271 * case. Frames received from stations that are not assigned to any VLAN are
272 * delivered on the main netdev and frames to such stations can be sent through
273 * that main netdev.
274 *
275 * %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and
276 * %NL80211_CMD_SET_STATION will optionally specify vlan_id using
277 * %NL80211_ATTR_VLAN_ID.
278 */
279
280/**
281 * DOC: TID configuration
282 *
283 * TID config support can be checked in the %NL80211_ATTR_TID_CONFIG
284 * attribute given in wiphy capabilities.
285 *
286 * The necessary configuration parameters are mentioned in
287 * &enum nl80211_tid_config_attr and it will be passed to the
288 * %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG.
289 *
290 * If the configuration needs to be applied for specific peer then the MAC
291 * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
292 * configuration will be applied for all the connected peers in the vif except
293 * any peers that have peer specific configuration for the TID by default; if
294 * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values
295 * will be overwritten.
296 *
297 * All this configuration is valid only for STA's current connection
298 * i.e. the configuration will be reset to default when the STA connects back
299 * after disconnection/roaming, and this configuration will be cleared when
300 * the interface goes down.
301 */
302
303/**
304 * DOC: FILS shared key crypto offload
305 *
306 * This feature is applicable to drivers running in AP mode.
307 *
308 * FILS shared key crypto offload can be advertised by drivers by setting
309 * @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD flag. The drivers that support
310 * FILS shared key crypto offload should be able to encrypt and decrypt
311 * association frames for FILS shared key authentication as per IEEE 802.11ai.
312 * With this capability, for FILS key derivation, drivers depend on userspace.
313 *
314 * After FILS key derivation, userspace shares the FILS AAD details with the
315 * driver and the driver stores the same to use in decryption of association
316 * request and in encryption of association response. The below parameters
317 * should be given to the driver in %NL80211_CMD_SET_FILS_AAD.
318 * %NL80211_ATTR_MAC - STA MAC address, used for storing FILS AAD per STA
319 * %NL80211_ATTR_FILS_KEK - Used for encryption or decryption
320 * %NL80211_ATTR_FILS_NONCES - Used for encryption or decryption
321 * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
322 *
323 * Once the association is done, the driver cleans the FILS AAD data.
324 */
325
237/**326/**
238 * enum nl80211_commands - supported nl80211 commands327 * enum nl80211_commands - supported nl80211 commands
239 *328 *
...@@ -243,13 +332,14 @@...@@ -243,13 +332,14 @@
243 * to get a list of all present wiphys.332 * to get a list of all present wiphys.
244 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or333 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
245 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,334 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
246 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the335 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
247 * attributes determining the channel width; this is used for setting336 * %NL80211_ATTR_WIPHY_FREQ_OFFSET (and the attributes determining the
248 * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,337 * channel width; this is used for setting monitor mode channel),
249 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,338 * %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG,
250 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.339 * %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or
251 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL340 * %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel,
252 * instead, the support here is for backward compatibility only.341 * see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward
342 * compatibility only.
253 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request343 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
254 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and344 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
255 * %NL80211_ATTR_WIPHY_NAME.345 * %NL80211_ATTR_WIPHY_NAME.
...@@ -270,7 +360,10 @@...@@ -270,7 +360,10 @@
270 * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes360 * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
271 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from361 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
272 * userspace to request deletion of a virtual interface, then requires362 * userspace to request deletion of a virtual interface, then requires
273 * attribute %NL80211_ATTR_IFINDEX.363 * attribute %NL80211_ATTR_IFINDEX. If multiple BSSID advertisements are
364 * enabled using %NL80211_ATTR_MBSSID_CONFIG, %NL80211_ATTR_MBSSID_ELEMS,
365 * and if this command is used for the transmitting interface, then all
366 * the non-transmitting interfaces are deleted as well.
274 *367 *
275 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified368 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
276 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.369 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
...@@ -298,7 +391,8 @@...@@ -298,7 +391,8 @@
298 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,391 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
299 * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.392 * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
300 * The channel to use can be set on the interface or be given using the393 * The channel to use can be set on the interface or be given using the
301 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.394 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_FREQ_OFFSET, and the
395 * attributes determining channel width.
302 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP396 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
303 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface397 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
304 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP398 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
...@@ -308,7 +402,7 @@...@@ -308,7 +402,7 @@
308 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by402 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
309 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.403 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
310 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the404 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
311 * the interface identified by %NL80211_ATTR_IFINDEX.405 * interface identified by %NL80211_ATTR_IFINDEX.
312 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC406 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
313 * or, if no MAC address given, all stations, on the interface identified407 * or, if no MAC address given, all stations, on the interface identified
314 * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and408 * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
...@@ -328,7 +422,7 @@...@@ -328,7 +422,7 @@
328 * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by422 * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
329 * %NL80211_ATTR_MAC.423 * %NL80211_ATTR_MAC.
330 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the424 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
331 * the interface identified by %NL80211_ATTR_IFINDEX.425 * interface identified by %NL80211_ATTR_IFINDEX.
332 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC426 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
333 * or, if no MAC address given, all mesh paths, on the interface identified427 * or, if no MAC address given, all mesh paths, on the interface identified
334 * by %NL80211_ATTR_IFINDEX.428 * by %NL80211_ATTR_IFINDEX.
...@@ -483,11 +577,12 @@...@@ -483,11 +577,12 @@
483 * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and577 * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
484 * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify578 * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
485 * the SSID (mainly for association, but is included in authentication579 * the SSID (mainly for association, but is included in authentication
486 * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used580 * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ +
487 * to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE581 * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the
488 * is used to specify the authentication type. %NL80211_ATTR_IE is used to582 * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the
489 * define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)583 * authentication type. %NL80211_ATTR_IE is used to define IEs
490 * to be added to the frame.584 * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added
585 * to the frame.
491 * When used as an event, this reports reception of an Authentication586 * When used as an event, this reports reception of an Authentication
492 * frame in station and IBSS modes when the local MLME processed the587 * frame in station and IBSS modes when the local MLME processed the
493 * frame, i.e., it was for the local STA and was received in correct588 * frame, i.e., it was for the local STA and was received in correct
...@@ -542,8 +637,9 @@...@@ -542,8 +637,9 @@
542 * requests to connect to a specified network but without separating637 * requests to connect to a specified network but without separating
543 * auth and assoc steps. For this, you need to specify the SSID in a638 * auth and assoc steps. For this, you need to specify the SSID in a
544 * %NL80211_ATTR_SSID attribute, and can optionally specify the association639 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
545 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,640 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE,
546 * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,641 * %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ,
642 * %NL80211_ATTR_WIPHY_FREQ_OFFSET, %NL80211_ATTR_CONTROL_PORT,
547 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,643 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
548 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,644 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
549 * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and645 * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and
...@@ -557,6 +653,14 @@...@@ -557,6 +653,14 @@
557 * set of BSSID,frequency parameters is used (i.e., either the enforcing653 * set of BSSID,frequency parameters is used (i.e., either the enforcing
558 * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict654 * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
559 * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).655 * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
656 * Driver shall not modify the IEs specified through %NL80211_ATTR_IE if
657 * %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is
658 * included, these IEs through %NL80211_ATTR_IE are specified by the user
659 * space based on the best possible BSS selected. Thus, if the driver ends
660 * up selecting a different BSS, it can modify these IEs accordingly (e.g.
661 * userspace asks the driver to perform PMKSA caching with BSS1 and the
662 * driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE
663 * has to get updated with the apt PMKID).
560 * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within664 * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
561 * the ESS in case the device is already associated and an association with665 * the ESS in case the device is already associated and an association with
562 * a different BSS is desired.666 * a different BSS is desired.
...@@ -573,14 +677,13 @@...@@ -573,14 +677,13 @@
573 * authentication/association or not receiving a response from the AP.677 * authentication/association or not receiving a response from the AP.
574 * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as678 * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as
575 * well to remain backwards compatible.679 * well to remain backwards compatible.
576 * When establishing a security association, drivers that support 4 way
577 * handshake offload should send %NL80211_CMD_PORT_AUTHORIZED event when
578 * the 4 way handshake is completed successfully.
579 * @NL80211_CMD_ROAM: Notification indicating the card/driver roamed by itself.680 * @NL80211_CMD_ROAM: Notification indicating the card/driver roamed by itself.
580 * When a security association was established with the new AP (e.g. if681 * When a security association was established on an 802.1X network using
581 * the FT protocol was used for roaming or the driver completed the 4 way682 * fast transition, this event should be followed by an
582 * handshake), this event should be followed by an
583 * %NL80211_CMD_PORT_AUTHORIZED event.683 * %NL80211_CMD_PORT_AUTHORIZED event.
684 * Following a %NL80211_CMD_ROAM event userspace can issue
685 * %NL80211_CMD_GET_SCAN in order to obtain the scan information for the
686 * new BSS the card/driver roamed to.
584 * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify687 * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
585 * userspace that a connection was dropped by the AP or due to other688 * userspace that a connection was dropped by the AP or due to other
586 * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and689 * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
...@@ -626,6 +729,10 @@...@@ -626,6 +729,10 @@
626 * four bytes for vendor frames including the OUI. The registration729 * four bytes for vendor frames including the OUI. The registration
627 * cannot be dropped, but is removed automatically when the netlink730 * cannot be dropped, but is removed automatically when the netlink
628 * socket is closed. Multiple registrations can be made.731 * socket is closed. Multiple registrations can be made.
732 * The %NL80211_ATTR_RECEIVE_MULTICAST flag attribute can be given if
733 * %NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS is available, in which
734 * case the registration can also be modified to include/exclude the
735 * flag, rather than requiring unregistration to change it.
629 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for736 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
630 * backward compatibility737 * backward compatibility
631 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This738 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
...@@ -648,7 +755,9 @@...@@ -648,7 +755,9 @@
648 * is used during CSA period.755 * is used during CSA period.
649 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this756 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
650 * command may be used with the corresponding cookie to cancel the wait757 * command may be used with the corresponding cookie to cancel the wait
651 * time if it is known that it is no longer necessary.758 * time if it is known that it is no longer necessary. This command is
759 * also sent as an event whenever the driver has completed the off-channel
760 * wait time.
652 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.761 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
653 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame762 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
654 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies763 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
...@@ -677,7 +786,8 @@...@@ -677,7 +786,8 @@
677 * of any other interfaces, and other interfaces will again take786 * of any other interfaces, and other interfaces will again take
678 * precedence when they are used.787 * precedence when they are used.
679 *788 *
680 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.789 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface
790 * (no longer supported).
681 *791 *
682 * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform792 * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform
683 * multicast to unicast conversion. When enabled, all multicast packets793 * multicast to unicast conversion. When enabled, all multicast packets
...@@ -723,7 +833,7 @@...@@ -723,7 +833,7 @@
723 * various triggers. These triggers can be configured through this833 * various triggers. These triggers can be configured through this
724 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For834 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
725 * more background information, see835 * more background information, see
726 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.836 * https://wireless.wiki.kernel.org/en/users/Documentation/WoWLAN.
727 * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification837 * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
728 * from the driver reporting the wakeup reason. In this case, the838 * from the driver reporting the wakeup reason. In this case, the
729 * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason839 * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
...@@ -863,7 +973,7 @@...@@ -863,7 +973,7 @@
863 * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.973 * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
864 *974 *
865 * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the975 * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
866 * the new channel information (Channel Switch Announcement - CSA)976 * new channel information (Channel Switch Announcement - CSA)
867 * in the beacon for some time (as defined in the977 * in the beacon for some time (as defined in the
868 * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the978 * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
869 * new channel. Userspace provides the new channel information (using979 * new channel. Userspace provides the new channel information (using
...@@ -987,13 +1097,11 @@...@@ -987,13 +1097,11 @@
987 * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously1097 * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
988 * configured PMK for the authenticator address identified by1098 * configured PMK for the authenticator address identified by
989 * %NL80211_ATTR_MAC.1099 * %NL80211_ATTR_MAC.
990 * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates that the 4 way1100 * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates an 802.1X FT roam was
991 * handshake was completed successfully by the driver. The BSSID is1101 * completed successfully. Drivers that support 4 way handshake offload
992 * specified with %NL80211_ATTR_MAC. Drivers that support 4 way handshake1102 * should send this event after indicating 802.1X FT assocation with
993 * offload should send this event after indicating 802.11 association with1103 * %NL80211_CMD_ROAM. If the 4 way handshake failed %NL80211_CMD_DISCONNECT
994 * %NL80211_CMD_CONNECT or %NL80211_CMD_ROAM. If the 4 way handshake failed1104 * should be indicated instead.
995 * %NL80211_CMD_DISCONNECT should be indicated instead.
996 *
997 * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request1105 * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
998 * and RX notification. This command is used both as a request to transmit1106 * and RX notification. This command is used both as a request to transmit
999 * a control port frame and as a notification that a control port frame1107 * a control port frame and as a notification that a control port frame
...@@ -1033,6 +1141,97 @@...@@ -1033,6 +1141,97 @@
1033 * %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its1141 * %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its
1034 * address(specified in %NL80211_ATTR_MAC).1142 * address(specified in %NL80211_ATTR_MAC).
1035 *1143 *
1144 * @NL80211_CMD_GET_FTM_RESPONDER_STATS: Retrieve FTM responder statistics, in
1145 * the %NL80211_ATTR_FTM_RESPONDER_STATS attribute.
1146 *
1147 * @NL80211_CMD_PEER_MEASUREMENT_START: start a (set of) peer measurement(s)
1148 * with the given parameters, which are encapsulated in the nested
1149 * %NL80211_ATTR_PEER_MEASUREMENTS attribute. Optionally, MAC address
1150 * randomization may be enabled and configured by specifying the
1151 * %NL80211_ATTR_MAC and %NL80211_ATTR_MAC_MASK attributes.
1152 * If a timeout is requested, use the %NL80211_ATTR_TIMEOUT attribute.
1153 * A u64 cookie for further %NL80211_ATTR_COOKIE use is returned in
1154 * the netlink extended ack message.
1155 *
1156 * To cancel a measurement, close the socket that requested it.
1157 *
1158 * Measurement results are reported to the socket that requested the
1159 * measurement using @NL80211_CMD_PEER_MEASUREMENT_RESULT when they
1160 * become available, so applications must ensure a large enough socket
1161 * buffer size.
1162 *
1163 * Depending on driver support it may or may not be possible to start
1164 * multiple concurrent measurements.
1165 * @NL80211_CMD_PEER_MEASUREMENT_RESULT: This command number is used for the
1166 * result notification from the driver to the requesting socket.
1167 * @NL80211_CMD_PEER_MEASUREMENT_COMPLETE: Notification only, indicating that
1168 * the measurement completed, using the measurement cookie
1169 * (%NL80211_ATTR_COOKIE).
1170 *
1171 * @NL80211_CMD_NOTIFY_RADAR: Notify the kernel that a radar signal was
1172 * detected and reported by a neighboring device on the channel
1173 * indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
1174 * determining the width and type.
1175 *
1176 * @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to
1177 * offload OWE processing to user space. This intends to support
1178 * OWE AKM by the host drivers that implement SME but rely
1179 * on the user space for the cryptographic/DH IE processing in AP mode.
1180 *
1181 * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
1182 * refreshing, is that from one mesh point we be able to send some data
1183 * frames to other mesh points which are not currently selected as a
1184 * primary traffic path, but which are only 1 hop away. The absence of
1185 * the primary path to the chosen node makes it necessary to apply some
1186 * form of marking on a chosen packet stream so that the packets can be
1187 * properly steered to the selected node for testing, and not by the
1188 * regular mesh path lookup. Further, the packets must be of type data
1189 * so that the rate control (often embedded in firmware) is used for
1190 * rate selection.
1191 *
1192 * Here attribute %NL80211_ATTR_MAC is used to specify connected mesh
1193 * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame
1194 * content. The frame is ethernet data.
1195 *
1196 * @NL80211_CMD_SET_TID_CONFIG: Data frame TID specific configuration
1197 * is passed using %NL80211_ATTR_TID_CONFIG attribute.
1198 *
1199 * @NL80211_CMD_UNPROT_BEACON: Unprotected or incorrectly protected Beacon
1200 * frame. This event is used to indicate that a received Beacon frame was
1201 * dropped because it did not include a valid MME MIC while beacon
1202 * protection was enabled (BIGTK configured in station mode).
1203 *
1204 * @NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS: Report TX status of a control
1205 * port frame transmitted with %NL80211_CMD_CONTROL_PORT_FRAME.
1206 * %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME
1207 * includes the contents of the frame. %NL80211_ATTR_ACK flag is included
1208 * if the recipient acknowledged the frame.
1209 *
1210 * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is
1211 * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
1212 * specify the wiphy index to be applied to.
1213 *
1214 * @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever
1215 * mac80211/drv detects a bss color collision.
1216 *
1217 * @NL80211_CMD_COLOR_CHANGE_REQUEST: This command is used to indicate that
1218 * userspace wants to change the BSS color.
1219 *
1220 * @NL80211_CMD_COLOR_CHANGE_STARTED: Notify userland, that a color change has
1221 * started
1222 *
1223 * @NL80211_CMD_COLOR_CHANGE_ABORTED: Notify userland, that the color change has
1224 * been aborted
1225 *
1226 * @NL80211_CMD_COLOR_CHANGE_COMPLETED: Notify userland that the color change
1227 * has completed
1228 *
1229 * @NL80211_CMD_SET_FILS_AAD: Set FILS AAD data to the driver using -
1230 * &NL80211_ATTR_MAC - for STA MAC address
1231 * &NL80211_ATTR_FILS_KEK - for KEK
1232 * &NL80211_ATTR_FILS_NONCES - for FILS Nonces
1233 * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
1234 *
1036 * @NL80211_CMD_MAX: highest used command number1235 * @NL80211_CMD_MAX: highest used command number
1037 * @__NL80211_CMD_AFTER_LAST: internal use1236 * @__NL80211_CMD_AFTER_LAST: internal use
1038 */1237 */
...@@ -1245,6 +1444,36 @@ enum nl80211_commands {...@@ -1245,6 +1444,36 @@ enum nl80211_commands {
12451444
1246 NL80211_CMD_CONTROL_PORT_FRAME,1445 NL80211_CMD_CONTROL_PORT_FRAME,
12471446
1447 NL80211_CMD_GET_FTM_RESPONDER_STATS,
1448
1449 NL80211_CMD_PEER_MEASUREMENT_START,
1450 NL80211_CMD_PEER_MEASUREMENT_RESULT,
1451 NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
1452
1453 NL80211_CMD_NOTIFY_RADAR,
1454
1455 NL80211_CMD_UPDATE_OWE_INFO,
1456
1457 NL80211_CMD_PROBE_MESH_LINK,
1458
1459 NL80211_CMD_SET_TID_CONFIG,
1460
1461 NL80211_CMD_UNPROT_BEACON,
1462
1463 NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS,
1464
1465 NL80211_CMD_SET_SAR_SPECS,
1466
1467 NL80211_CMD_OBSS_COLOR_COLLISION,
1468
1469 NL80211_CMD_COLOR_CHANGE_REQUEST,
1470
1471 NL80211_CMD_COLOR_CHANGE_STARTED,
1472 NL80211_CMD_COLOR_CHANGE_ABORTED,
1473 NL80211_CMD_COLOR_CHANGE_COMPLETED,
1474
1475 NL80211_CMD_SET_FILS_AAD,
1476
1248 /* add new commands above here */1477 /* add new commands above here */
12491478
1250 /* used to define NL80211_CMD_MAX below */1479 /* used to define NL80211_CMD_MAX below */
...@@ -1290,7 +1519,8 @@ enum nl80211_commands {...@@ -1290,7 +1519,8 @@ enum nl80211_commands {
1290 * of &enum nl80211_chan_width, describing the channel width. See the1519 * of &enum nl80211_chan_width, describing the channel width. See the
1291 * documentation of the enum for more information.1520 * documentation of the enum for more information.
1292 * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the1521 * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
1293 * channel, used for anything but 20 MHz bandwidth1522 * channel, used for anything but 20 MHz bandwidth. In S1G this is the
1523 * operating channel center frequency.
1294 * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the1524 * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
1295 * channel, used only for 80+80 MHz bandwidth1525 * channel, used only for 80+80 MHz bandwidth
1296 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ1526 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
...@@ -1355,7 +1585,7 @@ enum nl80211_commands {...@@ -1355,7 +1585,7 @@ enum nl80211_commands {
1355 * rates as defined by IEEE 802.11 7.3.2.2 but without the length1585 * rates as defined by IEEE 802.11 7.3.2.2 but without the length
1356 * restriction (at most %NL80211_MAX_SUPP_RATES).1586 * restriction (at most %NL80211_MAX_SUPP_RATES).
1357 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station1587 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
1358 * to, or the AP interface the station was originally added to to.1588 * to, or the AP interface the station was originally added to.
1359 * @NL80211_ATTR_STA_INFO: information about a station, part of station info1589 * @NL80211_ATTR_STA_INFO: information about a station, part of station info
1360 * given for %NL80211_CMD_GET_STATION, nested attribute containing1590 * given for %NL80211_CMD_GET_STATION, nested attribute containing
1361 * info as possible, see &enum nl80211_sta_info.1591 * info as possible, see &enum nl80211_sta_info.
...@@ -1500,7 +1730,8 @@ enum nl80211_commands {...@@ -1500,7 +1730,8 @@ enum nl80211_commands {
1500 * flag is included, then control port frames are sent over NL80211 instead1730 * flag is included, then control port frames are sent over NL80211 instead
1501 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is1731 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
1502 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER1732 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
1503 * flag.1733 * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
1734 * frames are not forwared over the control port.
1504 *1735 *
1505 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.1736 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
1506 * We recommend using nested, driver-specific attributes within this.1737 * We recommend using nested, driver-specific attributes within this.
...@@ -1525,6 +1756,12 @@ enum nl80211_commands {...@@ -1525,6 +1756,12 @@ enum nl80211_commands {
1525 * (a u32 with flags from &enum nl80211_wpa_versions).1756 * (a u32 with flags from &enum nl80211_wpa_versions).
1526 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to1757 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
1527 * indicate which key management algorithm(s) to use (an array of u32).1758 * indicate which key management algorithm(s) to use (an array of u32).
1759 * This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
1760 * indicating the supported AKM suites, intended for specific drivers which
1761 * implement SME and have constraints on which AKMs are supported and also
1762 * the cases where an AKM support is offloaded to the driver/firmware.
1763 * If there is no such notification from the driver, user space should
1764 * assume the driver supports all the AKM suites.
1528 *1765 *
1529 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as1766 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
1530 * sent out by the card, for ROAM and successful CONNECT events.1767 * sent out by the card, for ROAM and successful CONNECT events.
...@@ -1580,8 +1817,9 @@ enum nl80211_commands {...@@ -1580,8 +1817,9 @@ enum nl80211_commands {
1580 * specify just a single bitrate, which is to be used for the beacon.1817 * specify just a single bitrate, which is to be used for the beacon.
1581 * The driver must also specify support for this with the extended1818 * The driver must also specify support for this with the extended
1582 * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,1819 * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
1583 * NL80211_EXT_FEATURE_BEACON_RATE_HT and1820 * NL80211_EXT_FEATURE_BEACON_RATE_HT,
1584 * NL80211_EXT_FEATURE_BEACON_RATE_VHT.1821 * NL80211_EXT_FEATURE_BEACON_RATE_VHT and
1822 * NL80211_EXT_FEATURE_BEACON_RATE_HE.
1585 *1823 *
1586 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain1824 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
1587 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.1825 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
...@@ -1701,7 +1939,7 @@ enum nl80211_commands {...@@ -1701,7 +1939,7 @@ enum nl80211_commands {
1701 * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID1939 * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
1702 * is included in the probe request, but the match attributes1940 * is included in the probe request, but the match attributes
1703 * will never let it go through), -EINVAL may be returned.1941 * will never let it go through), -EINVAL may be returned.
1704 * If ommited, no filtering is done.1942 * If omitted, no filtering is done.
1705 *1943 *
1706 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported1944 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
1707 * interface combinations. In each nested item, it contains attributes1945 * interface combinations. In each nested item, it contains attributes
...@@ -1785,8 +2023,15 @@ enum nl80211_commands {...@@ -1785,8 +2023,15 @@ enum nl80211_commands {
1785 * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire2023 * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
1786 * probe-response frame. The DA field in the 802.11 header is zero-ed out,2024 * probe-response frame. The DA field in the 802.11 header is zero-ed out,
1787 * to be filled by the FW.2025 * to be filled by the FW.
1788 * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable2026 * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
1789 * this feature. Currently, only supported in mac80211 drivers.2027 * this feature during association. This is a flag attribute.
2028 * Currently only supported in mac80211 drivers.
2029 * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable
2030 * this feature during association. This is a flag attribute.
2031 * Currently only supported in mac80211 drivers.
2032 * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable
2033 * this feature during association. This is a flag attribute.
2034 * Currently only supported in mac80211 drivers.
1790 * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the2035 * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
1791 * ATTR_HT_CAPABILITY to which attention should be paid.2036 * ATTR_HT_CAPABILITY to which attention should be paid.
1792 * Currently, only mac80211 NICs support this feature.2037 * Currently, only mac80211 NICs support this feature.
...@@ -1806,7 +2051,7 @@ enum nl80211_commands {...@@ -1806,7 +2051,7 @@ enum nl80211_commands {
1806 *2051 *
1807 * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be2052 * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
1808 * used by the drivers which has MLME in firmware and does not have support2053 * used by the drivers which has MLME in firmware and does not have support
1809 * to report per station tx/rx activity to free up the staion entry from2054 * to report per station tx/rx activity to free up the station entry from
1810 * the list. This needs to be used when the driver advertises the2055 * the list. This needs to be used when the driver advertises the
1811 * capability to timeout the stations.2056 * capability to timeout the stations.
1812 *2057 *
...@@ -1907,13 +2152,14 @@ enum nl80211_commands {...@@ -1907,13 +2152,14 @@ enum nl80211_commands {
1907 * until the channel switch event.2152 * until the channel switch event.
1908 * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission2153 * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
1909 * must be blocked on the current channel (before the channel switch2154 * must be blocked on the current channel (before the channel switch
1910 * operation).2155 * operation). Also included in the channel switch started event if quiet
2156 * was requested by the AP.
1911 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information2157 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
1912 * for the time while performing a channel switch.2158 * for the time while performing a channel switch.
1913 * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel2159 * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel
1914 * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).2160 * switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
1915 * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel2161 * @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel
1916 * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).2162 * switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP).
1917 *2163 *
1918 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.2164 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
1919 * As specified in the &enum nl80211_rxmgmt_flags.2165 * As specified in the &enum nl80211_rxmgmt_flags.
...@@ -1921,7 +2167,7 @@ enum nl80211_commands {...@@ -1921,7 +2167,7 @@ enum nl80211_commands {
1921 * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.2167 * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.
1922 *2168 *
1923 * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported2169 * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported
1924 * supported operating classes.2170 * operating classes.
1925 *2171 *
1926 * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space2172 * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space
1927 * controls DFS operation in IBSS mode. If the flag is included in2173 * controls DFS operation in IBSS mode. If the flag is included in
...@@ -2167,7 +2413,7 @@ enum nl80211_commands {...@@ -2167,7 +2413,7 @@ enum nl80211_commands {
2167 *2413 *
2168 * @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in2414 * @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in
2169 * the specified band is to be adjusted before doing2415 * the specified band is to be adjusted before doing
2170 * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparision to figure out2416 * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparison to figure out
2171 * better BSSs. The attribute value is a packed structure2417 * better BSSs. The attribute value is a packed structure
2172 * value as specified by &struct nl80211_bss_select_rssi_adjust.2418 * value as specified by &struct nl80211_bss_select_rssi_adjust.
2173 *2419 *
...@@ -2199,10 +2445,11 @@ enum nl80211_commands {...@@ -2199,10 +2445,11 @@ enum nl80211_commands {
2199 *2445 *
2200 * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with2446 * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with
2201 * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID.2447 * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID.
2202 * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way2448 * For %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP it is used to provide
2203 * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is2449 * PSK for offloading 4-way handshake for WPA/WPA2-PSK networks. For 802.1X
2204 * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute2450 * authentication it is used with %NL80211_CMD_SET_PMK. For offloaded FT
2205 * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well.2451 * support this attribute specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME
2452 * is included as well.
2206 *2453 *
2207 * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to2454 * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to
2208 * indicate that it supports multiple active scheduled scan requests.2455 * indicate that it supports multiple active scheduled scan requests.
...@@ -2220,10 +2467,10 @@ enum nl80211_commands {...@@ -2220,10 +2467,10 @@ enum nl80211_commands {
2220 * &enum nl80211_external_auth_action value). This is used with the2467 * &enum nl80211_external_auth_action value). This is used with the
2221 * %NL80211_CMD_EXTERNAL_AUTH request event.2468 * %NL80211_CMD_EXTERNAL_AUTH request event.
2222 * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user2469 * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
2223 * space supports external authentication. This attribute shall be used2470 * space supports external authentication. This attribute shall be used
2224 * only with %NL80211_CMD_CONNECT request. The driver may offload2471 * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
2225 * authentication processing to user space if this capability is indicated2472 * may offload authentication processing to user space if this capability
2226 * in NL80211_CMD_CONNECT requests from the user space.2473 * is indicated in the respective requests from the user space.
2227 *2474 *
2228 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this2475 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
2229 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.2476 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
...@@ -2232,7 +2479,7 @@ enum nl80211_commands {...@@ -2232,7 +2479,7 @@ enum nl80211_commands {
2232 * nl80211_txq_stats)2479 * nl80211_txq_stats)
2233 * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy.2480 * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy.
2234 * The smaller of this and the memory limit is enforced.2481 * The smaller of this and the memory limit is enforced.
2235 * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the2482 * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory limit (in bytes) for the
2236 * TXQ queues for this phy. The smaller of this and the packet limit is2483 * TXQ queues for this phy. The smaller of this and the packet limit is
2237 * enforced.2484 * enforced.
2238 * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes2485 * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes
...@@ -2241,6 +2488,157 @@ enum nl80211_commands {...@@ -2241,6 +2488,157 @@ enum nl80211_commands {
2241 * association request when used with NL80211_CMD_NEW_STATION). Can be set2488 * association request when used with NL80211_CMD_NEW_STATION). Can be set
2242 * only if %NL80211_STA_FLAG_WME is set.2489 * only if %NL80211_STA_FLAG_WME is set.
2243 *2490 *
2491 * @NL80211_ATTR_FTM_RESPONDER: nested attribute which user-space can include
2492 * in %NL80211_CMD_START_AP or %NL80211_CMD_SET_BEACON for fine timing
2493 * measurement (FTM) responder functionality and containing parameters as
2494 * possible, see &enum nl80211_ftm_responder_attr
2495 *
2496 * @NL80211_ATTR_FTM_RESPONDER_STATS: Nested attribute with FTM responder
2497 * statistics, see &enum nl80211_ftm_responder_stats.
2498 *
2499 * @NL80211_ATTR_TIMEOUT: Timeout for the given operation in milliseconds (u32),
2500 * if the attribute is not given no timeout is requested. Note that 0 is an
2501 * invalid value.
2502 *
2503 * @NL80211_ATTR_PEER_MEASUREMENTS: peer measurements request (and result)
2504 * data, uses nested attributes specified in
2505 * &enum nl80211_peer_measurement_attrs.
2506 * This is also used for capability advertisement in the wiphy information,
2507 * with the appropriate sub-attributes.
2508 *
2509 * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
2510 * scheduler.
2511 *
2512 * @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for
2513 * station associated with the AP. See &enum nl80211_tx_power_setting for
2514 * possible values.
2515 * @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This
2516 * allows to set Tx power for a station. If this attribute is not included,
2517 * the default per-interface tx power setting will be overriding. Driver
2518 * should be picking up the lowest tx power, either tx power per-interface
2519 * or per-station.
2520 *
2521 * @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It
2522 * is used with %NL80211_CMD_CONNECT to provide password for offloading
2523 * SAE authentication for WPA3-Personal networks.
2524 *
2525 * @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
2526 *
2527 * @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
2528 * functionality.
2529 *
2530 * @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
2531 * channel(s) that are allowed to be used for EDMG transmissions.
2532 * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute)
2533 * @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
2534 * the allowed channel bandwidth configurations. (u8 attribute)
2535 * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
2536 *
2537 * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key
2538 * (u16).
2539 *
2540 * @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings.
2541 *
2542 * @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry
2543 * using attributes from &enum nl80211_iftype_akm_attributes. This
2544 * attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating
2545 * supported AKM suites capability per interface. AKMs advertised in
2546 * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not
2547 * advertised for a specific interface type.
2548 *
2549 * @NL80211_ATTR_TID_CONFIG: TID specific configuration in a
2550 * nested attribute with &enum nl80211_tid_config_attr sub-attributes;
2551 * on output (in wiphy attributes) it contains only the feature sub-
2552 * attributes.
2553 *
2554 * @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control
2555 * port in order to forward/receive them as ordinary data frames.
2556 *
2557 * @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32,
2558 * dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value).
2559 * An optional parameter configured through %NL80211_CMD_SET_PMKSA.
2560 * Drivers that trigger roaming need to know the lifetime of the
2561 * configured PMKSA for triggering the full vs. PMKSA caching based
2562 * authentication. This timeout helps authentication methods like SAE,
2563 * where PMK gets updated only by going through a full (new SAE)
2564 * authentication instead of getting updated during an association for EAP
2565 * authentication. No new full authentication within the PMK expiry shall
2566 * result in a disassociation at the end of the lifetime.
2567 *
2568 * @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in
2569 * terms of percentage of %NL80211_ATTR_PMK_LIFETIME
2570 * (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional
2571 * parameter configured through %NL80211_CMD_SET_PMKSA. Requests the
2572 * driver to trigger a full authentication roam (without PMKSA caching)
2573 * after the reauthentication threshold time, but before the PMK lifetime
2574 * has expired.
2575 *
2576 * Authentication methods like SAE need to be able to generate a new PMKSA
2577 * entry without having to force a disconnection after the PMK timeout. If
2578 * no roaming occurs between the reauth threshold and PMK expiration,
2579 * disassociation is still forced.
2580 * @NL80211_ATTR_RECEIVE_MULTICAST: multicast flag for the
2581 * %NL80211_CMD_REGISTER_FRAME command, see the description there.
2582 * @NL80211_ATTR_WIPHY_FREQ_OFFSET: offset of the associated
2583 * %NL80211_ATTR_WIPHY_FREQ in positive KHz. Only valid when supplied with
2584 * an %NL80211_ATTR_WIPHY_FREQ_OFFSET.
2585 * @NL80211_ATTR_CENTER_FREQ1_OFFSET: Center frequency offset in KHz for the
2586 * first channel segment specified in %NL80211_ATTR_CENTER_FREQ1.
2587 * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies
2588 *
2589 * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from
2590 * association request when used with NL80211_CMD_NEW_STATION).
2591 *
2592 * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS
2593 * discovery. It is a nested attribute, see
2594 * &enum nl80211_fils_discovery_attributes.
2595 *
2596 * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure
2597 * unsolicited broadcast probe response. It is a nested attribute, see
2598 * &enum nl80211_unsol_bcast_probe_resp_attributes.
2599 *
2600 * @NL80211_ATTR_S1G_CAPABILITY: S1G Capability information element (from
2601 * association request when used with NL80211_CMD_NEW_STATION)
2602 * @NL80211_ATTR_S1G_CAPABILITY_MASK: S1G Capability Information element
2603 * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in
2604 * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT.
2605 *
2606 * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE
2607 * derivation in WPA3-Personal networks which are using SAE authentication.
2608 * This is a u8 attribute that encapsulates one of the values from
2609 * &enum nl80211_sae_pwe_mechanism.
2610 *
2611 * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when
2612 * used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields
2613 * of %nl80211_sar_attrs which specifies the sar type and related
2614 * sar specs. Sar specs contains array of %nl80211_sar_specs_attrs.
2615 *
2616 * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and
2617 * disassoc events to indicate that an immediate reconnect to the AP
2618 * is desired.
2619 *
2620 * @NL80211_ATTR_OBSS_COLOR_BITMAP: bitmap of the u64 BSS colors for the
2621 * %NL80211_CMD_OBSS_COLOR_COLLISION event.
2622 *
2623 * @NL80211_ATTR_COLOR_CHANGE_COUNT: u8 attribute specifying the number of TBTT's
2624 * until the color switch event.
2625 * @NL80211_ATTR_COLOR_CHANGE_COLOR: u8 attribute specifying the color that we are
2626 * switching to
2627 * @NL80211_ATTR_COLOR_CHANGE_ELEMS: Nested set of attributes containing the IE
2628 * information for the time while performing a color switch.
2629 *
2630 * @NL80211_ATTR_MBSSID_CONFIG: Nested attribute for multiple BSSID
2631 * advertisements (MBSSID) parameters in AP mode.
2632 * Kernel uses this attribute to indicate the driver's support for MBSSID
2633 * and enhanced multi-BSSID advertisements (EMA AP) to the userspace.
2634 * Userspace should use this attribute to configure per interface MBSSID
2635 * parameters.
2636 * See &enum nl80211_mbssid_config_attributes for details.
2637 *
2638 * @NL80211_ATTR_MBSSID_ELEMS: Nested parameter to pass multiple BSSID elements.
2639 * Mandatory parameter for the transmitting interface to enable MBSSID.
2640 * Optional for the non-transmitting interfaces.
2641 *
2244 * @NUM_NL80211_ATTR: total number of nl80211_attrs available2642 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
2245 * @NL80211_ATTR_MAX: highest attribute number currently defined2643 * @NL80211_ATTR_MAX: highest attribute number currently defined
2246 * @__NL80211_ATTR_AFTER_LAST: internal use2644 * @__NL80211_ATTR_AFTER_LAST: internal use
...@@ -2547,8 +2945,8 @@ enum nl80211_attrs {...@@ -2547,8 +2945,8 @@ enum nl80211_attrs {
2547 NL80211_ATTR_CH_SWITCH_COUNT,2945 NL80211_ATTR_CH_SWITCH_COUNT,
2548 NL80211_ATTR_CH_SWITCH_BLOCK_TX,2946 NL80211_ATTR_CH_SWITCH_BLOCK_TX,
2549 NL80211_ATTR_CSA_IES,2947 NL80211_ATTR_CSA_IES,
2550 NL80211_ATTR_CSA_C_OFF_BEACON,2948 NL80211_ATTR_CNTDWN_OFFS_BEACON,
2551 NL80211_ATTR_CSA_C_OFF_PRESP,2949 NL80211_ATTR_CNTDWN_OFFS_PRESP,
25522950
2553 NL80211_ATTR_RXMGMT_FLAGS,2951 NL80211_ATTR_RXMGMT_FLAGS,
25542952
...@@ -2682,6 +3080,71 @@ enum nl80211_attrs {...@@ -2682,6 +3080,71 @@ enum nl80211_attrs {
26823080
2683 NL80211_ATTR_HE_CAPABILITY,3081 NL80211_ATTR_HE_CAPABILITY,
26843082
3083 NL80211_ATTR_FTM_RESPONDER,
3084
3085 NL80211_ATTR_FTM_RESPONDER_STATS,
3086
3087 NL80211_ATTR_TIMEOUT,
3088
3089 NL80211_ATTR_PEER_MEASUREMENTS,
3090
3091 NL80211_ATTR_AIRTIME_WEIGHT,
3092 NL80211_ATTR_STA_TX_POWER_SETTING,
3093 NL80211_ATTR_STA_TX_POWER,
3094
3095 NL80211_ATTR_SAE_PASSWORD,
3096
3097 NL80211_ATTR_TWT_RESPONDER,
3098
3099 NL80211_ATTR_HE_OBSS_PD,
3100
3101 NL80211_ATTR_WIPHY_EDMG_CHANNELS,
3102 NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
3103
3104 NL80211_ATTR_VLAN_ID,
3105
3106 NL80211_ATTR_HE_BSS_COLOR,
3107
3108 NL80211_ATTR_IFTYPE_AKM_SUITES,
3109
3110 NL80211_ATTR_TID_CONFIG,
3111
3112 NL80211_ATTR_CONTROL_PORT_NO_PREAUTH,
3113
3114 NL80211_ATTR_PMK_LIFETIME,
3115 NL80211_ATTR_PMK_REAUTH_THRESHOLD,
3116
3117 NL80211_ATTR_RECEIVE_MULTICAST,
3118 NL80211_ATTR_WIPHY_FREQ_OFFSET,
3119 NL80211_ATTR_CENTER_FREQ1_OFFSET,
3120 NL80211_ATTR_SCAN_FREQ_KHZ,
3121
3122 NL80211_ATTR_HE_6GHZ_CAPABILITY,
3123
3124 NL80211_ATTR_FILS_DISCOVERY,
3125
3126 NL80211_ATTR_UNSOL_BCAST_PROBE_RESP,
3127
3128 NL80211_ATTR_S1G_CAPABILITY,
3129 NL80211_ATTR_S1G_CAPABILITY_MASK,
3130
3131 NL80211_ATTR_SAE_PWE,
3132
3133 NL80211_ATTR_RECONNECT_REQUESTED,
3134
3135 NL80211_ATTR_SAR_SPEC,
3136
3137 NL80211_ATTR_DISABLE_HE,
3138
3139 NL80211_ATTR_OBSS_COLOR_BITMAP,
3140
3141 NL80211_ATTR_COLOR_CHANGE_COUNT,
3142 NL80211_ATTR_COLOR_CHANGE_COLOR,
3143 NL80211_ATTR_COLOR_CHANGE_ELEMS,
3144
3145 NL80211_ATTR_MBSSID_CONFIG,
3146 NL80211_ATTR_MBSSID_ELEMS,
3147
2685 /* add attributes here, update the policy in nl80211.c */3148 /* add attributes here, update the policy in nl80211.c */
26863149
2687 __NL80211_ATTR_AFTER_LAST,3150 __NL80211_ATTR_AFTER_LAST,
...@@ -2694,6 +3157,8 @@ enum nl80211_attrs {...@@ -2694,6 +3157,8 @@ enum nl80211_attrs {
2694#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG3157#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
2695#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER3158#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
2696#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA3159#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
3160#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
3161#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
26973162
2698/*3163/*
2699 * Allow user space programs to use #ifdef on new attributes by defining them3164 * Allow user space programs to use #ifdef on new attributes by defining them
...@@ -2725,14 +3190,14 @@ enum nl80211_attrs {...@@ -2725,14 +3190,14 @@ enum nl80211_attrs {
27253190
2726#define NL80211_MAX_SUPP_RATES 323191#define NL80211_MAX_SUPP_RATES 32
2727#define NL80211_MAX_SUPP_HT_RATES 773192#define NL80211_MAX_SUPP_HT_RATES 77
2728#define NL80211_MAX_SUPP_REG_RULES 643193#define NL80211_MAX_SUPP_REG_RULES 128
2729#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 03194#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
2730#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 163195#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
2731#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 243196#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
2732#define NL80211_HT_CAPABILITY_LEN 263197#define NL80211_HT_CAPABILITY_LEN 26
2733#define NL80211_VHT_CAPABILITY_LEN 123198#define NL80211_VHT_CAPABILITY_LEN 12
2734#define NL80211_HE_MIN_CAPABILITY_LEN 163199#define NL80211_HE_MIN_CAPABILITY_LEN 16
2735#define NL80211_HE_MAX_CAPABILITY_LEN 513200#define NL80211_HE_MAX_CAPABILITY_LEN 54
2736#define NL80211_MAX_NR_CIPHER_SUITES 53201#define NL80211_MAX_NR_CIPHER_SUITES 5
2737#define NL80211_MAX_NR_AKM_SUITES 23202#define NL80211_MAX_NR_AKM_SUITES 2
27383203
...@@ -2871,6 +3336,18 @@ enum nl80211_he_gi {...@@ -2871,6 +3336,18 @@ enum nl80211_he_gi {
2871 NL80211_RATE_INFO_HE_GI_3_2,3336 NL80211_RATE_INFO_HE_GI_3_2,
2872};3337};
28733338
3339/**
3340 * enum nl80211_he_ltf - HE long training field
3341 * @NL80211_RATE_INFO_HE_1xLTF: 3.2 usec
3342 * @NL80211_RATE_INFO_HE_2xLTF: 6.4 usec
3343 * @NL80211_RATE_INFO_HE_4xLTF: 12.8 usec
3344 */
3345enum nl80211_he_ltf {
3346 NL80211_RATE_INFO_HE_1XLTF,
3347 NL80211_RATE_INFO_HE_2XLTF,
3348 NL80211_RATE_INFO_HE_4XLTF,
3349};
3350
2874/**3351/**
2875 * enum nl80211_he_ru_alloc - HE RU allocation values3352 * enum nl80211_he_ru_alloc - HE RU allocation values
2876 * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation3353 * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation
...@@ -3050,8 +3527,23 @@ enum nl80211_sta_bss_param {...@@ -3050,8 +3527,23 @@ enum nl80211_sta_bss_param {
3050 * received from the station (u64, usec)3527 * received from the station (u64, usec)
3051 * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment3528 * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
3052 * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)3529 * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
3053 * @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data)3530 * @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
3054 * ACK frame (s8, dBm)3531 * @NL80211_STA_INFO_RX_MPDUS: total number of received packets (MPDUs)
3532 * (u32, from this station)
3533 * @NL80211_STA_INFO_FCS_ERROR_COUNT: total number of packets (MPDUs) received
3534 * with an FCS error (u32, from this station). This count may not include
3535 * some packets with an FCS error due to TA corruption. Hence this counter
3536 * might not be fully accurate.
3537 * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
3538 * mesh gate (u8, 0 or 1)
3539 * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
3540 * sent to the station (u64, usec)
3541 * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
3542 * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
3543 * @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds)
3544 * of STA's association
3545 * @NL80211_STA_INFO_CONNECTED_TO_AS: set to true if STA has a path to a
3546 * authentication server (u8, 0 or 1)
3055 * @__NL80211_STA_INFO_AFTER_LAST: internal3547 * @__NL80211_STA_INFO_AFTER_LAST: internal
3056 * @NL80211_STA_INFO_MAX: highest possible station info attribute3548 * @NL80211_STA_INFO_MAX: highest possible station info attribute
3057 */3549 */
...@@ -3091,13 +3583,25 @@ enum nl80211_sta_info {...@@ -3091,13 +3583,25 @@ enum nl80211_sta_info {
3091 NL80211_STA_INFO_RX_DURATION,3583 NL80211_STA_INFO_RX_DURATION,
3092 NL80211_STA_INFO_PAD,3584 NL80211_STA_INFO_PAD,
3093 NL80211_STA_INFO_ACK_SIGNAL,3585 NL80211_STA_INFO_ACK_SIGNAL,
3094 NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,3586 NL80211_STA_INFO_ACK_SIGNAL_AVG,
3587 NL80211_STA_INFO_RX_MPDUS,
3588 NL80211_STA_INFO_FCS_ERROR_COUNT,
3589 NL80211_STA_INFO_CONNECTED_TO_GATE,
3590 NL80211_STA_INFO_TX_DURATION,
3591 NL80211_STA_INFO_AIRTIME_WEIGHT,
3592 NL80211_STA_INFO_AIRTIME_LINK_METRIC,
3593 NL80211_STA_INFO_ASSOC_AT_BOOTTIME,
3594 NL80211_STA_INFO_CONNECTED_TO_AS,
30953595
3096 /* keep last */3596 /* keep last */
3097 __NL80211_STA_INFO_AFTER_LAST,3597 __NL80211_STA_INFO_AFTER_LAST,
3098 NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 13598 NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
3099};3599};
31003600
3601/* we renamed this - stay compatible */
3602#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG
3603
3604
3101/**3605/**
3102 * enum nl80211_tid_stats - per TID statistics attributes3606 * enum nl80211_tid_stats - per TID statistics attributes
3103 * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved3607 * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
...@@ -3197,8 +3701,10 @@ enum nl80211_mpath_flags {...@@ -3197,8 +3701,10 @@ enum nl80211_mpath_flags {
3197 * &enum nl80211_mpath_flags;3701 * &enum nl80211_mpath_flags;
3198 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec3702 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
3199 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries3703 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
3704 * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
3705 * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination
3200 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number3706 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
3201 * currently defind3707 * currently defined
3202 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use3708 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
3203 */3709 */
3204enum nl80211_mpath_info {3710enum nl80211_mpath_info {
...@@ -3210,6 +3716,8 @@ enum nl80211_mpath_info {...@@ -3210,6 +3716,8 @@ enum nl80211_mpath_info {
3210 NL80211_MPATH_INFO_FLAGS,3716 NL80211_MPATH_INFO_FLAGS,
3211 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,3717 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
3212 NL80211_MPATH_INFO_DISCOVERY_RETRIES,3718 NL80211_MPATH_INFO_DISCOVERY_RETRIES,
3719 NL80211_MPATH_INFO_HOP_COUNT,
3720 NL80211_MPATH_INFO_PATH_CHANGE,
32133721
3214 /* keep last */3722 /* keep last */
3215 __NL80211_MPATH_INFO_AFTER_LAST,3723 __NL80211_MPATH_INFO_AFTER_LAST,
...@@ -3232,6 +3740,10 @@ enum nl80211_mpath_info {...@@ -3232,6 +3740,10 @@ enum nl80211_mpath_info {
3232 * defined in HE capabilities IE3740 * defined in HE capabilities IE
3233 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently3741 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
3234 * defined3742 * defined
3743 * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
3744 * given for all 6 GHz band channels
3745 * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
3746 * advertised on this band/for this iftype (binary)
3235 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use3747 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
3236 */3748 */
3237enum nl80211_band_iftype_attr {3749enum nl80211_band_iftype_attr {
...@@ -3242,6 +3754,8 @@ enum nl80211_band_iftype_attr {...@@ -3242,6 +3754,8 @@ enum nl80211_band_iftype_attr {
3242 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY,3754 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY,
3243 NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET,3755 NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET,
3244 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,3756 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
3757 NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
3758 NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,
32453759
3246 /* keep last */3760 /* keep last */
3247 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,3761 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
...@@ -3265,6 +3779,12 @@ enum nl80211_band_iftype_attr {...@@ -3265,6 +3779,12 @@ enum nl80211_band_iftype_attr {
3265 * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE3779 * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
3266 * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using3780 * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using
3267 * attributes from &enum nl80211_band_iftype_attr3781 * attributes from &enum nl80211_band_iftype_attr
3782 * @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
3783 * channel(s) that are allowed to be used for EDMG transmissions.
3784 * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251.
3785 * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
3786 * the allowed channel bandwidth configurations.
3787 * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
3268 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined3788 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
3269 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use3789 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
3270 */3790 */
...@@ -3282,6 +3802,9 @@ enum nl80211_band_attr {...@@ -3282,6 +3802,9 @@ enum nl80211_band_attr {
3282 NL80211_BAND_ATTR_VHT_CAPA,3802 NL80211_BAND_ATTR_VHT_CAPA,
3283 NL80211_BAND_ATTR_IFTYPE_DATA,3803 NL80211_BAND_ATTR_IFTYPE_DATA,
32843804
3805 NL80211_BAND_ATTR_EDMG_CHANNELS,
3806 NL80211_BAND_ATTR_EDMG_BW_CONFIG,
3807
3285 /* keep last */3808 /* keep last */
3286 __NL80211_BAND_ATTR_AFTER_LAST,3809 __NL80211_BAND_ATTR_AFTER_LAST,
3287 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 13810 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
...@@ -3364,6 +3887,19 @@ enum nl80211_wmm_rule {...@@ -3364,6 +3887,19 @@ enum nl80211_wmm_rule {
3364 * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations.3887 * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations.
3365 * This is a nested attribute that contains the wmm limitation per AC.3888 * This is a nested attribute that contains the wmm limitation per AC.
3366 * (see &enum nl80211_wmm_rule)3889 * (see &enum nl80211_wmm_rule)
3890 * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel
3891 * in current regulatory domain.
3892 * @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz
3893 * @NL80211_FREQUENCY_ATTR_1MHZ: 1 MHz operation is allowed
3894 * on this channel in current regulatory domain.
3895 * @NL80211_FREQUENCY_ATTR_2MHZ: 2 MHz operation is allowed
3896 * on this channel in current regulatory domain.
3897 * @NL80211_FREQUENCY_ATTR_4MHZ: 4 MHz operation is allowed
3898 * on this channel in current regulatory domain.
3899 * @NL80211_FREQUENCY_ATTR_8MHZ: 8 MHz operation is allowed
3900 * on this channel in current regulatory domain.
3901 * @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
3902 * on this channel in current regulatory domain.
3367 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number3903 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
3368 * currently defined3904 * currently defined
3369 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use3905 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
...@@ -3393,6 +3929,13 @@ enum nl80211_frequency_attr {...@@ -3393,6 +3929,13 @@ enum nl80211_frequency_attr {
3393 NL80211_FREQUENCY_ATTR_NO_20MHZ,3929 NL80211_FREQUENCY_ATTR_NO_20MHZ,
3394 NL80211_FREQUENCY_ATTR_NO_10MHZ,3930 NL80211_FREQUENCY_ATTR_NO_10MHZ,
3395 NL80211_FREQUENCY_ATTR_WMM,3931 NL80211_FREQUENCY_ATTR_WMM,
3932 NL80211_FREQUENCY_ATTR_NO_HE,
3933 NL80211_FREQUENCY_ATTR_OFFSET,
3934 NL80211_FREQUENCY_ATTR_1MHZ,
3935 NL80211_FREQUENCY_ATTR_2MHZ,
3936 NL80211_FREQUENCY_ATTR_4MHZ,
3937 NL80211_FREQUENCY_ATTR_8MHZ,
3938 NL80211_FREQUENCY_ATTR_16MHZ,
33963939
3397 /* keep last */3940 /* keep last */
3398 __NL80211_FREQUENCY_ATTR_AFTER_LAST,3941 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
...@@ -3538,6 +4081,14 @@ enum nl80211_reg_rule_attr {...@@ -3538,6 +4081,14 @@ enum nl80211_reg_rule_attr {
3538 * value as specified by &struct nl80211_bss_select_rssi_adjust.4081 * value as specified by &struct nl80211_bss_select_rssi_adjust.
3539 * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching4082 * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
3540 * (this cannot be used together with SSID).4083 * (this cannot be used together with SSID).
4084 * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
4085 * band specific minimum rssi thresholds for the bands defined in
4086 * enum nl80211_band. The minimum rssi threshold value(s32) specific to a
4087 * band shall be encapsulated in attribute with type value equals to one
4088 * of the NL80211_BAND_* defined in enum nl80211_band. For example, the
4089 * minimum rssi threshold value for 2.4GHZ band shall be encapsulated
4090 * within an attribute of type NL80211_BAND_2GHZ. And one or more of such
4091 * attributes will be nested within this attribute.
3541 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter4092 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
3542 * attribute number currently defined4093 * attribute number currently defined
3543 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use4094 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
...@@ -3550,6 +4101,7 @@ enum nl80211_sched_scan_match_attr {...@@ -3550,6 +4101,7 @@ enum nl80211_sched_scan_match_attr {
3550 NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,4101 NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
3551 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,4102 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
3552 NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,4103 NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
4104 NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
35534105
3554 /* keep last */4106 /* keep last */
3555 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,4107 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
...@@ -3581,6 +4133,7 @@ enum nl80211_sched_scan_match_attr {...@@ -3581,6 +4133,7 @@ enum nl80211_sched_scan_match_attr {
3581 * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation4133 * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
3582 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed4134 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
3583 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed4135 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
4136 * @NL80211_RRF_NO_HE: HE operation not allowed
3584 */4137 */
3585enum nl80211_reg_rule_flags {4138enum nl80211_reg_rule_flags {
3586 NL80211_RRF_NO_OFDM = 1<<0,4139 NL80211_RRF_NO_OFDM = 1<<0,
...@@ -3598,6 +4151,7 @@ enum nl80211_reg_rule_flags {...@@ -3598,6 +4151,7 @@ enum nl80211_reg_rule_flags {
3598 NL80211_RRF_NO_HT40PLUS = 1<<14,4151 NL80211_RRF_NO_HT40PLUS = 1<<14,
3599 NL80211_RRF_NO_80MHZ = 1<<15,4152 NL80211_RRF_NO_80MHZ = 1<<15,
3600 NL80211_RRF_NO_160MHZ = 1<<16,4153 NL80211_RRF_NO_160MHZ = 1<<16,
4154 NL80211_RRF_NO_HE = 1<<17,
3601};4155};
36024156
3603#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR4157#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
...@@ -3671,8 +4225,11 @@ enum nl80211_user_reg_hint_type {...@@ -3671,8 +4225,11 @@ enum nl80211_user_reg_hint_type {
3671 * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan4225 * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
3672 * (on this channel or globally)4226 * (on this channel or globally)
3673 * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment4227 * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
4228 * @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent
4229 * receiving frames destined to the local BSS
3674 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number4230 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
3675 * currently defined4231 * currently defined
4232 * @NL80211_SURVEY_INFO_FREQUENCY_OFFSET: center frequency offset in KHz
3676 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use4233 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
3677 */4234 */
3678enum nl80211_survey_info {4235enum nl80211_survey_info {
...@@ -3687,6 +4244,8 @@ enum nl80211_survey_info {...@@ -3687,6 +4244,8 @@ enum nl80211_survey_info {
3687 NL80211_SURVEY_INFO_TIME_TX,4244 NL80211_SURVEY_INFO_TIME_TX,
3688 NL80211_SURVEY_INFO_TIME_SCAN,4245 NL80211_SURVEY_INFO_TIME_SCAN,
3689 NL80211_SURVEY_INFO_PAD,4246 NL80211_SURVEY_INFO_PAD,
4247 NL80211_SURVEY_INFO_TIME_BSS_RX,
4248 NL80211_SURVEY_INFO_FREQUENCY_OFFSET,
36904249
3691 /* keep last */4250 /* keep last */
3692 __NL80211_SURVEY_INFO_AFTER_LAST,4251 __NL80211_SURVEY_INFO_AFTER_LAST,
...@@ -3867,6 +4426,21 @@ enum nl80211_mesh_power_mode {...@@ -3867,6 +4426,21 @@ enum nl80211_mesh_power_mode {
3867 * remove it from the STA's list of peers. You may set this to 0 to disable4426 * remove it from the STA's list of peers. You may set this to 0 to disable
3868 * the removal of the STA. Default is 30 minutes.4427 * the removal of the STA. Default is 30 minutes.
3869 *4428 *
4429 * @NL80211_MESHCONF_CONNECTED_TO_GATE: If set to true then this mesh STA
4430 * will advertise that it is connected to a gate in the mesh formation
4431 * field. If left unset then the mesh formation field will only
4432 * advertise such if there is an active root mesh path.
4433 *
4434 * @NL80211_MESHCONF_NOLEARN: Try to avoid multi-hop path discovery (e.g.
4435 * PREQ/PREP for HWMP) if the destination is a direct neighbor. Note that
4436 * this might not be the optimal decision as a multi-hop route might be
4437 * better. So if using this setting you will likely also want to disable
4438 * dot11MeshForwarding and use another mesh routing protocol on top.
4439 *
4440 * @NL80211_MESHCONF_CONNECTED_TO_AS: If set to true then this mesh STA
4441 * will advertise that it is connected to a authentication server
4442 * in the mesh formation field.
4443 *
3870 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use4444 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
3871 */4445 */
3872enum nl80211_meshconf_params {4446enum nl80211_meshconf_params {
...@@ -3899,6 +4473,9 @@ enum nl80211_meshconf_params {...@@ -3899,6 +4473,9 @@ enum nl80211_meshconf_params {
3899 NL80211_MESHCONF_POWER_MODE,4473 NL80211_MESHCONF_POWER_MODE,
3900 NL80211_MESHCONF_AWAKE_WINDOW,4474 NL80211_MESHCONF_AWAKE_WINDOW,
3901 NL80211_MESHCONF_PLINK_TIMEOUT,4475 NL80211_MESHCONF_PLINK_TIMEOUT,
4476 NL80211_MESHCONF_CONNECTED_TO_GATE,
4477 NL80211_MESHCONF_NOLEARN,
4478 NL80211_MESHCONF_CONNECTED_TO_AS,
39024479
3903 /* keep last */4480 /* keep last */
3904 __NL80211_MESHCONF_ATTR_AFTER_LAST,4481 __NL80211_MESHCONF_ATTR_AFTER_LAST,
...@@ -4028,6 +4605,27 @@ enum nl80211_channel_type {...@@ -4028,6 +4605,27 @@ enum nl80211_channel_type {
4028 NL80211_CHAN_HT40PLUS4605 NL80211_CHAN_HT40PLUS
4029};4606};
40304607
4608/**
4609 * enum nl80211_key_mode - Key mode
4610 *
4611 * @NL80211_KEY_RX_TX: (Default)
4612 * Key can be used for Rx and Tx immediately
4613 *
4614 * The following modes can only be selected for unicast keys and when the
4615 * driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID:
4616 *
4617 * @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY:
4618 * Unicast key can only be used for Rx, Tx not allowed, yet
4619 * @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY:
4620 * The unicast key identified by idx and mac is cleared for Tx and becomes
4621 * the preferred Tx key for the station.
4622 */
4623enum nl80211_key_mode {
4624 NL80211_KEY_RX_TX,
4625 NL80211_KEY_NO_TX,
4626 NL80211_KEY_SET_TX
4627};
4628
4031/**4629/**
4032 * enum nl80211_chan_width - channel width definitions4630 * enum nl80211_chan_width - channel width definitions
4033 *4631 *
...@@ -4046,6 +4644,11 @@ enum nl80211_channel_type {...@@ -4046,6 +4644,11 @@ enum nl80211_channel_type {
4046 * attribute must be provided as well4644 * attribute must be provided as well
4047 * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel4645 * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
4048 * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel4646 * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
4647 * @NL80211_CHAN_WIDTH_1: 1 MHz OFDM channel
4648 * @NL80211_CHAN_WIDTH_2: 2 MHz OFDM channel
4649 * @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel
4650 * @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel
4651 * @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel
4049 */4652 */
4050enum nl80211_chan_width {4653enum nl80211_chan_width {
4051 NL80211_CHAN_WIDTH_20_NOHT,4654 NL80211_CHAN_WIDTH_20_NOHT,
...@@ -4056,6 +4659,11 @@ enum nl80211_chan_width {...@@ -4056,6 +4659,11 @@ enum nl80211_chan_width {
4056 NL80211_CHAN_WIDTH_160,4659 NL80211_CHAN_WIDTH_160,
4057 NL80211_CHAN_WIDTH_5,4660 NL80211_CHAN_WIDTH_5,
4058 NL80211_CHAN_WIDTH_10,4661 NL80211_CHAN_WIDTH_10,
4662 NL80211_CHAN_WIDTH_1,
4663 NL80211_CHAN_WIDTH_2,
4664 NL80211_CHAN_WIDTH_4,
4665 NL80211_CHAN_WIDTH_8,
4666 NL80211_CHAN_WIDTH_16,
4059};4667};
40604668
4061/**4669/**
...@@ -4066,11 +4674,15 @@ enum nl80211_chan_width {...@@ -4066,11 +4674,15 @@ enum nl80211_chan_width {
4066 * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible4674 * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
4067 * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide4675 * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
4068 * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide4676 * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
4677 * @NL80211_BSS_CHAN_WIDTH_1: control channel is 1 MHz wide
4678 * @NL80211_BSS_CHAN_WIDTH_2: control channel is 2 MHz wide
4069 */4679 */
4070enum nl80211_bss_scan_width {4680enum nl80211_bss_scan_width {
4071 NL80211_BSS_CHAN_WIDTH_20,4681 NL80211_BSS_CHAN_WIDTH_20,
4072 NL80211_BSS_CHAN_WIDTH_10,4682 NL80211_BSS_CHAN_WIDTH_10,
4073 NL80211_BSS_CHAN_WIDTH_5,4683 NL80211_BSS_CHAN_WIDTH_5,
4684 NL80211_BSS_CHAN_WIDTH_1,
4685 NL80211_BSS_CHAN_WIDTH_2,
4074};4686};
40754687
4076/**4688/**
...@@ -4122,6 +4734,7 @@ enum nl80211_bss_scan_width {...@@ -4122,6 +4734,7 @@ enum nl80211_bss_scan_width {
4122 * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update.4734 * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update.
4123 * Contains a nested array of signal strength attributes (u8, dBm),4735 * Contains a nested array of signal strength attributes (u8, dBm),
4124 * using the nesting index as the antenna number.4736 * using the nesting index as the antenna number.
4737 * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
4125 * @__NL80211_BSS_AFTER_LAST: internal4738 * @__NL80211_BSS_AFTER_LAST: internal
4126 * @NL80211_BSS_MAX: highest BSS attribute4739 * @NL80211_BSS_MAX: highest BSS attribute
4127 */4740 */
...@@ -4146,6 +4759,7 @@ enum nl80211_bss {...@@ -4146,6 +4759,7 @@ enum nl80211_bss {
4146 NL80211_BSS_PARENT_TSF,4759 NL80211_BSS_PARENT_TSF,
4147 NL80211_BSS_PARENT_BSSID,4760 NL80211_BSS_PARENT_BSSID,
4148 NL80211_BSS_CHAIN_SIGNAL,4761 NL80211_BSS_CHAIN_SIGNAL,
4762 NL80211_BSS_FREQUENCY_OFFSET,
41494763
4150 /* keep last */4764 /* keep last */
4151 __NL80211_BSS_AFTER_LAST,4765 __NL80211_BSS_AFTER_LAST,
...@@ -4233,6 +4847,7 @@ enum nl80211_mfp {...@@ -4233,6 +4847,7 @@ enum nl80211_mfp {
4233enum nl80211_wpa_versions {4847enum nl80211_wpa_versions {
4234 NL80211_WPA_VERSION_1 = 1 << 0,4848 NL80211_WPA_VERSION_1 = 1 << 0,
4235 NL80211_WPA_VERSION_2 = 1 << 1,4849 NL80211_WPA_VERSION_2 = 1 << 1,
4850 NL80211_WPA_VERSION_3 = 1 << 2,
4236};4851};
42374852
4238/**4853/**
...@@ -4271,6 +4886,10 @@ enum nl80211_key_default_types {...@@ -4271,6 +4886,10 @@ enum nl80211_key_default_types {
4271 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags4886 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
4272 * attributes, specifying what a key should be set as default as.4887 * attributes, specifying what a key should be set as default as.
4273 * See &enum nl80211_key_default_types.4888 * See &enum nl80211_key_default_types.
4889 * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
4890 * Defaults to @NL80211_KEY_RX_TX.
4891 * @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key
4892 *
4274 * @__NL80211_KEY_AFTER_LAST: internal4893 * @__NL80211_KEY_AFTER_LAST: internal
4275 * @NL80211_KEY_MAX: highest key attribute4894 * @NL80211_KEY_MAX: highest key attribute
4276 */4895 */
...@@ -4284,6 +4903,8 @@ enum nl80211_key_attributes {...@@ -4284,6 +4903,8 @@ enum nl80211_key_attributes {
4284 NL80211_KEY_DEFAULT_MGMT,4903 NL80211_KEY_DEFAULT_MGMT,
4285 NL80211_KEY_TYPE,4904 NL80211_KEY_TYPE,
4286 NL80211_KEY_DEFAULT_TYPES,4905 NL80211_KEY_DEFAULT_TYPES,
4906 NL80211_KEY_MODE,
4907 NL80211_KEY_DEFAULT_BEACON,
42874908
4288 /* keep last */4909 /* keep last */
4289 __NL80211_KEY_AFTER_LAST,4910 __NL80211_KEY_AFTER_LAST,
...@@ -4302,6 +4923,10 @@ enum nl80211_key_attributes {...@@ -4302,6 +4923,10 @@ enum nl80211_key_attributes {
4302 * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,4923 * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
4303 * see &struct nl80211_txrate_vht4924 * see &struct nl80211_txrate_vht
4304 * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi4925 * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
4926 * @NL80211_TXRATE_HE: HE rates allowed for TX rate selection,
4927 * see &struct nl80211_txrate_he
4928 * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us.
4929 * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF.
4305 * @__NL80211_TXRATE_AFTER_LAST: internal4930 * @__NL80211_TXRATE_AFTER_LAST: internal
4306 * @NL80211_TXRATE_MAX: highest TX rate attribute4931 * @NL80211_TXRATE_MAX: highest TX rate attribute
4307 */4932 */
...@@ -4311,6 +4936,9 @@ enum nl80211_tx_rate_attributes {...@@ -4311,6 +4936,9 @@ enum nl80211_tx_rate_attributes {
4311 NL80211_TXRATE_HT,4936 NL80211_TXRATE_HT,
4312 NL80211_TXRATE_VHT,4937 NL80211_TXRATE_VHT,
4313 NL80211_TXRATE_GI,4938 NL80211_TXRATE_GI,
4939 NL80211_TXRATE_HE,
4940 NL80211_TXRATE_HE_GI,
4941 NL80211_TXRATE_HE_LTF,
43144942
4315 /* keep last */4943 /* keep last */
4316 __NL80211_TXRATE_AFTER_LAST,4944 __NL80211_TXRATE_AFTER_LAST,
...@@ -4328,6 +4956,15 @@ struct nl80211_txrate_vht {...@@ -4328,6 +4956,15 @@ struct nl80211_txrate_vht {
4328 __u16 mcs[NL80211_VHT_NSS_MAX];4956 __u16 mcs[NL80211_VHT_NSS_MAX];
4329};4957};
43304958
4959#define NL80211_HE_NSS_MAX 8
4960/**
4961 * struct nl80211_txrate_he - HE MCS/NSS txrate bitmap
4962 * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
4963 */
4964struct nl80211_txrate_he {
4965 __u16 mcs[NL80211_HE_NSS_MAX];
4966};
4967
4331enum nl80211_txrate_gi {4968enum nl80211_txrate_gi {
4332 NL80211_TXRATE_DEFAULT_GI,4969 NL80211_TXRATE_DEFAULT_GI,
4333 NL80211_TXRATE_FORCE_SGI,4970 NL80211_TXRATE_FORCE_SGI,
...@@ -4338,7 +4975,10 @@ enum nl80211_txrate_gi {...@@ -4338,7 +4975,10 @@ enum nl80211_txrate_gi {
4338 * enum nl80211_band - Frequency band4975 * enum nl80211_band - Frequency band
4339 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band4976 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
4340 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)4977 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
4341 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)4978 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
4979 * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
4980 * @NL80211_BAND_S1GHZ: around 900MHz, supported by S1G PHYs
4981 * @NL80211_BAND_LC: light communication band (placeholder)
4342 * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace4982 * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
4343 * since newer kernel versions may support more bands4983 * since newer kernel versions may support more bands
4344 */4984 */
...@@ -4346,6 +4986,9 @@ enum nl80211_band {...@@ -4346,6 +4986,9 @@ enum nl80211_band {
4346 NL80211_BAND_2GHZ,4986 NL80211_BAND_2GHZ,
4347 NL80211_BAND_5GHZ,4987 NL80211_BAND_5GHZ,
4348 NL80211_BAND_60GHZ,4988 NL80211_BAND_60GHZ,
4989 NL80211_BAND_6GHZ,
4990 NL80211_BAND_S1GHZ,
4991 NL80211_BAND_LC,
43494992
4350 NUM_NL80211_BANDS,4993 NUM_NL80211_BANDS,
4351};4994};
...@@ -4437,6 +5080,92 @@ enum nl80211_tx_power_setting {...@@ -4437,6 +5080,92 @@ enum nl80211_tx_power_setting {
4437 NL80211_TX_POWER_FIXED,5080 NL80211_TX_POWER_FIXED,
4438};5081};
44395082
5083/**
5084 * enum nl80211_tid_config - TID config state
5085 * @NL80211_TID_CONFIG_ENABLE: Enable config for the TID
5086 * @NL80211_TID_CONFIG_DISABLE: Disable config for the TID
5087 */
5088enum nl80211_tid_config {
5089 NL80211_TID_CONFIG_ENABLE,
5090 NL80211_TID_CONFIG_DISABLE,
5091};
5092
5093/* enum nl80211_tx_rate_setting - TX rate configuration type
5094 * @NL80211_TX_RATE_AUTOMATIC: automatically determine TX rate
5095 * @NL80211_TX_RATE_LIMITED: limit the TX rate by the TX rate parameter
5096 * @NL80211_TX_RATE_FIXED: fix TX rate to the TX rate parameter
5097 */
5098enum nl80211_tx_rate_setting {
5099 NL80211_TX_RATE_AUTOMATIC,
5100 NL80211_TX_RATE_LIMITED,
5101 NL80211_TX_RATE_FIXED,
5102};
5103
5104/* enum nl80211_tid_config_attr - TID specific configuration.
5105 * @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values
5106 * @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported
5107 * for per-vif configuration; doesn't list the ones that are generic
5108 * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
5109 * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
5110 * per peer instead.
5111 * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates
5112 * that the new configuration overrides all previous peer
5113 * configurations, otherwise previous peer specific configurations
5114 * should be left untouched.
5115 * @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7)
5116 * Its type is u16.
5117 * @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID.
5118 * specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config.
5119 * Its type is u8.
5120 * @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame
5121 * transmission, user-space sets this configuration in
5122 * &NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and
5123 * the max value is advertised by the driver in this attribute on
5124 * output in wiphy capabilities.
5125 * @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame
5126 * transmission, user-space sets this configuration in
5127 * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and
5128 * the max value is advertised by the driver in this attribute on
5129 * output in wiphy capabilities.
5130 * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable MPDU aggregation
5131 * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS.
5132 * Its type is u8, using the values from &nl80211_tid_config.
5133 * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TIDs
5134 * specified in %NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type, using
5135 * the values from &nl80211_tid_config.
5136 * @NL80211_TID_CONFIG_ATTR_AMSDU_CTRL: Enable/Disable MSDU aggregation
5137 * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS.
5138 * Its type is u8, using the values from &nl80211_tid_config.
5139 * @NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE: This attribute will be useful
5140 * to notfiy the driver that what type of txrate should be used
5141 * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. using
5142 * the values form &nl80211_tx_rate_setting.
5143 * @NL80211_TID_CONFIG_ATTR_TX_RATE: Data frame TX rate mask should be applied
5144 * with the parameters passed through %NL80211_ATTR_TX_RATES.
5145 * configuration is applied to the data frame for the tid to that connected
5146 * station.
5147 */
5148enum nl80211_tid_config_attr {
5149 __NL80211_TID_CONFIG_ATTR_INVALID,
5150 NL80211_TID_CONFIG_ATTR_PAD,
5151 NL80211_TID_CONFIG_ATTR_VIF_SUPP,
5152 NL80211_TID_CONFIG_ATTR_PEER_SUPP,
5153 NL80211_TID_CONFIG_ATTR_OVERRIDE,
5154 NL80211_TID_CONFIG_ATTR_TIDS,
5155 NL80211_TID_CONFIG_ATTR_NOACK,
5156 NL80211_TID_CONFIG_ATTR_RETRY_SHORT,
5157 NL80211_TID_CONFIG_ATTR_RETRY_LONG,
5158 NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
5159 NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL,
5160 NL80211_TID_CONFIG_ATTR_AMSDU_CTRL,
5161 NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE,
5162 NL80211_TID_CONFIG_ATTR_TX_RATE,
5163
5164 /* keep last */
5165 __NL80211_TID_CONFIG_ATTR_AFTER_LAST,
5166 NL80211_TID_CONFIG_ATTR_MAX = __NL80211_TID_CONFIG_ATTR_AFTER_LAST - 1
5167};
5168
4440/**5169/**
4441 * enum nl80211_packet_pattern_attr - packet pattern attribute5170 * enum nl80211_packet_pattern_attr - packet pattern attribute
4442 * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute5171 * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
...@@ -4831,7 +5560,7 @@ enum nl80211_iface_limit_attrs {...@@ -4831,7 +5560,7 @@ enum nl80211_iface_limit_attrs {
4831 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 45560 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
4832 * => allows a STA plus three P2P interfaces5561 * => allows a STA plus three P2P interfaces
4833 *5562 *
4834 * The list of these four possiblities could completely be contained5563 * The list of these four possibilities could completely be contained
4835 * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate5564 * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
4836 * that any of these groups must match.5565 * that any of these groups must match.
4837 *5566 *
...@@ -4861,7 +5590,7 @@ enum nl80211_if_combination_attrs {...@@ -4861,7 +5590,7 @@ enum nl80211_if_combination_attrs {
4861 * enum nl80211_plink_state - state of a mesh peer link finite state machine5590 * enum nl80211_plink_state - state of a mesh peer link finite state machine
4862 *5591 *
4863 * @NL80211_PLINK_LISTEN: initial state, considered the implicit5592 * @NL80211_PLINK_LISTEN: initial state, considered the implicit
4864 * state of non existant mesh peer links5593 * state of non existent mesh peer links
4865 * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to5594 * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
4866 * this mesh peer5595 * this mesh peer
4867 * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received5596 * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
...@@ -4908,6 +5637,8 @@ enum plink_actions {...@@ -4908,6 +5637,8 @@ enum plink_actions {
49085637
4909#define NL80211_KCK_LEN 165638#define NL80211_KCK_LEN 16
4910#define NL80211_KEK_LEN 165639#define NL80211_KEK_LEN 16
5640#define NL80211_KCK_EXT_LEN 24
5641#define NL80211_KEK_EXT_LEN 32
4911#define NL80211_REPLAY_CTR_LEN 85642#define NL80211_REPLAY_CTR_LEN 8
49125643
4913/**5644/**
...@@ -4916,6 +5647,7 @@ enum plink_actions {...@@ -4916,6 +5647,7 @@ enum plink_actions {
4916 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)5647 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
4917 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)5648 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
4918 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)5649 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
5650 * @NL80211_REKEY_DATA_AKM: AKM data (OUI, suite type)
4919 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)5651 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
4920 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)5652 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
4921 */5653 */
...@@ -4924,6 +5656,7 @@ enum nl80211_rekey_data {...@@ -4924,6 +5656,7 @@ enum nl80211_rekey_data {
4924 NL80211_REKEY_DATA_KEK,5656 NL80211_REKEY_DATA_KEK,
4925 NL80211_REKEY_DATA_KCK,5657 NL80211_REKEY_DATA_KCK,
4926 NL80211_REKEY_DATA_REPLAY_CTR,5658 NL80211_REKEY_DATA_REPLAY_CTR,
5659 NL80211_REKEY_DATA_AKM,
49275660
4928 /* keep last */5661 /* keep last */
4929 NUM_NL80211_REKEY_DATA,5662 NUM_NL80211_REKEY_DATA,
...@@ -5137,14 +5870,14 @@ enum nl80211_feature_flags {...@@ -5137,14 +5870,14 @@ enum nl80211_feature_flags {
5137 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,5870 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,
5138 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,5871 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,
5139 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,5872 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,
5140 NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1 << 31,5873 NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1U << 31,
5141};5874};
51425875
5143/**5876/**
5144 * enum nl80211_ext_feature_index - bit index of extended features.5877 * enum nl80211_ext_feature_index - bit index of extended features.
5145 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.5878 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
5146 * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can5879 * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
5147 * can request to use RRM (see %NL80211_ATTR_USE_RRM) with5880 * request to use RRM (see %NL80211_ATTR_USE_RRM) with
5148 * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set5881 * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
5149 * the ASSOC_REQ_USE_RRM flag in the association request even if5882 * the ASSOC_REQ_USE_RRM flag in the association request even if
5150 * NL80211_FEATURE_QUIET is not advertized.5883 * NL80211_FEATURE_QUIET is not advertized.
...@@ -5213,9 +5946,8 @@ enum nl80211_feature_flags {...@@ -5213,9 +5946,8 @@ enum nl80211_feature_flags {
5213 * "radar detected" event.5946 * "radar detected" event.
5214 * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and5947 * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and
5215 * receiving control port frames over nl80211 instead of the netdevice.5948 * receiving control port frames over nl80211 instead of the netdevice.
5216 * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack5949 * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
5217 * rssi if firmware support, this flag is to intimate about ack rssi5950 * (average) ACK signal strength reporting.
5218 * support to nl80211.
5219 * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate5951 * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
5220 * TXQs.5952 * TXQs.
5221 * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the5953 * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
...@@ -5223,6 +5955,101 @@ enum nl80211_feature_flags {...@@ -5223,6 +5955,101 @@ enum nl80211_feature_flags {
5223 * @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data5955 * @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data
5224 * except for supported rates from the probe request content if requested5956 * except for supported rates from the probe request content if requested
5225 * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.5957 * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.
5958 * @NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER: Driver supports enabling fine
5959 * timing measurement responder role.
5960 *
5961 * @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0: Driver/device confirm that they are
5962 * able to rekey an in-use key correctly. Userspace must not rekey PTK keys
5963 * if this flag is not set. Ignoring this can leak clear text packets and/or
5964 * freeze the connection.
5965 * @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for
5966 * Individually Addressed Frames" from IEEE802.11-2016.
5967 *
5968 * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
5969 * fairness for transmitted packets and has enabled airtime fairness
5970 * scheduling.
5971 *
5972 * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
5973 * (set/del PMKSA operations) in AP mode.
5974 *
5975 * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
5976 * filtering of sched scan results using band specific RSSI thresholds.
5977 *
5978 * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
5979 * to a station.
5980 *
5981 * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
5982 * station mode (SAE password is passed as part of the connect command).
5983 *
5984 * @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev
5985 * with VLAN tagged frames and separate VLAN-specific netdevs added using
5986 * vconfig similarly to the Ethernet case.
5987 *
5988 * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL)
5989 * feature, which prevents bufferbloat by using the expected transmission
5990 * time to limit the amount of data buffered in the hardware.
5991 *
5992 * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection
5993 * and can receive key configuration for BIGTK using key indexes 6 and 7.
5994 * @NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT: The driver supports Beacon
5995 * protection as a client only and cannot transmit protected beacons.
5996 *
5997 * @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the
5998 * forwarding of preauth frames over the control port. They are then
5999 * handled as ordinary data frames.
6000 *
6001 * @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames
6002 *
6003 * @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations
6004 * in IBSS mode, essentially by dropping their state.
6005 *
6006 * @NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS: management frame registrations
6007 * are possible for multicast frames and those will be reported properly.
6008 *
6009 * @NL80211_EXT_FEATURE_SCAN_FREQ_KHZ: This driver supports receiving and
6010 * reporting scan request with %NL80211_ATTR_SCAN_FREQ_KHZ. In order to
6011 * report %NL80211_ATTR_SCAN_FREQ_KHZ, %NL80211_SCAN_FLAG_FREQ_KHZ must be
6012 * included in the scan request.
6013 *
6014 * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS: The driver
6015 * can report tx status for control port over nl80211 tx operations.
6016 *
6017 * @NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION: Driver supports Operating
6018 * Channel Validation (OCV) when using driver's SME for RSNA handshakes.
6019 *
6020 * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK: Device wants to do 4-way
6021 * handshake with PSK in AP mode (PSK is passed as part of the start AP
6022 * command).
6023 *
6024 * @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP: Device wants to do SAE authentication
6025 * in AP mode (SAE password is passed as part of the start AP command).
6026 *
6027 * @NL80211_EXT_FEATURE_FILS_DISCOVERY: Driver/device supports FILS discovery
6028 * frames transmission
6029 *
6030 * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports
6031 * unsolicited broadcast probe response transmission
6032 *
6033 * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
6034 * configuration (AP/mesh) with HE rates.
6035 *
6036 * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement
6037 * exchange protocol.
6038 *
6039 * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement
6040 * exchange protocol.
6041 *
6042 * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management
6043 * frame protection for all management frames exchanged during the
6044 * negotiation and range measurement procedure.
6045 *
6046 * @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
6047 * detection and change announcemnts.
6048 *
6049 * @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD: Driver running in AP mode supports
6050 * FILS encryption and decryption for (Re)Association Request and Response
6051 * frames. Userspace has to share FILS AAD details to the driver by using
6052 * @NL80211_CMD_SET_FILS_AAD.
5226 *6053 *
5227 * @NUM_NL80211_EXT_FEATURES: number of extended features.6054 * @NUM_NL80211_EXT_FEATURES: number of extended features.
5228 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.6055 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
...@@ -5255,10 +6082,41 @@ enum nl80211_ext_feature_index {...@@ -5255,10 +6082,41 @@ enum nl80211_ext_feature_index {
5255 NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,6082 NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
5256 NL80211_EXT_FEATURE_DFS_OFFLOAD,6083 NL80211_EXT_FEATURE_DFS_OFFLOAD,
5257 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,6084 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
5258 NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,6085 NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
6086 /* we renamed this - stay compatible */
6087 NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
5259 NL80211_EXT_FEATURE_TXQS,6088 NL80211_EXT_FEATURE_TXQS,
5260 NL80211_EXT_FEATURE_SCAN_RANDOM_SN,6089 NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
5261 NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,6090 NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
6091 NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
6092 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
6093 NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
6094 NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
6095 NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
6096 NL80211_EXT_FEATURE_EXT_KEY_ID,
6097 NL80211_EXT_FEATURE_STA_TX_PWR,
6098 NL80211_EXT_FEATURE_SAE_OFFLOAD,
6099 NL80211_EXT_FEATURE_VLAN_OFFLOAD,
6100 NL80211_EXT_FEATURE_AQL,
6101 NL80211_EXT_FEATURE_BEACON_PROTECTION,
6102 NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH,
6103 NL80211_EXT_FEATURE_PROTECTED_TWT,
6104 NL80211_EXT_FEATURE_DEL_IBSS_STA,
6105 NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS,
6106 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT,
6107 NL80211_EXT_FEATURE_SCAN_FREQ_KHZ,
6108 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS,
6109 NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION,
6110 NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK,
6111 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
6112 NL80211_EXT_FEATURE_FILS_DISCOVERY,
6113 NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
6114 NL80211_EXT_FEATURE_BEACON_RATE_HE,
6115 NL80211_EXT_FEATURE_SECURE_LTF,
6116 NL80211_EXT_FEATURE_SECURE_RTT,
6117 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
6118 NL80211_EXT_FEATURE_BSS_COLOR,
6119 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
52626120
5263 /* add new features before the definition below */6121 /* add new features before the definition below */
5264 NUM_NL80211_EXT_FEATURES,6122 NUM_NL80211_EXT_FEATURES,
...@@ -5343,7 +6201,7 @@ enum nl80211_timeout_reason {...@@ -5343,7 +6201,7 @@ enum nl80211_timeout_reason {
5343 * request parameters IE in the probe request6201 * request parameters IE in the probe request
5344 * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses6202 * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
5345 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at6203 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
5346 * rate of at least 5.5M. In case non OCE AP is dicovered in the channel,6204 * rate of at least 5.5M. In case non OCE AP is discovered in the channel,
5347 * only the first probe req in the channel will be sent in high rate.6205 * only the first probe req in the channel will be sent in high rate.
5348 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request6206 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
5349 * tx deferral (dot11FILSProbeDelay shall be set to 15ms)6207 * tx deferral (dot11FILSProbeDelay shall be set to 15ms)
...@@ -5370,6 +6228,11 @@ enum nl80211_timeout_reason {...@@ -5370,6 +6228,11 @@ enum nl80211_timeout_reason {
5370 * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to6228 * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to
5371 * only have supported rates and no additional capabilities (unless6229 * only have supported rates and no additional capabilities (unless
5372 * added by userspace explicitly.)6230 * added by userspace explicitly.)
6231 * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with
6232 * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means
6233 * %NL80211_ATTR_SCAN_FREQUENCIES will not be included.
6234 * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported by
6235 * 2.4/5 GHz APs
5373 */6236 */
5374enum nl80211_scan_flags {6237enum nl80211_scan_flags {
5375 NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,6238 NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
...@@ -5385,6 +6248,8 @@ enum nl80211_scan_flags {...@@ -5385,6 +6248,8 @@ enum nl80211_scan_flags {
5385 NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10,6248 NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10,
5386 NL80211_SCAN_FLAG_RANDOM_SN = 1<<11,6249 NL80211_SCAN_FLAG_RANDOM_SN = 1<<11,
5387 NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12,6250 NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12,
6251 NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13,
6252 NL80211_SCAN_FLAG_COLOCATED_6GHZ = 1<<14,
5388};6253};
53896254
5390/**6255/**
...@@ -5472,7 +6337,7 @@ enum nl80211_dfs_state {...@@ -5472,7 +6337,7 @@ enum nl80211_dfs_state {
5472};6337};
54736338
5474/**6339/**
5475 * enum enum nl80211_protocol_features - nl80211 protocol features6340 * enum nl80211_protocol_features - nl80211 protocol features
5476 * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting6341 * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
5477 * wiphy dumps (if requested by the application with the attribute6342 * wiphy dumps (if requested by the application with the attribute
5478 * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the6343 * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
...@@ -5510,9 +6375,14 @@ enum nl80211_crit_proto_id {...@@ -5510,9 +6375,14 @@ enum nl80211_crit_proto_id {
5510 * Used by cfg80211_rx_mgmt()6375 * Used by cfg80211_rx_mgmt()
5511 *6376 *
5512 * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.6377 * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
6378 * @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload
6379 * the authentication. Exclusively defined for host drivers that
6380 * advertises the SME functionality but would like the userspace
6381 * to handle certain authentication algorithms (e.g. SAE).
5513 */6382 */
5514enum nl80211_rxmgmt_flags {6383enum nl80211_rxmgmt_flags {
5515 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,6384 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
6385 NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
5516};6386};
55176387
5518/*6388/*
...@@ -5544,11 +6414,13 @@ struct nl80211_vendor_cmd_info {...@@ -5544,11 +6414,13 @@ struct nl80211_vendor_cmd_info {
5544 * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.6414 * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
5545 * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.6415 * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
5546 * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.6416 * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
6417 * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable.
5547 */6418 */
5548enum nl80211_tdls_peer_capability {6419enum nl80211_tdls_peer_capability {
5549 NL80211_TDLS_PEER_HT = 1<<0,6420 NL80211_TDLS_PEER_HT = 1<<0,
5550 NL80211_TDLS_PEER_VHT = 1<<1,6421 NL80211_TDLS_PEER_VHT = 1<<1,
5551 NL80211_TDLS_PEER_WMM = 1<<2,6422 NL80211_TDLS_PEER_WMM = 1<<2,
6423 NL80211_TDLS_PEER_HE = 1<<3,
5552};6424};
55536425
5554/**6426/**
...@@ -5798,4 +6670,796 @@ enum nl80211_external_auth_action {...@@ -5798,4 +6670,796 @@ enum nl80211_external_auth_action {
5798 NL80211_EXTERNAL_AUTH_ABORT,6670 NL80211_EXTERNAL_AUTH_ABORT,
5799};6671};
58006672
6673/**
6674 * enum nl80211_ftm_responder_attributes - fine timing measurement
6675 * responder attributes
6676 * @__NL80211_FTM_RESP_ATTR_INVALID: Invalid
6677 * @NL80211_FTM_RESP_ATTR_ENABLED: FTM responder is enabled
6678 * @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element
6679 * (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10),
6680 * i.e. starting with the measurement token
6681 * @NL80211_FTM_RESP_ATTR_CIVIC: The content of Measurement Report Element
6682 * (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13),
6683 * i.e. starting with the measurement token
6684 * @__NL80211_FTM_RESP_ATTR_LAST: Internal
6685 * @NL80211_FTM_RESP_ATTR_MAX: highest FTM responder attribute.
6686 */
6687enum nl80211_ftm_responder_attributes {
6688 __NL80211_FTM_RESP_ATTR_INVALID,
6689
6690 NL80211_FTM_RESP_ATTR_ENABLED,
6691 NL80211_FTM_RESP_ATTR_LCI,
6692 NL80211_FTM_RESP_ATTR_CIVICLOC,
6693
6694 /* keep last */
6695 __NL80211_FTM_RESP_ATTR_LAST,
6696 NL80211_FTM_RESP_ATTR_MAX = __NL80211_FTM_RESP_ATTR_LAST - 1,
6697};
6698
6699/*
6700 * enum nl80211_ftm_responder_stats - FTM responder statistics
6701 *
6702 * These attribute types are used with %NL80211_ATTR_FTM_RESPONDER_STATS
6703 * when getting FTM responder statistics.
6704 *
6705 * @__NL80211_FTM_STATS_INVALID: attribute number 0 is reserved
6706 * @NL80211_FTM_STATS_SUCCESS_NUM: number of FTM sessions in which all frames
6707 * were ssfully answered (u32)
6708 * @NL80211_FTM_STATS_PARTIAL_NUM: number of FTM sessions in which part of the
6709 * frames were successfully answered (u32)
6710 * @NL80211_FTM_STATS_FAILED_NUM: number of failed FTM sessions (u32)
6711 * @NL80211_FTM_STATS_ASAP_NUM: number of ASAP sessions (u32)
6712 * @NL80211_FTM_STATS_NON_ASAP_NUM: number of non-ASAP sessions (u32)
6713 * @NL80211_FTM_STATS_TOTAL_DURATION_MSEC: total sessions durations - gives an
6714 * indication of how much time the responder was busy (u64, msec)
6715 * @NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM: number of unknown FTM triggers -
6716 * triggers from initiators that didn't finish successfully the negotiation
6717 * phase with the responder (u32)
6718 * @NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM: number of FTM reschedule requests
6719 * - initiator asks for a new scheduling although it already has scheduled
6720 * FTM slot (u32)
6721 * @NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM: number of FTM triggers out of
6722 * scheduled window (u32)
6723 * @NL80211_FTM_STATS_PAD: used for padding, ignore
6724 * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
6725 * @NL80211_FTM_STATS_MAX: highest possible FTM responder stats attribute
6726 */
6727enum nl80211_ftm_responder_stats {
6728 __NL80211_FTM_STATS_INVALID,
6729 NL80211_FTM_STATS_SUCCESS_NUM,
6730 NL80211_FTM_STATS_PARTIAL_NUM,
6731 NL80211_FTM_STATS_FAILED_NUM,
6732 NL80211_FTM_STATS_ASAP_NUM,
6733 NL80211_FTM_STATS_NON_ASAP_NUM,
6734 NL80211_FTM_STATS_TOTAL_DURATION_MSEC,
6735 NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM,
6736 NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM,
6737 NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM,
6738 NL80211_FTM_STATS_PAD,
6739
6740 /* keep last */
6741 __NL80211_FTM_STATS_AFTER_LAST,
6742 NL80211_FTM_STATS_MAX = __NL80211_FTM_STATS_AFTER_LAST - 1
6743};
6744
6745/**
6746 * enum nl80211_preamble - frame preamble types
6747 * @NL80211_PREAMBLE_LEGACY: legacy (HR/DSSS, OFDM, ERP PHY) preamble
6748 * @NL80211_PREAMBLE_HT: HT preamble
6749 * @NL80211_PREAMBLE_VHT: VHT preamble
6750 * @NL80211_PREAMBLE_DMG: DMG preamble
6751 * @NL80211_PREAMBLE_HE: HE preamble
6752 */
6753enum nl80211_preamble {
6754 NL80211_PREAMBLE_LEGACY,
6755 NL80211_PREAMBLE_HT,
6756 NL80211_PREAMBLE_VHT,
6757 NL80211_PREAMBLE_DMG,
6758 NL80211_PREAMBLE_HE,
6759};
6760
6761/**
6762 * enum nl80211_peer_measurement_type - peer measurement types
6763 * @NL80211_PMSR_TYPE_INVALID: invalid/unused, needed as we use
6764 * these numbers also for attributes
6765 *
6766 * @NL80211_PMSR_TYPE_FTM: flight time measurement
6767 *
6768 * @NUM_NL80211_PMSR_TYPES: internal
6769 * @NL80211_PMSR_TYPE_MAX: highest type number
6770 */
6771enum nl80211_peer_measurement_type {
6772 NL80211_PMSR_TYPE_INVALID,
6773
6774 NL80211_PMSR_TYPE_FTM,
6775
6776 NUM_NL80211_PMSR_TYPES,
6777 NL80211_PMSR_TYPE_MAX = NUM_NL80211_PMSR_TYPES - 1
6778};
6779
6780/**
6781 * enum nl80211_peer_measurement_status - peer measurement status
6782 * @NL80211_PMSR_STATUS_SUCCESS: measurement completed successfully
6783 * @NL80211_PMSR_STATUS_REFUSED: measurement was locally refused
6784 * @NL80211_PMSR_STATUS_TIMEOUT: measurement timed out
6785 * @NL80211_PMSR_STATUS_FAILURE: measurement failed, a type-dependent
6786 * reason may be available in the response data
6787 */
6788enum nl80211_peer_measurement_status {
6789 NL80211_PMSR_STATUS_SUCCESS,
6790 NL80211_PMSR_STATUS_REFUSED,
6791 NL80211_PMSR_STATUS_TIMEOUT,
6792 NL80211_PMSR_STATUS_FAILURE,
6793};
6794
6795/**
6796 * enum nl80211_peer_measurement_req - peer measurement request attributes
6797 * @__NL80211_PMSR_REQ_ATTR_INVALID: invalid
6798 *
6799 * @NL80211_PMSR_REQ_ATTR_DATA: This is a nested attribute with measurement
6800 * type-specific request data inside. The attributes used are from the
6801 * enums named nl80211_peer_measurement_<type>_req.
6802 * @NL80211_PMSR_REQ_ATTR_GET_AP_TSF: include AP TSF timestamp, if supported
6803 * (flag attribute)
6804 *
6805 * @NUM_NL80211_PMSR_REQ_ATTRS: internal
6806 * @NL80211_PMSR_REQ_ATTR_MAX: highest attribute number
6807 */
6808enum nl80211_peer_measurement_req {
6809 __NL80211_PMSR_REQ_ATTR_INVALID,
6810
6811 NL80211_PMSR_REQ_ATTR_DATA,
6812 NL80211_PMSR_REQ_ATTR_GET_AP_TSF,
6813
6814 /* keep last */
6815 NUM_NL80211_PMSR_REQ_ATTRS,
6816 NL80211_PMSR_REQ_ATTR_MAX = NUM_NL80211_PMSR_REQ_ATTRS - 1
6817};
6818
6819/**
6820 * enum nl80211_peer_measurement_resp - peer measurement response attributes
6821 * @__NL80211_PMSR_RESP_ATTR_INVALID: invalid
6822 *
6823 * @NL80211_PMSR_RESP_ATTR_DATA: This is a nested attribute with measurement
6824 * type-specific results inside. The attributes used are from the enums
6825 * named nl80211_peer_measurement_<type>_resp.
6826 * @NL80211_PMSR_RESP_ATTR_STATUS: u32 value with the measurement status
6827 * (using values from &enum nl80211_peer_measurement_status.)
6828 * @NL80211_PMSR_RESP_ATTR_HOST_TIME: host time (%CLOCK_BOOTTIME) when the
6829 * result was measured; this value is not expected to be accurate to
6830 * more than 20ms. (u64, nanoseconds)
6831 * @NL80211_PMSR_RESP_ATTR_AP_TSF: TSF of the AP that the interface
6832 * doing the measurement is connected to when the result was measured.
6833 * This shall be accurately reported if supported and requested
6834 * (u64, usec)
6835 * @NL80211_PMSR_RESP_ATTR_FINAL: If results are sent to the host partially
6836 * (*e.g. with FTM per-burst data) this flag will be cleared on all but
6837 * the last result; if all results are combined it's set on the single
6838 * result.
6839 * @NL80211_PMSR_RESP_ATTR_PAD: padding for 64-bit attributes, ignore
6840 *
6841 * @NUM_NL80211_PMSR_RESP_ATTRS: internal
6842 * @NL80211_PMSR_RESP_ATTR_MAX: highest attribute number
6843 */
6844enum nl80211_peer_measurement_resp {
6845 __NL80211_PMSR_RESP_ATTR_INVALID,
6846
6847 NL80211_PMSR_RESP_ATTR_DATA,
6848 NL80211_PMSR_RESP_ATTR_STATUS,
6849 NL80211_PMSR_RESP_ATTR_HOST_TIME,
6850 NL80211_PMSR_RESP_ATTR_AP_TSF,
6851 NL80211_PMSR_RESP_ATTR_FINAL,
6852 NL80211_PMSR_RESP_ATTR_PAD,
6853
6854 /* keep last */
6855 NUM_NL80211_PMSR_RESP_ATTRS,
6856 NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1
6857};
6858
6859/**
6860 * enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement
6861 * @__NL80211_PMSR_PEER_ATTR_INVALID: invalid
6862 *
6863 * @NL80211_PMSR_PEER_ATTR_ADDR: peer's MAC address
6864 * @NL80211_PMSR_PEER_ATTR_CHAN: channel definition, nested, using top-level
6865 * attributes like %NL80211_ATTR_WIPHY_FREQ etc.
6866 * @NL80211_PMSR_PEER_ATTR_REQ: This is a nested attribute indexed by
6867 * measurement type, with attributes from the
6868 * &enum nl80211_peer_measurement_req inside.
6869 * @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by
6870 * measurement type, with attributes from the
6871 * &enum nl80211_peer_measurement_resp inside.
6872 *
6873 * @NUM_NL80211_PMSR_PEER_ATTRS: internal
6874 * @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number
6875 */
6876enum nl80211_peer_measurement_peer_attrs {
6877 __NL80211_PMSR_PEER_ATTR_INVALID,
6878
6879 NL80211_PMSR_PEER_ATTR_ADDR,
6880 NL80211_PMSR_PEER_ATTR_CHAN,
6881 NL80211_PMSR_PEER_ATTR_REQ,
6882 NL80211_PMSR_PEER_ATTR_RESP,
6883
6884 /* keep last */
6885 NUM_NL80211_PMSR_PEER_ATTRS,
6886 NL80211_PMSR_PEER_ATTR_MAX = NUM_NL80211_PMSR_PEER_ATTRS - 1,
6887};
6888
6889/**
6890 * enum nl80211_peer_measurement_attrs - peer measurement attributes
6891 * @__NL80211_PMSR_ATTR_INVALID: invalid
6892 *
6893 * @NL80211_PMSR_ATTR_MAX_PEERS: u32 attribute used for capability
6894 * advertisement only, indicates the maximum number of peers
6895 * measurements can be done with in a single request
6896 * @NL80211_PMSR_ATTR_REPORT_AP_TSF: flag attribute in capability
6897 * indicating that the connected AP's TSF can be reported in
6898 * measurement results
6899 * @NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR: flag attribute in capability
6900 * indicating that MAC address randomization is supported.
6901 * @NL80211_PMSR_ATTR_TYPE_CAPA: capabilities reported by the device,
6902 * this contains a nesting indexed by measurement type, and
6903 * type-specific capabilities inside, which are from the enums
6904 * named nl80211_peer_measurement_<type>_capa.
6905 * @NL80211_PMSR_ATTR_PEERS: nested attribute, the nesting index is
6906 * meaningless, just a list of peers to measure with, with the
6907 * sub-attributes taken from
6908 * &enum nl80211_peer_measurement_peer_attrs.
6909 *
6910 * @NUM_NL80211_PMSR_ATTR: internal
6911 * @NL80211_PMSR_ATTR_MAX: highest attribute number
6912 */
6913enum nl80211_peer_measurement_attrs {
6914 __NL80211_PMSR_ATTR_INVALID,
6915
6916 NL80211_PMSR_ATTR_MAX_PEERS,
6917 NL80211_PMSR_ATTR_REPORT_AP_TSF,
6918 NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR,
6919 NL80211_PMSR_ATTR_TYPE_CAPA,
6920 NL80211_PMSR_ATTR_PEERS,
6921
6922 /* keep last */
6923 NUM_NL80211_PMSR_ATTR,
6924 NL80211_PMSR_ATTR_MAX = NUM_NL80211_PMSR_ATTR - 1
6925};
6926
6927/**
6928 * enum nl80211_peer_measurement_ftm_capa - FTM capabilities
6929 * @__NL80211_PMSR_FTM_CAPA_ATTR_INVALID: invalid
6930 *
6931 * @NL80211_PMSR_FTM_CAPA_ATTR_ASAP: flag attribute indicating ASAP mode
6932 * is supported
6933 * @NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP: flag attribute indicating non-ASAP
6934 * mode is supported
6935 * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI: flag attribute indicating if LCI
6936 * data can be requested during the measurement
6937 * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC: flag attribute indicating if civic
6938 * location data can be requested during the measurement
6939 * @NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES: u32 bitmap attribute of bits
6940 * from &enum nl80211_preamble.
6941 * @NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS: bitmap of values from
6942 * &enum nl80211_chan_width indicating the supported channel
6943 * bandwidths for FTM. Note that a higher channel bandwidth may be
6944 * configured to allow for other measurements types with different
6945 * bandwidth requirement in the same measurement.
6946 * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT: u32 attribute indicating
6947 * the maximum bursts exponent that can be used (if not present anything
6948 * is valid)
6949 * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating
6950 * the maximum FTMs per burst (if not present anything is valid)
6951 * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
6952 * trigger based ranging measurement is supported
6953 * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
6954 * if non trigger based ranging measurement is supported
6955 *
6956 * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
6957 * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
6958 */
6959enum nl80211_peer_measurement_ftm_capa {
6960 __NL80211_PMSR_FTM_CAPA_ATTR_INVALID,
6961
6962 NL80211_PMSR_FTM_CAPA_ATTR_ASAP,
6963 NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP,
6964 NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI,
6965 NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC,
6966 NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES,
6967 NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS,
6968 NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT,
6969 NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
6970 NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED,
6971 NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED,
6972
6973 /* keep last */
6974 NUM_NL80211_PMSR_FTM_CAPA_ATTR,
6975 NL80211_PMSR_FTM_CAPA_ATTR_MAX = NUM_NL80211_PMSR_FTM_CAPA_ATTR - 1
6976};
6977
6978/**
6979 * enum nl80211_peer_measurement_ftm_req - FTM request attributes
6980 * @__NL80211_PMSR_FTM_REQ_ATTR_INVALID: invalid
6981 *
6982 * @NL80211_PMSR_FTM_REQ_ATTR_ASAP: ASAP mode requested (flag)
6983 * @NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE: preamble type (see
6984 * &enum nl80211_preamble), optional for DMG (u32)
6985 * @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in
6986 * 802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element"
6987 * (u8, 0-15, optional with default 15 i.e. "no preference")
6988 * @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units
6989 * of 100ms (u16, optional with default 0)
6990 * @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016
6991 * Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with
6992 * default 15 i.e. "no preference")
6993 * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames
6994 * requested per burst
6995 * (u8, 0-31, optional with default 0 i.e. "no preference")
6996 * @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries
6997 * (u8, default 3)
6998 * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)
6999 * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data
7000 * (flag)
7001 * @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging
7002 * measurement (flag).
7003 * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are
7004 * mutually exclusive.
7005 * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
7006 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
7007 * ranging will be used.
7008 * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based
7009 * ranging measurement (flag)
7010 * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
7011 * mutually exclusive.
7012 * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
7013 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
7014 * ranging will be used.
7015 * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only
7016 * valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or
7017 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
7018 * @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the
7019 * responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED
7020 * or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set.
7021 *
7022 * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
7023 * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
7024 */
7025enum nl80211_peer_measurement_ftm_req {
7026 __NL80211_PMSR_FTM_REQ_ATTR_INVALID,
7027
7028 NL80211_PMSR_FTM_REQ_ATTR_ASAP,
7029 NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE,
7030 NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP,
7031 NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD,
7032 NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION,
7033 NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST,
7034 NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES,
7035 NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI,
7036 NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
7037 NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
7038 NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
7039 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
7040 NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
7041
7042 /* keep last */
7043 NUM_NL80211_PMSR_FTM_REQ_ATTR,
7044 NL80211_PMSR_FTM_REQ_ATTR_MAX = NUM_NL80211_PMSR_FTM_REQ_ATTR - 1
7045};
7046
7047/**
7048 * enum nl80211_peer_measurement_ftm_failure_reasons - FTM failure reasons
7049 * @NL80211_PMSR_FTM_FAILURE_UNSPECIFIED: unspecified failure, not used
7050 * @NL80211_PMSR_FTM_FAILURE_NO_RESPONSE: no response from the FTM responder
7051 * @NL80211_PMSR_FTM_FAILURE_REJECTED: FTM responder rejected measurement
7052 * @NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL: we already know the peer is
7053 * on a different channel, so can't measure (if we didn't know, we'd
7054 * try and get no response)
7055 * @NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE: peer can't actually do FTM
7056 * @NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP: invalid T1/T4 timestamps
7057 * received
7058 * @NL80211_PMSR_FTM_FAILURE_PEER_BUSY: peer reports busy, you may retry
7059 * later (see %NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME)
7060 * @NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS: parameters were changed
7061 * by the peer and are no longer supported
7062 */
7063enum nl80211_peer_measurement_ftm_failure_reasons {
7064 NL80211_PMSR_FTM_FAILURE_UNSPECIFIED,
7065 NL80211_PMSR_FTM_FAILURE_NO_RESPONSE,
7066 NL80211_PMSR_FTM_FAILURE_REJECTED,
7067 NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL,
7068 NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE,
7069 NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP,
7070 NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
7071 NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
7072};
7073
7074/**
7075 * enum nl80211_peer_measurement_ftm_resp - FTM response attributes
7076 * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
7077 *
7078 * @NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON: FTM-specific failure reason
7079 * (u32, optional)
7080 * @NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX: optional, if bursts are reported
7081 * as separate results then it will be the burst index 0...(N-1) and
7082 * the top level will indicate partial results (u32)
7083 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
7084 * transmitted (u32, optional)
7085 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
7086 * that were acknowleged (u32, optional)
7087 * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
7088 * busy peer (u32, seconds)
7089 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
7090 * used by the responder (similar to request, u8)
7091 * @NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION: actual burst duration used by
7092 * the responder (similar to request, u8)
7093 * @NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST: actual FTMs per burst used
7094 * by the responder (similar to request, u8)
7095 * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG: average RSSI across all FTM action
7096 * frames (optional, s32, 1/2 dBm)
7097 * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD: RSSI spread across all FTM action
7098 * frames (optional, s32, 1/2 dBm)
7099 * @NL80211_PMSR_FTM_RESP_ATTR_TX_RATE: bitrate we used for the response to the
7100 * FTM action frame (optional, nested, using &enum nl80211_rate_info
7101 * attributes)
7102 * @NL80211_PMSR_FTM_RESP_ATTR_RX_RATE: bitrate the responder used for the FTM
7103 * action frame (optional, nested, using &enum nl80211_rate_info attrs)
7104 * @NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG: average RTT (s64, picoseconds, optional
7105 * but one of RTT/DIST must be present)
7106 * @NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE: RTT variance (u64, ps^2, note that
7107 * standard deviation is the square root of variance, optional)
7108 * @NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD: RTT spread (u64, picoseconds,
7109 * optional)
7110 * @NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG: average distance (s64, mm, optional
7111 * but one of RTT/DIST must be present)
7112 * @NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE: distance variance (u64, mm^2, note
7113 * that standard deviation is the square root of variance, optional)
7114 * @NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD: distance spread (u64, mm, optional)
7115 * @NL80211_PMSR_FTM_RESP_ATTR_LCI: LCI data from peer (binary, optional);
7116 * this is the contents of the Measurement Report Element (802.11-2016
7117 * 9.4.2.22.1) starting with the Measurement Token, with Measurement
7118 * Type 8.
7119 * @NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC: civic location data from peer
7120 * (binary, optional);
7121 * this is the contents of the Measurement Report Element (802.11-2016
7122 * 9.4.2.22.1) starting with the Measurement Token, with Measurement
7123 * Type 11.
7124 * @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only
7125 *
7126 * @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal
7127 * @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number
7128 */
7129enum nl80211_peer_measurement_ftm_resp {
7130 __NL80211_PMSR_FTM_RESP_ATTR_INVALID,
7131
7132 NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON,
7133 NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX,
7134 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS,
7135 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES,
7136 NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME,
7137 NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP,
7138 NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION,
7139 NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST,
7140 NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG,
7141 NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD,
7142 NL80211_PMSR_FTM_RESP_ATTR_TX_RATE,
7143 NL80211_PMSR_FTM_RESP_ATTR_RX_RATE,
7144 NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG,
7145 NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE,
7146 NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD,
7147 NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG,
7148 NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE,
7149 NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD,
7150 NL80211_PMSR_FTM_RESP_ATTR_LCI,
7151 NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
7152 NL80211_PMSR_FTM_RESP_ATTR_PAD,
7153
7154 /* keep last */
7155 NUM_NL80211_PMSR_FTM_RESP_ATTR,
7156 NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1
7157};
7158
7159/**
7160 * enum nl80211_obss_pd_attributes - OBSS packet detection attributes
7161 * @__NL80211_HE_OBSS_PD_ATTR_INVALID: Invalid
7162 *
7163 * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.
7164 * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset.
7165 * @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum
7166 * tx power offset.
7167 * @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color
7168 * values used by members of the SRG.
7169 * @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial
7170 * BSSID values used by members of the SRG.
7171 * @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element.
7172 *
7173 * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal
7174 * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.
7175 */
7176enum nl80211_obss_pd_attributes {
7177 __NL80211_HE_OBSS_PD_ATTR_INVALID,
7178
7179 NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
7180 NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,
7181 NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET,
7182 NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP,
7183 NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP,
7184 NL80211_HE_OBSS_PD_ATTR_SR_CTRL,
7185
7186 /* keep last */
7187 __NL80211_HE_OBSS_PD_ATTR_LAST,
7188 NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1,
7189};
7190
7191/**
7192 * enum nl80211_bss_color_attributes - BSS Color attributes
7193 * @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid
7194 *
7195 * @NL80211_HE_BSS_COLOR_ATTR_COLOR: the current BSS Color.
7196 * @NL80211_HE_BSS_COLOR_ATTR_DISABLED: is BSS coloring disabled.
7197 * @NL80211_HE_BSS_COLOR_ATTR_PARTIAL: the AID equation to be used..
7198 *
7199 * @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal
7200 * @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute.
7201 */
7202enum nl80211_bss_color_attributes {
7203 __NL80211_HE_BSS_COLOR_ATTR_INVALID,
7204
7205 NL80211_HE_BSS_COLOR_ATTR_COLOR,
7206 NL80211_HE_BSS_COLOR_ATTR_DISABLED,
7207 NL80211_HE_BSS_COLOR_ATTR_PARTIAL,
7208
7209 /* keep last */
7210 __NL80211_HE_BSS_COLOR_ATTR_LAST,
7211 NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1,
7212};
7213
7214/**
7215 * enum nl80211_iftype_akm_attributes - interface type AKM attributes
7216 * @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid
7217 *
7218 * @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag
7219 * attribute for each interface type that supports AKM suites specified in
7220 * %NL80211_IFTYPE_AKM_ATTR_SUITES
7221 * @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported
7222 * AKM suites for the specified interface types.
7223 *
7224 * @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal
7225 * @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute.
7226 */
7227enum nl80211_iftype_akm_attributes {
7228 __NL80211_IFTYPE_AKM_ATTR_INVALID,
7229
7230 NL80211_IFTYPE_AKM_ATTR_IFTYPES,
7231 NL80211_IFTYPE_AKM_ATTR_SUITES,
7232
7233 /* keep last */
7234 __NL80211_IFTYPE_AKM_ATTR_LAST,
7235 NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1,
7236};
7237
7238/**
7239 * enum nl80211_fils_discovery_attributes - FILS discovery configuration
7240 * from IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
7241 *
7242 * @__NL80211_FILS_DISCOVERY_ATTR_INVALID: Invalid
7243 *
7244 * @NL80211_FILS_DISCOVERY_ATTR_INT_MIN: Minimum packet interval (u32, TU).
7245 * Allowed range: 0..10000 (TU = Time Unit)
7246 * @NL80211_FILS_DISCOVERY_ATTR_INT_MAX: Maximum packet interval (u32, TU).
7247 * Allowed range: 0..10000 (TU = Time Unit)
7248 * @NL80211_FILS_DISCOVERY_ATTR_TMPL: Template data for FILS discovery action
7249 * frame including the headers.
7250 *
7251 * @__NL80211_FILS_DISCOVERY_ATTR_LAST: Internal
7252 * @NL80211_FILS_DISCOVERY_ATTR_MAX: highest attribute
7253 */
7254enum nl80211_fils_discovery_attributes {
7255 __NL80211_FILS_DISCOVERY_ATTR_INVALID,
7256
7257 NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
7258 NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
7259 NL80211_FILS_DISCOVERY_ATTR_TMPL,
7260
7261 /* keep last */
7262 __NL80211_FILS_DISCOVERY_ATTR_LAST,
7263 NL80211_FILS_DISCOVERY_ATTR_MAX = __NL80211_FILS_DISCOVERY_ATTR_LAST - 1
7264};
7265
7266/*
7267 * FILS discovery template minimum length with action frame headers and
7268 * mandatory fields.
7269 */
7270#define NL80211_FILS_DISCOVERY_TMPL_MIN_LEN 42
7271
7272/**
7273 * enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe
7274 * response configuration. Applicable only in 6GHz.
7275 *
7276 * @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID: Invalid
7277 *
7278 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU).
7279 * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0
7280 * 26.17.2.3.2 (AP behavior for fast passive scanning).
7281 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response
7282 * frame template (binary).
7283 *
7284 * @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST: Internal
7285 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX: highest attribute
7286 */
7287enum nl80211_unsol_bcast_probe_resp_attributes {
7288 __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID,
7289
7290 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
7291 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
7292
7293 /* keep last */
7294 __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST,
7295 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX =
7296 __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1
7297};
7298
7299/**
7300 * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE
7301 * derivation. Applicable only when WPA3-Personal SAE authentication is
7302 * used.
7303 *
7304 * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that
7305 * attribute is not present from userspace.
7306 * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only
7307 * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only
7308 * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element
7309 * can be used.
7310 */
7311enum nl80211_sae_pwe_mechanism {
7312 NL80211_SAE_PWE_UNSPECIFIED,
7313 NL80211_SAE_PWE_HUNT_AND_PECK,
7314 NL80211_SAE_PWE_HASH_TO_ELEMENT,
7315 NL80211_SAE_PWE_BOTH,
7316};
7317
7318/**
7319 * enum nl80211_sar_type - type of SAR specs
7320 *
7321 * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
7322 *
7323 */
7324enum nl80211_sar_type {
7325 NL80211_SAR_TYPE_POWER,
7326
7327 /* add new type here */
7328
7329 /* Keep last */
7330 NUM_NL80211_SAR_TYPE,
7331};
7332
7333/**
7334 * enum nl80211_sar_attrs - Attributes for SAR spec
7335 *
7336 * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
7337 *
7338 * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
7339 * limit specifications. Each specification contains a set
7340 * of %nl80211_sar_specs_attrs.
7341 *
7342 * For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER
7343 * and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX.
7344 *
7345 * For sar_capa dump, it contains array of
7346 * %NL80211_SAR_ATTR_SPECS_START_FREQ
7347 * and %NL80211_SAR_ATTR_SPECS_END_FREQ.
7348 *
7349 * @__NL80211_SAR_ATTR_LAST: Internal
7350 * @NL80211_SAR_ATTR_MAX: highest sar attribute
7351 *
7352 * These attributes are used with %NL80211_CMD_SET_SAR_SPEC
7353 */
7354enum nl80211_sar_attrs {
7355 __NL80211_SAR_ATTR_INVALID,
7356
7357 NL80211_SAR_ATTR_TYPE,
7358 NL80211_SAR_ATTR_SPECS,
7359
7360 __NL80211_SAR_ATTR_LAST,
7361 NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1,
7362};
7363
7364/**
7365 * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
7366 *
7367 * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual
7368 * power limit value in units of 0.25 dBm if type is
7369 * NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm).
7370 * 0 means userspace doesn't have SAR limitation on this associated range.
7371 *
7372 * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the
7373 * index of exported freq range table and the associated power limitation
7374 * is applied to this range.
7375 *
7376 * Userspace isn't required to set all the ranges advertised by WLAN driver,
7377 * and userspace can skip some certain ranges. These skipped ranges don't
7378 * have SAR limitations, and they are same as setting the
7379 * %NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any
7380 * value higher than regulatory allowed value just means SAR power
7381 * limitation is removed, but it's required to set at least one range.
7382 * It's not allowed to set duplicated range in one SET operation.
7383 *
7384 * Every SET operation overwrites previous SET operation.
7385 *
7386 * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start
7387 * frequency of this range edge when registering SAR capability to wiphy.
7388 * It's not a channel center frequency. The unit is kHz.
7389 *
7390 * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end
7391 * frequency of this range edge when registering SAR capability to wiphy.
7392 * It's not a channel center frequency. The unit is kHz.
7393 *
7394 * @__NL80211_SAR_ATTR_SPECS_LAST: Internal
7395 * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute
7396 */
7397enum nl80211_sar_specs_attrs {
7398 __NL80211_SAR_ATTR_SPECS_INVALID,
7399
7400 NL80211_SAR_ATTR_SPECS_POWER,
7401 NL80211_SAR_ATTR_SPECS_RANGE_INDEX,
7402 NL80211_SAR_ATTR_SPECS_START_FREQ,
7403 NL80211_SAR_ATTR_SPECS_END_FREQ,
7404
7405 __NL80211_SAR_ATTR_SPECS_LAST,
7406 NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1,
7407};
7408
7409/**
7410 * enum nl80211_mbssid_config_attributes - multiple BSSID (MBSSID) and enhanced
7411 * multi-BSSID advertisements (EMA) in AP mode.
7412 * Kernel uses some of these attributes to advertise driver's support for
7413 * MBSSID and EMA.
7414 * Remaining attributes should be used by the userspace to configure the
7415 * features.
7416 *
7417 * @__NL80211_MBSSID_CONFIG_ATTR_INVALID: Invalid
7418 *
7419 * @NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES: Used by the kernel to advertise
7420 * the maximum number of MBSSID interfaces supported by the driver.
7421 * Driver should indicate MBSSID support by setting
7422 * wiphy->mbssid_max_interfaces to a value more than or equal to 2.
7423 *
7424 * @NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY: Used by the kernel
7425 * to advertise the maximum profile periodicity supported by the driver
7426 * if EMA is enabled. Driver should indicate EMA support to the userspace
7427 * by setting wiphy->ema_max_profile_periodicity to
7428 * a non-zero value.
7429 *
7430 * @NL80211_MBSSID_CONFIG_ATTR_INDEX: Mandatory parameter to pass the index of
7431 * this BSS (u8) in the multiple BSSID set.
7432 * Value must be set to 0 for the transmitting interface and non-zero for
7433 * all non-transmitting interfaces. The userspace will be responsible
7434 * for using unique indices for the interfaces.
7435 * Range: 0 to wiphy->mbssid_max_interfaces-1.
7436 *
7437 * @NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX: Mandatory parameter for
7438 * a non-transmitted profile which provides the interface index (u32) of
7439 * the transmitted profile. The value must match one of the interface
7440 * indices advertised by the kernel. Optional if the interface being set up
7441 * is the transmitting one, however, if provided then the value must match
7442 * the interface index of the same.
7443 *
7444 * @NL80211_MBSSID_CONFIG_ATTR_EMA: Flag used to enable EMA AP feature.
7445 * Setting this flag is permitted only if the driver advertises EMA support
7446 * by setting wiphy->ema_max_profile_periodicity to non-zero.
7447 *
7448 * @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal
7449 * @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute
7450 */
7451enum nl80211_mbssid_config_attributes {
7452 __NL80211_MBSSID_CONFIG_ATTR_INVALID,
7453
7454 NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES,
7455 NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY,
7456 NL80211_MBSSID_CONFIG_ATTR_INDEX,
7457 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX,
7458 NL80211_MBSSID_CONFIG_ATTR_EMA,
7459
7460 /* keep last */
7461 __NL80211_MBSSID_CONFIG_ATTR_LAST,
7462 NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
7463};
7464
5801#endif /* __LINUX_NL80211_H */7465#endif /* __LINUX_NL80211_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nvme_ioctl.h+24-9
...@@ -2,15 +2,6 @@...@@ -2,15 +2,6 @@
2/*2/*
3 * Definitions for the NVM Express ioctl interface3 * Definitions for the NVM Express ioctl interface
4 * Copyright (c) 2011-2014, Intel Corporation.4 * Copyright (c) 2011-2014, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */5 */
156
16#ifndef _LINUX_NVME_IOCTL_H7#ifndef _LINUX_NVME_IOCTL_H
...@@ -54,6 +45,28 @@ struct nvme_passthru_cmd {...@@ -54,6 +45,28 @@ struct nvme_passthru_cmd {
54 __u32 result;45 __u32 result;
55};46};
5647
48struct nvme_passthru_cmd64 {
49 __u8 opcode;
50 __u8 flags;
51 __u16 rsvd1;
52 __u32 nsid;
53 __u32 cdw2;
54 __u32 cdw3;
55 __u64 metadata;
56 __u64 addr;
57 __u32 metadata_len;
58 __u32 data_len;
59 __u32 cdw10;
60 __u32 cdw11;
61 __u32 cdw12;
62 __u32 cdw13;
63 __u32 cdw14;
64 __u32 cdw15;
65 __u32 timeout_ms;
66 __u32 rsvd2;
67 __u64 result;
68};
69
57#define nvme_admin_cmd nvme_passthru_cmd70#define nvme_admin_cmd nvme_passthru_cmd
5871
59#define NVME_IOCTL_ID _IO('N', 0x40)72#define NVME_IOCTL_ID _IO('N', 0x40)
...@@ -63,5 +76,7 @@ struct nvme_passthru_cmd {...@@ -63,5 +76,7 @@ struct nvme_passthru_cmd {
63#define NVME_IOCTL_RESET _IO('N', 0x44)76#define NVME_IOCTL_RESET _IO('N', 0x44)
64#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)77#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
65#define NVME_IOCTL_RESCAN _IO('N', 0x46)78#define NVME_IOCTL_RESCAN _IO('N', 0x46)
79#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
80#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)
6681
67#endif /* _LINUX_NVME_IOCTL_H */82#endif /* _LINUX_NVME_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/openat2.h created+43
...@@ -0,0 +1,43 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_OPENAT2_H
3#define _LINUX_OPENAT2_H
4
5#include <linux/types.h>
6
7/*
8 * Arguments for how openat2(2) should open the target path. If only @flags and
9 * @mode are non-zero, then openat2(2) operates very similarly to openat(2).
10 *
11 * However, unlike openat(2), unknown or invalid bits in @flags result in
12 * -EINVAL rather than being silently ignored. @mode must be zero unless one of
13 * {O_CREAT, O_TMPFILE} are set.
14 *
15 * @flags: O_* flags.
16 * @mode: O_CREAT/O_TMPFILE file mode.
17 * @resolve: RESOLVE_* flags.
18 */
19struct open_how {
20 __u64 flags;
21 __u64 mode;
22 __u64 resolve;
23};
24
25/* how->resolve flags for openat2(2). */
26#define RESOLVE_NO_XDEV 0x01 /* Block mount-point crossings
27 (includes bind-mounts). */
28#define RESOLVE_NO_MAGICLINKS 0x02 /* Block traversal through procfs-style
29 "magic-links". */
30#define RESOLVE_NO_SYMLINKS 0x04 /* Block traversal through all symlinks
31 (implies OEXT_NO_MAGICLINKS) */
32#define RESOLVE_BENEATH 0x08 /* Block "lexical" trickery like
33 "..", symlinks, and absolute
34 paths which escape the dirfd. */
35#define RESOLVE_IN_ROOT 0x10 /* Make all jumps to "/" and ".."
36 be scoped inside the dirfd
37 (similar to chroot(2)). */
38#define RESOLVE_CACHED 0x20 /* Only complete if resolution can be
39 completed through cached lookup. May
40 return -EAGAIN if that's not
41 possible. */
42
43#endif /* _LINUX_OPENAT2_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/openvswitch.h+87-2
...@@ -70,6 +70,8 @@ enum ovs_datapath_cmd {...@@ -70,6 +70,8 @@ enum ovs_datapath_cmd {
70 * set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on70 * set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on
71 * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should71 * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should
72 * not be sent.72 * not be sent.
73 * @OVS_DP_ATTR_PER_CPU_PIDS: Per-cpu array of PIDs for upcalls when
74 * OVS_DP_F_DISPATCH_UPCALL_PER_CPU feature is set.
73 * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the75 * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the
74 * datapath. Always present in notifications.76 * datapath. Always present in notifications.
75 * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the77 * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the
...@@ -86,6 +88,10 @@ enum ovs_datapath_attr {...@@ -86,6 +88,10 @@ enum ovs_datapath_attr {
86 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */88 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */
87 OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */89 OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */
88 OVS_DP_ATTR_PAD,90 OVS_DP_ATTR_PAD,
91 OVS_DP_ATTR_MASKS_CACHE_SIZE,
92 OVS_DP_ATTR_PER_CPU_PIDS, /* Netlink PIDS to receive upcalls in
93 * per-cpu dispatch mode
94 */
89 __OVS_DP_ATTR_MAX95 __OVS_DP_ATTR_MAX
90};96};
9197
...@@ -102,8 +108,8 @@ struct ovs_dp_megaflow_stats {...@@ -102,8 +108,8 @@ struct ovs_dp_megaflow_stats {
102 __u64 n_mask_hit; /* Number of masks used for flow lookups. */108 __u64 n_mask_hit; /* Number of masks used for flow lookups. */
103 __u32 n_masks; /* Number of masks for the datapath. */109 __u32 n_masks; /* Number of masks for the datapath. */
104 __u32 pad0; /* Pad for future expension. */110 __u32 pad0; /* Pad for future expension. */
111 __u64 n_cache_hit; /* Number of cache matches for flow lookups. */
105 __u64 pad1; /* Pad for future expension. */112 __u64 pad1; /* Pad for future expension. */
106 __u64 pad2; /* Pad for future expension. */
107};113};
108114
109struct ovs_vport_stats {115struct ovs_vport_stats {
...@@ -123,6 +129,12 @@ struct ovs_vport_stats {...@@ -123,6 +129,12 @@ struct ovs_vport_stats {
123/* Allow datapath to associate multiple Netlink PIDs to each vport */129/* Allow datapath to associate multiple Netlink PIDs to each vport */
124#define OVS_DP_F_VPORT_PIDS (1 << 1)130#define OVS_DP_F_VPORT_PIDS (1 << 1)
125131
132/* Allow tc offload recirc sharing */
133#define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
134
135/* Allow per-cpu dispatch of upcalls */
136#define OVS_DP_F_DISPATCH_UPCALL_PER_CPU (1 << 3)
137
126/* Fixed logical ports. */138/* Fixed logical ports. */
127#define OVSP_LOCAL ((__u32)0)139#define OVSP_LOCAL ((__u32)0)
128140
...@@ -170,6 +182,7 @@ enum ovs_packet_cmd {...@@ -170,6 +182,7 @@ enum ovs_packet_cmd {
170 * @OVS_PACKET_ATTR_LEN: Packet size before truncation.182 * @OVS_PACKET_ATTR_LEN: Packet size before truncation.
171 * %OVS_PACKET_ATTR_USERSPACE action specify the Maximum received fragment183 * %OVS_PACKET_ATTR_USERSPACE action specify the Maximum received fragment
172 * size.184 * size.
185 * @OVS_PACKET_ATTR_HASH: Packet hash info (e.g. hash, sw_hash and l4_hash in skb).
173 *186 *
174 * These attributes follow the &struct ovs_header within the Generic Netlink187 * These attributes follow the &struct ovs_header within the Generic Netlink
175 * payload for %OVS_PACKET_* commands.188 * payload for %OVS_PACKET_* commands.
...@@ -187,7 +200,8 @@ enum ovs_packet_attr {...@@ -187,7 +200,8 @@ enum ovs_packet_attr {
187 OVS_PACKET_ATTR_PROBE, /* Packet operation is a feature probe,200 OVS_PACKET_ATTR_PROBE, /* Packet operation is a feature probe,
188 error logging should be suppressed. */201 error logging should be suppressed. */
189 OVS_PACKET_ATTR_MRU, /* Maximum received IP fragment size. */202 OVS_PACKET_ATTR_MRU, /* Maximum received IP fragment size. */
190 OVS_PACKET_ATTR_LEN, /* Packet size before truncation. */203 OVS_PACKET_ATTR_LEN, /* Packet size before truncation. */
204 OVS_PACKET_ATTR_HASH, /* Packet hash. */
191 __OVS_PACKET_ATTR_MAX205 __OVS_PACKET_ATTR_MAX
192};206};
193207
...@@ -361,6 +375,7 @@ enum ovs_tunnel_key_attr {...@@ -361,6 +375,7 @@ enum ovs_tunnel_key_attr {
361 OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */375 OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */
362 OVS_TUNNEL_KEY_ATTR_PAD,376 OVS_TUNNEL_KEY_ATTR_PAD,
363 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* struct erspan_metadata */377 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* struct erspan_metadata */
378 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE, /* No argument. IPV4_INFO_BRIDGE mode.*/
364 __OVS_TUNNEL_KEY_ATTR_MAX379 __OVS_TUNNEL_KEY_ATTR_MAX
365};380};
366381
...@@ -650,6 +665,32 @@ struct ovs_action_push_mpls {...@@ -650,6 +665,32 @@ struct ovs_action_push_mpls {
650 __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */665 __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */
651};666};
652667
668/**
669 * struct ovs_action_add_mpls - %OVS_ACTION_ATTR_ADD_MPLS action
670 * argument.
671 * @mpls_lse: MPLS label stack entry to push.
672 * @mpls_ethertype: Ethertype to set in the encapsulating ethernet frame.
673 * @tun_flags: MPLS tunnel attributes.
674 *
675 * The only values @mpls_ethertype should ever be given are %ETH_P_MPLS_UC and
676 * %ETH_P_MPLS_MC, indicating MPLS unicast or multicast. Other are rejected.
677 */
678struct ovs_action_add_mpls {
679 __be32 mpls_lse;
680 __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */
681 __u16 tun_flags;
682};
683
684#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0) /* Flag to specify the place of
685 * insertion of MPLS header.
686 * When false, the MPLS header
687 * will be inserted at the start
688 * of the packet.
689 * When true, the MPLS header
690 * will be inserted at the start
691 * of the l3 header.
692 */
693
653/**694/**
654 * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument.695 * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument.
655 * @vlan_tpid: Tag protocol identifier (TPID) to push.696 * @vlan_tpid: Tag protocol identifier (TPID) to push.
...@@ -718,6 +759,7 @@ struct ovs_action_hash {...@@ -718,6 +759,7 @@ struct ovs_action_hash {
718 * be received on NFNLGRP_CONNTRACK_NEW and NFNLGRP_CONNTRACK_DESTROY groups,759 * be received on NFNLGRP_CONNTRACK_NEW and NFNLGRP_CONNTRACK_DESTROY groups,
719 * respectively. Remaining bits control the changes for which an event is760 * respectively. Remaining bits control the changes for which an event is
720 * delivered on the NFNLGRP_CONNTRACK_UPDATE group.761 * delivered on the NFNLGRP_CONNTRACK_UPDATE group.
762 * @OVS_CT_ATTR_TIMEOUT: Variable length string defining conntrack timeout.
721 */763 */
722enum ovs_ct_attr {764enum ovs_ct_attr {
723 OVS_CT_ATTR_UNSPEC,765 OVS_CT_ATTR_UNSPEC,
...@@ -730,6 +772,8 @@ enum ovs_ct_attr {...@@ -730,6 +772,8 @@ enum ovs_ct_attr {
730 OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */772 OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */
731 OVS_CT_ATTR_FORCE_COMMIT, /* No argument */773 OVS_CT_ATTR_FORCE_COMMIT, /* No argument */
732 OVS_CT_ATTR_EVENTMASK, /* u32 mask of IPCT_* events. */774 OVS_CT_ATTR_EVENTMASK, /* u32 mask of IPCT_* events. */
775 OVS_CT_ATTR_TIMEOUT, /* Associate timeout with this connection for
776 * fine-grain timeout tuning. */
733 __OVS_CT_ATTR_MAX777 __OVS_CT_ATTR_MAX
734};778};
735779
...@@ -782,6 +826,29 @@ struct ovs_action_push_eth {...@@ -782,6 +826,29 @@ struct ovs_action_push_eth {
782 struct ovs_key_ethernet addresses;826 struct ovs_key_ethernet addresses;
783};827};
784828
829/*
830 * enum ovs_check_pkt_len_attr - Attributes for %OVS_ACTION_ATTR_CHECK_PKT_LEN.
831 *
832 * @OVS_CHECK_PKT_LEN_ATTR_PKT_LEN: u16 Packet length to check for.
833 * @OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER: Nested OVS_ACTION_ATTR_*
834 * actions to apply if the packer length is greater than the specified
835 * length in the attr - OVS_CHECK_PKT_LEN_ATTR_PKT_LEN.
836 * @OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL - Nested OVS_ACTION_ATTR_*
837 * actions to apply if the packer length is lesser or equal to the specified
838 * length in the attr - OVS_CHECK_PKT_LEN_ATTR_PKT_LEN.
839 */
840enum ovs_check_pkt_len_attr {
841 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
842 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
843 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
844 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
845 __OVS_CHECK_PKT_LEN_ATTR_MAX,
846
847};
848
849#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
850
851
785/**852/**
786 * enum ovs_action_attr - Action types.853 * enum ovs_action_attr - Action types.
787 *854 *
...@@ -826,6 +893,13 @@ struct ovs_action_push_eth {...@@ -826,6 +893,13 @@ struct ovs_action_push_eth {
826 * packet, or modify the packet (e.g., change the DSCP field).893 * packet, or modify the packet (e.g., change the DSCP field).
827 * @OVS_ACTION_ATTR_CLONE: make a copy of the packet and execute a list of894 * @OVS_ACTION_ATTR_CLONE: make a copy of the packet and execute a list of
828 * actions without affecting the original packet and key.895 * actions without affecting the original packet and key.
896 * @OVS_ACTION_ATTR_CHECK_PKT_LEN: Check the packet length and execute a set
897 * of actions if greater than the specified packet length, else execute
898 * another set of actions.
899 * @OVS_ACTION_ATTR_ADD_MPLS: Push a new MPLS label stack entry at the
900 * start of the packet or at the start of the l3 header depending on the value
901 * of l3 tunnel flag in the tun_flags field of OVS_ACTION_ATTR_ADD_MPLS
902 * argument.
829 *903 *
830 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all904 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
831 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment905 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
...@@ -860,6 +934,9 @@ enum ovs_action_attr {...@@ -860,6 +934,9 @@ enum ovs_action_attr {
860 OVS_ACTION_ATTR_POP_NSH, /* No argument. */934 OVS_ACTION_ATTR_POP_NSH, /* No argument. */
861 OVS_ACTION_ATTR_METER, /* u32 meter ID. */935 OVS_ACTION_ATTR_METER, /* u32 meter ID. */
862 OVS_ACTION_ATTR_CLONE, /* Nested OVS_CLONE_ATTR_*. */936 OVS_ACTION_ATTR_CLONE, /* Nested OVS_CLONE_ATTR_*. */
937 OVS_ACTION_ATTR_CHECK_PKT_LEN, /* Nested OVS_CHECK_PKT_LEN_ATTR_*. */
938 OVS_ACTION_ATTR_ADD_MPLS, /* struct ovs_action_add_mpls. */
939 OVS_ACTION_ATTR_DEC_TTL, /* Nested OVS_DEC_TTL_ATTR_*. */
863940
864 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted941 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
865 * from userspace. */942 * from userspace. */
...@@ -947,4 +1024,12 @@ struct ovs_zone_limit {...@@ -947,4 +1024,12 @@ struct ovs_zone_limit {
947 __u32 count;1024 __u32 count;
948};1025};
9491026
1027enum ovs_dec_ttl_attr {
1028 OVS_DEC_TTL_ATTR_UNSPEC,
1029 OVS_DEC_TTL_ATTR_ACTION, /* Nested struct nlattr */
1030 __OVS_DEC_TTL_ATTR_MAX
1031};
1032
1033#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
1034
950#endif /* _LINUX_OPENVSWITCH_H */1035#endif /* _LINUX_OPENVSWITCH_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pci_regs.h+125-69
...@@ -1,7 +1,5 @@...@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*2/*
3 * pci_regs.h
4 *
5 * PCI standard defines3 * PCI standard defines
6 * Copyright 1994, Drew Eckhardt4 * Copyright 1994, Drew Eckhardt
7 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>5 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
...@@ -15,7 +13,7 @@...@@ -15,7 +13,7 @@
15 * PCI System Design Guide13 * PCI System Design Guide
16 *14 *
17 * For HyperTransport information, please consult the following manuals15 * For HyperTransport information, please consult the following manuals
18 * from http://www.hypertransport.org16 * from http://www.hypertransport.org :
19 *17 *
20 * The HyperTransport I/O Link Specification18 * The HyperTransport I/O Link Specification
21 */19 */
...@@ -36,6 +34,7 @@...@@ -36,6 +34,7 @@
36 * of which the first 64 bytes are standardized as follows:34 * of which the first 64 bytes are standardized as follows:
37 */35 */
38#define PCI_STD_HEADER_SIZEOF 6436#define PCI_STD_HEADER_SIZEOF 64
37#define PCI_STD_NUM_BARS 6 /* Number of standard BARs */
39#define PCI_VENDOR_ID 0x00 /* 16 bits */38#define PCI_VENDOR_ID 0x00 /* 16 bits */
40#define PCI_DEVICE_ID 0x02 /* 16 bits */39#define PCI_DEVICE_ID 0x02 /* 16 bits */
41#define PCI_COMMAND 0x04 /* 16 bits */40#define PCI_COMMAND 0x04 /* 16 bits */
...@@ -52,6 +51,7 @@...@@ -52,6 +51,7 @@
52#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */51#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
5352
54#define PCI_STATUS 0x06 /* 16 bits */53#define PCI_STATUS 0x06 /* 16 bits */
54#define PCI_STATUS_IMM_READY 0x01 /* Immediate Readiness */
55#define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */55#define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */
56#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */56#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
57#define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */57#define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */
...@@ -76,6 +76,7 @@...@@ -76,6 +76,7 @@
76#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */76#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
77#define PCI_LATENCY_TIMER 0x0d /* 8 bits */77#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
78#define PCI_HEADER_TYPE 0x0e /* 8 bits */78#define PCI_HEADER_TYPE 0x0e /* 8 bits */
79#define PCI_HEADER_TYPE_MASK 0x7f
79#define PCI_HEADER_TYPE_NORMAL 080#define PCI_HEADER_TYPE_NORMAL 0
80#define PCI_HEADER_TYPE_BRIDGE 181#define PCI_HEADER_TYPE_BRIDGE 1
81#define PCI_HEADER_TYPE_CARDBUS 282#define PCI_HEADER_TYPE_CARDBUS 2
...@@ -246,7 +247,7 @@...@@ -246,7 +247,7 @@
246#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */247#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
247#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */248#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
248#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */249#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
249#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */250#define PCI_PM_CAP_PME_D3hot 0x4000 /* PME# from D3 (hot) */
250#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */251#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
251#define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */252#define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */
252#define PCI_PM_CTRL 4 /* PM control and status register */253#define PCI_PM_CTRL 4 /* PM control and status register */
...@@ -300,7 +301,7 @@...@@ -300,7 +301,7 @@
300#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */301#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
301#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */302#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
302303
303/* Message Signalled Interrupts registers */304/* Message Signalled Interrupt registers */
304305
305#define PCI_MSI_FLAGS 2 /* Message Control */306#define PCI_MSI_FLAGS 2 /* Message Control */
306#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */307#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */
...@@ -318,7 +319,7 @@...@@ -318,7 +319,7 @@
318#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */319#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
319#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */320#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
320321
321/* MSI-X registers */322/* MSI-X registers (in MSI-X capability) */
322#define PCI_MSIX_FLAGS 2 /* Message Control */323#define PCI_MSIX_FLAGS 2 /* Message Control */
323#define PCI_MSIX_FLAGS_QSIZE 0x07FF /* Table size */324#define PCI_MSIX_FLAGS_QSIZE 0x07FF /* Table size */
324#define PCI_MSIX_FLAGS_MASKALL 0x4000 /* Mask all vectors for this function */325#define PCI_MSIX_FLAGS_MASKALL 0x4000 /* Mask all vectors for this function */
...@@ -332,13 +333,13 @@...@@ -332,13 +333,13 @@
332#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */333#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
333#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */334#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
334335
335/* MSI-X Table entry format */336/* MSI-X Table entry format (in memory mapped by a BAR) */
336#define PCI_MSIX_ENTRY_SIZE 16337#define PCI_MSIX_ENTRY_SIZE 16
337#define PCI_MSIX_ENTRY_LOWER_ADDR 0338#define PCI_MSIX_ENTRY_LOWER_ADDR 0 /* Message Address */
338#define PCI_MSIX_ENTRY_UPPER_ADDR 4339#define PCI_MSIX_ENTRY_UPPER_ADDR 4 /* Message Upper Address */
339#define PCI_MSIX_ENTRY_DATA 8340#define PCI_MSIX_ENTRY_DATA 8 /* Message Data */
340#define PCI_MSIX_ENTRY_VECTOR_CTRL 12341#define PCI_MSIX_ENTRY_VECTOR_CTRL 12 /* Vector Control */
341#define PCI_MSIX_ENTRY_CTRL_MASKBIT 1342#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001
342343
343/* CompactPCI Hotswap Register */344/* CompactPCI Hotswap Register */
344345
...@@ -371,6 +372,12 @@...@@ -371,6 +372,12 @@
371#define PCI_EA_FIRST_ENT_BRIDGE 8 /* First EA Entry for Bridges */372#define PCI_EA_FIRST_ENT_BRIDGE 8 /* First EA Entry for Bridges */
372#define PCI_EA_ES 0x00000007 /* Entry Size */373#define PCI_EA_ES 0x00000007 /* Entry Size */
373#define PCI_EA_BEI 0x000000f0 /* BAR Equivalent Indicator */374#define PCI_EA_BEI 0x000000f0 /* BAR Equivalent Indicator */
375
376/* EA fixed Secondary and Subordinate bus numbers for Bridge */
377#define PCI_EA_SEC_BUS_MASK 0xff
378#define PCI_EA_SUB_BUS_MASK 0xff00
379#define PCI_EA_SUB_BUS_SHIFT 8
380
374/* 0-5 map to BARs 0-5 respectively */381/* 0-5 map to BARs 0-5 respectively */
375#define PCI_EA_BEI_BAR0 0382#define PCI_EA_BEI_BAR0 0
376#define PCI_EA_BEI_BAR5 5383#define PCI_EA_BEI_BAR5 5
...@@ -464,19 +471,19 @@...@@ -464,19 +471,19 @@
464/* PCI Express capability registers */471/* PCI Express capability registers */
465472
466#define PCI_EXP_FLAGS 2 /* Capabilities register */473#define PCI_EXP_FLAGS 2 /* Capabilities register */
467#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */474#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
468#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */475#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
469#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */476#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
470#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */477#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
471#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */478#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
472#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */479#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
473#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */480#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
474#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCIe to PCI/PCI-X Bridge */481#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCIe to PCI/PCI-X Bridge */
475#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIe Bridge */482#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIe Bridge */
476#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */483#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */
477#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */484#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
478#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */485#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
479#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */486#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
480#define PCI_EXP_DEVCAP 4 /* Device capabilities */487#define PCI_EXP_DEVCAP 4 /* Device capabilities */
481#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */488#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
482#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */489#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
...@@ -497,6 +504,12 @@...@@ -497,6 +504,12 @@
497#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */504#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
498#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */505#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
499#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */506#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
507#define PCI_EXP_DEVCTL_PAYLOAD_128B 0x0000 /* 128 Bytes */
508#define PCI_EXP_DEVCTL_PAYLOAD_256B 0x0020 /* 256 Bytes */
509#define PCI_EXP_DEVCTL_PAYLOAD_512B 0x0040 /* 512 Bytes */
510#define PCI_EXP_DEVCTL_PAYLOAD_1024B 0x0060 /* 1024 Bytes */
511#define PCI_EXP_DEVCTL_PAYLOAD_2048B 0x0080 /* 2048 Bytes */
512#define PCI_EXP_DEVCTL_PAYLOAD_4096B 0x00a0 /* 4096 Bytes */
500#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */513#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
501#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */514#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
502#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */515#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
...@@ -523,8 +536,12 @@...@@ -523,8 +536,12 @@
523#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */536#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
524#define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */537#define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */
525#define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */538#define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */
539#define PCI_EXP_LNKCAP_SLS_32_0GB 0x00000005 /* LNKCAP2 SLS Vector bit 4 */
540#define PCI_EXP_LNKCAP_SLS_64_0GB 0x00000006 /* LNKCAP2 SLS Vector bit 5 */
526#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */541#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
527#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */542#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
543#define PCI_EXP_LNKCAP_ASPM_L0S 0x00000400 /* ASPM L0s Support */
544#define PCI_EXP_LNKCAP_ASPM_L1 0x00000800 /* ASPM L1 Support */
528#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */545#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
529#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */546#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */
530#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* Clock Power Management */547#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* Clock Power Management */
...@@ -551,6 +568,8 @@...@@ -551,6 +568,8 @@
551#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */568#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
552#define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */569#define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */
553#define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */570#define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */
571#define PCI_EXP_LNKSTA_CLS_32_0GB 0x0005 /* Current Link Speed 32.0GT/s */
572#define PCI_EXP_LNKSTA_CLS_64_0GB 0x0006 /* Current Link Speed 64.0GT/s */
554#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */573#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */
555#define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */574#define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */
556#define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */575#define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */
...@@ -584,6 +603,7 @@...@@ -584,6 +603,7 @@
584#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */603#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */
585#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */604#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */
586#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */605#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */
606#define PCI_EXP_SLTCTL_ATTN_IND_SHIFT 6 /* Attention Indicator shift */
587#define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */607#define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */
588#define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */608#define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */
589#define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */609#define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */
...@@ -596,6 +616,7 @@...@@ -596,6 +616,7 @@
596#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */616#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
597#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */617#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
598#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */618#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
619#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */
599#define PCI_EXP_SLTSTA 26 /* Slot Status */620#define PCI_EXP_SLTSTA 26 /* Slot Status */
600#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */621#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
601#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */622#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */
...@@ -615,8 +636,8 @@...@@ -615,8 +636,8 @@
615#define PCI_EXP_RTCAP 30 /* Root Capabilities */636#define PCI_EXP_RTCAP 30 /* Root Capabilities */
616#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */637#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
617#define PCI_EXP_RTSTA 32 /* Root Status */638#define PCI_EXP_RTSTA 32 /* Root Status */
618#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */639#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
619#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */640#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
620/*641/*
621 * The Device Capabilities 2, Device Status 2, Device Control 2,642 * The Device Capabilities 2, Device Status 2, Device Control 2,
622 * Link Capabilities 2, Link Status 2, Link Control 2,643 * Link Capabilities 2, Link Status 2, Link Control 2,
...@@ -636,13 +657,13 @@...@@ -636,13 +657,13 @@
636#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */657#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */
637#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */658#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
638#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */659#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
639#define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */660#define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */
640#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */661#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
641#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */662#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */
642#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */663#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */
643#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */664#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */
644#define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */665#define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */
645#define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */666#define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */
646#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */667#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */
647#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */668#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */
648#define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */669#define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */
...@@ -656,16 +677,24 @@...@@ -656,16 +677,24 @@
656#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */677#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
657#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */678#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */
658#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */679#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */
680#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */
681#define PCI_EXP_LNKCAP2_SLS_64_0GB 0x00000040 /* Supported Speed 64GT/s */
659#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */682#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */
660#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */683#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
661#define PCI_EXP_LNKCTL2_TLS 0x000f684#define PCI_EXP_LNKCTL2_TLS 0x000f
662#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */685#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */
663#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */686#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */
664#define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */687#define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */
665#define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */688#define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */
689#define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */
690#define PCI_EXP_LNKCTL2_TLS_64_0GT 0x0006 /* Supported Speed 64GT/s */
691#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */
692#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */
693#define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */
666#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */694#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
667#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */695#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */
668#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */696#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */
697#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */
669#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */698#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
670#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */699#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */
671700
...@@ -704,7 +733,10 @@...@@ -704,7 +733,10 @@
704#define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */733#define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */
705#define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */734#define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */
706#define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */735#define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */
707#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM736#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
737#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
738#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
739#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT
708740
709#define PCI_EXT_CAP_DSN_SIZEOF 12741#define PCI_EXT_CAP_DSN_SIZEOF 12
710#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40742#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
...@@ -751,18 +783,18 @@...@@ -751,18 +783,18 @@
751#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */783#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
752#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */784#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
753#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */785#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
754#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */786#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */
755#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */787#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */
756#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */788#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */
757#define PCI_ERR_ROOT_STATUS 48789#define PCI_ERR_ROOT_STATUS 48
758#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */790#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
759#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */791#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */
760#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */792#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */
761#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 /* Multiple FATAL/NONFATAL */793#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 /* Multiple FATAL/NONFATAL */
762#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First UNC is Fatal */794#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First UNC is Fatal */
763#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */795#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
764#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */796#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
765#define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */797#define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */
766#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */798#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
767799
768/* Virtual Channel */800/* Virtual Channel */
...@@ -810,6 +842,13 @@...@@ -810,6 +842,13 @@
810#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */842#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
811#define PCI_EXT_CAP_PWR_SIZEOF 16843#define PCI_EXT_CAP_PWR_SIZEOF 16
812844
845/* Root Complex Event Collector Endpoint Association */
846#define PCI_RCEC_RCIEP_BITMAP 4 /* Associated Bitmap for RCiEPs */
847#define PCI_RCEC_BUSN 8 /* RCEC Associated Bus Numbers */
848#define PCI_RCEC_BUSN_REG_VER 0x02 /* Least version with BUSN present */
849#define PCI_RCEC_BUSN_NEXT(x) (((x) >> 8) & 0xff)
850#define PCI_RCEC_BUSN_LAST(x) (((x) >> 16) & 0xff)
851
813/* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */852/* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */
814#define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */853#define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */
815#define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff)854#define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff)
...@@ -865,6 +904,7 @@...@@ -865,6 +904,7 @@
865#define PCI_ATS_CAP 0x04 /* ATS Capability Register */904#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
866#define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */905#define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */
867#define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */906#define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */
907#define PCI_ATS_CAP_PAGE_ALIGNED 0x0020 /* Page Aligned Request */
868#define PCI_ATS_CTRL 0x06 /* ATS Control Register */908#define PCI_ATS_CTRL 0x06 /* ATS Control Register */
869#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */909#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
870#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */910#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
...@@ -873,12 +913,13 @@...@@ -873,12 +913,13 @@
873913
874/* Page Request Interface */914/* Page Request Interface */
875#define PCI_PRI_CTRL 0x04 /* PRI control register */915#define PCI_PRI_CTRL 0x04 /* PRI control register */
876#define PCI_PRI_CTRL_ENABLE 0x01 /* Enable */916#define PCI_PRI_CTRL_ENABLE 0x0001 /* Enable */
877#define PCI_PRI_CTRL_RESET 0x02 /* Reset */917#define PCI_PRI_CTRL_RESET 0x0002 /* Reset */
878#define PCI_PRI_STATUS 0x06 /* PRI status register */918#define PCI_PRI_STATUS 0x06 /* PRI status register */
879#define PCI_PRI_STATUS_RF 0x001 /* Response Failure */919#define PCI_PRI_STATUS_RF 0x0001 /* Response Failure */
880#define PCI_PRI_STATUS_UPRGI 0x002 /* Unexpected PRG index */920#define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */
881#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */921#define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */
922#define PCI_PRI_STATUS_PASID 0x8000 /* PRG Response PASID Required */
882#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */923#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
883#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */924#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
884#define PCI_EXT_CAP_PRI_SIZEOF 16925#define PCI_EXT_CAP_PRI_SIZEOF 16
...@@ -895,16 +936,16 @@...@@ -895,16 +936,16 @@
895936
896/* Single Root I/O Virtualization */937/* Single Root I/O Virtualization */
897#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */938#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
898#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */939#define PCI_SRIOV_CAP_VFM 0x00000001 /* VF Migration Capable */
899#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */940#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */
900#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */941#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */
901#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */942#define PCI_SRIOV_CTRL_VFE 0x0001 /* VF Enable */
902#define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */943#define PCI_SRIOV_CTRL_VFM 0x0002 /* VF Migration Enable */
903#define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */944#define PCI_SRIOV_CTRL_INTR 0x0004 /* VF Migration Interrupt Enable */
904#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */945#define PCI_SRIOV_CTRL_MSE 0x0008 /* VF Memory Space Enable */
905#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */946#define PCI_SRIOV_CTRL_ARI 0x0010 /* ARI Capable Hierarchy */
906#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */947#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */
907#define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */948#define PCI_SRIOV_STATUS_VFM 0x0001 /* VF Migration Status */
908#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */949#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */
909#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */950#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */
910#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */951#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */
...@@ -934,13 +975,13 @@...@@ -934,13 +975,13 @@
934975
935/* Access Control Service */976/* Access Control Service */
936#define PCI_ACS_CAP 0x04 /* ACS Capability Register */977#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
937#define PCI_ACS_SV 0x01 /* Source Validation */978#define PCI_ACS_SV 0x0001 /* Source Validation */
938#define PCI_ACS_TB 0x02 /* Translation Blocking */979#define PCI_ACS_TB 0x0002 /* Translation Blocking */
939#define PCI_ACS_RR 0x04 /* P2P Request Redirect */980#define PCI_ACS_RR 0x0004 /* P2P Request Redirect */
940#define PCI_ACS_CR 0x08 /* P2P Completion Redirect */981#define PCI_ACS_CR 0x0008 /* P2P Completion Redirect */
941#define PCI_ACS_UF 0x10 /* Upstream Forwarding */982#define PCI_ACS_UF 0x0010 /* Upstream Forwarding */
942#define PCI_ACS_EC 0x20 /* P2P Egress Control */983#define PCI_ACS_EC 0x0020 /* P2P Egress Control */
943#define PCI_ACS_DT 0x40 /* Direct Translated P2P */984#define PCI_ACS_DT 0x0040 /* Direct Translated P2P */
944#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */985#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
945#define PCI_ACS_CTRL 0x06 /* ACS Control Register */986#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
946#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */987#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
...@@ -990,9 +1031,9 @@...@@ -990,9 +1031,9 @@
990#define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */1031#define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */
9911032
992#define PCI_EXP_DPC_CTL 6 /* DPC control */1033#define PCI_EXP_DPC_CTL 6 /* DPC control */
993#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */1034#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */
994#define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */1035#define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */
995#define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */1036#define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */
9961037
997#define PCI_EXP_DPC_STATUS 8 /* DPC Status */1038#define PCI_EXP_DPC_STATUS 8 /* DPC Status */
998#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */1039#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */
...@@ -1036,10 +1077,25 @@...@@ -1036,10 +1077,25 @@
1036#define PCI_L1SS_CTL1_PCIPM_L1_1 0x00000002 /* PCI-PM L1.1 Enable */1077#define PCI_L1SS_CTL1_PCIPM_L1_1 0x00000002 /* PCI-PM L1.1 Enable */
1037#define PCI_L1SS_CTL1_ASPM_L1_2 0x00000004 /* ASPM L1.2 Enable */1078#define PCI_L1SS_CTL1_ASPM_L1_2 0x00000004 /* ASPM L1.2 Enable */
1038#define PCI_L1SS_CTL1_ASPM_L1_1 0x00000008 /* ASPM L1.1 Enable */1079#define PCI_L1SS_CTL1_ASPM_L1_1 0x00000008 /* ASPM L1.1 Enable */
1080#define PCI_L1SS_CTL1_L1_2_MASK 0x00000005
1039#define PCI_L1SS_CTL1_L1SS_MASK 0x0000000f1081#define PCI_L1SS_CTL1_L1SS_MASK 0x0000000f
1040#define PCI_L1SS_CTL1_CM_RESTORE_TIME 0x0000ff00 /* Common_Mode_Restore_Time */1082#define PCI_L1SS_CTL1_CM_RESTORE_TIME 0x0000ff00 /* Common_Mode_Restore_Time */
1041#define PCI_L1SS_CTL1_LTR_L12_TH_VALUE 0x03ff0000 /* LTR_L1.2_THRESHOLD_Value */1083#define PCI_L1SS_CTL1_LTR_L12_TH_VALUE 0x03ff0000 /* LTR_L1.2_THRESHOLD_Value */
1042#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */1084#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */
1043#define PCI_L1SS_CTL2 0x0c /* Control 2 Register */1085#define PCI_L1SS_CTL2 0x0c /* Control 2 Register */
10441086
1087/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */
1088#define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */
1089#define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */
1090
1091/* Data Link Feature */
1092#define PCI_DLF_CAP 0x04 /* Capabilities Register */
1093#define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */
1094
1095/* Physical Layer 16.0 GT/s */
1096#define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */
1097#define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F
1098#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
1099#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
1100
1045#endif /* LINUX_PCI_REGS_H */1101#endif /* LINUX_PCI_REGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pcitest.h+9-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/**2/*
3 * pcitest.h - PCI test uapi defines3 * pcitest.h - PCI test uapi defines
4 *4 *
5 * Copyright (C) 2017 Texas Instruments5 * Copyright (C) 2017 Texas Instruments
...@@ -19,5 +19,13 @@...@@ -19,5 +19,13 @@
19#define PCITEST_MSIX _IOW('P', 0x7, int)19#define PCITEST_MSIX _IOW('P', 0x7, int)
20#define PCITEST_SET_IRQTYPE _IOW('P', 0x8, int)20#define PCITEST_SET_IRQTYPE _IOW('P', 0x8, int)
21#define PCITEST_GET_IRQTYPE _IO('P', 0x9)21#define PCITEST_GET_IRQTYPE _IO('P', 0x9)
22#define PCITEST_CLEAR_IRQ _IO('P', 0x10)
23
24#define PCITEST_FLAGS_USE_DMA 0x00000001
25
26struct pci_endpoint_test_xfer_param {
27 unsigned long size;
28 unsigned char flags;
29};
2230
23#endif /* __UAPI_LINUX_PCITEST_H */31#endif /* __UAPI_LINUX_PCITEST_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/perf_event.h+280-22
...@@ -37,6 +37,21 @@ enum perf_type_id {...@@ -37,6 +37,21 @@ enum perf_type_id {
37 PERF_TYPE_MAX, /* non-ABI */37 PERF_TYPE_MAX, /* non-ABI */
38};38};
3939
40/*
41 * attr.config layout for type PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE
42 * PERF_TYPE_HARDWARE: 0xEEEEEEEE000000AA
43 * AA: hardware event ID
44 * EEEEEEEE: PMU type ID
45 * PERF_TYPE_HW_CACHE: 0xEEEEEEEE00DDCCBB
46 * BB: hardware cache ID
47 * CC: hardware cache op ID
48 * DD: hardware cache op result ID
49 * EEEEEEEE: PMU type ID
50 * If the PMU type ID is 0, the PERF_TYPE_RAW will be applied.
51 */
52#define PERF_PMU_TYPE_SHIFT 32
53#define PERF_HW_EVENT_MASK 0xffffffff
54
40/*55/*
41 * Generalized performance event event_id types, used by the56 * Generalized performance event event_id types, used by the
42 * attr.event_id parameter of the sys_perf_event_open()57 * attr.event_id parameter of the sys_perf_event_open()
...@@ -112,6 +127,7 @@ enum perf_sw_ids {...@@ -112,6 +127,7 @@ enum perf_sw_ids {
112 PERF_COUNT_SW_EMULATION_FAULTS = 8,127 PERF_COUNT_SW_EMULATION_FAULTS = 8,
113 PERF_COUNT_SW_DUMMY = 9,128 PERF_COUNT_SW_DUMMY = 9,
114 PERF_COUNT_SW_BPF_OUTPUT = 10,129 PERF_COUNT_SW_BPF_OUTPUT = 10,
130 PERF_COUNT_SW_CGROUP_SWITCHES = 11,
115131
116 PERF_COUNT_SW_MAX, /* non-ABI */132 PERF_COUNT_SW_MAX, /* non-ABI */
117};133};
...@@ -141,12 +157,18 @@ enum perf_event_sample_format {...@@ -141,12 +157,18 @@ enum perf_event_sample_format {
141 PERF_SAMPLE_TRANSACTION = 1U << 17,157 PERF_SAMPLE_TRANSACTION = 1U << 17,
142 PERF_SAMPLE_REGS_INTR = 1U << 18,158 PERF_SAMPLE_REGS_INTR = 1U << 18,
143 PERF_SAMPLE_PHYS_ADDR = 1U << 19,159 PERF_SAMPLE_PHYS_ADDR = 1U << 19,
160 PERF_SAMPLE_AUX = 1U << 20,
161 PERF_SAMPLE_CGROUP = 1U << 21,
162 PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22,
163 PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23,
164 PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,
144165
145 PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */166 PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */
146167
147 __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */168 __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
148};169};
149170
171#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
150/*172/*
151 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set173 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
152 *174 *
...@@ -180,6 +202,8 @@ enum perf_branch_sample_type_shift {...@@ -180,6 +202,8 @@ enum perf_branch_sample_type_shift {
180202
181 PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, /* save branch type */203 PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, /* save branch type */
182204
205 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */
206
183 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */207 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
184};208};
185209
...@@ -207,6 +231,8 @@ enum perf_branch_sample_type {...@@ -207,6 +231,8 @@ enum perf_branch_sample_type {
207 PERF_SAMPLE_BRANCH_TYPE_SAVE =231 PERF_SAMPLE_BRANCH_TYPE_SAVE =
208 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT,232 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT,
209233
234 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
235
210 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,236 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
211};237};
212238
...@@ -300,6 +326,8 @@ enum perf_event_read_format {...@@ -300,6 +326,8 @@ enum perf_event_read_format {
300 /* add: sample_stack_user */326 /* add: sample_stack_user */
301#define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */327#define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */
302#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */328#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */
329#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */
330#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */
303331
304/*332/*
305 * Hardware event_id to monitor via a performance monitoring event:333 * Hardware event_id to monitor via a performance monitoring event:
...@@ -372,7 +400,16 @@ struct perf_event_attr {...@@ -372,7 +400,16 @@ struct perf_event_attr {
372 context_switch : 1, /* context switch data */400 context_switch : 1, /* context switch data */
373 write_backward : 1, /* Write ring buffer from end to beginning */401 write_backward : 1, /* Write ring buffer from end to beginning */
374 namespaces : 1, /* include namespaces data */402 namespaces : 1, /* include namespaces data */
375 __reserved_1 : 35;403 ksymbol : 1, /* include ksymbol events */
404 bpf_event : 1, /* include bpf events */
405 aux_output : 1, /* generate AUX records instead of events */
406 cgroup : 1, /* include cgroup events */
407 text_poke : 1, /* include text poke events */
408 build_id : 1, /* use build id in mmap2 events */
409 inherit_thread : 1, /* children only inherit if cloned with CLONE_THREAD */
410 remove_on_exec : 1, /* event is removed from task on exec */
411 sigtrap : 1, /* send synchronous SIGTRAP on event */
412 __reserved_1 : 26;
376413
377 union {414 union {
378 __u32 wakeup_events; /* wakeup every n events */415 __u32 wakeup_events; /* wakeup every n events */
...@@ -421,7 +458,15 @@ struct perf_event_attr {...@@ -421,7 +458,15 @@ struct perf_event_attr {
421 */458 */
422 __u32 aux_watermark;459 __u32 aux_watermark;
423 __u16 sample_max_stack;460 __u16 sample_max_stack;
424 __u16 __reserved_2; /* align to __u64 */461 __u16 __reserved_2;
462 __u32 aux_sample_size;
463 __u32 __reserved_3;
464
465 /*
466 * User provided data if sigtrap=1, passed back to user via
467 * siginfo_t::si_perf_data, e.g. to permit user to identify the event.
468 */
469 __u64 sig_data;
425};470};
426471
427/*472/*
...@@ -445,8 +490,6 @@ struct perf_event_query_bpf {...@@ -445,8 +490,6 @@ struct perf_event_query_bpf {
445 __u32 ids[0];490 __u32 ids[0];
446};491};
447492
448#define perf_flags(attr) (*(&(attr)->read_format + 1))
449
450/*493/*
451 * Ioctls that can be done on a perf event fd:494 * Ioctls that can be done on a perf event fd:
452 */495 */
...@@ -521,9 +564,10 @@ struct perf_event_mmap_page {...@@ -521,9 +564,10 @@ struct perf_event_mmap_page {
521 cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */564 cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */
522565
523 cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */566 cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */
524 cap_user_time : 1, /* The time_* fields are used */567 cap_user_time : 1, /* The time_{shift,mult,offset} fields are used */
525 cap_user_time_zero : 1, /* The time_zero field is used */568 cap_user_time_zero : 1, /* The time_zero field is used */
526 cap_____res : 59;569 cap_user_time_short : 1, /* the time_{cycle,mask} fields are used */
570 cap_____res : 58;
527 };571 };
528 };572 };
529573
...@@ -582,13 +626,29 @@ struct perf_event_mmap_page {...@@ -582,13 +626,29 @@ struct perf_event_mmap_page {
582 * ((rem * time_mult) >> time_shift);626 * ((rem * time_mult) >> time_shift);
583 */627 */
584 __u64 time_zero;628 __u64 time_zero;
629
585 __u32 size; /* Header size up to __reserved[] fields. */630 __u32 size; /* Header size up to __reserved[] fields. */
631 __u32 __reserved_1;
632
633 /*
634 * If cap_usr_time_short, the hardware clock is less than 64bit wide
635 * and we must compute the 'cyc' value, as used by cap_usr_time, as:
636 *
637 * cyc = time_cycles + ((cyc - time_cycles) & time_mask)
638 *
639 * NOTE: this form is explicitly chosen such that cap_usr_time_short
640 * is a correction on top of cap_usr_time, and code that doesn't
641 * know about cap_usr_time_short still works under the assumption
642 * the counter doesn't wrap.
643 */
644 __u64 time_cycles;
645 __u64 time_mask;
586646
587 /*647 /*
588 * Hole for extension of the self monitor capabilities648 * Hole for extension of the self monitor capabilities
589 */649 */
590650
591 __u8 __reserved[118*8+4]; /* align to 1k. */651 __u8 __reserved[116*8]; /* align to 1k. */
592652
593 /*653 /*
594 * Control data for the mmap() data buffer.654 * Control data for the mmap() data buffer.
...@@ -628,6 +688,22 @@ struct perf_event_mmap_page {...@@ -628,6 +688,22 @@ struct perf_event_mmap_page {
628 __u64 aux_size;688 __u64 aux_size;
629};689};
630690
691/*
692 * The current state of perf_event_header::misc bits usage:
693 * ('|' used bit, '-' unused bit)
694 *
695 * 012 CDEF
696 * |||---------||||
697 *
698 * Where:
699 * 0-2 CPUMODE_MASK
700 *
701 * C PROC_MAP_PARSE_TIMEOUT
702 * D MMAP_DATA / COMM_EXEC / FORK_EXEC / SWITCH_OUT
703 * E MMAP_BUILD_ID / EXACT_IP / SCHED_OUT_PREEMPT
704 * F (reserved)
705 */
706
631#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)707#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
632#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)708#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
633#define PERF_RECORD_MISC_KERNEL (1 << 0)709#define PERF_RECORD_MISC_KERNEL (1 << 0)
...@@ -646,10 +722,12 @@ struct perf_event_mmap_page {...@@ -646,10 +722,12 @@ struct perf_event_mmap_page {
646 *722 *
647 * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events723 * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events
648 * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event724 * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event
725 * PERF_RECORD_MISC_FORK_EXEC - PERF_RECORD_FORK event (perf internal)
649 * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events726 * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events
650 */727 */
651#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)728#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
652#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)729#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
730#define PERF_RECORD_MISC_FORK_EXEC (1 << 13)
653#define PERF_RECORD_MISC_SWITCH_OUT (1 << 13)731#define PERF_RECORD_MISC_SWITCH_OUT (1 << 13)
654/*732/*
655 * These PERF_RECORD_MISC_* flags below are safely reused733 * These PERF_RECORD_MISC_* flags below are safely reused
...@@ -657,6 +735,7 @@ struct perf_event_mmap_page {...@@ -657,6 +735,7 @@ struct perf_event_mmap_page {
657 *735 *
658 * PERF_RECORD_MISC_EXACT_IP - PERF_RECORD_SAMPLE of precise events736 * PERF_RECORD_MISC_EXACT_IP - PERF_RECORD_SAMPLE of precise events
659 * PERF_RECORD_MISC_SWITCH_OUT_PREEMPT - PERF_RECORD_SWITCH* events737 * PERF_RECORD_MISC_SWITCH_OUT_PREEMPT - PERF_RECORD_SWITCH* events
738 * PERF_RECORD_MISC_MMAP_BUILD_ID - PERF_RECORD_MMAP2 event
660 *739 *
661 *740 *
662 * PERF_RECORD_MISC_EXACT_IP:741 * PERF_RECORD_MISC_EXACT_IP:
...@@ -666,9 +745,13 @@ struct perf_event_mmap_page {...@@ -666,9 +745,13 @@ struct perf_event_mmap_page {
666 *745 *
667 * PERF_RECORD_MISC_SWITCH_OUT_PREEMPT:746 * PERF_RECORD_MISC_SWITCH_OUT_PREEMPT:
668 * Indicates that thread was preempted in TASK_RUNNING state.747 * Indicates that thread was preempted in TASK_RUNNING state.
748 *
749 * PERF_RECORD_MISC_MMAP_BUILD_ID:
750 * Indicates that mmap2 event carries build id data.
669 */751 */
670#define PERF_RECORD_MISC_EXACT_IP (1 << 14)752#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
671#define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)753#define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)
754#define PERF_RECORD_MISC_MMAP_BUILD_ID (1 << 14)
672/*755/*
673 * Reserve the last bit to indicate some extended misc field756 * Reserve the last bit to indicate some extended misc field
674 */757 */
...@@ -846,7 +929,9 @@ enum perf_event_type {...@@ -846,7 +929,9 @@ enum perf_event_type {
846 * char data[size];}&& PERF_SAMPLE_RAW929 * char data[size];}&& PERF_SAMPLE_RAW
847 *930 *
848 * { u64 nr;931 * { u64 nr;
849 * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK932 * { u64 hw_idx; } && PERF_SAMPLE_BRANCH_HW_INDEX
933 * { u64 from, to, flags } lbr[nr];
934 * } && PERF_SAMPLE_BRANCH_STACK
850 *935 *
851 * { u64 abi; # enum perf_sample_regs_abi936 * { u64 abi; # enum perf_sample_regs_abi
852 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER937 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
...@@ -855,12 +940,33 @@ enum perf_event_type {...@@ -855,12 +940,33 @@ enum perf_event_type {
855 * char data[size];940 * char data[size];
856 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER941 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
857 *942 *
858 * { u64 weight; } && PERF_SAMPLE_WEIGHT943 * { union perf_sample_weight
944 * {
945 * u64 full; && PERF_SAMPLE_WEIGHT
946 * #if defined(__LITTLE_ENDIAN_BITFIELD)
947 * struct {
948 * u32 var1_dw;
949 * u16 var2_w;
950 * u16 var3_w;
951 * } && PERF_SAMPLE_WEIGHT_STRUCT
952 * #elif defined(__BIG_ENDIAN_BITFIELD)
953 * struct {
954 * u16 var3_w;
955 * u16 var2_w;
956 * u32 var1_dw;
957 * } && PERF_SAMPLE_WEIGHT_STRUCT
958 * #endif
959 * }
960 * }
859 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC961 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC
860 * { u64 transaction; } && PERF_SAMPLE_TRANSACTION962 * { u64 transaction; } && PERF_SAMPLE_TRANSACTION
861 * { u64 abi; # enum perf_sample_regs_abi963 * { u64 abi; # enum perf_sample_regs_abi
862 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR964 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
863 * { u64 phys_addr;} && PERF_SAMPLE_PHYS_ADDR965 * { u64 phys_addr;} && PERF_SAMPLE_PHYS_ADDR
966 * { u64 size;
967 * char data[size]; } && PERF_SAMPLE_AUX
968 * { u64 data_page_size;} && PERF_SAMPLE_DATA_PAGE_SIZE
969 * { u64 code_page_size;} && PERF_SAMPLE_CODE_PAGE_SIZE
864 * };970 * };
865 */971 */
866 PERF_RECORD_SAMPLE = 9,972 PERF_RECORD_SAMPLE = 9,
...@@ -876,10 +982,20 @@ enum perf_event_type {...@@ -876,10 +982,20 @@ enum perf_event_type {
876 * u64 addr;982 * u64 addr;
877 * u64 len;983 * u64 len;
878 * u64 pgoff;984 * u64 pgoff;
879 * u32 maj;985 * union {
880 * u32 min;986 * struct {
881 * u64 ino;987 * u32 maj;
882 * u64 ino_generation;988 * u32 min;
989 * u64 ino;
990 * u64 ino_generation;
991 * };
992 * struct {
993 * u8 build_id_size;
994 * u8 __reserved_1;
995 * u16 __reserved_2;
996 * u8 build_id[20];
997 * };
998 * };
883 * u32 prot, flags;999 * u32 prot, flags;
884 * char filename[];1000 * char filename[];
885 * struct sample_id sample_id;1001 * struct sample_id sample_id;
...@@ -963,9 +1079,106 @@ enum perf_event_type {...@@ -963,9 +1079,106 @@ enum perf_event_type {
963 */1079 */
964 PERF_RECORD_NAMESPACES = 16,1080 PERF_RECORD_NAMESPACES = 16,
9651081
1082 /*
1083 * Record ksymbol register/unregister events:
1084 *
1085 * struct {
1086 * struct perf_event_header header;
1087 * u64 addr;
1088 * u32 len;
1089 * u16 ksym_type;
1090 * u16 flags;
1091 * char name[];
1092 * struct sample_id sample_id;
1093 * };
1094 */
1095 PERF_RECORD_KSYMBOL = 17,
1096
1097 /*
1098 * Record bpf events:
1099 * enum perf_bpf_event_type {
1100 * PERF_BPF_EVENT_UNKNOWN = 0,
1101 * PERF_BPF_EVENT_PROG_LOAD = 1,
1102 * PERF_BPF_EVENT_PROG_UNLOAD = 2,
1103 * };
1104 *
1105 * struct {
1106 * struct perf_event_header header;
1107 * u16 type;
1108 * u16 flags;
1109 * u32 id;
1110 * u8 tag[BPF_TAG_SIZE];
1111 * struct sample_id sample_id;
1112 * };
1113 */
1114 PERF_RECORD_BPF_EVENT = 18,
1115
1116 /*
1117 * struct {
1118 * struct perf_event_header header;
1119 * u64 id;
1120 * char path[];
1121 * struct sample_id sample_id;
1122 * };
1123 */
1124 PERF_RECORD_CGROUP = 19,
1125
1126 /*
1127 * Records changes to kernel text i.e. self-modified code. 'old_len' is
1128 * the number of old bytes, 'new_len' is the number of new bytes. Either
1129 * 'old_len' or 'new_len' may be zero to indicate, for example, the
1130 * addition or removal of a trampoline. 'bytes' contains the old bytes
1131 * followed immediately by the new bytes.
1132 *
1133 * struct {
1134 * struct perf_event_header header;
1135 * u64 addr;
1136 * u16 old_len;
1137 * u16 new_len;
1138 * u8 bytes[];
1139 * struct sample_id sample_id;
1140 * };
1141 */
1142 PERF_RECORD_TEXT_POKE = 20,
1143
1144 /*
1145 * Data written to the AUX area by hardware due to aux_output, may need
1146 * to be matched to the event by an architecture-specific hardware ID.
1147 * This records the hardware ID, but requires sample_id to provide the
1148 * event ID. e.g. Intel PT uses this record to disambiguate PEBS-via-PT
1149 * records from multiple events.
1150 *
1151 * struct {
1152 * struct perf_event_header header;
1153 * u64 hw_id;
1154 * struct sample_id sample_id;
1155 * };
1156 */
1157 PERF_RECORD_AUX_OUTPUT_HW_ID = 21,
1158
966 PERF_RECORD_MAX, /* non-ABI */1159 PERF_RECORD_MAX, /* non-ABI */
967};1160};
9681161
1162enum perf_record_ksymbol_type {
1163 PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0,
1164 PERF_RECORD_KSYMBOL_TYPE_BPF = 1,
1165 /*
1166 * Out of line code such as kprobe-replaced instructions or optimized
1167 * kprobes or ftrace trampolines.
1168 */
1169 PERF_RECORD_KSYMBOL_TYPE_OOL = 2,
1170 PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */
1171};
1172
1173#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0)
1174
1175enum perf_bpf_event_type {
1176 PERF_BPF_EVENT_UNKNOWN = 0,
1177 PERF_BPF_EVENT_PROG_LOAD = 1,
1178 PERF_BPF_EVENT_PROG_UNLOAD = 2,
1179 PERF_BPF_EVENT_MAX, /* non-ABI */
1180};
1181
969#define PERF_MAX_STACK_DEPTH 1271182#define PERF_MAX_STACK_DEPTH 127
970#define PERF_MAX_CONTEXTS_PER_STACK 81183#define PERF_MAX_CONTEXTS_PER_STACK 8
9711184
...@@ -984,10 +1197,15 @@ enum perf_callchain_context {...@@ -984,10 +1197,15 @@ enum perf_callchain_context {
984/**1197/**
985 * PERF_RECORD_AUX::flags bits1198 * PERF_RECORD_AUX::flags bits
986 */1199 */
987#define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */1200#define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */
988#define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */1201#define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */
989#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */1202#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */
990#define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */1203#define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */
1204#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 /* PMU specific trace format type */
1205
1206/* CoreSight PMU AUX buffer formats */
1207#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 /* Default for backward compatibility */
1208#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 /* Raw format of the source */
9911209
992#define PERF_FLAG_FD_NO_GROUP (1UL << 0)1210#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
993#define PERF_FLAG_FD_OUTPUT (1UL << 1)1211#define PERF_FLAG_FD_OUTPUT (1UL << 1)
...@@ -1006,14 +1224,18 @@ union perf_mem_data_src {...@@ -1006,14 +1224,18 @@ union perf_mem_data_src {
1006 mem_lvl_num:4, /* memory hierarchy level number */1224 mem_lvl_num:4, /* memory hierarchy level number */
1007 mem_remote:1, /* remote */1225 mem_remote:1, /* remote */
1008 mem_snoopx:2, /* snoop mode, ext */1226 mem_snoopx:2, /* snoop mode, ext */
1009 mem_rsvd:24;1227 mem_blk:3, /* access blocked */
1228 mem_hops:3, /* hop level */
1229 mem_rsvd:18;
1010 };1230 };
1011};1231};
1012#elif defined(__BIG_ENDIAN_BITFIELD)1232#elif defined(__BIG_ENDIAN_BITFIELD)
1013union perf_mem_data_src {1233union perf_mem_data_src {
1014 __u64 val;1234 __u64 val;
1015 struct {1235 struct {
1016 __u64 mem_rsvd:24,1236 __u64 mem_rsvd:18,
1237 mem_hops:3, /* hop level */
1238 mem_blk:3, /* access blocked */
1017 mem_snoopx:2, /* snoop mode, ext */1239 mem_snoopx:2, /* snoop mode, ext */
1018 mem_remote:1, /* remote */1240 mem_remote:1, /* remote */
1019 mem_lvl_num:4, /* memory hierarchy level number */1241 mem_lvl_num:4, /* memory hierarchy level number */
...@@ -1036,7 +1258,13 @@ union perf_mem_data_src {...@@ -1036,7 +1258,13 @@ union perf_mem_data_src {
1036#define PERF_MEM_OP_EXEC 0x10 /* code (execution) */1258#define PERF_MEM_OP_EXEC 0x10 /* code (execution) */
1037#define PERF_MEM_OP_SHIFT 01259#define PERF_MEM_OP_SHIFT 0
10381260
1039/* memory hierarchy (memory level, hit or miss) */1261/*
1262 * PERF_MEM_LVL_* namespace being depricated to some extent in the
1263 * favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_} fields.
1264 * Supporting this namespace inorder to not break defined ABIs.
1265 *
1266 * memory hierarchy (memory level, hit or miss)
1267 */
1040#define PERF_MEM_LVL_NA 0x01 /* not available */1268#define PERF_MEM_LVL_NA 0x01 /* not available */
1041#define PERF_MEM_LVL_HIT 0x02 /* hit level */1269#define PERF_MEM_LVL_HIT 0x02 /* hit level */
1042#define PERF_MEM_LVL_MISS 0x04 /* miss level */1270#define PERF_MEM_LVL_MISS 0x04 /* miss level */
...@@ -1079,7 +1307,7 @@ union perf_mem_data_src {...@@ -1079,7 +1307,7 @@ union perf_mem_data_src {
10791307
1080#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */1308#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1081/* 1 free */1309/* 1 free */
1082#define PERF_MEM_SNOOPX_SHIFT 371310#define PERF_MEM_SNOOPX_SHIFT 38
10831311
1084/* locked instruction */1312/* locked instruction */
1085#define PERF_MEM_LOCK_NA 0x01 /* not available */1313#define PERF_MEM_LOCK_NA 0x01 /* not available */
...@@ -1096,6 +1324,17 @@ union perf_mem_data_src {...@@ -1096,6 +1324,17 @@ union perf_mem_data_src {
1096#define PERF_MEM_TLB_OS 0x40 /* OS fault handler */1324#define PERF_MEM_TLB_OS 0x40 /* OS fault handler */
1097#define PERF_MEM_TLB_SHIFT 261325#define PERF_MEM_TLB_SHIFT 26
10981326
1327/* Access blocked */
1328#define PERF_MEM_BLK_NA 0x01 /* not available */
1329#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */
1330#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */
1331#define PERF_MEM_BLK_SHIFT 40
1332
1333/* hop level */
1334#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */
1335/* 2-7 available */
1336#define PERF_MEM_HOPS_SHIFT 43
1337
1099#define PERF_MEM_S(a, s) \1338#define PERF_MEM_S(a, s) \
1100 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)1339 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
11011340
...@@ -1127,4 +1366,23 @@ struct perf_branch_entry {...@@ -1127,4 +1366,23 @@ struct perf_branch_entry {
1127 reserved:40;1366 reserved:40;
1128};1367};
11291368
1369union perf_sample_weight {
1370 __u64 full;
1371#if defined(__LITTLE_ENDIAN_BITFIELD)
1372 struct {
1373 __u32 var1_dw;
1374 __u16 var2_w;
1375 __u16 var3_w;
1376 };
1377#elif defined(__BIG_ENDIAN_BITFIELD)
1378 struct {
1379 __u16 var3_w;
1380 __u16 var2_w;
1381 __u32 var1_dw;
1382 };
1383#else
1384#error "Unknown endianness"
1385#endif
1386};
1387
1130#endif /* _LINUX_PERF_EVENT_H */1388#endif /* _LINUX_PERF_EVENT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pg.h+4-1
...@@ -35,6 +35,9 @@...@@ -35,6 +35,9 @@
3535
36*/36*/
3737
38#ifndef _LINUX_PG_H
39#define _LINUX_PG_H
40
38#define PG_MAGIC 'P'41#define PG_MAGIC 'P'
39#define PG_RESET 'Z'42#define PG_RESET 'Z'
40#define PG_COMMAND 'C'43#define PG_COMMAND 'C'
...@@ -61,4 +64,4 @@ struct pg_read_hdr {...@@ -61,4 +64,4 @@ struct pg_read_hdr {
6164
62};65};
6366
64/* end of pg.h */
\ No newline at end of file
67#endif /* _LINUX_PG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pidfd.h created+12
...@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_PIDFD_H
4#define _LINUX_PIDFD_H
5
6#include <linux/types.h>
7#include <linux/fcntl.h>
8
9/* Flags for pidfd_open(). */
10#define PIDFD_NONBLOCK O_NONBLOCK
11
12#endif /* _LINUX_PIDFD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pkt_cls.h+174-5
...@@ -16,9 +16,37 @@ enum {...@@ -16,9 +16,37 @@ enum {
16 TCA_ACT_STATS,16 TCA_ACT_STATS,
17 TCA_ACT_PAD,17 TCA_ACT_PAD,
18 TCA_ACT_COOKIE,18 TCA_ACT_COOKIE,
19 TCA_ACT_FLAGS,
20 TCA_ACT_HW_STATS,
21 TCA_ACT_USED_HW_STATS,
19 __TCA_ACT_MAX22 __TCA_ACT_MAX
20};23};
2124
25/* See other TCA_ACT_FLAGS_ * flags in include/net/act_api.h. */
26#define TCA_ACT_FLAGS_NO_PERCPU_STATS 1 /* Don't use percpu allocator for
27 * actions stats.
28 */
29
30/* tca HW stats type
31 * When user does not pass the attribute, he does not care.
32 * It is the same as if he would pass the attribute with
33 * all supported bits set.
34 * In case no bits are set, user is not interested in getting any HW statistics.
35 */
36#define TCA_ACT_HW_STATS_IMMEDIATE (1 << 0) /* Means that in dump, user
37 * gets the current HW stats
38 * state from the device
39 * queried at the dump time.
40 */
41#define TCA_ACT_HW_STATS_DELAYED (1 << 1) /* Means that in dump, user gets
42 * HW stats that might be out of date
43 * for some time, maybe couple of
44 * seconds. This is the case when
45 * driver polls stats updates
46 * periodically or when it gets async
47 * stats update from the device.
48 */
49
22#define TCA_ACT_MAX __TCA_ACT_MAX50#define TCA_ACT_MAX __TCA_ACT_MAX
23#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)51#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
24#define TCA_ACT_MAX_PRIO 3252#define TCA_ACT_MAX_PRIO 32
...@@ -63,12 +91,53 @@ enum {...@@ -63,12 +91,53 @@ enum {
63#define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)91#define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
64#define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN92#define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
6593
94/* These macros are put here for binary compatibility with userspace apps that
95 * make use of them. For kernel code and new userspace apps, use the TCA_ID_*
96 * versions.
97 */
98#define TCA_ACT_GACT 5
99#define TCA_ACT_IPT 6
100#define TCA_ACT_PEDIT 7
101#define TCA_ACT_MIRRED 8
102#define TCA_ACT_NAT 9
103#define TCA_ACT_XT 10
104#define TCA_ACT_SKBEDIT 11
105#define TCA_ACT_VLAN 12
106#define TCA_ACT_BPF 13
107#define TCA_ACT_CONNMARK 14
108#define TCA_ACT_SKBMOD 15
109#define TCA_ACT_CSUM 16
110#define TCA_ACT_TUNNEL_KEY 17
111#define TCA_ACT_SIMP 22
112#define TCA_ACT_IFE 25
113#define TCA_ACT_SAMPLE 26
114
66/* Action type identifiers*/115/* Action type identifiers*/
67enum {116enum tca_id {
68 TCA_ID_UNSPEC=0,117 TCA_ID_UNSPEC = 0,
69 TCA_ID_POLICE=1,118 TCA_ID_POLICE = 1,
119 TCA_ID_GACT = TCA_ACT_GACT,
120 TCA_ID_IPT = TCA_ACT_IPT,
121 TCA_ID_PEDIT = TCA_ACT_PEDIT,
122 TCA_ID_MIRRED = TCA_ACT_MIRRED,
123 TCA_ID_NAT = TCA_ACT_NAT,
124 TCA_ID_XT = TCA_ACT_XT,
125 TCA_ID_SKBEDIT = TCA_ACT_SKBEDIT,
126 TCA_ID_VLAN = TCA_ACT_VLAN,
127 TCA_ID_BPF = TCA_ACT_BPF,
128 TCA_ID_CONNMARK = TCA_ACT_CONNMARK,
129 TCA_ID_SKBMOD = TCA_ACT_SKBMOD,
130 TCA_ID_CSUM = TCA_ACT_CSUM,
131 TCA_ID_TUNNEL_KEY = TCA_ACT_TUNNEL_KEY,
132 TCA_ID_SIMP = TCA_ACT_SIMP,
133 TCA_ID_IFE = TCA_ACT_IFE,
134 TCA_ID_SAMPLE = TCA_ACT_SAMPLE,
135 TCA_ID_CTINFO,
136 TCA_ID_MPLS,
137 TCA_ID_CT,
138 TCA_ID_GATE,
70 /* other actions go here */139 /* other actions go here */
71 __TCA_ID_MAX=255140 __TCA_ID_MAX = 255
72};141};
73142
74#define TCA_ID_MAX __TCA_ID_MAX143#define TCA_ID_MAX __TCA_ID_MAX
...@@ -120,6 +189,10 @@ enum {...@@ -120,6 +189,10 @@ enum {
120 TCA_POLICE_RESULT,189 TCA_POLICE_RESULT,
121 TCA_POLICE_TM,190 TCA_POLICE_TM,
122 TCA_POLICE_PAD,191 TCA_POLICE_PAD,
192 TCA_POLICE_RATE64,
193 TCA_POLICE_PEAKRATE64,
194 TCA_POLICE_PKTRATE64,
195 TCA_POLICE_PKTBURST64,
123 __TCA_POLICE_MAX196 __TCA_POLICE_MAX
124#define TCA_POLICE_RESULT TCA_POLICE_RESULT197#define TCA_POLICE_RESULT TCA_POLICE_RESULT
125};198};
...@@ -257,7 +330,7 @@ enum {...@@ -257,7 +330,7 @@ enum {
257 TCA_FW_UNSPEC,330 TCA_FW_UNSPEC,
258 TCA_FW_CLASSID,331 TCA_FW_CLASSID,
259 TCA_FW_POLICE,332 TCA_FW_POLICE,
260 TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */333 TCA_FW_INDEV,
261 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */334 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
262 TCA_FW_MASK,335 TCA_FW_MASK,
263 __TCA_FW_MAX336 __TCA_FW_MAX
...@@ -333,12 +406,19 @@ enum {...@@ -333,12 +406,19 @@ enum {
333406
334/* Basic filter */407/* Basic filter */
335408
409struct tc_basic_pcnt {
410 __u64 rcnt;
411 __u64 rhit;
412};
413
336enum {414enum {
337 TCA_BASIC_UNSPEC,415 TCA_BASIC_UNSPEC,
338 TCA_BASIC_CLASSID,416 TCA_BASIC_CLASSID,
339 TCA_BASIC_EMATCHES,417 TCA_BASIC_EMATCHES,
340 TCA_BASIC_ACT,418 TCA_BASIC_ACT,
341 TCA_BASIC_POLICE,419 TCA_BASIC_POLICE,
420 TCA_BASIC_PCNT,
421 TCA_BASIC_PAD,
342 __TCA_BASIC_MAX422 __TCA_BASIC_MAX
343};423};
344424
...@@ -483,17 +563,56 @@ enum {...@@ -483,17 +563,56 @@ enum {
483 TCA_FLOWER_KEY_ENC_OPTS,563 TCA_FLOWER_KEY_ENC_OPTS,
484 TCA_FLOWER_KEY_ENC_OPTS_MASK,564 TCA_FLOWER_KEY_ENC_OPTS_MASK,
485565
566 TCA_FLOWER_IN_HW_COUNT,
567
568 TCA_FLOWER_KEY_PORT_SRC_MIN, /* be16 */
569 TCA_FLOWER_KEY_PORT_SRC_MAX, /* be16 */
570 TCA_FLOWER_KEY_PORT_DST_MIN, /* be16 */
571 TCA_FLOWER_KEY_PORT_DST_MAX, /* be16 */
572
573 TCA_FLOWER_KEY_CT_STATE, /* u16 */
574 TCA_FLOWER_KEY_CT_STATE_MASK, /* u16 */
575 TCA_FLOWER_KEY_CT_ZONE, /* u16 */
576 TCA_FLOWER_KEY_CT_ZONE_MASK, /* u16 */
577 TCA_FLOWER_KEY_CT_MARK, /* u32 */
578 TCA_FLOWER_KEY_CT_MARK_MASK, /* u32 */
579 TCA_FLOWER_KEY_CT_LABELS, /* u128 */
580 TCA_FLOWER_KEY_CT_LABELS_MASK, /* u128 */
581
582 TCA_FLOWER_KEY_MPLS_OPTS,
583
584 TCA_FLOWER_KEY_HASH, /* u32 */
585 TCA_FLOWER_KEY_HASH_MASK, /* u32 */
586
486 __TCA_FLOWER_MAX,587 __TCA_FLOWER_MAX,
487};588};
488589
489#define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)590#define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)
490591
592enum {
593 TCA_FLOWER_KEY_CT_FLAGS_NEW = 1 << 0, /* Beginning of a new connection. */
594 TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED = 1 << 1, /* Part of an existing connection. */
595 TCA_FLOWER_KEY_CT_FLAGS_RELATED = 1 << 2, /* Related to an established connection. */
596 TCA_FLOWER_KEY_CT_FLAGS_TRACKED = 1 << 3, /* Conntrack has occurred. */
597 TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */
598 TCA_FLOWER_KEY_CT_FLAGS_REPLY = 1 << 5, /* Packet is in the reply direction. */
599 __TCA_FLOWER_KEY_CT_FLAGS_MAX,
600};
601
491enum {602enum {
492 TCA_FLOWER_KEY_ENC_OPTS_UNSPEC,603 TCA_FLOWER_KEY_ENC_OPTS_UNSPEC,
493 TCA_FLOWER_KEY_ENC_OPTS_GENEVE, /* Nested604 TCA_FLOWER_KEY_ENC_OPTS_GENEVE, /* Nested
494 * TCA_FLOWER_KEY_ENC_OPT_GENEVE_605 * TCA_FLOWER_KEY_ENC_OPT_GENEVE_
495 * attributes606 * attributes
496 */607 */
608 TCA_FLOWER_KEY_ENC_OPTS_VXLAN, /* Nested
609 * TCA_FLOWER_KEY_ENC_OPT_VXLAN_
610 * attributes
611 */
612 TCA_FLOWER_KEY_ENC_OPTS_ERSPAN, /* Nested
613 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_
614 * attributes
615 */
497 __TCA_FLOWER_KEY_ENC_OPTS_MAX,616 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
498};617};
499618
...@@ -511,18 +630,68 @@ enum {...@@ -511,18 +630,68 @@ enum {
511#define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX \630#define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX \
512 (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)631 (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)
513632
633enum {
634 TCA_FLOWER_KEY_ENC_OPT_VXLAN_UNSPEC,
635 TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP, /* u32 */
636 __TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX,
637};
638
639#define TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX \
640 (__TCA_FLOWER_KEY_ENC_OPT_VXLAN_MAX - 1)
641
642enum {
643 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_UNSPEC,
644 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_VER, /* u8 */
645 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX, /* be32 */
646 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR, /* u8 */
647 TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID, /* u8 */
648 __TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX,
649};
650
651#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \
652 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)
653
654enum {
655 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
656 TCA_FLOWER_KEY_MPLS_OPTS_LSE,
657 __TCA_FLOWER_KEY_MPLS_OPTS_MAX,
658};
659
660#define TCA_FLOWER_KEY_MPLS_OPTS_MAX (__TCA_FLOWER_KEY_MPLS_OPTS_MAX - 1)
661
662enum {
663 TCA_FLOWER_KEY_MPLS_OPT_LSE_UNSPEC,
664 TCA_FLOWER_KEY_MPLS_OPT_LSE_DEPTH,
665 TCA_FLOWER_KEY_MPLS_OPT_LSE_TTL,
666 TCA_FLOWER_KEY_MPLS_OPT_LSE_BOS,
667 TCA_FLOWER_KEY_MPLS_OPT_LSE_TC,
668 TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL,
669 __TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX,
670};
671
672#define TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX \
673 (__TCA_FLOWER_KEY_MPLS_OPT_LSE_MAX - 1)
674
514enum {675enum {
515 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),676 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
516 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),677 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
517};678};
518679
680#define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0) /* Range-based match */
681
519/* Match-all classifier */682/* Match-all classifier */
520683
684struct tc_matchall_pcnt {
685 __u64 rhit;
686};
687
521enum {688enum {
522 TCA_MATCHALL_UNSPEC,689 TCA_MATCHALL_UNSPEC,
523 TCA_MATCHALL_CLASSID,690 TCA_MATCHALL_CLASSID,
524 TCA_MATCHALL_ACT,691 TCA_MATCHALL_ACT,
525 TCA_MATCHALL_FLAGS,692 TCA_MATCHALL_FLAGS,
693 TCA_MATCHALL_PCNT,
694 TCA_MATCHALL_PAD,
526 __TCA_MATCHALL_MAX,695 __TCA_MATCHALL_MAX,
527};696};
528697
lib/libc/include/any-linux-any/linux/pkt_sched.h+196-13
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef __LINUX_PKT_SCHED_H2#ifndef __LINUX_PKT_SCHED_H
3#define __LINUX_PKT_SCHED_H3#define __LINUX_PKT_SCHED_H
44
5#include <linux/const.h>
5#include <linux/types.h>6#include <linux/types.h>
67
7/* Logical priority bands not depending on specific packet scheduler.8/* Logical priority bands not depending on specific packet scheduler.
...@@ -255,6 +256,9 @@ enum {...@@ -255,6 +256,9 @@ enum {
255 TCA_RED_PARMS,256 TCA_RED_PARMS,
256 TCA_RED_STAB,257 TCA_RED_STAB,
257 TCA_RED_MAX_P,258 TCA_RED_MAX_P,
259 TCA_RED_FLAGS, /* bitfield32 */
260 TCA_RED_EARLY_DROP_BLOCK, /* u32 */
261 TCA_RED_MARK_BLOCK, /* u32 */
258 __TCA_RED_MAX,262 __TCA_RED_MAX,
259};263};
260264
...@@ -267,12 +271,28 @@ struct tc_red_qopt {...@@ -267,12 +271,28 @@ struct tc_red_qopt {
267 unsigned char Wlog; /* log(W) */271 unsigned char Wlog; /* log(W) */
268 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */272 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
269 unsigned char Scell_log; /* cell size for idle damping */273 unsigned char Scell_log; /* cell size for idle damping */
274
275 /* This field can be used for flags that a RED-like qdisc has
276 * historically supported. E.g. when configuring RED, it can be used for
277 * ECN, HARDDROP and ADAPTATIVE. For SFQ it can be used for ECN,
278 * HARDDROP. Etc. Because this field has not been validated, and is
279 * copied back on dump, any bits besides those to which a given qdisc
280 * has assigned a historical meaning need to be considered for free use
281 * by userspace tools.
282 *
283 * Any further flags need to be passed differently, e.g. through an
284 * attribute (such as TCA_RED_FLAGS above). Such attribute should allow
285 * passing both recent and historic flags in one value.
286 */
270 unsigned char flags;287 unsigned char flags;
271#define TC_RED_ECN 1288#define TC_RED_ECN 1
272#define TC_RED_HARDDROP 2289#define TC_RED_HARDDROP 2
273#define TC_RED_ADAPTATIVE 4290#define TC_RED_ADAPTATIVE 4
291#define TC_RED_NODROP 8
274};292};
275293
294#define TC_RED_HISTORIC_FLAGS (TC_RED_ECN | TC_RED_HARDDROP | TC_RED_ADAPTATIVE)
295
276struct tc_red_xstats {296struct tc_red_xstats {
277 __u32 early; /* Early drops */297 __u32 early; /* Early drops */
278 __u32 pdrop; /* Drops due to queue limits */298 __u32 pdrop; /* Drops due to queue limits */
...@@ -291,11 +311,38 @@ enum {...@@ -291,11 +311,38 @@ enum {
291 TCA_GRED_DPS,311 TCA_GRED_DPS,
292 TCA_GRED_MAX_P,312 TCA_GRED_MAX_P,
293 TCA_GRED_LIMIT,313 TCA_GRED_LIMIT,
314 TCA_GRED_VQ_LIST, /* nested TCA_GRED_VQ_ENTRY */
294 __TCA_GRED_MAX,315 __TCA_GRED_MAX,
295};316};
296317
297#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)318#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
298319
320enum {
321 TCA_GRED_VQ_ENTRY_UNSPEC,
322 TCA_GRED_VQ_ENTRY, /* nested TCA_GRED_VQ_* */
323 __TCA_GRED_VQ_ENTRY_MAX,
324};
325#define TCA_GRED_VQ_ENTRY_MAX (__TCA_GRED_VQ_ENTRY_MAX - 1)
326
327enum {
328 TCA_GRED_VQ_UNSPEC,
329 TCA_GRED_VQ_PAD,
330 TCA_GRED_VQ_DP, /* u32 */
331 TCA_GRED_VQ_STAT_BYTES, /* u64 */
332 TCA_GRED_VQ_STAT_PACKETS, /* u32 */
333 TCA_GRED_VQ_STAT_BACKLOG, /* u32 */
334 TCA_GRED_VQ_STAT_PROB_DROP, /* u32 */
335 TCA_GRED_VQ_STAT_PROB_MARK, /* u32 */
336 TCA_GRED_VQ_STAT_FORCED_DROP, /* u32 */
337 TCA_GRED_VQ_STAT_FORCED_MARK, /* u32 */
338 TCA_GRED_VQ_STAT_PDROP, /* u32 */
339 TCA_GRED_VQ_STAT_OTHER, /* u32 */
340 TCA_GRED_VQ_FLAGS, /* u32 */
341 __TCA_GRED_VQ_MAX
342};
343
344#define TCA_GRED_VQ_MAX (__TCA_GRED_VQ_MAX - 1)
345
299struct tc_gred_qopt {346struct tc_gred_qopt {
300 __u32 limit; /* HARD maximal queue length (bytes) */347 __u32 limit; /* HARD maximal queue length (bytes) */
301 __u32 qth_min; /* Min average length threshold (bytes) */348 __u32 qth_min; /* Min average length threshold (bytes) */
...@@ -387,6 +434,7 @@ enum {...@@ -387,6 +434,7 @@ enum {
387 TCA_HTB_RATE64,434 TCA_HTB_RATE64,
388 TCA_HTB_CEIL64,435 TCA_HTB_CEIL64,
389 TCA_HTB_PAD,436 TCA_HTB_PAD,
437 TCA_HTB_OFFLOAD,
390 __TCA_HTB_MAX,438 __TCA_HTB_MAX,
391};439};
392440
...@@ -395,9 +443,9 @@ enum {...@@ -395,9 +443,9 @@ enum {
395struct tc_htb_xstats {443struct tc_htb_xstats {
396 __u32 lends;444 __u32 lends;
397 __u32 borrows;445 __u32 borrows;
398 __u32 giants; /* too big packets (rate will not be accurate) */446 __u32 giants; /* unused since 'Make HTB scheduler work with TSO.' */
399 __u32 tokens;447 __s32 tokens;
400 __u32 ctokens;448 __s32 ctokens;
401};449};
402450
403/* HFSC section */451/* HFSC section */
...@@ -779,6 +827,8 @@ struct tc_codel_xstats {...@@ -779,6 +827,8 @@ struct tc_codel_xstats {
779827
780/* FQ_CODEL */828/* FQ_CODEL */
781829
830#define FQ_CODEL_QUANTUM_MAX (1 << 20)
831
782enum {832enum {
783 TCA_FQ_CODEL_UNSPEC,833 TCA_FQ_CODEL_UNSPEC,
784 TCA_FQ_CODEL_TARGET,834 TCA_FQ_CODEL_TARGET,
...@@ -790,6 +840,8 @@ enum {...@@ -790,6 +840,8 @@ enum {
790 TCA_FQ_CODEL_CE_THRESHOLD,840 TCA_FQ_CODEL_CE_THRESHOLD,
791 TCA_FQ_CODEL_DROP_BATCH_SIZE,841 TCA_FQ_CODEL_DROP_BATCH_SIZE,
792 TCA_FQ_CODEL_MEMORY_LIMIT,842 TCA_FQ_CODEL_MEMORY_LIMIT,
843 TCA_FQ_CODEL_CE_THRESHOLD_SELECTOR,
844 TCA_FQ_CODEL_CE_THRESHOLD_MASK,
793 __TCA_FQ_CODEL_MAX845 __TCA_FQ_CODEL_MAX
794};846};
795847
...@@ -864,6 +916,14 @@ enum {...@@ -864,6 +916,14 @@ enum {
864916
865 TCA_FQ_LOW_RATE_THRESHOLD, /* per packet delay under this rate */917 TCA_FQ_LOW_RATE_THRESHOLD, /* per packet delay under this rate */
866918
919 TCA_FQ_CE_THRESHOLD, /* DCTCP-like CE-marking threshold */
920
921 TCA_FQ_TIMER_SLACK, /* timer slack */
922
923 TCA_FQ_HORIZON, /* time horizon in us */
924
925 TCA_FQ_HORIZON_DROP, /* drop packets beyond horizon, or cap their EDT */
926
867 __TCA_FQ_MAX927 __TCA_FQ_MAX
868};928};
869929
...@@ -882,6 +942,9 @@ struct tc_fq_qd_stats {...@@ -882,6 +942,9 @@ struct tc_fq_qd_stats {
882 __u32 inactive_flows;942 __u32 inactive_flows;
883 __u32 throttled_flows;943 __u32 throttled_flows;
884 __u32 unthrottle_latency_ns;944 __u32 unthrottle_latency_ns;
945 __u64 ce_mark; /* packets above ce_threshold */
946 __u64 horizon_drops;
947 __u64 horizon_caps;
885};948};
886949
887/* Heavy-Hitter Filter */950/* Heavy-Hitter Filter */
...@@ -919,19 +982,56 @@ enum {...@@ -919,19 +982,56 @@ enum {
919 TCA_PIE_BETA,982 TCA_PIE_BETA,
920 TCA_PIE_ECN,983 TCA_PIE_ECN,
921 TCA_PIE_BYTEMODE,984 TCA_PIE_BYTEMODE,
985 TCA_PIE_DQ_RATE_ESTIMATOR,
922 __TCA_PIE_MAX986 __TCA_PIE_MAX
923};987};
924#define TCA_PIE_MAX (__TCA_PIE_MAX - 1)988#define TCA_PIE_MAX (__TCA_PIE_MAX - 1)
925989
926struct tc_pie_xstats {990struct tc_pie_xstats {
927 __u32 prob; /* current probability */991 __u64 prob; /* current probability */
928 __u32 delay; /* current delay in ms */992 __u32 delay; /* current delay in ms */
929 __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */993 __u32 avg_dq_rate; /* current average dq_rate in
930 __u32 packets_in; /* total number of packets enqueued */994 * bits/pie_time
931 __u32 dropped; /* packets dropped due to pie_action */995 */
932 __u32 overlimit; /* dropped due to lack of space in queue */996 __u32 dq_rate_estimating; /* is avg_dq_rate being calculated? */
933 __u32 maxq; /* maximum queue size */997 __u32 packets_in; /* total number of packets enqueued */
934 __u32 ecn_mark; /* packets marked with ecn*/998 __u32 dropped; /* packets dropped due to pie_action */
999 __u32 overlimit; /* dropped due to lack of space
1000 * in queue
1001 */
1002 __u32 maxq; /* maximum queue size */
1003 __u32 ecn_mark; /* packets marked with ecn*/
1004};
1005
1006/* FQ PIE */
1007enum {
1008 TCA_FQ_PIE_UNSPEC,
1009 TCA_FQ_PIE_LIMIT,
1010 TCA_FQ_PIE_FLOWS,
1011 TCA_FQ_PIE_TARGET,
1012 TCA_FQ_PIE_TUPDATE,
1013 TCA_FQ_PIE_ALPHA,
1014 TCA_FQ_PIE_BETA,
1015 TCA_FQ_PIE_QUANTUM,
1016 TCA_FQ_PIE_MEMORY_LIMIT,
1017 TCA_FQ_PIE_ECN_PROB,
1018 TCA_FQ_PIE_ECN,
1019 TCA_FQ_PIE_BYTEMODE,
1020 TCA_FQ_PIE_DQ_RATE_ESTIMATOR,
1021 __TCA_FQ_PIE_MAX
1022};
1023#define TCA_FQ_PIE_MAX (__TCA_FQ_PIE_MAX - 1)
1024
1025struct tc_fq_pie_xstats {
1026 __u32 packets_in; /* total number of packets enqueued */
1027 __u32 dropped; /* packets dropped due to fq_pie_action */
1028 __u32 overlimit; /* dropped due to lack of space in queue */
1029 __u32 overmemory; /* dropped due to lack of memory in queue */
1030 __u32 ecn_mark; /* packets marked with ecn */
1031 __u32 new_flow_count; /* count of new flows created by packets */
1032 __u32 new_flows_len; /* count of flows in new list */
1033 __u32 old_flows_len; /* count of flows in old list */
1034 __u32 memory_usage; /* total memory across all queues */
935};1035};
9361036
937/* CBS */1037/* CBS */
...@@ -958,8 +1058,9 @@ struct tc_etf_qopt {...@@ -958,8 +1058,9 @@ struct tc_etf_qopt {
958 __s32 delta;1058 __s32 delta;
959 __s32 clockid;1059 __s32 clockid;
960 __u32 flags;1060 __u32 flags;
961#define TC_ETF_DEADLINE_MODE_ON BIT(0)1061#define TC_ETF_DEADLINE_MODE_ON _BITUL(0)
962#define TC_ETF_OFFLOAD_ON BIT(1)1062#define TC_ETF_OFFLOAD_ON _BITUL(1)
1063#define TC_ETF_SKIP_SOCK_CHECK _BITUL(2)
963};1064};
9641065
965enum {1066enum {
...@@ -991,6 +1092,7 @@ enum {...@@ -991,6 +1092,7 @@ enum {
991 TCA_CAKE_INGRESS,1092 TCA_CAKE_INGRESS,
992 TCA_CAKE_ACK_FILTER,1093 TCA_CAKE_ACK_FILTER,
993 TCA_CAKE_SPLIT_GSO,1094 TCA_CAKE_SPLIT_GSO,
1095 TCA_CAKE_FWMARK,
994 __TCA_CAKE_MAX1096 __TCA_CAKE_MAX
995};1097};
996#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)1098#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
...@@ -1084,4 +1186,85 @@ enum {...@@ -1084,4 +1186,85 @@ enum {
1084 CAKE_ATM_MAX1186 CAKE_ATM_MAX
1085};1187};
10861188
1189
1190/* TAPRIO */
1191enum {
1192 TC_TAPRIO_CMD_SET_GATES = 0x00,
1193 TC_TAPRIO_CMD_SET_AND_HOLD = 0x01,
1194 TC_TAPRIO_CMD_SET_AND_RELEASE = 0x02,
1195};
1196
1197enum {
1198 TCA_TAPRIO_SCHED_ENTRY_UNSPEC,
1199 TCA_TAPRIO_SCHED_ENTRY_INDEX, /* u32 */
1200 TCA_TAPRIO_SCHED_ENTRY_CMD, /* u8 */
1201 TCA_TAPRIO_SCHED_ENTRY_GATE_MASK, /* u32 */
1202 TCA_TAPRIO_SCHED_ENTRY_INTERVAL, /* u32 */
1203 __TCA_TAPRIO_SCHED_ENTRY_MAX,
1204};
1205#define TCA_TAPRIO_SCHED_ENTRY_MAX (__TCA_TAPRIO_SCHED_ENTRY_MAX - 1)
1206
1207/* The format for schedule entry list is:
1208 * [TCA_TAPRIO_SCHED_ENTRY_LIST]
1209 * [TCA_TAPRIO_SCHED_ENTRY]
1210 * [TCA_TAPRIO_SCHED_ENTRY_CMD]
1211 * [TCA_TAPRIO_SCHED_ENTRY_GATES]
1212 * [TCA_TAPRIO_SCHED_ENTRY_INTERVAL]
1213 */
1214enum {
1215 TCA_TAPRIO_SCHED_UNSPEC,
1216 TCA_TAPRIO_SCHED_ENTRY,
1217 __TCA_TAPRIO_SCHED_MAX,
1218};
1219
1220#define TCA_TAPRIO_SCHED_MAX (__TCA_TAPRIO_SCHED_MAX - 1)
1221
1222/* The format for the admin sched (dump only):
1223 * [TCA_TAPRIO_SCHED_ADMIN_SCHED]
1224 * [TCA_TAPRIO_ATTR_SCHED_BASE_TIME]
1225 * [TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST]
1226 * [TCA_TAPRIO_ATTR_SCHED_ENTRY]
1227 * [TCA_TAPRIO_ATTR_SCHED_ENTRY_CMD]
1228 * [TCA_TAPRIO_ATTR_SCHED_ENTRY_GATES]
1229 * [TCA_TAPRIO_ATTR_SCHED_ENTRY_INTERVAL]
1230 */
1231
1232#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0)
1233#define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD _BITUL(1)
1234
1235enum {
1236 TCA_TAPRIO_ATTR_UNSPEC,
1237 TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */
1238 TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST, /* nested of entry */
1239 TCA_TAPRIO_ATTR_SCHED_BASE_TIME, /* s64 */
1240 TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY, /* single entry */
1241 TCA_TAPRIO_ATTR_SCHED_CLOCKID, /* s32 */
1242 TCA_TAPRIO_PAD,
1243 TCA_TAPRIO_ATTR_ADMIN_SCHED, /* The admin sched, only used in dump */
1244 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
1245 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
1246 TCA_TAPRIO_ATTR_FLAGS, /* u32 */
1247 TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */
1248 __TCA_TAPRIO_ATTR_MAX,
1249};
1250
1251#define TCA_TAPRIO_ATTR_MAX (__TCA_TAPRIO_ATTR_MAX - 1)
1252
1253/* ETS */
1254
1255#define TCQ_ETS_MAX_BANDS 16
1256
1257enum {
1258 TCA_ETS_UNSPEC,
1259 TCA_ETS_NBANDS, /* u8 */
1260 TCA_ETS_NSTRICT, /* u8 */
1261 TCA_ETS_QUANTA, /* nested TCA_ETS_QUANTA_BAND */
1262 TCA_ETS_QUANTA_BAND, /* u32 */
1263 TCA_ETS_PRIOMAP, /* nested TCA_ETS_PRIOMAP_BAND */
1264 TCA_ETS_PRIOMAP_BAND, /* u8 */
1265 __TCA_ETS_MAX,
1266};
1267
1268#define TCA_ETS_MAX (__TCA_ETS_MAX - 1)
1269
1087#endif1270#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pmu.h+2
...@@ -19,7 +19,9 @@...@@ -19,7 +19,9 @@
19#define PMU_POWER_CTRL 0x11 /* control power of some devices */19#define PMU_POWER_CTRL 0x11 /* control power of some devices */
20#define PMU_ADB_CMD 0x20 /* send ADB packet */20#define PMU_ADB_CMD 0x20 /* send ADB packet */
21#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */21#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
22#define PMU_WRITE_XPRAM 0x32 /* write eXtended Parameter RAM */
22#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */23#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */
24#define PMU_READ_XPRAM 0x3a /* read eXtended Parameter RAM */
23#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */25#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */
24#define PMU_SET_RTC 0x30 /* set real-time clock */26#define PMU_SET_RTC 0x30 /* set real-time clock */
25#define PMU_READ_RTC 0x38 /* read real-time clock */27#define PMU_READ_RTC 0x38 /* read real-time clock */
lib/libc/include/any-linux-any/linux/ppdev.h+6-1
...@@ -15,6 +15,9 @@...@@ -15,6 +15,9 @@
15 * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/200115 * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001
16 */16 */
1717
18#ifndef _LINUX_PPDEV_H
19#define _LINUX_PPDEV_H
20
18#define PP_IOCTL 'p'21#define PP_IOCTL 'p'
1922
20/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */23/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
...@@ -95,4 +98,6 @@ struct ppdev_frob_struct {...@@ -95,4 +98,6 @@ struct ppdev_frob_struct {
95#define PP_W91284PIC (1<<4)98#define PP_W91284PIC (1<<4)
9699
97/* only masks user-visible flags */100/* only masks user-visible flags */
98#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
\ No newline at end of file
101#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
102
103#endif /* _LINUX_PPDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ppp-ioctl.h+4
...@@ -104,6 +104,8 @@ struct pppol2tp_ioc_stats {...@@ -104,6 +104,8 @@ struct pppol2tp_ioc_stats {
104#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */104#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
105#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */105#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
106#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */106#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
107#define PPPIOCGIDLE32 _IOR('t', 63, struct ppp_idle32) /* 32-bit times */
108#define PPPIOCGIDLE64 _IOR('t', 63, struct ppp_idle64) /* 64-bit times */
107#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */109#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
108#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */110#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
109#define PPPIOCDETACH _IOW('t', 60, int) /* obsolete, do not use */111#define PPPIOCDETACH _IOW('t', 60, int) /* obsolete, do not use */
...@@ -113,6 +115,8 @@ struct pppol2tp_ioc_stats {...@@ -113,6 +115,8 @@ struct pppol2tp_ioc_stats {
113#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */115#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
114#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */116#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
115#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)117#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
118#define PPPIOCBRIDGECHAN _IOW('t', 53, int) /* bridge one channel to another */
119#define PPPIOCUNBRIDGECHAN _IO('t', 52) /* unbridge channel */
116120
117#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)121#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
118#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */122#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
lib/libc/include/any-linux-any/linux/ppp_defs.h+16-2
...@@ -142,10 +142,24 @@ struct ppp_comp_stats {...@@ -142,10 +142,24 @@ struct ppp_comp_stats {
142/*142/*
143 * The following structure records the time in seconds since143 * The following structure records the time in seconds since
144 * the last NP packet was sent or received.144 * the last NP packet was sent or received.
145 *
146 * Linux implements both 32-bit and 64-bit time_t versions
147 * for compatibility with user space that defines ppp_idle
148 * based on the libc time_t.
145 */149 */
146struct ppp_idle {150struct ppp_idle {
147 __kernel_time_t xmit_idle; /* time since last NP packet sent */151 __kernel_old_time_t xmit_idle; /* time since last NP packet sent */
148 __kernel_time_t recv_idle; /* time since last NP packet received */152 __kernel_old_time_t recv_idle; /* time since last NP packet received */
153};
154
155struct ppp_idle32 {
156 __s32 xmit_idle; /* time since last NP packet sent */
157 __s32 recv_idle; /* time since last NP packet received */
158};
159
160struct ppp_idle64 {
161 __s64 xmit_idle; /* time since last NP packet sent */
162 __s64 recv_idle; /* time since last NP packet received */
149};163};
150164
151#endif /* _PPP_DEFS_H_ */165#endif /* _PPP_DEFS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/prctl.h+53-1
...@@ -181,7 +181,7 @@ struct prctl_mm_map {...@@ -181,7 +181,7 @@ struct prctl_mm_map {
181#define PR_GET_THP_DISABLE 42181#define PR_GET_THP_DISABLE 42
182182
183/*183/*
184 * Tell the kernel to start/stop helping userspace manage bounds tables.184 * No longer implemented, but left here to ensure the numbers stay reserved:
185 */185 */
186#define PR_MPX_ENABLE_MANAGEMENT 43186#define PR_MPX_ENABLE_MANAGEMENT 43
187#define PR_MPX_DISABLE_MANAGEMENT 44187#define PR_MPX_DISABLE_MANAGEMENT 44
...@@ -213,11 +213,63 @@ struct prctl_mm_map {...@@ -213,11 +213,63 @@ struct prctl_mm_map {
213/* Speculation control variants */213/* Speculation control variants */
214# define PR_SPEC_STORE_BYPASS 0214# define PR_SPEC_STORE_BYPASS 0
215# define PR_SPEC_INDIRECT_BRANCH 1215# define PR_SPEC_INDIRECT_BRANCH 1
216# define PR_SPEC_L1D_FLUSH 2
216/* Return and control values for PR_SET/GET_SPECULATION_CTRL */217/* Return and control values for PR_SET/GET_SPECULATION_CTRL */
217# define PR_SPEC_NOT_AFFECTED 0218# define PR_SPEC_NOT_AFFECTED 0
218# define PR_SPEC_PRCTL (1UL << 0)219# define PR_SPEC_PRCTL (1UL << 0)
219# define PR_SPEC_ENABLE (1UL << 1)220# define PR_SPEC_ENABLE (1UL << 1)
220# define PR_SPEC_DISABLE (1UL << 2)221# define PR_SPEC_DISABLE (1UL << 2)
221# define PR_SPEC_FORCE_DISABLE (1UL << 3)222# define PR_SPEC_FORCE_DISABLE (1UL << 3)
223# define PR_SPEC_DISABLE_NOEXEC (1UL << 4)
224
225/* Reset arm64 pointer authentication keys */
226#define PR_PAC_RESET_KEYS 54
227# define PR_PAC_APIAKEY (1UL << 0)
228# define PR_PAC_APIBKEY (1UL << 1)
229# define PR_PAC_APDAKEY (1UL << 2)
230# define PR_PAC_APDBKEY (1UL << 3)
231# define PR_PAC_APGAKEY (1UL << 4)
232
233/* Tagged user address controls for arm64 */
234#define PR_SET_TAGGED_ADDR_CTRL 55
235#define PR_GET_TAGGED_ADDR_CTRL 56
236# define PR_TAGGED_ADDR_ENABLE (1UL << 0)
237/* MTE tag check fault modes */
238# define PR_MTE_TCF_NONE 0UL
239# define PR_MTE_TCF_SYNC (1UL << 1)
240# define PR_MTE_TCF_ASYNC (1UL << 2)
241# define PR_MTE_TCF_MASK (PR_MTE_TCF_SYNC | PR_MTE_TCF_ASYNC)
242/* MTE tag inclusion mask */
243# define PR_MTE_TAG_SHIFT 3
244# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
245/* Unused; kept only for source compatibility */
246# define PR_MTE_TCF_SHIFT 1
247
248/* Control reclaim behavior when allocating memory */
249#define PR_SET_IO_FLUSHER 57
250#define PR_GET_IO_FLUSHER 58
251
252/* Dispatch syscalls to a userspace handler */
253#define PR_SET_SYSCALL_USER_DISPATCH 59
254# define PR_SYS_DISPATCH_OFF 0
255# define PR_SYS_DISPATCH_ON 1
256/* The control values for the user space selector when dispatch is enabled */
257# define SYSCALL_DISPATCH_FILTER_ALLOW 0
258# define SYSCALL_DISPATCH_FILTER_BLOCK 1
259
260/* Set/get enabled arm64 pointer authentication keys */
261#define PR_PAC_SET_ENABLED_KEYS 60
262#define PR_PAC_GET_ENABLED_KEYS 61
263
264/* Request the scheduler to share a core */
265#define PR_SCHED_CORE 62
266# define PR_SCHED_CORE_GET 0
267# define PR_SCHED_CORE_CREATE 1 /* create unique core_sched cookie */
268# define PR_SCHED_CORE_SHARE_TO 2 /* push core_sched cookie to pid */
269# define PR_SCHED_CORE_SHARE_FROM 3 /* pull core_sched cookie to pid */
270# define PR_SCHED_CORE_MAX 4
271# define PR_SCHED_CORE_SCOPE_THREAD 0
272# define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1
273# define PR_SCHED_CORE_SCOPE_PROCESS_GROUP 2
222274
223#endif /* _LINUX_PRCTL_H */275#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psample.h+29-3
...@@ -3,7 +3,6 @@...@@ -3,7 +3,6 @@
3#define __UAPI_PSAMPLE_H3#define __UAPI_PSAMPLE_H
44
5enum {5enum {
6 /* sampled packet metadata */
7 PSAMPLE_ATTR_IIFINDEX,6 PSAMPLE_ATTR_IIFINDEX,
8 PSAMPLE_ATTR_OIFINDEX,7 PSAMPLE_ATTR_OIFINDEX,
9 PSAMPLE_ATTR_ORIGSIZE,8 PSAMPLE_ATTR_ORIGSIZE,
...@@ -11,9 +10,15 @@ enum {...@@ -11,9 +10,15 @@ enum {
11 PSAMPLE_ATTR_GROUP_SEQ,10 PSAMPLE_ATTR_GROUP_SEQ,
12 PSAMPLE_ATTR_SAMPLE_RATE,11 PSAMPLE_ATTR_SAMPLE_RATE,
13 PSAMPLE_ATTR_DATA,12 PSAMPLE_ATTR_DATA,
14
15 /* commands attributes */
16 PSAMPLE_ATTR_GROUP_REFCOUNT,13 PSAMPLE_ATTR_GROUP_REFCOUNT,
14 PSAMPLE_ATTR_TUNNEL,
15
16 PSAMPLE_ATTR_PAD,
17 PSAMPLE_ATTR_OUT_TC, /* u16 */
18 PSAMPLE_ATTR_OUT_TC_OCC, /* u64, bytes */
19 PSAMPLE_ATTR_LATENCY, /* u64, nanoseconds */
20 PSAMPLE_ATTR_TIMESTAMP, /* u64, nanoseconds */
21 PSAMPLE_ATTR_PROTO, /* u16 */
1722
18 __PSAMPLE_ATTR_MAX23 __PSAMPLE_ATTR_MAX
19};24};
...@@ -25,6 +30,27 @@ enum psample_command {...@@ -25,6 +30,27 @@ enum psample_command {
25 PSAMPLE_CMD_DEL_GROUP,30 PSAMPLE_CMD_DEL_GROUP,
26};31};
2732
33enum psample_tunnel_key_attr {
34 PSAMPLE_TUNNEL_KEY_ATTR_ID, /* be64 Tunnel ID */
35 PSAMPLE_TUNNEL_KEY_ATTR_IPV4_SRC, /* be32 src IP address. */
36 PSAMPLE_TUNNEL_KEY_ATTR_IPV4_DST, /* be32 dst IP address. */
37 PSAMPLE_TUNNEL_KEY_ATTR_TOS, /* u8 Tunnel IP ToS. */
38 PSAMPLE_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */
39 PSAMPLE_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */
40 PSAMPLE_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */
41 PSAMPLE_TUNNEL_KEY_ATTR_OAM, /* No argument. OAM frame. */
42 PSAMPLE_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */
43 PSAMPLE_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */
44 PSAMPLE_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */
45 PSAMPLE_TUNNEL_KEY_ATTR_VXLAN_OPTS, /* Nested VXLAN opts* */
46 PSAMPLE_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */
47 PSAMPLE_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */
48 PSAMPLE_TUNNEL_KEY_ATTR_PAD,
49 PSAMPLE_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* struct erspan_metadata */
50 PSAMPLE_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE, /* No argument. IPV4_INFO_BRIDGE mode.*/
51 __PSAMPLE_TUNNEL_KEY_ATTR_MAX
52};
53
28/* Can be overridden at runtime by module option */54/* Can be overridden at runtime by module option */
29#define PSAMPLE_ATTR_MAX (__PSAMPLE_ATTR_MAX - 1)55#define PSAMPLE_ATTR_MAX (__PSAMPLE_ATTR_MAX - 1)
3056
lib/libc/include/any-linux-any/linux/psci.h+7
...@@ -49,8 +49,11 @@...@@ -49,8 +49,11 @@
4949
50#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)50#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)
51#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)51#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)
52#define PSCI_1_0_FN_SET_SUSPEND_MODE PSCI_0_2_FN(15)
53#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)
5254
53#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)55#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)
56#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)
5457
55/* PSCI v0.2 power state encoding for CPU_SUSPEND function */58/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
56#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff59#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
...@@ -97,6 +100,10 @@...@@ -97,6 +100,10 @@
97#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK \100#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK \
98 (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT)101 (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT)
99102
103#define PSCI_1_0_OS_INITIATED BIT(0)
104#define PSCI_1_0_SUSPEND_MODE_PC 0
105#define PSCI_1_0_SUSPEND_MODE_OSI 1
106
100/* PSCI return values (inclusive of all PSCI versions) */107/* PSCI return values (inclusive of all PSCI versions) */
101#define PSCI_RET_SUCCESS 0108#define PSCI_RET_SUCCESS 0
102#define PSCI_RET_NOT_SUPPORTED -1109#define PSCI_RET_NOT_SUPPORTED -1
lib/libc/include/any-linux-any/linux/psp-sev.h+20-8
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
1/*2/*
2 * Userspace interface for AMD Secure Encrypted Virtualization (SEV)3 * Userspace interface for AMD Secure Encrypted Virtualization (SEV)
3 * platform management commands.4 * platform management commands.
...@@ -6,12 +7,7 @@...@@ -6,12 +7,7 @@
6 *7 *
7 * Author: Brijesh Singh <brijesh.singh@amd.com>8 * Author: Brijesh Singh <brijesh.singh@amd.com>
8 *9 *
9 * SEV spec 0.14 is available at:10 * SEV API specification is available at: https://developer.amd.com/sev/
10 * http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */11 */
1612
17#ifndef __PSP_SEV_USER_H__13#ifndef __PSP_SEV_USER_H__
...@@ -30,7 +26,8 @@ enum {...@@ -30,7 +26,8 @@ enum {
30 SEV_PDH_GEN,26 SEV_PDH_GEN,
31 SEV_PDH_CERT_EXPORT,27 SEV_PDH_CERT_EXPORT,
32 SEV_PEK_CERT_IMPORT,28 SEV_PEK_CERT_IMPORT,
33 SEV_GET_ID,29 SEV_GET_ID, /* This command is deprecated, use SEV_GET_ID2 */
30 SEV_GET_ID2,
3431
35 SEV_MAX,32 SEV_MAX,
36};33};
...@@ -61,6 +58,9 @@ typedef enum {...@@ -61,6 +58,9 @@ typedef enum {
61 SEV_RET_HWSEV_RET_PLATFORM,58 SEV_RET_HWSEV_RET_PLATFORM,
62 SEV_RET_HWSEV_RET_UNSAFE,59 SEV_RET_HWSEV_RET_UNSAFE,
63 SEV_RET_UNSUPPORTED,60 SEV_RET_UNSUPPORTED,
61 SEV_RET_INVALID_PARAM,
62 SEV_RET_RESOURCE_LIMIT,
63 SEV_RET_SECURE_DATA_INVALID,
64 SEV_RET_MAX,64 SEV_RET_MAX,
65} sev_ret_code;65} sev_ret_code;
6666
...@@ -83,6 +83,8 @@ struct sev_user_data_status {...@@ -83,6 +83,8 @@ struct sev_user_data_status {
83 __u32 guest_count; /* Out */83 __u32 guest_count; /* Out */
84} __attribute__((packed));84} __attribute__((packed));
8585
86#define SEV_STATUS_FLAGS_CONFIG_ES 0x0100
87
86/**88/**
87 * struct sev_user_data_pek_csr - PEK_CSR command parameters89 * struct sev_user_data_pek_csr - PEK_CSR command parameters
88 *90 *
...@@ -125,7 +127,7 @@ struct sev_user_data_pdh_cert_export {...@@ -125,7 +127,7 @@ struct sev_user_data_pdh_cert_export {
125} __attribute__((packed));127} __attribute__((packed));
126128
127/**129/**
128 * struct sev_user_data_get_id - GET_ID command parameters130 * struct sev_user_data_get_id - GET_ID command parameters (deprecated)
129 *131 *
130 * @socket1: Buffer to pass unique ID of first socket132 * @socket1: Buffer to pass unique ID of first socket
131 * @socket2: Buffer to pass unique ID of second socket133 * @socket2: Buffer to pass unique ID of second socket
...@@ -135,6 +137,16 @@ struct sev_user_data_get_id {...@@ -135,6 +137,16 @@ struct sev_user_data_get_id {
135 __u8 socket2[64]; /* Out */137 __u8 socket2[64]; /* Out */
136} __attribute__((packed));138} __attribute__((packed));
137139
140/**
141 * struct sev_user_data_get_id2 - GET_ID command parameters
142 * @address: Buffer to store unique ID
143 * @length: length of the unique ID
144 */
145struct sev_user_data_get_id2 {
146 __u64 address; /* In */
147 __u32 length; /* In/Out */
148} __attribute__((packed));
149
138/**150/**
139 * struct sev_issue_cmd - SEV ioctl parameters151 * struct sev_issue_cmd - SEV ioctl parameters
140 *152 *
lib/libc/include/any-linux-any/linux/ptp_clock.h+92-5
...@@ -25,10 +25,49 @@...@@ -25,10 +25,49 @@
25#include <linux/ioctl.h>25#include <linux/ioctl.h>
26#include <linux/types.h>26#include <linux/types.h>
2727
28/* PTP_xxx bits, for the flags field within the request structures. */28/*
29 * Bits of the ptp_extts_request.flags field:
30 */
29#define PTP_ENABLE_FEATURE (1<<0)31#define PTP_ENABLE_FEATURE (1<<0)
30#define PTP_RISING_EDGE (1<<1)32#define PTP_RISING_EDGE (1<<1)
31#define PTP_FALLING_EDGE (1<<2)33#define PTP_FALLING_EDGE (1<<2)
34#define PTP_STRICT_FLAGS (1<<3)
35#define PTP_EXTTS_EDGES (PTP_RISING_EDGE | PTP_FALLING_EDGE)
36
37/*
38 * flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl.
39 */
40#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
41 PTP_RISING_EDGE | \
42 PTP_FALLING_EDGE | \
43 PTP_STRICT_FLAGS)
44
45/*
46 * flag fields valid for the original PTP_EXTTS_REQUEST ioctl.
47 * DO NOT ADD NEW FLAGS HERE.
48 */
49#define PTP_EXTTS_V1_VALID_FLAGS (PTP_ENABLE_FEATURE | \
50 PTP_RISING_EDGE | \
51 PTP_FALLING_EDGE)
52
53/*
54 * Bits of the ptp_perout_request.flags field:
55 */
56#define PTP_PEROUT_ONE_SHOT (1<<0)
57#define PTP_PEROUT_DUTY_CYCLE (1<<1)
58#define PTP_PEROUT_PHASE (1<<2)
59
60/*
61 * flag fields valid for the new PTP_PEROUT_REQUEST2 ioctl.
62 */
63#define PTP_PEROUT_VALID_FLAGS (PTP_PEROUT_ONE_SHOT | \
64 PTP_PEROUT_DUTY_CYCLE | \
65 PTP_PEROUT_PHASE)
66
67/*
68 * No flags are valid for the original PTP_PEROUT_REQUEST ioctl
69 */
70#define PTP_PEROUT_V1_VALID_FLAGS (0)
3271
33/*72/*
34 * struct ptp_clock_time - represents a time value73 * struct ptp_clock_time - represents a time value
...@@ -54,7 +93,9 @@ struct ptp_clock_caps {...@@ -54,7 +93,9 @@ struct ptp_clock_caps {
54 int n_pins; /* Number of input/output pins. */93 int n_pins; /* Number of input/output pins. */
55 /* Whether the clock supports precise system-device cross timestamps */94 /* Whether the clock supports precise system-device cross timestamps */
56 int cross_timestamping;95 int cross_timestamping;
57 int rsv[13]; /* Reserved for future use. */96 /* Whether the clock supports adjust phase */
97 int adjust_phase;
98 int rsv[12]; /* Reserved for future use. */
58};99};
59100
60struct ptp_extts_request {101struct ptp_extts_request {
...@@ -64,11 +105,33 @@ struct ptp_extts_request {...@@ -64,11 +105,33 @@ struct ptp_extts_request {
64};105};
65106
66struct ptp_perout_request {107struct ptp_perout_request {
67 struct ptp_clock_time start; /* Absolute start time. */108 union {
109 /*
110 * Absolute start time.
111 * Valid only if (flags & PTP_PEROUT_PHASE) is unset.
112 */
113 struct ptp_clock_time start;
114 /*
115 * Phase offset. The signal should start toggling at an
116 * unspecified integer multiple of the period, plus this value.
117 * The start time should be "as soon as possible".
118 * Valid only if (flags & PTP_PEROUT_PHASE) is set.
119 */
120 struct ptp_clock_time phase;
121 };
68 struct ptp_clock_time period; /* Desired period, zero means disable. */122 struct ptp_clock_time period; /* Desired period, zero means disable. */
69 unsigned int index; /* Which channel to configure. */123 unsigned int index; /* Which channel to configure. */
70 unsigned int flags; /* Reserved for future use. */124 unsigned int flags;
71 unsigned int rsv[4]; /* Reserved for future use. */125 union {
126 /*
127 * The "on" time of the signal.
128 * Must be lower than the period.
129 * Valid only if (flags & PTP_PEROUT_DUTY_CYCLE) is set.
130 */
131 struct ptp_clock_time on;
132 /* Reserved for future use. */
133 unsigned int rsv[4];
134 };
72};135};
73136
74#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */137#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
...@@ -84,6 +147,16 @@ struct ptp_sys_offset {...@@ -84,6 +147,16 @@ struct ptp_sys_offset {
84 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];147 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
85};148};
86149
150struct ptp_sys_offset_extended {
151 unsigned int n_samples; /* Desired number of measurements. */
152 unsigned int rsv[3]; /* Reserved for future use. */
153 /*
154 * Array of [system, phc, system] time stamps. The kernel will provide
155 * 3*n_samples time stamps.
156 */
157 struct ptp_clock_time ts[PTP_MAX_SAMPLES][3];
158};
159
87struct ptp_sys_offset_precise {160struct ptp_sys_offset_precise {
88 struct ptp_clock_time device;161 struct ptp_clock_time device;
89 struct ptp_clock_time sys_realtime;162 struct ptp_clock_time sys_realtime;
...@@ -136,6 +209,20 @@ struct ptp_pin_desc {...@@ -136,6 +209,20 @@ struct ptp_pin_desc {
136#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)209#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
137#define PTP_SYS_OFFSET_PRECISE \210#define PTP_SYS_OFFSET_PRECISE \
138 _IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)211 _IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)
212#define PTP_SYS_OFFSET_EXTENDED \
213 _IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
214
215#define PTP_CLOCK_GETCAPS2 _IOR(PTP_CLK_MAGIC, 10, struct ptp_clock_caps)
216#define PTP_EXTTS_REQUEST2 _IOW(PTP_CLK_MAGIC, 11, struct ptp_extts_request)
217#define PTP_PEROUT_REQUEST2 _IOW(PTP_CLK_MAGIC, 12, struct ptp_perout_request)
218#define PTP_ENABLE_PPS2 _IOW(PTP_CLK_MAGIC, 13, int)
219#define PTP_SYS_OFFSET2 _IOW(PTP_CLK_MAGIC, 14, struct ptp_sys_offset)
220#define PTP_PIN_GETFUNC2 _IOWR(PTP_CLK_MAGIC, 15, struct ptp_pin_desc)
221#define PTP_PIN_SETFUNC2 _IOW(PTP_CLK_MAGIC, 16, struct ptp_pin_desc)
222#define PTP_SYS_OFFSET_PRECISE2 \
223 _IOWR(PTP_CLK_MAGIC, 17, struct ptp_sys_offset_precise)
224#define PTP_SYS_OFFSET_EXTENDED2 \
225 _IOWR(PTP_CLK_MAGIC, 18, struct ptp_sys_offset_extended)
139226
140struct ptp_extts_event {227struct ptp_extts_event {
141 struct ptp_clock_time t; /* Time event occured. */228 struct ptp_clock_time t; /* Time event occured. */
lib/libc/include/any-linux-any/linux/ptrace.h+46
...@@ -73,6 +73,52 @@ struct seccomp_metadata {...@@ -73,6 +73,52 @@ struct seccomp_metadata {
73 __u64 flags; /* Output: filter's flags */73 __u64 flags; /* Output: filter's flags */
74};74};
7575
76#define PTRACE_GET_SYSCALL_INFO 0x420e
77#define PTRACE_SYSCALL_INFO_NONE 0
78#define PTRACE_SYSCALL_INFO_ENTRY 1
79#define PTRACE_SYSCALL_INFO_EXIT 2
80#define PTRACE_SYSCALL_INFO_SECCOMP 3
81
82struct ptrace_syscall_info {
83 __u8 op; /* PTRACE_SYSCALL_INFO_* */
84 __u8 pad[3];
85 __u32 arch;
86 __u64 instruction_pointer;
87 __u64 stack_pointer;
88 union {
89 struct {
90 __u64 nr;
91 __u64 args[6];
92 } entry;
93 struct {
94 __s64 rval;
95 __u8 is_error;
96 } exit;
97 struct {
98 __u64 nr;
99 __u64 args[6];
100 __u32 ret_data;
101 } seccomp;
102 };
103};
104
105#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f
106
107struct ptrace_rseq_configuration {
108 __u64 rseq_abi_pointer;
109 __u32 rseq_abi_size;
110 __u32 signature;
111 __u32 flags;
112 __u32 pad;
113};
114
115/*
116 * These values are stored in task->ptrace_message
117 * by tracehook_report_syscall_* to describe the current syscall-stop.
118 */
119#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
120#define PTRACE_EVENTMSG_SYSCALL_EXIT 2
121
76/* Read signals from a shared (process wide) queue */122/* Read signals from a shared (process wide) queue */
77#define PTRACE_PEEKSIGINFO_SHARED (1 << 0)123#define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
78124
lib/libc/include/any-linux-any/linux/raid/md_p.h+3-1
...@@ -123,7 +123,7 @@ typedef struct mdp_device_descriptor_s {...@@ -123,7 +123,7 @@ typedef struct mdp_device_descriptor_s {
123123
124/*124/*
125 * Notes:125 * Notes:
126 * - if an array is being reshaped (restriped) in order to change the126 * - if an array is being reshaped (restriped) in order to change
127 * the number of active devices in the array, 'raid_disks' will be127 * the number of active devices in the array, 'raid_disks' will be
128 * the larger of the old and new numbers. 'delta_disks' will128 * the larger of the old and new numbers. 'delta_disks' will
129 * be the "new - old". So if +ve, raid_disks is the new value, and129 * be the "new - old". So if +ve, raid_disks is the new value, and
...@@ -329,6 +329,7 @@ struct mdp_superblock_1 {...@@ -329,6 +329,7 @@ struct mdp_superblock_1 {
329#define MD_FEATURE_JOURNAL 512 /* support write cache */329#define MD_FEATURE_JOURNAL 512 /* support write cache */
330#define MD_FEATURE_PPL 1024 /* support PPL */330#define MD_FEATURE_PPL 1024 /* support PPL */
331#define MD_FEATURE_MULTIPLE_PPLS 2048 /* support for multiple PPLs */331#define MD_FEATURE_MULTIPLE_PPLS 2048 /* support for multiple PPLs */
332#define MD_FEATURE_RAID0_LAYOUT 4096 /* layout is meaningful for RAID0 */
332#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \333#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
333 |MD_FEATURE_RECOVERY_OFFSET \334 |MD_FEATURE_RECOVERY_OFFSET \
334 |MD_FEATURE_RESHAPE_ACTIVE \335 |MD_FEATURE_RESHAPE_ACTIVE \
...@@ -341,6 +342,7 @@ struct mdp_superblock_1 {...@@ -341,6 +342,7 @@ struct mdp_superblock_1 {
341 |MD_FEATURE_JOURNAL \342 |MD_FEATURE_JOURNAL \
342 |MD_FEATURE_PPL \343 |MD_FEATURE_PPL \
343 |MD_FEATURE_MULTIPLE_PPLS \344 |MD_FEATURE_MULTIPLE_PPLS \
345 |MD_FEATURE_RAID0_LAYOUT \
344 )346 )
345347
346struct r5l_payload_header {348struct r5l_payload_header {
lib/libc/include/any-linux-any/linux/random.h+3-1
...@@ -48,9 +48,11 @@ struct rand_pool_info {...@@ -48,9 +48,11 @@ struct rand_pool_info {
48 * Flags for getrandom(2)48 * Flags for getrandom(2)
49 *49 *
50 * GRND_NONBLOCK Don't block and return EAGAIN instead50 * GRND_NONBLOCK Don't block and return EAGAIN instead
51 * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom51 * GRND_RANDOM No effect
52 * GRND_INSECURE Return non-cryptographic random bytes
52 */53 */
53#define GRND_NONBLOCK 0x000154#define GRND_NONBLOCK 0x0001
54#define GRND_RANDOM 0x000255#define GRND_RANDOM 0x0002
56#define GRND_INSECURE 0x0004
5557
56#endif /* _LINUX_RANDOM_H */58#endif /* _LINUX_RANDOM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/raw.h deleted-19
...@@ -1,19 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __LINUX_RAW_H
3#define __LINUX_RAW_H
4
5#include <linux/types.h>
6
7#define RAW_SETBIND _IO( 0xac, 0 )
8#define RAW_GETBIND _IO( 0xac, 1 )
9
10struct raw_config_request
11{
12 int raw_minor;
13 __u64 block_major;
14 __u64 block_minor;
15};
16
17#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS
18
19#endif /* __LINUX_RAW_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rds.h+18-1
...@@ -64,10 +64,18 @@...@@ -64,10 +64,18 @@
6464
65/* supported values for SO_RDS_TRANSPORT */65/* supported values for SO_RDS_TRANSPORT */
66#define RDS_TRANS_IB 066#define RDS_TRANS_IB 0
67#define RDS_TRANS_IWARP 167#define RDS_TRANS_GAP 1
68#define RDS_TRANS_TCP 268#define RDS_TRANS_TCP 2
69#define RDS_TRANS_COUNT 369#define RDS_TRANS_COUNT 3
70#define RDS_TRANS_NONE (~0)70#define RDS_TRANS_NONE (~0)
71/* don't use RDS_TRANS_IWARP - it is deprecated */
72#define RDS_TRANS_IWARP RDS_TRANS_GAP
73
74/* IOCTLS commands for SOL_RDS */
75#define SIOCRDSSETTOS (SIOCPROTOPRIVATE)
76#define SIOCRDSGETTOS (SIOCPROTOPRIVATE + 1)
77
78typedef __u8 rds_tos_t;
7179
72/*80/*
73 * Control message types for SOL_RDS.81 * Control message types for SOL_RDS.
...@@ -149,6 +157,7 @@ struct rds_info_connection {...@@ -149,6 +157,7 @@ struct rds_info_connection {
149 __be32 faddr;157 __be32 faddr;
150 __u8 transport[TRANSNAMSIZ]; /* null term ascii */158 __u8 transport[TRANSNAMSIZ]; /* null term ascii */
151 __u8 flags;159 __u8 flags;
160 __u8 tos;
152} __attribute__((packed));161} __attribute__((packed));
153162
154struct rds6_info_connection {163struct rds6_info_connection {
...@@ -171,6 +180,7 @@ struct rds_info_message {...@@ -171,6 +180,7 @@ struct rds_info_message {
171 __be16 lport;180 __be16 lport;
172 __be16 fport;181 __be16 fport;
173 __u8 flags;182 __u8 flags;
183 __u8 tos;
174} __attribute__((packed));184} __attribute__((packed));
175185
176struct rds6_info_message {186struct rds6_info_message {
...@@ -214,6 +224,7 @@ struct rds_info_tcp_socket {...@@ -214,6 +224,7 @@ struct rds_info_tcp_socket {
214 __u32 last_sent_nxt;224 __u32 last_sent_nxt;
215 __u32 last_expected_una;225 __u32 last_expected_una;
216 __u32 last_seen_una;226 __u32 last_seen_una;
227 __u8 tos;
217} __attribute__((packed));228} __attribute__((packed));
218229
219struct rds6_info_tcp_socket {230struct rds6_info_tcp_socket {
...@@ -240,6 +251,9 @@ struct rds_info_rdma_connection {...@@ -240,6 +251,9 @@ struct rds_info_rdma_connection {
240 __u32 max_send_sge;251 __u32 max_send_sge;
241 __u32 rdma_mr_max;252 __u32 rdma_mr_max;
242 __u32 rdma_mr_size;253 __u32 rdma_mr_size;
254 __u8 tos;
255 __u8 sl;
256 __u32 cache_allocs;
243};257};
244258
245struct rds6_info_rdma_connection {259struct rds6_info_rdma_connection {
...@@ -253,6 +267,9 @@ struct rds6_info_rdma_connection {...@@ -253,6 +267,9 @@ struct rds6_info_rdma_connection {
253 __u32 max_send_sge;267 __u32 max_send_sge;
254 __u32 rdma_mr_max;268 __u32 rdma_mr_max;
255 __u32 rdma_mr_size;269 __u32 rdma_mr_size;
270 __u8 tos;
271 __u8 sl;
272 __u32 cache_allocs;
256};273};
257274
258/* RDS message Receive Path Latency points */275/* RDS message Receive Path Latency points */
lib/libc/include/any-linux-any/linux/remoteproc_cdev.h created+37
...@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * IOCTLs for Remoteproc's character device interface.
4 *
5 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
6 */
7
8#ifndef _REMOTEPROC_CDEV_H_
9#define _REMOTEPROC_CDEV_H_
10
11#include <linux/ioctl.h>
12#include <linux/types.h>
13
14#define RPROC_MAGIC 0xB7
15
16/*
17 * The RPROC_SET_SHUTDOWN_ON_RELEASE ioctl allows to enable/disable the shutdown of a remote
18 * processor automatically when the controlling userpsace closes the char device interface.
19 *
20 * input parameter: integer
21 * 0 : disable automatic shutdown
22 * other : enable automatic shutdown
23 */
24#define RPROC_SET_SHUTDOWN_ON_RELEASE _IOW(RPROC_MAGIC, 1, __s32)
25
26/*
27 * The RPROC_GET_SHUTDOWN_ON_RELEASE ioctl gets information about whether the automatic shutdown of
28 * a remote processor is enabled or disabled when the controlling userspace closes the char device
29 * interface.
30 *
31 * output parameter: integer
32 * 0 : automatic shutdown disable
33 * other : automatic shutdown enable
34 */
35#define RPROC_GET_SHUTDOWN_ON_RELEASE _IOR(RPROC_MAGIC, 2, __s32)
36
37#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/resource.h+2-2
...@@ -22,8 +22,8 @@...@@ -22,8 +22,8 @@
22#define RUSAGE_THREAD 1 /* only the calling thread */22#define RUSAGE_THREAD 1 /* only the calling thread */
2323
24struct rusage {24struct rusage {
25 struct timeval ru_utime; /* user time used */25 struct __kernel_old_timeval ru_utime; /* user time used */
26 struct timeval ru_stime; /* system time used */26 struct __kernel_old_timeval ru_stime; /* system time used */
27 __kernel_long_t ru_maxrss; /* maximum resident set size */27 __kernel_long_t ru_maxrss; /* maximum resident set size */
28 __kernel_long_t ru_ixrss; /* integral shared memory size */28 __kernel_long_t ru_ixrss; /* integral shared memory size */
29 __kernel_long_t ru_idrss; /* integral unshared data size */29 __kernel_long_t ru_idrss; /* integral unshared data size */
lib/libc/include/any-linux-any/linux/rfkill.h+82-12
...@@ -69,6 +69,16 @@ enum rfkill_operation {...@@ -69,6 +69,16 @@ enum rfkill_operation {
69 RFKILL_OP_CHANGE_ALL,69 RFKILL_OP_CHANGE_ALL,
70};70};
7171
72/**
73 * enum rfkill_hard_block_reasons - hard block reasons
74 * @RFKILL_HARD_BLOCK_SIGNAL: the hardware rfkill signal is active
75 * @RFKILL_HARD_BLOCK_NOT_OWNER: the NIC is not owned by the host
76 */
77enum rfkill_hard_block_reasons {
78 RFKILL_HARD_BLOCK_SIGNAL = 1 << 0,
79 RFKILL_HARD_BLOCK_NOT_OWNER = 1 << 1,
80};
81
72/**82/**
73 * struct rfkill_event - events for userspace on /dev/rfkill83 * struct rfkill_event - events for userspace on /dev/rfkill
74 * @idx: index of dev rfkill84 * @idx: index of dev rfkill
...@@ -84,22 +94,82 @@ struct rfkill_event {...@@ -84,22 +94,82 @@ struct rfkill_event {
84 __u32 idx;94 __u32 idx;
85 __u8 type;95 __u8 type;
86 __u8 op;96 __u8 op;
87 __u8 soft, hard;97 __u8 soft;
98 __u8 hard;
88} __attribute__((packed));99} __attribute__((packed));
89100
90/*101/**
91 * We are planning to be backward and forward compatible with changes102 * struct rfkill_event_ext - events for userspace on /dev/rfkill
92 * to the event struct, by adding new, optional, members at the end.103 * @idx: index of dev rfkill
93 * When reading an event (whether the kernel from userspace or vice104 * @type: type of the rfkill struct
94 * versa) we need to accept anything that's at least as large as the105 * @op: operation code
95 * version 1 event size, but might be able to accept other sizes in106 * @hard: hard state (0/1)
96 * the future.107 * @soft: soft state (0/1)
108 * @hard_block_reasons: valid if hard is set. One or several reasons from
109 * &enum rfkill_hard_block_reasons.
110 *
111 * Structure used for userspace communication on /dev/rfkill,
112 * used for events from the kernel and control to the kernel.
113 *
114 * See the extensibility docs below.
115 */
116struct rfkill_event_ext {
117 __u32 idx;
118 __u8 type;
119 __u8 op;
120 __u8 soft;
121 __u8 hard;
122
123 /*
124 * older kernels will accept/send only up to this point,
125 * and if extended further up to any chunk marked below
126 */
127
128 __u8 hard_block_reasons;
129} __attribute__((packed));
130
131/**
132 * DOC: Extensibility
133 *
134 * Originally, we had planned to allow backward and forward compatible
135 * changes by just adding fields at the end of the structure that are
136 * then not reported on older kernels on read(), and not written to by
137 * older kernels on write(), with the kernel reporting the size it did
138 * accept as the result.
139 *
140 * This would have allowed userspace to detect on read() and write()
141 * which kernel structure version it was dealing with, and if was just
142 * recompiled it would have gotten the new fields, but obviously not
143 * accessed them, but things should've continued to work.
144 *
145 * Unfortunately, while actually exercising this mechanism to add the
146 * hard block reasons field, we found that userspace (notably systemd)
147 * did all kinds of fun things not in line with this scheme:
148 *
149 * 1. treat the (expected) short writes as an error;
150 * 2. ask to read sizeof(struct rfkill_event) but then compare the
151 * actual return value to RFKILL_EVENT_SIZE_V1 and treat any
152 * mismatch as an error.
153 *
154 * As a consequence, just recompiling with a new struct version caused
155 * things to no longer work correctly on old and new kernels.
156 *
157 * Hence, we've rolled back &struct rfkill_event to the original version
158 * and added &struct rfkill_event_ext. This effectively reverts to the
159 * old behaviour for all userspace, unless it explicitly opts in to the
160 * rules outlined here by using the new &struct rfkill_event_ext.
161 *
162 * Userspace using &struct rfkill_event_ext must adhere to the following
163 * rules
97 *164 *
98 * One exception is the kernel -- we already have two event sizes in165 * 1. accept short writes, optionally using them to detect that it's
99 * that we've made the 'hard' member optional since our only option166 * running on an older kernel;
100 * is to ignore it anyway.167 * 2. accept short reads, knowing that this means it's running on an
168 * older kernel;
169 * 3. treat reads that are as long as requested as acceptable, not
170 * checking against RFKILL_EVENT_SIZE_V1 or such.
101 */171 */
102#define RFKILL_EVENT_SIZE_V1 8172#define RFKILL_EVENT_SIZE_V1 sizeof(struct rfkill_event)
103173
104/* ioctl for turning off rfkill-input (if present) */174/* ioctl for turning off rfkill-input (if present) */
105#define RFKILL_IOC_MAGIC 'R'175#define RFKILL_IOC_MAGIC 'R'
lib/libc/include/any-linux-any/linux/rkisp1-config.h created+950
...@@ -0,0 +1,950 @@
1/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR MIT) */
2/*
3 * Rockchip ISP1 userspace API
4 * Copyright (C) 2017 Rockchip Electronics Co., Ltd.
5 */
6
7#ifndef _RKISP1_CONFIG_H
8#define _RKISP1_CONFIG_H
9
10#include <linux/types.h>
11
12/* Defect Pixel Cluster Detection */
13#define RKISP1_CIF_ISP_MODULE_DPCC (1U << 0)
14/* Black Level Subtraction */
15#define RKISP1_CIF_ISP_MODULE_BLS (1U << 1)
16/* Sensor De-gamma */
17#define RKISP1_CIF_ISP_MODULE_SDG (1U << 2)
18/* Histogram statistics configuration */
19#define RKISP1_CIF_ISP_MODULE_HST (1U << 3)
20/* Lens Shade Control */
21#define RKISP1_CIF_ISP_MODULE_LSC (1U << 4)
22/* Auto White Balance Gain */
23#define RKISP1_CIF_ISP_MODULE_AWB_GAIN (1U << 5)
24/* Filter */
25#define RKISP1_CIF_ISP_MODULE_FLT (1U << 6)
26/* Bayer Demosaic */
27#define RKISP1_CIF_ISP_MODULE_BDM (1U << 7)
28/* Cross Talk */
29#define RKISP1_CIF_ISP_MODULE_CTK (1U << 8)
30/* Gamma Out Curve */
31#define RKISP1_CIF_ISP_MODULE_GOC (1U << 9)
32/* Color Processing */
33#define RKISP1_CIF_ISP_MODULE_CPROC (1U << 10)
34/* Auto Focus Control statistics configuration */
35#define RKISP1_CIF_ISP_MODULE_AFC (1U << 11)
36/* Auto White Balancing statistics configuration */
37#define RKISP1_CIF_ISP_MODULE_AWB (1U << 12)
38/* Image Effect */
39#define RKISP1_CIF_ISP_MODULE_IE (1U << 13)
40/* Auto Exposure Control statistics configuration */
41#define RKISP1_CIF_ISP_MODULE_AEC (1U << 14)
42/* Wide Dynamic Range */
43#define RKISP1_CIF_ISP_MODULE_WDR (1U << 15)
44/* Denoise Pre-Filter */
45#define RKISP1_CIF_ISP_MODULE_DPF (1U << 16)
46/* Denoise Pre-Filter Strength */
47#define RKISP1_CIF_ISP_MODULE_DPF_STRENGTH (1U << 17)
48
49#define RKISP1_CIF_ISP_CTK_COEFF_MAX 0x100
50#define RKISP1_CIF_ISP_CTK_OFFSET_MAX 0x800
51
52#define RKISP1_CIF_ISP_AE_MEAN_MAX_V10 25
53#define RKISP1_CIF_ISP_AE_MEAN_MAX_V12 81
54#define RKISP1_CIF_ISP_AE_MEAN_MAX RKISP1_CIF_ISP_AE_MEAN_MAX_V12
55
56#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 16
57#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 32
58#define RKISP1_CIF_ISP_HIST_BIN_N_MAX RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12
59
60#define RKISP1_CIF_ISP_AFM_MAX_WINDOWS 3
61#define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE 17
62
63#define RKISP1_CIF_ISP_BDM_MAX_TH 0xff
64
65/*
66 * Black level compensation
67 */
68/* maximum value for horizontal start address */
69#define RKISP1_CIF_ISP_BLS_START_H_MAX 0x00000fff
70/* maximum value for horizontal stop address */
71#define RKISP1_CIF_ISP_BLS_STOP_H_MAX 0x00000fff
72/* maximum value for vertical start address */
73#define RKISP1_CIF_ISP_BLS_START_V_MAX 0x00000fff
74/* maximum value for vertical stop address */
75#define RKISP1_CIF_ISP_BLS_STOP_V_MAX 0x00000fff
76/* maximum is 2^18 = 262144*/
77#define RKISP1_CIF_ISP_BLS_SAMPLES_MAX 0x00000012
78/* maximum value for fixed black level */
79#define RKISP1_CIF_ISP_BLS_FIX_SUB_MAX 0x00000fff
80/* minimum value for fixed black level */
81#define RKISP1_CIF_ISP_BLS_FIX_SUB_MIN 0xfffff000
82/* 13 bit range (signed)*/
83#define RKISP1_CIF_ISP_BLS_FIX_MASK 0x00001fff
84
85/*
86 * Automatic white balance measurements
87 */
88#define RKISP1_CIF_ISP_AWB_MAX_GRID 1
89#define RKISP1_CIF_ISP_AWB_MAX_FRAMES 7
90
91/*
92 * Gamma out
93 */
94/* Maximum number of color samples supported */
95#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 17
96#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 34
97#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
98
99/*
100 * Lens shade correction
101 */
102#define RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE 8
103
104/*
105 * The following matches the tuning process,
106 * not the max capabilities of the chip.
107 */
108#define RKISP1_CIF_ISP_LSC_SAMPLES_MAX 17
109
110/*
111 * Histogram calculation
112 */
113#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 25
114#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 81
115#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
116
117/*
118 * Defect Pixel Cluster Correction
119 */
120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
121
122/*
123 * Denoising pre filter
124 */
125#define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS 17
126#define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS 6
127
128/*
129 * Measurement types
130 */
131#define RKISP1_CIF_ISP_STAT_AWB (1U << 0)
132#define RKISP1_CIF_ISP_STAT_AUTOEXP (1U << 1)
133#define RKISP1_CIF_ISP_STAT_AFM (1U << 2)
134#define RKISP1_CIF_ISP_STAT_HIST (1U << 3)
135
136/**
137 * enum rkisp1_cif_isp_version - ISP variants
138 *
139 * @RKISP1_V10: used at least in rk3288 and rk3399
140 * @RKISP1_V11: declared in the original vendor code, but not used
141 * @RKISP1_V12: used at least in rk3326 and px30
142 * @RKISP1_V13: used at least in rk1808
143 */
144enum rkisp1_cif_isp_version {
145 RKISP1_V10 = 10,
146 RKISP1_V11,
147 RKISP1_V12,
148 RKISP1_V13,
149};
150
151enum rkisp1_cif_isp_histogram_mode {
152 RKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE,
153 RKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED,
154 RKISP1_CIF_ISP_HISTOGRAM_MODE_R_HISTOGRAM,
155 RKISP1_CIF_ISP_HISTOGRAM_MODE_G_HISTOGRAM,
156 RKISP1_CIF_ISP_HISTOGRAM_MODE_B_HISTOGRAM,
157 RKISP1_CIF_ISP_HISTOGRAM_MODE_Y_HISTOGRAM
158};
159
160enum rkisp1_cif_isp_awb_mode_type {
161 RKISP1_CIF_ISP_AWB_MODE_MANUAL,
162 RKISP1_CIF_ISP_AWB_MODE_RGB,
163 RKISP1_CIF_ISP_AWB_MODE_YCBCR
164};
165
166enum rkisp1_cif_isp_flt_mode {
167 RKISP1_CIF_ISP_FLT_STATIC_MODE,
168 RKISP1_CIF_ISP_FLT_DYNAMIC_MODE
169};
170
171/**
172 * enum rkisp1_cif_isp_exp_ctrl_autostop - stop modes
173 * @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0: continuous measurement
174 * @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1: stop measuring after a complete frame
175 */
176enum rkisp1_cif_isp_exp_ctrl_autostop {
177 RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0 = 0,
178 RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1 = 1,
179};
180
181/**
182 * enum rkisp1_cif_isp_exp_meas_mode - Exposure measure mode
183 * @RKISP1_CIF_ISP_EXP_MEASURING_MODE_0: Y = 16 + 0.25R + 0.5G + 0.1094B
184 * @RKISP1_CIF_ISP_EXP_MEASURING_MODE_1: Y = (R + G + B) x (85/256)
185 */
186enum rkisp1_cif_isp_exp_meas_mode {
187 RKISP1_CIF_ISP_EXP_MEASURING_MODE_0,
188 RKISP1_CIF_ISP_EXP_MEASURING_MODE_1,
189};
190
191/*---------- PART1: Input Parameters ------------*/
192
193/**
194 * struct rkisp1_cif_isp_window - measurement window.
195 *
196 * Measurements are calculated per window inside the frame.
197 * This struct represents a window for a measurement.
198 *
199 * @h_offs: the horizontal offset of the window from the left of the frame in pixels.
200 * @v_offs: the vertical offset of the window from the top of the frame in pixels.
201 * @h_size: the horizontal size of the window in pixels
202 * @v_size: the vertical size of the window in pixels.
203 */
204struct rkisp1_cif_isp_window {
205 __u16 h_offs;
206 __u16 v_offs;
207 __u16 h_size;
208 __u16 v_size;
209};
210
211/**
212 * struct rkisp1_cif_isp_bls_fixed_val - BLS fixed subtraction values
213 *
214 * The values will be subtracted from the sensor
215 * values. Therefore a negative value means addition instead of subtraction!
216 *
217 * @r: Fixed (signed!) subtraction value for Bayer pattern R
218 * @gr: Fixed (signed!) subtraction value for Bayer pattern Gr
219 * @gb: Fixed (signed!) subtraction value for Bayer pattern Gb
220 * @b: Fixed (signed!) subtraction value for Bayer pattern B
221 */
222struct rkisp1_cif_isp_bls_fixed_val {
223 __s16 r;
224 __s16 gr;
225 __s16 gb;
226 __s16 b;
227};
228
229/**
230 * struct rkisp1_cif_isp_bls_config - Configuration used by black level subtraction
231 *
232 * @enable_auto: Automatic mode activated means that the measured values
233 * are subtracted. Otherwise the fixed subtraction
234 * values will be subtracted.
235 * @en_windows: enabled window
236 * @bls_window1: Measurement window 1 size
237 * @bls_window2: Measurement window 2 size
238 * @bls_samples: Set amount of measured pixels for each Bayer position
239 * (A, B,C and D) to 2^bls_samples.
240 * @fixed_val: Fixed subtraction values
241 */
242struct rkisp1_cif_isp_bls_config {
243 __u8 enable_auto;
244 __u8 en_windows;
245 struct rkisp1_cif_isp_window bls_window1;
246 struct rkisp1_cif_isp_window bls_window2;
247 __u8 bls_samples;
248 struct rkisp1_cif_isp_bls_fixed_val fixed_val;
249};
250
251/**
252 * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC
253 *
254 * Methods Configuration used by Defect Pixel Cluster Correction
255 *
256 * @method: Method enable bits
257 * @line_thresh: Line threshold
258 * @line_mad_fac: Line MAD factor
259 * @pg_fac: Peak gradient factor
260 * @rnd_thresh: Rank Neighbor Difference threshold
261 * @rg_fac: Rank gradient factor
262 */
263struct rkisp1_cif_isp_dpcc_methods_config {
264 __u32 method;
265 __u32 line_thresh;
266 __u32 line_mad_fac;
267 __u32 pg_fac;
268 __u32 rnd_thresh;
269 __u32 rg_fac;
270};
271
272/**
273 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
274 *
275 * Configuration used by Defect Pixel Cluster Correction
276 *
277 * @mode: dpcc output mode
278 * @output_mode: whether use hard coded methods
279 * @set_use: stage1 methods set
280 * @methods: methods config
281 * @ro_limits: rank order limits
282 * @rnd_offs: differential rank offsets for rank neighbor difference
283 */
284struct rkisp1_cif_isp_dpcc_config {
285 __u32 mode;
286 __u32 output_mode;
287 __u32 set_use;
288 struct rkisp1_cif_isp_dpcc_methods_config methods[RKISP1_CIF_ISP_DPCC_METHODS_MAX];
289 __u32 ro_limits;
290 __u32 rnd_offs;
291};
292
293/**
294 * struct rkisp1_cif_isp_gamma_corr_curve - gamma curve point definition y-axis (output).
295 *
296 * The reset values define a linear curve which has the same effect as bypass. Reset values are:
297 * gamma_y[0] = 0x0000, gamma_y[1] = 0x0100, ... gamma_y[15] = 0x0f00, gamma_y[16] = 0xfff
298 *
299 * @gamma_y: the values for the y-axis of gamma curve points. Each value is 12 bit.
300 */
301struct rkisp1_cif_isp_gamma_corr_curve {
302 __u16 gamma_y[RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE];
303};
304
305/**
306 * struct rkisp1_cif_isp_gamma_curve_x_axis_pnts - De-Gamma Curve definition x increments
307 * (sampling points). gamma_dx0 is for the lower samples (1-8), gamma_dx1 is for the
308 * higher samples (9-16). The reset values for both fields is 0x44444444. This means
309 * that each sample is 4 units away from the previous one on the x-axis.
310 *
311 * @gamma_dx0: gamma curve sample points definitions. Bits 0:2 for sample 1. Bit 3 unused.
312 * Bits 4:6 for sample 2. bit 7 unused ... Bits 28:30 for sample 8. Bit 31 unused
313 * @gamma_dx1: gamma curve sample points definitions. Bits 0:2 for sample 9. Bit 3 unused.
314 * Bits 4:6 for sample 10. bit 7 unused ... Bits 28:30 for sample 16. Bit 31 unused
315 */
316struct rkisp1_cif_isp_gamma_curve_x_axis_pnts {
317 __u32 gamma_dx0;
318 __u32 gamma_dx1;
319};
320
321/**
322 * struct rkisp1_cif_isp_sdg_config - Configuration used by sensor degamma
323 *
324 * @curve_r: gamma curve point definition axis for red
325 * @curve_g: gamma curve point definition axis for green
326 * @curve_b: gamma curve point definition axis for blue
327 * @xa_pnts: x axis increments
328 */
329struct rkisp1_cif_isp_sdg_config {
330 struct rkisp1_cif_isp_gamma_corr_curve curve_r;
331 struct rkisp1_cif_isp_gamma_corr_curve curve_g;
332 struct rkisp1_cif_isp_gamma_corr_curve curve_b;
333 struct rkisp1_cif_isp_gamma_curve_x_axis_pnts xa_pnts;
334};
335
336/**
337 * struct rkisp1_cif_isp_lsc_config - Configuration used by Lens shading correction
338 *
339 * @r_data_tbl: sample table red
340 * @gr_data_tbl: sample table green (red)
341 * @gb_data_tbl: sample table green (blue)
342 * @b_data_tbl: sample table blue
343 * @x_grad_tbl: gradient table x
344 * @y_grad_tbl: gradient table y
345 * @x_size_tbl: size table x
346 * @y_size_tbl: size table y
347 * @config_width: not used at the moment
348 * @config_height: not used at the moment
349 */
350struct rkisp1_cif_isp_lsc_config {
351 __u16 r_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
352 __u16 gr_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
353 __u16 gb_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
354 __u16 b_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
355
356 __u16 x_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
357 __u16 y_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
358
359 __u16 x_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
360 __u16 y_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
361 __u16 config_width;
362 __u16 config_height;
363};
364
365/**
366 * struct rkisp1_cif_isp_ie_config - Configuration used by image effects
367 *
368 * @effect: values from 'enum v4l2_colorfx'. Possible values are: V4L2_COLORFX_SEPIA,
369 * V4L2_COLORFX_SET_CBCR, V4L2_COLORFX_AQUA, V4L2_COLORFX_EMBOSS,
370 * V4L2_COLORFX_SKETCH, V4L2_COLORFX_BW, V4L2_COLORFX_NEGATIVE
371 * @color_sel: bits 0:2 - colors bitmask (001 - blue, 010 - green, 100 - red).
372 * bits 8:15 - Threshold value of the RGB colors for the color selection effect.
373 * @eff_mat_1: 3x3 Matrix Coefficients for Emboss Effect 1
374 * @eff_mat_2: 3x3 Matrix Coefficients for Emboss Effect 2
375 * @eff_mat_3: 3x3 Matrix Coefficients for Emboss 3/Sketch 1
376 * @eff_mat_4: 3x3 Matrix Coefficients for Sketch Effect 2
377 * @eff_mat_5: 3x3 Matrix Coefficients for Sketch Effect 3
378 * @eff_tint: Chrominance increment values of tint (used for sepia effect)
379 */
380struct rkisp1_cif_isp_ie_config {
381 __u16 effect;
382 __u16 color_sel;
383 __u16 eff_mat_1;
384 __u16 eff_mat_2;
385 __u16 eff_mat_3;
386 __u16 eff_mat_4;
387 __u16 eff_mat_5;
388 __u16 eff_tint;
389};
390
391/**
392 * struct rkisp1_cif_isp_cproc_config - Configuration used by Color Processing
393 *
394 * @c_out_range: Chrominance pixel clipping range at output.
395 * (0 for limit, 1 for full)
396 * @y_in_range: Luminance pixel clipping range at output.
397 * @y_out_range: Luminance pixel clipping range at output.
398 * @contrast: 00~ff, 0.0~1.992
399 * @brightness: 80~7F, -128~+127
400 * @sat: saturation, 00~FF, 0.0~1.992
401 * @hue: 80~7F, -90~+87.188
402 */
403struct rkisp1_cif_isp_cproc_config {
404 __u8 c_out_range;
405 __u8 y_in_range;
406 __u8 y_out_range;
407 __u8 contrast;
408 __u8 brightness;
409 __u8 sat;
410 __u8 hue;
411};
412
413/**
414 * struct rkisp1_cif_isp_awb_meas_config - Configuration for the AWB statistics
415 *
416 * @awb_mode: the awb meas mode. From enum rkisp1_cif_isp_awb_mode_type.
417 * @awb_wnd: white balance measurement window (in pixels)
418 * @max_y: only pixels values < max_y contribute to awb measurement, set to 0
419 * to disable this feature
420 * @min_y: only pixels values > min_y contribute to awb measurement
421 * @max_csum: Chrominance sum maximum value, only consider pixels with Cb+Cr,
422 * smaller than threshold for awb measurements
423 * @min_c: Chrominance minimum value, only consider pixels with Cb/Cr
424 * each greater than threshold value for awb measurements
425 * @frames: number of frames - 1 used for mean value calculation
426 * (ucFrames=0 means 1 Frame)
427 * @awb_ref_cr: reference Cr value for AWB regulation, target for AWB
428 * @awb_ref_cb: reference Cb value for AWB regulation, target for AWB
429 * @enable_ymax_cmp: enable Y_MAX compare (Not valid in RGB measurement mode.)
430 */
431struct rkisp1_cif_isp_awb_meas_config {
432 /*
433 * Note: currently the h and v offsets are mapped to grid offsets
434 */
435 struct rkisp1_cif_isp_window awb_wnd;
436 __u32 awb_mode;
437 __u8 max_y;
438 __u8 min_y;
439 __u8 max_csum;
440 __u8 min_c;
441 __u8 frames;
442 __u8 awb_ref_cr;
443 __u8 awb_ref_cb;
444 __u8 enable_ymax_cmp;
445};
446
447/**
448 * struct rkisp1_cif_isp_awb_gain_config - Configuration used by auto white balance gain
449 *
450 * All fields in this struct are 10 bit, where:
451 * 0x100h = 1, unsigned integer value, range 0 to 4 with 8 bit fractional part.
452 *
453 * out_data_x = ( AWB_GAIN_X * in_data + 128) >> 8
454 *
455 * @gain_red: gain value for red component.
456 * @gain_green_r: gain value for green component in red line.
457 * @gain_blue: gain value for blue component.
458 * @gain_green_b: gain value for green component in blue line.
459 */
460struct rkisp1_cif_isp_awb_gain_config {
461 __u16 gain_red;
462 __u16 gain_green_r;
463 __u16 gain_blue;
464 __u16 gain_green_b;
465};
466
467/**
468 * struct rkisp1_cif_isp_flt_config - Configuration used by ISP filtering
469 *
470 * All 4 threshold fields (thresh_*) are 10 bits.
471 * All 6 factor fields (fac_*) are 6 bits.
472 *
473 * @mode: ISP_FILT_MODE register fields (from enum rkisp1_cif_isp_flt_mode)
474 * @grn_stage1: Green filter stage 1 select (range 0x0...0x8)
475 * @chr_h_mode: Chroma filter horizontal mode
476 * @chr_v_mode: Chroma filter vertical mode
477 * @thresh_bl0: If thresh_bl1 < sum_grad < thresh_bl0 then fac_bl0 is selected (blurring th)
478 * @thresh_bl1: If sum_grad < thresh_bl1 then fac_bl1 is selected (blurring th)
479 * @thresh_sh0: If thresh_sh0 < sum_grad < thresh_sh1 then thresh_sh0 is selected (sharpening th)
480 * @thresh_sh1: If thresh_sh1 < sum_grad then thresh_sh1 is selected (sharpening th)
481 * @lum_weight: Parameters for luminance weight function.
482 * @fac_sh1: filter factor for sharp1 level
483 * @fac_sh0: filter factor for sharp0 level
484 * @fac_mid: filter factor for mid level and for static filter mode
485 * @fac_bl0: filter factor for blur 0 level
486 * @fac_bl1: filter factor for blur 1 level (max blur)
487 */
488struct rkisp1_cif_isp_flt_config {
489 __u32 mode;
490 __u8 grn_stage1;
491 __u8 chr_h_mode;
492 __u8 chr_v_mode;
493 __u32 thresh_bl0;
494 __u32 thresh_bl1;
495 __u32 thresh_sh0;
496 __u32 thresh_sh1;
497 __u32 lum_weight;
498 __u32 fac_sh1;
499 __u32 fac_sh0;
500 __u32 fac_mid;
501 __u32 fac_bl0;
502 __u32 fac_bl1;
503};
504
505/**
506 * struct rkisp1_cif_isp_bdm_config - Configuration used by Bayer DeMosaic
507 *
508 * @demosaic_th: threshold for bayer demosaicing texture detection
509 */
510struct rkisp1_cif_isp_bdm_config {
511 __u8 demosaic_th;
512};
513
514/**
515 * struct rkisp1_cif_isp_ctk_config - Configuration used by Cross Talk correction
516 *
517 * @coeff: color correction matrix. Values are 11-bit signed fixed-point numbers with 4 bit integer
518 * and 7 bit fractional part, ranging from -8 (0x400) to +7.992 (0x3FF). 0 is
519 * represented by 0x000 and a coefficient value of 1 as 0x080.
520 * @ct_offset: Red, Green, Blue offsets for the crosstalk correction matrix
521 */
522struct rkisp1_cif_isp_ctk_config {
523 __u16 coeff[3][3];
524 __u16 ct_offset[3];
525};
526
527enum rkisp1_cif_isp_goc_mode {
528 RKISP1_CIF_ISP_GOC_MODE_LOGARITHMIC,
529 RKISP1_CIF_ISP_GOC_MODE_EQUIDISTANT
530};
531
532/**
533 * struct rkisp1_cif_isp_goc_config - Configuration used by Gamma Out correction
534 *
535 * @mode: goc mode (from enum rkisp1_cif_isp_goc_mode)
536 * @gamma_y: gamma out curve y-axis for all color components
537 *
538 * The number of entries of @gamma_y depends on the hardware revision
539 * as is reported by the hw_revision field of the struct media_device_info
540 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
541 *
542 * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10
543 * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
544 * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum
545 * of the two.
546 */
547struct rkisp1_cif_isp_goc_config {
548 __u32 mode;
549 __u16 gamma_y[RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES];
550};
551
552/**
553 * struct rkisp1_cif_isp_hst_config - Configuration for Histogram statistics
554 *
555 * @mode: histogram mode (from enum rkisp1_cif_isp_histogram_mode)
556 * @histogram_predivider: process every stepsize pixel, all other pixels are
557 * skipped
558 * @meas_window: coordinates of the measure window
559 * @hist_weight: weighting factor for sub-windows
560 *
561 * The number of entries of @hist_weight depends on the hardware revision
562 * as is reported by the hw_revision field of the struct media_device_info
563 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
564 *
565 * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10
566 * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
567 * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum
568 * of the two.
569 */
570struct rkisp1_cif_isp_hst_config {
571 __u32 mode;
572 __u8 histogram_predivider;
573 struct rkisp1_cif_isp_window meas_window;
574 __u8 hist_weight[RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE];
575};
576
577/**
578 * struct rkisp1_cif_isp_aec_config - Configuration for Auto Exposure statistics
579 *
580 * @mode: Exposure measure mode (from enum rkisp1_cif_isp_exp_meas_mode)
581 * @autostop: stop mode (from enum rkisp1_cif_isp_exp_ctrl_autostop)
582 * @meas_window: coordinates of the measure window
583 */
584struct rkisp1_cif_isp_aec_config {
585 __u32 mode;
586 __u32 autostop;
587 struct rkisp1_cif_isp_window meas_window;
588};
589
590/**
591 * struct rkisp1_cif_isp_afc_config - Configuration for the Auto Focus statistics
592 *
593 * @num_afm_win: max RKISP1_CIF_ISP_AFM_MAX_WINDOWS
594 * @afm_win: coordinates of the meas window
595 * @thres: threshold used for minimizing the influence of noise
596 * @var_shift: the number of bits for the shift operation at the end of the
597 * calculation chain.
598 */
599struct rkisp1_cif_isp_afc_config {
600 __u8 num_afm_win;
601 struct rkisp1_cif_isp_window afm_win[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];
602 __u32 thres;
603 __u32 var_shift;
604};
605
606/**
607 * enum rkisp1_cif_isp_dpf_gain_usage - dpf gain usage
608 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED: don't use any gains in preprocessing stage
609 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS: use only the noise function gains from
610 * registers DPF_NF_GAIN_R, ...
611 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS: use only the gains from LSC module
612 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS: use the noise function gains and the
613 * gains from LSC module
614 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS: use only the gains from AWB module
615 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS: use the gains from AWB and LSC module
616 * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX: upper border (only for an internal evaluation)
617 */
618enum rkisp1_cif_isp_dpf_gain_usage {
619 RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED,
620 RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS,
621 RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS,
622 RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS,
623 RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS,
624 RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS,
625 RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX
626};
627
628/**
629 * enum rkisp1_cif_isp_dpf_rb_filtersize - Red and blue filter sizes
630 * @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9: red and blue filter kernel size 13x9
631 * (means 7x5 active pixel)
632 * @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9: red and blue filter kernel size 9x9
633 * (means 5x5 active pixel)
634 */
635enum rkisp1_cif_isp_dpf_rb_filtersize {
636 RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9,
637 RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9,
638};
639
640/**
641 * enum rkisp1_cif_isp_dpf_nll_scale_mode - dpf noise level scale mode
642 * @RKISP1_CIF_ISP_NLL_SCALE_LINEAR: use a linear scaling
643 * @RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC: use a logarithmic scaling
644 */
645enum rkisp1_cif_isp_dpf_nll_scale_mode {
646 RKISP1_CIF_ISP_NLL_SCALE_LINEAR,
647 RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC,
648};
649
650/**
651 * struct rkisp1_cif_isp_dpf_nll - Noise level lookup
652 *
653 * @coeff: Noise level Lookup coefficient
654 * @scale_mode: dpf noise level scale mode (from enum rkisp1_cif_isp_dpf_nll_scale_mode)
655 */
656struct rkisp1_cif_isp_dpf_nll {
657 __u16 coeff[RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS];
658 __u32 scale_mode;
659};
660
661/**
662 * struct rkisp1_cif_isp_dpf_rb_flt - Red blue filter config
663 *
664 * @fltsize: The filter size for the red and blue pixels
665 * (from enum rkisp1_cif_isp_dpf_rb_filtersize)
666 * @spatial_coeff: Spatial weights
667 * @r_enable: enable filter processing for red pixels
668 * @b_enable: enable filter processing for blue pixels
669 */
670struct rkisp1_cif_isp_dpf_rb_flt {
671 __u32 fltsize;
672 __u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];
673 __u8 r_enable;
674 __u8 b_enable;
675};
676
677/**
678 * struct rkisp1_cif_isp_dpf_g_flt - Green filter Configuration
679 *
680 * @spatial_coeff: Spatial weights
681 * @gr_enable: enable filter processing for green pixels in green/red lines
682 * @gb_enable: enable filter processing for green pixels in green/blue lines
683 */
684struct rkisp1_cif_isp_dpf_g_flt {
685 __u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];
686 __u8 gr_enable;
687 __u8 gb_enable;
688};
689
690/**
691 * struct rkisp1_cif_isp_dpf_gain - Noise function Configuration
692 *
693 * @mode: dpf gain usage (from enum rkisp1_cif_isp_dpf_gain_usage)
694 * @nf_r_gain: Noise function Gain that replaces the AWB gain for red pixels
695 * @nf_b_gain: Noise function Gain that replaces the AWB gain for blue pixels
696 * @nf_gr_gain: Noise function Gain that replaces the AWB gain
697 * for green pixels in a red line
698 * @nf_gb_gain: Noise function Gain that replaces the AWB gain
699 * for green pixels in a blue line
700 */
701struct rkisp1_cif_isp_dpf_gain {
702 __u32 mode;
703 __u16 nf_r_gain;
704 __u16 nf_b_gain;
705 __u16 nf_gr_gain;
706 __u16 nf_gb_gain;
707};
708
709/**
710 * struct rkisp1_cif_isp_dpf_config - Configuration used by De-noising pre-filter
711 *
712 * @gain: noise function gain
713 * @g_flt: green filter config
714 * @rb_flt: red blue filter config
715 * @nll: noise level lookup
716 */
717struct rkisp1_cif_isp_dpf_config {
718 struct rkisp1_cif_isp_dpf_gain gain;
719 struct rkisp1_cif_isp_dpf_g_flt g_flt;
720 struct rkisp1_cif_isp_dpf_rb_flt rb_flt;
721 struct rkisp1_cif_isp_dpf_nll nll;
722};
723
724/**
725 * struct rkisp1_cif_isp_dpf_strength_config - strength of the filter
726 *
727 * @r: filter strength of the RED filter
728 * @g: filter strength of the GREEN filter
729 * @b: filter strength of the BLUE filter
730 */
731struct rkisp1_cif_isp_dpf_strength_config {
732 __u8 r;
733 __u8 g;
734 __u8 b;
735};
736
737/**
738 * struct rkisp1_cif_isp_isp_other_cfg - Parameters for some blocks in rockchip isp1
739 *
740 * @dpcc_config: Defect Pixel Cluster Correction config
741 * @bls_config: Black Level Subtraction config
742 * @sdg_config: sensor degamma config
743 * @lsc_config: Lens Shade config
744 * @awb_gain_config: Auto White balance gain config
745 * @flt_config: filter config
746 * @bdm_config: demosaic config
747 * @ctk_config: cross talk config
748 * @goc_config: gamma out config
749 * @bls_config: black level subtraction config
750 * @dpf_config: De-noising pre-filter config
751 * @dpf_strength_config: dpf strength config
752 * @cproc_config: color process config
753 * @ie_config: image effects config
754 */
755struct rkisp1_cif_isp_isp_other_cfg {
756 struct rkisp1_cif_isp_dpcc_config dpcc_config;
757 struct rkisp1_cif_isp_bls_config bls_config;
758 struct rkisp1_cif_isp_sdg_config sdg_config;
759 struct rkisp1_cif_isp_lsc_config lsc_config;
760 struct rkisp1_cif_isp_awb_gain_config awb_gain_config;
761 struct rkisp1_cif_isp_flt_config flt_config;
762 struct rkisp1_cif_isp_bdm_config bdm_config;
763 struct rkisp1_cif_isp_ctk_config ctk_config;
764 struct rkisp1_cif_isp_goc_config goc_config;
765 struct rkisp1_cif_isp_dpf_config dpf_config;
766 struct rkisp1_cif_isp_dpf_strength_config dpf_strength_config;
767 struct rkisp1_cif_isp_cproc_config cproc_config;
768 struct rkisp1_cif_isp_ie_config ie_config;
769};
770
771/**
772 * struct rkisp1_cif_isp_isp_meas_cfg - Rockchip ISP1 Measure Parameters
773 *
774 * @awb_meas_config: auto white balance config
775 * @hst_config: histogram config
776 * @aec_config: auto exposure config
777 * @afc_config: auto focus config
778 */
779struct rkisp1_cif_isp_isp_meas_cfg {
780 struct rkisp1_cif_isp_awb_meas_config awb_meas_config;
781 struct rkisp1_cif_isp_hst_config hst_config;
782 struct rkisp1_cif_isp_aec_config aec_config;
783 struct rkisp1_cif_isp_afc_config afc_config;
784};
785
786/**
787 * struct rkisp1_params_cfg - Rockchip ISP1 Input Parameters Meta Data
788 *
789 * @module_en_update: mask the enable bits of which module should be updated
790 * @module_ens: mask the enable value of each module, only update the module
791 * which correspond bit was set in module_en_update
792 * @module_cfg_update: mask the config bits of which module should be updated
793 * @meas: measurement config
794 * @others: other config
795 */
796struct rkisp1_params_cfg {
797 __u32 module_en_update;
798 __u32 module_ens;
799 __u32 module_cfg_update;
800
801 struct rkisp1_cif_isp_isp_meas_cfg meas;
802 struct rkisp1_cif_isp_isp_other_cfg others;
803};
804
805/*---------- PART2: Measurement Statistics ------------*/
806
807/**
808 * struct rkisp1_cif_isp_awb_meas - AWB measured values
809 *
810 * @cnt: White pixel count, number of "white pixels" found during last
811 * measurement
812 * @mean_y_or_g: Mean value of Y within window and frames,
813 * Green if RGB is selected.
814 * @mean_cb_or_b: Mean value of Cb within window and frames,
815 * Blue if RGB is selected.
816 * @mean_cr_or_r: Mean value of Cr within window and frames,
817 * Red if RGB is selected.
818 */
819struct rkisp1_cif_isp_awb_meas {
820 __u32 cnt;
821 __u8 mean_y_or_g;
822 __u8 mean_cb_or_b;
823 __u8 mean_cr_or_r;
824};
825
826/**
827 * struct rkisp1_cif_isp_awb_stat - statistics automatic white balance data
828 *
829 * @awb_mean: Mean measured data
830 */
831struct rkisp1_cif_isp_awb_stat {
832 struct rkisp1_cif_isp_awb_meas awb_mean[RKISP1_CIF_ISP_AWB_MAX_GRID];
833};
834
835/**
836 * struct rkisp1_cif_isp_bls_meas_val - BLS measured values
837 *
838 * @meas_r: Mean measured value for Bayer pattern R
839 * @meas_gr: Mean measured value for Bayer pattern Gr
840 * @meas_gb: Mean measured value for Bayer pattern Gb
841 * @meas_b: Mean measured value for Bayer pattern B
842 */
843struct rkisp1_cif_isp_bls_meas_val {
844 __u16 meas_r;
845 __u16 meas_gr;
846 __u16 meas_gb;
847 __u16 meas_b;
848};
849
850/**
851 * struct rkisp1_cif_isp_ae_stat - statistics auto exposure data
852 *
853 * @exp_mean: Mean luminance value of block xx
854 * @bls_val: BLS measured values
855 *
856 * The number of entries of @exp_mean depends on the hardware revision
857 * as is reported by the hw_revision field of the struct media_device_info
858 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
859 *
860 * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,
861 * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.
862 * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.
863 *
864 * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.
865 */
866struct rkisp1_cif_isp_ae_stat {
867 __u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX];
868 struct rkisp1_cif_isp_bls_meas_val bls_val;
869};
870
871/**
872 * struct rkisp1_cif_isp_af_meas_val - AF measured values
873 *
874 * @sum: sharpness value
875 * @lum: luminance value
876 */
877struct rkisp1_cif_isp_af_meas_val {
878 __u32 sum;
879 __u32 lum;
880};
881
882/**
883 * struct rkisp1_cif_isp_af_stat - statistics auto focus data
884 *
885 * @window: AF measured value of window x
886 *
887 * The module measures the sharpness in 3 windows of selectable size via
888 * register settings(ISP_AFM_*_A/B/C)
889 */
890struct rkisp1_cif_isp_af_stat {
891 struct rkisp1_cif_isp_af_meas_val window[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];
892};
893
894/**
895 * struct rkisp1_cif_isp_hist_stat - statistics histogram data
896 *
897 * @hist_bins: measured bin counters. Each bin is a 20 bits unsigned fixed point
898 * type. Bits 0-4 are the fractional part and bits 5-19 are the
899 * integer part.
900 *
901 * The window of the measurements area is divided to 5x5 sub-windows for
902 * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for
903 * each sub-window independently and the final result is a weighted average of
904 * the histogram measurements on all sub-windows. The window of the
905 * measurements area and the weight of each sub-window are configurable using
906 * struct @rkisp1_cif_isp_hst_config.
907 *
908 * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.
909 *
910 * The number of entries of @hist_bins depends on the hardware revision
911 * as is reported by the hw_revision field of the struct media_device_info
912 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
913 *
914 * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,
915 * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.
916 * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.
917 */
918struct rkisp1_cif_isp_hist_stat {
919 __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];
920};
921
922/**
923 * struct rkisp1_cif_isp_stat - Rockchip ISP1 Statistics Data
924 *
925 * @awb: statistics data for automatic white balance
926 * @ae: statistics data for auto exposure
927 * @af: statistics data for auto focus
928 * @hist: statistics histogram data
929 */
930struct rkisp1_cif_isp_stat {
931 struct rkisp1_cif_isp_awb_stat awb;
932 struct rkisp1_cif_isp_ae_stat ae;
933 struct rkisp1_cif_isp_af_stat af;
934 struct rkisp1_cif_isp_hist_stat hist;
935};
936
937/**
938 * struct rkisp1_stat_buffer - Rockchip ISP1 Statistics Meta Data
939 *
940 * @meas_type: measurement types (RKISP1_CIF_ISP_STAT_* definitions)
941 * @frame_id: frame ID for sync
942 * @params: statistics data
943 */
944struct rkisp1_stat_buffer {
945 __u32 meas_type;
946 __u32 frame_id;
947 struct rkisp1_cif_isp_stat params;
948};
949
950#endif /* _RKISP1_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rpl.h created+48
...@@ -0,0 +1,48 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * IPv6 RPL-SR implementation
4 *
5 * Author:
6 * (C) 2020 Alexander Aring <alex.aring@gmail.com>
7 */
8
9#ifndef _LINUX_RPL_H
10#define _LINUX_RPL_H
11
12#include <asm/byteorder.h>
13#include <linux/types.h>
14#include <linux/in6.h>
15
16/*
17 * RPL SR Header
18 */
19struct ipv6_rpl_sr_hdr {
20 __u8 nexthdr;
21 __u8 hdrlen;
22 __u8 type;
23 __u8 segments_left;
24#if defined(__LITTLE_ENDIAN_BITFIELD)
25 __u32 cmpre:4,
26 cmpri:4,
27 reserved:4,
28 pad:4,
29 reserved1:16;
30#elif defined(__BIG_ENDIAN_BITFIELD)
31 __u32 cmpri:4,
32 cmpre:4,
33 pad:4,
34 reserved:20;
35#else
36#error "Please fix <asm/byteorder.h>"
37#endif
38
39 union {
40 struct in6_addr addr[0];
41 __u8 data[0];
42 } segments;
43} __attribute__((packed));
44
45#define rpl_segaddr segments.addr
46#define rpl_segdata segments.data
47
48#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rpl_iptunnel.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * IPv6 RPL-SR implementation
4 *
5 * Author:
6 * (C) 2020 Alexander Aring <alex.aring@gmail.com>
7 */
8
9#ifndef _LINUX_RPL_IPTUNNEL_H
10#define _LINUX_RPL_IPTUNNEL_H
11
12enum {
13 RPL_IPTUNNEL_UNSPEC,
14 RPL_IPTUNNEL_SRH,
15 __RPL_IPTUNNEL_MAX,
16};
17#define RPL_IPTUNNEL_MAX (__RPL_IPTUNNEL_MAX - 1)
18
19#define RPL_IPTUNNEL_SRH_SIZE(srh) (((srh)->hdrlen + 1) << 3)
20
21#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rpmsg.h+11-2
...@@ -9,11 +9,13 @@...@@ -9,11 +9,13 @@
9#include <linux/ioctl.h>9#include <linux/ioctl.h>
10#include <linux/types.h>10#include <linux/types.h>
1111
12#define RPMSG_ADDR_ANY 0xFFFFFFFF
13
12/**14/**
13 * struct rpmsg_endpoint_info - endpoint info representation15 * struct rpmsg_endpoint_info - endpoint info representation
14 * @name: name of service16 * @name: name of service
15 * @src: local address17 * @src: local address. To set to RPMSG_ADDR_ANY if not used.
16 * @dst: destination address18 * @dst: destination address. To set to RPMSG_ADDR_ANY if not used.
17 */19 */
18struct rpmsg_endpoint_info {20struct rpmsg_endpoint_info {
19 char name[32];21 char name[32];
...@@ -21,7 +23,14 @@ struct rpmsg_endpoint_info {...@@ -21,7 +23,14 @@ struct rpmsg_endpoint_info {
21 __u32 dst;23 __u32 dst;
22};24};
2325
26/**
27 * Instantiate a new rmpsg char device endpoint.
28 */
24#define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x1, struct rpmsg_endpoint_info)29#define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x1, struct rpmsg_endpoint_info)
30
31/**
32 * Destroy a rpmsg char device endpoint created by the RPMSG_CREATE_EPT_IOCTL.
33 */
25#define RPMSG_DESTROY_EPT_IOCTL _IO(0xb5, 0x2)34#define RPMSG_DESTROY_EPT_IOCTL _IO(0xb5, 0x2)
2635
27#endif36#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rpmsg_types.h created+11
...@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_RPMSG_TYPES_H
3#define _LINUX_RPMSG_TYPES_H
4
5#include <linux/types.h>
6
7typedef __u16 __bitwise __rpmsg16;
8typedef __u32 __bitwise __rpmsg32;
9typedef __u64 __bitwise __rpmsg64;
10
11#endif /* _LINUX_RPMSG_TYPES_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rtc.h+44-1
...@@ -12,6 +12,10 @@...@@ -12,6 +12,10 @@
12#ifndef _LINUX_RTC_H_12#ifndef _LINUX_RTC_H_
13#define _LINUX_RTC_H_13#define _LINUX_RTC_H_
1414
15#include <linux/const.h>
16#include <linux/ioctl.h>
17#include <linux/types.h>
18
15/*19/*
16 * The struct used to pass data via the following ioctl. Similar to the20 * The struct used to pass data via the following ioctl. Similar to the
17 * struct tm in <time.h>, but it needs to be here so that the kernel21 * struct tm in <time.h>, but it needs to be here so that the kernel
...@@ -63,6 +67,17 @@ struct rtc_pll_info {...@@ -63,6 +67,17 @@ struct rtc_pll_info {
63 long pll_clock; /* base PLL frequency */67 long pll_clock; /* base PLL frequency */
64};68};
6569
70struct rtc_param {
71 __u64 param;
72 union {
73 __u64 uvalue;
74 __s64 svalue;
75 __u64 ptr;
76 };
77 __u32 index;
78 __u32 __pad;
79};
80
66/*81/*
67 * ioctl calls that are permitted to the /dev/rtc interface, if82 * ioctl calls that are permitted to the /dev/rtc interface, if
68 * any of the RTC drivers are enabled.83 * any of the RTC drivers are enabled.
...@@ -92,7 +107,16 @@ struct rtc_pll_info {...@@ -92,7 +107,16 @@ struct rtc_pll_info {
92#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */107#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
93#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */108#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
94109
95#define RTC_VL_READ _IOR('p', 0x13, int) /* Voltage low detector */110#define RTC_PARAM_GET _IOW('p', 0x13, struct rtc_param) /* Get parameter */
111#define RTC_PARAM_SET _IOW('p', 0x14, struct rtc_param) /* Set parameter */
112
113#define RTC_VL_DATA_INVALID _BITUL(0) /* Voltage too low, RTC data is invalid */
114#define RTC_VL_BACKUP_LOW _BITUL(1) /* Backup voltage is low */
115#define RTC_VL_BACKUP_EMPTY _BITUL(2) /* Backup empty or not present */
116#define RTC_VL_ACCURACY_LOW _BITUL(3) /* Voltage is low, RTC accuracy is reduced */
117#define RTC_VL_BACKUP_SWITCH _BITUL(4) /* Backup switchover happened */
118
119#define RTC_VL_READ _IOR('p', 0x13, unsigned int) /* Voltage low detection */
96#define RTC_VL_CLR _IO('p', 0x14) /* Clear voltage low information */120#define RTC_VL_CLR _IO('p', 0x14) /* Clear voltage low information */
97121
98/* interrupt flags */122/* interrupt flags */
...@@ -101,6 +125,25 @@ struct rtc_pll_info {...@@ -101,6 +125,25 @@ struct rtc_pll_info {
101#define RTC_AF 0x20 /* Alarm interrupt */125#define RTC_AF 0x20 /* Alarm interrupt */
102#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */126#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
103127
128/* feature list */
129#define RTC_FEATURE_ALARM 0
130#define RTC_FEATURE_ALARM_RES_MINUTE 1
131#define RTC_FEATURE_NEED_WEEK_DAY 2
132#define RTC_FEATURE_ALARM_RES_2S 3
133#define RTC_FEATURE_UPDATE_INTERRUPT 4
134#define RTC_FEATURE_CORRECTION 5
135#define RTC_FEATURE_BACKUP_SWITCH_MODE 6
136#define RTC_FEATURE_CNT 7
137
138/* parameter list */
139#define RTC_PARAM_FEATURES 0
140#define RTC_PARAM_CORRECTION 1
141#define RTC_PARAM_BACKUP_SWITCH_MODE 2
142
143#define RTC_BSM_DISABLED 0
144#define RTC_BSM_DIRECT 1
145#define RTC_BSM_LEVEL 2
146#define RTC_BSM_STANDBY 3
104147
105#define RTC_MAX_FREQ 8192148#define RTC_MAX_FREQ 8192
106149
lib/libc/include/any-linux-any/linux/rtnetlink.h+86-27
...@@ -157,6 +157,34 @@ enum {...@@ -157,6 +157,34 @@ enum {
157 RTM_GETCHAIN,157 RTM_GETCHAIN,
158#define RTM_GETCHAIN RTM_GETCHAIN158#define RTM_GETCHAIN RTM_GETCHAIN
159159
160 RTM_NEWNEXTHOP = 104,
161#define RTM_NEWNEXTHOP RTM_NEWNEXTHOP
162 RTM_DELNEXTHOP,
163#define RTM_DELNEXTHOP RTM_DELNEXTHOP
164 RTM_GETNEXTHOP,
165#define RTM_GETNEXTHOP RTM_GETNEXTHOP
166
167 RTM_NEWLINKPROP = 108,
168#define RTM_NEWLINKPROP RTM_NEWLINKPROP
169 RTM_DELLINKPROP,
170#define RTM_DELLINKPROP RTM_DELLINKPROP
171 RTM_GETLINKPROP,
172#define RTM_GETLINKPROP RTM_GETLINKPROP
173
174 RTM_NEWVLAN = 112,
175#define RTM_NEWNVLAN RTM_NEWVLAN
176 RTM_DELVLAN,
177#define RTM_DELVLAN RTM_DELVLAN
178 RTM_GETVLAN,
179#define RTM_GETVLAN RTM_GETVLAN
180
181 RTM_NEWNEXTHOPBUCKET = 116,
182#define RTM_NEWNEXTHOPBUCKET RTM_NEWNEXTHOPBUCKET
183 RTM_DELNEXTHOPBUCKET,
184#define RTM_DELNEXTHOPBUCKET RTM_DELNEXTHOPBUCKET
185 RTM_GETNEXTHOPBUCKET,
186#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET
187
160 __RTM_MAX,188 __RTM_MAX,
161#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)189#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
162};190};
...@@ -236,12 +264,12 @@ enum {...@@ -236,12 +264,12 @@ enum {
236264
237/* rtm_protocol */265/* rtm_protocol */
238266
239#define RTPROT_UNSPEC 0267#define RTPROT_UNSPEC 0
240#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;268#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
241 not used by current IPv4 */269 not used by current IPv4 */
242#define RTPROT_KERNEL 2 /* Route installed by kernel */270#define RTPROT_KERNEL 2 /* Route installed by kernel */
243#define RTPROT_BOOT 3 /* Route installed during boot */271#define RTPROT_BOOT 3 /* Route installed during boot */
244#define RTPROT_STATIC 4 /* Route installed by administrator */272#define RTPROT_STATIC 4 /* Route installed by administrator */
245273
246/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;274/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
247 they are just passed from user and back as is.275 they are just passed from user and back as is.
...@@ -250,22 +278,24 @@ enum {...@@ -250,22 +278,24 @@ enum {
250 avoid conflicts.278 avoid conflicts.
251 */279 */
252280
253#define RTPROT_GATED 8 /* Apparently, GateD */281#define RTPROT_GATED 8 /* Apparently, GateD */
254#define RTPROT_RA 9 /* RDISC/ND router advertisements */282#define RTPROT_RA 9 /* RDISC/ND router advertisements */
255#define RTPROT_MRT 10 /* Merit MRT */283#define RTPROT_MRT 10 /* Merit MRT */
256#define RTPROT_ZEBRA 11 /* Zebra */284#define RTPROT_ZEBRA 11 /* Zebra */
257#define RTPROT_BIRD 12 /* BIRD */285#define RTPROT_BIRD 12 /* BIRD */
258#define RTPROT_DNROUTED 13 /* DECnet routing daemon */286#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
259#define RTPROT_XORP 14 /* XORP */287#define RTPROT_XORP 14 /* XORP */
260#define RTPROT_NTK 15 /* Netsukuku */288#define RTPROT_NTK 15 /* Netsukuku */
261#define RTPROT_DHCP 16 /* DHCP client */289#define RTPROT_DHCP 16 /* DHCP client */
262#define RTPROT_MROUTED 17 /* Multicast daemon */290#define RTPROT_MROUTED 17 /* Multicast daemon */
263#define RTPROT_BABEL 42 /* Babel daemon */291#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
264#define RTPROT_BGP 186 /* BGP Routes */292#define RTPROT_BABEL 42 /* Babel daemon */
265#define RTPROT_ISIS 187 /* ISIS Routes */293#define RTPROT_OPENR 99 /* Open Routing (Open/R) Routes */
266#define RTPROT_OSPF 188 /* OSPF Routes */294#define RTPROT_BGP 186 /* BGP Routes */
267#define RTPROT_RIP 189 /* RIP Routes */295#define RTPROT_ISIS 187 /* ISIS Routes */
268#define RTPROT_EIGRP 192 /* EIGRP Routes */296#define RTPROT_OSPF 188 /* OSPF Routes */
297#define RTPROT_RIP 189 /* RIP Routes */
298#define RTPROT_EIGRP 192 /* EIGRP Routes */
269299
270/* rtm_scope300/* rtm_scope
271301
...@@ -295,6 +325,13 @@ enum rt_scope_t {...@@ -295,6 +325,13 @@ enum rt_scope_t {
295#define RTM_F_PREFIX 0x800 /* Prefix addresses */325#define RTM_F_PREFIX 0x800 /* Prefix addresses */
296#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */326#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
297#define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */327#define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */
328#define RTM_F_OFFLOAD 0x4000 /* route is offloaded */
329#define RTM_F_TRAP 0x8000 /* route is trapping packets */
330#define RTM_F_OFFLOAD_FAILED 0x20000000 /* route offload failed, this value
331 * is chosen to avoid conflicts with
332 * other flags defined in
333 * include/uapi/linux/ipv6_route.h
334 */
298335
299/* Reserved table identifiers */336/* Reserved table identifiers */
300337
...@@ -342,6 +379,7 @@ enum rtattr_type_t {...@@ -342,6 +379,7 @@ enum rtattr_type_t {
342 RTA_IP_PROTO,379 RTA_IP_PROTO,
343 RTA_SPORT,380 RTA_SPORT,
344 RTA_DPORT,381 RTA_DPORT,
382 RTA_NH_ID,
345 __RTA_MAX383 __RTA_MAX
346};384};
347385
...@@ -371,11 +409,13 @@ struct rtnexthop {...@@ -371,11 +409,13 @@ struct rtnexthop {
371#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */409#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
372#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */410#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
373#define RTNH_F_ONLINK 4 /* Gateway is forced on link */411#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
374#define RTNH_F_OFFLOAD 8 /* offloaded route */412#define RTNH_F_OFFLOAD 8 /* Nexthop is offloaded */
375#define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */413#define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */
376#define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */414#define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */
415#define RTNH_F_TRAP 64 /* Nexthop is trapping packets */
377416
378#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)417#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | \
418 RTNH_F_OFFLOAD | RTNH_F_TRAP)
379419
380/* Macros to handle hexthops */420/* Macros to handle hexthops */
381421
...@@ -585,11 +625,17 @@ enum {...@@ -585,11 +625,17 @@ enum {
585 TCA_HW_OFFLOAD,625 TCA_HW_OFFLOAD,
586 TCA_INGRESS_BLOCK,626 TCA_INGRESS_BLOCK,
587 TCA_EGRESS_BLOCK,627 TCA_EGRESS_BLOCK,
628 TCA_DUMP_FLAGS,
588 __TCA_MAX629 __TCA_MAX
589};630};
590631
591#define TCA_MAX (__TCA_MAX - 1)632#define TCA_MAX (__TCA_MAX - 1)
592633
634#define TCA_DUMP_FLAGS_TERSE (1 << 0) /* Means that in dump user gets only basic
635 * data necessary to identify the objects
636 * (handle, cookie, etc.) and stats.
637 */
638
593#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))639#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
594#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))640#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
595641
...@@ -702,6 +748,10 @@ enum rtnetlink_groups {...@@ -702,6 +748,10 @@ enum rtnetlink_groups {
702#define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R748#define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R
703 RTNLGRP_IPV6_MROUTE_R,749 RTNLGRP_IPV6_MROUTE_R,
704#define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R750#define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R
751 RTNLGRP_NEXTHOP,
752#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
753 RTNLGRP_BRVLAN,
754#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
705 __RTNLGRP_MAX755 __RTNLGRP_MAX
706};756};
707#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)757#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
...@@ -729,18 +779,27 @@ enum {...@@ -729,18 +779,27 @@ enum {
729#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))779#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
730/* tcamsg flags stored in attribute TCA_ROOT_FLAGS780/* tcamsg flags stored in attribute TCA_ROOT_FLAGS
731 *781 *
732 * TCA_FLAG_LARGE_DUMP_ON user->kernel to request for larger than TCA_ACT_MAX_PRIO782 * TCA_ACT_FLAG_LARGE_DUMP_ON user->kernel to request for larger than
733 * actions in a dump. All dump responses will contain the number of actions783 * TCA_ACT_MAX_PRIO actions in a dump. All dump responses will contain the
734 * being dumped stored in for user app's consumption in TCA_ROOT_COUNT784 * number of actions being dumped stored in for user app's consumption in
785 * TCA_ROOT_COUNT
786 *
787 * TCA_ACT_FLAG_TERSE_DUMP user->kernel to request terse (brief) dump that only
788 * includes essential action info (kind, index, etc.)
735 *789 *
736 */790 */
737#define TCA_FLAG_LARGE_DUMP_ON (1 << 0)791#define TCA_FLAG_LARGE_DUMP_ON (1 << 0)
792#define TCA_ACT_FLAG_LARGE_DUMP_ON TCA_FLAG_LARGE_DUMP_ON
793#define TCA_ACT_FLAG_TERSE_DUMP (1 << 1)
738794
739/* New extended info filters for IFLA_EXT_MASK */795/* New extended info filters for IFLA_EXT_MASK */
740#define RTEXT_FILTER_VF (1 << 0)796#define RTEXT_FILTER_VF (1 << 0)
741#define RTEXT_FILTER_BRVLAN (1 << 1)797#define RTEXT_FILTER_BRVLAN (1 << 1)
742#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)798#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
743#define RTEXT_FILTER_SKIP_STATS (1 << 3)799#define RTEXT_FILTER_SKIP_STATS (1 << 3)
800#define RTEXT_FILTER_MRP (1 << 4)
801#define RTEXT_FILTER_CFM_CONFIG (1 << 5)
802#define RTEXT_FILTER_CFM_STATUS (1 << 6)
744803
745/* End of information exported to user level */804/* End of information exported to user level */
746805
lib/libc/include/any-linux-any/linux/rxrpc.h+2-6
...@@ -1,12 +1,8 @@...@@ -1,12 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
1/* Types and definitions for AF_RXRPC.2/* Types and definitions for AF_RXRPC.
2 *3 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.4 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */6 */
117
12#ifndef _LINUX_RXRPC_H8#ifndef _LINUX_RXRPC_H
...@@ -55,11 +51,11 @@ enum rxrpc_cmsg_type {...@@ -55,11 +51,11 @@ enum rxrpc_cmsg_type {
55 RXRPC_BUSY = 6, /* -r: server busy received [terminal] */51 RXRPC_BUSY = 6, /* -r: server busy received [terminal] */
56 RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */52 RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */
57 RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */53 RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */
58 RXRPC_ACCEPT = 9, /* s-: [Service] accept request */
59 RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */54 RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */
60 RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */55 RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */
61 RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */56 RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */
62 RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */57 RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */
58 RXRPC_CHARGE_ACCEPT = 14, /* s-: Charge the accept pool with a user call ID */
63 RXRPC__SUPPORTED59 RXRPC__SUPPORTED
64};60};
6561
lib/libc/include/any-linux-any/linux/scc.h+1
...@@ -4,6 +4,7 @@...@@ -4,6 +4,7 @@
4#ifndef _SCC_H4#ifndef _SCC_H
5#define _SCC_H5#define _SCC_H
66
7#include <linux/sockios.h>
78
8/* selection of hardware types */9/* selection of hardware types */
910
lib/libc/include/any-linux-any/linux/sched.h+91-1
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef _LINUX_SCHED_H2#ifndef _LINUX_SCHED_H
3#define _LINUX_SCHED_H3#define _LINUX_SCHED_H
44
5#include <linux/types.h>
6
5/*7/*
6 * cloning flags:8 * cloning flags:
7 */9 */
...@@ -10,6 +12,7 @@...@@ -10,6 +12,7 @@
10#define CLONE_FS 0x00000200 /* set if fs info shared between processes */12#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
11#define CLONE_FILES 0x00000400 /* set if open files shared between processes */13#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
12#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */14#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
15#define CLONE_PIDFD 0x00001000 /* set if a pidfd should be placed in parent */
13#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */16#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
14#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */17#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
15#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */18#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
...@@ -30,6 +33,81 @@...@@ -30,6 +33,81 @@
30#define CLONE_NEWNET 0x40000000 /* New network namespace */33#define CLONE_NEWNET 0x40000000 /* New network namespace */
31#define CLONE_IO 0x80000000 /* Clone io context */34#define CLONE_IO 0x80000000 /* Clone io context */
3235
36/* Flags for the clone3() syscall. */
37#define CLONE_CLEAR_SIGHAND 0x100000000ULL /* Clear any signal handler and reset to SIG_DFL. */
38#define CLONE_INTO_CGROUP 0x200000000ULL /* Clone into a specific cgroup given the right permissions. */
39
40/*
41 * cloning flags intersect with CSIGNAL so can be used with unshare and clone3
42 * syscalls only:
43 */
44#define CLONE_NEWTIME 0x00000080 /* New time namespace */
45
46#ifndef __ASSEMBLY__
47/**
48 * struct clone_args - arguments for the clone3 syscall
49 * @flags: Flags for the new process as listed above.
50 * All flags are valid except for CSIGNAL and
51 * CLONE_DETACHED.
52 * @pidfd: If CLONE_PIDFD is set, a pidfd will be
53 * returned in this argument.
54 * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the
55 * child process will be returned in the child's
56 * memory.
57 * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of
58 * the child process will be returned in the
59 * parent's memory.
60 * @exit_signal: The exit_signal the parent process will be
61 * sent when the child exits.
62 * @stack: Specify the location of the stack for the
63 * child process.
64 * Note, @stack is expected to point to the
65 * lowest address. The stack direction will be
66 * determined by the kernel and set up
67 * appropriately based on @stack_size.
68 * @stack_size: The size of the stack for the child process.
69 * @tls: If CLONE_SETTLS is set, the tls descriptor
70 * is set to tls.
71 * @set_tid: Pointer to an array of type *pid_t. The size
72 * of the array is defined using @set_tid_size.
73 * This array is used to select PIDs/TIDs for
74 * newly created processes. The first element in
75 * this defines the PID in the most nested PID
76 * namespace. Each additional element in the array
77 * defines the PID in the parent PID namespace of
78 * the original PID namespace. If the array has
79 * less entries than the number of currently
80 * nested PID namespaces only the PIDs in the
81 * corresponding namespaces are set.
82 * @set_tid_size: This defines the size of the array referenced
83 * in @set_tid. This cannot be larger than the
84 * kernel's limit of nested PID namespaces.
85 * @cgroup: If CLONE_INTO_CGROUP is specified set this to
86 * a file descriptor for the cgroup.
87 *
88 * The structure is versioned by size and thus extensible.
89 * New struct members must go at the end of the struct and
90 * must be properly 64bit aligned.
91 */
92struct clone_args {
93 __aligned_u64 flags;
94 __aligned_u64 pidfd;
95 __aligned_u64 child_tid;
96 __aligned_u64 parent_tid;
97 __aligned_u64 exit_signal;
98 __aligned_u64 stack;
99 __aligned_u64 stack_size;
100 __aligned_u64 tls;
101 __aligned_u64 set_tid;
102 __aligned_u64 set_tid_size;
103 __aligned_u64 cgroup;
104};
105#endif
106
107#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */
108#define CLONE_ARGS_SIZE_VER1 80 /* sizeof second published struct */
109#define CLONE_ARGS_SIZE_VER2 88 /* sizeof third published struct */
110
33/*111/*
34 * Scheduling policies112 * Scheduling policies
35 */113 */
...@@ -50,9 +128,21 @@...@@ -50,9 +128,21 @@
50#define SCHED_FLAG_RESET_ON_FORK 0x01128#define SCHED_FLAG_RESET_ON_FORK 0x01
51#define SCHED_FLAG_RECLAIM 0x02129#define SCHED_FLAG_RECLAIM 0x02
52#define SCHED_FLAG_DL_OVERRUN 0x04130#define SCHED_FLAG_DL_OVERRUN 0x04
131#define SCHED_FLAG_KEEP_POLICY 0x08
132#define SCHED_FLAG_KEEP_PARAMS 0x10
133#define SCHED_FLAG_UTIL_CLAMP_MIN 0x20
134#define SCHED_FLAG_UTIL_CLAMP_MAX 0x40
135
136#define SCHED_FLAG_KEEP_ALL (SCHED_FLAG_KEEP_POLICY | \
137 SCHED_FLAG_KEEP_PARAMS)
138
139#define SCHED_FLAG_UTIL_CLAMP (SCHED_FLAG_UTIL_CLAMP_MIN | \
140 SCHED_FLAG_UTIL_CLAMP_MAX)
53141
54#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \142#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \
55 SCHED_FLAG_RECLAIM | \143 SCHED_FLAG_RECLAIM | \
56 SCHED_FLAG_DL_OVERRUN)144 SCHED_FLAG_DL_OVERRUN | \
145 SCHED_FLAG_KEEP_ALL | \
146 SCHED_FLAG_UTIL_CLAMP)
57147
58#endif /* _LINUX_SCHED_H */148#endif /* _LINUX_SCHED_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sched/types.h+59-9
...@@ -9,6 +9,7 @@ struct sched_param {...@@ -9,6 +9,7 @@ struct sched_param {
9};9};
1010
11#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */11#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */
12#define SCHED_ATTR_SIZE_VER1 56 /* add: util_{min,max} */
1213
13/*14/*
14 * Extended scheduling parameters data structure.15 * Extended scheduling parameters data structure.
...@@ -21,8 +22,33 @@ struct sched_param {...@@ -21,8 +22,33 @@ struct sched_param {
21 * the tasks may be useful for a wide variety of application fields, e.g.,22 * the tasks may be useful for a wide variety of application fields, e.g.,
22 * multimedia, streaming, automation and control, and many others.23 * multimedia, streaming, automation and control, and many others.
23 *24 *
24 * This variant (sched_attr) is meant at describing a so-called25 * This variant (sched_attr) allows to define additional attributes to
25 * sporadic time-constrained task. In such model a task is specified by:26 * improve the scheduler knowledge about task requirements.
27 *
28 * Scheduling Class Attributes
29 * ===========================
30 *
31 * A subset of sched_attr attributes specifies the
32 * scheduling policy and relative POSIX attributes:
33 *
34 * @size size of the structure, for fwd/bwd compat.
35 *
36 * @sched_policy task's scheduling policy
37 * @sched_nice task's nice value (SCHED_NORMAL/BATCH)
38 * @sched_priority task's static priority (SCHED_FIFO/RR)
39 *
40 * Certain more advanced scheduling features can be controlled by a
41 * predefined set of flags via the attribute:
42 *
43 * @sched_flags for customizing the scheduler behaviour
44 *
45 * Sporadic Time-Constrained Task Attributes
46 * =========================================
47 *
48 * A subset of sched_attr attributes allows to describe a so-called
49 * sporadic time-constrained task.
50 *
51 * In such a model a task is specified by:
26 * - the activation period or minimum instance inter-arrival time;52 * - the activation period or minimum instance inter-arrival time;
27 * - the maximum (or average, depending on the actual scheduling53 * - the maximum (or average, depending on the actual scheduling
28 * discipline) computation time of all instances, a.k.a. runtime;54 * discipline) computation time of all instances, a.k.a. runtime;
...@@ -34,14 +60,8 @@ struct sched_param {...@@ -34,14 +60,8 @@ struct sched_param {
34 * than the runtime and must be completed by time instant t equal to60 * than the runtime and must be completed by time instant t equal to
35 * the instance activation time + the deadline.61 * the instance activation time + the deadline.
36 *62 *
37 * This is reflected by the actual fields of the sched_attr structure:63 * This is reflected by the following fields of the sched_attr structure:
38 *64 *
39 * @size size of the structure, for fwd/bwd compat.
40 *
41 * @sched_policy task's scheduling policy
42 * @sched_flags for customizing the scheduler behaviour
43 * @sched_nice task's nice value (SCHED_NORMAL/BATCH)
44 * @sched_priority task's static priority (SCHED_FIFO/RR)
45 * @sched_deadline representative of the task's deadline65 * @sched_deadline representative of the task's deadline
46 * @sched_runtime representative of the task's runtime66 * @sched_runtime representative of the task's runtime
47 * @sched_period representative of the task's period67 * @sched_period representative of the task's period
...@@ -53,6 +73,31 @@ struct sched_param {...@@ -53,6 +73,31 @@ struct sched_param {
53 * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the73 * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the
54 * only user of this new interface. More information about the algorithm74 * only user of this new interface. More information about the algorithm
55 * available in the scheduling class file or in Documentation/.75 * available in the scheduling class file or in Documentation/.
76 *
77 * Task Utilization Attributes
78 * ===========================
79 *
80 * A subset of sched_attr attributes allows to specify the utilization
81 * expected for a task. These attributes allow to inform the scheduler about
82 * the utilization boundaries within which it should schedule the task. These
83 * boundaries are valuable hints to support scheduler decisions on both task
84 * placement and frequency selection.
85 *
86 * @sched_util_min represents the minimum utilization
87 * @sched_util_max represents the maximum utilization
88 *
89 * Utilization is a value in the range [0..SCHED_CAPACITY_SCALE]. It
90 * represents the percentage of CPU time used by a task when running at the
91 * maximum frequency on the highest capacity CPU of the system. For example, a
92 * 20% utilization task is a task running for 2ms every 10ms at maximum
93 * frequency.
94 *
95 * A task with a min utilization value bigger than 0 is more likely scheduled
96 * on a CPU with a capacity big enough to fit the specified value.
97 * A task with a max utilization value smaller than 1024 is more likely
98 * scheduled on a CPU with no more capacity than the specified value.
99 *
100 * A task utilization boundary can be reset by setting the attribute to -1.
56 */101 */
57struct sched_attr {102struct sched_attr {
58 __u32 size;103 __u32 size;
...@@ -70,6 +115,11 @@ struct sched_attr {...@@ -70,6 +115,11 @@ struct sched_attr {
70 __u64 sched_runtime;115 __u64 sched_runtime;
71 __u64 sched_deadline;116 __u64 sched_deadline;
72 __u64 sched_period;117 __u64 sched_period;
118
119 /* Utilization hints */
120 __u32 sched_util_min;
121 __u32 sched_util_max;
122
73};123};
74124
75#endif /* _LINUX_SCHED_TYPES_H */125#endif /* _LINUX_SCHED_TYPES_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sctp.h+63-1
...@@ -59,6 +59,10 @@...@@ -59,6 +59,10 @@
5959
60typedef __s32 sctp_assoc_t;60typedef __s32 sctp_assoc_t;
6161
62#define SCTP_FUTURE_ASSOC 0
63#define SCTP_CURRENT_ASSOC 1
64#define SCTP_ALL_ASSOC 2
65
62/* The following symbols come from the Sockets API Extensions for66/* The following symbols come from the Sockets API Extensions for
63 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.67 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
64 */68 */
...@@ -101,6 +105,7 @@ typedef __s32 sctp_assoc_t;...@@ -101,6 +105,7 @@ typedef __s32 sctp_assoc_t;
101#define SCTP_DEFAULT_SNDINFO 34105#define SCTP_DEFAULT_SNDINFO 34
102#define SCTP_AUTH_DEACTIVATE_KEY 35106#define SCTP_AUTH_DEACTIVATE_KEY 35
103#define SCTP_REUSE_PORT 36107#define SCTP_REUSE_PORT 36
108#define SCTP_PEER_ADDR_THLDS_V2 37
104109
105/* Internal Socket Options. Some of the sctp library functions are110/* Internal Socket Options. Some of the sctp library functions are
106 * implemented using these socket options.111 * implemented using these socket options.
...@@ -129,6 +134,14 @@ typedef __s32 sctp_assoc_t;...@@ -129,6 +134,14 @@ typedef __s32 sctp_assoc_t;
129#define SCTP_STREAM_SCHEDULER_VALUE 124134#define SCTP_STREAM_SCHEDULER_VALUE 124
130#define SCTP_INTERLEAVING_SUPPORTED 125135#define SCTP_INTERLEAVING_SUPPORTED 125
131#define SCTP_SENDMSG_CONNECT 126136#define SCTP_SENDMSG_CONNECT 126
137#define SCTP_EVENT 127
138#define SCTP_ASCONF_SUPPORTED 128
139#define SCTP_AUTH_SUPPORTED 129
140#define SCTP_ECN_SUPPORTED 130
141#define SCTP_EXPOSE_POTENTIALLY_FAILED_STATE 131
142#define SCTP_EXPOSE_PF_STATE SCTP_EXPOSE_POTENTIALLY_FAILED_STATE
143#define SCTP_REMOTE_UDP_ENCAPS_PORT 132
144#define SCTP_PLPMTUD_PROBE_INTERVAL 133
132145
133/* PR-SCTP policies */146/* PR-SCTP policies */
134#define SCTP_PR_SCTP_NONE 0x0000147#define SCTP_PR_SCTP_NONE 0x0000
...@@ -402,6 +415,8 @@ enum sctp_spc_state {...@@ -402,6 +415,8 @@ enum sctp_spc_state {
402 SCTP_ADDR_ADDED,415 SCTP_ADDR_ADDED,
403 SCTP_ADDR_MADE_PRIM,416 SCTP_ADDR_MADE_PRIM,
404 SCTP_ADDR_CONFIRMED,417 SCTP_ADDR_CONFIRMED,
418 SCTP_ADDR_POTENTIALLY_FAILED,
419#define SCTP_ADDR_PF SCTP_ADDR_POTENTIALLY_FAILED
405};420};
406421
407422
...@@ -441,6 +456,16 @@ struct sctp_send_failed {...@@ -441,6 +456,16 @@ struct sctp_send_failed {
441 __u8 ssf_data[0];456 __u8 ssf_data[0];
442};457};
443458
459struct sctp_send_failed_event {
460 __u16 ssf_type;
461 __u16 ssf_flags;
462 __u32 ssf_length;
463 __u32 ssf_error;
464 struct sctp_sndinfo ssfe_info;
465 sctp_assoc_t ssf_assoc_id;
466 __u8 ssf_data[0];
467};
468
444/*469/*
445 * ssf_flags: 16 bits (unsigned integer)470 * ssf_flags: 16 bits (unsigned integer)
446 *471 *
...@@ -597,6 +622,7 @@ struct sctp_event_subscribe {...@@ -597,6 +622,7 @@ struct sctp_event_subscribe {
597 __u8 sctp_stream_reset_event;622 __u8 sctp_stream_reset_event;
598 __u8 sctp_assoc_reset_event;623 __u8 sctp_assoc_reset_event;
599 __u8 sctp_stream_change_event;624 __u8 sctp_stream_change_event;
625 __u8 sctp_send_failure_event_event;
600};626};
601627
602/*628/*
...@@ -624,6 +650,7 @@ union sctp_notification {...@@ -624,6 +650,7 @@ union sctp_notification {
624 struct sctp_stream_reset_event sn_strreset_event;650 struct sctp_stream_reset_event sn_strreset_event;
625 struct sctp_assoc_reset_event sn_assocreset_event;651 struct sctp_assoc_reset_event sn_assocreset_event;
626 struct sctp_stream_change_event sn_strchange_event;652 struct sctp_stream_change_event sn_strchange_event;
653 struct sctp_send_failed_event sn_send_failed_event;
627};654};
628655
629/* Section 5.3.1656/* Section 5.3.1
...@@ -632,7 +659,9 @@ union sctp_notification {...@@ -632,7 +659,9 @@ union sctp_notification {
632 */659 */
633660
634enum sctp_sn_type {661enum sctp_sn_type {
635 SCTP_SN_TYPE_BASE = (1<<15),662 SCTP_SN_TYPE_BASE = (1<<15),
663 SCTP_DATA_IO_EVENT = SCTP_SN_TYPE_BASE,
664#define SCTP_DATA_IO_EVENT SCTP_DATA_IO_EVENT
636 SCTP_ASSOC_CHANGE,665 SCTP_ASSOC_CHANGE,
637#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE666#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
638 SCTP_PEER_ADDR_CHANGE,667 SCTP_PEER_ADDR_CHANGE,
...@@ -657,6 +686,10 @@ enum sctp_sn_type {...@@ -657,6 +686,10 @@ enum sctp_sn_type {
657#define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT686#define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
658 SCTP_STREAM_CHANGE_EVENT,687 SCTP_STREAM_CHANGE_EVENT,
659#define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT688#define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
689 SCTP_SEND_FAILED_EVENT,
690#define SCTP_SEND_FAILED_EVENT SCTP_SEND_FAILED_EVENT
691 SCTP_SN_TYPE_MAX = SCTP_SEND_FAILED_EVENT,
692#define SCTP_SN_TYPE_MAX SCTP_SN_TYPE_MAX
660};693};
661694
662/* Notification error codes used to fill up the error fields in some695/* Notification error codes used to fill up the error fields in some
...@@ -905,6 +938,7 @@ struct sctp_paddrinfo {...@@ -905,6 +938,7 @@ struct sctp_paddrinfo {
905enum sctp_spinfo_state {938enum sctp_spinfo_state {
906 SCTP_INACTIVE,939 SCTP_INACTIVE,
907 SCTP_PF,940 SCTP_PF,
941#define SCTP_POTENTIALLY_FAILED SCTP_PF
908 SCTP_ACTIVE,942 SCTP_ACTIVE,
909 SCTP_UNCONFIRMED,943 SCTP_UNCONFIRMED,
910 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */944 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
...@@ -1050,6 +1084,15 @@ struct sctp_paddrthlds {...@@ -1050,6 +1084,15 @@ struct sctp_paddrthlds {
1050 __u16 spt_pathpfthld;1084 __u16 spt_pathpfthld;
1051};1085};
10521086
1087/* Use a new structure with spt_pathcpthld for back compatibility */
1088struct sctp_paddrthlds_v2 {
1089 sctp_assoc_t spt_assoc_id;
1090 struct sockaddr_storage spt_address;
1091 __u16 spt_pathmaxrxt;
1092 __u16 spt_pathpfthld;
1093 __u16 spt_pathcpthld;
1094};
1095
1053/*1096/*
1054 * Socket Option for Getting the Association/Stream-Specific PR-SCTP Status1097 * Socket Option for Getting the Association/Stream-Specific PR-SCTP Status
1055 */1098 */
...@@ -1144,6 +1187,18 @@ struct sctp_add_streams {...@@ -1144,6 +1187,18 @@ struct sctp_add_streams {
1144 uint16_t sas_outstrms;1187 uint16_t sas_outstrms;
1145};1188};
11461189
1190struct sctp_event {
1191 sctp_assoc_t se_assoc_id;
1192 uint16_t se_type;
1193 uint8_t se_on;
1194};
1195
1196struct sctp_udpencaps {
1197 sctp_assoc_t sue_assoc_id;
1198 struct sockaddr_storage sue_address;
1199 uint16_t sue_port;
1200};
1201
1147/* SCTP Stream schedulers */1202/* SCTP Stream schedulers */
1148enum sctp_sched_type {1203enum sctp_sched_type {
1149 SCTP_SS_FCFS,1204 SCTP_SS_FCFS,
...@@ -1153,4 +1208,11 @@ enum sctp_sched_type {...@@ -1153,4 +1208,11 @@ enum sctp_sched_type {
1153 SCTP_SS_MAX = SCTP_SS_RR1208 SCTP_SS_MAX = SCTP_SS_RR
1154};1209};
11551210
1211/* Probe Interval socket option */
1212struct sctp_probeinterval {
1213 sctp_assoc_t spi_assoc_id;
1214 struct sockaddr_storage spi_address;
1215 __u32 spi_interval;
1216};
1217
1156#endif /* _SCTP_H */1218#endif /* _SCTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sdla.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * Global definitions for the Frame relay interface.
8 *
9 * Version: @(#)if_ifrad.h 0.20 13 Apr 96
10 *
11 * Author: Mike McLagan <mike.mclagan@linux.org>
12 *
13 * Changes:
14 * 0.15 Mike McLagan Structure packing
15 *
16 * 0.20 Mike McLagan New flags for S508 buffer handling
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 */
23
24#ifndef SDLA_H
25#define SDLA_H
26
27/* adapter type */
28#define SDLA_TYPES
29#define SDLA_S502A 5020
30#define SDLA_S502E 5021
31#define SDLA_S503 5030
32#define SDLA_S507 5070
33#define SDLA_S508 5080
34#define SDLA_S509 5090
35#define SDLA_UNKNOWN -1
36
37/* port selection flags for the S508 */
38#define SDLA_S508_PORT_V35 0x00
39#define SDLA_S508_PORT_RS232 0x02
40
41/* Z80 CPU speeds */
42#define SDLA_CPU_3M 0x00
43#define SDLA_CPU_5M 0x01
44#define SDLA_CPU_7M 0x02
45#define SDLA_CPU_8M 0x03
46#define SDLA_CPU_10M 0x04
47#define SDLA_CPU_16M 0x05
48#define SDLA_CPU_12M 0x06
49
50/* some private IOCTLs */
51#define SDLA_IDENTIFY (FRAD_LAST_IOCTL + 1)
52#define SDLA_CPUSPEED (FRAD_LAST_IOCTL + 2)
53#define SDLA_PROTOCOL (FRAD_LAST_IOCTL + 3)
54
55#define SDLA_CLEARMEM (FRAD_LAST_IOCTL + 4)
56#define SDLA_WRITEMEM (FRAD_LAST_IOCTL + 5)
57#define SDLA_READMEM (FRAD_LAST_IOCTL + 6)
58
59struct sdla_mem {
60 int addr;
61 int len;
62 void *data;
63};
64
65#define SDLA_START (FRAD_LAST_IOCTL + 7)
66#define SDLA_STOP (FRAD_LAST_IOCTL + 8)
67
68/* some offsets in the Z80's memory space */
69#define SDLA_NMIADDR 0x0000
70#define SDLA_CONF_ADDR 0x0010
71#define SDLA_S502A_NMIADDR 0x0066
72#define SDLA_CODE_BASEADDR 0x0100
73#define SDLA_WINDOW_SIZE 0x2000
74#define SDLA_ADDR_MASK 0x1FFF
75
76/* largest handleable block of data */
77#define SDLA_MAX_DATA 4080
78#define SDLA_MAX_MTU 4072 /* MAX_DATA - sizeof(fradhdr) */
79#define SDLA_MAX_DLCI 24
80
81/* this should be the same as frad_conf */
82struct sdla_conf {
83 short station;
84 short config;
85 short kbaud;
86 short clocking;
87 short max_frm;
88 short T391;
89 short T392;
90 short N391;
91 short N392;
92 short N393;
93 short CIR_fwd;
94 short Bc_fwd;
95 short Be_fwd;
96 short CIR_bwd;
97 short Bc_bwd;
98 short Be_bwd;
99};
100
101/* this should be the same as dlci_conf */
102struct sdla_dlci_conf {
103 short config;
104 short CIR_fwd;
105 short Bc_fwd;
106 short Be_fwd;
107 short CIR_bwd;
108 short Bc_bwd;
109 short Be_bwd;
110 short Tc_fwd;
111 short Tc_bwd;
112 short Tf_max;
113 short Tb_max;
114};
115
116
117#endif /* SDLA_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seccomp.h+91-3
...@@ -15,11 +15,14 @@...@@ -15,11 +15,14 @@
15#define SECCOMP_SET_MODE_STRICT 015#define SECCOMP_SET_MODE_STRICT 0
16#define SECCOMP_SET_MODE_FILTER 116#define SECCOMP_SET_MODE_FILTER 1
17#define SECCOMP_GET_ACTION_AVAIL 217#define SECCOMP_GET_ACTION_AVAIL 2
18#define SECCOMP_GET_NOTIF_SIZES 3
1819
19/* Valid flags for SECCOMP_SET_MODE_FILTER */20/* Valid flags for SECCOMP_SET_MODE_FILTER */
20#define SECCOMP_FILTER_FLAG_TSYNC (1UL << 0)21#define SECCOMP_FILTER_FLAG_TSYNC (1UL << 0)
21#define SECCOMP_FILTER_FLAG_LOG (1UL << 1)22#define SECCOMP_FILTER_FLAG_LOG (1UL << 1)
22#define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)23#define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)
24#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
25#define SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1UL << 4)
2326
24/*27/*
25 * All BPF programs must return a 32-bit value.28 * All BPF programs must return a 32-bit value.
...@@ -35,6 +38,7 @@...@@ -35,6 +38,7 @@
35#define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD38#define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD
36#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */39#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
37#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */40#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
41#define SECCOMP_RET_USER_NOTIF 0x7fc00000U /* notifies userspace */
38#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */42#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */
39#define SECCOMP_RET_LOG 0x7ffc0000U /* allow after logging */43#define SECCOMP_RET_LOG 0x7ffc0000U /* allow after logging */
40#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */44#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
...@@ -60,4 +64,88 @@ struct seccomp_data {...@@ -60,4 +64,88 @@ struct seccomp_data {
60 __u64 args[6];64 __u64 args[6];
61};65};
6266
67struct seccomp_notif_sizes {
68 __u16 seccomp_notif;
69 __u16 seccomp_notif_resp;
70 __u16 seccomp_data;
71};
72
73struct seccomp_notif {
74 __u64 id;
75 __u32 pid;
76 __u32 flags;
77 struct seccomp_data data;
78};
79
80/*
81 * Valid flags for struct seccomp_notif_resp
82 *
83 * Note, the SECCOMP_USER_NOTIF_FLAG_CONTINUE flag must be used with caution!
84 * If set by the process supervising the syscalls of another process the
85 * syscall will continue. This is problematic because of an inherent TOCTOU.
86 * An attacker can exploit the time while the supervised process is waiting on
87 * a response from the supervising process to rewrite syscall arguments which
88 * are passed as pointers of the intercepted syscall.
89 * It should be absolutely clear that this means that the seccomp notifier
90 * _cannot_ be used to implement a security policy! It should only ever be used
91 * in scenarios where a more privileged process supervises the syscalls of a
92 * lesser privileged process to get around kernel-enforced security
93 * restrictions when the privileged process deems this safe. In other words,
94 * in order to continue a syscall the supervising process should be sure that
95 * another security mechanism or the kernel itself will sufficiently block
96 * syscalls if arguments are rewritten to something unsafe.
97 *
98 * Similar precautions should be applied when stacking SECCOMP_RET_USER_NOTIF
99 * or SECCOMP_RET_TRACE. For SECCOMP_RET_USER_NOTIF filters acting on the
100 * same syscall, the most recently added filter takes precedence. This means
101 * that the new SECCOMP_RET_USER_NOTIF filter can override any
102 * SECCOMP_IOCTL_NOTIF_SEND from earlier filters, essentially allowing all
103 * such filtered syscalls to be executed by sending the response
104 * SECCOMP_USER_NOTIF_FLAG_CONTINUE. Note that SECCOMP_RET_TRACE can equally
105 * be overriden by SECCOMP_USER_NOTIF_FLAG_CONTINUE.
106 */
107#define SECCOMP_USER_NOTIF_FLAG_CONTINUE (1UL << 0)
108
109struct seccomp_notif_resp {
110 __u64 id;
111 __s64 val;
112 __s32 error;
113 __u32 flags;
114};
115
116/* valid flags for seccomp_notif_addfd */
117#define SECCOMP_ADDFD_FLAG_SETFD (1UL << 0) /* Specify remote fd */
118#define SECCOMP_ADDFD_FLAG_SEND (1UL << 1) /* Addfd and return it, atomically */
119
120/**
121 * struct seccomp_notif_addfd
122 * @id: The ID of the seccomp notification
123 * @flags: SECCOMP_ADDFD_FLAG_*
124 * @srcfd: The local fd number
125 * @newfd: Optional remote FD number if SETFD option is set, otherwise 0.
126 * @newfd_flags: The O_* flags the remote FD should have applied
127 */
128struct seccomp_notif_addfd {
129 __u64 id;
130 __u32 flags;
131 __u32 srcfd;
132 __u32 newfd;
133 __u32 newfd_flags;
134};
135
136#define SECCOMP_IOC_MAGIC '!'
137#define SECCOMP_IO(nr) _IO(SECCOMP_IOC_MAGIC, nr)
138#define SECCOMP_IOR(nr, type) _IOR(SECCOMP_IOC_MAGIC, nr, type)
139#define SECCOMP_IOW(nr, type) _IOW(SECCOMP_IOC_MAGIC, nr, type)
140#define SECCOMP_IOWR(nr, type) _IOWR(SECCOMP_IOC_MAGIC, nr, type)
141
142/* Flags for seccomp notification fd ioctl. */
143#define SECCOMP_IOCTL_NOTIF_RECV SECCOMP_IOWR(0, struct seccomp_notif)
144#define SECCOMP_IOCTL_NOTIF_SEND SECCOMP_IOWR(1, \
145 struct seccomp_notif_resp)
146#define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOW(2, __u64)
147/* On success, the return value is the remote process's added fd number */
148#define SECCOMP_IOCTL_NOTIF_ADDFD SECCOMP_IOW(3, \
149 struct seccomp_notif_addfd)
150
63#endif /* _LINUX_SECCOMP_H */151#endif /* _LINUX_SECCOMP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sed-opal.h+42-10
...@@ -5,15 +5,6 @@...@@ -5,15 +5,6 @@
5 * Authors:5 * Authors:
6 * Rafael Antognolli <rafael.antognolli@intel.com>6 * Rafael Antognolli <rafael.antognolli@intel.com>
7 * Scott Bauer <scott.bauer@intel.com>7 * Scott Bauer <scott.bauer@intel.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License,
11 * version 2, as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 */8 */
189
19#ifndef _SED_OPAL_H10#ifndef _SED_OPAL_H
...@@ -29,6 +20,11 @@ enum opal_mbr {...@@ -29,6 +20,11 @@ enum opal_mbr {
29 OPAL_MBR_DISABLE = 0x01,20 OPAL_MBR_DISABLE = 0x01,
30};21};
3122
23enum opal_mbr_done_flag {
24 OPAL_MBR_NOT_DONE = 0x0,
25 OPAL_MBR_DONE = 0x01
26};
27
32enum opal_user {28enum opal_user {
33 OPAL_ADMIN1 = 0x0,29 OPAL_ADMIN1 = 0x0,
34 OPAL_USER1 = 0x01,30 OPAL_USER1 = 0x01,
...@@ -58,7 +54,7 @@ struct opal_key {...@@ -58,7 +54,7 @@ struct opal_key {
58struct opal_lr_act {54struct opal_lr_act {
59 struct opal_key key;55 struct opal_key key;
60 __u32 sum;56 __u32 sum;
61 __u8 num_lrs;57 __u8 num_lrs;
62 __u8 lr[OPAL_MAX_LRS];58 __u8 lr[OPAL_MAX_LRS];
63 __u8 align[2]; /* Align to 8 byte boundary */59 __u8 align[2]; /* Align to 8 byte boundary */
64};60};
...@@ -104,6 +100,38 @@ struct opal_mbr_data {...@@ -104,6 +100,38 @@ struct opal_mbr_data {
104 __u8 __align[7];100 __u8 __align[7];
105};101};
106102
103struct opal_mbr_done {
104 struct opal_key key;
105 __u8 done_flag;
106 __u8 __align[7];
107};
108
109struct opal_shadow_mbr {
110 struct opal_key key;
111 const __u64 data;
112 __u64 offset;
113 __u64 size;
114};
115
116/* Opal table operations */
117enum opal_table_ops {
118 OPAL_READ_TABLE,
119 OPAL_WRITE_TABLE,
120};
121
122#define OPAL_UID_LENGTH 8
123struct opal_read_write_table {
124 struct opal_key key;
125 const __u64 data;
126 const __u8 table_uid[OPAL_UID_LENGTH];
127 __u64 offset;
128 __u64 size;
129#define OPAL_TABLE_READ (1 << OPAL_READ_TABLE)
130#define OPAL_TABLE_WRITE (1 << OPAL_WRITE_TABLE)
131 __u64 flags;
132 __u64 priv;
133};
134
107#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)135#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
108#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)136#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
109#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)137#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
...@@ -116,5 +144,9 @@ struct opal_mbr_data {...@@ -116,5 +144,9 @@ struct opal_mbr_data {
116#define IOC_OPAL_ENABLE_DISABLE_MBR _IOW('p', 229, struct opal_mbr_data)144#define IOC_OPAL_ENABLE_DISABLE_MBR _IOW('p', 229, struct opal_mbr_data)
117#define IOC_OPAL_ERASE_LR _IOW('p', 230, struct opal_session_info)145#define IOC_OPAL_ERASE_LR _IOW('p', 230, struct opal_session_info)
118#define IOC_OPAL_SECURE_ERASE_LR _IOW('p', 231, struct opal_session_info)146#define IOC_OPAL_SECURE_ERASE_LR _IOW('p', 231, struct opal_session_info)
147#define IOC_OPAL_PSID_REVERT_TPR _IOW('p', 232, struct opal_key)
148#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
149#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
150#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)
119151
120#endif /* _SED_OPAL_H */152#endif /* _SED_OPAL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seg6_iptunnel.h-1
...@@ -37,5 +37,4 @@ enum {...@@ -37,5 +37,4 @@ enum {
37 SEG6_IPTUN_MODE_L2ENCAP,37 SEG6_IPTUN_MODE_L2ENCAP,
38};38};
3939
40
41#endif40#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seg6_local.h+33
...@@ -26,6 +26,8 @@ enum {...@@ -26,6 +26,8 @@ enum {
26 SEG6_LOCAL_IIF,26 SEG6_LOCAL_IIF,
27 SEG6_LOCAL_OIF,27 SEG6_LOCAL_OIF,
28 SEG6_LOCAL_BPF,28 SEG6_LOCAL_BPF,
29 SEG6_LOCAL_VRFTABLE,
30 SEG6_LOCAL_COUNTERS,
29 __SEG6_LOCAL_MAX,31 __SEG6_LOCAL_MAX,
30};32};
31#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)33#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
...@@ -62,6 +64,8 @@ enum {...@@ -62,6 +64,8 @@ enum {
62 SEG6_LOCAL_ACTION_END_AM = 14,64 SEG6_LOCAL_ACTION_END_AM = 14,
63 /* custom BPF action */65 /* custom BPF action */
64 SEG6_LOCAL_ACTION_END_BPF = 15,66 SEG6_LOCAL_ACTION_END_BPF = 15,
67 /* decap and lookup of DA in v4 or v6 table */
68 SEG6_LOCAL_ACTION_END_DT46 = 16,
6569
66 __SEG6_LOCAL_ACTION_MAX,70 __SEG6_LOCAL_ACTION_MAX,
67};71};
...@@ -77,4 +81,33 @@ enum {...@@ -77,4 +81,33 @@ enum {
7781
78#define SEG6_LOCAL_BPF_PROG_MAX (__SEG6_LOCAL_BPF_PROG_MAX - 1)82#define SEG6_LOCAL_BPF_PROG_MAX (__SEG6_LOCAL_BPF_PROG_MAX - 1)
7983
84/* SRv6 Behavior counters are encoded as netlink attributes guaranteeing the
85 * correct alignment.
86 * Each counter is identified by a different attribute type (i.e.
87 * SEG6_LOCAL_CNT_PACKETS).
88 *
89 * - SEG6_LOCAL_CNT_PACKETS: identifies a counter that counts the number of
90 * packets that have been CORRECTLY processed by an SRv6 Behavior instance
91 * (i.e., packets that generate errors or are dropped are NOT counted).
92 *
93 * - SEG6_LOCAL_CNT_BYTES: identifies a counter that counts the total amount
94 * of traffic in bytes of all packets that have been CORRECTLY processed by
95 * an SRv6 Behavior instance (i.e., packets that generate errors or are
96 * dropped are NOT counted).
97 *
98 * - SEG6_LOCAL_CNT_ERRORS: identifies a counter that counts the number of
99 * packets that have NOT been properly processed by an SRv6 Behavior instance
100 * (i.e., packets that generate errors or are dropped).
101 */
102enum {
103 SEG6_LOCAL_CNT_UNSPEC,
104 SEG6_LOCAL_CNT_PAD, /* pad for 64 bits values */
105 SEG6_LOCAL_CNT_PACKETS,
106 SEG6_LOCAL_CNT_BYTES,
107 SEG6_LOCAL_CNT_ERRORS,
108 __SEG6_LOCAL_CNT_MAX,
109};
110
111#define SEG6_LOCAL_CNT_MAX (__SEG6_LOCAL_CNT_MAX - 1)
112
80#endif113#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sem.h+2-2
...@@ -24,8 +24,8 @@...@@ -24,8 +24,8 @@
24/* Obsolete, used only for backwards compatibility and libc5 compiles */24/* Obsolete, used only for backwards compatibility and libc5 compiles */
25struct semid_ds {25struct semid_ds {
26 struct ipc_perm sem_perm; /* permissions .. see ipc.h */26 struct ipc_perm sem_perm; /* permissions .. see ipc.h */
27 __kernel_time_t sem_otime; /* last semop time */27 __kernel_old_time_t sem_otime; /* last semop time */
28 __kernel_time_t sem_ctime; /* create/last semctl() time */28 __kernel_old_time_t sem_ctime; /* create/last semctl() time */
29 struct sem *sem_base; /* ptr to first semaphore in array */29 struct sem *sem_base; /* ptr to first semaphore in array */
30 struct sem_queue *sem_pending; /* pending operations to be processed */30 struct sem_queue *sem_pending; /* pending operations to be processed */
31 struct sem_queue **sem_pending_last; /* last pending operation */31 struct sem_queue **sem_pending_last; /* last pending operation */
lib/libc/include/any-linux-any/linux/serial.h+19-2
...@@ -52,11 +52,11 @@ struct serial_struct {...@@ -52,11 +52,11 @@ struct serial_struct {
52#define PORT_16450 252#define PORT_16450 2
53#define PORT_16550 353#define PORT_16550 3
54#define PORT_16550A 454#define PORT_16550A 4
55#define PORT_CIRRUS 5 /* usurped by cyclades.c */55#define PORT_CIRRUS 5
56#define PORT_16650 656#define PORT_16650 6
57#define PORT_16650V2 757#define PORT_16650V2 7
58#define PORT_16750 858#define PORT_16750 8
59#define PORT_STARTECH 9 /* usurped by cyclades.c */59#define PORT_STARTECH 9
60#define PORT_16C950 10 /* Oxford Semiconductor */60#define PORT_16C950 10 /* Oxford Semiconductor */
61#define PORT_16654 1161#define PORT_16654 11
62#define PORT_16850 1262#define PORT_16850 12
...@@ -132,4 +132,21 @@ struct serial_rs485 {...@@ -132,4 +132,21 @@ struct serial_rs485 {
132 are a royal PITA .. */132 are a royal PITA .. */
133};133};
134134
135/*
136 * Serial interface for controlling ISO7816 settings on chips with suitable
137 * support. Set with TIOCSISO7816 and get with TIOCGISO7816 if supported by
138 * your platform.
139 */
140struct serial_iso7816 {
141 __u32 flags; /* ISO7816 feature flags */
142#define SER_ISO7816_ENABLED (1 << 0)
143#define SER_ISO7816_T_PARAM (0x0f << 4)
144#define SER_ISO7816_T(t) (((t) & 0x0f) << 4)
145 __u32 tg;
146 __u32 sc_fi;
147 __u32 sc_di;
148 __u32 clk;
149 __u32 reserved[5];
150};
151
135#endif /* _LINUX_SERIAL_H */152#endif /* _LINUX_SERIAL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial_core.h+19-26
...@@ -26,20 +26,6 @@...@@ -26,20 +26,6 @@
26/*26/*
27 * The type definitions. These are from Ted Ts'o's serial.h27 * The type definitions. These are from Ted Ts'o's serial.h
28 */28 */
29#define PORT_UNKNOWN 0
30#define PORT_8250 1
31#define PORT_16450 2
32#define PORT_16550 3
33#define PORT_16550A 4
34#define PORT_CIRRUS 5
35#define PORT_16650 6
36#define PORT_16650V2 7
37#define PORT_16750 8
38#define PORT_STARTECH 9
39#define PORT_16C950 10
40#define PORT_16654 11
41#define PORT_16850 12
42#define PORT_RSA 13
43#define PORT_NS16550A 1429#define PORT_NS16550A 14
44#define PORT_XSCALE 1530#define PORT_XSCALE 15
45#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */31#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
...@@ -79,6 +65,9 @@...@@ -79,6 +65,9 @@
79/* Nuvoton UART */65/* Nuvoton UART */
80#define PORT_NPCM 4066#define PORT_NPCM 40
8167
68/* NVIDIA Tegra Combined UART */
69#define PORT_TEGRA_TCU 41
70
82/* Intel EG20 */71/* Intel EG20 */
83#define PORT_PCH_8LINE 4472#define PORT_PCH_8LINE 44
84#define PORT_PCH_2LINE 4573#define PORT_PCH_2LINE 45
...@@ -126,7 +115,7 @@...@@ -126,7 +115,7 @@
126/* Motorola i.MX SoC */115/* Motorola i.MX SoC */
127#define PORT_IMX 62116#define PORT_IMX 62
128117
129/* Marvell MPSC */118/* Marvell MPSC (obsolete unused) */
130#define PORT_MPSC 63119#define PORT_MPSC 63
131120
132/* TXX9 type number */121/* TXX9 type number */
...@@ -145,11 +134,6 @@...@@ -145,11 +134,6 @@
145/*Digi jsm */134/*Digi jsm */
146#define PORT_JSM 69135#define PORT_JSM 69
147136
148#define PORT_PNX8XXX 70
149
150/* Hilscher netx */
151#define PORT_NETX 71
152
153/* SUN4V Hypervisor Console */137/* SUN4V Hypervisor Console */
154#define PORT_SUNHV 72138#define PORT_SUNHV 72
155139
...@@ -161,9 +145,6 @@...@@ -161,9 +145,6 @@
161/* Blackfin bf5xx */145/* Blackfin bf5xx */
162#define PORT_BFIN 75146#define PORT_BFIN 75
163147
164/* Micrel KS8695 */
165#define PORT_KS8695 76
166
167/* Broadcom SB1250, etc. SOC */148/* Broadcom SB1250, etc. SOC */
168#define PORT_SB1250_DUART 77149#define PORT_SB1250_DUART 77
169150
...@@ -227,9 +208,6 @@...@@ -227,9 +208,6 @@
227/* Atheros AR933X SoC */208/* Atheros AR933X SoC */
228#define PORT_AR933X 99209#define PORT_AR933X 99
229210
230/* Energy Micro efm32 SoC */
231#define PORT_EFMUART 100
232
233/* ARC (Synopsys) on-chip UART */211/* ARC (Synopsys) on-chip UART */
234#define PORT_ARC 101212#define PORT_ARC 101
235213
...@@ -281,4 +259,19 @@...@@ -281,4 +259,19 @@
281/* MediaTek BTIF */259/* MediaTek BTIF */
282#define PORT_MTK_BTIF 117260#define PORT_MTK_BTIF 117
283261
262/* RDA UART */
263#define PORT_RDA 118
264
265/* Socionext Milbeaut UART */
266#define PORT_MLB_USIO 119
267
268/* SiFive UART */
269#define PORT_SIFIVE_V0 120
270
271/* Sunix UART */
272#define PORT_SUNIX 121
273
274/* Freescale LINFlexD UART */
275#define PORT_LINFLEXUART 122
276
284#endif /* LINUX_SERIAL_CORE_H */277#endif /* LINUX_SERIAL_CORE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial_reg.h+1
...@@ -62,6 +62,7 @@...@@ -62,6 +62,7 @@
62 * ST16C654: 8 16 56 60 8 16 32 56 PORT_1665462 * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654
63 * TI16C750: 1 16 32 56 xx xx xx xx PORT_1675063 * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750
64 * TI16C752: 8 16 56 60 8 16 32 5664 * TI16C752: 8 16 56 60 8 16 32 56
65 * OX16C950: 16 32 112 120 16 32 64 112 PORT_16C950
65 * Tegra: 1 4 8 14 16 8 4 1 PORT_TEGRA66 * Tegra: 1 4 8 14 16 8 4 1 PORT_TEGRA
66 */67 */
67#define UART_FCR_R_TRIG_00 0x0068#define UART_FCR_R_TRIG_00 0x00
lib/libc/include/any-linux-any/linux/serio.h+6-5
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#ifndef _SERIO_H9#ifndef _SERIO_H
10#define _SERIO_H10#define _SERIO_H
1111
1212#include <linux/const.h>
13#include <linux/ioctl.h>13#include <linux/ioctl.h>
1414
15#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)15#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18/*18/*
19 * bit masks for use in "interrupt" flags (3rd argument)19 * bit masks for use in "interrupt" flags (3rd argument)
20 */20 */
21#define SERIO_TIMEOUT BIT(0)21#define SERIO_TIMEOUT _BITUL(0)
22#define SERIO_PARITY BIT(1)22#define SERIO_PARITY _BITUL(1)
23#define SERIO_FRAME BIT(2)23#define SERIO_FRAME _BITUL(2)
24#define SERIO_OOB_DATA BIT(3)24#define SERIO_OOB_DATA _BITUL(3)
2525
26/*26/*
27 * Serio types27 * Serio types
...@@ -82,5 +82,6 @@...@@ -82,5 +82,6 @@
82#define SERIO_EGALAX 0x3f82#define SERIO_EGALAX 0x3f
83#define SERIO_PULSE8_CEC 0x4083#define SERIO_PULSE8_CEC 0x40
84#define SERIO_RAINSHADOW_CEC 0x4184#define SERIO_RAINSHADOW_CEC 0x41
85#define SERIO_FSIA6B 0x42
8586
86#endif /* _SERIO_H */87#endif /* _SERIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/shm.h+3-3
...@@ -26,9 +26,9 @@...@@ -26,9 +26,9 @@
26struct shmid_ds {26struct shmid_ds {
27 struct ipc_perm shm_perm; /* operation perms */27 struct ipc_perm shm_perm; /* operation perms */
28 int shm_segsz; /* size of segment (bytes) */28 int shm_segsz; /* size of segment (bytes) */
29 __kernel_time_t shm_atime; /* last attach time */29 __kernel_old_time_t shm_atime; /* last attach time */
30 __kernel_time_t shm_dtime; /* last detach time */30 __kernel_old_time_t shm_dtime; /* last detach time */
31 __kernel_time_t shm_ctime; /* last change time */31 __kernel_old_time_t shm_ctime; /* last change time */
32 __kernel_ipc_pid_t shm_cpid; /* pid of creator */32 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
33 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */33 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
34 unsigned short shm_nattch; /* no. of current attaches */34 unsigned short shm_nattch; /* no. of current attaches */
lib/libc/include/any-linux-any/linux/smc.h+249
...@@ -33,4 +33,253 @@ enum { /* SMC PNET Table commands */...@@ -33,4 +33,253 @@ enum { /* SMC PNET Table commands */
33#define SMCR_GENL_FAMILY_NAME "SMC_PNETID"33#define SMCR_GENL_FAMILY_NAME "SMC_PNETID"
34#define SMCR_GENL_FAMILY_VERSION 134#define SMCR_GENL_FAMILY_VERSION 1
3535
36/* gennetlink interface to access non-socket information from SMC module */
37#define SMC_GENL_FAMILY_NAME "SMC_GEN_NETLINK"
38#define SMC_GENL_FAMILY_VERSION 1
39
40#define SMC_PCI_ID_STR_LEN 16 /* Max length of pci id string */
41#define SMC_MAX_HOSTNAME_LEN 32 /* Max length of the hostname */
42#define SMC_MAX_UEID 4 /* Max number of user EIDs */
43#define SMC_MAX_EID_LEN 32 /* Max length of an EID */
44
45/* SMC_GENL_FAMILY commands */
46enum {
47 SMC_NETLINK_GET_SYS_INFO = 1,
48 SMC_NETLINK_GET_LGR_SMCR,
49 SMC_NETLINK_GET_LINK_SMCR,
50 SMC_NETLINK_GET_LGR_SMCD,
51 SMC_NETLINK_GET_DEV_SMCD,
52 SMC_NETLINK_GET_DEV_SMCR,
53 SMC_NETLINK_GET_STATS,
54 SMC_NETLINK_GET_FBACK_STATS,
55 SMC_NETLINK_DUMP_UEID,
56 SMC_NETLINK_ADD_UEID,
57 SMC_NETLINK_REMOVE_UEID,
58 SMC_NETLINK_FLUSH_UEID,
59 SMC_NETLINK_DUMP_SEID,
60 SMC_NETLINK_ENABLE_SEID,
61 SMC_NETLINK_DISABLE_SEID,
62};
63
64/* SMC_GENL_FAMILY top level attributes */
65enum {
66 SMC_GEN_UNSPEC,
67 SMC_GEN_SYS_INFO, /* nest */
68 SMC_GEN_LGR_SMCR, /* nest */
69 SMC_GEN_LINK_SMCR, /* nest */
70 SMC_GEN_LGR_SMCD, /* nest */
71 SMC_GEN_DEV_SMCD, /* nest */
72 SMC_GEN_DEV_SMCR, /* nest */
73 SMC_GEN_STATS, /* nest */
74 SMC_GEN_FBACK_STATS, /* nest */
75 __SMC_GEN_MAX,
76 SMC_GEN_MAX = __SMC_GEN_MAX - 1
77};
78
79/* SMC_GEN_SYS_INFO attributes */
80enum {
81 SMC_NLA_SYS_UNSPEC,
82 SMC_NLA_SYS_VER, /* u8 */
83 SMC_NLA_SYS_REL, /* u8 */
84 SMC_NLA_SYS_IS_ISM_V2, /* u8 */
85 SMC_NLA_SYS_LOCAL_HOST, /* string */
86 SMC_NLA_SYS_SEID, /* string */
87 SMC_NLA_SYS_IS_SMCR_V2, /* u8 */
88 __SMC_NLA_SYS_MAX,
89 SMC_NLA_SYS_MAX = __SMC_NLA_SYS_MAX - 1
90};
91
92/* SMC_NLA_LGR_D_V2_COMMON and SMC_NLA_LGR_R_V2_COMMON nested attributes */
93enum {
94 SMC_NLA_LGR_V2_VER, /* u8 */
95 SMC_NLA_LGR_V2_REL, /* u8 */
96 SMC_NLA_LGR_V2_OS, /* u8 */
97 SMC_NLA_LGR_V2_NEG_EID, /* string */
98 SMC_NLA_LGR_V2_PEER_HOST, /* string */
99 __SMC_NLA_LGR_V2_MAX,
100 SMC_NLA_LGR_V2_MAX = __SMC_NLA_LGR_V2_MAX - 1
101};
102
103/* SMC_NLA_LGR_R_V2 nested attributes */
104enum {
105 SMC_NLA_LGR_R_V2_UNSPEC,
106 SMC_NLA_LGR_R_V2_DIRECT, /* u8 */
107 __SMC_NLA_LGR_R_V2_MAX,
108 SMC_NLA_LGR_R_V2_MAX = __SMC_NLA_LGR_R_V2_MAX - 1
109};
110
111/* SMC_GEN_LGR_SMCR attributes */
112enum {
113 SMC_NLA_LGR_R_UNSPEC,
114 SMC_NLA_LGR_R_ID, /* u32 */
115 SMC_NLA_LGR_R_ROLE, /* u8 */
116 SMC_NLA_LGR_R_TYPE, /* u8 */
117 SMC_NLA_LGR_R_PNETID, /* string */
118 SMC_NLA_LGR_R_VLAN_ID, /* u8 */
119 SMC_NLA_LGR_R_CONNS_NUM, /* u32 */
120 SMC_NLA_LGR_R_V2_COMMON, /* nest */
121 SMC_NLA_LGR_R_V2, /* nest */
122 __SMC_NLA_LGR_R_MAX,
123 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1
124};
125
126/* SMC_GEN_LINK_SMCR attributes */
127enum {
128 SMC_NLA_LINK_UNSPEC,
129 SMC_NLA_LINK_ID, /* u8 */
130 SMC_NLA_LINK_IB_DEV, /* string */
131 SMC_NLA_LINK_IB_PORT, /* u8 */
132 SMC_NLA_LINK_GID, /* string */
133 SMC_NLA_LINK_PEER_GID, /* string */
134 SMC_NLA_LINK_CONN_CNT, /* u32 */
135 SMC_NLA_LINK_NET_DEV, /* u32 */
136 SMC_NLA_LINK_UID, /* u32 */
137 SMC_NLA_LINK_PEER_UID, /* u32 */
138 SMC_NLA_LINK_STATE, /* u32 */
139 __SMC_NLA_LINK_MAX,
140 SMC_NLA_LINK_MAX = __SMC_NLA_LINK_MAX - 1
141};
142
143/* SMC_GEN_LGR_SMCD attributes */
144enum {
145 SMC_NLA_LGR_D_UNSPEC,
146 SMC_NLA_LGR_D_ID, /* u32 */
147 SMC_NLA_LGR_D_GID, /* u64 */
148 SMC_NLA_LGR_D_PEER_GID, /* u64 */
149 SMC_NLA_LGR_D_VLAN_ID, /* u8 */
150 SMC_NLA_LGR_D_CONNS_NUM, /* u32 */
151 SMC_NLA_LGR_D_PNETID, /* string */
152 SMC_NLA_LGR_D_CHID, /* u16 */
153 SMC_NLA_LGR_D_PAD, /* flag */
154 SMC_NLA_LGR_D_V2_COMMON, /* nest */
155 __SMC_NLA_LGR_D_MAX,
156 SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
157};
158
159/* SMC_NLA_DEV_PORT nested attributes */
160enum {
161 SMC_NLA_DEV_PORT_UNSPEC,
162 SMC_NLA_DEV_PORT_PNET_USR, /* u8 */
163 SMC_NLA_DEV_PORT_PNETID, /* string */
164 SMC_NLA_DEV_PORT_NETDEV, /* u32 */
165 SMC_NLA_DEV_PORT_STATE, /* u8 */
166 SMC_NLA_DEV_PORT_VALID, /* u8 */
167 SMC_NLA_DEV_PORT_LNK_CNT, /* u32 */
168 __SMC_NLA_DEV_PORT_MAX,
169 SMC_NLA_DEV_PORT_MAX = __SMC_NLA_DEV_PORT_MAX - 1
170};
171
172/* SMC_GEN_DEV_SMCD and SMC_GEN_DEV_SMCR attributes */
173enum {
174 SMC_NLA_DEV_UNSPEC,
175 SMC_NLA_DEV_USE_CNT, /* u32 */
176 SMC_NLA_DEV_IS_CRIT, /* u8 */
177 SMC_NLA_DEV_PCI_FID, /* u32 */
178 SMC_NLA_DEV_PCI_CHID, /* u16 */
179 SMC_NLA_DEV_PCI_VENDOR, /* u16 */
180 SMC_NLA_DEV_PCI_DEVICE, /* u16 */
181 SMC_NLA_DEV_PCI_ID, /* string */
182 SMC_NLA_DEV_PORT, /* nest */
183 SMC_NLA_DEV_PORT2, /* nest */
184 SMC_NLA_DEV_IB_NAME, /* string */
185 __SMC_NLA_DEV_MAX,
186 SMC_NLA_DEV_MAX = __SMC_NLA_DEV_MAX - 1
187};
188
189/* SMC_NLA_STATS_T_TX(RX)_RMB_SIZE nested attributes */
190/* SMC_NLA_STATS_TX(RX)PLOAD_SIZE nested attributes */
191enum {
192 SMC_NLA_STATS_PLOAD_PAD,
193 SMC_NLA_STATS_PLOAD_8K, /* u64 */
194 SMC_NLA_STATS_PLOAD_16K, /* u64 */
195 SMC_NLA_STATS_PLOAD_32K, /* u64 */
196 SMC_NLA_STATS_PLOAD_64K, /* u64 */
197 SMC_NLA_STATS_PLOAD_128K, /* u64 */
198 SMC_NLA_STATS_PLOAD_256K, /* u64 */
199 SMC_NLA_STATS_PLOAD_512K, /* u64 */
200 SMC_NLA_STATS_PLOAD_1024K, /* u64 */
201 SMC_NLA_STATS_PLOAD_G_1024K, /* u64 */
202 __SMC_NLA_STATS_PLOAD_MAX,
203 SMC_NLA_STATS_PLOAD_MAX = __SMC_NLA_STATS_PLOAD_MAX - 1
204};
205
206/* SMC_NLA_STATS_T_TX(RX)_RMB_STATS nested attributes */
207enum {
208 SMC_NLA_STATS_RMB_PAD,
209 SMC_NLA_STATS_RMB_SIZE_SM_PEER_CNT, /* u64 */
210 SMC_NLA_STATS_RMB_SIZE_SM_CNT, /* u64 */
211 SMC_NLA_STATS_RMB_FULL_PEER_CNT, /* u64 */
212 SMC_NLA_STATS_RMB_FULL_CNT, /* u64 */
213 SMC_NLA_STATS_RMB_REUSE_CNT, /* u64 */
214 SMC_NLA_STATS_RMB_ALLOC_CNT, /* u64 */
215 SMC_NLA_STATS_RMB_DGRADE_CNT, /* u64 */
216 __SMC_NLA_STATS_RMB_MAX,
217 SMC_NLA_STATS_RMB_MAX = __SMC_NLA_STATS_RMB_MAX - 1
218};
219
220/* SMC_NLA_STATS_SMCD_TECH and _SMCR_TECH nested attributes */
221enum {
222 SMC_NLA_STATS_T_PAD,
223 SMC_NLA_STATS_T_TX_RMB_SIZE, /* nest */
224 SMC_NLA_STATS_T_RX_RMB_SIZE, /* nest */
225 SMC_NLA_STATS_T_TXPLOAD_SIZE, /* nest */
226 SMC_NLA_STATS_T_RXPLOAD_SIZE, /* nest */
227 SMC_NLA_STATS_T_TX_RMB_STATS, /* nest */
228 SMC_NLA_STATS_T_RX_RMB_STATS, /* nest */
229 SMC_NLA_STATS_T_CLNT_V1_SUCC, /* u64 */
230 SMC_NLA_STATS_T_CLNT_V2_SUCC, /* u64 */
231 SMC_NLA_STATS_T_SRV_V1_SUCC, /* u64 */
232 SMC_NLA_STATS_T_SRV_V2_SUCC, /* u64 */
233 SMC_NLA_STATS_T_SENDPAGE_CNT, /* u64 */
234 SMC_NLA_STATS_T_SPLICE_CNT, /* u64 */
235 SMC_NLA_STATS_T_CORK_CNT, /* u64 */
236 SMC_NLA_STATS_T_NDLY_CNT, /* u64 */
237 SMC_NLA_STATS_T_URG_DATA_CNT, /* u64 */
238 SMC_NLA_STATS_T_RX_BYTES, /* u64 */
239 SMC_NLA_STATS_T_TX_BYTES, /* u64 */
240 SMC_NLA_STATS_T_RX_CNT, /* u64 */
241 SMC_NLA_STATS_T_TX_CNT, /* u64 */
242 __SMC_NLA_STATS_T_MAX,
243 SMC_NLA_STATS_T_MAX = __SMC_NLA_STATS_T_MAX - 1
244};
245
246/* SMC_GEN_STATS attributes */
247enum {
248 SMC_NLA_STATS_PAD,
249 SMC_NLA_STATS_SMCD_TECH, /* nest */
250 SMC_NLA_STATS_SMCR_TECH, /* nest */
251 SMC_NLA_STATS_CLNT_HS_ERR_CNT, /* u64 */
252 SMC_NLA_STATS_SRV_HS_ERR_CNT, /* u64 */
253 __SMC_NLA_STATS_MAX,
254 SMC_NLA_STATS_MAX = __SMC_NLA_STATS_MAX - 1
255};
256
257/* SMC_GEN_FBACK_STATS attributes */
258enum {
259 SMC_NLA_FBACK_STATS_PAD,
260 SMC_NLA_FBACK_STATS_TYPE, /* u8 */
261 SMC_NLA_FBACK_STATS_SRV_CNT, /* u64 */
262 SMC_NLA_FBACK_STATS_CLNT_CNT, /* u64 */
263 SMC_NLA_FBACK_STATS_RSN_CODE, /* u32 */
264 SMC_NLA_FBACK_STATS_RSN_CNT, /* u16 */
265 __SMC_NLA_FBACK_STATS_MAX,
266 SMC_NLA_FBACK_STATS_MAX = __SMC_NLA_FBACK_STATS_MAX - 1
267};
268
269/* SMC_NETLINK_UEID attributes */
270enum {
271 SMC_NLA_EID_TABLE_UNSPEC,
272 SMC_NLA_EID_TABLE_ENTRY, /* string */
273 __SMC_NLA_EID_TABLE_MAX,
274 SMC_NLA_EID_TABLE_MAX = __SMC_NLA_EID_TABLE_MAX - 1
275};
276
277/* SMC_NETLINK_SEID attributes */
278enum {
279 SMC_NLA_SEID_UNSPEC,
280 SMC_NLA_SEID_ENTRY, /* string */
281 SMC_NLA_SEID_ENABLED, /* u8 */
282 __SMC_NLA_SEID_TABLE_MAX,
283 SMC_NLA_SEID_TABLE_MAX = __SMC_NLA_SEID_TABLE_MAX - 1
284};
36#endif /* _LINUX_SMC_H */285#endif /* _LINUX_SMC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/snmp.h+27
...@@ -159,6 +159,7 @@ enum...@@ -159,6 +159,7 @@ enum
159 UDP_MIB_SNDBUFERRORS, /* SndbufErrors */159 UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
160 UDP_MIB_CSUMERRORS, /* InCsumErrors */160 UDP_MIB_CSUMERRORS, /* InCsumErrors */
161 UDP_MIB_IGNOREDMULTI, /* IgnoredMulti */161 UDP_MIB_IGNOREDMULTI, /* IgnoredMulti */
162 UDP_MIB_MEMERRORS, /* MemErrors */
162 __UDP_MIB_MAX163 __UDP_MIB_MAX
163};164};
164165
...@@ -243,6 +244,7 @@ enum...@@ -243,6 +244,7 @@ enum
243 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */244 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
244 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */245 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
245 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */246 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
247 LINUX_MIB_TCPBACKLOGCOALESCE, /* TCPBacklogCoalesce */
246 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */248 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
247 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */249 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
248 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */250 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
...@@ -282,6 +284,14 @@ enum...@@ -282,6 +284,14 @@ enum
282 LINUX_MIB_TCPACKCOMPRESSED, /* TCPAckCompressed */284 LINUX_MIB_TCPACKCOMPRESSED, /* TCPAckCompressed */
283 LINUX_MIB_TCPZEROWINDOWDROP, /* TCPZeroWindowDrop */285 LINUX_MIB_TCPZEROWINDOWDROP, /* TCPZeroWindowDrop */
284 LINUX_MIB_TCPRCVQDROP, /* TCPRcvQDrop */286 LINUX_MIB_TCPRCVQDROP, /* TCPRcvQDrop */
287 LINUX_MIB_TCPWQUEUETOOBIG, /* TCPWqueueTooBig */
288 LINUX_MIB_TCPFASTOPENPASSIVEALTKEY, /* TCPFastOpenPassiveAltKey */
289 LINUX_MIB_TCPTIMEOUTREHASH, /* TCPTimeoutRehash */
290 LINUX_MIB_TCPDUPLICATEDATAREHASH, /* TCPDuplicateDataRehash */
291 LINUX_MIB_TCPDSACKRECVSEGS, /* TCPDSACKRecvSegs */
292 LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */
293 LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */
294 LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */
285 __LINUX_MIB_MAX295 __LINUX_MIB_MAX
286};296};
287297
...@@ -320,4 +330,21 @@ enum...@@ -320,4 +330,21 @@ enum
320 __LINUX_MIB_XFRMMAX330 __LINUX_MIB_XFRMMAX
321};331};
322332
333/* linux TLS mib definitions */
334enum
335{
336 LINUX_MIB_TLSNUM = 0,
337 LINUX_MIB_TLSCURRTXSW, /* TlsCurrTxSw */
338 LINUX_MIB_TLSCURRRXSW, /* TlsCurrRxSw */
339 LINUX_MIB_TLSCURRTXDEVICE, /* TlsCurrTxDevice */
340 LINUX_MIB_TLSCURRRXDEVICE, /* TlsCurrRxDevice */
341 LINUX_MIB_TLSTXSW, /* TlsTxSw */
342 LINUX_MIB_TLSRXSW, /* TlsRxSw */
343 LINUX_MIB_TLSTXDEVICE, /* TlsTxDevice */
344 LINUX_MIB_TLSRXDEVICE, /* TlsRxDevice */
345 LINUX_MIB_TLSDECRYPTERROR, /* TlsDecryptError */
346 LINUX_MIB_TLSRXDEVICERESYNC, /* TlsRxDeviceResync */
347 __LINUX_MIB_TLSMAX
348};
349
323#endif /* _LINUX_SNMP_H */350#endif /* _LINUX_SNMP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sock_diag.h+26
...@@ -36,4 +36,30 @@ enum sknetlink_groups {...@@ -36,4 +36,30 @@ enum sknetlink_groups {
36};36};
37#define SKNLGRP_MAX (__SKNLGRP_MAX - 1)37#define SKNLGRP_MAX (__SKNLGRP_MAX - 1)
3838
39enum {
40 SK_DIAG_BPF_STORAGE_REQ_NONE,
41 SK_DIAG_BPF_STORAGE_REQ_MAP_FD,
42 __SK_DIAG_BPF_STORAGE_REQ_MAX,
43};
44
45#define SK_DIAG_BPF_STORAGE_REQ_MAX (__SK_DIAG_BPF_STORAGE_REQ_MAX - 1)
46
47enum {
48 SK_DIAG_BPF_STORAGE_REP_NONE,
49 SK_DIAG_BPF_STORAGE,
50 __SK_DIAG_BPF_STORAGE_REP_MAX,
51};
52
53#define SK_DIAB_BPF_STORAGE_REP_MAX (__SK_DIAG_BPF_STORAGE_REP_MAX - 1)
54
55enum {
56 SK_DIAG_BPF_STORAGE_NONE,
57 SK_DIAG_BPF_STORAGE_PAD,
58 SK_DIAG_BPF_STORAGE_MAP_ID,
59 SK_DIAG_BPF_STORAGE_MAP_VALUE,
60 __SK_DIAG_BPF_STORAGE_MAX,
61};
62
63#define SK_DIAG_BPF_STORAGE_MAX (__SK_DIAG_BPF_STORAGE_MAX - 1)
64
39#endif /* __SOCK_DIAG_H__ */65#endif /* __SOCK_DIAG_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/socket.h+18-6
...@@ -6,17 +6,29 @@...@@ -6,17 +6,29 @@
6 * Desired design of maximum size and alignment (see RFC2553)6 * Desired design of maximum size and alignment (see RFC2553)
7 */7 */
8#define _K_SS_MAXSIZE 128 /* Implementation specific max size */8#define _K_SS_MAXSIZE 128 /* Implementation specific max size */
9#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
10 /* Implementation specific desired alignment */
119
12typedef unsigned short __kernel_sa_family_t;10typedef unsigned short __kernel_sa_family_t;
1311
12/*
13 * The definition uses anonymous union and struct in order to control the
14 * default alignment.
15 */
14struct __kernel_sockaddr_storage {16struct __kernel_sockaddr_storage {
15 __kernel_sa_family_t ss_family; /* address family */17 union {
16 /* Following field(s) are implementation specific */18 struct {
17 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];19 __kernel_sa_family_t ss_family; /* address family */
20 /* Following field(s) are implementation specific */
21 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
18 /* space to achieve desired size, */22 /* space to achieve desired size, */
19 /* _SS_MAXSIZE value minus size of ss_family */23 /* _SS_MAXSIZE value minus size of ss_family */
20} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */24 };
25 void *__align; /* implementation specific desired alignment */
26 };
27};
28
29#define SOCK_SNDBUF_LOCK 1
30#define SOCK_RCVBUF_LOCK 2
31
32#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK)
2133
22#endif /* _LINUX_SOCKET_H */34#endif /* _LINUX_SOCKET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sockios.h+21
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#ifndef _LINUX_SOCKIOS_H19#ifndef _LINUX_SOCKIOS_H
20#define _LINUX_SOCKIOS_H20#define _LINUX_SOCKIOS_H
2121
22#include <asm/bitsperlong.h>
22#include <asm/sockios.h>23#include <asm/sockios.h>
2324
24/* Linux-specific socket ioctls */25/* Linux-specific socket ioctls */
...@@ -27,6 +28,26 @@...@@ -27,6 +28,26 @@
2728
28#define SOCK_IOC_TYPE 0x8929#define SOCK_IOC_TYPE 0x89
2930
31/*
32 * the timeval/timespec data structure layout is defined by libc,
33 * so we need to cover both possible versions on 32-bit.
34 */
35/* Get stamp (timeval) */
36#define SIOCGSTAMP_NEW _IOR(SOCK_IOC_TYPE, 0x06, long long[2])
37/* Get stamp (timespec) */
38#define SIOCGSTAMPNS_NEW _IOR(SOCK_IOC_TYPE, 0x07, long long[2])
39
40#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
41/* on 64-bit and x32, avoid the ?: operator */
42#define SIOCGSTAMP SIOCGSTAMP_OLD
43#define SIOCGSTAMPNS SIOCGSTAMPNS_OLD
44#else
45#define SIOCGSTAMP ((sizeof(struct timeval)) == 8 ? \
46 SIOCGSTAMP_OLD : SIOCGSTAMP_NEW)
47#define SIOCGSTAMPNS ((sizeof(struct timespec)) == 8 ? \
48 SIOCGSTAMPNS_OLD : SIOCGSTAMPNS_NEW)
49#endif
50
30/* Routing table calls. */51/* Routing table calls. */
31#define SIOCADDRT 0x890B /* add routing table entry */52#define SIOCADDRT 0x890B /* add routing table entry */
32#define SIOCDELRT 0x890C /* delete routing table entry */53#define SIOCDELRT 0x890C /* delete routing table entry */
lib/libc/include/any-linux-any/linux/spi/spi.h created+41
...@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _SPI_H
3#define _SPI_H
4
5#include <linux/const.h>
6
7#define SPI_CPHA _BITUL(0) /* clock phase */
8#define SPI_CPOL _BITUL(1) /* clock polarity */
9
10#define SPI_MODE_0 (0|0) /* (original MicroWire) */
11#define SPI_MODE_1 (0|SPI_CPHA)
12#define SPI_MODE_2 (SPI_CPOL|0)
13#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
14#define SPI_MODE_X_MASK (SPI_CPOL|SPI_CPHA)
15
16#define SPI_CS_HIGH _BITUL(2) /* chipselect active high? */
17#define SPI_LSB_FIRST _BITUL(3) /* per-word bits-on-wire */
18#define SPI_3WIRE _BITUL(4) /* SI/SO signals shared */
19#define SPI_LOOP _BITUL(5) /* loopback mode */
20#define SPI_NO_CS _BITUL(6) /* 1 dev/bus, no chipselect */
21#define SPI_READY _BITUL(7) /* slave pulls low to pause */
22#define SPI_TX_DUAL _BITUL(8) /* transmit with 2 wires */
23#define SPI_TX_QUAD _BITUL(9) /* transmit with 4 wires */
24#define SPI_RX_DUAL _BITUL(10) /* receive with 2 wires */
25#define SPI_RX_QUAD _BITUL(11) /* receive with 4 wires */
26#define SPI_CS_WORD _BITUL(12) /* toggle cs after each word */
27#define SPI_TX_OCTAL _BITUL(13) /* transmit with 8 wires */
28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
30
31/*
32 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
33 * The SPI_MODE_USER_MASK has the SPI_MODE_KERNEL_MASK counterpart in
34 * 'include/linux/spi/spi.h'. The bits defined here are from bit 0 upwards
35 * while in SPI_MODE_KERNEL_MASK they are from the other end downwards.
36 * These bits must not overlap. A static assert check should make sure of that.
37 * If adding extra bits, make sure to increase the bit index below as well.
38 */
39#define SPI_MODE_USER_MASK (_BITUL(16) - 1)
40
41#endif /* _SPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/spi/spidev.h+6-26
...@@ -25,31 +25,7 @@...@@ -25,31 +25,7 @@
2525
26#include <linux/types.h>26#include <linux/types.h>
27#include <linux/ioctl.h>27#include <linux/ioctl.h>
2828#include <linux/spi/spi.h>
29/* User space versions of kernel symbols for SPI clocking modes,
30 * matching <linux/spi/spi.h>
31 */
32
33#define SPI_CPHA 0x01
34#define SPI_CPOL 0x02
35
36#define SPI_MODE_0 (0|0)
37#define SPI_MODE_1 (0|SPI_CPHA)
38#define SPI_MODE_2 (SPI_CPOL|0)
39#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
40
41#define SPI_CS_HIGH 0x04
42#define SPI_LSB_FIRST 0x08
43#define SPI_3WIRE 0x10
44#define SPI_LOOP 0x20
45#define SPI_NO_CS 0x40
46#define SPI_READY 0x80
47#define SPI_TX_DUAL 0x100
48#define SPI_TX_QUAD 0x200
49#define SPI_RX_DUAL 0x400
50#define SPI_RX_QUAD 0x800
51
52/*---------------------------------------------------------------------------*/
5329
54/* IOCTL commands */30/* IOCTL commands */
5531
...@@ -66,6 +42,9 @@...@@ -66,6 +42,9 @@
66 * @delay_usecs: If nonzero, how long to delay after the last bit transfer42 * @delay_usecs: If nonzero, how long to delay after the last bit transfer
67 * before optionally deselecting the device before the next transfer.43 * before optionally deselecting the device before the next transfer.
68 * @cs_change: True to deselect device before starting the next transfer.44 * @cs_change: True to deselect device before starting the next transfer.
45 * @word_delay_usecs: If nonzero, how long to wait between words within one
46 * transfer. This property needs explicit support in the SPI controller,
47 * otherwise it is silently ignored.
69 *48 *
70 * This structure is mapped directly to the kernel spi_transfer structure;49 * This structure is mapped directly to the kernel spi_transfer structure;
71 * the fields have the same meanings, except of course that the pointers50 * the fields have the same meanings, except of course that the pointers
...@@ -100,7 +79,8 @@ struct spi_ioc_transfer {...@@ -100,7 +79,8 @@ struct spi_ioc_transfer {
100 __u8 cs_change;79 __u8 cs_change;
101 __u8 tx_nbits;80 __u8 tx_nbits;
102 __u8 rx_nbits;81 __u8 rx_nbits;
103 __u16 pad;82 __u8 word_delay_usecs;
83 __u8 pad;
10484
105 /* If the contents of 'struct spi_ioc_transfer' ever change85 /* If the contents of 'struct spi_ioc_transfer' ever change
106 * incompatibly, then the ioctl number (currently 0) must change;86 * incompatibly, then the ioctl number (currently 0) must change;
lib/libc/include/any-linux-any/linux/stat.h+21-5
...@@ -123,7 +123,10 @@ struct statx {...@@ -123,7 +123,10 @@ struct statx {
123 __u32 stx_dev_major; /* ID of device containing file [uncond] */123 __u32 stx_dev_major; /* ID of device containing file [uncond] */
124 __u32 stx_dev_minor;124 __u32 stx_dev_minor;
125 /* 0x90 */125 /* 0x90 */
126 __u64 __spare2[14]; /* Spare space for future expansion */126 __u64 stx_mnt_id;
127 __u64 __spare2;
128 /* 0xa0 */
129 __u64 __spare3[12]; /* Spare space for future expansion */
127 /* 0x100 */130 /* 0x100 */
128};131};
129132
...@@ -148,9 +151,17 @@ struct statx {...@@ -148,9 +151,17 @@ struct statx {
148#define STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */151#define STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */
149#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */152#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */
150#define STATX_BTIME 0x00000800U /* Want/got stx_btime */153#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
151#define STATX_ALL 0x00000fffU /* All currently supported flags */154#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
155
152#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */156#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
153157
158/*
159 * This is deprecated, and shall remain the same value in the future. To avoid
160 * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME)
161 * instead.
162 */
163#define STATX_ALL 0x00000fffU
164
154/*165/*
155 * Attributes to be found in stx_attributes and masked in stx_attributes_mask.166 * Attributes to be found in stx_attributes and masked in stx_attributes_mask.
156 *167 *
...@@ -158,17 +169,22 @@ struct statx {...@@ -158,17 +169,22 @@ struct statx {
158 * be of use to ordinary userspace programs such as GUIs or ls rather than169 * be of use to ordinary userspace programs such as GUIs or ls rather than
159 * specialised tools.170 * specialised tools.
160 *171 *
161 * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS172 * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags
162 * semantically. Where possible, the numerical value is picked to correspond173 * semantically. Where possible, the numerical value is picked to correspond
163 * also.174 * also. Note that the DAX attribute indicates that the file is in the CPU
175 * direct access state. It does not correspond to the per-inode flag that
176 * some filesystems support.
177 *
164 */178 */
165#define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */179#define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */
166#define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */180#define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */
167#define STATX_ATTR_APPEND 0x00000020 /* [I] File is append-only */181#define STATX_ATTR_APPEND 0x00000020 /* [I] File is append-only */
168#define STATX_ATTR_NODUMP 0x00000040 /* [I] File is not to be dumped */182#define STATX_ATTR_NODUMP 0x00000040 /* [I] File is not to be dumped */
169#define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */183#define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */
170
171#define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */184#define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */
185#define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */
186#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */
187#define STATX_ATTR_DAX 0x00200000 /* File is currently in DAX state */
172188
173189
174#endif /* _LINUX_STAT_H */190#endif /* _LINUX_STAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stddef.h+38-1
...@@ -3,4 +3,41 @@...@@ -3,4 +3,41 @@
33
4#ifndef __always_inline4#ifndef __always_inline
5#define __always_inline __inline__5#define __always_inline __inline__
6#endif
\ No newline at end of file
6#endif
7
8/**
9 * __struct_group() - Create a mirrored named and anonyomous struct
10 *
11 * @TAG: The tag name for the named sub-struct (usually empty)
12 * @NAME: The identifier name of the mirrored sub-struct
13 * @ATTRS: Any struct attributes (usually empty)
14 * @MEMBERS: The member declarations for the mirrored structs
15 *
16 * Used to create an anonymous union of two structs with identical layout
17 * and size: one anonymous and one named. The former's members can be used
18 * normally without sub-struct naming, and the latter can be used to
19 * reason about the start, end, and size of the group of struct members.
20 * The named struct can also be explicitly tagged for layer reuse, as well
21 * as both having struct attributes appended.
22 */
23#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
24 union { \
25 struct { MEMBERS } ATTRS; \
26 struct TAG { MEMBERS } ATTRS NAME; \
27 }
28
29/**
30 * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
31 *
32 * @TYPE: The type of each flexible array element
33 * @NAME: The name of the flexible array member
34 *
35 * In order to have a flexible array member in a union or alone in a
36 * struct, it needs to be wrapped in an anonymous struct with at least 1
37 * named member, but that member can be empty.
38 */
39#define __DECLARE_FLEX_ARRAY(TYPE, NAME) \
40 struct { \
41 struct { } __empty_ ## NAME; \
42 TYPE NAME[]; \
43 }
\ No newline at end of file
lib/libc/include/any-linux-any/linux/surface_aggregator/cdev.h created+147
...@@ -0,0 +1,147 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Surface System Aggregator Module (SSAM) user-space EC interface.
4 *
5 * Definitions, structs, and IOCTLs for the /dev/surface/aggregator misc
6 * device. This device provides direct user-space access to the SSAM EC.
7 * Intended for debugging and development.
8 *
9 * Copyright (C) 2020-2021 Maximilian Luz <luzmaximilian@gmail.com>
10 */
11
12#ifndef _LINUX_SURFACE_AGGREGATOR_CDEV_H
13#define _LINUX_SURFACE_AGGREGATOR_CDEV_H
14
15#include <linux/ioctl.h>
16#include <linux/types.h>
17
18/**
19 * enum ssam_cdev_request_flags - Request flags for SSAM cdev request IOCTL.
20 *
21 * @SSAM_CDEV_REQUEST_HAS_RESPONSE:
22 * Specifies that the request expects a response. If not set, the request
23 * will be directly completed after its underlying packet has been
24 * transmitted. If set, the request transport system waits for a response
25 * of the request.
26 *
27 * @SSAM_CDEV_REQUEST_UNSEQUENCED:
28 * Specifies that the request should be transmitted via an unsequenced
29 * packet. If set, the request must not have a response, meaning that this
30 * flag and the %SSAM_CDEV_REQUEST_HAS_RESPONSE flag are mutually
31 * exclusive.
32 */
33enum ssam_cdev_request_flags {
34 SSAM_CDEV_REQUEST_HAS_RESPONSE = 0x01,
35 SSAM_CDEV_REQUEST_UNSEQUENCED = 0x02,
36};
37
38/**
39 * struct ssam_cdev_request - Controller request IOCTL argument.
40 * @target_category: Target category of the SAM request.
41 * @target_id: Target ID of the SAM request.
42 * @command_id: Command ID of the SAM request.
43 * @instance_id: Instance ID of the SAM request.
44 * @flags: Request flags (see &enum ssam_cdev_request_flags).
45 * @status: Request status (output).
46 * @payload: Request payload (input data).
47 * @payload.data: Pointer to request payload data.
48 * @payload.length: Length of request payload data (in bytes).
49 * @response: Request response (output data).
50 * @response.data: Pointer to response buffer.
51 * @response.length: On input: Capacity of response buffer (in bytes).
52 * On output: Length of request response (number of bytes
53 * in the buffer that are actually used).
54 */
55struct ssam_cdev_request {
56 __u8 target_category;
57 __u8 target_id;
58 __u8 command_id;
59 __u8 instance_id;
60 __u16 flags;
61 __s16 status;
62
63 struct {
64 __u64 data;
65 __u16 length;
66 __u8 __pad[6];
67 } payload;
68
69 struct {
70 __u64 data;
71 __u16 length;
72 __u8 __pad[6];
73 } response;
74} __attribute__((__packed__));
75
76/**
77 * struct ssam_cdev_notifier_desc - Notifier descriptor.
78 * @priority: Priority value determining the order in which notifier
79 * callbacks will be called. A higher value means higher
80 * priority, i.e. the associated callback will be executed
81 * earlier than other (lower priority) callbacks.
82 * @target_category: The event target category for which this notifier should
83 * receive events.
84 *
85 * Specifies the notifier that should be registered or unregistered,
86 * specifically with which priority and for which target category of events.
87 */
88struct ssam_cdev_notifier_desc {
89 __s32 priority;
90 __u8 target_category;
91} __attribute__((__packed__));
92
93/**
94 * struct ssam_cdev_event_desc - Event descriptor.
95 * @reg: Registry via which the event will be enabled/disabled.
96 * @reg.target_category: Target category for the event registry requests.
97 * @reg.target_id: Target ID for the event registry requests.
98 * @reg.cid_enable: Command ID for the event-enable request.
99 * @reg.cid_disable: Command ID for the event-disable request.
100 * @id: ID specifying the event.
101 * @id.target_category: Target category of the event source.
102 * @id.instance: Instance ID of the event source.
103 * @flags: Flags used for enabling the event.
104 *
105 * Specifies which event should be enabled/disabled and how to do that.
106 */
107struct ssam_cdev_event_desc {
108 struct {
109 __u8 target_category;
110 __u8 target_id;
111 __u8 cid_enable;
112 __u8 cid_disable;
113 } reg;
114
115 struct {
116 __u8 target_category;
117 __u8 instance;
118 } id;
119
120 __u8 flags;
121} __attribute__((__packed__));
122
123/**
124 * struct ssam_cdev_event - SSAM event sent by the EC.
125 * @target_category: Target category of the event source. See &enum ssam_ssh_tc.
126 * @target_id: Target ID of the event source.
127 * @command_id: Command ID of the event.
128 * @instance_id: Instance ID of the event source.
129 * @length: Length of the event payload in bytes.
130 * @data: Event payload data.
131 */
132struct ssam_cdev_event {
133 __u8 target_category;
134 __u8 target_id;
135 __u8 command_id;
136 __u8 instance_id;
137 __u16 length;
138 __u8 data[];
139} __attribute__((__packed__));
140
141#define SSAM_CDEV_REQUEST _IOWR(0xA5, 1, struct ssam_cdev_request)
142#define SSAM_CDEV_NOTIF_REGISTER _IOW(0xA5, 2, struct ssam_cdev_notifier_desc)
143#define SSAM_CDEV_NOTIF_UNREGISTER _IOW(0xA5, 3, struct ssam_cdev_notifier_desc)
144#define SSAM_CDEV_EVENT_ENABLE _IOW(0xA5, 4, struct ssam_cdev_event_desc)
145#define SSAM_CDEV_EVENT_DISABLE _IOW(0xA5, 5, struct ssam_cdev_event_desc)
146
147#endif /* _LINUX_SURFACE_AGGREGATOR_CDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/surface_aggregator/dtx.h created+146
...@@ -0,0 +1,146 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Surface DTX (clipboard detachment system driver) user-space interface.
4 *
5 * Definitions, structs, and IOCTLs for the /dev/surface/dtx misc device. This
6 * device allows user-space to control the clipboard detachment process on
7 * Surface Book series devices.
8 *
9 * Copyright (C) 2020-2021 Maximilian Luz <luzmaximilian@gmail.com>
10 */
11
12#ifndef _LINUX_SURFACE_AGGREGATOR_DTX_H
13#define _LINUX_SURFACE_AGGREGATOR_DTX_H
14
15#include <linux/ioctl.h>
16#include <linux/types.h>
17
18/* Status/error categories */
19#define SDTX_CATEGORY_STATUS 0x0000
20#define SDTX_CATEGORY_RUNTIME_ERROR 0x1000
21#define SDTX_CATEGORY_HARDWARE_ERROR 0x2000
22#define SDTX_CATEGORY_UNKNOWN 0xf000
23
24#define SDTX_CATEGORY_MASK 0xf000
25#define SDTX_CATEGORY(value) ((value) & SDTX_CATEGORY_MASK)
26
27#define SDTX_STATUS(code) ((code) | SDTX_CATEGORY_STATUS)
28#define SDTX_ERR_RT(code) ((code) | SDTX_CATEGORY_RUNTIME_ERROR)
29#define SDTX_ERR_HW(code) ((code) | SDTX_CATEGORY_HARDWARE_ERROR)
30#define SDTX_UNKNOWN(code) ((code) | SDTX_CATEGORY_UNKNOWN)
31
32#define SDTX_SUCCESS(value) (SDTX_CATEGORY(value) == SDTX_CATEGORY_STATUS)
33
34/* Latch status values */
35#define SDTX_LATCH_CLOSED SDTX_STATUS(0x00)
36#define SDTX_LATCH_OPENED SDTX_STATUS(0x01)
37
38/* Base state values */
39#define SDTX_BASE_DETACHED SDTX_STATUS(0x00)
40#define SDTX_BASE_ATTACHED SDTX_STATUS(0x01)
41
42/* Runtime errors (non-critical) */
43#define SDTX_DETACH_NOT_FEASIBLE SDTX_ERR_RT(0x01)
44#define SDTX_DETACH_TIMEDOUT SDTX_ERR_RT(0x02)
45
46/* Hardware errors (critical) */
47#define SDTX_ERR_FAILED_TO_OPEN SDTX_ERR_HW(0x01)
48#define SDTX_ERR_FAILED_TO_REMAIN_OPEN SDTX_ERR_HW(0x02)
49#define SDTX_ERR_FAILED_TO_CLOSE SDTX_ERR_HW(0x03)
50
51/* Base types */
52#define SDTX_DEVICE_TYPE_HID 0x0100
53#define SDTX_DEVICE_TYPE_SSH 0x0200
54
55#define SDTX_DEVICE_TYPE_MASK 0x0f00
56#define SDTX_DEVICE_TYPE(value) ((value) & SDTX_DEVICE_TYPE_MASK)
57
58#define SDTX_BASE_TYPE_HID(id) ((id) | SDTX_DEVICE_TYPE_HID)
59#define SDTX_BASE_TYPE_SSH(id) ((id) | SDTX_DEVICE_TYPE_SSH)
60
61/**
62 * enum sdtx_device_mode - Mode describing how (and if) the clipboard is
63 * attached to the base of the device.
64 * @SDTX_DEVICE_MODE_TABLET: The clipboard is detached from the base and the
65 * device operates as tablet.
66 * @SDTX_DEVICE_MODE_LAPTOP: The clipboard is attached normally to the base
67 * and the device operates as laptop.
68 * @SDTX_DEVICE_MODE_STUDIO: The clipboard is attached to the base in reverse.
69 * The device operates as tablet with keyboard and
70 * touchpad deactivated, however, the base battery
71 * and, if present in the specific device model, dGPU
72 * are available to the system.
73 */
74enum sdtx_device_mode {
75 SDTX_DEVICE_MODE_TABLET = 0x00,
76 SDTX_DEVICE_MODE_LAPTOP = 0x01,
77 SDTX_DEVICE_MODE_STUDIO = 0x02,
78};
79
80/**
81 * struct sdtx_event - Event provided by reading from the DTX device file.
82 * @length: Length of the event payload, in bytes.
83 * @code: Event code, detailing what type of event this is.
84 * @data: Payload of the event, containing @length bytes.
85 *
86 * See &enum sdtx_event_code for currently valid event codes.
87 */
88struct sdtx_event {
89 __u16 length;
90 __u16 code;
91 __u8 data[];
92} __attribute__((__packed__));
93
94/**
95 * enum sdtx_event_code - Code describing the type of an event.
96 * @SDTX_EVENT_REQUEST: Detachment request event type.
97 * @SDTX_EVENT_CANCEL: Cancel detachment process event type.
98 * @SDTX_EVENT_BASE_CONNECTION: Base/clipboard connection change event type.
99 * @SDTX_EVENT_LATCH_STATUS: Latch status change event type.
100 * @SDTX_EVENT_DEVICE_MODE: Device mode change event type.
101 *
102 * Used in &struct sdtx_event to describe the type of the event. Further event
103 * codes are reserved for future use. Any event parser should be able to
104 * gracefully handle unknown events, i.e. by simply skipping them.
105 *
106 * Consult the DTX user-space interface documentation for details regarding
107 * the individual event types.
108 */
109enum sdtx_event_code {
110 SDTX_EVENT_REQUEST = 1,
111 SDTX_EVENT_CANCEL = 2,
112 SDTX_EVENT_BASE_CONNECTION = 3,
113 SDTX_EVENT_LATCH_STATUS = 4,
114 SDTX_EVENT_DEVICE_MODE = 5,
115};
116
117/**
118 * struct sdtx_base_info - Describes if and what type of base is connected.
119 * @state: The state of the connection. Valid values are %SDTX_BASE_DETACHED,
120 * %SDTX_BASE_ATTACHED, and %SDTX_DETACH_NOT_FEASIBLE (in case a base
121 * is attached but low clipboard battery prevents detachment). Other
122 * values are currently reserved.
123 * @base_id: The type of base connected. Zero if no base is connected.
124 */
125struct sdtx_base_info {
126 __u16 state;
127 __u16 base_id;
128} __attribute__((__packed__));
129
130/* IOCTLs */
131#define SDTX_IOCTL_EVENTS_ENABLE _IO(0xa5, 0x21)
132#define SDTX_IOCTL_EVENTS_DISABLE _IO(0xa5, 0x22)
133
134#define SDTX_IOCTL_LATCH_LOCK _IO(0xa5, 0x23)
135#define SDTX_IOCTL_LATCH_UNLOCK _IO(0xa5, 0x24)
136
137#define SDTX_IOCTL_LATCH_REQUEST _IO(0xa5, 0x25)
138#define SDTX_IOCTL_LATCH_CONFIRM _IO(0xa5, 0x26)
139#define SDTX_IOCTL_LATCH_HEARTBEAT _IO(0xa5, 0x27)
140#define SDTX_IOCTL_LATCH_CANCEL _IO(0xa5, 0x28)
141
142#define SDTX_IOCTL_GET_BASE_INFO _IOR(0xa5, 0x29, struct sdtx_base_info)
143#define SDTX_IOCTL_GET_DEVICE_MODE _IOR(0xa5, 0x2a, __u16)
144#define SDTX_IOCTL_GET_LATCH_STATUS _IOR(0xa5, 0x2b, __u16)
145
146#endif /* _LINUX_SURFACE_AGGREGATOR_DTX_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/swab.h+10
...@@ -4,6 +4,7 @@...@@ -4,6 +4,7 @@
44
5#include <linux/types.h>5#include <linux/types.h>
66
7#include <asm/bitsperlong.h>
7#include <asm/swab.h>8#include <asm/swab.h>
89
9/*10/*
...@@ -132,6 +133,15 @@ static __inline__ __u32 __fswahb32(__u32 val)...@@ -132,6 +133,15 @@ static __inline__ __u32 __fswahb32(__u32 val)
132 __fswab64(x))133 __fswab64(x))
133#endif134#endif
134135
136static __always_inline unsigned long __swab(const unsigned long y)
137{
138#if __BITS_PER_LONG == 64
139 return __swab64(y);
140#else /* __BITS_PER_LONG == 32 */
141 return __swab32(y);
142#endif
143}
144
135/**145/**
136 * __swahw32 - return a word-swapped 32-bit value146 * __swahw32 - return a word-swapped 32-bit value
137 * @x: value to wordswap147 * @x: value to wordswap
lib/libc/include/any-linux-any/linux/switchtec_ioctl.h+27-3
...@@ -32,7 +32,18 @@...@@ -32,7 +32,18 @@
32#define SWITCHTEC_IOCTL_PART_VENDOR5 1032#define SWITCHTEC_IOCTL_PART_VENDOR5 10
33#define SWITCHTEC_IOCTL_PART_VENDOR6 1133#define SWITCHTEC_IOCTL_PART_VENDOR6 11
34#define SWITCHTEC_IOCTL_PART_VENDOR7 1234#define SWITCHTEC_IOCTL_PART_VENDOR7 12
35#define SWITCHTEC_IOCTL_NUM_PARTITIONS 1335#define SWITCHTEC_IOCTL_PART_BL2_0 13
36#define SWITCHTEC_IOCTL_PART_BL2_1 14
37#define SWITCHTEC_IOCTL_PART_MAP_0 15
38#define SWITCHTEC_IOCTL_PART_MAP_1 16
39#define SWITCHTEC_IOCTL_PART_KEY_0 17
40#define SWITCHTEC_IOCTL_PART_KEY_1 18
41
42#define SWITCHTEC_NUM_PARTITIONS_GEN3 13
43#define SWITCHTEC_NUM_PARTITIONS_GEN4 19
44
45/* obsolete: for compatibility with old userspace software */
46#define SWITCHTEC_IOCTL_NUM_PARTITIONS SWITCHTEC_NUM_PARTITIONS_GEN3
3647
37struct switchtec_ioctl_flash_info {48struct switchtec_ioctl_flash_info {
38 __u64 flash_length;49 __u64 flash_length;
...@@ -50,7 +61,7 @@ struct switchtec_ioctl_flash_part_info {...@@ -50,7 +61,7 @@ struct switchtec_ioctl_flash_part_info {
50 __u32 active;61 __u32 active;
51};62};
5263
53struct switchtec_ioctl_event_summary {64struct switchtec_ioctl_event_summary_legacy {
54 __u64 global;65 __u64 global;
55 __u64 part_bitmap;66 __u64 part_bitmap;
56 __u32 local_part;67 __u32 local_part;
...@@ -59,6 +70,15 @@ struct switchtec_ioctl_event_summary {...@@ -59,6 +70,15 @@ struct switchtec_ioctl_event_summary {
59 __u32 pff[48];70 __u32 pff[48];
60};71};
6172
73struct switchtec_ioctl_event_summary {
74 __u64 global;
75 __u64 part_bitmap;
76 __u32 local_part;
77 __u32 padding;
78 __u32 part[48];
79 __u32 pff[255];
80};
81
62#define SWITCHTEC_IOCTL_EVENT_STACK_ERROR 082#define SWITCHTEC_IOCTL_EVENT_STACK_ERROR 0
63#define SWITCHTEC_IOCTL_EVENT_PPU_ERROR 183#define SWITCHTEC_IOCTL_EVENT_PPU_ERROR 1
64#define SWITCHTEC_IOCTL_EVENT_ISP_ERROR 284#define SWITCHTEC_IOCTL_EVENT_ISP_ERROR 2
...@@ -89,7 +109,9 @@ struct switchtec_ioctl_event_summary {...@@ -89,7 +109,9 @@ struct switchtec_ioctl_event_summary {
89#define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT 27109#define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT 27
90#define SWITCHTEC_IOCTL_EVENT_LINK_STATE 28110#define SWITCHTEC_IOCTL_EVENT_LINK_STATE 28
91#define SWITCHTEC_IOCTL_EVENT_GFMS 29111#define SWITCHTEC_IOCTL_EVENT_GFMS 29
92#define SWITCHTEC_IOCTL_MAX_EVENTS 30112#define SWITCHTEC_IOCTL_EVENT_INTERCOMM_REQ_NOTIFY 30
113#define SWITCHTEC_IOCTL_EVENT_UEC 31
114#define SWITCHTEC_IOCTL_MAX_EVENTS 32
93115
94#define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1116#define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1
95#define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2117#define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2
...@@ -127,6 +149,8 @@ struct switchtec_ioctl_pff_port {...@@ -127,6 +149,8 @@ struct switchtec_ioctl_pff_port {
127 _IOWR('W', 0x41, struct switchtec_ioctl_flash_part_info)149 _IOWR('W', 0x41, struct switchtec_ioctl_flash_part_info)
128#define SWITCHTEC_IOCTL_EVENT_SUMMARY \150#define SWITCHTEC_IOCTL_EVENT_SUMMARY \
129 _IOR('W', 0x42, struct switchtec_ioctl_event_summary)151 _IOR('W', 0x42, struct switchtec_ioctl_event_summary)
152#define SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY \
153 _IOR('W', 0x42, struct switchtec_ioctl_event_summary_legacy)
130#define SWITCHTEC_IOCTL_EVENT_CTL \154#define SWITCHTEC_IOCTL_EVENT_CTL \
131 _IOWR('W', 0x43, struct switchtec_ioctl_event_ctl)155 _IOWR('W', 0x43, struct switchtec_ioctl_event_ctl)
132#define SWITCHTEC_IOCTL_PFF_TO_PORT \156#define SWITCHTEC_IOCTL_PFF_TO_PORT \
lib/libc/include/any-linux-any/linux/sysctl.h+5-2
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
23#ifndef _LINUX_SYSCTL_H23#ifndef _LINUX_SYSCTL_H
24#define _LINUX_SYSCTL_H24#define _LINUX_SYSCTL_H
2525
26#include <linux/kernel.h>26#include <linux/const.h>
27#include <linux/types.h>27#include <linux/types.h>
2828
2929
...@@ -153,6 +153,7 @@ enum...@@ -153,6 +153,7 @@ enum
153 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */153 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
154 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */154 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
155 KERN_PANIC_ON_WARN=77, /* int: call panic() in WARN() functions */155 KERN_PANIC_ON_WARN=77, /* int: call panic() in WARN() functions */
156 KERN_PANIC_PRINT=78, /* ulong: bitmask to print system info on panic */
156};157};
157158
158159
...@@ -194,7 +195,7 @@ enum...@@ -194,7 +195,7 @@ enum
194 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */195 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
195 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */196 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
196 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */197 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
197 VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */198 VM_MIN_SLAB=35, /* Percent pages ignored by node reclaim */
198};199};
199200
200201
...@@ -481,6 +482,7 @@ enum...@@ -481,6 +482,7 @@ enum
481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,482 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
482 NET_IPV4_CONF_ARP_ACCEPT=21,483 NET_IPV4_CONF_ARP_ACCEPT=21,
483 NET_IPV4_CONF_ARP_NOTIFY=22,484 NET_IPV4_CONF_ARP_NOTIFY=22,
485 NET_IPV4_CONF_ARP_EVICT_NOCARRIER=23,
484};486};
485487
486/* /proc/sys/net/ipv4/netfilter */488/* /proc/sys/net/ipv4/netfilter */
...@@ -570,6 +572,7 @@ enum {...@@ -570,6 +572,7 @@ enum {
570 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,572 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
571 NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,573 NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,
572 NET_IPV6_ACCEPT_RA_RT_INFO_MIN_PLEN=27,574 NET_IPV6_ACCEPT_RA_RT_INFO_MIN_PLEN=27,
575 NET_IPV6_RA_DEFRTR_METRIC=28,
573 __NET_IPV6_MAX576 __NET_IPV6_MAX
574};577};
575578
lib/libc/include/any-linux-any/linux/target_core_user.h+27
...@@ -45,6 +45,8 @@...@@ -45,6 +45,8 @@
45#define ALIGN_SIZE 64 /* Should be enough for most CPUs */45#define ALIGN_SIZE 64 /* Should be enough for most CPUs */
46#define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */46#define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */
47#define TCMU_MAILBOX_FLAG_CAP_READ_LEN (1 << 1) /* Read data length */47#define TCMU_MAILBOX_FLAG_CAP_READ_LEN (1 << 1) /* Read data length */
48#define TCMU_MAILBOX_FLAG_CAP_TMR (1 << 2) /* TMR notifications */
49#define TCMU_MAILBOX_FLAG_CAP_KEEP_BUF (1<<3) /* Keep buf after cmd completion */
4850
49struct tcmu_mailbox {51struct tcmu_mailbox {
50 __u16 version;52 __u16 version;
...@@ -62,6 +64,7 @@ struct tcmu_mailbox {...@@ -62,6 +64,7 @@ struct tcmu_mailbox {
62enum tcmu_opcode {64enum tcmu_opcode {
63 TCMU_OP_PAD = 0,65 TCMU_OP_PAD = 0,
64 TCMU_OP_CMD,66 TCMU_OP_CMD,
67 TCMU_OP_TMR,
65};68};
6669
67/*70/*
...@@ -73,6 +76,7 @@ struct tcmu_cmd_entry_hdr {...@@ -73,6 +76,7 @@ struct tcmu_cmd_entry_hdr {
73 __u8 kflags;76 __u8 kflags;
74#define TCMU_UFLAG_UNKNOWN_OP 0x177#define TCMU_UFLAG_UNKNOWN_OP 0x1
75#define TCMU_UFLAG_READ_LEN 0x278#define TCMU_UFLAG_READ_LEN 0x2
79#define TCMU_UFLAG_KEEP_BUF 0x4
76 __u8 uflags;80 __u8 uflags;
7781
78} __attribute__((packed));82} __attribute__((packed));
...@@ -128,6 +132,29 @@ struct tcmu_cmd_entry {...@@ -128,6 +132,29 @@ struct tcmu_cmd_entry {
128132
129} __attribute__((packed));133} __attribute__((packed));
130134
135struct tcmu_tmr_entry {
136 struct tcmu_cmd_entry_hdr hdr;
137
138#define TCMU_TMR_UNKNOWN 0
139#define TCMU_TMR_ABORT_TASK 1
140#define TCMU_TMR_ABORT_TASK_SET 2
141#define TCMU_TMR_CLEAR_ACA 3
142#define TCMU_TMR_CLEAR_TASK_SET 4
143#define TCMU_TMR_LUN_RESET 5
144#define TCMU_TMR_TARGET_WARM_RESET 6
145#define TCMU_TMR_TARGET_COLD_RESET 7
146/* Pseudo reset due to received PR OUT */
147#define TCMU_TMR_LUN_RESET_PRO 128
148 __u8 tmr_type;
149
150 __u8 __pad1;
151 __u16 __pad2;
152 __u32 cmd_cnt;
153 __u64 __pad3;
154 __u64 __pad4;
155 __u16 cmd_ids[0];
156} __attribute__((packed));
157
131#define TCMU_OP_ALIGN_SIZE sizeof(__u64)158#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
132159
133enum tcmu_genl_cmd {160enum tcmu_genl_cmd {
lib/libc/include/any-linux-any/linux/taskstats.h+9-1
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
34 */34 */
3535
3636
37#define TASKSTATS_VERSION 837#define TASKSTATS_VERSION 10
38#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN38#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
39 * in linux/sched.h */39 * in linux/sched.h */
4040
...@@ -112,6 +112,7 @@ struct taskstats {...@@ -112,6 +112,7 @@ struct taskstats {
112 __u32 ac_gid; /* Group ID */112 __u32 ac_gid; /* Group ID */
113 __u32 ac_pid; /* Process ID */113 __u32 ac_pid; /* Process ID */
114 __u32 ac_ppid; /* Parent process ID */114 __u32 ac_ppid; /* Parent process ID */
115 /* __u32 range means times from 1970 to 2106 */
115 __u32 ac_btime; /* Begin time [sec since 1970] */116 __u32 ac_btime; /* Begin time [sec since 1970] */
116 __u64 ac_etime __attribute__((aligned(8)));117 __u64 ac_etime __attribute__((aligned(8)));
117 /* Elapsed time [usec] */118 /* Elapsed time [usec] */
...@@ -164,6 +165,13 @@ struct taskstats {...@@ -164,6 +165,13 @@ struct taskstats {
164 /* Delay waiting for memory reclaim */165 /* Delay waiting for memory reclaim */
165 __u64 freepages_count;166 __u64 freepages_count;
166 __u64 freepages_delay_total;167 __u64 freepages_delay_total;
168
169 /* Delay waiting for thrashing page */
170 __u64 thrashing_count;
171 __u64 thrashing_delay_total;
172
173 /* v10: 64-bit btime to avoid overflow */
174 __u64 ac_btime64; /* 64-bit begin time */
167};175};
168176
169177
lib/libc/include/any-linux-any/linux/tc_act/tc_bpf.h-2
...@@ -13,8 +13,6 @@...@@ -13,8 +13,6 @@
1313
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
1515
16#define TCA_ACT_BPF 13
17
18struct tc_act_bpf {16struct tc_act_bpf {
19 tc_gen;17 tc_gen;
20};18};
lib/libc/include/any-linux-any/linux/tc_act/tc_connmark.h-2
...@@ -5,8 +5,6 @@...@@ -5,8 +5,6 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
77
8#define TCA_ACT_CONNMARK 14
9
10struct tc_connmark {8struct tc_connmark {
11 tc_gen;9 tc_gen;
12 __u16 zone;10 __u16 zone;
lib/libc/include/any-linux-any/linux/tc_act/tc_csum.h-2
...@@ -5,8 +5,6 @@...@@ -5,8 +5,6 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
77
8#define TCA_ACT_CSUM 16
9
10enum {8enum {
11 TCA_CSUM_UNSPEC,9 TCA_CSUM_UNSPEC,
12 TCA_CSUM_PARMS,10 TCA_CSUM_PARMS,
lib/libc/include/any-linux-any/linux/tc_act/tc_ct.h created+41
...@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __UAPI_TC_CT_H
3#define __UAPI_TC_CT_H
4
5#include <linux/types.h>
6#include <linux/pkt_cls.h>
7
8enum {
9 TCA_CT_UNSPEC,
10 TCA_CT_PARMS,
11 TCA_CT_TM,
12 TCA_CT_ACTION, /* u16 */
13 TCA_CT_ZONE, /* u16 */
14 TCA_CT_MARK, /* u32 */
15 TCA_CT_MARK_MASK, /* u32 */
16 TCA_CT_LABELS, /* u128 */
17 TCA_CT_LABELS_MASK, /* u128 */
18 TCA_CT_NAT_IPV4_MIN, /* be32 */
19 TCA_CT_NAT_IPV4_MAX, /* be32 */
20 TCA_CT_NAT_IPV6_MIN, /* struct in6_addr */
21 TCA_CT_NAT_IPV6_MAX, /* struct in6_addr */
22 TCA_CT_NAT_PORT_MIN, /* be16 */
23 TCA_CT_NAT_PORT_MAX, /* be16 */
24 TCA_CT_PAD,
25 __TCA_CT_MAX
26};
27
28#define TCA_CT_MAX (__TCA_CT_MAX - 1)
29
30#define TCA_CT_ACT_COMMIT (1 << 0)
31#define TCA_CT_ACT_FORCE (1 << 1)
32#define TCA_CT_ACT_CLEAR (1 << 2)
33#define TCA_CT_ACT_NAT (1 << 3)
34#define TCA_CT_ACT_NAT_SRC (1 << 4)
35#define TCA_CT_ACT_NAT_DST (1 << 5)
36
37struct tc_ct {
38 tc_gen;
39};
40
41#endif /* __UAPI_TC_CT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_ctinfo.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __UAPI_TC_CTINFO_H
3#define __UAPI_TC_CTINFO_H
4
5#include <linux/types.h>
6#include <linux/pkt_cls.h>
7
8struct tc_ctinfo {
9 tc_gen;
10};
11
12enum {
13 TCA_CTINFO_UNSPEC,
14 TCA_CTINFO_PAD,
15 TCA_CTINFO_TM,
16 TCA_CTINFO_ACT,
17 TCA_CTINFO_ZONE,
18 TCA_CTINFO_PARMS_DSCP_MASK,
19 TCA_CTINFO_PARMS_DSCP_STATEMASK,
20 TCA_CTINFO_PARMS_CPMARK_MASK,
21 TCA_CTINFO_STATS_DSCP_SET,
22 TCA_CTINFO_STATS_DSCP_ERROR,
23 TCA_CTINFO_STATS_CPMARK_SET,
24 __TCA_CTINFO_MAX
25};
26
27#define TCA_CTINFO_MAX (__TCA_CTINFO_MAX - 1)
28
29#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_gact.h-1
...@@ -5,7 +5,6 @@...@@ -5,7 +5,6 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
77
8#define TCA_ACT_GACT 5
9struct tc_gact {8struct tc_gact {
10 tc_gen;9 tc_gen;
1110
lib/libc/include/any-linux-any/linux/tc_act/tc_gate.h created+47
...@@ -0,0 +1,47 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* Copyright 2020 NXP */
3
4#ifndef __LINUX_TC_GATE_H
5#define __LINUX_TC_GATE_H
6
7#include <linux/pkt_cls.h>
8
9struct tc_gate {
10 tc_gen;
11};
12
13enum {
14 TCA_GATE_ENTRY_UNSPEC,
15 TCA_GATE_ENTRY_INDEX,
16 TCA_GATE_ENTRY_GATE,
17 TCA_GATE_ENTRY_INTERVAL,
18 TCA_GATE_ENTRY_IPV,
19 TCA_GATE_ENTRY_MAX_OCTETS,
20 __TCA_GATE_ENTRY_MAX,
21};
22#define TCA_GATE_ENTRY_MAX (__TCA_GATE_ENTRY_MAX - 1)
23
24enum {
25 TCA_GATE_ONE_ENTRY_UNSPEC,
26 TCA_GATE_ONE_ENTRY,
27 __TCA_GATE_ONE_ENTRY_MAX,
28};
29#define TCA_GATE_ONE_ENTRY_MAX (__TCA_GATE_ONE_ENTRY_MAX - 1)
30
31enum {
32 TCA_GATE_UNSPEC,
33 TCA_GATE_TM,
34 TCA_GATE_PARMS,
35 TCA_GATE_PAD,
36 TCA_GATE_PRIORITY,
37 TCA_GATE_ENTRY_LIST,
38 TCA_GATE_BASE_TIME,
39 TCA_GATE_CYCLE_TIME,
40 TCA_GATE_CYCLE_TIME_EXT,
41 TCA_GATE_FLAGS,
42 TCA_GATE_CLOCKID,
43 __TCA_GATE_MAX,
44};
45#define TCA_GATE_MAX (__TCA_GATE_MAX - 1)
46
47#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_ife.h-1
...@@ -6,7 +6,6 @@...@@ -6,7 +6,6 @@
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7#include <linux/ife.h>7#include <linux/ife.h>
88
9#define TCA_ACT_IFE 25
10/* Flag bits for now just encoding/decoding; mutually exclusive */9/* Flag bits for now just encoding/decoding; mutually exclusive */
11#define IFE_ENCODE 110#define IFE_ENCODE 1
12#define IFE_DECODE 011#define IFE_DECODE 0
lib/libc/include/any-linux-any/linux/tc_act/tc_ipt.h-3
...@@ -4,9 +4,6 @@...@@ -4,9 +4,6 @@
44
5#include <linux/pkt_cls.h>5#include <linux/pkt_cls.h>
66
7#define TCA_ACT_IPT 6
8#define TCA_ACT_XT 10
9
10enum {7enum {
11 TCA_IPT_UNSPEC,8 TCA_IPT_UNSPEC,
12 TCA_IPT_TABLE,9 TCA_IPT_TABLE,
lib/libc/include/any-linux-any/linux/tc_act/tc_mirred.h-1
...@@ -5,7 +5,6 @@...@@ -5,7 +5,6 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
77
8#define TCA_ACT_MIRRED 8
9#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/8#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/
10#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */9#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
11#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/10#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
lib/libc/include/any-linux-any/linux/tc_act/tc_mpls.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (C) 2019 Netronome Systems, Inc. */
3
4#ifndef __LINUX_TC_MPLS_H
5#define __LINUX_TC_MPLS_H
6
7#include <linux/pkt_cls.h>
8
9#define TCA_MPLS_ACT_POP 1
10#define TCA_MPLS_ACT_PUSH 2
11#define TCA_MPLS_ACT_MODIFY 3
12#define TCA_MPLS_ACT_DEC_TTL 4
13#define TCA_MPLS_ACT_MAC_PUSH 5
14
15struct tc_mpls {
16 tc_gen; /* generic TC action fields. */
17 int m_action; /* action of type TCA_MPLS_ACT_*. */
18};
19
20enum {
21 TCA_MPLS_UNSPEC,
22 TCA_MPLS_TM, /* struct tcf_t; time values associated with action. */
23 TCA_MPLS_PARMS, /* struct tc_mpls; action type and general TC fields. */
24 TCA_MPLS_PAD,
25 TCA_MPLS_PROTO, /* be16; eth_type of pushed or next (for pop) header. */
26 TCA_MPLS_LABEL, /* u32; MPLS label. Lower 20 bits are used. */
27 TCA_MPLS_TC, /* u8; MPLS TC field. Lower 3 bits are used. */
28 TCA_MPLS_TTL, /* u8; MPLS TTL field. Must not be 0. */
29 TCA_MPLS_BOS, /* u8; MPLS BOS field. Either 1 or 0. */
30 __TCA_MPLS_MAX,
31};
32#define TCA_MPLS_MAX (__TCA_MPLS_MAX - 1)
33
34#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_nat.h-2
...@@ -5,8 +5,6 @@...@@ -5,8 +5,6 @@
5#include <linux/pkt_cls.h>5#include <linux/pkt_cls.h>
6#include <linux/types.h>6#include <linux/types.h>
77
8#define TCA_ACT_NAT 9
9
10enum {8enum {
11 TCA_NAT_UNSPEC,9 TCA_NAT_UNSPEC,
12 TCA_NAT_PARMS,10 TCA_NAT_PARMS,
lib/libc/include/any-linux-any/linux/tc_act/tc_pedit.h-2
...@@ -5,8 +5,6 @@...@@ -5,8 +5,6 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
77
8#define TCA_ACT_PEDIT 7
9
10enum {8enum {
11 TCA_PEDIT_UNSPEC,9 TCA_PEDIT_UNSPEC,
12 TCA_PEDIT_TM,10 TCA_PEDIT_TM,
lib/libc/include/any-linux-any/linux/tc_act/tc_sample.h-2
...@@ -6,8 +6,6 @@...@@ -6,8 +6,6 @@
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7#include <linux/if_ether.h>7#include <linux/if_ether.h>
88
9#define TCA_ACT_SAMPLE 26
10
11struct tc_sample {9struct tc_sample {
12 tc_gen;10 tc_gen;
13};11};
lib/libc/include/any-linux-any/linux/tc_act/tc_skbedit.h-2
...@@ -23,8 +23,6 @@...@@ -23,8 +23,6 @@
2323
24#include <linux/pkt_cls.h>24#include <linux/pkt_cls.h>
2525
26#define TCA_ACT_SKBEDIT 11
27
28#define SKBEDIT_F_PRIORITY 0x126#define SKBEDIT_F_PRIORITY 0x1
29#define SKBEDIT_F_QUEUE_MAPPING 0x227#define SKBEDIT_F_QUEUE_MAPPING 0x2
30#define SKBEDIT_F_MARK 0x428#define SKBEDIT_F_MARK 0x4
lib/libc/include/any-linux-any/linux/tc_act/tc_skbmod.h+1-2
...@@ -13,12 +13,11 @@...@@ -13,12 +13,11 @@
1313
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
1515
16#define TCA_ACT_SKBMOD 15
17
18#define SKBMOD_F_DMAC 0x116#define SKBMOD_F_DMAC 0x1
19#define SKBMOD_F_SMAC 0x217#define SKBMOD_F_SMAC 0x2
20#define SKBMOD_F_ETYPE 0x418#define SKBMOD_F_ETYPE 0x4
21#define SKBMOD_F_SWAPMAC 0x819#define SKBMOD_F_SWAPMAC 0x8
20#define SKBMOD_F_ECN 0x10
2221
23struct tc_skbmod {22struct tc_skbmod {
24 tc_gen;23 tc_gen;
lib/libc/include/any-linux-any/linux/tc_act/tc_tunnel_key.h+29-2
...@@ -14,8 +14,6 @@...@@ -14,8 +14,6 @@
1414
15#include <linux/pkt_cls.h>15#include <linux/pkt_cls.h>
1616
17#define TCA_ACT_TUNNEL_KEY 17
18
19#define TCA_TUNNEL_KEY_ACT_SET 117#define TCA_TUNNEL_KEY_ACT_SET 1
20#define TCA_TUNNEL_KEY_ACT_RELEASE 218#define TCA_TUNNEL_KEY_ACT_RELEASE 2
2119
...@@ -52,6 +50,14 @@ enum {...@@ -52,6 +50,14 @@ enum {
52 * TCA_TUNNEL_KEY_ENC_OPTS_50 * TCA_TUNNEL_KEY_ENC_OPTS_
53 * attributes51 * attributes
54 */52 */
53 TCA_TUNNEL_KEY_ENC_OPTS_VXLAN, /* Nested
54 * TCA_TUNNEL_KEY_ENC_OPTS_
55 * attributes
56 */
57 TCA_TUNNEL_KEY_ENC_OPTS_ERSPAN, /* Nested
58 * TCA_TUNNEL_KEY_ENC_OPTS_
59 * attributes
60 */
55 __TCA_TUNNEL_KEY_ENC_OPTS_MAX,61 __TCA_TUNNEL_KEY_ENC_OPTS_MAX,
56};62};
5763
...@@ -69,4 +75,25 @@ enum {...@@ -69,4 +75,25 @@ enum {
69#define TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX \75#define TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX \
70 (__TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX - 1)76 (__TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX - 1)
7177
78enum {
79 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_UNSPEC,
80 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_GBP, /* u32 */
81 __TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX,
82};
83
84#define TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX \
85 (__TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX - 1)
86
87enum {
88 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_UNSPEC,
89 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_VER, /* u8 */
90 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_INDEX, /* be32 */
91 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_DIR, /* u8 */
92 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_HWID, /* u8 */
93 __TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX,
94};
95
96#define TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX \
97 (__TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX - 1)
98
72#endif99#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_vlan.h+4-2
...@@ -13,11 +13,11 @@...@@ -13,11 +13,11 @@
1313
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
1515
16#define TCA_ACT_VLAN 12
17
18#define TCA_VLAN_ACT_POP 116#define TCA_VLAN_ACT_POP 1
19#define TCA_VLAN_ACT_PUSH 217#define TCA_VLAN_ACT_PUSH 2
20#define TCA_VLAN_ACT_MODIFY 318#define TCA_VLAN_ACT_MODIFY 3
19#define TCA_VLAN_ACT_POP_ETH 4
20#define TCA_VLAN_ACT_PUSH_ETH 5
2121
22struct tc_vlan {22struct tc_vlan {
23 tc_gen;23 tc_gen;
...@@ -32,6 +32,8 @@ enum {...@@ -32,6 +32,8 @@ enum {
32 TCA_VLAN_PUSH_VLAN_PROTOCOL,32 TCA_VLAN_PUSH_VLAN_PROTOCOL,
33 TCA_VLAN_PAD,33 TCA_VLAN_PAD,
34 TCA_VLAN_PUSH_VLAN_PRIORITY,34 TCA_VLAN_PUSH_VLAN_PRIORITY,
35 TCA_VLAN_PUSH_ETH_DST,
36 TCA_VLAN_PUSH_ETH_SRC,
35 __TCA_VLAN_MAX,37 __TCA_VLAN_MAX,
36};38};
37#define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)39#define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)
lib/libc/include/any-linux-any/linux/tcp.h+72-12
...@@ -51,7 +51,7 @@ struct tcphdr {...@@ -51,7 +51,7 @@ struct tcphdr {
51 fin:1;51 fin:1;
52#else52#else
53#error "Adjust your <asm/byteorder.h> defines"53#error "Adjust your <asm/byteorder.h> defines"
54#endif 54#endif
55 __be16 window;55 __be16 window;
56 __sum16 check;56 __sum16 check;
57 __be16 urg_ptr;57 __be16 urg_ptr;
...@@ -62,14 +62,14 @@ struct tcphdr {...@@ -62,14 +62,14 @@ struct tcphdr {
62 * (union is compatible to any of its members)62 * (union is compatible to any of its members)
63 * This means this part of the code is -fstrict-aliasing safe now.63 * This means this part of the code is -fstrict-aliasing safe now.
64 */64 */
65union tcp_word_hdr { 65union tcp_word_hdr {
66 struct tcphdr hdr;66 struct tcphdr hdr;
67 __be32 words[5];67 __be32 words[5];
68}; 68};
6969
70#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 70#define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3])
7171
72enum { 72enum {
73 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),73 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
74 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),74 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
75 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),75 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
...@@ -80,7 +80,7 @@ enum {...@@ -80,7 +80,7 @@ enum {
80 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),80 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
81 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),81 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
82 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)82 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
83}; 83};
8484
85/*85/*
86 * TCP general constants86 * TCP general constants
...@@ -103,8 +103,8 @@ enum {...@@ -103,8 +103,8 @@ enum {
103#define TCP_QUICKACK 12 /* Block/reenable quick acks */103#define TCP_QUICKACK 12 /* Block/reenable quick acks */
104#define TCP_CONGESTION 13 /* Congestion control algorithm */104#define TCP_CONGESTION 13 /* Congestion control algorithm */
105#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */105#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
109#define TCP_REPAIR 19 /* TCP sock is under repair right now */109#define TCP_REPAIR 19 /* TCP sock is under repair right now */
110#define TCP_REPAIR_QUEUE 20110#define TCP_REPAIR_QUEUE 20
...@@ -127,6 +127,9 @@ enum {...@@ -127,6 +127,9 @@ enum {
127127
128#define TCP_CM_INQ TCP_INQ128#define TCP_CM_INQ TCP_INQ
129129
130#define TCP_TX_DELAY 37 /* delay outgoing packets by XX usec */
131
132
130#define TCP_REPAIR_ON 1133#define TCP_REPAIR_ON 1
131#define TCP_REPAIR_OFF 0134#define TCP_REPAIR_OFF 0
132#define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */135#define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */
...@@ -152,6 +155,14 @@ enum {...@@ -152,6 +155,14 @@ enum {
152 TCP_QUEUES_NR,155 TCP_QUEUES_NR,
153};156};
154157
158/* why fastopen failed from client perspective */
159enum tcp_fastopen_client_fail {
160 TFO_STATUS_UNSPEC, /* catch-all */
161 TFO_COOKIE_UNAVAILABLE, /* if not in TFO_CLIENT_NO_COOKIE mode */
162 TFO_DATA_NOT_ACKED, /* SYN-ACK did not ack SYN data */
163 TFO_SYN_RETRANSMITTED, /* SYN-ACK did not ack SYN data after timeout */
164};
165
155/* for TCP_INFO socket option */166/* for TCP_INFO socket option */
156#define TCPI_OPT_TIMESTAMPS 1167#define TCPI_OPT_TIMESTAMPS 1
157#define TCPI_OPT_SACK 2168#define TCPI_OPT_SACK 2
...@@ -160,15 +171,42 @@ enum {...@@ -160,15 +171,42 @@ enum {
160#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */171#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
161#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */172#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
162173
174/*
175 * Sender's congestion state indicating normal or abnormal situations
176 * in the last round of packets sent. The state is driven by the ACK
177 * information and timer events.
178 */
163enum tcp_ca_state {179enum tcp_ca_state {
180 /*
181 * Nothing bad has been observed recently.
182 * No apparent reordering, packet loss, or ECN marks.
183 */
164 TCP_CA_Open = 0,184 TCP_CA_Open = 0,
165#define TCPF_CA_Open (1<<TCP_CA_Open)185#define TCPF_CA_Open (1<<TCP_CA_Open)
186 /*
187 * The sender enters disordered state when it has received DUPACKs or
188 * SACKs in the last round of packets sent. This could be due to packet
189 * loss or reordering but needs further information to confirm packets
190 * have been lost.
191 */
166 TCP_CA_Disorder = 1,192 TCP_CA_Disorder = 1,
167#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)193#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
194 /*
195 * The sender enters Congestion Window Reduction (CWR) state when it
196 * has received ACKs with ECN-ECE marks, or has experienced congestion
197 * or packet discard on the sender host (e.g. qdisc).
198 */
168 TCP_CA_CWR = 2,199 TCP_CA_CWR = 2,
169#define TCPF_CA_CWR (1<<TCP_CA_CWR)200#define TCPF_CA_CWR (1<<TCP_CA_CWR)
201 /*
202 * The sender is in fast recovery and retransmitting lost packets,
203 * typically triggered by ACK events.
204 */
170 TCP_CA_Recovery = 3,205 TCP_CA_Recovery = 3,
171#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)206#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
207 /*
208 * The sender is in loss recovery triggered by retransmission timeout.
209 */
172 TCP_CA_Loss = 4210 TCP_CA_Loss = 4
173#define TCPF_CA_Loss (1<<TCP_CA_Loss)211#define TCPF_CA_Loss (1<<TCP_CA_Loss)
174};212};
...@@ -181,7 +219,7 @@ struct tcp_info {...@@ -181,7 +219,7 @@ struct tcp_info {
181 __u8 tcpi_backoff;219 __u8 tcpi_backoff;
182 __u8 tcpi_options;220 __u8 tcpi_options;
183 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;221 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
184 __u8 tcpi_delivery_rate_app_limited:1;222 __u8 tcpi_delivery_rate_app_limited:1, tcpi_fastopen_client_fail:2;
185223
186 __u32 tcpi_rto;224 __u32 tcpi_rto;
187 __u32 tcpi_ato;225 __u32 tcpi_ato;
...@@ -240,6 +278,12 @@ struct tcp_info {...@@ -240,6 +278,12 @@ struct tcp_info {
240 __u64 tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */278 __u64 tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */
241 __u32 tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */279 __u32 tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */
242 __u32 tcpi_reord_seen; /* reordering events seen */280 __u32 tcpi_reord_seen; /* reordering events seen */
281
282 __u32 tcpi_rcv_ooopack; /* Out-of-order packets received */
283
284 __u32 tcpi_snd_wnd; /* peer's advertised receive window after
285 * scaling (bytes)
286 */
243};287};
244288
245/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */289/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
...@@ -266,20 +310,26 @@ enum {...@@ -266,20 +310,26 @@ enum {
266 TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */310 TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */
267 TCP_NLA_DSACK_DUPS, /* DSACK blocks received */311 TCP_NLA_DSACK_DUPS, /* DSACK blocks received */
268 TCP_NLA_REORD_SEEN, /* reordering events seen */312 TCP_NLA_REORD_SEEN, /* reordering events seen */
313 TCP_NLA_SRTT, /* smoothed RTT in usecs */
314 TCP_NLA_TIMEOUT_REHASH, /* Timeout-triggered rehash attempts */
315 TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */
316 TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */
317 TCP_NLA_TTL, /* TTL or hop limit of a packet received */
269};318};
270319
271/* for TCP_MD5SIG socket option */320/* for TCP_MD5SIG socket option */
272#define TCP_MD5SIG_MAXKEYLEN 80321#define TCP_MD5SIG_MAXKEYLEN 80
273322
274/* tcp_md5sig extension flags for TCP_MD5SIG_EXT */323/* tcp_md5sig extension flags for TCP_MD5SIG_EXT */
275#define TCP_MD5SIG_FLAG_PREFIX 1 /* address prefix length */324#define TCP_MD5SIG_FLAG_PREFIX 0x1 /* address prefix length */
325#define TCP_MD5SIG_FLAG_IFINDEX 0x2 /* ifindex set */
276326
277struct tcp_md5sig {327struct tcp_md5sig {
278 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */328 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
279 __u8 tcpm_flags; /* extension flags */329 __u8 tcpm_flags; /* extension flags */
280 __u8 tcpm_prefixlen; /* address prefix */330 __u8 tcpm_prefixlen; /* address prefix */
281 __u16 tcpm_keylen; /* key length */331 __u16 tcpm_keylen; /* key length */
282 __u32 __tcpm_pad; /* zero */332 int tcpm_ifindex; /* device index for scope */
283 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */333 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
284};334};
285335
...@@ -294,9 +344,19 @@ struct tcp_diag_md5sig {...@@ -294,9 +344,19 @@ struct tcp_diag_md5sig {
294344
295/* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */345/* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */
296346
347#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
297struct tcp_zerocopy_receive {348struct tcp_zerocopy_receive {
298 __u64 address; /* in: address of mapping */349 __u64 address; /* in: address of mapping */
299 __u32 length; /* in/out: number of bytes to map/mapped */350 __u32 length; /* in/out: number of bytes to map/mapped */
300 __u32 recv_skip_hint; /* out: amount of bytes to skip */351 __u32 recv_skip_hint; /* out: amount of bytes to skip */
352 __u32 inq; /* out: amount of bytes in read queue */
353 __s32 err; /* out: socket error */
354 __u64 copybuf_address; /* in: copybuf address (small reads) */
355 __s32 copybuf_len; /* in/out: copybuf bytes avail/used or error */
356 __u32 flags; /* in: flags */
357 __u64 msg_control; /* ancillary data */
358 __u64 msg_controllen;
359 __u32 msg_flags;
360 __u32 reserved; /* set to 0 for now */
301};361};
302#endif /* _LINUX_TCP_H */362#endif /* _LINUX_TCP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tee.h+24-1
...@@ -51,11 +51,15 @@...@@ -51,11 +51,15 @@
51#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */51#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
52#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */52#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
53#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */53#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
54#define TEE_GEN_CAP_MEMREF_NULL (1 << 3)/* NULL MemRef support */
55
56#define TEE_MEMREF_NULL (__u64)(-1) /* NULL MemRef Buffer */
5457
55/*58/*
56 * TEE Implementation ID59 * TEE Implementation ID
57 */60 */
58#define TEE_IMPL_ID_OPTEE 161#define TEE_IMPL_ID_OPTEE 1
62#define TEE_IMPL_ID_AMDTEE 2
5963
60/*64/*
61 * OP-TEE specific capabilities65 * OP-TEE specific capabilities
...@@ -172,6 +176,15 @@ struct tee_ioctl_buf_data {...@@ -172,6 +176,15 @@ struct tee_ioctl_buf_data {
172#define TEE_IOCTL_LOGIN_APPLICATION 4176#define TEE_IOCTL_LOGIN_APPLICATION 4
173#define TEE_IOCTL_LOGIN_USER_APPLICATION 5177#define TEE_IOCTL_LOGIN_USER_APPLICATION 5
174#define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6178#define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6
179/*
180 * Disallow user-space to use GP implementation specific login
181 * method range (0x80000000 - 0xBFFFFFFF). This range is rather
182 * being reserved for REE kernel clients or TEE implementation.
183 */
184#define TEE_IOCTL_LOGIN_REE_KERNEL_MIN 0x80000000
185#define TEE_IOCTL_LOGIN_REE_KERNEL_MAX 0xBFFFFFFF
186/* Private login method for REE kernel clients */
187#define TEE_IOCTL_LOGIN_REE_KERNEL 0x80000000
175188
176/**189/**
177 * struct tee_ioctl_param - parameter190 * struct tee_ioctl_param - parameter
...@@ -190,6 +203,16 @@ struct tee_ioctl_buf_data {...@@ -190,6 +203,16 @@ struct tee_ioctl_buf_data {
190 * a part of a shared memory by specifying an offset (@a) and size (@b) of203 * a part of a shared memory by specifying an offset (@a) and size (@b) of
191 * the object. To supply the entire shared memory object set the offset204 * the object. To supply the entire shared memory object set the offset
192 * (@a) to 0 and size (@b) to the previously returned size of the object.205 * (@a) to 0 and size (@b) to the previously returned size of the object.
206 *
207 * A client may need to present a NULL pointer in the argument
208 * passed to a trusted application in the TEE.
209 * This is also a requirement in GlobalPlatform Client API v1.0c
210 * (section 3.2.5 memory references), which can be found at
211 * http://www.globalplatform.org/specificationsdevice.asp
212 *
213 * If a NULL pointer is passed to a TA in the TEE, the (@c)
214 * IOCTL parameters value must be set to TEE_MEMREF_NULL indicating a NULL
215 * memory reference.
193 */216 */
194struct tee_ioctl_param {217struct tee_ioctl_param {
195 __u64 attr;218 __u64 attr;
...@@ -332,7 +355,7 @@ struct tee_iocl_supp_send_arg {...@@ -332,7 +355,7 @@ struct tee_iocl_supp_send_arg {
332};355};
333356
334/**357/**
335 * TEE_IOC_SUPPL_SEND - Receive a request for a supplicant function358 * TEE_IOC_SUPPL_SEND - Send a response to a received request
336 *359 *
337 * Takes a struct tee_ioctl_buf_data which contains a struct360 * Takes a struct tee_ioctl_buf_data which contains a struct
338 * tee_iocl_supp_send_arg followed by any array of struct tee_param361 * tee_iocl_supp_send_arg followed by any array of struct tee_param
lib/libc/include/any-linux-any/linux/termios.h-15
...@@ -5,19 +5,4 @@...@@ -5,19 +5,4 @@
5#include <linux/types.h>5#include <linux/types.h>
6#include <asm/termios.h>6#include <asm/termios.h>
77
8#define NFF 5
9
10struct termiox
11{
12 __u16 x_hflag;
13 __u16 x_cflag;
14 __u16 x_rflag[NFF];
15 __u16 x_sflag;
16};
17
18#define RTSXOFF 0x0001 /* RTS flow control on input */
19#define CTSXON 0x0002 /* CTS flow control on output */
20#define DTRXOFF 0x0004 /* DTR flow control on input */
21#define DSRXON 0x0008 /* DCD flow control on output */
22
23#endif8#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/thermal.h+72-17
...@@ -4,31 +4,86 @@...@@ -4,31 +4,86 @@
44
5#define THERMAL_NAME_LENGTH 205#define THERMAL_NAME_LENGTH 20
66
7/* Adding event notification support elements */7enum thermal_device_mode {
8#define THERMAL_GENL_FAMILY_NAME "thermal_event"8 THERMAL_DEVICE_DISABLED = 0,
9#define THERMAL_GENL_VERSION 0x019 THERMAL_DEVICE_ENABLED,
10#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp"10};
1111
12/* Events supported by Thermal Netlink */12enum thermal_trip_type {
13enum events {13 THERMAL_TRIP_ACTIVE = 0,
14 THERMAL_AUX0,14 THERMAL_TRIP_PASSIVE,
15 THERMAL_AUX1,15 THERMAL_TRIP_HOT,
16 THERMAL_CRITICAL,16 THERMAL_TRIP_CRITICAL,
17 THERMAL_DEV_FAULT,
18};17};
1918
20/* attributes of thermal_genl_family */19/* Adding event notification support elements */
21enum {20#define THERMAL_GENL_FAMILY_NAME "thermal"
21#define THERMAL_GENL_VERSION 0x01
22#define THERMAL_GENL_SAMPLING_GROUP_NAME "sampling"
23#define THERMAL_GENL_EVENT_GROUP_NAME "event"
24
25/* Attributes of thermal_genl_family */
26enum thermal_genl_attr {
22 THERMAL_GENL_ATTR_UNSPEC,27 THERMAL_GENL_ATTR_UNSPEC,
23 THERMAL_GENL_ATTR_EVENT,28 THERMAL_GENL_ATTR_TZ,
29 THERMAL_GENL_ATTR_TZ_ID,
30 THERMAL_GENL_ATTR_TZ_TEMP,
31 THERMAL_GENL_ATTR_TZ_TRIP,
32 THERMAL_GENL_ATTR_TZ_TRIP_ID,
33 THERMAL_GENL_ATTR_TZ_TRIP_TYPE,
34 THERMAL_GENL_ATTR_TZ_TRIP_TEMP,
35 THERMAL_GENL_ATTR_TZ_TRIP_HYST,
36 THERMAL_GENL_ATTR_TZ_MODE,
37 THERMAL_GENL_ATTR_TZ_NAME,
38 THERMAL_GENL_ATTR_TZ_CDEV_WEIGHT,
39 THERMAL_GENL_ATTR_TZ_GOV,
40 THERMAL_GENL_ATTR_TZ_GOV_NAME,
41 THERMAL_GENL_ATTR_CDEV,
42 THERMAL_GENL_ATTR_CDEV_ID,
43 THERMAL_GENL_ATTR_CDEV_CUR_STATE,
44 THERMAL_GENL_ATTR_CDEV_MAX_STATE,
45 THERMAL_GENL_ATTR_CDEV_NAME,
46 THERMAL_GENL_ATTR_GOV_NAME,
47
24 __THERMAL_GENL_ATTR_MAX,48 __THERMAL_GENL_ATTR_MAX,
25};49};
26#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)50#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
2751
28/* commands supported by the thermal_genl_family */52enum thermal_genl_sampling {
29enum {53 THERMAL_GENL_SAMPLING_TEMP,
54 __THERMAL_GENL_SAMPLING_MAX,
55};
56#define THERMAL_GENL_SAMPLING_MAX (__THERMAL_GENL_SAMPLING_MAX - 1)
57
58/* Events of thermal_genl_family */
59enum thermal_genl_event {
60 THERMAL_GENL_EVENT_UNSPEC,
61 THERMAL_GENL_EVENT_TZ_CREATE, /* Thermal zone creation */
62 THERMAL_GENL_EVENT_TZ_DELETE, /* Thermal zone deletion */
63 THERMAL_GENL_EVENT_TZ_DISABLE, /* Thermal zone disabled */
64 THERMAL_GENL_EVENT_TZ_ENABLE, /* Thermal zone enabled */
65 THERMAL_GENL_EVENT_TZ_TRIP_UP, /* Trip point crossed the way up */
66 THERMAL_GENL_EVENT_TZ_TRIP_DOWN, /* Trip point crossed the way down */
67 THERMAL_GENL_EVENT_TZ_TRIP_CHANGE, /* Trip point changed */
68 THERMAL_GENL_EVENT_TZ_TRIP_ADD, /* Trip point added */
69 THERMAL_GENL_EVENT_TZ_TRIP_DELETE, /* Trip point deleted */
70 THERMAL_GENL_EVENT_CDEV_ADD, /* Cdev bound to the thermal zone */
71 THERMAL_GENL_EVENT_CDEV_DELETE, /* Cdev unbound */
72 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
73 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
74 __THERMAL_GENL_EVENT_MAX,
75};
76#define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)
77
78/* Commands supported by the thermal_genl_family */
79enum thermal_genl_cmd {
30 THERMAL_GENL_CMD_UNSPEC,80 THERMAL_GENL_CMD_UNSPEC,
31 THERMAL_GENL_CMD_EVENT,81 THERMAL_GENL_CMD_TZ_GET_ID, /* List of thermal zones id */
82 THERMAL_GENL_CMD_TZ_GET_TRIP, /* List of thermal trips */
83 THERMAL_GENL_CMD_TZ_GET_TEMP, /* Get the thermal zone temperature */
84 THERMAL_GENL_CMD_TZ_GET_GOV, /* Get the thermal zone governor */
85 THERMAL_GENL_CMD_TZ_GET_MODE, /* Get the thermal zone mode */
86 THERMAL_GENL_CMD_CDEV_GET, /* List of cdev id */
32 __THERMAL_GENL_CMD_MAX,87 __THERMAL_GENL_CMD_MAX,
33};88};
34#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)89#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
lib/libc/include/any-linux-any/linux/time.h+14-41
...@@ -3,70 +3,43 @@...@@ -3,70 +3,43 @@
3#define _LINUX_TIME_H3#define _LINUX_TIME_H
44
5#include <linux/types.h>5#include <linux/types.h>
66#include <linux/time_types.h>
77
8#ifndef _STRUCT_TIMESPEC8#ifndef _STRUCT_TIMESPEC
9#define _STRUCT_TIMESPEC9#define _STRUCT_TIMESPEC
10struct timespec {10struct timespec {
11 __kernel_time_t tv_sec; /* seconds */11 __kernel_old_time_t tv_sec; /* seconds */
12 long tv_nsec; /* nanoseconds */12 long tv_nsec; /* nanoseconds */
13};13};
14#endif14#endif
1515
16struct timeval {16struct timeval {
17 __kernel_time_t tv_sec; /* seconds */17 __kernel_old_time_t tv_sec; /* seconds */
18 __kernel_suseconds_t tv_usec; /* microseconds */18 __kernel_suseconds_t tv_usec; /* microseconds */
19};19};
2020
21struct timezone {
22 int tz_minuteswest; /* minutes west of Greenwich */
23 int tz_dsttime; /* type of dst correction */
24};
25
26
27/*
28 * Names of the interval timers, and structure
29 * defining a timer setting:
30 */
31#define ITIMER_REAL 0
32#define ITIMER_VIRTUAL 1
33#define ITIMER_PROF 2
34
35struct itimerspec {21struct itimerspec {
36 struct timespec it_interval; /* timer period */22 struct timespec it_interval;/* timer period */
37 struct timespec it_value; /* timer expiration */23 struct timespec it_value; /* timer expiration */
38};24};
3925
40struct itimerval {26struct itimerval {
41 struct timeval it_interval; /* timer interval */27 struct timeval it_interval;/* timer interval */
42 struct timeval it_value; /* current value */28 struct timeval it_value; /* current value */
43};29};
4430
45#ifndef __kernel_timespec31struct timezone {
46struct __kernel_timespec {32 int tz_minuteswest; /* minutes west of Greenwich */
47 __kernel_time64_t tv_sec; /* seconds */33 int tz_dsttime; /* type of dst correction */
48 long long tv_nsec; /* nanoseconds */
49};
50#endif
51
52#ifndef __kernel_itimerspec
53struct __kernel_itimerspec {
54 struct __kernel_timespec it_interval; /* timer period */
55 struct __kernel_timespec it_value; /* timer expiration */
56};34};
57#endif
5835
59/*36/*
60 * legacy timeval structure, only embedded in structures that37 * Names of the interval timers, and structure
61 * traditionally used 'timeval' to pass time intervals (not absolute38 * defining a timer setting:
62 * times). Do not add new users. If user space fails to compile
63 * here, this is probably because it is not y2038 safe and needs to
64 * be changed to use another interface.
65 */39 */
66struct __kernel_old_timeval {40#define ITIMER_REAL 0
67 __kernel_long_t tv_sec;41#define ITIMER_VIRTUAL 1
68 __kernel_long_t tv_usec;42#define ITIMER_PROF 2
69};
7043
71/*44/*
72 * The IDs of the various system clocks (for POSIX.1b interval timers):45 * The IDs of the various system clocks (for POSIX.1b interval timers):
lib/libc/include/any-linux-any/linux/time_types.h created+46
...@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_TIME_TYPES_H
3#define _LINUX_TIME_TYPES_H
4
5#include <linux/types.h>
6
7struct __kernel_timespec {
8 __kernel_time64_t tv_sec; /* seconds */
9 long long tv_nsec; /* nanoseconds */
10};
11
12struct __kernel_itimerspec {
13 struct __kernel_timespec it_interval; /* timer period */
14 struct __kernel_timespec it_value; /* timer expiration */
15};
16
17/*
18 * legacy timeval structure, only embedded in structures that
19 * traditionally used 'timeval' to pass time intervals (not absolute
20 * times). Do not add new users. If user space fails to compile
21 * here, this is probably because it is not y2038 safe and needs to
22 * be changed to use another interface.
23 */
24#ifndef __kernel_old_timeval
25struct __kernel_old_timeval {
26 __kernel_long_t tv_sec;
27 __kernel_long_t tv_usec;
28};
29#endif
30
31struct __kernel_old_timespec {
32 __kernel_old_time_t tv_sec; /* seconds */
33 long tv_nsec; /* nanoseconds */
34};
35
36struct __kernel_old_itimerval {
37 struct __kernel_old_timeval it_interval;/* timer interval */
38 struct __kernel_old_timeval it_value; /* current value */
39};
40
41struct __kernel_sock_timeval {
42 __s64 tv_sec;
43 __s64 tv_usec;
44};
45
46#endif /* _LINUX_TIME_TYPES_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/timex.h+39
...@@ -92,6 +92,45 @@ struct timex {...@@ -92,6 +92,45 @@ struct timex {
92 int :32; int :32; int :32;92 int :32; int :32; int :32;
93};93};
9494
95struct __kernel_timex_timeval {
96 __kernel_time64_t tv_sec;
97 long long tv_usec;
98};
99
100struct __kernel_timex {
101 unsigned int modes; /* mode selector */
102 int :32; /* pad */
103 long long offset; /* time offset (usec) */
104 long long freq; /* frequency offset (scaled ppm) */
105 long long maxerror;/* maximum error (usec) */
106 long long esterror;/* estimated error (usec) */
107 int status; /* clock command/status */
108 int :32; /* pad */
109 long long constant;/* pll time constant */
110 long long precision;/* clock precision (usec) (read only) */
111 long long tolerance;/* clock frequency tolerance (ppm)
112 * (read only)
113 */
114 struct __kernel_timex_timeval time; /* (read only, except for ADJ_SETOFFSET) */
115 long long tick; /* (modified) usecs between clock ticks */
116
117 long long ppsfreq;/* pps frequency (scaled ppm) (ro) */
118 long long jitter; /* pps jitter (us) (ro) */
119 int shift; /* interval duration (s) (shift) (ro) */
120 int :32; /* pad */
121 long long stabil; /* pps stability (scaled ppm) (ro) */
122 long long jitcnt; /* jitter limit exceeded (ro) */
123 long long calcnt; /* calibration intervals (ro) */
124 long long errcnt; /* calibration errors (ro) */
125 long long stbcnt; /* stability limit exceeded (ro) */
126
127 int tai; /* TAI offset (ro) */
128
129 int :32; int :32; int :32; int :32;
130 int :32; int :32; int :32; int :32;
131 int :32; int :32; int :32;
132};
133
95/*134/*
96 * Mode codes (timex.mode)135 * Mode codes (timex.mode)
97 */136 */
lib/libc/include/any-linux-any/linux/tipc.h+25
...@@ -190,6 +190,8 @@ struct sockaddr_tipc {...@@ -190,6 +190,8 @@ struct sockaddr_tipc {
190#define TIPC_MCAST_REPLICAST 134 /* Default: TIPC selects. No arg */190#define TIPC_MCAST_REPLICAST 134 /* Default: TIPC selects. No arg */
191#define TIPC_GROUP_JOIN 135 /* Takes struct tipc_group_req* */191#define TIPC_GROUP_JOIN 135 /* Takes struct tipc_group_req* */
192#define TIPC_GROUP_LEAVE 136 /* No argument */192#define TIPC_GROUP_LEAVE 136 /* No argument */
193#define TIPC_SOCK_RECVQ_USED 137 /* Default: none (read only) */
194#define TIPC_NODELAY 138 /* Default: false */
193195
194/*196/*
195 * Flag values197 * Flag values
...@@ -231,6 +233,29 @@ struct tipc_sioc_nodeid_req {...@@ -231,6 +233,29 @@ struct tipc_sioc_nodeid_req {
231 char node_id[TIPC_NODEID_LEN];233 char node_id[TIPC_NODEID_LEN];
232};234};
233235
236/*
237 * TIPC Crypto, AEAD
238 */
239#define TIPC_AEAD_ALG_NAME (32)
240
241struct tipc_aead_key {
242 char alg_name[TIPC_AEAD_ALG_NAME];
243 unsigned int keylen; /* in bytes */
244 char key[];
245};
246
247#define TIPC_AEAD_KEYLEN_MIN (16 + 4)
248#define TIPC_AEAD_KEYLEN_MAX (32 + 4)
249#define TIPC_AEAD_KEY_SIZE_MAX (sizeof(struct tipc_aead_key) + \
250 TIPC_AEAD_KEYLEN_MAX)
251
252static __inline__ int tipc_aead_key_size(struct tipc_aead_key *key)
253{
254 return sizeof(*key) + key->keylen;
255}
256
257#define TIPC_REKEYING_NOW (~0U)
258
234/* The macros and functions below are deprecated:259/* The macros and functions below are deprecated:
235 */260 */
236261
lib/libc/include/any-linux-any/linux/tipc_config.h+7-3
...@@ -305,8 +305,10 @@ static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)...@@ -305,8 +305,10 @@ static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
305 tlv_ptr = (struct tlv_desc *)tlv;305 tlv_ptr = (struct tlv_desc *)tlv;
306 tlv_ptr->tlv_type = htons(type);306 tlv_ptr->tlv_type = htons(type);
307 tlv_ptr->tlv_len = htons(tlv_len);307 tlv_ptr->tlv_len = htons(tlv_len);
308 if (len && data)308 if (len && data) {
309 memcpy(TLV_DATA(tlv_ptr), data, tlv_len);309 memcpy(TLV_DATA(tlv_ptr), data, len);
310 memset((char *)TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);
311 }
310 return TLV_SPACE(len);312 return TLV_SPACE(len);
311}313}
312314
...@@ -403,8 +405,10 @@ static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,...@@ -403,8 +405,10 @@ static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,
403 tcm_hdr->tcm_len = htonl(msg_len);405 tcm_hdr->tcm_len = htonl(msg_len);
404 tcm_hdr->tcm_type = htons(cmd);406 tcm_hdr->tcm_type = htons(cmd);
405 tcm_hdr->tcm_flags = htons(flags);407 tcm_hdr->tcm_flags = htons(flags);
406 if (data_len && data)408 if (data_len && data) {
407 memcpy(TCM_DATA(msg), data, data_len);409 memcpy(TCM_DATA(msg), data, data_len);
410 memset((char *)TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);
411 }
408 return TCM_SPACE(data_len);412 return TCM_SPACE(data_len);
409}413}
410414
lib/libc/include/any-linux-any/linux/tipc_netlink.h+10
...@@ -63,6 +63,9 @@ enum {...@@ -63,6 +63,9 @@ enum {
63 TIPC_NL_PEER_REMOVE,63 TIPC_NL_PEER_REMOVE,
64 TIPC_NL_BEARER_ADD,64 TIPC_NL_BEARER_ADD,
65 TIPC_NL_UDP_GET_REMOTEIP,65 TIPC_NL_UDP_GET_REMOTEIP,
66 TIPC_NL_KEY_SET,
67 TIPC_NL_KEY_FLUSH,
68 TIPC_NL_ADDR_LEGACY_GET,
6669
67 __TIPC_NL_CMD_MAX,70 __TIPC_NL_CMD_MAX,
68 TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 171 TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1
...@@ -160,6 +163,10 @@ enum {...@@ -160,6 +163,10 @@ enum {
160 TIPC_NLA_NODE_UNSPEC,163 TIPC_NLA_NODE_UNSPEC,
161 TIPC_NLA_NODE_ADDR, /* u32 */164 TIPC_NLA_NODE_ADDR, /* u32 */
162 TIPC_NLA_NODE_UP, /* flag */165 TIPC_NLA_NODE_UP, /* flag */
166 TIPC_NLA_NODE_ID, /* data */
167 TIPC_NLA_NODE_KEY, /* data */
168 TIPC_NLA_NODE_KEY_MASTER, /* flag */
169 TIPC_NLA_NODE_REKEYING, /* u32 */
163170
164 __TIPC_NLA_NODE_MAX,171 __TIPC_NLA_NODE_MAX,
165 TIPC_NLA_NODE_MAX = __TIPC_NLA_NODE_MAX - 1172 TIPC_NLA_NODE_MAX = __TIPC_NLA_NODE_MAX - 1
...@@ -172,6 +179,7 @@ enum {...@@ -172,6 +179,7 @@ enum {
172 TIPC_NLA_NET_ADDR, /* u32 */179 TIPC_NLA_NET_ADDR, /* u32 */
173 TIPC_NLA_NET_NODEID, /* u64 */180 TIPC_NLA_NET_NODEID, /* u64 */
174 TIPC_NLA_NET_NODEID_W1, /* u64 */181 TIPC_NLA_NET_NODEID_W1, /* u64 */
182 TIPC_NLA_NET_ADDR_LEGACY, /* flag */
175183
176 __TIPC_NLA_NET_MAX,184 __TIPC_NLA_NET_MAX,
177 TIPC_NLA_NET_MAX = __TIPC_NLA_NET_MAX - 1185 TIPC_NLA_NET_MAX = __TIPC_NLA_NET_MAX - 1
...@@ -281,6 +289,8 @@ enum {...@@ -281,6 +289,8 @@ enum {
281 TIPC_NLA_PROP_TOL, /* u32 */289 TIPC_NLA_PROP_TOL, /* u32 */
282 TIPC_NLA_PROP_WIN, /* u32 */290 TIPC_NLA_PROP_WIN, /* u32 */
283 TIPC_NLA_PROP_MTU, /* u32 */291 TIPC_NLA_PROP_MTU, /* u32 */
292 TIPC_NLA_PROP_BROADCAST, /* u32 */
293 TIPC_NLA_PROP_BROADCAST_RATIO, /* u32 */
284294
285 __TIPC_NLA_PROP_MAX,295 __TIPC_NLA_PROP_MAX,
286 TIPC_NLA_PROP_MAX = __TIPC_NLA_PROP_MAX - 1296 TIPC_NLA_PROP_MAX = __TIPC_NLA_PROP_MAX - 1
lib/libc/include/any-linux-any/linux/tls.h+94
...@@ -51,6 +51,10 @@...@@ -51,6 +51,10 @@
51#define TLS_1_2_VERSION_MINOR 0x351#define TLS_1_2_VERSION_MINOR 0x3
52#define TLS_1_2_VERSION TLS_VERSION_NUMBER(TLS_1_2)52#define TLS_1_2_VERSION TLS_VERSION_NUMBER(TLS_1_2)
5353
54#define TLS_1_3_VERSION_MAJOR 0x3
55#define TLS_1_3_VERSION_MINOR 0x4
56#define TLS_1_3_VERSION TLS_VERSION_NUMBER(TLS_1_3)
57
54/* Supported ciphers */58/* Supported ciphers */
55#define TLS_CIPHER_AES_GCM_128 5159#define TLS_CIPHER_AES_GCM_128 51
56#define TLS_CIPHER_AES_GCM_128_IV_SIZE 860#define TLS_CIPHER_AES_GCM_128_IV_SIZE 8
...@@ -59,6 +63,41 @@...@@ -59,6 +63,41 @@
59#define TLS_CIPHER_AES_GCM_128_TAG_SIZE 1663#define TLS_CIPHER_AES_GCM_128_TAG_SIZE 16
60#define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 864#define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8
6165
66#define TLS_CIPHER_AES_GCM_256 52
67#define TLS_CIPHER_AES_GCM_256_IV_SIZE 8
68#define TLS_CIPHER_AES_GCM_256_KEY_SIZE 32
69#define TLS_CIPHER_AES_GCM_256_SALT_SIZE 4
70#define TLS_CIPHER_AES_GCM_256_TAG_SIZE 16
71#define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8
72
73#define TLS_CIPHER_AES_CCM_128 53
74#define TLS_CIPHER_AES_CCM_128_IV_SIZE 8
75#define TLS_CIPHER_AES_CCM_128_KEY_SIZE 16
76#define TLS_CIPHER_AES_CCM_128_SALT_SIZE 4
77#define TLS_CIPHER_AES_CCM_128_TAG_SIZE 16
78#define TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE 8
79
80#define TLS_CIPHER_CHACHA20_POLY1305 54
81#define TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE 12
82#define TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE 32
83#define TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE 0
84#define TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE 16
85#define TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE 8
86
87#define TLS_CIPHER_SM4_GCM 55
88#define TLS_CIPHER_SM4_GCM_IV_SIZE 8
89#define TLS_CIPHER_SM4_GCM_KEY_SIZE 16
90#define TLS_CIPHER_SM4_GCM_SALT_SIZE 4
91#define TLS_CIPHER_SM4_GCM_TAG_SIZE 16
92#define TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE 8
93
94#define TLS_CIPHER_SM4_CCM 56
95#define TLS_CIPHER_SM4_CCM_IV_SIZE 8
96#define TLS_CIPHER_SM4_CCM_KEY_SIZE 16
97#define TLS_CIPHER_SM4_CCM_SALT_SIZE 4
98#define TLS_CIPHER_SM4_CCM_TAG_SIZE 16
99#define TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE 8
100
62#define TLS_SET_RECORD_TYPE 1101#define TLS_SET_RECORD_TYPE 1
63#define TLS_GET_RECORD_TYPE 2102#define TLS_GET_RECORD_TYPE 2
64103
...@@ -75,4 +114,59 @@ struct tls12_crypto_info_aes_gcm_128 {...@@ -75,4 +114,59 @@ struct tls12_crypto_info_aes_gcm_128 {
75 unsigned char rec_seq[TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE];114 unsigned char rec_seq[TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE];
76};115};
77116
117struct tls12_crypto_info_aes_gcm_256 {
118 struct tls_crypto_info info;
119 unsigned char iv[TLS_CIPHER_AES_GCM_256_IV_SIZE];
120 unsigned char key[TLS_CIPHER_AES_GCM_256_KEY_SIZE];
121 unsigned char salt[TLS_CIPHER_AES_GCM_256_SALT_SIZE];
122 unsigned char rec_seq[TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE];
123};
124
125struct tls12_crypto_info_aes_ccm_128 {
126 struct tls_crypto_info info;
127 unsigned char iv[TLS_CIPHER_AES_CCM_128_IV_SIZE];
128 unsigned char key[TLS_CIPHER_AES_CCM_128_KEY_SIZE];
129 unsigned char salt[TLS_CIPHER_AES_CCM_128_SALT_SIZE];
130 unsigned char rec_seq[TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE];
131};
132
133struct tls12_crypto_info_chacha20_poly1305 {
134 struct tls_crypto_info info;
135 unsigned char iv[TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE];
136 unsigned char key[TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE];
137 unsigned char salt[TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE];
138 unsigned char rec_seq[TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE];
139};
140
141struct tls12_crypto_info_sm4_gcm {
142 struct tls_crypto_info info;
143 unsigned char iv[TLS_CIPHER_SM4_GCM_IV_SIZE];
144 unsigned char key[TLS_CIPHER_SM4_GCM_KEY_SIZE];
145 unsigned char salt[TLS_CIPHER_SM4_GCM_SALT_SIZE];
146 unsigned char rec_seq[TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE];
147};
148
149struct tls12_crypto_info_sm4_ccm {
150 struct tls_crypto_info info;
151 unsigned char iv[TLS_CIPHER_SM4_CCM_IV_SIZE];
152 unsigned char key[TLS_CIPHER_SM4_CCM_KEY_SIZE];
153 unsigned char salt[TLS_CIPHER_SM4_CCM_SALT_SIZE];
154 unsigned char rec_seq[TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE];
155};
156
157enum {
158 TLS_INFO_UNSPEC,
159 TLS_INFO_VERSION,
160 TLS_INFO_CIPHER,
161 TLS_INFO_TXCONF,
162 TLS_INFO_RXCONF,
163 __TLS_INFO_MAX,
164};
165#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
166
167#define TLS_CONF_BASE 1
168#define TLS_CONF_SW 2
169#define TLS_CONF_HW 3
170#define TLS_CONF_HW_RECORD 4
171
78#endif /* _LINUX_TLS_H */172#endif /* _LINUX_TLS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tty_flags.h+2-6
...@@ -39,7 +39,6 @@...@@ -39,7 +39,6 @@
39 * WARNING: These flags are no longer used and have been superceded by the39 * WARNING: These flags are no longer used and have been superceded by the
40 * TTY_PORT_ flags in the iflags field (and not userspace-visible)40 * TTY_PORT_ flags in the iflags field (and not userspace-visible)
41 */41 */
42#ifndef _KERNEL_
43#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */42#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
44#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */43#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
45#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */44#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
...@@ -50,7 +49,6 @@...@@ -50,7 +49,6 @@
50#define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */49#define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */
51#define ASYNCB_CONS_FLOW 23 /* flow control for console */50#define ASYNCB_CONS_FLOW 23 /* flow control for console */
52#define ASYNCB_FIRST_KERNEL 2251#define ASYNCB_FIRST_KERNEL 22
53#endif
5452
55/* Masks */53/* Masks */
56#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)54#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
...@@ -73,15 +71,14 @@...@@ -73,15 +71,14 @@
73#define ASYNC_MAGIC_MULTIPLIER (1U << ASYNCB_MAGIC_MULTIPLIER)71#define ASYNC_MAGIC_MULTIPLIER (1U << ASYNCB_MAGIC_MULTIPLIER)
7472
75#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)73#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)
76#define ASYNC_DEPRECATED (ASYNC_SESSION_LOCKOUT | ASYNC_PGRP_LOCKOUT | \74#define ASYNC_DEPRECATED (ASYNC_SPLIT_TERMIOS | ASYNC_SESSION_LOCKOUT | \
77 ASYNC_CALLOUT_NOHUP | ASYNC_AUTOPROBE)75 ASYNC_PGRP_LOCKOUT | ASYNC_CALLOUT_NOHUP | ASYNC_AUTOPROBE)
78#define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \76#define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \
79 ASYNC_LOW_LATENCY)77 ASYNC_LOW_LATENCY)
80#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)78#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
81#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)79#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)
82#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)80#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
8381
84#ifndef _KERNEL_
85/* These flags are no longer used (and were always masked from userspace) */82/* These flags are no longer used (and were always masked from userspace) */
86#define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED)83#define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED)
87#define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE)84#define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE)
...@@ -92,6 +89,5 @@...@@ -92,6 +89,5 @@
92#define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ)89#define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ)
93#define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW)90#define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW)
94#define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1))91#define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1))
95#endif
9692
97#endif93#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/udmabuf.h created+33
...@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_UDMABUF_H
3#define _LINUX_UDMABUF_H
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8#define UDMABUF_FLAGS_CLOEXEC 0x01
9
10struct udmabuf_create {
11 __u32 memfd;
12 __u32 flags;
13 __u64 offset;
14 __u64 size;
15};
16
17struct udmabuf_create_item {
18 __u32 memfd;
19 __u32 __pad;
20 __u64 offset;
21 __u64 size;
22};
23
24struct udmabuf_create_list {
25 __u32 flags;
26 __u32 count;
27 struct udmabuf_create_item list[];
28};
29
30#define UDMABUF_CREATE _IOW('u', 0x42, struct udmabuf_create)
31#define UDMABUF_CREATE_LIST _IOW('u', 0x43, struct udmabuf_create_list)
32
33#endif /* _LINUX_UDMABUF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/udp.h+2
...@@ -33,6 +33,7 @@ struct udphdr {...@@ -33,6 +33,7 @@ struct udphdr {
33#define UDP_NO_CHECK6_TX 101 /* Disable sending checksum for UDP6X */33#define UDP_NO_CHECK6_TX 101 /* Disable sending checksum for UDP6X */
34#define UDP_NO_CHECK6_RX 102 /* Disable accpeting checksum for UDP6 */34#define UDP_NO_CHECK6_RX 102 /* Disable accpeting checksum for UDP6 */
35#define UDP_SEGMENT 103 /* Set GSO segmentation size */35#define UDP_SEGMENT 103 /* Set GSO segmentation size */
36#define UDP_GRO 104 /* This socket can receive UDP GRO packets */
3637
37/* UDP encapsulation types */38/* UDP encapsulation types */
38#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */39#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
...@@ -41,5 +42,6 @@ struct udphdr {...@@ -41,5 +42,6 @@ struct udphdr {
41#define UDP_ENCAP_GTP0 4 /* GSM TS 09.60 */42#define UDP_ENCAP_GTP0 4 /* GSM TS 09.60 */
42#define UDP_ENCAP_GTP1U 5 /* 3GPP TS 29.060 */43#define UDP_ENCAP_GTP1U 5 /* 3GPP TS 29.060 */
43#define UDP_ENCAP_RXRPC 644#define UDP_ENCAP_RXRPC 6
45#define TCP_ENCAP_ESPINTCP 7 /* Yikes, this is really xfrm encap types. */
4446
45#endif /* _LINUX_UDP_H */47#endif /* _LINUX_UDP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/um_timetravel.h created+128
...@@ -0,0 +1,128 @@
1/*
2 * Permission to use, copy, modify, and/or distribute this software for any
3 * purpose with or without fee is hereby granted, provided that the above
4 * copyright notice and this permission notice appear in all copies.
5 *
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 *
14 * Copyright (C) 2019 Intel Corporation
15 */
16#ifndef _LINUX_UM_TIMETRAVEL_H
17#define _LINUX_UM_TIMETRAVEL_H
18#include <linux/types.h>
19
20/**
21 * struct um_timetravel_msg - UM time travel message
22 *
23 * This is the basic message type, going in both directions.
24 *
25 * This is the message passed between the host (user-mode Linux instance)
26 * and the calendar (the application on the other side of the socket) in
27 * order to implement common scheduling.
28 *
29 * Whenever UML has an event it will request runtime for it from the
30 * calendar, and then wait for its turn until it can run, etc. Note
31 * that it will only ever request the single next runtime, i.e. multiple
32 * REQUEST messages override each other.
33 */
34struct um_timetravel_msg {
35 /**
36 * @op: operation value from &enum um_timetravel_ops
37 */
38 __u32 op;
39
40 /**
41 * @seq: sequence number for the message - shall be reflected in
42 * the ACK response, and should be checked while processing
43 * the response to see if it matches
44 */
45 __u32 seq;
46
47 /**
48 * @time: time in nanoseconds
49 */
50 __u64 time;
51};
52
53/**
54 * enum um_timetravel_ops - Operation codes
55 */
56enum um_timetravel_ops {
57 /**
58 * @UM_TIMETRAVEL_ACK: response (ACK) to any previous message,
59 * this usually doesn't carry any data in the 'time' field
60 * unless otherwise specified below
61 */
62 UM_TIMETRAVEL_ACK = 0,
63
64 /**
65 * @UM_TIMETRAVEL_START: initialize the connection, the time
66 * field contains an (arbitrary) ID to possibly be able
67 * to distinguish the connections.
68 */
69 UM_TIMETRAVEL_START = 1,
70
71 /**
72 * @UM_TIMETRAVEL_REQUEST: request to run at the given time
73 * (host -> calendar)
74 */
75 UM_TIMETRAVEL_REQUEST = 2,
76
77 /**
78 * @UM_TIMETRAVEL_WAIT: Indicate waiting for the previously requested
79 * runtime, new requests may be made while waiting (e.g. due to
80 * interrupts); the time field is ignored. The calendar must process
81 * this message and later send a %UM_TIMETRAVEL_RUN message when
82 * the host can run again.
83 * (host -> calendar)
84 */
85 UM_TIMETRAVEL_WAIT = 3,
86
87 /**
88 * @UM_TIMETRAVEL_GET: return the current time from the calendar in the
89 * ACK message, the time in the request message is ignored
90 * (host -> calendar)
91 */
92 UM_TIMETRAVEL_GET = 4,
93
94 /**
95 * @UM_TIMETRAVEL_UPDATE: time update to the calendar, must be sent e.g.
96 * before kicking an interrupt to another calendar
97 * (host -> calendar)
98 */
99 UM_TIMETRAVEL_UPDATE = 5,
100
101 /**
102 * @UM_TIMETRAVEL_RUN: run time request granted, current time is in
103 * the time field
104 * (calendar -> host)
105 */
106 UM_TIMETRAVEL_RUN = 6,
107
108 /**
109 * @UM_TIMETRAVEL_FREE_UNTIL: Enable free-running until the given time,
110 * this is a message from the calendar telling the host that it can
111 * freely do its own scheduling for anything before the indicated
112 * time.
113 * Note that if a calendar sends this message once, the host may
114 * assume that it will also do so in the future, if it implements
115 * wraparound semantics for the time field.
116 * (calendar -> host)
117 */
118 UM_TIMETRAVEL_FREE_UNTIL = 7,
119
120 /**
121 * @UM_TIMETRAVEL_GET_TOD: Return time of day, typically used once at
122 * boot by the virtual machines to get a synchronized time from
123 * the simulation.
124 */
125 UM_TIMETRAVEL_GET_TOD = 8,
126};
127
128#endif /* _LINUX_UM_TIMETRAVEL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/unix_diag.h+2
...@@ -20,6 +20,7 @@ struct unix_diag_req {...@@ -20,6 +20,7 @@ struct unix_diag_req {
20#define UDIAG_SHOW_ICONS 0x00000008 /* show pending connections */20#define UDIAG_SHOW_ICONS 0x00000008 /* show pending connections */
21#define UDIAG_SHOW_RQLEN 0x00000010 /* show skb receive queue len */21#define UDIAG_SHOW_RQLEN 0x00000010 /* show skb receive queue len */
22#define UDIAG_SHOW_MEMINFO 0x00000020 /* show memory info of a socket */22#define UDIAG_SHOW_MEMINFO 0x00000020 /* show memory info of a socket */
23#define UDIAG_SHOW_UID 0x00000040 /* show socket's UID */
2324
24struct unix_diag_msg {25struct unix_diag_msg {
25 __u8 udiag_family;26 __u8 udiag_family;
...@@ -40,6 +41,7 @@ enum {...@@ -40,6 +41,7 @@ enum {
40 UNIX_DIAG_RQLEN,41 UNIX_DIAG_RQLEN,
41 UNIX_DIAG_MEMINFO,42 UNIX_DIAG_MEMINFO,
42 UNIX_DIAG_SHUTDOWN,43 UNIX_DIAG_SHUTDOWN,
44 UNIX_DIAG_UID,
4345
44 __UNIX_DIAG_MAX,46 __UNIX_DIAG_MAX,
45};47};
lib/libc/include/any-linux-any/linux/usb/audio.h+37
...@@ -450,6 +450,43 @@ static __inline__ __u8 *uac_processing_unit_specific(struct uac_processing_unit_...@@ -450,6 +450,43 @@ static __inline__ __u8 *uac_processing_unit_specific(struct uac_processing_unit_
450 }450 }
451}451}
452452
453/*
454 * Extension Unit (XU) has almost compatible layout with Processing Unit, but
455 * on UAC2, it has a different bmControls size (bControlSize); it's 1 byte for
456 * XU while 2 bytes for PU. The last iExtension field is a one-byte index as
457 * well as iProcessing field of PU.
458 */
459static __inline__ __u8 uac_extension_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
460 int protocol)
461{
462 switch (protocol) {
463 case UAC_VERSION_1:
464 return desc->baSourceID[desc->bNrInPins + 4];
465 case UAC_VERSION_2:
466 return 1; /* in UAC2, this value is constant */
467 case UAC_VERSION_3:
468 return 4; /* in UAC3, this value is constant */
469 default:
470 return 1;
471 }
472}
473
474static __inline__ __u8 uac_extension_unit_iExtension(struct uac_processing_unit_descriptor *desc,
475 int protocol)
476{
477 __u8 control_size = uac_extension_unit_bControlSize(desc, protocol);
478
479 switch (protocol) {
480 case UAC_VERSION_1:
481 case UAC_VERSION_2:
482 default:
483 return *(uac_processing_unit_bmControls(desc, protocol)
484 + control_size);
485 case UAC_VERSION_3:
486 return 0; /* UAC3 does not have this field */
487 }
488}
489
453/* 4.5.2 Class-Specific AS Interface Descriptor */490/* 4.5.2 Class-Specific AS Interface Descriptor */
454struct uac1_as_header_descriptor {491struct uac1_as_header_descriptor {
455 __u8 bLength; /* in bytes: 7 */492 __u8 bLength; /* in bytes: 7 */
lib/libc/include/any-linux-any/linux/usb/ch9.h+28-6
...@@ -138,11 +138,11 @@...@@ -138,11 +138,11 @@
138 * Test Mode Selectors138 * Test Mode Selectors
139 * See USB 2.0 spec Table 9-7139 * See USB 2.0 spec Table 9-7
140 */140 */
141#define TEST_J 1141#define USB_TEST_J 1
142#define TEST_K 2142#define USB_TEST_K 2
143#define TEST_SE0_NAK 3143#define USB_TEST_SE0_NAK 3
144#define TEST_PACKET 4144#define USB_TEST_PACKET 4
145#define TEST_FORCE_EN 5145#define USB_TEST_FORCE_ENABLE 5
146146
147/* Status Type */147/* Status Type */
148#define USB_STATUS_TYPE_STANDARD 0148#define USB_STATUS_TYPE_STANDARD 0
...@@ -326,6 +326,10 @@ struct usb_device_descriptor {...@@ -326,6 +326,10 @@ struct usb_device_descriptor {
326#define USB_CLASS_CONTENT_SEC 0x0d /* content security */326#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
327#define USB_CLASS_VIDEO 0x0e327#define USB_CLASS_VIDEO 0x0e
328#define USB_CLASS_WIRELESS_CONTROLLER 0xe0328#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
329#define USB_CLASS_PERSONAL_HEALTHCARE 0x0f
330#define USB_CLASS_AUDIO_VIDEO 0x10
331#define USB_CLASS_BILLBOARD 0x11
332#define USB_CLASS_USB_TYPE_C_BRIDGE 0x12
329#define USB_CLASS_MISC 0xef333#define USB_CLASS_MISC 0xef
330#define USB_CLASS_APP_SPEC 0xfe334#define USB_CLASS_APP_SPEC 0xfe
331#define USB_CLASS_VENDOR_SPEC 0xff335#define USB_CLASS_VENDOR_SPEC 0xff
...@@ -364,6 +368,9 @@ struct usb_config_descriptor {...@@ -364,6 +368,9 @@ struct usb_config_descriptor {
364368
365/*-------------------------------------------------------------------------*/369/*-------------------------------------------------------------------------*/
366370
371/* USB String descriptors can contain at most 126 characters. */
372#define USB_MAX_STRING_LEN 126
373
367/* USB_DT_STRING: String descriptor */374/* USB_DT_STRING: String descriptor */
368struct usb_string_descriptor {375struct usb_string_descriptor {
369 __u8 bLength;376 __u8 bLength;
...@@ -894,6 +901,8 @@ struct usb_ext_cap_descriptor { /* Link Power Management */...@@ -894,6 +901,8 @@ struct usb_ext_cap_descriptor { /* Link Power Management */
894#define USB_BESL_SUPPORT (1 << 2) /* supports BESL */901#define USB_BESL_SUPPORT (1 << 2) /* supports BESL */
895#define USB_BESL_BASELINE_VALID (1 << 3) /* Baseline BESL valid*/902#define USB_BESL_BASELINE_VALID (1 << 3) /* Baseline BESL valid*/
896#define USB_BESL_DEEP_VALID (1 << 4) /* Deep BESL valid */903#define USB_BESL_DEEP_VALID (1 << 4) /* Deep BESL valid */
904#define USB_SET_BESL_BASELINE(p) (((p) & 0xf) << 8)
905#define USB_SET_BESL_DEEP(p) (((p) & 0xf) << 12)
897#define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8)906#define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8)
898#define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12)907#define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12)
899} __attribute__((packed));908} __attribute__((packed));
...@@ -959,9 +968,22 @@ struct usb_ssp_cap_descriptor {...@@ -959,9 +968,22 @@ struct usb_ssp_cap_descriptor {
959 __le32 bmSublinkSpeedAttr[1]; /* list of sublink speed attrib entries */968 __le32 bmSublinkSpeedAttr[1]; /* list of sublink speed attrib entries */
960#define USB_SSP_SUBLINK_SPEED_SSID (0xf) /* sublink speed ID */969#define USB_SSP_SUBLINK_SPEED_SSID (0xf) /* sublink speed ID */
961#define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4) /* Lanespeed exponent */970#define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4) /* Lanespeed exponent */
971#define USB_SSP_SUBLINK_SPEED_LSE_BPS 0
972#define USB_SSP_SUBLINK_SPEED_LSE_KBPS 1
973#define USB_SSP_SUBLINK_SPEED_LSE_MBPS 2
974#define USB_SSP_SUBLINK_SPEED_LSE_GBPS 3
975
962#define USB_SSP_SUBLINK_SPEED_ST (0x3 << 6) /* Sublink type */976#define USB_SSP_SUBLINK_SPEED_ST (0x3 << 6) /* Sublink type */
977#define USB_SSP_SUBLINK_SPEED_ST_SYM_RX 0
978#define USB_SSP_SUBLINK_SPEED_ST_ASYM_RX 1
979#define USB_SSP_SUBLINK_SPEED_ST_SYM_TX 2
980#define USB_SSP_SUBLINK_SPEED_ST_ASYM_TX 3
981
963#define USB_SSP_SUBLINK_SPEED_RSVD (0x3f << 8) /* Reserved */982#define USB_SSP_SUBLINK_SPEED_RSVD (0x3f << 8) /* Reserved */
964#define USB_SSP_SUBLINK_SPEED_LP (0x3 << 14) /* Link protocol */983#define USB_SSP_SUBLINK_SPEED_LP (0x3 << 14) /* Link protocol */
984#define USB_SSP_SUBLINK_SPEED_LP_SS 0
985#define USB_SSP_SUBLINK_SPEED_LP_SSP 1
986
965#define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16) /* Lanespeed mantissa */987#define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16) /* Lanespeed mantissa */
966} __attribute__((packed));988} __attribute__((packed));
967989
...@@ -1220,7 +1242,7 @@ struct usb_set_sel_req {...@@ -1220,7 +1242,7 @@ struct usb_set_sel_req {
1220 * As per USB compliance update, a device that is actively drawing1242 * As per USB compliance update, a device that is actively drawing
1221 * more than 100mA from USB must report itself as bus-powered in1243 * more than 100mA from USB must report itself as bus-powered in
1222 * the GetStatus(DEVICE) call.1244 * the GetStatus(DEVICE) call.
1223 * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#341245 * https://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
1224 */1246 */
1225#define USB_SELF_POWER_VBUS_MAX_DRAW 1001247#define USB_SELF_POWER_VBUS_MAX_DRAW 100
12261248
lib/libc/include/any-linux-any/linux/usb/charger.h+8-8
...@@ -14,18 +14,18 @@...@@ -14,18 +14,18 @@
14 * ACA (Accessory Charger Adapters)14 * ACA (Accessory Charger Adapters)
15 */15 */
16enum usb_charger_type {16enum usb_charger_type {
17 UNKNOWN_TYPE,17 UNKNOWN_TYPE = 0,
18 SDP_TYPE,18 SDP_TYPE = 1,
19 DCP_TYPE,19 DCP_TYPE = 2,
20 CDP_TYPE,20 CDP_TYPE = 3,
21 ACA_TYPE,21 ACA_TYPE = 4,
22};22};
2323
24/* USB charger state */24/* USB charger state */
25enum usb_charger_state {25enum usb_charger_state {
26 USB_CHARGER_DEFAULT,26 USB_CHARGER_DEFAULT = 0,
27 USB_CHARGER_PRESENT,27 USB_CHARGER_PRESENT = 1,
28 USB_CHARGER_ABSENT,28 USB_CHARGER_ABSENT = 2,
29};29};
3030
31#endif /* __LINUX_USB_CHARGER_H */31#endif /* __LINUX_USB_CHARGER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/g_uvc.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0+ */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * g_uvc.h -- USB Video Class Gadget driver API3 * g_uvc.h -- USB Video Class Gadget driver API
4 *4 *
lib/libc/include/any-linux-any/linux/usb/raw_gadget.h created+249
...@@ -0,0 +1,249 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * USB Raw Gadget driver.
4 *
5 * See Documentation/usb/raw-gadget.rst for more details.
6 */
7
8#ifndef __LINUX_USB_RAW_GADGET_H
9#define __LINUX_USB_RAW_GADGET_H
10
11#include <asm/ioctl.h>
12#include <linux/types.h>
13#include <linux/usb/ch9.h>
14
15/* Maximum length of driver_name/device_name in the usb_raw_init struct. */
16#define UDC_NAME_LENGTH_MAX 128
17
18/*
19 * struct usb_raw_init - argument for USB_RAW_IOCTL_INIT ioctl.
20 * @speed: The speed of the emulated USB device, takes the same values as
21 * the usb_device_speed enum: USB_SPEED_FULL, USB_SPEED_HIGH, etc.
22 * @driver_name: The name of the UDC driver.
23 * @device_name: The name of a UDC instance.
24 *
25 * The last two fields identify a UDC the gadget driver should bind to.
26 * For example, Dummy UDC has "dummy_udc" as its driver_name and "dummy_udc.N"
27 * as its device_name, where N in the index of the Dummy UDC instance.
28 * At the same time the dwc2 driver that is used on Raspberry Pi Zero, has
29 * "20980000.usb" as both driver_name and device_name.
30 */
31struct usb_raw_init {
32 __u8 driver_name[UDC_NAME_LENGTH_MAX];
33 __u8 device_name[UDC_NAME_LENGTH_MAX];
34 __u8 speed;
35};
36
37/* The type of event fetched with the USB_RAW_IOCTL_EVENT_FETCH ioctl. */
38enum usb_raw_event_type {
39 USB_RAW_EVENT_INVALID = 0,
40
41 /* This event is queued when the driver has bound to a UDC. */
42 USB_RAW_EVENT_CONNECT = 1,
43
44 /* This event is queued when a new control request arrived to ep0. */
45 USB_RAW_EVENT_CONTROL = 2,
46
47 /* The list might grow in the future. */
48};
49
50/*
51 * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
52 * @type: The type of the fetched event.
53 * @length: Length of the data buffer. Updated by the driver and set to the
54 * actual length of the fetched event data.
55 * @data: A buffer to store the fetched event data.
56 *
57 * Currently the fetched data buffer is empty for USB_RAW_EVENT_CONNECT,
58 * and contains struct usb_ctrlrequest for USB_RAW_EVENT_CONTROL.
59 */
60struct usb_raw_event {
61 __u32 type;
62 __u32 length;
63 __u8 data[0];
64};
65
66#define USB_RAW_IO_FLAGS_ZERO 0x0001
67#define USB_RAW_IO_FLAGS_MASK 0x0001
68
69static __inline__ int usb_raw_io_flags_valid(__u16 flags)
70{
71 return (flags & ~USB_RAW_IO_FLAGS_MASK) == 0;
72}
73
74static __inline__ int usb_raw_io_flags_zero(__u16 flags)
75{
76 return (flags & USB_RAW_IO_FLAGS_ZERO);
77}
78
79/*
80 * struct usb_raw_ep_io - argument for USB_RAW_IOCTL_EP0/EP_WRITE/READ ioctls.
81 * @ep: Endpoint handle as returned by USB_RAW_IOCTL_EP_ENABLE for
82 * USB_RAW_IOCTL_EP_WRITE/READ. Ignored for USB_RAW_IOCTL_EP0_WRITE/READ.
83 * @flags: When USB_RAW_IO_FLAGS_ZERO is specified, the zero flag is set on
84 * the submitted USB request, see include/linux/usb/gadget.h for details.
85 * @length: Length of data.
86 * @data: Data to send for USB_RAW_IOCTL_EP0/EP_WRITE. Buffer to store received
87 * data for USB_RAW_IOCTL_EP0/EP_READ.
88 */
89struct usb_raw_ep_io {
90 __u16 ep;
91 __u16 flags;
92 __u32 length;
93 __u8 data[0];
94};
95
96/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
97#define USB_RAW_EPS_NUM_MAX 30
98
99/* Maximum length of UDC endpoint name in struct usb_raw_ep_info. */
100#define USB_RAW_EP_NAME_MAX 16
101
102/* Used as addr in struct usb_raw_ep_info if endpoint accepts any address. */
103#define USB_RAW_EP_ADDR_ANY 0xff
104
105/*
106 * struct usb_raw_ep_caps - exposes endpoint capabilities from struct usb_ep
107 * (technically from its member struct usb_ep_caps).
108 */
109struct usb_raw_ep_caps {
110 __u32 type_control : 1;
111 __u32 type_iso : 1;
112 __u32 type_bulk : 1;
113 __u32 type_int : 1;
114 __u32 dir_in : 1;
115 __u32 dir_out : 1;
116};
117
118/*
119 * struct usb_raw_ep_limits - exposes endpoint limits from struct usb_ep.
120 * @maxpacket_limit: Maximum packet size value supported by this endpoint.
121 * @max_streams: maximum number of streams supported by this endpoint
122 * (actual number is 2^n).
123 * @reserved: Empty, reserved for potential future extensions.
124 */
125struct usb_raw_ep_limits {
126 __u16 maxpacket_limit;
127 __u16 max_streams;
128 __u32 reserved;
129};
130
131/*
132 * struct usb_raw_ep_info - stores information about a gadget endpoint.
133 * @name: Name of the endpoint as it is defined in the UDC driver.
134 * @addr: Address of the endpoint that must be specified in the endpoint
135 * descriptor passed to USB_RAW_IOCTL_EP_ENABLE ioctl.
136 * @caps: Endpoint capabilities.
137 * @limits: Endpoint limits.
138 */
139struct usb_raw_ep_info {
140 __u8 name[USB_RAW_EP_NAME_MAX];
141 __u32 addr;
142 struct usb_raw_ep_caps caps;
143 struct usb_raw_ep_limits limits;
144};
145
146/*
147 * struct usb_raw_eps_info - argument for USB_RAW_IOCTL_EPS_INFO ioctl.
148 * eps: Structures that store information about non-control endpoints.
149 */
150struct usb_raw_eps_info {
151 struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
152};
153
154/*
155 * Initializes a Raw Gadget instance.
156 * Accepts a pointer to the usb_raw_init struct as an argument.
157 * Returns 0 on success or negative error code on failure.
158 */
159#define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
160
161/*
162 * Instructs Raw Gadget to bind to a UDC and start emulating a USB device.
163 * Returns 0 on success or negative error code on failure.
164 */
165#define USB_RAW_IOCTL_RUN _IO('U', 1)
166
167/*
168 * A blocking ioctl that waits for an event and returns fetched event data to
169 * the user.
170 * Accepts a pointer to the usb_raw_event struct.
171 * Returns 0 on success or negative error code on failure.
172 */
173#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
174
175/*
176 * Queues an IN (OUT for READ) request as a response to the last setup request
177 * received on endpoint 0 (provided that was an IN (OUT for READ) request), and
178 * waits until the request is completed. Copies received data to user for READ.
179 * Accepts a pointer to the usb_raw_ep_io struct as an argument.
180 * Returns length of transferred data on success or negative error code on
181 * failure.
182 */
183#define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
184#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
185
186/*
187 * Finds an endpoint that satisfies the parameters specified in the provided
188 * descriptors (address, transfer type, etc.) and enables it.
189 * Accepts a pointer to the usb_raw_ep_descs struct as an argument.
190 * Returns enabled endpoint handle on success or negative error code on failure.
191 */
192#define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
193
194/*
195 * Disables specified endpoint.
196 * Accepts endpoint handle as an argument.
197 * Returns 0 on success or negative error code on failure.
198 */
199#define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
200
201/*
202 * Queues an IN (OUT for READ) request as a response to the last setup request
203 * received on endpoint usb_raw_ep_io.ep (provided that was an IN (OUT for READ)
204 * request), and waits until the request is completed. Copies received data to
205 * user for READ.
206 * Accepts a pointer to the usb_raw_ep_io struct as an argument.
207 * Returns length of transferred data on success or negative error code on
208 * failure.
209 */
210#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
211#define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
212
213/*
214 * Switches the gadget into the configured state.
215 * Returns 0 on success or negative error code on failure.
216 */
217#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
218
219/*
220 * Constrains UDC VBUS power usage.
221 * Accepts current limit in 2 mA units as an argument.
222 * Returns 0 on success or negative error code on failure.
223 */
224#define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
225
226/*
227 * Fills in the usb_raw_eps_info structure with information about non-control
228 * endpoints available for the currently connected UDC.
229 * Returns the number of available endpoints on success or negative error code
230 * on failure.
231 */
232#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
233
234/*
235 * Stalls a pending control request on endpoint 0.
236 * Returns 0 on success or negative error code on failure.
237 */
238#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
239
240/*
241 * Sets or clears halt or wedge status of the endpoint.
242 * Accepts endpoint handle as an argument.
243 * Returns 0 on success or negative error code on failure.
244 */
245#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
246#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
247#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)
248
249#endif /* __LINUX_USB_RAW_GADGET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/tmc.h+44
...@@ -4,6 +4,7 @@...@@ -4,6 +4,7 @@
4 * Copyright (C) 2008 Novell, Inc.4 * Copyright (C) 2008 Novell, Inc.
5 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>5 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
6 * Copyright (C) 2015 Dave Penkler <dpenkler@gmail.com>6 * Copyright (C) 2015 Dave Penkler <dpenkler@gmail.com>
7 * Copyright (C) 2018 IVI Foundation, Inc.
7 *8 *
8 * This file holds USB constants defined by the USB Device Class9 * This file holds USB constants defined by the USB Device Class
9 * and USB488 Subclass Definitions for Test and Measurement devices10 * and USB488 Subclass Definitions for Test and Measurement devices
...@@ -40,11 +41,38 @@...@@ -40,11 +41,38 @@
40#define USBTMC488_REQUEST_GOTO_LOCAL 16141#define USBTMC488_REQUEST_GOTO_LOCAL 161
41#define USBTMC488_REQUEST_LOCAL_LOCKOUT 16242#define USBTMC488_REQUEST_LOCAL_LOCKOUT 162
4243
44struct usbtmc_request {
45 __u8 bRequestType;
46 __u8 bRequest;
47 __u16 wValue;
48 __u16 wIndex;
49 __u16 wLength;
50} __attribute__ ((packed));
51
52struct usbtmc_ctrlrequest {
53 struct usbtmc_request req;
54 void *data; /* pointer to user space */
55} __attribute__ ((packed));
56
43struct usbtmc_termchar {57struct usbtmc_termchar {
44 __u8 term_char;58 __u8 term_char;
45 __u8 term_char_enabled;59 __u8 term_char_enabled;
46} __attribute__ ((packed));60} __attribute__ ((packed));
4761
62/*
63 * usbtmc_message->flags:
64 */
65#define USBTMC_FLAG_ASYNC 0x0001
66#define USBTMC_FLAG_APPEND 0x0002
67#define USBTMC_FLAG_IGNORE_TRAILER 0x0004
68
69struct usbtmc_message {
70 __u32 transfer_size; /* size of bytes to transfer */
71 __u32 transferred; /* size of received/written bytes */
72 __u32 flags; /* bit 0: 0 = synchronous; 1 = asynchronous */
73 void *message; /* pointer to header and data in user space */
74} __attribute__ ((packed));
75
48/* Request values for USBTMC driver's ioctl entry point */76/* Request values for USBTMC driver's ioctl entry point */
49#define USBTMC_IOC_NR 9177#define USBTMC_IOC_NR 91
50#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)78#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
...@@ -53,10 +81,15 @@ struct usbtmc_termchar {...@@ -53,10 +81,15 @@ struct usbtmc_termchar {
53#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)81#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
54#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)82#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
55#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)83#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
84#define USBTMC_IOCTL_CTRL_REQUEST _IOWR(USBTMC_IOC_NR, 8, struct usbtmc_ctrlrequest)
56#define USBTMC_IOCTL_GET_TIMEOUT _IOR(USBTMC_IOC_NR, 9, __u32)85#define USBTMC_IOCTL_GET_TIMEOUT _IOR(USBTMC_IOC_NR, 9, __u32)
57#define USBTMC_IOCTL_SET_TIMEOUT _IOW(USBTMC_IOC_NR, 10, __u32)86#define USBTMC_IOCTL_SET_TIMEOUT _IOW(USBTMC_IOC_NR, 10, __u32)
58#define USBTMC_IOCTL_EOM_ENABLE _IOW(USBTMC_IOC_NR, 11, __u8)87#define USBTMC_IOCTL_EOM_ENABLE _IOW(USBTMC_IOC_NR, 11, __u8)
59#define USBTMC_IOCTL_CONFIG_TERMCHAR _IOW(USBTMC_IOC_NR, 12, struct usbtmc_termchar)88#define USBTMC_IOCTL_CONFIG_TERMCHAR _IOW(USBTMC_IOC_NR, 12, struct usbtmc_termchar)
89#define USBTMC_IOCTL_WRITE _IOWR(USBTMC_IOC_NR, 13, struct usbtmc_message)
90#define USBTMC_IOCTL_READ _IOWR(USBTMC_IOC_NR, 14, struct usbtmc_message)
91#define USBTMC_IOCTL_WRITE_RESULT _IOWR(USBTMC_IOC_NR, 15, __u32)
92#define USBTMC_IOCTL_API_VERSION _IOR(USBTMC_IOC_NR, 16, __u32)
6093
61#define USBTMC488_IOCTL_GET_CAPS _IOR(USBTMC_IOC_NR, 17, unsigned char)94#define USBTMC488_IOCTL_GET_CAPS _IOR(USBTMC_IOC_NR, 17, unsigned char)
62#define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)95#define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)
...@@ -64,6 +97,17 @@ struct usbtmc_termchar {...@@ -64,6 +97,17 @@ struct usbtmc_termchar {
64#define USBTMC488_IOCTL_GOTO_LOCAL _IO(USBTMC_IOC_NR, 20)97#define USBTMC488_IOCTL_GOTO_LOCAL _IO(USBTMC_IOC_NR, 20)
65#define USBTMC488_IOCTL_LOCAL_LOCKOUT _IO(USBTMC_IOC_NR, 21)98#define USBTMC488_IOCTL_LOCAL_LOCKOUT _IO(USBTMC_IOC_NR, 21)
66#define USBTMC488_IOCTL_TRIGGER _IO(USBTMC_IOC_NR, 22)99#define USBTMC488_IOCTL_TRIGGER _IO(USBTMC_IOC_NR, 22)
100#define USBTMC488_IOCTL_WAIT_SRQ _IOW(USBTMC_IOC_NR, 23, __u32)
101
102#define USBTMC_IOCTL_MSG_IN_ATTR _IOR(USBTMC_IOC_NR, 24, __u8)
103#define USBTMC_IOCTL_AUTO_ABORT _IOW(USBTMC_IOC_NR, 25, __u8)
104
105#define USBTMC_IOCTL_GET_STB _IOR(USBTMC_IOC_NR, 26, __u8)
106#define USBTMC_IOCTL_GET_SRQ_STB _IOR(USBTMC_IOC_NR, 27, __u8)
107
108/* Cancel and cleanup asynchronous calls */
109#define USBTMC_IOCTL_CANCEL_IO _IO(USBTMC_IOC_NR, 35)
110#define USBTMC_IOCTL_CLEANUP_IO _IO(USBTMC_IOC_NR, 36)
67111
68/* Driver encoded usb488 capabilities */112/* Driver encoded usb488 capabilities */
69#define USBTMC488_CAPABILITY_TRIGGER 1113#define USBTMC488_CAPABILITY_TRIGGER 1
lib/libc/include/any-linux-any/linux/usb/video.h+154-153
...@@ -192,14 +192,14 @@ struct uvc_descriptor_header {...@@ -192,14 +192,14 @@ struct uvc_descriptor_header {
192192
193/* 3.7.2. Video Control Interface Header Descriptor */193/* 3.7.2. Video Control Interface Header Descriptor */
194struct uvc_header_descriptor {194struct uvc_header_descriptor {
195 __u8 bLength;195 __u8 bLength;
196 __u8 bDescriptorType;196 __u8 bDescriptorType;
197 __u8 bDescriptorSubType;197 __u8 bDescriptorSubType;
198 __u16 bcdUVC;198 __le16 bcdUVC;
199 __u16 wTotalLength;199 __le16 wTotalLength;
200 __u32 dwClockFrequency;200 __le32 dwClockFrequency;
201 __u8 bInCollection;201 __u8 bInCollection;
202 __u8 baInterfaceNr[];202 __u8 baInterfaceNr[];
203} __attribute__((__packed__));203} __attribute__((__packed__));
204204
205#define UVC_DT_HEADER_SIZE(n) (12+(n))205#define UVC_DT_HEADER_SIZE(n) (12+(n))
...@@ -209,57 +209,57 @@ struct uvc_header_descriptor {...@@ -209,57 +209,57 @@ struct uvc_header_descriptor {
209209
210#define DECLARE_UVC_HEADER_DESCRIPTOR(n) \210#define DECLARE_UVC_HEADER_DESCRIPTOR(n) \
211struct UVC_HEADER_DESCRIPTOR(n) { \211struct UVC_HEADER_DESCRIPTOR(n) { \
212 __u8 bLength; \212 __u8 bLength; \
213 __u8 bDescriptorType; \213 __u8 bDescriptorType; \
214 __u8 bDescriptorSubType; \214 __u8 bDescriptorSubType; \
215 __u16 bcdUVC; \215 __le16 bcdUVC; \
216 __u16 wTotalLength; \216 __le16 wTotalLength; \
217 __u32 dwClockFrequency; \217 __le32 dwClockFrequency; \
218 __u8 bInCollection; \218 __u8 bInCollection; \
219 __u8 baInterfaceNr[n]; \219 __u8 baInterfaceNr[n]; \
220} __attribute__ ((packed))220} __attribute__ ((packed))
221221
222/* 3.7.2.1. Input Terminal Descriptor */222/* 3.7.2.1. Input Terminal Descriptor */
223struct uvc_input_terminal_descriptor {223struct uvc_input_terminal_descriptor {
224 __u8 bLength;224 __u8 bLength;
225 __u8 bDescriptorType;225 __u8 bDescriptorType;
226 __u8 bDescriptorSubType;226 __u8 bDescriptorSubType;
227 __u8 bTerminalID;227 __u8 bTerminalID;
228 __u16 wTerminalType;228 __le16 wTerminalType;
229 __u8 bAssocTerminal;229 __u8 bAssocTerminal;
230 __u8 iTerminal;230 __u8 iTerminal;
231} __attribute__((__packed__));231} __attribute__((__packed__));
232232
233#define UVC_DT_INPUT_TERMINAL_SIZE 8233#define UVC_DT_INPUT_TERMINAL_SIZE 8
234234
235/* 3.7.2.2. Output Terminal Descriptor */235/* 3.7.2.2. Output Terminal Descriptor */
236struct uvc_output_terminal_descriptor {236struct uvc_output_terminal_descriptor {
237 __u8 bLength;237 __u8 bLength;
238 __u8 bDescriptorType;238 __u8 bDescriptorType;
239 __u8 bDescriptorSubType;239 __u8 bDescriptorSubType;
240 __u8 bTerminalID;240 __u8 bTerminalID;
241 __u16 wTerminalType;241 __le16 wTerminalType;
242 __u8 bAssocTerminal;242 __u8 bAssocTerminal;
243 __u8 bSourceID;243 __u8 bSourceID;
244 __u8 iTerminal;244 __u8 iTerminal;
245} __attribute__((__packed__));245} __attribute__((__packed__));
246246
247#define UVC_DT_OUTPUT_TERMINAL_SIZE 9247#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
248248
249/* 3.7.2.3. Camera Terminal Descriptor */249/* 3.7.2.3. Camera Terminal Descriptor */
250struct uvc_camera_terminal_descriptor {250struct uvc_camera_terminal_descriptor {
251 __u8 bLength;251 __u8 bLength;
252 __u8 bDescriptorType;252 __u8 bDescriptorType;
253 __u8 bDescriptorSubType;253 __u8 bDescriptorSubType;
254 __u8 bTerminalID;254 __u8 bTerminalID;
255 __u16 wTerminalType;255 __le16 wTerminalType;
256 __u8 bAssocTerminal;256 __u8 bAssocTerminal;
257 __u8 iTerminal;257 __u8 iTerminal;
258 __u16 wObjectiveFocalLengthMin;258 __le16 wObjectiveFocalLengthMin;
259 __u16 wObjectiveFocalLengthMax;259 __le16 wObjectiveFocalLengthMax;
260 __u16 wOcularFocalLength;260 __le16 wOcularFocalLength;
261 __u8 bControlSize;261 __u8 bControlSize;
262 __u8 bmControls[3];262 __u8 bmControls[3];
263} __attribute__((__packed__));263} __attribute__((__packed__));
264264
265#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))265#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))
...@@ -293,18 +293,19 @@ struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \...@@ -293,18 +293,19 @@ struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \
293293
294/* 3.7.2.5. Processing Unit Descriptor */294/* 3.7.2.5. Processing Unit Descriptor */
295struct uvc_processing_unit_descriptor {295struct uvc_processing_unit_descriptor {
296 __u8 bLength;296 __u8 bLength;
297 __u8 bDescriptorType;297 __u8 bDescriptorType;
298 __u8 bDescriptorSubType;298 __u8 bDescriptorSubType;
299 __u8 bUnitID;299 __u8 bUnitID;
300 __u8 bSourceID;300 __u8 bSourceID;
301 __u16 wMaxMultiplier;301 __le16 wMaxMultiplier;
302 __u8 bControlSize;302 __u8 bControlSize;
303 __u8 bmControls[2];303 __u8 bmControls[2];
304 __u8 iProcessing;304 __u8 iProcessing;
305 __u8 bmVideoStandards;
305} __attribute__((__packed__));306} __attribute__((__packed__));
306307
307#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))308#define UVC_DT_PROCESSING_UNIT_SIZE(n) (10+(n))
308309
309/* 3.7.2.6. Extension Unit Descriptor */310/* 3.7.2.6. Extension Unit Descriptor */
310struct uvc_extension_unit_descriptor {311struct uvc_extension_unit_descriptor {
...@@ -343,29 +344,29 @@ struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \...@@ -343,29 +344,29 @@ struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \
343344
344/* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */345/* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */
345struct uvc_control_endpoint_descriptor {346struct uvc_control_endpoint_descriptor {
346 __u8 bLength;347 __u8 bLength;
347 __u8 bDescriptorType;348 __u8 bDescriptorType;
348 __u8 bDescriptorSubType;349 __u8 bDescriptorSubType;
349 __u16 wMaxTransferSize;350 __le16 wMaxTransferSize;
350} __attribute__((__packed__));351} __attribute__((__packed__));
351352
352#define UVC_DT_CONTROL_ENDPOINT_SIZE 5353#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
353354
354/* 3.9.2.1. Input Header Descriptor */355/* 3.9.2.1. Input Header Descriptor */
355struct uvc_input_header_descriptor {356struct uvc_input_header_descriptor {
356 __u8 bLength;357 __u8 bLength;
357 __u8 bDescriptorType;358 __u8 bDescriptorType;
358 __u8 bDescriptorSubType;359 __u8 bDescriptorSubType;
359 __u8 bNumFormats;360 __u8 bNumFormats;
360 __u16 wTotalLength;361 __le16 wTotalLength;
361 __u8 bEndpointAddress;362 __u8 bEndpointAddress;
362 __u8 bmInfo;363 __u8 bmInfo;
363 __u8 bTerminalLink;364 __u8 bTerminalLink;
364 __u8 bStillCaptureMethod;365 __u8 bStillCaptureMethod;
365 __u8 bTriggerSupport;366 __u8 bTriggerSupport;
366 __u8 bTriggerUsage;367 __u8 bTriggerUsage;
367 __u8 bControlSize;368 __u8 bControlSize;
368 __u8 bmaControls[];369 __u8 bmaControls[];
369} __attribute__((__packed__));370} __attribute__((__packed__));
370371
371#define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))372#define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))
...@@ -375,32 +376,32 @@ struct uvc_input_header_descriptor {...@@ -375,32 +376,32 @@ struct uvc_input_header_descriptor {
375376
376#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \377#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
377struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \378struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \
378 __u8 bLength; \379 __u8 bLength; \
379 __u8 bDescriptorType; \380 __u8 bDescriptorType; \
380 __u8 bDescriptorSubType; \381 __u8 bDescriptorSubType; \
381 __u8 bNumFormats; \382 __u8 bNumFormats; \
382 __u16 wTotalLength; \383 __le16 wTotalLength; \
383 __u8 bEndpointAddress; \384 __u8 bEndpointAddress; \
384 __u8 bmInfo; \385 __u8 bmInfo; \
385 __u8 bTerminalLink; \386 __u8 bTerminalLink; \
386 __u8 bStillCaptureMethod; \387 __u8 bStillCaptureMethod; \
387 __u8 bTriggerSupport; \388 __u8 bTriggerSupport; \
388 __u8 bTriggerUsage; \389 __u8 bTriggerUsage; \
389 __u8 bControlSize; \390 __u8 bControlSize; \
390 __u8 bmaControls[p][n]; \391 __u8 bmaControls[p][n]; \
391} __attribute__ ((packed))392} __attribute__ ((packed))
392393
393/* 3.9.2.2. Output Header Descriptor */394/* 3.9.2.2. Output Header Descriptor */
394struct uvc_output_header_descriptor {395struct uvc_output_header_descriptor {
395 __u8 bLength;396 __u8 bLength;
396 __u8 bDescriptorType;397 __u8 bDescriptorType;
397 __u8 bDescriptorSubType;398 __u8 bDescriptorSubType;
398 __u8 bNumFormats;399 __u8 bNumFormats;
399 __u16 wTotalLength;400 __le16 wTotalLength;
400 __u8 bEndpointAddress;401 __u8 bEndpointAddress;
401 __u8 bTerminalLink;402 __u8 bTerminalLink;
402 __u8 bControlSize;403 __u8 bControlSize;
403 __u8 bmaControls[];404 __u8 bmaControls[];
404} __attribute__((__packed__));405} __attribute__((__packed__));
405406
406#define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))407#define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))
...@@ -410,15 +411,15 @@ struct uvc_output_header_descriptor {...@@ -410,15 +411,15 @@ struct uvc_output_header_descriptor {
410411
411#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \412#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
412struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \413struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \
413 __u8 bLength; \414 __u8 bLength; \
414 __u8 bDescriptorType; \415 __u8 bDescriptorType; \
415 __u8 bDescriptorSubType; \416 __u8 bDescriptorSubType; \
416 __u8 bNumFormats; \417 __u8 bNumFormats; \
417 __u16 wTotalLength; \418 __le16 wTotalLength; \
418 __u8 bEndpointAddress; \419 __u8 bEndpointAddress; \
419 __u8 bTerminalLink; \420 __u8 bTerminalLink; \
420 __u8 bControlSize; \421 __u8 bControlSize; \
421 __u8 bmaControls[p][n]; \422 __u8 bmaControls[p][n]; \
422} __attribute__ ((packed))423} __attribute__ ((packed))
423424
424/* 3.9.2.6. Color matching descriptor */425/* 3.9.2.6. Color matching descriptor */
...@@ -473,19 +474,19 @@ struct uvc_format_uncompressed {...@@ -473,19 +474,19 @@ struct uvc_format_uncompressed {
473474
474/* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */475/* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */
475struct uvc_frame_uncompressed {476struct uvc_frame_uncompressed {
476 __u8 bLength;477 __u8 bLength;
477 __u8 bDescriptorType;478 __u8 bDescriptorType;
478 __u8 bDescriptorSubType;479 __u8 bDescriptorSubType;
479 __u8 bFrameIndex;480 __u8 bFrameIndex;
480 __u8 bmCapabilities;481 __u8 bmCapabilities;
481 __u16 wWidth;482 __le16 wWidth;
482 __u16 wHeight;483 __le16 wHeight;
483 __u32 dwMinBitRate;484 __le32 dwMinBitRate;
484 __u32 dwMaxBitRate;485 __le32 dwMaxBitRate;
485 __u32 dwMaxVideoFrameBufferSize;486 __le32 dwMaxVideoFrameBufferSize;
486 __u32 dwDefaultFrameInterval;487 __le32 dwDefaultFrameInterval;
487 __u8 bFrameIntervalType;488 __u8 bFrameIntervalType;
488 __u32 dwFrameInterval[];489 __le32 dwFrameInterval[];
489} __attribute__((__packed__));490} __attribute__((__packed__));
490491
491#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))492#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))
...@@ -495,19 +496,19 @@ struct uvc_frame_uncompressed {...@@ -495,19 +496,19 @@ struct uvc_frame_uncompressed {
495496
496#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \497#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \
497struct UVC_FRAME_UNCOMPRESSED(n) { \498struct UVC_FRAME_UNCOMPRESSED(n) { \
498 __u8 bLength; \499 __u8 bLength; \
499 __u8 bDescriptorType; \500 __u8 bDescriptorType; \
500 __u8 bDescriptorSubType; \501 __u8 bDescriptorSubType; \
501 __u8 bFrameIndex; \502 __u8 bFrameIndex; \
502 __u8 bmCapabilities; \503 __u8 bmCapabilities; \
503 __u16 wWidth; \504 __le16 wWidth; \
504 __u16 wHeight; \505 __le16 wHeight; \
505 __u32 dwMinBitRate; \506 __le32 dwMinBitRate; \
506 __u32 dwMaxBitRate; \507 __le32 dwMaxBitRate; \
507 __u32 dwMaxVideoFrameBufferSize; \508 __le32 dwMaxVideoFrameBufferSize; \
508 __u32 dwDefaultFrameInterval; \509 __le32 dwDefaultFrameInterval; \
509 __u8 bFrameIntervalType; \510 __u8 bFrameIntervalType; \
510 __u32 dwFrameInterval[n]; \511 __le32 dwFrameInterval[n]; \
511} __attribute__ ((packed))512} __attribute__ ((packed))
512513
513/* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */514/* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */
...@@ -529,19 +530,19 @@ struct uvc_format_mjpeg {...@@ -529,19 +530,19 @@ struct uvc_format_mjpeg {
529530
530/* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */531/* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */
531struct uvc_frame_mjpeg {532struct uvc_frame_mjpeg {
532 __u8 bLength;533 __u8 bLength;
533 __u8 bDescriptorType;534 __u8 bDescriptorType;
534 __u8 bDescriptorSubType;535 __u8 bDescriptorSubType;
535 __u8 bFrameIndex;536 __u8 bFrameIndex;
536 __u8 bmCapabilities;537 __u8 bmCapabilities;
537 __u16 wWidth;538 __le16 wWidth;
538 __u16 wHeight;539 __le16 wHeight;
539 __u32 dwMinBitRate;540 __le32 dwMinBitRate;
540 __u32 dwMaxBitRate;541 __le32 dwMaxBitRate;
541 __u32 dwMaxVideoFrameBufferSize;542 __le32 dwMaxVideoFrameBufferSize;
542 __u32 dwDefaultFrameInterval;543 __le32 dwDefaultFrameInterval;
543 __u8 bFrameIntervalType;544 __u8 bFrameIntervalType;
544 __u32 dwFrameInterval[];545 __le32 dwFrameInterval[];
545} __attribute__((__packed__));546} __attribute__((__packed__));
546547
547#define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))548#define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))
...@@ -551,19 +552,19 @@ struct uvc_frame_mjpeg {...@@ -551,19 +552,19 @@ struct uvc_frame_mjpeg {
551552
552#define DECLARE_UVC_FRAME_MJPEG(n) \553#define DECLARE_UVC_FRAME_MJPEG(n) \
553struct UVC_FRAME_MJPEG(n) { \554struct UVC_FRAME_MJPEG(n) { \
554 __u8 bLength; \555 __u8 bLength; \
555 __u8 bDescriptorType; \556 __u8 bDescriptorType; \
556 __u8 bDescriptorSubType; \557 __u8 bDescriptorSubType; \
557 __u8 bFrameIndex; \558 __u8 bFrameIndex; \
558 __u8 bmCapabilities; \559 __u8 bmCapabilities; \
559 __u16 wWidth; \560 __le16 wWidth; \
560 __u16 wHeight; \561 __le16 wHeight; \
561 __u32 dwMinBitRate; \562 __le32 dwMinBitRate; \
562 __u32 dwMaxBitRate; \563 __le32 dwMaxBitRate; \
563 __u32 dwMaxVideoFrameBufferSize; \564 __le32 dwMaxVideoFrameBufferSize; \
564 __u32 dwDefaultFrameInterval; \565 __le32 dwDefaultFrameInterval; \
565 __u8 bFrameIntervalType; \566 __u8 bFrameIntervalType; \
566 __u32 dwFrameInterval[n]; \567 __le32 dwFrameInterval[n]; \
567} __attribute__ ((packed))568} __attribute__ ((packed))
568569
569#endif /* __LINUX_USB_VIDEO_H */570#endif /* __LINUX_USB_VIDEO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usbdevice_fs.h+30
...@@ -76,6 +76,26 @@ struct usbdevfs_connectinfo {...@@ -76,6 +76,26 @@ struct usbdevfs_connectinfo {
76 unsigned char slow;76 unsigned char slow;
77};77};
7878
79struct usbdevfs_conninfo_ex {
80 __u32 size; /* Size of the structure from the kernel's */
81 /* point of view. Can be used by userspace */
82 /* to determine how much data can be */
83 /* used/trusted. */
84 __u32 busnum; /* USB bus number, as enumerated by the */
85 /* kernel, the device is connected to. */
86 __u32 devnum; /* Device address on the bus. */
87 __u32 speed; /* USB_SPEED_* constants from ch9.h */
88 __u8 num_ports; /* Number of ports the device is connected */
89 /* to on the way to the root hub. It may */
90 /* be bigger than size of 'ports' array so */
91 /* userspace can detect overflows. */
92 __u8 ports[7]; /* List of ports on the way from the root */
93 /* hub to the device. Current limit in */
94 /* USB specification is 7 tiers (root hub, */
95 /* 5 intermediate hubs, device), which */
96 /* gives at most 6 port entries. */
97};
98
79#define USBDEVFS_URB_SHORT_NOT_OK 0x0199#define USBDEVFS_URB_SHORT_NOT_OK 0x01
80#define USBDEVFS_URB_ISO_ASAP 0x02100#define USBDEVFS_URB_ISO_ASAP 0x02
81#define USBDEVFS_URB_BULK_CONTINUATION 0x04101#define USBDEVFS_URB_BULK_CONTINUATION 0x04
...@@ -137,6 +157,8 @@ struct usbdevfs_hub_portinfo {...@@ -137,6 +157,8 @@ struct usbdevfs_hub_portinfo {
137#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10157#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10
138#define USBDEVFS_CAP_MMAP 0x20158#define USBDEVFS_CAP_MMAP 0x20
139#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40159#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40
160#define USBDEVFS_CAP_CONNINFO_EX 0x80
161#define USBDEVFS_CAP_SUSPEND 0x100
140162
141/* USBDEVFS_DISCONNECT_CLAIM flags & struct */163/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
142164
...@@ -197,5 +219,13 @@ struct usbdevfs_streams {...@@ -197,5 +219,13 @@ struct usbdevfs_streams {
197#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)219#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
198#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)220#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
199#define USBDEVFS_GET_SPEED _IO('U', 31)221#define USBDEVFS_GET_SPEED _IO('U', 31)
222/*
223 * Returns struct usbdevfs_conninfo_ex; length is variable to allow
224 * extending size of the data returned.
225 */
226#define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
227#define USBDEVFS_FORBID_SUSPEND _IO('U', 33)
228#define USBDEVFS_ALLOW_SUSPEND _IO('U', 34)
229#define USBDEVFS_WAIT_FOR_RESUME _IO('U', 35)
200230
201#endif /* _LINUX_USBDEVICE_FS_H */231#endif /* _LINUX_USBDEVICE_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/userfaultfd.h+78-10
...@@ -19,14 +19,20 @@...@@ -19,14 +19,20 @@
19 * means the userland is reading).19 * means the userland is reading).
20 */20 */
21#define UFFD_API ((__u64)0xAA)21#define UFFD_API ((__u64)0xAA)
22#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \22#define UFFD_API_REGISTER_MODES (UFFDIO_REGISTER_MODE_MISSING | \
23 UFFDIO_REGISTER_MODE_WP | \
24 UFFDIO_REGISTER_MODE_MINOR)
25#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \
26 UFFD_FEATURE_EVENT_FORK | \
23 UFFD_FEATURE_EVENT_REMAP | \27 UFFD_FEATURE_EVENT_REMAP | \
24 UFFD_FEATURE_EVENT_REMOVE | \28 UFFD_FEATURE_EVENT_REMOVE | \
25 UFFD_FEATURE_EVENT_UNMAP | \29 UFFD_FEATURE_EVENT_UNMAP | \
26 UFFD_FEATURE_MISSING_HUGETLBFS | \30 UFFD_FEATURE_MISSING_HUGETLBFS | \
27 UFFD_FEATURE_MISSING_SHMEM | \31 UFFD_FEATURE_MISSING_SHMEM | \
28 UFFD_FEATURE_SIGBUS | \32 UFFD_FEATURE_SIGBUS | \
29 UFFD_FEATURE_THREAD_ID)33 UFFD_FEATURE_THREAD_ID | \
34 UFFD_FEATURE_MINOR_HUGETLBFS | \
35 UFFD_FEATURE_MINOR_SHMEM)
30#define UFFD_API_IOCTLS \36#define UFFD_API_IOCTLS \
31 ((__u64)1 << _UFFDIO_REGISTER | \37 ((__u64)1 << _UFFDIO_REGISTER | \
32 (__u64)1 << _UFFDIO_UNREGISTER | \38 (__u64)1 << _UFFDIO_UNREGISTER | \
...@@ -34,10 +40,13 @@...@@ -34,10 +40,13 @@
34#define UFFD_API_RANGE_IOCTLS \40#define UFFD_API_RANGE_IOCTLS \
35 ((__u64)1 << _UFFDIO_WAKE | \41 ((__u64)1 << _UFFDIO_WAKE | \
36 (__u64)1 << _UFFDIO_COPY | \42 (__u64)1 << _UFFDIO_COPY | \
37 (__u64)1 << _UFFDIO_ZEROPAGE)43 (__u64)1 << _UFFDIO_ZEROPAGE | \
44 (__u64)1 << _UFFDIO_WRITEPROTECT | \
45 (__u64)1 << _UFFDIO_CONTINUE)
38#define UFFD_API_RANGE_IOCTLS_BASIC \46#define UFFD_API_RANGE_IOCTLS_BASIC \
39 ((__u64)1 << _UFFDIO_WAKE | \47 ((__u64)1 << _UFFDIO_WAKE | \
40 (__u64)1 << _UFFDIO_COPY)48 (__u64)1 << _UFFDIO_COPY | \
49 (__u64)1 << _UFFDIO_CONTINUE)
4150
42/*51/*
43 * Valid ioctl command number range with this API is from 0x00 to52 * Valid ioctl command number range with this API is from 0x00 to
...@@ -52,6 +61,8 @@...@@ -52,6 +61,8 @@
52#define _UFFDIO_WAKE (0x02)61#define _UFFDIO_WAKE (0x02)
53#define _UFFDIO_COPY (0x03)62#define _UFFDIO_COPY (0x03)
54#define _UFFDIO_ZEROPAGE (0x04)63#define _UFFDIO_ZEROPAGE (0x04)
64#define _UFFDIO_WRITEPROTECT (0x06)
65#define _UFFDIO_CONTINUE (0x07)
55#define _UFFDIO_API (0x3F)66#define _UFFDIO_API (0x3F)
5667
57/* userfaultfd ioctl ids */68/* userfaultfd ioctl ids */
...@@ -68,6 +79,10 @@...@@ -68,6 +79,10 @@
68 struct uffdio_copy)79 struct uffdio_copy)
69#define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \80#define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \
70 struct uffdio_zeropage)81 struct uffdio_zeropage)
82#define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
83 struct uffdio_writeprotect)
84#define UFFDIO_CONTINUE _IOWR(UFFDIO, _UFFDIO_CONTINUE, \
85 struct uffdio_continue)
7186
72/* read() structure */87/* read() structure */
73struct uffd_msg {88struct uffd_msg {
...@@ -122,6 +137,7 @@ struct uffd_msg {...@@ -122,6 +137,7 @@ struct uffd_msg {
122/* flags for UFFD_EVENT_PAGEFAULT */137/* flags for UFFD_EVENT_PAGEFAULT */
123#define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */138#define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */
124#define UFFD_PAGEFAULT_FLAG_WP (1<<1) /* If reason is VM_UFFD_WP */139#define UFFD_PAGEFAULT_FLAG_WP (1<<1) /* If reason is VM_UFFD_WP */
140#define UFFD_PAGEFAULT_FLAG_MINOR (1<<2) /* If reason is VM_UFFD_MINOR */
125141
126struct uffdio_api {142struct uffdio_api {
127 /* userland asks for an API number and the features to enable */143 /* userland asks for an API number and the features to enable */
...@@ -166,6 +182,13 @@ struct uffdio_api {...@@ -166,6 +182,13 @@ struct uffdio_api {
166 *182 *
167 * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will183 * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will
168 * be returned, if feature is not requested 0 will be returned.184 * be returned, if feature is not requested 0 will be returned.
185 *
186 * UFFD_FEATURE_MINOR_HUGETLBFS indicates that minor faults
187 * can be intercepted (via REGISTER_MODE_MINOR) for
188 * hugetlbfs-backed pages.
189 *
190 * UFFD_FEATURE_MINOR_SHMEM indicates the same support as
191 * UFFD_FEATURE_MINOR_HUGETLBFS, but for shmem-backed pages instead.
169 */192 */
170#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)193#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
171#define UFFD_FEATURE_EVENT_FORK (1<<1)194#define UFFD_FEATURE_EVENT_FORK (1<<1)
...@@ -176,6 +199,8 @@ struct uffdio_api {...@@ -176,6 +199,8 @@ struct uffdio_api {
176#define UFFD_FEATURE_EVENT_UNMAP (1<<6)199#define UFFD_FEATURE_EVENT_UNMAP (1<<6)
177#define UFFD_FEATURE_SIGBUS (1<<7)200#define UFFD_FEATURE_SIGBUS (1<<7)
178#define UFFD_FEATURE_THREAD_ID (1<<8)201#define UFFD_FEATURE_THREAD_ID (1<<8)
202#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9)
203#define UFFD_FEATURE_MINOR_SHMEM (1<<10)
179 __u64 features;204 __u64 features;
180205
181 __u64 ioctls;206 __u64 ioctls;
...@@ -190,6 +215,7 @@ struct uffdio_register {...@@ -190,6 +215,7 @@ struct uffdio_register {
190 struct uffdio_range range;215 struct uffdio_range range;
191#define UFFDIO_REGISTER_MODE_MISSING ((__u64)1<<0)216#define UFFDIO_REGISTER_MODE_MISSING ((__u64)1<<0)
192#define UFFDIO_REGISTER_MODE_WP ((__u64)1<<1)217#define UFFDIO_REGISTER_MODE_WP ((__u64)1<<1)
218#define UFFDIO_REGISTER_MODE_MINOR ((__u64)1<<2)
193 __u64 mode;219 __u64 mode;
194220
195 /*221 /*
...@@ -203,13 +229,14 @@ struct uffdio_copy {...@@ -203,13 +229,14 @@ struct uffdio_copy {
203 __u64 dst;229 __u64 dst;
204 __u64 src;230 __u64 src;
205 __u64 len;231 __u64 len;
232#define UFFDIO_COPY_MODE_DONTWAKE ((__u64)1<<0)
206 /*233 /*
207 * There will be a wrprotection flag later that allows to map234 * UFFDIO_COPY_MODE_WP will map the page write protected on
208 * pages wrprotected on the fly. And such a flag will be235 * the fly. UFFDIO_COPY_MODE_WP is available only if the
209 * available if the wrprotection ioctl are implemented for the236 * write protected ioctl is implemented for the range
210 * range according to the uffdio_register.ioctls.237 * according to the uffdio_register.ioctls.
211 */238 */
212#define UFFDIO_COPY_MODE_DONTWAKE ((__u64)1<<0)239#define UFFDIO_COPY_MODE_WP ((__u64)1<<1)
213 __u64 mode;240 __u64 mode;
214241
215 /*242 /*
...@@ -231,4 +258,45 @@ struct uffdio_zeropage {...@@ -231,4 +258,45 @@ struct uffdio_zeropage {
231 __s64 zeropage;258 __s64 zeropage;
232};259};
233260
261struct uffdio_writeprotect {
262 struct uffdio_range range;
263/*
264 * UFFDIO_WRITEPROTECT_MODE_WP: set the flag to write protect a range,
265 * unset the flag to undo protection of a range which was previously
266 * write protected.
267 *
268 * UFFDIO_WRITEPROTECT_MODE_DONTWAKE: set the flag to avoid waking up
269 * any wait thread after the operation succeeds.
270 *
271 * NOTE: Write protecting a region (WP=1) is unrelated to page faults,
272 * therefore DONTWAKE flag is meaningless with WP=1. Removing write
273 * protection (WP=0) in response to a page fault wakes the faulting
274 * task unless DONTWAKE is set.
275 */
276#define UFFDIO_WRITEPROTECT_MODE_WP ((__u64)1<<0)
277#define UFFDIO_WRITEPROTECT_MODE_DONTWAKE ((__u64)1<<1)
278 __u64 mode;
279};
280
281struct uffdio_continue {
282 struct uffdio_range range;
283#define UFFDIO_CONTINUE_MODE_DONTWAKE ((__u64)1<<0)
284 __u64 mode;
285
286 /*
287 * Fields below here are written by the ioctl and must be at the end:
288 * the copy_from_user will not read past here.
289 */
290 __s64 mapped;
291};
292
293/*
294 * Flags for the userfaultfd(2) system call itself.
295 */
296
297/*
298 * Create a userfaultfd that can handle page faults only in user mode.
299 */
300#define UFFD_USER_MODE_ONLY 1
301
234#endif /* _LINUX_USERFAULTFD_H */302#endif /* _LINUX_USERFAULTFD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/utime.h+2-2
...@@ -5,8 +5,8 @@...@@ -5,8 +5,8 @@
5#include <linux/types.h>5#include <linux/types.h>
66
7struct utimbuf {7struct utimbuf {
8 __kernel_time_t actime;8 __kernel_old_time_t actime;
9 __kernel_time_t modtime;9 __kernel_old_time_t modtime;
10};10};
1111
12#endif12#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/uvcvideo.h+5-5
...@@ -76,11 +76,11 @@ struct uvc_xu_control_query {...@@ -76,11 +76,11 @@ struct uvc_xu_control_query {
7676
77/**77/**
78 * struct uvc_meta_buf - metadata buffer building block78 * struct uvc_meta_buf - metadata buffer building block
79 * @ns - system timestamp of the payload in nanoseconds79 * @ns: system timestamp of the payload in nanoseconds
80 * @sof - USB Frame Number80 * @sof: USB Frame Number
81 * @length - length of the payload header81 * @length: length of the payload header
82 * @flags - payload header flags82 * @flags: payload header flags
83 * @buf - optional device-specific header data83 * @buf: optional device-specific header data
84 *84 *
85 * UVC metadata nodes fill buffers with possibly multiple instances of this85 * UVC metadata nodes fill buffers with possibly multiple instances of this
86 * struct. The first two fields are added by the driver, they can be used for86 * struct. The first two fields are added by the driver, they can be used for
lib/libc/include/any-linux-any/linux/v4l2-common.h+13-13
...@@ -79,24 +79,11 @@...@@ -79,24 +79,11 @@
79/* Current composing area plus all padding pixels */79/* Current composing area plus all padding pixels */
80#define V4L2_SEL_TGT_COMPOSE_PADDED 0x010380#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
8181
82/* Backward compatibility target definitions --- to be removed. */
83#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
84#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
85#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
86#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
87#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
88#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
89
90/* Selection flags */82/* Selection flags */
91#define V4L2_SEL_FLAG_GE (1 << 0)83#define V4L2_SEL_FLAG_GE (1 << 0)
92#define V4L2_SEL_FLAG_LE (1 << 1)84#define V4L2_SEL_FLAG_LE (1 << 1)
93#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)85#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
9486
95/* Backward compatibility flag definitions --- to be removed. */
96#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
97#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
98#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
99
100struct v4l2_edid {87struct v4l2_edid {
101 __u32 pad;88 __u32 pad;
102 __u32 start_block;89 __u32 start_block;
...@@ -105,4 +92,17 @@ struct v4l2_edid {...@@ -105,4 +92,17 @@ struct v4l2_edid {
105 __u8 *edid;92 __u8 *edid;
106};93};
10794
95/* Backward compatibility target definitions --- to be removed. */
96#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
97#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
98#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
99#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
100#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
101#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
102
103/* Backward compatibility flag definitions --- to be removed. */
104#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
105#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
106#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
107
108#endif /* __V4L2_COMMON__ */108#endif /* __V4L2_COMMON__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/v4l2-controls.h+1118-189
...@@ -50,9 +50,12 @@...@@ -50,9 +50,12 @@
50#ifndef __LINUX_V4L2_CONTROLS_H50#ifndef __LINUX_V4L2_CONTROLS_H
51#define __LINUX_V4L2_CONTROLS_H51#define __LINUX_V4L2_CONTROLS_H
5252
53#include <linux/const.h>
54#include <linux/types.h>
55
53/* Control classes */56/* Control classes */
54#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */57#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
55#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */58#define V4L2_CTRL_CLASS_CODEC 0x00990000 /* Stateful codec controls */
56#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */59#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
57#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator controls */60#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator controls */
58#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */61#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
...@@ -63,6 +66,8 @@...@@ -63,6 +66,8 @@
63#define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */66#define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */
64#define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */67#define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */
65#define V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */68#define V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */
69#define V4L2_CTRL_CLASS_CODEC_STATELESS 0x00a40000 /* Stateless codecs controls */
70#define V4L2_CTRL_CLASS_COLORIMETRY 0x00a50000 /* Colorimetry controls */
6671
67/* User-class control IDs */72/* User-class control IDs */
6873
...@@ -190,15 +195,37 @@ enum v4l2_colorfx {...@@ -190,15 +195,37 @@ enum v4l2_colorfx {
190 * We reserve 16 controls for this driver. */195 * We reserve 16 controls for this driver. */
191#define V4L2_CID_USER_IMX_BASE (V4L2_CID_USER_BASE + 0x10b0)196#define V4L2_CID_USER_IMX_BASE (V4L2_CID_USER_BASE + 0x10b0)
192197
198/*
199 * The base for the atmel isc driver controls.
200 * We reserve 32 controls for this driver.
201 */
202#define V4L2_CID_USER_ATMEL_ISC_BASE (V4L2_CID_USER_BASE + 0x10c0)
203
204/*
205 * The base for the CODA driver controls.
206 * We reserve 16 controls for this driver.
207 */
208#define V4L2_CID_USER_CODA_BASE (V4L2_CID_USER_BASE + 0x10e0)
209/*
210 * The base for MIPI CCS driver controls.
211 * We reserve 128 controls for this driver.
212 */
213#define V4L2_CID_USER_CCS_BASE (V4L2_CID_USER_BASE + 0x10f0)
214/*
215 * The base for Allegro driver controls.
216 * We reserve 16 controls for this driver.
217 */
218#define V4L2_CID_USER_ALLEGRO_BASE (V4L2_CID_USER_BASE + 0x1170)
219
193/* MPEG-class control IDs */220/* MPEG-class control IDs */
194/* The MPEG controls are applicable to all codec controls221/* The MPEG controls are applicable to all codec controls
195 * and the 'MPEG' part of the define is historical */222 * and the 'MPEG' part of the define is historical */
196223
197#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)224#define V4L2_CID_CODEC_BASE (V4L2_CTRL_CLASS_CODEC | 0x900)
198#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)225#define V4L2_CID_CODEC_CLASS (V4L2_CTRL_CLASS_CODEC | 1)
199226
200/* MPEG streams, specific to multiplexed streams */227/* MPEG streams, specific to multiplexed streams */
201#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)228#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_CODEC_BASE+0)
202enum v4l2_mpeg_stream_type {229enum v4l2_mpeg_stream_type {
203 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */230 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
204 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */231 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
...@@ -207,26 +234,26 @@ enum v4l2_mpeg_stream_type {...@@ -207,26 +234,26 @@ enum v4l2_mpeg_stream_type {
207 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */234 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
208 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */235 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
209};236};
210#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)237#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_CODEC_BASE+1)
211#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)238#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_CODEC_BASE+2)
212#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)239#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_CODEC_BASE+3)
213#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)240#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_CODEC_BASE+4)
214#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)241#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_CODEC_BASE+5)
215#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)242#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_CODEC_BASE+6)
216#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)243#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_CODEC_BASE+7)
217enum v4l2_mpeg_stream_vbi_fmt {244enum v4l2_mpeg_stream_vbi_fmt {
218 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */245 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
219 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */246 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
220};247};
221248
222/* MPEG audio controls specific to multiplexed streams */249/* MPEG audio controls specific to multiplexed streams */
223#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)250#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_CODEC_BASE+100)
224enum v4l2_mpeg_audio_sampling_freq {251enum v4l2_mpeg_audio_sampling_freq {
225 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,252 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
226 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,253 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
227 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,254 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
228};255};
229#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)256#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_CODEC_BASE+101)
230enum v4l2_mpeg_audio_encoding {257enum v4l2_mpeg_audio_encoding {
231 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,258 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
232 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,259 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
...@@ -234,7 +261,7 @@ enum v4l2_mpeg_audio_encoding {...@@ -234,7 +261,7 @@ enum v4l2_mpeg_audio_encoding {
234 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,261 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
235 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,262 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
236};263};
237#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)264#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_CODEC_BASE+102)
238enum v4l2_mpeg_audio_l1_bitrate {265enum v4l2_mpeg_audio_l1_bitrate {
239 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,266 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
240 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,267 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
...@@ -251,7 +278,7 @@ enum v4l2_mpeg_audio_l1_bitrate {...@@ -251,7 +278,7 @@ enum v4l2_mpeg_audio_l1_bitrate {
251 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,278 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
252 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,279 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
253};280};
254#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)281#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_CODEC_BASE+103)
255enum v4l2_mpeg_audio_l2_bitrate {282enum v4l2_mpeg_audio_l2_bitrate {
256 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,283 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
257 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,284 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
...@@ -268,7 +295,7 @@ enum v4l2_mpeg_audio_l2_bitrate {...@@ -268,7 +295,7 @@ enum v4l2_mpeg_audio_l2_bitrate {
268 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,295 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
269 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,296 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
270};297};
271#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)298#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_CODEC_BASE+104)
272enum v4l2_mpeg_audio_l3_bitrate {299enum v4l2_mpeg_audio_l3_bitrate {
273 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,300 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
274 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,301 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
...@@ -285,34 +312,34 @@ enum v4l2_mpeg_audio_l3_bitrate {...@@ -285,34 +312,34 @@ enum v4l2_mpeg_audio_l3_bitrate {
285 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,312 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
286 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,313 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
287};314};
288#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)315#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_CODEC_BASE+105)
289enum v4l2_mpeg_audio_mode {316enum v4l2_mpeg_audio_mode {
290 V4L2_MPEG_AUDIO_MODE_STEREO = 0,317 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
291 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,318 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
292 V4L2_MPEG_AUDIO_MODE_DUAL = 2,319 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
293 V4L2_MPEG_AUDIO_MODE_MONO = 3,320 V4L2_MPEG_AUDIO_MODE_MONO = 3,
294};321};
295#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)322#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_CODEC_BASE+106)
296enum v4l2_mpeg_audio_mode_extension {323enum v4l2_mpeg_audio_mode_extension {
297 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,324 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
298 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,325 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
299 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,326 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
300 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,327 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
301};328};
302#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)329#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_CODEC_BASE+107)
303enum v4l2_mpeg_audio_emphasis {330enum v4l2_mpeg_audio_emphasis {
304 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,331 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
305 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,332 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
306 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,333 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
307};334};
308#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)335#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_CODEC_BASE+108)
309enum v4l2_mpeg_audio_crc {336enum v4l2_mpeg_audio_crc {
310 V4L2_MPEG_AUDIO_CRC_NONE = 0,337 V4L2_MPEG_AUDIO_CRC_NONE = 0,
311 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,338 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
312};339};
313#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)340#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_CODEC_BASE+109)
314#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)341#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_CODEC_BASE+110)
315#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)342#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_CODEC_BASE+111)
316enum v4l2_mpeg_audio_ac3_bitrate {343enum v4l2_mpeg_audio_ac3_bitrate {
317 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,344 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
318 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,345 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
...@@ -334,7 +361,7 @@ enum v4l2_mpeg_audio_ac3_bitrate {...@@ -334,7 +361,7 @@ enum v4l2_mpeg_audio_ac3_bitrate {
334 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,361 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
335 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,362 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
336};363};
337#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)364#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_CODEC_BASE+112)
338enum v4l2_mpeg_audio_dec_playback {365enum v4l2_mpeg_audio_dec_playback {
339 V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,366 V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
340 V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,367 V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
...@@ -343,84 +370,117 @@ enum v4l2_mpeg_audio_dec_playback {...@@ -343,84 +370,117 @@ enum v4l2_mpeg_audio_dec_playback {
343 V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,370 V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
344 V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,371 V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
345};372};
346#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)373#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_CODEC_BASE+113)
347374
348/* MPEG video controls specific to multiplexed streams */375/* MPEG video controls specific to multiplexed streams */
349#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)376#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_CODEC_BASE+200)
350enum v4l2_mpeg_video_encoding {377enum v4l2_mpeg_video_encoding {
351 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,378 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
352 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,379 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
353 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,380 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
354};381};
355#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)382#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_CODEC_BASE+201)
356enum v4l2_mpeg_video_aspect {383enum v4l2_mpeg_video_aspect {
357 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,384 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
358 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,385 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
359 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,386 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
360 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,387 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
361};388};
362#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)389#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_CODEC_BASE+202)
363#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)390#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_CODEC_BASE+203)
364#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)391#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_CODEC_BASE+204)
365#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)392#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_CODEC_BASE+205)
366#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)393#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_CODEC_BASE+206)
367enum v4l2_mpeg_video_bitrate_mode {394enum v4l2_mpeg_video_bitrate_mode {
368 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,395 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
369 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,396 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
370};397 V4L2_MPEG_VIDEO_BITRATE_MODE_CQ = 2,
371#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)398};
372#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)399#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_CODEC_BASE+207)
373#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)400#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_CODEC_BASE+208)
374#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)401#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_CODEC_BASE+209)
375#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)402#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_CODEC_BASE+210)
376#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)403#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_CODEC_BASE+211)
377#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)404#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_CODEC_BASE+212)
378#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)405#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_CODEC_BASE+213)
379#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)406#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_CODEC_BASE+214)
380#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)407#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_CODEC_BASE+215)
408#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_CODEC_BASE+216)
381enum v4l2_mpeg_video_header_mode {409enum v4l2_mpeg_video_header_mode {
382 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,410 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
383 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,411 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
384412
385};413};
386#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)414#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_CODEC_BASE+217)
387#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)415#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_CODEC_BASE+218)
388#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)416#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_CODEC_BASE+219)
389#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)417#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_CODEC_BASE+220)
390#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)418#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_CODEC_BASE+221)
391enum v4l2_mpeg_video_multi_slice_mode {419enum v4l2_mpeg_video_multi_slice_mode {
392 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,420 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
421 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB = 1,
422 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES = 2,
423 /* Kept for backwards compatibility reasons. Stupid typo... */
393 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,424 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
394 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,425 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
395};426};
396#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)427#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_CODEC_BASE+222)
397#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)428#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_CODEC_BASE+223)
398#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)429#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_CODEC_BASE+224)
399#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)430#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_CODEC_BASE+225)
400#define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226)431#define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_CODEC_BASE+226)
401#define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_MPEG_BASE+227)432#define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_CODEC_BASE+227)
402#define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_MPEG_BASE+228)433#define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_CODEC_BASE+228)
403#define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_MPEG_BASE+229)434#define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_CODEC_BASE+229)
404435#define V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID (V4L2_CID_CODEC_BASE+230)
405#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)436#define V4L2_CID_MPEG_VIDEO_AU_DELIMITER (V4L2_CID_CODEC_BASE+231)
406#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)437#define V4L2_CID_MPEG_VIDEO_LTR_COUNT (V4L2_CID_CODEC_BASE+232)
407#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)438#define V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX (V4L2_CID_CODEC_BASE+233)
408#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)439#define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234)
409#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)440#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235)
410#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)441#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+236)
411#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)442
412#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)443/* CIDs for the MPEG-2 Part 2 (H.262) codec */
413#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)444#define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)
414#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)445enum v4l2_mpeg_video_mpeg2_level {
415#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)446 V4L2_MPEG_VIDEO_MPEG2_LEVEL_LOW = 0,
416#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)447 V4L2_MPEG_VIDEO_MPEG2_LEVEL_MAIN = 1,
417#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)448 V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH_1440 = 2,
449 V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH = 3,
450};
451#define V4L2_CID_MPEG_VIDEO_MPEG2_PROFILE (V4L2_CID_CODEC_BASE+271)
452enum v4l2_mpeg_video_mpeg2_profile {
453 V4L2_MPEG_VIDEO_MPEG2_PROFILE_SIMPLE = 0,
454 V4L2_MPEG_VIDEO_MPEG2_PROFILE_MAIN = 1,
455 V4L2_MPEG_VIDEO_MPEG2_PROFILE_SNR_SCALABLE = 2,
456 V4L2_MPEG_VIDEO_MPEG2_PROFILE_SPATIALLY_SCALABLE = 3,
457 V4L2_MPEG_VIDEO_MPEG2_PROFILE_HIGH = 4,
458 V4L2_MPEG_VIDEO_MPEG2_PROFILE_MULTIVIEW = 5,
459};
460
461/* CIDs for the FWHT codec as used by the vicodec driver. */
462#define V4L2_CID_FWHT_I_FRAME_QP (V4L2_CID_CODEC_BASE + 290)
463#define V4L2_CID_FWHT_P_FRAME_QP (V4L2_CID_CODEC_BASE + 291)
464
465#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_CODEC_BASE+300)
466#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_CODEC_BASE+301)
467#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_CODEC_BASE+302)
468#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_CODEC_BASE+303)
469#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_CODEC_BASE+304)
470#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_CODEC_BASE+350)
471#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_CODEC_BASE+351)
472#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_CODEC_BASE+352)
473#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_CODEC_BASE+353)
474#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_CODEC_BASE+354)
475#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_CODEC_BASE+355)
476#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_CODEC_BASE+356)
477#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_CODEC_BASE+357)
418enum v4l2_mpeg_video_h264_entropy_mode {478enum v4l2_mpeg_video_h264_entropy_mode {
419 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,479 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
420 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,480 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
421};481};
422#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)482#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_CODEC_BASE+358)
423#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)483#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_CODEC_BASE+359)
424enum v4l2_mpeg_video_h264_level {484enum v4l2_mpeg_video_h264_level {
425 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,485 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
426 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,486 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
...@@ -438,16 +498,20 @@ enum v4l2_mpeg_video_h264_level {...@@ -438,16 +498,20 @@ enum v4l2_mpeg_video_h264_level {
438 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,498 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
439 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,499 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
440 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,500 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
441};501 V4L2_MPEG_VIDEO_H264_LEVEL_5_2 = 16,
442#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)502 V4L2_MPEG_VIDEO_H264_LEVEL_6_0 = 17,
443#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)503 V4L2_MPEG_VIDEO_H264_LEVEL_6_1 = 18,
444#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)504 V4L2_MPEG_VIDEO_H264_LEVEL_6_2 = 19,
505};
506#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_CODEC_BASE+360)
507#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_CODEC_BASE+361)
508#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_CODEC_BASE+362)
445enum v4l2_mpeg_video_h264_loop_filter_mode {509enum v4l2_mpeg_video_h264_loop_filter_mode {
446 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,510 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
447 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,511 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
448 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,512 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
449};513};
450#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)514#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_CODEC_BASE+363)
451enum v4l2_mpeg_video_h264_profile {515enum v4l2_mpeg_video_h264_profile {
452 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,516 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
453 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,517 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
...@@ -466,11 +530,12 @@ enum v4l2_mpeg_video_h264_profile {...@@ -466,11 +530,12 @@ enum v4l2_mpeg_video_h264_profile {
466 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,530 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
467 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,531 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
468 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,532 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
533 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH = 17,
469};534};
470#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)535#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_CODEC_BASE+364)
471#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)536#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_CODEC_BASE+365)
472#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)537#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_CODEC_BASE+366)
473#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)538#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_CODEC_BASE+367)
474enum v4l2_mpeg_video_h264_vui_sar_idc {539enum v4l2_mpeg_video_h264_vui_sar_idc {
475 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,540 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
476 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,541 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
...@@ -491,9 +556,9 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {...@@ -491,9 +556,9 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {
491 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,556 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
492 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,557 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
493};558};
494#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)559#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_CODEC_BASE+368)
495#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)560#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_CODEC_BASE+369)
496#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)561#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_CODEC_BASE+370)
497enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {562enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
498 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD = 0,563 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD = 0,
499 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,564 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
...@@ -502,8 +567,8 @@ enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {...@@ -502,8 +567,8 @@ enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
502 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,567 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
503 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,568 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
504};569};
505#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)570#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_CODEC_BASE+371)
506#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)571#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_CODEC_BASE+372)
507enum v4l2_mpeg_video_h264_fmo_map_type {572enum v4l2_mpeg_video_h264_fmo_map_type {
508 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,573 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
509 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,574 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
...@@ -513,30 +578,45 @@ enum v4l2_mpeg_video_h264_fmo_map_type {...@@ -513,30 +578,45 @@ enum v4l2_mpeg_video_h264_fmo_map_type {
513 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,578 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
514 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,579 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
515};580};
516#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)581#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_CODEC_BASE+373)
517#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)582#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_CODEC_BASE+374)
518enum v4l2_mpeg_video_h264_fmo_change_dir {583enum v4l2_mpeg_video_h264_fmo_change_dir {
519 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,584 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
520 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,585 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
521};586};
522#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)587#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_CODEC_BASE+375)
523#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)588#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_CODEC_BASE+376)
524#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)589#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_CODEC_BASE+377)
525#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)590#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_CODEC_BASE+378)
526#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)591#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_CODEC_BASE+379)
527#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)592#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_CODEC_BASE+380)
528enum v4l2_mpeg_video_h264_hierarchical_coding_type {593enum v4l2_mpeg_video_h264_hierarchical_coding_type {
529 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,594 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
530 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,595 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
531};596};
532#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)597#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_CODEC_BASE+381)
533#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)598#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_CODEC_BASE+382)
534#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)599#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_CODEC_BASE+383)
535#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)600#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_CODEC_BASE+384)
536#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)601#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP (V4L2_CID_CODEC_BASE+385)
537#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)602#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP (V4L2_CID_CODEC_BASE+386)
538#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)603#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP (V4L2_CID_CODEC_BASE+387)
539#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)604#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP (V4L2_CID_CODEC_BASE+388)
605#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MIN_QP (V4L2_CID_CODEC_BASE+389)
606#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE+390)
607#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L0_BR (V4L2_CID_CODEC_BASE+391)
608#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L1_BR (V4L2_CID_CODEC_BASE+392)
609#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L2_BR (V4L2_CID_CODEC_BASE+393)
610#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L3_BR (V4L2_CID_CODEC_BASE+394)
611#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L4_BR (V4L2_CID_CODEC_BASE+395)
612#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L5_BR (V4L2_CID_CODEC_BASE+396)
613#define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR (V4L2_CID_CODEC_BASE+397)
614#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_CODEC_BASE+400)
615#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_CODEC_BASE+401)
616#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_CODEC_BASE+402)
617#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_CODEC_BASE+403)
618#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_CODEC_BASE+404)
619#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_CODEC_BASE+405)
540enum v4l2_mpeg_video_mpeg4_level {620enum v4l2_mpeg_video_mpeg4_level {
541 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,621 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
542 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,622 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
...@@ -547,7 +627,7 @@ enum v4l2_mpeg_video_mpeg4_level {...@@ -547,7 +627,7 @@ enum v4l2_mpeg_video_mpeg4_level {
547 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,627 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
548 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,628 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
549};629};
550#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)630#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_CODEC_BASE+406)
551enum v4l2_mpeg_video_mpeg4_profile {631enum v4l2_mpeg_video_mpeg4_profile {
552 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,632 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
553 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,633 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
...@@ -555,40 +635,40 @@ enum v4l2_mpeg_video_mpeg4_profile {...@@ -555,40 +635,40 @@ enum v4l2_mpeg_video_mpeg4_profile {
555 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,635 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
556 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,636 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
557};637};
558#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)638#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_CODEC_BASE+407)
559639
560/* Control IDs for VP8 streams640/* Control IDs for VP8 streams
561 * Although VP8 is not part of MPEG we add these controls to the MPEG class641 * Although VP8 is not part of MPEG we add these controls to the MPEG class
562 * as that class is already handling other video compression standards642 * as that class is already handling other video compression standards
563 */643 */
564#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)644#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_CODEC_BASE+500)
565enum v4l2_vp8_num_partitions {645enum v4l2_vp8_num_partitions {
566 V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,646 V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,
567 V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,647 V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,
568 V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,648 V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,
569 V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,649 V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,
570};650};
571#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)651#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_CODEC_BASE+501)
572#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)652#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_CODEC_BASE+502)
573enum v4l2_vp8_num_ref_frames {653enum v4l2_vp8_num_ref_frames {
574 V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,654 V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,
575 V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,655 V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,
576 V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,656 V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,
577};657};
578#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)658#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_CODEC_BASE+503)
579#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)659#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_CODEC_BASE+504)
580#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)660#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_CODEC_BASE+505)
581#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)661#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_CODEC_BASE+506)
582enum v4l2_vp8_golden_frame_sel {662enum v4l2_vp8_golden_frame_sel {
583 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,663 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
584 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,664 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
585};665};
586#define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_MPEG_BASE+507)666#define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_CODEC_BASE+507)
587#define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508)667#define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_CODEC_BASE+508)
588#define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509)668#define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_CODEC_BASE+509)
589#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)669#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_CODEC_BASE+510)
590670
591#define V4L2_CID_MPEG_VIDEO_VP8_PROFILE (V4L2_CID_MPEG_BASE+511)671#define V4L2_CID_MPEG_VIDEO_VP8_PROFILE (V4L2_CID_CODEC_BASE+511)
592enum v4l2_mpeg_video_vp8_profile {672enum v4l2_mpeg_video_vp8_profile {
593 V4L2_MPEG_VIDEO_VP8_PROFILE_0 = 0,673 V4L2_MPEG_VIDEO_VP8_PROFILE_0 = 0,
594 V4L2_MPEG_VIDEO_VP8_PROFILE_1 = 1,674 V4L2_MPEG_VIDEO_VP8_PROFILE_1 = 1,
...@@ -597,42 +677,59 @@ enum v4l2_mpeg_video_vp8_profile {...@@ -597,42 +677,59 @@ enum v4l2_mpeg_video_vp8_profile {
597};677};
598/* Deprecated alias for compatibility reasons. */678/* Deprecated alias for compatibility reasons. */
599#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE V4L2_CID_MPEG_VIDEO_VP8_PROFILE679#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE V4L2_CID_MPEG_VIDEO_VP8_PROFILE
600#define V4L2_CID_MPEG_VIDEO_VP9_PROFILE (V4L2_CID_MPEG_BASE+512)680#define V4L2_CID_MPEG_VIDEO_VP9_PROFILE (V4L2_CID_CODEC_BASE+512)
601enum v4l2_mpeg_video_vp9_profile {681enum v4l2_mpeg_video_vp9_profile {
602 V4L2_MPEG_VIDEO_VP9_PROFILE_0 = 0,682 V4L2_MPEG_VIDEO_VP9_PROFILE_0 = 0,
603 V4L2_MPEG_VIDEO_VP9_PROFILE_1 = 1,683 V4L2_MPEG_VIDEO_VP9_PROFILE_1 = 1,
604 V4L2_MPEG_VIDEO_VP9_PROFILE_2 = 2,684 V4L2_MPEG_VIDEO_VP9_PROFILE_2 = 2,
605 V4L2_MPEG_VIDEO_VP9_PROFILE_3 = 3,685 V4L2_MPEG_VIDEO_VP9_PROFILE_3 = 3,
606};686};
687#define V4L2_CID_MPEG_VIDEO_VP9_LEVEL (V4L2_CID_CODEC_BASE+513)
688enum v4l2_mpeg_video_vp9_level {
689 V4L2_MPEG_VIDEO_VP9_LEVEL_1_0 = 0,
690 V4L2_MPEG_VIDEO_VP9_LEVEL_1_1 = 1,
691 V4L2_MPEG_VIDEO_VP9_LEVEL_2_0 = 2,
692 V4L2_MPEG_VIDEO_VP9_LEVEL_2_1 = 3,
693 V4L2_MPEG_VIDEO_VP9_LEVEL_3_0 = 4,
694 V4L2_MPEG_VIDEO_VP9_LEVEL_3_1 = 5,
695 V4L2_MPEG_VIDEO_VP9_LEVEL_4_0 = 6,
696 V4L2_MPEG_VIDEO_VP9_LEVEL_4_1 = 7,
697 V4L2_MPEG_VIDEO_VP9_LEVEL_5_0 = 8,
698 V4L2_MPEG_VIDEO_VP9_LEVEL_5_1 = 9,
699 V4L2_MPEG_VIDEO_VP9_LEVEL_5_2 = 10,
700 V4L2_MPEG_VIDEO_VP9_LEVEL_6_0 = 11,
701 V4L2_MPEG_VIDEO_VP9_LEVEL_6_1 = 12,
702 V4L2_MPEG_VIDEO_VP9_LEVEL_6_2 = 13,
703};
607704
608/* CIDs for HEVC encoding. */705/* CIDs for HEVC encoding. */
609706
610#define V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (V4L2_CID_MPEG_BASE + 600)707#define V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (V4L2_CID_CODEC_BASE + 600)
611#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (V4L2_CID_MPEG_BASE + 601)708#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (V4L2_CID_CODEC_BASE + 601)
612#define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (V4L2_CID_MPEG_BASE + 602)709#define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (V4L2_CID_CODEC_BASE + 602)
613#define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (V4L2_CID_MPEG_BASE + 603)710#define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (V4L2_CID_CODEC_BASE + 603)
614#define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (V4L2_CID_MPEG_BASE + 604)711#define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (V4L2_CID_CODEC_BASE + 604)
615#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (V4L2_CID_MPEG_BASE + 605)712#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (V4L2_CID_CODEC_BASE + 605)
616#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE (V4L2_CID_MPEG_BASE + 606)713#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE (V4L2_CID_CODEC_BASE + 606)
617enum v4l2_mpeg_video_hevc_hier_coding_type {714enum v4l2_mpeg_video_hevc_hier_coding_type {
618 V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B = 0,715 V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B = 0,
619 V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P = 1,716 V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P = 1,
620};717};
621#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (V4L2_CID_MPEG_BASE + 607)718#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (V4L2_CID_CODEC_BASE + 607)
622#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (V4L2_CID_MPEG_BASE + 608)719#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (V4L2_CID_CODEC_BASE + 608)
623#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (V4L2_CID_MPEG_BASE + 609)720#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (V4L2_CID_CODEC_BASE + 609)
624#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (V4L2_CID_MPEG_BASE + 610)721#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (V4L2_CID_CODEC_BASE + 610)
625#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (V4L2_CID_MPEG_BASE + 611)722#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (V4L2_CID_CODEC_BASE + 611)
626#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (V4L2_CID_MPEG_BASE + 612)723#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (V4L2_CID_CODEC_BASE + 612)
627#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (V4L2_CID_MPEG_BASE + 613)724#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (V4L2_CID_CODEC_BASE + 613)
628#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (V4L2_CID_MPEG_BASE + 614)725#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (V4L2_CID_CODEC_BASE + 614)
629#define V4L2_CID_MPEG_VIDEO_HEVC_PROFILE (V4L2_CID_MPEG_BASE + 615)726#define V4L2_CID_MPEG_VIDEO_HEVC_PROFILE (V4L2_CID_CODEC_BASE + 615)
630enum v4l2_mpeg_video_hevc_profile {727enum v4l2_mpeg_video_hevc_profile {
631 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN = 0,728 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN = 0,
632 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE = 1,729 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE = 1,
633 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 = 2,730 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 = 2,
634};731};
635#define V4L2_CID_MPEG_VIDEO_HEVC_LEVEL (V4L2_CID_MPEG_BASE + 616)732#define V4L2_CID_MPEG_VIDEO_HEVC_LEVEL (V4L2_CID_CODEC_BASE + 616)
636enum v4l2_mpeg_video_hevc_level {733enum v4l2_mpeg_video_hevc_level {
637 V4L2_MPEG_VIDEO_HEVC_LEVEL_1 = 0,734 V4L2_MPEG_VIDEO_HEVC_LEVEL_1 = 0,
638 V4L2_MPEG_VIDEO_HEVC_LEVEL_2 = 1,735 V4L2_MPEG_VIDEO_HEVC_LEVEL_2 = 1,
...@@ -648,64 +745,81 @@ enum v4l2_mpeg_video_hevc_level {...@@ -648,64 +745,81 @@ enum v4l2_mpeg_video_hevc_level {
648 V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1 = 11,745 V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1 = 11,
649 V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2 = 12,746 V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2 = 12,
650};747};
651#define V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (V4L2_CID_MPEG_BASE + 617)748#define V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (V4L2_CID_CODEC_BASE + 617)
652#define V4L2_CID_MPEG_VIDEO_HEVC_TIER (V4L2_CID_MPEG_BASE + 618)749#define V4L2_CID_MPEG_VIDEO_HEVC_TIER (V4L2_CID_CODEC_BASE + 618)
653enum v4l2_mpeg_video_hevc_tier {750enum v4l2_mpeg_video_hevc_tier {
654 V4L2_MPEG_VIDEO_HEVC_TIER_MAIN = 0,751 V4L2_MPEG_VIDEO_HEVC_TIER_MAIN = 0,
655 V4L2_MPEG_VIDEO_HEVC_TIER_HIGH = 1,752 V4L2_MPEG_VIDEO_HEVC_TIER_HIGH = 1,
656};753};
657#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (V4L2_CID_MPEG_BASE + 619)754#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (V4L2_CID_CODEC_BASE + 619)
658#define V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE + 620)755#define V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE (V4L2_CID_CODEC_BASE + 620)
659enum v4l2_cid_mpeg_video_hevc_loop_filter_mode {756enum v4l2_cid_mpeg_video_hevc_loop_filter_mode {
660 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED = 0,757 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED = 0,
661 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED = 1,758 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED = 1,
662 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,759 V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
663};760};
664#define V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (V4L2_CID_MPEG_BASE + 621)761#define V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (V4L2_CID_CODEC_BASE + 621)
665#define V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (V4L2_CID_MPEG_BASE + 622)762#define V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (V4L2_CID_CODEC_BASE + 622)
666#define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE (V4L2_CID_MPEG_BASE + 623)763#define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE (V4L2_CID_CODEC_BASE + 623)
667enum v4l2_cid_mpeg_video_hevc_refresh_type {764enum v4l2_cid_mpeg_video_hevc_refresh_type {
668 V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE = 0,765 V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE = 0,
669 V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA = 1,766 V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA = 1,
670 V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR = 2,767 V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR = 2,
671};768};
672#define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (V4L2_CID_MPEG_BASE + 624)769#define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (V4L2_CID_CODEC_BASE + 624)
673#define V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (V4L2_CID_MPEG_BASE + 625)770#define V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (V4L2_CID_CODEC_BASE + 625)
674#define V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (V4L2_CID_MPEG_BASE + 626)771#define V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (V4L2_CID_CODEC_BASE + 626)
675#define V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (V4L2_CID_MPEG_BASE + 627)772#define V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (V4L2_CID_CODEC_BASE + 627)
676#define V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (V4L2_CID_MPEG_BASE + 628)773#define V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (V4L2_CID_CODEC_BASE + 628)
677#define V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (V4L2_CID_MPEG_BASE + 629)774#define V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (V4L2_CID_CODEC_BASE + 629)
678#define V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (V4L2_CID_MPEG_BASE + 630)775#define V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (V4L2_CID_CODEC_BASE + 630)
679#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (V4L2_CID_MPEG_BASE + 631)776#define V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (V4L2_CID_CODEC_BASE + 631)
680#define V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT (V4L2_CID_MPEG_BASE + 632)777#define V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT (V4L2_CID_CODEC_BASE + 632)
681#define V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (V4L2_CID_MPEG_BASE + 633)778#define V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (V4L2_CID_CODEC_BASE + 633)
682#define V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (V4L2_CID_MPEG_BASE + 634)779#define V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (V4L2_CID_CODEC_BASE + 634)
683#define V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD (V4L2_CID_MPEG_BASE + 635)780#define V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD (V4L2_CID_CODEC_BASE + 635)
684enum v4l2_cid_mpeg_video_hevc_size_of_length_field {781enum v4l2_cid_mpeg_video_hevc_size_of_length_field {
685 V4L2_MPEG_VIDEO_HEVC_SIZE_0 = 0,782 V4L2_MPEG_VIDEO_HEVC_SIZE_0 = 0,
686 V4L2_MPEG_VIDEO_HEVC_SIZE_1 = 1,783 V4L2_MPEG_VIDEO_HEVC_SIZE_1 = 1,
687 V4L2_MPEG_VIDEO_HEVC_SIZE_2 = 2,784 V4L2_MPEG_VIDEO_HEVC_SIZE_2 = 2,
688 V4L2_MPEG_VIDEO_HEVC_SIZE_4 = 3,785 V4L2_MPEG_VIDEO_HEVC_SIZE_4 = 3,
689};786};
690#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (V4L2_CID_MPEG_BASE + 636)787#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (V4L2_CID_CODEC_BASE + 636)
691#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (V4L2_CID_MPEG_BASE + 637)788#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (V4L2_CID_CODEC_BASE + 637)
692#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (V4L2_CID_MPEG_BASE + 638)789#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (V4L2_CID_CODEC_BASE + 638)
693#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (V4L2_CID_MPEG_BASE + 639)790#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (V4L2_CID_CODEC_BASE + 639)
694#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (V4L2_CID_MPEG_BASE + 640)791#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (V4L2_CID_CODEC_BASE + 640)
695#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (V4L2_CID_MPEG_BASE + 641)792#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (V4L2_CID_CODEC_BASE + 641)
696#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (V4L2_CID_MPEG_BASE + 642)793#define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (V4L2_CID_CODEC_BASE + 642)
697#define V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (V4L2_CID_MPEG_BASE + 643)794#define V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (V4L2_CID_CODEC_BASE + 643)
698#define V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (V4L2_CID_MPEG_BASE + 644)795#define V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (V4L2_CID_CODEC_BASE + 644)
796#define V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY (V4L2_CID_CODEC_BASE + 645)
797#define V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE (V4L2_CID_CODEC_BASE + 646)
798enum v4l2_mpeg_video_frame_skip_mode {
799 V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
800 V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
801 V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
802};
803
804#define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 647)
805#define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 648)
806#define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 649)
807#define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 650)
808#define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 651)
809#define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 652)
810
811#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653)
812#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654)
699813
700/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */814/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
701#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)815#define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)
702#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)816#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)
703enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {817enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
704 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,818 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
705 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,819 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
706};820};
707#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)821#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_CODEC_CX2341X_BASE+1)
708#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)822#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_CODEC_CX2341X_BASE+2)
709enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {823enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
710 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,824 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
711 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,825 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
...@@ -713,18 +827,18 @@ enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {...@@ -713,18 +827,18 @@ enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
713 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,827 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
714 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,828 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
715};829};
716#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)830#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_CODEC_CX2341X_BASE+3)
717enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {831enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
718 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,832 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
719 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,833 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
720};834};
721#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)835#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+4)
722enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {836enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
723 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,837 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
724 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,838 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
725};839};
726#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)840#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_CODEC_CX2341X_BASE+5)
727#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)841#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_CODEC_CX2341X_BASE+6)
728enum v4l2_mpeg_cx2341x_video_median_filter_type {842enum v4l2_mpeg_cx2341x_video_median_filter_type {
729 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,843 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
730 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,844 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
...@@ -732,38 +846,38 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {...@@ -732,38 +846,38 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {
732 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,846 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
733 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,847 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
734};848};
735#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)849#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_CODEC_CX2341X_BASE+7)
736#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)850#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_CODEC_CX2341X_BASE+8)
737#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)851#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_CODEC_CX2341X_BASE+9)
738#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)852#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_CODEC_CX2341X_BASE+10)
739#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)853#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_CODEC_CX2341X_BASE+11)
740854
741/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */855/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
742#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)856#define V4L2_CID_CODEC_MFC51_BASE (V4L2_CTRL_CLASS_CODEC | 0x1100)
743857
744#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)858#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_CODEC_MFC51_BASE+0)
745#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)859#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_MFC51_BASE+1)
746#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)860#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_CODEC_MFC51_BASE+2)
747enum v4l2_mpeg_mfc51_video_frame_skip_mode {861enum v4l2_mpeg_mfc51_video_frame_skip_mode {
748 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,862 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
749 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,863 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
750 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,864 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
751};865};
752#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)866#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_CODEC_MFC51_BASE+3)
753enum v4l2_mpeg_mfc51_video_force_frame_type {867enum v4l2_mpeg_mfc51_video_force_frame_type {
754 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,868 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
755 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,869 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
756 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,870 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
757};871};
758#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)872#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_CODEC_MFC51_BASE+4)
759#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)873#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_CODEC_MFC51_BASE+5)
760#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)874#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_CODEC_MFC51_BASE+6)
761#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)875#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_CODEC_MFC51_BASE+7)
762#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)876#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_CODEC_MFC51_BASE+50)
763#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)877#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_CODEC_MFC51_BASE+51)
764#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)878#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_CODEC_MFC51_BASE+52)
765#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)879#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_CODEC_MFC51_BASE+53)
766#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)880#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_CODEC_MFC51_BASE+54)
767881
768/* Camera class control IDs */882/* Camera class control IDs */
769883
...@@ -877,6 +991,13 @@ enum v4l2_auto_focus_range {...@@ -877,6 +991,13 @@ enum v4l2_auto_focus_range {
877#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE+32)991#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE+32)
878#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE+33)992#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE+33)
879993
994#define V4L2_CID_CAMERA_ORIENTATION (V4L2_CID_CAMERA_CLASS_BASE+34)
995#define V4L2_CAMERA_ORIENTATION_FRONT 0
996#define V4L2_CAMERA_ORIENTATION_BACK 1
997#define V4L2_CAMERA_ORIENTATION_EXTERNAL 2
998
999#define V4L2_CID_CAMERA_SENSOR_ROTATION (V4L2_CID_CAMERA_CLASS_BASE+35)
1000
880/* FM Modulator class control IDs */1001/* FM Modulator class control IDs */
8811002
882#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)1003#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
...@@ -999,6 +1120,8 @@ enum v4l2_jpeg_chroma_subsampling {...@@ -999,6 +1120,8 @@ enum v4l2_jpeg_chroma_subsampling {
999#define V4L2_CID_TEST_PATTERN_GREENR (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)1120#define V4L2_CID_TEST_PATTERN_GREENR (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
1000#define V4L2_CID_TEST_PATTERN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)1121#define V4L2_CID_TEST_PATTERN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
1001#define V4L2_CID_TEST_PATTERN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)1122#define V4L2_CID_TEST_PATTERN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
1123#define V4L2_CID_UNIT_CELL_SIZE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
1124#define V4L2_CID_NOTIFY_GAINS (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9)
10021125
10031126
1004/* Image processing controls */1127/* Image processing controls */
...@@ -1092,4 +1215,810 @@ enum v4l2_detect_md_mode {...@@ -1092,4 +1215,810 @@ enum v4l2_detect_md_mode {
1092#define V4L2_CID_DETECT_MD_THRESHOLD_GRID (V4L2_CID_DETECT_CLASS_BASE + 3)1215#define V4L2_CID_DETECT_MD_THRESHOLD_GRID (V4L2_CID_DETECT_CLASS_BASE + 3)
1093#define V4L2_CID_DETECT_MD_REGION_GRID (V4L2_CID_DETECT_CLASS_BASE + 4)1216#define V4L2_CID_DETECT_MD_REGION_GRID (V4L2_CID_DETECT_CLASS_BASE + 4)
10941217
1218
1219/* Stateless CODECs controls */
1220#define V4L2_CID_CODEC_STATELESS_BASE (V4L2_CTRL_CLASS_CODEC_STATELESS | 0x900)
1221#define V4L2_CID_CODEC_STATELESS_CLASS (V4L2_CTRL_CLASS_CODEC_STATELESS | 1)
1222
1223#define V4L2_CID_STATELESS_H264_DECODE_MODE (V4L2_CID_CODEC_STATELESS_BASE + 0)
1224/**
1225 * enum v4l2_stateless_h264_decode_mode - Decoding mode
1226 *
1227 * @V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED: indicates that decoding
1228 * is performed one slice at a time. In this mode,
1229 * V4L2_CID_STATELESS_H264_SLICE_PARAMS must contain the parsed slice
1230 * parameters and the OUTPUT buffer must contain a single slice.
1231 * V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF feature is used
1232 * in order to support multislice frames.
1233 * @V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED: indicates that
1234 * decoding is performed per frame. The OUTPUT buffer must contain
1235 * all slices and also both fields. This mode is typically supported
1236 * by device drivers that are able to parse the slice(s) header(s)
1237 * in hardware. When this mode is selected,
1238 * V4L2_CID_STATELESS_H264_SLICE_PARAMS is not used.
1239 */
1240enum v4l2_stateless_h264_decode_mode {
1241 V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED,
1242 V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED,
1243};
1244
1245#define V4L2_CID_STATELESS_H264_START_CODE (V4L2_CID_CODEC_STATELESS_BASE + 1)
1246/**
1247 * enum v4l2_stateless_h264_start_code - Start code
1248 *
1249 * @V4L2_STATELESS_H264_START_CODE_NONE: slices are passed
1250 * to the driver without any start code.
1251 * @V4L2_STATELESS_H264_START_CODE_ANNEX_B: slices are passed
1252 * to the driver with an Annex B start code prefix
1253 * (legal start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001).
1254 * This mode is typically supported by device drivers that parse
1255 * the start code in hardware.
1256 */
1257enum v4l2_stateless_h264_start_code {
1258 V4L2_STATELESS_H264_START_CODE_NONE,
1259 V4L2_STATELESS_H264_START_CODE_ANNEX_B,
1260};
1261
1262#define V4L2_H264_SPS_CONSTRAINT_SET0_FLAG 0x01
1263#define V4L2_H264_SPS_CONSTRAINT_SET1_FLAG 0x02
1264#define V4L2_H264_SPS_CONSTRAINT_SET2_FLAG 0x04
1265#define V4L2_H264_SPS_CONSTRAINT_SET3_FLAG 0x08
1266#define V4L2_H264_SPS_CONSTRAINT_SET4_FLAG 0x10
1267#define V4L2_H264_SPS_CONSTRAINT_SET5_FLAG 0x20
1268
1269#define V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE 0x01
1270#define V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS 0x02
1271#define V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO 0x04
1272#define V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED 0x08
1273#define V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY 0x10
1274#define V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD 0x20
1275#define V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE 0x40
1276
1277#define V4L2_H264_SPS_HAS_CHROMA_FORMAT(sps) \
1278 ((sps)->profile_idc == 100 || (sps)->profile_idc == 110 || \
1279 (sps)->profile_idc == 122 || (sps)->profile_idc == 244 || \
1280 (sps)->profile_idc == 44 || (sps)->profile_idc == 83 || \
1281 (sps)->profile_idc == 86 || (sps)->profile_idc == 118 || \
1282 (sps)->profile_idc == 128 || (sps)->profile_idc == 138 || \
1283 (sps)->profile_idc == 139 || (sps)->profile_idc == 134 || \
1284 (sps)->profile_idc == 135)
1285
1286#define V4L2_CID_STATELESS_H264_SPS (V4L2_CID_CODEC_STATELESS_BASE + 2)
1287/**
1288 * struct v4l2_ctrl_h264_sps - H264 sequence parameter set
1289 *
1290 * All the members on this sequence parameter set structure match the
1291 * sequence parameter set syntax as specified by the H264 specification.
1292 *
1293 * @profile_idc: see H264 specification.
1294 * @constraint_set_flags: see H264 specification.
1295 * @level_idc: see H264 specification.
1296 * @seq_parameter_set_id: see H264 specification.
1297 * @chroma_format_idc: see H264 specification.
1298 * @bit_depth_luma_minus8: see H264 specification.
1299 * @bit_depth_chroma_minus8: see H264 specification.
1300 * @log2_max_frame_num_minus4: see H264 specification.
1301 * @pic_order_cnt_type: see H264 specification.
1302 * @log2_max_pic_order_cnt_lsb_minus4: see H264 specification.
1303 * @max_num_ref_frames: see H264 specification.
1304 * @num_ref_frames_in_pic_order_cnt_cycle: see H264 specification.
1305 * @offset_for_ref_frame: see H264 specification.
1306 * @offset_for_non_ref_pic: see H264 specification.
1307 * @offset_for_top_to_bottom_field: see H264 specification.
1308 * @pic_width_in_mbs_minus1: see H264 specification.
1309 * @pic_height_in_map_units_minus1: see H264 specification.
1310 * @flags: see V4L2_H264_SPS_FLAG_{}.
1311 */
1312struct v4l2_ctrl_h264_sps {
1313 __u8 profile_idc;
1314 __u8 constraint_set_flags;
1315 __u8 level_idc;
1316 __u8 seq_parameter_set_id;
1317 __u8 chroma_format_idc;
1318 __u8 bit_depth_luma_minus8;
1319 __u8 bit_depth_chroma_minus8;
1320 __u8 log2_max_frame_num_minus4;
1321 __u8 pic_order_cnt_type;
1322 __u8 log2_max_pic_order_cnt_lsb_minus4;
1323 __u8 max_num_ref_frames;
1324 __u8 num_ref_frames_in_pic_order_cnt_cycle;
1325 __s32 offset_for_ref_frame[255];
1326 __s32 offset_for_non_ref_pic;
1327 __s32 offset_for_top_to_bottom_field;
1328 __u16 pic_width_in_mbs_minus1;
1329 __u16 pic_height_in_map_units_minus1;
1330 __u32 flags;
1331};
1332
1333#define V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE 0x0001
1334#define V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT 0x0002
1335#define V4L2_H264_PPS_FLAG_WEIGHTED_PRED 0x0004
1336#define V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT 0x0008
1337#define V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED 0x0010
1338#define V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT 0x0020
1339#define V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE 0x0040
1340#define V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT 0x0080
1341
1342#define V4L2_CID_STATELESS_H264_PPS (V4L2_CID_CODEC_STATELESS_BASE + 3)
1343/**
1344 * struct v4l2_ctrl_h264_pps - H264 picture parameter set
1345 *
1346 * Except where noted, all the members on this picture parameter set
1347 * structure match the picture parameter set syntax as specified
1348 * by the H264 specification.
1349 *
1350 * In particular, V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT flag
1351 * has a specific meaning. This flag should be set if a non-flat
1352 * scaling matrix applies to the picture. In this case, applications
1353 * are expected to use V4L2_CID_STATELESS_H264_SCALING_MATRIX,
1354 * to pass the values of the non-flat matrices.
1355 *
1356 * @pic_parameter_set_id: see H264 specification.
1357 * @seq_parameter_set_id: see H264 specification.
1358 * @num_slice_groups_minus1: see H264 specification.
1359 * @num_ref_idx_l0_default_active_minus1: see H264 specification.
1360 * @num_ref_idx_l1_default_active_minus1: see H264 specification.
1361 * @weighted_bipred_idc: see H264 specification.
1362 * @pic_init_qp_minus26: see H264 specification.
1363 * @pic_init_qs_minus26: see H264 specification.
1364 * @chroma_qp_index_offset: see H264 specification.
1365 * @second_chroma_qp_index_offset: see H264 specification.
1366 * @flags: see V4L2_H264_PPS_FLAG_{}.
1367 */
1368struct v4l2_ctrl_h264_pps {
1369 __u8 pic_parameter_set_id;
1370 __u8 seq_parameter_set_id;
1371 __u8 num_slice_groups_minus1;
1372 __u8 num_ref_idx_l0_default_active_minus1;
1373 __u8 num_ref_idx_l1_default_active_minus1;
1374 __u8 weighted_bipred_idc;
1375 __s8 pic_init_qp_minus26;
1376 __s8 pic_init_qs_minus26;
1377 __s8 chroma_qp_index_offset;
1378 __s8 second_chroma_qp_index_offset;
1379 __u16 flags;
1380};
1381
1382#define V4L2_CID_STATELESS_H264_SCALING_MATRIX (V4L2_CID_CODEC_STATELESS_BASE + 4)
1383/**
1384 * struct v4l2_ctrl_h264_scaling_matrix - H264 scaling matrices
1385 *
1386 * @scaling_list_4x4: scaling matrix after applying the inverse
1387 * scanning process. Expected list order is Intra Y, Intra Cb,
1388 * Intra Cr, Inter Y, Inter Cb, Inter Cr. The values on each
1389 * scaling list are expected in raster scan order.
1390 * @scaling_list_8x8: scaling matrix after applying the inverse
1391 * scanning process. Expected list order is Intra Y, Inter Y,
1392 * Intra Cb, Inter Cb, Intra Cr, Inter Cr. The values on each
1393 * scaling list are expected in raster scan order.
1394 *
1395 * Note that the list order is different for the 4x4 and 8x8
1396 * matrices as per the H264 specification, see table 7-2 "Assignment
1397 * of mnemonic names to scaling list indices and specification of
1398 * fall-back rule".
1399 */
1400struct v4l2_ctrl_h264_scaling_matrix {
1401 __u8 scaling_list_4x4[6][16];
1402 __u8 scaling_list_8x8[6][64];
1403};
1404
1405struct v4l2_h264_weight_factors {
1406 __s16 luma_weight[32];
1407 __s16 luma_offset[32];
1408 __s16 chroma_weight[32][2];
1409 __s16 chroma_offset[32][2];
1410};
1411
1412#define V4L2_H264_CTRL_PRED_WEIGHTS_REQUIRED(pps, slice) \
1413 ((((pps)->flags & V4L2_H264_PPS_FLAG_WEIGHTED_PRED) && \
1414 ((slice)->slice_type == V4L2_H264_SLICE_TYPE_P || \
1415 (slice)->slice_type == V4L2_H264_SLICE_TYPE_SP)) || \
1416 ((pps)->weighted_bipred_idc == 1 && \
1417 (slice)->slice_type == V4L2_H264_SLICE_TYPE_B))
1418
1419#define V4L2_CID_STATELESS_H264_PRED_WEIGHTS (V4L2_CID_CODEC_STATELESS_BASE + 5)
1420/**
1421 * struct v4l2_ctrl_h264_pred_weights - Prediction weight table
1422 *
1423 * Prediction weight table, which matches the syntax specified
1424 * by the H264 specification.
1425 *
1426 * @luma_log2_weight_denom: see H264 specification.
1427 * @chroma_log2_weight_denom: see H264 specification.
1428 * @weight_factors: luma and chroma weight factors.
1429 */
1430struct v4l2_ctrl_h264_pred_weights {
1431 __u16 luma_log2_weight_denom;
1432 __u16 chroma_log2_weight_denom;
1433 struct v4l2_h264_weight_factors weight_factors[2];
1434};
1435
1436#define V4L2_H264_SLICE_TYPE_P 0
1437#define V4L2_H264_SLICE_TYPE_B 1
1438#define V4L2_H264_SLICE_TYPE_I 2
1439#define V4L2_H264_SLICE_TYPE_SP 3
1440#define V4L2_H264_SLICE_TYPE_SI 4
1441
1442#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
1443#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
1444
1445#define V4L2_H264_TOP_FIELD_REF 0x1
1446#define V4L2_H264_BOTTOM_FIELD_REF 0x2
1447#define V4L2_H264_FRAME_REF 0x3
1448
1449/**
1450 * struct v4l2_h264_reference - H264 picture reference
1451 *
1452 * @fields: indicates how the picture is referenced.
1453 * Valid values are V4L2_H264_{}_REF.
1454 * @index: index into v4l2_ctrl_h264_decode_params.dpb[].
1455 */
1456struct v4l2_h264_reference {
1457 __u8 fields;
1458 __u8 index;
1459};
1460
1461/*
1462 * Maximum DPB size, as specified by section 'A.3.1 Level limits
1463 * common to the Baseline, Main, and Extended profiles'.
1464 */
1465#define V4L2_H264_NUM_DPB_ENTRIES 16
1466#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
1467
1468#define V4L2_CID_STATELESS_H264_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 6)
1469/**
1470 * struct v4l2_ctrl_h264_slice_params - H264 slice parameters
1471 *
1472 * This structure holds the H264 syntax elements that are specified
1473 * as non-invariant for the slices in a given frame.
1474 *
1475 * Slice invariant syntax elements are contained in struct
1476 * v4l2_ctrl_h264_decode_params. This is done to reduce the API surface
1477 * on frame-based decoders, where slice header parsing is done by the
1478 * hardware.
1479 *
1480 * Slice invariant syntax elements are specified in specification section
1481 * "7.4.3 Slice header semantics".
1482 *
1483 * Except where noted, the members on this struct match the slice header syntax.
1484 *
1485 * @header_bit_size: offset in bits to slice_data() from the beginning of this slice.
1486 * @first_mb_in_slice: see H264 specification.
1487 * @slice_type: see H264 specification.
1488 * @colour_plane_id: see H264 specification.
1489 * @redundant_pic_cnt: see H264 specification.
1490 * @cabac_init_idc: see H264 specification.
1491 * @slice_qp_delta: see H264 specification.
1492 * @slice_qs_delta: see H264 specification.
1493 * @disable_deblocking_filter_idc: see H264 specification.
1494 * @slice_alpha_c0_offset_div2: see H264 specification.
1495 * @slice_beta_offset_div2: see H264 specification.
1496 * @num_ref_idx_l0_active_minus1: see H264 specification.
1497 * @num_ref_idx_l1_active_minus1: see H264 specification.
1498 * @reserved: padding field. Should be zeroed by applications.
1499 * @ref_pic_list0: reference picture list 0 after applying the per-slice modifications.
1500 * @ref_pic_list1: reference picture list 1 after applying the per-slice modifications.
1501 * @flags: see V4L2_H264_SLICE_FLAG_{}.
1502 */
1503struct v4l2_ctrl_h264_slice_params {
1504 __u32 header_bit_size;
1505 __u32 first_mb_in_slice;
1506 __u8 slice_type;
1507 __u8 colour_plane_id;
1508 __u8 redundant_pic_cnt;
1509 __u8 cabac_init_idc;
1510 __s8 slice_qp_delta;
1511 __s8 slice_qs_delta;
1512 __u8 disable_deblocking_filter_idc;
1513 __s8 slice_alpha_c0_offset_div2;
1514 __s8 slice_beta_offset_div2;
1515 __u8 num_ref_idx_l0_active_minus1;
1516 __u8 num_ref_idx_l1_active_minus1;
1517
1518 __u8 reserved;
1519
1520 struct v4l2_h264_reference ref_pic_list0[V4L2_H264_REF_LIST_LEN];
1521 struct v4l2_h264_reference ref_pic_list1[V4L2_H264_REF_LIST_LEN];
1522
1523 __u32 flags;
1524};
1525
1526#define V4L2_H264_DPB_ENTRY_FLAG_VALID 0x01
1527#define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE 0x02
1528#define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM 0x04
1529#define V4L2_H264_DPB_ENTRY_FLAG_FIELD 0x08
1530
1531/**
1532 * struct v4l2_h264_dpb_entry - H264 decoded picture buffer entry
1533 *
1534 * @reference_ts: timestamp of the V4L2 capture buffer to use as reference.
1535 * The timestamp refers to the timestamp field in struct v4l2_buffer.
1536 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
1537 * @pic_num: matches PicNum variable assigned during the reference
1538 * picture lists construction process.
1539 * @frame_num: frame identifier which matches frame_num syntax element.
1540 * @fields: indicates how the DPB entry is referenced. Valid values are
1541 * V4L2_H264_{}_REF.
1542 * @reserved: padding field. Should be zeroed by applications.
1543 * @top_field_order_cnt: matches TopFieldOrderCnt picture value.
1544 * @bottom_field_order_cnt: matches BottomFieldOrderCnt picture value.
1545 * Note that picture field is indicated by v4l2_buffer.field.
1546 * @flags: see V4L2_H264_DPB_ENTRY_FLAG_{}.
1547 */
1548struct v4l2_h264_dpb_entry {
1549 __u64 reference_ts;
1550 __u32 pic_num;
1551 __u16 frame_num;
1552 __u8 fields;
1553 __u8 reserved[5];
1554 __s32 top_field_order_cnt;
1555 __s32 bottom_field_order_cnt;
1556 __u32 flags;
1557};
1558
1559#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
1560#define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC 0x02
1561#define V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD 0x04
1562
1563#define V4L2_CID_STATELESS_H264_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 7)
1564/**
1565 * struct v4l2_ctrl_h264_decode_params - H264 decoding parameters
1566 *
1567 * @dpb: decoded picture buffer.
1568 * @nal_ref_idc: slice header syntax element.
1569 * @frame_num: slice header syntax element.
1570 * @top_field_order_cnt: matches TopFieldOrderCnt picture value.
1571 * @bottom_field_order_cnt: matches BottomFieldOrderCnt picture value.
1572 * Note that picture field is indicated by v4l2_buffer.field.
1573 * @idr_pic_id: slice header syntax element.
1574 * @pic_order_cnt_lsb: slice header syntax element.
1575 * @delta_pic_order_cnt_bottom: slice header syntax element.
1576 * @delta_pic_order_cnt0: slice header syntax element.
1577 * @delta_pic_order_cnt1: slice header syntax element.
1578 * @dec_ref_pic_marking_bit_size: size in bits of dec_ref_pic_marking()
1579 * syntax element.
1580 * @pic_order_cnt_bit_size: size in bits of pic order count syntax.
1581 * @slice_group_change_cycle: slice header syntax element.
1582 * @reserved: padding field. Should be zeroed by applications.
1583 * @flags: see V4L2_H264_DECODE_PARAM_FLAG_{}.
1584 */
1585struct v4l2_ctrl_h264_decode_params {
1586 struct v4l2_h264_dpb_entry dpb[V4L2_H264_NUM_DPB_ENTRIES];
1587 __u16 nal_ref_idc;
1588 __u16 frame_num;
1589 __s32 top_field_order_cnt;
1590 __s32 bottom_field_order_cnt;
1591 __u16 idr_pic_id;
1592 __u16 pic_order_cnt_lsb;
1593 __s32 delta_pic_order_cnt_bottom;
1594 __s32 delta_pic_order_cnt0;
1595 __s32 delta_pic_order_cnt1;
1596 __u32 dec_ref_pic_marking_bit_size;
1597 __u32 pic_order_cnt_bit_size;
1598 __u32 slice_group_change_cycle;
1599
1600 __u32 reserved;
1601 __u32 flags;
1602};
1603
1604
1605/* Stateless FWHT control, used by the vicodec driver */
1606
1607/* Current FWHT version */
1608#define V4L2_FWHT_VERSION 3
1609
1610/* Set if this is an interlaced format */
1611#define V4L2_FWHT_FL_IS_INTERLACED _BITUL(0)
1612/* Set if this is a bottom-first (NTSC) interlaced format */
1613#define V4L2_FWHT_FL_IS_BOTTOM_FIRST _BITUL(1)
1614/* Set if each 'frame' contains just one field */
1615#define V4L2_FWHT_FL_IS_ALTERNATE _BITUL(2)
1616/*
1617 * If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this
1618 * 'frame' is the bottom field, else it is the top field.
1619 */
1620#define V4L2_FWHT_FL_IS_BOTTOM_FIELD _BITUL(3)
1621/* Set if the Y' plane is uncompressed */
1622#define V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED _BITUL(4)
1623/* Set if the Cb plane is uncompressed */
1624#define V4L2_FWHT_FL_CB_IS_UNCOMPRESSED _BITUL(5)
1625/* Set if the Cr plane is uncompressed */
1626#define V4L2_FWHT_FL_CR_IS_UNCOMPRESSED _BITUL(6)
1627/* Set if the chroma plane is full height, if cleared it is half height */
1628#define V4L2_FWHT_FL_CHROMA_FULL_HEIGHT _BITUL(7)
1629/* Set if the chroma plane is full width, if cleared it is half width */
1630#define V4L2_FWHT_FL_CHROMA_FULL_WIDTH _BITUL(8)
1631/* Set if the alpha plane is uncompressed */
1632#define V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED _BITUL(9)
1633/* Set if this is an I Frame */
1634#define V4L2_FWHT_FL_I_FRAME _BITUL(10)
1635
1636/* A 4-values flag - the number of components - 1 */
1637#define V4L2_FWHT_FL_COMPONENTS_NUM_MSK GENMASK(18, 16)
1638#define V4L2_FWHT_FL_COMPONENTS_NUM_OFFSET 16
1639
1640/* A 4-values flag - the pixel encoding type */
1641#define V4L2_FWHT_FL_PIXENC_MSK GENMASK(20, 19)
1642#define V4L2_FWHT_FL_PIXENC_OFFSET 19
1643#define V4L2_FWHT_FL_PIXENC_YUV (1 << V4L2_FWHT_FL_PIXENC_OFFSET)
1644#define V4L2_FWHT_FL_PIXENC_RGB (2 << V4L2_FWHT_FL_PIXENC_OFFSET)
1645#define V4L2_FWHT_FL_PIXENC_HSV (3 << V4L2_FWHT_FL_PIXENC_OFFSET)
1646
1647#define V4L2_CID_STATELESS_FWHT_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 100)
1648/**
1649 * struct v4l2_ctrl_fwht_params - FWHT parameters
1650 *
1651 * @backward_ref_ts: timestamp of the V4L2 capture buffer to use as reference.
1652 * The timestamp refers to the timestamp field in struct v4l2_buffer.
1653 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
1654 * @version: must be V4L2_FWHT_VERSION.
1655 * @width: width of frame.
1656 * @height: height of frame.
1657 * @flags: FWHT flags (see V4L2_FWHT_FL_*).
1658 * @colorspace: the colorspace (enum v4l2_colorspace).
1659 * @xfer_func: the transfer function (enum v4l2_xfer_func).
1660 * @ycbcr_enc: the Y'CbCr encoding (enum v4l2_ycbcr_encoding).
1661 * @quantization: the quantization (enum v4l2_quantization).
1662 */
1663struct v4l2_ctrl_fwht_params {
1664 __u64 backward_ref_ts;
1665 __u32 version;
1666 __u32 width;
1667 __u32 height;
1668 __u32 flags;
1669 __u32 colorspace;
1670 __u32 xfer_func;
1671 __u32 ycbcr_enc;
1672 __u32 quantization;
1673};
1674
1675/* Stateless VP8 control */
1676
1677#define V4L2_VP8_SEGMENT_FLAG_ENABLED 0x01
1678#define V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP 0x02
1679#define V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA 0x04
1680#define V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE 0x08
1681
1682/**
1683 * struct v4l2_vp8_segment - VP8 segment-based adjustments parameters
1684 *
1685 * @quant_update: update values for the segment quantizer.
1686 * @lf_update: update values for the loop filter level.
1687 * @segment_probs: branch probabilities of the segment_id decoding tree.
1688 * @padding: padding field. Should be zeroed by applications.
1689 * @flags: see V4L2_VP8_SEGMENT_FLAG_{}.
1690 *
1691 * This structure contains segment-based adjustments related parameters.
1692 * See the 'update_segmentation()' part of the frame header syntax,
1693 * and section '9.3. Segment-Based Adjustments' of the VP8 specification
1694 * for more details.
1695 */
1696struct v4l2_vp8_segment {
1697 __s8 quant_update[4];
1698 __s8 lf_update[4];
1699 __u8 segment_probs[3];
1700 __u8 padding;
1701 __u32 flags;
1702};
1703
1704#define V4L2_VP8_LF_ADJ_ENABLE 0x01
1705#define V4L2_VP8_LF_DELTA_UPDATE 0x02
1706#define V4L2_VP8_LF_FILTER_TYPE_SIMPLE 0x04
1707
1708/**
1709 * struct v4l2_vp8_loop_filter - VP8 loop filter parameters
1710 *
1711 * @ref_frm_delta: Reference frame signed delta values.
1712 * @mb_mode_delta: MB prediction mode signed delta values.
1713 * @sharpness_level: matches sharpness_level syntax element.
1714 * @level: matches loop_filter_level syntax element.
1715 * @padding: padding field. Should be zeroed by applications.
1716 * @flags: see V4L2_VP8_LF_FLAG_{}.
1717 *
1718 * This structure contains loop filter related parameters.
1719 * See the 'mb_lf_adjustments()' part of the frame header syntax,
1720 * and section '9.4. Loop Filter Type and Levels' of the VP8 specification
1721 * for more details.
1722 */
1723struct v4l2_vp8_loop_filter {
1724 __s8 ref_frm_delta[4];
1725 __s8 mb_mode_delta[4];
1726 __u8 sharpness_level;
1727 __u8 level;
1728 __u16 padding;
1729 __u32 flags;
1730};
1731
1732/**
1733 * struct v4l2_vp8_quantization - VP8 quantizattion indices
1734 *
1735 * @y_ac_qi: luma AC coefficient table index.
1736 * @y_dc_delta: luma DC delta vaue.
1737 * @y2_dc_delta: y2 block DC delta value.
1738 * @y2_ac_delta: y2 block AC delta value.
1739 * @uv_dc_delta: chroma DC delta value.
1740 * @uv_ac_delta: chroma AC delta value.
1741 * @padding: padding field. Should be zeroed by applications.
1742 *
1743 * This structure contains the quantization indices present
1744 * in 'quant_indices()' part of the frame header syntax.
1745 * See section '9.6. Dequantization Indices' of the VP8 specification
1746 * for more details.
1747 */
1748struct v4l2_vp8_quantization {
1749 __u8 y_ac_qi;
1750 __s8 y_dc_delta;
1751 __s8 y2_dc_delta;
1752 __s8 y2_ac_delta;
1753 __s8 uv_dc_delta;
1754 __s8 uv_ac_delta;
1755 __u16 padding;
1756};
1757
1758#define V4L2_VP8_COEFF_PROB_CNT 11
1759#define V4L2_VP8_MV_PROB_CNT 19
1760
1761/**
1762 * struct v4l2_vp8_entropy - VP8 update probabilities
1763 *
1764 * @coeff_probs: coefficient probability update values.
1765 * @y_mode_probs: luma intra-prediction probabilities.
1766 * @uv_mode_probs: chroma intra-prediction probabilities.
1767 * @mv_probs: mv decoding probability.
1768 * @padding: padding field. Should be zeroed by applications.
1769 *
1770 * This structure contains the update probabilities present in
1771 * 'token_prob_update()' and 'mv_prob_update()' part of the frame header.
1772 * See section '17.2. Probability Updates' of the VP8 specification
1773 * for more details.
1774 */
1775struct v4l2_vp8_entropy {
1776 __u8 coeff_probs[4][8][3][V4L2_VP8_COEFF_PROB_CNT];
1777 __u8 y_mode_probs[4];
1778 __u8 uv_mode_probs[3];
1779 __u8 mv_probs[2][V4L2_VP8_MV_PROB_CNT];
1780 __u8 padding[3];
1781};
1782
1783/**
1784 * struct v4l2_vp8_entropy_coder_state - VP8 boolean coder state
1785 *
1786 * @range: coder state value for "Range"
1787 * @value: coder state value for "Value"
1788 * @bit_count: number of bits left in range "Value".
1789 * @padding: padding field. Should be zeroed by applications.
1790 *
1791 * This structure contains the state for the boolean coder, as
1792 * explained in section '7. Boolean Entropy Decoder' of the VP8 specification.
1793 */
1794struct v4l2_vp8_entropy_coder_state {
1795 __u8 range;
1796 __u8 value;
1797 __u8 bit_count;
1798 __u8 padding;
1799};
1800
1801#define V4L2_VP8_FRAME_FLAG_KEY_FRAME 0x01
1802#define V4L2_VP8_FRAME_FLAG_EXPERIMENTAL 0x02
1803#define V4L2_VP8_FRAME_FLAG_SHOW_FRAME 0x04
1804#define V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF 0x08
1805#define V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN 0x10
1806#define V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT 0x20
1807
1808#define V4L2_VP8_FRAME_IS_KEY_FRAME(hdr) \
1809 (!!((hdr)->flags & V4L2_VP8_FRAME_FLAG_KEY_FRAME))
1810
1811#define V4L2_CID_STATELESS_VP8_FRAME (V4L2_CID_CODEC_STATELESS_BASE + 200)
1812/**
1813 * struct v4l2_ctrl_vp8_frame - VP8 frame parameters
1814 *
1815 * @segment: segmentation parameters. See &v4l2_vp8_segment for more details
1816 * @lf: loop filter parameters. See &v4l2_vp8_loop_filter for more details
1817 * @quant: quantization parameters. See &v4l2_vp8_quantization for more details
1818 * @entropy: update probabilities. See &v4l2_vp8_entropy for more details
1819 * @coder_state: boolean coder state. See &v4l2_vp8_entropy_coder_state for more details
1820 * @width: frame width.
1821 * @height: frame height.
1822 * @horizontal_scale: horizontal scaling factor.
1823 * @vertical_scale: vertical scaling factor.
1824 * @version: bitstream version.
1825 * @prob_skip_false: frame header syntax element.
1826 * @prob_intra: frame header syntax element.
1827 * @prob_last: frame header syntax element.
1828 * @prob_gf: frame header syntax element.
1829 * @num_dct_parts: number of DCT coefficients partitions.
1830 * @first_part_size: size of the first partition, i.e. the control partition.
1831 * @first_part_header_bits: size in bits of the first partition header portion.
1832 * @dct_part_sizes: DCT coefficients sizes.
1833 * @last_frame_ts: "last" reference buffer timestamp.
1834 * The timestamp refers to the timestamp field in struct v4l2_buffer.
1835 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
1836 * @golden_frame_ts: "golden" reference buffer timestamp.
1837 * @alt_frame_ts: "alt" reference buffer timestamp.
1838 * @flags: see V4L2_VP8_FRAME_FLAG_{}.
1839 */
1840struct v4l2_ctrl_vp8_frame {
1841 struct v4l2_vp8_segment segment;
1842 struct v4l2_vp8_loop_filter lf;
1843 struct v4l2_vp8_quantization quant;
1844 struct v4l2_vp8_entropy entropy;
1845 struct v4l2_vp8_entropy_coder_state coder_state;
1846
1847 __u16 width;
1848 __u16 height;
1849
1850 __u8 horizontal_scale;
1851 __u8 vertical_scale;
1852
1853 __u8 version;
1854 __u8 prob_skip_false;
1855 __u8 prob_intra;
1856 __u8 prob_last;
1857 __u8 prob_gf;
1858 __u8 num_dct_parts;
1859
1860 __u32 first_part_size;
1861 __u32 first_part_header_bits;
1862 __u32 dct_part_sizes[8];
1863
1864 __u64 last_frame_ts;
1865 __u64 golden_frame_ts;
1866 __u64 alt_frame_ts;
1867
1868 __u64 flags;
1869};
1870
1871/* Stateless MPEG-2 controls */
1872
1873#define V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE 0x01
1874
1875#define V4L2_CID_STATELESS_MPEG2_SEQUENCE (V4L2_CID_CODEC_STATELESS_BASE+220)
1876/**
1877 * struct v4l2_ctrl_mpeg2_sequence - MPEG-2 sequence header
1878 *
1879 * All the members on this structure match the sequence header and sequence
1880 * extension syntaxes as specified by the MPEG-2 specification.
1881 *
1882 * Fields horizontal_size, vertical_size and vbv_buffer_size are a
1883 * combination of respective _value and extension syntax elements,
1884 * as described in section 6.3.3 "Sequence header".
1885 *
1886 * @horizontal_size: combination of elements horizontal_size_value and
1887 * horizontal_size_extension.
1888 * @vertical_size: combination of elements vertical_size_value and
1889 * vertical_size_extension.
1890 * @vbv_buffer_size: combination of elements vbv_buffer_size_value and
1891 * vbv_buffer_size_extension.
1892 * @profile_and_level_indication: see MPEG-2 specification.
1893 * @chroma_format: see MPEG-2 specification.
1894 * @flags: see V4L2_MPEG2_SEQ_FLAG_{}.
1895 */
1896struct v4l2_ctrl_mpeg2_sequence {
1897 __u16 horizontal_size;
1898 __u16 vertical_size;
1899 __u32 vbv_buffer_size;
1900 __u16 profile_and_level_indication;
1901 __u8 chroma_format;
1902 __u8 flags;
1903};
1904
1905#define V4L2_MPEG2_PIC_CODING_TYPE_I 1
1906#define V4L2_MPEG2_PIC_CODING_TYPE_P 2
1907#define V4L2_MPEG2_PIC_CODING_TYPE_B 3
1908#define V4L2_MPEG2_PIC_CODING_TYPE_D 4
1909
1910#define V4L2_MPEG2_PIC_TOP_FIELD 0x1
1911#define V4L2_MPEG2_PIC_BOTTOM_FIELD 0x2
1912#define V4L2_MPEG2_PIC_FRAME 0x3
1913
1914#define V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST 0x0001
1915#define V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT 0x0002
1916#define V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV 0x0004
1917#define V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE 0x0008
1918#define V4L2_MPEG2_PIC_FLAG_INTRA_VLC 0x0010
1919#define V4L2_MPEG2_PIC_FLAG_ALT_SCAN 0x0020
1920#define V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST 0x0040
1921#define V4L2_MPEG2_PIC_FLAG_PROGRESSIVE 0x0080
1922
1923#define V4L2_CID_STATELESS_MPEG2_PICTURE (V4L2_CID_CODEC_STATELESS_BASE+221)
1924/**
1925 * struct v4l2_ctrl_mpeg2_picture - MPEG-2 picture header
1926 *
1927 * All the members on this structure match the picture header and picture
1928 * coding extension syntaxes as specified by the MPEG-2 specification.
1929 *
1930 * @backward_ref_ts: timestamp of the V4L2 capture buffer to use as
1931 * reference for backward prediction.
1932 * @forward_ref_ts: timestamp of the V4L2 capture buffer to use as
1933 * reference for forward prediction. These timestamp refers to the
1934 * timestamp field in struct v4l2_buffer. Use v4l2_timeval_to_ns()
1935 * to convert the struct timeval to a __u64.
1936 * @flags: see V4L2_MPEG2_PIC_FLAG_{}.
1937 * @f_code: see MPEG-2 specification.
1938 * @picture_coding_type: see MPEG-2 specification.
1939 * @picture_structure: see V4L2_MPEG2_PIC_{}_FIELD.
1940 * @intra_dc_precision: see MPEG-2 specification.
1941 * @reserved: padding field. Should be zeroed by applications.
1942 */
1943struct v4l2_ctrl_mpeg2_picture {
1944 __u64 backward_ref_ts;
1945 __u64 forward_ref_ts;
1946 __u32 flags;
1947 __u8 f_code[2][2];
1948 __u8 picture_coding_type;
1949 __u8 picture_structure;
1950 __u8 intra_dc_precision;
1951 __u8 reserved[5];
1952};
1953
1954#define V4L2_CID_STATELESS_MPEG2_QUANTISATION (V4L2_CID_CODEC_STATELESS_BASE+222)
1955/**
1956 * struct v4l2_ctrl_mpeg2_quantisation - MPEG-2 quantisation
1957 *
1958 * Quantisation matrices as specified by section 6.3.7
1959 * "Quant matrix extension".
1960 *
1961 * @intra_quantiser_matrix: The quantisation matrix coefficients
1962 * for intra-coded frames, in zigzag scanning order. It is relevant
1963 * for both luma and chroma components, although it can be superseded
1964 * by the chroma-specific matrix for non-4:2:0 YUV formats.
1965 * @non_intra_quantiser_matrix: The quantisation matrix coefficients
1966 * for non-intra-coded frames, in zigzag scanning order. It is relevant
1967 * for both luma and chroma components, although it can be superseded
1968 * by the chroma-specific matrix for non-4:2:0 YUV formats.
1969 * @chroma_intra_quantiser_matrix: The quantisation matrix coefficients
1970 * for the chominance component of intra-coded frames, in zigzag scanning
1971 * order. Only relevant for 4:2:2 and 4:4:4 YUV formats.
1972 * @chroma_non_intra_quantiser_matrix: The quantisation matrix coefficients
1973 * for the chrominance component of non-intra-coded frames, in zigzag scanning
1974 * order. Only relevant for 4:2:2 and 4:4:4 YUV formats.
1975 */
1976struct v4l2_ctrl_mpeg2_quantisation {
1977 __u8 intra_quantiser_matrix[64];
1978 __u8 non_intra_quantiser_matrix[64];
1979 __u8 chroma_intra_quantiser_matrix[64];
1980 __u8 chroma_non_intra_quantiser_matrix[64];
1981};
1982
1983#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
1984#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
1985
1986#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
1987
1988struct v4l2_ctrl_hdr10_cll_info {
1989 __u16 max_content_light_level;
1990 __u16 max_pic_average_light_level;
1991};
1992
1993#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1)
1994
1995#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
1996#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
1997#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
1998#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
1999#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
2000#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
2001#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
2002#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
2003#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
2004#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
2005#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
2006#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
2007
2008struct v4l2_ctrl_hdr10_mastering_display {
2009 __u16 display_primaries_x[3];
2010 __u16 display_primaries_y[3];
2011 __u16 white_point_x;
2012 __u16 white_point_y;
2013 __u32 max_display_mastering_luminance;
2014 __u32 min_display_mastering_luminance;
2015};
2016
2017/* MPEG-compression definitions kept for backwards compatibility */
2018#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
2019#define V4L2_CID_MPEG_CLASS V4L2_CID_CODEC_CLASS
2020#define V4L2_CID_MPEG_BASE V4L2_CID_CODEC_BASE
2021#define V4L2_CID_MPEG_CX2341X_BASE V4L2_CID_CODEC_CX2341X_BASE
2022#define V4L2_CID_MPEG_MFC51_BASE V4L2_CID_CODEC_MFC51_BASE
2023
1095#endif2024#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/v4l2-mediabus.h+13-2
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16#include <linux/types.h>16#include <linux/types.h>
17#include <linux/videodev2.h>17#include <linux/videodev2.h>
1818
19#define V4L2_MBUS_FRAMEFMT_SET_CSC 0x0001
20
19/**21/**
20 * struct v4l2_mbus_framefmt - frame format on the media bus22 * struct v4l2_mbus_framefmt - frame format on the media bus
21 * @width: image width23 * @width: image width
...@@ -24,8 +26,11 @@...@@ -24,8 +26,11 @@
24 * @field: used interlacing type (from enum v4l2_field)26 * @field: used interlacing type (from enum v4l2_field)
25 * @colorspace: colorspace of the data (from enum v4l2_colorspace)27 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
26 * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)28 * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)
29 * @hsv_enc: HSV encoding of the data (from enum v4l2_hsv_encoding)
27 * @quantization: quantization of the data (from enum v4l2_quantization)30 * @quantization: quantization of the data (from enum v4l2_quantization)
28 * @xfer_func: transfer function of the data (from enum v4l2_xfer_func)31 * @xfer_func: transfer function of the data (from enum v4l2_xfer_func)
32 * @flags: flags (V4L2_MBUS_FRAMEFMT_*)
33 * @reserved: reserved bytes that can be later used
29 */34 */
30struct v4l2_mbus_framefmt {35struct v4l2_mbus_framefmt {
31 __u32 width;36 __u32 width;
...@@ -33,10 +38,16 @@ struct v4l2_mbus_framefmt {...@@ -33,10 +38,16 @@ struct v4l2_mbus_framefmt {
33 __u32 code;38 __u32 code;
34 __u32 field;39 __u32 field;
35 __u32 colorspace;40 __u32 colorspace;
36 __u16 ycbcr_enc;41 union {
42 /* enum v4l2_ycbcr_encoding */
43 __u16 ycbcr_enc;
44 /* enum v4l2_hsv_encoding */
45 __u16 hsv_enc;
46 };
37 __u16 quantization;47 __u16 quantization;
38 __u16 xfer_func;48 __u16 xfer_func;
39 __u16 reserved[11];49 __u16 flags;
50 __u16 reserved[10];
40};51};
4152
42/*53/*
lib/libc/include/any-linux-any/linux/v4l2-subdev.h+36-2
...@@ -44,6 +44,7 @@ enum v4l2_subdev_format_whence {...@@ -44,6 +44,7 @@ enum v4l2_subdev_format_whence {
44 * @which: format type (from enum v4l2_subdev_format_whence)44 * @which: format type (from enum v4l2_subdev_format_whence)
45 * @pad: pad number, as reported by the media API45 * @pad: pad number, as reported by the media API
46 * @format: media bus format (format code and frame size)46 * @format: media bus format (format code and frame size)
47 * @reserved: drivers and applications must zero this array
47 */48 */
48struct v4l2_subdev_format {49struct v4l2_subdev_format {
49 __u32 which;50 __u32 which;
...@@ -57,6 +58,7 @@ struct v4l2_subdev_format {...@@ -57,6 +58,7 @@ struct v4l2_subdev_format {
57 * @which: format type (from enum v4l2_subdev_format_whence)58 * @which: format type (from enum v4l2_subdev_format_whence)
58 * @pad: pad number, as reported by the media API59 * @pad: pad number, as reported by the media API
59 * @rect: pad crop rectangle boundaries60 * @rect: pad crop rectangle boundaries
61 * @reserved: drivers and applications must zero this array
60 */62 */
61struct v4l2_subdev_crop {63struct v4l2_subdev_crop {
62 __u32 which;64 __u32 which;
...@@ -65,27 +67,41 @@ struct v4l2_subdev_crop {...@@ -65,27 +67,41 @@ struct v4l2_subdev_crop {
65 __u32 reserved[8];67 __u32 reserved[8];
66};68};
6769
70#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
71#define V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC 0x00000002
72#define V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC 0x00000004
73#define V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC
74#define V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION 0x00000008
75
68/**76/**
69 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration77 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
70 * @pad: pad number, as reported by the media API78 * @pad: pad number, as reported by the media API
71 * @index: format index during enumeration79 * @index: format index during enumeration
72 * @code: format code (MEDIA_BUS_FMT_ definitions)80 * @code: format code (MEDIA_BUS_FMT_ definitions)
73 * @which: format type (from enum v4l2_subdev_format_whence)81 * @which: format type (from enum v4l2_subdev_format_whence)
82 * @flags: flags set by the driver, (V4L2_SUBDEV_MBUS_CODE_*)
83 * @reserved: drivers and applications must zero this array
74 */84 */
75struct v4l2_subdev_mbus_code_enum {85struct v4l2_subdev_mbus_code_enum {
76 __u32 pad;86 __u32 pad;
77 __u32 index;87 __u32 index;
78 __u32 code;88 __u32 code;
79 __u32 which;89 __u32 which;
80 __u32 reserved[8];90 __u32 flags;
91 __u32 reserved[7];
81};92};
8293
83/**94/**
84 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration95 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
85 * @pad: pad number, as reported by the media API
86 * @index: format index during enumeration96 * @index: format index during enumeration
97 * @pad: pad number, as reported by the media API
87 * @code: format code (MEDIA_BUS_FMT_ definitions)98 * @code: format code (MEDIA_BUS_FMT_ definitions)
99 * @min_width: minimum frame width, in pixels
100 * @max_width: maximum frame width, in pixels
101 * @min_height: minimum frame height, in pixels
102 * @max_height: maximum frame height, in pixels
88 * @which: format type (from enum v4l2_subdev_format_whence)103 * @which: format type (from enum v4l2_subdev_format_whence)
104 * @reserved: drivers and applications must zero this array
89 */105 */
90struct v4l2_subdev_frame_size_enum {106struct v4l2_subdev_frame_size_enum {
91 __u32 index;107 __u32 index;
...@@ -103,6 +119,7 @@ struct v4l2_subdev_frame_size_enum {...@@ -103,6 +119,7 @@ struct v4l2_subdev_frame_size_enum {
103 * struct v4l2_subdev_frame_interval - Pad-level frame rate119 * struct v4l2_subdev_frame_interval - Pad-level frame rate
104 * @pad: pad number, as reported by the media API120 * @pad: pad number, as reported by the media API
105 * @interval: frame interval in seconds121 * @interval: frame interval in seconds
122 * @reserved: drivers and applications must zero this array
106 */123 */
107struct v4l2_subdev_frame_interval {124struct v4l2_subdev_frame_interval {
108 __u32 pad;125 __u32 pad;
...@@ -119,6 +136,7 @@ struct v4l2_subdev_frame_interval {...@@ -119,6 +136,7 @@ struct v4l2_subdev_frame_interval {
119 * @height: frame height in pixels136 * @height: frame height in pixels
120 * @interval: frame interval in seconds137 * @interval: frame interval in seconds
121 * @which: format type (from enum v4l2_subdev_format_whence)138 * @which: format type (from enum v4l2_subdev_format_whence)
139 * @reserved: drivers and applications must zero this array
122 */140 */
123struct v4l2_subdev_frame_interval_enum {141struct v4l2_subdev_frame_interval_enum {
124 __u32 index;142 __u32 index;
...@@ -155,9 +173,25 @@ struct v4l2_subdev_selection {...@@ -155,9 +173,25 @@ struct v4l2_subdev_selection {
155 __u32 reserved[8];173 __u32 reserved[8];
156};174};
157175
176/**
177 * struct v4l2_subdev_capability - subdev capabilities
178 * @version: the driver versioning number
179 * @capabilities: the subdev capabilities, see V4L2_SUBDEV_CAP_*
180 * @reserved: for future use, set to zero for now
181 */
182struct v4l2_subdev_capability {
183 __u32 version;
184 __u32 capabilities;
185 __u32 reserved[14];
186};
187
188/* The v4l2 sub-device video device node is registered in read-only mode. */
189#define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001
190
158/* Backwards compatibility define --- to be removed */191/* Backwards compatibility define --- to be removed */
159#define v4l2_subdev_edid v4l2_edid192#define v4l2_subdev_edid v4l2_edid
160193
194#define VIDIOC_SUBDEV_QUERYCAP _IOR('V', 0, struct v4l2_subdev_capability)
161#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)195#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
162#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)196#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
163#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)197#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
lib/libc/include/any-linux-any/linux/vbox_vmmdev_types.h+64-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR CDDL-1.0) */
2/*2/*
3 * Virtual Device for Guest <-> VMM/Host communication, type definitions3 * Virtual Device for Guest <-> VMM/Host communication, type definitions
4 * which are also used for the vboxguest ioctl interface / by vboxsf4 * which are also used for the vboxguest ioctl interface / by vboxsf
...@@ -63,6 +63,7 @@ enum vmmdev_request_type {...@@ -63,6 +63,7 @@ enum vmmdev_request_type {
63 VMMDEVREQ_SET_GUEST_CAPABILITIES = 56,63 VMMDEVREQ_SET_GUEST_CAPABILITIES = 56,
64 VMMDEVREQ_VIDEMODE_SUPPORTED2 = 57, /* since version 3.2.0 */64 VMMDEVREQ_VIDEMODE_SUPPORTED2 = 57, /* since version 3.2.0 */
65 VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX = 80, /* since version 4.2.4 */65 VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX = 80, /* since version 4.2.4 */
66 VMMDEVREQ_GET_DISPLAY_CHANGE_REQ_MULTI = 81,
66 VMMDEVREQ_HGCM_CONNECT = 60,67 VMMDEVREQ_HGCM_CONNECT = 60,
67 VMMDEVREQ_HGCM_DISCONNECT = 61,68 VMMDEVREQ_HGCM_DISCONNECT = 61,
68 VMMDEVREQ_HGCM_CALL32 = 62,69 VMMDEVREQ_HGCM_CALL32 = 62,
...@@ -92,6 +93,8 @@ enum vmmdev_request_type {...@@ -92,6 +93,8 @@ enum vmmdev_request_type {
92 VMMDEVREQ_WRITE_COREDUMP = 218,93 VMMDEVREQ_WRITE_COREDUMP = 218,
93 VMMDEVREQ_GUEST_HEARTBEAT = 219,94 VMMDEVREQ_GUEST_HEARTBEAT = 219,
94 VMMDEVREQ_HEARTBEAT_CONFIGURE = 220,95 VMMDEVREQ_HEARTBEAT_CONFIGURE = 220,
96 VMMDEVREQ_NT_BUG_CHECK = 221,
97 VMMDEVREQ_VIDEO_UPDATE_MONITOR_POSITIONS = 222,
95 /* Ensure the enum is a 32 bit data-type */98 /* Ensure the enum is a 32 bit data-type */
96 VMMDEVREQ_SIZEHACK = 0x7fffffff99 VMMDEVREQ_SIZEHACK = 0x7fffffff
97};100};
...@@ -102,6 +105,66 @@ enum vmmdev_request_type {...@@ -102,6 +105,66 @@ enum vmmdev_request_type {
102#define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL32105#define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL32
103#endif106#endif
104107
108/* vmmdev_request_header.requestor defines */
109
110/* Requestor user not given. */
111#define VMMDEV_REQUESTOR_USR_NOT_GIVEN 0x00000000
112/* The kernel driver (vboxguest) is the requestor. */
113#define VMMDEV_REQUESTOR_USR_DRV 0x00000001
114/* Some other kernel driver is the requestor. */
115#define VMMDEV_REQUESTOR_USR_DRV_OTHER 0x00000002
116/* The root or a admin user is the requestor. */
117#define VMMDEV_REQUESTOR_USR_ROOT 0x00000003
118/* Regular joe user is making the request. */
119#define VMMDEV_REQUESTOR_USR_USER 0x00000006
120/* User classification mask. */
121#define VMMDEV_REQUESTOR_USR_MASK 0x00000007
122
123/* Kernel mode request. Note this is 0, check for !USERMODE instead. */
124#define VMMDEV_REQUESTOR_KERNEL 0x00000000
125/* User mode request. */
126#define VMMDEV_REQUESTOR_USERMODE 0x00000008
127/* User or kernel mode classification mask. */
128#define VMMDEV_REQUESTOR_MODE_MASK 0x00000008
129
130/* Don't know the physical console association of the requestor. */
131#define VMMDEV_REQUESTOR_CON_DONT_KNOW 0x00000000
132/*
133 * The request originates with a process that is NOT associated with the
134 * physical console.
135 */
136#define VMMDEV_REQUESTOR_CON_NO 0x00000010
137/* Requestor process is associated with the physical console. */
138#define VMMDEV_REQUESTOR_CON_YES 0x00000020
139/* Console classification mask. */
140#define VMMDEV_REQUESTOR_CON_MASK 0x00000030
141
142/* Requestor is member of special VirtualBox user group. */
143#define VMMDEV_REQUESTOR_GRP_VBOX 0x00000080
144
145/* Note: trust level is for windows guests only, linux always uses not-given */
146/* Requestor trust level: Unspecified */
147#define VMMDEV_REQUESTOR_TRUST_NOT_GIVEN 0x00000000
148/* Requestor trust level: Untrusted (SID S-1-16-0) */
149#define VMMDEV_REQUESTOR_TRUST_UNTRUSTED 0x00001000
150/* Requestor trust level: Untrusted (SID S-1-16-4096) */
151#define VMMDEV_REQUESTOR_TRUST_LOW 0x00002000
152/* Requestor trust level: Medium (SID S-1-16-8192) */
153#define VMMDEV_REQUESTOR_TRUST_MEDIUM 0x00003000
154/* Requestor trust level: Medium plus (SID S-1-16-8448) */
155#define VMMDEV_REQUESTOR_TRUST_MEDIUM_PLUS 0x00004000
156/* Requestor trust level: High (SID S-1-16-12288) */
157#define VMMDEV_REQUESTOR_TRUST_HIGH 0x00005000
158/* Requestor trust level: System (SID S-1-16-16384) */
159#define VMMDEV_REQUESTOR_TRUST_SYSTEM 0x00006000
160/* Requestor trust level >= Protected (SID S-1-16-20480, S-1-16-28672) */
161#define VMMDEV_REQUESTOR_TRUST_PROTECTED 0x00007000
162/* Requestor trust level mask */
163#define VMMDEV_REQUESTOR_TRUST_MASK 0x00007000
164
165/* Requestor is using the less trusted user device node (/dev/vboxuser) */
166#define VMMDEV_REQUESTOR_USER_DEVICE 0x00008000
167
105/** HGCM service location types. */168/** HGCM service location types. */
106enum vmmdev_hgcm_service_location_type {169enum vmmdev_hgcm_service_location_type {
107 VMMDEV_HGCM_LOC_INVALID = 0,170 VMMDEV_HGCM_LOC_INVALID = 0,
lib/libc/include/any-linux-any/linux/vboxguest.h+27-3
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR CDDL-1.0) */
2/*2/*
3 * VBoxGuest - VirtualBox Guest Additions Driver Interface.3 * VBoxGuest - VirtualBox Guest Additions Driver Interface.
4 *4 *
...@@ -103,7 +103,7 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20);...@@ -103,7 +103,7 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20);
103103
104104
105/* IOCTL to perform a VMM Device request larger then 1KB. */105/* IOCTL to perform a VMM Device request larger then 1KB. */
106#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)106#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IO('V', 3)
107107
108108
109/** VBG_IOCTL_HGCM_CONNECT data structure. */109/** VBG_IOCTL_HGCM_CONNECT data structure. */
...@@ -198,7 +198,7 @@ struct vbg_ioctl_log {...@@ -198,7 +198,7 @@ struct vbg_ioctl_log {
198 } u;198 } u;
199};199};
200200
201#define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)201#define VBG_IOCTL_LOG(s) _IO('V', 9)
202202
203203
204/** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */204/** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */
...@@ -257,6 +257,30 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8);...@@ -257,6 +257,30 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8);
257 _IOWR('V', 12, struct vbg_ioctl_change_filter)257 _IOWR('V', 12, struct vbg_ioctl_change_filter)
258258
259259
260/** VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES data structure. */
261struct vbg_ioctl_acquire_guest_caps {
262 /** The header. */
263 struct vbg_ioctl_hdr hdr;
264 union {
265 struct {
266 /** Flags (VBGL_IOC_AGC_FLAGS_XXX). */
267 __u32 flags;
268 /** Capabilities to set (VMMDEV_GUEST_SUPPORTS_XXX). */
269 __u32 or_mask;
270 /** Capabilities to drop (VMMDEV_GUEST_SUPPORTS_XXX). */
271 __u32 not_mask;
272 } in;
273 } u;
274};
275VMMDEV_ASSERT_SIZE(vbg_ioctl_acquire_guest_caps, 24 + 12);
276
277#define VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE 0x00000001
278#define VBGL_IOC_AGC_FLAGS_VALID_MASK 0x00000001
279
280#define VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES \
281 _IOWR('V', 13, struct vbg_ioctl_acquire_guest_caps)
282
283
260/** VBG_IOCTL_CHANGE_GUEST_CAPABILITIES data structure. */284/** VBG_IOCTL_CHANGE_GUEST_CAPABILITIES data structure. */
261struct vbg_ioctl_set_guest_caps {285struct vbg_ioctl_set_guest_caps {
262 /** The header. */286 /** The header. */
lib/libc/include/any-linux-any/linux/vdpa.h created+47
...@@ -0,0 +1,47 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * vdpa device management interface
4 * Copyright (c) 2020 Mellanox Technologies Ltd. All rights reserved.
5 */
6
7#ifndef _LINUX_VDPA_H_
8#define _LINUX_VDPA_H_
9
10#define VDPA_GENL_NAME "vdpa"
11#define VDPA_GENL_VERSION 0x1
12
13enum vdpa_command {
14 VDPA_CMD_UNSPEC,
15 VDPA_CMD_MGMTDEV_NEW,
16 VDPA_CMD_MGMTDEV_GET, /* can dump */
17 VDPA_CMD_DEV_NEW,
18 VDPA_CMD_DEV_DEL,
19 VDPA_CMD_DEV_GET, /* can dump */
20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */
21};
22
23enum vdpa_attr {
24 VDPA_ATTR_UNSPEC,
25
26 /* bus name (optional) + dev name together make the parent device handle */
27 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
28 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
29 VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES, /* u64 */
30
31 VDPA_ATTR_DEV_NAME, /* string */
32 VDPA_ATTR_DEV_ID, /* u32 */
33 VDPA_ATTR_DEV_VENDOR_ID, /* u32 */
34 VDPA_ATTR_DEV_MAX_VQS, /* u32 */
35 VDPA_ATTR_DEV_MAX_VQ_SIZE, /* u16 */
36 VDPA_ATTR_DEV_MIN_VQ_SIZE, /* u16 */
37
38 VDPA_ATTR_DEV_NET_CFG_MACADDR, /* binary */
39 VDPA_ATTR_DEV_NET_STATUS, /* u8 */
40 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
41 VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */
42
43 /* new attributes must be added above here */
44 VDPA_ATTR_MAX,
45};
46
47#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vduse.h created+306
...@@ -0,0 +1,306 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _VDUSE_H_
3#define _VDUSE_H_
4
5#include <linux/types.h>
6
7#define VDUSE_BASE 0x81
8
9/* The ioctls for control device (/dev/vduse/control) */
10
11#define VDUSE_API_VERSION 0
12
13/*
14 * Get the version of VDUSE API that kernel supported (VDUSE_API_VERSION).
15 * This is used for future extension.
16 */
17#define VDUSE_GET_API_VERSION _IOR(VDUSE_BASE, 0x00, __u64)
18
19/* Set the version of VDUSE API that userspace supported. */
20#define VDUSE_SET_API_VERSION _IOW(VDUSE_BASE, 0x01, __u64)
21
22/**
23 * struct vduse_dev_config - basic configuration of a VDUSE device
24 * @name: VDUSE device name, needs to be NUL terminated
25 * @vendor_id: virtio vendor id
26 * @device_id: virtio device id
27 * @features: virtio features
28 * @vq_num: the number of virtqueues
29 * @vq_align: the allocation alignment of virtqueue's metadata
30 * @reserved: for future use, needs to be initialized to zero
31 * @config_size: the size of the configuration space
32 * @config: the buffer of the configuration space
33 *
34 * Structure used by VDUSE_CREATE_DEV ioctl to create VDUSE device.
35 */
36struct vduse_dev_config {
37#define VDUSE_NAME_MAX 256
38 char name[VDUSE_NAME_MAX];
39 __u32 vendor_id;
40 __u32 device_id;
41 __u64 features;
42 __u32 vq_num;
43 __u32 vq_align;
44 __u32 reserved[13];
45 __u32 config_size;
46 __u8 config[];
47};
48
49/* Create a VDUSE device which is represented by a char device (/dev/vduse/$NAME) */
50#define VDUSE_CREATE_DEV _IOW(VDUSE_BASE, 0x02, struct vduse_dev_config)
51
52/*
53 * Destroy a VDUSE device. Make sure there are no more references
54 * to the char device (/dev/vduse/$NAME).
55 */
56#define VDUSE_DESTROY_DEV _IOW(VDUSE_BASE, 0x03, char[VDUSE_NAME_MAX])
57
58/* The ioctls for VDUSE device (/dev/vduse/$NAME) */
59
60/**
61 * struct vduse_iotlb_entry - entry of IOTLB to describe one IOVA region [start, last]
62 * @offset: the mmap offset on returned file descriptor
63 * @start: start of the IOVA region
64 * @last: last of the IOVA region
65 * @perm: access permission of the IOVA region
66 *
67 * Structure used by VDUSE_IOTLB_GET_FD ioctl to find an overlapped IOVA region.
68 */
69struct vduse_iotlb_entry {
70 __u64 offset;
71 __u64 start;
72 __u64 last;
73#define VDUSE_ACCESS_RO 0x1
74#define VDUSE_ACCESS_WO 0x2
75#define VDUSE_ACCESS_RW 0x3
76 __u8 perm;
77};
78
79/*
80 * Find the first IOVA region that overlaps with the range [start, last]
81 * and return the corresponding file descriptor. Return -EINVAL means the
82 * IOVA region doesn't exist. Caller should set start and last fields.
83 */
84#define VDUSE_IOTLB_GET_FD _IOWR(VDUSE_BASE, 0x10, struct vduse_iotlb_entry)
85
86/*
87 * Get the negotiated virtio features. It's a subset of the features in
88 * struct vduse_dev_config which can be accepted by virtio driver. It's
89 * only valid after FEATURES_OK status bit is set.
90 */
91#define VDUSE_DEV_GET_FEATURES _IOR(VDUSE_BASE, 0x11, __u64)
92
93/**
94 * struct vduse_config_data - data used to update configuration space
95 * @offset: the offset from the beginning of configuration space
96 * @length: the length to write to configuration space
97 * @buffer: the buffer used to write from
98 *
99 * Structure used by VDUSE_DEV_SET_CONFIG ioctl to update device
100 * configuration space.
101 */
102struct vduse_config_data {
103 __u32 offset;
104 __u32 length;
105 __u8 buffer[];
106};
107
108/* Set device configuration space */
109#define VDUSE_DEV_SET_CONFIG _IOW(VDUSE_BASE, 0x12, struct vduse_config_data)
110
111/*
112 * Inject a config interrupt. It's usually used to notify virtio driver
113 * that device configuration space has changed.
114 */
115#define VDUSE_DEV_INJECT_CONFIG_IRQ _IO(VDUSE_BASE, 0x13)
116
117/**
118 * struct vduse_vq_config - basic configuration of a virtqueue
119 * @index: virtqueue index
120 * @max_size: the max size of virtqueue
121 * @reserved: for future use, needs to be initialized to zero
122 *
123 * Structure used by VDUSE_VQ_SETUP ioctl to setup a virtqueue.
124 */
125struct vduse_vq_config {
126 __u32 index;
127 __u16 max_size;
128 __u16 reserved[13];
129};
130
131/*
132 * Setup the specified virtqueue. Make sure all virtqueues have been
133 * configured before the device is attached to vDPA bus.
134 */
135#define VDUSE_VQ_SETUP _IOW(VDUSE_BASE, 0x14, struct vduse_vq_config)
136
137/**
138 * struct vduse_vq_state_split - split virtqueue state
139 * @avail_index: available index
140 */
141struct vduse_vq_state_split {
142 __u16 avail_index;
143};
144
145/**
146 * struct vduse_vq_state_packed - packed virtqueue state
147 * @last_avail_counter: last driver ring wrap counter observed by device
148 * @last_avail_idx: device available index
149 * @last_used_counter: device ring wrap counter
150 * @last_used_idx: used index
151 */
152struct vduse_vq_state_packed {
153 __u16 last_avail_counter;
154 __u16 last_avail_idx;
155 __u16 last_used_counter;
156 __u16 last_used_idx;
157};
158
159/**
160 * struct vduse_vq_info - information of a virtqueue
161 * @index: virtqueue index
162 * @num: the size of virtqueue
163 * @desc_addr: address of desc area
164 * @driver_addr: address of driver area
165 * @device_addr: address of device area
166 * @split: split virtqueue state
167 * @packed: packed virtqueue state
168 * @ready: ready status of virtqueue
169 *
170 * Structure used by VDUSE_VQ_GET_INFO ioctl to get virtqueue's information.
171 */
172struct vduse_vq_info {
173 __u32 index;
174 __u32 num;
175 __u64 desc_addr;
176 __u64 driver_addr;
177 __u64 device_addr;
178 union {
179 struct vduse_vq_state_split split;
180 struct vduse_vq_state_packed packed;
181 };
182 __u8 ready;
183};
184
185/* Get the specified virtqueue's information. Caller should set index field. */
186#define VDUSE_VQ_GET_INFO _IOWR(VDUSE_BASE, 0x15, struct vduse_vq_info)
187
188/**
189 * struct vduse_vq_eventfd - eventfd configuration for a virtqueue
190 * @index: virtqueue index
191 * @fd: eventfd, -1 means de-assigning the eventfd
192 *
193 * Structure used by VDUSE_VQ_SETUP_KICKFD ioctl to setup kick eventfd.
194 */
195struct vduse_vq_eventfd {
196 __u32 index;
197#define VDUSE_EVENTFD_DEASSIGN -1
198 int fd;
199};
200
201/*
202 * Setup kick eventfd for specified virtqueue. The kick eventfd is used
203 * by VDUSE kernel module to notify userspace to consume the avail vring.
204 */
205#define VDUSE_VQ_SETUP_KICKFD _IOW(VDUSE_BASE, 0x16, struct vduse_vq_eventfd)
206
207/*
208 * Inject an interrupt for specific virtqueue. It's used to notify virtio driver
209 * to consume the used vring.
210 */
211#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)
212
213/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
214
215/**
216 * enum vduse_req_type - request type
217 * @VDUSE_GET_VQ_STATE: get the state for specified virtqueue from userspace
218 * @VDUSE_SET_STATUS: set the device status
219 * @VDUSE_UPDATE_IOTLB: Notify userspace to update the memory mapping for
220 * specified IOVA range via VDUSE_IOTLB_GET_FD ioctl
221 */
222enum vduse_req_type {
223 VDUSE_GET_VQ_STATE,
224 VDUSE_SET_STATUS,
225 VDUSE_UPDATE_IOTLB,
226};
227
228/**
229 * struct vduse_vq_state - virtqueue state
230 * @index: virtqueue index
231 * @split: split virtqueue state
232 * @packed: packed virtqueue state
233 */
234struct vduse_vq_state {
235 __u32 index;
236 union {
237 struct vduse_vq_state_split split;
238 struct vduse_vq_state_packed packed;
239 };
240};
241
242/**
243 * struct vduse_dev_status - device status
244 * @status: device status
245 */
246struct vduse_dev_status {
247 __u8 status;
248};
249
250/**
251 * struct vduse_iova_range - IOVA range [start, last]
252 * @start: start of the IOVA range
253 * @last: last of the IOVA range
254 */
255struct vduse_iova_range {
256 __u64 start;
257 __u64 last;
258};
259
260/**
261 * struct vduse_dev_request - control request
262 * @type: request type
263 * @request_id: request id
264 * @reserved: for future use
265 * @vq_state: virtqueue state, only index field is available
266 * @s: device status
267 * @iova: IOVA range for updating
268 * @padding: padding
269 *
270 * Structure used by read(2) on /dev/vduse/$NAME.
271 */
272struct vduse_dev_request {
273 __u32 type;
274 __u32 request_id;
275 __u32 reserved[4];
276 union {
277 struct vduse_vq_state vq_state;
278 struct vduse_dev_status s;
279 struct vduse_iova_range iova;
280 __u32 padding[32];
281 };
282};
283
284/**
285 * struct vduse_dev_response - response to control request
286 * @request_id: corresponding request id
287 * @result: the result of request
288 * @reserved: for future use, needs to be initialized to zero
289 * @vq_state: virtqueue state
290 * @padding: padding
291 *
292 * Structure used by write(2) on /dev/vduse/$NAME.
293 */
294struct vduse_dev_response {
295 __u32 request_id;
296#define VDUSE_REQ_RESULT_OK 0x00
297#define VDUSE_REQ_RESULT_FAILED 0x01
298 __u32 result;
299 __u32 reserved[4];
300 union {
301 struct vduse_vq_state vq_state;
302 __u32 padding[32];
303 };
304};
305
306#endif /* _VDUSE_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/version.h+5-2
...@@ -1,2 +1,5 @@...@@ -1,2 +1,5 @@
1#define LINUX_VERSION_CODE 267034
2#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
\ No newline at end of file
1#define LINUX_VERSION_CODE 331776
2#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
3#define LINUX_VERSION_MAJOR 5
4#define LINUX_VERSION_PATCHLEVEL 16
5#define LINUX_VERSION_SUBLEVEL 0
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+553-2
...@@ -46,6 +46,12 @@...@@ -46,6 +46,12 @@
46 */46 */
47#define VFIO_NOIOMMU_IOMMU 847#define VFIO_NOIOMMU_IOMMU 8
4848
49/* Supports VFIO_DMA_UNMAP_FLAG_ALL */
50#define VFIO_UNMAP_ALL 9
51
52/* Supports the vaddr flag for DMA map and unmap */
53#define VFIO_UPDATE_VADDR 10
54
49/*55/*
50 * The IOCTL interface is designed for extensibility by embedding the56 * The IOCTL interface is designed for extensibility by embedding the
51 * structure length (argsz) and flags into structures passed between57 * structure length (argsz) and flags into structures passed between
...@@ -200,8 +206,12 @@ struct vfio_device_info {...@@ -200,8 +206,12 @@ struct vfio_device_info {
200#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */206#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */
201#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */207#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */
202#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */208#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */
209#define VFIO_DEVICE_FLAGS_AP (1 << 5) /* vfio-ap device */
210#define VFIO_DEVICE_FLAGS_FSL_MC (1 << 6) /* vfio-fsl-mc device */
211#define VFIO_DEVICE_FLAGS_CAPS (1 << 7) /* Info supports caps */
203 __u32 num_regions; /* Max region index + 1 */212 __u32 num_regions; /* Max region index + 1 */
204 __u32 num_irqs; /* Max IRQ index + 1 */213 __u32 num_irqs; /* Max IRQ index + 1 */
214 __u32 cap_offset; /* Offset within info struct of first cap */
205};215};
206#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)216#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
207217
...@@ -215,6 +225,16 @@ struct vfio_device_info {...@@ -215,6 +225,16 @@ struct vfio_device_info {
215#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"225#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
216#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"226#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
217#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"227#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"
228#define VFIO_DEVICE_API_AP_STRING "vfio-ap"
229
230/*
231 * The following capabilities are unique to s390 zPCI devices. Their contents
232 * are further-defined in vfio_zdev.h
233 */
234#define VFIO_DEVICE_INFO_CAP_ZPCI_BASE 1
235#define VFIO_DEVICE_INFO_CAP_ZPCI_GROUP 2
236#define VFIO_DEVICE_INFO_CAP_ZPCI_UTIL 3
237#define VFIO_DEVICE_INFO_CAP_ZPCI_PFIP 4
218238
219/**239/**
220 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,240 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
...@@ -293,14 +313,324 @@ struct vfio_region_info_cap_type {...@@ -293,14 +313,324 @@ struct vfio_region_info_cap_type {
293 __u32 subtype; /* type specific */313 __u32 subtype; /* type specific */
294};314};
295315
316/*
317 * List of region types, global per bus driver.
318 * If you introduce a new type, please add it here.
319 */
320
321/* PCI region type containing a PCI vendor part */
296#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)322#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
297#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)323#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
324#define VFIO_REGION_TYPE_GFX (1)
325#define VFIO_REGION_TYPE_CCW (2)
326#define VFIO_REGION_TYPE_MIGRATION (3)
327
328/* sub-types for VFIO_REGION_TYPE_PCI_* */
298329
299/* 8086 Vendor sub-types */330/* 8086 vendor PCI sub-types */
300#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)331#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
301#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)332#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
302#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)333#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
303334
335/* 10de vendor PCI sub-types */
336/*
337 * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space.
338 *
339 * Deprecated, region no longer provided
340 */
341#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
342
343/* 1014 vendor PCI sub-types */
344/*
345 * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU
346 * to do TLB invalidation on a GPU.
347 *
348 * Deprecated, region no longer provided
349 */
350#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
351
352/* sub-types for VFIO_REGION_TYPE_GFX */
353#define VFIO_REGION_SUBTYPE_GFX_EDID (1)
354
355/**
356 * struct vfio_region_gfx_edid - EDID region layout.
357 *
358 * Set display link state and EDID blob.
359 *
360 * The EDID blob has monitor information such as brand, name, serial
361 * number, physical size, supported video modes and more.
362 *
363 * This special region allows userspace (typically qemu) set a virtual
364 * EDID for the virtual monitor, which allows a flexible display
365 * configuration.
366 *
367 * For the edid blob spec look here:
368 * https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
369 *
370 * On linux systems you can find the EDID blob in sysfs:
371 * /sys/class/drm/${card}/${connector}/edid
372 *
373 * You can use the edid-decode ulility (comes with xorg-x11-utils) to
374 * decode the EDID blob.
375 *
376 * @edid_offset: location of the edid blob, relative to the
377 * start of the region (readonly).
378 * @edid_max_size: max size of the edid blob (readonly).
379 * @edid_size: actual edid size (read/write).
380 * @link_state: display link state (read/write).
381 * VFIO_DEVICE_GFX_LINK_STATE_UP: Monitor is turned on.
382 * VFIO_DEVICE_GFX_LINK_STATE_DOWN: Monitor is turned off.
383 * @max_xres: max display width (0 == no limitation, readonly).
384 * @max_yres: max display height (0 == no limitation, readonly).
385 *
386 * EDID update protocol:
387 * (1) set link-state to down.
388 * (2) update edid blob and size.
389 * (3) set link-state to up.
390 */
391struct vfio_region_gfx_edid {
392 __u32 edid_offset;
393 __u32 edid_max_size;
394 __u32 edid_size;
395 __u32 max_xres;
396 __u32 max_yres;
397 __u32 link_state;
398#define VFIO_DEVICE_GFX_LINK_STATE_UP 1
399#define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2
400};
401
402/* sub-types for VFIO_REGION_TYPE_CCW */
403#define VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD (1)
404#define VFIO_REGION_SUBTYPE_CCW_SCHIB (2)
405#define VFIO_REGION_SUBTYPE_CCW_CRW (3)
406
407/* sub-types for VFIO_REGION_TYPE_MIGRATION */
408#define VFIO_REGION_SUBTYPE_MIGRATION (1)
409
410/*
411 * The structure vfio_device_migration_info is placed at the 0th offset of
412 * the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related
413 * migration information. Field accesses from this structure are only supported
414 * at their native width and alignment. Otherwise, the result is undefined and
415 * vendor drivers should return an error.
416 *
417 * device_state: (read/write)
418 * - The user application writes to this field to inform the vendor driver
419 * about the device state to be transitioned to.
420 * - The vendor driver should take the necessary actions to change the
421 * device state. After successful transition to a given state, the
422 * vendor driver should return success on write(device_state, state)
423 * system call. If the device state transition fails, the vendor driver
424 * should return an appropriate -errno for the fault condition.
425 * - On the user application side, if the device state transition fails,
426 * that is, if write(device_state, state) returns an error, read
427 * device_state again to determine the current state of the device from
428 * the vendor driver.
429 * - The vendor driver should return previous state of the device unless
430 * the vendor driver has encountered an internal error, in which case
431 * the vendor driver may report the device_state VFIO_DEVICE_STATE_ERROR.
432 * - The user application must use the device reset ioctl to recover the
433 * device from VFIO_DEVICE_STATE_ERROR state. If the device is
434 * indicated to be in a valid device state by reading device_state, the
435 * user application may attempt to transition the device to any valid
436 * state reachable from the current state or terminate itself.
437 *
438 * device_state consists of 3 bits:
439 * - If bit 0 is set, it indicates the _RUNNING state. If bit 0 is clear,
440 * it indicates the _STOP state. When the device state is changed to
441 * _STOP, driver should stop the device before write() returns.
442 * - If bit 1 is set, it indicates the _SAVING state, which means that the
443 * driver should start gathering device state information that will be
444 * provided to the VFIO user application to save the device's state.
445 * - If bit 2 is set, it indicates the _RESUMING state, which means that
446 * the driver should prepare to resume the device. Data provided through
447 * the migration region should be used to resume the device.
448 * Bits 3 - 31 are reserved for future use. To preserve them, the user
449 * application should perform a read-modify-write operation on this
450 * field when modifying the specified bits.
451 *
452 * +------- _RESUMING
453 * |+------ _SAVING
454 * ||+----- _RUNNING
455 * |||
456 * 000b => Device Stopped, not saving or resuming
457 * 001b => Device running, which is the default state
458 * 010b => Stop the device & save the device state, stop-and-copy state
459 * 011b => Device running and save the device state, pre-copy state
460 * 100b => Device stopped and the device state is resuming
461 * 101b => Invalid state
462 * 110b => Error state
463 * 111b => Invalid state
464 *
465 * State transitions:
466 *
467 * _RESUMING _RUNNING Pre-copy Stop-and-copy _STOP
468 * (100b) (001b) (011b) (010b) (000b)
469 * 0. Running or default state
470 * |
471 *
472 * 1. Normal Shutdown (optional)
473 * |------------------------------------->|
474 *
475 * 2. Save the state or suspend
476 * |------------------------->|---------->|
477 *
478 * 3. Save the state during live migration
479 * |----------->|------------>|---------->|
480 *
481 * 4. Resuming
482 * |<---------|
483 *
484 * 5. Resumed
485 * |--------->|
486 *
487 * 0. Default state of VFIO device is _RUNNING when the user application starts.
488 * 1. During normal shutdown of the user application, the user application may
489 * optionally change the VFIO device state from _RUNNING to _STOP. This
490 * transition is optional. The vendor driver must support this transition but
491 * must not require it.
492 * 2. When the user application saves state or suspends the application, the
493 * device state transitions from _RUNNING to stop-and-copy and then to _STOP.
494 * On state transition from _RUNNING to stop-and-copy, driver must stop the
495 * device, save the device state and send it to the application through the
496 * migration region. The sequence to be followed for such transition is given
497 * below.
498 * 3. In live migration of user application, the state transitions from _RUNNING
499 * to pre-copy, to stop-and-copy, and to _STOP.
500 * On state transition from _RUNNING to pre-copy, the driver should start
501 * gathering the device state while the application is still running and send
502 * the device state data to application through the migration region.
503 * On state transition from pre-copy to stop-and-copy, the driver must stop
504 * the device, save the device state and send it to the user application
505 * through the migration region.
506 * Vendor drivers must support the pre-copy state even for implementations
507 * where no data is provided to the user before the stop-and-copy state. The
508 * user must not be required to consume all migration data before the device
509 * transitions to a new state, including the stop-and-copy state.
510 * The sequence to be followed for above two transitions is given below.
511 * 4. To start the resuming phase, the device state should be transitioned from
512 * the _RUNNING to the _RESUMING state.
513 * In the _RESUMING state, the driver should use the device state data
514 * received through the migration region to resume the device.
515 * 5. After providing saved device data to the driver, the application should
516 * change the state from _RESUMING to _RUNNING.
517 *
518 * reserved:
519 * Reads on this field return zero and writes are ignored.
520 *
521 * pending_bytes: (read only)
522 * The number of pending bytes still to be migrated from the vendor driver.
523 *
524 * data_offset: (read only)
525 * The user application should read data_offset field from the migration
526 * region. The user application should read the device data from this
527 * offset within the migration region during the _SAVING state or write
528 * the device data during the _RESUMING state. See below for details of
529 * sequence to be followed.
530 *
531 * data_size: (read/write)
532 * The user application should read data_size to get the size in bytes of
533 * the data copied in the migration region during the _SAVING state and
534 * write the size in bytes of the data copied in the migration region
535 * during the _RESUMING state.
536 *
537 * The format of the migration region is as follows:
538 * ------------------------------------------------------------------
539 * |vfio_device_migration_info| data section |
540 * | | /////////////////////////////// |
541 * ------------------------------------------------------------------
542 * ^ ^
543 * offset 0-trapped part data_offset
544 *
545 * The structure vfio_device_migration_info is always followed by the data
546 * section in the region, so data_offset will always be nonzero. The offset
547 * from where the data is copied is decided by the kernel driver. The data
548 * section can be trapped, mmapped, or partitioned, depending on how the kernel
549 * driver defines the data section. The data section partition can be defined
550 * as mapped by the sparse mmap capability. If mmapped, data_offset must be
551 * page aligned, whereas initial section which contains the
552 * vfio_device_migration_info structure, might not end at the offset, which is
553 * page aligned. The user is not required to access through mmap regardless
554 * of the capabilities of the region mmap.
555 * The vendor driver should determine whether and how to partition the data
556 * section. The vendor driver should return data_offset accordingly.
557 *
558 * The sequence to be followed while in pre-copy state and stop-and-copy state
559 * is as follows:
560 * a. Read pending_bytes, indicating the start of a new iteration to get device
561 * data. Repeated read on pending_bytes at this stage should have no side
562 * effects.
563 * If pending_bytes == 0, the user application should not iterate to get data
564 * for that device.
565 * If pending_bytes > 0, perform the following steps.
566 * b. Read data_offset, indicating that the vendor driver should make data
567 * available through the data section. The vendor driver should return this
568 * read operation only after data is available from (region + data_offset)
569 * to (region + data_offset + data_size).
570 * c. Read data_size, which is the amount of data in bytes available through
571 * the migration region.
572 * Read on data_offset and data_size should return the offset and size of
573 * the current buffer if the user application reads data_offset and
574 * data_size more than once here.
575 * d. Read data_size bytes of data from (region + data_offset) from the
576 * migration region.
577 * e. Process the data.
578 * f. Read pending_bytes, which indicates that the data from the previous
579 * iteration has been read. If pending_bytes > 0, go to step b.
580 *
581 * The user application can transition from the _SAVING|_RUNNING
582 * (pre-copy state) to the _SAVING (stop-and-copy) state regardless of the
583 * number of pending bytes. The user application should iterate in _SAVING
584 * (stop-and-copy) until pending_bytes is 0.
585 *
586 * The sequence to be followed while _RESUMING device state is as follows:
587 * While data for this device is available, repeat the following steps:
588 * a. Read data_offset from where the user application should write data.
589 * b. Write migration data starting at the migration region + data_offset for
590 * the length determined by data_size from the migration source.
591 * c. Write data_size, which indicates to the vendor driver that data is
592 * written in the migration region. Vendor driver must return this write
593 * operations on consuming data. Vendor driver should apply the
594 * user-provided migration region data to the device resume state.
595 *
596 * If an error occurs during the above sequences, the vendor driver can return
597 * an error code for next read() or write() operation, which will terminate the
598 * loop. The user application should then take the next necessary action, for
599 * example, failing migration or terminating the user application.
600 *
601 * For the user application, data is opaque. The user application should write
602 * data in the same order as the data is received and the data should be of
603 * same transaction size at the source.
604 */
605
606struct vfio_device_migration_info {
607 __u32 device_state; /* VFIO device state */
608#define VFIO_DEVICE_STATE_STOP (0)
609#define VFIO_DEVICE_STATE_RUNNING (1 << 0)
610#define VFIO_DEVICE_STATE_SAVING (1 << 1)
611#define VFIO_DEVICE_STATE_RESUMING (1 << 2)
612#define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_RUNNING | \
613 VFIO_DEVICE_STATE_SAVING | \
614 VFIO_DEVICE_STATE_RESUMING)
615
616#define VFIO_DEVICE_STATE_VALID(state) \
617 (state & VFIO_DEVICE_STATE_RESUMING ? \
618 (state & VFIO_DEVICE_STATE_MASK) == VFIO_DEVICE_STATE_RESUMING : 1)
619
620#define VFIO_DEVICE_STATE_IS_ERROR(state) \
621 ((state & VFIO_DEVICE_STATE_MASK) == (VFIO_DEVICE_STATE_SAVING | \
622 VFIO_DEVICE_STATE_RESUMING))
623
624#define VFIO_DEVICE_STATE_SET_ERROR(state) \
625 ((state & ~VFIO_DEVICE_STATE_MASK) | VFIO_DEVICE_SATE_SAVING | \
626 VFIO_DEVICE_STATE_RESUMING)
627
628 __u32 reserved;
629 __u64 pending_bytes;
630 __u64 data_offset;
631 __u64 data_size;
632};
633
304/*634/*
305 * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped635 * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
306 * which allows direct access to non-MSIX registers which happened to be within636 * which allows direct access to non-MSIX registers which happened to be within
...@@ -311,6 +641,37 @@ struct vfio_region_info_cap_type {...@@ -311,6 +641,37 @@ struct vfio_region_info_cap_type {
311 */641 */
312#define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3642#define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3
313643
644/*
645 * Capability with compressed real address (aka SSA - small system address)
646 * where GPU RAM is mapped on a system bus. Used by a GPU for DMA routing
647 * and by the userspace to associate a NVLink bridge with a GPU.
648 *
649 * Deprecated, capability no longer provided
650 */
651#define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4
652
653struct vfio_region_info_cap_nvlink2_ssatgt {
654 struct vfio_info_cap_header header;
655 __u64 tgt;
656};
657
658/*
659 * Capability with an NVLink link speed. The value is read by
660 * the NVlink2 bridge driver from the bridge's "ibm,nvlink-speed"
661 * property in the device tree. The value is fixed in the hardware
662 * and failing to provide the correct value results in the link
663 * not working with no indication from the driver why.
664 *
665 * Deprecated, capability no longer provided
666 */
667#define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5
668
669struct vfio_region_info_cap_nvlink2_lnkspd {
670 struct vfio_info_cap_header header;
671 __u32 link_speed;
672 __u32 __pad;
673};
674
314/**675/**
315 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,676 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
316 * struct vfio_irq_info)677 * struct vfio_irq_info)
...@@ -472,6 +833,8 @@ enum {...@@ -472,6 +833,8 @@ enum {
472833
473enum {834enum {
474 VFIO_CCW_IO_IRQ_INDEX,835 VFIO_CCW_IO_IRQ_INDEX,
836 VFIO_CCW_CRW_IRQ_INDEX,
837 VFIO_CCW_REQ_IRQ_INDEX,
475 VFIO_CCW_NUM_IRQS838 VFIO_CCW_NUM_IRQS
476};839};
477840
...@@ -602,6 +965,43 @@ struct vfio_device_ioeventfd {...@@ -602,6 +965,43 @@ struct vfio_device_ioeventfd {
602965
603#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)966#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
604967
968/**
969 * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,
970 * struct vfio_device_feature)
971 *
972 * Get, set, or probe feature data of the device. The feature is selected
973 * using the FEATURE_MASK portion of the flags field. Support for a feature
974 * can be probed by setting both the FEATURE_MASK and PROBE bits. A probe
975 * may optionally include the GET and/or SET bits to determine read vs write
976 * access of the feature respectively. Probing a feature will return success
977 * if the feature is supported and all of the optionally indicated GET/SET
978 * methods are supported. The format of the data portion of the structure is
979 * specific to the given feature. The data portion is not required for
980 * probing. GET and SET are mutually exclusive, except for use with PROBE.
981 *
982 * Return 0 on success, -errno on failure.
983 */
984struct vfio_device_feature {
985 __u32 argsz;
986 __u32 flags;
987#define VFIO_DEVICE_FEATURE_MASK (0xffff) /* 16-bit feature index */
988#define VFIO_DEVICE_FEATURE_GET (1 << 16) /* Get feature into data[] */
989#define VFIO_DEVICE_FEATURE_SET (1 << 17) /* Set feature from data[] */
990#define VFIO_DEVICE_FEATURE_PROBE (1 << 18) /* Probe feature support */
991 __u8 data[];
992};
993
994#define VFIO_DEVICE_FEATURE _IO(VFIO_TYPE, VFIO_BASE + 17)
995
996/*
997 * Provide support for setting a PCI VF Token, which is used as a shared
998 * secret between PF and VF drivers. This feature may only be set on a
999 * PCI SR-IOV PF when SR-IOV is enabled on the PF and there are no existing
1000 * open VFs. Data provided when setting this feature is a 16-byte array
1001 * (__u8 b[16]), representing a UUID.
1002 */
1003#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN (0)
1004
605/* -------- API for Type1 VFIO IOMMU -------- */1005/* -------- API for Type1 VFIO IOMMU -------- */
6061006
607/**1007/**
...@@ -616,7 +1016,69 @@ struct vfio_iommu_type1_info {...@@ -616,7 +1016,69 @@ struct vfio_iommu_type1_info {
616 __u32 argsz;1016 __u32 argsz;
617 __u32 flags;1017 __u32 flags;
618#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */1018#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
619 __u64 iova_pgsizes; /* Bitmap of supported page sizes */1019#define VFIO_IOMMU_INFO_CAPS (1 << 1) /* Info supports caps */
1020 __u64 iova_pgsizes; /* Bitmap of supported page sizes */
1021 __u32 cap_offset; /* Offset within info struct of first cap */
1022};
1023
1024/*
1025 * The IOVA capability allows to report the valid IOVA range(s)
1026 * excluding any non-relaxable reserved regions exposed by
1027 * devices attached to the container. Any DMA map attempt
1028 * outside the valid iova range will return error.
1029 *
1030 * The structures below define version 1 of this capability.
1031 */
1032#define VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE 1
1033
1034struct vfio_iova_range {
1035 __u64 start;
1036 __u64 end;
1037};
1038
1039struct vfio_iommu_type1_info_cap_iova_range {
1040 struct vfio_info_cap_header header;
1041 __u32 nr_iovas;
1042 __u32 reserved;
1043 struct vfio_iova_range iova_ranges[];
1044};
1045
1046/*
1047 * The migration capability allows to report supported features for migration.
1048 *
1049 * The structures below define version 1 of this capability.
1050 *
1051 * The existence of this capability indicates that IOMMU kernel driver supports
1052 * dirty page logging.
1053 *
1054 * pgsize_bitmap: Kernel driver returns bitmap of supported page sizes for dirty
1055 * page logging.
1056 * max_dirty_bitmap_size: Kernel driver returns maximum supported dirty bitmap
1057 * size in bytes that can be used by user applications when getting the dirty
1058 * bitmap.
1059 */
1060#define VFIO_IOMMU_TYPE1_INFO_CAP_MIGRATION 2
1061
1062struct vfio_iommu_type1_info_cap_migration {
1063 struct vfio_info_cap_header header;
1064 __u32 flags;
1065 __u64 pgsize_bitmap;
1066 __u64 max_dirty_bitmap_size; /* in bytes */
1067};
1068
1069/*
1070 * The DMA available capability allows to report the current number of
1071 * simultaneously outstanding DMA mappings that are allowed.
1072 *
1073 * The structure below defines version 1 of this capability.
1074 *
1075 * avail: specifies the current number of outstanding DMA mappings allowed.
1076 */
1077#define VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL 3
1078
1079struct vfio_iommu_type1_info_dma_avail {
1080 struct vfio_info_cap_header header;
1081 __u32 avail;
620};1082};
6211083
622#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)1084#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
...@@ -626,12 +1088,22 @@ struct vfio_iommu_type1_info {...@@ -626,12 +1088,22 @@ struct vfio_iommu_type1_info {
626 *1088 *
627 * Map process virtual addresses to IO virtual addresses using the1089 * Map process virtual addresses to IO virtual addresses using the
628 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.1090 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
1091 *
1092 * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova, and
1093 * unblock translation of host virtual addresses in the iova range. The vaddr
1094 * must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To
1095 * maintain memory consistency within the user application, the updated vaddr
1096 * must address the same memory object as originally mapped. Failure to do so
1097 * will result in user memory corruption and/or device misbehavior. iova and
1098 * size must match those in the original MAP_DMA call. Protection is not
1099 * changed, and the READ & WRITE flags must be 0.
629 */1100 */
630struct vfio_iommu_type1_dma_map {1101struct vfio_iommu_type1_dma_map {
631 __u32 argsz;1102 __u32 argsz;
632 __u32 flags;1103 __u32 flags;
633#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */1104#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
634#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */1105#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
1106#define VFIO_DMA_MAP_FLAG_VADDR (1 << 2)
635 __u64 vaddr; /* Process virtual address */1107 __u64 vaddr; /* Process virtual address */
636 __u64 iova; /* IO virtual address */1108 __u64 iova; /* IO virtual address */
637 __u64 size; /* Size of mapping (bytes) */1109 __u64 size; /* Size of mapping (bytes) */
...@@ -639,6 +1111,12 @@ struct vfio_iommu_type1_dma_map {...@@ -639,6 +1111,12 @@ struct vfio_iommu_type1_dma_map {
6391111
640#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)1112#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
6411113
1114struct vfio_bitmap {
1115 __u64 pgsize; /* page size for bitmap in bytes */
1116 __u64 size; /* in bytes */
1117 __u64 *data; /* one bit per page */
1118};
1119
642/**1120/**
643 * VFIO_IOMMU_UNMAP_DMA - _IOWR(VFIO_TYPE, VFIO_BASE + 14,1121 * VFIO_IOMMU_UNMAP_DMA - _IOWR(VFIO_TYPE, VFIO_BASE + 14,
644 * struct vfio_dma_unmap)1122 * struct vfio_dma_unmap)
...@@ -648,12 +1126,34 @@ struct vfio_iommu_type1_dma_map {...@@ -648,12 +1126,34 @@ struct vfio_iommu_type1_dma_map {
648 * field. No guarantee is made to the user that arbitrary unmaps of iova1126 * field. No guarantee is made to the user that arbitrary unmaps of iova
649 * or size different from those used in the original mapping call will1127 * or size different from those used in the original mapping call will
650 * succeed.1128 * succeed.
1129 *
1130 * VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP should be set to get the dirty bitmap
1131 * before unmapping IO virtual addresses. When this flag is set, the user must
1132 * provide a struct vfio_bitmap in data[]. User must provide zero-allocated
1133 * memory via vfio_bitmap.data and its size in the vfio_bitmap.size field.
1134 * A bit in the bitmap represents one page, of user provided page size in
1135 * vfio_bitmap.pgsize field, consecutively starting from iova offset. Bit set
1136 * indicates that the page at that offset from iova is dirty. A Bitmap of the
1137 * pages in the range of unmapped size is returned in the user-provided
1138 * vfio_bitmap.data.
1139 *
1140 * If flags & VFIO_DMA_UNMAP_FLAG_ALL, unmap all addresses. iova and size
1141 * must be 0. This cannot be combined with the get-dirty-bitmap flag.
1142 *
1143 * If flags & VFIO_DMA_UNMAP_FLAG_VADDR, do not unmap, but invalidate host
1144 * virtual addresses in the iova range. Tasks that attempt to translate an
1145 * iova's vaddr will block. DMA to already-mapped pages continues. This
1146 * cannot be combined with the get-dirty-bitmap flag.
651 */1147 */
652struct vfio_iommu_type1_dma_unmap {1148struct vfio_iommu_type1_dma_unmap {
653 __u32 argsz;1149 __u32 argsz;
654 __u32 flags;1150 __u32 flags;
1151#define VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP (1 << 0)
1152#define VFIO_DMA_UNMAP_FLAG_ALL (1 << 1)
1153#define VFIO_DMA_UNMAP_FLAG_VADDR (1 << 2)
655 __u64 iova; /* IO virtual address */1154 __u64 iova; /* IO virtual address */
656 __u64 size; /* Size of mapping (bytes) */1155 __u64 size; /* Size of mapping (bytes) */
1156 __u8 data[];
657};1157};
6581158
659#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)1159#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
...@@ -665,6 +1165,57 @@ struct vfio_iommu_type1_dma_unmap {...@@ -665,6 +1165,57 @@ struct vfio_iommu_type1_dma_unmap {
665#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)1165#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
666#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)1166#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
6671167
1168/**
1169 * VFIO_IOMMU_DIRTY_PAGES - _IOWR(VFIO_TYPE, VFIO_BASE + 17,
1170 * struct vfio_iommu_type1_dirty_bitmap)
1171 * IOCTL is used for dirty pages logging.
1172 * Caller should set flag depending on which operation to perform, details as
1173 * below:
1174 *
1175 * Calling the IOCTL with VFIO_IOMMU_DIRTY_PAGES_FLAG_START flag set, instructs
1176 * the IOMMU driver to log pages that are dirtied or potentially dirtied by
1177 * the device; designed to be used when a migration is in progress. Dirty pages
1178 * are logged until logging is disabled by user application by calling the IOCTL
1179 * with VFIO_IOMMU_DIRTY_PAGES_FLAG_STOP flag.
1180 *
1181 * Calling the IOCTL with VFIO_IOMMU_DIRTY_PAGES_FLAG_STOP flag set, instructs
1182 * the IOMMU driver to stop logging dirtied pages.
1183 *
1184 * Calling the IOCTL with VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP flag set
1185 * returns the dirty pages bitmap for IOMMU container for a given IOVA range.
1186 * The user must specify the IOVA range and the pgsize through the structure
1187 * vfio_iommu_type1_dirty_bitmap_get in the data[] portion. This interface
1188 * supports getting a bitmap of the smallest supported pgsize only and can be
1189 * modified in future to get a bitmap of any specified supported pgsize. The
1190 * user must provide a zeroed memory area for the bitmap memory and specify its
1191 * size in bitmap.size. One bit is used to represent one page consecutively
1192 * starting from iova offset. The user should provide page size in bitmap.pgsize
1193 * field. A bit set in the bitmap indicates that the page at that offset from
1194 * iova is dirty. The caller must set argsz to a value including the size of
1195 * structure vfio_iommu_type1_dirty_bitmap_get, but excluding the size of the
1196 * actual bitmap. If dirty pages logging is not enabled, an error will be
1197 * returned.
1198 *
1199 * Only one of the flags _START, _STOP and _GET may be specified at a time.
1200 *
1201 */
1202struct vfio_iommu_type1_dirty_bitmap {
1203 __u32 argsz;
1204 __u32 flags;
1205#define VFIO_IOMMU_DIRTY_PAGES_FLAG_START (1 << 0)
1206#define VFIO_IOMMU_DIRTY_PAGES_FLAG_STOP (1 << 1)
1207#define VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP (1 << 2)
1208 __u8 data[];
1209};
1210
1211struct vfio_iommu_type1_dirty_bitmap_get {
1212 __u64 iova; /* IO virtual address */
1213 __u64 size; /* Size of iova range */
1214 struct vfio_bitmap bitmap;
1215};
1216
1217#define VFIO_IOMMU_DIRTY_PAGES _IO(VFIO_TYPE, VFIO_BASE + 17)
1218
668/* -------- Additional API for SPAPR TCE (Server POWERPC) IOMMU -------- */1219/* -------- Additional API for SPAPR TCE (Server POWERPC) IOMMU -------- */
6691220
670/*1221/*
lib/libc/include/any-linux-any/linux/vfio_ccw.h+31
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
1212
13#include <linux/types.h>13#include <linux/types.h>
1414
15/* used for START SUBCHANNEL, always present */
15struct ccw_io_region {16struct ccw_io_region {
16#define ORB_AREA_SIZE 1217#define ORB_AREA_SIZE 12
17 __u8 orb_area[ORB_AREA_SIZE];18 __u8 orb_area[ORB_AREA_SIZE];
...@@ -22,4 +23,34 @@ struct ccw_io_region {...@@ -22,4 +23,34 @@ struct ccw_io_region {
22 __u32 ret_code;23 __u32 ret_code;
23} __attribute__((packed));24} __attribute__((packed));
2425
26/*
27 * used for processing commands that trigger asynchronous actions
28 * Note: this is controlled by a capability
29 */
30#define VFIO_CCW_ASYNC_CMD_HSCH (1 << 0)
31#define VFIO_CCW_ASYNC_CMD_CSCH (1 << 1)
32struct ccw_cmd_region {
33 __u32 command;
34 __u32 ret_code;
35} __attribute__((packed));
36
37/*
38 * Used for processing commands that read the subchannel-information block
39 * Reading this region triggers a stsch() to hardware
40 * Note: this is controlled by a capability
41 */
42struct ccw_schib_region {
43#define SCHIB_AREA_SIZE 52
44 __u8 schib_area[SCHIB_AREA_SIZE];
45} __attribute__((packed));
46
47/*
48 * Used for returning a Channel Report Word to userspace.
49 * Note: this is controlled by a capability
50 */
51struct ccw_crw_region {
52 __u32 crw;
53 __u32 pad;
54} __attribute__((packed));
55
25#endif56#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio_zdev.h created+78
...@@ -0,0 +1,78 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * VFIO Region definitions for ZPCI devices
4 *
5 * Copyright IBM Corp. 2020
6 *
7 * Author(s): Pierre Morel <pmorel@linux.ibm.com>
8 * Matthew Rosato <mjrosato@linux.ibm.com>
9 */
10
11#ifndef _VFIO_ZDEV_H_
12#define _VFIO_ZDEV_H_
13
14#include <linux/types.h>
15#include <linux/vfio.h>
16
17/**
18 * VFIO_DEVICE_INFO_CAP_ZPCI_BASE - Base PCI Function information
19 *
20 * This capability provides a set of descriptive information about the
21 * associated PCI function.
22 */
23struct vfio_device_info_cap_zpci_base {
24 struct vfio_info_cap_header header;
25 __u64 start_dma; /* Start of available DMA addresses */
26 __u64 end_dma; /* End of available DMA addresses */
27 __u16 pchid; /* Physical Channel ID */
28 __u16 vfn; /* Virtual function number */
29 __u16 fmb_length; /* Measurement Block Length (in bytes) */
30 __u8 pft; /* PCI Function Type */
31 __u8 gid; /* PCI function group ID */
32};
33
34/**
35 * VFIO_DEVICE_INFO_CAP_ZPCI_GROUP - Base PCI Function Group information
36 *
37 * This capability provides a set of descriptive information about the group of
38 * PCI functions that the associated device belongs to.
39 */
40struct vfio_device_info_cap_zpci_group {
41 struct vfio_info_cap_header header;
42 __u64 dasm; /* DMA Address space mask */
43 __u64 msi_addr; /* MSI address */
44 __u64 flags;
45#define VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH 1 /* Program-specified TLB refresh */
46 __u16 mui; /* Measurement Block Update Interval */
47 __u16 noi; /* Maximum number of MSIs */
48 __u16 maxstbl; /* Maximum Store Block Length */
49 __u8 version; /* Supported PCI Version */
50};
51
52/**
53 * VFIO_DEVICE_INFO_CAP_ZPCI_UTIL - Utility String
54 *
55 * This capability provides the utility string for the associated device, which
56 * is a device identifier string made up of EBCDID characters. 'size' specifies
57 * the length of 'util_str'.
58 */
59struct vfio_device_info_cap_zpci_util {
60 struct vfio_info_cap_header header;
61 __u32 size;
62 __u8 util_str[];
63};
64
65/**
66 * VFIO_DEVICE_INFO_CAP_ZPCI_PFIP - PCI Function Path
67 *
68 * This capability provides the PCI function path string, which is an identifier
69 * that describes the internal hardware path of the device. 'size' specifies
70 * the length of 'pfip'.
71 */
72struct vfio_device_info_cap_zpci_pfip {
73 struct vfio_info_cap_header header;
74 __u32 size;
75 __u8 pfip[];
76};
77
78#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vhost.h+36-111
...@@ -11,94 +11,11 @@...@@ -11,94 +11,11 @@
11 * device configuration.11 * device configuration.
12 */12 */
1313
14#include <linux/vhost_types.h>
14#include <linux/types.h>15#include <linux/types.h>
15
16#include <linux/ioctl.h>16#include <linux/ioctl.h>
17#include <linux/virtio_config.h>17
18#include <linux/virtio_ring.h>18#define VHOST_FILE_UNBIND -1
19
20struct vhost_vring_state {
21 unsigned int index;
22 unsigned int num;
23};
24
25struct vhost_vring_file {
26 unsigned int index;
27 int fd; /* Pass -1 to unbind from file. */
28
29};
30
31struct vhost_vring_addr {
32 unsigned int index;
33 /* Option flags. */
34 unsigned int flags;
35 /* Flag values: */
36 /* Whether log address is valid. If set enables logging. */
37#define VHOST_VRING_F_LOG 0
38
39 /* Start of array of descriptors (virtually contiguous) */
40 __u64 desc_user_addr;
41 /* Used structure address. Must be 32 bit aligned */
42 __u64 used_user_addr;
43 /* Available structure address. Must be 16 bit aligned */
44 __u64 avail_user_addr;
45 /* Logging support. */
46 /* Log writes to used structure, at offset calculated from specified
47 * address. Address must be 32 bit aligned. */
48 __u64 log_guest_addr;
49};
50
51/* no alignment requirement */
52struct vhost_iotlb_msg {
53 __u64 iova;
54 __u64 size;
55 __u64 uaddr;
56#define VHOST_ACCESS_RO 0x1
57#define VHOST_ACCESS_WO 0x2
58#define VHOST_ACCESS_RW 0x3
59 __u8 perm;
60#define VHOST_IOTLB_MISS 1
61#define VHOST_IOTLB_UPDATE 2
62#define VHOST_IOTLB_INVALIDATE 3
63#define VHOST_IOTLB_ACCESS_FAIL 4
64 __u8 type;
65};
66
67#define VHOST_IOTLB_MSG 0x1
68#define VHOST_IOTLB_MSG_V2 0x2
69
70struct vhost_msg {
71 int type;
72 union {
73 struct vhost_iotlb_msg iotlb;
74 __u8 padding[64];
75 };
76};
77
78struct vhost_msg_v2 {
79 __u32 type;
80 __u32 reserved;
81 union {
82 struct vhost_iotlb_msg iotlb;
83 __u8 padding[64];
84 };
85};
86
87struct vhost_memory_region {
88 __u64 guest_phys_addr;
89 __u64 memory_size; /* bytes */
90 __u64 userspace_addr;
91 __u64 flags_padding; /* No flags are currently specified. */
92};
93
94/* All region addresses and sizes must be 4K aligned. */
95#define VHOST_PAGE_SIZE 0x1000
96
97struct vhost_memory {
98 __u32 nregions;
99 __u32 padding;
100 struct vhost_memory_region regions[0];
101};
10219
103/* ioctls */20/* ioctls */
10421
...@@ -174,6 +91,8 @@ struct vhost_memory {...@@ -174,6 +91,8 @@ struct vhost_memory {
17491
175/* Use message type V2 */92/* Use message type V2 */
176#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x193#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
94/* IOTLB can accept batching hints */
95#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
17796
178#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)97#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
179#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)98#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
...@@ -186,31 +105,7 @@ struct vhost_memory {...@@ -186,31 +105,7 @@ struct vhost_memory {
186 * device. This can be used to stop the ring (e.g. for migration). */105 * device. This can be used to stop the ring (e.g. for migration). */
187#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)106#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
188107
189/* Feature bits */108/* VHOST_SCSI specific defines */
190/* Log all write descriptors. Can be changed while device is active. */
191#define VHOST_F_LOG_ALL 26
192/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
193#define VHOST_NET_F_VIRTIO_NET_HDR 27
194
195/* VHOST_SCSI specific definitions */
196
197/*
198 * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
199 *
200 * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
201 * RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage
202 * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
203 * All the targets under vhost_wwpn can be seen and used by guset.
204 */
205
206#define VHOST_SCSI_ABI_VERSION 1
207
208struct vhost_scsi_target {
209 int abi_version;
210 char vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */
211 unsigned short vhost_tpgt;
212 unsigned short reserved;
213};
214109
215#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)110#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
216#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)111#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
...@@ -225,4 +120,34 @@ struct vhost_scsi_target {...@@ -225,4 +120,34 @@ struct vhost_scsi_target {
225#define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64)120#define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64)
226#define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)121#define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
227122
123/* VHOST_VDPA specific defines */
124
125/* Get the device id. The device ids follow the same definition of
126 * the device id defined in virtio-spec.
127 */
128#define VHOST_VDPA_GET_DEVICE_ID _IOR(VHOST_VIRTIO, 0x70, __u32)
129/* Get and set the status. The status bits follow the same definition
130 * of the device status defined in virtio-spec.
131 */
132#define VHOST_VDPA_GET_STATUS _IOR(VHOST_VIRTIO, 0x71, __u8)
133#define VHOST_VDPA_SET_STATUS _IOW(VHOST_VIRTIO, 0x72, __u8)
134/* Get and set the device config. The device config follows the same
135 * definition of the device config defined in virtio-spec.
136 */
137#define VHOST_VDPA_GET_CONFIG _IOR(VHOST_VIRTIO, 0x73, \
138 struct vhost_vdpa_config)
139#define VHOST_VDPA_SET_CONFIG _IOW(VHOST_VIRTIO, 0x74, \
140 struct vhost_vdpa_config)
141/* Enable/disable the ring. */
142#define VHOST_VDPA_SET_VRING_ENABLE _IOW(VHOST_VIRTIO, 0x75, \
143 struct vhost_vring_state)
144/* Get the max ring size. */
145#define VHOST_VDPA_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16)
146
147/* Set event fd for config interrupt*/
148#define VHOST_VDPA_SET_CONFIG_CALL _IOW(VHOST_VIRTIO, 0x77, int)
149
150/* Get the valid iova range */
151#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \
152 struct vhost_vdpa_iova_range)
228#endif153#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vhost_types.h created+156
...@@ -0,0 +1,156 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_VHOST_TYPES_H
3#define _LINUX_VHOST_TYPES_H
4/* Userspace interface for in-kernel virtio accelerators. */
5
6/* vhost is used to reduce the number of system calls involved in virtio.
7 *
8 * Existing virtio net code is used in the guest without modification.
9 *
10 * This header includes interface used by userspace hypervisor for
11 * device configuration.
12 */
13
14#include <linux/types.h>
15
16#include <linux/virtio_config.h>
17#include <linux/virtio_ring.h>
18
19struct vhost_vring_state {
20 unsigned int index;
21 unsigned int num;
22};
23
24struct vhost_vring_file {
25 unsigned int index;
26 int fd; /* Pass -1 to unbind from file. */
27
28};
29
30struct vhost_vring_addr {
31 unsigned int index;
32 /* Option flags. */
33 unsigned int flags;
34 /* Flag values: */
35 /* Whether log address is valid. If set enables logging. */
36#define VHOST_VRING_F_LOG 0
37
38 /* Start of array of descriptors (virtually contiguous) */
39 __u64 desc_user_addr;
40 /* Used structure address. Must be 32 bit aligned */
41 __u64 used_user_addr;
42 /* Available structure address. Must be 16 bit aligned */
43 __u64 avail_user_addr;
44 /* Logging support. */
45 /* Log writes to used structure, at offset calculated from specified
46 * address. Address must be 32 bit aligned. */
47 __u64 log_guest_addr;
48};
49
50/* no alignment requirement */
51struct vhost_iotlb_msg {
52 __u64 iova;
53 __u64 size;
54 __u64 uaddr;
55#define VHOST_ACCESS_RO 0x1
56#define VHOST_ACCESS_WO 0x2
57#define VHOST_ACCESS_RW 0x3
58 __u8 perm;
59#define VHOST_IOTLB_MISS 1
60#define VHOST_IOTLB_UPDATE 2
61#define VHOST_IOTLB_INVALIDATE 3
62#define VHOST_IOTLB_ACCESS_FAIL 4
63/*
64 * VHOST_IOTLB_BATCH_BEGIN and VHOST_IOTLB_BATCH_END allow modifying
65 * multiple mappings in one go: beginning with
66 * VHOST_IOTLB_BATCH_BEGIN, followed by any number of
67 * VHOST_IOTLB_UPDATE messages, and ending with VHOST_IOTLB_BATCH_END.
68 * When one of these two values is used as the message type, the rest
69 * of the fields in the message are ignored. There's no guarantee that
70 * these changes take place automatically in the device.
71 */
72#define VHOST_IOTLB_BATCH_BEGIN 5
73#define VHOST_IOTLB_BATCH_END 6
74 __u8 type;
75};
76
77#define VHOST_IOTLB_MSG 0x1
78#define VHOST_IOTLB_MSG_V2 0x2
79
80struct vhost_msg {
81 int type;
82 union {
83 struct vhost_iotlb_msg iotlb;
84 __u8 padding[64];
85 };
86};
87
88struct vhost_msg_v2 {
89 __u32 type;
90 __u32 reserved;
91 union {
92 struct vhost_iotlb_msg iotlb;
93 __u8 padding[64];
94 };
95};
96
97struct vhost_memory_region {
98 __u64 guest_phys_addr;
99 __u64 memory_size; /* bytes */
100 __u64 userspace_addr;
101 __u64 flags_padding; /* No flags are currently specified. */
102};
103
104/* All region addresses and sizes must be 4K aligned. */
105#define VHOST_PAGE_SIZE 0x1000
106
107struct vhost_memory {
108 __u32 nregions;
109 __u32 padding;
110 struct vhost_memory_region regions[0];
111};
112
113/* VHOST_SCSI specific definitions */
114
115/*
116 * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
117 *
118 * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
119 * RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage
120 * ABI Rev 1: January 2013. Ignore vhost_tpgt field in struct vhost_scsi_target.
121 * All the targets under vhost_wwpn can be seen and used by guset.
122 */
123
124#define VHOST_SCSI_ABI_VERSION 1
125
126struct vhost_scsi_target {
127 int abi_version;
128 char vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */
129 unsigned short vhost_tpgt;
130 unsigned short reserved;
131};
132
133/* VHOST_VDPA specific definitions */
134
135struct vhost_vdpa_config {
136 __u32 off;
137 __u32 len;
138 __u8 buf[0];
139};
140
141/* vhost vdpa IOVA range
142 * @first: First address that can be mapped by vhost-vDPA
143 * @last: Last address that can be mapped by vhost-vDPA
144 */
145struct vhost_vdpa_iova_range {
146 __u64 first;
147 __u64 last;
148};
149
150/* Feature bits */
151/* Log all write descriptors. Can be changed while device is active. */
152#define VHOST_F_LOG_ALL 26
153/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
154#define VHOST_NET_F_VIRTIO_NET_HDR 27
155
156#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/videodev2.h+203-26
...@@ -78,7 +78,7 @@...@@ -78,7 +78,7 @@
78/* Four-character-code (FOURCC) */78/* Four-character-code (FOURCC) */
79#define v4l2_fourcc(a, b, c, d)\79#define v4l2_fourcc(a, b, c, d)\
80 ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))80 ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
81#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31))81#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1U << 31))
8282
83/*83/*
84 * E N U M S84 * E N U M S
...@@ -128,6 +128,13 @@ enum v4l2_field {...@@ -128,6 +128,13 @@ enum v4l2_field {
128 ((field) == V4L2_FIELD_BOTTOM ||\128 ((field) == V4L2_FIELD_BOTTOM ||\
129 (field) == V4L2_FIELD_TOP ||\129 (field) == V4L2_FIELD_TOP ||\
130 (field) == V4L2_FIELD_ALTERNATE)130 (field) == V4L2_FIELD_ALTERNATE)
131#define V4L2_FIELD_IS_INTERLACED(field) \
132 ((field) == V4L2_FIELD_INTERLACED ||\
133 (field) == V4L2_FIELD_INTERLACED_TB ||\
134 (field) == V4L2_FIELD_INTERLACED_BT)
135#define V4L2_FIELD_IS_SEQUENTIAL(field) \
136 ((field) == V4L2_FIELD_SEQ_TB ||\
137 (field) == V4L2_FIELD_SEQ_BT)
131138
132enum v4l2_buf_type {139enum v4l2_buf_type {
133 V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,140 V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
...@@ -143,6 +150,7 @@ enum v4l2_buf_type {...@@ -143,6 +150,7 @@ enum v4l2_buf_type {
143 V4L2_BUF_TYPE_SDR_CAPTURE = 11,150 V4L2_BUF_TYPE_SDR_CAPTURE = 11,
144 V4L2_BUF_TYPE_SDR_OUTPUT = 12,151 V4L2_BUF_TYPE_SDR_OUTPUT = 12,
145 V4L2_BUF_TYPE_META_CAPTURE = 13,152 V4L2_BUF_TYPE_META_CAPTURE = 13,
153 V4L2_BUF_TYPE_META_OUTPUT = 14,
146 /* Deprecated, do not use */154 /* Deprecated, do not use */
147 V4L2_BUF_TYPE_PRIVATE = 0x80,155 V4L2_BUF_TYPE_PRIVATE = 0x80,
148};156};
...@@ -158,7 +166,10 @@ enum v4l2_buf_type {...@@ -158,7 +166,10 @@ enum v4l2_buf_type {
158 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \166 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
159 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \167 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
160 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \168 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \
161 || (type) == V4L2_BUF_TYPE_SDR_OUTPUT)169 || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \
170 || (type) == V4L2_BUF_TYPE_META_OUTPUT)
171
172#define V4L2_TYPE_IS_CAPTURE(type) (!V4L2_TYPE_IS_OUTPUT(type))
162173
163enum v4l2_tuner_type {174enum v4l2_tuner_type {
164 V4L2_TUNER_RADIO = 1,175 V4L2_TUNER_RADIO = 1,
...@@ -208,9 +219,7 @@ enum v4l2_colorspace {...@@ -208,9 +219,7 @@ enum v4l2_colorspace {
208 V4L2_COLORSPACE_470_SYSTEM_M = 5,219 V4L2_COLORSPACE_470_SYSTEM_M = 5,
209220
210 /*221 /*
211 * EBU Tech 3213 PAL/SECAM colorspace. This only makes sense when222 * EBU Tech 3213 PAL/SECAM colorspace.
212 * dealing with really old PAL/SECAM recordings. Superseded by
213 * SMPTE 170M.
214 */223 */
215 V4L2_COLORSPACE_470_SYSTEM_BG = 6,224 V4L2_COLORSPACE_470_SYSTEM_BG = 6,
216225
...@@ -358,9 +367,9 @@ enum v4l2_hsv_encoding {...@@ -358,9 +367,9 @@ enum v4l2_hsv_encoding {
358367
359enum v4l2_quantization {368enum v4l2_quantization {
360 /*369 /*
361 * The default for R'G'B' quantization is always full range, except370 * The default for R'G'B' quantization is always full range.
362 * for the BT2020 colorspace. For Y'CbCr the quantization is always371 * For Y'CbCr the quantization is always limited range, except
363 * limited range, except for COLORSPACE_JPEG: this is full range.372 * for COLORSPACE_JPEG: this is full range.
364 */373 */
365 V4L2_QUANTIZATION_DEFAULT = 0,374 V4L2_QUANTIZATION_DEFAULT = 0,
366 V4L2_QUANTIZATION_FULL_RANGE = 1,375 V4L2_QUANTIZATION_FULL_RANGE = 1,
...@@ -369,14 +378,13 @@ enum v4l2_quantization {...@@ -369,14 +378,13 @@ enum v4l2_quantization {
369378
370/*379/*
371 * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.380 * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.
372 * This depends on whether the image is RGB or not, the colorspace and the381 * This depends on whether the image is RGB or not, the colorspace.
373 * Y'CbCr encoding.382 * The Y'CbCr encoding is not used anymore, but is still there for backwards
383 * compatibility.
374 */384 */
375#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc) \385#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc) \
376 (((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \386 (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \
377 V4L2_QUANTIZATION_LIM_RANGE : \387 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)
378 (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \
379 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
380388
381/*389/*
382 * Deprecated names for opRGB colorspace (IEC 61966-2-5)390 * Deprecated names for opRGB colorspace (IEC 61966-2-5)
...@@ -407,6 +415,11 @@ struct v4l2_fract {...@@ -407,6 +415,11 @@ struct v4l2_fract {
407 __u32 denominator;415 __u32 denominator;
408};416};
409417
418struct v4l2_area {
419 __u32 width;
420 __u32 height;
421};
422
410/**423/**
411 * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP424 * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
412 *425 *
...@@ -463,9 +476,12 @@ struct v4l2_capability {...@@ -463,9 +476,12 @@ struct v4l2_capability {
463#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */476#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
464#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */477#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
465#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */478#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
479#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */
466480
467#define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */481#define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */
468482
483#define V4L2_CAP_IO_MC 0x20000000 /* Is input/output controlled by the media controller */
484
469#define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */485#define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
470486
471/*487/*
...@@ -493,26 +509,44 @@ struct v4l2_pix_format {...@@ -493,26 +509,44 @@ struct v4l2_pix_format {
493509
494/* Pixel format FOURCC depth Description */510/* Pixel format FOURCC depth Description */
495511
496/* RGB formats */512/* RGB formats (1 or 2 bytes per pixel) */
497#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */513#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
498#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */514#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
499#define V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */515#define V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */
500#define V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */516#define V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */
517#define V4L2_PIX_FMT_RGBA444 v4l2_fourcc('R', 'A', '1', '2') /* 16 rrrrgggg bbbbaaaa */
518#define V4L2_PIX_FMT_RGBX444 v4l2_fourcc('R', 'X', '1', '2') /* 16 rrrrgggg bbbbxxxx */
519#define V4L2_PIX_FMT_ABGR444 v4l2_fourcc('A', 'B', '1', '2') /* 16 aaaabbbb ggggrrrr */
520#define V4L2_PIX_FMT_XBGR444 v4l2_fourcc('X', 'B', '1', '2') /* 16 xxxxbbbb ggggrrrr */
521#define V4L2_PIX_FMT_BGRA444 v4l2_fourcc('G', 'A', '1', '2') /* 16 bbbbgggg rrrraaaa */
522#define V4L2_PIX_FMT_BGRX444 v4l2_fourcc('B', 'X', '1', '2') /* 16 bbbbgggg rrrrxxxx */
501#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */523#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
502#define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */524#define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */
503#define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */525#define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */
526#define V4L2_PIX_FMT_RGBA555 v4l2_fourcc('R', 'A', '1', '5') /* 16 RGBA-5-5-5-1 */
527#define V4L2_PIX_FMT_RGBX555 v4l2_fourcc('R', 'X', '1', '5') /* 16 RGBX-5-5-5-1 */
528#define V4L2_PIX_FMT_ABGR555 v4l2_fourcc('A', 'B', '1', '5') /* 16 ABGR-1-5-5-5 */
529#define V4L2_PIX_FMT_XBGR555 v4l2_fourcc('X', 'B', '1', '5') /* 16 XBGR-1-5-5-5 */
530#define V4L2_PIX_FMT_BGRA555 v4l2_fourcc('B', 'A', '1', '5') /* 16 BGRA-5-5-5-1 */
531#define V4L2_PIX_FMT_BGRX555 v4l2_fourcc('B', 'X', '1', '5') /* 16 BGRX-5-5-5-1 */
504#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */532#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
505#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */533#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
506#define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */534#define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */
507#define V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5') /* 16 XRGB-5-5-5 BE */535#define V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5') /* 16 XRGB-5-5-5 BE */
508#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */536#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
537
538/* RGB formats (3 or 4 bytes per pixel) */
509#define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */539#define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
510#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */540#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
511#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */541#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
512#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */542#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
513#define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */543#define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */
514#define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */544#define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */
545#define V4L2_PIX_FMT_BGRA32 v4l2_fourcc('R', 'A', '2', '4') /* 32 ABGR-8-8-8-8 */
546#define V4L2_PIX_FMT_BGRX32 v4l2_fourcc('R', 'X', '2', '4') /* 32 XBGR-8-8-8-8 */
515#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */547#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
548#define V4L2_PIX_FMT_RGBA32 v4l2_fourcc('A', 'B', '2', '4') /* 32 RGBA-8-8-8-8 */
549#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */
516#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */550#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
517#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */551#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */
518552
...@@ -522,6 +556,7 @@ struct v4l2_pix_format {...@@ -522,6 +556,7 @@ struct v4l2_pix_format {
522#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */556#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
523#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */557#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
524#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */558#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
559#define V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ') /* 14 Greyscale */
525#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */560#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
526#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */561#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */
527562
...@@ -545,9 +580,12 @@ struct v4l2_pix_format {...@@ -545,9 +580,12 @@ struct v4l2_pix_format {
545#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */580#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
546#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */581#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
547#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */582#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
583#define V4L2_PIX_FMT_YUV24 v4l2_fourcc('Y', 'U', 'V', '3') /* 24 YUV-8-8-8 */
548#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */584#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
549#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */585#define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */
550#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */586#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */
587#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */
588#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */
551#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */589#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
552590
553/* two planes -- one Y, one Cr + Cb interleaved */591/* two planes -- one Y, one Cr + Cb interleaved */
...@@ -563,8 +601,6 @@ struct v4l2_pix_format {...@@ -563,8 +601,6 @@ struct v4l2_pix_format {
563#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */601#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
564#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */602#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
565#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */603#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
566#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
567#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
568604
569/* three planes - Y Cb, Cr */605/* three planes - Y Cb, Cr */
570#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */606#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
...@@ -582,6 +618,15 @@ struct v4l2_pix_format {...@@ -582,6 +618,15 @@ struct v4l2_pix_format {
582#define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24 YUV444 planar */618#define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24 YUV444 planar */
583#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24 YVU444 planar */619#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24 YVU444 planar */
584620
621/* Tiled YUV formats */
622#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */
623#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
624#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 32x32 tiles */
625
626/* Tiled YUV formats, non contiguous planes */
627#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */
628#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
629
585/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */630/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
586#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */631#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
587#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */632#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
...@@ -615,6 +660,10 @@ struct v4l2_pix_format {...@@ -615,6 +660,10 @@ struct v4l2_pix_format {
615#define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')660#define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
616#define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')661#define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
617#define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')662#define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
663#define V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') /* 14 BGBG.. GRGR.. */
664#define V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') /* 14 GBGB.. RGRG.. */
665#define V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('G', 'R', '1', '4') /* 14 GRGR.. BGBG.. */
666#define V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') /* 14 RGRG.. GBGB.. */
618 /* 14bit raw bayer packed, 7 bytes for every 4 pixels */667 /* 14bit raw bayer packed, 7 bytes for every 4 pixels */
619#define V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E')668#define V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E')
620#define V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E')669#define V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E')
...@@ -640,14 +689,18 @@ struct v4l2_pix_format {...@@ -640,14 +689,18 @@ struct v4l2_pix_format {
640#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */689#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
641#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */690#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
642#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */691#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
692#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */
643#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */693#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */
644#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */694#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
645#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */695#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
646#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */696#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
647#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */697#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
698#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */
648#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */699#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
649#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */700#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
650#define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */701#define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */
702#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
703#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
651704
652/* Vendor-specific formats */705/* Vendor-specific formats */
653#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */706#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
...@@ -680,7 +733,10 @@ struct v4l2_pix_format {...@@ -680,7 +733,10 @@ struct v4l2_pix_format {
680#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */733#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
681#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */734#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
682#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */735#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
736#define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */
683#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */737#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
738#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
739#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */
684740
685/* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */741/* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
686#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */742#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
...@@ -708,12 +764,19 @@ struct v4l2_pix_format {...@@ -708,12 +764,19 @@ struct v4l2_pix_format {
708#define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */764#define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */
709#define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */765#define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
710#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */766#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
767#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
768#define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
769
770/* Vendor specific - used for RK_ISP1 camera sub-system */
771#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */
772#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */
711773
712/* priv field value to indicates that subsequent fields are valid. */774/* priv field value to indicates that subsequent fields are valid. */
713#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe775#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
714776
715/* Flags */777/* Flags */
716#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001778#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001
779#define V4L2_PIX_FMT_FLAG_SET_CSC 0x00000002
717780
718/*781/*
719 * F O R M A T E N U M E R A T I O N782 * F O R M A T E N U M E R A T I O N
...@@ -724,11 +787,20 @@ struct v4l2_fmtdesc {...@@ -724,11 +787,20 @@ struct v4l2_fmtdesc {
724 __u32 flags;787 __u32 flags;
725 __u8 description[32]; /* Description string */788 __u8 description[32]; /* Description string */
726 __u32 pixelformat; /* Format fourcc */789 __u32 pixelformat; /* Format fourcc */
727 __u32 reserved[4];790 __u32 mbus_code; /* Media bus code */
791 __u32 reserved[3];
728};792};
729793
730#define V4L2_FMT_FLAG_COMPRESSED 0x0001794#define V4L2_FMT_FLAG_COMPRESSED 0x0001
731#define V4L2_FMT_FLAG_EMULATED 0x0002795#define V4L2_FMT_FLAG_EMULATED 0x0002
796#define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM 0x0004
797#define V4L2_FMT_FLAG_DYN_RESOLUTION 0x0008
798#define V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL 0x0010
799#define V4L2_FMT_FLAG_CSC_COLORSPACE 0x0020
800#define V4L2_FMT_FLAG_CSC_XFER_FUNC 0x0040
801#define V4L2_FMT_FLAG_CSC_YCBCR_ENC 0x0080
802#define V4L2_FMT_FLAG_CSC_HSV_ENC V4L2_FMT_FLAG_CSC_YCBCR_ENC
803#define V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100
732804
733 /* Frame Size and frame rate enumeration */805 /* Frame Size and frame rate enumeration */
734/*806/*
...@@ -857,13 +929,28 @@ struct v4l2_jpegcompression {...@@ -857,13 +929,28 @@ struct v4l2_jpegcompression {
857/*929/*
858 * M E M O R Y - M A P P I N G B U F F E R S930 * M E M O R Y - M A P P I N G B U F F E R S
859 */931 */
932
933
860struct v4l2_requestbuffers {934struct v4l2_requestbuffers {
861 __u32 count;935 __u32 count;
862 __u32 type; /* enum v4l2_buf_type */936 __u32 type; /* enum v4l2_buf_type */
863 __u32 memory; /* enum v4l2_memory */937 __u32 memory; /* enum v4l2_memory */
864 __u32 reserved[2];938 __u32 capabilities;
939 __u8 flags;
940 __u8 reserved[3];
865};941};
866942
943#define V4L2_MEMORY_FLAG_NON_COHERENT (1 << 0)
944
945/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */
946#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0)
947#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1)
948#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2)
949#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3)
950#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
951#define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5)
952#define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS (1 << 6)
953
867/**954/**
868 * struct v4l2_plane - plane info for multi-planar buffers955 * struct v4l2_plane - plane info for multi-planar buffers
869 * @bytesused: number of bytes occupied by data in the plane (payload)956 * @bytesused: number of bytes occupied by data in the plane (payload)
...@@ -876,8 +963,10 @@ struct v4l2_requestbuffers {...@@ -876,8 +963,10 @@ struct v4l2_requestbuffers {
876 * pointing to this plane963 * pointing to this plane
877 * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file964 * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
878 * descriptor associated with this plane965 * descriptor associated with this plane
966 * @m: union of @mem_offset, @userptr and @fd
879 * @data_offset: offset in the plane to the start of data; usually 0,967 * @data_offset: offset in the plane to the start of data; usually 0,
880 * unless there is a header in front of the data968 * unless there is a header in front of the data
969 * @reserved: drivers and applications must zero this array
881 *970 *
882 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer971 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
883 * with two planes can have one plane for Y, and another for interleaved CbCr972 * with two planes can have one plane for Y, and another for interleaved CbCr
...@@ -919,9 +1008,14 @@ struct v4l2_plane {...@@ -919,9 +1008,14 @@ struct v4l2_plane {
919 * a userspace file descriptor associated with this buffer1008 * a userspace file descriptor associated with this buffer
920 * @planes: for multiplanar buffers; userspace pointer to the array of plane1009 * @planes: for multiplanar buffers; userspace pointer to the array of plane
921 * info structs for this buffer1010 * info structs for this buffer
1011 * @m: union of @offset, @userptr, @planes and @fd
922 * @length: size in bytes of the buffer (NOT its payload) for single-plane1012 * @length: size in bytes of the buffer (NOT its payload) for single-plane
923 * buffers (when type != *_MPLANE); number of elements in the1013 * buffers (when type != *_MPLANE); number of elements in the
924 * planes array for multi-plane buffers1014 * planes array for multi-plane buffers
1015 * @reserved2: drivers and applications must zero this field
1016 * @request_fd: fd of the request that this buffer should use
1017 * @reserved: for backwards compatibility with applications that do not know
1018 * about @request_fd
925 *1019 *
926 * Contains data exchanged by application and driver using one of the Streaming1020 * Contains data exchanged by application and driver using one of the Streaming
927 * I/O methods.1021 * I/O methods.
...@@ -946,9 +1040,24 @@ struct v4l2_buffer {...@@ -946,9 +1040,24 @@ struct v4l2_buffer {
946 } m;1040 } m;
947 __u32 length;1041 __u32 length;
948 __u32 reserved2;1042 __u32 reserved2;
949 __u32 reserved;1043 union {
1044 __s32 request_fd;
1045 __u32 reserved;
1046 };
950};1047};
9511048
1049/**
1050 * v4l2_timeval_to_ns - Convert timeval to nanoseconds
1051 * @tv: pointer to the timeval variable to be converted
1052 *
1053 * Returns the scalar nanosecond representation of the timeval
1054 * parameter.
1055 */
1056static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv)
1057{
1058 return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000;
1059}
1060
952/* Flags for 'flags' field */1061/* Flags for 'flags' field */
953/* Buffer is mapped (flag) */1062/* Buffer is mapped (flag) */
954#define V4L2_BUF_FLAG_MAPPED 0x000000011063#define V4L2_BUF_FLAG_MAPPED 0x00000001
...@@ -964,8 +1073,12 @@ struct v4l2_buffer {...@@ -964,8 +1073,12 @@ struct v4l2_buffer {
964#define V4L2_BUF_FLAG_BFRAME 0x000000201073#define V4L2_BUF_FLAG_BFRAME 0x00000020
965/* Buffer is ready, but the data contained within is corrupted. */1074/* Buffer is ready, but the data contained within is corrupted. */
966#define V4L2_BUF_FLAG_ERROR 0x000000401075#define V4L2_BUF_FLAG_ERROR 0x00000040
1076/* Buffer is added to an unqueued request */
1077#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080
967/* timecode field is valid */1078/* timecode field is valid */
968#define V4L2_BUF_FLAG_TIMECODE 0x000001001079#define V4L2_BUF_FLAG_TIMECODE 0x00000100
1080/* Don't return the capture buffer until OUTPUT timestamp changes */
1081#define V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF 0x00000200
969/* Buffer is prepared for queuing */1082/* Buffer is prepared for queuing */
970#define V4L2_BUF_FLAG_PREPARED 0x000004001083#define V4L2_BUF_FLAG_PREPARED 0x00000400
971/* Cache handling flags */1084/* Cache handling flags */
...@@ -982,6 +1095,8 @@ struct v4l2_buffer {...@@ -982,6 +1095,8 @@ struct v4l2_buffer {
982#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x000100001095#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
983/* mem2mem encoder/decoder */1096/* mem2mem encoder/decoder */
984#define V4L2_BUF_FLAG_LAST 0x001000001097#define V4L2_BUF_FLAG_LAST 0x00100000
1098/* request_fd is valid */
1099#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
9851100
986/**1101/**
987 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor1102 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
...@@ -993,6 +1108,7 @@ struct v4l2_buffer {...@@ -993,6 +1108,7 @@ struct v4l2_buffer {
993 * @flags: flags for newly created file, currently only O_CLOEXEC is1108 * @flags: flags for newly created file, currently only O_CLOEXEC is
994 * supported, refer to manual of open syscall for more details1109 * supported, refer to manual of open syscall for more details
995 * @fd: file descriptor associated with DMABUF (set by driver)1110 * @fd: file descriptor associated with DMABUF (set by driver)
1111 * @reserved: drivers and applications must zero this array
996 *1112 *
997 * Contains data used for exporting a video buffer as DMABUF file descriptor.1113 * Contains data used for exporting a video buffer as DMABUF file descriptor.
998 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF1114 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF
...@@ -1131,6 +1247,10 @@ struct v4l2_selection {...@@ -1131,6 +1247,10 @@ struct v4l2_selection {
11311247
1132typedef __u64 v4l2_std_id;1248typedef __u64 v4l2_std_id;
11331249
1250/*
1251 * Attention: Keep the V4L2_STD_* bit definitions in sync with
1252 * include/dt-bindings/display/sdtv-standards.h SDTV_STD_* bit definitions.
1253 */
1134/* one bit for each */1254/* one bit for each */
1135#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)1255#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
1136#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)1256#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
...@@ -1405,6 +1525,13 @@ struct v4l2_bt_timings {...@@ -1405,6 +1525,13 @@ struct v4l2_bt_timings {
1405 * InfoFrame).1525 * InfoFrame).
1406 */1526 */
1407#define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)1527#define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)
1528/*
1529 * CEA-861 specific: only valid for video receivers.
1530 * If set, then HW can detect the difference between regular FPS and
1531 * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with
1532 * the V4L2_DV_FL_CAN_REDUCE_FPS flag set.
1533 */
1534#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9)
14081535
1409/* A few useful defines to calculate the total blanking and frame sizes */1536/* A few useful defines to calculate the total blanking and frame sizes */
1410#define V4L2_DV_BT_BLANKING_WIDTH(bt) \1537#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
...@@ -1591,6 +1718,18 @@ struct v4l2_ext_control {...@@ -1591,6 +1718,18 @@ struct v4l2_ext_control {
1591 __u8 *p_u8;1718 __u8 *p_u8;
1592 __u16 *p_u16;1719 __u16 *p_u16;
1593 __u32 *p_u32;1720 __u32 *p_u32;
1721 struct v4l2_area *p_area;
1722 struct v4l2_ctrl_h264_sps *p_h264_sps;
1723 struct v4l2_ctrl_h264_pps *p_h264_pps;
1724 struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
1725 struct v4l2_ctrl_h264_pred_weights *p_h264_pred_weights;
1726 struct v4l2_ctrl_h264_slice_params *p_h264_slice_params;
1727 struct v4l2_ctrl_h264_decode_params *p_h264_decode_params;
1728 struct v4l2_ctrl_fwht_params *p_fwht_params;
1729 struct v4l2_ctrl_vp8_frame *p_vp8_frame;
1730 struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;
1731 struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;
1732 struct v4l2_ctrl_mpeg2_quantisation *p_mpeg2_quantisation;
1594 void *ptr;1733 void *ptr;
1595 };1734 };
1596} __attribute__ ((packed));1735} __attribute__ ((packed));
...@@ -1602,7 +1741,8 @@ struct v4l2_ext_controls {...@@ -1602,7 +1741,8 @@ struct v4l2_ext_controls {
1602 };1741 };
1603 __u32 count;1742 __u32 count;
1604 __u32 error_idx;1743 __u32 error_idx;
1605 __u32 reserved[2];1744 __s32 request_fd;
1745 __u32 reserved[1];
1606 struct v4l2_ext_control *controls;1746 struct v4l2_ext_control *controls;
1607};1747};
16081748
...@@ -1613,6 +1753,7 @@ struct v4l2_ext_controls {...@@ -1613,6 +1753,7 @@ struct v4l2_ext_controls {
1613#define V4L2_CTRL_MAX_DIMS (4)1753#define V4L2_CTRL_MAX_DIMS (4)
1614#define V4L2_CTRL_WHICH_CUR_VAL 01754#define V4L2_CTRL_WHICH_CUR_VAL 0
1615#define V4L2_CTRL_WHICH_DEF_VAL 0x0f0000001755#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
1756#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000
16161757
1617enum v4l2_ctrl_type {1758enum v4l2_ctrl_type {
1618 V4L2_CTRL_TYPE_INTEGER = 1,1759 V4L2_CTRL_TYPE_INTEGER = 1,
...@@ -1630,6 +1771,25 @@ enum v4l2_ctrl_type {...@@ -1630,6 +1771,25 @@ enum v4l2_ctrl_type {
1630 V4L2_CTRL_TYPE_U8 = 0x0100,1771 V4L2_CTRL_TYPE_U8 = 0x0100,
1631 V4L2_CTRL_TYPE_U16 = 0x0101,1772 V4L2_CTRL_TYPE_U16 = 0x0101,
1632 V4L2_CTRL_TYPE_U32 = 0x0102,1773 V4L2_CTRL_TYPE_U32 = 0x0102,
1774 V4L2_CTRL_TYPE_AREA = 0x0106,
1775
1776 V4L2_CTRL_TYPE_HDR10_CLL_INFO = 0x0110,
1777 V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY = 0x0111,
1778
1779 V4L2_CTRL_TYPE_H264_SPS = 0x0200,
1780 V4L2_CTRL_TYPE_H264_PPS = 0x0201,
1781 V4L2_CTRL_TYPE_H264_SCALING_MATRIX = 0x0202,
1782 V4L2_CTRL_TYPE_H264_SLICE_PARAMS = 0x0203,
1783 V4L2_CTRL_TYPE_H264_DECODE_PARAMS = 0x0204,
1784 V4L2_CTRL_TYPE_H264_PRED_WEIGHTS = 0x0205,
1785
1786 V4L2_CTRL_TYPE_FWHT_PARAMS = 0x0220,
1787
1788 V4L2_CTRL_TYPE_VP8_FRAME = 0x0240,
1789
1790 V4L2_CTRL_TYPE_MPEG2_QUANTISATION = 0x0250,
1791 V4L2_CTRL_TYPE_MPEG2_SEQUENCE = 0x0251,
1792 V4L2_CTRL_TYPE_MPEG2_PICTURE = 0x0252,
1633};1793};
16341794
1635/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */1795/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
...@@ -1885,6 +2045,7 @@ struct v4l2_encoder_cmd {...@@ -1885,6 +2045,7 @@ struct v4l2_encoder_cmd {
1885#define V4L2_DEC_CMD_STOP (1)2045#define V4L2_DEC_CMD_STOP (1)
1886#define V4L2_DEC_CMD_PAUSE (2)2046#define V4L2_DEC_CMD_PAUSE (2)
1887#define V4L2_DEC_CMD_RESUME (3)2047#define V4L2_DEC_CMD_RESUME (3)
2048#define V4L2_DEC_CMD_FLUSH (4)
18882049
1889/* Flags for V4L2_DEC_CMD_START */2050/* Flags for V4L2_DEC_CMD_START */
1890#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)2051#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
...@@ -2066,6 +2227,7 @@ struct v4l2_mpeg_vbi_fmt_ivtv {...@@ -2066,6 +2227,7 @@ struct v4l2_mpeg_vbi_fmt_ivtv {
2066 * this plane will be used2227 * this plane will be used
2067 * @bytesperline: distance in bytes between the leftmost pixels in two2228 * @bytesperline: distance in bytes between the leftmost pixels in two
2068 * adjacent lines2229 * adjacent lines
2230 * @reserved: drivers and applications must zero this array
2069 */2231 */
2070struct v4l2_plane_pix_format {2232struct v4l2_plane_pix_format {
2071 __u32 sizeimage;2233 __u32 sizeimage;
...@@ -2084,8 +2246,10 @@ struct v4l2_plane_pix_format {...@@ -2084,8 +2246,10 @@ struct v4l2_plane_pix_format {
2084 * @num_planes: number of planes for this format2246 * @num_planes: number of planes for this format
2085 * @flags: format flags (V4L2_PIX_FMT_FLAG_*)2247 * @flags: format flags (V4L2_PIX_FMT_FLAG_*)
2086 * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding2248 * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
2249 * @hsv_enc: enum v4l2_hsv_encoding, HSV encoding
2087 * @quantization: enum v4l2_quantization, colorspace quantization2250 * @quantization: enum v4l2_quantization, colorspace quantization
2088 * @xfer_func: enum v4l2_xfer_func, colorspace transfer function2251 * @xfer_func: enum v4l2_xfer_func, colorspace transfer function
2252 * @reserved: drivers and applications must zero this array
2089 */2253 */
2090struct v4l2_pix_format_mplane {2254struct v4l2_pix_format_mplane {
2091 __u32 width;2255 __u32 width;
...@@ -2110,6 +2274,7 @@ struct v4l2_pix_format_mplane {...@@ -2110,6 +2274,7 @@ struct v4l2_pix_format_mplane {
2110 * struct v4l2_sdr_format - SDR format definition2274 * struct v4l2_sdr_format - SDR format definition
2111 * @pixelformat: little endian four character code (fourcc)2275 * @pixelformat: little endian four character code (fourcc)
2112 * @buffersize: maximum size in bytes required for data2276 * @buffersize: maximum size in bytes required for data
2277 * @reserved: drivers and applications must zero this array
2113 */2278 */
2114struct v4l2_sdr_format {2279struct v4l2_sdr_format {
2115 __u32 pixelformat;2280 __u32 pixelformat;
...@@ -2136,6 +2301,8 @@ struct v4l2_meta_format {...@@ -2136,6 +2301,8 @@ struct v4l2_meta_format {
2136 * @vbi: raw VBI capture or output parameters2301 * @vbi: raw VBI capture or output parameters
2137 * @sliced: sliced VBI capture or output parameters2302 * @sliced: sliced VBI capture or output parameters
2138 * @raw_data: placeholder for future extensions and custom formats2303 * @raw_data: placeholder for future extensions and custom formats
2304 * @fmt: union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta
2305 * and @raw_data
2139 */2306 */
2140struct v4l2_format {2307struct v4l2_format {
2141 __u32 type;2308 __u32 type;
...@@ -2303,6 +2470,10 @@ struct v4l2_dbg_chip_info {...@@ -2303,6 +2470,10 @@ struct v4l2_dbg_chip_info {
2303 * return: number of created buffers2470 * return: number of created buffers
2304 * @memory: enum v4l2_memory; buffer memory type2471 * @memory: enum v4l2_memory; buffer memory type
2305 * @format: frame format, for which buffers are requested2472 * @format: frame format, for which buffers are requested
2473 * @capabilities: capabilities of this buffer type.
2474 * @flags: additional buffer management attributes (ignored unless the
2475 * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
2476 * and configured for MMAP streaming I/O).
2306 * @reserved: future extensions2477 * @reserved: future extensions
2307 */2478 */
2308struct v4l2_create_buffers {2479struct v4l2_create_buffers {
...@@ -2310,7 +2481,9 @@ struct v4l2_create_buffers {...@@ -2310,7 +2481,9 @@ struct v4l2_create_buffers {
2310 __u32 count;2481 __u32 count;
2311 __u32 memory;2482 __u32 memory;
2312 struct v4l2_format format;2483 struct v4l2_format format;
2313 __u32 reserved[8];2484 __u32 capabilities;
2485 __u32 flags;
2486 __u32 reserved[6];
2314};2487};
23152488
2316/*2489/*
...@@ -2418,4 +2591,8 @@ struct v4l2_create_buffers {...@@ -2418,4 +2591,8 @@ struct v4l2_create_buffers {
24182591
2419#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */2592#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
24202593
2594/* Deprecated definitions kept for backwards compatibility */
2595#define V4L2_PIX_FMT_HM12 V4L2_PIX_FMT_NV12_16L16
2596#define V4L2_PIX_FMT_SUNXI_TILED_NV12 V4L2_PIX_FMT_NV12_32L32
2597
2421#endif /* __LINUX_VIDEODEV2_H */2598#endif /* __LINUX_VIDEODEV2_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_9p.h+2-2
...@@ -25,7 +25,7 @@...@@ -25,7 +25,7 @@
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */27 * SUCH DAMAGE. */
28#include <linux/types.h>28#include <linux/virtio_types.h>
29#include <linux/virtio_ids.h>29#include <linux/virtio_ids.h>
30#include <linux/virtio_config.h>30#include <linux/virtio_config.h>
3131
...@@ -36,7 +36,7 @@...@@ -36,7 +36,7 @@
3636
37struct virtio_9p_config {37struct virtio_9p_config {
38 /* length of the tag name */38 /* length of the tag name */
39 __u16 tag_len;39 __virtio16 tag_len;
40 /* non-NULL terminated tag name */40 /* non-NULL terminated tag name */
41 __u8 tag[0];41 __u8 tag[0];
42} __attribute__((packed));42} __attribute__((packed));
lib/libc/include/any-linux-any/linux/virtio_balloon.h+18-2
...@@ -34,15 +34,31 @@...@@ -34,15 +34,31 @@
34#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */34#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
35#define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */35#define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */
36#define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */36#define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */
37#define VIRTIO_BALLOON_F_FREE_PAGE_HINT 3 /* VQ to report free pages */
38#define VIRTIO_BALLOON_F_PAGE_POISON 4 /* Guest is using page poisoning */
39#define VIRTIO_BALLOON_F_REPORTING 5 /* Page reporting virtqueue */
3740
38/* Size of a PFN in the balloon interface. */41/* Size of a PFN in the balloon interface. */
39#define VIRTIO_BALLOON_PFN_SHIFT 1242#define VIRTIO_BALLOON_PFN_SHIFT 12
4043
44#define VIRTIO_BALLOON_CMD_ID_STOP 0
45#define VIRTIO_BALLOON_CMD_ID_DONE 1
41struct virtio_balloon_config {46struct virtio_balloon_config {
42 /* Number of pages host wants Guest to give up. */47 /* Number of pages host wants Guest to give up. */
43 __u32 num_pages;48 __le32 num_pages;
44 /* Number of pages we've actually got in balloon. */49 /* Number of pages we've actually got in balloon. */
45 __u32 actual;50 __le32 actual;
51 /*
52 * Free page hint command id, readonly by guest.
53 * Was previously named free_page_report_cmd_id so we
54 * need to carry that name for legacy support.
55 */
56 union {
57 __le32 free_page_hint_cmd_id;
58 __le32 free_page_report_cmd_id; /* deprecated */
59 };
60 /* Stores PAGE_POISON if page poisoning is in use */
61 __le32 poison_val;
46};62};
4763
48#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */64#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */
lib/libc/include/any-linux-any/linux/virtio_blk.h+62-8
...@@ -38,6 +38,8 @@...@@ -38,6 +38,8 @@
38#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/38#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
39#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */39#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
40#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */40#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */
41#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */
42#define VIRTIO_BLK_F_WRITE_ZEROES 14 /* WRITE ZEROES is supported */
4143
42/* Legacy feature bits */44/* Legacy feature bits */
43#ifndef VIRTIO_BLK_NO_LEGACY45#ifndef VIRTIO_BLK_NO_LEGACY
...@@ -53,20 +55,20 @@...@@ -53,20 +55,20 @@
5355
54struct virtio_blk_config {56struct virtio_blk_config {
55 /* The capacity (in 512-byte sectors). */57 /* The capacity (in 512-byte sectors). */
56 __u64 capacity;58 __virtio64 capacity;
57 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */59 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
58 __u32 size_max;60 __virtio32 size_max;
59 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */61 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
60 __u32 seg_max;62 __virtio32 seg_max;
61 /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */63 /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
62 struct virtio_blk_geometry {64 struct virtio_blk_geometry {
63 __u16 cylinders;65 __virtio16 cylinders;
64 __u8 heads;66 __u8 heads;
65 __u8 sectors;67 __u8 sectors;
66 } geometry;68 } geometry;
6769
68 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */70 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
69 __u32 blk_size;71 __virtio32 blk_size;
7072
71 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */73 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
72 /* exponent for physical block per logical block. */74 /* exponent for physical block per logical block. */
...@@ -74,16 +76,49 @@ struct virtio_blk_config {...@@ -74,16 +76,49 @@ struct virtio_blk_config {
74 /* alignment offset in logical blocks. */76 /* alignment offset in logical blocks. */
75 __u8 alignment_offset;77 __u8 alignment_offset;
76 /* minimum I/O size without performance penalty in logical blocks. */78 /* minimum I/O size without performance penalty in logical blocks. */
77 __u16 min_io_size;79 __virtio16 min_io_size;
78 /* optimal sustained I/O size in logical blocks. */80 /* optimal sustained I/O size in logical blocks. */
79 __u32 opt_io_size;81 __virtio32 opt_io_size;
8082
81 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */83 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
82 __u8 wce;84 __u8 wce;
83 __u8 unused;85 __u8 unused;
8486
85 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */87 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
86 __u16 num_queues;88 __virtio16 num_queues;
89
90 /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */
91 /*
92 * The maximum discard sectors (in 512-byte sectors) for
93 * one segment.
94 */
95 __virtio32 max_discard_sectors;
96 /*
97 * The maximum number of discard segments in a
98 * discard command.
99 */
100 __virtio32 max_discard_seg;
101 /* Discard commands must be aligned to this number of sectors. */
102 __virtio32 discard_sector_alignment;
103
104 /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */
105 /*
106 * The maximum number of write zeroes sectors (in 512-byte sectors) in
107 * one segment.
108 */
109 __virtio32 max_write_zeroes_sectors;
110 /*
111 * The maximum number of segments in a write zeroes
112 * command.
113 */
114 __virtio32 max_write_zeroes_seg;
115 /*
116 * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the
117 * deallocation of one or more of the sectors.
118 */
119 __u8 write_zeroes_may_unmap;
120
121 __u8 unused1[3];
87} __attribute__((packed));122} __attribute__((packed));
88123
89/*124/*
...@@ -112,6 +147,12 @@ struct virtio_blk_config {...@@ -112,6 +147,12 @@ struct virtio_blk_config {
112/* Get device ID command */147/* Get device ID command */
113#define VIRTIO_BLK_T_GET_ID 8148#define VIRTIO_BLK_T_GET_ID 8
114149
150/* Discard command */
151#define VIRTIO_BLK_T_DISCARD 11
152
153/* Write zeroes command */
154#define VIRTIO_BLK_T_WRITE_ZEROES 13
155
115#ifndef VIRTIO_BLK_NO_LEGACY156#ifndef VIRTIO_BLK_NO_LEGACY
116/* Barrier before this op. */157/* Barrier before this op. */
117#define VIRTIO_BLK_T_BARRIER 0x80000000158#define VIRTIO_BLK_T_BARRIER 0x80000000
...@@ -131,6 +172,19 @@ struct virtio_blk_outhdr {...@@ -131,6 +172,19 @@ struct virtio_blk_outhdr {
131 __virtio64 sector;172 __virtio64 sector;
132};173};
133174
175/* Unmap this range (only valid for write zeroes command) */
176#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
177
178/* Discard/write zeroes range for each request. */
179struct virtio_blk_discard_write_zeroes {
180 /* discard/write zeroes start sector */
181 __le64 sector;
182 /* number of discard/write zeroes sectors */
183 __le32 num_sectors;
184 /* flags for this range */
185 __le32 flags;
186};
187
134#ifndef VIRTIO_BLK_NO_LEGACY188#ifndef VIRTIO_BLK_NO_LEGACY
135struct virtio_scsi_inhdr {189struct virtio_scsi_inhdr {
136 __virtio32 errors;190 __virtio32 errors;
lib/libc/include/any-linux-any/linux/virtio_bt.h created+31
...@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
2
3#ifndef _LINUX_VIRTIO_BT_H
4#define _LINUX_VIRTIO_BT_H
5
6#include <linux/virtio_types.h>
7
8/* Feature bits */
9#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */
10#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */
11#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */
12
13enum virtio_bt_config_type {
14 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
15 VIRTIO_BT_CONFIG_TYPE_AMP = 1,
16};
17
18enum virtio_bt_config_vendor {
19 VIRTIO_BT_CONFIG_VENDOR_NONE = 0,
20 VIRTIO_BT_CONFIG_VENDOR_ZEPHYR = 1,
21 VIRTIO_BT_CONFIG_VENDOR_INTEL = 2,
22 VIRTIO_BT_CONFIG_VENDOR_REALTEK = 3,
23};
24
25struct virtio_bt_config {
26 __u8 type;
27 __u16 vendor;
28 __u16 msft_opcode;
29} __attribute__((packed));
30
31#endif /* _LINUX_VIRTIO_BT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_config.h+14-3
...@@ -67,13 +67,24 @@...@@ -67,13 +67,24 @@
67#define VIRTIO_F_VERSION_1 3267#define VIRTIO_F_VERSION_1 32
6868
69/*69/*
70 * If clear - device has the IOMMU bypass quirk feature.70 * If clear - device has the platform DMA (e.g. IOMMU) bypass quirk feature.
71 * If set - use platform tools to detect the IOMMU.71 * If set - use platform DMA tools to access the memory.
72 *72 *
73 * Note the reverse polarity (compared to most other features),73 * Note the reverse polarity (compared to most other features),
74 * this is for compatibility with legacy systems.74 * this is for compatibility with legacy systems.
75 */75 */
76#define VIRTIO_F_IOMMU_PLATFORM 3376#define VIRTIO_F_ACCESS_PLATFORM 33
77/* Legacy name for VIRTIO_F_ACCESS_PLATFORM (for compatibility with old userspace) */
78#define VIRTIO_F_IOMMU_PLATFORM VIRTIO_F_ACCESS_PLATFORM
79
80/* This feature indicates support for the packed virtqueue layout. */
81#define VIRTIO_F_RING_PACKED 34
82
83/*
84 * This feature indicates that memory accesses by the driver and the
85 * device are ordered in a way described by the platform.
86 */
87#define VIRTIO_F_ORDER_PLATFORM 36
7788
78/*89/*
79 * Does the device support Single Root I/O Virtualization?90 * Does the device support Single Root I/O Virtualization?
lib/libc/include/any-linux-any/linux/virtio_console.h+4-4
...@@ -45,13 +45,13 @@...@@ -45,13 +45,13 @@
4545
46struct virtio_console_config {46struct virtio_console_config {
47 /* colums of the screens */47 /* colums of the screens */
48 __u16 cols;48 __virtio16 cols;
49 /* rows of the screens */49 /* rows of the screens */
50 __u16 rows;50 __virtio16 rows;
51 /* max. number of ports this device can hold */51 /* max. number of ports this device can hold */
52 __u32 max_nr_ports;52 __virtio32 max_nr_ports;
53 /* emergency write register */53 /* emergency write register */
54 __u32 emerg_wr;54 __virtio32 emerg_wr;
55} __attribute__((packed));55} __attribute__((packed));
5656
57/*57/*
lib/libc/include/any-linux-any/linux/virtio_crypto.h+13-13
...@@ -414,33 +414,33 @@ struct virtio_crypto_op_data_req {...@@ -414,33 +414,33 @@ struct virtio_crypto_op_data_req {
414414
415struct virtio_crypto_config {415struct virtio_crypto_config {
416 /* See VIRTIO_CRYPTO_OP_* above */416 /* See VIRTIO_CRYPTO_OP_* above */
417 __u32 status;417 __le32 status;
418418
419 /*419 /*
420 * Maximum number of data queue420 * Maximum number of data queue
421 */421 */
422 __u32 max_dataqueues;422 __le32 max_dataqueues;
423423
424 /*424 /*
425 * Specifies the services mask which the device support,425 * Specifies the services mask which the device support,
426 * see VIRTIO_CRYPTO_SERVICE_* above426 * see VIRTIO_CRYPTO_SERVICE_* above
427 */427 */
428 __u32 crypto_services;428 __le32 crypto_services;
429429
430 /* Detailed algorithms mask */430 /* Detailed algorithms mask */
431 __u32 cipher_algo_l;431 __le32 cipher_algo_l;
432 __u32 cipher_algo_h;432 __le32 cipher_algo_h;
433 __u32 hash_algo;433 __le32 hash_algo;
434 __u32 mac_algo_l;434 __le32 mac_algo_l;
435 __u32 mac_algo_h;435 __le32 mac_algo_h;
436 __u32 aead_algo;436 __le32 aead_algo;
437 /* Maximum length of cipher key */437 /* Maximum length of cipher key */
438 __u32 max_cipher_key_len;438 __le32 max_cipher_key_len;
439 /* Maximum length of authenticated key */439 /* Maximum length of authenticated key */
440 __u32 max_auth_key_len;440 __le32 max_auth_key_len;
441 __u32 reserve;441 __le32 reserve;
442 /* Maximum size of each crypto request's content */442 /* Maximum size of each crypto request's content */
443 __u64 max_size;443 __le64 max_size;
444};444};
445445
446struct virtio_crypto_inhdr {446struct virtio_crypto_inhdr {
lib/libc/include/any-linux-any/linux/virtio_fs.h created+22
...@@ -0,0 +1,22 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2
3#ifndef _LINUX_VIRTIO_FS_H
4#define _LINUX_VIRTIO_FS_H
5
6#include <linux/types.h>
7#include <linux/virtio_ids.h>
8#include <linux/virtio_config.h>
9#include <linux/virtio_types.h>
10
11struct virtio_fs_config {
12 /* Filesystem name (UTF-8, not NUL-terminated, padded with NULs) */
13 __u8 tag[36];
14
15 /* Number of request queues */
16 __le32 num_request_queues;
17} __attribute__((packed));
18
19/* For the id field in virtio_pci_shm_cap */
20#define VIRTIO_FS_SHMCAP_ID_CACHE 0
21
22#endif /* _LINUX_VIRTIO_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_gpio.h created+72
...@@ -0,0 +1,72 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_VIRTIO_GPIO_H
4#define _LINUX_VIRTIO_GPIO_H
5
6#include <linux/types.h>
7
8/* Virtio GPIO Feature bits */
9#define VIRTIO_GPIO_F_IRQ 0
10
11/* Virtio GPIO request types */
12#define VIRTIO_GPIO_MSG_GET_NAMES 0x0001
13#define VIRTIO_GPIO_MSG_GET_DIRECTION 0x0002
14#define VIRTIO_GPIO_MSG_SET_DIRECTION 0x0003
15#define VIRTIO_GPIO_MSG_GET_VALUE 0x0004
16#define VIRTIO_GPIO_MSG_SET_VALUE 0x0005
17#define VIRTIO_GPIO_MSG_IRQ_TYPE 0x0006
18
19/* Possible values of the status field */
20#define VIRTIO_GPIO_STATUS_OK 0x0
21#define VIRTIO_GPIO_STATUS_ERR 0x1
22
23/* Direction types */
24#define VIRTIO_GPIO_DIRECTION_NONE 0x00
25#define VIRTIO_GPIO_DIRECTION_OUT 0x01
26#define VIRTIO_GPIO_DIRECTION_IN 0x02
27
28/* Virtio GPIO IRQ types */
29#define VIRTIO_GPIO_IRQ_TYPE_NONE 0x00
30#define VIRTIO_GPIO_IRQ_TYPE_EDGE_RISING 0x01
31#define VIRTIO_GPIO_IRQ_TYPE_EDGE_FALLING 0x02
32#define VIRTIO_GPIO_IRQ_TYPE_EDGE_BOTH 0x03
33#define VIRTIO_GPIO_IRQ_TYPE_LEVEL_HIGH 0x04
34#define VIRTIO_GPIO_IRQ_TYPE_LEVEL_LOW 0x08
35
36struct virtio_gpio_config {
37 __le16 ngpio;
38 __u8 padding[2];
39 __le32 gpio_names_size;
40};
41
42/* Virtio GPIO Request / Response */
43struct virtio_gpio_request {
44 __le16 type;
45 __le16 gpio;
46 __le32 value;
47};
48
49struct virtio_gpio_response {
50 __u8 status;
51 __u8 value;
52};
53
54struct virtio_gpio_response_get_names {
55 __u8 status;
56 __u8 value[];
57};
58
59/* Virtio GPIO IRQ Request / Response */
60struct virtio_gpio_irq_request {
61 __le16 gpio;
62};
63
64struct virtio_gpio_irq_response {
65 __u8 status;
66};
67
68/* Possible values of the interrupt status field */
69#define VIRTIO_GPIO_IRQ_STATUS_INVALID 0x0
70#define VIRTIO_GPIO_IRQ_STATUS_VALID 0x1
71
72#endif /* _LINUX_VIRTIO_GPIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_gpu.h+147-8
...@@ -40,7 +40,30 @@...@@ -40,7 +40,30 @@
4040
41#include <linux/types.h>41#include <linux/types.h>
4242
43#define VIRTIO_GPU_F_VIRGL 043/*
44 * VIRTIO_GPU_CMD_CTX_*
45 * VIRTIO_GPU_CMD_*_3D
46 */
47#define VIRTIO_GPU_F_VIRGL 0
48
49/*
50 * VIRTIO_GPU_CMD_GET_EDID
51 */
52#define VIRTIO_GPU_F_EDID 1
53/*
54 * VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID
55 */
56#define VIRTIO_GPU_F_RESOURCE_UUID 2
57
58/*
59 * VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB
60 */
61#define VIRTIO_GPU_F_RESOURCE_BLOB 3
62/*
63 * VIRTIO_GPU_CMD_CREATE_CONTEXT with
64 * context_init and multiple timelines
65 */
66#define VIRTIO_GPU_F_CONTEXT_INIT 4
4467
45enum virtio_gpu_ctrl_type {68enum virtio_gpu_ctrl_type {
46 VIRTIO_GPU_UNDEFINED = 0,69 VIRTIO_GPU_UNDEFINED = 0,
...@@ -56,6 +79,10 @@ enum virtio_gpu_ctrl_type {...@@ -56,6 +79,10 @@ enum virtio_gpu_ctrl_type {
56 VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING,79 VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING,
57 VIRTIO_GPU_CMD_GET_CAPSET_INFO,80 VIRTIO_GPU_CMD_GET_CAPSET_INFO,
58 VIRTIO_GPU_CMD_GET_CAPSET,81 VIRTIO_GPU_CMD_GET_CAPSET,
82 VIRTIO_GPU_CMD_GET_EDID,
83 VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID,
84 VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB,
85 VIRTIO_GPU_CMD_SET_SCANOUT_BLOB,
5986
60 /* 3d commands */87 /* 3d commands */
61 VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,88 VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,
...@@ -66,6 +93,8 @@ enum virtio_gpu_ctrl_type {...@@ -66,6 +93,8 @@ enum virtio_gpu_ctrl_type {
66 VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D,93 VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D,
67 VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D,94 VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D,
68 VIRTIO_GPU_CMD_SUBMIT_3D,95 VIRTIO_GPU_CMD_SUBMIT_3D,
96 VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB,
97 VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB,
6998
70 /* cursor commands */99 /* cursor commands */
71 VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300,100 VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300,
...@@ -76,6 +105,9 @@ enum virtio_gpu_ctrl_type {...@@ -76,6 +105,9 @@ enum virtio_gpu_ctrl_type {
76 VIRTIO_GPU_RESP_OK_DISPLAY_INFO,105 VIRTIO_GPU_RESP_OK_DISPLAY_INFO,
77 VIRTIO_GPU_RESP_OK_CAPSET_INFO,106 VIRTIO_GPU_RESP_OK_CAPSET_INFO,
78 VIRTIO_GPU_RESP_OK_CAPSET,107 VIRTIO_GPU_RESP_OK_CAPSET,
108 VIRTIO_GPU_RESP_OK_EDID,
109 VIRTIO_GPU_RESP_OK_RESOURCE_UUID,
110 VIRTIO_GPU_RESP_OK_MAP_INFO,
79111
80 /* error responses */112 /* error responses */
81 VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200,113 VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200,
...@@ -86,14 +118,29 @@ enum virtio_gpu_ctrl_type {...@@ -86,14 +118,29 @@ enum virtio_gpu_ctrl_type {
86 VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER,118 VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER,
87};119};
88120
89#define VIRTIO_GPU_FLAG_FENCE (1 << 0)121enum virtio_gpu_shm_id {
122 VIRTIO_GPU_SHM_ID_UNDEFINED = 0,
123 /*
124 * VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB
125 * VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB
126 */
127 VIRTIO_GPU_SHM_ID_HOST_VISIBLE = 1
128};
129
130#define VIRTIO_GPU_FLAG_FENCE (1 << 0)
131/*
132 * If the following flag is set, then ring_idx contains the index
133 * of the command ring that needs to used when creating the fence
134 */
135#define VIRTIO_GPU_FLAG_INFO_RING_IDX (1 << 1)
90136
91struct virtio_gpu_ctrl_hdr {137struct virtio_gpu_ctrl_hdr {
92 __le32 type;138 __le32 type;
93 __le32 flags;139 __le32 flags;
94 __le64 fence_id;140 __le64 fence_id;
95 __le32 ctx_id;141 __le32 ctx_id;
96 __le32 padding;142 __u8 ring_idx;
143 __u8 padding[3];
97};144};
98145
99/* data passed in the cursor vq */146/* data passed in the cursor vq */
...@@ -233,10 +280,11 @@ struct virtio_gpu_resource_create_3d {...@@ -233,10 +280,11 @@ struct virtio_gpu_resource_create_3d {
233};280};
234281
235/* VIRTIO_GPU_CMD_CTX_CREATE */282/* VIRTIO_GPU_CMD_CTX_CREATE */
283#define VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK 0x000000ff
236struct virtio_gpu_ctx_create {284struct virtio_gpu_ctx_create {
237 struct virtio_gpu_ctrl_hdr hdr;285 struct virtio_gpu_ctrl_hdr hdr;
238 __le32 nlen;286 __le32 nlen;
239 __le32 padding;287 __le32 context_init;
240 char debug_name[64];288 char debug_name[64];
241};289};
242290
...@@ -291,13 +339,28 @@ struct virtio_gpu_resp_capset {...@@ -291,13 +339,28 @@ struct virtio_gpu_resp_capset {
291 __u8 capset_data[];339 __u8 capset_data[];
292};340};
293341
342/* VIRTIO_GPU_CMD_GET_EDID */
343struct virtio_gpu_cmd_get_edid {
344 struct virtio_gpu_ctrl_hdr hdr;
345 __le32 scanout;
346 __le32 padding;
347};
348
349/* VIRTIO_GPU_RESP_OK_EDID */
350struct virtio_gpu_resp_edid {
351 struct virtio_gpu_ctrl_hdr hdr;
352 __le32 size;
353 __le32 padding;
354 __u8 edid[1024];
355};
356
294#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)357#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)
295358
296struct virtio_gpu_config {359struct virtio_gpu_config {
297 __u32 events_read;360 __le32 events_read;
298 __u32 events_clear;361 __le32 events_clear;
299 __u32 num_scanouts;362 __le32 num_scanouts;
300 __u32 num_capsets;363 __le32 num_capsets;
301};364};
302365
303/* simple formats for fbcon/X use */366/* simple formats for fbcon/X use */
...@@ -314,4 +377,80 @@ enum virtio_gpu_formats {...@@ -314,4 +377,80 @@ enum virtio_gpu_formats {
314 VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM = 134,377 VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM = 134,
315};378};
316379
380/* VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID */
381struct virtio_gpu_resource_assign_uuid {
382 struct virtio_gpu_ctrl_hdr hdr;
383 __le32 resource_id;
384 __le32 padding;
385};
386
387/* VIRTIO_GPU_RESP_OK_RESOURCE_UUID */
388struct virtio_gpu_resp_resource_uuid {
389 struct virtio_gpu_ctrl_hdr hdr;
390 __u8 uuid[16];
391};
392
393/* VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB */
394struct virtio_gpu_resource_create_blob {
395 struct virtio_gpu_ctrl_hdr hdr;
396 __le32 resource_id;
397#define VIRTIO_GPU_BLOB_MEM_GUEST 0x0001
398#define VIRTIO_GPU_BLOB_MEM_HOST3D 0x0002
399#define VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST 0x0003
400
401#define VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE 0x0001
402#define VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE 0x0002
403#define VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
404 /* zero is invalid blob mem */
405 __le32 blob_mem;
406 __le32 blob_flags;
407 __le32 nr_entries;
408 __le64 blob_id;
409 __le64 size;
410 /*
411 * sizeof(nr_entries * virtio_gpu_mem_entry) bytes follow
412 */
413};
414
415/* VIRTIO_GPU_CMD_SET_SCANOUT_BLOB */
416struct virtio_gpu_set_scanout_blob {
417 struct virtio_gpu_ctrl_hdr hdr;
418 struct virtio_gpu_rect r;
419 __le32 scanout_id;
420 __le32 resource_id;
421 __le32 width;
422 __le32 height;
423 __le32 format;
424 __le32 padding;
425 __le32 strides[4];
426 __le32 offsets[4];
427};
428
429/* VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB */
430struct virtio_gpu_resource_map_blob {
431 struct virtio_gpu_ctrl_hdr hdr;
432 __le32 resource_id;
433 __le32 padding;
434 __le64 offset;
435};
436
437/* VIRTIO_GPU_RESP_OK_MAP_INFO */
438#define VIRTIO_GPU_MAP_CACHE_MASK 0x0f
439#define VIRTIO_GPU_MAP_CACHE_NONE 0x00
440#define VIRTIO_GPU_MAP_CACHE_CACHED 0x01
441#define VIRTIO_GPU_MAP_CACHE_UNCACHED 0x02
442#define VIRTIO_GPU_MAP_CACHE_WC 0x03
443struct virtio_gpu_resp_map_info {
444 struct virtio_gpu_ctrl_hdr hdr;
445 __u32 map_info;
446 __u32 padding;
447};
448
449/* VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB */
450struct virtio_gpu_resource_unmap_blob {
451 struct virtio_gpu_ctrl_hdr hdr;
452 __le32 resource_id;
453 __le32 padding;
454};
455
317#endif456#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_i2c.h created+47
...@@ -0,0 +1,47 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
2/*
3 * Definitions for virtio I2C Adpter
4 *
5 * Copyright (c) 2021 Intel Corporation. All rights reserved.
6 */
7
8#ifndef _LINUX_VIRTIO_I2C_H
9#define _LINUX_VIRTIO_I2C_H
10
11#include <linux/const.h>
12#include <linux/types.h>
13
14/* Virtio I2C Feature bits */
15#define VIRTIO_I2C_F_ZERO_LENGTH_REQUEST 0
16
17/* The bit 0 of the @virtio_i2c_out_hdr.@flags, used to group the requests */
18#define VIRTIO_I2C_FLAGS_FAIL_NEXT _BITUL(0)
19
20/* The bit 1 of the @virtio_i2c_out_hdr.@flags, used to mark a buffer as read */
21#define VIRTIO_I2C_FLAGS_M_RD _BITUL(1)
22
23/**
24 * struct virtio_i2c_out_hdr - the virtio I2C message OUT header
25 * @addr: the controlled device address
26 * @padding: used to pad to full dword
27 * @flags: used for feature extensibility
28 */
29struct virtio_i2c_out_hdr {
30 __le16 addr;
31 __le16 padding;
32 __le32 flags;
33};
34
35/**
36 * struct virtio_i2c_in_hdr - the virtio I2C message IN header
37 * @status: the processing result from the backend
38 */
39struct virtio_i2c_in_hdr {
40 __u8 status;
41};
42
43/* The final status written by the device */
44#define VIRTIO_I2C_MSG_OK 0
45#define VIRTIO_I2C_MSG_ERR 1
46
47#endif /* _LINUX_VIRTIO_I2C_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_ids.h+51-14
...@@ -29,19 +29,56 @@...@@ -29,19 +29,56 @@
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE. */30 * SUCH DAMAGE. */
3131
32#define VIRTIO_ID_NET 1 /* virtio net */32#define VIRTIO_ID_NET 1 /* virtio net */
33#define VIRTIO_ID_BLOCK 2 /* virtio block */33#define VIRTIO_ID_BLOCK 2 /* virtio block */
34#define VIRTIO_ID_CONSOLE 3 /* virtio console */34#define VIRTIO_ID_CONSOLE 3 /* virtio console */
35#define VIRTIO_ID_RNG 4 /* virtio rng */35#define VIRTIO_ID_RNG 4 /* virtio rng */
36#define VIRTIO_ID_BALLOON 5 /* virtio balloon */36#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
37#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */37#define VIRTIO_ID_IOMEM 6 /* virtio ioMemory */
38#define VIRTIO_ID_SCSI 8 /* virtio scsi */38#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */
39#define VIRTIO_ID_9P 9 /* 9p virtio console */39#define VIRTIO_ID_SCSI 8 /* virtio scsi */
40#define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */40#define VIRTIO_ID_9P 9 /* 9p virtio console */
41#define VIRTIO_ID_CAIF 12 /* Virtio caif */41#define VIRTIO_ID_MAC80211_WLAN 10 /* virtio WLAN MAC */
42#define VIRTIO_ID_GPU 16 /* virtio GPU */42#define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */
43#define VIRTIO_ID_INPUT 18 /* virtio input */43#define VIRTIO_ID_CAIF 12 /* Virtio caif */
44#define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */44#define VIRTIO_ID_MEMORY_BALLOON 13 /* virtio memory balloon */
45#define VIRTIO_ID_CRYPTO 20 /* virtio crypto */45#define VIRTIO_ID_GPU 16 /* virtio GPU */
46#define VIRTIO_ID_CLOCK 17 /* virtio clock/timer */
47#define VIRTIO_ID_INPUT 18 /* virtio input */
48#define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */
49#define VIRTIO_ID_CRYPTO 20 /* virtio crypto */
50#define VIRTIO_ID_SIGNAL_DIST 21 /* virtio signal distribution device */
51#define VIRTIO_ID_PSTORE 22 /* virtio pstore device */
52#define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */
53#define VIRTIO_ID_MEM 24 /* virtio mem */
54#define VIRTIO_ID_SOUND 25 /* virtio sound */
55#define VIRTIO_ID_FS 26 /* virtio filesystem */
56#define VIRTIO_ID_PMEM 27 /* virtio pmem */
57#define VIRTIO_ID_RPMB 28 /* virtio rpmb */
58#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */
59#define VIRTIO_ID_VIDEO_ENCODER 30 /* virtio video encoder */
60#define VIRTIO_ID_VIDEO_DECODER 31 /* virtio video decoder */
61#define VIRTIO_ID_SCMI 32 /* virtio SCMI */
62#define VIRTIO_ID_NITRO_SEC_MOD 33 /* virtio nitro secure module*/
63#define VIRTIO_ID_I2C_ADAPTER 34 /* virtio i2c adapter */
64#define VIRTIO_ID_WATCHDOG 35 /* virtio watchdog */
65#define VIRTIO_ID_CAN 36 /* virtio can */
66#define VIRTIO_ID_DMABUF 37 /* virtio dmabuf */
67#define VIRTIO_ID_PARAM_SERV 38 /* virtio parameter server */
68#define VIRTIO_ID_AUDIO_POLICY 39 /* virtio audio policy */
69#define VIRTIO_ID_BT 40 /* virtio bluetooth */
70#define VIRTIO_ID_GPIO 41 /* virtio gpio */
71
72/*
73 * Virtio Transitional IDs
74 */
75
76#define VIRTIO_TRANS_ID_NET 1000 /* transitional virtio net */
77#define VIRTIO_TRANS_ID_BLOCK 1001 /* transitional virtio block */
78#define VIRTIO_TRANS_ID_BALLOON 1002 /* transitional virtio balloon */
79#define VIRTIO_TRANS_ID_CONSOLE 1003 /* transitional virtio console */
80#define VIRTIO_TRANS_ID_SCSI 1004 /* transitional virtio SCSI */
81#define VIRTIO_TRANS_ID_RNG 1005 /* transitional virtio rng */
82#define VIRTIO_TRANS_ID_9P 1009 /* transitional virtio 9p console */
4683
47#endif /* _LINUX_VIRTIO_IDS_H */84#endif /* _LINUX_VIRTIO_IDS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_input.h+9-9
...@@ -40,18 +40,18 @@ enum virtio_input_config_select {...@@ -40,18 +40,18 @@ enum virtio_input_config_select {
40};40};
4141
42struct virtio_input_absinfo {42struct virtio_input_absinfo {
43 __u32 min;43 __le32 min;
44 __u32 max;44 __le32 max;
45 __u32 fuzz;45 __le32 fuzz;
46 __u32 flat;46 __le32 flat;
47 __u32 res;47 __le32 res;
48};48};
4949
50struct virtio_input_devids {50struct virtio_input_devids {
51 __u16 bustype;51 __le16 bustype;
52 __u16 vendor;52 __le16 vendor;
53 __u16 product;53 __le16 product;
54 __u16 version;54 __le16 version;
55};55};
5656
57struct virtio_input_config {57struct virtio_input_config {
lib/libc/include/any-linux-any/linux/virtio_iommu.h created+165
...@@ -0,0 +1,165 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Virtio-iommu definition v0.12
4 *
5 * Copyright (C) 2019 Arm Ltd.
6 */
7#ifndef _LINUX_VIRTIO_IOMMU_H
8#define _LINUX_VIRTIO_IOMMU_H
9
10#include <linux/types.h>
11
12/* Feature bits */
13#define VIRTIO_IOMMU_F_INPUT_RANGE 0
14#define VIRTIO_IOMMU_F_DOMAIN_RANGE 1
15#define VIRTIO_IOMMU_F_MAP_UNMAP 2
16#define VIRTIO_IOMMU_F_BYPASS 3
17#define VIRTIO_IOMMU_F_PROBE 4
18#define VIRTIO_IOMMU_F_MMIO 5
19
20struct virtio_iommu_range_64 {
21 __le64 start;
22 __le64 end;
23};
24
25struct virtio_iommu_range_32 {
26 __le32 start;
27 __le32 end;
28};
29
30struct virtio_iommu_config {
31 /* Supported page sizes */
32 __le64 page_size_mask;
33 /* Supported IOVA range */
34 struct virtio_iommu_range_64 input_range;
35 /* Max domain ID size */
36 struct virtio_iommu_range_32 domain_range;
37 /* Probe buffer size */
38 __le32 probe_size;
39};
40
41/* Request types */
42#define VIRTIO_IOMMU_T_ATTACH 0x01
43#define VIRTIO_IOMMU_T_DETACH 0x02
44#define VIRTIO_IOMMU_T_MAP 0x03
45#define VIRTIO_IOMMU_T_UNMAP 0x04
46#define VIRTIO_IOMMU_T_PROBE 0x05
47
48/* Status types */
49#define VIRTIO_IOMMU_S_OK 0x00
50#define VIRTIO_IOMMU_S_IOERR 0x01
51#define VIRTIO_IOMMU_S_UNSUPP 0x02
52#define VIRTIO_IOMMU_S_DEVERR 0x03
53#define VIRTIO_IOMMU_S_INVAL 0x04
54#define VIRTIO_IOMMU_S_RANGE 0x05
55#define VIRTIO_IOMMU_S_NOENT 0x06
56#define VIRTIO_IOMMU_S_FAULT 0x07
57#define VIRTIO_IOMMU_S_NOMEM 0x08
58
59struct virtio_iommu_req_head {
60 __u8 type;
61 __u8 reserved[3];
62};
63
64struct virtio_iommu_req_tail {
65 __u8 status;
66 __u8 reserved[3];
67};
68
69struct virtio_iommu_req_attach {
70 struct virtio_iommu_req_head head;
71 __le32 domain;
72 __le32 endpoint;
73 __u8 reserved[8];
74 struct virtio_iommu_req_tail tail;
75};
76
77struct virtio_iommu_req_detach {
78 struct virtio_iommu_req_head head;
79 __le32 domain;
80 __le32 endpoint;
81 __u8 reserved[8];
82 struct virtio_iommu_req_tail tail;
83};
84
85#define VIRTIO_IOMMU_MAP_F_READ (1 << 0)
86#define VIRTIO_IOMMU_MAP_F_WRITE (1 << 1)
87#define VIRTIO_IOMMU_MAP_F_MMIO (1 << 2)
88
89#define VIRTIO_IOMMU_MAP_F_MASK (VIRTIO_IOMMU_MAP_F_READ | \
90 VIRTIO_IOMMU_MAP_F_WRITE | \
91 VIRTIO_IOMMU_MAP_F_MMIO)
92
93struct virtio_iommu_req_map {
94 struct virtio_iommu_req_head head;
95 __le32 domain;
96 __le64 virt_start;
97 __le64 virt_end;
98 __le64 phys_start;
99 __le32 flags;
100 struct virtio_iommu_req_tail tail;
101};
102
103struct virtio_iommu_req_unmap {
104 struct virtio_iommu_req_head head;
105 __le32 domain;
106 __le64 virt_start;
107 __le64 virt_end;
108 __u8 reserved[4];
109 struct virtio_iommu_req_tail tail;
110};
111
112#define VIRTIO_IOMMU_PROBE_T_NONE 0
113#define VIRTIO_IOMMU_PROBE_T_RESV_MEM 1
114
115#define VIRTIO_IOMMU_PROBE_T_MASK 0xfff
116
117struct virtio_iommu_probe_property {
118 __le16 type;
119 __le16 length;
120};
121
122#define VIRTIO_IOMMU_RESV_MEM_T_RESERVED 0
123#define VIRTIO_IOMMU_RESV_MEM_T_MSI 1
124
125struct virtio_iommu_probe_resv_mem {
126 struct virtio_iommu_probe_property head;
127 __u8 subtype;
128 __u8 reserved[3];
129 __le64 start;
130 __le64 end;
131};
132
133struct virtio_iommu_req_probe {
134 struct virtio_iommu_req_head head;
135 __le32 endpoint;
136 __u8 reserved[64];
137
138 __u8 properties[];
139
140 /*
141 * Tail follows the variable-length properties array. No padding,
142 * property lengths are all aligned on 8 bytes.
143 */
144};
145
146/* Fault types */
147#define VIRTIO_IOMMU_FAULT_R_UNKNOWN 0
148#define VIRTIO_IOMMU_FAULT_R_DOMAIN 1
149#define VIRTIO_IOMMU_FAULT_R_MAPPING 2
150
151#define VIRTIO_IOMMU_FAULT_F_READ (1 << 0)
152#define VIRTIO_IOMMU_FAULT_F_WRITE (1 << 1)
153#define VIRTIO_IOMMU_FAULT_F_EXEC (1 << 2)
154#define VIRTIO_IOMMU_FAULT_F_ADDRESS (1 << 8)
155
156struct virtio_iommu_fault {
157 __u8 reason;
158 __u8 reserved[3];
159 __le32 flags;
160 __le32 endpoint;
161 __u8 reserved2[4];
162 __le64 address;
163};
164
165#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_mem.h created+214
...@@ -0,0 +1,214 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Virtio Mem Device
4 *
5 * Copyright Red Hat, Inc. 2020
6 *
7 * Authors:
8 * David Hildenbrand <david@redhat.com>
9 *
10 * This header is BSD licensed so anyone can use the definitions
11 * to implement compatible drivers/servers:
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of IBM nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
31 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
34 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef _LINUX_VIRTIO_MEM_H
39#define _LINUX_VIRTIO_MEM_H
40
41#include <linux/types.h>
42#include <linux/virtio_types.h>
43#include <linux/virtio_ids.h>
44#include <linux/virtio_config.h>
45
46/*
47 * Each virtio-mem device manages a dedicated region in physical address
48 * space. Each device can belong to a single NUMA node, multiple devices
49 * for a single NUMA node are possible. A virtio-mem device is like a
50 * "resizable DIMM" consisting of small memory blocks that can be plugged
51 * or unplugged. The device driver is responsible for (un)plugging memory
52 * blocks on demand.
53 *
54 * Virtio-mem devices can only operate on their assigned memory region in
55 * order to (un)plug memory. A device cannot (un)plug memory belonging to
56 * other devices.
57 *
58 * The "region_size" corresponds to the maximum amount of memory that can
59 * be provided by a device. The "size" corresponds to the amount of memory
60 * that is currently plugged. "requested_size" corresponds to a request
61 * from the device to the device driver to (un)plug blocks. The
62 * device driver should try to (un)plug blocks in order to reach the
63 * "requested_size". It is impossible to plug more memory than requested.
64 *
65 * The "usable_region_size" represents the memory region that can actually
66 * be used to (un)plug memory. It is always at least as big as the
67 * "requested_size" and will grow dynamically. It will only shrink when
68 * explicitly triggered (VIRTIO_MEM_REQ_UNPLUG).
69 *
70 * There are no guarantees what will happen if unplugged memory is
71 * read/written. In general, unplugged memory should not be touched, because
72 * the resulting action is undefined. There is one exception: without
73 * VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, unplugged memory inside the usable
74 * region can be read, to simplify creation of memory dumps.
75 *
76 * It can happen that the device cannot process a request, because it is
77 * busy. The device driver has to retry later.
78 *
79 * Usually, during system resets all memory will get unplugged, so the
80 * device driver can start with a clean state. However, in specific
81 * scenarios (if the device is busy) it can happen that the device still
82 * has memory plugged. The device driver can request to unplug all memory
83 * (VIRTIO_MEM_REQ_UNPLUG) - which might take a while to succeed if the
84 * device is busy.
85 */
86
87/* --- virtio-mem: feature bits --- */
88
89/* node_id is an ACPI PXM and is valid */
90#define VIRTIO_MEM_F_ACPI_PXM 0
91/* unplugged memory must not be accessed */
92#define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
93
94
95/* --- virtio-mem: guest -> host requests --- */
96
97/* request to plug memory blocks */
98#define VIRTIO_MEM_REQ_PLUG 0
99/* request to unplug memory blocks */
100#define VIRTIO_MEM_REQ_UNPLUG 1
101/* request to unplug all blocks and shrink the usable size */
102#define VIRTIO_MEM_REQ_UNPLUG_ALL 2
103/* request information about the plugged state of memory blocks */
104#define VIRTIO_MEM_REQ_STATE 3
105
106struct virtio_mem_req_plug {
107 __virtio64 addr;
108 __virtio16 nb_blocks;
109 __virtio16 padding[3];
110};
111
112struct virtio_mem_req_unplug {
113 __virtio64 addr;
114 __virtio16 nb_blocks;
115 __virtio16 padding[3];
116};
117
118struct virtio_mem_req_state {
119 __virtio64 addr;
120 __virtio16 nb_blocks;
121 __virtio16 padding[3];
122};
123
124struct virtio_mem_req {
125 __virtio16 type;
126 __virtio16 padding[3];
127
128 union {
129 struct virtio_mem_req_plug plug;
130 struct virtio_mem_req_unplug unplug;
131 struct virtio_mem_req_state state;
132 } u;
133};
134
135
136/* --- virtio-mem: host -> guest response --- */
137
138/*
139 * Request processed successfully, applicable for
140 * - VIRTIO_MEM_REQ_PLUG
141 * - VIRTIO_MEM_REQ_UNPLUG
142 * - VIRTIO_MEM_REQ_UNPLUG_ALL
143 * - VIRTIO_MEM_REQ_STATE
144 */
145#define VIRTIO_MEM_RESP_ACK 0
146/*
147 * Request denied - e.g. trying to plug more than requested, applicable for
148 * - VIRTIO_MEM_REQ_PLUG
149 */
150#define VIRTIO_MEM_RESP_NACK 1
151/*
152 * Request cannot be processed right now, try again later, applicable for
153 * - VIRTIO_MEM_REQ_PLUG
154 * - VIRTIO_MEM_REQ_UNPLUG
155 * - VIRTIO_MEM_REQ_UNPLUG_ALL
156 */
157#define VIRTIO_MEM_RESP_BUSY 2
158/*
159 * Error in request (e.g. addresses/alignment), applicable for
160 * - VIRTIO_MEM_REQ_PLUG
161 * - VIRTIO_MEM_REQ_UNPLUG
162 * - VIRTIO_MEM_REQ_STATE
163 */
164#define VIRTIO_MEM_RESP_ERROR 3
165
166
167/* State of memory blocks is "plugged" */
168#define VIRTIO_MEM_STATE_PLUGGED 0
169/* State of memory blocks is "unplugged" */
170#define VIRTIO_MEM_STATE_UNPLUGGED 1
171/* State of memory blocks is "mixed" */
172#define VIRTIO_MEM_STATE_MIXED 2
173
174struct virtio_mem_resp_state {
175 __virtio16 state;
176};
177
178struct virtio_mem_resp {
179 __virtio16 type;
180 __virtio16 padding[3];
181
182 union {
183 struct virtio_mem_resp_state state;
184 } u;
185};
186
187/* --- virtio-mem: configuration --- */
188
189struct virtio_mem_config {
190 /* Block size and alignment. Cannot change. */
191 __le64 block_size;
192 /* Valid with VIRTIO_MEM_F_ACPI_PXM. Cannot change. */
193 __le16 node_id;
194 __u8 padding[6];
195 /* Start address of the memory region. Cannot change. */
196 __le64 addr;
197 /* Region size (maximum). Cannot change. */
198 __le64 region_size;
199 /*
200 * Currently usable region size. Can grow up to region_size. Can
201 * shrink due to VIRTIO_MEM_REQ_UNPLUG_ALL (in which case no config
202 * update will be sent).
203 */
204 __le64 usable_region_size;
205 /*
206 * Currently used size. Changes due to plug/unplug requests, but no
207 * config updates will be sent.
208 */
209 __le64 plugged_size;
210 /* Requested size. New plug requests cannot exceed it. Can change. */
211 __le64 requested_size;
212};
213
214#endif /* _LINUX_VIRTIO_MEM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_mmio.h+11
...@@ -122,6 +122,17 @@...@@ -122,6 +122,17 @@
122#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0122#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0
123#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4123#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4
124124
125/* Shared memory region id */
126#define VIRTIO_MMIO_SHM_SEL 0x0ac
127
128/* Shared memory region length, 64 bits in two halves */
129#define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0
130#define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4
131
132/* Shared memory region base address, 64 bits in two halves */
133#define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8
134#define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc
135
125/* Configuration atomicity value */136/* Configuration atomicity value */
126#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc137#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc
127138
lib/libc/include/any-linux-any/linux/virtio_net.h+102-8
...@@ -57,6 +57,9 @@...@@ -57,6 +57,9 @@
57 * Steering */57 * Steering */
58#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */58#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
5959
60#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
61#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
62#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
60#define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device63#define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device
61 * with the same MAC.64 * with the same MAC.
62 */65 */
...@@ -69,29 +72,46 @@...@@ -69,29 +72,46 @@
69#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */72#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
70#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */73#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
7174
75/* supported/enabled hash types */
76#define VIRTIO_NET_RSS_HASH_TYPE_IPv4 (1 << 0)
77#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4 (1 << 1)
78#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4 (1 << 2)
79#define VIRTIO_NET_RSS_HASH_TYPE_IPv6 (1 << 3)
80#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6 (1 << 4)
81#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6 (1 << 5)
82#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX (1 << 6)
83#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX (1 << 7)
84#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX (1 << 8)
85
72struct virtio_net_config {86struct virtio_net_config {
73 /* The config defining mac address (if VIRTIO_NET_F_MAC) */87 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
74 __u8 mac[ETH_ALEN];88 __u8 mac[ETH_ALEN];
75 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */89 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
76 __u16 status;90 __virtio16 status;
77 /* Maximum number of each of transmit and receive queues;91 /* Maximum number of each of transmit and receive queues;
78 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.92 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
79 * Legal values are between 1 and 0x800093 * Legal values are between 1 and 0x8000
80 */94 */
81 __u16 max_virtqueue_pairs;95 __virtio16 max_virtqueue_pairs;
82 /* Default maximum transmit unit advice */96 /* Default maximum transmit unit advice */
83 __u16 mtu;97 __virtio16 mtu;
84 /*98 /*
85 * speed, in units of 1Mb. All values 0 to INT_MAX are legal.99 * speed, in units of 1Mb. All values 0 to INT_MAX are legal.
86 * Any other value stands for unknown.100 * Any other value stands for unknown.
87 */101 */
88 __u32 speed;102 __le32 speed;
89 /*103 /*
90 * 0x00 - half duplex104 * 0x00 - half duplex
91 * 0x01 - full duplex105 * 0x01 - full duplex
92 * Any other value stands for unknown.106 * Any other value stands for unknown.
93 */107 */
94 __u8 duplex;108 __u8 duplex;
109 /* maximum size of RSS key */
110 __u8 rss_max_key_size;
111 /* maximum number of indirection table entries */
112 __le16 rss_max_indirection_table_length;
113 /* bitmask of supported VIRTIO_NET_RSS_HASH_ types */
114 __le32 supported_hash_types;
95} __attribute__((packed));115} __attribute__((packed));
96116
97/*117/*
...@@ -104,6 +124,7 @@ struct virtio_net_config {...@@ -104,6 +124,7 @@ struct virtio_net_config {
104struct virtio_net_hdr_v1 {124struct virtio_net_hdr_v1 {
105#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */125#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */
106#define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */126#define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */
127#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc info in csum_ fields */
107 __u8 flags;128 __u8 flags;
108#define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */129#define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */
109#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */130#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */
...@@ -113,11 +134,46 @@ struct virtio_net_hdr_v1 {...@@ -113,11 +134,46 @@ struct virtio_net_hdr_v1 {
113 __u8 gso_type;134 __u8 gso_type;
114 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */135 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
115 __virtio16 gso_size; /* Bytes to append to hdr_len per frame */136 __virtio16 gso_size; /* Bytes to append to hdr_len per frame */
116 __virtio16 csum_start; /* Position to start checksumming from */137 union {
117 __virtio16 csum_offset; /* Offset after that to place checksum */138 struct {
139 __virtio16 csum_start;
140 __virtio16 csum_offset;
141 };
142 /* Checksum calculation */
143 struct {
144 /* Position to start checksumming from */
145 __virtio16 start;
146 /* Offset after that to place checksum */
147 __virtio16 offset;
148 } csum;
149 /* Receive Segment Coalescing */
150 struct {
151 /* Number of coalesced segments */
152 __le16 segments;
153 /* Number of duplicated acks */
154 __le16 dup_acks;
155 } rsc;
156 };
118 __virtio16 num_buffers; /* Number of merged rx buffers */157 __virtio16 num_buffers; /* Number of merged rx buffers */
119};158};
120159
160struct virtio_net_hdr_v1_hash {
161 struct virtio_net_hdr_v1 hdr;
162 __le32 hash_value;
163#define VIRTIO_NET_HASH_REPORT_NONE 0
164#define VIRTIO_NET_HASH_REPORT_IPv4 1
165#define VIRTIO_NET_HASH_REPORT_TCPv4 2
166#define VIRTIO_NET_HASH_REPORT_UDPv4 3
167#define VIRTIO_NET_HASH_REPORT_IPv6 4
168#define VIRTIO_NET_HASH_REPORT_TCPv6 5
169#define VIRTIO_NET_HASH_REPORT_UDPv6 6
170#define VIRTIO_NET_HASH_REPORT_IPv6_EX 7
171#define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8
172#define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9
173 __le16 hash_report;
174 __le16 padding;
175};
176
121#ifndef VIRTIO_NET_NO_LEGACY177#ifndef VIRTIO_NET_NO_LEGACY
122/* This header comes first in the scatter-gather list.178/* This header comes first in the scatter-gather list.
123 * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must179 * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
...@@ -228,7 +284,9 @@ struct virtio_net_ctrl_mac {...@@ -228,7 +284,9 @@ struct virtio_net_ctrl_mac {
228284
229/*285/*
230 * Control Receive Flow Steering286 * Control Receive Flow Steering
231 *287 */
288#define VIRTIO_NET_CTRL_MQ 4
289/*
232 * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET290 * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
233 * enables Receive Flow Steering, specifying the number of the transmit and291 * enables Receive Flow Steering, specifying the number of the transmit and
234 * receive queues that will be used. After the command is consumed and acked by292 * receive queues that will be used. After the command is consumed and acked by
...@@ -241,11 +299,47 @@ struct virtio_net_ctrl_mq {...@@ -241,11 +299,47 @@ struct virtio_net_ctrl_mq {
241 __virtio16 virtqueue_pairs;299 __virtio16 virtqueue_pairs;
242};300};
243301
244#define VIRTIO_NET_CTRL_MQ 4
245 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0302 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0
246 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1303 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1
247 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000304 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000
248305
306/*
307 * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as
308 * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures
309 * the receive steering to use a hash calculated for incoming packet
310 * to decide on receive virtqueue to place the packet. The command
311 * also provides parameters to calculate a hash and receive virtqueue.
312 */
313struct virtio_net_rss_config {
314 __le32 hash_types;
315 __le16 indirection_table_mask;
316 __le16 unclassified_queue;
317 __le16 indirection_table[1/* + indirection_table_mask */];
318 __le16 max_tx_vq;
319 __u8 hash_key_length;
320 __u8 hash_key_data[/* hash_key_length */];
321};
322
323 #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG 1
324
325/*
326 * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device
327 * to include in the virtio header of the packet the value of the
328 * calculated hash and the report type of hash. It also provides
329 * parameters for hash calculation. The command requires feature
330 * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the
331 * layout of virtio header as defined in virtio_net_hdr_v1_hash.
332 */
333struct virtio_net_hash_config {
334 __le32 hash_types;
335 /* for compatibility with virtio_net_rss_config */
336 __le16 reserved[4];
337 __u8 hash_key_length;
338 __u8 hash_key_data[/* hash_key_length */];
339};
340
341 #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG 2
342
249/*343/*
250 * Control network offloads344 * Control network offloads
251 *345 *
lib/libc/include/any-linux-any/linux/virtio_pci.h+10-1
...@@ -113,6 +113,8 @@...@@ -113,6 +113,8 @@
113#define VIRTIO_PCI_CAP_DEVICE_CFG 4113#define VIRTIO_PCI_CAP_DEVICE_CFG 4
114/* PCI configuration access */114/* PCI configuration access */
115#define VIRTIO_PCI_CAP_PCI_CFG 5115#define VIRTIO_PCI_CAP_PCI_CFG 5
116/* Additional shared memory capability */
117#define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
116118
117/* This is the PCI capability header: */119/* This is the PCI capability header: */
118struct virtio_pci_cap {120struct virtio_pci_cap {
...@@ -121,11 +123,18 @@ struct virtio_pci_cap {...@@ -121,11 +123,18 @@ struct virtio_pci_cap {
121 __u8 cap_len; /* Generic PCI field: capability length */123 __u8 cap_len; /* Generic PCI field: capability length */
122 __u8 cfg_type; /* Identifies the structure. */124 __u8 cfg_type; /* Identifies the structure. */
123 __u8 bar; /* Where to find it. */125 __u8 bar; /* Where to find it. */
124 __u8 padding[3]; /* Pad to full dword. */126 __u8 id; /* Multiple capabilities of the same type */
127 __u8 padding[2]; /* Pad to full dword. */
125 __le32 offset; /* Offset within bar. */128 __le32 offset; /* Offset within bar. */
126 __le32 length; /* Length of the structure, in bytes. */129 __le32 length; /* Length of the structure, in bytes. */
127};130};
128131
132struct virtio_pci_cap64 {
133 struct virtio_pci_cap cap;
134 __le32 offset_hi; /* Most sig 32 bits of offset */
135 __le32 length_hi; /* Most sig 32 bits of length */
136};
137
129struct virtio_pci_notify_cap {138struct virtio_pci_notify_cap {
130 struct virtio_pci_cap cap;139 struct virtio_pci_cap cap;
131 __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */140 __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */
lib/libc/include/any-linux-any/linux/virtio_pcidev.h created+65
...@@ -0,0 +1,65 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * Copyright (C) 2021 Intel Corporation
4 * Author: Johannes Berg <johannes@sipsolutions.net>
5 */
6#ifndef _LINUX_VIRTIO_PCIDEV_H
7#define _LINUX_VIRTIO_PCIDEV_H
8#include <linux/types.h>
9
10/**
11 * enum virtio_pcidev_ops - virtual PCI device operations
12 * @VIRTIO_PCIDEV_OP_RESERVED: reserved to catch errors
13 * @VIRTIO_PCIDEV_OP_CFG_READ: read config space, size is 1, 2, 4 or 8;
14 * the @data field should be filled in by the device (in little endian).
15 * @VIRTIO_PCIDEV_OP_CFG_WRITE: write config space, size is 1, 2, 4 or 8;
16 * the @data field contains the data to write (in little endian).
17 * @VIRTIO_PCIDEV_OP_MMIO_READ: read BAR mem/pio, size can be variable;
18 * the @data field should be filled in by the device (in little endian).
19 * @VIRTIO_PCIDEV_OP_MMIO_WRITE: write BAR mem/pio, size can be variable;
20 * the @data field contains the data to write (in little endian).
21 * @VIRTIO_PCIDEV_OP_MMIO_MEMSET: memset MMIO, size is variable but
22 * the @data field only has one byte (unlike @VIRTIO_PCIDEV_OP_MMIO_WRITE)
23 * @VIRTIO_PCIDEV_OP_INT: legacy INTx# pin interrupt, the addr field is 1-4 for
24 * the number
25 * @VIRTIO_PCIDEV_OP_MSI: MSI(-X) interrupt, this message basically transports
26 * the 16- or 32-bit write that would otherwise be done into memory,
27 * analogous to the write messages (@VIRTIO_PCIDEV_OP_MMIO_WRITE) above
28 * @VIRTIO_PCIDEV_OP_PME: Dummy message whose content is ignored (and should be
29 * all zeroes) to signal the PME# pin.
30 */
31enum virtio_pcidev_ops {
32 VIRTIO_PCIDEV_OP_RESERVED = 0,
33 VIRTIO_PCIDEV_OP_CFG_READ,
34 VIRTIO_PCIDEV_OP_CFG_WRITE,
35 VIRTIO_PCIDEV_OP_MMIO_READ,
36 VIRTIO_PCIDEV_OP_MMIO_WRITE,
37 VIRTIO_PCIDEV_OP_MMIO_MEMSET,
38 VIRTIO_PCIDEV_OP_INT,
39 VIRTIO_PCIDEV_OP_MSI,
40 VIRTIO_PCIDEV_OP_PME,
41};
42
43/**
44 * struct virtio_pcidev_msg - virtio PCI device operation
45 * @op: the operation to do
46 * @bar: the bar (only with BAR read/write messages)
47 * @reserved: reserved
48 * @size: the size of the read/write (in bytes)
49 * @addr: the address to read/write
50 * @data: the data, normally @size long, but just one byte for
51 * %VIRTIO_PCIDEV_OP_MMIO_MEMSET
52 *
53 * Note: the fields are all in native (CPU) endian, however, the
54 * @data values will often be in little endian (see the ops above.)
55 */
56struct virtio_pcidev_msg {
57 __u8 op;
58 __u8 bar;
59 __u16 reserved;
60 __u32 size;
61 __u64 addr;
62 __u8 data[];
63};
64
65#endif /* _LINUX_VIRTIO_PCIDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_pmem.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */
2/*
3 * Definitions for virtio-pmem devices.
4 *
5 * Copyright (C) 2019 Red Hat, Inc.
6 *
7 * Author(s): Pankaj Gupta <pagupta@redhat.com>
8 */
9
10#ifndef _LINUX_VIRTIO_PMEM_H
11#define _LINUX_VIRTIO_PMEM_H
12
13#include <linux/types.h>
14#include <linux/virtio_ids.h>
15#include <linux/virtio_config.h>
16
17struct virtio_pmem_config {
18 __le64 start;
19 __le64 size;
20};
21
22#define VIRTIO_PMEM_REQ_TYPE_FLUSH 0
23
24struct virtio_pmem_resp {
25 /* Host return status corresponding to flush request */
26 __le32 ret;
27};
28
29struct virtio_pmem_req {
30 /* command type */
31 __le32 type;
32};
33
34#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_ring.h+81-11
...@@ -42,6 +42,13 @@...@@ -42,6 +42,13 @@
42/* This means the buffer contains a list of buffer descriptors. */42/* This means the buffer contains a list of buffer descriptors. */
43#define VRING_DESC_F_INDIRECT 443#define VRING_DESC_F_INDIRECT 4
4444
45/*
46 * Mark a descriptor as available or used in packed ring.
47 * Notice: they are defined as shifts instead of shifted values.
48 */
49#define VRING_PACKED_DESC_F_AVAIL 7
50#define VRING_PACKED_DESC_F_USED 15
51
45/* The Host uses this in used->flags to advise the Guest: don't kick me when52/* The Host uses this in used->flags to advise the Guest: don't kick me when
46 * you add a buffer. It's unreliable, so it's simply an optimization. Guest53 * you add a buffer. It's unreliable, so it's simply an optimization. Guest
47 * will still kick if it's out of buffers. */54 * will still kick if it's out of buffers. */
...@@ -51,6 +58,23 @@...@@ -51,6 +58,23 @@
51 * optimization. */58 * optimization. */
52#define VRING_AVAIL_F_NO_INTERRUPT 159#define VRING_AVAIL_F_NO_INTERRUPT 1
5360
61/* Enable events in packed ring. */
62#define VRING_PACKED_EVENT_FLAG_ENABLE 0x0
63/* Disable events in packed ring. */
64#define VRING_PACKED_EVENT_FLAG_DISABLE 0x1
65/*
66 * Enable events for a specific descriptor in packed ring.
67 * (as specified by Descriptor Ring Change Event Offset/Wrap Counter).
68 * Only valid if VIRTIO_RING_F_EVENT_IDX has been negotiated.
69 */
70#define VRING_PACKED_EVENT_FLAG_DESC 0x2
71
72/*
73 * Wrap counter bit shift in event suppression structure
74 * of packed ring.
75 */
76#define VRING_PACKED_EVENT_F_WRAP_CTR 15
77
54/* We support indirect buffer descriptors */78/* We support indirect buffer descriptors */
55#define VIRTIO_RING_F_INDIRECT_DESC 2879#define VIRTIO_RING_F_INDIRECT_DESC 28
5680
...@@ -60,6 +84,13 @@...@@ -60,6 +84,13 @@
60 * at the end of the used ring. Guest should ignore the used->flags field. */84 * at the end of the used ring. Guest should ignore the used->flags field. */
61#define VIRTIO_RING_F_EVENT_IDX 2985#define VIRTIO_RING_F_EVENT_IDX 29
6286
87/* Alignment requirements for vring elements.
88 * When using pre-virtio 1.0 layout, these fall out naturally.
89 */
90#define VRING_AVAIL_ALIGN_SIZE 2
91#define VRING_USED_ALIGN_SIZE 4
92#define VRING_DESC_ALIGN_SIZE 16
93
63/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */94/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
64struct vring_desc {95struct vring_desc {
65 /* Address (guest-physical). */96 /* Address (guest-physical). */
...@@ -86,28 +117,47 @@ struct vring_used_elem {...@@ -86,28 +117,47 @@ struct vring_used_elem {
86 __virtio32 len;117 __virtio32 len;
87};118};
88119
120typedef struct vring_used_elem __attribute__((aligned(VRING_USED_ALIGN_SIZE)))
121 vring_used_elem_t;
122
89struct vring_used {123struct vring_used {
90 __virtio16 flags;124 __virtio16 flags;
91 __virtio16 idx;125 __virtio16 idx;
92 struct vring_used_elem ring[];126 vring_used_elem_t ring[];
93};127};
94128
129/*
130 * The ring element addresses are passed between components with different
131 * alignments assumptions. Thus, we might need to decrease the compiler-selected
132 * alignment, and so must use a typedef to make sure the aligned attribute
133 * actually takes hold:
134 *
135 * https://gcc.gnu.org/onlinedocs//gcc/Common-Type-Attributes.html#Common-Type-Attributes
136 *
137 * When used on a struct, or struct member, the aligned attribute can only
138 * increase the alignment; in order to decrease it, the packed attribute must
139 * be specified as well. When used as part of a typedef, the aligned attribute
140 * can both increase and decrease alignment, and specifying the packed
141 * attribute generates a warning.
142 */
143typedef struct vring_desc __attribute__((aligned(VRING_DESC_ALIGN_SIZE)))
144 vring_desc_t;
145typedef struct vring_avail __attribute__((aligned(VRING_AVAIL_ALIGN_SIZE)))
146 vring_avail_t;
147typedef struct vring_used __attribute__((aligned(VRING_USED_ALIGN_SIZE)))
148 vring_used_t;
149
95struct vring {150struct vring {
96 unsigned int num;151 unsigned int num;
97152
98 struct vring_desc *desc;153 vring_desc_t *desc;
99154
100 struct vring_avail *avail;155 vring_avail_t *avail;
101156
102 struct vring_used *used;157 vring_used_t *used;
103};158};
104159
105/* Alignment requirements for vring elements.160#ifndef VIRTIO_RING_NO_LEGACY
106 * When using pre-virtio 1.0 layout, these fall out naturally.
107 */
108#define VRING_AVAIL_ALIGN_SIZE 2
109#define VRING_USED_ALIGN_SIZE 4
110#define VRING_DESC_ALIGN_SIZE 16
111161
112/* The standard layout for the ring is a continuous chunk of memory which looks162/* The standard layout for the ring is a continuous chunk of memory which looks
113 * like this. We assume num is a power of 2.163 * like this. We assume num is a power of 2.
...@@ -143,7 +193,7 @@ static __inline__ void vring_init(struct vring *vr, unsigned int num, void *p,...@@ -143,7 +193,7 @@ static __inline__ void vring_init(struct vring *vr, unsigned int num, void *p,
143{193{
144 vr->num = num;194 vr->num = num;
145 vr->desc = p;195 vr->desc = p;
146 vr->avail = p + num*sizeof(struct vring_desc);196 vr->avail = (struct vring_avail *)((char *)p + num * sizeof(struct vring_desc));
147 vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16)197 vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16)
148 + align-1) & ~(align - 1));198 + align-1) & ~(align - 1));
149}199}
...@@ -155,6 +205,8 @@ static __inline__ unsigned vring_size(unsigned int num, unsigned long align)...@@ -155,6 +205,8 @@ static __inline__ unsigned vring_size(unsigned int num, unsigned long align)
155 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;205 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
156}206}
157207
208#endif /* VIRTIO_RING_NO_LEGACY */
209
158/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */210/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
159/* Assuming a given event_idx value from the other side, if211/* Assuming a given event_idx value from the other side, if
160 * we have just incremented index from old to new_idx,212 * we have just incremented index from old to new_idx,
...@@ -169,4 +221,22 @@ static __inline__ int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old...@@ -169,4 +221,22 @@ static __inline__ int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old
169 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);221 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
170}222}
171223
224struct vring_packed_desc_event {
225 /* Descriptor Ring Change Event Offset/Wrap Counter. */
226 __le16 off_wrap;
227 /* Descriptor Ring Change Event Flags. */
228 __le16 flags;
229};
230
231struct vring_packed_desc {
232 /* Buffer Address. */
233 __le64 addr;
234 /* Buffer Length. */
235 __le32 len;
236 /* Buffer ID. */
237 __le16 id;
238 /* The flags depending on descriptor type. */
239 __le16 flags;
240};
241
172#endif /* _LINUX_VIRTIO_RING_H */242#endif /* _LINUX_VIRTIO_RING_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_scmi.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * Copyright (C) 2020-2021 OpenSynergy GmbH
4 * Copyright (C) 2021 ARM Ltd.
5 */
6
7#ifndef _LINUX_VIRTIO_SCMI_H
8#define _LINUX_VIRTIO_SCMI_H
9
10#include <linux/virtio_types.h>
11
12/* Device implements some SCMI notifications, or delayed responses. */
13#define VIRTIO_SCMI_F_P2A_CHANNELS 0
14
15/* Device implements any SCMI statistics shared memory region */
16#define VIRTIO_SCMI_F_SHARED_MEMORY 1
17
18/* Virtqueues */
19
20#define VIRTIO_SCMI_VQ_TX 0 /* cmdq */
21#define VIRTIO_SCMI_VQ_RX 1 /* eventq */
22#define VIRTIO_SCMI_VQ_MAX_CNT 2
23
24#endif /* _LINUX_VIRTIO_SCMI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_scsi.h+10-10
...@@ -103,16 +103,16 @@ struct virtio_scsi_event {...@@ -103,16 +103,16 @@ struct virtio_scsi_event {
103} __attribute__((packed));103} __attribute__((packed));
104104
105struct virtio_scsi_config {105struct virtio_scsi_config {
106 __u32 num_queues;106 __virtio32 num_queues;
107 __u32 seg_max;107 __virtio32 seg_max;
108 __u32 max_sectors;108 __virtio32 max_sectors;
109 __u32 cmd_per_lun;109 __virtio32 cmd_per_lun;
110 __u32 event_info_size;110 __virtio32 event_info_size;
111 __u32 sense_size;111 __virtio32 sense_size;
112 __u32 cdb_size;112 __virtio32 cdb_size;
113 __u16 max_channel;113 __virtio16 max_channel;
114 __u16 max_target;114 __virtio16 max_target;
115 __u32 max_lun;115 __virtio32 max_lun;
116} __attribute__((packed));116} __attribute__((packed));
117117
118/* Feature Bits */118/* Feature Bits */
lib/libc/include/any-linux-any/linux/virtio_snd.h created+334
...@@ -0,0 +1,334 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright (C) 2021 OpenSynergy GmbH
4 */
5#ifndef VIRTIO_SND_IF_H
6#define VIRTIO_SND_IF_H
7
8#include <linux/virtio_types.h>
9
10/*******************************************************************************
11 * CONFIGURATION SPACE
12 */
13struct virtio_snd_config {
14 /* # of available physical jacks */
15 __le32 jacks;
16 /* # of available PCM streams */
17 __le32 streams;
18 /* # of available channel maps */
19 __le32 chmaps;
20};
21
22enum {
23 /* device virtqueue indexes */
24 VIRTIO_SND_VQ_CONTROL = 0,
25 VIRTIO_SND_VQ_EVENT,
26 VIRTIO_SND_VQ_TX,
27 VIRTIO_SND_VQ_RX,
28 /* # of device virtqueues */
29 VIRTIO_SND_VQ_MAX
30};
31
32/*******************************************************************************
33 * COMMON DEFINITIONS
34 */
35
36/* supported dataflow directions */
37enum {
38 VIRTIO_SND_D_OUTPUT = 0,
39 VIRTIO_SND_D_INPUT
40};
41
42enum {
43 /* jack control request types */
44 VIRTIO_SND_R_JACK_INFO = 1,
45 VIRTIO_SND_R_JACK_REMAP,
46
47 /* PCM control request types */
48 VIRTIO_SND_R_PCM_INFO = 0x0100,
49 VIRTIO_SND_R_PCM_SET_PARAMS,
50 VIRTIO_SND_R_PCM_PREPARE,
51 VIRTIO_SND_R_PCM_RELEASE,
52 VIRTIO_SND_R_PCM_START,
53 VIRTIO_SND_R_PCM_STOP,
54
55 /* channel map control request types */
56 VIRTIO_SND_R_CHMAP_INFO = 0x0200,
57
58 /* jack event types */
59 VIRTIO_SND_EVT_JACK_CONNECTED = 0x1000,
60 VIRTIO_SND_EVT_JACK_DISCONNECTED,
61
62 /* PCM event types */
63 VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED = 0x1100,
64 VIRTIO_SND_EVT_PCM_XRUN,
65
66 /* common status codes */
67 VIRTIO_SND_S_OK = 0x8000,
68 VIRTIO_SND_S_BAD_MSG,
69 VIRTIO_SND_S_NOT_SUPP,
70 VIRTIO_SND_S_IO_ERR
71};
72
73/* common header */
74struct virtio_snd_hdr {
75 __le32 code;
76};
77
78/* event notification */
79struct virtio_snd_event {
80 /* VIRTIO_SND_EVT_XXX */
81 struct virtio_snd_hdr hdr;
82 /* optional event data */
83 __le32 data;
84};
85
86/* common control request to query an item information */
87struct virtio_snd_query_info {
88 /* VIRTIO_SND_R_XXX_INFO */
89 struct virtio_snd_hdr hdr;
90 /* item start identifier */
91 __le32 start_id;
92 /* item count to query */
93 __le32 count;
94 /* item information size in bytes */
95 __le32 size;
96};
97
98/* common item information header */
99struct virtio_snd_info {
100 /* function group node id (High Definition Audio Specification 7.1.2) */
101 __le32 hda_fn_nid;
102};
103
104/*******************************************************************************
105 * JACK CONTROL MESSAGES
106 */
107struct virtio_snd_jack_hdr {
108 /* VIRTIO_SND_R_JACK_XXX */
109 struct virtio_snd_hdr hdr;
110 /* 0 ... virtio_snd_config::jacks - 1 */
111 __le32 jack_id;
112};
113
114/* supported jack features */
115enum {
116 VIRTIO_SND_JACK_F_REMAP = 0
117};
118
119struct virtio_snd_jack_info {
120 /* common header */
121 struct virtio_snd_info hdr;
122 /* supported feature bit map (1 << VIRTIO_SND_JACK_F_XXX) */
123 __le32 features;
124 /* pin configuration (High Definition Audio Specification 7.3.3.31) */
125 __le32 hda_reg_defconf;
126 /* pin capabilities (High Definition Audio Specification 7.3.4.9) */
127 __le32 hda_reg_caps;
128 /* current jack connection status (0: disconnected, 1: connected) */
129 __u8 connected;
130
131 __u8 padding[7];
132};
133
134/* jack remapping control request */
135struct virtio_snd_jack_remap {
136 /* .code = VIRTIO_SND_R_JACK_REMAP */
137 struct virtio_snd_jack_hdr hdr;
138 /* selected association number */
139 __le32 association;
140 /* selected sequence number */
141 __le32 sequence;
142};
143
144/*******************************************************************************
145 * PCM CONTROL MESSAGES
146 */
147struct virtio_snd_pcm_hdr {
148 /* VIRTIO_SND_R_PCM_XXX */
149 struct virtio_snd_hdr hdr;
150 /* 0 ... virtio_snd_config::streams - 1 */
151 __le32 stream_id;
152};
153
154/* supported PCM stream features */
155enum {
156 VIRTIO_SND_PCM_F_SHMEM_HOST = 0,
157 VIRTIO_SND_PCM_F_SHMEM_GUEST,
158 VIRTIO_SND_PCM_F_MSG_POLLING,
159 VIRTIO_SND_PCM_F_EVT_SHMEM_PERIODS,
160 VIRTIO_SND_PCM_F_EVT_XRUNS
161};
162
163/* supported PCM sample formats */
164enum {
165 /* analog formats (width / physical width) */
166 VIRTIO_SND_PCM_FMT_IMA_ADPCM = 0, /* 4 / 4 bits */
167 VIRTIO_SND_PCM_FMT_MU_LAW, /* 8 / 8 bits */
168 VIRTIO_SND_PCM_FMT_A_LAW, /* 8 / 8 bits */
169 VIRTIO_SND_PCM_FMT_S8, /* 8 / 8 bits */
170 VIRTIO_SND_PCM_FMT_U8, /* 8 / 8 bits */
171 VIRTIO_SND_PCM_FMT_S16, /* 16 / 16 bits */
172 VIRTIO_SND_PCM_FMT_U16, /* 16 / 16 bits */
173 VIRTIO_SND_PCM_FMT_S18_3, /* 18 / 24 bits */
174 VIRTIO_SND_PCM_FMT_U18_3, /* 18 / 24 bits */
175 VIRTIO_SND_PCM_FMT_S20_3, /* 20 / 24 bits */
176 VIRTIO_SND_PCM_FMT_U20_3, /* 20 / 24 bits */
177 VIRTIO_SND_PCM_FMT_S24_3, /* 24 / 24 bits */
178 VIRTIO_SND_PCM_FMT_U24_3, /* 24 / 24 bits */
179 VIRTIO_SND_PCM_FMT_S20, /* 20 / 32 bits */
180 VIRTIO_SND_PCM_FMT_U20, /* 20 / 32 bits */
181 VIRTIO_SND_PCM_FMT_S24, /* 24 / 32 bits */
182 VIRTIO_SND_PCM_FMT_U24, /* 24 / 32 bits */
183 VIRTIO_SND_PCM_FMT_S32, /* 32 / 32 bits */
184 VIRTIO_SND_PCM_FMT_U32, /* 32 / 32 bits */
185 VIRTIO_SND_PCM_FMT_FLOAT, /* 32 / 32 bits */
186 VIRTIO_SND_PCM_FMT_FLOAT64, /* 64 / 64 bits */
187 /* digital formats (width / physical width) */
188 VIRTIO_SND_PCM_FMT_DSD_U8, /* 8 / 8 bits */
189 VIRTIO_SND_PCM_FMT_DSD_U16, /* 16 / 16 bits */
190 VIRTIO_SND_PCM_FMT_DSD_U32, /* 32 / 32 bits */
191 VIRTIO_SND_PCM_FMT_IEC958_SUBFRAME /* 32 / 32 bits */
192};
193
194/* supported PCM frame rates */
195enum {
196 VIRTIO_SND_PCM_RATE_5512 = 0,
197 VIRTIO_SND_PCM_RATE_8000,
198 VIRTIO_SND_PCM_RATE_11025,
199 VIRTIO_SND_PCM_RATE_16000,
200 VIRTIO_SND_PCM_RATE_22050,
201 VIRTIO_SND_PCM_RATE_32000,
202 VIRTIO_SND_PCM_RATE_44100,
203 VIRTIO_SND_PCM_RATE_48000,
204 VIRTIO_SND_PCM_RATE_64000,
205 VIRTIO_SND_PCM_RATE_88200,
206 VIRTIO_SND_PCM_RATE_96000,
207 VIRTIO_SND_PCM_RATE_176400,
208 VIRTIO_SND_PCM_RATE_192000,
209 VIRTIO_SND_PCM_RATE_384000
210};
211
212struct virtio_snd_pcm_info {
213 /* common header */
214 struct virtio_snd_info hdr;
215 /* supported feature bit map (1 << VIRTIO_SND_PCM_F_XXX) */
216 __le32 features;
217 /* supported sample format bit map (1 << VIRTIO_SND_PCM_FMT_XXX) */
218 __le64 formats;
219 /* supported frame rate bit map (1 << VIRTIO_SND_PCM_RATE_XXX) */
220 __le64 rates;
221 /* dataflow direction (VIRTIO_SND_D_XXX) */
222 __u8 direction;
223 /* minimum # of supported channels */
224 __u8 channels_min;
225 /* maximum # of supported channels */
226 __u8 channels_max;
227
228 __u8 padding[5];
229};
230
231/* set PCM stream format */
232struct virtio_snd_pcm_set_params {
233 /* .code = VIRTIO_SND_R_PCM_SET_PARAMS */
234 struct virtio_snd_pcm_hdr hdr;
235 /* size of the hardware buffer */
236 __le32 buffer_bytes;
237 /* size of the hardware period */
238 __le32 period_bytes;
239 /* selected feature bit map (1 << VIRTIO_SND_PCM_F_XXX) */
240 __le32 features;
241 /* selected # of channels */
242 __u8 channels;
243 /* selected sample format (VIRTIO_SND_PCM_FMT_XXX) */
244 __u8 format;
245 /* selected frame rate (VIRTIO_SND_PCM_RATE_XXX) */
246 __u8 rate;
247
248 __u8 padding;
249};
250
251/*******************************************************************************
252 * PCM I/O MESSAGES
253 */
254
255/* I/O request header */
256struct virtio_snd_pcm_xfer {
257 /* 0 ... virtio_snd_config::streams - 1 */
258 __le32 stream_id;
259};
260
261/* I/O request status */
262struct virtio_snd_pcm_status {
263 /* VIRTIO_SND_S_XXX */
264 __le32 status;
265 /* current device latency */
266 __le32 latency_bytes;
267};
268
269/*******************************************************************************
270 * CHANNEL MAP CONTROL MESSAGES
271 */
272struct virtio_snd_chmap_hdr {
273 /* VIRTIO_SND_R_CHMAP_XXX */
274 struct virtio_snd_hdr hdr;
275 /* 0 ... virtio_snd_config::chmaps - 1 */
276 __le32 chmap_id;
277};
278
279/* standard channel position definition */
280enum {
281 VIRTIO_SND_CHMAP_NONE = 0, /* undefined */
282 VIRTIO_SND_CHMAP_NA, /* silent */
283 VIRTIO_SND_CHMAP_MONO, /* mono stream */
284 VIRTIO_SND_CHMAP_FL, /* front left */
285 VIRTIO_SND_CHMAP_FR, /* front right */
286 VIRTIO_SND_CHMAP_RL, /* rear left */
287 VIRTIO_SND_CHMAP_RR, /* rear right */
288 VIRTIO_SND_CHMAP_FC, /* front center */
289 VIRTIO_SND_CHMAP_LFE, /* low frequency (LFE) */
290 VIRTIO_SND_CHMAP_SL, /* side left */
291 VIRTIO_SND_CHMAP_SR, /* side right */
292 VIRTIO_SND_CHMAP_RC, /* rear center */
293 VIRTIO_SND_CHMAP_FLC, /* front left center */
294 VIRTIO_SND_CHMAP_FRC, /* front right center */
295 VIRTIO_SND_CHMAP_RLC, /* rear left center */
296 VIRTIO_SND_CHMAP_RRC, /* rear right center */
297 VIRTIO_SND_CHMAP_FLW, /* front left wide */
298 VIRTIO_SND_CHMAP_FRW, /* front right wide */
299 VIRTIO_SND_CHMAP_FLH, /* front left high */
300 VIRTIO_SND_CHMAP_FCH, /* front center high */
301 VIRTIO_SND_CHMAP_FRH, /* front right high */
302 VIRTIO_SND_CHMAP_TC, /* top center */
303 VIRTIO_SND_CHMAP_TFL, /* top front left */
304 VIRTIO_SND_CHMAP_TFR, /* top front right */
305 VIRTIO_SND_CHMAP_TFC, /* top front center */
306 VIRTIO_SND_CHMAP_TRL, /* top rear left */
307 VIRTIO_SND_CHMAP_TRR, /* top rear right */
308 VIRTIO_SND_CHMAP_TRC, /* top rear center */
309 VIRTIO_SND_CHMAP_TFLC, /* top front left center */
310 VIRTIO_SND_CHMAP_TFRC, /* top front right center */
311 VIRTIO_SND_CHMAP_TSL, /* top side left */
312 VIRTIO_SND_CHMAP_TSR, /* top side right */
313 VIRTIO_SND_CHMAP_LLFE, /* left LFE */
314 VIRTIO_SND_CHMAP_RLFE, /* right LFE */
315 VIRTIO_SND_CHMAP_BC, /* bottom center */
316 VIRTIO_SND_CHMAP_BLC, /* bottom left center */
317 VIRTIO_SND_CHMAP_BRC /* bottom right center */
318};
319
320/* maximum possible number of channels */
321#define VIRTIO_SND_CHMAP_MAX_SIZE 18
322
323struct virtio_snd_chmap_info {
324 /* common header */
325 struct virtio_snd_info hdr;
326 /* dataflow direction (VIRTIO_SND_D_XXX) */
327 __u8 direction;
328 /* # of valid channel position values */
329 __u8 channels;
330 /* channel position values (VIRTIO_SND_CHMAP_XXX) */
331 __u8 positions[VIRTIO_SND_CHMAP_MAX_SIZE];
332};
333
334#endif /* VIRTIO_SND_IF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_vsock.h+10
...@@ -38,6 +38,9 @@...@@ -38,6 +38,9 @@
38#include <linux/virtio_ids.h>38#include <linux/virtio_ids.h>
39#include <linux/virtio_config.h>39#include <linux/virtio_config.h>
4040
41/* The feature bitmap for virtio vsock */
42#define VIRTIO_VSOCK_F_SEQPACKET 1 /* SOCK_SEQPACKET supported */
43
41struct virtio_vsock_config {44struct virtio_vsock_config {
42 __le64 guest_cid;45 __le64 guest_cid;
43} __attribute__((packed));46} __attribute__((packed));
...@@ -65,6 +68,7 @@ struct virtio_vsock_hdr {...@@ -65,6 +68,7 @@ struct virtio_vsock_hdr {
6568
66enum virtio_vsock_type {69enum virtio_vsock_type {
67 VIRTIO_VSOCK_TYPE_STREAM = 1,70 VIRTIO_VSOCK_TYPE_STREAM = 1,
71 VIRTIO_VSOCK_TYPE_SEQPACKET = 2,
68};72};
6973
70enum virtio_vsock_op {74enum virtio_vsock_op {
...@@ -91,4 +95,10 @@ enum virtio_vsock_shutdown {...@@ -91,4 +95,10 @@ enum virtio_vsock_shutdown {
91 VIRTIO_VSOCK_SHUTDOWN_SEND = 2,95 VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
92};96};
9397
98/* VIRTIO_VSOCK_OP_RW flags values */
99enum virtio_vsock_rw {
100 VIRTIO_VSOCK_SEQ_EOM = 1,
101 VIRTIO_VSOCK_SEQ_EOR = 2,
102};
103
94#endif /* _LINUX_VIRTIO_VSOCK_H */104#endif /* _LINUX_VIRTIO_VSOCK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vm_sockets.h+40-5
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#define _VM_SOCKETS_H18#define _VM_SOCKETS_H
1919
20#include <linux/socket.h>20#include <linux/socket.h>
21#include <linux/types.h>
2122
22/* Option name for STREAM socket buffer size. Use as the option name in23/* Option name for STREAM socket buffer size. Use as the option name in
23 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that24 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
...@@ -63,7 +64,7 @@...@@ -63,7 +64,7 @@
63 * timeout for a STREAM socket.64 * timeout for a STREAM socket.
64 */65 */
6566
66#define SO_VM_SOCKETS_CONNECT_TIMEOUT 667#define SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD 6
6768
68/* Option name for using non-blocking send/receive. Use as the option name69/* Option name for using non-blocking send/receive. Use as the option name
69 * for setsockopt(3) or getsockopt(3) to set or get the non-blocking70 * for setsockopt(3) or getsockopt(3) to set or get the non-blocking
...@@ -80,6 +81,15 @@...@@ -80,6 +81,15 @@
8081
81#define SO_VM_SOCKETS_NONBLOCK_TXRX 782#define SO_VM_SOCKETS_NONBLOCK_TXRX 7
8283
84#define SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW 8
85
86#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
87#define SO_VM_SOCKETS_CONNECT_TIMEOUT SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD
88#else
89#define SO_VM_SOCKETS_CONNECT_TIMEOUT \
90 (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD : SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW)
91#endif
92
83/* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of93/* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of
84 * sockaddr_vm and indicates the context ID of the current endpoint.94 * sockaddr_vm and indicates the context ID of the current endpoint.
85 */95 */
...@@ -99,11 +109,13 @@...@@ -99,11 +109,13 @@
99109
100#define VMADDR_CID_HYPERVISOR 0110#define VMADDR_CID_HYPERVISOR 0
101111
102/* This CID is specific to VMCI and can be considered reserved (even VMCI112/* Use this as the destination CID in an address when referring to the
103 * doesn't use it anymore, it's a legacy value from an older release).113 * local communication (loopback).
114 * (This was VMADDR_CID_RESERVED, but even VMCI doesn't use it anymore,
115 * it was a legacy value from an older release).
104 */116 */
105117
106#define VMADDR_CID_RESERVED 1118#define VMADDR_CID_LOCAL 1
107119
108/* Use this as the destination CID in an address when referring to the host120/* Use this as the destination CID in an address when referring to the host
109 * (any process other than the hypervisor). VMCI relies on it being 2, but121 * (any process other than the hypervisor). VMCI relies on it being 2, but
...@@ -112,6 +124,26 @@...@@ -112,6 +124,26 @@
112124
113#define VMADDR_CID_HOST 2125#define VMADDR_CID_HOST 2
114126
127/* The current default use case for the vsock channel is the following:
128 * local vsock communication between guest and host and nested VMs setup.
129 * In addition to this, implicitly, the vsock packets are forwarded to the host
130 * if no host->guest vsock transport is set.
131 *
132 * Set this flag value in the sockaddr_vm corresponding field if the vsock
133 * packets need to be always forwarded to the host. Using this behavior,
134 * vsock communication between sibling VMs can be setup.
135 *
136 * This way can explicitly distinguish between vsock channels created for
137 * different use cases, such as nested VMs (or local communication between
138 * guest and host) and sibling VMs.
139 *
140 * The flag can be set in the connect logic in the user space application flow.
141 * In the listen logic (from kernel space) the flag is set on the remote peer
142 * address. This happens for an incoming connection when it is routed from the
143 * host and comes from the guest (local CID and remote CID > VMADDR_CID_HOST).
144 */
145#define VMADDR_FLAG_TO_HOST 0x01
146
115/* Invalid vSockets version. */147/* Invalid vSockets version. */
116148
117#define VM_SOCKETS_INVALID_VERSION -1U149#define VM_SOCKETS_INVALID_VERSION -1U
...@@ -146,10 +178,13 @@ struct sockaddr_vm {...@@ -146,10 +178,13 @@ struct sockaddr_vm {
146 unsigned short svm_reserved1;178 unsigned short svm_reserved1;
147 unsigned int svm_port;179 unsigned int svm_port;
148 unsigned int svm_cid;180 unsigned int svm_cid;
181 __u8 svm_flags;
149 unsigned char svm_zero[sizeof(struct sockaddr) -182 unsigned char svm_zero[sizeof(struct sockaddr) -
150 sizeof(sa_family_t) -183 sizeof(sa_family_t) -
151 sizeof(unsigned short) -184 sizeof(unsigned short) -
152 sizeof(unsigned int) - sizeof(unsigned int)];185 sizeof(unsigned int) -
186 sizeof(unsigned int) -
187 sizeof(__u8)];
153};188};
154189
155#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)190#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
lib/libc/include/any-linux-any/linux/vmcore.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _VMCORE_H2#ifndef _VMCORE_H
3#define _VMCORE_H3#define _VMCORE_H
44
lib/libc/include/any-linux-any/linux/wait.h+1
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#define P_ALL 017#define P_ALL 0
18#define P_PID 118#define P_PID 1
19#define P_PGID 219#define P_PGID 2
20#define P_PIDFD 3
2021
2122
22#endif /* _LINUX_WAIT_H */23#endif /* _LINUX_WAIT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wanrouter.h deleted-18
...@@ -1,18 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * wanrouter.h Legacy declarations kept around until X25 is removed
4 */
5
6#ifndef _ROUTER_H
7#define _ROUTER_H
8
9/* 'state' defines */
10enum wan_states
11{
12 WAN_UNCONFIGURED, /* link/channel is not configured */
13 WAN_DISCONNECTED, /* link/channel is disconnected */
14 WAN_CONNECTING, /* connection is in progress */
15 WAN_CONNECTED /* link/channel is operational */
16};
17
18#endif /* _ROUTER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/watch_queue.h created+104
...@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_WATCH_QUEUE_H
3#define _LINUX_WATCH_QUEUE_H
4
5#include <linux/types.h>
6#include <linux/fcntl.h>
7#include <linux/ioctl.h>
8
9#define O_NOTIFICATION_PIPE O_EXCL /* Parameter to pipe2() selecting notification pipe */
10
11#define IOC_WATCH_QUEUE_SET_SIZE _IO('W', 0x60) /* Set the size in pages */
12#define IOC_WATCH_QUEUE_SET_FILTER _IO('W', 0x61) /* Set the filter */
13
14enum watch_notification_type {
15 WATCH_TYPE_META = 0, /* Special record */
16 WATCH_TYPE_KEY_NOTIFY = 1, /* Key change event notification */
17 WATCH_TYPE__NR = 2
18};
19
20enum watch_meta_notification_subtype {
21 WATCH_META_REMOVAL_NOTIFICATION = 0, /* Watched object was removed */
22 WATCH_META_LOSS_NOTIFICATION = 1, /* Data loss occurred */
23};
24
25/*
26 * Notification record header. This is aligned to 64-bits so that subclasses
27 * can contain __u64 fields.
28 */
29struct watch_notification {
30 __u32 type:24; /* enum watch_notification_type */
31 __u32 subtype:8; /* Type-specific subtype (filterable) */
32 __u32 info;
33#define WATCH_INFO_LENGTH 0x0000007f /* Length of record */
34#define WATCH_INFO_LENGTH__SHIFT 0
35#define WATCH_INFO_ID 0x0000ff00 /* ID of watchpoint */
36#define WATCH_INFO_ID__SHIFT 8
37#define WATCH_INFO_TYPE_INFO 0xffff0000 /* Type-specific info */
38#define WATCH_INFO_TYPE_INFO__SHIFT 16
39#define WATCH_INFO_FLAG_0 0x00010000 /* Type-specific info, flag bit 0 */
40#define WATCH_INFO_FLAG_1 0x00020000 /* ... */
41#define WATCH_INFO_FLAG_2 0x00040000
42#define WATCH_INFO_FLAG_3 0x00080000
43#define WATCH_INFO_FLAG_4 0x00100000
44#define WATCH_INFO_FLAG_5 0x00200000
45#define WATCH_INFO_FLAG_6 0x00400000
46#define WATCH_INFO_FLAG_7 0x00800000
47};
48
49/*
50 * Notification filtering rules (IOC_WATCH_QUEUE_SET_FILTER).
51 */
52struct watch_notification_type_filter {
53 __u32 type; /* Type to apply filter to */
54 __u32 info_filter; /* Filter on watch_notification::info */
55 __u32 info_mask; /* Mask of relevant bits in info_filter */
56 __u32 subtype_filter[8]; /* Bitmask of subtypes to filter on */
57};
58
59struct watch_notification_filter {
60 __u32 nr_filters; /* Number of filters */
61 __u32 __reserved; /* Must be 0 */
62 struct watch_notification_type_filter filters[];
63};
64
65
66/*
67 * Extended watch removal notification. This is used optionally if the type
68 * wants to indicate an identifier for the object being watched, if there is
69 * such. This can be distinguished by the length.
70 *
71 * type -> WATCH_TYPE_META
72 * subtype -> WATCH_META_REMOVAL_NOTIFICATION
73 */
74struct watch_notification_removal {
75 struct watch_notification watch;
76 __u64 id; /* Type-dependent identifier */
77};
78
79/*
80 * Type of key/keyring change notification.
81 */
82enum key_notification_subtype {
83 NOTIFY_KEY_INSTANTIATED = 0, /* Key was instantiated (aux is error code) */
84 NOTIFY_KEY_UPDATED = 1, /* Key was updated */
85 NOTIFY_KEY_LINKED = 2, /* Key (aux) was added to watched keyring */
86 NOTIFY_KEY_UNLINKED = 3, /* Key (aux) was removed from watched keyring */
87 NOTIFY_KEY_CLEARED = 4, /* Keyring was cleared */
88 NOTIFY_KEY_REVOKED = 5, /* Key was revoked */
89 NOTIFY_KEY_INVALIDATED = 6, /* Key was invalidated */
90 NOTIFY_KEY_SETATTR = 7, /* Key's attributes got changed */
91};
92
93/*
94 * Key/keyring notification record.
95 * - watch.type = WATCH_TYPE_KEY_NOTIFY
96 * - watch.subtype = enum key_notification_type
97 */
98struct key_notification {
99 struct watch_notification watch;
100 __u32 key_id; /* The key/keyring affected */
101 __u32 aux; /* Per-type auxiliary data */
102};
103
104#endif /* _LINUX_WATCH_QUEUE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wimax.h deleted-239
...@@ -1,239 +0,0 @@
1/*
2 * Linux WiMax
3 * API for user space
4 *
5 *
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *
35 * Intel Corporation <linux-wimax@intel.com>
36 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
37 * - Initial implementation
38 *
39 *
40 * This file declares the user/kernel protocol that is spoken over
41 * Generic Netlink, as well as any type declaration that is to be used
42 * by kernel and user space.
43 *
44 * It is intended for user space to clone it verbatim to use it as a
45 * primary reference for definitions.
46 *
47 * Stuff intended for kernel usage as well as full protocol and stack
48 * documentation is rooted in include/net/wimax.h.
49 */
50
51#ifndef __LINUX__WIMAX_H__
52#define __LINUX__WIMAX_H__
53
54#include <linux/types.h>
55
56enum {
57 /**
58 * Version of the interface (unsigned decimal, MMm, max 25.5)
59 * M - Major: change if removing or modifying an existing call.
60 * m - minor: change when adding a new call
61 */
62 WIMAX_GNL_VERSION = 01,
63 /* Generic NetLink attributes */
64 WIMAX_GNL_ATTR_INVALID = 0x00,
65 WIMAX_GNL_ATTR_MAX = 10,
66};
67
68
69/*
70 * Generic NetLink operations
71 *
72 * Most of these map to an API call; _OP_ stands for operation, _RP_
73 * for reply and _RE_ for report (aka: signal).
74 */
75enum {
76 WIMAX_GNL_OP_MSG_FROM_USER, /* User to kernel message */
77 WIMAX_GNL_OP_MSG_TO_USER, /* Kernel to user message */
78 WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */
79 WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */
80 WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */
81 WIMAX_GNL_OP_STATE_GET, /* Request for current state */
82};
83
84
85/* Message from user / to user */
86enum {
87 WIMAX_GNL_MSG_IFIDX = 1,
88 WIMAX_GNL_MSG_PIPE_NAME,
89 WIMAX_GNL_MSG_DATA,
90};
91
92
93/*
94 * wimax_rfkill()
95 *
96 * The state of the radio (ON/OFF) is mapped to the rfkill subsystem's
97 * switch state (DISABLED/ENABLED).
98 */
99enum wimax_rf_state {
100 WIMAX_RF_OFF = 0, /* Radio is off, rfkill on/enabled */
101 WIMAX_RF_ON = 1, /* Radio is on, rfkill off/disabled */
102 WIMAX_RF_QUERY = 2,
103};
104
105/* Attributes */
106enum {
107 WIMAX_GNL_RFKILL_IFIDX = 1,
108 WIMAX_GNL_RFKILL_STATE,
109};
110
111
112/* Attributes for wimax_reset() */
113enum {
114 WIMAX_GNL_RESET_IFIDX = 1,
115};
116
117/* Attributes for wimax_state_get() */
118enum {
119 WIMAX_GNL_STGET_IFIDX = 1,
120};
121
122/*
123 * Attributes for the Report State Change
124 *
125 * For now we just have the old and new states; new attributes might
126 * be added later on.
127 */
128enum {
129 WIMAX_GNL_STCH_IFIDX = 1,
130 WIMAX_GNL_STCH_STATE_OLD,
131 WIMAX_GNL_STCH_STATE_NEW,
132};
133
134
135/**
136 * enum wimax_st - The different states of a WiMAX device
137 * @__WIMAX_ST_NULL: The device structure has been allocated and zeroed,
138 * but still wimax_dev_add() hasn't been called. There is no state.
139 *
140 * @WIMAX_ST_DOWN: The device has been registered with the WiMAX and
141 * networking stacks, but it is not initialized (normally that is
142 * done with 'ifconfig DEV up' [or equivalent], which can upload
143 * firmware and enable communications with the device).
144 * In this state, the device is powered down and using as less
145 * power as possible.
146 * This state is the default after a call to wimax_dev_add(). It
147 * is ok to have drivers move directly to %WIMAX_ST_UNINITIALIZED
148 * or %WIMAX_ST_RADIO_OFF in _probe() after the call to
149 * wimax_dev_add().
150 * It is recommended that the driver leaves this state when
151 * calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV
152 * down'.
153 *
154 * @__WIMAX_ST_QUIESCING: The device is being torn down, so no API
155 * operations are allowed to proceed except the ones needed to
156 * complete the device clean up process.
157 *
158 * @WIMAX_ST_UNINITIALIZED: [optional] Communication with the device
159 * is setup, but the device still requires some configuration
160 * before being operational.
161 * Some WiMAX API calls might work.
162 *
163 * @WIMAX_ST_RADIO_OFF: The device is fully up; radio is off (wether
164 * by hardware or software switches).
165 * It is recommended to always leave the device in this state
166 * after initialization.
167 *
168 * @WIMAX_ST_READY: The device is fully up and radio is on.
169 *
170 * @WIMAX_ST_SCANNING: [optional] The device has been instructed to
171 * scan. In this state, the device cannot be actively connected to
172 * a network.
173 *
174 * @WIMAX_ST_CONNECTING: The device is connecting to a network. This
175 * state exists because in some devices, the connect process can
176 * include a number of negotiations between user space, kernel
177 * space and the device. User space needs to know what the device
178 * is doing. If the connect sequence in a device is atomic and
179 * fast, the device can transition directly to CONNECTED
180 *
181 * @WIMAX_ST_CONNECTED: The device is connected to a network.
182 *
183 * @__WIMAX_ST_INVALID: This is an invalid state used to mark the
184 * maximum numeric value of states.
185 *
186 * Description:
187 *
188 * Transitions from one state to another one are atomic and can only
189 * be caused in kernel space with wimax_state_change(). To read the
190 * state, use wimax_state_get().
191 *
192 * States starting with __ are internal and shall not be used or
193 * referred to by drivers or userspace. They look ugly, but that's the
194 * point -- if any use is made non-internal to the stack, it is easier
195 * to catch on review.
196 *
197 * All API operations [with well defined exceptions] will take the
198 * device mutex before starting and then check the state. If the state
199 * is %__WIMAX_ST_NULL, %WIMAX_ST_DOWN, %WIMAX_ST_UNINITIALIZED or
200 * %__WIMAX_ST_QUIESCING, it will drop the lock and quit with
201 * -%EINVAL, -%ENOMEDIUM, -%ENOTCONN or -%ESHUTDOWN.
202 *
203 * The order of the definitions is important, so we can do numerical
204 * comparisons (eg: < %WIMAX_ST_RADIO_OFF means the device is not ready
205 * to operate).
206 */
207/*
208 * The allowed state transitions are described in the table below
209 * (states in rows can go to states in columns where there is an X):
210 *
211 * UNINI RADIO READY SCAN CONNEC CONNEC
212 * NULL DOWN QUIESCING TIALIZED OFF NING TING TED
213 * NULL - x
214 * DOWN - x x x
215 * QUIESCING x -
216 * UNINITIALIZED x - x
217 * RADIO_OFF x - x
218 * READY x x - x x x
219 * SCANNING x x x - x x
220 * CONNECTING x x x x - x
221 * CONNECTED x x x -
222 *
223 * This table not available in kernel-doc because the formatting messes it up.
224 */
225 enum wimax_st {
226 __WIMAX_ST_NULL = 0,
227 WIMAX_ST_DOWN,
228 __WIMAX_ST_QUIESCING,
229 WIMAX_ST_UNINITIALIZED,
230 WIMAX_ST_RADIO_OFF,
231 WIMAX_ST_READY,
232 WIMAX_ST_SCANNING,
233 WIMAX_ST_CONNECTING,
234 WIMAX_ST_CONNECTED,
235 __WIMAX_ST_INVALID /* Always keep last */
236};
237
238
239#endif /* #ifndef __LINUX__WIMAX_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wimax/i2400m.h deleted-572
...@@ -1,572 +0,0 @@
1/*
2 * Intel Wireless WiMax Connection 2400m
3 * Host-Device protocol interface definitions
4 *
5 *
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *
35 * Intel Corporation <linux-wimax@intel.com>
36 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
37 * - Initial implementation
38 *
39 *
40 * This header defines the data structures and constants used to
41 * communicate with the device.
42 *
43 * BOOTMODE/BOOTROM/FIRMWARE UPLOAD PROTOCOL
44 *
45 * The firmware upload protocol is quite simple and only requires a
46 * handful of commands. See drivers/net/wimax/i2400m/fw.c for more
47 * details.
48 *
49 * The BCF data structure is for the firmware file header.
50 *
51 *
52 * THE DATA / CONTROL PROTOCOL
53 *
54 * This is the normal protocol spoken with the device once the
55 * firmware is uploaded. It transports data payloads and control
56 * messages back and forth.
57 *
58 * It consists 'messages' that pack one or more payloads each. The
59 * format is described in detail in drivers/net/wimax/i2400m/rx.c and
60 * tx.c.
61 *
62 *
63 * THE L3L4 PROTOCOL
64 *
65 * The term L3L4 refers to Layer 3 (the device), Layer 4 (the
66 * driver/host software).
67 *
68 * This is the control protocol used by the host to control the i2400m
69 * device (scan, connect, disconnect...). This is sent to / received
70 * as control frames. These frames consist of a header and zero or
71 * more TLVs with information. We call each control frame a "message".
72 *
73 * Each message is composed of:
74 *
75 * HEADER
76 * [TLV0 + PAYLOAD0]
77 * [TLV1 + PAYLOAD1]
78 * [...]
79 * [TLVN + PAYLOADN]
80 *
81 * The HEADER is defined by 'struct i2400m_l3l4_hdr'. The payloads are
82 * defined by a TLV structure (Type Length Value) which is a 'header'
83 * (struct i2400m_tlv_hdr) and then the payload.
84 *
85 * All integers are represented as Little Endian.
86 *
87 * - REQUESTS AND EVENTS
88 *
89 * The requests can be clasified as follows:
90 *
91 * COMMAND: implies a request from the host to the device requesting
92 * an action being performed. The device will reply with a
93 * message (with the same type as the command), status and
94 * no (TLV) payload. Execution of a command might cause
95 * events (of different type) to be sent later on as
96 * device's state changes.
97 *
98 * GET/SET: similar to COMMAND, but will not cause other
99 * EVENTs. The reply, in the case of GET, will contain
100 * TLVs with the requested information.
101 *
102 * EVENT: asynchronous messages sent from the device, maybe as a
103 * consequence of previous COMMANDs but disassociated from
104 * them.
105 *
106 * Only one request might be pending at the same time (ie: don't
107 * parallelize nor post another GET request before the previous
108 * COMMAND has been acknowledged with it's corresponding reply by the
109 * device).
110 *
111 * The different requests and their formats are described below:
112 *
113 * I2400M_MT_* Message types
114 * I2400M_MS_* Message status (for replies, events)
115 * i2400m_tlv_* TLVs
116 *
117 * data types are named 'struct i2400m_msg_OPNAME', OPNAME matching the
118 * operation.
119 */
120
121#ifndef __LINUX__WIMAX__I2400M_H__
122#define __LINUX__WIMAX__I2400M_H__
123
124#include <linux/types.h>
125#include <linux/if_ether.h>
126
127/*
128 * Host Device Interface (HDI) common to all busses
129 */
130
131/* Boot-mode (firmware upload mode) commands */
132
133/* Header for the firmware file */
134struct i2400m_bcf_hdr {
135 __le32 module_type;
136 __le32 header_len;
137 __le32 header_version;
138 __le32 module_id;
139 __le32 module_vendor;
140 __le32 date; /* BCD YYYMMDD */
141 __le32 size; /* in dwords */
142 __le32 key_size; /* in dwords */
143 __le32 modulus_size; /* in dwords */
144 __le32 exponent_size; /* in dwords */
145 __u8 reserved[88];
146} __attribute__ ((packed));
147
148/* Boot mode opcodes */
149enum i2400m_brh_opcode {
150 I2400M_BRH_READ = 1,
151 I2400M_BRH_WRITE = 2,
152 I2400M_BRH_JUMP = 3,
153 I2400M_BRH_SIGNED_JUMP = 8,
154 I2400M_BRH_HASH_PAYLOAD_ONLY = 9,
155};
156
157/* Boot mode command masks and stuff */
158enum i2400m_brh {
159 I2400M_BRH_SIGNATURE = 0xcbbc0000,
160 I2400M_BRH_SIGNATURE_MASK = 0xffff0000,
161 I2400M_BRH_SIGNATURE_SHIFT = 16,
162 I2400M_BRH_OPCODE_MASK = 0x0000000f,
163 I2400M_BRH_RESPONSE_MASK = 0x000000f0,
164 I2400M_BRH_RESPONSE_SHIFT = 4,
165 I2400M_BRH_DIRECT_ACCESS = 0x00000400,
166 I2400M_BRH_RESPONSE_REQUIRED = 0x00000200,
167 I2400M_BRH_USE_CHECKSUM = 0x00000100,
168};
169
170
171/**
172 * i2400m_bootrom_header - Header for a boot-mode command
173 *
174 * @cmd: the above command descriptor
175 * @target_addr: where on the device memory should the action be performed.
176 * @data_size: for read/write, amount of data to be read/written
177 * @block_checksum: checksum value (if applicable)
178 * @payload: the beginning of data attached to this header
179 */
180struct i2400m_bootrom_header {
181 __le32 command; /* Compose with enum i2400_brh */
182 __le32 target_addr;
183 __le32 data_size;
184 __le32 block_checksum;
185 char payload[0];
186} __attribute__ ((packed));
187
188
189/*
190 * Data / control protocol
191 */
192
193/* Packet types for the host-device interface */
194enum i2400m_pt {
195 I2400M_PT_DATA = 0,
196 I2400M_PT_CTRL,
197 I2400M_PT_TRACE, /* For device debug */
198 I2400M_PT_RESET_WARM, /* device reset */
199 I2400M_PT_RESET_COLD, /* USB[transport] reset, like reconnect */
200 I2400M_PT_EDATA, /* Extended RX data */
201 I2400M_PT_ILLEGAL
202};
203
204
205/*
206 * Payload for a data packet
207 *
208 * This is prefixed to each and every outgoing DATA type.
209 */
210struct i2400m_pl_data_hdr {
211 __le32 reserved;
212} __attribute__((packed));
213
214
215/*
216 * Payload for an extended data packet
217 *
218 * New in fw v1.4
219 *
220 * @reorder: if this payload has to be reorder or not (and how)
221 * @cs: the type of data in the packet, as defined per (802.16e
222 * T11.13.19.1). Currently only 2 (IPv4 packet) supported.
223 *
224 * This is prefixed to each and every INCOMING DATA packet.
225 */
226struct i2400m_pl_edata_hdr {
227 __le32 reorder; /* bits defined in i2400m_ro */
228 __u8 cs;
229 __u8 reserved[11];
230} __attribute__((packed));
231
232enum i2400m_cs {
233 I2400M_CS_IPV4_0 = 0,
234 I2400M_CS_IPV4 = 2,
235};
236
237enum i2400m_ro {
238 I2400M_RO_NEEDED = 0x01,
239 I2400M_RO_TYPE = 0x03,
240 I2400M_RO_TYPE_SHIFT = 1,
241 I2400M_RO_CIN = 0x0f,
242 I2400M_RO_CIN_SHIFT = 4,
243 I2400M_RO_FBN = 0x07ff,
244 I2400M_RO_FBN_SHIFT = 8,
245 I2400M_RO_SN = 0x07ff,
246 I2400M_RO_SN_SHIFT = 21,
247};
248
249enum i2400m_ro_type {
250 I2400M_RO_TYPE_RESET = 0,
251 I2400M_RO_TYPE_PACKET,
252 I2400M_RO_TYPE_WS,
253 I2400M_RO_TYPE_PACKET_WS,
254};
255
256
257/* Misc constants */
258enum {
259 I2400M_PL_ALIGN = 16, /* Payload data size alignment */
260 I2400M_PL_SIZE_MAX = 0x3EFF,
261 I2400M_MAX_PLS_IN_MSG = 60,
262 /* protocol barkers: sync sequences; for notifications they
263 * are sent in groups of four. */
264 I2400M_H2D_PREVIEW_BARKER = 0xcafe900d,
265 I2400M_COLD_RESET_BARKER = 0xc01dc01d,
266 I2400M_WARM_RESET_BARKER = 0x50f750f7,
267 I2400M_NBOOT_BARKER = 0xdeadbeef,
268 I2400M_SBOOT_BARKER = 0x0ff1c1a1,
269 I2400M_SBOOT_BARKER_6050 = 0x80000001,
270 I2400M_ACK_BARKER = 0xfeedbabe,
271 I2400M_D2H_MSG_BARKER = 0xbeefbabe,
272};
273
274
275/*
276 * Hardware payload descriptor
277 *
278 * Bitfields encoded in a struct to enforce typing semantics.
279 *
280 * Look in rx.c and tx.c for a full description of the format.
281 */
282struct i2400m_pld {
283 __le32 val;
284} __attribute__ ((packed));
285
286#define I2400M_PLD_SIZE_MASK 0x00003fff
287#define I2400M_PLD_TYPE_SHIFT 16
288#define I2400M_PLD_TYPE_MASK 0x000f0000
289
290/*
291 * Header for a TX message or RX message
292 *
293 * @barker: preamble
294 * @size: used for management of the FIFO queue buffer; before
295 * sending, this is converted to be a real preamble. This
296 * indicates the real size of the TX message that starts at this
297 * point. If the highest bit is set, then this message is to be
298 * skipped.
299 * @sequence: sequence number of this message
300 * @offset: offset where the message itself starts -- see the comments
301 * in the file header about message header and payload descriptor
302 * alignment.
303 * @num_pls: number of payloads in this message
304 * @padding: amount of padding bytes at the end of the message to make
305 * it be of block-size aligned
306 *
307 * Look in rx.c and tx.c for a full description of the format.
308 */
309struct i2400m_msg_hdr {
310 union {
311 __le32 barker;
312 __u32 size; /* same size type as barker!! */
313 };
314 union {
315 __le32 sequence;
316 __u32 offset; /* same size type as barker!! */
317 };
318 __le16 num_pls;
319 __le16 rsv1;
320 __le16 padding;
321 __le16 rsv2;
322 struct i2400m_pld pld[0];
323} __attribute__ ((packed));
324
325
326
327/*
328 * L3/L4 control protocol
329 */
330
331enum {
332 /* Interface version */
333 I2400M_L3L4_VERSION = 0x0100,
334};
335
336/* Message types */
337enum i2400m_mt {
338 I2400M_MT_RESERVED = 0x0000,
339 I2400M_MT_INVALID = 0xffff,
340 I2400M_MT_REPORT_MASK = 0x8000,
341
342 I2400M_MT_GET_SCAN_RESULT = 0x4202,
343 I2400M_MT_SET_SCAN_PARAM = 0x4402,
344 I2400M_MT_CMD_RF_CONTROL = 0x4602,
345 I2400M_MT_CMD_SCAN = 0x4603,
346 I2400M_MT_CMD_CONNECT = 0x4604,
347 I2400M_MT_CMD_DISCONNECT = 0x4605,
348 I2400M_MT_CMD_EXIT_IDLE = 0x4606,
349 I2400M_MT_GET_LM_VERSION = 0x5201,
350 I2400M_MT_GET_DEVICE_INFO = 0x5202,
351 I2400M_MT_GET_LINK_STATUS = 0x5203,
352 I2400M_MT_GET_STATISTICS = 0x5204,
353 I2400M_MT_GET_STATE = 0x5205,
354 I2400M_MT_GET_MEDIA_STATUS = 0x5206,
355 I2400M_MT_SET_INIT_CONFIG = 0x5404,
356 I2400M_MT_CMD_INIT = 0x5601,
357 I2400M_MT_CMD_TERMINATE = 0x5602,
358 I2400M_MT_CMD_MODE_OF_OP = 0x5603,
359 I2400M_MT_CMD_RESET_DEVICE = 0x5604,
360 I2400M_MT_CMD_MONITOR_CONTROL = 0x5605,
361 I2400M_MT_CMD_ENTER_POWERSAVE = 0x5606,
362 I2400M_MT_GET_TLS_OPERATION_RESULT = 0x6201,
363 I2400M_MT_SET_EAP_SUCCESS = 0x6402,
364 I2400M_MT_SET_EAP_FAIL = 0x6403,
365 I2400M_MT_SET_EAP_KEY = 0x6404,
366 I2400M_MT_CMD_SEND_EAP_RESPONSE = 0x6602,
367 I2400M_MT_REPORT_SCAN_RESULT = 0xc002,
368 I2400M_MT_REPORT_STATE = 0xd002,
369 I2400M_MT_REPORT_POWERSAVE_READY = 0xd005,
370 I2400M_MT_REPORT_EAP_REQUEST = 0xe002,
371 I2400M_MT_REPORT_EAP_RESTART = 0xe003,
372 I2400M_MT_REPORT_ALT_ACCEPT = 0xe004,
373 I2400M_MT_REPORT_KEY_REQUEST = 0xe005,
374};
375
376
377/*
378 * Message Ack Status codes
379 *
380 * When a message is replied-to, this status is reported.
381 */
382enum i2400m_ms {
383 I2400M_MS_DONE_OK = 0,
384 I2400M_MS_DONE_IN_PROGRESS = 1,
385 I2400M_MS_INVALID_OP = 2,
386 I2400M_MS_BAD_STATE = 3,
387 I2400M_MS_ILLEGAL_VALUE = 4,
388 I2400M_MS_MISSING_PARAMS = 5,
389 I2400M_MS_VERSION_ERROR = 6,
390 I2400M_MS_ACCESSIBILITY_ERROR = 7,
391 I2400M_MS_BUSY = 8,
392 I2400M_MS_CORRUPTED_TLV = 9,
393 I2400M_MS_UNINITIALIZED = 10,
394 I2400M_MS_UNKNOWN_ERROR = 11,
395 I2400M_MS_PRODUCTION_ERROR = 12,
396 I2400M_MS_NO_RF = 13,
397 I2400M_MS_NOT_READY_FOR_POWERSAVE = 14,
398 I2400M_MS_THERMAL_CRITICAL = 15,
399 I2400M_MS_MAX
400};
401
402
403/**
404 * i2400m_tlv - enumeration of the different types of TLVs
405 *
406 * TLVs stand for type-length-value and are the header for a payload
407 * composed of almost anything. Each payload has a type assigned
408 * and a length.
409 */
410enum i2400m_tlv {
411 I2400M_TLV_L4_MESSAGE_VERSIONS = 129,
412 I2400M_TLV_SYSTEM_STATE = 141,
413 I2400M_TLV_MEDIA_STATUS = 161,
414 I2400M_TLV_RF_OPERATION = 162,
415 I2400M_TLV_RF_STATUS = 163,
416 I2400M_TLV_DEVICE_RESET_TYPE = 132,
417 I2400M_TLV_CONFIG_IDLE_PARAMETERS = 601,
418 I2400M_TLV_CONFIG_IDLE_TIMEOUT = 611,
419 I2400M_TLV_CONFIG_D2H_DATA_FORMAT = 614,
420 I2400M_TLV_CONFIG_DL_HOST_REORDER = 615,
421};
422
423
424struct i2400m_tlv_hdr {
425 __le16 type;
426 __le16 length; /* payload's */
427 __u8 pl[0];
428} __attribute__((packed));
429
430
431struct i2400m_l3l4_hdr {
432 __le16 type;
433 __le16 length; /* payload's */
434 __le16 version;
435 __le16 resv1;
436 __le16 status;
437 __le16 resv2;
438 struct i2400m_tlv_hdr pl[0];
439} __attribute__((packed));
440
441
442/**
443 * i2400m_system_state - different states of the device
444 */
445enum i2400m_system_state {
446 I2400M_SS_UNINITIALIZED = 1,
447 I2400M_SS_INIT,
448 I2400M_SS_READY,
449 I2400M_SS_SCAN,
450 I2400M_SS_STANDBY,
451 I2400M_SS_CONNECTING,
452 I2400M_SS_WIMAX_CONNECTED,
453 I2400M_SS_DATA_PATH_CONNECTED,
454 I2400M_SS_IDLE,
455 I2400M_SS_DISCONNECTING,
456 I2400M_SS_OUT_OF_ZONE,
457 I2400M_SS_SLEEPACTIVE,
458 I2400M_SS_PRODUCTION,
459 I2400M_SS_CONFIG,
460 I2400M_SS_RF_OFF,
461 I2400M_SS_RF_SHUTDOWN,
462 I2400M_SS_DEVICE_DISCONNECT,
463 I2400M_SS_MAX,
464};
465
466
467/**
468 * i2400m_tlv_system_state - report on the state of the system
469 *
470 * @state: see enum i2400m_system_state
471 */
472struct i2400m_tlv_system_state {
473 struct i2400m_tlv_hdr hdr;
474 __le32 state;
475} __attribute__((packed));
476
477
478struct i2400m_tlv_l4_message_versions {
479 struct i2400m_tlv_hdr hdr;
480 __le16 major;
481 __le16 minor;
482 __le16 branch;
483 __le16 reserved;
484} __attribute__((packed));
485
486
487struct i2400m_tlv_detailed_device_info {
488 struct i2400m_tlv_hdr hdr;
489 __u8 reserved1[400];
490 __u8 mac_address[ETH_ALEN];
491 __u8 reserved2[2];
492} __attribute__((packed));
493
494
495enum i2400m_rf_switch_status {
496 I2400M_RF_SWITCH_ON = 1,
497 I2400M_RF_SWITCH_OFF = 2,
498};
499
500struct i2400m_tlv_rf_switches_status {
501 struct i2400m_tlv_hdr hdr;
502 __u8 sw_rf_switch; /* 1 ON, 2 OFF */
503 __u8 hw_rf_switch; /* 1 ON, 2 OFF */
504 __u8 reserved[2];
505} __attribute__((packed));
506
507
508enum {
509 i2400m_rf_operation_on = 1,
510 i2400m_rf_operation_off = 2
511};
512
513struct i2400m_tlv_rf_operation {
514 struct i2400m_tlv_hdr hdr;
515 __le32 status; /* 1 ON, 2 OFF */
516} __attribute__((packed));
517
518
519enum i2400m_tlv_reset_type {
520 I2400M_RESET_TYPE_COLD = 1,
521 I2400M_RESET_TYPE_WARM
522};
523
524struct i2400m_tlv_device_reset_type {
525 struct i2400m_tlv_hdr hdr;
526 __le32 reset_type;
527} __attribute__((packed));
528
529
530struct i2400m_tlv_config_idle_parameters {
531 struct i2400m_tlv_hdr hdr;
532 __le32 idle_timeout; /* 100 to 300000 ms [5min], 100 increments
533 * 0 disabled */
534 __le32 idle_paging_interval; /* frames */
535} __attribute__((packed));
536
537
538enum i2400m_media_status {
539 I2400M_MEDIA_STATUS_LINK_UP = 1,
540 I2400M_MEDIA_STATUS_LINK_DOWN,
541 I2400M_MEDIA_STATUS_LINK_RENEW,
542};
543
544struct i2400m_tlv_media_status {
545 struct i2400m_tlv_hdr hdr;
546 __le32 media_status;
547} __attribute__((packed));
548
549
550/* New in v1.4 */
551struct i2400m_tlv_config_idle_timeout {
552 struct i2400m_tlv_hdr hdr;
553 __le32 timeout; /* 100 to 300000 ms [5min], 100 increments
554 * 0 disabled */
555} __attribute__((packed));
556
557/* New in v1.4 -- for backward compat, will be removed */
558struct i2400m_tlv_config_d2h_data_format {
559 struct i2400m_tlv_hdr hdr;
560 __u8 format; /* 0 old format, 1 enhanced */
561 __u8 reserved[3];
562} __attribute__((packed));
563
564/* New in v1.4 */
565struct i2400m_tlv_config_dl_host_reorder {
566 struct i2400m_tlv_hdr hdr;
567 __u8 reorder; /* 0 disabled, 1 enabled */
568 __u8 reserved[3];
569} __attribute__((packed));
570
571
572#endif /* #ifndef __LINUX__WIMAX__I2400M_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wireguard.h created+196
...@@ -0,0 +1,196 @@
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 * 0: NLA_NESTED
105 * ...
106 * 0: NLA_NESTED
107 * ...
108 * ...
109 * WGPEER_A_PROTOCOL_VERSION: NLA_U32, should not be set or used at
110 * all by most users of this API, as the
111 * most recent protocol will be used when
112 * this is unset. Otherwise, must be set
113 * to 1.
114 * 0: NLA_NESTED
115 * ...
116 * ...
117 *
118 * It is possible that the amount of configuration data exceeds that of
119 * the maximum message length accepted by the kernel. In that case, several
120 * messages should be sent one after another, with each successive one
121 * filling in information not contained in the prior. Note that if
122 * WGDEVICE_F_REPLACE_PEERS is specified in the first message, it probably
123 * should not be specified in fragments that come after, so that the list
124 * of peers is only cleared the first time but appended after. Likewise for
125 * peers, if WGPEER_F_REPLACE_ALLOWEDIPS is specified in the first message
126 * of a peer, it likely should not be specified in subsequent fragments.
127 *
128 * If an error occurs, NLMSG_ERROR will reply containing an errno.
129 */
130
131#ifndef _WG_UAPI_WIREGUARD_H
132#define _WG_UAPI_WIREGUARD_H
133
134#define WG_GENL_NAME "wireguard"
135#define WG_GENL_VERSION 1
136
137#define WG_KEY_LEN 32
138
139enum wg_cmd {
140 WG_CMD_GET_DEVICE,
141 WG_CMD_SET_DEVICE,
142 __WG_CMD_MAX
143};
144#define WG_CMD_MAX (__WG_CMD_MAX - 1)
145
146enum wgdevice_flag {
147 WGDEVICE_F_REPLACE_PEERS = 1U << 0,
148 __WGDEVICE_F_ALL = WGDEVICE_F_REPLACE_PEERS
149};
150enum wgdevice_attribute {
151 WGDEVICE_A_UNSPEC,
152 WGDEVICE_A_IFINDEX,
153 WGDEVICE_A_IFNAME,
154 WGDEVICE_A_PRIVATE_KEY,
155 WGDEVICE_A_PUBLIC_KEY,
156 WGDEVICE_A_FLAGS,
157 WGDEVICE_A_LISTEN_PORT,
158 WGDEVICE_A_FWMARK,
159 WGDEVICE_A_PEERS,
160 __WGDEVICE_A_LAST
161};
162#define WGDEVICE_A_MAX (__WGDEVICE_A_LAST - 1)
163
164enum wgpeer_flag {
165 WGPEER_F_REMOVE_ME = 1U << 0,
166 WGPEER_F_REPLACE_ALLOWEDIPS = 1U << 1,
167 WGPEER_F_UPDATE_ONLY = 1U << 2,
168 __WGPEER_F_ALL = WGPEER_F_REMOVE_ME | WGPEER_F_REPLACE_ALLOWEDIPS |
169 WGPEER_F_UPDATE_ONLY
170};
171enum wgpeer_attribute {
172 WGPEER_A_UNSPEC,
173 WGPEER_A_PUBLIC_KEY,
174 WGPEER_A_PRESHARED_KEY,
175 WGPEER_A_FLAGS,
176 WGPEER_A_ENDPOINT,
177 WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL,
178 WGPEER_A_LAST_HANDSHAKE_TIME,
179 WGPEER_A_RX_BYTES,
180 WGPEER_A_TX_BYTES,
181 WGPEER_A_ALLOWEDIPS,
182 WGPEER_A_PROTOCOL_VERSION,
183 __WGPEER_A_LAST
184};
185#define WGPEER_A_MAX (__WGPEER_A_LAST - 1)
186
187enum wgallowedip_attribute {
188 WGALLOWEDIP_A_UNSPEC,
189 WGALLOWEDIP_A_FAMILY,
190 WGALLOWEDIP_A_IPADDR,
191 WGALLOWEDIP_A_CIDR_MASK,
192 __WGALLOWEDIP_A_LAST
193};
194#define WGALLOWEDIP_A_MAX (__WGALLOWEDIP_A_LAST - 1)
195
196#endif /* _WG_UAPI_WIREGUARD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wireless.h+4-3
...@@ -74,6 +74,8 @@...@@ -74,6 +74,8 @@
74#include <linux/socket.h> /* for "struct sockaddr" et al */74#include <linux/socket.h> /* for "struct sockaddr" et al */
75#include <linux/if.h> /* for IFNAMSIZ and co... */75#include <linux/if.h> /* for IFNAMSIZ and co... */
7676
77# include <stddef.h> /* for offsetof */
78
77/***************************** VERSION *****************************/79/***************************** VERSION *****************************/
78/*80/*
79 * This constant is used to know the availability of the wireless81 * This constant is used to know the availability of the wireless
...@@ -908,7 +910,7 @@ union iwreq_data {...@@ -908,7 +910,7 @@ union iwreq_data {
908 struct iw_param sens; /* signal level threshold */910 struct iw_param sens; /* signal level threshold */
909 struct iw_param bitrate; /* default bit rate */911 struct iw_param bitrate; /* default bit rate */
910 struct iw_param txpower; /* default transmit power */912 struct iw_param txpower; /* default transmit power */
911 struct iw_param rts; /* RTS threshold threshold */913 struct iw_param rts; /* RTS threshold */
912 struct iw_param frag; /* Fragmentation threshold */914 struct iw_param frag; /* Fragmentation threshold */
913 __u32 mode; /* Operation mode */915 __u32 mode; /* Operation mode */
914 struct iw_param retry; /* Retry limits & lifetime */916 struct iw_param retry; /* Retry limits & lifetime */
...@@ -1090,8 +1092,7 @@ struct iw_event {...@@ -1090,8 +1092,7 @@ struct iw_event {
1090/* iw_point events are special. First, the payload (extra data) come at1092/* iw_point events are special. First, the payload (extra data) come at
1091 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,1093 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1092 * we omit the pointer, so start at an offset. */1094 * we omit the pointer, so start at an offset. */
1093#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \1095#define IW_EV_POINT_OFF offsetof(struct iw_point, length)
1094 (char *) NULL)
1095#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \1096#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1096 IW_EV_POINT_OFF)1097 IW_EV_POINT_OFF)
10971098
lib/libc/include/any-linux-any/linux/wmi.h+1-4
...@@ -1,11 +1,8 @@...@@ -1,11 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
1/*2/*
2 * User API methods for ACPI-WMI mapping driver3 * User API methods for ACPI-WMI mapping driver
3 *4 *
4 * Copyright (C) 2017 Dell, Inc.5 * Copyright (C) 2017 Dell, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */6 */
10#ifndef _LINUX_WMI_H7#ifndef _LINUX_WMI_H
11#define _LINUX_WMI_H8#define _LINUX_WMI_H
lib/libc/include/any-linux-any/linux/wwan.h created+16
...@@ -0,0 +1,16 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2021 Intel Corporation.
4 */
5#ifndef _WWAN_H_
6#define _WWAN_H_
7
8enum {
9 IFLA_WWAN_UNSPEC,
10 IFLA_WWAN_LINK_ID, /* u32 */
11
12 __IFLA_WWAN_MAX
13};
14#define IFLA_WWAN_MAX (__IFLA_WWAN_MAX - 1)
15
16#endif /* _WWAN_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/xattr.h+4
...@@ -7,6 +7,7 @@...@@ -7,6 +7,7 @@
7 Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>7 Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
8 Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.8 Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
9 Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>9 Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
10 Copyright (c) 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
10*/11*/
1112
12#include <linux/libc-compat.h>13#include <linux/libc-compat.h>
...@@ -31,6 +32,9 @@...@@ -31,6 +32,9 @@
31#define XATTR_BTRFS_PREFIX "btrfs."32#define XATTR_BTRFS_PREFIX "btrfs."
32#define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1)33#define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1)
3334
35#define XATTR_HURD_PREFIX "gnu."
36#define XATTR_HURD_PREFIX_LEN (sizeof(XATTR_HURD_PREFIX) - 1)
37
34#define XATTR_SECURITY_PREFIX "security."38#define XATTR_SECURITY_PREFIX "security."
35#define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)39#define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)
3640
lib/libc/include/any-linux-any/linux/xdp_diag.h created+83
...@@ -0,0 +1,83 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * xdp_diag: interface for query/monitor XDP sockets
4 * Copyright(c) 2019 Intel Corporation.
5 */
6
7#ifndef _LINUX_XDP_DIAG_H
8#define _LINUX_XDP_DIAG_H
9
10#include <linux/types.h>
11
12struct xdp_diag_req {
13 __u8 sdiag_family;
14 __u8 sdiag_protocol;
15 __u16 pad;
16 __u32 xdiag_ino;
17 __u32 xdiag_show;
18 __u32 xdiag_cookie[2];
19};
20
21struct xdp_diag_msg {
22 __u8 xdiag_family;
23 __u8 xdiag_type;
24 __u16 pad;
25 __u32 xdiag_ino;
26 __u32 xdiag_cookie[2];
27};
28
29#define XDP_SHOW_INFO (1 << 0) /* Basic information */
30#define XDP_SHOW_RING_CFG (1 << 1)
31#define XDP_SHOW_UMEM (1 << 2)
32#define XDP_SHOW_MEMINFO (1 << 3)
33#define XDP_SHOW_STATS (1 << 4)
34
35enum {
36 XDP_DIAG_NONE,
37 XDP_DIAG_INFO,
38 XDP_DIAG_UID,
39 XDP_DIAG_RX_RING,
40 XDP_DIAG_TX_RING,
41 XDP_DIAG_UMEM,
42 XDP_DIAG_UMEM_FILL_RING,
43 XDP_DIAG_UMEM_COMPLETION_RING,
44 XDP_DIAG_MEMINFO,
45 XDP_DIAG_STATS,
46 __XDP_DIAG_MAX,
47};
48
49#define XDP_DIAG_MAX (__XDP_DIAG_MAX - 1)
50
51struct xdp_diag_info {
52 __u32 ifindex;
53 __u32 queue_id;
54};
55
56struct xdp_diag_ring {
57 __u32 entries; /*num descs */
58};
59
60#define XDP_DU_F_ZEROCOPY (1 << 0)
61
62struct xdp_diag_umem {
63 __u64 size;
64 __u32 id;
65 __u32 num_pages;
66 __u32 chunk_size;
67 __u32 headroom;
68 __u32 ifindex;
69 __u32 queue_id;
70 __u32 flags;
71 __u32 refs;
72};
73
74struct xdp_diag_stats {
75 __u64 n_rx_dropped;
76 __u64 n_rx_invalid;
77 __u64 n_rx_full;
78 __u64 n_fill_ring_empty;
79 __u64 n_tx_invalid;
80 __u64 n_tx_ring_empty;
81};
82
83#endif /* _LINUX_XDP_DIAG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/xfrm.h+16-1
...@@ -215,6 +215,11 @@ enum {...@@ -215,6 +215,11 @@ enum {
215215
216 XFRM_MSG_MAPPING,216 XFRM_MSG_MAPPING,
217#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING217#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
218
219 XFRM_MSG_SETDEFAULT,
220#define XFRM_MSG_SETDEFAULT XFRM_MSG_SETDEFAULT
221 XFRM_MSG_GETDEFAULT,
222#define XFRM_MSG_GETDEFAULT XFRM_MSG_GETDEFAULT
218 __XFRM_MSG_MAX223 __XFRM_MSG_MAX
219};224};
220#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)225#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
...@@ -304,7 +309,7 @@ enum xfrm_attr_type_t {...@@ -304,7 +309,7 @@ enum xfrm_attr_type_t {
304 XFRMA_PROTO, /* __u8 */309 XFRMA_PROTO, /* __u8 */
305 XFRMA_ADDRESS_FILTER, /* struct xfrm_address_filter */310 XFRMA_ADDRESS_FILTER, /* struct xfrm_address_filter */
306 XFRMA_PAD,311 XFRMA_PAD,
307 XFRMA_OFFLOAD_DEV, /* struct xfrm_state_offload */312 XFRMA_OFFLOAD_DEV, /* struct xfrm_user_offload */
308 XFRMA_SET_MARK, /* __u32 */313 XFRMA_SET_MARK, /* __u32 */
309 XFRMA_SET_MARK_MASK, /* __u32 */314 XFRMA_SET_MARK_MASK, /* __u32 */
310 XFRMA_IF_ID, /* __u32 */315 XFRMA_IF_ID, /* __u32 */
...@@ -387,6 +392,7 @@ struct xfrm_usersa_info {...@@ -387,6 +392,7 @@ struct xfrm_usersa_info {
387};392};
388393
389#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1394#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
395#define XFRM_SA_XFLAG_OSEQ_MAY_WRAP 2
390396
391struct xfrm_usersa_id {397struct xfrm_usersa_id {
392 xfrm_address_t daddr;398 xfrm_address_t daddr;
...@@ -507,6 +513,15 @@ struct xfrm_user_offload {...@@ -507,6 +513,15 @@ struct xfrm_user_offload {
507#define XFRM_OFFLOAD_IPV6 1513#define XFRM_OFFLOAD_IPV6 1
508#define XFRM_OFFLOAD_INBOUND 2514#define XFRM_OFFLOAD_INBOUND 2
509515
516struct xfrm_userpolicy_default {
517#define XFRM_USERPOLICY_UNSPEC 0
518#define XFRM_USERPOLICY_BLOCK 1
519#define XFRM_USERPOLICY_ACCEPT 2
520 __u8 in;
521 __u8 fwd;
522 __u8 out;
523};
524
510/* backwards compatibility for userspace */525/* backwards compatibility for userspace */
511#define XFRMGRP_ACQUIRE 1526#define XFRMGRP_ACQUIRE 1
512#define XFRMGRP_EXPIRE 2527#define XFRMGRP_EXPIRE 2
lib/libc/include/any-linux-any/misc/cxl.h created+156
...@@ -0,0 +1,156 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright 2014 IBM Corp.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _MISC_CXL_H
12#define _MISC_CXL_H
13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17
18struct cxl_ioctl_start_work {
19 __u64 flags;
20 __u64 work_element_descriptor;
21 __u64 amr;
22 __s16 num_interrupts;
23 __u16 tid;
24 __s32 reserved1;
25 __u64 reserved2;
26 __u64 reserved3;
27 __u64 reserved4;
28 __u64 reserved5;
29};
30
31#define CXL_START_WORK_AMR 0x0000000000000001ULL
32#define CXL_START_WORK_NUM_IRQS 0x0000000000000002ULL
33#define CXL_START_WORK_ERR_FF 0x0000000000000004ULL
34#define CXL_START_WORK_TID 0x0000000000000008ULL
35#define CXL_START_WORK_ALL (CXL_START_WORK_AMR |\
36 CXL_START_WORK_NUM_IRQS |\
37 CXL_START_WORK_ERR_FF |\
38 CXL_START_WORK_TID)
39
40
41/* Possible modes that an afu can be in */
42#define CXL_MODE_DEDICATED 0x1
43#define CXL_MODE_DIRECTED 0x2
44
45/* possible flags for the cxl_afu_id flags field */
46#define CXL_AFUID_FLAG_SLAVE 0x1 /* In directed-mode afu is in slave mode */
47
48struct cxl_afu_id {
49 __u64 flags; /* One of CXL_AFUID_FLAG_X */
50 __u32 card_id;
51 __u32 afu_offset;
52 __u32 afu_mode; /* one of the CXL_MODE_X */
53 __u32 reserved1;
54 __u64 reserved2;
55 __u64 reserved3;
56 __u64 reserved4;
57 __u64 reserved5;
58 __u64 reserved6;
59};
60
61/* base adapter image header is included in the image */
62#define CXL_AI_NEED_HEADER 0x0000000000000001ULL
63#define CXL_AI_ALL CXL_AI_NEED_HEADER
64
65#define CXL_AI_HEADER_SIZE 128
66#define CXL_AI_BUFFER_SIZE 4096
67#define CXL_AI_MAX_ENTRIES 256
68#define CXL_AI_MAX_CHUNK_SIZE (CXL_AI_BUFFER_SIZE * CXL_AI_MAX_ENTRIES)
69
70struct cxl_adapter_image {
71 __u64 flags;
72 __u64 data;
73 __u64 len_data;
74 __u64 len_image;
75 __u64 reserved1;
76 __u64 reserved2;
77 __u64 reserved3;
78 __u64 reserved4;
79};
80
81/* ioctl numbers */
82#define CXL_MAGIC 0xCA
83/* AFU devices */
84#define CXL_IOCTL_START_WORK _IOW(CXL_MAGIC, 0x00, struct cxl_ioctl_start_work)
85#define CXL_IOCTL_GET_PROCESS_ELEMENT _IOR(CXL_MAGIC, 0x01, __u32)
86#define CXL_IOCTL_GET_AFU_ID _IOR(CXL_MAGIC, 0x02, struct cxl_afu_id)
87/* adapter devices */
88#define CXL_IOCTL_DOWNLOAD_IMAGE _IOW(CXL_MAGIC, 0x0A, struct cxl_adapter_image)
89#define CXL_IOCTL_VALIDATE_IMAGE _IOW(CXL_MAGIC, 0x0B, struct cxl_adapter_image)
90
91#define CXL_READ_MIN_SIZE 0x1000 /* 4K */
92
93/* Events from read() */
94enum cxl_event_type {
95 CXL_EVENT_RESERVED = 0,
96 CXL_EVENT_AFU_INTERRUPT = 1,
97 CXL_EVENT_DATA_STORAGE = 2,
98 CXL_EVENT_AFU_ERROR = 3,
99 CXL_EVENT_AFU_DRIVER = 4,
100};
101
102struct cxl_event_header {
103 __u16 type;
104 __u16 size;
105 __u16 process_element;
106 __u16 reserved1;
107};
108
109struct cxl_event_afu_interrupt {
110 __u16 flags;
111 __u16 irq; /* Raised AFU interrupt number */
112 __u32 reserved1;
113};
114
115struct cxl_event_data_storage {
116 __u16 flags;
117 __u16 reserved1;
118 __u32 reserved2;
119 __u64 addr;
120 __u64 dsisr;
121 __u64 reserved3;
122};
123
124struct cxl_event_afu_error {
125 __u16 flags;
126 __u16 reserved1;
127 __u32 reserved2;
128 __u64 error;
129};
130
131struct cxl_event_afu_driver_reserved {
132 /*
133 * Defines the buffer passed to the cxl driver by the AFU driver.
134 *
135 * This is not ABI since the event header.size passed to the user for
136 * existing events is set in the read call to sizeof(cxl_event_header)
137 * + sizeof(whatever event is being dispatched) and the user is already
138 * required to use a 4K buffer on the read call.
139 *
140 * Of course the contents will be ABI, but that's up the AFU driver.
141 */
142 __u32 data_size;
143 __u8 data[];
144};
145
146struct cxl_event {
147 struct cxl_event_header header;
148 union {
149 struct cxl_event_afu_interrupt irq;
150 struct cxl_event_data_storage fault;
151 struct cxl_event_afu_error afu_error;
152 struct cxl_event_afu_driver_reserved afu_driver_event;
153 };
154};
155
156#endif /* _MISC_CXL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/fastrpc.h created+57
...@@ -0,0 +1,57 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __QCOM_FASTRPC_H__
4#define __QCOM_FASTRPC_H__
5
6#include <linux/types.h>
7
8#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)
9#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)
10#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)
11#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)
12#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)
13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
15#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
16
17struct fastrpc_invoke_args {
18 __u64 ptr;
19 __u64 length;
20 __s32 fd;
21 __u32 reserved;
22};
23
24struct fastrpc_invoke {
25 __u32 handle;
26 __u32 sc;
27 __u64 args;
28};
29
30struct fastrpc_init_create {
31 __u32 filelen; /* elf file length */
32 __s32 filefd; /* fd for the file */
33 __u32 attrs;
34 __u32 siglen;
35 __u64 file; /* pointer to elf file */
36};
37
38struct fastrpc_alloc_dma_buf {
39 __s32 fd; /* fd */
40 __u32 flags; /* flags to map with */
41 __u64 size; /* size */
42};
43
44struct fastrpc_req_mmap {
45 __s32 fd;
46 __u32 flags; /* flags for dsp to map with */
47 __u64 vaddrin; /* optional virtual address */
48 __u64 size; /* size */
49 __u64 vaddrout; /* dsp virtual address */
50};
51
52struct fastrpc_req_munmap {
53 __u64 vaddrout; /* address to unmap */
54 __u64 size; /* size */
55};
56
57#endif /* __QCOM_FASTRPC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/habanalabs.h created+1384
...@@ -0,0 +1,1384 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2 *
3 * Copyright 2016-2020 HabanaLabs, Ltd.
4 * All Rights Reserved.
5 *
6 */
7
8#ifndef HABANALABS_H_
9#define HABANALABS_H_
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14/*
15 * Defines that are asic-specific but constitutes as ABI between kernel driver
16 * and userspace
17 */
18#define GOYA_KMD_SRAM_RESERVED_SIZE_FROM_START 0x8000 /* 32KB */
19#define GAUDI_DRIVER_SRAM_RESERVED_SIZE_FROM_START 0x80 /* 128 bytes */
20
21/*
22 * 128 SOBs reserved for collective wait
23 * 16 SOBs reserved for sync stream
24 */
25#define GAUDI_FIRST_AVAILABLE_W_S_SYNC_OBJECT 144
26
27/*
28 * 64 monitors reserved for collective wait
29 * 8 monitors reserved for sync stream
30 */
31#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
32
33/*
34 * Goya queue Numbering
35 *
36 * The external queues (PCI DMA channels) MUST be before the internal queues
37 * and each group (PCI DMA channels and internal) must be contiguous inside
38 * itself but there can be a gap between the two groups (although not
39 * recommended)
40 */
41
42enum goya_queue_id {
43 GOYA_QUEUE_ID_DMA_0 = 0,
44 GOYA_QUEUE_ID_DMA_1 = 1,
45 GOYA_QUEUE_ID_DMA_2 = 2,
46 GOYA_QUEUE_ID_DMA_3 = 3,
47 GOYA_QUEUE_ID_DMA_4 = 4,
48 GOYA_QUEUE_ID_CPU_PQ = 5,
49 GOYA_QUEUE_ID_MME = 6, /* Internal queues start here */
50 GOYA_QUEUE_ID_TPC0 = 7,
51 GOYA_QUEUE_ID_TPC1 = 8,
52 GOYA_QUEUE_ID_TPC2 = 9,
53 GOYA_QUEUE_ID_TPC3 = 10,
54 GOYA_QUEUE_ID_TPC4 = 11,
55 GOYA_QUEUE_ID_TPC5 = 12,
56 GOYA_QUEUE_ID_TPC6 = 13,
57 GOYA_QUEUE_ID_TPC7 = 14,
58 GOYA_QUEUE_ID_SIZE
59};
60
61/*
62 * Gaudi queue Numbering
63 * External queues (PCI DMA channels) are DMA_0_*, DMA_1_* and DMA_5_*.
64 * Except one CPU queue, all the rest are internal queues.
65 */
66
67enum gaudi_queue_id {
68 GAUDI_QUEUE_ID_DMA_0_0 = 0, /* external */
69 GAUDI_QUEUE_ID_DMA_0_1 = 1, /* external */
70 GAUDI_QUEUE_ID_DMA_0_2 = 2, /* external */
71 GAUDI_QUEUE_ID_DMA_0_3 = 3, /* external */
72 GAUDI_QUEUE_ID_DMA_1_0 = 4, /* external */
73 GAUDI_QUEUE_ID_DMA_1_1 = 5, /* external */
74 GAUDI_QUEUE_ID_DMA_1_2 = 6, /* external */
75 GAUDI_QUEUE_ID_DMA_1_3 = 7, /* external */
76 GAUDI_QUEUE_ID_CPU_PQ = 8, /* CPU */
77 GAUDI_QUEUE_ID_DMA_2_0 = 9, /* internal */
78 GAUDI_QUEUE_ID_DMA_2_1 = 10, /* internal */
79 GAUDI_QUEUE_ID_DMA_2_2 = 11, /* internal */
80 GAUDI_QUEUE_ID_DMA_2_3 = 12, /* internal */
81 GAUDI_QUEUE_ID_DMA_3_0 = 13, /* internal */
82 GAUDI_QUEUE_ID_DMA_3_1 = 14, /* internal */
83 GAUDI_QUEUE_ID_DMA_3_2 = 15, /* internal */
84 GAUDI_QUEUE_ID_DMA_3_3 = 16, /* internal */
85 GAUDI_QUEUE_ID_DMA_4_0 = 17, /* internal */
86 GAUDI_QUEUE_ID_DMA_4_1 = 18, /* internal */
87 GAUDI_QUEUE_ID_DMA_4_2 = 19, /* internal */
88 GAUDI_QUEUE_ID_DMA_4_3 = 20, /* internal */
89 GAUDI_QUEUE_ID_DMA_5_0 = 21, /* internal */
90 GAUDI_QUEUE_ID_DMA_5_1 = 22, /* internal */
91 GAUDI_QUEUE_ID_DMA_5_2 = 23, /* internal */
92 GAUDI_QUEUE_ID_DMA_5_3 = 24, /* internal */
93 GAUDI_QUEUE_ID_DMA_6_0 = 25, /* internal */
94 GAUDI_QUEUE_ID_DMA_6_1 = 26, /* internal */
95 GAUDI_QUEUE_ID_DMA_6_2 = 27, /* internal */
96 GAUDI_QUEUE_ID_DMA_6_3 = 28, /* internal */
97 GAUDI_QUEUE_ID_DMA_7_0 = 29, /* internal */
98 GAUDI_QUEUE_ID_DMA_7_1 = 30, /* internal */
99 GAUDI_QUEUE_ID_DMA_7_2 = 31, /* internal */
100 GAUDI_QUEUE_ID_DMA_7_3 = 32, /* internal */
101 GAUDI_QUEUE_ID_MME_0_0 = 33, /* internal */
102 GAUDI_QUEUE_ID_MME_0_1 = 34, /* internal */
103 GAUDI_QUEUE_ID_MME_0_2 = 35, /* internal */
104 GAUDI_QUEUE_ID_MME_0_3 = 36, /* internal */
105 GAUDI_QUEUE_ID_MME_1_0 = 37, /* internal */
106 GAUDI_QUEUE_ID_MME_1_1 = 38, /* internal */
107 GAUDI_QUEUE_ID_MME_1_2 = 39, /* internal */
108 GAUDI_QUEUE_ID_MME_1_3 = 40, /* internal */
109 GAUDI_QUEUE_ID_TPC_0_0 = 41, /* internal */
110 GAUDI_QUEUE_ID_TPC_0_1 = 42, /* internal */
111 GAUDI_QUEUE_ID_TPC_0_2 = 43, /* internal */
112 GAUDI_QUEUE_ID_TPC_0_3 = 44, /* internal */
113 GAUDI_QUEUE_ID_TPC_1_0 = 45, /* internal */
114 GAUDI_QUEUE_ID_TPC_1_1 = 46, /* internal */
115 GAUDI_QUEUE_ID_TPC_1_2 = 47, /* internal */
116 GAUDI_QUEUE_ID_TPC_1_3 = 48, /* internal */
117 GAUDI_QUEUE_ID_TPC_2_0 = 49, /* internal */
118 GAUDI_QUEUE_ID_TPC_2_1 = 50, /* internal */
119 GAUDI_QUEUE_ID_TPC_2_2 = 51, /* internal */
120 GAUDI_QUEUE_ID_TPC_2_3 = 52, /* internal */
121 GAUDI_QUEUE_ID_TPC_3_0 = 53, /* internal */
122 GAUDI_QUEUE_ID_TPC_3_1 = 54, /* internal */
123 GAUDI_QUEUE_ID_TPC_3_2 = 55, /* internal */
124 GAUDI_QUEUE_ID_TPC_3_3 = 56, /* internal */
125 GAUDI_QUEUE_ID_TPC_4_0 = 57, /* internal */
126 GAUDI_QUEUE_ID_TPC_4_1 = 58, /* internal */
127 GAUDI_QUEUE_ID_TPC_4_2 = 59, /* internal */
128 GAUDI_QUEUE_ID_TPC_4_3 = 60, /* internal */
129 GAUDI_QUEUE_ID_TPC_5_0 = 61, /* internal */
130 GAUDI_QUEUE_ID_TPC_5_1 = 62, /* internal */
131 GAUDI_QUEUE_ID_TPC_5_2 = 63, /* internal */
132 GAUDI_QUEUE_ID_TPC_5_3 = 64, /* internal */
133 GAUDI_QUEUE_ID_TPC_6_0 = 65, /* internal */
134 GAUDI_QUEUE_ID_TPC_6_1 = 66, /* internal */
135 GAUDI_QUEUE_ID_TPC_6_2 = 67, /* internal */
136 GAUDI_QUEUE_ID_TPC_6_3 = 68, /* internal */
137 GAUDI_QUEUE_ID_TPC_7_0 = 69, /* internal */
138 GAUDI_QUEUE_ID_TPC_7_1 = 70, /* internal */
139 GAUDI_QUEUE_ID_TPC_7_2 = 71, /* internal */
140 GAUDI_QUEUE_ID_TPC_7_3 = 72, /* internal */
141 GAUDI_QUEUE_ID_NIC_0_0 = 73, /* internal */
142 GAUDI_QUEUE_ID_NIC_0_1 = 74, /* internal */
143 GAUDI_QUEUE_ID_NIC_0_2 = 75, /* internal */
144 GAUDI_QUEUE_ID_NIC_0_3 = 76, /* internal */
145 GAUDI_QUEUE_ID_NIC_1_0 = 77, /* internal */
146 GAUDI_QUEUE_ID_NIC_1_1 = 78, /* internal */
147 GAUDI_QUEUE_ID_NIC_1_2 = 79, /* internal */
148 GAUDI_QUEUE_ID_NIC_1_3 = 80, /* internal */
149 GAUDI_QUEUE_ID_NIC_2_0 = 81, /* internal */
150 GAUDI_QUEUE_ID_NIC_2_1 = 82, /* internal */
151 GAUDI_QUEUE_ID_NIC_2_2 = 83, /* internal */
152 GAUDI_QUEUE_ID_NIC_2_3 = 84, /* internal */
153 GAUDI_QUEUE_ID_NIC_3_0 = 85, /* internal */
154 GAUDI_QUEUE_ID_NIC_3_1 = 86, /* internal */
155 GAUDI_QUEUE_ID_NIC_3_2 = 87, /* internal */
156 GAUDI_QUEUE_ID_NIC_3_3 = 88, /* internal */
157 GAUDI_QUEUE_ID_NIC_4_0 = 89, /* internal */
158 GAUDI_QUEUE_ID_NIC_4_1 = 90, /* internal */
159 GAUDI_QUEUE_ID_NIC_4_2 = 91, /* internal */
160 GAUDI_QUEUE_ID_NIC_4_3 = 92, /* internal */
161 GAUDI_QUEUE_ID_NIC_5_0 = 93, /* internal */
162 GAUDI_QUEUE_ID_NIC_5_1 = 94, /* internal */
163 GAUDI_QUEUE_ID_NIC_5_2 = 95, /* internal */
164 GAUDI_QUEUE_ID_NIC_5_3 = 96, /* internal */
165 GAUDI_QUEUE_ID_NIC_6_0 = 97, /* internal */
166 GAUDI_QUEUE_ID_NIC_6_1 = 98, /* internal */
167 GAUDI_QUEUE_ID_NIC_6_2 = 99, /* internal */
168 GAUDI_QUEUE_ID_NIC_6_3 = 100, /* internal */
169 GAUDI_QUEUE_ID_NIC_7_0 = 101, /* internal */
170 GAUDI_QUEUE_ID_NIC_7_1 = 102, /* internal */
171 GAUDI_QUEUE_ID_NIC_7_2 = 103, /* internal */
172 GAUDI_QUEUE_ID_NIC_7_3 = 104, /* internal */
173 GAUDI_QUEUE_ID_NIC_8_0 = 105, /* internal */
174 GAUDI_QUEUE_ID_NIC_8_1 = 106, /* internal */
175 GAUDI_QUEUE_ID_NIC_8_2 = 107, /* internal */
176 GAUDI_QUEUE_ID_NIC_8_3 = 108, /* internal */
177 GAUDI_QUEUE_ID_NIC_9_0 = 109, /* internal */
178 GAUDI_QUEUE_ID_NIC_9_1 = 110, /* internal */
179 GAUDI_QUEUE_ID_NIC_9_2 = 111, /* internal */
180 GAUDI_QUEUE_ID_NIC_9_3 = 112, /* internal */
181 GAUDI_QUEUE_ID_SIZE
182};
183
184/*
185 * Engine Numbering
186 *
187 * Used in the "busy_engines_mask" field in `struct hl_info_hw_idle'
188 */
189
190enum goya_engine_id {
191 GOYA_ENGINE_ID_DMA_0 = 0,
192 GOYA_ENGINE_ID_DMA_1,
193 GOYA_ENGINE_ID_DMA_2,
194 GOYA_ENGINE_ID_DMA_3,
195 GOYA_ENGINE_ID_DMA_4,
196 GOYA_ENGINE_ID_MME_0,
197 GOYA_ENGINE_ID_TPC_0,
198 GOYA_ENGINE_ID_TPC_1,
199 GOYA_ENGINE_ID_TPC_2,
200 GOYA_ENGINE_ID_TPC_3,
201 GOYA_ENGINE_ID_TPC_4,
202 GOYA_ENGINE_ID_TPC_5,
203 GOYA_ENGINE_ID_TPC_6,
204 GOYA_ENGINE_ID_TPC_7,
205 GOYA_ENGINE_ID_SIZE
206};
207
208enum gaudi_engine_id {
209 GAUDI_ENGINE_ID_DMA_0 = 0,
210 GAUDI_ENGINE_ID_DMA_1,
211 GAUDI_ENGINE_ID_DMA_2,
212 GAUDI_ENGINE_ID_DMA_3,
213 GAUDI_ENGINE_ID_DMA_4,
214 GAUDI_ENGINE_ID_DMA_5,
215 GAUDI_ENGINE_ID_DMA_6,
216 GAUDI_ENGINE_ID_DMA_7,
217 GAUDI_ENGINE_ID_MME_0,
218 GAUDI_ENGINE_ID_MME_1,
219 GAUDI_ENGINE_ID_MME_2,
220 GAUDI_ENGINE_ID_MME_3,
221 GAUDI_ENGINE_ID_TPC_0,
222 GAUDI_ENGINE_ID_TPC_1,
223 GAUDI_ENGINE_ID_TPC_2,
224 GAUDI_ENGINE_ID_TPC_3,
225 GAUDI_ENGINE_ID_TPC_4,
226 GAUDI_ENGINE_ID_TPC_5,
227 GAUDI_ENGINE_ID_TPC_6,
228 GAUDI_ENGINE_ID_TPC_7,
229 GAUDI_ENGINE_ID_NIC_0,
230 GAUDI_ENGINE_ID_NIC_1,
231 GAUDI_ENGINE_ID_NIC_2,
232 GAUDI_ENGINE_ID_NIC_3,
233 GAUDI_ENGINE_ID_NIC_4,
234 GAUDI_ENGINE_ID_NIC_5,
235 GAUDI_ENGINE_ID_NIC_6,
236 GAUDI_ENGINE_ID_NIC_7,
237 GAUDI_ENGINE_ID_NIC_8,
238 GAUDI_ENGINE_ID_NIC_9,
239 GAUDI_ENGINE_ID_SIZE
240};
241
242/*
243 * ASIC specific PLL index
244 *
245 * Used to retrieve in frequency info of different IPs via
246 * HL_INFO_PLL_FREQUENCY under HL_IOCTL_INFO IOCTL. The enums need to be
247 * used as an index in struct hl_pll_frequency_info
248 */
249
250enum hl_goya_pll_index {
251 HL_GOYA_CPU_PLL = 0,
252 HL_GOYA_IC_PLL,
253 HL_GOYA_MC_PLL,
254 HL_GOYA_MME_PLL,
255 HL_GOYA_PCI_PLL,
256 HL_GOYA_EMMC_PLL,
257 HL_GOYA_TPC_PLL,
258 HL_GOYA_PLL_MAX
259};
260
261enum hl_gaudi_pll_index {
262 HL_GAUDI_CPU_PLL = 0,
263 HL_GAUDI_PCI_PLL,
264 HL_GAUDI_SRAM_PLL,
265 HL_GAUDI_HBM_PLL,
266 HL_GAUDI_NIC_PLL,
267 HL_GAUDI_DMA_PLL,
268 HL_GAUDI_MESH_PLL,
269 HL_GAUDI_MME_PLL,
270 HL_GAUDI_TPC_PLL,
271 HL_GAUDI_IF_PLL,
272 HL_GAUDI_PLL_MAX
273};
274
275/**
276 * enum hl_device_status - Device status information.
277 * @HL_DEVICE_STATUS_OPERATIONAL: Device is operational.
278 * @HL_DEVICE_STATUS_IN_RESET: Device is currently during reset.
279 * @HL_DEVICE_STATUS_MALFUNCTION: Device is unusable.
280 * @HL_DEVICE_STATUS_NEEDS_RESET: Device needs reset because auto reset was disabled.
281 * @HL_DEVICE_STATUS_IN_DEVICE_CREATION: Device is operational but its creation is still in
282 * progress.
283 * @HL_DEVICE_STATUS_LAST: Last status.
284 */
285enum hl_device_status {
286 HL_DEVICE_STATUS_OPERATIONAL,
287 HL_DEVICE_STATUS_IN_RESET,
288 HL_DEVICE_STATUS_MALFUNCTION,
289 HL_DEVICE_STATUS_NEEDS_RESET,
290 HL_DEVICE_STATUS_IN_DEVICE_CREATION,
291 HL_DEVICE_STATUS_LAST = HL_DEVICE_STATUS_IN_DEVICE_CREATION
292};
293
294enum hl_server_type {
295 HL_SERVER_TYPE_UNKNOWN = 0,
296 HL_SERVER_GAUDI_HLS1 = 1,
297 HL_SERVER_GAUDI_HLS1H = 2,
298 HL_SERVER_GAUDI_TYPE1 = 3,
299 HL_SERVER_GAUDI_TYPE2 = 4
300};
301
302/* Opcode for management ioctl
303 *
304 * HW_IP_INFO - Receive information about different IP blocks in the
305 * device.
306 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
307 * occurred since the last hard reset.
308 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
309 * specific context. This is relevant only for devices
310 * where the dram is managed by the kernel driver
311 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
312 * internal engine.
313 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
314 * require an open context.
315 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
316 * over the last period specified by the user.
317 * The period can be between 100ms to 1s, in
318 * resolution of 100ms. The return value is a
319 * percentage of the utilization rate.
320 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
321 * event occurred since the driver was loaded.
322 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
323 * of the device in MHz. The maximum clock rate is
324 * configurable via sysfs parameter
325 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
326 * operations performed on the device since the last
327 * time the driver was loaded.
328 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
329 * for synchronization.
330 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
331 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
332 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
333 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
334 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
335 * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency
336 * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls
337 */
338#define HL_INFO_HW_IP_INFO 0
339#define HL_INFO_HW_EVENTS 1
340#define HL_INFO_DRAM_USAGE 2
341#define HL_INFO_HW_IDLE 3
342#define HL_INFO_DEVICE_STATUS 4
343#define HL_INFO_DEVICE_UTILIZATION 6
344#define HL_INFO_HW_EVENTS_AGGREGATE 7
345#define HL_INFO_CLK_RATE 8
346#define HL_INFO_RESET_COUNT 9
347#define HL_INFO_TIME_SYNC 10
348#define HL_INFO_CS_COUNTERS 11
349#define HL_INFO_PCI_COUNTERS 12
350#define HL_INFO_CLK_THROTTLE_REASON 13
351#define HL_INFO_SYNC_MANAGER 14
352#define HL_INFO_TOTAL_ENERGY 15
353#define HL_INFO_PLL_FREQUENCY 16
354#define HL_INFO_POWER 17
355#define HL_INFO_OPEN_STATS 18
356
357#define HL_INFO_VERSION_MAX_LEN 128
358#define HL_INFO_CARD_NAME_MAX_LEN 16
359
360/**
361 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
362 * @sram_base_address: The first SRAM physical base address that is free to be
363 * used by the user.
364 * @dram_base_address: The first DRAM virtual or physical base address that is
365 * free to be used by the user.
366 * @dram_size: The DRAM size that is available to the user.
367 * @sram_size: The SRAM size that is available to the user.
368 * @num_of_events: The number of events that can be received from the f/w. This
369 * is needed so the user can what is the size of the h/w events
370 * array he needs to pass to the kernel when he wants to fetch
371 * the event counters.
372 * @device_id: PCI device ID of the ASIC.
373 * @module_id: Module ID of the ASIC for mezzanine cards in servers
374 * (From OCP spec).
375 * @first_available_interrupt_id: The first available interrupt ID for the user
376 * to be used when it works with user interrupts.
377 * @server_type: Server type that the Gaudi ASIC is currently installed in.
378 * The value is according to enum hl_server_type
379 * @cpld_version: CPLD version on the board.
380 * @psoc_pci_pll_nr: PCI PLL NR value. Needed by the profiler in some ASICs.
381 * @psoc_pci_pll_nf: PCI PLL NF value. Needed by the profiler in some ASICs.
382 * @psoc_pci_pll_od: PCI PLL OD value. Needed by the profiler in some ASICs.
383 * @psoc_pci_pll_div_factor: PCI PLL DIV factor value. Needed by the profiler
384 * in some ASICs.
385 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
386 * for Goya/Gaudi only.
387 * @dram_enabled: Whether the DRAM is enabled.
388 * @cpucp_version: The CPUCP f/w version.
389 * @card_name: The card name as passed by the f/w.
390 * @dram_page_size: The DRAM physical page size.
391 */
392struct hl_info_hw_ip_info {
393 __u64 sram_base_address;
394 __u64 dram_base_address;
395 __u64 dram_size;
396 __u32 sram_size;
397 __u32 num_of_events;
398 __u32 device_id;
399 __u32 module_id;
400 __u32 reserved;
401 __u16 first_available_interrupt_id;
402 __u16 server_type;
403 __u32 cpld_version;
404 __u32 psoc_pci_pll_nr;
405 __u32 psoc_pci_pll_nf;
406 __u32 psoc_pci_pll_od;
407 __u32 psoc_pci_pll_div_factor;
408 __u8 tpc_enabled_mask;
409 __u8 dram_enabled;
410 __u8 pad[2];
411 __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN];
412 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
413 __u64 reserved2;
414 __u64 dram_page_size;
415};
416
417struct hl_info_dram_usage {
418 __u64 dram_free_mem;
419 __u64 ctx_dram_mem;
420};
421
422#define HL_BUSY_ENGINES_MASK_EXT_SIZE 2
423
424struct hl_info_hw_idle {
425 __u32 is_idle;
426 /*
427 * Bitmask of busy engines.
428 * Bits definition is according to `enum <chip>_enging_id'.
429 */
430 __u32 busy_engines_mask;
431
432 /*
433 * Extended Bitmask of busy engines.
434 * Bits definition is according to `enum <chip>_enging_id'.
435 */
436 __u64 busy_engines_mask_ext[HL_BUSY_ENGINES_MASK_EXT_SIZE];
437};
438
439struct hl_info_device_status {
440 __u32 status;
441 __u32 pad;
442};
443
444struct hl_info_device_utilization {
445 __u32 utilization;
446 __u32 pad;
447};
448
449struct hl_info_clk_rate {
450 __u32 cur_clk_rate_mhz;
451 __u32 max_clk_rate_mhz;
452};
453
454struct hl_info_reset_count {
455 __u32 hard_reset_cnt;
456 __u32 soft_reset_cnt;
457};
458
459struct hl_info_time_sync {
460 __u64 device_time;
461 __u64 host_time;
462};
463
464/**
465 * struct hl_info_pci_counters - pci counters
466 * @rx_throughput: PCI rx throughput KBps
467 * @tx_throughput: PCI tx throughput KBps
468 * @replay_cnt: PCI replay counter
469 */
470struct hl_info_pci_counters {
471 __u64 rx_throughput;
472 __u64 tx_throughput;
473 __u64 replay_cnt;
474};
475
476#define HL_CLK_THROTTLE_POWER 0x1
477#define HL_CLK_THROTTLE_THERMAL 0x2
478
479/**
480 * struct hl_info_clk_throttle - clock throttling reason
481 * @clk_throttling_reason: each bit represents a clk throttling reason
482 */
483struct hl_info_clk_throttle {
484 __u32 clk_throttling_reason;
485};
486
487/**
488 * struct hl_info_energy - device energy information
489 * @total_energy_consumption: total device energy consumption
490 */
491struct hl_info_energy {
492 __u64 total_energy_consumption;
493};
494
495#define HL_PLL_NUM_OUTPUTS 4
496
497struct hl_pll_frequency_info {
498 __u16 output[HL_PLL_NUM_OUTPUTS];
499};
500
501/**
502 * struct hl_open_stats_info - device open statistics information
503 * @open_counter: ever growing counter, increased on each successful dev open
504 * @last_open_period_ms: duration (ms) device was open last time
505 */
506struct hl_open_stats_info {
507 __u64 open_counter;
508 __u64 last_open_period_ms;
509};
510
511/**
512 * struct hl_power_info - power information
513 * @power: power consumption
514 */
515struct hl_power_info {
516 __u64 power;
517};
518
519/**
520 * struct hl_info_sync_manager - sync manager information
521 * @first_available_sync_object: first available sob
522 * @first_available_monitor: first available monitor
523 * @first_available_cq: first available cq
524 */
525struct hl_info_sync_manager {
526 __u32 first_available_sync_object;
527 __u32 first_available_monitor;
528 __u32 first_available_cq;
529 __u32 reserved;
530};
531
532/**
533 * struct hl_info_cs_counters - command submission counters
534 * @total_out_of_mem_drop_cnt: total dropped due to memory allocation issue
535 * @ctx_out_of_mem_drop_cnt: context dropped due to memory allocation issue
536 * @total_parsing_drop_cnt: total dropped due to error in packet parsing
537 * @ctx_parsing_drop_cnt: context dropped due to error in packet parsing
538 * @total_queue_full_drop_cnt: total dropped due to queue full
539 * @ctx_queue_full_drop_cnt: context dropped due to queue full
540 * @total_device_in_reset_drop_cnt: total dropped due to device in reset
541 * @ctx_device_in_reset_drop_cnt: context dropped due to device in reset
542 * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight
543 * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight
544 * @total_validation_drop_cnt: total dropped due to validation error
545 * @ctx_validation_drop_cnt: context dropped due to validation error
546 */
547struct hl_info_cs_counters {
548 __u64 total_out_of_mem_drop_cnt;
549 __u64 ctx_out_of_mem_drop_cnt;
550 __u64 total_parsing_drop_cnt;
551 __u64 ctx_parsing_drop_cnt;
552 __u64 total_queue_full_drop_cnt;
553 __u64 ctx_queue_full_drop_cnt;
554 __u64 total_device_in_reset_drop_cnt;
555 __u64 ctx_device_in_reset_drop_cnt;
556 __u64 total_max_cs_in_flight_drop_cnt;
557 __u64 ctx_max_cs_in_flight_drop_cnt;
558 __u64 total_validation_drop_cnt;
559 __u64 ctx_validation_drop_cnt;
560};
561
562enum gaudi_dcores {
563 HL_GAUDI_WS_DCORE,
564 HL_GAUDI_WN_DCORE,
565 HL_GAUDI_EN_DCORE,
566 HL_GAUDI_ES_DCORE
567};
568
569/**
570 * struct hl_info_args - Main structure to retrieve device related information.
571 * @return_pointer: User space address of the relevant structure related to HL_INFO_* operation
572 * mentioned in @op.
573 * @return_size: Size of the structure used in @return_pointer, just like "size" in "snprintf", it
574 * limits how many bytes the kernel can write. For hw_events array, the size should be
575 * hl_info_hw_ip_info.num_of_events * sizeof(__u32).
576 * @op: Defines which type of information to be retrieved. Refer HL_INFO_* for details.
577 * @dcore_id: DCORE id for which the information is relevant (for Gaudi refer to enum gaudi_dcores).
578 * @ctx_id: Context ID of the user. Currently not in use.
579 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
580 * resolution. Currently not in use.
581 * @pll_index: Index as defined in hl_<asic type>_pll_index enumeration.
582 * @pad: Padding to 64 bit.
583 */
584struct hl_info_args {
585 __u64 return_pointer;
586 __u32 return_size;
587 __u32 op;
588
589 union {
590 __u32 dcore_id;
591 __u32 ctx_id;
592 __u32 period_ms;
593 __u32 pll_index;
594 };
595
596 __u32 pad;
597};
598
599/* Opcode to create a new command buffer */
600#define HL_CB_OP_CREATE 0
601/* Opcode to destroy previously created command buffer */
602#define HL_CB_OP_DESTROY 1
603/* Opcode to retrieve information about a command buffer */
604#define HL_CB_OP_INFO 2
605
606/* 2MB minus 32 bytes for 2xMSG_PROT */
607#define HL_MAX_CB_SIZE (0x200000 - 32)
608
609/* Indicates whether the command buffer should be mapped to the device's MMU */
610#define HL_CB_FLAGS_MAP 0x1
611
612struct hl_cb_in {
613 /* Handle of CB or 0 if we want to create one */
614 __u64 cb_handle;
615 /* HL_CB_OP_* */
616 __u32 op;
617 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
618 * will be allocated, regardless of this parameter's value, is PAGE_SIZE
619 */
620 __u32 cb_size;
621 /* Context ID - Currently not in use */
622 __u32 ctx_id;
623 /* HL_CB_FLAGS_* */
624 __u32 flags;
625};
626
627struct hl_cb_out {
628 union {
629 /* Handle of CB */
630 __u64 cb_handle;
631
632 /* Information about CB */
633 struct {
634 /* Usage count of CB */
635 __u32 usage_cnt;
636 __u32 pad;
637 };
638 };
639};
640
641union hl_cb_args {
642 struct hl_cb_in in;
643 struct hl_cb_out out;
644};
645
646/* HL_CS_CHUNK_FLAGS_ values
647 *
648 * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB:
649 * Indicates if the CB was allocated and mapped by userspace.
650 * User allocated CB is a command buffer allocated by the user, via malloc
651 * (or similar). After allocating the CB, the user invokes “memory ioctl”
652 * to map the user memory into a device virtual address. The user provides
653 * this address via the cb_handle field. The interface provides the
654 * ability to create a large CBs, Which aren’t limited to
655 * “HL_MAX_CB_SIZE”. Therefore, it increases the PCI-DMA queues
656 * throughput. This CB allocation method also reduces the use of Linux
657 * DMA-able memory pool. Which are limited and used by other Linux
658 * sub-systems.
659 */
660#define HL_CS_CHUNK_FLAGS_USER_ALLOC_CB 0x1
661
662/*
663 * This structure size must always be fixed to 64-bytes for backward
664 * compatibility
665 */
666struct hl_cs_chunk {
667 union {
668 /* For external queue, this represents a Handle of CB on the
669 * Host.
670 * For internal queue in Goya, this represents an SRAM or
671 * a DRAM address of the internal CB. In Gaudi, this might also
672 * represent a mapped host address of the CB.
673 *
674 * A mapped host address is in the device address space, after
675 * a host address was mapped by the device MMU.
676 */
677 __u64 cb_handle;
678
679 /* Relevant only when HL_CS_FLAGS_WAIT or
680 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
681 * This holds address of array of u64 values that contain
682 * signal CS sequence numbers. The wait described by
683 * this job will listen on all those signals
684 * (wait event per signal)
685 */
686 __u64 signal_seq_arr;
687
688 /*
689 * Relevant only when HL_CS_FLAGS_WAIT or
690 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
691 * along with HL_CS_FLAGS_ENCAP_SIGNALS.
692 * This is the CS sequence which has the encapsulated signals.
693 */
694 __u64 encaps_signal_seq;
695 };
696
697 /* Index of queue to put the CB on */
698 __u32 queue_index;
699
700 union {
701 /*
702 * Size of command buffer with valid packets
703 * Can be smaller then actual CB size
704 */
705 __u32 cb_size;
706
707 /* Relevant only when HL_CS_FLAGS_WAIT or
708 * HL_CS_FLAGS_COLLECTIVE_WAIT is set.
709 * Number of entries in signal_seq_arr
710 */
711 __u32 num_signal_seq_arr;
712
713 /* Relevant only when HL_CS_FLAGS_WAIT or
714 * HL_CS_FLAGS_COLLECTIVE_WAIT is set along
715 * with HL_CS_FLAGS_ENCAP_SIGNALS
716 * This set the signals range that the user want to wait for
717 * out of the whole reserved signals range.
718 * e.g if the signals range is 20, and user don't want
719 * to wait for signal 8, so he set this offset to 7, then
720 * he call the API again with 9 and so on till 20.
721 */
722 __u32 encaps_signal_offset;
723 };
724
725 /* HL_CS_CHUNK_FLAGS_* */
726 __u32 cs_chunk_flags;
727
728 /* Relevant only when HL_CS_FLAGS_COLLECTIVE_WAIT is set.
729 * This holds the collective engine ID. The wait described by this job
730 * will sync with this engine and with all NICs before completion.
731 */
732 __u32 collective_engine_id;
733
734 /* Align structure to 64 bytes */
735 __u32 pad[10];
736};
737
738/* SIGNAL and WAIT/COLLECTIVE_WAIT flags are mutually exclusive */
739#define HL_CS_FLAGS_FORCE_RESTORE 0x1
740#define HL_CS_FLAGS_SIGNAL 0x2
741#define HL_CS_FLAGS_WAIT 0x4
742#define HL_CS_FLAGS_COLLECTIVE_WAIT 0x8
743#define HL_CS_FLAGS_TIMESTAMP 0x20
744#define HL_CS_FLAGS_STAGED_SUBMISSION 0x40
745#define HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 0x80
746#define HL_CS_FLAGS_STAGED_SUBMISSION_LAST 0x100
747#define HL_CS_FLAGS_CUSTOM_TIMEOUT 0x200
748#define HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT 0x400
749
750/*
751 * The encapsulated signals CS is merged into the existing CS ioctls.
752 * In order to use this feature need to follow the below procedure:
753 * 1. Reserve signals, set the CS type to HL_CS_FLAGS_RESERVE_SIGNALS_ONLY
754 * the output of this API will be the SOB offset from CFG_BASE.
755 * this address will be used to patch CB cmds to do the signaling for this
756 * SOB by incrementing it's value.
757 * for reverting the reservation use HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY
758 * CS type, note that this might fail if out-of-sync happened to the SOB
759 * value, in case other signaling request to the same SOB occurred between
760 * reserve-unreserve calls.
761 * 2. Use the staged CS to do the encapsulated signaling jobs.
762 * use HL_CS_FLAGS_STAGED_SUBMISSION and HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
763 * along with HL_CS_FLAGS_ENCAP_SIGNALS flag, and set encaps_signal_offset
764 * field. This offset allows app to wait on part of the reserved signals.
765 * 3. Use WAIT/COLLECTIVE WAIT CS along with HL_CS_FLAGS_ENCAP_SIGNALS flag
766 * to wait for the encapsulated signals.
767 */
768#define HL_CS_FLAGS_ENCAP_SIGNALS 0x800
769#define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000
770#define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000
771
772#define HL_CS_STATUS_SUCCESS 0
773
774#define HL_MAX_JOBS_PER_CS 512
775
776struct hl_cs_in {
777
778 /* this holds address of array of hl_cs_chunk for restore phase */
779 __u64 chunks_restore;
780
781 /* holds address of array of hl_cs_chunk for execution phase */
782 __u64 chunks_execute;
783
784 union {
785 /*
786 * Sequence number of a staged submission CS
787 * valid only if HL_CS_FLAGS_STAGED_SUBMISSION is set and
788 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST is unset.
789 */
790 __u64 seq;
791
792 /*
793 * Encapsulated signals handle id
794 * Valid for two flows:
795 * 1. CS with encapsulated signals:
796 * when HL_CS_FLAGS_STAGED_SUBMISSION and
797 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
798 * and HL_CS_FLAGS_ENCAP_SIGNALS are set.
799 * 2. unreserve signals:
800 * valid when HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY is set.
801 */
802 __u32 encaps_sig_handle_id;
803
804 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
805 struct {
806 /* Encapsulated signals number */
807 __u32 encaps_signals_count;
808
809 /* Encapsulated signals queue index (stream) */
810 __u32 encaps_signals_q_idx;
811 };
812 };
813
814 /* Number of chunks in restore phase array. Maximum number is
815 * HL_MAX_JOBS_PER_CS
816 */
817 __u32 num_chunks_restore;
818
819 /* Number of chunks in execution array. Maximum number is
820 * HL_MAX_JOBS_PER_CS
821 */
822 __u32 num_chunks_execute;
823
824 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
825 * is set
826 */
827 __u32 timeout;
828
829 /* HL_CS_FLAGS_* */
830 __u32 cs_flags;
831
832 /* Context ID - Currently not in use */
833 __u32 ctx_id;
834};
835
836struct hl_cs_out {
837 union {
838 /*
839 * seq holds the sequence number of the CS to pass to wait
840 * ioctl. All values are valid except for 0 and ULLONG_MAX
841 */
842 __u64 seq;
843
844 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
845 struct {
846 /* This is the resereved signal handle id */
847 __u32 handle_id;
848
849 /* This is the signals count */
850 __u32 count;
851 };
852 };
853
854 /* HL_CS_STATUS */
855 __u32 status;
856
857 /*
858 * SOB base address offset
859 * Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set
860 */
861 __u32 sob_base_addr_offset;
862};
863
864union hl_cs_args {
865 struct hl_cs_in in;
866 struct hl_cs_out out;
867};
868
869#define HL_WAIT_CS_FLAGS_INTERRUPT 0x2
870#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
871#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
872
873#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
874
875struct hl_wait_cs_in {
876 union {
877 struct {
878 /*
879 * In case of wait_cs holds the CS sequence number.
880 * In case of wait for multi CS hold a user pointer to
881 * an array of CS sequence numbers
882 */
883 __u64 seq;
884 /* Absolute timeout to wait for command submission
885 * in microseconds
886 */
887 __u64 timeout_us;
888 };
889
890 struct {
891 /* User address for completion comparison.
892 * upon interrupt, driver will compare the value pointed
893 * by this address with the supplied target value.
894 * in order not to perform any comparison, set address
895 * to all 1s.
896 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
897 */
898 __u64 addr;
899 /* Target value for completion comparison */
900 __u64 target;
901 };
902 };
903
904 /* Context ID - Currently not in use */
905 __u32 ctx_id;
906
907 /* HL_WAIT_CS_FLAGS_*
908 * If HL_WAIT_CS_FLAGS_INTERRUPT is set, this field should include
909 * interrupt id according to HL_WAIT_CS_FLAGS_INTERRUPT_MASK, in order
910 * not to specify an interrupt id ,set mask to all 1s.
911 */
912 __u32 flags;
913
914 /* Multi CS API info- valid entries in multi-CS array */
915 __u8 seq_arr_len;
916 __u8 pad[3];
917
918 /* Absolute timeout to wait for an interrupt in microseconds.
919 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
920 */
921 __u32 interrupt_timeout_us;
922};
923
924#define HL_WAIT_CS_STATUS_COMPLETED 0
925#define HL_WAIT_CS_STATUS_BUSY 1
926#define HL_WAIT_CS_STATUS_TIMEDOUT 2
927#define HL_WAIT_CS_STATUS_ABORTED 3
928
929#define HL_WAIT_CS_STATUS_FLAG_GONE 0x1
930#define HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD 0x2
931
932struct hl_wait_cs_out {
933 /* HL_WAIT_CS_STATUS_* */
934 __u32 status;
935 /* HL_WAIT_CS_STATUS_FLAG* */
936 __u32 flags;
937 /*
938 * valid only if HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD is set
939 * for wait_cs: timestamp of CS completion
940 * for wait_multi_cs: timestamp of FIRST CS completion
941 */
942 __s64 timestamp_nsec;
943 /* multi CS completion bitmap */
944 __u32 cs_completion_map;
945 __u32 pad;
946};
947
948union hl_wait_cs_args {
949 struct hl_wait_cs_in in;
950 struct hl_wait_cs_out out;
951};
952
953/* Opcode to allocate device memory */
954#define HL_MEM_OP_ALLOC 0
955/* Opcode to free previously allocated device memory */
956#define HL_MEM_OP_FREE 1
957/* Opcode to map host and device memory */
958#define HL_MEM_OP_MAP 2
959/* Opcode to unmap previously mapped host and device memory */
960#define HL_MEM_OP_UNMAP 3
961/* Opcode to map a hw block */
962#define HL_MEM_OP_MAP_BLOCK 4
963/* Opcode to create DMA-BUF object for an existing device memory allocation
964 * and to export an FD of that DMA-BUF back to the caller
965 */
966#define HL_MEM_OP_EXPORT_DMABUF_FD 5
967
968/* Memory flags */
969#define HL_MEM_CONTIGUOUS 0x1
970#define HL_MEM_SHARED 0x2
971#define HL_MEM_USERPTR 0x4
972#define HL_MEM_FORCE_HINT 0x8
973
974struct hl_mem_in {
975 union {
976 /* HL_MEM_OP_ALLOC- allocate device memory */
977 struct {
978 /* Size to alloc */
979 __u64 mem_size;
980 } alloc;
981
982 /* HL_MEM_OP_FREE - free device memory */
983 struct {
984 /* Handle returned from HL_MEM_OP_ALLOC */
985 __u64 handle;
986 } free;
987
988 /* HL_MEM_OP_MAP - map device memory */
989 struct {
990 /*
991 * Requested virtual address of mapped memory.
992 * The driver will try to map the requested region to
993 * this hint address, as long as the address is valid
994 * and not already mapped. The user should check the
995 * returned address of the IOCTL to make sure he got
996 * the hint address. Passing 0 here means that the
997 * driver will choose the address itself.
998 */
999 __u64 hint_addr;
1000 /* Handle returned from HL_MEM_OP_ALLOC */
1001 __u64 handle;
1002 } map_device;
1003
1004 /* HL_MEM_OP_MAP - map host memory */
1005 struct {
1006 /* Address of allocated host memory */
1007 __u64 host_virt_addr;
1008 /*
1009 * Requested virtual address of mapped memory.
1010 * The driver will try to map the requested region to
1011 * this hint address, as long as the address is valid
1012 * and not already mapped. The user should check the
1013 * returned address of the IOCTL to make sure he got
1014 * the hint address. Passing 0 here means that the
1015 * driver will choose the address itself.
1016 */
1017 __u64 hint_addr;
1018 /* Size of allocated host memory */
1019 __u64 mem_size;
1020 } map_host;
1021
1022 /* HL_MEM_OP_MAP_BLOCK - map a hw block */
1023 struct {
1024 /*
1025 * HW block address to map, a handle and size will be
1026 * returned to the user and will be used to mmap the
1027 * relevant block. Only addresses from configuration
1028 * space are allowed.
1029 */
1030 __u64 block_addr;
1031 } map_block;
1032
1033 /* HL_MEM_OP_UNMAP - unmap host memory */
1034 struct {
1035 /* Virtual address returned from HL_MEM_OP_MAP */
1036 __u64 device_virt_addr;
1037 } unmap;
1038
1039 /* HL_MEM_OP_EXPORT_DMABUF_FD */
1040 struct {
1041 /* Handle returned from HL_MEM_OP_ALLOC. In Gaudi,
1042 * where we don't have MMU for the device memory, the
1043 * driver expects a physical address (instead of
1044 * a handle) in the device memory space.
1045 */
1046 __u64 handle;
1047 /* Size of memory allocation. Relevant only for GAUDI */
1048 __u64 mem_size;
1049 } export_dmabuf_fd;
1050 };
1051
1052 /* HL_MEM_OP_* */
1053 __u32 op;
1054 /* HL_MEM_* flags.
1055 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the
1056 * DMA-BUF file/FD flags.
1057 */
1058 __u32 flags;
1059 /* Context ID - Currently not in use */
1060 __u32 ctx_id;
1061 __u32 pad;
1062};
1063
1064struct hl_mem_out {
1065 union {
1066 /*
1067 * Used for HL_MEM_OP_MAP as the virtual address that was
1068 * assigned in the device VA space.
1069 * A value of 0 means the requested operation failed.
1070 */
1071 __u64 device_virt_addr;
1072
1073 /*
1074 * Used in HL_MEM_OP_ALLOC
1075 * This is the assigned handle for the allocated memory
1076 */
1077 __u64 handle;
1078
1079 struct {
1080 /*
1081 * Used in HL_MEM_OP_MAP_BLOCK.
1082 * This is the assigned handle for the mapped block
1083 */
1084 __u64 block_handle;
1085
1086 /*
1087 * Used in HL_MEM_OP_MAP_BLOCK
1088 * This is the size of the mapped block
1089 */
1090 __u32 block_size;
1091
1092 __u32 pad;
1093 };
1094
1095 /* Returned in HL_MEM_OP_EXPORT_DMABUF_FD. Represents the
1096 * DMA-BUF object that was created to describe a memory
1097 * allocation on the device's memory space. The FD should be
1098 * passed to the importer driver
1099 */
1100 __s32 fd;
1101 };
1102};
1103
1104union hl_mem_args {
1105 struct hl_mem_in in;
1106 struct hl_mem_out out;
1107};
1108
1109#define HL_DEBUG_MAX_AUX_VALUES 10
1110
1111struct hl_debug_params_etr {
1112 /* Address in memory to allocate buffer */
1113 __u64 buffer_address;
1114
1115 /* Size of buffer to allocate */
1116 __u64 buffer_size;
1117
1118 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1119 __u32 sink_mode;
1120 __u32 pad;
1121};
1122
1123struct hl_debug_params_etf {
1124 /* Address in memory to allocate buffer */
1125 __u64 buffer_address;
1126
1127 /* Size of buffer to allocate */
1128 __u64 buffer_size;
1129
1130 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1131 __u32 sink_mode;
1132 __u32 pad;
1133};
1134
1135struct hl_debug_params_stm {
1136 /* Two bit masks for HW event and Stimulus Port */
1137 __u64 he_mask;
1138 __u64 sp_mask;
1139
1140 /* Trace source ID */
1141 __u32 id;
1142
1143 /* Frequency for the timestamp register */
1144 __u32 frequency;
1145};
1146
1147struct hl_debug_params_bmon {
1148 /* Two address ranges that the user can request to filter */
1149 __u64 start_addr0;
1150 __u64 addr_mask0;
1151
1152 __u64 start_addr1;
1153 __u64 addr_mask1;
1154
1155 /* Capture window configuration */
1156 __u32 bw_win;
1157 __u32 win_capture;
1158
1159 /* Trace source ID */
1160 __u32 id;
1161 __u32 pad;
1162};
1163
1164struct hl_debug_params_spmu {
1165 /* Event types selection */
1166 __u64 event_types[HL_DEBUG_MAX_AUX_VALUES];
1167
1168 /* Number of event types selection */
1169 __u32 event_types_num;
1170 __u32 pad;
1171};
1172
1173/* Opcode for ETR component */
1174#define HL_DEBUG_OP_ETR 0
1175/* Opcode for ETF component */
1176#define HL_DEBUG_OP_ETF 1
1177/* Opcode for STM component */
1178#define HL_DEBUG_OP_STM 2
1179/* Opcode for FUNNEL component */
1180#define HL_DEBUG_OP_FUNNEL 3
1181/* Opcode for BMON component */
1182#define HL_DEBUG_OP_BMON 4
1183/* Opcode for SPMU component */
1184#define HL_DEBUG_OP_SPMU 5
1185/* Opcode for timestamp (deprecated) */
1186#define HL_DEBUG_OP_TIMESTAMP 6
1187/* Opcode for setting the device into or out of debug mode. The enable
1188 * variable should be 1 for enabling debug mode and 0 for disabling it
1189 */
1190#define HL_DEBUG_OP_SET_MODE 7
1191
1192struct hl_debug_args {
1193 /*
1194 * Pointer to user input structure.
1195 * This field is relevant to specific opcodes.
1196 */
1197 __u64 input_ptr;
1198 /* Pointer to user output structure */
1199 __u64 output_ptr;
1200 /* Size of user input structure */
1201 __u32 input_size;
1202 /* Size of user output structure */
1203 __u32 output_size;
1204 /* HL_DEBUG_OP_* */
1205 __u32 op;
1206 /*
1207 * Register index in the component, taken from the debug_regs_index enum
1208 * in the various ASIC header files
1209 */
1210 __u32 reg_idx;
1211 /* Enable/disable */
1212 __u32 enable;
1213 /* Context ID - Currently not in use */
1214 __u32 ctx_id;
1215};
1216
1217/*
1218 * Various information operations such as:
1219 * - H/W IP information
1220 * - Current dram usage
1221 *
1222 * The user calls this IOCTL with an opcode that describes the required
1223 * information. The user should supply a pointer to a user-allocated memory
1224 * chunk, which will be filled by the driver with the requested information.
1225 *
1226 * The user supplies the maximum amount of size to copy into the user's memory,
1227 * in order to prevent data corruption in case of differences between the
1228 * definitions of structures in kernel and userspace, e.g. in case of old
1229 * userspace and new kernel driver
1230 */
1231#define HL_IOCTL_INFO \
1232 _IOWR('H', 0x01, struct hl_info_args)
1233
1234/*
1235 * Command Buffer
1236 * - Request a Command Buffer
1237 * - Destroy a Command Buffer
1238 *
1239 * The command buffers are memory blocks that reside in DMA-able address
1240 * space and are physically contiguous so they can be accessed by the device
1241 * directly. They are allocated using the coherent DMA API.
1242 *
1243 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
1244 * process needs to use that handle to mmap the buffer so it can access them.
1245 *
1246 * In some instances, the device must access the command buffer through the
1247 * device's MMU, and thus its memory should be mapped. In these cases, user can
1248 * indicate the driver that such a mapping is required.
1249 * The resulting device virtual address will be used internally by the driver,
1250 * and won't be returned to user.
1251 *
1252 */
1253#define HL_IOCTL_CB \
1254 _IOWR('H', 0x02, union hl_cb_args)
1255
1256/*
1257 * Command Submission
1258 *
1259 * To submit work to the device, the user need to call this IOCTL with a set
1260 * of JOBS. That set of JOBS constitutes a CS object.
1261 * Each JOB will be enqueued on a specific queue, according to the user's input.
1262 * There can be more then one JOB per queue.
1263 *
1264 * The CS IOCTL will receive two sets of JOBS. One set is for "restore" phase
1265 * and a second set is for "execution" phase.
1266 * The JOBS on the "restore" phase are enqueued only after context-switch
1267 * (or if its the first CS for this context). The user can also order the
1268 * driver to run the "restore" phase explicitly
1269 *
1270 * There are two types of queues - external and internal. External queues
1271 * are DMA queues which transfer data from/to the Host. All other queues are
1272 * internal. The driver will get completion notifications from the device only
1273 * on JOBS which are enqueued in the external queues.
1274 *
1275 * For jobs on external queues, the user needs to create command buffers
1276 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
1277 * internal queues, the user needs to prepare a "command buffer" with packets
1278 * on either the device SRAM/DRAM or the host, and give the device address of
1279 * that buffer to the CS ioctl.
1280 *
1281 * This IOCTL is asynchronous in regard to the actual execution of the CS. This
1282 * means it returns immediately after ALL the JOBS were enqueued on their
1283 * relevant queues. Therefore, the user mustn't assume the CS has been completed
1284 * or has even started to execute.
1285 *
1286 * Upon successful enqueue, the IOCTL returns a sequence number which the user
1287 * can use with the "Wait for CS" IOCTL to check whether the handle's CS
1288 * external JOBS have been completed. Note that if the CS has internal JOBS
1289 * which can execute AFTER the external JOBS have finished, the driver might
1290 * report that the CS has finished executing BEFORE the internal JOBS have
1291 * actually finished executing.
1292 *
1293 * Even though the sequence number increments per CS, the user can NOT
1294 * automatically assume that if CS with sequence number N finished, then CS
1295 * with sequence number N-1 also finished. The user can make this assumption if
1296 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
1297 * queues).
1298 */
1299#define HL_IOCTL_CS \
1300 _IOWR('H', 0x03, union hl_cs_args)
1301
1302/*
1303 * Wait for Command Submission
1304 *
1305 * The user can call this IOCTL with a handle it received from the CS IOCTL
1306 * to wait until the handle's CS has finished executing. The user will wait
1307 * inside the kernel until the CS has finished or until the user-requested
1308 * timeout has expired.
1309 *
1310 * If the timeout value is 0, the driver won't sleep at all. It will check
1311 * the status of the CS and return immediately
1312 *
1313 * The return value of the IOCTL is a standard Linux error code. The possible
1314 * values are:
1315 *
1316 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
1317 * that the user process received
1318 * ETIMEDOUT - The CS has caused a timeout on the device
1319 * EIO - The CS was aborted (usually because the device was reset)
1320 * ENODEV - The device wants to do hard-reset (so user need to close FD)
1321 *
1322 * The driver also returns a custom define in case the IOCTL call returned 0.
1323 * The define can be one of the following:
1324 *
1325 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
1326 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
1327 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
1328 * (ETIMEDOUT)
1329 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
1330 * device was reset (EIO)
1331 */
1332
1333#define HL_IOCTL_WAIT_CS \
1334 _IOWR('H', 0x04, union hl_wait_cs_args)
1335
1336/*
1337 * Memory
1338 * - Map host memory to device MMU
1339 * - Unmap host memory from device MMU
1340 *
1341 * This IOCTL allows the user to map host memory to the device MMU
1342 *
1343 * For host memory, the IOCTL doesn't allocate memory. The user is supposed
1344 * to allocate the memory in user-space (malloc/new). The driver pins the
1345 * physical pages (up to the allowed limit by the OS), assigns a virtual
1346 * address in the device VA space and initializes the device MMU.
1347 *
1348 * There is an option for the user to specify the requested virtual address.
1349 *
1350 */
1351#define HL_IOCTL_MEMORY \
1352 _IOWR('H', 0x05, union hl_mem_args)
1353
1354/*
1355 * Debug
1356 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
1357 *
1358 * This IOCTL allows the user to get debug traces from the chip.
1359 *
1360 * Before the user can send configuration requests of the various
1361 * debug/profile engines, it needs to set the device into debug mode.
1362 * This is because the debug/profile infrastructure is shared component in the
1363 * device and we can't allow multiple users to access it at the same time.
1364 *
1365 * Once a user set the device into debug mode, the driver won't allow other
1366 * users to "work" with the device, i.e. open a FD. If there are multiple users
1367 * opened on the device, the driver won't allow any user to debug the device.
1368 *
1369 * For each configuration request, the user needs to provide the register index
1370 * and essential data such as buffer address and size.
1371 *
1372 * Once the user has finished using the debug/profile engines, he should
1373 * set the device into non-debug mode, i.e. disable debug mode.
1374 *
1375 * The driver can decide to "kick out" the user if he abuses this interface.
1376 *
1377 */
1378#define HL_IOCTL_DEBUG \
1379 _IOWR('H', 0x06, struct hl_debug_args)
1380
1381#define HL_COMMAND_START 0x01
1382#define HL_COMMAND_END 0x07
1383
1384#endif /* HABANALABS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/ocxl.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* Copyright 2017 IBM Corp. */
3#ifndef _MISC_OCXL_H
4#define _MISC_OCXL_H
5
6#include <linux/types.h>
7#include <linux/ioctl.h>
8
9enum ocxl_event_type {
10 OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
11};
12
13#define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001 /* This is the last event pending */
14
15struct ocxl_kernel_event_header {
16 __u16 type;
17 __u16 flags;
18 __u32 reserved;
19};
20
21struct ocxl_kernel_event_xsl_fault_error {
22 __u64 addr;
23 __u64 dsisr;
24 __u64 count;
25 __u64 reserved;
26};
27
28struct ocxl_ioctl_attach {
29 __u64 amr;
30 __u64 reserved1;
31 __u64 reserved2;
32 __u64 reserved3;
33};
34
35struct ocxl_ioctl_metadata {
36 __u16 version; /* struct version, always backwards compatible */
37
38 /* Version 0 fields */
39 __u8 afu_version_major;
40 __u8 afu_version_minor;
41 __u32 pasid; /* PASID assigned to the current context */
42
43 __u64 pp_mmio_size; /* Per PASID MMIO size */
44 __u64 global_mmio_size;
45
46 /* End version 0 fields */
47
48 __u64 reserved[13]; /* Total of 16*u64 */
49};
50
51struct ocxl_ioctl_p9_wait {
52 __u16 thread_id; /* The thread ID required to wake this thread */
53 __u16 reserved1;
54 __u32 reserved2;
55 __u64 reserved3[3];
56};
57
58#define OCXL_IOCTL_FEATURES_FLAGS0_P9_WAIT 0x01
59struct ocxl_ioctl_features {
60 __u64 flags[4];
61};
62
63struct ocxl_ioctl_irq_fd {
64 __u64 irq_offset;
65 __s32 eventfd;
66 __u32 reserved;
67};
68
69/* ioctl numbers */
70#define OCXL_MAGIC 0xCA
71/* AFU devices */
72#define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
73#define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
74#define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
75#define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
76#define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
77#define OCXL_IOCTL_ENABLE_P9_WAIT _IOR(OCXL_MAGIC, 0x15, struct ocxl_ioctl_p9_wait)
78#define OCXL_IOCTL_GET_FEATURES _IOR(OCXL_MAGIC, 0x16, struct ocxl_ioctl_features)
79
80#endif /* _MISC_OCXL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/pvpanic.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __PVPANIC_H__
4#define __PVPANIC_H__
5
6#define PVPANIC_PANICKED (1 << 0)
7#define PVPANIC_CRASH_LOADED (1 << 1)
8
9#endif /* __PVPANIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/uacce/hisi_qm.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _HISI_QM_H
3#define _HISI_QM_H
4
5#include <linux/types.h>
6
7/**
8 * struct hisi_qp_ctx - User data for hisi qp.
9 * @id: qp_index return to user space
10 * @qc_type: Accelerator algorithm type
11 */
12struct hisi_qp_ctx {
13 __u16 id;
14 __u16 qc_type;
15};
16
17#define HISI_QM_API_VER_BASE "hisi_qm_v1"
18#define HISI_QM_API_VER2_BASE "hisi_qm_v2"
19#define HISI_QM_API_VER3_BASE "hisi_qm_v3"
20
21/* UACCE_CMD_QM_SET_QP_CTX: Set qp algorithm type */
22#define UACCE_CMD_QM_SET_QP_CTX _IOWR('H', 10, struct hisi_qp_ctx)
23
24#endif
\ No newline at end of file
lib/libc/include/any-linux-any/misc/uacce/uacce.h created+38
...@@ -0,0 +1,38 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef UUACCE_H
3#define UUACCE_H
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8/*
9 * UACCE_CMD_START_Q: Start queue
10 */
11#define UACCE_CMD_START_Q _IO('W', 0)
12
13/*
14 * UACCE_CMD_PUT_Q:
15 * User actively stop queue and free queue resource immediately
16 * Optimization method since close fd may delay
17 */
18#define UACCE_CMD_PUT_Q _IO('W', 1)
19
20/*
21 * UACCE Device flags:
22 * UACCE_DEV_SVA: Shared Virtual Addresses
23 * Support PASID
24 * Support device page faults (PCI PRI or SMMU Stall)
25 */
26#define UACCE_DEV_SVA BIT(0)
27
28/**
29 * enum uacce_qfrt: queue file region type
30 * @UACCE_QFRT_MMIO: device mmio region
31 * @UACCE_QFRT_DUS: device user share region
32 */
33enum uacce_qfrt {
34 UACCE_QFRT_MMIO = 0,
35 UACCE_QFRT_DUS = 1,
36};
37
38#endif
\ No newline at end of file
lib/libc/include/any-linux-any/misc/xilinx_sdfec.h created+448
...@@ -0,0 +1,448 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Xilinx SD-FEC
4 *
5 * Copyright (C) 2019 Xilinx, Inc.
6 *
7 * Description:
8 * This driver is developed for SDFEC16 IP. It provides a char device
9 * in sysfs and supports file operations like open(), close() and ioctl().
10 */
11#ifndef __XILINX_SDFEC_H__
12#define __XILINX_SDFEC_H__
13
14#include <linux/types.h>
15
16/* Shared LDPC Tables */
17#define XSDFEC_LDPC_SC_TABLE_ADDR_BASE (0x10000)
18#define XSDFEC_LDPC_SC_TABLE_ADDR_HIGH (0x10400)
19#define XSDFEC_LDPC_LA_TABLE_ADDR_BASE (0x18000)
20#define XSDFEC_LDPC_LA_TABLE_ADDR_HIGH (0x19000)
21#define XSDFEC_LDPC_QC_TABLE_ADDR_BASE (0x20000)
22#define XSDFEC_LDPC_QC_TABLE_ADDR_HIGH (0x28000)
23
24/* LDPC tables depth */
25#define XSDFEC_SC_TABLE_DEPTH \
26 (XSDFEC_LDPC_SC_TABLE_ADDR_HIGH - XSDFEC_LDPC_SC_TABLE_ADDR_BASE)
27#define XSDFEC_LA_TABLE_DEPTH \
28 (XSDFEC_LDPC_LA_TABLE_ADDR_HIGH - XSDFEC_LDPC_LA_TABLE_ADDR_BASE)
29#define XSDFEC_QC_TABLE_DEPTH \
30 (XSDFEC_LDPC_QC_TABLE_ADDR_HIGH - XSDFEC_LDPC_QC_TABLE_ADDR_BASE)
31
32/**
33 * enum xsdfec_code - Code Type.
34 * @XSDFEC_TURBO_CODE: Driver is configured for Turbo mode.
35 * @XSDFEC_LDPC_CODE: Driver is configured for LDPC mode.
36 *
37 * This enum is used to indicate the mode of the driver. The mode is determined
38 * by checking which codes are set in the driver. Note that the mode cannot be
39 * changed by the driver.
40 */
41enum xsdfec_code {
42 XSDFEC_TURBO_CODE = 0,
43 XSDFEC_LDPC_CODE,
44};
45
46/**
47 * enum xsdfec_order - Order
48 * @XSDFEC_MAINTAIN_ORDER: Maintain order execution of blocks.
49 * @XSDFEC_OUT_OF_ORDER: Out-of-order execution of blocks.
50 *
51 * This enum is used to indicate whether the order of blocks can change from
52 * input to output.
53 */
54enum xsdfec_order {
55 XSDFEC_MAINTAIN_ORDER = 0,
56 XSDFEC_OUT_OF_ORDER,
57};
58
59/**
60 * enum xsdfec_turbo_alg - Turbo Algorithm Type.
61 * @XSDFEC_MAX_SCALE: Max Log-Map algorithm with extrinsic scaling. When
62 * scaling is set to this is equivalent to the Max Log-Map
63 * algorithm.
64 * @XSDFEC_MAX_STAR: Log-Map algorithm.
65 * @XSDFEC_TURBO_ALG_MAX: Used to indicate out of bound Turbo algorithms.
66 *
67 * This enum specifies which Turbo Decode algorithm is in use.
68 */
69enum xsdfec_turbo_alg {
70 XSDFEC_MAX_SCALE = 0,
71 XSDFEC_MAX_STAR,
72 XSDFEC_TURBO_ALG_MAX,
73};
74
75/**
76 * enum xsdfec_state - State.
77 * @XSDFEC_INIT: Driver is initialized.
78 * @XSDFEC_STARTED: Driver is started.
79 * @XSDFEC_STOPPED: Driver is stopped.
80 * @XSDFEC_NEEDS_RESET: Driver needs to be reset.
81 * @XSDFEC_PL_RECONFIGURE: Programmable Logic needs to be recofigured.
82 *
83 * This enum is used to indicate the state of the driver.
84 */
85enum xsdfec_state {
86 XSDFEC_INIT = 0,
87 XSDFEC_STARTED,
88 XSDFEC_STOPPED,
89 XSDFEC_NEEDS_RESET,
90 XSDFEC_PL_RECONFIGURE,
91};
92
93/**
94 * enum xsdfec_axis_width - AXIS_WIDTH.DIN Setting for 128-bit width.
95 * @XSDFEC_1x128b: DIN data input stream consists of a 128-bit lane
96 * @XSDFEC_2x128b: DIN data input stream consists of two 128-bit lanes
97 * @XSDFEC_4x128b: DIN data input stream consists of four 128-bit lanes
98 *
99 * This enum is used to indicate the AXIS_WIDTH.DIN setting for 128-bit width.
100 * The number of lanes of the DIN data input stream depends upon the
101 * AXIS_WIDTH.DIN parameter.
102 */
103enum xsdfec_axis_width {
104 XSDFEC_1x128b = 1,
105 XSDFEC_2x128b = 2,
106 XSDFEC_4x128b = 4,
107};
108
109/**
110 * enum xsdfec_axis_word_include - Words Configuration.
111 * @XSDFEC_FIXED_VALUE: Fixed, the DIN_WORDS AXI4-Stream interface is removed
112 * from the IP instance and is driven with the specified
113 * number of words.
114 * @XSDFEC_IN_BLOCK: In Block, configures the IP instance to expect a single
115 * DIN_WORDS value per input code block. The DIN_WORDS
116 * interface is present.
117 * @XSDFEC_PER_AXI_TRANSACTION: Per Transaction, configures the IP instance to
118 * expect one DIN_WORDS value per input transaction on the DIN interface. The
119 * DIN_WORDS interface is present.
120 * @XSDFEC_AXIS_WORDS_INCLUDE_MAX: Used to indicate out of bound Words
121 * Configurations.
122 *
123 * This enum is used to specify the DIN_WORDS configuration.
124 */
125enum xsdfec_axis_word_include {
126 XSDFEC_FIXED_VALUE = 0,
127 XSDFEC_IN_BLOCK,
128 XSDFEC_PER_AXI_TRANSACTION,
129 XSDFEC_AXIS_WORDS_INCLUDE_MAX,
130};
131
132/**
133 * struct xsdfec_turbo - User data for Turbo codes.
134 * @alg: Specifies which Turbo decode algorithm to use
135 * @scale: Specifies the extrinsic scaling to apply when the Max Scale algorithm
136 * has been selected
137 *
138 * Turbo code structure to communicate parameters to XSDFEC driver.
139 */
140struct xsdfec_turbo {
141 __u32 alg;
142 __u8 scale;
143};
144
145/**
146 * struct xsdfec_ldpc_params - User data for LDPC codes.
147 * @n: Number of code word bits
148 * @k: Number of information bits
149 * @psize: Size of sub-matrix
150 * @nlayers: Number of layers in code
151 * @nqc: Quasi Cyclic Number
152 * @nmqc: Number of M-sized QC operations in parity check matrix
153 * @nm: Number of M-size vectors in N
154 * @norm_type: Normalization required or not
155 * @no_packing: Determines if multiple QC ops should be performed
156 * @special_qc: Sub-Matrix property for Circulant weight > 0
157 * @no_final_parity: Decide if final parity check needs to be performed
158 * @max_schedule: Experimental code word scheduling limit
159 * @sc_off: SC offset
160 * @la_off: LA offset
161 * @qc_off: QC offset
162 * @sc_table: Pointer to SC Table which must be page aligned
163 * @la_table: Pointer to LA Table which must be page aligned
164 * @qc_table: Pointer to QC Table which must be page aligned
165 * @code_id: LDPC Code
166 *
167 * This structure describes the LDPC code that is passed to the driver by the
168 * application.
169 */
170struct xsdfec_ldpc_params {
171 __u32 n;
172 __u32 k;
173 __u32 psize;
174 __u32 nlayers;
175 __u32 nqc;
176 __u32 nmqc;
177 __u32 nm;
178 __u32 norm_type;
179 __u32 no_packing;
180 __u32 special_qc;
181 __u32 no_final_parity;
182 __u32 max_schedule;
183 __u32 sc_off;
184 __u32 la_off;
185 __u32 qc_off;
186 __u32 *sc_table;
187 __u32 *la_table;
188 __u32 *qc_table;
189 __u16 code_id;
190};
191
192/**
193 * struct xsdfec_status - Status of SD-FEC core.
194 * @state: State of the SD-FEC core
195 * @activity: Describes if the SD-FEC instance is Active
196 */
197struct xsdfec_status {
198 __u32 state;
199 __s8 activity;
200};
201
202/**
203 * struct xsdfec_irq - Enabling or Disabling Interrupts.
204 * @enable_isr: If true enables the ISR
205 * @enable_ecc_isr: If true enables the ECC ISR
206 */
207struct xsdfec_irq {
208 __s8 enable_isr;
209 __s8 enable_ecc_isr;
210};
211
212/**
213 * struct xsdfec_config - Configuration of SD-FEC core.
214 * @code: The codes being used by the SD-FEC instance
215 * @order: Order of Operation
216 * @din_width: Width of the DIN AXI4-Stream
217 * @din_word_include: How DIN_WORDS are inputted
218 * @dout_width: Width of the DOUT AXI4-Stream
219 * @dout_word_include: HOW DOUT_WORDS are outputted
220 * @irq: Enabling or disabling interrupts
221 * @bypass: Is the core being bypassed
222 * @code_wr_protect: Is write protection of LDPC codes enabled
223 */
224struct xsdfec_config {
225 __u32 code;
226 __u32 order;
227 __u32 din_width;
228 __u32 din_word_include;
229 __u32 dout_width;
230 __u32 dout_word_include;
231 struct xsdfec_irq irq;
232 __s8 bypass;
233 __s8 code_wr_protect;
234};
235
236/**
237 * struct xsdfec_stats - Stats retrived by ioctl XSDFEC_GET_STATS. Used
238 * to buffer atomic_t variables from struct
239 * xsdfec_dev. Counts are accumulated until
240 * the user clears them.
241 * @isr_err_count: Count of ISR errors
242 * @cecc_count: Count of Correctable ECC errors (SBE)
243 * @uecc_count: Count of Uncorrectable ECC errors (MBE)
244 */
245struct xsdfec_stats {
246 __u32 isr_err_count;
247 __u32 cecc_count;
248 __u32 uecc_count;
249};
250
251/**
252 * struct xsdfec_ldpc_param_table_sizes - Used to store sizes of SD-FEC table
253 * entries for an individual LPDC code
254 * parameter.
255 * @sc_size: Size of SC table used
256 * @la_size: Size of LA table used
257 * @qc_size: Size of QC table used
258 */
259struct xsdfec_ldpc_param_table_sizes {
260 __u32 sc_size;
261 __u32 la_size;
262 __u32 qc_size;
263};
264
265/*
266 * XSDFEC IOCTL List
267 */
268#define XSDFEC_MAGIC 'f'
269/**
270 * DOC: XSDFEC_START_DEV
271 *
272 * @Description
273 *
274 * ioctl to start SD-FEC core
275 *
276 * This fails if the XSDFEC_SET_ORDER ioctl has not been previously called
277 */
278#define XSDFEC_START_DEV _IO(XSDFEC_MAGIC, 0)
279/**
280 * DOC: XSDFEC_STOP_DEV
281 *
282 * @Description
283 *
284 * ioctl to stop the SD-FEC core
285 */
286#define XSDFEC_STOP_DEV _IO(XSDFEC_MAGIC, 1)
287/**
288 * DOC: XSDFEC_GET_STATUS
289 *
290 * @Description
291 *
292 * ioctl that returns status of SD-FEC core
293 */
294#define XSDFEC_GET_STATUS _IOR(XSDFEC_MAGIC, 2, struct xsdfec_status)
295/**
296 * DOC: XSDFEC_SET_IRQ
297 * @Parameters
298 *
299 * @struct xsdfec_irq *
300 * Pointer to the &struct xsdfec_irq that contains the interrupt settings
301 * for the SD-FEC core
302 *
303 * @Description
304 *
305 * ioctl to enable or disable irq
306 */
307#define XSDFEC_SET_IRQ _IOW(XSDFEC_MAGIC, 3, struct xsdfec_irq)
308/**
309 * DOC: XSDFEC_SET_TURBO
310 * @Parameters
311 *
312 * @struct xsdfec_turbo *
313 * Pointer to the &struct xsdfec_turbo that contains the Turbo decode
314 * settings for the SD-FEC core
315 *
316 * @Description
317 *
318 * ioctl that sets the SD-FEC Turbo parameter values
319 *
320 * This can only be used when the driver is in the XSDFEC_STOPPED state
321 */
322#define XSDFEC_SET_TURBO _IOW(XSDFEC_MAGIC, 4, struct xsdfec_turbo)
323/**
324 * DOC: XSDFEC_ADD_LDPC_CODE_PARAMS
325 * @Parameters
326 *
327 * @struct xsdfec_ldpc_params *
328 * Pointer to the &struct xsdfec_ldpc_params that contains the LDPC code
329 * parameters to be added to the SD-FEC Block
330 *
331 * @Description
332 * ioctl to add an LDPC code to the SD-FEC LDPC codes
333 *
334 * This can only be used when:
335 *
336 * - Driver is in the XSDFEC_STOPPED state
337 *
338 * - SD-FEC core is configured as LPDC
339 *
340 * - SD-FEC Code Write Protection is disabled
341 */
342#define XSDFEC_ADD_LDPC_CODE_PARAMS \
343 _IOW(XSDFEC_MAGIC, 5, struct xsdfec_ldpc_params)
344/**
345 * DOC: XSDFEC_GET_CONFIG
346 * @Parameters
347 *
348 * @struct xsdfec_config *
349 * Pointer to the &struct xsdfec_config that contains the current
350 * configuration settings of the SD-FEC Block
351 *
352 * @Description
353 *
354 * ioctl that returns SD-FEC core configuration
355 */
356#define XSDFEC_GET_CONFIG _IOR(XSDFEC_MAGIC, 6, struct xsdfec_config)
357/**
358 * DOC: XSDFEC_GET_TURBO
359 * @Parameters
360 *
361 * @struct xsdfec_turbo *
362 * Pointer to the &struct xsdfec_turbo that contains the current Turbo
363 * decode settings of the SD-FEC Block
364 *
365 * @Description
366 *
367 * ioctl that returns SD-FEC turbo param values
368 */
369#define XSDFEC_GET_TURBO _IOR(XSDFEC_MAGIC, 7, struct xsdfec_turbo)
370/**
371 * DOC: XSDFEC_SET_ORDER
372 * @Parameters
373 *
374 * @struct unsigned long *
375 * Pointer to the unsigned long that contains a value from the
376 * @enum xsdfec_order
377 *
378 * @Description
379 *
380 * ioctl that sets order, if order of blocks can change from input to output
381 *
382 * This can only be used when the driver is in the XSDFEC_STOPPED state
383 */
384#define XSDFEC_SET_ORDER _IOW(XSDFEC_MAGIC, 8, unsigned long)
385/**
386 * DOC: XSDFEC_SET_BYPASS
387 * @Parameters
388 *
389 * @struct bool *
390 * Pointer to bool that sets the bypass value, where false results in
391 * normal operation and false results in the SD-FEC performing the
392 * configured operations (same number of cycles) but output data matches
393 * the input data
394 *
395 * @Description
396 *
397 * ioctl that sets bypass.
398 *
399 * This can only be used when the driver is in the XSDFEC_STOPPED state
400 */
401#define XSDFEC_SET_BYPASS _IOW(XSDFEC_MAGIC, 9, bool)
402/**
403 * DOC: XSDFEC_IS_ACTIVE
404 * @Parameters
405 *
406 * @struct bool *
407 * Pointer to bool that returns true if the SD-FEC is processing data
408 *
409 * @Description
410 *
411 * ioctl that determines if SD-FEC is processing data
412 */
413#define XSDFEC_IS_ACTIVE _IOR(XSDFEC_MAGIC, 10, bool)
414/**
415 * DOC: XSDFEC_CLEAR_STATS
416 *
417 * @Description
418 *
419 * ioctl that clears error stats collected during interrupts
420 */
421#define XSDFEC_CLEAR_STATS _IO(XSDFEC_MAGIC, 11)
422/**
423 * DOC: XSDFEC_GET_STATS
424 * @Parameters
425 *
426 * @struct xsdfec_stats *
427 * Pointer to the &struct xsdfec_stats that will contain the updated stats
428 * values
429 *
430 * @Description
431 *
432 * ioctl that returns SD-FEC core stats
433 *
434 * This can only be used when the driver is in the XSDFEC_STOPPED state
435 */
436#define XSDFEC_GET_STATS _IOR(XSDFEC_MAGIC, 12, struct xsdfec_stats)
437/**
438 * DOC: XSDFEC_SET_DEFAULT_CONFIG
439 *
440 * @Description
441 *
442 * ioctl that returns SD-FEC core to default config, use after a reset
443 *
444 * This can only be used when the driver is in the XSDFEC_STOPPED state
445 */
446#define XSDFEC_SET_DEFAULT_CONFIG _IO(XSDFEC_MAGIC, 13)
447
448#endif /* __XILINX_SDFEC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/inftl-user.h created+90
...@@ -0,0 +1,90 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Parts of INFTL headers shared with userspace
4 *
5 */
6
7#ifndef __MTD_INFTL_USER_H__
8#define __MTD_INFTL_USER_H__
9
10#include <linux/types.h>
11
12#define OSAK_VERSION 0x5120
13#define PERCENTUSED 98
14
15#define SECTORSIZE 512
16
17/* Block Control Information */
18
19struct inftl_bci {
20 __u8 ECCsig[6];
21 __u8 Status;
22 __u8 Status1;
23} __attribute__((packed));
24
25struct inftl_unithead1 {
26 __u16 virtualUnitNo;
27 __u16 prevUnitNo;
28 __u8 ANAC;
29 __u8 NACs;
30 __u8 parityPerField;
31 __u8 discarded;
32} __attribute__((packed));
33
34struct inftl_unithead2 {
35 __u8 parityPerField;
36 __u8 ANAC;
37 __u16 prevUnitNo;
38 __u16 virtualUnitNo;
39 __u8 NACs;
40 __u8 discarded;
41} __attribute__((packed));
42
43struct inftl_unittail {
44 __u8 Reserved[4];
45 __u16 EraseMark;
46 __u16 EraseMark1;
47} __attribute__((packed));
48
49union inftl_uci {
50 struct inftl_unithead1 a;
51 struct inftl_unithead2 b;
52 struct inftl_unittail c;
53};
54
55struct inftl_oob {
56 struct inftl_bci b;
57 union inftl_uci u;
58};
59
60
61/* INFTL Media Header */
62
63struct INFTLPartition {
64 __u32 virtualUnits;
65 __u32 firstUnit;
66 __u32 lastUnit;
67 __u32 flags;
68 __u32 spareUnits;
69 __u32 Reserved0;
70 __u32 Reserved1;
71} __attribute__((packed));
72
73struct INFTLMediaHeader {
74 char bootRecordID[8];
75 __u32 NoOfBootImageBlocks;
76 __u32 NoOfBinaryPartitions;
77 __u32 NoOfBDTLPartitions;
78 __u32 BlockMultiplierBits;
79 __u32 FormatFlags;
80 __u32 OsakVersion;
81 __u32 PercentUsed;
82 struct INFTLPartition Partitions[4];
83} __attribute__((packed));
84
85/* Partition flag types */
86#define INFTL_BINARY 0x20000000
87#define INFTL_BDTL 0x40000000
88#define INFTL_LAST 0x80000000
89
90#endif /* __MTD_INFTL_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/mtd-abi.h created+288
...@@ -0,0 +1,288 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_ABI_H__
22#define __MTD_ABI_H__
23
24#include <linux/types.h>
25
26struct erase_info_user {
27 __u32 start;
28 __u32 length;
29};
30
31struct erase_info_user64 {
32 __u64 start;
33 __u64 length;
34};
35
36struct mtd_oob_buf {
37 __u32 start;
38 __u32 length;
39 unsigned char *ptr;
40};
41
42struct mtd_oob_buf64 {
43 __u64 start;
44 __u32 pad;
45 __u32 length;
46 __u64 usr_ptr;
47};
48
49/**
50 * MTD operation modes
51 *
52 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
53 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
54 * which are defined by the internal ecclayout
55 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
56 * this mode implies %MTD_OPS_PLACE_OOB
57 *
58 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
59 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
60 * %MTD_FILE_MODE_RAW.
61 */
62enum {
63 MTD_OPS_PLACE_OOB = 0,
64 MTD_OPS_AUTO_OOB = 1,
65 MTD_OPS_RAW = 2,
66};
67
68/**
69 * struct mtd_write_req - data structure for requesting a write operation
70 *
71 * @start: start address
72 * @len: length of data buffer
73 * @ooblen: length of OOB buffer
74 * @usr_data: user-provided data buffer
75 * @usr_oob: user-provided OOB buffer
76 * @mode: MTD mode (see "MTD operation modes")
77 * @padding: reserved, must be set to 0
78 *
79 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
80 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
81 * write data-only, set @usr_oob == NULL. However, setting both @usr_data and
82 * @usr_oob to NULL is not allowed.
83 */
84struct mtd_write_req {
85 __u64 start;
86 __u64 len;
87 __u64 ooblen;
88 __u64 usr_data;
89 __u64 usr_oob;
90 __u8 mode;
91 __u8 padding[7];
92};
93
94#define MTD_ABSENT 0
95#define MTD_RAM 1
96#define MTD_ROM 2
97#define MTD_NORFLASH 3
98#define MTD_NANDFLASH 4 /* SLC NAND */
99#define MTD_DATAFLASH 6
100#define MTD_UBIVOLUME 7
101#define MTD_MLCNANDFLASH 8 /* MLC NAND (including TLC) */
102
103#define MTD_WRITEABLE 0x400 /* Device is writeable */
104#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
105#define MTD_NO_ERASE 0x1000 /* No erase necessary */
106#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
107#define MTD_SLC_ON_MLC_EMULATION 0x4000 /* Emulate SLC behavior on MLC NANDs */
108
109/* Some common devices / combinations of capabilities */
110#define MTD_CAP_ROM 0
111#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
112#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
113#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
114#define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
115
116/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
117#define MTD_NANDECC_OFF 0 /* Switch off ECC (Not recommended) */
118#define MTD_NANDECC_PLACE 1 /* Use the given placement in the structure (YAFFS1 legacy mode) */
119#define MTD_NANDECC_AUTOPLACE 2 /* Use the default placement scheme */
120#define MTD_NANDECC_PLACEONLY 3 /* Use the given placement in the structure (Do not store ecc result on read) */
121#define MTD_NANDECC_AUTOPL_USR 4 /* Use the given autoplacement scheme rather than using the default */
122
123/* OTP mode selection */
124#define MTD_OTP_OFF 0
125#define MTD_OTP_FACTORY 1
126#define MTD_OTP_USER 2
127
128struct mtd_info_user {
129 __u8 type;
130 __u32 flags;
131 __u32 size; /* Total size of the MTD */
132 __u32 erasesize;
133 __u32 writesize;
134 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
135 __u64 padding; /* Old obsolete field; do not use */
136};
137
138struct region_info_user {
139 __u32 offset; /* At which this region starts,
140 * from the beginning of the MTD */
141 __u32 erasesize; /* For this region */
142 __u32 numblocks; /* Number of blocks in this region */
143 __u32 regionindex;
144};
145
146struct otp_info {
147 __u32 start;
148 __u32 length;
149 __u32 locked;
150};
151
152/*
153 * Note, the following ioctl existed in the past and was removed:
154 * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
155 * Try to avoid adding a new ioctl with the same ioctl number.
156 */
157
158/* Get basic MTD characteristics info (better to use sysfs) */
159#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
160/* Erase segment of MTD */
161#define MEMERASE _IOW('M', 2, struct erase_info_user)
162/* Write out-of-band data from MTD */
163#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
164/* Read out-of-band data from MTD */
165#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
166/* Lock a chip (for MTD that supports it) */
167#define MEMLOCK _IOW('M', 5, struct erase_info_user)
168/* Unlock a chip (for MTD that supports it) */
169#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
170/* Get the number of different erase regions */
171#define MEMGETREGIONCOUNT _IOR('M', 7, int)
172/* Get information about the erase region for a specific index */
173#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
174/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
175#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
176/* Check if an eraseblock is bad */
177#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
178/* Mark an eraseblock as bad */
179#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
180/* Set OTP (One-Time Programmable) mode (factory vs. user) */
181#define OTPSELECT _IOR('M', 13, int)
182/* Get number of OTP (One-Time Programmable) regions */
183#define OTPGETREGIONCOUNT _IOW('M', 14, int)
184/* Get all OTP (One-Time Programmable) info about MTD */
185#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
186/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
187#define OTPLOCK _IOR('M', 16, struct otp_info)
188/* Get ECC layout (deprecated) */
189#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
190/* Get statistics about corrected/uncorrected errors */
191#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
192/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */
193#define MTDFILEMODE _IO('M', 19)
194/* Erase segment of MTD (supports 64-bit address) */
195#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
196/* Write data to OOB (64-bit version) */
197#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
198/* Read data from OOB (64-bit version) */
199#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
200/* Check if chip is locked (for MTD that supports it) */
201#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
202/*
203 * Most generic write interface; can write in-band and/or out-of-band in various
204 * modes (see "struct mtd_write_req"). This ioctl is not supported for flashes
205 * without OOB, e.g., NOR flash.
206 */
207#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
208/* Erase a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
209#define OTPERASE _IOW('M', 25, struct otp_info)
210
211/*
212 * Obsolete legacy interface. Keep it in order not to break userspace
213 * interfaces
214 */
215struct nand_oobinfo {
216 __u32 useecc;
217 __u32 eccbytes;
218 __u32 oobfree[8][2];
219 __u32 eccpos[32];
220};
221
222struct nand_oobfree {
223 __u32 offset;
224 __u32 length;
225};
226
227#define MTD_MAX_OOBFREE_ENTRIES 8
228#define MTD_MAX_ECCPOS_ENTRIES 64
229/*
230 * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl
231 * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a
232 * complete set of ECC information. The ioctl truncates the larger internal
233 * structure to retain binary compatibility with the static declaration of the
234 * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of
235 * the user struct, not the MAX size of the internal OOB layout representation.
236 */
237struct nand_ecclayout_user {
238 __u32 eccbytes;
239 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
240 __u32 oobavail;
241 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
242};
243
244/**
245 * struct mtd_ecc_stats - error correction stats
246 *
247 * @corrected: number of corrected bits
248 * @failed: number of uncorrectable errors
249 * @badblocks: number of bad blocks in this partition
250 * @bbtblocks: number of blocks reserved for bad block tables
251 */
252struct mtd_ecc_stats {
253 __u32 corrected;
254 __u32 failed;
255 __u32 badblocks;
256 __u32 bbtblocks;
257};
258
259/*
260 * MTD file modes - for read/write access to MTD
261 *
262 * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled
263 * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode
264 * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode
265 * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled
266 *
267 * These modes can be set via ioctl(MTDFILEMODE). The mode will be retained
268 * separately for each open file descriptor.
269 *
270 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
271 * raw access to the flash, without error correction or autoplacement schemes.
272 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
273 * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
274 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
275 */
276enum mtd_file_modes {
277 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
278 MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
279 MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
280 MTD_FILE_MODE_RAW,
281};
282
283static __inline__ int mtd_type_is_nand_user(const struct mtd_info_user *mtd)
284{
285 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
286}
287
288#endif /* __MTD_ABI_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/mtd-user.h created+33
...@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_USER_H__
22#define __MTD_USER_H__
23
24/* This file is blessed for inclusion by userspace */
25#include <mtd/mtd-abi.h>
26
27typedef struct mtd_info_user mtd_info_t;
28typedef struct erase_info_user erase_info_t;
29typedef struct region_info_user region_info_t;
30typedef struct nand_oobinfo nand_oobinfo_t;
31typedef struct nand_ecclayout_user nand_ecclayout_t;
32
33#endif /* __MTD_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/nftl-user.h created+91
...@@ -0,0 +1,91 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_NFTL_USER_H__
22#define __MTD_NFTL_USER_H__
23
24#include <linux/types.h>
25
26/* Block Control Information */
27
28struct nftl_bci {
29 unsigned char ECCSig[6];
30 __u8 Status;
31 __u8 Status1;
32}__attribute__((packed));
33
34/* Unit Control Information */
35
36struct nftl_uci0 {
37 __u16 VirtUnitNum;
38 __u16 ReplUnitNum;
39 __u16 SpareVirtUnitNum;
40 __u16 SpareReplUnitNum;
41} __attribute__((packed));
42
43struct nftl_uci1 {
44 __u32 WearInfo;
45 __u16 EraseMark;
46 __u16 EraseMark1;
47} __attribute__((packed));
48
49struct nftl_uci2 {
50 __u16 FoldMark;
51 __u16 FoldMark1;
52 __u32 unused;
53} __attribute__((packed));
54
55union nftl_uci {
56 struct nftl_uci0 a;
57 struct nftl_uci1 b;
58 struct nftl_uci2 c;
59};
60
61struct nftl_oob {
62 struct nftl_bci b;
63 union nftl_uci u;
64};
65
66/* NFTL Media Header */
67
68struct NFTLMediaHeader {
69 char DataOrgID[6];
70 __u16 NumEraseUnits;
71 __u16 FirstPhysicalEUN;
72 __u32 FormattedSize;
73 unsigned char UnitSizeFactor;
74} __attribute__((packed));
75
76#define MAX_ERASE_ZONES (8192 - 512)
77
78#define ERASE_MARK 0x3c69
79#define SECTOR_FREE 0xff
80#define SECTOR_USED 0x55
81#define SECTOR_IGNORE 0x11
82#define SECTOR_DELETED 0x00
83
84#define FOLD_MARK_IN_PROGRESS 0x5555
85
86#define ZONE_GOOD 0xff
87#define ZONE_BAD_ORIGINAL 0
88#define ZONE_BAD_MARKED 7
89
90
91#endif /* __MTD_NFTL_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/ubi-user.h created+465
...@@ -0,0 +1,465 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © International Business Machines Corp., 2006
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Artem Bityutskiy (Битюцкий Артём)
20 */
21
22#ifndef __UBI_USER_H__
23#define __UBI_USER_H__
24
25#include <linux/types.h>
26
27/*
28 * UBI device creation (the same as MTD device attachment)
29 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 *
31 * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI
32 * control device. The caller has to properly fill and pass
33 * &struct ubi_attach_req object - UBI will attach the MTD device specified in
34 * the request and return the newly created UBI device number as the ioctl
35 * return value.
36 *
37 * UBI device deletion (the same as MTD device detachment)
38 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 *
40 * An UBI device maybe deleted with %UBI_IOCDET ioctl command of the UBI
41 * control device.
42 *
43 * UBI volume creation
44 * ~~~~~~~~~~~~~~~~~~~
45 *
46 * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character
47 * device. A &struct ubi_mkvol_req object has to be properly filled and a
48 * pointer to it has to be passed to the ioctl.
49 *
50 * UBI volume deletion
51 * ~~~~~~~~~~~~~~~~~~~
52 *
53 * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character
54 * device should be used. A pointer to the 32-bit volume ID hast to be passed
55 * to the ioctl.
56 *
57 * UBI volume re-size
58 * ~~~~~~~~~~~~~~~~~~
59 *
60 * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character
61 * device should be used. A &struct ubi_rsvol_req object has to be properly
62 * filled and a pointer to it has to be passed to the ioctl.
63 *
64 * UBI volumes re-name
65 * ~~~~~~~~~~~~~~~~~~~
66 *
67 * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command
68 * of the UBI character device should be used. A &struct ubi_rnvol_req object
69 * has to be properly filled and a pointer to it has to be passed to the ioctl.
70 *
71 * UBI volume update
72 * ~~~~~~~~~~~~~~~~~
73 *
74 * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the
75 * corresponding UBI volume character device. A pointer to a 64-bit update
76 * size should be passed to the ioctl. After this, UBI expects user to write
77 * this number of bytes to the volume character device. The update is finished
78 * when the claimed number of bytes is passed. So, the volume update sequence
79 * is something like:
80 *
81 * fd = open("/dev/my_volume");
82 * ioctl(fd, UBI_IOCVOLUP, &image_size);
83 * write(fd, buf, image_size);
84 * close(fd);
85 *
86 * Logical eraseblock erase
87 * ~~~~~~~~~~~~~~~~~~~~~~~~
88 *
89 * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the
90 * corresponding UBI volume character device should be used. This command
91 * unmaps the requested logical eraseblock, makes sure the corresponding
92 * physical eraseblock is successfully erased, and returns.
93 *
94 * Atomic logical eraseblock change
95 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96 *
97 * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH
98 * ioctl command of the corresponding UBI volume character device. A pointer to
99 * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the
100 * user is expected to write the requested amount of bytes (similarly to what
101 * should be done in case of the "volume update" ioctl).
102 *
103 * Logical eraseblock map
104 * ~~~~~~~~~~~~~~~~~~~~~
105 *
106 * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP
107 * ioctl command should be used. A pointer to a &struct ubi_map_req object is
108 * expected to be passed. The ioctl maps the requested logical eraseblock to
109 * a physical eraseblock and returns. Only non-mapped logical eraseblocks can
110 * be mapped. If the logical eraseblock specified in the request is already
111 * mapped to a physical eraseblock, the ioctl fails and returns error.
112 *
113 * Logical eraseblock unmap
114 * ~~~~~~~~~~~~~~~~~~~~~~~~
115 *
116 * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP
117 * ioctl command should be used. The ioctl unmaps the logical eraseblocks,
118 * schedules corresponding physical eraseblock for erasure, and returns. Unlike
119 * the "LEB erase" command, it does not wait for the physical eraseblock being
120 * erased. Note, the side effect of this is that if an unclean reboot happens
121 * after the unmap ioctl returns, you may find the LEB mapped again to the same
122 * physical eraseblock after the UBI is run again.
123 *
124 * Check if logical eraseblock is mapped
125 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126 *
127 * To check if a logical eraseblock is mapped to a physical eraseblock, the
128 * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
129 * not mapped, and %1 if it is mapped.
130 *
131 * Set an UBI volume property
132 * ~~~~~~~~~~~~~~~~~~~~~~~~~
133 *
134 * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
135 * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
136 * passed. The object describes which property should be set, and to which value
137 * it should be set.
138 *
139 * Block devices on UBI volumes
140 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141 *
142 * To create a R/O block device on top of an UBI volume the %UBI_IOCVOLCRBLK
143 * should be used. A pointer to a &struct ubi_blkcreate_req object is expected
144 * to be passed, which is not used and reserved for future usage.
145 *
146 * Conversely, to remove a block device the %UBI_IOCVOLRMBLK should be used,
147 * which takes no arguments.
148 */
149
150/*
151 * When a new UBI volume or UBI device is created, users may either specify the
152 * volume/device number they want to create or to let UBI automatically assign
153 * the number using these constants.
154 */
155#define UBI_VOL_NUM_AUTO (-1)
156#define UBI_DEV_NUM_AUTO (-1)
157
158/* Maximum volume name length */
159#define UBI_MAX_VOLUME_NAME 127
160
161/* ioctl commands of UBI character devices */
162
163#define UBI_IOC_MAGIC 'o'
164
165/* Create an UBI volume */
166#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
167/* Remove an UBI volume */
168#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
169/* Re-size an UBI volume */
170#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
171/* Re-name volumes */
172#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
173
174/* Read the specified PEB and scrub it if there are bitflips */
175#define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
176/* Force scrubbing on the specified PEB */
177#define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
178
179/* ioctl commands of the UBI control character device */
180
181#define UBI_CTRL_IOC_MAGIC 'o'
182
183/* Attach an MTD device */
184#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
185/* Detach an MTD device */
186#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
187
188/* ioctl commands of UBI volume character devices */
189
190#define UBI_VOL_IOC_MAGIC 'O'
191
192/* Start UBI volume update
193 * Note: This actually takes a pointer (__s64*), but we can't change
194 * that without breaking the ABI on 32bit systems
195 */
196#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
197/* LEB erasure command, used for debugging, disabled by default */
198#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
199/* Atomic LEB change command */
200#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
201/* Map LEB command */
202#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
203/* Unmap LEB command */
204#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
205/* Check if LEB is mapped command */
206#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
207/* Set an UBI volume property */
208#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
209 struct ubi_set_vol_prop_req)
210/* Create a R/O block device on top of an UBI volume */
211#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
212/* Remove the R/O block device */
213#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
214
215/* Maximum MTD device name length supported by UBI */
216#define MAX_UBI_MTD_NAME_LEN 127
217
218/* Maximum amount of UBI volumes that can be re-named at one go */
219#define UBI_MAX_RNVOL 32
220
221/*
222 * UBI volume type constants.
223 *
224 * @UBI_DYNAMIC_VOLUME: dynamic volume
225 * @UBI_STATIC_VOLUME: static volume
226 */
227enum {
228 UBI_DYNAMIC_VOLUME = 3,
229 UBI_STATIC_VOLUME = 4,
230};
231
232/*
233 * UBI set volume property ioctl constants.
234 *
235 * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0)
236 * user to directly write and erase individual
237 * eraseblocks on dynamic volumes
238 */
239enum {
240 UBI_VOL_PROP_DIRECT_WRITE = 1,
241};
242
243/**
244 * struct ubi_attach_req - attach MTD device request.
245 * @ubi_num: UBI device number to create
246 * @mtd_num: MTD device number to attach
247 * @vid_hdr_offset: VID header offset (use defaults if %0)
248 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
249 * @padding: reserved for future, not used, has to be zeroed
250 *
251 * This data structure is used to specify MTD device UBI has to attach and the
252 * parameters it has to use. The number which should be assigned to the new UBI
253 * device is passed in @ubi_num. UBI may automatically assign the number if
254 * @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in
255 * @ubi_num.
256 *
257 * Most applications should pass %0 in @vid_hdr_offset to make UBI use default
258 * offset of the VID header within physical eraseblocks. The default offset is
259 * the next min. I/O unit after the EC header. For example, it will be offset
260 * 512 in case of a 512 bytes page NAND flash with no sub-page support. Or
261 * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages.
262 *
263 * But in rare cases, if this optimizes things, the VID header may be placed to
264 * a different offset. For example, the boot-loader might do things faster if
265 * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages.
266 * As the boot-loader would not normally need to read EC headers (unless it
267 * needs UBI in RW mode), it might be faster to calculate ECC. This is weird
268 * example, but it real-life example. So, in this example, @vid_hdr_offer would
269 * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes
270 * aligned, which is OK, as UBI is clever enough to realize this is 4th
271 * sub-page of the first page and add needed padding.
272 *
273 * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the
274 * UBI device per 1024 eraseblocks. This value is often given in an other form
275 * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The
276 * maximum expected bad eraseblocks per 1024 is then:
277 * 1024 * (1 - MinNVB / MaxNVB)
278 * Which gives 20 for most NAND devices. This limit is used in order to derive
279 * amount of eraseblock UBI reserves for handling new bad blocks. If the device
280 * has more bad eraseblocks than this limit, UBI does not reserve any physical
281 * eraseblocks for new bad eraseblocks, but attempts to use available
282 * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the
283 * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used.
284 */
285struct ubi_attach_req {
286 __s32 ubi_num;
287 __s32 mtd_num;
288 __s32 vid_hdr_offset;
289 __s16 max_beb_per1024;
290 __s8 padding[10];
291};
292
293/*
294 * UBI volume flags.
295 *
296 * @UBI_VOL_SKIP_CRC_CHECK_FLG: skip the CRC check done on a static volume at
297 * open time. Only valid for static volumes and
298 * should only be used if the volume user has a
299 * way to verify data integrity
300 */
301enum {
302 UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
303};
304
305#define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG)
306
307/**
308 * struct ubi_mkvol_req - volume description data structure used in
309 * volume creation requests.
310 * @vol_id: volume number
311 * @alignment: volume alignment
312 * @bytes: volume size in bytes
313 * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME)
314 * @flags: volume flags (%UBI_VOL_SKIP_CRC_CHECK_FLG)
315 * @name_len: volume name length
316 * @padding2: reserved for future, not used, has to be zeroed
317 * @name: volume name
318 *
319 * This structure is used by user-space programs when creating new volumes. The
320 * @used_bytes field is only necessary when creating static volumes.
321 *
322 * The @alignment field specifies the required alignment of the volume logical
323 * eraseblock. This means, that the size of logical eraseblocks will be aligned
324 * to this number, i.e.,
325 * (UBI device logical eraseblock size) mod (@alignment) = 0.
326 *
327 * To put it differently, the logical eraseblock of this volume may be slightly
328 * shortened in order to make it properly aligned. The alignment has to be
329 * multiple of the flash minimal input/output unit, or %1 to utilize the entire
330 * available space of logical eraseblocks.
331 *
332 * The @alignment field may be useful, for example, when one wants to maintain
333 * a block device on top of an UBI volume. In this case, it is desirable to fit
334 * an integer number of blocks in logical eraseblocks of this UBI volume. With
335 * alignment it is possible to update this volume using plane UBI volume image
336 * BLOBs, without caring about how to properly align them.
337 */
338struct ubi_mkvol_req {
339 __s32 vol_id;
340 __s32 alignment;
341 __s64 bytes;
342 __s8 vol_type;
343 __u8 flags;
344 __s16 name_len;
345 __s8 padding2[4];
346 char name[UBI_MAX_VOLUME_NAME + 1];
347} __attribute__((packed));
348
349/**
350 * struct ubi_rsvol_req - a data structure used in volume re-size requests.
351 * @vol_id: ID of the volume to re-size
352 * @bytes: new size of the volume in bytes
353 *
354 * Re-sizing is possible for both dynamic and static volumes. But while dynamic
355 * volumes may be re-sized arbitrarily, static volumes cannot be made to be
356 * smaller than the number of bytes they bear. To arbitrarily shrink a static
357 * volume, it must be wiped out first (by means of volume update operation with
358 * zero number of bytes).
359 */
360struct ubi_rsvol_req {
361 __s64 bytes;
362 __s32 vol_id;
363} __attribute__((packed));
364
365/**
366 * struct ubi_rnvol_req - volumes re-name request.
367 * @count: count of volumes to re-name
368 * @padding1: reserved for future, not used, has to be zeroed
369 * @vol_id: ID of the volume to re-name
370 * @name_len: name length
371 * @padding2: reserved for future, not used, has to be zeroed
372 * @name: new volume name
373 *
374 * UBI allows to re-name up to %32 volumes at one go. The count of volumes to
375 * re-name is specified in the @count field. The ID of the volumes to re-name
376 * and the new names are specified in the @vol_id and @name fields.
377 *
378 * The UBI volume re-name operation is atomic, which means that should power cut
379 * happen, the volumes will have either old name or new name. So the possible
380 * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes
381 * A and B one may create temporary volumes %A1 and %B1 with the new contents,
382 * then atomically re-name A1->A and B1->B, in which case old %A and %B will
383 * be removed.
384 *
385 * If it is not desirable to remove old A and B, the re-name request has to
386 * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1
387 * become A and B, and old A and B will become A1 and B1.
388 *
389 * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1
390 * and B1 become A and B, and old A and B become X and Y.
391 *
392 * In other words, in case of re-naming into an existing volume name, the
393 * existing volume is removed, unless it is re-named as well at the same
394 * re-name request.
395 */
396struct ubi_rnvol_req {
397 __s32 count;
398 __s8 padding1[12];
399 struct {
400 __s32 vol_id;
401 __s16 name_len;
402 __s8 padding2[2];
403 char name[UBI_MAX_VOLUME_NAME + 1];
404 } ents[UBI_MAX_RNVOL];
405} __attribute__((packed));
406
407/**
408 * struct ubi_leb_change_req - a data structure used in atomic LEB change
409 * requests.
410 * @lnum: logical eraseblock number to change
411 * @bytes: how many bytes will be written to the logical eraseblock
412 * @dtype: pass "3" for better compatibility with old kernels
413 * @padding: reserved for future, not used, has to be zeroed
414 *
415 * The @dtype field used to inform UBI about what kind of data will be written
416 * to the LEB: long term (value 1), short term (value 2), unknown (value 3).
417 * UBI tried to pick a PEB with lower erase counter for short term data and a
418 * PEB with higher erase counter for long term data. But this was not really
419 * used because users usually do not know this and could easily mislead UBI. We
420 * removed this feature in May 2012. UBI currently just ignores the @dtype
421 * field. But for better compatibility with older kernels it is recommended to
422 * set @dtype to 3 (unknown).
423 */
424struct ubi_leb_change_req {
425 __s32 lnum;
426 __s32 bytes;
427 __s8 dtype; /* obsolete, do not use! */
428 __s8 padding[7];
429} __attribute__((packed));
430
431/**
432 * struct ubi_map_req - a data structure used in map LEB requests.
433 * @dtype: pass "3" for better compatibility with old kernels
434 * @lnum: logical eraseblock number to unmap
435 * @padding: reserved for future, not used, has to be zeroed
436 */
437struct ubi_map_req {
438 __s32 lnum;
439 __s8 dtype; /* obsolete, do not use! */
440 __s8 padding[3];
441} __attribute__((packed));
442
443
444/**
445 * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume
446 * property.
447 * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
448 * @padding: reserved for future, not used, has to be zeroed
449 * @value: value to set
450 */
451struct ubi_set_vol_prop_req {
452 __u8 property;
453 __u8 padding[7];
454 __u64 value;
455} __attribute__((packed));
456
457/**
458 * struct ubi_blkcreate_req - a data structure used in block creation requests.
459 * @padding: reserved for future, not used, has to be zeroed
460 */
461struct ubi_blkcreate_req {
462 __s8 padding[128];
463} __attribute__((packed));
464
465#endif /* __UBI_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/bnxt_re-abi.h created+126
...@@ -0,0 +1,126 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 * Broadcom NetXtreme-E RoCE driver.
4 *
5 * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
6 * Broadcom refers to Broadcom Limited and/or its subsidiaries.
7 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 *
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in
22 * the documentation and/or other materials provided with the
23 * distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
35 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Description: Uverbs ABI header file
38 */
39
40#ifndef __BNXT_RE_UVERBS_ABI_H__
41#define __BNXT_RE_UVERBS_ABI_H__
42
43#include <linux/types.h>
44
45#define BNXT_RE_ABI_VERSION 1
46
47#define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00
48#define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10
49#define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18
50
51enum {
52 BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
53 BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
54};
55
56enum bnxt_re_wqe_mode {
57 BNXT_QPLIB_WQE_MODE_STATIC = 0x00,
58 BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01,
59 BNXT_QPLIB_WQE_MODE_INVALID = 0x02,
60};
61
62struct bnxt_re_uctx_resp {
63 __u32 dev_id;
64 __u32 max_qp;
65 __u32 pg_size;
66 __u32 cqe_sz;
67 __u32 max_cqd;
68 __u32 rsvd;
69 __aligned_u64 comp_mask;
70 __u32 chip_id0;
71 __u32 chip_id1;
72 __u32 mode;
73 __u32 rsvd1; /* padding */
74};
75
76/*
77 * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
78 * not 8 byted aligned. To avoid undesired padding in various cases we have to
79 * set this struct to packed.
80 */
81struct bnxt_re_pd_resp {
82 __u32 pdid;
83 __u32 dpi;
84 __u64 dbr;
85} __attribute__((packed, aligned(4)));
86
87struct bnxt_re_cq_req {
88 __aligned_u64 cq_va;
89 __aligned_u64 cq_handle;
90};
91
92struct bnxt_re_cq_resp {
93 __u32 cqid;
94 __u32 tail;
95 __u32 phase;
96 __u32 rsvd;
97};
98
99struct bnxt_re_qp_req {
100 __aligned_u64 qpsva;
101 __aligned_u64 qprva;
102 __aligned_u64 qp_handle;
103};
104
105struct bnxt_re_qp_resp {
106 __u32 qpid;
107 __u32 rsvd;
108};
109
110struct bnxt_re_srq_req {
111 __aligned_u64 srqva;
112 __aligned_u64 srq_handle;
113};
114
115struct bnxt_re_srq_resp {
116 __u32 srqid;
117};
118
119enum bnxt_re_shpg_offt {
120 BNXT_RE_BEG_RESV_OFFT = 0x00,
121 BNXT_RE_AVID_OFFT = 0x10,
122 BNXT_RE_AVID_SIZE = 0x04,
123 BNXT_RE_END_RESV_OFFT = 0xFF0
124};
125
126#endif /* __BNXT_RE_UVERBS_ABI_H__*/
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/cxgb4-abi.h created+115
...@@ -0,0 +1,115 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33#ifndef CXGB4_ABI_USER_H
34#define CXGB4_ABI_USER_H
35
36#include <linux/types.h>
37
38#define C4IW_UVERBS_ABI_VERSION 3
39
40/*
41 * Make sure that all structs defined in this file remain laid out so
42 * that they pack the same way on 32-bit and 64-bit architectures (to
43 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
44 * In particular do not use pointer types -- pass pointers in __aligned_u64
45 * instead.
46 */
47
48enum {
49 C4IW_64B_CQE = (1 << 0)
50};
51
52struct c4iw_create_cq {
53 __u32 flags;
54 __u32 reserved;
55};
56
57struct c4iw_create_cq_resp {
58 __aligned_u64 key;
59 __aligned_u64 gts_key;
60 __aligned_u64 memsize;
61 __u32 cqid;
62 __u32 size;
63 __u32 qid_mask;
64 __u32 flags;
65};
66
67enum {
68 C4IW_QPF_ONCHIP = (1 << 0),
69 C4IW_QPF_WRITE_W_IMM = (1 << 1)
70};
71
72struct c4iw_create_qp_resp {
73 __aligned_u64 ma_sync_key;
74 __aligned_u64 sq_key;
75 __aligned_u64 rq_key;
76 __aligned_u64 sq_db_gts_key;
77 __aligned_u64 rq_db_gts_key;
78 __aligned_u64 sq_memsize;
79 __aligned_u64 rq_memsize;
80 __u32 sqid;
81 __u32 rqid;
82 __u32 sq_size;
83 __u32 rq_size;
84 __u32 qid_mask;
85 __u32 flags;
86};
87
88struct c4iw_create_srq_resp {
89 __aligned_u64 srq_key;
90 __aligned_u64 srq_db_gts_key;
91 __aligned_u64 srq_memsize;
92 __u32 srqid;
93 __u32 srq_size;
94 __u32 rqt_abs_idx;
95 __u32 qid_mask;
96 __u32 flags;
97 __u32 reserved; /* explicit padding */
98};
99
100enum {
101 /* HW supports SRQ_LIMIT_REACHED event */
102 T4_SRQ_LIMIT_SUPPORT = 1 << 0,
103};
104
105struct c4iw_alloc_ucontext_resp {
106 __aligned_u64 status_page_key;
107 __u32 status_page_size;
108 __u32 reserved; /* explicit padding (optional for i386) */
109};
110
111struct c4iw_alloc_pd_resp {
112 __u32 pdid;
113};
114
115#endif /* CXGB4_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/efa-abi.h created+133
...@@ -0,0 +1,133 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 * Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
4 */
5
6#ifndef EFA_ABI_USER_H
7#define EFA_ABI_USER_H
8
9#include <linux/types.h>
10
11/*
12 * Increment this value if any changes that break userspace ABI
13 * compatibility are made.
14 */
15#define EFA_UVERBS_ABI_VERSION 1
16
17/*
18 * Keep structs aligned to 8 bytes.
19 * Keep reserved fields as arrays of __u8 named reserved_XXX where XXX is the
20 * hex bit offset of the field.
21 */
22
23enum {
24 EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0,
25 EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
26};
27
28struct efa_ibv_alloc_ucontext_cmd {
29 __u32 comp_mask;
30 __u8 reserved_20[4];
31};
32
33enum efa_ibv_user_cmds_supp_udata {
34 EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
35 EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1,
36};
37
38struct efa_ibv_alloc_ucontext_resp {
39 __u32 comp_mask;
40 __u32 cmds_supp_udata_mask;
41 __u16 sub_cqs_per_cq;
42 __u16 inline_buf_size;
43 __u32 max_llq_size; /* bytes */
44 __u16 max_tx_batch; /* units of 64 bytes */
45 __u16 min_sq_wr;
46 __u8 reserved_a0[4];
47};
48
49struct efa_ibv_alloc_pd_resp {
50 __u32 comp_mask;
51 __u16 pdn;
52 __u8 reserved_30[2];
53};
54
55enum {
56 EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
57};
58
59struct efa_ibv_create_cq {
60 __u32 comp_mask;
61 __u32 cq_entry_size;
62 __u16 num_sub_cqs;
63 __u8 flags;
64 __u8 reserved_58[5];
65};
66
67enum {
68 EFA_CREATE_CQ_RESP_DB_OFF = 1 << 0,
69};
70
71struct efa_ibv_create_cq_resp {
72 __u32 comp_mask;
73 __u8 reserved_20[4];
74 __aligned_u64 q_mmap_key;
75 __aligned_u64 q_mmap_size;
76 __u16 cq_idx;
77 __u8 reserved_d0[2];
78 __u32 db_off;
79 __aligned_u64 db_mmap_key;
80};
81
82enum {
83 EFA_QP_DRIVER_TYPE_SRD = 0,
84};
85
86struct efa_ibv_create_qp {
87 __u32 comp_mask;
88 __u32 rq_ring_size; /* bytes */
89 __u32 sq_ring_size; /* bytes */
90 __u32 driver_qp_type;
91};
92
93struct efa_ibv_create_qp_resp {
94 __u32 comp_mask;
95 /* the offset inside the page of the rq db */
96 __u32 rq_db_offset;
97 /* the offset inside the page of the sq db */
98 __u32 sq_db_offset;
99 /* the offset inside the page of descriptors buffer */
100 __u32 llq_desc_offset;
101 __aligned_u64 rq_mmap_key;
102 __aligned_u64 rq_mmap_size;
103 __aligned_u64 rq_db_mmap_key;
104 __aligned_u64 sq_db_mmap_key;
105 __aligned_u64 llq_desc_mmap_key;
106 __u16 send_sub_cq_idx;
107 __u16 recv_sub_cq_idx;
108 __u8 reserved_1e0[4];
109};
110
111struct efa_ibv_create_ah_resp {
112 __u32 comp_mask;
113 __u16 efa_address_handle;
114 __u8 reserved_30[2];
115};
116
117enum {
118 EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
119 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
120 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
121};
122
123struct efa_ibv_ex_query_device_resp {
124 __u32 comp_mask;
125 __u32 max_sq_wr;
126 __u32 max_rq_wr;
127 __u16 max_sq_sge;
128 __u16 max_rq_sge;
129 __u32 max_rdma_size;
130 __u32 device_caps;
131};
132
133#endif /* EFA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/hfi/hfi1_ioctl.h created+174
...@@ -0,0 +1,174 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2015 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * BSD LICENSE
21 *
22 * Copyright(c) 2015 Intel Corporation.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 *
28 * - Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * - Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 * - Neither the name of Intel Corporation nor the names of its
35 * contributors may be used to endorse or promote products derived
36 * from this software without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
42 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52#ifndef _LINUX__HFI1_IOCTL_H
53#define _LINUX__HFI1_IOCTL_H
54#include <linux/types.h>
55
56/*
57 * This structure is passed to the driver to tell it where
58 * user code buffers are, sizes, etc. The offsets and sizes of the
59 * fields must remain unchanged, for binary compatibility. It can
60 * be extended, if userversion is changed so user code can tell, if needed
61 */
62struct hfi1_user_info {
63 /*
64 * version of user software, to detect compatibility issues.
65 * Should be set to HFI1_USER_SWVERSION.
66 */
67 __u32 userversion;
68 __u32 pad;
69 /*
70 * If two or more processes wish to share a context, each process
71 * must set the subcontext_cnt and subcontext_id to the same
72 * values. The only restriction on the subcontext_id is that
73 * it be unique for a given node.
74 */
75 __u16 subctxt_cnt;
76 __u16 subctxt_id;
77 /* 128bit UUID passed in by PSM. */
78 __u8 uuid[16];
79};
80
81struct hfi1_ctxt_info {
82 __aligned_u64 runtime_flags; /* chip/drv runtime flags (HFI1_CAP_*) */
83 __u32 rcvegr_size; /* size of each eager buffer */
84 __u16 num_active; /* number of active units */
85 __u16 unit; /* unit (chip) assigned to caller */
86 __u16 ctxt; /* ctxt on unit assigned to caller */
87 __u16 subctxt; /* subctxt on unit assigned to caller */
88 __u16 rcvtids; /* number of Rcv TIDs for this context */
89 __u16 credits; /* number of PIO credits for this context */
90 __u16 numa_node; /* NUMA node of the assigned device */
91 __u16 rec_cpu; /* cpu # for affinity (0xffff if none) */
92 __u16 send_ctxt; /* send context in use by this user context */
93 __u16 egrtids; /* number of RcvArray entries for Eager Rcvs */
94 __u16 rcvhdrq_cnt; /* number of RcvHdrQ entries */
95 __u16 rcvhdrq_entsize; /* size (in bytes) for each RcvHdrQ entry */
96 __u16 sdma_ring_size; /* number of entries in SDMA request ring */
97};
98
99struct hfi1_tid_info {
100 /* virtual address of first page in transfer */
101 __aligned_u64 vaddr;
102 /* pointer to tid array. this array is big enough */
103 __aligned_u64 tidlist;
104 /* number of tids programmed by this request */
105 __u32 tidcnt;
106 /* length of transfer buffer programmed by this request */
107 __u32 length;
108};
109
110/*
111 * This structure is returned by the driver immediately after
112 * open to get implementation-specific info, and info specific to this
113 * instance.
114 *
115 * This struct must have explicit pad fields where type sizes
116 * may result in different alignments between 32 and 64 bit
117 * programs, since the 64 bit * bit kernel requires the user code
118 * to have matching offsets
119 */
120struct hfi1_base_info {
121 /* version of hardware, for feature checking. */
122 __u32 hw_version;
123 /* version of software, for feature checking. */
124 __u32 sw_version;
125 /* Job key */
126 __u16 jkey;
127 __u16 padding1;
128 /*
129 * The special QP (queue pair) value that identifies PSM
130 * protocol packet from standard IB packets.
131 */
132 __u32 bthqp;
133 /* PIO credit return address, */
134 __aligned_u64 sc_credits_addr;
135 /*
136 * Base address of write-only pio buffers for this process.
137 * Each buffer has sendpio_credits*64 bytes.
138 */
139 __aligned_u64 pio_bufbase_sop;
140 /*
141 * Base address of write-only pio buffers for this process.
142 * Each buffer has sendpio_credits*64 bytes.
143 */
144 __aligned_u64 pio_bufbase;
145 /* address where receive buffer queue is mapped into */
146 __aligned_u64 rcvhdr_bufbase;
147 /* base address of Eager receive buffers. */
148 __aligned_u64 rcvegr_bufbase;
149 /* base address of SDMA completion ring */
150 __aligned_u64 sdma_comp_bufbase;
151 /*
152 * User register base for init code, not to be used directly by
153 * protocol or applications. Always maps real chip register space.
154 * the register addresses are:
155 * ur_rcvhdrhead, ur_rcvhdrtail, ur_rcvegrhead, ur_rcvegrtail,
156 * ur_rcvtidflow
157 */
158 __aligned_u64 user_regbase;
159 /* notification events */
160 __aligned_u64 events_bufbase;
161 /* status page */
162 __aligned_u64 status_bufbase;
163 /* rcvhdrtail update */
164 __aligned_u64 rcvhdrtail_base;
165 /*
166 * shared memory pages for subctxts if ctxt is shared; these cover
167 * all the processes in the group sharing a single context.
168 * all have enough space for the num_subcontexts value on this job.
169 */
170 __aligned_u64 subctxt_uregbase;
171 __aligned_u64 subctxt_rcvegrbuf;
172 __aligned_u64 subctxt_rcvhdrbuf;
173};
174#endif /* _LINIUX__HFI1_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/hfi/hfi1_user.h created+268
...@@ -0,0 +1,268 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2015 - 2020 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * BSD LICENSE
21 *
22 * Copyright(c) 2015 Intel Corporation.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 *
28 * - Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * - Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 * - Neither the name of Intel Corporation nor the names of its
35 * contributors may be used to endorse or promote products derived
36 * from this software without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
42 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52/*
53 * This file contains defines, structures, etc. that are used
54 * to communicate between kernel and user code.
55 */
56
57#ifndef _LINUX__HFI1_USER_H
58#define _LINUX__HFI1_USER_H
59
60#include <linux/types.h>
61#include <rdma/rdma_user_ioctl.h>
62
63/*
64 * This version number is given to the driver by the user code during
65 * initialization in the spu_userversion field of hfi1_user_info, so
66 * the driver can check for compatibility with user code.
67 *
68 * The major version changes when data structures change in an incompatible
69 * way. The driver must be the same for initialization to succeed.
70 */
71#define HFI1_USER_SWMAJOR 6
72
73/*
74 * Minor version differences are always compatible
75 * a within a major version, however if user software is larger
76 * than driver software, some new features and/or structure fields
77 * may not be implemented; the user code must deal with this if it
78 * cares, or it must abort after initialization reports the difference.
79 */
80#define HFI1_USER_SWMINOR 3
81
82/*
83 * We will encode the major/minor inside a single 32bit version number.
84 */
85#define HFI1_SWMAJOR_SHIFT 16
86
87/*
88 * Set of HW and driver capability/feature bits.
89 * These bit values are used to configure enabled/disabled HW and
90 * driver features. The same set of bits are communicated to user
91 * space.
92 */
93#define HFI1_CAP_DMA_RTAIL (1UL << 0) /* Use DMA'ed RTail value */
94#define HFI1_CAP_SDMA (1UL << 1) /* Enable SDMA support */
95#define HFI1_CAP_SDMA_AHG (1UL << 2) /* Enable SDMA AHG support */
96#define HFI1_CAP_EXTENDED_PSN (1UL << 3) /* Enable Extended PSN support */
97#define HFI1_CAP_HDRSUPP (1UL << 4) /* Enable Header Suppression */
98#define HFI1_CAP_TID_RDMA (1UL << 5) /* Enable TID RDMA operations */
99#define HFI1_CAP_USE_SDMA_HEAD (1UL << 6) /* DMA Hdr Q tail vs. use CSR */
100#define HFI1_CAP_MULTI_PKT_EGR (1UL << 7) /* Enable multi-packet Egr buffs*/
101#define HFI1_CAP_NODROP_RHQ_FULL (1UL << 8) /* Don't drop on Hdr Q full */
102#define HFI1_CAP_NODROP_EGR_FULL (1UL << 9) /* Don't drop on EGR buffs full */
103#define HFI1_CAP_TID_UNMAP (1UL << 10) /* Disable Expected TID caching */
104#define HFI1_CAP_PRINT_UNIMPL (1UL << 11) /* Show for unimplemented feats */
105#define HFI1_CAP_ALLOW_PERM_JKEY (1UL << 12) /* Allow use of permissive JKEY */
106#define HFI1_CAP_NO_INTEGRITY (1UL << 13) /* Enable ctxt integrity checks */
107#define HFI1_CAP_PKEY_CHECK (1UL << 14) /* Enable ctxt PKey checking */
108#define HFI1_CAP_STATIC_RATE_CTRL (1UL << 15) /* Allow PBC.StaticRateControl */
109#define HFI1_CAP_OPFN (1UL << 16) /* Enable the OPFN protocol */
110#define HFI1_CAP_SDMA_HEAD_CHECK (1UL << 17) /* SDMA head checking */
111#define HFI1_CAP_EARLY_CREDIT_RETURN (1UL << 18) /* early credit return */
112#define HFI1_CAP_AIP (1UL << 19) /* Enable accelerated IP */
113
114#define HFI1_RCVHDR_ENTSIZE_2 (1UL << 0)
115#define HFI1_RCVHDR_ENTSIZE_16 (1UL << 1)
116#define HFI1_RCVDHR_ENTSIZE_32 (1UL << 2)
117
118#define _HFI1_EVENT_FROZEN_BIT 0
119#define _HFI1_EVENT_LINKDOWN_BIT 1
120#define _HFI1_EVENT_LID_CHANGE_BIT 2
121#define _HFI1_EVENT_LMC_CHANGE_BIT 3
122#define _HFI1_EVENT_SL2VL_CHANGE_BIT 4
123#define _HFI1_EVENT_TID_MMU_NOTIFY_BIT 5
124#define _HFI1_MAX_EVENT_BIT _HFI1_EVENT_TID_MMU_NOTIFY_BIT
125
126#define HFI1_EVENT_FROZEN (1UL << _HFI1_EVENT_FROZEN_BIT)
127#define HFI1_EVENT_LINKDOWN (1UL << _HFI1_EVENT_LINKDOWN_BIT)
128#define HFI1_EVENT_LID_CHANGE (1UL << _HFI1_EVENT_LID_CHANGE_BIT)
129#define HFI1_EVENT_LMC_CHANGE (1UL << _HFI1_EVENT_LMC_CHANGE_BIT)
130#define HFI1_EVENT_SL2VL_CHANGE (1UL << _HFI1_EVENT_SL2VL_CHANGE_BIT)
131#define HFI1_EVENT_TID_MMU_NOTIFY (1UL << _HFI1_EVENT_TID_MMU_NOTIFY_BIT)
132
133/*
134 * These are the status bits readable (in ASCII form, 64bit value)
135 * from the "status" sysfs file. For binary compatibility, values
136 * must remain as is; removed states can be reused for different
137 * purposes.
138 */
139#define HFI1_STATUS_INITTED 0x1 /* basic initialization done */
140/* Chip has been found and initialized */
141#define HFI1_STATUS_CHIP_PRESENT 0x20
142/* IB link is at ACTIVE, usable for data traffic */
143#define HFI1_STATUS_IB_READY 0x40
144/* link is configured, LID, MTU, etc. have been set */
145#define HFI1_STATUS_IB_CONF 0x80
146/* A Fatal hardware error has occurred. */
147#define HFI1_STATUS_HWERROR 0x200
148
149/*
150 * Number of supported shared contexts.
151 * This is the maximum number of software contexts that can share
152 * a hardware send/receive context.
153 */
154#define HFI1_MAX_SHARED_CTXTS 8
155
156/*
157 * Poll types
158 */
159#define HFI1_POLL_TYPE_ANYRCV 0x0
160#define HFI1_POLL_TYPE_URGENT 0x1
161
162enum hfi1_sdma_comp_state {
163 FREE = 0,
164 QUEUED,
165 COMPLETE,
166 ERROR
167};
168
169/*
170 * SDMA completion ring entry
171 */
172struct hfi1_sdma_comp_entry {
173 __u32 status;
174 __u32 errcode;
175};
176
177/*
178 * Device status and notifications from driver to user-space.
179 */
180struct hfi1_status {
181 __aligned_u64 dev; /* device/hw status bits */
182 __aligned_u64 port; /* port state and status bits */
183 char freezemsg[0];
184};
185
186enum sdma_req_opcode {
187 EXPECTED = 0,
188 EAGER
189};
190
191#define HFI1_SDMA_REQ_VERSION_MASK 0xF
192#define HFI1_SDMA_REQ_VERSION_SHIFT 0x0
193#define HFI1_SDMA_REQ_OPCODE_MASK 0xF
194#define HFI1_SDMA_REQ_OPCODE_SHIFT 0x4
195#define HFI1_SDMA_REQ_IOVCNT_MASK 0xFF
196#define HFI1_SDMA_REQ_IOVCNT_SHIFT 0x8
197
198struct sdma_req_info {
199 /*
200 * bits 0-3 - version (currently unused)
201 * bits 4-7 - opcode (enum sdma_req_opcode)
202 * bits 8-15 - io vector count
203 */
204 __u16 ctrl;
205 /*
206 * Number of fragments contained in this request.
207 * User-space has already computed how many
208 * fragment-sized packet the user buffer will be
209 * split into.
210 */
211 __u16 npkts;
212 /*
213 * Size of each fragment the user buffer will be
214 * split into.
215 */
216 __u16 fragsize;
217 /*
218 * Index of the slot in the SDMA completion ring
219 * this request should be using. User-space is
220 * in charge of managing its own ring.
221 */
222 __u16 comp_idx;
223} __attribute__((__packed__));
224
225/*
226 * SW KDETH header.
227 * swdata is SW defined portion.
228 */
229struct hfi1_kdeth_header {
230 __le32 ver_tid_offset;
231 __le16 jkey;
232 __le16 hcrc;
233 __le32 swdata[7];
234} __attribute__((__packed__));
235
236/*
237 * Structure describing the headers that User space uses. The
238 * structure above is a subset of this one.
239 */
240struct hfi1_pkt_header {
241 __le16 pbc[4];
242 __be16 lrh[4];
243 __be32 bth[3];
244 struct hfi1_kdeth_header kdeth;
245} __attribute__((__packed__));
246
247
248/*
249 * The list of usermode accessible registers.
250 */
251enum hfi1_ureg {
252 /* (RO) DMA RcvHdr to be used next. */
253 ur_rcvhdrtail = 0,
254 /* (RW) RcvHdr entry to be processed next by host. */
255 ur_rcvhdrhead = 1,
256 /* (RO) Index of next Eager index to use. */
257 ur_rcvegrindextail = 2,
258 /* (RW) Eager TID to be processed next */
259 ur_rcvegrindexhead = 3,
260 /* (RO) Receive Eager Offset Tail */
261 ur_rcvegroffsettail = 4,
262 /* For internal use only; max register number. */
263 ur_maxreg,
264 /* (RW) Receive TID flow table */
265 ur_rcvtidflowtable = 256
266};
267
268#endif /* _LINIUX__HFI1_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/hns-abi.h created+97
...@@ -0,0 +1,97 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Hisilicon Limited.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef HNS_ABI_USER_H
35#define HNS_ABI_USER_H
36
37#include <linux/types.h>
38
39struct hns_roce_ib_create_cq {
40 __aligned_u64 buf_addr;
41 __aligned_u64 db_addr;
42 __u32 cqe_size;
43 __u32 reserved;
44};
45
46enum hns_roce_cq_cap_flags {
47 HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0,
48};
49
50struct hns_roce_ib_create_cq_resp {
51 __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */
52 __aligned_u64 cap_flags;
53};
54
55struct hns_roce_ib_create_srq {
56 __aligned_u64 buf_addr;
57 __aligned_u64 db_addr;
58 __aligned_u64 que_addr;
59};
60
61struct hns_roce_ib_create_srq_resp {
62 __u32 srqn;
63 __u32 reserved;
64};
65
66struct hns_roce_ib_create_qp {
67 __aligned_u64 buf_addr;
68 __aligned_u64 db_addr;
69 __u8 log_sq_bb_count;
70 __u8 log_sq_stride;
71 __u8 sq_no_prefetch;
72 __u8 reserved[5];
73 __aligned_u64 sdb_addr;
74};
75
76enum hns_roce_qp_cap_flags {
77 HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
78 HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
79 HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
80};
81
82struct hns_roce_ib_create_qp_resp {
83 __aligned_u64 cap_flags;
84};
85
86struct hns_roce_ib_alloc_ucontext_resp {
87 __u32 qp_tab_size;
88 __u32 cqe_size;
89 __u32 srq_tab_size;
90 __u32 reserved;
91};
92
93struct hns_roce_ib_alloc_pd_resp {
94 __u32 pdn;
95};
96
97#endif /* HNS_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_cmds.h created+385
...@@ -0,0 +1,385 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 * Copyright (c) 2020, Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef IB_USER_IOCTL_CMDS_H
35#define IB_USER_IOCTL_CMDS_H
36
37#define UVERBS_ID_NS_MASK 0xF000
38#define UVERBS_ID_NS_SHIFT 12
39
40#define UVERBS_UDATA_DRIVER_DATA_NS 1
41#define UVERBS_UDATA_DRIVER_DATA_FLAG (1UL << UVERBS_ID_NS_SHIFT)
42
43enum uverbs_default_objects {
44 UVERBS_OBJECT_DEVICE, /* No instances of DEVICE are allowed */
45 UVERBS_OBJECT_PD,
46 UVERBS_OBJECT_COMP_CHANNEL,
47 UVERBS_OBJECT_CQ,
48 UVERBS_OBJECT_QP,
49 UVERBS_OBJECT_SRQ,
50 UVERBS_OBJECT_AH,
51 UVERBS_OBJECT_MR,
52 UVERBS_OBJECT_MW,
53 UVERBS_OBJECT_FLOW,
54 UVERBS_OBJECT_XRCD,
55 UVERBS_OBJECT_RWQ_IND_TBL,
56 UVERBS_OBJECT_WQ,
57 UVERBS_OBJECT_FLOW_ACTION,
58 UVERBS_OBJECT_DM,
59 UVERBS_OBJECT_COUNTERS,
60 UVERBS_OBJECT_ASYNC_EVENT,
61};
62
63enum {
64 UVERBS_ATTR_UHW_IN = UVERBS_UDATA_DRIVER_DATA_FLAG,
65 UVERBS_ATTR_UHW_OUT,
66};
67
68enum uverbs_methods_device {
69 UVERBS_METHOD_INVOKE_WRITE,
70 UVERBS_METHOD_INFO_HANDLES,
71 UVERBS_METHOD_QUERY_PORT,
72 UVERBS_METHOD_GET_CONTEXT,
73 UVERBS_METHOD_QUERY_CONTEXT,
74 UVERBS_METHOD_QUERY_GID_TABLE,
75 UVERBS_METHOD_QUERY_GID_ENTRY,
76};
77
78enum uverbs_attrs_invoke_write_cmd_attr_ids {
79 UVERBS_ATTR_CORE_IN,
80 UVERBS_ATTR_CORE_OUT,
81 UVERBS_ATTR_WRITE_CMD,
82};
83
84enum uverbs_attrs_query_port_cmd_attr_ids {
85 UVERBS_ATTR_QUERY_PORT_PORT_NUM,
86 UVERBS_ATTR_QUERY_PORT_RESP,
87};
88
89enum uverbs_attrs_get_context_attr_ids {
90 UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
91 UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,
92};
93
94enum uverbs_attrs_query_context_attr_ids {
95 UVERBS_ATTR_QUERY_CONTEXT_NUM_COMP_VECTORS,
96 UVERBS_ATTR_QUERY_CONTEXT_CORE_SUPPORT,
97};
98
99enum uverbs_attrs_create_cq_cmd_attr_ids {
100 UVERBS_ATTR_CREATE_CQ_HANDLE,
101 UVERBS_ATTR_CREATE_CQ_CQE,
102 UVERBS_ATTR_CREATE_CQ_USER_HANDLE,
103 UVERBS_ATTR_CREATE_CQ_COMP_CHANNEL,
104 UVERBS_ATTR_CREATE_CQ_COMP_VECTOR,
105 UVERBS_ATTR_CREATE_CQ_FLAGS,
106 UVERBS_ATTR_CREATE_CQ_RESP_CQE,
107 UVERBS_ATTR_CREATE_CQ_EVENT_FD,
108};
109
110enum uverbs_attrs_destroy_cq_cmd_attr_ids {
111 UVERBS_ATTR_DESTROY_CQ_HANDLE,
112 UVERBS_ATTR_DESTROY_CQ_RESP,
113};
114
115enum uverbs_attrs_create_flow_action_esp {
116 UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE,
117 UVERBS_ATTR_FLOW_ACTION_ESP_ATTRS,
118 UVERBS_ATTR_FLOW_ACTION_ESP_ESN,
119 UVERBS_ATTR_FLOW_ACTION_ESP_KEYMAT,
120 UVERBS_ATTR_FLOW_ACTION_ESP_REPLAY,
121 UVERBS_ATTR_FLOW_ACTION_ESP_ENCAP,
122};
123
124enum uverbs_attrs_modify_flow_action_esp {
125 UVERBS_ATTR_MODIFY_FLOW_ACTION_ESP_HANDLE =
126 UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE,
127};
128
129enum uverbs_attrs_destroy_flow_action_esp {
130 UVERBS_ATTR_DESTROY_FLOW_ACTION_HANDLE,
131};
132
133enum uverbs_attrs_create_qp_cmd_attr_ids {
134 UVERBS_ATTR_CREATE_QP_HANDLE,
135 UVERBS_ATTR_CREATE_QP_XRCD_HANDLE,
136 UVERBS_ATTR_CREATE_QP_PD_HANDLE,
137 UVERBS_ATTR_CREATE_QP_SRQ_HANDLE,
138 UVERBS_ATTR_CREATE_QP_SEND_CQ_HANDLE,
139 UVERBS_ATTR_CREATE_QP_RECV_CQ_HANDLE,
140 UVERBS_ATTR_CREATE_QP_IND_TABLE_HANDLE,
141 UVERBS_ATTR_CREATE_QP_USER_HANDLE,
142 UVERBS_ATTR_CREATE_QP_CAP,
143 UVERBS_ATTR_CREATE_QP_TYPE,
144 UVERBS_ATTR_CREATE_QP_FLAGS,
145 UVERBS_ATTR_CREATE_QP_SOURCE_QPN,
146 UVERBS_ATTR_CREATE_QP_EVENT_FD,
147 UVERBS_ATTR_CREATE_QP_RESP_CAP,
148 UVERBS_ATTR_CREATE_QP_RESP_QP_NUM,
149};
150
151enum uverbs_attrs_destroy_qp_cmd_attr_ids {
152 UVERBS_ATTR_DESTROY_QP_HANDLE,
153 UVERBS_ATTR_DESTROY_QP_RESP,
154};
155
156enum uverbs_methods_qp {
157 UVERBS_METHOD_QP_CREATE,
158 UVERBS_METHOD_QP_DESTROY,
159};
160
161enum uverbs_attrs_create_srq_cmd_attr_ids {
162 UVERBS_ATTR_CREATE_SRQ_HANDLE,
163 UVERBS_ATTR_CREATE_SRQ_PD_HANDLE,
164 UVERBS_ATTR_CREATE_SRQ_XRCD_HANDLE,
165 UVERBS_ATTR_CREATE_SRQ_CQ_HANDLE,
166 UVERBS_ATTR_CREATE_SRQ_USER_HANDLE,
167 UVERBS_ATTR_CREATE_SRQ_MAX_WR,
168 UVERBS_ATTR_CREATE_SRQ_MAX_SGE,
169 UVERBS_ATTR_CREATE_SRQ_LIMIT,
170 UVERBS_ATTR_CREATE_SRQ_MAX_NUM_TAGS,
171 UVERBS_ATTR_CREATE_SRQ_TYPE,
172 UVERBS_ATTR_CREATE_SRQ_EVENT_FD,
173 UVERBS_ATTR_CREATE_SRQ_RESP_MAX_WR,
174 UVERBS_ATTR_CREATE_SRQ_RESP_MAX_SGE,
175 UVERBS_ATTR_CREATE_SRQ_RESP_SRQ_NUM,
176};
177
178enum uverbs_attrs_destroy_srq_cmd_attr_ids {
179 UVERBS_ATTR_DESTROY_SRQ_HANDLE,
180 UVERBS_ATTR_DESTROY_SRQ_RESP,
181};
182
183enum uverbs_methods_srq {
184 UVERBS_METHOD_SRQ_CREATE,
185 UVERBS_METHOD_SRQ_DESTROY,
186};
187
188enum uverbs_methods_cq {
189 UVERBS_METHOD_CQ_CREATE,
190 UVERBS_METHOD_CQ_DESTROY,
191};
192
193enum uverbs_attrs_create_wq_cmd_attr_ids {
194 UVERBS_ATTR_CREATE_WQ_HANDLE,
195 UVERBS_ATTR_CREATE_WQ_PD_HANDLE,
196 UVERBS_ATTR_CREATE_WQ_CQ_HANDLE,
197 UVERBS_ATTR_CREATE_WQ_USER_HANDLE,
198 UVERBS_ATTR_CREATE_WQ_TYPE,
199 UVERBS_ATTR_CREATE_WQ_EVENT_FD,
200 UVERBS_ATTR_CREATE_WQ_MAX_WR,
201 UVERBS_ATTR_CREATE_WQ_MAX_SGE,
202 UVERBS_ATTR_CREATE_WQ_FLAGS,
203 UVERBS_ATTR_CREATE_WQ_RESP_MAX_WR,
204 UVERBS_ATTR_CREATE_WQ_RESP_MAX_SGE,
205 UVERBS_ATTR_CREATE_WQ_RESP_WQ_NUM,
206};
207
208enum uverbs_attrs_destroy_wq_cmd_attr_ids {
209 UVERBS_ATTR_DESTROY_WQ_HANDLE,
210 UVERBS_ATTR_DESTROY_WQ_RESP,
211};
212
213enum uverbs_methods_wq {
214 UVERBS_METHOD_WQ_CREATE,
215 UVERBS_METHOD_WQ_DESTROY,
216};
217
218enum uverbs_methods_actions_flow_action_ops {
219 UVERBS_METHOD_FLOW_ACTION_ESP_CREATE,
220 UVERBS_METHOD_FLOW_ACTION_DESTROY,
221 UVERBS_METHOD_FLOW_ACTION_ESP_MODIFY,
222};
223
224enum uverbs_attrs_alloc_dm_cmd_attr_ids {
225 UVERBS_ATTR_ALLOC_DM_HANDLE,
226 UVERBS_ATTR_ALLOC_DM_LENGTH,
227 UVERBS_ATTR_ALLOC_DM_ALIGNMENT,
228};
229
230enum uverbs_attrs_free_dm_cmd_attr_ids {
231 UVERBS_ATTR_FREE_DM_HANDLE,
232};
233
234enum uverbs_methods_dm {
235 UVERBS_METHOD_DM_ALLOC,
236 UVERBS_METHOD_DM_FREE,
237};
238
239enum uverbs_attrs_reg_dm_mr_cmd_attr_ids {
240 UVERBS_ATTR_REG_DM_MR_HANDLE,
241 UVERBS_ATTR_REG_DM_MR_OFFSET,
242 UVERBS_ATTR_REG_DM_MR_LENGTH,
243 UVERBS_ATTR_REG_DM_MR_PD_HANDLE,
244 UVERBS_ATTR_REG_DM_MR_ACCESS_FLAGS,
245 UVERBS_ATTR_REG_DM_MR_DM_HANDLE,
246 UVERBS_ATTR_REG_DM_MR_RESP_LKEY,
247 UVERBS_ATTR_REG_DM_MR_RESP_RKEY,
248};
249
250enum uverbs_methods_mr {
251 UVERBS_METHOD_DM_MR_REG,
252 UVERBS_METHOD_MR_DESTROY,
253 UVERBS_METHOD_ADVISE_MR,
254 UVERBS_METHOD_QUERY_MR,
255 UVERBS_METHOD_REG_DMABUF_MR,
256};
257
258enum uverbs_attrs_mr_destroy_ids {
259 UVERBS_ATTR_DESTROY_MR_HANDLE,
260};
261
262enum uverbs_attrs_advise_mr_cmd_attr_ids {
263 UVERBS_ATTR_ADVISE_MR_PD_HANDLE,
264 UVERBS_ATTR_ADVISE_MR_ADVICE,
265 UVERBS_ATTR_ADVISE_MR_FLAGS,
266 UVERBS_ATTR_ADVISE_MR_SGE_LIST,
267};
268
269enum uverbs_attrs_query_mr_cmd_attr_ids {
270 UVERBS_ATTR_QUERY_MR_HANDLE,
271 UVERBS_ATTR_QUERY_MR_RESP_LKEY,
272 UVERBS_ATTR_QUERY_MR_RESP_RKEY,
273 UVERBS_ATTR_QUERY_MR_RESP_LENGTH,
274 UVERBS_ATTR_QUERY_MR_RESP_IOVA,
275};
276
277enum uverbs_attrs_reg_dmabuf_mr_cmd_attr_ids {
278 UVERBS_ATTR_REG_DMABUF_MR_HANDLE,
279 UVERBS_ATTR_REG_DMABUF_MR_PD_HANDLE,
280 UVERBS_ATTR_REG_DMABUF_MR_OFFSET,
281 UVERBS_ATTR_REG_DMABUF_MR_LENGTH,
282 UVERBS_ATTR_REG_DMABUF_MR_IOVA,
283 UVERBS_ATTR_REG_DMABUF_MR_FD,
284 UVERBS_ATTR_REG_DMABUF_MR_ACCESS_FLAGS,
285 UVERBS_ATTR_REG_DMABUF_MR_RESP_LKEY,
286 UVERBS_ATTR_REG_DMABUF_MR_RESP_RKEY,
287};
288
289enum uverbs_attrs_create_counters_cmd_attr_ids {
290 UVERBS_ATTR_CREATE_COUNTERS_HANDLE,
291};
292
293enum uverbs_attrs_destroy_counters_cmd_attr_ids {
294 UVERBS_ATTR_DESTROY_COUNTERS_HANDLE,
295};
296
297enum uverbs_attrs_read_counters_cmd_attr_ids {
298 UVERBS_ATTR_READ_COUNTERS_HANDLE,
299 UVERBS_ATTR_READ_COUNTERS_BUFF,
300 UVERBS_ATTR_READ_COUNTERS_FLAGS,
301};
302
303enum uverbs_methods_actions_counters_ops {
304 UVERBS_METHOD_COUNTERS_CREATE,
305 UVERBS_METHOD_COUNTERS_DESTROY,
306 UVERBS_METHOD_COUNTERS_READ,
307};
308
309enum uverbs_attrs_info_handles_id {
310 UVERBS_ATTR_INFO_OBJECT_ID,
311 UVERBS_ATTR_INFO_TOTAL_HANDLES,
312 UVERBS_ATTR_INFO_HANDLES_LIST,
313};
314
315enum uverbs_methods_pd {
316 UVERBS_METHOD_PD_DESTROY,
317};
318
319enum uverbs_attrs_pd_destroy_ids {
320 UVERBS_ATTR_DESTROY_PD_HANDLE,
321};
322
323enum uverbs_methods_mw {
324 UVERBS_METHOD_MW_DESTROY,
325};
326
327enum uverbs_attrs_mw_destroy_ids {
328 UVERBS_ATTR_DESTROY_MW_HANDLE,
329};
330
331enum uverbs_methods_xrcd {
332 UVERBS_METHOD_XRCD_DESTROY,
333};
334
335enum uverbs_attrs_xrcd_destroy_ids {
336 UVERBS_ATTR_DESTROY_XRCD_HANDLE,
337};
338
339enum uverbs_methods_ah {
340 UVERBS_METHOD_AH_DESTROY,
341};
342
343enum uverbs_attrs_ah_destroy_ids {
344 UVERBS_ATTR_DESTROY_AH_HANDLE,
345};
346
347enum uverbs_methods_rwq_ind_tbl {
348 UVERBS_METHOD_RWQ_IND_TBL_DESTROY,
349};
350
351enum uverbs_attrs_rwq_ind_tbl_destroy_ids {
352 UVERBS_ATTR_DESTROY_RWQ_IND_TBL_HANDLE,
353};
354
355enum uverbs_methods_flow {
356 UVERBS_METHOD_FLOW_DESTROY,
357};
358
359enum uverbs_attrs_flow_destroy_ids {
360 UVERBS_ATTR_DESTROY_FLOW_HANDLE,
361};
362
363enum uverbs_method_async_event {
364 UVERBS_METHOD_ASYNC_EVENT_ALLOC,
365};
366
367enum uverbs_attrs_async_event_create {
368 UVERBS_ATTR_ASYNC_EVENT_ALLOC_FD_HANDLE,
369};
370
371enum uverbs_attrs_query_gid_table_cmd_attr_ids {
372 UVERBS_ATTR_QUERY_GID_TABLE_ENTRY_SIZE,
373 UVERBS_ATTR_QUERY_GID_TABLE_FLAGS,
374 UVERBS_ATTR_QUERY_GID_TABLE_RESP_ENTRIES,
375 UVERBS_ATTR_QUERY_GID_TABLE_RESP_NUM_ENTRIES,
376};
377
378enum uverbs_attrs_query_gid_entry_cmd_attr_ids {
379 UVERBS_ATTR_QUERY_GID_ENTRY_PORT,
380 UVERBS_ATTR_QUERY_GID_ENTRY_GID_INDEX,
381 UVERBS_ATTR_QUERY_GID_ENTRY_FLAGS,
382 UVERBS_ATTR_QUERY_GID_ENTRY_RESP_ENTRY,
383};
384
385#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_verbs.h created+269
...@@ -0,0 +1,269 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef IB_USER_IOCTL_VERBS_H
35#define IB_USER_IOCTL_VERBS_H
36
37#include <linux/types.h>
38#include <rdma/ib_user_verbs.h>
39
40#ifndef RDMA_UAPI_PTR
41#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
42#endif
43
44#define IB_UVERBS_ACCESS_OPTIONAL_FIRST (1 << 20)
45#define IB_UVERBS_ACCESS_OPTIONAL_LAST (1 << 29)
46
47enum ib_uverbs_core_support {
48 IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS = 1 << 0,
49};
50
51enum ib_uverbs_access_flags {
52 IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,
53 IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,
54 IB_UVERBS_ACCESS_REMOTE_READ = 1 << 2,
55 IB_UVERBS_ACCESS_REMOTE_ATOMIC = 1 << 3,
56 IB_UVERBS_ACCESS_MW_BIND = 1 << 4,
57 IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
58 IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
59 IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
60
61 IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,
62 IB_UVERBS_ACCESS_OPTIONAL_RANGE =
63 ((IB_UVERBS_ACCESS_OPTIONAL_LAST << 1) - 1) &
64 ~(IB_UVERBS_ACCESS_OPTIONAL_FIRST - 1)
65};
66
67enum ib_uverbs_srq_type {
68 IB_UVERBS_SRQT_BASIC,
69 IB_UVERBS_SRQT_XRC,
70 IB_UVERBS_SRQT_TM,
71};
72
73enum ib_uverbs_wq_type {
74 IB_UVERBS_WQT_RQ,
75};
76
77enum ib_uverbs_wq_flags {
78 IB_UVERBS_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0,
79 IB_UVERBS_WQ_FLAGS_SCATTER_FCS = 1 << 1,
80 IB_UVERBS_WQ_FLAGS_DELAY_DROP = 1 << 2,
81 IB_UVERBS_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3,
82};
83
84enum ib_uverbs_qp_type {
85 IB_UVERBS_QPT_RC = 2,
86 IB_UVERBS_QPT_UC,
87 IB_UVERBS_QPT_UD,
88 IB_UVERBS_QPT_RAW_PACKET = 8,
89 IB_UVERBS_QPT_XRC_INI,
90 IB_UVERBS_QPT_XRC_TGT,
91 IB_UVERBS_QPT_DRIVER = 0xFF,
92};
93
94enum ib_uverbs_qp_create_flags {
95 IB_UVERBS_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1,
96 IB_UVERBS_QP_CREATE_SCATTER_FCS = 1 << 8,
97 IB_UVERBS_QP_CREATE_CVLAN_STRIPPING = 1 << 9,
98 IB_UVERBS_QP_CREATE_PCI_WRITE_END_PADDING = 1 << 11,
99 IB_UVERBS_QP_CREATE_SQ_SIG_ALL = 1 << 12,
100};
101
102enum ib_uverbs_query_port_cap_flags {
103 IB_UVERBS_PCF_SM = 1 << 1,
104 IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,
105 IB_UVERBS_PCF_TRAP_SUP = 1 << 3,
106 IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,
107 IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,
108 IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,
109 IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,
110 IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,
111 IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,
112 IB_UVERBS_PCF_SM_DISABLED = 1 << 10,
113 IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,
114 IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
115 IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,
116 IB_UVERBS_PCF_CM_SUP = 1 << 16,
117 IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,
118 IB_UVERBS_PCF_REINIT_SUP = 1 << 18,
119 IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,
120 IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,
121 IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,
122 IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,
123 IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,
124 IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,
125 IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,
126 /*
127 * IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and
128 * is inaccessible
129 */
130 IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,
131 IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,
132 IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,
133 IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,
134 IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,
135
136 /* NOTE this is an internal flag, not an IBA flag */
137 IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,
138};
139
140enum ib_uverbs_query_port_flags {
141 IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,
142};
143
144enum ib_uverbs_flow_action_esp_keymat {
145 IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
146};
147
148enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {
149 IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,
150};
151
152struct ib_uverbs_flow_action_esp_keymat_aes_gcm {
153 __aligned_u64 iv;
154 __u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */
155
156 __u32 salt;
157 __u32 icv_len;
158
159 __u32 key_len;
160 __u32 aes_key[256 / 32];
161};
162
163enum ib_uverbs_flow_action_esp_replay {
164 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,
165 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,
166};
167
168struct ib_uverbs_flow_action_esp_replay_bmp {
169 __u32 size;
170};
171
172enum ib_uverbs_flow_action_esp_flags {
173 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */
174 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,
175
176 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */
177 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,
178
179 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */
180 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,
181
182 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,
183};
184
185struct ib_uverbs_flow_action_esp_encap {
186 /* This struct represents a list of pointers to flow_xxxx_filter that
187 * encapsulates the payload in ESP tunnel mode.
188 */
189 RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */
190 RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);
191 __u16 len; /* Len of the filter struct val_ptr points to */
192 __u16 type; /* Use flow_spec_type enum */
193};
194
195struct ib_uverbs_flow_action_esp {
196 __u32 spi;
197 __u32 seq;
198 __u32 tfc_pad;
199 __u32 flags;
200 __aligned_u64 hard_limit_pkts;
201};
202
203enum ib_uverbs_read_counters_flags {
204 /* prefer read values from driver cache */
205 IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,
206};
207
208enum ib_uverbs_advise_mr_advice {
209 IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH,
210 IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,
211 IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_NO_FAULT,
212};
213
214enum ib_uverbs_advise_mr_flag {
215 IB_UVERBS_ADVISE_MR_FLAG_FLUSH = 1 << 0,
216};
217
218struct ib_uverbs_query_port_resp_ex {
219 struct ib_uverbs_query_port_resp legacy_resp;
220 __u16 port_cap_flags2;
221 __u8 reserved[6];
222};
223
224struct ib_uverbs_qp_cap {
225 __u32 max_send_wr;
226 __u32 max_recv_wr;
227 __u32 max_send_sge;
228 __u32 max_recv_sge;
229 __u32 max_inline_data;
230};
231
232enum rdma_driver_id {
233 RDMA_DRIVER_UNKNOWN,
234 RDMA_DRIVER_MLX5,
235 RDMA_DRIVER_MLX4,
236 RDMA_DRIVER_CXGB3,
237 RDMA_DRIVER_CXGB4,
238 RDMA_DRIVER_MTHCA,
239 RDMA_DRIVER_BNXT_RE,
240 RDMA_DRIVER_OCRDMA,
241 RDMA_DRIVER_NES,
242 RDMA_DRIVER_I40IW,
243 RDMA_DRIVER_IRDMA = RDMA_DRIVER_I40IW,
244 RDMA_DRIVER_VMW_PVRDMA,
245 RDMA_DRIVER_QEDR,
246 RDMA_DRIVER_HNS,
247 RDMA_DRIVER_USNIC,
248 RDMA_DRIVER_RXE,
249 RDMA_DRIVER_HFI1,
250 RDMA_DRIVER_QIB,
251 RDMA_DRIVER_EFA,
252 RDMA_DRIVER_SIW,
253};
254
255enum ib_uverbs_gid_type {
256 IB_UVERBS_GID_TYPE_IB,
257 IB_UVERBS_GID_TYPE_ROCE_V1,
258 IB_UVERBS_GID_TYPE_ROCE_V2,
259};
260
261struct ib_uverbs_gid_entry {
262 __aligned_u64 gid[2];
263 __u32 gid_index;
264 __u32 port_num;
265 __u32 gid_type;
266 __u32 netdev_ifindex; /* It is 0 if there is no netdev associated with it */
267};
268
269#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_mad.h created+234
...@@ -0,0 +1,234 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2004 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef IB_USER_MAD_H
36#define IB_USER_MAD_H
37
38#include <linux/types.h>
39#include <rdma/rdma_user_ioctl.h>
40
41/*
42 * Increment this value if any changes that break userspace ABI
43 * compatibility are made.
44 */
45#define IB_USER_MAD_ABI_VERSION 5
46
47/*
48 * Make sure that all structs defined in this file remain laid out so
49 * that they pack the same way on 32-bit and 64-bit architectures (to
50 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
51 */
52
53/**
54 * ib_user_mad_hdr_old - Old version of MAD packet header without pkey_index
55 * @id - ID of agent MAD received with/to be sent with
56 * @status - 0 on successful receive, ETIMEDOUT if no response
57 * received (transaction ID in data[] will be set to TID of original
58 * request) (ignored on send)
59 * @timeout_ms - Milliseconds to wait for response (unset on receive)
60 * @retries - Number of automatic retries to attempt
61 * @qpn - Remote QP number received from/to be sent to
62 * @qkey - Remote Q_Key to be sent with (unset on receive)
63 * @lid - Remote lid received from/to be sent to
64 * @sl - Service level received with/to be sent with
65 * @path_bits - Local path bits received with/to be sent with
66 * @grh_present - If set, GRH was received/should be sent
67 * @gid_index - Local GID index to send with (unset on receive)
68 * @hop_limit - Hop limit in GRH
69 * @traffic_class - Traffic class in GRH
70 * @gid - Remote GID in GRH
71 * @flow_label - Flow label in GRH
72 */
73struct ib_user_mad_hdr_old {
74 __u32 id;
75 __u32 status;
76 __u32 timeout_ms;
77 __u32 retries;
78 __u32 length;
79 __be32 qpn;
80 __be32 qkey;
81 __be16 lid;
82 __u8 sl;
83 __u8 path_bits;
84 __u8 grh_present;
85 __u8 gid_index;
86 __u8 hop_limit;
87 __u8 traffic_class;
88 __u8 gid[16];
89 __be32 flow_label;
90};
91
92/**
93 * ib_user_mad_hdr - MAD packet header
94 * This layout allows specifying/receiving the P_Key index. To use
95 * this capability, an application must call the
96 * IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before
97 * any other actions with the file handle.
98 * @id - ID of agent MAD received with/to be sent with
99 * @status - 0 on successful receive, ETIMEDOUT if no response
100 * received (transaction ID in data[] will be set to TID of original
101 * request) (ignored on send)
102 * @timeout_ms - Milliseconds to wait for response (unset on receive)
103 * @retries - Number of automatic retries to attempt
104 * @qpn - Remote QP number received from/to be sent to
105 * @qkey - Remote Q_Key to be sent with (unset on receive)
106 * @lid - Remote lid received from/to be sent to
107 * @sl - Service level received with/to be sent with
108 * @path_bits - Local path bits received with/to be sent with
109 * @grh_present - If set, GRH was received/should be sent
110 * @gid_index - Local GID index to send with (unset on receive)
111 * @hop_limit - Hop limit in GRH
112 * @traffic_class - Traffic class in GRH
113 * @gid - Remote GID in GRH
114 * @flow_label - Flow label in GRH
115 * @pkey_index - P_Key index
116 */
117struct ib_user_mad_hdr {
118 __u32 id;
119 __u32 status;
120 __u32 timeout_ms;
121 __u32 retries;
122 __u32 length;
123 __be32 qpn;
124 __be32 qkey;
125 __be16 lid;
126 __u8 sl;
127 __u8 path_bits;
128 __u8 grh_present;
129 __u8 gid_index;
130 __u8 hop_limit;
131 __u8 traffic_class;
132 __u8 gid[16];
133 __be32 flow_label;
134 __u16 pkey_index;
135 __u8 reserved[6];
136};
137
138/**
139 * ib_user_mad - MAD packet
140 * @hdr - MAD packet header
141 * @data - Contents of MAD
142 *
143 */
144struct ib_user_mad {
145 struct ib_user_mad_hdr hdr;
146 __aligned_u64 data[];
147};
148
149/*
150 * Earlier versions of this interface definition declared the
151 * method_mask[] member as an array of __u32 but treated it as a
152 * bitmap made up of longs in the kernel. This ambiguity meant that
153 * 32-bit big-endian applications that can run on both 32-bit and
154 * 64-bit kernels had no consistent ABI to rely on, and 64-bit
155 * big-endian applications that treated method_mask as being made up
156 * of 32-bit words would have their bitmap misinterpreted.
157 *
158 * To clear up this confusion, we change the declaration of
159 * method_mask[] to use unsigned long and handle the conversion from
160 * 32-bit userspace to 64-bit kernel for big-endian systems in the
161 * compat_ioctl method. Unfortunately, to keep the structure layout
162 * the same, we need the method_mask[] array to be aligned only to 4
163 * bytes even when long is 64 bits, which forces us into this ugly
164 * typedef.
165 */
166typedef unsigned long __attribute__((aligned(4))) packed_ulong;
167#define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof (long)))
168
169/**
170 * ib_user_mad_reg_req - MAD registration request
171 * @id - Set by the kernel; used to identify agent in future requests.
172 * @qpn - Queue pair number; must be 0 or 1.
173 * @method_mask - The caller will receive unsolicited MADs for any method
174 * where @method_mask = 1.
175 * @mgmt_class - Indicates which management class of MADs should be receive
176 * by the caller. This field is only required if the user wishes to
177 * receive unsolicited MADs, otherwise it should be 0.
178 * @mgmt_class_version - Indicates which version of MADs for the given
179 * management class to receive.
180 * @oui: Indicates IEEE OUI when mgmt_class is a vendor class
181 * in the range from 0x30 to 0x4f. Otherwise not used.
182 * @rmpp_version: If set, indicates the RMPP version used.
183 *
184 */
185struct ib_user_mad_reg_req {
186 __u32 id;
187 packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK];
188 __u8 qpn;
189 __u8 mgmt_class;
190 __u8 mgmt_class_version;
191 __u8 oui[3];
192 __u8 rmpp_version;
193};
194
195/**
196 * ib_user_mad_reg_req2 - MAD registration request
197 *
198 * @id - Set by the _kernel_; used by userspace to identify the
199 * registered agent in future requests.
200 * @qpn - Queue pair number; must be 0 or 1.
201 * @mgmt_class - Indicates which management class of MADs should be
202 * receive by the caller. This field is only required if
203 * the user wishes to receive unsolicited MADs, otherwise
204 * it should be 0.
205 * @mgmt_class_version - Indicates which version of MADs for the given
206 * management class to receive.
207 * @res - Ignored.
208 * @flags - additional registration flags; Must be in the set of
209 * flags defined in IB_USER_MAD_REG_FLAGS_CAP
210 * @method_mask - The caller wishes to receive unsolicited MADs for the
211 * methods whose bit(s) is(are) set.
212 * @oui - Indicates IEEE OUI to use when mgmt_class is a vendor
213 * class in the range from 0x30 to 0x4f. Otherwise not
214 * used.
215 * @rmpp_version - If set, indicates the RMPP version to use.
216 */
217enum {
218 IB_USER_MAD_USER_RMPP = (1 << 0),
219};
220#define IB_USER_MAD_REG_FLAGS_CAP (IB_USER_MAD_USER_RMPP)
221struct ib_user_mad_reg_req2 {
222 __u32 id;
223 __u32 qpn;
224 __u8 mgmt_class;
225 __u8 mgmt_class_version;
226 __u16 res;
227 __u32 flags;
228 __aligned_u64 method_mask[2];
229 __u32 oui;
230 __u8 rmpp_version;
231 __u8 reserved[3];
232};
233
234#endif /* IB_USER_MAD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_sa.h created+77
...@@ -0,0 +1,77 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef IB_USER_SA_H
35#define IB_USER_SA_H
36
37#include <linux/types.h>
38
39enum {
40 IB_PATH_GMP = 1,
41 IB_PATH_PRIMARY = (1<<1),
42 IB_PATH_ALTERNATE = (1<<2),
43 IB_PATH_OUTBOUND = (1<<3),
44 IB_PATH_INBOUND = (1<<4),
45 IB_PATH_INBOUND_REVERSE = (1<<5),
46 IB_PATH_BIDIRECTIONAL = IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE
47};
48
49struct ib_path_rec_data {
50 __u32 flags;
51 __u32 reserved;
52 __u32 path_rec[16];
53};
54
55struct ib_user_path_rec {
56 __u8 dgid[16];
57 __u8 sgid[16];
58 __be16 dlid;
59 __be16 slid;
60 __u32 raw_traffic;
61 __be32 flow_label;
62 __u32 reversible;
63 __u32 mtu;
64 __be16 pkey;
65 __u8 hop_limit;
66 __u8 traffic_class;
67 __u8 numb_path;
68 __u8 sl;
69 __u8 mtu_selector;
70 __u8 rate_selector;
71 __u8 rate;
72 __u8 packet_life_time_selector;
73 __u8 packet_life_time;
74 __u8 preference;
75};
76
77#endif /* IB_USER_SA_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_verbs.h created+1301
...@@ -0,0 +1,1301 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
5 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
6 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
7 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * OpenIB.org BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or
15 * without modification, are permitted provided that the following
16 * conditions are met:
17 *
18 * - Redistributions of source code must retain the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer.
21 *
22 * - Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimer in the documentation and/or other materials
25 * provided with the distribution.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
31 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
32 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 * SOFTWARE.
35 */
36
37#ifndef IB_USER_VERBS_H
38#define IB_USER_VERBS_H
39
40#include <linux/types.h>
41
42/*
43 * Increment this value if any changes that break userspace ABI
44 * compatibility are made.
45 */
46#define IB_USER_VERBS_ABI_VERSION 6
47#define IB_USER_VERBS_CMD_THRESHOLD 50
48
49enum ib_uverbs_write_cmds {
50 IB_USER_VERBS_CMD_GET_CONTEXT,
51 IB_USER_VERBS_CMD_QUERY_DEVICE,
52 IB_USER_VERBS_CMD_QUERY_PORT,
53 IB_USER_VERBS_CMD_ALLOC_PD,
54 IB_USER_VERBS_CMD_DEALLOC_PD,
55 IB_USER_VERBS_CMD_CREATE_AH,
56 IB_USER_VERBS_CMD_MODIFY_AH,
57 IB_USER_VERBS_CMD_QUERY_AH,
58 IB_USER_VERBS_CMD_DESTROY_AH,
59 IB_USER_VERBS_CMD_REG_MR,
60 IB_USER_VERBS_CMD_REG_SMR,
61 IB_USER_VERBS_CMD_REREG_MR,
62 IB_USER_VERBS_CMD_QUERY_MR,
63 IB_USER_VERBS_CMD_DEREG_MR,
64 IB_USER_VERBS_CMD_ALLOC_MW,
65 IB_USER_VERBS_CMD_BIND_MW,
66 IB_USER_VERBS_CMD_DEALLOC_MW,
67 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
68 IB_USER_VERBS_CMD_CREATE_CQ,
69 IB_USER_VERBS_CMD_RESIZE_CQ,
70 IB_USER_VERBS_CMD_DESTROY_CQ,
71 IB_USER_VERBS_CMD_POLL_CQ,
72 IB_USER_VERBS_CMD_PEEK_CQ,
73 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
74 IB_USER_VERBS_CMD_CREATE_QP,
75 IB_USER_VERBS_CMD_QUERY_QP,
76 IB_USER_VERBS_CMD_MODIFY_QP,
77 IB_USER_VERBS_CMD_DESTROY_QP,
78 IB_USER_VERBS_CMD_POST_SEND,
79 IB_USER_VERBS_CMD_POST_RECV,
80 IB_USER_VERBS_CMD_ATTACH_MCAST,
81 IB_USER_VERBS_CMD_DETACH_MCAST,
82 IB_USER_VERBS_CMD_CREATE_SRQ,
83 IB_USER_VERBS_CMD_MODIFY_SRQ,
84 IB_USER_VERBS_CMD_QUERY_SRQ,
85 IB_USER_VERBS_CMD_DESTROY_SRQ,
86 IB_USER_VERBS_CMD_POST_SRQ_RECV,
87 IB_USER_VERBS_CMD_OPEN_XRCD,
88 IB_USER_VERBS_CMD_CLOSE_XRCD,
89 IB_USER_VERBS_CMD_CREATE_XSRQ,
90 IB_USER_VERBS_CMD_OPEN_QP,
91};
92
93enum {
94 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
95 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
96 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
97 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
98 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
99 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
100 IB_USER_VERBS_EX_CMD_CREATE_WQ,
101 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
102 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
103 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
104 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
106};
107
108/*
109 * Make sure that all structs defined in this file remain laid out so
110 * that they pack the same way on 32-bit and 64-bit architectures (to
111 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
112 * Specifically:
113 * - Do not use pointer types -- pass pointers in __u64 instead.
114 * - Make sure that any structure larger than 4 bytes is padded to a
115 * multiple of 8 bytes. Otherwise the structure size will be
116 * different between 32-bit and 64-bit architectures.
117 */
118
119struct ib_uverbs_async_event_desc {
120 __aligned_u64 element;
121 __u32 event_type; /* enum ib_event_type */
122 __u32 reserved;
123};
124
125struct ib_uverbs_comp_event_desc {
126 __aligned_u64 cq_handle;
127};
128
129struct ib_uverbs_cq_moderation_caps {
130 __u16 max_cq_moderation_count;
131 __u16 max_cq_moderation_period;
132 __u32 reserved;
133};
134
135/*
136 * All commands from userspace should start with a __u32 command field
137 * followed by __u16 in_words and out_words fields (which give the
138 * length of the command block and response buffer if any in 32-bit
139 * words). The kernel driver will read these fields first and read
140 * the rest of the command struct based on these value.
141 */
142
143#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
144#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
145
146struct ib_uverbs_cmd_hdr {
147 __u32 command;
148 __u16 in_words;
149 __u16 out_words;
150};
151
152struct ib_uverbs_ex_cmd_hdr {
153 __aligned_u64 response;
154 __u16 provider_in_words;
155 __u16 provider_out_words;
156 __u32 cmd_hdr_reserved;
157};
158
159struct ib_uverbs_get_context {
160 __aligned_u64 response;
161 __aligned_u64 driver_data[0];
162};
163
164struct ib_uverbs_get_context_resp {
165 __u32 async_fd;
166 __u32 num_comp_vectors;
167 __aligned_u64 driver_data[0];
168};
169
170struct ib_uverbs_query_device {
171 __aligned_u64 response;
172 __aligned_u64 driver_data[0];
173};
174
175struct ib_uverbs_query_device_resp {
176 __aligned_u64 fw_ver;
177 __be64 node_guid;
178 __be64 sys_image_guid;
179 __aligned_u64 max_mr_size;
180 __aligned_u64 page_size_cap;
181 __u32 vendor_id;
182 __u32 vendor_part_id;
183 __u32 hw_ver;
184 __u32 max_qp;
185 __u32 max_qp_wr;
186 __u32 device_cap_flags;
187 __u32 max_sge;
188 __u32 max_sge_rd;
189 __u32 max_cq;
190 __u32 max_cqe;
191 __u32 max_mr;
192 __u32 max_pd;
193 __u32 max_qp_rd_atom;
194 __u32 max_ee_rd_atom;
195 __u32 max_res_rd_atom;
196 __u32 max_qp_init_rd_atom;
197 __u32 max_ee_init_rd_atom;
198 __u32 atomic_cap;
199 __u32 max_ee;
200 __u32 max_rdd;
201 __u32 max_mw;
202 __u32 max_raw_ipv6_qp;
203 __u32 max_raw_ethy_qp;
204 __u32 max_mcast_grp;
205 __u32 max_mcast_qp_attach;
206 __u32 max_total_mcast_qp_attach;
207 __u32 max_ah;
208 __u32 max_fmr;
209 __u32 max_map_per_fmr;
210 __u32 max_srq;
211 __u32 max_srq_wr;
212 __u32 max_srq_sge;
213 __u16 max_pkeys;
214 __u8 local_ca_ack_delay;
215 __u8 phys_port_cnt;
216 __u8 reserved[4];
217};
218
219struct ib_uverbs_ex_query_device {
220 __u32 comp_mask;
221 __u32 reserved;
222};
223
224struct ib_uverbs_odp_caps {
225 __aligned_u64 general_caps;
226 struct {
227 __u32 rc_odp_caps;
228 __u32 uc_odp_caps;
229 __u32 ud_odp_caps;
230 } per_transport_caps;
231 __u32 reserved;
232};
233
234struct ib_uverbs_rss_caps {
235 /* Corresponding bit will be set if qp type from
236 * 'enum ib_qp_type' is supported, e.g.
237 * supported_qpts |= 1 << IB_QPT_UD
238 */
239 __u32 supported_qpts;
240 __u32 max_rwq_indirection_tables;
241 __u32 max_rwq_indirection_table_size;
242 __u32 reserved;
243};
244
245struct ib_uverbs_tm_caps {
246 /* Max size of rendezvous request message */
247 __u32 max_rndv_hdr_size;
248 /* Max number of entries in tag matching list */
249 __u32 max_num_tags;
250 /* TM flags */
251 __u32 flags;
252 /* Max number of outstanding list operations */
253 __u32 max_ops;
254 /* Max number of SGE in tag matching entry */
255 __u32 max_sge;
256 __u32 reserved;
257};
258
259struct ib_uverbs_ex_query_device_resp {
260 struct ib_uverbs_query_device_resp base;
261 __u32 comp_mask;
262 __u32 response_length;
263 struct ib_uverbs_odp_caps odp_caps;
264 __aligned_u64 timestamp_mask;
265 __aligned_u64 hca_core_clock; /* in KHZ */
266 __aligned_u64 device_cap_flags_ex;
267 struct ib_uverbs_rss_caps rss_caps;
268 __u32 max_wq_type_rq;
269 __u32 raw_packet_caps;
270 struct ib_uverbs_tm_caps tm_caps;
271 struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
272 __aligned_u64 max_dm_size;
273 __u32 xrc_odp_caps;
274 __u32 reserved;
275};
276
277struct ib_uverbs_query_port {
278 __aligned_u64 response;
279 __u8 port_num;
280 __u8 reserved[7];
281 __aligned_u64 driver_data[0];
282};
283
284struct ib_uverbs_query_port_resp {
285 __u32 port_cap_flags; /* see ib_uverbs_query_port_cap_flags */
286 __u32 max_msg_sz;
287 __u32 bad_pkey_cntr;
288 __u32 qkey_viol_cntr;
289 __u32 gid_tbl_len;
290 __u16 pkey_tbl_len;
291 __u16 lid;
292 __u16 sm_lid;
293 __u8 state;
294 __u8 max_mtu;
295 __u8 active_mtu;
296 __u8 lmc;
297 __u8 max_vl_num;
298 __u8 sm_sl;
299 __u8 subnet_timeout;
300 __u8 init_type_reply;
301 __u8 active_width;
302 __u8 active_speed;
303 __u8 phys_state;
304 __u8 link_layer;
305 __u8 flags; /* see ib_uverbs_query_port_flags */
306 __u8 reserved;
307};
308
309struct ib_uverbs_alloc_pd {
310 __aligned_u64 response;
311 __aligned_u64 driver_data[0];
312};
313
314struct ib_uverbs_alloc_pd_resp {
315 __u32 pd_handle;
316 __u32 driver_data[0];
317};
318
319struct ib_uverbs_dealloc_pd {
320 __u32 pd_handle;
321};
322
323struct ib_uverbs_open_xrcd {
324 __aligned_u64 response;
325 __u32 fd;
326 __u32 oflags;
327 __aligned_u64 driver_data[0];
328};
329
330struct ib_uverbs_open_xrcd_resp {
331 __u32 xrcd_handle;
332 __u32 driver_data[0];
333};
334
335struct ib_uverbs_close_xrcd {
336 __u32 xrcd_handle;
337};
338
339struct ib_uverbs_reg_mr {
340 __aligned_u64 response;
341 __aligned_u64 start;
342 __aligned_u64 length;
343 __aligned_u64 hca_va;
344 __u32 pd_handle;
345 __u32 access_flags;
346 __aligned_u64 driver_data[0];
347};
348
349struct ib_uverbs_reg_mr_resp {
350 __u32 mr_handle;
351 __u32 lkey;
352 __u32 rkey;
353 __u32 driver_data[0];
354};
355
356struct ib_uverbs_rereg_mr {
357 __aligned_u64 response;
358 __u32 mr_handle;
359 __u32 flags;
360 __aligned_u64 start;
361 __aligned_u64 length;
362 __aligned_u64 hca_va;
363 __u32 pd_handle;
364 __u32 access_flags;
365 __aligned_u64 driver_data[0];
366};
367
368struct ib_uverbs_rereg_mr_resp {
369 __u32 lkey;
370 __u32 rkey;
371 __aligned_u64 driver_data[0];
372};
373
374struct ib_uverbs_dereg_mr {
375 __u32 mr_handle;
376};
377
378struct ib_uverbs_alloc_mw {
379 __aligned_u64 response;
380 __u32 pd_handle;
381 __u8 mw_type;
382 __u8 reserved[3];
383 __aligned_u64 driver_data[0];
384};
385
386struct ib_uverbs_alloc_mw_resp {
387 __u32 mw_handle;
388 __u32 rkey;
389 __aligned_u64 driver_data[0];
390};
391
392struct ib_uverbs_dealloc_mw {
393 __u32 mw_handle;
394};
395
396struct ib_uverbs_create_comp_channel {
397 __aligned_u64 response;
398};
399
400struct ib_uverbs_create_comp_channel_resp {
401 __u32 fd;
402};
403
404struct ib_uverbs_create_cq {
405 __aligned_u64 response;
406 __aligned_u64 user_handle;
407 __u32 cqe;
408 __u32 comp_vector;
409 __s32 comp_channel;
410 __u32 reserved;
411 __aligned_u64 driver_data[0];
412};
413
414enum ib_uverbs_ex_create_cq_flags {
415 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
416 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
417};
418
419struct ib_uverbs_ex_create_cq {
420 __aligned_u64 user_handle;
421 __u32 cqe;
422 __u32 comp_vector;
423 __s32 comp_channel;
424 __u32 comp_mask;
425 __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
426 __u32 reserved;
427};
428
429struct ib_uverbs_create_cq_resp {
430 __u32 cq_handle;
431 __u32 cqe;
432 __aligned_u64 driver_data[0];
433};
434
435struct ib_uverbs_ex_create_cq_resp {
436 struct ib_uverbs_create_cq_resp base;
437 __u32 comp_mask;
438 __u32 response_length;
439};
440
441struct ib_uverbs_resize_cq {
442 __aligned_u64 response;
443 __u32 cq_handle;
444 __u32 cqe;
445 __aligned_u64 driver_data[0];
446};
447
448struct ib_uverbs_resize_cq_resp {
449 __u32 cqe;
450 __u32 reserved;
451 __aligned_u64 driver_data[0];
452};
453
454struct ib_uverbs_poll_cq {
455 __aligned_u64 response;
456 __u32 cq_handle;
457 __u32 ne;
458};
459
460enum ib_uverbs_wc_opcode {
461 IB_UVERBS_WC_SEND = 0,
462 IB_UVERBS_WC_RDMA_WRITE = 1,
463 IB_UVERBS_WC_RDMA_READ = 2,
464 IB_UVERBS_WC_COMP_SWAP = 3,
465 IB_UVERBS_WC_FETCH_ADD = 4,
466 IB_UVERBS_WC_BIND_MW = 5,
467 IB_UVERBS_WC_LOCAL_INV = 6,
468 IB_UVERBS_WC_TSO = 7,
469};
470
471struct ib_uverbs_wc {
472 __aligned_u64 wr_id;
473 __u32 status;
474 __u32 opcode;
475 __u32 vendor_err;
476 __u32 byte_len;
477 union {
478 __be32 imm_data;
479 __u32 invalidate_rkey;
480 } ex;
481 __u32 qp_num;
482 __u32 src_qp;
483 __u32 wc_flags;
484 __u16 pkey_index;
485 __u16 slid;
486 __u8 sl;
487 __u8 dlid_path_bits;
488 __u8 port_num;
489 __u8 reserved;
490};
491
492struct ib_uverbs_poll_cq_resp {
493 __u32 count;
494 __u32 reserved;
495 struct ib_uverbs_wc wc[0];
496};
497
498struct ib_uverbs_req_notify_cq {
499 __u32 cq_handle;
500 __u32 solicited_only;
501};
502
503struct ib_uverbs_destroy_cq {
504 __aligned_u64 response;
505 __u32 cq_handle;
506 __u32 reserved;
507};
508
509struct ib_uverbs_destroy_cq_resp {
510 __u32 comp_events_reported;
511 __u32 async_events_reported;
512};
513
514struct ib_uverbs_global_route {
515 __u8 dgid[16];
516 __u32 flow_label;
517 __u8 sgid_index;
518 __u8 hop_limit;
519 __u8 traffic_class;
520 __u8 reserved;
521};
522
523struct ib_uverbs_ah_attr {
524 struct ib_uverbs_global_route grh;
525 __u16 dlid;
526 __u8 sl;
527 __u8 src_path_bits;
528 __u8 static_rate;
529 __u8 is_global;
530 __u8 port_num;
531 __u8 reserved;
532};
533
534struct ib_uverbs_qp_attr {
535 __u32 qp_attr_mask;
536 __u32 qp_state;
537 __u32 cur_qp_state;
538 __u32 path_mtu;
539 __u32 path_mig_state;
540 __u32 qkey;
541 __u32 rq_psn;
542 __u32 sq_psn;
543 __u32 dest_qp_num;
544 __u32 qp_access_flags;
545
546 struct ib_uverbs_ah_attr ah_attr;
547 struct ib_uverbs_ah_attr alt_ah_attr;
548
549 /* ib_qp_cap */
550 __u32 max_send_wr;
551 __u32 max_recv_wr;
552 __u32 max_send_sge;
553 __u32 max_recv_sge;
554 __u32 max_inline_data;
555
556 __u16 pkey_index;
557 __u16 alt_pkey_index;
558 __u8 en_sqd_async_notify;
559 __u8 sq_draining;
560 __u8 max_rd_atomic;
561 __u8 max_dest_rd_atomic;
562 __u8 min_rnr_timer;
563 __u8 port_num;
564 __u8 timeout;
565 __u8 retry_cnt;
566 __u8 rnr_retry;
567 __u8 alt_port_num;
568 __u8 alt_timeout;
569 __u8 reserved[5];
570};
571
572struct ib_uverbs_create_qp {
573 __aligned_u64 response;
574 __aligned_u64 user_handle;
575 __u32 pd_handle;
576 __u32 send_cq_handle;
577 __u32 recv_cq_handle;
578 __u32 srq_handle;
579 __u32 max_send_wr;
580 __u32 max_recv_wr;
581 __u32 max_send_sge;
582 __u32 max_recv_sge;
583 __u32 max_inline_data;
584 __u8 sq_sig_all;
585 __u8 qp_type;
586 __u8 is_srq;
587 __u8 reserved;
588 __aligned_u64 driver_data[0];
589};
590
591enum ib_uverbs_create_qp_mask {
592 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
593};
594
595enum {
596 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
597};
598
599struct ib_uverbs_ex_create_qp {
600 __aligned_u64 user_handle;
601 __u32 pd_handle;
602 __u32 send_cq_handle;
603 __u32 recv_cq_handle;
604 __u32 srq_handle;
605 __u32 max_send_wr;
606 __u32 max_recv_wr;
607 __u32 max_send_sge;
608 __u32 max_recv_sge;
609 __u32 max_inline_data;
610 __u8 sq_sig_all;
611 __u8 qp_type;
612 __u8 is_srq;
613 __u8 reserved;
614 __u32 comp_mask;
615 __u32 create_flags;
616 __u32 rwq_ind_tbl_handle;
617 __u32 source_qpn;
618};
619
620struct ib_uverbs_open_qp {
621 __aligned_u64 response;
622 __aligned_u64 user_handle;
623 __u32 pd_handle;
624 __u32 qpn;
625 __u8 qp_type;
626 __u8 reserved[7];
627 __aligned_u64 driver_data[0];
628};
629
630/* also used for open response */
631struct ib_uverbs_create_qp_resp {
632 __u32 qp_handle;
633 __u32 qpn;
634 __u32 max_send_wr;
635 __u32 max_recv_wr;
636 __u32 max_send_sge;
637 __u32 max_recv_sge;
638 __u32 max_inline_data;
639 __u32 reserved;
640 __u32 driver_data[0];
641};
642
643struct ib_uverbs_ex_create_qp_resp {
644 struct ib_uverbs_create_qp_resp base;
645 __u32 comp_mask;
646 __u32 response_length;
647};
648
649/*
650 * This struct needs to remain a multiple of 8 bytes to keep the
651 * alignment of the modify QP parameters.
652 */
653struct ib_uverbs_qp_dest {
654 __u8 dgid[16];
655 __u32 flow_label;
656 __u16 dlid;
657 __u16 reserved;
658 __u8 sgid_index;
659 __u8 hop_limit;
660 __u8 traffic_class;
661 __u8 sl;
662 __u8 src_path_bits;
663 __u8 static_rate;
664 __u8 is_global;
665 __u8 port_num;
666};
667
668struct ib_uverbs_query_qp {
669 __aligned_u64 response;
670 __u32 qp_handle;
671 __u32 attr_mask;
672 __aligned_u64 driver_data[0];
673};
674
675struct ib_uverbs_query_qp_resp {
676 struct ib_uverbs_qp_dest dest;
677 struct ib_uverbs_qp_dest alt_dest;
678 __u32 max_send_wr;
679 __u32 max_recv_wr;
680 __u32 max_send_sge;
681 __u32 max_recv_sge;
682 __u32 max_inline_data;
683 __u32 qkey;
684 __u32 rq_psn;
685 __u32 sq_psn;
686 __u32 dest_qp_num;
687 __u32 qp_access_flags;
688 __u16 pkey_index;
689 __u16 alt_pkey_index;
690 __u8 qp_state;
691 __u8 cur_qp_state;
692 __u8 path_mtu;
693 __u8 path_mig_state;
694 __u8 sq_draining;
695 __u8 max_rd_atomic;
696 __u8 max_dest_rd_atomic;
697 __u8 min_rnr_timer;
698 __u8 port_num;
699 __u8 timeout;
700 __u8 retry_cnt;
701 __u8 rnr_retry;
702 __u8 alt_port_num;
703 __u8 alt_timeout;
704 __u8 sq_sig_all;
705 __u8 reserved[5];
706 __aligned_u64 driver_data[0];
707};
708
709struct ib_uverbs_modify_qp {
710 struct ib_uverbs_qp_dest dest;
711 struct ib_uverbs_qp_dest alt_dest;
712 __u32 qp_handle;
713 __u32 attr_mask;
714 __u32 qkey;
715 __u32 rq_psn;
716 __u32 sq_psn;
717 __u32 dest_qp_num;
718 __u32 qp_access_flags;
719 __u16 pkey_index;
720 __u16 alt_pkey_index;
721 __u8 qp_state;
722 __u8 cur_qp_state;
723 __u8 path_mtu;
724 __u8 path_mig_state;
725 __u8 en_sqd_async_notify;
726 __u8 max_rd_atomic;
727 __u8 max_dest_rd_atomic;
728 __u8 min_rnr_timer;
729 __u8 port_num;
730 __u8 timeout;
731 __u8 retry_cnt;
732 __u8 rnr_retry;
733 __u8 alt_port_num;
734 __u8 alt_timeout;
735 __u8 reserved[2];
736 __aligned_u64 driver_data[0];
737};
738
739struct ib_uverbs_ex_modify_qp {
740 struct ib_uverbs_modify_qp base;
741 __u32 rate_limit;
742 __u32 reserved;
743};
744
745struct ib_uverbs_ex_modify_qp_resp {
746 __u32 comp_mask;
747 __u32 response_length;
748};
749
750struct ib_uverbs_destroy_qp {
751 __aligned_u64 response;
752 __u32 qp_handle;
753 __u32 reserved;
754};
755
756struct ib_uverbs_destroy_qp_resp {
757 __u32 events_reported;
758};
759
760/*
761 * The ib_uverbs_sge structure isn't used anywhere, since we assume
762 * the ib_sge structure is packed the same way on 32-bit and 64-bit
763 * architectures in both kernel and user space. It's just here to
764 * document the ABI.
765 */
766struct ib_uverbs_sge {
767 __aligned_u64 addr;
768 __u32 length;
769 __u32 lkey;
770};
771
772enum ib_uverbs_wr_opcode {
773 IB_UVERBS_WR_RDMA_WRITE = 0,
774 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
775 IB_UVERBS_WR_SEND = 2,
776 IB_UVERBS_WR_SEND_WITH_IMM = 3,
777 IB_UVERBS_WR_RDMA_READ = 4,
778 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
779 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
780 IB_UVERBS_WR_LOCAL_INV = 7,
781 IB_UVERBS_WR_BIND_MW = 8,
782 IB_UVERBS_WR_SEND_WITH_INV = 9,
783 IB_UVERBS_WR_TSO = 10,
784 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
785 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
786 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
787 /* Review enum ib_wr_opcode before modifying this */
788};
789
790struct ib_uverbs_send_wr {
791 __aligned_u64 wr_id;
792 __u32 num_sge;
793 __u32 opcode; /* see enum ib_uverbs_wr_opcode */
794 __u32 send_flags;
795 union {
796 __be32 imm_data;
797 __u32 invalidate_rkey;
798 } ex;
799 union {
800 struct {
801 __aligned_u64 remote_addr;
802 __u32 rkey;
803 __u32 reserved;
804 } rdma;
805 struct {
806 __aligned_u64 remote_addr;
807 __aligned_u64 compare_add;
808 __aligned_u64 swap;
809 __u32 rkey;
810 __u32 reserved;
811 } atomic;
812 struct {
813 __u32 ah;
814 __u32 remote_qpn;
815 __u32 remote_qkey;
816 __u32 reserved;
817 } ud;
818 } wr;
819};
820
821struct ib_uverbs_post_send {
822 __aligned_u64 response;
823 __u32 qp_handle;
824 __u32 wr_count;
825 __u32 sge_count;
826 __u32 wqe_size;
827 struct ib_uverbs_send_wr send_wr[0];
828};
829
830struct ib_uverbs_post_send_resp {
831 __u32 bad_wr;
832};
833
834struct ib_uverbs_recv_wr {
835 __aligned_u64 wr_id;
836 __u32 num_sge;
837 __u32 reserved;
838};
839
840struct ib_uverbs_post_recv {
841 __aligned_u64 response;
842 __u32 qp_handle;
843 __u32 wr_count;
844 __u32 sge_count;
845 __u32 wqe_size;
846 struct ib_uverbs_recv_wr recv_wr[0];
847};
848
849struct ib_uverbs_post_recv_resp {
850 __u32 bad_wr;
851};
852
853struct ib_uverbs_post_srq_recv {
854 __aligned_u64 response;
855 __u32 srq_handle;
856 __u32 wr_count;
857 __u32 sge_count;
858 __u32 wqe_size;
859 struct ib_uverbs_recv_wr recv[0];
860};
861
862struct ib_uverbs_post_srq_recv_resp {
863 __u32 bad_wr;
864};
865
866struct ib_uverbs_create_ah {
867 __aligned_u64 response;
868 __aligned_u64 user_handle;
869 __u32 pd_handle;
870 __u32 reserved;
871 struct ib_uverbs_ah_attr attr;
872 __aligned_u64 driver_data[0];
873};
874
875struct ib_uverbs_create_ah_resp {
876 __u32 ah_handle;
877 __u32 driver_data[0];
878};
879
880struct ib_uverbs_destroy_ah {
881 __u32 ah_handle;
882};
883
884struct ib_uverbs_attach_mcast {
885 __u8 gid[16];
886 __u32 qp_handle;
887 __u16 mlid;
888 __u16 reserved;
889 __aligned_u64 driver_data[0];
890};
891
892struct ib_uverbs_detach_mcast {
893 __u8 gid[16];
894 __u32 qp_handle;
895 __u16 mlid;
896 __u16 reserved;
897 __aligned_u64 driver_data[0];
898};
899
900struct ib_uverbs_flow_spec_hdr {
901 __u32 type;
902 __u16 size;
903 __u16 reserved;
904 /* followed by flow_spec */
905 __aligned_u64 flow_spec_data[0];
906};
907
908struct ib_uverbs_flow_eth_filter {
909 __u8 dst_mac[6];
910 __u8 src_mac[6];
911 __be16 ether_type;
912 __be16 vlan_tag;
913};
914
915struct ib_uverbs_flow_spec_eth {
916 union {
917 struct ib_uverbs_flow_spec_hdr hdr;
918 struct {
919 __u32 type;
920 __u16 size;
921 __u16 reserved;
922 };
923 };
924 struct ib_uverbs_flow_eth_filter val;
925 struct ib_uverbs_flow_eth_filter mask;
926};
927
928struct ib_uverbs_flow_ipv4_filter {
929 __be32 src_ip;
930 __be32 dst_ip;
931 __u8 proto;
932 __u8 tos;
933 __u8 ttl;
934 __u8 flags;
935};
936
937struct ib_uverbs_flow_spec_ipv4 {
938 union {
939 struct ib_uverbs_flow_spec_hdr hdr;
940 struct {
941 __u32 type;
942 __u16 size;
943 __u16 reserved;
944 };
945 };
946 struct ib_uverbs_flow_ipv4_filter val;
947 struct ib_uverbs_flow_ipv4_filter mask;
948};
949
950struct ib_uverbs_flow_tcp_udp_filter {
951 __be16 dst_port;
952 __be16 src_port;
953};
954
955struct ib_uverbs_flow_spec_tcp_udp {
956 union {
957 struct ib_uverbs_flow_spec_hdr hdr;
958 struct {
959 __u32 type;
960 __u16 size;
961 __u16 reserved;
962 };
963 };
964 struct ib_uverbs_flow_tcp_udp_filter val;
965 struct ib_uverbs_flow_tcp_udp_filter mask;
966};
967
968struct ib_uverbs_flow_ipv6_filter {
969 __u8 src_ip[16];
970 __u8 dst_ip[16];
971 __be32 flow_label;
972 __u8 next_hdr;
973 __u8 traffic_class;
974 __u8 hop_limit;
975 __u8 reserved;
976};
977
978struct ib_uverbs_flow_spec_ipv6 {
979 union {
980 struct ib_uverbs_flow_spec_hdr hdr;
981 struct {
982 __u32 type;
983 __u16 size;
984 __u16 reserved;
985 };
986 };
987 struct ib_uverbs_flow_ipv6_filter val;
988 struct ib_uverbs_flow_ipv6_filter mask;
989};
990
991struct ib_uverbs_flow_spec_action_tag {
992 union {
993 struct ib_uverbs_flow_spec_hdr hdr;
994 struct {
995 __u32 type;
996 __u16 size;
997 __u16 reserved;
998 };
999 };
1000 __u32 tag_id;
1001 __u32 reserved1;
1002};
1003
1004struct ib_uverbs_flow_spec_action_drop {
1005 union {
1006 struct ib_uverbs_flow_spec_hdr hdr;
1007 struct {
1008 __u32 type;
1009 __u16 size;
1010 __u16 reserved;
1011 };
1012 };
1013};
1014
1015struct ib_uverbs_flow_spec_action_handle {
1016 union {
1017 struct ib_uverbs_flow_spec_hdr hdr;
1018 struct {
1019 __u32 type;
1020 __u16 size;
1021 __u16 reserved;
1022 };
1023 };
1024 __u32 handle;
1025 __u32 reserved1;
1026};
1027
1028struct ib_uverbs_flow_spec_action_count {
1029 union {
1030 struct ib_uverbs_flow_spec_hdr hdr;
1031 struct {
1032 __u32 type;
1033 __u16 size;
1034 __u16 reserved;
1035 };
1036 };
1037 __u32 handle;
1038 __u32 reserved1;
1039};
1040
1041struct ib_uverbs_flow_tunnel_filter {
1042 __be32 tunnel_id;
1043};
1044
1045struct ib_uverbs_flow_spec_tunnel {
1046 union {
1047 struct ib_uverbs_flow_spec_hdr hdr;
1048 struct {
1049 __u32 type;
1050 __u16 size;
1051 __u16 reserved;
1052 };
1053 };
1054 struct ib_uverbs_flow_tunnel_filter val;
1055 struct ib_uverbs_flow_tunnel_filter mask;
1056};
1057
1058struct ib_uverbs_flow_spec_esp_filter {
1059 __u32 spi;
1060 __u32 seq;
1061};
1062
1063struct ib_uverbs_flow_spec_esp {
1064 union {
1065 struct ib_uverbs_flow_spec_hdr hdr;
1066 struct {
1067 __u32 type;
1068 __u16 size;
1069 __u16 reserved;
1070 };
1071 };
1072 struct ib_uverbs_flow_spec_esp_filter val;
1073 struct ib_uverbs_flow_spec_esp_filter mask;
1074};
1075
1076struct ib_uverbs_flow_gre_filter {
1077 /* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header:
1078 * bit 0 - C - checksum bit.
1079 * bit 1 - reserved. set to 0.
1080 * bit 2 - key bit.
1081 * bit 3 - sequence number bit.
1082 * bits 4:12 - reserved. set to 0.
1083 * bits 13:15 - GRE version.
1084 */
1085 __be16 c_ks_res0_ver;
1086 __be16 protocol;
1087 __be32 key;
1088};
1089
1090struct ib_uverbs_flow_spec_gre {
1091 union {
1092 struct ib_uverbs_flow_spec_hdr hdr;
1093 struct {
1094 __u32 type;
1095 __u16 size;
1096 __u16 reserved;
1097 };
1098 };
1099 struct ib_uverbs_flow_gre_filter val;
1100 struct ib_uverbs_flow_gre_filter mask;
1101};
1102
1103struct ib_uverbs_flow_mpls_filter {
1104 /* The field includes the entire MPLS label:
1105 * bits 0:19 - label field.
1106 * bits 20:22 - traffic class field.
1107 * bits 23 - bottom of stack bit.
1108 * bits 24:31 - ttl field.
1109 */
1110 __be32 label;
1111};
1112
1113struct ib_uverbs_flow_spec_mpls {
1114 union {
1115 struct ib_uverbs_flow_spec_hdr hdr;
1116 struct {
1117 __u32 type;
1118 __u16 size;
1119 __u16 reserved;
1120 };
1121 };
1122 struct ib_uverbs_flow_mpls_filter val;
1123 struct ib_uverbs_flow_mpls_filter mask;
1124};
1125
1126struct ib_uverbs_flow_attr {
1127 __u32 type;
1128 __u16 size;
1129 __u16 priority;
1130 __u8 num_of_specs;
1131 __u8 reserved[2];
1132 __u8 port;
1133 __u32 flags;
1134 /* Following are the optional layers according to user request
1135 * struct ib_flow_spec_xxx
1136 * struct ib_flow_spec_yyy
1137 */
1138 struct ib_uverbs_flow_spec_hdr flow_specs[0];
1139};
1140
1141struct ib_uverbs_create_flow {
1142 __u32 comp_mask;
1143 __u32 qp_handle;
1144 struct ib_uverbs_flow_attr flow_attr;
1145};
1146
1147struct ib_uverbs_create_flow_resp {
1148 __u32 comp_mask;
1149 __u32 flow_handle;
1150};
1151
1152struct ib_uverbs_destroy_flow {
1153 __u32 comp_mask;
1154 __u32 flow_handle;
1155};
1156
1157struct ib_uverbs_create_srq {
1158 __aligned_u64 response;
1159 __aligned_u64 user_handle;
1160 __u32 pd_handle;
1161 __u32 max_wr;
1162 __u32 max_sge;
1163 __u32 srq_limit;
1164 __aligned_u64 driver_data[0];
1165};
1166
1167struct ib_uverbs_create_xsrq {
1168 __aligned_u64 response;
1169 __aligned_u64 user_handle;
1170 __u32 srq_type;
1171 __u32 pd_handle;
1172 __u32 max_wr;
1173 __u32 max_sge;
1174 __u32 srq_limit;
1175 __u32 max_num_tags;
1176 __u32 xrcd_handle;
1177 __u32 cq_handle;
1178 __aligned_u64 driver_data[0];
1179};
1180
1181struct ib_uverbs_create_srq_resp {
1182 __u32 srq_handle;
1183 __u32 max_wr;
1184 __u32 max_sge;
1185 __u32 srqn;
1186 __u32 driver_data[0];
1187};
1188
1189struct ib_uverbs_modify_srq {
1190 __u32 srq_handle;
1191 __u32 attr_mask;
1192 __u32 max_wr;
1193 __u32 srq_limit;
1194 __aligned_u64 driver_data[0];
1195};
1196
1197struct ib_uverbs_query_srq {
1198 __aligned_u64 response;
1199 __u32 srq_handle;
1200 __u32 reserved;
1201 __aligned_u64 driver_data[0];
1202};
1203
1204struct ib_uverbs_query_srq_resp {
1205 __u32 max_wr;
1206 __u32 max_sge;
1207 __u32 srq_limit;
1208 __u32 reserved;
1209};
1210
1211struct ib_uverbs_destroy_srq {
1212 __aligned_u64 response;
1213 __u32 srq_handle;
1214 __u32 reserved;
1215};
1216
1217struct ib_uverbs_destroy_srq_resp {
1218 __u32 events_reported;
1219};
1220
1221struct ib_uverbs_ex_create_wq {
1222 __u32 comp_mask;
1223 __u32 wq_type;
1224 __aligned_u64 user_handle;
1225 __u32 pd_handle;
1226 __u32 cq_handle;
1227 __u32 max_wr;
1228 __u32 max_sge;
1229 __u32 create_flags; /* Use enum ib_wq_flags */
1230 __u32 reserved;
1231};
1232
1233struct ib_uverbs_ex_create_wq_resp {
1234 __u32 comp_mask;
1235 __u32 response_length;
1236 __u32 wq_handle;
1237 __u32 max_wr;
1238 __u32 max_sge;
1239 __u32 wqn;
1240};
1241
1242struct ib_uverbs_ex_destroy_wq {
1243 __u32 comp_mask;
1244 __u32 wq_handle;
1245};
1246
1247struct ib_uverbs_ex_destroy_wq_resp {
1248 __u32 comp_mask;
1249 __u32 response_length;
1250 __u32 events_reported;
1251 __u32 reserved;
1252};
1253
1254struct ib_uverbs_ex_modify_wq {
1255 __u32 attr_mask;
1256 __u32 wq_handle;
1257 __u32 wq_state;
1258 __u32 curr_wq_state;
1259 __u32 flags; /* Use enum ib_wq_flags */
1260 __u32 flags_mask; /* Use enum ib_wq_flags */
1261};
1262
1263/* Prevent memory allocation rather than max expected size */
1264#define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1265struct ib_uverbs_ex_create_rwq_ind_table {
1266 __u32 comp_mask;
1267 __u32 log_ind_tbl_size;
1268 /* Following are the wq handles according to log_ind_tbl_size
1269 * wq_handle1
1270 * wq_handle2
1271 */
1272 __u32 wq_handles[0];
1273};
1274
1275struct ib_uverbs_ex_create_rwq_ind_table_resp {
1276 __u32 comp_mask;
1277 __u32 response_length;
1278 __u32 ind_tbl_handle;
1279 __u32 ind_tbl_num;
1280};
1281
1282struct ib_uverbs_ex_destroy_rwq_ind_table {
1283 __u32 comp_mask;
1284 __u32 ind_tbl_handle;
1285};
1286
1287struct ib_uverbs_cq_moderation {
1288 __u16 cq_count;
1289 __u16 cq_period;
1290};
1291
1292struct ib_uverbs_ex_modify_cq {
1293 __u32 cq_handle;
1294 __u32 attr_mask;
1295 struct ib_uverbs_cq_moderation attr;
1296 __u32 reserved;
1297};
1298
1299#define IB_DEVICE_NAME_MAX 64
1300
1301#endif /* IB_USER_VERBS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/irdma-abi.h created+111
...@@ -0,0 +1,111 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB */
2/*
3 * Copyright (c) 2006 - 2021 Intel Corporation. All rights reserved.
4 * Copyright (c) 2005 Topspin Communications. All rights reserved.
5 * Copyright (c) 2005 Cisco Systems. All rights reserved.
6 * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
7 */
8
9#ifndef IRDMA_ABI_H
10#define IRDMA_ABI_H
11
12#include <linux/types.h>
13
14/* irdma must support legacy GEN_1 i40iw kernel
15 * and user-space whose last ABI ver is 5
16 */
17#define IRDMA_ABI_VER 5
18
19enum irdma_memreg_type {
20 IRDMA_MEMREG_TYPE_MEM = 0,
21 IRDMA_MEMREG_TYPE_QP = 1,
22 IRDMA_MEMREG_TYPE_CQ = 2,
23};
24
25struct irdma_alloc_ucontext_req {
26 __u32 rsvd32;
27 __u8 userspace_ver;
28 __u8 rsvd8[3];
29};
30
31struct irdma_alloc_ucontext_resp {
32 __u32 max_pds;
33 __u32 max_qps;
34 __u32 wq_size; /* size of the WQs (SQ+RQ) in the mmaped area */
35 __u8 kernel_ver;
36 __u8 rsvd[3];
37 __aligned_u64 feature_flags;
38 __aligned_u64 db_mmap_key;
39 __u32 max_hw_wq_frags;
40 __u32 max_hw_read_sges;
41 __u32 max_hw_inline;
42 __u32 max_hw_rq_quanta;
43 __u32 max_hw_wq_quanta;
44 __u32 min_hw_cq_size;
45 __u32 max_hw_cq_size;
46 __u16 max_hw_sq_chunk;
47 __u8 hw_rev;
48 __u8 rsvd2;
49};
50
51struct irdma_alloc_pd_resp {
52 __u32 pd_id;
53 __u8 rsvd[4];
54};
55
56struct irdma_resize_cq_req {
57 __aligned_u64 user_cq_buffer;
58};
59
60struct irdma_create_cq_req {
61 __aligned_u64 user_cq_buf;
62 __aligned_u64 user_shadow_area;
63};
64
65struct irdma_create_qp_req {
66 __aligned_u64 user_wqe_bufs;
67 __aligned_u64 user_compl_ctx;
68};
69
70struct irdma_mem_reg_req {
71 __u16 reg_type; /* enum irdma_memreg_type */
72 __u16 cq_pages;
73 __u16 rq_pages;
74 __u16 sq_pages;
75};
76
77struct irdma_modify_qp_req {
78 __u8 sq_flush;
79 __u8 rq_flush;
80 __u8 rsvd[6];
81};
82
83struct irdma_create_cq_resp {
84 __u32 cq_id;
85 __u32 cq_size;
86};
87
88struct irdma_create_qp_resp {
89 __u32 qp_id;
90 __u32 actual_sq_size;
91 __u32 actual_rq_size;
92 __u32 irdma_drv_opt;
93 __u16 push_idx;
94 __u8 lsmm;
95 __u8 rsvd;
96 __u32 qp_caps;
97};
98
99struct irdma_modify_qp_resp {
100 __aligned_u64 push_wqe_mmap_key;
101 __aligned_u64 push_db_mmap_key;
102 __u16 push_offset;
103 __u8 push_valid;
104 __u8 rsvd[5];
105};
106
107struct irdma_create_ah_resp {
108 __u32 ah_id;
109 __u8 rsvd[4];
110};
111#endif /* IRDMA_ABI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx4-abi.h created+191
...@@ -0,0 +1,191 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
4 * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef MLX4_ABI_USER_H
36#define MLX4_ABI_USER_H
37
38#include <linux/types.h>
39
40/*
41 * Increment this value if any changes that break userspace ABI
42 * compatibility are made.
43 */
44
45#define MLX4_IB_UVERBS_NO_DEV_CAPS_ABI_VERSION 3
46#define MLX4_IB_UVERBS_ABI_VERSION 4
47
48/*
49 * Make sure that all structs defined in this file remain laid out so
50 * that they pack the same way on 32-bit and 64-bit architectures (to
51 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
52 * In particular do not use pointer types -- pass pointers in __u64
53 * instead.
54 */
55
56struct mlx4_ib_alloc_ucontext_resp_v3 {
57 __u32 qp_tab_size;
58 __u16 bf_reg_size;
59 __u16 bf_regs_per_page;
60};
61
62enum {
63 MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0,
64};
65
66struct mlx4_ib_alloc_ucontext_resp {
67 __u32 dev_caps;
68 __u32 qp_tab_size;
69 __u16 bf_reg_size;
70 __u16 bf_regs_per_page;
71 __u32 cqe_size;
72};
73
74struct mlx4_ib_alloc_pd_resp {
75 __u32 pdn;
76 __u32 reserved;
77};
78
79struct mlx4_ib_create_cq {
80 __aligned_u64 buf_addr;
81 __aligned_u64 db_addr;
82};
83
84struct mlx4_ib_create_cq_resp {
85 __u32 cqn;
86 __u32 reserved;
87};
88
89struct mlx4_ib_resize_cq {
90 __aligned_u64 buf_addr;
91};
92
93struct mlx4_ib_create_srq {
94 __aligned_u64 buf_addr;
95 __aligned_u64 db_addr;
96};
97
98struct mlx4_ib_create_srq_resp {
99 __u32 srqn;
100 __u32 reserved;
101};
102
103struct mlx4_ib_create_qp_rss {
104 __aligned_u64 rx_hash_fields_mask; /* Use enum mlx4_ib_rx_hash_fields */
105 __u8 rx_hash_function; /* Use enum mlx4_ib_rx_hash_function_flags */
106 __u8 reserved[7];
107 __u8 rx_hash_key[40];
108 __u32 comp_mask;
109 __u32 reserved1;
110};
111
112struct mlx4_ib_create_qp {
113 __aligned_u64 buf_addr;
114 __aligned_u64 db_addr;
115 __u8 log_sq_bb_count;
116 __u8 log_sq_stride;
117 __u8 sq_no_prefetch;
118 __u8 reserved;
119 __u32 inl_recv_sz;
120};
121
122struct mlx4_ib_create_wq {
123 __aligned_u64 buf_addr;
124 __aligned_u64 db_addr;
125 __u8 log_range_size;
126 __u8 reserved[3];
127 __u32 comp_mask;
128};
129
130struct mlx4_ib_modify_wq {
131 __u32 comp_mask;
132 __u32 reserved;
133};
134
135struct mlx4_ib_create_rwq_ind_tbl_resp {
136 __u32 response_length;
137 __u32 reserved;
138};
139
140/* RX Hash function flags */
141enum mlx4_ib_rx_hash_function_flags {
142 MLX4_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
143};
144
145/*
146 * RX Hash flags, these flags allows to set which incoming packet's field should
147 * participates in RX Hash. Each flag represent certain packet's field,
148 * when the flag is set the field that is represented by the flag will
149 * participate in RX Hash calculation.
150 */
151enum mlx4_ib_rx_hash_fields {
152 MLX4_IB_RX_HASH_SRC_IPV4 = 1 << 0,
153 MLX4_IB_RX_HASH_DST_IPV4 = 1 << 1,
154 MLX4_IB_RX_HASH_SRC_IPV6 = 1 << 2,
155 MLX4_IB_RX_HASH_DST_IPV6 = 1 << 3,
156 MLX4_IB_RX_HASH_SRC_PORT_TCP = 1 << 4,
157 MLX4_IB_RX_HASH_DST_PORT_TCP = 1 << 5,
158 MLX4_IB_RX_HASH_SRC_PORT_UDP = 1 << 6,
159 MLX4_IB_RX_HASH_DST_PORT_UDP = 1 << 7,
160 MLX4_IB_RX_HASH_INNER = 1ULL << 31,
161};
162
163struct mlx4_ib_rss_caps {
164 __aligned_u64 rx_hash_fields_mask; /* enum mlx4_ib_rx_hash_fields */
165 __u8 rx_hash_function; /* enum mlx4_ib_rx_hash_function_flags */
166 __u8 reserved[7];
167};
168
169enum query_device_resp_mask {
170 MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
171};
172
173struct mlx4_ib_tso_caps {
174 __u32 max_tso; /* Maximum tso payload size in bytes */
175 /* Corresponding bit will be set if qp type from
176 * 'enum ib_qp_type' is supported.
177 */
178 __u32 supported_qpts;
179};
180
181struct mlx4_uverbs_ex_query_device_resp {
182 __u32 comp_mask;
183 __u32 response_length;
184 __aligned_u64 hca_core_clock_offset;
185 __u32 max_inl_recv_sz;
186 __u32 reserved;
187 struct mlx4_ib_rss_caps rss_caps;
188 struct mlx4_ib_tso_caps tso_caps;
189};
190
191#endif /* MLX4_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx5-abi.h created+522
...@@ -0,0 +1,522 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef MLX5_ABI_USER_H
35#define MLX5_ABI_USER_H
36
37#include <linux/types.h>
38#include <linux/if_ether.h> /* For ETH_ALEN. */
39#include <rdma/ib_user_ioctl_verbs.h>
40
41enum {
42 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
43 MLX5_QP_FLAG_SCATTER_CQE = 1 << 1,
44 MLX5_QP_FLAG_TUNNEL_OFFLOADS = 1 << 2,
45 MLX5_QP_FLAG_BFREG_INDEX = 1 << 3,
46 MLX5_QP_FLAG_TYPE_DCT = 1 << 4,
47 MLX5_QP_FLAG_TYPE_DCI = 1 << 5,
48 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
49 MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
50 MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8,
51 MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE = 1 << 9,
52 MLX5_QP_FLAG_UAR_PAGE_INDEX = 1 << 10,
53 MLX5_QP_FLAG_DCI_STREAM = 1 << 11,
54};
55
56enum {
57 MLX5_SRQ_FLAG_SIGNATURE = 1 << 0,
58};
59
60enum {
61 MLX5_WQ_FLAG_SIGNATURE = 1 << 0,
62};
63
64/* Increment this value if any changes that break userspace ABI
65 * compatibility are made.
66 */
67#define MLX5_IB_UVERBS_ABI_VERSION 1
68
69/* Make sure that all structs defined in this file remain laid out so
70 * that they pack the same way on 32-bit and 64-bit architectures (to
71 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
72 * In particular do not use pointer types -- pass pointers in __u64
73 * instead.
74 */
75
76struct mlx5_ib_alloc_ucontext_req {
77 __u32 total_num_bfregs;
78 __u32 num_low_latency_bfregs;
79};
80
81enum mlx5_lib_caps {
82 MLX5_LIB_CAP_4K_UAR = (__u64)1 << 0,
83 MLX5_LIB_CAP_DYN_UAR = (__u64)1 << 1,
84};
85
86enum mlx5_ib_alloc_uctx_v2_flags {
87 MLX5_IB_ALLOC_UCTX_DEVX = 1 << 0,
88};
89struct mlx5_ib_alloc_ucontext_req_v2 {
90 __u32 total_num_bfregs;
91 __u32 num_low_latency_bfregs;
92 __u32 flags;
93 __u32 comp_mask;
94 __u8 max_cqe_version;
95 __u8 reserved0;
96 __u16 reserved1;
97 __u32 reserved2;
98 __aligned_u64 lib_caps;
99};
100
101enum mlx5_ib_alloc_ucontext_resp_mask {
102 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
103 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY = 1UL << 1,
104 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2,
105 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS = 1UL << 3,
106 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS = 1UL << 4,
107};
108
109enum mlx5_user_cmds_supp_uhw {
110 MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0,
111 MLX5_USER_CMDS_SUPP_UHW_CREATE_AH = 1 << 1,
112};
113
114/* The eth_min_inline response value is set to off-by-one vs the FW
115 * returned value to allow user-space to deal with older kernels.
116 */
117enum mlx5_user_inline_mode {
118 MLX5_USER_INLINE_MODE_NA,
119 MLX5_USER_INLINE_MODE_NONE,
120 MLX5_USER_INLINE_MODE_L2,
121 MLX5_USER_INLINE_MODE_IP,
122 MLX5_USER_INLINE_MODE_TCP_UDP,
123};
124
125enum {
126 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM = 1 << 0,
127 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_REQ_METADATA = 1 << 1,
128 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_SPI_STEERING = 1 << 2,
129 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_FULL_OFFLOAD = 1 << 3,
130 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_TX_IV_IS_ESN = 1 << 4,
131};
132
133struct mlx5_ib_alloc_ucontext_resp {
134 __u32 qp_tab_size;
135 __u32 bf_reg_size;
136 __u32 tot_bfregs;
137 __u32 cache_line_size;
138 __u16 max_sq_desc_sz;
139 __u16 max_rq_desc_sz;
140 __u32 max_send_wqebb;
141 __u32 max_recv_wr;
142 __u32 max_srq_recv_wr;
143 __u16 num_ports;
144 __u16 flow_action_flags;
145 __u32 comp_mask;
146 __u32 response_length;
147 __u8 cqe_version;
148 __u8 cmds_supp_uhw;
149 __u8 eth_min_inline;
150 __u8 clock_info_versions;
151 __aligned_u64 hca_core_clock_offset;
152 __u32 log_uar_size;
153 __u32 num_uars_per_page;
154 __u32 num_dyn_bfregs;
155 __u32 dump_fill_mkey;
156};
157
158struct mlx5_ib_alloc_pd_resp {
159 __u32 pdn;
160};
161
162struct mlx5_ib_tso_caps {
163 __u32 max_tso; /* Maximum tso payload size in bytes */
164
165 /* Corresponding bit will be set if qp type from
166 * 'enum ib_qp_type' is supported, e.g.
167 * supported_qpts |= 1 << IB_QPT_UD
168 */
169 __u32 supported_qpts;
170};
171
172struct mlx5_ib_rss_caps {
173 __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
174 __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
175 __u8 reserved[7];
176};
177
178enum mlx5_ib_cqe_comp_res_format {
179 MLX5_IB_CQE_RES_FORMAT_HASH = 1 << 0,
180 MLX5_IB_CQE_RES_FORMAT_CSUM = 1 << 1,
181 MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2,
182};
183
184struct mlx5_ib_cqe_comp_caps {
185 __u32 max_num;
186 __u32 supported_format; /* enum mlx5_ib_cqe_comp_res_format */
187};
188
189enum mlx5_ib_packet_pacing_cap_flags {
190 MLX5_IB_PP_SUPPORT_BURST = 1 << 0,
191};
192
193struct mlx5_packet_pacing_caps {
194 __u32 qp_rate_limit_min;
195 __u32 qp_rate_limit_max; /* In kpbs */
196
197 /* Corresponding bit will be set if qp type from
198 * 'enum ib_qp_type' is supported, e.g.
199 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
200 */
201 __u32 supported_qpts;
202 __u8 cap_flags; /* enum mlx5_ib_packet_pacing_cap_flags */
203 __u8 reserved[3];
204};
205
206enum mlx5_ib_mpw_caps {
207 MPW_RESERVED = 1 << 0,
208 MLX5_IB_ALLOW_MPW = 1 << 1,
209 MLX5_IB_SUPPORT_EMPW = 1 << 2,
210};
211
212enum mlx5_ib_sw_parsing_offloads {
213 MLX5_IB_SW_PARSING = 1 << 0,
214 MLX5_IB_SW_PARSING_CSUM = 1 << 1,
215 MLX5_IB_SW_PARSING_LSO = 1 << 2,
216};
217
218struct mlx5_ib_sw_parsing_caps {
219 __u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */
220
221 /* Corresponding bit will be set if qp type from
222 * 'enum ib_qp_type' is supported, e.g.
223 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
224 */
225 __u32 supported_qpts;
226};
227
228struct mlx5_ib_striding_rq_caps {
229 __u32 min_single_stride_log_num_of_bytes;
230 __u32 max_single_stride_log_num_of_bytes;
231 __u32 min_single_wqe_log_num_of_strides;
232 __u32 max_single_wqe_log_num_of_strides;
233
234 /* Corresponding bit will be set if qp type from
235 * 'enum ib_qp_type' is supported, e.g.
236 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
237 */
238 __u32 supported_qpts;
239 __u32 reserved;
240};
241
242struct mlx5_ib_dci_streams_caps {
243 __u8 max_log_num_concurent;
244 __u8 max_log_num_errored;
245};
246
247enum mlx5_ib_query_dev_resp_flags {
248 /* Support 128B CQE compression */
249 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
250 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1,
251 MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,
252 MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3,
253};
254
255enum mlx5_ib_tunnel_offloads {
256 MLX5_IB_TUNNELED_OFFLOADS_VXLAN = 1 << 0,
257 MLX5_IB_TUNNELED_OFFLOADS_GRE = 1 << 1,
258 MLX5_IB_TUNNELED_OFFLOADS_GENEVE = 1 << 2,
259 MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE = 1 << 3,
260 MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP = 1 << 4,
261};
262
263struct mlx5_ib_query_device_resp {
264 __u32 comp_mask;
265 __u32 response_length;
266 struct mlx5_ib_tso_caps tso_caps;
267 struct mlx5_ib_rss_caps rss_caps;
268 struct mlx5_ib_cqe_comp_caps cqe_comp_caps;
269 struct mlx5_packet_pacing_caps packet_pacing_caps;
270 __u32 mlx5_ib_support_multi_pkt_send_wqes;
271 __u32 flags; /* Use enum mlx5_ib_query_dev_resp_flags */
272 struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
273 struct mlx5_ib_striding_rq_caps striding_rq_caps;
274 __u32 tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */
275 struct mlx5_ib_dci_streams_caps dci_streams_caps;
276 __u16 reserved;
277};
278
279enum mlx5_ib_create_cq_flags {
280 MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD = 1 << 0,
281 MLX5_IB_CREATE_CQ_FLAGS_UAR_PAGE_INDEX = 1 << 1,
282 MLX5_IB_CREATE_CQ_FLAGS_REAL_TIME_TS = 1 << 2,
283};
284
285struct mlx5_ib_create_cq {
286 __aligned_u64 buf_addr;
287 __aligned_u64 db_addr;
288 __u32 cqe_size;
289 __u8 cqe_comp_en;
290 __u8 cqe_comp_res_format;
291 __u16 flags;
292 __u16 uar_page_index;
293 __u16 reserved0;
294 __u32 reserved1;
295};
296
297struct mlx5_ib_create_cq_resp {
298 __u32 cqn;
299 __u32 reserved;
300};
301
302struct mlx5_ib_resize_cq {
303 __aligned_u64 buf_addr;
304 __u16 cqe_size;
305 __u16 reserved0;
306 __u32 reserved1;
307};
308
309struct mlx5_ib_create_srq {
310 __aligned_u64 buf_addr;
311 __aligned_u64 db_addr;
312 __u32 flags;
313 __u32 reserved0; /* explicit padding (optional on i386) */
314 __u32 uidx;
315 __u32 reserved1;
316};
317
318struct mlx5_ib_create_srq_resp {
319 __u32 srqn;
320 __u32 reserved;
321};
322
323struct mlx5_ib_create_qp_dci_streams {
324 __u8 log_num_concurent;
325 __u8 log_num_errored;
326};
327
328struct mlx5_ib_create_qp {
329 __aligned_u64 buf_addr;
330 __aligned_u64 db_addr;
331 __u32 sq_wqe_count;
332 __u32 rq_wqe_count;
333 __u32 rq_wqe_shift;
334 __u32 flags;
335 __u32 uidx;
336 __u32 bfreg_index;
337 union {
338 __aligned_u64 sq_buf_addr;
339 __aligned_u64 access_key;
340 };
341 __u32 ece_options;
342 struct mlx5_ib_create_qp_dci_streams dci_streams;
343 __u16 reserved;
344};
345
346/* RX Hash function flags */
347enum mlx5_rx_hash_function_flags {
348 MLX5_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
349};
350
351/*
352 * RX Hash flags, these flags allows to set which incoming packet's field should
353 * participates in RX Hash. Each flag represent certain packet's field,
354 * when the flag is set the field that is represented by the flag will
355 * participate in RX Hash calculation.
356 * Note: *IPV4 and *IPV6 flags can't be enabled together on the same QP
357 * and *TCP and *UDP flags can't be enabled together on the same QP.
358*/
359enum mlx5_rx_hash_fields {
360 MLX5_RX_HASH_SRC_IPV4 = 1 << 0,
361 MLX5_RX_HASH_DST_IPV4 = 1 << 1,
362 MLX5_RX_HASH_SRC_IPV6 = 1 << 2,
363 MLX5_RX_HASH_DST_IPV6 = 1 << 3,
364 MLX5_RX_HASH_SRC_PORT_TCP = 1 << 4,
365 MLX5_RX_HASH_DST_PORT_TCP = 1 << 5,
366 MLX5_RX_HASH_SRC_PORT_UDP = 1 << 6,
367 MLX5_RX_HASH_DST_PORT_UDP = 1 << 7,
368 MLX5_RX_HASH_IPSEC_SPI = 1 << 8,
369 /* Save bits for future fields */
370 MLX5_RX_HASH_INNER = (1UL << 31),
371};
372
373struct mlx5_ib_create_qp_rss {
374 __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
375 __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
376 __u8 rx_key_len; /* valid only for Toeplitz */
377 __u8 reserved[6];
378 __u8 rx_hash_key[128]; /* valid only for Toeplitz */
379 __u32 comp_mask;
380 __u32 flags;
381};
382
383enum mlx5_ib_create_qp_resp_mask {
384 MLX5_IB_CREATE_QP_RESP_MASK_TIRN = 1UL << 0,
385 MLX5_IB_CREATE_QP_RESP_MASK_TISN = 1UL << 1,
386 MLX5_IB_CREATE_QP_RESP_MASK_RQN = 1UL << 2,
387 MLX5_IB_CREATE_QP_RESP_MASK_SQN = 1UL << 3,
388 MLX5_IB_CREATE_QP_RESP_MASK_TIR_ICM_ADDR = 1UL << 4,
389};
390
391struct mlx5_ib_create_qp_resp {
392 __u32 bfreg_index;
393 __u32 ece_options;
394 __u32 comp_mask;
395 __u32 tirn;
396 __u32 tisn;
397 __u32 rqn;
398 __u32 sqn;
399 __u32 reserved1;
400 __u64 tir_icm_addr;
401};
402
403struct mlx5_ib_alloc_mw {
404 __u32 comp_mask;
405 __u8 num_klms;
406 __u8 reserved1;
407 __u16 reserved2;
408};
409
410enum mlx5_ib_create_wq_mask {
411 MLX5_IB_CREATE_WQ_STRIDING_RQ = (1 << 0),
412};
413
414struct mlx5_ib_create_wq {
415 __aligned_u64 buf_addr;
416 __aligned_u64 db_addr;
417 __u32 rq_wqe_count;
418 __u32 rq_wqe_shift;
419 __u32 user_index;
420 __u32 flags;
421 __u32 comp_mask;
422 __u32 single_stride_log_num_of_bytes;
423 __u32 single_wqe_log_num_of_strides;
424 __u32 two_byte_shift_en;
425};
426
427struct mlx5_ib_create_ah_resp {
428 __u32 response_length;
429 __u8 dmac[ETH_ALEN];
430 __u8 reserved[6];
431};
432
433struct mlx5_ib_burst_info {
434 __u32 max_burst_sz;
435 __u16 typical_pkt_sz;
436 __u16 reserved;
437};
438
439struct mlx5_ib_modify_qp {
440 __u32 comp_mask;
441 struct mlx5_ib_burst_info burst_info;
442 __u32 ece_options;
443};
444
445struct mlx5_ib_modify_qp_resp {
446 __u32 response_length;
447 __u32 dctn;
448 __u32 ece_options;
449 __u32 reserved;
450};
451
452struct mlx5_ib_create_wq_resp {
453 __u32 response_length;
454 __u32 reserved;
455};
456
457struct mlx5_ib_create_rwq_ind_tbl_resp {
458 __u32 response_length;
459 __u32 reserved;
460};
461
462struct mlx5_ib_modify_wq {
463 __u32 comp_mask;
464 __u32 reserved;
465};
466
467struct mlx5_ib_clock_info {
468 __u32 sign;
469 __u32 resv;
470 __aligned_u64 nsec;
471 __aligned_u64 cycles;
472 __aligned_u64 frac;
473 __u32 mult;
474 __u32 shift;
475 __aligned_u64 mask;
476 __aligned_u64 overflow_period;
477};
478
479enum mlx5_ib_mmap_cmd {
480 MLX5_IB_MMAP_REGULAR_PAGE = 0,
481 MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES = 1,
482 MLX5_IB_MMAP_WC_PAGE = 2,
483 MLX5_IB_MMAP_NC_PAGE = 3,
484 /* 5 is chosen in order to be compatible with old versions of libmlx5 */
485 MLX5_IB_MMAP_CORE_CLOCK = 5,
486 MLX5_IB_MMAP_ALLOC_WC = 6,
487 MLX5_IB_MMAP_CLOCK_INFO = 7,
488 MLX5_IB_MMAP_DEVICE_MEM = 8,
489};
490
491enum {
492 MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1,
493};
494
495/* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */
496enum {
497 MLX5_IB_CLOCK_INFO_V1 = 0,
498};
499
500struct mlx5_ib_flow_counters_desc {
501 __u32 description;
502 __u32 index;
503};
504
505struct mlx5_ib_flow_counters_data {
506 RDMA_UAPI_PTR(struct mlx5_ib_flow_counters_desc *, counters_data);
507 __u32 ncounters;
508 __u32 reserved;
509};
510
511struct mlx5_ib_create_flow {
512 __u32 ncounters_data;
513 __u32 reserved;
514 /*
515 * Following are counters data based on ncounters_data, each
516 * entry in the data[] should match a corresponding counter object
517 * that was pointed by a counters spec upon the flow creation
518 */
519 struct mlx5_ib_flow_counters_data data[];
520};
521
522#endif /* MLX5_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_cmds.h created+332
...@@ -0,0 +1,332 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef MLX5_USER_IOCTL_CMDS_H
34#define MLX5_USER_IOCTL_CMDS_H
35
36#include <linux/types.h>
37#include <rdma/ib_user_ioctl_cmds.h>
38
39enum mlx5_ib_create_flow_action_attrs {
40 /* This attribute belong to the driver namespace */
41 MLX5_IB_ATTR_CREATE_FLOW_ACTION_FLAGS = (1U << UVERBS_ID_NS_SHIFT),
42};
43
44enum mlx5_ib_dm_methods {
45 MLX5_IB_METHOD_DM_MAP_OP_ADDR = (1U << UVERBS_ID_NS_SHIFT),
46 MLX5_IB_METHOD_DM_QUERY,
47};
48
49enum mlx5_ib_dm_map_op_addr_attrs {
50 MLX5_IB_ATTR_DM_MAP_OP_ADDR_REQ_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
51 MLX5_IB_ATTR_DM_MAP_OP_ADDR_REQ_OP,
52 MLX5_IB_ATTR_DM_MAP_OP_ADDR_RESP_START_OFFSET,
53 MLX5_IB_ATTR_DM_MAP_OP_ADDR_RESP_PAGE_INDEX,
54};
55
56enum mlx5_ib_query_dm_attrs {
57 MLX5_IB_ATTR_QUERY_DM_REQ_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
58 MLX5_IB_ATTR_QUERY_DM_RESP_START_OFFSET,
59 MLX5_IB_ATTR_QUERY_DM_RESP_PAGE_INDEX,
60 MLX5_IB_ATTR_QUERY_DM_RESP_LENGTH,
61};
62
63enum mlx5_ib_alloc_dm_attrs {
64 MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET = (1U << UVERBS_ID_NS_SHIFT),
65 MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,
66 MLX5_IB_ATTR_ALLOC_DM_REQ_TYPE,
67};
68
69enum mlx5_ib_devx_methods {
70 MLX5_IB_METHOD_DEVX_OTHER = (1U << UVERBS_ID_NS_SHIFT),
71 MLX5_IB_METHOD_DEVX_QUERY_UAR,
72 MLX5_IB_METHOD_DEVX_QUERY_EQN,
73 MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT,
74};
75
76enum mlx5_ib_devx_other_attrs {
77 MLX5_IB_ATTR_DEVX_OTHER_CMD_IN = (1U << UVERBS_ID_NS_SHIFT),
78 MLX5_IB_ATTR_DEVX_OTHER_CMD_OUT,
79};
80
81enum mlx5_ib_devx_obj_create_attrs {
82 MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
83 MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_IN,
84 MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT,
85};
86
87enum mlx5_ib_devx_query_uar_attrs {
88 MLX5_IB_ATTR_DEVX_QUERY_UAR_USER_IDX = (1U << UVERBS_ID_NS_SHIFT),
89 MLX5_IB_ATTR_DEVX_QUERY_UAR_DEV_IDX,
90};
91
92enum mlx5_ib_devx_obj_destroy_attrs {
93 MLX5_IB_ATTR_DEVX_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
94};
95
96enum mlx5_ib_devx_obj_modify_attrs {
97 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
98 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
99 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_OUT,
100};
101
102enum mlx5_ib_devx_obj_query_attrs {
103 MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
104 MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_IN,
105 MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_OUT,
106};
107
108enum mlx5_ib_devx_obj_query_async_attrs {
109 MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
110 MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_CMD_IN,
111 MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_FD,
112 MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_WR_ID,
113 MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_OUT_LEN,
114};
115
116enum mlx5_ib_devx_subscribe_event_attrs {
117 MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_FD_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
118 MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_OBJ_HANDLE,
119 MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_TYPE_NUM_LIST,
120 MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_FD_NUM,
121 MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_COOKIE,
122};
123
124enum mlx5_ib_devx_query_eqn_attrs {
125 MLX5_IB_ATTR_DEVX_QUERY_EQN_USER_VEC = (1U << UVERBS_ID_NS_SHIFT),
126 MLX5_IB_ATTR_DEVX_QUERY_EQN_DEV_EQN,
127};
128
129enum mlx5_ib_devx_obj_methods {
130 MLX5_IB_METHOD_DEVX_OBJ_CREATE = (1U << UVERBS_ID_NS_SHIFT),
131 MLX5_IB_METHOD_DEVX_OBJ_DESTROY,
132 MLX5_IB_METHOD_DEVX_OBJ_MODIFY,
133 MLX5_IB_METHOD_DEVX_OBJ_QUERY,
134 MLX5_IB_METHOD_DEVX_OBJ_ASYNC_QUERY,
135};
136
137enum mlx5_ib_var_alloc_attrs {
138 MLX5_IB_ATTR_VAR_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
139 MLX5_IB_ATTR_VAR_OBJ_ALLOC_MMAP_OFFSET,
140 MLX5_IB_ATTR_VAR_OBJ_ALLOC_MMAP_LENGTH,
141 MLX5_IB_ATTR_VAR_OBJ_ALLOC_PAGE_ID,
142};
143
144enum mlx5_ib_var_obj_destroy_attrs {
145 MLX5_IB_ATTR_VAR_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
146};
147
148enum mlx5_ib_var_obj_methods {
149 MLX5_IB_METHOD_VAR_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
150 MLX5_IB_METHOD_VAR_OBJ_DESTROY,
151};
152
153enum mlx5_ib_uar_alloc_attrs {
154 MLX5_IB_ATTR_UAR_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
155 MLX5_IB_ATTR_UAR_OBJ_ALLOC_TYPE,
156 MLX5_IB_ATTR_UAR_OBJ_ALLOC_MMAP_OFFSET,
157 MLX5_IB_ATTR_UAR_OBJ_ALLOC_MMAP_LENGTH,
158 MLX5_IB_ATTR_UAR_OBJ_ALLOC_PAGE_ID,
159};
160
161enum mlx5_ib_uar_obj_destroy_attrs {
162 MLX5_IB_ATTR_UAR_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
163};
164
165enum mlx5_ib_uar_obj_methods {
166 MLX5_IB_METHOD_UAR_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
167 MLX5_IB_METHOD_UAR_OBJ_DESTROY,
168};
169
170enum mlx5_ib_devx_umem_reg_attrs {
171 MLX5_IB_ATTR_DEVX_UMEM_REG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
172 MLX5_IB_ATTR_DEVX_UMEM_REG_ADDR,
173 MLX5_IB_ATTR_DEVX_UMEM_REG_LEN,
174 MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
175 MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
176 MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP,
177};
178
179enum mlx5_ib_devx_umem_dereg_attrs {
180 MLX5_IB_ATTR_DEVX_UMEM_DEREG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
181};
182
183enum mlx5_ib_pp_obj_methods {
184 MLX5_IB_METHOD_PP_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
185 MLX5_IB_METHOD_PP_OBJ_DESTROY,
186};
187
188enum mlx5_ib_pp_alloc_attrs {
189 MLX5_IB_ATTR_PP_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
190 MLX5_IB_ATTR_PP_OBJ_ALLOC_CTX,
191 MLX5_IB_ATTR_PP_OBJ_ALLOC_FLAGS,
192 MLX5_IB_ATTR_PP_OBJ_ALLOC_INDEX,
193};
194
195enum mlx5_ib_pp_obj_destroy_attrs {
196 MLX5_IB_ATTR_PP_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
197};
198
199enum mlx5_ib_devx_umem_methods {
200 MLX5_IB_METHOD_DEVX_UMEM_REG = (1U << UVERBS_ID_NS_SHIFT),
201 MLX5_IB_METHOD_DEVX_UMEM_DEREG,
202};
203
204enum mlx5_ib_devx_async_cmd_fd_alloc_attrs {
205 MLX5_IB_ATTR_DEVX_ASYNC_CMD_FD_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
206};
207
208enum mlx5_ib_devx_async_event_fd_alloc_attrs {
209 MLX5_IB_ATTR_DEVX_ASYNC_EVENT_FD_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
210 MLX5_IB_ATTR_DEVX_ASYNC_EVENT_FD_ALLOC_FLAGS,
211};
212
213enum mlx5_ib_devx_async_cmd_fd_methods {
214 MLX5_IB_METHOD_DEVX_ASYNC_CMD_FD_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
215};
216
217enum mlx5_ib_devx_async_event_fd_methods {
218 MLX5_IB_METHOD_DEVX_ASYNC_EVENT_FD_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
219};
220
221enum mlx5_ib_objects {
222 MLX5_IB_OBJECT_DEVX = (1U << UVERBS_ID_NS_SHIFT),
223 MLX5_IB_OBJECT_DEVX_OBJ,
224 MLX5_IB_OBJECT_DEVX_UMEM,
225 MLX5_IB_OBJECT_FLOW_MATCHER,
226 MLX5_IB_OBJECT_DEVX_ASYNC_CMD_FD,
227 MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD,
228 MLX5_IB_OBJECT_VAR,
229 MLX5_IB_OBJECT_PP,
230 MLX5_IB_OBJECT_UAR,
231};
232
233enum mlx5_ib_flow_matcher_create_attrs {
234 MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
235 MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
236 MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
237 MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
238 MLX5_IB_ATTR_FLOW_MATCHER_FLOW_FLAGS,
239 MLX5_IB_ATTR_FLOW_MATCHER_FT_TYPE,
240};
241
242enum mlx5_ib_flow_matcher_destroy_attrs {
243 MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
244};
245
246enum mlx5_ib_flow_matcher_methods {
247 MLX5_IB_METHOD_FLOW_MATCHER_CREATE = (1U << UVERBS_ID_NS_SHIFT),
248 MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
249};
250
251enum mlx5_ib_device_query_context_attrs {
252 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),
253};
254
255#define MLX5_IB_DW_MATCH_PARAM 0x90
256
257struct mlx5_ib_match_params {
258 __u32 match_params[MLX5_IB_DW_MATCH_PARAM];
259};
260
261enum mlx5_ib_flow_type {
262 MLX5_IB_FLOW_TYPE_NORMAL,
263 MLX5_IB_FLOW_TYPE_SNIFFER,
264 MLX5_IB_FLOW_TYPE_ALL_DEFAULT,
265 MLX5_IB_FLOW_TYPE_MC_DEFAULT,
266};
267
268enum mlx5_ib_create_flow_flags {
269 MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DEFAULT_MISS = 1 << 0,
270 MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DROP = 1 << 1,
271};
272
273enum mlx5_ib_create_flow_attrs {
274 MLX5_IB_ATTR_CREATE_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
275 MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
276 MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
277 MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
278 MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
279 MLX5_IB_ATTR_CREATE_FLOW_ARR_FLOW_ACTIONS,
280 MLX5_IB_ATTR_CREATE_FLOW_TAG,
281 MLX5_IB_ATTR_CREATE_FLOW_ARR_COUNTERS_DEVX,
282 MLX5_IB_ATTR_CREATE_FLOW_ARR_COUNTERS_DEVX_OFFSET,
283 MLX5_IB_ATTR_CREATE_FLOW_FLAGS,
284};
285
286enum mlx5_ib_destroy_flow_attrs {
287 MLX5_IB_ATTR_DESTROY_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
288};
289
290enum mlx5_ib_flow_methods {
291 MLX5_IB_METHOD_CREATE_FLOW = (1U << UVERBS_ID_NS_SHIFT),
292 MLX5_IB_METHOD_DESTROY_FLOW,
293};
294
295enum mlx5_ib_flow_action_methods {
296 MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER = (1U << UVERBS_ID_NS_SHIFT),
297 MLX5_IB_METHOD_FLOW_ACTION_CREATE_PACKET_REFORMAT,
298};
299
300enum mlx5_ib_create_flow_action_create_modify_header_attrs {
301 MLX5_IB_ATTR_CREATE_MODIFY_HEADER_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
302 MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM,
303 MLX5_IB_ATTR_CREATE_MODIFY_HEADER_FT_TYPE,
304};
305
306enum mlx5_ib_create_flow_action_create_packet_reformat_attrs {
307 MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
308 MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_TYPE,
309 MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_FT_TYPE,
310 MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_DATA_BUF,
311};
312
313enum mlx5_ib_query_pd_attrs {
314 MLX5_IB_ATTR_QUERY_PD_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
315 MLX5_IB_ATTR_QUERY_PD_RESP_PDN,
316};
317
318enum mlx5_ib_pd_methods {
319 MLX5_IB_METHOD_PD_QUERY = (1U << UVERBS_ID_NS_SHIFT),
320
321};
322
323enum mlx5_ib_device_methods {
324 MLX5_IB_METHOD_QUERY_PORT = (1U << UVERBS_ID_NS_SHIFT),
325};
326
327enum mlx5_ib_query_port_attrs {
328 MLX5_IB_ATTR_QUERY_PORT_PORT_NUM = (1U << UVERBS_ID_NS_SHIFT),
329 MLX5_IB_ATTR_QUERY_PORT,
330};
331
332#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_verbs.h created+111
...@@ -0,0 +1,111 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef MLX5_USER_IOCTL_VERBS_H
34#define MLX5_USER_IOCTL_VERBS_H
35
36#include <linux/types.h>
37
38enum mlx5_ib_uapi_flow_action_flags {
39 MLX5_IB_UAPI_FLOW_ACTION_FLAGS_REQUIRE_METADATA = 1 << 0,
40};
41
42enum mlx5_ib_uapi_flow_table_type {
43 MLX5_IB_UAPI_FLOW_TABLE_TYPE_NIC_RX = 0x0,
44 MLX5_IB_UAPI_FLOW_TABLE_TYPE_NIC_TX = 0x1,
45 MLX5_IB_UAPI_FLOW_TABLE_TYPE_FDB = 0x2,
46 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_RX = 0x3,
47 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_TX = 0x4,
48};
49
50enum mlx5_ib_uapi_flow_action_packet_reformat_type {
51 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2 = 0x0,
52 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x1,
53 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2 = 0x2,
54 MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x3,
55};
56
57struct mlx5_ib_uapi_devx_async_cmd_hdr {
58 __aligned_u64 wr_id;
59 __u8 out_data[];
60};
61
62enum mlx5_ib_uapi_dm_type {
63 MLX5_IB_UAPI_DM_TYPE_MEMIC,
64 MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM,
65 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM,
66};
67
68enum mlx5_ib_uapi_devx_create_event_channel_flags {
69 MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA = 1 << 0,
70};
71
72struct mlx5_ib_uapi_devx_async_event_hdr {
73 __aligned_u64 cookie;
74 __u8 out_data[];
75};
76
77enum mlx5_ib_uapi_pp_alloc_flags {
78 MLX5_IB_UAPI_PP_ALLOC_FLAGS_DEDICATED_INDEX = 1 << 0,
79};
80
81enum mlx5_ib_uapi_uar_alloc_type {
82 MLX5_IB_UAPI_UAR_ALLOC_TYPE_BF = 0x0,
83 MLX5_IB_UAPI_UAR_ALLOC_TYPE_NC = 0x1,
84};
85
86enum mlx5_ib_uapi_query_port_flags {
87 MLX5_IB_UAPI_QUERY_PORT_VPORT = 1 << 0,
88 MLX5_IB_UAPI_QUERY_PORT_VPORT_VHCA_ID = 1 << 1,
89 MLX5_IB_UAPI_QUERY_PORT_VPORT_STEERING_ICM_RX = 1 << 2,
90 MLX5_IB_UAPI_QUERY_PORT_VPORT_STEERING_ICM_TX = 1 << 3,
91 MLX5_IB_UAPI_QUERY_PORT_VPORT_REG_C0 = 1 << 4,
92 MLX5_IB_UAPI_QUERY_PORT_ESW_OWNER_VHCA_ID = 1 << 5,
93};
94
95struct mlx5_ib_uapi_reg {
96 __u32 value;
97 __u32 mask;
98};
99
100struct mlx5_ib_uapi_query_port {
101 __aligned_u64 flags;
102 __u16 vport;
103 __u16 vport_vhca_id;
104 __u16 esw_owner_vhca_id;
105 __u16 rsvd0;
106 __aligned_u64 vport_steering_icm_rx;
107 __aligned_u64 vport_steering_icm_tx;
108 struct mlx5_ib_uapi_reg reg_c0;
109};
110
111#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mthca-abi.h created+112
...@@ -0,0 +1,112 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef MTHCA_ABI_USER_H
36#define MTHCA_ABI_USER_H
37
38#include <linux/types.h>
39
40/*
41 * Increment this value if any changes that break userspace ABI
42 * compatibility are made.
43 */
44#define MTHCA_UVERBS_ABI_VERSION 1
45
46/*
47 * Make sure that all structs defined in this file remain laid out so
48 * that they pack the same way on 32-bit and 64-bit architectures (to
49 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
50 * In particular do not use pointer types -- pass pointers in __u64
51 * instead.
52 */
53struct mthca_alloc_ucontext_resp {
54 __u32 qp_tab_size;
55 __u32 uarc_size;
56};
57
58struct mthca_alloc_pd_resp {
59 __u32 pdn;
60 __u32 reserved;
61};
62
63/*
64 * Mark the memory region with a DMA attribute that causes
65 * in-flight DMA to be flushed when the region is written to:
66 */
67#define MTHCA_MR_DMASYNC 0x1
68
69struct mthca_reg_mr {
70 __u32 mr_attrs;
71 __u32 reserved;
72};
73
74struct mthca_create_cq {
75 __u32 lkey;
76 __u32 pdn;
77 __aligned_u64 arm_db_page;
78 __aligned_u64 set_db_page;
79 __u32 arm_db_index;
80 __u32 set_db_index;
81};
82
83struct mthca_create_cq_resp {
84 __u32 cqn;
85 __u32 reserved;
86};
87
88struct mthca_resize_cq {
89 __u32 lkey;
90 __u32 reserved;
91};
92
93struct mthca_create_srq {
94 __u32 lkey;
95 __u32 db_index;
96 __aligned_u64 db_page;
97};
98
99struct mthca_create_srq_resp {
100 __u32 srqn;
101 __u32 reserved;
102};
103
104struct mthca_create_qp {
105 __u32 lkey;
106 __u32 reserved;
107 __aligned_u64 sq_db_page;
108 __aligned_u64 rq_db_page;
109 __u32 sq_db_index;
110 __u32 rq_db_index;
111};
112#endif /* MTHCA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ocrdma-abi.h created+152
...@@ -0,0 +1,152 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/* This file is part of the Emulex RoCE Device Driver for
3 * RoCE (RDMA over Converged Ethernet) adapters.
4 * Copyright (C) 2012-2015 Emulex. All rights reserved.
5 * EMULEX and SLI are trademarks of Emulex.
6 * www.emulex.com
7 *
8 * This software is available to you under a choice of one of two licenses.
9 * You may choose to be licensed under the terms of the GNU General Public
10 * License (GPL) Version 2, available from the file COPYING in the main
11 * directory of this source tree, or the BSD license below:
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 *
17 * - Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in
22 * the documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 * Contact Information:
37 * linux-drivers@emulex.com
38 *
39 * Emulex
40 * 3333 Susan Street
41 * Costa Mesa, CA 92626
42 */
43
44#ifndef OCRDMA_ABI_USER_H
45#define OCRDMA_ABI_USER_H
46
47#include <linux/types.h>
48
49#define OCRDMA_ABI_VERSION 2
50#define OCRDMA_BE_ROCE_ABI_VERSION 1
51/* user kernel communication data structures. */
52
53struct ocrdma_alloc_ucontext_resp {
54 __u32 dev_id;
55 __u32 wqe_size;
56 __u32 max_inline_data;
57 __u32 dpp_wqe_size;
58 __aligned_u64 ah_tbl_page;
59 __u32 ah_tbl_len;
60 __u32 rqe_size;
61 __u8 fw_ver[32];
62 /* for future use/new features in progress */
63 __aligned_u64 rsvd1;
64 __aligned_u64 rsvd2;
65};
66
67struct ocrdma_alloc_pd_ureq {
68 __u32 rsvd[2];
69};
70
71struct ocrdma_alloc_pd_uresp {
72 __u32 id;
73 __u32 dpp_enabled;
74 __u32 dpp_page_addr_hi;
75 __u32 dpp_page_addr_lo;
76 __u32 rsvd[2];
77};
78
79struct ocrdma_create_cq_ureq {
80 __u32 dpp_cq;
81 __u32 rsvd; /* pad */
82};
83
84#define MAX_CQ_PAGES 8
85struct ocrdma_create_cq_uresp {
86 __u32 cq_id;
87 __u32 page_size;
88 __u32 num_pages;
89 __u32 max_hw_cqe;
90 __aligned_u64 page_addr[MAX_CQ_PAGES];
91 __aligned_u64 db_page_addr;
92 __u32 db_page_size;
93 __u32 phase_change;
94 /* for future use/new features in progress */
95 __aligned_u64 rsvd1;
96 __aligned_u64 rsvd2;
97};
98
99#define MAX_QP_PAGES 8
100#define MAX_UD_AV_PAGES 8
101
102struct ocrdma_create_qp_ureq {
103 __u8 enable_dpp_cq;
104 __u8 rsvd;
105 __u16 dpp_cq_id;
106 __u32 rsvd1; /* pad */
107};
108
109struct ocrdma_create_qp_uresp {
110 __u16 qp_id;
111 __u16 sq_dbid;
112 __u16 rq_dbid;
113 __u16 resv0; /* pad */
114 __u32 sq_page_size;
115 __u32 rq_page_size;
116 __u32 num_sq_pages;
117 __u32 num_rq_pages;
118 __aligned_u64 sq_page_addr[MAX_QP_PAGES];
119 __aligned_u64 rq_page_addr[MAX_QP_PAGES];
120 __aligned_u64 db_page_addr;
121 __u32 db_page_size;
122 __u32 dpp_credit;
123 __u32 dpp_offset;
124 __u32 num_wqe_allocated;
125 __u32 num_rqe_allocated;
126 __u32 db_sq_offset;
127 __u32 db_rq_offset;
128 __u32 db_shift;
129 __aligned_u64 rsvd[11];
130};
131
132struct ocrdma_create_srq_uresp {
133 __u16 rq_dbid;
134 __u16 resv0; /* pad */
135 __u32 resv1;
136
137 __u32 rq_page_size;
138 __u32 num_rq_pages;
139
140 __aligned_u64 rq_page_addr[MAX_QP_PAGES];
141 __aligned_u64 db_page_addr;
142
143 __u32 db_page_size;
144 __u32 num_rqe_allocated;
145 __u32 db_rq_offset;
146 __u32 db_shift;
147
148 __aligned_u64 rsvd2;
149 __aligned_u64 rsvd3;
150};
151
152#endif /* OCRDMA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/qedr-abi.h created+174
...@@ -0,0 +1,174 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/* QLogic qedr NIC Driver
3 * Copyright (c) 2015-2016 QLogic Corporation
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and /or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33#ifndef __QEDR_USER_H__
34#define __QEDR_USER_H__
35
36#include <linux/types.h>
37
38#define QEDR_ABI_VERSION (8)
39
40/* user kernel communication data structures. */
41enum qedr_alloc_ucontext_flags {
42 QEDR_ALLOC_UCTX_EDPM_MODE = 1 << 0,
43 QEDR_ALLOC_UCTX_DB_REC = 1 << 1,
44 QEDR_SUPPORT_DPM_SIZES = 1 << 2,
45};
46
47struct qedr_alloc_ucontext_req {
48 __u32 context_flags;
49 __u32 reserved;
50};
51
52#define QEDR_LDPM_MAX_SIZE (8192)
53#define QEDR_EDPM_TRANS_SIZE (64)
54#define QEDR_EDPM_MAX_SIZE (ROCE_REQ_MAX_INLINE_DATA_SIZE)
55
56enum qedr_rdma_dpm_type {
57 QEDR_DPM_TYPE_NONE = 0,
58 QEDR_DPM_TYPE_ROCE_ENHANCED = 1 << 0,
59 QEDR_DPM_TYPE_ROCE_LEGACY = 1 << 1,
60 QEDR_DPM_TYPE_IWARP_LEGACY = 1 << 2,
61 QEDR_DPM_TYPE_ROCE_EDPM_MODE = 1 << 3,
62 QEDR_DPM_SIZES_SET = 1 << 4,
63};
64
65struct qedr_alloc_ucontext_resp {
66 __aligned_u64 db_pa;
67 __u32 db_size;
68
69 __u32 max_send_wr;
70 __u32 max_recv_wr;
71 __u32 max_srq_wr;
72 __u32 sges_per_send_wr;
73 __u32 sges_per_recv_wr;
74 __u32 sges_per_srq_wr;
75 __u32 max_cqes;
76 __u8 dpm_flags;
77 __u8 wids_enabled;
78 __u16 wid_count;
79 __u16 ldpm_limit_size;
80 __u8 edpm_trans_size;
81 __u8 reserved;
82 __u16 edpm_limit_size;
83 __u8 padding[6];
84};
85
86struct qedr_alloc_pd_ureq {
87 __aligned_u64 rsvd1;
88};
89
90struct qedr_alloc_pd_uresp {
91 __u32 pd_id;
92 __u32 reserved;
93};
94
95struct qedr_create_cq_ureq {
96 __aligned_u64 addr;
97 __aligned_u64 len;
98};
99
100struct qedr_create_cq_uresp {
101 __u32 db_offset;
102 __u16 icid;
103 __u16 reserved;
104 __aligned_u64 db_rec_addr;
105};
106
107struct qedr_create_qp_ureq {
108 __u32 qp_handle_hi;
109 __u32 qp_handle_lo;
110
111 /* SQ */
112 /* user space virtual address of SQ buffer */
113 __aligned_u64 sq_addr;
114
115 /* length of SQ buffer */
116 __aligned_u64 sq_len;
117
118 /* RQ */
119 /* user space virtual address of RQ buffer */
120 __aligned_u64 rq_addr;
121
122 /* length of RQ buffer */
123 __aligned_u64 rq_len;
124};
125
126struct qedr_create_qp_uresp {
127 __u32 qp_id;
128 __u32 atomic_supported;
129
130 /* SQ */
131 __u32 sq_db_offset;
132 __u16 sq_icid;
133
134 /* RQ */
135 __u32 rq_db_offset;
136 __u16 rq_icid;
137
138 __u32 rq_db2_offset;
139 __u32 reserved;
140
141 /* address of SQ doorbell recovery user entry */
142 __aligned_u64 sq_db_rec_addr;
143
144 /* address of RQ doorbell recovery user entry */
145 __aligned_u64 rq_db_rec_addr;
146
147};
148
149struct qedr_create_srq_ureq {
150 /* user space virtual address of producer pair */
151 __aligned_u64 prod_pair_addr;
152
153 /* user space virtual address of SRQ buffer */
154 __aligned_u64 srq_addr;
155
156 /* length of SRQ buffer */
157 __aligned_u64 srq_len;
158};
159
160struct qedr_create_srq_uresp {
161 __u16 srq_id;
162 __u16 reserved0;
163 __u32 reserved1;
164};
165
166/* doorbell recovery entry allocated and populated by userspace doorbelling
167 * entities and mapped to kernel. Kernel uses this to register doorbell
168 * information with doorbell drop recovery mechanism.
169 */
170struct qedr_user_db_rec {
171 __aligned_u64 db_data; /* doorbell data */
172};
173
174#endif /* __QEDR_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_netlink.h created+595
...@@ -0,0 +1,595 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _RDMA_NETLINK_H
3#define _RDMA_NETLINK_H
4
5#include <linux/types.h>
6
7enum {
8 RDMA_NL_IWCM = 2,
9 RDMA_NL_RSVD,
10 RDMA_NL_LS, /* RDMA Local Services */
11 RDMA_NL_NLDEV, /* RDMA device interface */
12 RDMA_NL_NUM_CLIENTS
13};
14
15enum {
16 RDMA_NL_GROUP_IWPM = 2,
17 RDMA_NL_GROUP_LS,
18 RDMA_NL_NUM_GROUPS
19};
20
21#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
22#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
23#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
24
25/* The minimum version that the iwpm kernel supports */
26#define IWPM_UABI_VERSION_MIN 3
27
28/* The latest version that the iwpm kernel supports */
29#define IWPM_UABI_VERSION 4
30
31/* iwarp port mapper message flags */
32enum {
33
34 /* Do not map the port for this IWPM request */
35 IWPM_FLAGS_NO_PORT_MAP = (1 << 0),
36};
37
38/* iwarp port mapper op-codes */
39enum {
40 RDMA_NL_IWPM_REG_PID = 0,
41 RDMA_NL_IWPM_ADD_MAPPING,
42 RDMA_NL_IWPM_QUERY_MAPPING,
43 RDMA_NL_IWPM_REMOVE_MAPPING,
44 RDMA_NL_IWPM_REMOTE_INFO,
45 RDMA_NL_IWPM_HANDLE_ERR,
46 RDMA_NL_IWPM_MAPINFO,
47 RDMA_NL_IWPM_MAPINFO_NUM,
48 RDMA_NL_IWPM_HELLO,
49 RDMA_NL_IWPM_NUM_OPS
50};
51
52enum {
53 IWPM_NLA_REG_PID_UNSPEC = 0,
54 IWPM_NLA_REG_PID_SEQ,
55 IWPM_NLA_REG_IF_NAME,
56 IWPM_NLA_REG_IBDEV_NAME,
57 IWPM_NLA_REG_ULIB_NAME,
58 IWPM_NLA_REG_PID_MAX
59};
60
61enum {
62 IWPM_NLA_RREG_PID_UNSPEC = 0,
63 IWPM_NLA_RREG_PID_SEQ,
64 IWPM_NLA_RREG_IBDEV_NAME,
65 IWPM_NLA_RREG_ULIB_NAME,
66 IWPM_NLA_RREG_ULIB_VER,
67 IWPM_NLA_RREG_PID_ERR,
68 IWPM_NLA_RREG_PID_MAX
69
70};
71
72enum {
73 IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
74 IWPM_NLA_MANAGE_MAPPING_SEQ,
75 IWPM_NLA_MANAGE_ADDR,
76 IWPM_NLA_MANAGE_FLAGS,
77 IWPM_NLA_MANAGE_MAPPING_MAX
78};
79
80enum {
81 IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0,
82 IWPM_NLA_RMANAGE_MAPPING_SEQ,
83 IWPM_NLA_RMANAGE_ADDR,
84 IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
85 /* The following maintains bisectability of rdma-core */
86 IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
87 IWPM_NLA_RMANAGE_MAPPING_ERR,
88 IWPM_NLA_RMANAGE_MAPPING_MAX
89};
90
91#define IWPM_NLA_MAPINFO_SEND_MAX 3
92#define IWPM_NLA_REMOVE_MAPPING_MAX 3
93
94enum {
95 IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
96 IWPM_NLA_QUERY_MAPPING_SEQ,
97 IWPM_NLA_QUERY_LOCAL_ADDR,
98 IWPM_NLA_QUERY_REMOTE_ADDR,
99 IWPM_NLA_QUERY_FLAGS,
100 IWPM_NLA_QUERY_MAPPING_MAX,
101};
102
103enum {
104 IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0,
105 IWPM_NLA_RQUERY_MAPPING_SEQ,
106 IWPM_NLA_RQUERY_LOCAL_ADDR,
107 IWPM_NLA_RQUERY_REMOTE_ADDR,
108 IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
109 IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
110 IWPM_NLA_RQUERY_MAPPING_ERR,
111 IWPM_NLA_RQUERY_MAPPING_MAX
112};
113
114enum {
115 IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
116 IWPM_NLA_MAPINFO_ULIB_NAME,
117 IWPM_NLA_MAPINFO_ULIB_VER,
118 IWPM_NLA_MAPINFO_REQ_MAX
119};
120
121enum {
122 IWPM_NLA_MAPINFO_UNSPEC = 0,
123 IWPM_NLA_MAPINFO_LOCAL_ADDR,
124 IWPM_NLA_MAPINFO_MAPPED_ADDR,
125 IWPM_NLA_MAPINFO_FLAGS,
126 IWPM_NLA_MAPINFO_MAX
127};
128
129enum {
130 IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
131 IWPM_NLA_MAPINFO_SEQ,
132 IWPM_NLA_MAPINFO_SEND_NUM,
133 IWPM_NLA_MAPINFO_ACK_NUM,
134 IWPM_NLA_MAPINFO_NUM_MAX
135};
136
137enum {
138 IWPM_NLA_ERR_UNSPEC = 0,
139 IWPM_NLA_ERR_SEQ,
140 IWPM_NLA_ERR_CODE,
141 IWPM_NLA_ERR_MAX
142};
143
144enum {
145 IWPM_NLA_HELLO_UNSPEC = 0,
146 IWPM_NLA_HELLO_ABI_VERSION,
147 IWPM_NLA_HELLO_MAX
148};
149
150/* For RDMA_NLDEV_ATTR_DEV_NODE_TYPE */
151enum {
152 /* IB values map to NodeInfo:NodeType. */
153 RDMA_NODE_IB_CA = 1,
154 RDMA_NODE_IB_SWITCH,
155 RDMA_NODE_IB_ROUTER,
156 RDMA_NODE_RNIC,
157 RDMA_NODE_USNIC,
158 RDMA_NODE_USNIC_UDP,
159 RDMA_NODE_UNSPECIFIED,
160};
161
162/*
163 * Local service operations:
164 * RESOLVE - The client requests the local service to resolve a path.
165 * SET_TIMEOUT - The local service requests the client to set the timeout.
166 * IP_RESOLVE - The client requests the local service to resolve an IP to GID.
167 */
168enum {
169 RDMA_NL_LS_OP_RESOLVE = 0,
170 RDMA_NL_LS_OP_SET_TIMEOUT,
171 RDMA_NL_LS_OP_IP_RESOLVE,
172 RDMA_NL_LS_NUM_OPS
173};
174
175/* Local service netlink message flags */
176#define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
177
178/*
179 * Local service resolve operation family header.
180 * The layout for the resolve operation:
181 * nlmsg header
182 * family header
183 * attributes
184 */
185
186/*
187 * Local service path use:
188 * Specify how the path(s) will be used.
189 * ALL - For connected CM operation (6 pathrecords)
190 * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
191 * GMP - For miscellaneous GMP like operation (at least 1 reversible
192 * pathrecord)
193 */
194enum {
195 LS_RESOLVE_PATH_USE_ALL = 0,
196 LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
197 LS_RESOLVE_PATH_USE_GMP,
198 LS_RESOLVE_PATH_USE_MAX
199};
200
201#define LS_DEVICE_NAME_MAX 64
202
203struct rdma_ls_resolve_header {
204 __u8 device_name[LS_DEVICE_NAME_MAX];
205 __u8 port_num;
206 __u8 path_use;
207};
208
209struct rdma_ls_ip_resolve_header {
210 __u32 ifindex;
211};
212
213/* Local service attribute type */
214#define RDMA_NLA_F_MANDATORY (1 << 13)
215#define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
216 RDMA_NLA_F_MANDATORY))
217
218/*
219 * Local service attributes:
220 * Attr Name Size Byte order
221 * -----------------------------------------------------
222 * PATH_RECORD struct ib_path_rec_data
223 * TIMEOUT u32 cpu
224 * SERVICE_ID u64 cpu
225 * DGID u8[16] BE
226 * SGID u8[16] BE
227 * TCLASS u8
228 * PKEY u16 cpu
229 * QOS_CLASS u16 cpu
230 * IPV4 u32 BE
231 * IPV6 u8[16] BE
232 */
233enum {
234 LS_NLA_TYPE_UNSPEC = 0,
235 LS_NLA_TYPE_PATH_RECORD,
236 LS_NLA_TYPE_TIMEOUT,
237 LS_NLA_TYPE_SERVICE_ID,
238 LS_NLA_TYPE_DGID,
239 LS_NLA_TYPE_SGID,
240 LS_NLA_TYPE_TCLASS,
241 LS_NLA_TYPE_PKEY,
242 LS_NLA_TYPE_QOS_CLASS,
243 LS_NLA_TYPE_IPV4,
244 LS_NLA_TYPE_IPV6,
245 LS_NLA_TYPE_MAX
246};
247
248/* Local service DGID/SGID attribute: big endian */
249struct rdma_nla_ls_gid {
250 __u8 gid[16];
251};
252
253enum rdma_nldev_command {
254 RDMA_NLDEV_CMD_UNSPEC,
255
256 RDMA_NLDEV_CMD_GET, /* can dump */
257 RDMA_NLDEV_CMD_SET,
258
259 RDMA_NLDEV_CMD_NEWLINK,
260
261 RDMA_NLDEV_CMD_DELLINK,
262
263 RDMA_NLDEV_CMD_PORT_GET, /* can dump */
264
265 RDMA_NLDEV_CMD_SYS_GET,
266 RDMA_NLDEV_CMD_SYS_SET,
267
268 /* 8 is free to use */
269
270 RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */
271
272 RDMA_NLDEV_CMD_RES_QP_GET, /* can dump */
273
274 RDMA_NLDEV_CMD_RES_CM_ID_GET, /* can dump */
275
276 RDMA_NLDEV_CMD_RES_CQ_GET, /* can dump */
277
278 RDMA_NLDEV_CMD_RES_MR_GET, /* can dump */
279
280 RDMA_NLDEV_CMD_RES_PD_GET, /* can dump */
281
282 RDMA_NLDEV_CMD_GET_CHARDEV,
283
284 RDMA_NLDEV_CMD_STAT_SET,
285
286 RDMA_NLDEV_CMD_STAT_GET, /* can dump */
287
288 RDMA_NLDEV_CMD_STAT_DEL,
289
290 RDMA_NLDEV_CMD_RES_QP_GET_RAW,
291
292 RDMA_NLDEV_CMD_RES_CQ_GET_RAW,
293
294 RDMA_NLDEV_CMD_RES_MR_GET_RAW,
295
296 RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */
297
298 RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */
299
300 RDMA_NLDEV_CMD_STAT_GET_STATUS,
301
302 RDMA_NLDEV_NUM_OPS
303};
304
305enum rdma_nldev_print_type {
306 RDMA_NLDEV_PRINT_TYPE_UNSPEC,
307 RDMA_NLDEV_PRINT_TYPE_HEX,
308};
309
310enum rdma_nldev_attr {
311 /* don't change the order or add anything between, this is ABI! */
312 RDMA_NLDEV_ATTR_UNSPEC,
313
314 /* Pad attribute for 64b alignment */
315 RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
316
317 /* Identifier for ib_device */
318 RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
319
320 RDMA_NLDEV_ATTR_DEV_NAME, /* string */
321 /*
322 * Device index together with port index are identifiers
323 * for port/link properties.
324 *
325 * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
326 * of available ports in ib_device, while for port specific operations,
327 * it will be real port index as it appears in sysfs. Port index follows
328 * sysfs notation and starts from 1 for the first port.
329 */
330 RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
331
332 /*
333 * Device and port capabilities
334 *
335 * When used for port info, first 32-bits are CapabilityMask followed by
336 * 16-bit CapabilityMask2.
337 */
338 RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */
339
340 /*
341 * FW version
342 */
343 RDMA_NLDEV_ATTR_FW_VERSION, /* string */
344
345 /*
346 * Node GUID (in host byte order) associated with the RDMA device.
347 */
348 RDMA_NLDEV_ATTR_NODE_GUID, /* u64 */
349
350 /*
351 * System image GUID (in host byte order) associated with
352 * this RDMA device and other devices which are part of a
353 * single system.
354 */
355 RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
356
357 /*
358 * Subnet prefix (in host byte order)
359 */
360 RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
361
362 /*
363 * Local Identifier (LID),
364 * According to IB specification, It is 16-bit address assigned
365 * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
366 */
367 RDMA_NLDEV_ATTR_LID, /* u32 */
368 RDMA_NLDEV_ATTR_SM_LID, /* u32 */
369
370 /*
371 * LID mask control (LMC)
372 */
373 RDMA_NLDEV_ATTR_LMC, /* u8 */
374
375 RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
376 RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
377
378 RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
379
380 RDMA_NLDEV_ATTR_RES_SUMMARY, /* nested table */
381 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY, /* nested table */
382 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME, /* string */
383 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR, /* u64 */
384
385 RDMA_NLDEV_ATTR_RES_QP, /* nested table */
386 RDMA_NLDEV_ATTR_RES_QP_ENTRY, /* nested table */
387 /*
388 * Local QPN
389 */
390 RDMA_NLDEV_ATTR_RES_LQPN, /* u32 */
391 /*
392 * Remote QPN,
393 * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
394 */
395 RDMA_NLDEV_ATTR_RES_RQPN, /* u32 */
396 /*
397 * Receive Queue PSN,
398 * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
399 */
400 RDMA_NLDEV_ATTR_RES_RQ_PSN, /* u32 */
401 /*
402 * Send Queue PSN
403 */
404 RDMA_NLDEV_ATTR_RES_SQ_PSN, /* u32 */
405 RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE, /* u8 */
406 /*
407 * QP types as visible to RDMA/core, the reserved QPT
408 * are not exported through this interface.
409 */
410 RDMA_NLDEV_ATTR_RES_TYPE, /* u8 */
411 RDMA_NLDEV_ATTR_RES_STATE, /* u8 */
412 /*
413 * Process ID which created object,
414 * in case of kernel origin, PID won't exist.
415 */
416 RDMA_NLDEV_ATTR_RES_PID, /* u32 */
417 /*
418 * The name of process created following resource.
419 * It will exist only for kernel objects.
420 * For user created objects, the user is supposed
421 * to read /proc/PID/comm file.
422 */
423 RDMA_NLDEV_ATTR_RES_KERN_NAME, /* string */
424
425 RDMA_NLDEV_ATTR_RES_CM_ID, /* nested table */
426 RDMA_NLDEV_ATTR_RES_CM_ID_ENTRY, /* nested table */
427 /*
428 * rdma_cm_id port space.
429 */
430 RDMA_NLDEV_ATTR_RES_PS, /* u32 */
431 /*
432 * Source and destination socket addresses
433 */
434 RDMA_NLDEV_ATTR_RES_SRC_ADDR, /* __kernel_sockaddr_storage */
435 RDMA_NLDEV_ATTR_RES_DST_ADDR, /* __kernel_sockaddr_storage */
436
437 RDMA_NLDEV_ATTR_RES_CQ, /* nested table */
438 RDMA_NLDEV_ATTR_RES_CQ_ENTRY, /* nested table */
439 RDMA_NLDEV_ATTR_RES_CQE, /* u32 */
440 RDMA_NLDEV_ATTR_RES_USECNT, /* u64 */
441 RDMA_NLDEV_ATTR_RES_POLL_CTX, /* u8 */
442
443 RDMA_NLDEV_ATTR_RES_MR, /* nested table */
444 RDMA_NLDEV_ATTR_RES_MR_ENTRY, /* nested table */
445 RDMA_NLDEV_ATTR_RES_RKEY, /* u32 */
446 RDMA_NLDEV_ATTR_RES_LKEY, /* u32 */
447 RDMA_NLDEV_ATTR_RES_IOVA, /* u64 */
448 RDMA_NLDEV_ATTR_RES_MRLEN, /* u64 */
449
450 RDMA_NLDEV_ATTR_RES_PD, /* nested table */
451 RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
452 RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
453 RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
454 /*
455 * Provides logical name and index of netdevice which is
456 * connected to physical port. This information is relevant
457 * for RoCE and iWARP.
458 *
459 * The netdevices which are associated with containers are
460 * supposed to be exported together with GID table once it
461 * will be exposed through the netlink. Because the
462 * associated netdevices are properties of GIDs.
463 */
464 RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
465 RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
466 /*
467 * driver-specific attributes.
468 */
469 RDMA_NLDEV_ATTR_DRIVER, /* nested table */
470 RDMA_NLDEV_ATTR_DRIVER_ENTRY, /* nested table */
471 RDMA_NLDEV_ATTR_DRIVER_STRING, /* string */
472 /*
473 * u8 values from enum rdma_nldev_print_type
474 */
475 RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE, /* u8 */
476 RDMA_NLDEV_ATTR_DRIVER_S32, /* s32 */
477 RDMA_NLDEV_ATTR_DRIVER_U32, /* u32 */
478 RDMA_NLDEV_ATTR_DRIVER_S64, /* s64 */
479 RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
480
481 /*
482 * Indexes to get/set secific entry,
483 * for QP use RDMA_NLDEV_ATTR_RES_LQPN
484 */
485 RDMA_NLDEV_ATTR_RES_PDN, /* u32 */
486 RDMA_NLDEV_ATTR_RES_CQN, /* u32 */
487 RDMA_NLDEV_ATTR_RES_MRN, /* u32 */
488 RDMA_NLDEV_ATTR_RES_CM_IDN, /* u32 */
489 RDMA_NLDEV_ATTR_RES_CTXN, /* u32 */
490 /*
491 * Identifies the rdma driver. eg: "rxe" or "siw"
492 */
493 RDMA_NLDEV_ATTR_LINK_TYPE, /* string */
494
495 /*
496 * net namespace mode for rdma subsystem:
497 * either shared or exclusive among multiple net namespaces.
498 */
499 RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */
500 /*
501 * Device protocol, e.g. ib, iw, usnic, roce and opa
502 */
503 RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */
504
505 /*
506 * File descriptor handle of the net namespace object
507 */
508 RDMA_NLDEV_NET_NS_FD, /* u32 */
509 /*
510 * Information about a chardev.
511 * CHARDEV_TYPE is the name of the chardev ABI (ie uverbs, umad, etc)
512 * CHARDEV_ABI signals the ABI revision (historical)
513 * CHARDEV_NAME is the kernel name for the /dev/ file (no directory)
514 * CHARDEV is the 64 bit dev_t for the inode
515 */
516 RDMA_NLDEV_ATTR_CHARDEV_TYPE, /* string */
517 RDMA_NLDEV_ATTR_CHARDEV_NAME, /* string */
518 RDMA_NLDEV_ATTR_CHARDEV_ABI, /* u64 */
519 RDMA_NLDEV_ATTR_CHARDEV, /* u64 */
520 RDMA_NLDEV_ATTR_UVERBS_DRIVER_ID, /* u64 */
521 /*
522 * Counter-specific attributes.
523 */
524 RDMA_NLDEV_ATTR_STAT_MODE, /* u32 */
525 RDMA_NLDEV_ATTR_STAT_RES, /* u32 */
526 RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK, /* u32 */
527 RDMA_NLDEV_ATTR_STAT_COUNTER, /* nested table */
528 RDMA_NLDEV_ATTR_STAT_COUNTER_ENTRY, /* nested table */
529 RDMA_NLDEV_ATTR_STAT_COUNTER_ID, /* u32 */
530 RDMA_NLDEV_ATTR_STAT_HWCOUNTERS, /* nested table */
531 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY, /* nested table */
532 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_NAME, /* string */
533 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_VALUE, /* u64 */
534
535 /*
536 * CQ adaptive moderatio (DIM)
537 */
538 RDMA_NLDEV_ATTR_DEV_DIM, /* u8 */
539
540 RDMA_NLDEV_ATTR_RES_RAW, /* binary */
541
542 RDMA_NLDEV_ATTR_RES_CTX, /* nested table */
543 RDMA_NLDEV_ATTR_RES_CTX_ENTRY, /* nested table */
544
545 RDMA_NLDEV_ATTR_RES_SRQ, /* nested table */
546 RDMA_NLDEV_ATTR_RES_SRQ_ENTRY, /* nested table */
547 RDMA_NLDEV_ATTR_RES_SRQN, /* u32 */
548
549 RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */
550 RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */
551
552 RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */
553
554 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX, /* u32 */
555 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */
556
557 /*
558 * Always the end
559 */
560 RDMA_NLDEV_ATTR_MAX
561};
562
563/*
564 * Supported counter bind modes. All modes are mutual-exclusive.
565 */
566enum rdma_nl_counter_mode {
567 RDMA_COUNTER_MODE_NONE,
568
569 /*
570 * A qp is bound with a counter automatically during initialization
571 * based on the auto mode (e.g., qp type, ...)
572 */
573 RDMA_COUNTER_MODE_AUTO,
574
575 /*
576 * Which qp are bound with which counter is explicitly specified
577 * by the user
578 */
579 RDMA_COUNTER_MODE_MANUAL,
580
581 /*
582 * Always the end
583 */
584 RDMA_COUNTER_MODE_MAX,
585};
586
587/*
588 * Supported criteria in counter auto mode.
589 * Currently only "qp type" is supported
590 */
591enum rdma_nl_counter_mask {
592 RDMA_COUNTER_MASK_QP_TYPE = 1,
593 RDMA_COUNTER_MASK_PID = 1 << 1,
594};
595#endif /* _RDMA_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_user_cm.h created+341
...@@ -0,0 +1,341 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005-2006 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_CM_H
35#define RDMA_USER_CM_H
36
37#include <linux/types.h>
38#include <linux/socket.h>
39#include <linux/in6.h>
40#include <rdma/ib_user_verbs.h>
41#include <rdma/ib_user_sa.h>
42
43#define RDMA_USER_CM_ABI_VERSION 4
44
45#define RDMA_MAX_PRIVATE_DATA 256
46
47enum {
48 RDMA_USER_CM_CMD_CREATE_ID,
49 RDMA_USER_CM_CMD_DESTROY_ID,
50 RDMA_USER_CM_CMD_BIND_IP,
51 RDMA_USER_CM_CMD_RESOLVE_IP,
52 RDMA_USER_CM_CMD_RESOLVE_ROUTE,
53 RDMA_USER_CM_CMD_QUERY_ROUTE,
54 RDMA_USER_CM_CMD_CONNECT,
55 RDMA_USER_CM_CMD_LISTEN,
56 RDMA_USER_CM_CMD_ACCEPT,
57 RDMA_USER_CM_CMD_REJECT,
58 RDMA_USER_CM_CMD_DISCONNECT,
59 RDMA_USER_CM_CMD_INIT_QP_ATTR,
60 RDMA_USER_CM_CMD_GET_EVENT,
61 RDMA_USER_CM_CMD_GET_OPTION,
62 RDMA_USER_CM_CMD_SET_OPTION,
63 RDMA_USER_CM_CMD_NOTIFY,
64 RDMA_USER_CM_CMD_JOIN_IP_MCAST,
65 RDMA_USER_CM_CMD_LEAVE_MCAST,
66 RDMA_USER_CM_CMD_MIGRATE_ID,
67 RDMA_USER_CM_CMD_QUERY,
68 RDMA_USER_CM_CMD_BIND,
69 RDMA_USER_CM_CMD_RESOLVE_ADDR,
70 RDMA_USER_CM_CMD_JOIN_MCAST
71};
72
73/* See IBTA Annex A11, servies ID bytes 4 & 5 */
74enum rdma_ucm_port_space {
75 RDMA_PS_IPOIB = 0x0002,
76 RDMA_PS_IB = 0x013F,
77 RDMA_PS_TCP = 0x0106,
78 RDMA_PS_UDP = 0x0111,
79};
80
81/*
82 * command ABI structures.
83 */
84struct rdma_ucm_cmd_hdr {
85 __u32 cmd;
86 __u16 in;
87 __u16 out;
88};
89
90struct rdma_ucm_create_id {
91 __aligned_u64 uid;
92 __aligned_u64 response;
93 __u16 ps; /* use enum rdma_ucm_port_space */
94 __u8 qp_type;
95 __u8 reserved[5];
96};
97
98struct rdma_ucm_create_id_resp {
99 __u32 id;
100};
101
102struct rdma_ucm_destroy_id {
103 __aligned_u64 response;
104 __u32 id;
105 __u32 reserved;
106};
107
108struct rdma_ucm_destroy_id_resp {
109 __u32 events_reported;
110};
111
112struct rdma_ucm_bind_ip {
113 __aligned_u64 response;
114 struct sockaddr_in6 addr;
115 __u32 id;
116};
117
118struct rdma_ucm_bind {
119 __u32 id;
120 __u16 addr_size;
121 __u16 reserved;
122 struct __kernel_sockaddr_storage addr;
123};
124
125struct rdma_ucm_resolve_ip {
126 struct sockaddr_in6 src_addr;
127 struct sockaddr_in6 dst_addr;
128 __u32 id;
129 __u32 timeout_ms;
130};
131
132struct rdma_ucm_resolve_addr {
133 __u32 id;
134 __u32 timeout_ms;
135 __u16 src_size;
136 __u16 dst_size;
137 __u32 reserved;
138 struct __kernel_sockaddr_storage src_addr;
139 struct __kernel_sockaddr_storage dst_addr;
140};
141
142struct rdma_ucm_resolve_route {
143 __u32 id;
144 __u32 timeout_ms;
145};
146
147enum {
148 RDMA_USER_CM_QUERY_ADDR,
149 RDMA_USER_CM_QUERY_PATH,
150 RDMA_USER_CM_QUERY_GID
151};
152
153struct rdma_ucm_query {
154 __aligned_u64 response;
155 __u32 id;
156 __u32 option;
157};
158
159struct rdma_ucm_query_route_resp {
160 __aligned_u64 node_guid;
161 struct ib_user_path_rec ib_route[2];
162 struct sockaddr_in6 src_addr;
163 struct sockaddr_in6 dst_addr;
164 __u32 num_paths;
165 __u8 port_num;
166 __u8 reserved[3];
167 __u32 ibdev_index;
168 __u32 reserved1;
169};
170
171struct rdma_ucm_query_addr_resp {
172 __aligned_u64 node_guid;
173 __u8 port_num;
174 __u8 reserved;
175 __u16 pkey;
176 __u16 src_size;
177 __u16 dst_size;
178 struct __kernel_sockaddr_storage src_addr;
179 struct __kernel_sockaddr_storage dst_addr;
180 __u32 ibdev_index;
181 __u32 reserved1;
182};
183
184struct rdma_ucm_query_path_resp {
185 __u32 num_paths;
186 __u32 reserved;
187 struct ib_path_rec_data path_data[0];
188};
189
190struct rdma_ucm_conn_param {
191 __u32 qp_num;
192 __u32 qkey;
193 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
194 __u8 private_data_len;
195 __u8 srq;
196 __u8 responder_resources;
197 __u8 initiator_depth;
198 __u8 flow_control;
199 __u8 retry_count;
200 __u8 rnr_retry_count;
201 __u8 valid;
202};
203
204struct rdma_ucm_ud_param {
205 __u32 qp_num;
206 __u32 qkey;
207 struct ib_uverbs_ah_attr ah_attr;
208 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
209 __u8 private_data_len;
210 __u8 reserved[7];
211};
212
213struct rdma_ucm_ece {
214 __u32 vendor_id;
215 __u32 attr_mod;
216};
217
218struct rdma_ucm_connect {
219 struct rdma_ucm_conn_param conn_param;
220 __u32 id;
221 __u32 reserved;
222 struct rdma_ucm_ece ece;
223};
224
225struct rdma_ucm_listen {
226 __u32 id;
227 __u32 backlog;
228};
229
230struct rdma_ucm_accept {
231 __aligned_u64 uid;
232 struct rdma_ucm_conn_param conn_param;
233 __u32 id;
234 __u32 reserved;
235 struct rdma_ucm_ece ece;
236};
237
238struct rdma_ucm_reject {
239 __u32 id;
240 __u8 private_data_len;
241 __u8 reason;
242 __u8 reserved[2];
243 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
244};
245
246struct rdma_ucm_disconnect {
247 __u32 id;
248};
249
250struct rdma_ucm_init_qp_attr {
251 __aligned_u64 response;
252 __u32 id;
253 __u32 qp_state;
254};
255
256struct rdma_ucm_notify {
257 __u32 id;
258 __u32 event;
259};
260
261struct rdma_ucm_join_ip_mcast {
262 __aligned_u64 response; /* rdma_ucm_create_id_resp */
263 __aligned_u64 uid;
264 struct sockaddr_in6 addr;
265 __u32 id;
266};
267
268/* Multicast join flags */
269enum {
270 RDMA_MC_JOIN_FLAG_FULLMEMBER,
271 RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
272 RDMA_MC_JOIN_FLAG_RESERVED,
273};
274
275struct rdma_ucm_join_mcast {
276 __aligned_u64 response; /* rdma_ucma_create_id_resp */
277 __aligned_u64 uid;
278 __u32 id;
279 __u16 addr_size;
280 __u16 join_flags;
281 struct __kernel_sockaddr_storage addr;
282};
283
284struct rdma_ucm_get_event {
285 __aligned_u64 response;
286};
287
288struct rdma_ucm_event_resp {
289 __aligned_u64 uid;
290 __u32 id;
291 __u32 event;
292 __u32 status;
293 /*
294 * NOTE: This union is not aligned to 8 bytes so none of the union
295 * members may contain a u64 or anything with higher alignment than 4.
296 */
297 union {
298 struct rdma_ucm_conn_param conn;
299 struct rdma_ucm_ud_param ud;
300 } param;
301 __u32 reserved;
302 struct rdma_ucm_ece ece;
303};
304
305/* Option levels */
306enum {
307 RDMA_OPTION_ID = 0,
308 RDMA_OPTION_IB = 1
309};
310
311/* Option details */
312enum {
313 RDMA_OPTION_ID_TOS = 0,
314 RDMA_OPTION_ID_REUSEADDR = 1,
315 RDMA_OPTION_ID_AFONLY = 2,
316 RDMA_OPTION_ID_ACK_TIMEOUT = 3
317};
318
319enum {
320 RDMA_OPTION_IB_PATH = 1
321};
322
323struct rdma_ucm_set_option {
324 __aligned_u64 optval;
325 __u32 id;
326 __u32 level;
327 __u32 optname;
328 __u32 optlen;
329};
330
331struct rdma_ucm_migrate_id {
332 __aligned_u64 response;
333 __u32 id;
334 __u32 fd;
335};
336
337struct rdma_ucm_migrate_resp {
338 __u32 events_reported;
339};
340
341#endif /* RDMA_USER_CM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_user_ioctl.h created+85
...@@ -0,0 +1,85 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Mellanox Technologies, LTD. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_IOCTL_H
35#define RDMA_USER_IOCTL_H
36
37#include <rdma/ib_user_mad.h>
38#include <rdma/hfi/hfi1_ioctl.h>
39#include <rdma/rdma_user_ioctl_cmds.h>
40
41/* Legacy name, for user space application which already use it */
42#define IB_IOCTL_MAGIC RDMA_IOCTL_MAGIC
43
44/*
45 * General blocks assignments
46 * It is closed on purpose - do not expose it to user space
47 * #define MAD_CMD_BASE 0x00
48 * #define HFI1_CMD_BAS 0xE0
49 */
50
51/* MAD specific section */
52#define IB_USER_MAD_REGISTER_AGENT _IOWR(RDMA_IOCTL_MAGIC, 0x01, struct ib_user_mad_reg_req)
53#define IB_USER_MAD_UNREGISTER_AGENT _IOW(RDMA_IOCTL_MAGIC, 0x02, __u32)
54#define IB_USER_MAD_ENABLE_PKEY _IO(RDMA_IOCTL_MAGIC, 0x03)
55#define IB_USER_MAD_REGISTER_AGENT2 _IOWR(RDMA_IOCTL_MAGIC, 0x04, struct ib_user_mad_reg_req2)
56
57/* HFI specific section */
58/* allocate HFI and context */
59#define HFI1_IOCTL_ASSIGN_CTXT _IOWR(RDMA_IOCTL_MAGIC, 0xE1, struct hfi1_user_info)
60/* find out what resources we got */
61#define HFI1_IOCTL_CTXT_INFO _IOW(RDMA_IOCTL_MAGIC, 0xE2, struct hfi1_ctxt_info)
62/* set up userspace */
63#define HFI1_IOCTL_USER_INFO _IOW(RDMA_IOCTL_MAGIC, 0xE3, struct hfi1_base_info)
64/* update expected TID entries */
65#define HFI1_IOCTL_TID_UPDATE _IOWR(RDMA_IOCTL_MAGIC, 0xE4, struct hfi1_tid_info)
66/* free expected TID entries */
67#define HFI1_IOCTL_TID_FREE _IOWR(RDMA_IOCTL_MAGIC, 0xE5, struct hfi1_tid_info)
68/* force an update of PIO credit */
69#define HFI1_IOCTL_CREDIT_UPD _IO(RDMA_IOCTL_MAGIC, 0xE6)
70/* control receipt of packets */
71#define HFI1_IOCTL_RECV_CTRL _IOW(RDMA_IOCTL_MAGIC, 0xE8, int)
72/* set the kind of polling we want */
73#define HFI1_IOCTL_POLL_TYPE _IOW(RDMA_IOCTL_MAGIC, 0xE9, int)
74/* ack & clear user status bits */
75#define HFI1_IOCTL_ACK_EVENT _IOW(RDMA_IOCTL_MAGIC, 0xEA, unsigned long)
76/* set context's pkey */
77#define HFI1_IOCTL_SET_PKEY _IOW(RDMA_IOCTL_MAGIC, 0xEB, __u16)
78/* reset context's HW send context */
79#define HFI1_IOCTL_CTXT_RESET _IO(RDMA_IOCTL_MAGIC, 0xEC)
80/* read TID cache invalidations */
81#define HFI1_IOCTL_TID_INVAL_READ _IOWR(RDMA_IOCTL_MAGIC, 0xED, struct hfi1_tid_info)
82/* get the version of the user cdev */
83#define HFI1_IOCTL_GET_VERS _IOR(RDMA_IOCTL_MAGIC, 0xEE, int)
84
85#endif /* RDMA_USER_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_user_ioctl_cmds.h created+87
...@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef RDMA_USER_IOCTL_CMDS_H
34#define RDMA_USER_IOCTL_CMDS_H
35
36#include <linux/types.h>
37#include <linux/ioctl.h>
38
39/* Documentation/userspace-api/ioctl/ioctl-number.rst */
40#define RDMA_IOCTL_MAGIC 0x1b
41#define RDMA_VERBS_IOCTL \
42 _IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)
43
44enum {
45 /* User input */
46 UVERBS_ATTR_F_MANDATORY = 1U << 0,
47 /*
48 * Valid output bit should be ignored and considered set in
49 * mandatory fields. This bit is kernel output.
50 */
51 UVERBS_ATTR_F_VALID_OUTPUT = 1U << 1,
52};
53
54struct ib_uverbs_attr {
55 __u16 attr_id; /* command specific type attribute */
56 __u16 len; /* only for pointers and IDRs array */
57 __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */
58 union {
59 struct {
60 __u8 elem_id;
61 __u8 reserved;
62 } enum_data;
63 __u16 reserved;
64 } attr_data;
65 union {
66 /*
67 * ptr to command, __inline__ data, idr/fd or
68 * ptr to __u32 array of IDRs
69 */
70 __aligned_u64 data;
71 /* Used by FD_IN and FD_OUT */
72 __s64 data_s64;
73 };
74};
75
76struct ib_uverbs_ioctl_hdr {
77 __u16 length;
78 __u16 object_id;
79 __u16 method_id;
80 __u16 num_attrs;
81 __aligned_u64 reserved1;
82 __u32 driver_id;
83 __u32 reserved2;
84 struct ib_uverbs_attr attrs[0];
85};
86
87#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_user_rxe.h created+213
...@@ -0,0 +1,213 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_RXE_H
35#define RDMA_USER_RXE_H
36
37#include <linux/types.h>
38#include <linux/socket.h>
39#include <linux/in.h>
40#include <linux/in6.h>
41
42enum {
43 RXE_NETWORK_TYPE_IPV4 = 1,
44 RXE_NETWORK_TYPE_IPV6 = 2,
45};
46
47union rxe_gid {
48 __u8 raw[16];
49 struct {
50 __be64 subnet_prefix;
51 __be64 interface_id;
52 } global;
53};
54
55struct rxe_global_route {
56 union rxe_gid dgid;
57 __u32 flow_label;
58 __u8 sgid_index;
59 __u8 hop_limit;
60 __u8 traffic_class;
61};
62
63struct rxe_av {
64 __u8 port_num;
65 /* From RXE_NETWORK_TYPE_* */
66 __u8 network_type;
67 __u8 dmac[6];
68 struct rxe_global_route grh;
69 union {
70 struct sockaddr_in _sockaddr_in;
71 struct sockaddr_in6 _sockaddr_in6;
72 } sgid_addr, dgid_addr;
73};
74
75struct rxe_send_wr {
76 __aligned_u64 wr_id;
77 __u32 num_sge;
78 __u32 opcode;
79 __u32 send_flags;
80 union {
81 __be32 imm_data;
82 __u32 invalidate_rkey;
83 } ex;
84 union {
85 struct {
86 __aligned_u64 remote_addr;
87 __u32 rkey;
88 __u32 reserved;
89 } rdma;
90 struct {
91 __aligned_u64 remote_addr;
92 __aligned_u64 compare_add;
93 __aligned_u64 swap;
94 __u32 rkey;
95 __u32 reserved;
96 } atomic;
97 struct {
98 __u32 remote_qpn;
99 __u32 remote_qkey;
100 __u16 pkey_index;
101 __u16 reserved;
102 __u32 ah_num;
103 __u32 pad[4];
104 struct rxe_av av;
105 } ud;
106 struct {
107 __aligned_u64 addr;
108 __aligned_u64 length;
109 __u32 mr_lkey;
110 __u32 mw_rkey;
111 __u32 rkey;
112 __u32 access;
113 } mw;
114 /* reg is only used by the kernel and is not part of the uapi */
115 } wr;
116};
117
118struct rxe_sge {
119 __aligned_u64 addr;
120 __u32 length;
121 __u32 lkey;
122};
123
124struct mminfo {
125 __aligned_u64 offset;
126 __u32 size;
127 __u32 pad;
128};
129
130struct rxe_dma_info {
131 __u32 length;
132 __u32 resid;
133 __u32 cur_sge;
134 __u32 num_sge;
135 __u32 sge_offset;
136 __u32 reserved;
137 union {
138 __DECLARE_FLEX_ARRAY(__u8, inline_data);
139 __DECLARE_FLEX_ARRAY(struct rxe_sge, sge);
140 };
141};
142
143struct rxe_send_wqe {
144 struct rxe_send_wr wr;
145 __u32 status;
146 __u32 state;
147 __aligned_u64 iova;
148 __u32 mask;
149 __u32 first_psn;
150 __u32 last_psn;
151 __u32 ack_length;
152 __u32 ssn;
153 __u32 has_rd_atomic;
154 struct rxe_dma_info dma;
155};
156
157struct rxe_recv_wqe {
158 __aligned_u64 wr_id;
159 __u32 num_sge;
160 __u32 padding;
161 struct rxe_dma_info dma;
162};
163
164struct rxe_create_ah_resp {
165 __u32 ah_num;
166 __u32 reserved;
167};
168
169struct rxe_create_cq_resp {
170 struct mminfo mi;
171};
172
173struct rxe_resize_cq_resp {
174 struct mminfo mi;
175};
176
177struct rxe_create_qp_resp {
178 struct mminfo rq_mi;
179 struct mminfo sq_mi;
180};
181
182struct rxe_create_srq_resp {
183 struct mminfo mi;
184 __u32 srq_num;
185 __u32 reserved;
186};
187
188struct rxe_modify_srq_cmd {
189 __aligned_u64 mmap_info_addr;
190};
191
192/* This data structure is stored at the base of work and
193 * completion queues shared between user space and kernel space.
194 * It contains the producer and consumer indices. Is also
195 * contains a copy of the queue size parameters for user space
196 * to use but the kernel must use the parameters in the
197 * rxe_queue struct. For performance reasons arrange to have
198 * producer and consumer indices in separate cache lines
199 * the kernel should always mask the indices to avoid accessing
200 * memory outside of the data area
201 */
202struct rxe_queue_buf {
203 __u32 log2_elem_size;
204 __u32 index_mask;
205 __u32 pad_1[30];
206 __u32 producer_index;
207 __u32 pad_2[31];
208 __u32 consumer_index;
209 __u32 pad_3[31];
210 __u8 data[];
211};
212
213#endif /* RDMA_USER_RXE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rvt-abi.h created+66
...@@ -0,0 +1,66 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2
3/*
4 * This file contains defines, structures, etc. that are used
5 * to communicate between kernel and user code.
6 */
7
8#ifndef RVT_ABI_USER_H
9#define RVT_ABI_USER_H
10
11#include <linux/types.h>
12#include <rdma/ib_user_verbs.h>
13#ifndef RDMA_ATOMIC_UAPI
14#define RDMA_ATOMIC_UAPI(_type, _name) struct{ _type val; } _name
15#endif
16
17struct rvt_wqe_sge {
18 __aligned_u64 addr;
19 __u32 length;
20 __u32 lkey;
21};
22
23/*
24 * This structure is used to contain the head pointer, tail pointer,
25 * and completion queue entries as a single memory allocation so
26 * it can be mmap'ed into user space.
27 */
28struct rvt_cq_wc {
29 /* index of next entry to fill */
30 RDMA_ATOMIC_UAPI(__u32, head);
31 /* index of next ib_poll_cq() entry */
32 RDMA_ATOMIC_UAPI(__u32, tail);
33
34 /* these are actually size ibcq.cqe + 1 */
35 struct ib_uverbs_wc uqueue[];
36};
37
38/*
39 * Receive work request queue entry.
40 * The size of the sg_list is determined when the QP (or SRQ) is created
41 * and stored in qp->r_rq.max_sge (or srq->rq.max_sge).
42 */
43struct rvt_rwqe {
44 __u64 wr_id;
45 __u8 num_sge;
46 __u8 padding[7];
47 struct rvt_wqe_sge sg_list[];
48};
49
50/*
51 * This structure is used to contain the head pointer, tail pointer,
52 * and receive work queue entries as a single memory allocation so
53 * it can be mmap'ed into user space.
54 * Note that the wq array elements are variable size so you can't
55 * just index into the array to get the N'th element;
56 * use get_rwqe_ptr() for user space and rvt_get_rwqe_ptr()
57 * for kernel space.
58 */
59struct rvt_rwq {
60 /* new work requests posted to the head */
61 RDMA_ATOMIC_UAPI(__u32, head);
62 /* receives pull requests from here. */
63 RDMA_ATOMIC_UAPI(__u32, tail);
64 struct rvt_rwqe wq[];
65};
66#endif /* RVT_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/siw-abi.h created+186
...@@ -0,0 +1,186 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) or BSD-3-Clause */
2
3/* Authors: Bernard Metzler <bmt@zurich.ibm.com> */
4/* Copyright (c) 2008-2019, IBM Corporation */
5
6#ifndef _SIW_USER_H
7#define _SIW_USER_H
8
9#include <linux/types.h>
10
11#define SIW_NODE_DESC_COMMON "Software iWARP stack"
12#define SIW_ABI_VERSION 1
13#define SIW_MAX_SGE 6
14#define SIW_UOBJ_MAX_KEY 0x08FFFF
15#define SIW_INVAL_UOBJ_KEY (SIW_UOBJ_MAX_KEY + 1)
16
17struct siw_uresp_create_cq {
18 __u32 cq_id;
19 __u32 num_cqe;
20 __aligned_u64 cq_key;
21};
22
23struct siw_uresp_create_qp {
24 __u32 qp_id;
25 __u32 num_sqe;
26 __u32 num_rqe;
27 __u32 pad;
28 __aligned_u64 sq_key;
29 __aligned_u64 rq_key;
30};
31
32struct siw_ureq_reg_mr {
33 __u8 stag_key;
34 __u8 reserved[3];
35 __u32 pad;
36};
37
38struct siw_uresp_reg_mr {
39 __u32 stag;
40 __u32 pad;
41};
42
43struct siw_uresp_create_srq {
44 __u32 num_rqe;
45 __u32 pad;
46 __aligned_u64 srq_key;
47};
48
49struct siw_uresp_alloc_ctx {
50 __u32 dev_id;
51 __u32 pad;
52};
53
54enum siw_opcode {
55 SIW_OP_WRITE,
56 SIW_OP_READ,
57 SIW_OP_READ_LOCAL_INV,
58 SIW_OP_SEND,
59 SIW_OP_SEND_WITH_IMM,
60 SIW_OP_SEND_REMOTE_INV,
61
62 /* Unsupported */
63 SIW_OP_FETCH_AND_ADD,
64 SIW_OP_COMP_AND_SWAP,
65
66 SIW_OP_RECEIVE,
67 /* provider internal SQE */
68 SIW_OP_READ_RESPONSE,
69 /*
70 * below opcodes valid for
71 * in-kernel clients only
72 */
73 SIW_OP_INVAL_STAG,
74 SIW_OP_REG_MR,
75 SIW_NUM_OPCODES
76};
77
78/* Keep it same as ibv_sge to allow for memcpy */
79struct siw_sge {
80 __aligned_u64 laddr;
81 __u32 length;
82 __u32 lkey;
83};
84
85/*
86 * Inline data are kept within the work request itself occupying
87 * the space of sge[1] .. sge[n]. Therefore, __inline__ data cannot be
88 * supported if SIW_MAX_SGE is below 2 elements.
89 */
90#define SIW_MAX_INLINE (sizeof(struct siw_sge) * (SIW_MAX_SGE - 1))
91
92#if SIW_MAX_SGE < 2
93#error "SIW_MAX_SGE must be at least 2"
94#endif
95
96enum siw_wqe_flags {
97 SIW_WQE_VALID = 1,
98 SIW_WQE_INLINE = (1 << 1),
99 SIW_WQE_SIGNALLED = (1 << 2),
100 SIW_WQE_SOLICITED = (1 << 3),
101 SIW_WQE_READ_FENCE = (1 << 4),
102 SIW_WQE_REM_INVAL = (1 << 5),
103 SIW_WQE_COMPLETED = (1 << 6)
104};
105
106/* Send Queue Element */
107struct siw_sqe {
108 __aligned_u64 id;
109 __u16 flags;
110 __u8 num_sge;
111 /* Contains enum siw_opcode values */
112 __u8 opcode;
113 __u32 rkey;
114 union {
115 __aligned_u64 raddr;
116 __aligned_u64 base_mr;
117 };
118 union {
119 struct siw_sge sge[SIW_MAX_SGE];
120 __aligned_u64 access;
121 };
122};
123
124/* Receive Queue Element */
125struct siw_rqe {
126 __aligned_u64 id;
127 __u16 flags;
128 __u8 num_sge;
129 /*
130 * only used by kernel driver,
131 * ignored if set by user
132 */
133 __u8 opcode;
134 __u32 unused;
135 struct siw_sge sge[SIW_MAX_SGE];
136};
137
138enum siw_notify_flags {
139 SIW_NOTIFY_NOT = (0),
140 SIW_NOTIFY_SOLICITED = (1 << 0),
141 SIW_NOTIFY_NEXT_COMPLETION = (1 << 1),
142 SIW_NOTIFY_MISSED_EVENTS = (1 << 2),
143 SIW_NOTIFY_ALL = SIW_NOTIFY_SOLICITED | SIW_NOTIFY_NEXT_COMPLETION |
144 SIW_NOTIFY_MISSED_EVENTS
145};
146
147enum siw_wc_status {
148 SIW_WC_SUCCESS,
149 SIW_WC_LOC_LEN_ERR,
150 SIW_WC_LOC_PROT_ERR,
151 SIW_WC_LOC_QP_OP_ERR,
152 SIW_WC_WR_FLUSH_ERR,
153 SIW_WC_BAD_RESP_ERR,
154 SIW_WC_LOC_ACCESS_ERR,
155 SIW_WC_REM_ACCESS_ERR,
156 SIW_WC_REM_INV_REQ_ERR,
157 SIW_WC_GENERAL_ERR,
158 SIW_NUM_WC_STATUS
159};
160
161struct siw_cqe {
162 __aligned_u64 id;
163 __u8 flags;
164 __u8 opcode;
165 __u16 status;
166 __u32 bytes;
167 union {
168 __aligned_u64 imm_data;
169 __u32 inval_stag;
170 };
171 /* QP number or QP pointer */
172 union {
173 struct ib_qp *base_qp;
174 __aligned_u64 qp_id;
175 };
176};
177
178/*
179 * Shared structure between user and kernel
180 * to control CQ arming.
181 */
182struct siw_cq_ctrl {
183 __u32 flags;
184 __u32 pad;
185};
186#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/vmw_pvrdma-abi.h created+310
...@@ -0,0 +1,310 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 * Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of EITHER the GNU General Public License
7 * version 2 as published by the Free Software Foundation or the BSD
8 * 2-Clause License. This program is distributed in the hope that it
9 * will be useful, but WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED
10 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11 * See the GNU General Public License version 2 for more details at
12 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program available in the file COPYING in the main
16 * directory of this source tree.
17 *
18 * The BSD 2-Clause License
19 *
20 * Redistribution and use in source and binary forms, with or
21 * without modification, are permitted provided that the following
22 * conditions are met:
23 *
24 * - Redistributions of source code must retain the above
25 * copyright notice, this list of conditions and the following
26 * disclaimer.
27 *
28 * - Redistributions in binary form must reproduce the above
29 * copyright notice, this list of conditions and the following
30 * disclaimer in the documentation and/or other materials
31 * provided with the distribution.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
38 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
42 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
44 * OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46
47#ifndef __VMW_PVRDMA_ABI_H__
48#define __VMW_PVRDMA_ABI_H__
49
50#include <linux/types.h>
51
52#define PVRDMA_UVERBS_ABI_VERSION 3 /* ABI Version. */
53#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */
54#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell. */
55#define PVRDMA_UAR_QP_SEND (1 << 30) /* Send bit. */
56#define PVRDMA_UAR_QP_RECV (1 << 31) /* Recv bit. */
57#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell. */
58#define PVRDMA_UAR_CQ_ARM_SOL (1 << 29) /* Arm solicited bit. */
59#define PVRDMA_UAR_CQ_ARM (1 << 30) /* Arm bit. */
60#define PVRDMA_UAR_CQ_POLL (1 << 31) /* Poll bit. */
61#define PVRDMA_UAR_SRQ_OFFSET 8 /* SRQ doorbell. */
62#define PVRDMA_UAR_SRQ_RECV (1 << 30) /* Recv bit. */
63
64enum pvrdma_wr_opcode {
65 PVRDMA_WR_RDMA_WRITE,
66 PVRDMA_WR_RDMA_WRITE_WITH_IMM,
67 PVRDMA_WR_SEND,
68 PVRDMA_WR_SEND_WITH_IMM,
69 PVRDMA_WR_RDMA_READ,
70 PVRDMA_WR_ATOMIC_CMP_AND_SWP,
71 PVRDMA_WR_ATOMIC_FETCH_AND_ADD,
72 PVRDMA_WR_LSO,
73 PVRDMA_WR_SEND_WITH_INV,
74 PVRDMA_WR_RDMA_READ_WITH_INV,
75 PVRDMA_WR_LOCAL_INV,
76 PVRDMA_WR_FAST_REG_MR,
77 PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP,
78 PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD,
79 PVRDMA_WR_BIND_MW,
80 PVRDMA_WR_REG_SIG_MR,
81 PVRDMA_WR_ERROR,
82};
83
84enum pvrdma_wc_status {
85 PVRDMA_WC_SUCCESS,
86 PVRDMA_WC_LOC_LEN_ERR,
87 PVRDMA_WC_LOC_QP_OP_ERR,
88 PVRDMA_WC_LOC_EEC_OP_ERR,
89 PVRDMA_WC_LOC_PROT_ERR,
90 PVRDMA_WC_WR_FLUSH_ERR,
91 PVRDMA_WC_MW_BIND_ERR,
92 PVRDMA_WC_BAD_RESP_ERR,
93 PVRDMA_WC_LOC_ACCESS_ERR,
94 PVRDMA_WC_REM_INV_REQ_ERR,
95 PVRDMA_WC_REM_ACCESS_ERR,
96 PVRDMA_WC_REM_OP_ERR,
97 PVRDMA_WC_RETRY_EXC_ERR,
98 PVRDMA_WC_RNR_RETRY_EXC_ERR,
99 PVRDMA_WC_LOC_RDD_VIOL_ERR,
100 PVRDMA_WC_REM_INV_RD_REQ_ERR,
101 PVRDMA_WC_REM_ABORT_ERR,
102 PVRDMA_WC_INV_EECN_ERR,
103 PVRDMA_WC_INV_EEC_STATE_ERR,
104 PVRDMA_WC_FATAL_ERR,
105 PVRDMA_WC_RESP_TIMEOUT_ERR,
106 PVRDMA_WC_GENERAL_ERR,
107};
108
109enum pvrdma_wc_opcode {
110 PVRDMA_WC_SEND,
111 PVRDMA_WC_RDMA_WRITE,
112 PVRDMA_WC_RDMA_READ,
113 PVRDMA_WC_COMP_SWAP,
114 PVRDMA_WC_FETCH_ADD,
115 PVRDMA_WC_BIND_MW,
116 PVRDMA_WC_LSO,
117 PVRDMA_WC_LOCAL_INV,
118 PVRDMA_WC_FAST_REG_MR,
119 PVRDMA_WC_MASKED_COMP_SWAP,
120 PVRDMA_WC_MASKED_FETCH_ADD,
121 PVRDMA_WC_RECV = 1 << 7,
122 PVRDMA_WC_RECV_RDMA_WITH_IMM,
123};
124
125enum pvrdma_wc_flags {
126 PVRDMA_WC_GRH = 1 << 0,
127 PVRDMA_WC_WITH_IMM = 1 << 1,
128 PVRDMA_WC_WITH_INVALIDATE = 1 << 2,
129 PVRDMA_WC_IP_CSUM_OK = 1 << 3,
130 PVRDMA_WC_WITH_SMAC = 1 << 4,
131 PVRDMA_WC_WITH_VLAN = 1 << 5,
132 PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6,
133 PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE,
134};
135
136enum pvrdma_network_type {
137 PVRDMA_NETWORK_IB,
138 PVRDMA_NETWORK_ROCE_V1 = PVRDMA_NETWORK_IB,
139 PVRDMA_NETWORK_IPV4,
140 PVRDMA_NETWORK_IPV6
141};
142
143struct pvrdma_alloc_ucontext_resp {
144 __u32 qp_tab_size;
145 __u32 reserved;
146};
147
148struct pvrdma_alloc_pd_resp {
149 __u32 pdn;
150 __u32 reserved;
151};
152
153struct pvrdma_create_cq {
154 __aligned_u64 buf_addr;
155 __u32 buf_size;
156 __u32 reserved;
157};
158
159struct pvrdma_create_cq_resp {
160 __u32 cqn;
161 __u32 reserved;
162};
163
164struct pvrdma_resize_cq {
165 __aligned_u64 buf_addr;
166 __u32 buf_size;
167 __u32 reserved;
168};
169
170struct pvrdma_create_srq {
171 __aligned_u64 buf_addr;
172 __u32 buf_size;
173 __u32 reserved;
174};
175
176struct pvrdma_create_srq_resp {
177 __u32 srqn;
178 __u32 reserved;
179};
180
181struct pvrdma_create_qp {
182 __aligned_u64 rbuf_addr;
183 __aligned_u64 sbuf_addr;
184 __u32 rbuf_size;
185 __u32 sbuf_size;
186 __aligned_u64 qp_addr;
187};
188
189struct pvrdma_create_qp_resp {
190 __u32 qpn;
191 __u32 qp_handle;
192};
193
194/* PVRDMA masked atomic compare and swap */
195struct pvrdma_ex_cmp_swap {
196 __aligned_u64 swap_val;
197 __aligned_u64 compare_val;
198 __aligned_u64 swap_mask;
199 __aligned_u64 compare_mask;
200};
201
202/* PVRDMA masked atomic fetch and add */
203struct pvrdma_ex_fetch_add {
204 __aligned_u64 add_val;
205 __aligned_u64 field_boundary;
206};
207
208/* PVRDMA address vector. */
209struct pvrdma_av {
210 __u32 port_pd;
211 __u32 sl_tclass_flowlabel;
212 __u8 dgid[16];
213 __u8 src_path_bits;
214 __u8 gid_index;
215 __u8 stat_rate;
216 __u8 hop_limit;
217 __u8 dmac[6];
218 __u8 reserved[6];
219};
220
221/* PVRDMA scatter/gather entry */
222struct pvrdma_sge {
223 __aligned_u64 addr;
224 __u32 length;
225 __u32 lkey;
226};
227
228/* PVRDMA receive queue work request */
229struct pvrdma_rq_wqe_hdr {
230 __aligned_u64 wr_id; /* wr id */
231 __u32 num_sge; /* size of s/g array */
232 __u32 total_len; /* reserved */
233};
234/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */
235
236/* PVRDMA send queue work request */
237struct pvrdma_sq_wqe_hdr {
238 __aligned_u64 wr_id; /* wr id */
239 __u32 num_sge; /* size of s/g array */
240 __u32 total_len; /* reserved */
241 __u32 opcode; /* operation type */
242 __u32 send_flags; /* wr flags */
243 union {
244 __be32 imm_data;
245 __u32 invalidate_rkey;
246 } ex;
247 __u32 reserved;
248 union {
249 struct {
250 __aligned_u64 remote_addr;
251 __u32 rkey;
252 __u8 reserved[4];
253 } rdma;
254 struct {
255 __aligned_u64 remote_addr;
256 __aligned_u64 compare_add;
257 __aligned_u64 swap;
258 __u32 rkey;
259 __u32 reserved;
260 } atomic;
261 struct {
262 __aligned_u64 remote_addr;
263 __u32 log_arg_sz;
264 __u32 rkey;
265 union {
266 struct pvrdma_ex_cmp_swap cmp_swap;
267 struct pvrdma_ex_fetch_add fetch_add;
268 } wr_data;
269 } masked_atomics;
270 struct {
271 __aligned_u64 iova_start;
272 __aligned_u64 pl_pdir_dma;
273 __u32 page_shift;
274 __u32 page_list_len;
275 __u32 length;
276 __u32 access_flags;
277 __u32 rkey;
278 __u32 reserved;
279 } fast_reg;
280 struct {
281 __u32 remote_qpn;
282 __u32 remote_qkey;
283 struct pvrdma_av av;
284 } ud;
285 } wr;
286};
287/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */
288
289/* Completion queue element. */
290struct pvrdma_cqe {
291 __aligned_u64 wr_id;
292 __aligned_u64 qp;
293 __u32 opcode;
294 __u32 status;
295 __u32 byte_len;
296 __be32 imm_data;
297 __u32 src_qp;
298 __u32 wc_flags;
299 __u32 vendor_err;
300 __u16 pkey_index;
301 __u16 slid;
302 __u8 sl;
303 __u8 dlid_path_bits;
304 __u8 port_num;
305 __u8 smac[6];
306 __u8 network_hdr_type;
307 __u8 reserved2[6]; /* Pad to next power of 2 (64). */
308};
309
310#endif /* __VMW_PVRDMA_ABI_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/cxlflash_ioctl.h created+276
...@@ -0,0 +1,276 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * CXL Flash Device Driver
4 *
5 * Written by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>, IBM Corporation
6 * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
7 *
8 * Copyright (C) 2015 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#ifndef _CXLFLASH_IOCTL_H
17#define _CXLFLASH_IOCTL_H
18
19#include <linux/types.h>
20
21/*
22 * Structure and definitions for all CXL Flash ioctls
23 */
24#define CXLFLASH_WWID_LEN 16
25
26/*
27 * Structure and flag definitions CXL Flash superpipe ioctls
28 */
29
30#define DK_CXLFLASH_VERSION_0 0
31
32struct dk_cxlflash_hdr {
33 __u16 version; /* Version data */
34 __u16 rsvd[3]; /* Reserved for future use */
35 __u64 flags; /* Input flags */
36 __u64 return_flags; /* Returned flags */
37};
38
39/*
40 * Return flag definitions available to all superpipe ioctls
41 *
42 * Similar to the input flags, these are grown from the bottom-up with the
43 * intention that ioctl-specific return flag definitions would grow from the
44 * top-down, allowing the two sets to co-exist. While not required/enforced
45 * at this time, this provides future flexibility.
46 */
47#define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL
48#define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL
49#define DK_CXLFLASH_CONTEXT_SQ_CMD_MODE 0x0000000000000004ULL
50
51/*
52 * General Notes:
53 * -------------
54 * The 'context_id' field of all ioctl structures contains the context
55 * identifier for a context in the lower 32-bits (upper 32-bits are not
56 * to be used when identifying a context to the AFU). That said, the value
57 * in its entirety (all 64-bits) is to be treated as an opaque cookie and
58 * should be presented as such when issuing ioctls.
59 */
60
61/*
62 * DK_CXLFLASH_ATTACH Notes:
63 * ------------------------
64 * Read/write access permissions are specified via the O_RDONLY, O_WRONLY,
65 * and O_RDWR flags defined in the fcntl.h header file.
66 *
67 * A valid adapter file descriptor (fd >= 0) is only returned on the initial
68 * attach (successful) of a context. When a context is shared(reused), the user
69 * is expected to already 'know' the adapter file descriptor associated with the
70 * context.
71 */
72#define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL
73
74struct dk_cxlflash_attach {
75 struct dk_cxlflash_hdr hdr; /* Common fields */
76 __u64 num_interrupts; /* Requested number of interrupts */
77 __u64 context_id; /* Returned context */
78 __u64 mmio_size; /* Returned size of MMIO area */
79 __u64 block_size; /* Returned block size, in bytes */
80 __u64 adap_fd; /* Returned adapter file descriptor */
81 __u64 last_lba; /* Returned last LBA on the device */
82 __u64 max_xfer; /* Returned max transfer size, blocks */
83 __u64 reserved[8]; /* Reserved for future use */
84};
85
86struct dk_cxlflash_detach {
87 struct dk_cxlflash_hdr hdr; /* Common fields */
88 __u64 context_id; /* Context to detach */
89 __u64 reserved[8]; /* Reserved for future use */
90};
91
92struct dk_cxlflash_udirect {
93 struct dk_cxlflash_hdr hdr; /* Common fields */
94 __u64 context_id; /* Context to own physical resources */
95 __u64 rsrc_handle; /* Returned resource handle */
96 __u64 last_lba; /* Returned last LBA on the device */
97 __u64 reserved[8]; /* Reserved for future use */
98};
99
100#define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL
101
102struct dk_cxlflash_uvirtual {
103 struct dk_cxlflash_hdr hdr; /* Common fields */
104 __u64 context_id; /* Context to own virtual resources */
105 __u64 lun_size; /* Requested size, in 4K blocks */
106 __u64 rsrc_handle; /* Returned resource handle */
107 __u64 last_lba; /* Returned last LBA of LUN */
108 __u64 reserved[8]; /* Reserved for future use */
109};
110
111struct dk_cxlflash_release {
112 struct dk_cxlflash_hdr hdr; /* Common fields */
113 __u64 context_id; /* Context owning resources */
114 __u64 rsrc_handle; /* Resource handle to release */
115 __u64 reserved[8]; /* Reserved for future use */
116};
117
118struct dk_cxlflash_resize {
119 struct dk_cxlflash_hdr hdr; /* Common fields */
120 __u64 context_id; /* Context owning resources */
121 __u64 rsrc_handle; /* Resource handle of LUN to resize */
122 __u64 req_size; /* New requested size, in 4K blocks */
123 __u64 last_lba; /* Returned last LBA of LUN */
124 __u64 reserved[8]; /* Reserved for future use */
125};
126
127struct dk_cxlflash_clone {
128 struct dk_cxlflash_hdr hdr; /* Common fields */
129 __u64 context_id_src; /* Context to clone from */
130 __u64 context_id_dst; /* Context to clone to */
131 __u64 adap_fd_src; /* Source context adapter fd */
132 __u64 reserved[8]; /* Reserved for future use */
133};
134
135#define DK_CXLFLASH_VERIFY_SENSE_LEN 18
136#define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL
137
138struct dk_cxlflash_verify {
139 struct dk_cxlflash_hdr hdr; /* Common fields */
140 __u64 context_id; /* Context owning resources to verify */
141 __u64 rsrc_handle; /* Resource handle of LUN */
142 __u64 hint; /* Reasons for verify */
143 __u64 last_lba; /* Returned last LBA of device */
144 __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN]; /* SCSI sense data */
145 __u8 pad[6]; /* Pad to next 8-byte boundary */
146 __u64 reserved[8]; /* Reserved for future use */
147};
148
149#define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL
150
151struct dk_cxlflash_recover_afu {
152 struct dk_cxlflash_hdr hdr; /* Common fields */
153 __u64 reason; /* Reason for recovery request */
154 __u64 context_id; /* Context to recover / updated ID */
155 __u64 mmio_size; /* Returned size of MMIO area */
156 __u64 adap_fd; /* Returned adapter file descriptor */
157 __u64 reserved[8]; /* Reserved for future use */
158};
159
160#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN
161#define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL
162#define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL
163#define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL
164
165struct dk_cxlflash_manage_lun {
166 struct dk_cxlflash_hdr hdr; /* Common fields */
167 __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN]; /* Page83 WWID, NAA-6 */
168 __u64 reserved[8]; /* Rsvd, future use */
169};
170
171union cxlflash_ioctls {
172 struct dk_cxlflash_attach attach;
173 struct dk_cxlflash_detach detach;
174 struct dk_cxlflash_udirect udirect;
175 struct dk_cxlflash_uvirtual uvirtual;
176 struct dk_cxlflash_release release;
177 struct dk_cxlflash_resize resize;
178 struct dk_cxlflash_clone clone;
179 struct dk_cxlflash_verify verify;
180 struct dk_cxlflash_recover_afu recover_afu;
181 struct dk_cxlflash_manage_lun manage_lun;
182};
183
184#define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls))
185
186#define CXL_MAGIC 0xCA
187#define CXL_IOWR(_n, _s) _IOWR(CXL_MAGIC, _n, struct _s)
188
189/*
190 * CXL Flash superpipe ioctls start at base of the reserved CXL_MAGIC
191 * region (0x80) and grow upwards.
192 */
193#define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach)
194#define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect)
195#define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release)
196#define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach)
197#define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify)
198#define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu)
199#define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun)
200#define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual)
201#define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize)
202#define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone)
203
204/*
205 * Structure and flag definitions CXL Flash host ioctls
206 */
207
208#define HT_CXLFLASH_VERSION_0 0
209
210struct ht_cxlflash_hdr {
211 __u16 version; /* Version data */
212 __u16 subcmd; /* Sub-command */
213 __u16 rsvd[2]; /* Reserved for future use */
214 __u64 flags; /* Input flags */
215 __u64 return_flags; /* Returned flags */
216};
217
218/*
219 * Input flag definitions available to all host ioctls
220 *
221 * These are grown from the bottom-up with the intention that ioctl-specific
222 * input flag definitions would grow from the top-down, allowing the two sets
223 * to co-exist. While not required/enforced at this time, this provides future
224 * flexibility.
225 */
226#define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL
227#define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL
228
229#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001
230#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002
231#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003
232
233struct ht_cxlflash_lun_provision {
234 struct ht_cxlflash_hdr hdr; /* Common fields */
235 __u16 port; /* Target port for provision request */
236 __u16 reserved16[3]; /* Reserved for future use */
237 __u64 size; /* Size of LUN (4K blocks) */
238 __u64 lun_id; /* SCSI LUN ID */
239 __u8 wwid[CXLFLASH_WWID_LEN];/* Page83 WWID, NAA-6 */
240 __u64 max_num_luns; /* Maximum number of LUNs provisioned */
241 __u64 cur_num_luns; /* Current number of LUNs provisioned */
242 __u64 max_cap_port; /* Total capacity for port (4K blocks) */
243 __u64 cur_cap_port; /* Current capacity for port (4K blocks) */
244 __u64 reserved[8]; /* Reserved for future use */
245};
246
247#define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 /* 256K */
248#define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12
249struct ht_cxlflash_afu_debug {
250 struct ht_cxlflash_hdr hdr; /* Common fields */
251 __u8 reserved8[4]; /* Reserved for future use */
252 __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; /* AFU subcommand,
253 * (pass through)
254 */
255 __u64 data_ea; /* Data buffer effective address */
256 __u32 data_len; /* Data buffer length */
257 __u32 reserved32; /* Reserved for future use */
258 __u64 reserved[8]; /* Reserved for future use */
259};
260
261union cxlflash_ht_ioctls {
262 struct ht_cxlflash_lun_provision lun_provision;
263 struct ht_cxlflash_afu_debug afu_debug;
264};
265
266#define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls))
267
268/*
269 * CXL Flash host ioctls start at the top of the reserved CXL_MAGIC
270 * region (0xBF) and grow downwards.
271 */
272#define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision)
273#define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug)
274
275
276#endif /* ifndef _CXLFLASH_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/fc/fc_els.h created+1253
...@@ -0,0 +1,1253 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * Maintained at www.Open-FCoE.org
6 */
7
8#ifndef _FC_ELS_H_
9#define _FC_ELS_H_
10
11#include <linux/types.h>
12#include <asm/byteorder.h>
13
14/*
15 * Fibre Channel Switch - Enhanced Link Services definitions.
16 * From T11 FC-LS Rev 1.2 June 7, 2005.
17 */
18
19/*
20 * ELS Command codes - byte 0 of the frame payload
21 */
22enum fc_els_cmd {
23 ELS_LS_RJT = 0x01, /* ESL reject */
24 ELS_LS_ACC = 0x02, /* ESL Accept */
25 ELS_PLOGI = 0x03, /* N_Port login */
26 ELS_FLOGI = 0x04, /* F_Port login */
27 ELS_LOGO = 0x05, /* Logout */
28 ELS_ABTX = 0x06, /* Abort exchange - obsolete */
29 ELS_RCS = 0x07, /* read connection status */
30 ELS_RES = 0x08, /* read exchange status block */
31 ELS_RSS = 0x09, /* read sequence status block */
32 ELS_RSI = 0x0a, /* read sequence initiative */
33 ELS_ESTS = 0x0b, /* establish streaming */
34 ELS_ESTC = 0x0c, /* estimate credit */
35 ELS_ADVC = 0x0d, /* advise credit */
36 ELS_RTV = 0x0e, /* read timeout value */
37 ELS_RLS = 0x0f, /* read link error status block */
38 ELS_ECHO = 0x10, /* echo */
39 ELS_TEST = 0x11, /* test */
40 ELS_RRQ = 0x12, /* reinstate recovery qualifier */
41 ELS_REC = 0x13, /* read exchange concise */
42 ELS_SRR = 0x14, /* sequence retransmission request */
43 ELS_FPIN = 0x16, /* Fabric Performance Impact Notification */
44 ELS_EDC = 0x17, /* Exchange Diagnostic Capabilities */
45 ELS_RDP = 0x18, /* Read Diagnostic Parameters */
46 ELS_RDF = 0x19, /* Register Diagnostic Functions */
47 ELS_PRLI = 0x20, /* process login */
48 ELS_PRLO = 0x21, /* process logout */
49 ELS_SCN = 0x22, /* state change notification */
50 ELS_TPLS = 0x23, /* test process login state */
51 ELS_TPRLO = 0x24, /* third party process logout */
52 ELS_LCLM = 0x25, /* login control list mgmt (obs) */
53 ELS_GAID = 0x30, /* get alias_ID */
54 ELS_FACT = 0x31, /* fabric activate alias_id */
55 ELS_FDACDT = 0x32, /* fabric deactivate alias_id */
56 ELS_NACT = 0x33, /* N-port activate alias_id */
57 ELS_NDACT = 0x34, /* N-port deactivate alias_id */
58 ELS_QOSR = 0x40, /* quality of service request */
59 ELS_RVCS = 0x41, /* read virtual circuit status */
60 ELS_PDISC = 0x50, /* discover N_port service params */
61 ELS_FDISC = 0x51, /* discover F_port service params */
62 ELS_ADISC = 0x52, /* discover address */
63 ELS_RNC = 0x53, /* report node cap (obs) */
64 ELS_FARP_REQ = 0x54, /* FC ARP request */
65 ELS_FARP_REPL = 0x55, /* FC ARP reply */
66 ELS_RPS = 0x56, /* read port status block */
67 ELS_RPL = 0x57, /* read port list */
68 ELS_RPBC = 0x58, /* read port buffer condition */
69 ELS_FAN = 0x60, /* fabric address notification */
70 ELS_RSCN = 0x61, /* registered state change notification */
71 ELS_SCR = 0x62, /* state change registration */
72 ELS_RNFT = 0x63, /* report node FC-4 types */
73 ELS_CSR = 0x68, /* clock synch. request */
74 ELS_CSU = 0x69, /* clock synch. update */
75 ELS_LINIT = 0x70, /* loop initialize */
76 ELS_LSTS = 0x72, /* loop status */
77 ELS_RNID = 0x78, /* request node ID data */
78 ELS_RLIR = 0x79, /* registered link incident report */
79 ELS_LIRR = 0x7a, /* link incident record registration */
80 ELS_SRL = 0x7b, /* scan remote loop */
81 ELS_SBRP = 0x7c, /* set bit-error reporting params */
82 ELS_RPSC = 0x7d, /* report speed capabilities */
83 ELS_QSA = 0x7e, /* query security attributes */
84 ELS_EVFP = 0x7f, /* exchange virt. fabrics params */
85 ELS_LKA = 0x80, /* link keep-alive */
86 ELS_AUTH_ELS = 0x90, /* authentication ELS */
87};
88
89/*
90 * Initializer useful for decoding table.
91 * Please keep this in sync with the above definitions.
92 */
93#define FC_ELS_CMDS_INIT { \
94 [ELS_LS_RJT] = "LS_RJT", \
95 [ELS_LS_ACC] = "LS_ACC", \
96 [ELS_PLOGI] = "PLOGI", \
97 [ELS_FLOGI] = "FLOGI", \
98 [ELS_LOGO] = "LOGO", \
99 [ELS_ABTX] = "ABTX", \
100 [ELS_RCS] = "RCS", \
101 [ELS_RES] = "RES", \
102 [ELS_RSS] = "RSS", \
103 [ELS_RSI] = "RSI", \
104 [ELS_ESTS] = "ESTS", \
105 [ELS_ESTC] = "ESTC", \
106 [ELS_ADVC] = "ADVC", \
107 [ELS_RTV] = "RTV", \
108 [ELS_RLS] = "RLS", \
109 [ELS_ECHO] = "ECHO", \
110 [ELS_TEST] = "TEST", \
111 [ELS_RRQ] = "RRQ", \
112 [ELS_REC] = "REC", \
113 [ELS_SRR] = "SRR", \
114 [ELS_FPIN] = "FPIN", \
115 [ELS_EDC] = "EDC", \
116 [ELS_RDP] = "RDP", \
117 [ELS_RDF] = "RDF", \
118 [ELS_PRLI] = "PRLI", \
119 [ELS_PRLO] = "PRLO", \
120 [ELS_SCN] = "SCN", \
121 [ELS_TPLS] = "TPLS", \
122 [ELS_TPRLO] = "TPRLO", \
123 [ELS_LCLM] = "LCLM", \
124 [ELS_GAID] = "GAID", \
125 [ELS_FACT] = "FACT", \
126 [ELS_FDACDT] = "FDACDT", \
127 [ELS_NACT] = "NACT", \
128 [ELS_NDACT] = "NDACT", \
129 [ELS_QOSR] = "QOSR", \
130 [ELS_RVCS] = "RVCS", \
131 [ELS_PDISC] = "PDISC", \
132 [ELS_FDISC] = "FDISC", \
133 [ELS_ADISC] = "ADISC", \
134 [ELS_RNC] = "RNC", \
135 [ELS_FARP_REQ] = "FARP_REQ", \
136 [ELS_FARP_REPL] = "FARP_REPL", \
137 [ELS_RPS] = "RPS", \
138 [ELS_RPL] = "RPL", \
139 [ELS_RPBC] = "RPBC", \
140 [ELS_FAN] = "FAN", \
141 [ELS_RSCN] = "RSCN", \
142 [ELS_SCR] = "SCR", \
143 [ELS_RNFT] = "RNFT", \
144 [ELS_CSR] = "CSR", \
145 [ELS_CSU] = "CSU", \
146 [ELS_LINIT] = "LINIT", \
147 [ELS_LSTS] = "LSTS", \
148 [ELS_RNID] = "RNID", \
149 [ELS_RLIR] = "RLIR", \
150 [ELS_LIRR] = "LIRR", \
151 [ELS_SRL] = "SRL", \
152 [ELS_SBRP] = "SBRP", \
153 [ELS_RPSC] = "RPSC", \
154 [ELS_QSA] = "QSA", \
155 [ELS_EVFP] = "EVFP", \
156 [ELS_LKA] = "LKA", \
157 [ELS_AUTH_ELS] = "AUTH_ELS", \
158}
159
160/*
161 * LS_ACC payload.
162 */
163struct fc_els_ls_acc {
164 __u8 la_cmd; /* command code ELS_LS_ACC */
165 __u8 la_resv[3]; /* reserved */
166};
167
168/*
169 * ELS reject payload.
170 */
171struct fc_els_ls_rjt {
172 __u8 er_cmd; /* command code ELS_LS_RJT */
173 __u8 er_resv[4]; /* reserved must be zero */
174 __u8 er_reason; /* reason (enum fc_els_rjt_reason below) */
175 __u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */
176 __u8 er_vendor; /* vendor specific code */
177};
178
179/*
180 * ELS reject reason codes (er_reason).
181 */
182enum fc_els_rjt_reason {
183 ELS_RJT_NONE = 0, /* no reject - not to be sent */
184 ELS_RJT_INVAL = 0x01, /* invalid ELS command code */
185 ELS_RJT_LOGIC = 0x03, /* logical error */
186 ELS_RJT_BUSY = 0x05, /* logical busy */
187 ELS_RJT_PROT = 0x07, /* protocol error */
188 ELS_RJT_UNAB = 0x09, /* unable to perform command request */
189 ELS_RJT_UNSUP = 0x0b, /* command not supported */
190 ELS_RJT_INPROG = 0x0e, /* command already in progress */
191 ELS_RJT_FIP = 0x20, /* FIP error */
192 ELS_RJT_VENDOR = 0xff, /* vendor specific error */
193};
194
195
196/*
197 * reason code explanation (er_explan).
198 */
199enum fc_els_rjt_explan {
200 ELS_EXPL_NONE = 0x00, /* No additional explanation */
201 ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */
202 ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */
203 ELS_EXPL_AH = 0x11, /* invalid association header */
204 ELS_EXPL_AH_REQ = 0x13, /* association_header required */
205 ELS_EXPL_SID = 0x15, /* invalid originator S_ID */
206 ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */
207 ELS_EXPL_INPROG = 0x19, /* Request already in progress */
208 ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */
209 ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */
210 ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */
211 ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */
212 ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */
213 ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */
214 /* TBD - above definitions incomplete */
215};
216
217/*
218 * Link Service TLV Descriptor Tag Values
219 */
220enum fc_ls_tlv_dtag {
221 ELS_DTAG_LS_REQ_INFO = 0x00000001,
222 /* Link Service Request Information Descriptor */
223 ELS_DTAG_LNK_FAULT_CAP = 0x0001000D,
224 /* Link Fault Capability Descriptor */
225 ELS_DTAG_CG_SIGNAL_CAP = 0x0001000F,
226 /* Congestion Signaling Capability Descriptor */
227 ELS_DTAG_LNK_INTEGRITY = 0x00020001,
228 /* Link Integrity Notification Descriptor */
229 ELS_DTAG_DELIVERY = 0x00020002,
230 /* Delivery Notification Descriptor */
231 ELS_DTAG_PEER_CONGEST = 0x00020003,
232 /* Peer Congestion Notification Descriptor */
233 ELS_DTAG_CONGESTION = 0x00020004,
234 /* Congestion Notification Descriptor */
235 ELS_DTAG_FPIN_REGISTER = 0x00030001,
236 /* FPIN Registration Descriptor */
237};
238
239/*
240 * Initializer useful for decoding table.
241 * Please keep this in sync with the above definitions.
242 */
243#define FC_LS_TLV_DTAG_INIT { \
244 { ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \
245 { ELS_DTAG_LNK_FAULT_CAP, "Link Fault Capability" }, \
246 { ELS_DTAG_CG_SIGNAL_CAP, "Congestion Signaling Capability" }, \
247 { ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \
248 { ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \
249 { ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \
250 { ELS_DTAG_CONGESTION, "Congestion Notification" }, \
251 { ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \
252}
253
254
255/*
256 * Generic Link Service TLV Descriptor format
257 *
258 * This structure, as it defines no payload, will also be referred to
259 * as the "tlv header" - which contains the tag and len fields.
260 */
261struct fc_tlv_desc {
262 __be32 desc_tag; /* Notification Descriptor Tag */
263 __be32 desc_len; /* Length of Descriptor (in bytes).
264 * Size of descriptor excluding
265 * desc_tag and desc_len fields.
266 */
267 __u8 desc_value[0]; /* Descriptor Value */
268};
269
270/* Descriptor tag and len fields are considered the mandatory header
271 * for a descriptor
272 */
273#define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc)
274
275/*
276 * Macro, used when initializing payloads, to return the descriptor length.
277 * Length is size of descriptor minus the tag and len fields.
278 */
279#define FC_TLV_DESC_LENGTH_FROM_SZ(desc) \
280 (sizeof(desc) - FC_TLV_DESC_HDR_SZ)
281
282/* Macro, used on received payloads, to return the descriptor length */
283#define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) \
284 (__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
285
286/*
287 * This helper is used to walk descriptors in a descriptor list.
288 * Given the address of the current descriptor, which minimally contains a
289 * tag and len field, calculate the address of the next descriptor based
290 * on the len field.
291 */
292static __inline__ void *fc_tlv_next_desc(void *desc)
293{
294 struct fc_tlv_desc *tlv = desc;
295
296 return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));
297}
298
299
300/*
301 * Link Service Request Information Descriptor
302 */
303struct fc_els_lsri_desc {
304 __be32 desc_tag; /* descriptor tag (0x0000 0001) */
305 __be32 desc_len; /* Length of Descriptor (in bytes) (4).
306 * Size of descriptor excluding
307 * desc_tag and desc_len fields.
308 */
309 struct {
310 __u8 cmd; /* ELS cmd byte */
311 __u8 bytes[3]; /* bytes 1..3 */
312 } rqst_w0; /* Request word 0 */
313};
314
315
316/*
317 * Common service parameters (N ports).
318 */
319struct fc_els_csp {
320 __u8 sp_hi_ver; /* highest version supported (obs.) */
321 __u8 sp_lo_ver; /* highest version supported (obs.) */
322 __be16 sp_bb_cred; /* buffer-to-buffer credits */
323 __be16 sp_features; /* common feature flags */
324 __be16 sp_bb_data; /* b-b state number and data field sz */
325 union {
326 struct {
327 __be16 _sp_tot_seq; /* total concurrent sequences */
328 __be16 _sp_rel_off; /* rel. offset by info cat */
329 } sp_plogi;
330 struct {
331 __be32 _sp_r_a_tov; /* resource alloc. timeout msec */
332 } sp_flogi_acc;
333 } sp_u;
334 __be32 sp_e_d_tov; /* error detect timeout value */
335};
336#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq
337#define sp_rel_off sp_u.sp_plogi._sp_rel_off
338#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov
339
340#define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */
341
342/*
343 * Minimum and maximum values for max data field size in service parameters.
344 */
345#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD
346#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD
347
348/*
349 * sp_features
350 */
351#define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */
352#define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */
353#define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */
354#define FC_SP_FT_RAND 0x4000 /* random relative offset */
355#define FC_SP_FT_VAL 0x2000 /* valid vendor version level */
356#define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */
357#define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */
358#define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */
359#define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */
360#define FC_SP_FT_MCAST 0x0200 /* multicast */
361#define FC_SP_FT_BCAST 0x0100 /* broadcast */
362#define FC_SP_FT_HUNT 0x0080 /* hunt group */
363#define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */
364#define FC_SP_FT_SEC 0x0020 /* reserved for security */
365#define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */
366#define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */
367#define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */
368#define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */
369#define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */
370
371/*
372 * Class-specific service parameters.
373 */
374struct fc_els_cssp {
375 __be16 cp_class; /* class flags */
376 __be16 cp_init; /* initiator flags */
377 __be16 cp_recip; /* recipient flags */
378 __be16 cp_rdfs; /* receive data field size */
379 __be16 cp_con_seq; /* concurrent sequences */
380 __be16 cp_ee_cred; /* N-port end-to-end credit */
381 __u8 cp_resv1; /* reserved */
382 __u8 cp_open_seq; /* open sequences per exchange */
383 __u8 _cp_resv2[2]; /* reserved */
384};
385
386/*
387 * cp_class flags.
388 */
389#define FC_CPC_VALID 0x8000 /* class valid */
390#define FC_CPC_IMIX 0x4000 /* intermix mode */
391#define FC_CPC_SEQ 0x0800 /* sequential delivery */
392#define FC_CPC_CAMP 0x0200 /* camp-on */
393#define FC_CPC_PRI 0x0080 /* priority */
394
395/*
396 * cp_init flags.
397 * (TBD: not all flags defined here).
398 */
399#define FC_CPI_CSYN 0x0010 /* clock synch. capable */
400
401/*
402 * cp_recip flags.
403 */
404#define FC_CPR_CSYN 0x0008 /* clock synch. capable */
405
406/*
407 * NFC_ELS_FLOGI: Fabric login request.
408 * NFC_ELS_PLOGI: Port login request (same format).
409 */
410struct fc_els_flogi {
411 __u8 fl_cmd; /* command */
412 __u8 _fl_resvd[3]; /* must be zero */
413 struct fc_els_csp fl_csp; /* common service parameters */
414 __be64 fl_wwpn; /* port name */
415 __be64 fl_wwnn; /* node name */
416 struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */
417 __u8 fl_vend[16]; /* vendor version level */
418} __attribute__((__packed__));
419
420/*
421 * Process login service parameter page.
422 */
423struct fc_els_spp {
424 __u8 spp_type; /* type code or common service params */
425 __u8 spp_type_ext; /* type code extension */
426 __u8 spp_flags;
427 __u8 _spp_resvd;
428 __be32 spp_orig_pa; /* originator process associator */
429 __be32 spp_resp_pa; /* responder process associator */
430 __be32 spp_params; /* service parameters */
431};
432
433/*
434 * spp_flags.
435 */
436#define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */
437#define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */
438#define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */
439#define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */
440
441/*
442 * SPP response code in spp_flags - lower 4 bits.
443 */
444enum fc_els_spp_resp {
445 FC_SPP_RESP_ACK = 1, /* request executed */
446 FC_SPP_RESP_RES = 2, /* unable due to lack of resources */
447 FC_SPP_RESP_INIT = 3, /* initialization not complete */
448 FC_SPP_RESP_NO_PA = 4, /* unknown process associator */
449 FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */
450 FC_SPP_RESP_COND = 6, /* request completed conditionally */
451 FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */
452 FC_SPP_RESP_INVL = 8, /* SPP is invalid */
453};
454
455/*
456 * ELS_RRQ - Reinstate Recovery Qualifier
457 */
458struct fc_els_rrq {
459 __u8 rrq_cmd; /* command (0x12) */
460 __u8 rrq_zero[3]; /* specified as zero - part of cmd */
461 __u8 rrq_resvd; /* reserved */
462 __u8 rrq_s_id[3]; /* originator FID */
463 __be16 rrq_ox_id; /* originator exchange ID */
464 __be16 rrq_rx_id; /* responders exchange ID */
465};
466
467/*
468 * ELS_REC - Read exchange concise.
469 */
470struct fc_els_rec {
471 __u8 rec_cmd; /* command (0x13) */
472 __u8 rec_zero[3]; /* specified as zero - part of cmd */
473 __u8 rec_resvd; /* reserved */
474 __u8 rec_s_id[3]; /* originator FID */
475 __be16 rec_ox_id; /* originator exchange ID */
476 __be16 rec_rx_id; /* responders exchange ID */
477};
478
479/*
480 * ELS_REC LS_ACC payload.
481 */
482struct fc_els_rec_acc {
483 __u8 reca_cmd; /* accept (0x02) */
484 __u8 reca_zero[3]; /* specified as zero - part of cmd */
485 __be16 reca_ox_id; /* originator exchange ID */
486 __be16 reca_rx_id; /* responders exchange ID */
487 __u8 reca_resvd1; /* reserved */
488 __u8 reca_ofid[3]; /* originator FID */
489 __u8 reca_resvd2; /* reserved */
490 __u8 reca_rfid[3]; /* responder FID */
491 __be32 reca_fc4value; /* FC4 value */
492 __be32 reca_e_stat; /* ESB (exchange status block) status */
493};
494
495/*
496 * ELS_PRLI - Process login request and response.
497 */
498struct fc_els_prli {
499 __u8 prli_cmd; /* command */
500 __u8 prli_spp_len; /* length of each serv. parm. page */
501 __be16 prli_len; /* length of entire payload */
502 /* service parameter pages follow */
503};
504
505/*
506 * ELS_PRLO - Process logout request and response.
507 */
508struct fc_els_prlo {
509 __u8 prlo_cmd; /* command */
510 __u8 prlo_obs; /* obsolete, but shall be set to 10h */
511 __be16 prlo_len; /* payload length */
512};
513
514/*
515 * ELS_ADISC payload
516 */
517struct fc_els_adisc {
518 __u8 adisc_cmd;
519 __u8 adisc_resv[3];
520 __u8 adisc_resv1;
521 __u8 adisc_hard_addr[3];
522 __be64 adisc_wwpn;
523 __be64 adisc_wwnn;
524 __u8 adisc_resv2;
525 __u8 adisc_port_id[3];
526} __attribute__((__packed__));
527
528/*
529 * ELS_LOGO - process or fabric logout.
530 */
531struct fc_els_logo {
532 __u8 fl_cmd; /* command code */
533 __u8 fl_zero[3]; /* specified as zero - part of cmd */
534 __u8 fl_resvd; /* reserved */
535 __u8 fl_n_port_id[3];/* N port ID */
536 __be64 fl_n_port_wwn; /* port name */
537};
538
539/*
540 * ELS_RTV - read timeout value.
541 */
542struct fc_els_rtv {
543 __u8 rtv_cmd; /* command code 0x0e */
544 __u8 rtv_zero[3]; /* specified as zero - part of cmd */
545};
546
547/*
548 * LS_ACC for ELS_RTV - read timeout value.
549 */
550struct fc_els_rtv_acc {
551 __u8 rtv_cmd; /* command code 0x02 */
552 __u8 rtv_zero[3]; /* specified as zero - part of cmd */
553 __be32 rtv_r_a_tov; /* resource allocation timeout value */
554 __be32 rtv_e_d_tov; /* error detection timeout value */
555 __be32 rtv_toq; /* timeout qualifier (see below) */
556};
557
558/*
559 * rtv_toq bits.
560 */
561#define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */
562#define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */
563
564/*
565 * ELS_SCR - state change registration payload.
566 */
567struct fc_els_scr {
568 __u8 scr_cmd; /* command code */
569 __u8 scr_resv[6]; /* reserved */
570 __u8 scr_reg_func; /* registration function (see below) */
571};
572
573enum fc_els_scr_func {
574 ELS_SCRF_FAB = 1, /* fabric-detected registration */
575 ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */
576 ELS_SCRF_FULL = 3, /* full registration */
577 ELS_SCRF_CLEAR = 255, /* remove any current registrations */
578};
579
580/*
581 * ELS_RSCN - registered state change notification payload.
582 */
583struct fc_els_rscn {
584 __u8 rscn_cmd; /* RSCN opcode (0x61) */
585 __u8 rscn_page_len; /* page length (4) */
586 __be16 rscn_plen; /* payload length including this word */
587
588 /* followed by 4-byte generic affected Port_ID pages */
589};
590
591struct fc_els_rscn_page {
592 __u8 rscn_page_flags; /* event and address format */
593 __u8 rscn_fid[3]; /* fabric ID */
594};
595
596#define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */
597#define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */
598#define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */
599#define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */
600
601enum fc_els_rscn_ev_qual {
602 ELS_EV_QUAL_NONE = 0, /* unspecified */
603 ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */
604 ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */
605 ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */
606 ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */
607 ELS_EV_QUAL_REM_OBJ = 5, /* removed object */
608};
609
610enum fc_els_rscn_addr_fmt {
611 ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */
612 ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */
613 ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */
614 ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */
615};
616
617/*
618 * ELS_RNID - request Node ID.
619 */
620struct fc_els_rnid {
621 __u8 rnid_cmd; /* RNID opcode (0x78) */
622 __u8 rnid_resv[3]; /* reserved */
623 __u8 rnid_fmt; /* data format */
624 __u8 rnid_resv2[3]; /* reserved */
625};
626
627/*
628 * Node Identification Data formats (rnid_fmt)
629 */
630enum fc_els_rnid_fmt {
631 ELS_RNIDF_NONE = 0, /* no specific identification data */
632 ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */
633};
634
635/*
636 * ELS_RNID response.
637 */
638struct fc_els_rnid_resp {
639 __u8 rnid_cmd; /* response code (LS_ACC) */
640 __u8 rnid_resv[3]; /* reserved */
641 __u8 rnid_fmt; /* data format */
642 __u8 rnid_cid_len; /* common ID data length */
643 __u8 rnid_resv2; /* reserved */
644 __u8 rnid_sid_len; /* specific ID data length */
645};
646
647struct fc_els_rnid_cid {
648 __be64 rnid_wwpn; /* N port name */
649 __be64 rnid_wwnn; /* node name */
650};
651
652struct fc_els_rnid_gen {
653 __u8 rnid_vend_id[16]; /* vendor-unique ID */
654 __be32 rnid_atype; /* associated type (see below) */
655 __be32 rnid_phys_port; /* physical port number */
656 __be32 rnid_att_nodes; /* number of attached nodes */
657 __u8 rnid_node_mgmt; /* node management (see below) */
658 __u8 rnid_ip_ver; /* IP version (see below) */
659 __be16 rnid_prot_port; /* UDP / TCP port number */
660 __be32 rnid_ip_addr[4]; /* IP address */
661 __u8 rnid_resvd[2]; /* reserved */
662 __be16 rnid_vend_spec; /* vendor-specific field */
663};
664
665enum fc_els_rnid_atype {
666 ELS_RNIDA_UNK = 0x01, /* unknown */
667 ELS_RNIDA_OTHER = 0x02, /* none of the following */
668 ELS_RNIDA_HUB = 0x03,
669 ELS_RNIDA_SWITCH = 0x04,
670 ELS_RNIDA_GATEWAY = 0x05,
671 ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */
672 ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */
673 ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */
674 ELS_RNIDA_STORAGE = 0x09,
675 ELS_RNIDA_HOST = 0x0a,
676 ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */
677 ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */
678 ELS_RNIDA_NAS = 0x11, /* NAS server */
679 ELS_RNIDA_BRIDGE = 0x12, /* bridge */
680 ELS_RNIDA_VIRT = 0x13, /* virtualization device */
681 ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */
682 ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */
683 ELS_RNIDA_MF_SW = 1UL << 30, /* switch */
684 ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */
685 ELS_RNIDA_MF_ST = 1UL << 28, /* storage */
686 ELS_RNIDA_MF_HOST = 1UL << 27, /* host */
687 ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */
688 ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */
689 ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */
690 ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */
691 ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */
692 ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */
693};
694
695enum fc_els_rnid_mgmt {
696 ELS_RNIDM_SNMP = 0,
697 ELS_RNIDM_TELNET = 1,
698 ELS_RNIDM_HTTP = 2,
699 ELS_RNIDM_HTTPS = 3,
700 ELS_RNIDM_XML = 4, /* HTTP + XML */
701};
702
703enum fc_els_rnid_ipver {
704 ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */
705 ELS_RNIDIP_V4 = 1, /* IPv4 */
706 ELS_RNIDIP_V6 = 2, /* IPv6 */
707};
708
709/*
710 * ELS RPL - Read Port List.
711 */
712struct fc_els_rpl {
713 __u8 rpl_cmd; /* command */
714 __u8 rpl_resv[5]; /* reserved - must be zero */
715 __be16 rpl_max_size; /* maximum response size or zero */
716 __u8 rpl_resv1; /* reserved - must be zero */
717 __u8 rpl_index[3]; /* starting index */
718};
719
720/*
721 * Port number block in RPL response.
722 */
723struct fc_els_pnb {
724 __be32 pnb_phys_pn; /* physical port number */
725 __u8 pnb_resv; /* reserved */
726 __u8 pnb_port_id[3]; /* port ID */
727 __be64 pnb_wwpn; /* port name */
728};
729
730/*
731 * RPL LS_ACC response.
732 */
733struct fc_els_rpl_resp {
734 __u8 rpl_cmd; /* ELS_LS_ACC */
735 __u8 rpl_resv1; /* reserved - must be zero */
736 __be16 rpl_plen; /* payload length */
737 __u8 rpl_resv2; /* reserved - must be zero */
738 __u8 rpl_llen[3]; /* list length */
739 __u8 rpl_resv3; /* reserved - must be zero */
740 __u8 rpl_index[3]; /* starting index */
741 struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */
742};
743
744/*
745 * Link Error Status Block.
746 */
747struct fc_els_lesb {
748 __be32 lesb_link_fail; /* link failure count */
749 __be32 lesb_sync_loss; /* loss of synchronization count */
750 __be32 lesb_sig_loss; /* loss of signal count */
751 __be32 lesb_prim_err; /* primitive sequence error count */
752 __be32 lesb_inv_word; /* invalid transmission word count */
753 __be32 lesb_inv_crc; /* invalid CRC count */
754};
755
756/*
757 * ELS RPS - Read Port Status Block request.
758 */
759struct fc_els_rps {
760 __u8 rps_cmd; /* command */
761 __u8 rps_resv[2]; /* reserved - must be zero */
762 __u8 rps_flag; /* flag - see below */
763 __be64 rps_port_spec; /* port selection */
764};
765
766enum fc_els_rps_flag {
767 FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */
768 FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */
769 FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */
770};
771
772/*
773 * ELS RPS LS_ACC response.
774 */
775struct fc_els_rps_resp {
776 __u8 rps_cmd; /* command - LS_ACC */
777 __u8 rps_resv[2]; /* reserved - must be zero */
778 __u8 rps_flag; /* flag - see below */
779 __u8 rps_resv2[2]; /* reserved */
780 __be16 rps_status; /* port status - see below */
781 struct fc_els_lesb rps_lesb; /* link error status block */
782};
783
784enum fc_els_rps_resp_flag {
785 FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */
786};
787
788enum fc_els_rps_resp_status {
789 FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */
790 FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */
791 FC_ELS_RPS_FAB = 1 << 3, /* fabric present */
792 FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */
793 FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */
794 FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */
795};
796
797/*
798 * ELS LIRR - Link Incident Record Registration request.
799 */
800struct fc_els_lirr {
801 __u8 lirr_cmd; /* command */
802 __u8 lirr_resv[3]; /* reserved - must be zero */
803 __u8 lirr_func; /* registration function */
804 __u8 lirr_fmt; /* FC-4 type of RLIR requested */
805 __u8 lirr_resv2[2]; /* reserved - must be zero */
806};
807
808enum fc_els_lirr_func {
809 ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */
810 ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */
811 ELS_LIRR_CLEAR = 0xff /* clear registration */
812};
813
814/*
815 * ELS SRL - Scan Remote Loop request.
816 */
817struct fc_els_srl {
818 __u8 srl_cmd; /* command */
819 __u8 srl_resv[3]; /* reserved - must be zero */
820 __u8 srl_flag; /* flag - see below */
821 __u8 srl_flag_param[3]; /* flag parameter */
822};
823
824enum fc_els_srl_flag {
825 FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */
826 FC_ELS_SRL_ONE = 0x01, /* scan specified loop */
827 FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */
828 FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */
829};
830
831/*
832 * ELS RLS - Read Link Error Status Block request.
833 */
834struct fc_els_rls {
835 __u8 rls_cmd; /* command */
836 __u8 rls_resv[4]; /* reserved - must be zero */
837 __u8 rls_port_id[3]; /* port ID */
838};
839
840/*
841 * ELS RLS LS_ACC Response.
842 */
843struct fc_els_rls_resp {
844 __u8 rls_cmd; /* ELS_LS_ACC */
845 __u8 rls_resv[3]; /* reserved - must be zero */
846 struct fc_els_lesb rls_lesb; /* link error status block */
847};
848
849/*
850 * ELS RLIR - Registered Link Incident Report.
851 * This is followed by the CLIR and the CLID, described below.
852 */
853struct fc_els_rlir {
854 __u8 rlir_cmd; /* command */
855 __u8 rlir_resv[3]; /* reserved - must be zero */
856 __u8 rlir_fmt; /* format (FC4-type if type specific) */
857 __u8 rlir_clr_len; /* common link incident record length */
858 __u8 rlir_cld_len; /* common link incident desc. length */
859 __u8 rlir_slr_len; /* spec. link incident record length */
860};
861
862/*
863 * CLIR - Common Link Incident Record Data. - Sent via RLIR.
864 */
865struct fc_els_clir {
866 __be64 clir_wwpn; /* incident port name */
867 __be64 clir_wwnn; /* incident port node name */
868 __u8 clir_port_type; /* incident port type */
869 __u8 clir_port_id[3]; /* incident port ID */
870
871 __be64 clir_conn_wwpn; /* connected port name */
872 __be64 clir_conn_wwnn; /* connected node name */
873 __be64 clir_fab_name; /* fabric name */
874 __be32 clir_phys_port; /* physical port number */
875 __be32 clir_trans_id; /* transaction ID */
876 __u8 clir_resv[3]; /* reserved */
877 __u8 clir_ts_fmt; /* time stamp format */
878 __be64 clir_timestamp; /* time stamp */
879};
880
881/*
882 * CLIR clir_ts_fmt - time stamp format values.
883 */
884enum fc_els_clir_ts_fmt {
885 ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */
886 ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */
887 ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */
888};
889
890/*
891 * Common Link Incident Descriptor - sent via RLIR.
892 */
893struct fc_els_clid {
894 __u8 clid_iq; /* incident qualifier flags */
895 __u8 clid_ic; /* incident code */
896 __be16 clid_epai; /* domain/area of ISL */
897};
898
899/*
900 * CLID incident qualifier flags.
901 */
902enum fc_els_clid_iq {
903 ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */
904 ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */
905 ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */
906 ELS_CLID_SEV_INFO = 0x00, /* report is informational */
907 ELS_CLID_SEV_INOP = 0x08, /* link not operational */
908 ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */
909 ELS_CLID_LASER = 0x02, /* subassembly is a laser */
910 ELS_CLID_FRU = 0x01, /* format can identify a FRU */
911};
912
913/*
914 * CLID incident code.
915 */
916enum fc_els_clid_ic {
917 ELS_CLID_IC_IMPL = 1, /* implicit incident */
918 ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */
919 ELS_CLID_IC_LOS = 3, /* loss of synch or signal */
920 ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */
921 ELS_CLID_IC_PST = 5, /* primitive sequence timeout */
922 ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */
923 ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */
924 ELS_CLID_IC_LIP = 8, /* receiving LIP */
925};
926
927/*
928 * Link Integrity event types
929 */
930enum fc_fpin_li_event_types {
931 FPIN_LI_UNKNOWN = 0x0,
932 FPIN_LI_LINK_FAILURE = 0x1,
933 FPIN_LI_LOSS_OF_SYNC = 0x2,
934 FPIN_LI_LOSS_OF_SIG = 0x3,
935 FPIN_LI_PRIM_SEQ_ERR = 0x4,
936 FPIN_LI_INVALID_TX_WD = 0x5,
937 FPIN_LI_INVALID_CRC = 0x6,
938 FPIN_LI_DEVICE_SPEC = 0xF,
939};
940
941/*
942 * Initializer useful for decoding table.
943 * Please keep this in sync with the above definitions.
944 */
945#define FC_FPIN_LI_EVT_TYPES_INIT { \
946 { FPIN_LI_UNKNOWN, "Unknown" }, \
947 { FPIN_LI_LINK_FAILURE, "Link Failure" }, \
948 { FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, \
949 { FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, \
950 { FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, \
951 { FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, \
952 { FPIN_LI_INVALID_CRC, "Invalid CRC" }, \
953 { FPIN_LI_DEVICE_SPEC, "Device Specific" }, \
954}
955
956/*
957 * Delivery event types
958 */
959enum fc_fpin_deli_event_types {
960 FPIN_DELI_UNKNOWN = 0x0,
961 FPIN_DELI_TIMEOUT = 0x1,
962 FPIN_DELI_UNABLE_TO_ROUTE = 0x2,
963 FPIN_DELI_DEVICE_SPEC = 0xF,
964};
965
966/*
967 * Initializer useful for decoding table.
968 * Please keep this in sync with the above definitions.
969 */
970#define FC_FPIN_DELI_EVT_TYPES_INIT { \
971 { FPIN_DELI_UNKNOWN, "Unknown" }, \
972 { FPIN_DELI_TIMEOUT, "Timeout" }, \
973 { FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \
974 { FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \
975}
976
977/*
978 * Congestion event types
979 */
980enum fc_fpin_congn_event_types {
981 FPIN_CONGN_CLEAR = 0x0,
982 FPIN_CONGN_LOST_CREDIT = 0x1,
983 FPIN_CONGN_CREDIT_STALL = 0x2,
984 FPIN_CONGN_OVERSUBSCRIPTION = 0x3,
985 FPIN_CONGN_DEVICE_SPEC = 0xF,
986};
987
988/*
989 * Initializer useful for decoding table.
990 * Please keep this in sync with the above definitions.
991 */
992#define FC_FPIN_CONGN_EVT_TYPES_INIT { \
993 { FPIN_CONGN_CLEAR, "Clear" }, \
994 { FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \
995 { FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \
996 { FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \
997 { FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \
998}
999
1000enum fc_fpin_congn_severity_types {
1001 FPIN_CONGN_SEVERITY_WARNING = 0xF1,
1002 FPIN_CONGN_SEVERITY_ERROR = 0xF7,
1003};
1004
1005/*
1006 * Link Integrity Notification Descriptor
1007 */
1008struct fc_fn_li_desc {
1009 __be32 desc_tag; /* Descriptor Tag (0x00020001) */
1010 __be32 desc_len; /* Length of Descriptor (in bytes).
1011 * Size of descriptor excluding
1012 * desc_tag and desc_len fields.
1013 */
1014 __be64 detecting_wwpn; /* Port Name that detected event */
1015 __be64 attached_wwpn; /* Port Name of device attached to
1016 * detecting Port Name
1017 */
1018 __be16 event_type; /* see enum fc_fpin_li_event_types */
1019 __be16 event_modifier; /* Implementation specific value
1020 * describing the event type
1021 */
1022 __be32 event_threshold;/* duration in ms of the link
1023 * integrity detection cycle
1024 */
1025 __be32 event_count; /* minimum number of event
1026 * occurrences during the event
1027 * threshold to caause the LI event
1028 */
1029 __be32 pname_count; /* number of portname_list elements */
1030 __be64 pname_list[0]; /* list of N_Port_Names accessible
1031 * through the attached port
1032 */
1033};
1034
1035/*
1036 * Delivery Notification Descriptor
1037 */
1038struct fc_fn_deli_desc {
1039 __be32 desc_tag; /* Descriptor Tag (0x00020002) */
1040 __be32 desc_len; /* Length of Descriptor (in bytes).
1041 * Size of descriptor excluding
1042 * desc_tag and desc_len fields.
1043 */
1044 __be64 detecting_wwpn; /* Port Name that detected event */
1045 __be64 attached_wwpn; /* Port Name of device attached to
1046 * detecting Port Name
1047 */
1048 __be32 deli_reason_code;/* see enum fc_fpin_deli_event_types */
1049};
1050
1051/*
1052 * Peer Congestion Notification Descriptor
1053 */
1054struct fc_fn_peer_congn_desc {
1055 __be32 desc_tag; /* Descriptor Tag (0x00020003) */
1056 __be32 desc_len; /* Length of Descriptor (in bytes).
1057 * Size of descriptor excluding
1058 * desc_tag and desc_len fields.
1059 */
1060 __be64 detecting_wwpn; /* Port Name that detected event */
1061 __be64 attached_wwpn; /* Port Name of device attached to
1062 * detecting Port Name
1063 */
1064 __be16 event_type; /* see enum fc_fpin_congn_event_types */
1065 __be16 event_modifier; /* Implementation specific value
1066 * describing the event type
1067 */
1068 __be32 event_period; /* duration (ms) of the detected
1069 * congestion event
1070 */
1071 __be32 pname_count; /* number of portname_list elements */
1072 __be64 pname_list[0]; /* list of N_Port_Names accessible
1073 * through the attached port
1074 */
1075};
1076
1077/*
1078 * Congestion Notification Descriptor
1079 */
1080struct fc_fn_congn_desc {
1081 __be32 desc_tag; /* Descriptor Tag (0x00020004) */
1082 __be32 desc_len; /* Length of Descriptor (in bytes).
1083 * Size of descriptor excluding
1084 * desc_tag and desc_len fields.
1085 */
1086 __be16 event_type; /* see enum fc_fpin_congn_event_types */
1087 __be16 event_modifier; /* Implementation specific value
1088 * describing the event type
1089 */
1090 __be32 event_period; /* duration (ms) of the detected
1091 * congestion event
1092 */
1093 __u8 severity; /* command */
1094 __u8 resv[3]; /* reserved - must be zero */
1095};
1096
1097/*
1098 * ELS_FPIN - Fabric Performance Impact Notification
1099 */
1100struct fc_els_fpin {
1101 __u8 fpin_cmd; /* command (0x16) */
1102 __u8 fpin_zero[3]; /* specified as zero - part of cmd */
1103 __be32 desc_len; /* Length of Descriptor List (in bytes).
1104 * Size of ELS excluding fpin_cmd,
1105 * fpin_zero and desc_len fields.
1106 */
1107 struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */
1108};
1109
1110/* Diagnostic Function Descriptor - FPIN Registration */
1111struct 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 */
1118 __be32 desc_tags[0]; /* Array of Descriptor Tags.
1119 * Each tag indicates a function
1120 * supported by the N_Port (request)
1121 * or by the N_Port and Fabric
1122 * Controller (reply; may be a subset
1123 * of the request).
1124 * See ELS_FN_DTAG_xxx for tag values.
1125 */
1126};
1127
1128/*
1129 * ELS_RDF - Register Diagnostic Functions
1130 */
1131struct 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 */
1138 struct fc_tlv_desc desc[0]; /* Descriptor list */
1139};
1140
1141/*
1142 * ELS RDF LS_ACC Response.
1143 */
1144struct 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;
1151 struct fc_tlv_desc desc[0]; /* Supported Descriptor list */
1152};
1153
1154
1155/*
1156 * Diagnostic Capability Descriptors for EDC ELS
1157 */
1158
1159/*
1160 * Diagnostic: Link Fault Capability Descriptor
1161 */
1162struct fc_diag_lnkflt_desc {
1163 __be32 desc_tag; /* Descriptor Tag (0x0001000D) */
1164 __be32 desc_len; /* Length of Descriptor (in bytes).
1165 * Size of descriptor excluding
1166 * desc_tag and desc_len fields.
1167 * 12 bytes
1168 */
1169 __be32 degrade_activate_threshold;
1170 __be32 degrade_deactivate_threshold;
1171 __be32 fec_degrade_interval;
1172};
1173
1174enum fc_edc_cg_signal_cap_types {
1175 /* Note: Capability: bits 31:4 Rsvd; bits 3:0 are capabilities */
1176 EDC_CG_SIG_NOTSUPPORTED = 0x00, /* neither supported */
1177 EDC_CG_SIG_WARN_ONLY = 0x01,
1178 EDC_CG_SIG_WARN_ALARM = 0x02, /* both supported */
1179};
1180
1181/*
1182 * Initializer useful for decoding table.
1183 * Please keep this in sync with the above definitions.
1184 */
1185#define FC_EDC_CG_SIGNAL_CAP_TYPES_INIT { \
1186 { EDC_CG_SIG_NOTSUPPORTED, "Signaling Not Supported" }, \
1187 { EDC_CG_SIG_WARN_ONLY, "Warning Signal" }, \
1188 { EDC_CG_SIG_WARN_ALARM, "Warning and Alarm Signals" }, \
1189}
1190
1191enum fc_diag_cg_sig_freq_types {
1192 EDC_CG_SIGFREQ_CNT_MIN = 1, /* Min Frequency Count */
1193 EDC_CG_SIGFREQ_CNT_MAX = 999, /* Max Frequency Count */
1194
1195 EDC_CG_SIGFREQ_SEC = 0x1, /* Units: seconds */
1196 EDC_CG_SIGFREQ_MSEC = 0x2, /* Units: milliseconds */
1197};
1198
1199struct fc_diag_cg_sig_freq {
1200 __be16 count; /* Time between signals
1201 * note: upper 6 bits rsvd
1202 */
1203 __be16 units; /* Time unit for count
1204 * note: upper 12 bits rsvd
1205 */
1206};
1207
1208/*
1209 * Diagnostic: Congestion Signaling Capability Descriptor
1210 */
1211struct fc_diag_cg_sig_desc {
1212 __be32 desc_tag; /* Descriptor Tag (0x0001000F) */
1213 __be32 desc_len; /* Length of Descriptor (in bytes).
1214 * Size of descriptor excluding
1215 * desc_tag and desc_len fields.
1216 * 16 bytes
1217 */
1218 __be32 xmt_signal_capability;
1219 struct fc_diag_cg_sig_freq xmt_signal_frequency;
1220 __be32 rcv_signal_capability;
1221 struct fc_diag_cg_sig_freq rcv_signal_frequency;
1222};
1223
1224/*
1225 * ELS_EDC - Exchange Diagnostic Capabilities
1226 */
1227struct fc_els_edc {
1228 __u8 edc_cmd; /* command (0x17) */
1229 __u8 edc_zero[3]; /* specified as zero - part of cmd */
1230 __be32 desc_len; /* Length of Descriptor List (in bytes).
1231 * Size of ELS excluding edc_cmd,
1232 * edc_zero and desc_len fields.
1233 */
1234 struct fc_tlv_desc desc[0];
1235 /* Diagnostic Descriptor list */
1236};
1237
1238/*
1239 * ELS EDC LS_ACC Response.
1240 */
1241struct fc_els_edc_resp {
1242 struct fc_els_ls_acc acc_hdr;
1243 __be32 desc_list_len; /* Length of response (in
1244 * bytes). Excludes acc_hdr
1245 * and desc_list_len fields.
1246 */
1247 struct fc_els_lsri_desc lsri;
1248 struct fc_tlv_desc desc[0];
1249 /* Supported Diagnostic Descriptor list */
1250};
1251
1252
1253#endif /* _FC_ELS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/fc/fc_fs.h created+338
...@@ -0,0 +1,338 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * Maintained at www.Open-FCoE.org
6 */
7
8#ifndef _FC_FS_H_
9#define _FC_FS_H_
10
11#include <linux/types.h>
12
13/*
14 * Fibre Channel Framing and Signalling definitions.
15 * From T11 FC-FS-2 Rev 0.90 - 9 August 2005.
16 */
17
18/*
19 * Frame header
20 */
21struct fc_frame_header {
22 __u8 fh_r_ctl; /* routing control */
23 __u8 fh_d_id[3]; /* Destination ID */
24
25 __u8 fh_cs_ctl; /* class of service control / pri */
26 __u8 fh_s_id[3]; /* Source ID */
27
28 __u8 fh_type; /* see enum fc_fh_type below */
29 __u8 fh_f_ctl[3]; /* frame control */
30
31 __u8 fh_seq_id; /* sequence ID */
32 __u8 fh_df_ctl; /* data field control */
33 __be16 fh_seq_cnt; /* sequence count */
34
35 __be16 fh_ox_id; /* originator exchange ID */
36 __be16 fh_rx_id; /* responder exchange ID */
37 __be32 fh_parm_offset; /* parameter or relative offset */
38};
39
40#define FC_FRAME_HEADER_LEN 24 /* expected length of structure */
41
42#define FC_MAX_PAYLOAD 2112U /* max payload length in bytes */
43#define FC_MIN_MAX_PAYLOAD 256U /* lower limit on max payload */
44
45#define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
46#define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
47
48/*
49 * fh_r_ctl - Routing control definitions.
50 */
51 /*
52 * FC-4 device_data.
53 */
54enum fc_rctl {
55 FC_RCTL_DD_UNCAT = 0x00, /* uncategorized information */
56 FC_RCTL_DD_SOL_DATA = 0x01, /* solicited data */
57 FC_RCTL_DD_UNSOL_CTL = 0x02, /* unsolicited control */
58 FC_RCTL_DD_SOL_CTL = 0x03, /* solicited control or reply */
59 FC_RCTL_DD_UNSOL_DATA = 0x04, /* unsolicited data */
60 FC_RCTL_DD_DATA_DESC = 0x05, /* data descriptor */
61 FC_RCTL_DD_UNSOL_CMD = 0x06, /* unsolicited command */
62 FC_RCTL_DD_CMD_STATUS = 0x07, /* command status */
63
64#define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL /* ILS request */
65#define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL /* ILS reply */
66
67 /*
68 * Extended Link_Data
69 */
70 FC_RCTL_ELS_REQ = 0x22, /* extended link services request */
71 FC_RCTL_ELS_REP = 0x23, /* extended link services reply */
72 FC_RCTL_ELS4_REQ = 0x32, /* FC-4 ELS request */
73 FC_RCTL_ELS4_REP = 0x33, /* FC-4 ELS reply */
74 /*
75 * Optional Extended Headers
76 */
77 FC_RCTL_VFTH = 0x50, /* virtual fabric tagging header */
78 FC_RCTL_IFRH = 0x51, /* inter-fabric routing header */
79 FC_RCTL_ENCH = 0x52, /* encapsulation header */
80 /*
81 * Basic Link Services fh_r_ctl values.
82 */
83 FC_RCTL_BA_NOP = 0x80, /* basic link service NOP */
84 FC_RCTL_BA_ABTS = 0x81, /* basic link service abort */
85 FC_RCTL_BA_RMC = 0x82, /* remove connection */
86 FC_RCTL_BA_ACC = 0x84, /* basic accept */
87 FC_RCTL_BA_RJT = 0x85, /* basic reject */
88 FC_RCTL_BA_PRMT = 0x86, /* dedicated connection preempted */
89 /*
90 * Link Control Information.
91 */
92 FC_RCTL_ACK_1 = 0xc0, /* acknowledge_1 */
93 FC_RCTL_ACK_0 = 0xc1, /* acknowledge_0 */
94 FC_RCTL_P_RJT = 0xc2, /* port reject */
95 FC_RCTL_F_RJT = 0xc3, /* fabric reject */
96 FC_RCTL_P_BSY = 0xc4, /* port busy */
97 FC_RCTL_F_BSY = 0xc5, /* fabric busy to data frame */
98 FC_RCTL_F_BSYL = 0xc6, /* fabric busy to link control frame */
99 FC_RCTL_LCR = 0xc7, /* link credit reset */
100 FC_RCTL_END = 0xc9, /* end */
101};
102 /* incomplete list of definitions */
103
104/*
105 * R_CTL names initializer.
106 * Please keep this matching the above definitions.
107 */
108#define FC_RCTL_NAMES_INIT { \
109 [FC_RCTL_DD_UNCAT] = "uncat", \
110 [FC_RCTL_DD_SOL_DATA] = "sol data", \
111 [FC_RCTL_DD_UNSOL_CTL] = "unsol ctl", \
112 [FC_RCTL_DD_SOL_CTL] = "sol ctl/reply", \
113 [FC_RCTL_DD_UNSOL_DATA] = "unsol data", \
114 [FC_RCTL_DD_DATA_DESC] = "data desc", \
115 [FC_RCTL_DD_UNSOL_CMD] = "unsol cmd", \
116 [FC_RCTL_DD_CMD_STATUS] = "cmd status", \
117 [FC_RCTL_ELS_REQ] = "ELS req", \
118 [FC_RCTL_ELS_REP] = "ELS rep", \
119 [FC_RCTL_ELS4_REQ] = "FC-4 ELS req", \
120 [FC_RCTL_ELS4_REP] = "FC-4 ELS rep", \
121 [FC_RCTL_BA_NOP] = "BLS NOP", \
122 [FC_RCTL_BA_ABTS] = "BLS abort", \
123 [FC_RCTL_BA_RMC] = "BLS remove connection", \
124 [FC_RCTL_BA_ACC] = "BLS accept", \
125 [FC_RCTL_BA_RJT] = "BLS reject", \
126 [FC_RCTL_BA_PRMT] = "BLS dedicated connection preempted", \
127 [FC_RCTL_ACK_1] = "LC ACK_1", \
128 [FC_RCTL_ACK_0] = "LC ACK_0", \
129 [FC_RCTL_P_RJT] = "LC port reject", \
130 [FC_RCTL_F_RJT] = "LC fabric reject", \
131 [FC_RCTL_P_BSY] = "LC port busy", \
132 [FC_RCTL_F_BSY] = "LC fabric busy to data frame", \
133 [FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",\
134 [FC_RCTL_LCR] = "LC link credit reset", \
135 [FC_RCTL_END] = "LC end", \
136}
137
138/*
139 * Well-known fabric addresses.
140 */
141enum fc_well_known_fid {
142 FC_FID_NONE = 0x000000, /* No destination */
143 FC_FID_BCAST = 0xffffff, /* broadcast */
144 FC_FID_FLOGI = 0xfffffe, /* fabric login */
145 FC_FID_FCTRL = 0xfffffd, /* fabric controller */
146 FC_FID_DIR_SERV = 0xfffffc, /* directory server */
147 FC_FID_TIME_SERV = 0xfffffb, /* time server */
148 FC_FID_MGMT_SERV = 0xfffffa, /* management server */
149 FC_FID_QOS = 0xfffff9, /* QoS Facilitator */
150 FC_FID_ALIASES = 0xfffff8, /* alias server (FC-PH2) */
151 FC_FID_SEC_KEY = 0xfffff7, /* Security key dist. server */
152 FC_FID_CLOCK = 0xfffff6, /* clock synch server */
153 FC_FID_MCAST_SERV = 0xfffff5, /* multicast server */
154};
155
156#define FC_FID_WELL_KNOWN_MAX 0xffffff /* highest well-known fabric ID */
157#define FC_FID_WELL_KNOWN_BASE 0xfffff5 /* start of well-known fabric ID */
158
159/*
160 * Other well-known addresses, outside the above contiguous range.
161 */
162#define FC_FID_DOM_MGR 0xfffc00 /* domain manager base */
163
164/*
165 * Fabric ID bytes.
166 */
167#define FC_FID_DOMAIN 0
168#define FC_FID_PORT 1
169#define FC_FID_LINK 2
170
171/*
172 * fh_type codes
173 */
174enum fc_fh_type {
175 FC_TYPE_BLS = 0x00, /* basic link service */
176 FC_TYPE_ELS = 0x01, /* extended link service */
177 FC_TYPE_IP = 0x05, /* IP over FC, RFC 4338 */
178 FC_TYPE_FCP = 0x08, /* SCSI FCP */
179 FC_TYPE_CT = 0x20, /* Fibre Channel Services (FC-CT) */
180 FC_TYPE_ILS = 0x22, /* internal link service */
181 FC_TYPE_NVME = 0x28, /* FC-NVME */
182};
183
184/*
185 * FC_TYPE names initializer.
186 * Please keep this matching the above definitions.
187 */
188#define FC_TYPE_NAMES_INIT { \
189 [FC_TYPE_BLS] = "BLS", \
190 [FC_TYPE_ELS] = "ELS", \
191 [FC_TYPE_IP] = "IP", \
192 [FC_TYPE_FCP] = "FCP", \
193 [FC_TYPE_CT] = "CT", \
194 [FC_TYPE_ILS] = "ILS", \
195 [FC_TYPE_NVME] = "NVME", \
196}
197
198/*
199 * Exchange IDs.
200 */
201#define FC_XID_UNKNOWN 0xffff /* unknown exchange ID */
202#define FC_XID_MIN 0x0 /* supported min exchange ID */
203#define FC_XID_MAX 0xfffe /* supported max exchange ID */
204
205/*
206 * fh_f_ctl - Frame control flags.
207 */
208#define FC_FC_EX_CTX (1 << 23) /* sent by responder to exchange */
209#define FC_FC_SEQ_CTX (1 << 22) /* sent by responder to sequence */
210#define FC_FC_FIRST_SEQ (1 << 21) /* first sequence of this exchange */
211#define FC_FC_LAST_SEQ (1 << 20) /* last sequence of this exchange */
212#define FC_FC_END_SEQ (1 << 19) /* last frame of sequence */
213#define FC_FC_END_CONN (1 << 18) /* end of class 1 connection pending */
214#define FC_FC_RES_B17 (1 << 17) /* reserved */
215#define FC_FC_SEQ_INIT (1 << 16) /* transfer of sequence initiative */
216#define FC_FC_X_ID_REASS (1 << 15) /* exchange ID has been changed */
217#define FC_FC_X_ID_INVAL (1 << 14) /* exchange ID invalidated */
218
219#define FC_FC_ACK_1 (1 << 12) /* 13:12 = 1: ACK_1 expected */
220#define FC_FC_ACK_N (2 << 12) /* 13:12 = 2: ACK_N expected */
221#define FC_FC_ACK_0 (3 << 12) /* 13:12 = 3: ACK_0 expected */
222
223#define FC_FC_RES_B11 (1 << 11) /* reserved */
224#define FC_FC_RES_B10 (1 << 10) /* reserved */
225#define FC_FC_RETX_SEQ (1 << 9) /* retransmitted sequence */
226#define FC_FC_UNI_TX (1 << 8) /* unidirectional transmit (class 1) */
227#define FC_FC_CONT_SEQ(i) ((i) << 6)
228#define FC_FC_ABT_SEQ(i) ((i) << 4)
229#define FC_FC_REL_OFF (1 << 3) /* parameter is relative offset */
230#define FC_FC_RES2 (1 << 2) /* reserved */
231#define FC_FC_FILL(i) ((i) & 3) /* 1:0: bytes of trailing fill */
232
233/*
234 * BA_ACC payload.
235 */
236struct fc_ba_acc {
237 __u8 ba_seq_id_val; /* SEQ_ID validity */
238#define FC_BA_SEQ_ID_VAL 0x80
239 __u8 ba_seq_id; /* SEQ_ID of seq last deliverable */
240 __u8 ba_resvd[2]; /* reserved */
241 __be16 ba_ox_id; /* OX_ID for aborted seq or exch */
242 __be16 ba_rx_id; /* RX_ID for aborted seq or exch */
243 __be16 ba_low_seq_cnt; /* low SEQ_CNT of aborted seq */
244 __be16 ba_high_seq_cnt; /* high SEQ_CNT of aborted seq */
245};
246
247/*
248 * BA_RJT: Basic Reject payload.
249 */
250struct fc_ba_rjt {
251 __u8 br_resvd; /* reserved */
252 __u8 br_reason; /* reason code */
253 __u8 br_explan; /* reason explanation */
254 __u8 br_vendor; /* vendor unique code */
255};
256
257/*
258 * BA_RJT reason codes.
259 * From FS-2.
260 */
261enum fc_ba_rjt_reason {
262 FC_BA_RJT_NONE = 0, /* in software this means no reject */
263 FC_BA_RJT_INVL_CMD = 0x01, /* invalid command code */
264 FC_BA_RJT_LOG_ERR = 0x03, /* logical error */
265 FC_BA_RJT_LOG_BUSY = 0x05, /* logical busy */
266 FC_BA_RJT_PROTO_ERR = 0x07, /* protocol error */
267 FC_BA_RJT_UNABLE = 0x09, /* unable to perform request */
268 FC_BA_RJT_VENDOR = 0xff, /* vendor-specific (see br_vendor) */
269};
270
271/*
272 * BA_RJT reason code explanations.
273 */
274enum fc_ba_rjt_explan {
275 FC_BA_RJT_EXP_NONE = 0x00, /* no additional expanation */
276 FC_BA_RJT_INV_XID = 0x03, /* invalid OX_ID-RX_ID combination */
277 FC_BA_RJT_ABT = 0x05, /* sequence aborted, no seq info */
278};
279
280/*
281 * P_RJT or F_RJT: Port Reject or Fabric Reject parameter field.
282 */
283struct fc_pf_rjt {
284 __u8 rj_action; /* reserved */
285 __u8 rj_reason; /* reason code */
286 __u8 rj_resvd; /* reserved */
287 __u8 rj_vendor; /* vendor unique code */
288};
289
290/*
291 * P_RJT and F_RJT reject reason codes.
292 */
293enum fc_pf_rjt_reason {
294 FC_RJT_NONE = 0, /* non-reject (reserved by standard) */
295 FC_RJT_INVL_DID = 0x01, /* invalid destination ID */
296 FC_RJT_INVL_SID = 0x02, /* invalid source ID */
297 FC_RJT_P_UNAV_T = 0x03, /* port unavailable, temporary */
298 FC_RJT_P_UNAV = 0x04, /* port unavailable, permanent */
299 FC_RJT_CLS_UNSUP = 0x05, /* class not supported */
300 FC_RJT_DEL_USAGE = 0x06, /* delimiter usage error */
301 FC_RJT_TYPE_UNSUP = 0x07, /* type not supported */
302 FC_RJT_LINK_CTL = 0x08, /* invalid link control */
303 FC_RJT_R_CTL = 0x09, /* invalid R_CTL field */
304 FC_RJT_F_CTL = 0x0a, /* invalid F_CTL field */
305 FC_RJT_OX_ID = 0x0b, /* invalid originator exchange ID */
306 FC_RJT_RX_ID = 0x0c, /* invalid responder exchange ID */
307 FC_RJT_SEQ_ID = 0x0d, /* invalid sequence ID */
308 FC_RJT_DF_CTL = 0x0e, /* invalid DF_CTL field */
309 FC_RJT_SEQ_CNT = 0x0f, /* invalid SEQ_CNT field */
310 FC_RJT_PARAM = 0x10, /* invalid parameter field */
311 FC_RJT_EXCH_ERR = 0x11, /* exchange error */
312 FC_RJT_PROTO = 0x12, /* protocol error */
313 FC_RJT_LEN = 0x13, /* incorrect length */
314 FC_RJT_UNEXP_ACK = 0x14, /* unexpected ACK */
315 FC_RJT_FAB_CLASS = 0x15, /* class unsupported by fabric entity */
316 FC_RJT_LOGI_REQ = 0x16, /* login required */
317 FC_RJT_SEQ_XS = 0x17, /* excessive sequences attempted */
318 FC_RJT_EXCH_EST = 0x18, /* unable to establish exchange */
319 FC_RJT_FAB_UNAV = 0x1a, /* fabric unavailable */
320 FC_RJT_VC_ID = 0x1b, /* invalid VC_ID (class 4) */
321 FC_RJT_CS_CTL = 0x1c, /* invalid CS_CTL field */
322 FC_RJT_INSUF_RES = 0x1d, /* insuff. resources for VC (Class 4) */
323 FC_RJT_INVL_CLS = 0x1f, /* invalid class of service */
324 FC_RJT_PREEMT_RJT = 0x20, /* preemption request rejected */
325 FC_RJT_PREEMT_DIS = 0x21, /* preemption not enabled */
326 FC_RJT_MCAST_ERR = 0x22, /* multicast error */
327 FC_RJT_MCAST_ET = 0x23, /* multicast error terminate */
328 FC_RJT_PRLI_REQ = 0x24, /* process login required */
329 FC_RJT_INVL_ATT = 0x25, /* invalid attachment */
330 FC_RJT_VENDOR = 0xff, /* vendor specific reject */
331};
332
333/* default timeout values */
334
335#define FC_DEF_E_D_TOV 2000UL
336#define FC_DEF_R_A_TOV 10000UL
337
338#endif /* _FC_FS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/fc/fc_gs.h created+84
...@@ -0,0 +1,84 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * Maintained at www.Open-FCoE.org
6 */
7
8#ifndef _FC_GS_H_
9#define _FC_GS_H_
10
11#include <linux/types.h>
12
13/*
14 * Fibre Channel Services - Common Transport.
15 * From T11.org FC-GS-2 Rev 5.3 November 1998.
16 */
17
18struct fc_ct_hdr {
19 __u8 ct_rev; /* revision */
20 __u8 ct_in_id[3]; /* N_Port ID of original requestor */
21 __u8 ct_fs_type; /* type of fibre channel service */
22 __u8 ct_fs_subtype; /* subtype */
23 __u8 ct_options;
24 __u8 _ct_resvd1;
25 __be16 ct_cmd; /* command / response code */
26 __be16 ct_mr_size; /* maximum / residual size */
27 __u8 _ct_resvd2;
28 __u8 ct_reason; /* reject reason */
29 __u8 ct_explan; /* reason code explanation */
30 __u8 ct_vendor; /* vendor unique data */
31};
32
33#define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */
34
35enum fc_ct_rev {
36 FC_CT_REV = 1 /* common transport revision */
37};
38
39/*
40 * ct_fs_type values.
41 */
42enum fc_ct_fs_type {
43 FC_FST_ALIAS = 0xf8, /* alias service */
44 FC_FST_MGMT = 0xfa, /* management service */
45 FC_FST_TIME = 0xfb, /* time service */
46 FC_FST_DIR = 0xfc, /* directory service */
47};
48
49/*
50 * ct_cmd: Command / response codes
51 */
52enum fc_ct_cmd {
53 FC_FS_RJT = 0x8001, /* reject */
54 FC_FS_ACC = 0x8002, /* accept */
55};
56
57/*
58 * FS_RJT reason codes.
59 */
60enum fc_ct_reason {
61 FC_FS_RJT_CMD = 0x01, /* invalid command code */
62 FC_FS_RJT_VER = 0x02, /* invalid version level */
63 FC_FS_RJT_LOG = 0x03, /* logical error */
64 FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */
65 FC_FS_RJT_BSY = 0x05, /* logical busy */
66 FC_FS_RJT_PROTO = 0x07, /* protocol error */
67 FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */
68 FC_FS_RJT_UNSUP = 0x0b, /* command not supported */
69};
70
71/*
72 * FS_RJT reason code explanations.
73 */
74enum fc_ct_explan {
75 FC_FS_EXP_NONE = 0x00, /* no additional explanation */
76 FC_FS_EXP_PID = 0x01, /* port ID not registered */
77 FC_FS_EXP_PNAM = 0x02, /* port name not registered */
78 FC_FS_EXP_NNAM = 0x03, /* node name not registered */
79 FC_FS_EXP_COS = 0x04, /* class of service not registered */
80 FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
81 /* definitions not complete */
82};
83
84#endif /* _FC_GS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/fc/fc_ns.h created+196
...@@ -0,0 +1,196 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * Maintained at www.Open-FCoE.org
6 */
7
8#ifndef _FC_NS_H_
9#define _FC_NS_H_
10
11#include <linux/types.h>
12
13/*
14 * Fibre Channel Services - Name Service (dNS)
15 * From T11.org FC-GS-2 Rev 5.3 November 1998.
16 */
17
18/*
19 * Common-transport sub-type for Name Server.
20 */
21#define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */
22
23/*
24 * Name server Requests.
25 * Note: this is an incomplete list, some unused requests are omitted.
26 */
27enum fc_ns_req {
28 FC_NS_GA_NXT = 0x0100, /* get all next */
29 FC_NS_GI_A = 0x0101, /* get identifiers - scope */
30 FC_NS_GPN_ID = 0x0112, /* get port name by ID */
31 FC_NS_GNN_ID = 0x0113, /* get node name by ID */
32 FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */
33 FC_NS_GID_PN = 0x0121, /* get ID for port name */
34 FC_NS_GID_NN = 0x0131, /* get IDs for node name */
35 FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */
36 FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */
37 FC_NS_GID_PT = 0x01a1, /* get IDs by port type */
38 FC_NS_RPN_ID = 0x0212, /* reg port name for ID */
39 FC_NS_RNN_ID = 0x0213, /* reg node name for ID */
40 FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */
41 FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */
42 FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */
43 FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */
44};
45
46/*
47 * Port type values.
48 */
49enum fc_ns_pt {
50 FC_NS_UNID_PORT = 0x00, /* unidentified */
51 FC_NS_N_PORT = 0x01, /* N port */
52 FC_NS_NL_PORT = 0x02, /* NL port */
53 FC_NS_FNL_PORT = 0x03, /* F/NL port */
54 FC_NS_NX_PORT = 0x7f, /* Nx port */
55 FC_NS_F_PORT = 0x81, /* F port */
56 FC_NS_FL_PORT = 0x82, /* FL port */
57 FC_NS_E_PORT = 0x84, /* E port */
58 FC_NS_B_PORT = 0x85, /* B port */
59};
60
61/*
62 * Port type object.
63 */
64struct fc_ns_pt_obj {
65 __u8 pt_type;
66};
67
68/*
69 * Port ID object
70 */
71struct fc_ns_fid {
72 __u8 fp_flags; /* flags for responses only */
73 __u8 fp_fid[3];
74};
75
76/*
77 * fp_flags in port ID object, for responses only.
78 */
79#define FC_NS_FID_LAST 0x80 /* last object */
80
81/*
82 * FC4-types object.
83 */
84#define FC_NS_TYPES 256 /* number of possible FC-4 types */
85#define FC_NS_BPW 32 /* bits per word in bitmap */
86
87struct fc_ns_fts {
88 __be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */
89};
90
91/*
92 * FC4-features object.
93 */
94struct fc_ns_ff {
95 __be32 fd_feat[FC_NS_TYPES * 4 / FC_NS_BPW]; /* 4-bits per FC-type */
96};
97
98/*
99 * GID_PT request.
100 */
101struct fc_ns_gid_pt {
102 __u8 fn_pt_type;
103 __u8 fn_domain_id_scope;
104 __u8 fn_area_id_scope;
105 __u8 fn_resvd;
106};
107
108/*
109 * GID_FT or GPN_FT request.
110 */
111struct fc_ns_gid_ft {
112 __u8 fn_resvd;
113 __u8 fn_domain_id_scope;
114 __u8 fn_area_id_scope;
115 __u8 fn_fc4_type;
116};
117
118/*
119 * GPN_FT response.
120 */
121struct fc_gpn_ft_resp {
122 __u8 fp_flags; /* see fp_flags definitions above */
123 __u8 fp_fid[3]; /* port ID */
124 __be32 fp_resvd;
125 __be64 fp_wwpn; /* port name */
126};
127
128/*
129 * GID_PN request
130 */
131struct fc_ns_gid_pn {
132 __be64 fn_wwpn; /* port name */
133};
134
135/*
136 * GID_PN response or GSPN_ID request
137 */
138struct fc_gid_pn_resp {
139 __u8 fp_resvd;
140 __u8 fp_fid[3]; /* port ID */
141};
142
143/*
144 * GSPN_ID response
145 */
146struct fc_gspn_resp {
147 __u8 fp_name_len;
148 char fp_name[];
149};
150
151/*
152 * RFT_ID request - register FC-4 types for ID.
153 */
154struct fc_ns_rft_id {
155 struct fc_ns_fid fr_fid; /* port ID object */
156 struct fc_ns_fts fr_fts; /* FC-4 types object */
157};
158
159/*
160 * RPN_ID request - register port name for ID.
161 * RNN_ID request - register node name for ID.
162 */
163struct fc_ns_rn_id {
164 struct fc_ns_fid fr_fid; /* port ID object */
165 __be64 fr_wwn; /* node name or port name */
166} __attribute__((__packed__));
167
168/*
169 * RSNN_NN request - register symbolic node name
170 */
171struct fc_ns_rsnn {
172 __be64 fr_wwn; /* node name */
173 __u8 fr_name_len;
174 char fr_name[];
175} __attribute__((__packed__));
176
177/*
178 * RSPN_ID request - register symbolic port name
179 */
180struct fc_ns_rspn {
181 struct fc_ns_fid fr_fid; /* port ID object */
182 __u8 fr_name_len;
183 char fr_name[];
184} __attribute__((__packed__));
185
186/*
187 * RFF_ID request - register FC-4 Features for ID.
188 */
189struct fc_ns_rff_id {
190 struct fc_ns_fid fr_fid; /* port ID object */
191 __u8 fr_resvd[2];
192 __u8 fr_feat; /* FC-4 Feature bits */
193 __u8 fr_type; /* FC-4 type */
194} __attribute__((__packed__));
195
196#endif /* _FC_NS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_bsg_fc.h created+307
...@@ -0,0 +1,307 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * FC Transport BSG Interface
4 *
5 * Copyright (C) 2008 James Smart, Emulex Corporation
6 */
7
8#ifndef SCSI_BSG_FC_H
9#define SCSI_BSG_FC_H
10
11#include <linux/types.h>
12
13/*
14 * This file intended to be included by both kernel and user space
15 */
16
17/*
18 * FC Transport SGIO v4 BSG Message Support
19 */
20
21/* Default BSG request timeout (in seconds) */
22#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
23
24
25/*
26 * Request Message Codes supported by the FC Transport
27 */
28
29/* define the class masks for the message codes */
30#define FC_BSG_CLS_MASK 0xF0000000 /* find object class */
31#define FC_BSG_HST_MASK 0x80000000 /* fc host class */
32#define FC_BSG_RPT_MASK 0x40000000 /* fc rport class */
33
34 /* fc_host Message Codes */
35#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
36#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
37#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
38#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
39#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
40
41 /* fc_rport Message Codes */
42#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
43#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
44
45
46
47/*
48 * FC Address Identifiers in Message Structures :
49 *
50 * Whenever a command payload contains a FC Address Identifier
51 * (aka port_id), the value is effectively in big-endian
52 * order, thus the array elements are decoded as follows:
53 * element [0] is bits 23:16 of the FC Address Identifier
54 * element [1] is bits 15:8 of the FC Address Identifier
55 * element [2] is bits 7:0 of the FC Address Identifier
56 */
57
58
59/*
60 * FC Host Messages
61 */
62
63/* FC_BSG_HST_ADDR_PORT : */
64
65/* Request:
66 * This message requests the FC host to login to the remote port
67 * at the specified N_Port_Id. The remote port is to be enumerated
68 * with the transport upon completion of the login.
69 */
70struct fc_bsg_host_add_rport {
71 __u8 reserved;
72
73 /* FC Address Identier of the remote port to login to */
74 __u8 port_id[3];
75};
76
77/* Response:
78 * There is no additional response data - fc_bsg_reply->result is sufficient
79 */
80
81
82/* FC_BSG_HST_DEL_RPORT : */
83
84/* Request:
85 * This message requests the FC host to remove an enumerated
86 * remote port and to terminate the login to it.
87 *
88 * Note: The driver is free to reject this request if it desires to
89 * remain logged in with the remote port.
90 */
91struct fc_bsg_host_del_rport {
92 __u8 reserved;
93
94 /* FC Address Identier of the remote port to logout of */
95 __u8 port_id[3];
96};
97
98/* Response:
99 * There is no additional response data - fc_bsg_reply->result is sufficient
100 */
101
102
103/* FC_BSG_HST_ELS_NOLOGIN : */
104
105/* Request:
106 * This message requests the FC_Host to send an ELS to a specific
107 * N_Port_ID. The host does not need to log into the remote port,
108 * nor does it need to enumerate the rport for further traffic
109 * (although, the FC host is free to do so if it desires).
110 */
111struct fc_bsg_host_els {
112 /*
113 * ELS Command Code being sent (must be the same as byte 0
114 * of the payload)
115 */
116 __u8 command_code;
117
118 /* FC Address Identier of the remote port to send the ELS to */
119 __u8 port_id[3];
120};
121
122/* Response:
123 */
124/* fc_bsg_ctels_reply->status values */
125#define FC_CTELS_STATUS_OK 0x00000000
126#define FC_CTELS_STATUS_REJECT 0x00000001
127#define FC_CTELS_STATUS_P_RJT 0x00000002
128#define FC_CTELS_STATUS_F_RJT 0x00000003
129#define FC_CTELS_STATUS_P_BSY 0x00000004
130#define FC_CTELS_STATUS_F_BSY 0x00000006
131struct fc_bsg_ctels_reply {
132 /*
133 * Note: An ELS LS_RJT may be reported in 2 ways:
134 * a) A status of FC_CTELS_STATUS_OK is returned. The caller
135 * is to look into the ELS receive payload to determine
136 * LS_ACC or LS_RJT (by contents of word 0). The reject
137 * data will be in word 1.
138 * b) A status of FC_CTELS_STATUS_REJECT is returned, The
139 * rjt_data field will contain valid data.
140 *
141 * Note: ELS LS_ACC is determined by an FC_CTELS_STATUS_OK, and
142 * the receive payload word 0 indicates LS_ACC
143 * (e.g. value is 0x02xxxxxx).
144 *
145 * Note: Similarly, a CT Reject may be reported in 2 ways:
146 * a) A status of FC_CTELS_STATUS_OK is returned. The caller
147 * is to look into the CT receive payload to determine
148 * Accept or Reject (by contents of word 2). The reject
149 * data will be in word 3.
150 * b) A status of FC_CTELS_STATUS_REJECT is returned, The
151 * rjt_data field will contain valid data.
152 *
153 * Note: x_RJT/BSY status will indicae that the rjt_data field
154 * is valid and contains the reason/explanation values.
155 */
156 __u32 status; /* See FC_CTELS_STATUS_xxx */
157
158 /* valid if status is not FC_CTELS_STATUS_OK */
159 struct {
160 __u8 action; /* fragment_id for CT REJECT */
161 __u8 reason_code;
162 __u8 reason_explanation;
163 __u8 vendor_unique;
164 } rjt_data;
165};
166
167
168/* FC_BSG_HST_CT : */
169
170/* Request:
171 * This message requests that a CT Request be performed with the
172 * indicated N_Port_ID. The driver is responsible for logging in with
173 * the fabric and/or N_Port_ID, etc as per FC rules. This request does
174 * not mandate that the driver must enumerate the destination in the
175 * transport. The driver is allowed to decide whether to enumerate it,
176 * and whether to tear it down after the request.
177 */
178struct fc_bsg_host_ct {
179 __u8 reserved;
180
181 /* FC Address Identier of the remote port to send the ELS to */
182 __u8 port_id[3];
183
184 /*
185 * We need words 0-2 of the generic preamble for the LLD's
186 */
187 __u32 preamble_word0; /* revision & IN_ID */
188 __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
189 __u32 preamble_word2; /* Cmd Code, Max Size */
190
191};
192/* Response:
193 *
194 * The reply structure is an fc_bsg_ctels_reply structure
195 */
196
197
198/* FC_BSG_HST_VENDOR : */
199
200/* Request:
201 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
202 * formatting requirements specified in scsi_netlink.h
203 */
204struct fc_bsg_host_vendor {
205 /*
206 * Identifies the vendor that the message is formatted for. This
207 * should be the recipient of the message.
208 */
209 __u64 vendor_id;
210
211 /* start of vendor command area */
212 __u32 vendor_cmd[0];
213};
214
215/* Response:
216 */
217struct fc_bsg_host_vendor_reply {
218 /* start of vendor response area */
219 __u32 vendor_rsp[0];
220};
221
222
223
224/*
225 * FC Remote Port Messages
226 */
227
228/* FC_BSG_RPT_ELS : */
229
230/* Request:
231 * This message requests that an ELS be performed with the rport.
232 */
233struct fc_bsg_rport_els {
234 /*
235 * ELS Command Code being sent (must be the same as
236 * byte 0 of the payload)
237 */
238 __u8 els_code;
239};
240
241/* Response:
242 *
243 * The reply structure is an fc_bsg_ctels_reply structure
244 */
245
246
247/* FC_BSG_RPT_CT : */
248
249/* Request:
250 * This message requests that a CT Request be performed with the rport.
251 */
252struct fc_bsg_rport_ct {
253 /*
254 * We need words 0-2 of the generic preamble for the LLD's
255 */
256 __u32 preamble_word0; /* revision & IN_ID */
257 __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
258 __u32 preamble_word2; /* Cmd Code, Max Size */
259};
260/* Response:
261 *
262 * The reply structure is an fc_bsg_ctels_reply structure
263 */
264
265
266
267
268/* request (CDB) structure of the sg_io_v4 */
269struct fc_bsg_request {
270 __u32 msgcode;
271 union {
272 struct fc_bsg_host_add_rport h_addrport;
273 struct fc_bsg_host_del_rport h_delrport;
274 struct fc_bsg_host_els h_els;
275 struct fc_bsg_host_ct h_ct;
276 struct fc_bsg_host_vendor h_vendor;
277
278 struct fc_bsg_rport_els r_els;
279 struct fc_bsg_rport_ct r_ct;
280 } rqst_data;
281} __attribute__((packed));
282
283
284/* response (request sense data) structure of the sg_io_v4 */
285struct fc_bsg_reply {
286 /*
287 * The completion result. Result exists in two forms:
288 * if negative, it is an -Exxx system errno value. There will
289 * be no further reply information supplied.
290 * else, it's the 4-byte scsi error result, with driver, host,
291 * msg and status fields. The per-msgcode reply structure
292 * will contain valid data.
293 */
294 __u32 result;
295
296 /* If there was reply_payload, how much was recevied ? */
297 __u32 reply_payload_rcv_len;
298
299 union {
300 struct fc_bsg_host_vendor_reply vendor_reply;
301
302 struct fc_bsg_ctels_reply ctels_reply;
303 } reply_data;
304};
305
306
307#endif /* SCSI_BSG_FC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_bsg_ufs.h created+105
...@@ -0,0 +1,105 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * UFS Transport SGIO v4 BSG Message Support
4 *
5 * Copyright (C) 2011-2013 Samsung India Software Operations
6 * Copyright (C) 2018 Western Digital Corporation
7 */
8#ifndef SCSI_BSG_UFS_H
9#define SCSI_BSG_UFS_H
10
11#include <linux/types.h>
12/*
13 * This file intended to be included by both kernel and user space
14 */
15
16#define UFS_CDB_SIZE 16
17#define UPIU_TRANSACTION_UIC_CMD 0x1F
18/* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */
19#define UIC_CMD_SIZE (sizeof(__u32) * 4)
20
21/**
22 * struct utp_upiu_header - UPIU header structure
23 * @dword_0: UPIU header DW-0
24 * @dword_1: UPIU header DW-1
25 * @dword_2: UPIU header DW-2
26 */
27struct utp_upiu_header {
28 __be32 dword_0;
29 __be32 dword_1;
30 __be32 dword_2;
31};
32
33/**
34 * struct utp_upiu_query - upiu request buffer structure for
35 * query request.
36 * @opcode: command to perform B-0
37 * @idn: a value that indicates the particular type of data B-1
38 * @index: Index to further identify data B-2
39 * @selector: Index to further identify data B-3
40 * @reserved_osf: spec reserved field B-4,5
41 * @length: number of descriptor bytes to read/write B-6,7
42 * @value: Attribute value to be written DW-5
43 * @reserved: spec reserved DW-6,7
44 */
45struct utp_upiu_query {
46 __u8 opcode;
47 __u8 idn;
48 __u8 index;
49 __u8 selector;
50 __be16 reserved_osf;
51 __be16 length;
52 __be32 value;
53 __be32 reserved[2];
54};
55
56/**
57 * struct utp_upiu_cmd - Command UPIU structure
58 * @data_transfer_len: Data Transfer Length DW-3
59 * @cdb: Command Descriptor Block CDB DW-4 to DW-7
60 */
61struct utp_upiu_cmd {
62 __be32 exp_data_transfer_len;
63 __u8 cdb[UFS_CDB_SIZE];
64};
65
66/**
67 * struct utp_upiu_req - general upiu request structure
68 * @header:UPIU header structure DW-0 to DW-2
69 * @sc: fields structure for scsi command DW-3 to DW-7
70 * @qr: fields structure for query request DW-3 to DW-7
71 * @uc: use utp_upiu_query to host the 4 dwords of uic command
72 */
73struct utp_upiu_req {
74 struct utp_upiu_header header;
75 union {
76 struct utp_upiu_cmd sc;
77 struct utp_upiu_query qr;
78 struct utp_upiu_query uc;
79 };
80};
81
82/* request (CDB) structure of the sg_io_v4 */
83struct ufs_bsg_request {
84 __u32 msgcode;
85 struct utp_upiu_req upiu_req;
86};
87
88/* response (request sense data) structure of the sg_io_v4 */
89struct ufs_bsg_reply {
90 /*
91 * The completion result. Result exists in two forms:
92 * if negative, it is an -Exxx system errno value. There will
93 * be no further reply information supplied.
94 * else, it's the 4-byte scsi error result, with driver, host,
95 * msg and status fields. The per-msgcode reply structure
96 * will contain valid data.
97 */
98 __u32 result;
99
100 /* If there was reply_payload, how much was received? */
101 __u32 reply_payload_rcv_len;
102
103 struct utp_upiu_req upiu_rsp;
104};
105#endif /* UFS_BSG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_netlink.h created+108
...@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * SCSI Transport Netlink Interface
4 * Used for the posting of outbound SCSI transport events
5 *
6 * Copyright (C) 2006 James Smart, Emulex Corporation
7 */
8#ifndef SCSI_NETLINK_H
9#define SCSI_NETLINK_H
10
11#include <linux/netlink.h>
12#include <linux/types.h>
13
14/*
15 * This file intended to be included by both kernel and user space
16 */
17
18/* Single Netlink Message type to send all SCSI Transport messages */
19#define SCSI_TRANSPORT_MSG NLMSG_MIN_TYPE + 1
20
21/* SCSI Transport Broadcast Groups */
22 /* leaving groups 0 and 1 unassigned */
23#define SCSI_NL_GRP_FC_EVENTS (1<<2) /* Group 2 */
24#define SCSI_NL_GRP_CNT 3
25
26
27/* SCSI_TRANSPORT_MSG event message header */
28struct scsi_nl_hdr {
29 __u8 version;
30 __u8 transport;
31 __u16 magic;
32 __u16 msgtype;
33 __u16 msglen;
34} __attribute__((aligned(sizeof(__u64))));
35
36/* scsi_nl_hdr->version value */
37#define SCSI_NL_VERSION 1
38
39/* scsi_nl_hdr->magic value */
40#define SCSI_NL_MAGIC 0xA1B2
41
42/* scsi_nl_hdr->transport value */
43#define SCSI_NL_TRANSPORT 0
44#define SCSI_NL_TRANSPORT_FC 1
45#define SCSI_NL_MAX_TRANSPORTS 2
46
47/* Transport-based scsi_nl_hdr->msgtype values are defined in each transport */
48
49/*
50 * GENERIC SCSI scsi_nl_hdr->msgtype Values
51 */
52 /* kernel -> user */
53#define SCSI_NL_SHOST_VENDOR 0x0001
54 /* user -> kernel */
55/* SCSI_NL_SHOST_VENDOR msgtype is kernel->user and user->kernel */
56
57
58/*
59 * Message Structures :
60 */
61
62/* macro to round up message lengths to 8byte boundary */
63#define SCSI_NL_MSGALIGN(len) (((len) + 7) & ~7)
64
65
66/*
67 * SCSI HOST Vendor Unique messages :
68 * SCSI_NL_SHOST_VENDOR
69 *
70 * Note: The Vendor Unique message payload will begin directly after
71 * this structure, with the length of the payload per vmsg_datalen.
72 *
73 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
74 * formatting requirements specified below
75 */
76struct scsi_nl_host_vendor_msg {
77 struct scsi_nl_hdr snlh; /* must be 1st element ! */
78 __u64 vendor_id;
79 __u16 host_no;
80 __u16 vmsg_datalen;
81} __attribute__((aligned(sizeof(__u64))));
82
83
84/*
85 * Vendor ID:
86 * If transports post vendor-unique events, they must pass a well-known
87 * 32-bit vendor identifier. This identifier consists of 8 bits indicating
88 * the "type" of identifier contained, and 24 bits of id data.
89 *
90 * Identifiers for each type:
91 * PCI : ID data is the 16 bit PCI Registered Vendor ID
92 */
93#define SCSI_NL_VID_TYPE_SHIFT 56
94#define SCSI_NL_VID_TYPE_MASK ((__u64)0xFF << SCSI_NL_VID_TYPE_SHIFT)
95#define SCSI_NL_VID_TYPE_PCI ((__u64)0x01 << SCSI_NL_VID_TYPE_SHIFT)
96#define SCSI_NL_VID_ID_MASK (~ SCSI_NL_VID_TYPE_MASK)
97
98
99#define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen) \
100 { \
101 (hdr)->version = SCSI_NL_VERSION; \
102 (hdr)->transport = t; \
103 (hdr)->magic = SCSI_NL_MAGIC; \
104 (hdr)->msgtype = mtype; \
105 (hdr)->msglen = mlen; \
106 }
107
108#endif /* SCSI_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_netlink_fc.h created+57
...@@ -0,0 +1,57 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * FC Transport Netlink Interface
4 *
5 * Copyright (C) 2006 James Smart, Emulex Corporation
6 */
7#ifndef SCSI_NETLINK_FC_H
8#define SCSI_NETLINK_FC_H
9
10#include <linux/types.h>
11#include <scsi/scsi_netlink.h>
12
13/*
14 * This file intended to be included by both kernel and user space
15 */
16
17/*
18 * FC Transport Message Types
19 */
20 /* kernel -> user */
21#define FC_NL_ASYNC_EVENT 0x0100
22 /* user -> kernel */
23/* none */
24
25
26/*
27 * Message Structures :
28 */
29
30/* macro to round up message lengths to 8byte boundary */
31#define FC_NL_MSGALIGN(len) (((len) + 7) & ~7)
32
33
34/*
35 * FC Transport Broadcast Event Message :
36 * FC_NL_ASYNC_EVENT
37 *
38 * Note: if Vendor Unique message, &event_data will be start of
39 * vendor unique payload, and the length of the payload is
40 * per event_datalen
41 *
42 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
43 * formatting requirements specified in scsi_netlink.h
44 */
45struct fc_nl_event {
46 struct scsi_nl_hdr snlh; /* must be 1st element ! */
47 __u64 seconds;
48 __u64 vendor_id;
49 __u16 host_no;
50 __u16 event_datalen;
51 __u32 event_num;
52 __u32 event_code;
53 __u32 event_data;
54} __attribute__((aligned(sizeof(__u64))));
55
56
57#endif /* SCSI_NETLINK_FC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asequencer.h created+612
...@@ -0,0 +1,612 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Main header file for the ALSA sequencer
4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
5 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_ASEQUENCER_H
24#define __SOUND_ASEQUENCER_H
25
26#include <sound/asound.h>
27
28/** version of the sequencer */
29#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
30
31/**
32 * definition of sequencer event types
33 */
34
35/** system messages
36 * event data type = #snd_seq_result
37 */
38#define SNDRV_SEQ_EVENT_SYSTEM 0
39#define SNDRV_SEQ_EVENT_RESULT 1
40
41/** note messages (channel specific)
42 * event data type = #snd_seq_ev_note
43 */
44#define SNDRV_SEQ_EVENT_NOTE 5
45#define SNDRV_SEQ_EVENT_NOTEON 6
46#define SNDRV_SEQ_EVENT_NOTEOFF 7
47#define SNDRV_SEQ_EVENT_KEYPRESS 8
48
49/** control messages (channel specific)
50 * event data type = #snd_seq_ev_ctrl
51 */
52#define SNDRV_SEQ_EVENT_CONTROLLER 10
53#define SNDRV_SEQ_EVENT_PGMCHANGE 11
54#define SNDRV_SEQ_EVENT_CHANPRESS 12
55#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
56#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
57#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
58#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
59
60/** synchronisation messages
61 * event data type = #snd_seq_ev_ctrl
62 */
63#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
64#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
65#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
66#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
67#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
68
69/** timer messages
70 * event data type = snd_seq_ev_queue_control
71 */
72#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
73#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
74#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
75#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
76#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
77#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
78#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
79#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
80#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
81
82/** others
83 * event data type = none
84 */
85#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
86#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
87#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
88
89/** echo back, kernel private messages
90 * event data type = any type
91 */
92#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
93#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
94
95/** system status messages (broadcast for subscribers)
96 * event data type = snd_seq_addr
97 */
98#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
99#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
100#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
101#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
102#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
103#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
104
105/** port connection changes
106 * event data type = snd_seq_connect
107 */
108#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
109#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
110
111/* 70-89: synthesizer events - obsoleted */
112
113/** user-defined events with fixed length
114 * event data type = any
115 */
116#define SNDRV_SEQ_EVENT_USR0 90
117#define SNDRV_SEQ_EVENT_USR1 91
118#define SNDRV_SEQ_EVENT_USR2 92
119#define SNDRV_SEQ_EVENT_USR3 93
120#define SNDRV_SEQ_EVENT_USR4 94
121#define SNDRV_SEQ_EVENT_USR5 95
122#define SNDRV_SEQ_EVENT_USR6 96
123#define SNDRV_SEQ_EVENT_USR7 97
124#define SNDRV_SEQ_EVENT_USR8 98
125#define SNDRV_SEQ_EVENT_USR9 99
126
127/* 100-118: instrument layer - obsoleted */
128/* 119-129: reserved */
129
130/* 130-139: variable length events
131 * event data type = snd_seq_ev_ext
132 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
133 */
134#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
135#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
136/* 132-134: reserved */
137#define SNDRV_SEQ_EVENT_USR_VAR0 135
138#define SNDRV_SEQ_EVENT_USR_VAR1 136
139#define SNDRV_SEQ_EVENT_USR_VAR2 137
140#define SNDRV_SEQ_EVENT_USR_VAR3 138
141#define SNDRV_SEQ_EVENT_USR_VAR4 139
142
143/* 150-151: kernel events with quote - DO NOT use in user clients */
144#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
145#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
146
147/* 152-191: reserved */
148
149/* 192-254: hardware specific events */
150
151/* 255: special event */
152#define SNDRV_SEQ_EVENT_NONE 255
153
154
155typedef unsigned char snd_seq_event_type_t;
156
157/** event address */
158struct snd_seq_addr {
159 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
160 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
161};
162
163/** port connection */
164struct snd_seq_connect {
165 struct snd_seq_addr sender;
166 struct snd_seq_addr dest;
167};
168
169
170#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
171#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
172#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
173#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
174
175 /* event mode flag - NOTE: only 8 bits available! */
176#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
177#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
178#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
179
180#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
181#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
182#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
183
184#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
185#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
186#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
187#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
188
189#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
190#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
191#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
192
193
194 /* note event */
195struct snd_seq_ev_note {
196 unsigned char channel;
197 unsigned char note;
198 unsigned char velocity;
199 unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
200 unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
201};
202
203 /* controller event */
204struct snd_seq_ev_ctrl {
205 unsigned char channel;
206 unsigned char unused1, unused2, unused3; /* pad */
207 unsigned int param;
208 signed int value;
209};
210
211 /* generic set of bytes (12x8 bit) */
212struct snd_seq_ev_raw8 {
213 unsigned char d[12]; /* 8 bit value */
214};
215
216 /* generic set of integers (3x32 bit) */
217struct snd_seq_ev_raw32 {
218 unsigned int d[3]; /* 32 bit value */
219};
220
221 /* external stored data */
222struct snd_seq_ev_ext {
223 unsigned int len; /* length of data */
224 void *ptr; /* pointer to data (note: maybe 64-bit) */
225} __attribute__((packed));
226
227struct snd_seq_result {
228 int event; /* processed event type */
229 int result;
230};
231
232
233struct snd_seq_real_time {
234 unsigned int tv_sec; /* seconds */
235 unsigned int tv_nsec; /* nanoseconds */
236};
237
238typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
239
240union snd_seq_timestamp {
241 snd_seq_tick_time_t tick;
242 struct snd_seq_real_time time;
243};
244
245struct snd_seq_queue_skew {
246 unsigned int value;
247 unsigned int base;
248};
249
250 /* queue timer control */
251struct snd_seq_ev_queue_control {
252 unsigned char queue; /* affected queue */
253 unsigned char pad[3]; /* reserved */
254 union {
255 signed int value; /* affected value (e.g. tempo) */
256 union snd_seq_timestamp time; /* time */
257 unsigned int position; /* sync position */
258 struct snd_seq_queue_skew skew;
259 unsigned int d32[2];
260 unsigned char d8[8];
261 } param;
262};
263
264 /* quoted event - inside the kernel only */
265struct snd_seq_ev_quote {
266 struct snd_seq_addr origin; /* original sender */
267 unsigned short value; /* optional data */
268 struct snd_seq_event *event; /* quoted event */
269} __attribute__((packed));
270
271
272 /* sequencer event */
273struct snd_seq_event {
274 snd_seq_event_type_t type; /* event type */
275 unsigned char flags; /* event flags */
276 char tag;
277
278 unsigned char queue; /* schedule queue */
279 union snd_seq_timestamp time; /* schedule time */
280
281
282 struct snd_seq_addr source; /* source address */
283 struct snd_seq_addr dest; /* destination address */
284
285 union { /* event data... */
286 struct snd_seq_ev_note note;
287 struct snd_seq_ev_ctrl control;
288 struct snd_seq_ev_raw8 raw8;
289 struct snd_seq_ev_raw32 raw32;
290 struct snd_seq_ev_ext ext;
291 struct snd_seq_ev_queue_control queue;
292 union snd_seq_timestamp time;
293 struct snd_seq_addr addr;
294 struct snd_seq_connect connect;
295 struct snd_seq_result result;
296 struct snd_seq_ev_quote quote;
297 } data;
298};
299
300
301/*
302 * bounce event - stored as variable size data
303 */
304struct snd_seq_event_bounce {
305 int err;
306 struct snd_seq_event event;
307 /* external data follows here. */
308};
309
310
311 /* system information */
312struct snd_seq_system_info {
313 int queues; /* maximum queues count */
314 int clients; /* maximum clients count */
315 int ports; /* maximum ports per client */
316 int channels; /* maximum channels per port */
317 int cur_clients; /* current clients */
318 int cur_queues; /* current queues */
319 char reserved[24];
320};
321
322
323 /* system running information */
324struct snd_seq_running_info {
325 unsigned char client; /* client id */
326 unsigned char big_endian; /* 1 = big-endian */
327 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
328 unsigned char pad; /* reserved */
329 unsigned char reserved[12];
330};
331
332
333 /* known client numbers */
334#define SNDRV_SEQ_CLIENT_SYSTEM 0
335 /* internal client numbers */
336#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
337#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
338
339
340 /* client types */
341typedef int __bitwise snd_seq_client_type_t;
342#define NO_CLIENT ((snd_seq_client_type_t) 0)
343#define USER_CLIENT ((snd_seq_client_type_t) 1)
344#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
345
346 /* event filter flags */
347#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
348#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
349#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
350#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
351
352struct snd_seq_client_info {
353 int client; /* client number to inquire */
354 snd_seq_client_type_t type; /* client type */
355 char name[64]; /* client name */
356 unsigned int filter; /* filter flags */
357 unsigned char multicast_filter[8]; /* multicast filter bitmap */
358 unsigned char event_filter[32]; /* event filter bitmap */
359 int num_ports; /* RO: number of ports */
360 int event_lost; /* number of lost events */
361 int card; /* RO: card number[kernel] */
362 int pid; /* RO: pid[user] */
363 char reserved[56]; /* for future use */
364};
365
366
367/* client pool size */
368struct snd_seq_client_pool {
369 int client; /* client number to inquire */
370 int output_pool; /* outgoing (write) pool size */
371 int input_pool; /* incoming (read) pool size */
372 int output_room; /* minimum free pool size for select/blocking mode */
373 int output_free; /* unused size */
374 int input_free; /* unused size */
375 char reserved[64];
376};
377
378
379/* Remove events by specified criteria */
380
381#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
382#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
383#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
384#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
385#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
386#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
387#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
388#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
389#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
390#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
391
392struct snd_seq_remove_events {
393 unsigned int remove_mode; /* Flags that determine what gets removed */
394
395 union snd_seq_timestamp time;
396
397 unsigned char queue; /* Queue for REMOVE_DEST */
398 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
399 unsigned char channel; /* Channel for REMOVE_DEST */
400
401 int type; /* For REMOVE_EVENT_TYPE */
402 char tag; /* Tag for REMOVE_TAG */
403
404 int reserved[10]; /* To allow for future binary compatibility */
405
406};
407
408
409 /* known port numbers */
410#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
411#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
412
413 /* port capabilities (32 bits) */
414#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
415#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
416
417#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
418#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
419
420#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
421
422#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
423#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
424#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
425
426 /* port type */
427#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
428#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
429#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
430#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
431#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
432#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
433#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
434
435/* other standards...*/
436#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
437#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
438#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
439/*...*/
440#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
441#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
442#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
443#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
444#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
445
446/* misc. conditioning flags */
447#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
448#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
449#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
450
451struct snd_seq_port_info {
452 struct snd_seq_addr addr; /* client/port numbers */
453 char name[64]; /* port name */
454
455 unsigned int capability; /* port capability bits */
456 unsigned int type; /* port type bits */
457 int midi_channels; /* channels per MIDI port */
458 int midi_voices; /* voices per MIDI port */
459 int synth_voices; /* voices per SYNTH port */
460
461 int read_use; /* R/O: subscribers for output (from this port) */
462 int write_use; /* R/O: subscribers for input (to this port) */
463
464 void *kernel; /* reserved for kernel use (must be NULL) */
465 unsigned int flags; /* misc. conditioning */
466 unsigned char time_queue; /* queue # for timestamping */
467 char reserved[59]; /* for future use */
468};
469
470
471/* queue flags */
472#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
473
474/* queue information */
475struct snd_seq_queue_info {
476 int queue; /* queue id */
477
478 /*
479 * security settings, only owner of this queue can start/stop timer
480 * etc. if the queue is locked for other clients
481 */
482 int owner; /* client id for owner of the queue */
483 unsigned locked:1; /* timing queue locked for other queues */
484 char name[64]; /* name of this queue */
485 unsigned int flags; /* flags */
486 char reserved[60]; /* for future use */
487
488};
489
490/* queue info/status */
491struct snd_seq_queue_status {
492 int queue; /* queue id */
493 int events; /* read-only - queue size */
494 snd_seq_tick_time_t tick; /* current tick */
495 struct snd_seq_real_time time; /* current time */
496 int running; /* running state of queue */
497 int flags; /* various flags */
498 char reserved[64]; /* for the future */
499};
500
501
502/* queue tempo */
503struct snd_seq_queue_tempo {
504 int queue; /* sequencer queue */
505 unsigned int tempo; /* current tempo, us/tick */
506 int ppq; /* time resolution, ticks/quarter */
507 unsigned int skew_value; /* queue skew */
508 unsigned int skew_base; /* queue skew base */
509 char reserved[24]; /* for the future */
510};
511
512
513/* sequencer timer sources */
514#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
515#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
516#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
517
518/* queue timer info */
519struct snd_seq_queue_timer {
520 int queue; /* sequencer queue */
521 int type; /* source timer type */
522 union {
523 struct {
524 struct snd_timer_id id; /* ALSA's timer ID */
525 unsigned int resolution; /* resolution in Hz */
526 } alsa;
527 } u;
528 char reserved[64]; /* for the future use */
529};
530
531
532struct snd_seq_queue_client {
533 int queue; /* sequencer queue */
534 int client; /* sequencer client */
535 int used; /* queue is used with this client
536 (must be set for accepting events) */
537 /* per client watermarks */
538 char reserved[64]; /* for future use */
539};
540
541
542#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
543#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
544#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
545
546struct snd_seq_port_subscribe {
547 struct snd_seq_addr sender; /* sender address */
548 struct snd_seq_addr dest; /* destination address */
549 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
550 unsigned int flags; /* modes */
551 unsigned char queue; /* input time-stamp queue (optional) */
552 unsigned char pad[3]; /* reserved */
553 char reserved[64];
554};
555
556/* type of query subscription */
557#define SNDRV_SEQ_QUERY_SUBS_READ 0
558#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
559
560struct snd_seq_query_subs {
561 struct snd_seq_addr root; /* client/port id to be searched */
562 int type; /* READ or WRITE */
563 int index; /* 0..N-1 */
564 int num_subs; /* R/O: number of subscriptions on this port */
565 struct snd_seq_addr addr; /* R/O: result */
566 unsigned char queue; /* R/O: result */
567 unsigned int flags; /* R/O: result */
568 char reserved[64]; /* for future use */
569};
570
571
572/*
573 * IOCTL commands
574 */
575
576#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
577#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
578#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
579#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
580
581#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
582#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
583
584#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
585#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
586#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
587#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
588
589#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
590#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
591
592#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
593#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
594#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
595#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
596#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
597#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
598#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
599#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
600#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
601#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
602#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
603#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
604#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
605#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
606#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
607#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
608#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
609#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
610#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
611
612#endif /* __SOUND_ASEQUENCER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asoc.h created+639
...@@ -0,0 +1,639 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
4 *
5 * Copyright (C) 2012 Texas Instruments Inc.
6 * Copyright (C) 2015 Intel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
13 * algorithms, equalisers, DAIs, widgets etc.
14*/
15
16#ifndef __LINUX_UAPI_SND_ASOC_H
17#define __LINUX_UAPI_SND_ASOC_H
18
19#include <linux/types.h>
20#include <sound/asound.h>
21
22/*
23 * Maximum number of channels topology kcontrol can represent.
24 */
25#define SND_SOC_TPLG_MAX_CHAN 8
26
27/*
28 * Maximum number of PCM formats capability
29 */
30#define SND_SOC_TPLG_MAX_FORMATS 16
31
32/*
33 * Maximum number of PCM stream configs
34 */
35#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
36
37/*
38 * Maximum number of physical link's hardware configs
39 */
40#define SND_SOC_TPLG_HW_CONFIG_MAX 8
41
42/* individual kcontrol info types - can be mixed with other types */
43#define SND_SOC_TPLG_CTL_VOLSW 1
44#define SND_SOC_TPLG_CTL_VOLSW_SX 2
45#define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3
46#define SND_SOC_TPLG_CTL_ENUM 4
47#define SND_SOC_TPLG_CTL_BYTES 5
48#define SND_SOC_TPLG_CTL_ENUM_VALUE 6
49#define SND_SOC_TPLG_CTL_RANGE 7
50#define SND_SOC_TPLG_CTL_STROBE 8
51
52
53/* individual widget kcontrol info types - can be mixed with other types */
54#define SND_SOC_TPLG_DAPM_CTL_VOLSW 64
55#define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65
56#define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66
57#define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67
58#define SND_SOC_TPLG_DAPM_CTL_PIN 68
59
60/* DAPM widget types - add new items to the end */
61#define SND_SOC_TPLG_DAPM_INPUT 0
62#define SND_SOC_TPLG_DAPM_OUTPUT 1
63#define SND_SOC_TPLG_DAPM_MUX 2
64#define SND_SOC_TPLG_DAPM_MIXER 3
65#define SND_SOC_TPLG_DAPM_PGA 4
66#define SND_SOC_TPLG_DAPM_OUT_DRV 5
67#define SND_SOC_TPLG_DAPM_ADC 6
68#define SND_SOC_TPLG_DAPM_DAC 7
69#define SND_SOC_TPLG_DAPM_SWITCH 8
70#define SND_SOC_TPLG_DAPM_PRE 9
71#define SND_SOC_TPLG_DAPM_POST 10
72#define SND_SOC_TPLG_DAPM_AIF_IN 11
73#define SND_SOC_TPLG_DAPM_AIF_OUT 12
74#define SND_SOC_TPLG_DAPM_DAI_IN 13
75#define SND_SOC_TPLG_DAPM_DAI_OUT 14
76#define SND_SOC_TPLG_DAPM_DAI_LINK 15
77#define SND_SOC_TPLG_DAPM_BUFFER 16
78#define SND_SOC_TPLG_DAPM_SCHEDULER 17
79#define SND_SOC_TPLG_DAPM_EFFECT 18
80#define SND_SOC_TPLG_DAPM_SIGGEN 19
81#define SND_SOC_TPLG_DAPM_SRC 20
82#define SND_SOC_TPLG_DAPM_ASRC 21
83#define SND_SOC_TPLG_DAPM_ENCODER 22
84#define SND_SOC_TPLG_DAPM_DECODER 23
85#define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER
86
87/* Header magic number and string sizes */
88#define SND_SOC_TPLG_MAGIC 0x41536F43 /* ASoC */
89
90/* string sizes */
91#define SND_SOC_TPLG_NUM_TEXTS 16
92
93/* ABI version */
94#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
95#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */
96
97/* Max size of TLV data */
98#define SND_SOC_TPLG_TLV_SIZE 32
99
100/*
101 * File and Block header data types.
102 * Add new generic and vendor types to end of list.
103 * Generic types are handled by the core whilst vendors types are passed
104 * to the component drivers for handling.
105 */
106#define SND_SOC_TPLG_TYPE_MIXER 1
107#define SND_SOC_TPLG_TYPE_BYTES 2
108#define SND_SOC_TPLG_TYPE_ENUM 3
109#define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
110#define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
111#define SND_SOC_TPLG_TYPE_DAI_LINK 6
112#define SND_SOC_TPLG_TYPE_PCM 7
113#define SND_SOC_TPLG_TYPE_MANIFEST 8
114#define SND_SOC_TPLG_TYPE_CODEC_LINK 9
115#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
116#define SND_SOC_TPLG_TYPE_PDATA 11
117#define SND_SOC_TPLG_TYPE_DAI 12
118#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
119
120/* vendor block IDs - please add new vendor types to end */
121#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
122#define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
123#define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
124#define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
125
126#define SND_SOC_TPLG_STREAM_PLAYBACK 0
127#define SND_SOC_TPLG_STREAM_CAPTURE 1
128
129/* vendor tuple types */
130#define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
131#define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
132#define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
133#define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
134#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
135#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
136
137/* DAI flags */
138#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
139#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
140#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
141
142/* DAI clock gating */
143#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
144#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
145#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2
146
147/* DAI mclk_direction */
148#define SND_SOC_TPLG_MCLK_CO 0 /* for codec, mclk is output */
149#define SND_SOC_TPLG_MCLK_CI 1 /* for codec, mclk is input */
150
151/* DAI physical PCM data formats.
152 * Add new formats to the end of the list.
153 */
154#define SND_SOC_DAI_FORMAT_I2S 1 /* I2S mode */
155#define SND_SOC_DAI_FORMAT_RIGHT_J 2 /* Right Justified mode */
156#define SND_SOC_DAI_FORMAT_LEFT_J 3 /* Left Justified mode */
157#define SND_SOC_DAI_FORMAT_DSP_A 4 /* L data MSB after FRM LRC */
158#define SND_SOC_DAI_FORMAT_DSP_B 5 /* L data MSB during FRM LRC */
159#define SND_SOC_DAI_FORMAT_AC97 6 /* AC97 */
160#define SND_SOC_DAI_FORMAT_PDM 7 /* Pulse density modulation */
161
162/* left and right justified also known as MSB and LSB respectively */
163#define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
164#define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
165
166/* DAI link flags */
167#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
168#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
169#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
170#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
171
172/* DAI topology BCLK parameter
173 * For the backwards capability, by default codec is bclk provider
174 */
175#define SND_SOC_TPLG_BCLK_CP 0 /* codec is bclk provider */
176#define SND_SOC_TPLG_BCLK_CC 1 /* codec is bclk consumer */
177/* keep previous definitions for compatibility */
178#define SND_SOC_TPLG_BCLK_CM SND_SOC_TPLG_BCLK_CP
179#define SND_SOC_TPLG_BCLK_CS SND_SOC_TPLG_BCLK_CC
180
181/* DAI topology FSYNC parameter
182 * For the backwards capability, by default codec is fsync provider
183 */
184#define SND_SOC_TPLG_FSYNC_CP 0 /* codec is fsync provider */
185#define SND_SOC_TPLG_FSYNC_CC 1 /* codec is fsync consumer */
186/* keep previous definitions for compatibility */
187#define SND_SOC_TPLG_FSYNC_CM SND_SOC_TPLG_FSYNC_CP
188#define SND_SOC_TPLG_FSYNC_CS SND_SOC_TPLG_FSYNC_CC
189
190/*
191 * Block Header.
192 * This header precedes all object and object arrays below.
193 */
194struct snd_soc_tplg_hdr {
195 __le32 magic; /* magic number */
196 __le32 abi; /* ABI version */
197 __le32 version; /* optional vendor specific version details */
198 __le32 type; /* SND_SOC_TPLG_TYPE_ */
199 __le32 size; /* size of this structure */
200 __le32 vendor_type; /* optional vendor specific type info */
201 __le32 payload_size; /* data bytes, excluding this header */
202 __le32 index; /* identifier for block */
203 __le32 count; /* number of elements in block */
204} __attribute__((packed));
205
206/* vendor tuple for uuid */
207struct snd_soc_tplg_vendor_uuid_elem {
208 __le32 token;
209 char uuid[16];
210} __attribute__((packed));
211
212/* vendor tuple for a bool/byte/short/word value */
213struct snd_soc_tplg_vendor_value_elem {
214 __le32 token;
215 __le32 value;
216} __attribute__((packed));
217
218/* vendor tuple for string */
219struct snd_soc_tplg_vendor_string_elem {
220 __le32 token;
221 char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
222} __attribute__((packed));
223
224struct snd_soc_tplg_vendor_array {
225 __le32 size; /* size in bytes of the array, including all elements */
226 __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */
227 __le32 num_elems; /* number of elements in array */
228 union {
229 struct snd_soc_tplg_vendor_uuid_elem uuid[0];
230 struct snd_soc_tplg_vendor_value_elem value[0];
231 struct snd_soc_tplg_vendor_string_elem string[0];
232 };
233} __attribute__((packed));
234
235/*
236 * Private data.
237 * All topology objects may have private data that can be used by the driver or
238 * firmware. Core will ignore this data.
239 */
240struct snd_soc_tplg_private {
241 __le32 size; /* in bytes of private data */
242 union {
243 __DECLARE_FLEX_ARRAY(char, data);
244 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_array, array);
245 };
246} __attribute__((packed));
247
248/*
249 * Kcontrol TLV data.
250 */
251struct snd_soc_tplg_tlv_dbscale {
252 __le32 min;
253 __le32 step;
254 __le32 mute;
255} __attribute__((packed));
256
257struct snd_soc_tplg_ctl_tlv {
258 __le32 size; /* in bytes of this structure */
259 __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */
260 union {
261 __le32 data[SND_SOC_TPLG_TLV_SIZE];
262 struct snd_soc_tplg_tlv_dbscale scale;
263 };
264} __attribute__((packed));
265
266/*
267 * Kcontrol channel data
268 */
269struct snd_soc_tplg_channel {
270 __le32 size; /* in bytes of this structure */
271 __le32 reg;
272 __le32 shift;
273 __le32 id; /* ID maps to Left, Right, LFE etc */
274} __attribute__((packed));
275
276/*
277 * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
278 * Kcontrol ops need get/put/info.
279 * Bytes ext ops need get/put.
280 */
281struct snd_soc_tplg_io_ops {
282 __le32 get;
283 __le32 put;
284 __le32 info;
285} __attribute__((packed));
286
287/*
288 * kcontrol header
289 */
290struct snd_soc_tplg_ctl_hdr {
291 __le32 size; /* in bytes of this structure */
292 __le32 type;
293 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
294 __le32 access;
295 struct snd_soc_tplg_io_ops ops;
296 struct snd_soc_tplg_ctl_tlv tlv;
297} __attribute__((packed));
298
299/*
300 * Stream Capabilities
301 */
302struct snd_soc_tplg_stream_caps {
303 __le32 size; /* in bytes of this structure */
304 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
305 __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
306 __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
307 __le32 rate_min; /* min rate */
308 __le32 rate_max; /* max rate */
309 __le32 channels_min; /* min channels */
310 __le32 channels_max; /* max channels */
311 __le32 periods_min; /* min number of periods */
312 __le32 periods_max; /* max number of periods */
313 __le32 period_size_min; /* min period size bytes */
314 __le32 period_size_max; /* max period size bytes */
315 __le32 buffer_size_min; /* min buffer size bytes */
316 __le32 buffer_size_max; /* max buffer size bytes */
317 __le32 sig_bits; /* number of bits of content */
318} __attribute__((packed));
319
320/*
321 * FE or BE Stream configuration supported by SW/FW
322 */
323struct snd_soc_tplg_stream {
324 __le32 size; /* in bytes of this structure */
325 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
326 __le64 format; /* SNDRV_PCM_FMTBIT_* */
327 __le32 rate; /* SNDRV_PCM_RATE_* */
328 __le32 period_bytes; /* size of period in bytes */
329 __le32 buffer_bytes; /* size of buffer in bytes */
330 __le32 channels; /* channels */
331} __attribute__((packed));
332
333
334/*
335 * Describes a physical link's runtime supported hardware config,
336 * i.e. hardware audio formats.
337 */
338struct snd_soc_tplg_hw_config {
339 __le32 size; /* in bytes of this structure */
340 __le32 id; /* unique ID - - used to match */
341 __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
342 __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
343 __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
344 __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
345 __u8 bclk_provider; /* SND_SOC_TPLG_BCLK_ value */
346 __u8 fsync_provider; /* SND_SOC_TPLG_FSYNC_ value */
347 __u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
348 __le16 reserved; /* for 32bit alignment */
349 __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
350 __le32 bclk_rate; /* BCLK freqency in Hz */
351 __le32 fsync_rate; /* frame clock in Hz */
352 __le32 tdm_slots; /* number of TDM slots in use */
353 __le32 tdm_slot_width; /* width in bits for each slot */
354 __le32 tx_slots; /* bit mask for active Tx slots */
355 __le32 rx_slots; /* bit mask for active Rx slots */
356 __le32 tx_channels; /* number of Tx channels */
357 __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
358 __le32 rx_channels; /* number of Rx channels */
359 __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
360} __attribute__((packed));
361
362/*
363 * Manifest. List totals for each payload type. Not used in parsing, but will
364 * be passed to the component driver before any other objects in order for any
365 * global component resource allocations.
366 *
367 * File block representation for manifest :-
368 * +-----------------------------------+----+
369 * | struct snd_soc_tplg_hdr | 1 |
370 * +-----------------------------------+----+
371 * | struct snd_soc_tplg_manifest | 1 |
372 * +-----------------------------------+----+
373 */
374struct snd_soc_tplg_manifest {
375 __le32 size; /* in bytes of this structure */
376 __le32 control_elems; /* number of control elements */
377 __le32 widget_elems; /* number of widget elements */
378 __le32 graph_elems; /* number of graph elements */
379 __le32 pcm_elems; /* number of PCM elements */
380 __le32 dai_link_elems; /* number of DAI link elements */
381 __le32 dai_elems; /* number of physical DAI elements */
382 __le32 reserved[20]; /* reserved for new ABI element types */
383 struct snd_soc_tplg_private priv;
384} __attribute__((packed));
385
386/*
387 * Mixer kcontrol.
388 *
389 * File block representation for mixer kcontrol :-
390 * +-----------------------------------+----+
391 * | struct snd_soc_tplg_hdr | 1 |
392 * +-----------------------------------+----+
393 * | struct snd_soc_tplg_mixer_control | N |
394 * +-----------------------------------+----+
395 */
396struct snd_soc_tplg_mixer_control {
397 struct snd_soc_tplg_ctl_hdr hdr;
398 __le32 size; /* in bytes of this structure */
399 __le32 min;
400 __le32 max;
401 __le32 platform_max;
402 __le32 invert;
403 __le32 num_channels;
404 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
405 struct snd_soc_tplg_private priv;
406} __attribute__((packed));
407
408/*
409 * Enumerated kcontrol
410 *
411 * File block representation for enum kcontrol :-
412 * +-----------------------------------+----+
413 * | struct snd_soc_tplg_hdr | 1 |
414 * +-----------------------------------+----+
415 * | struct snd_soc_tplg_enum_control | N |
416 * +-----------------------------------+----+
417 */
418struct snd_soc_tplg_enum_control {
419 struct snd_soc_tplg_ctl_hdr hdr;
420 __le32 size; /* in bytes of this structure */
421 __le32 num_channels;
422 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
423 __le32 items;
424 __le32 mask;
425 __le32 count;
426 char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
427 __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
428 struct snd_soc_tplg_private priv;
429} __attribute__((packed));
430
431/*
432 * Bytes kcontrol
433 *
434 * File block representation for bytes kcontrol :-
435 * +-----------------------------------+----+
436 * | struct snd_soc_tplg_hdr | 1 |
437 * +-----------------------------------+----+
438 * | struct snd_soc_tplg_bytes_control | N |
439 * +-----------------------------------+----+
440 */
441struct snd_soc_tplg_bytes_control {
442 struct snd_soc_tplg_ctl_hdr hdr;
443 __le32 size; /* in bytes of this structure */
444 __le32 max;
445 __le32 mask;
446 __le32 base;
447 __le32 num_regs;
448 struct snd_soc_tplg_io_ops ext_ops;
449 struct snd_soc_tplg_private priv;
450} __attribute__((packed));
451
452/*
453 * DAPM Graph Element
454 *
455 * File block representation for DAPM graph elements :-
456 * +-------------------------------------+----+
457 * | struct snd_soc_tplg_hdr | 1 |
458 * +-------------------------------------+----+
459 * | struct snd_soc_tplg_dapm_graph_elem | N |
460 * +-------------------------------------+----+
461 */
462struct snd_soc_tplg_dapm_graph_elem {
463 char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
464 char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
465 char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
466} __attribute__((packed));
467
468/*
469 * DAPM Widget.
470 *
471 * File block representation for DAPM widget :-
472 * +-------------------------------------+-----+
473 * | struct snd_soc_tplg_hdr | 1 |
474 * +-------------------------------------+-----+
475 * | struct snd_soc_tplg_dapm_widget | N |
476 * +-------------------------------------+-----+
477 * | struct snd_soc_tplg_enum_control | 0|1 |
478 * | struct snd_soc_tplg_mixer_control | 0|N |
479 * +-------------------------------------+-----+
480 *
481 * Optional enum or mixer control can be appended to the end of each widget
482 * in the block.
483 */
484struct snd_soc_tplg_dapm_widget {
485 __le32 size; /* in bytes of this structure */
486 __le32 id; /* SND_SOC_DAPM_CTL */
487 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
488 char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
489
490 __le32 reg; /* negative reg = no direct dapm */
491 __le32 shift; /* bits to shift */
492 __le32 mask; /* non-shifted mask */
493 __le32 subseq; /* sort within widget type */
494 __le32 invert; /* invert the power bit */
495 __le32 ignore_suspend; /* kept enabled over suspend */
496 __le16 event_flags;
497 __le16 event_type;
498 __le32 num_kcontrols;
499 struct snd_soc_tplg_private priv;
500 /*
501 * kcontrols that relate to this widget
502 * follow here after widget private data
503 */
504} __attribute__((packed));
505
506
507/*
508 * Describes SW/FW specific features of PCM (FE DAI & DAI link).
509 *
510 * File block representation for PCM :-
511 * +-----------------------------------+-----+
512 * | struct snd_soc_tplg_hdr | 1 |
513 * +-----------------------------------+-----+
514 * | struct snd_soc_tplg_pcm | N |
515 * +-----------------------------------+-----+
516 */
517struct snd_soc_tplg_pcm {
518 __le32 size; /* in bytes of this structure */
519 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
520 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
521 __le32 pcm_id; /* unique ID - used to match with DAI link */
522 __le32 dai_id; /* unique ID - used to match */
523 __le32 playback; /* supports playback mode */
524 __le32 capture; /* supports capture mode */
525 __le32 compress; /* 1 = compressed; 0 = PCM */
526 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
527 __le32 num_streams; /* number of streams */
528 struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
529 __le32 flag_mask; /* bitmask of flags to configure */
530 __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
531 struct snd_soc_tplg_private priv;
532} __attribute__((packed));
533
534
535/*
536 * Describes the physical link runtime supported configs or params
537 *
538 * File block representation for physical link config :-
539 * +-----------------------------------+-----+
540 * | struct snd_soc_tplg_hdr | 1 |
541 * +-----------------------------------+-----+
542 * | struct snd_soc_tplg_link_config | N |
543 * +-----------------------------------+-----+
544 */
545struct snd_soc_tplg_link_config {
546 __le32 size; /* in bytes of this structure */
547 __le32 id; /* unique ID - used to match */
548 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
549 char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */
550 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
551 __le32 num_streams; /* number of streams */
552 struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */
553 __le32 num_hw_configs; /* number of hw configs */
554 __le32 default_hw_config_id; /* default hw config ID for init */
555 __le32 flag_mask; /* bitmask of flags to configure */
556 __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
557 struct snd_soc_tplg_private priv;
558} __attribute__((packed));
559
560/*
561 * Describes SW/FW specific features of physical DAI.
562 * It can be used to configure backend DAIs for DPCM.
563 *
564 * File block representation for physical DAI :-
565 * +-----------------------------------+-----+
566 * | struct snd_soc_tplg_hdr | 1 |
567 * +-----------------------------------+-----+
568 * | struct snd_soc_tplg_dai | N |
569 * +-----------------------------------+-----+
570 */
571struct snd_soc_tplg_dai {
572 __le32 size; /* in bytes of this structure */
573 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
574 __le32 dai_id; /* unique ID - used to match */
575 __le32 playback; /* supports playback mode */
576 __le32 capture; /* supports capture mode */
577 struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
578 __le32 flag_mask; /* bitmask of flags to configure */
579 __le32 flags; /* SND_SOC_TPLG_DAI_FLGBIT_* */
580 struct snd_soc_tplg_private priv;
581} __attribute__((packed));
582
583/*
584 * Old version of ABI structs, supported for backward compatibility.
585 */
586
587/* Manifest v4 */
588struct snd_soc_tplg_manifest_v4 {
589 __le32 size; /* in bytes of this structure */
590 __le32 control_elems; /* number of control elements */
591 __le32 widget_elems; /* number of widget elements */
592 __le32 graph_elems; /* number of graph elements */
593 __le32 pcm_elems; /* number of PCM elements */
594 __le32 dai_link_elems; /* number of DAI link elements */
595 struct snd_soc_tplg_private priv;
596} __attribute__((packed));
597
598/* Stream Capabilities v4 */
599struct snd_soc_tplg_stream_caps_v4 {
600 __le32 size; /* in bytes of this structure */
601 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
602 __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
603 __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
604 __le32 rate_min; /* min rate */
605 __le32 rate_max; /* max rate */
606 __le32 channels_min; /* min channels */
607 __le32 channels_max; /* max channels */
608 __le32 periods_min; /* min number of periods */
609 __le32 periods_max; /* max number of periods */
610 __le32 period_size_min; /* min period size bytes */
611 __le32 period_size_max; /* max period size bytes */
612 __le32 buffer_size_min; /* min buffer size bytes */
613 __le32 buffer_size_max; /* max buffer size bytes */
614} __attribute__((packed));
615
616/* PCM v4 */
617struct snd_soc_tplg_pcm_v4 {
618 __le32 size; /* in bytes of this structure */
619 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
620 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
621 __le32 pcm_id; /* unique ID - used to match with DAI link */
622 __le32 dai_id; /* unique ID - used to match */
623 __le32 playback; /* supports playback mode */
624 __le32 capture; /* supports capture mode */
625 __le32 compress; /* 1 = compressed; 0 = PCM */
626 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
627 __le32 num_streams; /* number of streams */
628 struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
629} __attribute__((packed));
630
631/* Physical link config v4 */
632struct snd_soc_tplg_link_config_v4 {
633 __le32 size; /* in bytes of this structure */
634 __le32 id; /* unique ID - used to match */
635 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
636 __le32 num_streams; /* number of streams */
637} __attribute__((packed));
638
639#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asound.h created+1161
...@@ -0,0 +1,1161 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Advanced Linux Sound Architecture - ALSA - Driver
4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
5 * Abramo Bagnara <abramo@alsa-project.org>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_ASOUND_H
25#define __SOUND_ASOUND_H
26
27#if defined(__KERNEL__) || defined(__linux__)
28#include <linux/types.h>
29#include <asm/byteorder.h>
30#else
31#include <endian.h>
32#include <sys/ioctl.h>
33#endif
34
35#include <stdlib.h>
36#include <time.h>
37
38/*
39 * protocol version
40 */
41
42#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
43#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
44#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
45#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
46#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
47 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
48 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
49 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
50
51/****************************************************************************
52 * *
53 * Digital audio interface *
54 * *
55 ****************************************************************************/
56
57struct snd_aes_iec958 {
58 unsigned char status[24]; /* AES/IEC958 channel status bits */
59 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
60 unsigned char pad; /* nothing */
61 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
62};
63
64/****************************************************************************
65 * *
66 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
67 * *
68 ****************************************************************************/
69
70struct snd_cea_861_aud_if {
71 unsigned char db1_ct_cc; /* coding type and channel count */
72 unsigned char db2_sf_ss; /* sample frequency and size */
73 unsigned char db3; /* not used, all zeros */
74 unsigned char db4_ca; /* channel allocation code */
75 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
76};
77
78/****************************************************************************
79 * *
80 * Section for driver hardware dependent interface - /dev/snd/hw? *
81 * *
82 ****************************************************************************/
83
84#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
85
86enum {
87 SNDRV_HWDEP_IFACE_OPL2 = 0,
88 SNDRV_HWDEP_IFACE_OPL3,
89 SNDRV_HWDEP_IFACE_OPL4,
90 SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
91 SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
92 SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
93 SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
94 SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
95 SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
96 SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
97 SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
98 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
99 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
100 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
101 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
102 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
103 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
104 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
105 SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
106 SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */
107 SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */
108 SNDRV_HWDEP_IFACE_FW_OXFW, /* Oxford OXFW970/971 based device */
109 SNDRV_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */
110 SNDRV_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */
111 SNDRV_HWDEP_IFACE_LINE6, /* Line6 USB processors */
112 SNDRV_HWDEP_IFACE_FW_MOTU, /* MOTU FireWire series */
113 SNDRV_HWDEP_IFACE_FW_FIREFACE, /* RME Fireface series */
114
115 /* Don't forget to change the following: */
116 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_FIREFACE
117};
118
119struct snd_hwdep_info {
120 unsigned int device; /* WR: device number */
121 int card; /* R: card number */
122 unsigned char id[64]; /* ID (user selectable) */
123 unsigned char name[80]; /* hwdep name */
124 int iface; /* hwdep interface */
125 unsigned char reserved[64]; /* reserved for future */
126};
127
128/* generic DSP loader */
129struct snd_hwdep_dsp_status {
130 unsigned int version; /* R: driver-specific version */
131 unsigned char id[32]; /* R: driver-specific ID string */
132 unsigned int num_dsps; /* R: number of DSP images to transfer */
133 unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
134 unsigned int chip_ready; /* R: 1 = initialization finished */
135 unsigned char reserved[16]; /* reserved for future use */
136};
137
138struct snd_hwdep_dsp_image {
139 unsigned int index; /* W: DSP index */
140 unsigned char name[64]; /* W: ID (e.g. file name) */
141 unsigned char *image; /* W: binary image */
142 size_t length; /* W: size of image in bytes */
143 unsigned long driver_data; /* W: driver-specific data */
144};
145
146#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
147#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
148#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
149#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
150
151/*****************************************************************************
152 * *
153 * Digital Audio (PCM) interface - /dev/snd/pcm?? *
154 * *
155 *****************************************************************************/
156
157#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 15)
158
159typedef unsigned long snd_pcm_uframes_t;
160typedef signed long snd_pcm_sframes_t;
161
162enum {
163 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
164 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
165 SNDRV_PCM_CLASS_MODEM, /* software modem class */
166 SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
167 /* Don't forget to change the following: */
168 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
169};
170
171enum {
172 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
173 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
174 /* Don't forget to change the following: */
175 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
176};
177
178enum {
179 SNDRV_PCM_STREAM_PLAYBACK = 0,
180 SNDRV_PCM_STREAM_CAPTURE,
181 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
182};
183
184typedef int __bitwise snd_pcm_access_t;
185#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((snd_pcm_access_t) 0) /* interleaved mmap */
186#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((snd_pcm_access_t) 1) /* noninterleaved mmap */
187#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((snd_pcm_access_t) 2) /* complex mmap */
188#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((snd_pcm_access_t) 3) /* readi/writei */
189#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((snd_pcm_access_t) 4) /* readn/writen */
190#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
191
192typedef int __bitwise snd_pcm_format_t;
193#define SNDRV_PCM_FORMAT_S8 ((snd_pcm_format_t) 0)
194#define SNDRV_PCM_FORMAT_U8 ((snd_pcm_format_t) 1)
195#define SNDRV_PCM_FORMAT_S16_LE ((snd_pcm_format_t) 2)
196#define SNDRV_PCM_FORMAT_S16_BE ((snd_pcm_format_t) 3)
197#define SNDRV_PCM_FORMAT_U16_LE ((snd_pcm_format_t) 4)
198#define SNDRV_PCM_FORMAT_U16_BE ((snd_pcm_format_t) 5)
199#define SNDRV_PCM_FORMAT_S24_LE ((snd_pcm_format_t) 6) /* low three bytes */
200#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */
201#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */
202#define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9) /* low three bytes */
203#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
204#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
205#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
206#define SNDRV_PCM_FORMAT_U32_BE ((snd_pcm_format_t) 13)
207#define SNDRV_PCM_FORMAT_FLOAT_LE ((snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
208#define SNDRV_PCM_FORMAT_FLOAT_BE ((snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
209#define SNDRV_PCM_FORMAT_FLOAT64_LE ((snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
210#define SNDRV_PCM_FORMAT_FLOAT64_BE ((snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
211#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
212#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
213#define SNDRV_PCM_FORMAT_MU_LAW ((snd_pcm_format_t) 20)
214#define SNDRV_PCM_FORMAT_A_LAW ((snd_pcm_format_t) 21)
215#define SNDRV_PCM_FORMAT_IMA_ADPCM ((snd_pcm_format_t) 22)
216#define SNDRV_PCM_FORMAT_MPEG ((snd_pcm_format_t) 23)
217#define SNDRV_PCM_FORMAT_GSM ((snd_pcm_format_t) 24)
218#define SNDRV_PCM_FORMAT_S20_LE ((snd_pcm_format_t) 25) /* in four bytes, LSB justified */
219#define SNDRV_PCM_FORMAT_S20_BE ((snd_pcm_format_t) 26) /* in four bytes, LSB justified */
220#define SNDRV_PCM_FORMAT_U20_LE ((snd_pcm_format_t) 27) /* in four bytes, LSB justified */
221#define SNDRV_PCM_FORMAT_U20_BE ((snd_pcm_format_t) 28) /* in four bytes, LSB justified */
222/* gap in the numbering for a future standard linear format */
223#define SNDRV_PCM_FORMAT_SPECIAL ((snd_pcm_format_t) 31)
224#define SNDRV_PCM_FORMAT_S24_3LE ((snd_pcm_format_t) 32) /* in three bytes */
225#define SNDRV_PCM_FORMAT_S24_3BE ((snd_pcm_format_t) 33) /* in three bytes */
226#define SNDRV_PCM_FORMAT_U24_3LE ((snd_pcm_format_t) 34) /* in three bytes */
227#define SNDRV_PCM_FORMAT_U24_3BE ((snd_pcm_format_t) 35) /* in three bytes */
228#define SNDRV_PCM_FORMAT_S20_3LE ((snd_pcm_format_t) 36) /* in three bytes */
229#define SNDRV_PCM_FORMAT_S20_3BE ((snd_pcm_format_t) 37) /* in three bytes */
230#define SNDRV_PCM_FORMAT_U20_3LE ((snd_pcm_format_t) 38) /* in three bytes */
231#define SNDRV_PCM_FORMAT_U20_3BE ((snd_pcm_format_t) 39) /* in three bytes */
232#define SNDRV_PCM_FORMAT_S18_3LE ((snd_pcm_format_t) 40) /* in three bytes */
233#define SNDRV_PCM_FORMAT_S18_3BE ((snd_pcm_format_t) 41) /* in three bytes */
234#define SNDRV_PCM_FORMAT_U18_3LE ((snd_pcm_format_t) 42) /* in three bytes */
235#define SNDRV_PCM_FORMAT_U18_3BE ((snd_pcm_format_t) 43) /* in three bytes */
236#define SNDRV_PCM_FORMAT_G723_24 ((snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
237#define SNDRV_PCM_FORMAT_G723_24_1B ((snd_pcm_format_t) 45) /* 1 sample in 1 byte */
238#define SNDRV_PCM_FORMAT_G723_40 ((snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
239#define SNDRV_PCM_FORMAT_G723_40_1B ((snd_pcm_format_t) 47) /* 1 sample in 1 byte */
240#define SNDRV_PCM_FORMAT_DSD_U8 ((snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
241#define SNDRV_PCM_FORMAT_DSD_U16_LE ((snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
242#define SNDRV_PCM_FORMAT_DSD_U32_LE ((snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
243#define SNDRV_PCM_FORMAT_DSD_U16_BE ((snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
244#define SNDRV_PCM_FORMAT_DSD_U32_BE ((snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
245#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
246#define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8
247
248#ifdef SNDRV_LITTLE_ENDIAN
249#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
250#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
251#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
252#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
253#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
254#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
255#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
256#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
257#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
258#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_LE
259#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_LE
260#endif
261#ifdef SNDRV_BIG_ENDIAN
262#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
263#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
264#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
265#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
266#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
267#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
268#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
269#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
270#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
271#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_BE
272#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_BE
273#endif
274
275typedef int __bitwise snd_pcm_subformat_t;
276#define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
277#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
278
279#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
280#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
281#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
282#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
283#define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020 /* need the explicit sync of appl_ptr update */
284#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
285#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
286#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
287#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
288#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
289#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
290#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
291#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
292#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
293#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
294#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
295#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* (Deprecated)has audio wall clock for audio/system time sync */
296#define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000 /* report hardware link audio time, reset on startup */
297#define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000 /* report absolute hardware link audio time, not reset on startup */
298#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
299#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
300#define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
301
302#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
303#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
304
305#if (__BITS_PER_LONG == 32 && defined(__USE_TIME_BITS64)) || defined __KERNEL__
306#define __SND_STRUCT_TIME64
307#endif
308
309typedef int __bitwise snd_pcm_state_t;
310#define SNDRV_PCM_STATE_OPEN ((snd_pcm_state_t) 0) /* stream is open */
311#define SNDRV_PCM_STATE_SETUP ((snd_pcm_state_t) 1) /* stream has a setup */
312#define SNDRV_PCM_STATE_PREPARED ((snd_pcm_state_t) 2) /* stream is ready to start */
313#define SNDRV_PCM_STATE_RUNNING ((snd_pcm_state_t) 3) /* stream is running */
314#define SNDRV_PCM_STATE_XRUN ((snd_pcm_state_t) 4) /* stream reached an xrun */
315#define SNDRV_PCM_STATE_DRAINING ((snd_pcm_state_t) 5) /* stream is draining */
316#define SNDRV_PCM_STATE_PAUSED ((snd_pcm_state_t) 6) /* stream is paused */
317#define SNDRV_PCM_STATE_SUSPENDED ((snd_pcm_state_t) 7) /* hardware is suspended */
318#define SNDRV_PCM_STATE_DISCONNECTED ((snd_pcm_state_t) 8) /* hardware is disconnected */
319#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
320
321enum {
322 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
323 SNDRV_PCM_MMAP_OFFSET_STATUS_OLD = 0x80000000,
324 SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD = 0x81000000,
325 SNDRV_PCM_MMAP_OFFSET_STATUS_NEW = 0x82000000,
326 SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW = 0x83000000,
327#ifdef __SND_STRUCT_TIME64
328 SNDRV_PCM_MMAP_OFFSET_STATUS = SNDRV_PCM_MMAP_OFFSET_STATUS_NEW,
329 SNDRV_PCM_MMAP_OFFSET_CONTROL = SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW,
330#else
331 SNDRV_PCM_MMAP_OFFSET_STATUS = SNDRV_PCM_MMAP_OFFSET_STATUS_OLD,
332 SNDRV_PCM_MMAP_OFFSET_CONTROL = SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD,
333#endif
334};
335
336union snd_pcm_sync_id {
337 unsigned char id[16];
338 unsigned short id16[8];
339 unsigned int id32[4];
340};
341
342struct snd_pcm_info {
343 unsigned int device; /* RO/WR (control): device number */
344 unsigned int subdevice; /* RO/WR (control): subdevice number */
345 int stream; /* RO/WR (control): stream direction */
346 int card; /* R: card number */
347 unsigned char id[64]; /* ID (user selectable) */
348 unsigned char name[80]; /* name of this device */
349 unsigned char subname[32]; /* subdevice name */
350 int dev_class; /* SNDRV_PCM_CLASS_* */
351 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
352 unsigned int subdevices_count;
353 unsigned int subdevices_avail;
354 union snd_pcm_sync_id sync; /* hardware synchronization ID */
355 unsigned char reserved[64]; /* reserved for future... */
356};
357
358typedef int snd_pcm_hw_param_t;
359#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
360#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
361#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
362#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
363#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
364
365#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
366#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
367#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
368#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
369#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
370 * interrupts in us
371 */
372#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
373 * interrupts
374 */
375#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
376 * interrupts
377 */
378#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
379 * buffer
380 */
381#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
382 * in us
383 */
384#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
385#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
386#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
387#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
388#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
389
390#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
391#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
392#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
393
394struct snd_interval {
395 unsigned int min, max;
396 unsigned int openmin:1,
397 openmax:1,
398 integer:1,
399 empty:1;
400};
401
402#define SNDRV_MASK_MAX 256
403
404struct snd_mask {
405 __u32 bits[(SNDRV_MASK_MAX+31)/32];
406};
407
408struct snd_pcm_hw_params {
409 unsigned int flags;
410 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
411 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
412 struct snd_mask mres[5]; /* reserved masks */
413 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
414 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
415 struct snd_interval ires[9]; /* reserved intervals */
416 unsigned int rmask; /* W: requested masks */
417 unsigned int cmask; /* R: changed masks */
418 unsigned int info; /* R: Info flags for returned setup */
419 unsigned int msbits; /* R: used most significant bits */
420 unsigned int rate_num; /* R: rate numerator */
421 unsigned int rate_den; /* R: rate denominator */
422 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
423 unsigned char reserved[64]; /* reserved for future */
424};
425
426enum {
427 SNDRV_PCM_TSTAMP_NONE = 0,
428 SNDRV_PCM_TSTAMP_ENABLE,
429 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
430};
431
432struct snd_pcm_sw_params {
433 int tstamp_mode; /* timestamp mode */
434 unsigned int period_step;
435 unsigned int sleep_min; /* min ticks to sleep */
436 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
437 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
438 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
439 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
440 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
441 snd_pcm_uframes_t silence_size; /* silence block size */
442 snd_pcm_uframes_t boundary; /* pointers wrap point */
443 unsigned int proto; /* protocol version */
444 unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
445 unsigned char reserved[56]; /* reserved for future */
446};
447
448struct snd_pcm_channel_info {
449 unsigned int channel;
450 __kernel_off_t offset; /* mmap offset */
451 unsigned int first; /* offset to first sample in bits */
452 unsigned int step; /* samples distance in bits */
453};
454
455enum {
456 /*
457 * first definition for backwards compatibility only,
458 * maps to wallclock/link time for HDAudio playback and DEFAULT/DMA time for everything else
459 */
460 SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0,
461
462 /* timestamp definitions */
463 SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1, /* DMA time, reported as per hw_ptr */
464 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2, /* link time reported by sample or wallclock counter, reset on startup */
465 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3, /* link time reported by sample or wallclock counter, not reset on startup */
466 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4, /* link time estimated indirectly */
467 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5, /* link time synchronized with system time */
468 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
469};
470
471/* explicit padding avoids incompatibility between i386 and x86-64 */
472typedef struct { unsigned char pad[sizeof(time_t) - sizeof(int)]; } __time_pad;
473
474struct snd_pcm_status {
475 snd_pcm_state_t state; /* stream state */
476 __time_pad pad1; /* align to timespec */
477 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
478 struct timespec tstamp; /* reference timestamp */
479 snd_pcm_uframes_t appl_ptr; /* appl ptr */
480 snd_pcm_uframes_t hw_ptr; /* hw ptr */
481 snd_pcm_sframes_t delay; /* current delay in frames */
482 snd_pcm_uframes_t avail; /* number of frames available */
483 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
484 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
485 snd_pcm_state_t suspended_state; /* suspended stream state */
486 __u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */
487 struct timespec audio_tstamp; /* sample counter, wall clock, PHC or on-demand sync'ed */
488 struct timespec driver_tstamp; /* useful in case reference system tstamp is reported with delay */
489 __u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */
490 unsigned char reserved[52-2*sizeof(struct timespec)]; /* must be filled with zero */
491};
492
493/*
494 * For mmap operations, we need the 64-bit layout, both for compat mode,
495 * and for y2038 compatibility. For 64-bit applications, the two definitions
496 * are identical, so we keep the traditional version.
497 */
498#ifdef __SND_STRUCT_TIME64
499#define __snd_pcm_mmap_status64 snd_pcm_mmap_status
500#define __snd_pcm_mmap_control64 snd_pcm_mmap_control
501#define __snd_pcm_sync_ptr64 snd_pcm_sync_ptr
502#define __snd_timespec64 timespec
503struct __snd_timespec {
504 __s32 tv_sec;
505 __s32 tv_nsec;
506};
507#else
508#define __snd_pcm_mmap_status snd_pcm_mmap_status
509#define __snd_pcm_mmap_control snd_pcm_mmap_control
510#define __snd_pcm_sync_ptr snd_pcm_sync_ptr
511#define __snd_timespec timespec
512struct __snd_timespec64 {
513 __s64 tv_sec;
514 __s64 tv_nsec;
515};
516
517#endif
518
519struct __snd_pcm_mmap_status {
520 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
521 int pad1; /* Needed for 64 bit alignment */
522 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
523 struct __snd_timespec tstamp; /* Timestamp */
524 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
525 struct __snd_timespec audio_tstamp; /* from sample counter or wall clock */
526};
527
528struct __snd_pcm_mmap_control {
529 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
530 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
531};
532
533#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
534#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
535#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
536
537struct __snd_pcm_sync_ptr {
538 unsigned int flags;
539 union {
540 struct __snd_pcm_mmap_status status;
541 unsigned char reserved[64];
542 } s;
543 union {
544 struct __snd_pcm_mmap_control control;
545 unsigned char reserved[64];
546 } c;
547};
548
549#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
550typedef char __pad_before_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)];
551typedef char __pad_after_uframe[0];
552#endif
553
554#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
555typedef char __pad_before_uframe[0];
556typedef char __pad_after_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)];
557#endif
558
559struct __snd_pcm_mmap_status64 {
560 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
561 __u32 pad1; /* Needed for 64 bit alignment */
562 __pad_before_uframe __pad1;
563 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
564 __pad_after_uframe __pad2;
565 struct __snd_timespec64 tstamp; /* Timestamp */
566 snd_pcm_state_t suspended_state;/* RO: suspended stream state */
567 __u32 pad3; /* Needed for 64 bit alignment */
568 struct __snd_timespec64 audio_tstamp; /* sample counter or wall clock */
569};
570
571struct __snd_pcm_mmap_control64 {
572 __pad_before_uframe __pad1;
573 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
574 __pad_before_uframe __pad2;
575
576 __pad_before_uframe __pad3;
577 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
578 __pad_after_uframe __pad4;
579};
580
581struct __snd_pcm_sync_ptr64 {
582 __u32 flags;
583 __u32 pad1;
584 union {
585 struct __snd_pcm_mmap_status64 status;
586 unsigned char reserved[64];
587 } s;
588 union {
589 struct __snd_pcm_mmap_control64 control;
590 unsigned char reserved[64];
591 } c;
592};
593
594struct snd_xferi {
595 snd_pcm_sframes_t result;
596 void *buf;
597 snd_pcm_uframes_t frames;
598};
599
600struct snd_xfern {
601 snd_pcm_sframes_t result;
602 void * *bufs;
603 snd_pcm_uframes_t frames;
604};
605
606enum {
607 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
608 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
609 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
610 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
611};
612
613/* channel positions */
614enum {
615 SNDRV_CHMAP_UNKNOWN = 0,
616 SNDRV_CHMAP_NA, /* N/A, silent */
617 SNDRV_CHMAP_MONO, /* mono stream */
618 /* this follows the alsa-lib mixer channel value + 3 */
619 SNDRV_CHMAP_FL, /* front left */
620 SNDRV_CHMAP_FR, /* front right */
621 SNDRV_CHMAP_RL, /* rear left */
622 SNDRV_CHMAP_RR, /* rear right */
623 SNDRV_CHMAP_FC, /* front center */
624 SNDRV_CHMAP_LFE, /* LFE */
625 SNDRV_CHMAP_SL, /* side left */
626 SNDRV_CHMAP_SR, /* side right */
627 SNDRV_CHMAP_RC, /* rear center */
628 /* new definitions */
629 SNDRV_CHMAP_FLC, /* front left center */
630 SNDRV_CHMAP_FRC, /* front right center */
631 SNDRV_CHMAP_RLC, /* rear left center */
632 SNDRV_CHMAP_RRC, /* rear right center */
633 SNDRV_CHMAP_FLW, /* front left wide */
634 SNDRV_CHMAP_FRW, /* front right wide */
635 SNDRV_CHMAP_FLH, /* front left high */
636 SNDRV_CHMAP_FCH, /* front center high */
637 SNDRV_CHMAP_FRH, /* front right high */
638 SNDRV_CHMAP_TC, /* top center */
639 SNDRV_CHMAP_TFL, /* top front left */
640 SNDRV_CHMAP_TFR, /* top front right */
641 SNDRV_CHMAP_TFC, /* top front center */
642 SNDRV_CHMAP_TRL, /* top rear left */
643 SNDRV_CHMAP_TRR, /* top rear right */
644 SNDRV_CHMAP_TRC, /* top rear center */
645 /* new definitions for UAC2 */
646 SNDRV_CHMAP_TFLC, /* top front left center */
647 SNDRV_CHMAP_TFRC, /* top front right center */
648 SNDRV_CHMAP_TSL, /* top side left */
649 SNDRV_CHMAP_TSR, /* top side right */
650 SNDRV_CHMAP_LLFE, /* left LFE */
651 SNDRV_CHMAP_RLFE, /* right LFE */
652 SNDRV_CHMAP_BC, /* bottom center */
653 SNDRV_CHMAP_BLC, /* bottom left center */
654 SNDRV_CHMAP_BRC, /* bottom right center */
655 SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
656};
657
658#define SNDRV_CHMAP_POSITION_MASK 0xffff
659#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
660#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
661
662#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
663#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
664#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
665#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
666#define SNDRV_PCM_IOCTL_USER_PVERSION _IOW('A', 0x04, int)
667#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
668#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
669#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
670#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
671#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
672#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
673#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
674#define __SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct __snd_pcm_sync_ptr)
675#define __SNDRV_PCM_IOCTL_SYNC_PTR64 _IOWR('A', 0x23, struct __snd_pcm_sync_ptr64)
676#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
677#define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status)
678#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
679#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
680#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
681#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
682#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
683#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
684#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
685#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
686#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
687#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
688#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
689#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
690#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
691#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
692#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
693#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
694#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
695
696/*****************************************************************************
697 * *
698 * MIDI v1.0 interface *
699 * *
700 *****************************************************************************/
701
702/*
703 * Raw MIDI section - /dev/snd/midi??
704 */
705
706#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)
707
708enum {
709 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
710 SNDRV_RAWMIDI_STREAM_INPUT,
711 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
712};
713
714#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
715#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
716#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
717
718struct snd_rawmidi_info {
719 unsigned int device; /* RO/WR (control): device number */
720 unsigned int subdevice; /* RO/WR (control): subdevice number */
721 int stream; /* WR: stream */
722 int card; /* R: card number */
723 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
724 unsigned char id[64]; /* ID (user selectable) */
725 unsigned char name[80]; /* name of device */
726 unsigned char subname[32]; /* name of active or selected subdevice */
727 unsigned int subdevices_count;
728 unsigned int subdevices_avail;
729 unsigned char reserved[64]; /* reserved for future use */
730};
731
732#define SNDRV_RAWMIDI_MODE_FRAMING_MASK (7<<0)
733#define SNDRV_RAWMIDI_MODE_FRAMING_SHIFT 0
734#define SNDRV_RAWMIDI_MODE_FRAMING_NONE (0<<0)
735#define SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP (1<<0)
736#define SNDRV_RAWMIDI_MODE_CLOCK_MASK (7<<3)
737#define SNDRV_RAWMIDI_MODE_CLOCK_SHIFT 3
738#define SNDRV_RAWMIDI_MODE_CLOCK_NONE (0<<3)
739#define SNDRV_RAWMIDI_MODE_CLOCK_REALTIME (1<<3)
740#define SNDRV_RAWMIDI_MODE_CLOCK_MONOTONIC (2<<3)
741#define SNDRV_RAWMIDI_MODE_CLOCK_MONOTONIC_RAW (3<<3)
742
743#define SNDRV_RAWMIDI_FRAMING_DATA_LENGTH 16
744
745struct snd_rawmidi_framing_tstamp {
746 /* For now, frame_type is always 0. Midi 2.0 is expected to add new
747 * types here. Applications are expected to skip unknown frame types.
748 */
749 __u8 frame_type;
750 __u8 length; /* number of valid bytes in data field */
751 __u8 reserved[2];
752 __u32 tv_nsec; /* nanoseconds */
753 __u64 tv_sec; /* seconds */
754 __u8 data[SNDRV_RAWMIDI_FRAMING_DATA_LENGTH];
755} __attribute__((packed));
756
757struct snd_rawmidi_params {
758 int stream;
759 size_t buffer_size; /* queue size in bytes */
760 size_t avail_min; /* minimum avail bytes for wakeup */
761 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
762 unsigned int mode; /* For input data only, frame incoming data */
763 unsigned char reserved[12]; /* reserved for future use */
764};
765
766struct snd_rawmidi_status {
767 int stream;
768 __time_pad pad1;
769 struct timespec tstamp; /* Timestamp */
770 size_t avail; /* available bytes */
771 size_t xruns; /* count of overruns since last status (in bytes) */
772 unsigned char reserved[16]; /* reserved for future use */
773};
774
775#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
776#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
777#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
778#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
779#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
780#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
781#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
782
783/*
784 * Timer section - /dev/snd/timer
785 */
786
787#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
788
789enum {
790 SNDRV_TIMER_CLASS_NONE = -1,
791 SNDRV_TIMER_CLASS_SLAVE = 0,
792 SNDRV_TIMER_CLASS_GLOBAL,
793 SNDRV_TIMER_CLASS_CARD,
794 SNDRV_TIMER_CLASS_PCM,
795 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
796};
797
798/* slave timer classes */
799enum {
800 SNDRV_TIMER_SCLASS_NONE = 0,
801 SNDRV_TIMER_SCLASS_APPLICATION,
802 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
803 SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
804 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
805};
806
807/* global timers (device member) */
808#define SNDRV_TIMER_GLOBAL_SYSTEM 0
809#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */
810#define SNDRV_TIMER_GLOBAL_HPET 2
811#define SNDRV_TIMER_GLOBAL_HRTIMER 3
812
813/* info flags */
814#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
815
816struct snd_timer_id {
817 int dev_class;
818 int dev_sclass;
819 int card;
820 int device;
821 int subdevice;
822};
823
824struct snd_timer_ginfo {
825 struct snd_timer_id tid; /* requested timer ID */
826 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
827 int card; /* card number */
828 unsigned char id[64]; /* timer identification */
829 unsigned char name[80]; /* timer name */
830 unsigned long reserved0; /* reserved for future use */
831 unsigned long resolution; /* average period resolution in ns */
832 unsigned long resolution_min; /* minimal period resolution in ns */
833 unsigned long resolution_max; /* maximal period resolution in ns */
834 unsigned int clients; /* active timer clients */
835 unsigned char reserved[32];
836};
837
838struct snd_timer_gparams {
839 struct snd_timer_id tid; /* requested timer ID */
840 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
841 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
842 unsigned char reserved[32];
843};
844
845struct snd_timer_gstatus {
846 struct snd_timer_id tid; /* requested timer ID */
847 unsigned long resolution; /* current period resolution in ns */
848 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
849 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
850 unsigned char reserved[32];
851};
852
853struct snd_timer_select {
854 struct snd_timer_id id; /* bind to timer ID */
855 unsigned char reserved[32]; /* reserved */
856};
857
858struct snd_timer_info {
859 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
860 int card; /* card number */
861 unsigned char id[64]; /* timer identificator */
862 unsigned char name[80]; /* timer name */
863 unsigned long reserved0; /* reserved for future use */
864 unsigned long resolution; /* average period resolution in ns */
865 unsigned char reserved[64]; /* reserved */
866};
867
868#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
869#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
870#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
871
872struct snd_timer_params {
873 unsigned int flags; /* flags - SNDRV_TIMER_PSFLG_* */
874 unsigned int ticks; /* requested resolution in ticks */
875 unsigned int queue_size; /* total size of queue (32-1024) */
876 unsigned int reserved0; /* reserved, was: failure locations */
877 unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
878 unsigned char reserved[60]; /* reserved */
879};
880
881struct snd_timer_status {
882 struct timespec tstamp; /* Timestamp - last update */
883 unsigned int resolution; /* current period resolution in ns */
884 unsigned int lost; /* counter of master tick lost */
885 unsigned int overrun; /* count of read queue overruns */
886 unsigned int queue; /* used queue size */
887 unsigned char reserved[64]; /* reserved */
888};
889
890#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
891#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
892#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int)
893#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
894#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
895#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
896#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
897#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
898#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
899#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
900/* The following four ioctls are changed since 1.0.9 due to confliction */
901#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
902#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
903#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
904#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
905#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int)
906
907#if __BITS_PER_LONG == 64
908#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD
909#else
910#define SNDRV_TIMER_IOCTL_TREAD ((sizeof(__kernel_long_t) >= sizeof(time_t)) ? \
911 SNDRV_TIMER_IOCTL_TREAD_OLD : \
912 SNDRV_TIMER_IOCTL_TREAD64)
913#endif
914
915struct snd_timer_read {
916 unsigned int resolution;
917 unsigned int ticks;
918};
919
920enum {
921 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
922 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
923 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
924 SNDRV_TIMER_EVENT_STOP, /* val = 0 */
925 SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
926 SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
927 SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
928 SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
929 SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
930 /* master timer events for slave timer instances */
931 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
932 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
933 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
934 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
935 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
936 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
937};
938
939struct snd_timer_tread {
940 int event;
941 __time_pad pad1;
942 struct timespec tstamp;
943 unsigned int val;
944 __time_pad pad2;
945};
946
947/****************************************************************************
948 * *
949 * Section for driver control interface - /dev/snd/control? *
950 * *
951 ****************************************************************************/
952
953#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
954
955struct snd_ctl_card_info {
956 int card; /* card number */
957 int pad; /* reserved for future (was type) */
958 unsigned char id[16]; /* ID of card (user selectable) */
959 unsigned char driver[16]; /* Driver name */
960 unsigned char name[32]; /* Short name of soundcard */
961 unsigned char longname[80]; /* name + info text about soundcard */
962 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
963 unsigned char mixername[80]; /* visual mixer identification */
964 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
965};
966
967typedef int __bitwise snd_ctl_elem_type_t;
968#define SNDRV_CTL_ELEM_TYPE_NONE ((snd_ctl_elem_type_t) 0) /* invalid */
969#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((snd_ctl_elem_type_t) 1) /* boolean type */
970#define SNDRV_CTL_ELEM_TYPE_INTEGER ((snd_ctl_elem_type_t) 2) /* integer type */
971#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((snd_ctl_elem_type_t) 3) /* enumerated type */
972#define SNDRV_CTL_ELEM_TYPE_BYTES ((snd_ctl_elem_type_t) 4) /* byte array */
973#define SNDRV_CTL_ELEM_TYPE_IEC958 ((snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
974#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((snd_ctl_elem_type_t) 6) /* 64-bit integer type */
975#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
976
977typedef int __bitwise snd_ctl_elem_iface_t;
978#define SNDRV_CTL_ELEM_IFACE_CARD ((snd_ctl_elem_iface_t) 0) /* global control */
979#define SNDRV_CTL_ELEM_IFACE_HWDEP ((snd_ctl_elem_iface_t) 1) /* hardware dependent device */
980#define SNDRV_CTL_ELEM_IFACE_MIXER ((snd_ctl_elem_iface_t) 2) /* virtual mixer device */
981#define SNDRV_CTL_ELEM_IFACE_PCM ((snd_ctl_elem_iface_t) 3) /* PCM device */
982#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((snd_ctl_elem_iface_t) 4) /* RawMidi device */
983#define SNDRV_CTL_ELEM_IFACE_TIMER ((snd_ctl_elem_iface_t) 5) /* timer device */
984#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((snd_ctl_elem_iface_t) 6) /* sequencer client */
985#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
986
987#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
988#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
989#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
990#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
991/* (1 << 3) is unused. */
992#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
993#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
994#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
995#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
996#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
997#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
998#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
999#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
1000#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
1001/* bits 30 and 31 are obsoleted (for indirect access) */
1002
1003/* for further details see the ACPI and PCI power management specification */
1004#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
1005#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
1006#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
1007#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
1008#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
1009#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
1010
1011#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
1012
1013struct snd_ctl_elem_id {
1014 unsigned int numid; /* numeric identifier, zero = invalid */
1015 snd_ctl_elem_iface_t iface; /* interface identifier */
1016 unsigned int device; /* device/client number */
1017 unsigned int subdevice; /* subdevice (substream) number */
1018 unsigned char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* ASCII name of item */
1019 unsigned int index; /* index of item */
1020};
1021
1022struct snd_ctl_elem_list {
1023 unsigned int offset; /* W: first element ID to get */
1024 unsigned int space; /* W: count of element IDs to get */
1025 unsigned int used; /* R: count of element IDs set */
1026 unsigned int count; /* R: count of all elements */
1027 struct snd_ctl_elem_id *pids; /* R: IDs */
1028 unsigned char reserved[50];
1029};
1030
1031struct snd_ctl_elem_info {
1032 struct snd_ctl_elem_id id; /* W: element ID */
1033 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
1034 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
1035 unsigned int count; /* count of values */
1036 __kernel_pid_t owner; /* owner's PID of this control */
1037 union {
1038 struct {
1039 long min; /* R: minimum value */
1040 long max; /* R: maximum value */
1041 long step; /* R: step (0 variable) */
1042 } integer;
1043 struct {
1044 long long min; /* R: minimum value */
1045 long long max; /* R: maximum value */
1046 long long step; /* R: step (0 variable) */
1047 } integer64;
1048 struct {
1049 unsigned int items; /* R: number of items */
1050 unsigned int item; /* W: item number */
1051 char name[64]; /* R: value name */
1052 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
1053 unsigned int names_length;
1054 } enumerated;
1055 unsigned char reserved[128];
1056 } value;
1057 unsigned char reserved[64];
1058};
1059
1060struct snd_ctl_elem_value {
1061 struct snd_ctl_elem_id id; /* W: element ID */
1062 unsigned int indirect: 1; /* W: indirect access - obsoleted */
1063 union {
1064 union {
1065 long value[128];
1066 long *value_ptr; /* obsoleted */
1067 } integer;
1068 union {
1069 long long value[64];
1070 long long *value_ptr; /* obsoleted */
1071 } integer64;
1072 union {
1073 unsigned int item[128];
1074 unsigned int *item_ptr; /* obsoleted */
1075 } enumerated;
1076 union {
1077 unsigned char data[512];
1078 unsigned char *data_ptr; /* obsoleted */
1079 } bytes;
1080 struct snd_aes_iec958 iec958;
1081 } value; /* RO */
1082 unsigned char reserved[128];
1083};
1084
1085struct snd_ctl_tlv {
1086 unsigned int numid; /* control element numeric identification */
1087 unsigned int length; /* in bytes aligned to 4 */
1088 unsigned int tlv[0]; /* first TLV */
1089};
1090
1091#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
1092#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
1093#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
1094#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
1095#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
1096#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
1097#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
1098#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
1099#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
1100#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
1101#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
1102#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
1103#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
1104#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
1105#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
1106#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
1107#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
1108#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
1109#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
1110#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
1111#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
1112#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
1113#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
1114#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
1115#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
1116
1117/*
1118 * Read interface.
1119 */
1120
1121enum sndrv_ctl_event_type {
1122 SNDRV_CTL_EVENT_ELEM = 0,
1123 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
1124};
1125
1126#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
1127#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
1128#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
1129#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
1130#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
1131
1132struct snd_ctl_event {
1133 int type; /* event type - SNDRV_CTL_EVENT_* */
1134 union {
1135 struct {
1136 unsigned int mask;
1137 struct snd_ctl_elem_id id;
1138 } elem;
1139 unsigned char data8[60];
1140 } data;
1141};
1142
1143/*
1144 * Control names
1145 */
1146
1147#define SNDRV_CTL_NAME_NONE ""
1148#define SNDRV_CTL_NAME_PLAYBACK "Playback "
1149#define SNDRV_CTL_NAME_CAPTURE "Capture "
1150
1151#define SNDRV_CTL_NAME_IEC958_NONE ""
1152#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
1153#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
1154#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
1155#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
1156#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
1157#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
1158#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
1159#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
1160
1161#endif /* __SOUND_ASOUND_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asound_fm.h created+135
...@@ -0,0 +1,135 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_ASOUND_FM_H
3#define __SOUND_ASOUND_FM_H
4
5/*
6 * Advanced Linux Sound Architecture - ALSA
7 *
8 * Interface file between ALSA driver & user space
9 * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
10 * 4Front Technologies
11 *
12 * Direct FM control
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30#define SNDRV_DM_FM_MODE_OPL2 0x00
31#define SNDRV_DM_FM_MODE_OPL3 0x01
32
33struct snd_dm_fm_info {
34 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
35 unsigned char rhythm; /* percussion mode flag */
36};
37
38/*
39 * Data structure composing an FM "note" or sound event.
40 */
41
42struct snd_dm_fm_voice {
43 unsigned char op; /* operator cell (0 or 1) */
44 unsigned char voice; /* FM voice (0 to 17) */
45
46 unsigned char am; /* amplitude modulation */
47 unsigned char vibrato; /* vibrato effect */
48 unsigned char do_sustain; /* sustain phase */
49 unsigned char kbd_scale; /* keyboard scaling */
50 unsigned char harmonic; /* 4 bits: harmonic and multiplier */
51 unsigned char scale_level; /* 2 bits: decrease output freq rises */
52 unsigned char volume; /* 6 bits: volume */
53
54 unsigned char attack; /* 4 bits: attack rate */
55 unsigned char decay; /* 4 bits: decay rate */
56 unsigned char sustain; /* 4 bits: sustain level */
57 unsigned char release; /* 4 bits: release rate */
58
59 unsigned char feedback; /* 3 bits: feedback for op0 */
60 unsigned char connection; /* 0 for serial, 1 for parallel */
61 unsigned char left; /* stereo left */
62 unsigned char right; /* stereo right */
63 unsigned char waveform; /* 3 bits: waveform shape */
64};
65
66/*
67 * This describes an FM note by its voice, octave, frequency number (10bit)
68 * and key on/off.
69 */
70
71struct snd_dm_fm_note {
72 unsigned char voice; /* 0-17 voice channel */
73 unsigned char octave; /* 3 bits: what octave to play */
74 unsigned int fnum; /* 10 bits: frequency number */
75 unsigned char key_on; /* set for active, clear for silent */
76};
77
78/*
79 * FM parameters that apply globally to all voices, and thus are not "notes"
80 */
81
82struct snd_dm_fm_params {
83 unsigned char am_depth; /* amplitude modulation depth (1=hi) */
84 unsigned char vib_depth; /* vibrato depth (1=hi) */
85 unsigned char kbd_split; /* keyboard split */
86 unsigned char rhythm; /* percussion mode select */
87
88 /* This block is the percussion instrument data */
89 unsigned char bass;
90 unsigned char snare;
91 unsigned char tomtom;
92 unsigned char cymbal;
93 unsigned char hihat;
94};
95
96/*
97 * FM mode ioctl settings
98 */
99
100#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
101#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
102#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
103#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
104#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
105#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
106/* for OPL3 only */
107#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
108/* SBI patch management */
109#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
110
111#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
112#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
113#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22
114#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23
115#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
116#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
117
118/*
119 * Patch Record - fixed size for write
120 */
121
122#define FM_KEY_SBI "SBI\032"
123#define FM_KEY_2OP "2OP\032"
124#define FM_KEY_4OP "4OP\032"
125
126struct sbi_patch {
127 unsigned char prog;
128 unsigned char bank;
129 char key[4];
130 char name[25];
131 char extension[7];
132 unsigned char data[32];
133};
134
135#endif /* __SOUND_ASOUND_FM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/compress_offload.h created+192
...@@ -0,0 +1,192 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * compress_offload.h - compress offload header definations
4 *
5 * Copyright (C) 2011 Intel Corporation
6 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
7 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *
23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 *
25 */
26#ifndef __COMPRESS_OFFLOAD_H
27#define __COMPRESS_OFFLOAD_H
28
29#include <linux/types.h>
30#include <sound/asound.h>
31#include <sound/compress_params.h>
32
33
34#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0)
35/**
36 * struct snd_compressed_buffer - compressed buffer
37 * @fragment_size: size of buffer fragment in bytes
38 * @fragments: number of such fragments
39 */
40struct snd_compressed_buffer {
41 __u32 fragment_size;
42 __u32 fragments;
43} __attribute__((packed, aligned(4)));
44
45/**
46 * struct snd_compr_params - compressed stream params
47 * @buffer: buffer description
48 * @codec: codec parameters
49 * @no_wake_mode: dont wake on fragment elapsed
50 */
51struct snd_compr_params {
52 struct snd_compressed_buffer buffer;
53 struct snd_codec codec;
54 __u8 no_wake_mode;
55} __attribute__((packed, aligned(4)));
56
57/**
58 * struct snd_compr_tstamp - timestamp descriptor
59 * @byte_offset: Byte offset in ring buffer to DSP
60 * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
61 * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
62 * large steps and should only be used to monitor encoding/decoding
63 * progress. It shall not be used for timing estimates.
64 * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
65 * output/input. This field should be used for A/V sync or time estimates.
66 * @sampling_rate: sampling rate of audio
67 */
68struct snd_compr_tstamp {
69 __u32 byte_offset;
70 __u32 copied_total;
71 __u32 pcm_frames;
72 __u32 pcm_io_frames;
73 __u32 sampling_rate;
74} __attribute__((packed, aligned(4)));
75
76/**
77 * struct snd_compr_avail - avail descriptor
78 * @avail: Number of bytes available in ring buffer for writing/reading
79 * @tstamp: timestamp information
80 */
81struct snd_compr_avail {
82 __u64 avail;
83 struct snd_compr_tstamp tstamp;
84} __attribute__((packed, aligned(4)));
85
86enum snd_compr_direction {
87 SND_COMPRESS_PLAYBACK = 0,
88 SND_COMPRESS_CAPTURE
89};
90
91/**
92 * struct snd_compr_caps - caps descriptor
93 * @codecs: pointer to array of codecs
94 * @direction: direction supported. Of type snd_compr_direction
95 * @min_fragment_size: minimum fragment supported by DSP
96 * @max_fragment_size: maximum fragment supported by DSP
97 * @min_fragments: min fragments supported by DSP
98 * @max_fragments: max fragments supported by DSP
99 * @num_codecs: number of codecs supported
100 * @reserved: reserved field
101 */
102struct snd_compr_caps {
103 __u32 num_codecs;
104 __u32 direction;
105 __u32 min_fragment_size;
106 __u32 max_fragment_size;
107 __u32 min_fragments;
108 __u32 max_fragments;
109 __u32 codecs[MAX_NUM_CODECS];
110 __u32 reserved[11];
111} __attribute__((packed, aligned(4)));
112
113/**
114 * struct snd_compr_codec_caps - query capability of codec
115 * @codec: codec for which capability is queried
116 * @num_descriptors: number of codec descriptors
117 * @descriptor: array of codec capability descriptor
118 */
119struct snd_compr_codec_caps {
120 __u32 codec;
121 __u32 num_descriptors;
122 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
123} __attribute__((packed, aligned(4)));
124
125/**
126 * enum sndrv_compress_encoder
127 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
128 * end of the track
129 * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
130 * beginning of the track
131 */
132enum sndrv_compress_encoder {
133 SNDRV_COMPRESS_ENCODER_PADDING = 1,
134 SNDRV_COMPRESS_ENCODER_DELAY = 2,
135};
136
137/**
138 * struct snd_compr_metadata - compressed stream metadata
139 * @key: key id
140 * @value: key value
141 */
142struct snd_compr_metadata {
143 __u32 key;
144 __u32 value[8];
145} __attribute__((packed, aligned(4)));
146
147/*
148 * compress path ioctl definitions
149 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
150 * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec
151 * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters
152 * Note: only codec params can be changed runtime and stream params cant be
153 * SNDRV_COMPRESS_GET_PARAMS: Query codec params
154 * SNDRV_COMPRESS_TSTAMP: get the current timestamp value
155 * SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
156 * This also queries the tstamp properties
157 * SNDRV_COMPRESS_PAUSE: Pause the running stream
158 * SNDRV_COMPRESS_RESUME: resume a paused stream
159 * SNDRV_COMPRESS_START: Start a stream
160 * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content
161 * and the buffers currently with DSP
162 * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that
163 * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version
164 */
165#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
166#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
167#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\
168 struct snd_compr_codec_caps)
169#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
170#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
171#define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14,\
172 struct snd_compr_metadata)
173#define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15,\
174 struct snd_compr_metadata)
175#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
176#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
177#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
178#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
179#define SNDRV_COMPRESS_START _IO('C', 0x32)
180#define SNDRV_COMPRESS_STOP _IO('C', 0x33)
181#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
182#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)
183#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)
184/*
185 * TODO
186 * 1. add mmap support
187 *
188 */
189#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
190#define SND_COMPR_TRIGGER_NEXT_TRACK 8
191#define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9
192#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/compress_params.h created+451
...@@ -0,0 +1,451 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) AND MIT) */
2/*
3 * compress_params.h - codec types and parameters for compressed data
4 * streaming interface
5 *
6 * Copyright (C) 2011 Intel Corporation
7 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * Vinod Koul <vinod.koul@linux.intel.com>
9 *
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *
25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 *
27 * The definitions in this file are derived from the OpenMAX AL version 1.1
28 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
29 *
30 * Copyright (c) 2007-2010 The Khronos Group Inc.
31 *
32 * Permission is hereby granted, free of charge, to any person obtaining
33 * a copy of this software and/or associated documentation files (the
34 * "Materials "), to deal in the Materials without restriction, including
35 * without limitation the rights to use, copy, modify, merge, publish,
36 * distribute, sublicense, and/or sell copies of the Materials, and to
37 * permit persons to whom the Materials are furnished to do so, subject to
38 * the following conditions:
39 *
40 * The above copyright notice and this permission notice shall be included
41 * in all copies or substantial portions of the Materials.
42 *
43 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
44 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
46 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
47 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
48 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
49 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
50 *
51 */
52#ifndef __SND_COMPRESS_PARAMS_H
53#define __SND_COMPRESS_PARAMS_H
54
55#include <linux/types.h>
56
57/* AUDIO CODECS SUPPORTED */
58#define MAX_NUM_CODECS 32
59#define MAX_NUM_CODEC_DESCRIPTORS 32
60#define MAX_NUM_BITRATES 32
61#define MAX_NUM_SAMPLE_RATES 32
62
63/* Codecs are listed linearly to allow for extensibility */
64#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
65#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
66#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
67#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
68#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
69#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
70#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
71#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
72#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
73#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
74#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
75#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
76#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
77#define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
78#define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F)
79#define SND_AUDIOCODEC_APE ((__u32) 0x00000010)
80#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE
81
82/*
83 * Profile and modes are listed with bit masks. This allows for a
84 * more compact representation of fields that will not evolve
85 * (in contrast to the list of codecs)
86 */
87
88#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
89
90/* MP3 modes are only useful for encoders */
91#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
92#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
93#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
94#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
95
96#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
97
98/* AMR modes are only useful for encoders */
99#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
100#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
101#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
102
103#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
104#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
105#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
106#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
107#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
108#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
109#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
110
111#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
112
113/* AMRWB modes are only useful for encoders */
114#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
115#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
116#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
117
118#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
119
120#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
121
122/* AAC modes are required for encoders and decoders */
123#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
124#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
125#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
126#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
127#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
128#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
129#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
130#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
131#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
132#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
133
134/* AAC formats are required for encoders and decoders */
135#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
136#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
137#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
138#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
139#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
140#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
141#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
142
143#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
144#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
145#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
146#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
147#define SND_AUDIOPROFILE_WMA9_PRO ((__u32) 0x00000010)
148#define SND_AUDIOPROFILE_WMA9_LOSSLESS ((__u32) 0x00000020)
149#define SND_AUDIOPROFILE_WMA10_LOSSLESS ((__u32) 0x00000040)
150
151#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
152#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
153#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
154#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
155#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
156#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
157#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
158#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
159
160#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
161/*
162 * Some implementations strip the ASF header and only send ASF packets
163 * to the DSP
164 */
165#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
166
167#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
168
169#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
170#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
171#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
172#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
173
174#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
175
176#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
177
178#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
179
180/*
181 * Define quality levels for FLAC encoders, from LEVEL0 (fast)
182 * to LEVEL8 (best)
183 */
184#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
185#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
186#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
187#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
188#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
189#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
190#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
191#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
192#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
193
194#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
195#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
196
197/* IEC61937 payloads without CUVP and preambles */
198#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
199/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
200#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
201
202/*
203 * IEC modes are mandatory for decoders. Format autodetection
204 * will only happen on the DSP side with mode 0. The PCM mode should
205 * not be used, the PCM codec should be used instead.
206 */
207#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
208#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
209#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
210#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
211#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
212#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
213#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
214#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
215#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
216#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
217#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
218#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
219#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
220#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
221#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
222#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
223#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
224#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
225#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
226
227#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
228
229#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
230#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
231#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
232
233#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
234
235#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
236#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
237
238/* <FIXME: multichannel encoders aren't supported for now. Would need
239 an additional definition of channel arrangement> */
240
241/* VBR/CBR definitions */
242#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
243#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
244
245/* Encoder options */
246
247struct snd_enc_wma {
248 __u32 super_block_align; /* WMA Type-specific data */
249};
250
251
252/**
253 * struct snd_enc_vorbis
254 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
255 * In the default mode of operation, the quality level is 3.
256 * Normal quality range is 0 - 10.
257 * @managed: Boolean. Set bitrate management mode. This turns off the
258 * normal VBR encoding, but allows hard or soft bitrate constraints to be
259 * enforced by the encoder. This mode can be slower, and may also be
260 * lower quality. It is primarily useful for streaming.
261 * @max_bit_rate: Enabled only if managed is TRUE
262 * @min_bit_rate: Enabled only if managed is TRUE
263 * @downmix: Boolean. Downmix input from stereo to mono (has no effect on
264 * non-stereo streams). Useful for lower-bitrate encoding.
265 *
266 * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
267 * properties
268 *
269 * For best quality users should specify VBR mode and set quality levels.
270 */
271
272struct snd_enc_vorbis {
273 __s32 quality;
274 __u32 managed;
275 __u32 max_bit_rate;
276 __u32 min_bit_rate;
277 __u32 downmix;
278} __attribute__((packed, aligned(4)));
279
280
281/**
282 * struct snd_enc_real
283 * @quant_bits: number of coupling quantization bits in the stream
284 * @start_region: coupling start region in the stream
285 * @num_regions: number of regions value
286 *
287 * These options were extracted from the OpenMAX IL spec
288 */
289
290struct snd_enc_real {
291 __u32 quant_bits;
292 __u32 start_region;
293 __u32 num_regions;
294} __attribute__((packed, aligned(4)));
295
296/**
297 * struct snd_enc_flac
298 * @num: serial number, valid only for OGG formats
299 * needs to be set by application
300 * @gain: Add replay gain tags
301 *
302 * These options were extracted from the FLAC online documentation
303 * at http://flac.sourceforge.net/documentation_tools_flac.html
304 *
305 * To make the API simpler, it is assumed that the user will select quality
306 * profiles. Additional options that affect encoding quality and speed can
307 * be added at a later stage if needed.
308 *
309 * By default the Subset format is used by encoders.
310 *
311 * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
312 * not supported in this API.
313 */
314
315struct snd_enc_flac {
316 __u32 num;
317 __u32 gain;
318} __attribute__((packed, aligned(4)));
319
320struct snd_enc_generic {
321 __u32 bw; /* encoder bandwidth */
322 __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
323} __attribute__((packed, aligned(4)));
324
325struct snd_dec_flac {
326 __u16 sample_size;
327 __u16 min_blk_size;
328 __u16 max_blk_size;
329 __u16 min_frame_size;
330 __u16 max_frame_size;
331 __u16 reserved;
332} __attribute__((packed, aligned(4)));
333
334struct snd_dec_wma {
335 __u32 encoder_option;
336 __u32 adv_encoder_option;
337 __u32 adv_encoder_option2;
338 __u32 reserved;
339} __attribute__((packed, aligned(4)));
340
341struct snd_dec_alac {
342 __u32 frame_length;
343 __u8 compatible_version;
344 __u8 pb;
345 __u8 mb;
346 __u8 kb;
347 __u32 max_run;
348 __u32 max_frame_bytes;
349} __attribute__((packed, aligned(4)));
350
351struct snd_dec_ape {
352 __u16 compatible_version;
353 __u16 compression_level;
354 __u32 format_flags;
355 __u32 blocks_per_frame;
356 __u32 final_frame_blocks;
357 __u32 total_frames;
358 __u32 seek_table_present;
359} __attribute__((packed, aligned(4)));
360
361union snd_codec_options {
362 struct snd_enc_wma wma;
363 struct snd_enc_vorbis vorbis;
364 struct snd_enc_real real;
365 struct snd_enc_flac flac;
366 struct snd_enc_generic generic;
367 struct snd_dec_flac flac_d;
368 struct snd_dec_wma wma_d;
369 struct snd_dec_alac alac_d;
370 struct snd_dec_ape ape_d;
371} __attribute__((packed, aligned(4)));
372
373/** struct snd_codec_desc - description of codec capabilities
374 * @max_ch: Maximum number of audio channels
375 * @sample_rates: Sampling rates in Hz, use values like 48000 for this
376 * @num_sample_rates: Number of valid values in sample_rates array
377 * @bit_rate: Indexed array containing supported bit rates
378 * @num_bitrates: Number of valid values in bit_rate array
379 * @rate_control: value is specified by SND_RATECONTROLMODE defines.
380 * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
381 * @modes: Supported modes. See SND_AUDIOMODE defines
382 * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
383 * @min_buffer: Minimum buffer size handled by codec implementation
384 * @reserved: reserved for future use
385 *
386 * This structure provides a scalar value for profiles, modes and stream
387 * format fields.
388 * If an implementation supports multiple combinations, they will be listed as
389 * codecs with different descriptors, for example there would be 2 descriptors
390 * for AAC-RAW and AAC-ADTS.
391 * This entails some redundancy but makes it easier to avoid invalid
392 * configurations.
393 *
394 */
395
396struct snd_codec_desc {
397 __u32 max_ch;
398 __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
399 __u32 num_sample_rates;
400 __u32 bit_rate[MAX_NUM_BITRATES];
401 __u32 num_bitrates;
402 __u32 rate_control;
403 __u32 profiles;
404 __u32 modes;
405 __u32 formats;
406 __u32 min_buffer;
407 __u32 reserved[15];
408} __attribute__((packed, aligned(4)));
409
410/** struct snd_codec
411 * @id: Identifies the supported audio encoder/decoder.
412 * See SND_AUDIOCODEC macros.
413 * @ch_in: Number of input audio channels
414 * @ch_out: Number of output channels. In case of contradiction between
415 * this field and the channelMode field, the channelMode field
416 * overrides.
417 * @sample_rate: Audio sample rate of input data in Hz, use values like 48000
418 * for this.
419 * @bit_rate: Bitrate of encoded data. May be ignored by decoders
420 * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
421 * Encoders may rely on profiles for quality levels.
422 * May be ignored by decoders.
423 * @profile: Mandatory for encoders, can be mandatory for specific
424 * decoders as well. See SND_AUDIOPROFILE defines.
425 * @level: Supported level (Only used by WMA at the moment)
426 * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
427 * @format: Format of encoded bistream. Mandatory when defined.
428 * See SND_AUDIOSTREAMFORMAT defines.
429 * @align: Block alignment in bytes of an audio sample.
430 * Only required for PCM or IEC formats.
431 * @options: encoder-specific settings
432 * @reserved: reserved for future use
433 */
434
435struct snd_codec {
436 __u32 id;
437 __u32 ch_in;
438 __u32 ch_out;
439 __u32 sample_rate;
440 __u32 bit_rate;
441 __u32 rate_control;
442 __u32 profile;
443 __u32 level;
444 __u32 ch_mode;
445 __u32 format;
446 __u32 align;
447 union snd_codec_options options;
448 __u32 reserved[3];
449} __attribute__((packed, aligned(4)));
450
451#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/emu10k1.h created+387
...@@ -0,0 +1,387 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
4 * Creative Labs, Inc.
5 * Definitions for EMU10K1 (SB Live!) chips
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_EMU10K1_H
24#define __SOUND_EMU10K1_H
25
26#ifdef __linux__
27#include <linux/types.h>
28#endif
29
30/*
31 * ---- FX8010 ----
32 */
33
34#define EMU10K1_CARD_CREATIVE 0x00000000
35#define EMU10K1_CARD_EMUAPS 0x00000001
36
37#define EMU10K1_FX8010_PCM_COUNT 8
38
39/*
40 * Following definition is copied from linux/types.h to support compiling
41 * this header file in userspace since they are not generally available for
42 * uapi headers.
43 */
44#define __EMU10K1_DECLARE_BITMAP(name,bits) \
45 unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
46
47/* instruction set */
48#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
49#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
50#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
51#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
52#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
53#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
54#define iACC3 0x06 /* R = A + X + Y ; saturation */
55#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
56#define iANDXOR 0x08 /* R = (A & X) ^ Y */
57#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
58#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
59#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
60#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
61#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
62#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
63#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
64
65/* GPRs */
66#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
67#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
68#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
69#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
70 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
71
72#define C_00000000 0x40
73#define C_00000001 0x41
74#define C_00000002 0x42
75#define C_00000003 0x43
76#define C_00000004 0x44
77#define C_00000008 0x45
78#define C_00000010 0x46
79#define C_00000020 0x47
80#define C_00000100 0x48
81#define C_00010000 0x49
82#define C_00080000 0x4a
83#define C_10000000 0x4b
84#define C_20000000 0x4c
85#define C_40000000 0x4d
86#define C_80000000 0x4e
87#define C_7fffffff 0x4f
88#define C_ffffffff 0x50
89#define C_fffffffe 0x51
90#define C_c0000000 0x52
91#define C_4f1bbcdc 0x53
92#define C_5a7ef9db 0x54
93#define C_00100000 0x55 /* ?? */
94#define GPR_ACCU 0x56 /* ACCUM, accumulator */
95#define GPR_COND 0x57 /* CCR, condition register */
96#define GPR_NOISE0 0x58 /* noise source */
97#define GPR_NOISE1 0x59 /* noise source */
98#define GPR_IRQ 0x5a /* IRQ register */
99#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
100#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
101#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
102#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
103#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
104#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
105
106#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
107#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
108#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
109#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
110#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
111#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
112
113#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
114#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
115#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
116#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
117#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
118#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
119#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
120#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
121#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
122#define A_GPR(x) (A_FXGPREGBASE + (x))
123
124/* cc_reg constants */
125#define CC_REG_NORMALIZED C_00000001
126#define CC_REG_BORROW C_00000002
127#define CC_REG_MINUS C_00000004
128#define CC_REG_ZERO C_00000008
129#define CC_REG_SATURATE C_00000010
130#define CC_REG_NONZERO C_00000100
131
132/* FX buses */
133#define FXBUS_PCM_LEFT 0x00
134#define FXBUS_PCM_RIGHT 0x01
135#define FXBUS_PCM_LEFT_REAR 0x02
136#define FXBUS_PCM_RIGHT_REAR 0x03
137#define FXBUS_MIDI_LEFT 0x04
138#define FXBUS_MIDI_RIGHT 0x05
139#define FXBUS_PCM_CENTER 0x06
140#define FXBUS_PCM_LFE 0x07
141#define FXBUS_PCM_LEFT_FRONT 0x08
142#define FXBUS_PCM_RIGHT_FRONT 0x09
143#define FXBUS_MIDI_REVERB 0x0c
144#define FXBUS_MIDI_CHORUS 0x0d
145#define FXBUS_PCM_LEFT_SIDE 0x0e
146#define FXBUS_PCM_RIGHT_SIDE 0x0f
147#define FXBUS_PT_LEFT 0x14
148#define FXBUS_PT_RIGHT 0x15
149
150/* Inputs */
151#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
152#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
153#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
154#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
155#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
156#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
157#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
158#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
159#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
160#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
161#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
162#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
163#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
164#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
165
166/* Outputs */
167#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
168#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
169#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
170#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
171#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
172#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
173#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
174#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
175#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
176#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
177#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
178#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
179#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
180#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
181#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
182#define EXTOUT_ACENTER 0x11 /* Analog Center */
183#define EXTOUT_ALFE 0x12 /* Analog LFE */
184
185/* Audigy Inputs */
186#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
187#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
188#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
189#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
190#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
191#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
192#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
193#define A_EXTIN_LINE2_R 0x09 /* right */
194#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
195#define A_EXTIN_ADC_R 0x0b /* right */
196#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
197#define A_EXTIN_AUX2_R 0x0d /* - right */
198
199/* Audigiy Outputs */
200#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
201#define A_EXTOUT_FRONT_R 0x01 /* right */
202#define A_EXTOUT_CENTER 0x02 /* digital front center */
203#define A_EXTOUT_LFE 0x03 /* digital front lfe */
204#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
205#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
206#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
207#define A_EXTOUT_REAR_R 0x07 /* right */
208#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
209#define A_EXTOUT_AFRONT_R 0x09 /* right */
210#define A_EXTOUT_ACENTER 0x0a /* analog center */
211#define A_EXTOUT_ALFE 0x0b /* analog LFE */
212#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
213#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
214#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
215#define A_EXTOUT_AREAR_R 0x0f /* right */
216#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
217#define A_EXTOUT_AC97_R 0x11 /* right */
218#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
219#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
220#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
221
222/* Audigy constants */
223#define A_C_00000000 0xc0
224#define A_C_00000001 0xc1
225#define A_C_00000002 0xc2
226#define A_C_00000003 0xc3
227#define A_C_00000004 0xc4
228#define A_C_00000008 0xc5
229#define A_C_00000010 0xc6
230#define A_C_00000020 0xc7
231#define A_C_00000100 0xc8
232#define A_C_00010000 0xc9
233#define A_C_00000800 0xca
234#define A_C_10000000 0xcb
235#define A_C_20000000 0xcc
236#define A_C_40000000 0xcd
237#define A_C_80000000 0xce
238#define A_C_7fffffff 0xcf
239#define A_C_ffffffff 0xd0
240#define A_C_fffffffe 0xd1
241#define A_C_c0000000 0xd2
242#define A_C_4f1bbcdc 0xd3
243#define A_C_5a7ef9db 0xd4
244#define A_C_00100000 0xd5
245#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
246#define A_GPR_COND 0xd7 /* CCR, condition register */
247#define A_GPR_NOISE0 0xd8 /* noise source */
248#define A_GPR_NOISE1 0xd9 /* noise source */
249#define A_GPR_IRQ 0xda /* IRQ register */
250#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
251#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
252
253/* definitions for debug register */
254#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
255#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
256#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
257#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
258#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
259#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
260#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
261
262/* tank memory address line */
263#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
264#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
265#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
266#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
267#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
268
269struct snd_emu10k1_fx8010_info {
270 unsigned int internal_tram_size; /* in samples */
271 unsigned int external_tram_size; /* in samples */
272 char fxbus_names[16][32]; /* names of FXBUSes */
273 char extin_names[16][32]; /* names of external inputs */
274 char extout_names[32][32]; /* names of external outputs */
275 unsigned int gpr_controls; /* count of GPR controls */
276};
277
278#define EMU10K1_GPR_TRANSLATION_NONE 0
279#define EMU10K1_GPR_TRANSLATION_TABLE100 1
280#define EMU10K1_GPR_TRANSLATION_BASS 2
281#define EMU10K1_GPR_TRANSLATION_TREBLE 3
282#define EMU10K1_GPR_TRANSLATION_ONOFF 4
283
284enum emu10k1_ctl_elem_iface {
285 EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */
286 EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */
287};
288
289struct emu10k1_ctl_elem_id {
290 unsigned int pad; /* don't use */
291 int iface; /* interface identifier */
292 unsigned int device; /* device/client number */
293 unsigned int subdevice; /* subdevice (substream) number */
294 unsigned char name[44]; /* ASCII name of item */
295 unsigned int index; /* index of item */
296};
297
298struct snd_emu10k1_fx8010_control_gpr {
299 struct emu10k1_ctl_elem_id id; /* full control ID definition */
300 unsigned int vcount; /* visible count */
301 unsigned int count; /* count of GPR (1..16) */
302 unsigned short gpr[32]; /* GPR number(s) */
303 unsigned int value[32]; /* initial values */
304 unsigned int min; /* minimum range */
305 unsigned int max; /* maximum range */
306 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
307 const unsigned int *tlv;
308};
309
310/* old ABI without TLV support */
311struct snd_emu10k1_fx8010_control_old_gpr {
312 struct emu10k1_ctl_elem_id id;
313 unsigned int vcount;
314 unsigned int count;
315 unsigned short gpr[32];
316 unsigned int value[32];
317 unsigned int min;
318 unsigned int max;
319 unsigned int translation;
320};
321
322struct snd_emu10k1_fx8010_code {
323 char name[128];
324
325 __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
326 __u32 *gpr_map; /* initializers */
327
328 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
329 struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
330
331 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
332 struct emu10k1_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
333
334 unsigned int gpr_list_control_count; /* count of GPR controls to list */
335 unsigned int gpr_list_control_total; /* total count of GPR controls */
336 struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
337
338 __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
339 __u32 *tram_data_map; /* data initializers */
340 __u32 *tram_addr_map; /* map initializers */
341
342 __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
343 __u32 *code; /* one instruction - 64 bits */
344};
345
346struct snd_emu10k1_fx8010_tram {
347 unsigned int address; /* 31.bit == 1 -> external TRAM */
348 unsigned int size; /* size in samples (4 bytes) */
349 unsigned int *samples; /* pointer to samples (20-bit) */
350 /* NULL->clear memory */
351};
352
353struct snd_emu10k1_fx8010_pcm_rec {
354 unsigned int substream; /* substream number */
355 unsigned int res1; /* reserved */
356 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
357 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
358 unsigned int buffer_size; /* count of buffered samples */
359 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
360 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
361 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
362 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
363 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
364 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
365 unsigned char pad; /* reserved */
366 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
367 unsigned int res2; /* reserved */
368};
369
370#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
371
372#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
373#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
374#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
375#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
376#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
377#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
378#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
379#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
380#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
381#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
382#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
383#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
384#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
385#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
386
387#endif /* __SOUND_EMU10K1_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/firewire.h created+257
...@@ -0,0 +1,257 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SOUND_FIREWIRE_H_INCLUDED
3#define _SOUND_FIREWIRE_H_INCLUDED
4
5#include <linux/ioctl.h>
6#include <linux/types.h>
7
8/* events can be read() from the hwdep device */
9
10#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
11#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
12#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
13#define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
14#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
15#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
16#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d545244
17
18struct snd_firewire_event_common {
19 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
20};
21
22struct snd_firewire_event_lock_status {
23 unsigned int type;
24 unsigned int status; /* 0/1 = unlocked/locked */
25};
26
27struct snd_firewire_event_dice_notification {
28 unsigned int type;
29 unsigned int notification; /* DICE-specific bits */
30};
31
32#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
33/* each field should be in big endian */
34struct snd_efw_transaction {
35 __be32 length;
36 __be32 version;
37 __be32 seqnum;
38 __be32 category;
39 __be32 command;
40 __be32 status;
41 __be32 params[0];
42};
43struct snd_firewire_event_efw_response {
44 unsigned int type;
45 __be32 response[0]; /* some responses */
46};
47
48struct snd_firewire_event_digi00x_message {
49 unsigned int type;
50 __u32 message; /* Digi00x-specific message */
51};
52
53struct snd_firewire_event_motu_notification {
54 unsigned int type;
55 __u32 message; /* MOTU-specific bits. */
56};
57
58struct snd_firewire_tascam_change {
59 unsigned int index;
60 __be32 before;
61 __be32 after;
62};
63
64struct snd_firewire_event_tascam_control {
65 unsigned int type;
66 struct snd_firewire_tascam_change changes[0];
67};
68
69struct snd_firewire_event_motu_register_dsp_change {
70 unsigned int type;
71 __u32 count; /* The number of changes. */
72 __u32 changes[]; /* Encoded event for change of register DSP. */
73};
74
75union snd_firewire_event {
76 struct snd_firewire_event_common common;
77 struct snd_firewire_event_lock_status lock_status;
78 struct snd_firewire_event_dice_notification dice_notification;
79 struct snd_firewire_event_efw_response efw_response;
80 struct snd_firewire_event_digi00x_message digi00x_message;
81 struct snd_firewire_event_tascam_control tascam_control;
82 struct snd_firewire_event_motu_notification motu_notification;
83 struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;
84};
85
86
87#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
88#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
89#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
90#define SNDRV_FIREWIRE_IOCTL_TASCAM_STATE _IOR('H', 0xfb, struct snd_firewire_tascam_state)
91#define SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_METER _IOR('H', 0xfc, struct snd_firewire_motu_register_dsp_meter)
92#define SNDRV_FIREWIRE_IOCTL_MOTU_COMMAND_DSP_METER _IOR('H', 0xfd, struct snd_firewire_motu_command_dsp_meter)
93#define SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_PARAMETER _IOR('H', 0xfe, struct snd_firewire_motu_register_dsp_parameter)
94
95#define SNDRV_FIREWIRE_TYPE_DICE 1
96#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
97#define SNDRV_FIREWIRE_TYPE_BEBOB 3
98#define SNDRV_FIREWIRE_TYPE_OXFW 4
99#define SNDRV_FIREWIRE_TYPE_DIGI00X 5
100#define SNDRV_FIREWIRE_TYPE_TASCAM 6
101#define SNDRV_FIREWIRE_TYPE_MOTU 7
102#define SNDRV_FIREWIRE_TYPE_FIREFACE 8
103
104struct snd_firewire_get_info {
105 unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
106 unsigned int card; /* same as fw_cdev_get_info.card */
107 unsigned char guid[8];
108 char device_name[16]; /* device node in /dev */
109};
110
111/*
112 * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
113 * Returns -EBUSY if the driver is already streaming.
114 */
115
116#define SNDRV_FIREWIRE_TASCAM_STATE_COUNT 64
117
118struct snd_firewire_tascam_state {
119 __be32 data[SNDRV_FIREWIRE_TASCAM_STATE_COUNT];
120};
121
122/*
123 * In below MOTU models, software is allowed to control their DSP by accessing to registers.
124 * - 828mk2
125 * - 896hd
126 * - Traveler
127 * - 8 pre
128 * - Ultralite
129 * - 4 pre
130 * - Audio Express
131 *
132 * On the other hand, the status of DSP is split into specific messages included in the sequence of
133 * isochronous packet. ALSA firewire-motu driver gathers the messages and allow userspace applications
134 * to read it via ioctl. In 828mk2, 896hd, and Traveler, hardware meter for all of physical inputs
135 * are put into the message, while one pair of physical outputs is selected. The selection is done by
136 * LSB one byte in asynchronous write quadlet transaction to 0x'ffff'f000'0b2c.
137 *
138 * I note that V3HD/V4HD uses asynchronous transaction for the purpose. The destination address is
139 * registered to 0x'ffff'f000'0b38 and '0b3c by asynchronous write quadlet request. The size of
140 * message differs between 23 and 51 quadlets. For the case, the number of mixer bus can be extended
141 * up to 12.
142 */
143
144#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_INPUT_COUNT 24
145#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_OUTPUT_COUNT 24
146#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_COUNT \
147 (SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_INPUT_COUNT + SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_OUTPUT_COUNT)
148
149/**
150 * struct snd_firewire_motu_register_dsp_meter - the container for meter information in DSP
151 * controlled by register access
152 * @data: Signal level meters. The mapping between position and input/output channel is
153 * model-dependent.
154 *
155 * The structure expresses the part of DSP status for hardware meter. The u8 storage includes linear
156 * value for audio signal level between 0x00 and 0x7f.
157 */
158struct snd_firewire_motu_register_dsp_meter {
159 __u8 data[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_COUNT];
160};
161
162#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT 4
163#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT 20
164#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_INPUT_COUNT 10
165#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT (SNDRV_FIREWIRE_MOTU_REGISTER_DSP_INPUT_COUNT + 2)
166
167/**
168 * snd_firewire_motu_register_dsp_parameter - the container for parameters of DSP controlled
169 * by register access.
170 * @mixer.source.gain: The gain of source to mixer.
171 * @mixer.source.pan: The L/R balance of source to mixer.
172 * @mixer.source.flag: The flag of source to mixer, including mute, solo.
173 * @mixer.source.paired_balance: The L/R balance of paired source to mixer, only for 4 pre and
174 * Audio Express.
175 * @mixer.source.paired_width: The width of paired source to mixer, only for 4 pre and
176 * Audio Express.
177 * @mixer.output.paired_volume: The volume of paired output from mixer.
178 * @mixer.output.paired_flag: The flag of paired output from mixer.
179 * @output.main_paired_volume: The volume of paired main output.
180 * @output.hp_paired_volume: The volume of paired hp output.
181 * @output.hp_paired_assignment: The source assigned to paired hp output.
182 * @output.reserved: Padding for 32 bit alignment for future extension.
183 * @line_input.boost_flag: The flags of boost for line inputs, only for 828mk2 and Traveler.
184 * @line_input.nominal_level_flag: The flags of nominal level for line inputs, only for 828mk2 and
185 * Traveler.
186 * @line_input.reserved: Padding for 32 bit alignment for future extension.
187 * @input.gain_and_invert: The value including gain and invert for input, only for Ultralite, 4 pre
188 * and Audio Express.
189 * @input.flag: The flag of input; e.g. jack detection, phantom power, and pad, only for Ultralite,
190 * 4 pre and Audio express.
191 * @reserved: Padding so that the size of structure is kept to 512 byte, but for future extension.
192 *
193 * The structure expresses the set of parameters for DSP controlled by register access.
194 */
195struct snd_firewire_motu_register_dsp_parameter {
196 struct {
197 struct {
198 __u8 gain[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
199 __u8 pan[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
200 __u8 flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
201 __u8 paired_balance[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
202 __u8 paired_width[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
203 } source[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
204 struct {
205 __u8 paired_volume[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
206 __u8 paired_flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
207 } output;
208 } mixer;
209 struct {
210 __u8 main_paired_volume;
211 __u8 hp_paired_volume;
212 __u8 hp_paired_assignment;
213 __u8 reserved[5];
214 } output;
215 struct {
216 __u8 boost_flag;
217 __u8 nominal_level_flag;
218 __u8 reserved[6];
219 } line_input;
220 struct {
221 __u8 gain_and_invert[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT];
222 __u8 flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT];
223 } input;
224 __u8 reserved[64];
225};
226
227/*
228 * In below MOTU models, software is allowed to control their DSP by command in frame of
229 * asynchronous transaction to 0x'ffff'0001'0000:
230 *
231 * - 828 mk3 (FireWire only and Hybrid)
232 * - 896 mk3 (FireWire only and Hybrid)
233 * - Ultralite mk3 (FireWire only and Hybrid)
234 * - Traveler mk3
235 * - Track 16
236 *
237 * On the other hand, the states of hardware meter is split into specific messages included in the
238 * sequence of isochronous packet. ALSA firewire-motu driver gathers the message and allow userspace
239 * application to read it via ioctl.
240 */
241
242#define SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT 400
243
244/**
245 * struct snd_firewire_motu_command_dsp_meter - the container for meter information in DSP
246 * controlled by command
247 * @data: Signal level meters. The mapping between position and signal channel is model-dependent.
248 *
249 * The structure expresses the part of DSP status for hardware meter. The 32 bit storage is
250 * estimated to include IEEE 764 32 bit single precision floating point (binary32) value. It is
251 * expected to be linear value (not logarithm) for audio signal level between 0.0 and +1.0.
252 */
253struct snd_firewire_motu_command_dsp_meter {
254 float data[SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT];
255};
256
257#endif /* _SOUND_FIREWIRE_H_INCLUDED */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/hdsp.h created+104
...@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_HDSP_H
3#define __SOUND_HDSP_H
4
5/*
6 * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#ifdef __linux__
24#include <linux/types.h>
25#endif
26
27#define HDSP_MATRIX_MIXER_SIZE 2048
28
29enum HDSP_IO_Type {
30 Digiface,
31 Multiface,
32 H9652,
33 H9632,
34 RPM,
35 Undefined,
36};
37
38struct hdsp_peak_rms {
39 __u32 input_peaks[26];
40 __u32 playback_peaks[26];
41 __u32 output_peaks[28];
42 __u64 input_rms[26];
43 __u64 playback_rms[26];
44 /* These are only used for H96xx cards */
45 __u64 output_rms[26];
46};
47
48#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
49
50struct hdsp_config_info {
51 unsigned char pref_sync_ref;
52 unsigned char wordclock_sync_check;
53 unsigned char spdif_sync_check;
54 unsigned char adatsync_sync_check;
55 unsigned char adat_sync_check[3];
56 unsigned char spdif_in;
57 unsigned char spdif_out;
58 unsigned char spdif_professional;
59 unsigned char spdif_emphasis;
60 unsigned char spdif_nonaudio;
61 unsigned int spdif_sample_rate;
62 unsigned int system_sample_rate;
63 unsigned int autosync_sample_rate;
64 unsigned char system_clock_mode;
65 unsigned char clock_source;
66 unsigned char autosync_ref;
67 unsigned char line_out;
68 unsigned char passthru;
69 unsigned char da_gain;
70 unsigned char ad_gain;
71 unsigned char phone_gain;
72 unsigned char xlr_breakout_cable;
73 unsigned char analog_extension_board;
74};
75
76#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
77
78struct hdsp_firmware {
79 void *firmware_data; /* 24413 x 4 bytes */
80};
81
82#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
83
84struct hdsp_version {
85 enum HDSP_IO_Type io_type;
86 unsigned short firmware_rev;
87};
88
89#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
90
91struct hdsp_mixer {
92 unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
93};
94
95#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
96
97struct hdsp_9632_aeb {
98 int aebi;
99 int aebo;
100};
101
102#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
103
104#endif /* __SOUND_HDSP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/hdspm.h created+226
...@@ -0,0 +1,226 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_HDSPM_H
3#define __SOUND_HDSPM_H
4/*
5 * Copyright (C) 2003 Winfried Ritsch (IEM)
6 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#ifdef __linux__
25#include <linux/types.h>
26#endif
27
28/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
29#define HDSPM_MAX_CHANNELS 64
30
31enum hdspm_io_type {
32 MADI,
33 MADIface,
34 AIO,
35 AES32,
36 RayDAT
37};
38
39enum hdspm_speed {
40 ss,
41 ds,
42 qs
43};
44
45/* -------------------- IOCTL Peak/RMS Meters -------------------- */
46
47struct hdspm_peak_rms {
48 __u32 input_peaks[64];
49 __u32 playback_peaks[64];
50 __u32 output_peaks[64];
51
52 __u64 input_rms[64];
53 __u64 playback_rms[64];
54 __u64 output_rms[64];
55
56 __u8 speed; /* enum {ss, ds, qs} */
57 int status2;
58};
59
60#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
61 _IOR('H', 0x42, struct hdspm_peak_rms)
62
63/* ------------ CONFIG block IOCTL ---------------------- */
64
65struct hdspm_config {
66 unsigned char pref_sync_ref;
67 unsigned char wordclock_sync_check;
68 unsigned char madi_sync_check;
69 unsigned int system_sample_rate;
70 unsigned int autosync_sample_rate;
71 unsigned char system_clock_mode;
72 unsigned char clock_source;
73 unsigned char autosync_ref;
74 unsigned char line_out;
75 unsigned int passthru;
76 unsigned int analog_out;
77};
78
79#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
80 _IOR('H', 0x41, struct hdspm_config)
81
82/*
83 * If there's a TCO (TimeCode Option) board installed,
84 * there are further options and status data available.
85 * The hdspm_ltc structure contains the current SMPTE
86 * timecode and some status information and can be
87 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
88 * hdspm_status struct.
89 */
90
91enum hdspm_ltc_format {
92 format_invalid,
93 fps_24,
94 fps_25,
95 fps_2997,
96 fps_30
97};
98
99enum hdspm_ltc_frame {
100 frame_invalid,
101 drop_frame,
102 full_frame
103};
104
105enum hdspm_ltc_input_format {
106 ntsc,
107 pal,
108 no_video
109};
110
111struct hdspm_ltc {
112 unsigned int ltc;
113
114 enum hdspm_ltc_format format;
115 enum hdspm_ltc_frame frame;
116 enum hdspm_ltc_input_format input_format;
117};
118
119#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
120
121/*
122 * The status data reflects the device's current state
123 * as determined by the card's configuration and
124 * connection status.
125 */
126
127enum hdspm_sync {
128 hdspm_sync_no_lock = 0,
129 hdspm_sync_lock = 1,
130 hdspm_sync_sync = 2
131};
132
133enum hdspm_madi_input {
134 hdspm_input_optical = 0,
135 hdspm_input_coax = 1
136};
137
138enum hdspm_madi_channel_format {
139 hdspm_format_ch_64 = 0,
140 hdspm_format_ch_56 = 1
141};
142
143enum hdspm_madi_frame_format {
144 hdspm_frame_48 = 0,
145 hdspm_frame_96 = 1
146};
147
148enum hdspm_syncsource {
149 syncsource_wc = 0,
150 syncsource_madi = 1,
151 syncsource_tco = 2,
152 syncsource_sync = 3,
153 syncsource_none = 4
154};
155
156struct hdspm_status {
157 __u8 card_type; /* enum hdspm_io_type */
158 enum hdspm_syncsource autosync_source;
159
160 __u64 card_clock;
161 __u32 master_period;
162
163 union {
164 struct {
165 __u8 sync_wc; /* enum hdspm_sync */
166 __u8 sync_madi; /* enum hdspm_sync */
167 __u8 sync_tco; /* enum hdspm_sync */
168 __u8 sync_in; /* enum hdspm_sync */
169 __u8 madi_input; /* enum hdspm_madi_input */
170 __u8 channel_format; /* enum hdspm_madi_channel_format */
171 __u8 frame_format; /* enum hdspm_madi_frame_format */
172 } madi;
173 } card_specific;
174};
175
176#define SNDRV_HDSPM_IOCTL_GET_STATUS \
177 _IOR('H', 0x47, struct hdspm_status)
178
179/*
180 * Get information about the card and its add-ons.
181 */
182
183#define HDSPM_ADDON_TCO 1
184
185struct hdspm_version {
186 __u8 card_type; /* enum hdspm_io_type */
187 char cardname[20];
188 unsigned int serial;
189 unsigned short firmware_rev;
190 int addons;
191};
192
193#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
194
195/* ------------- get Matrix Mixer IOCTL --------------- */
196
197/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
198 * 32768 Bytes
199 */
200
201/* organisation is 64 channelfader in a continuous memory block */
202/* equivalent to hardware definition, maybe for future feature of mmap of
203 * them
204 */
205/* each of 64 outputs has 64 infader and 64 outfader:
206 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
207
208#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
209
210struct hdspm_channelfader {
211 unsigned int in[HDSPM_MIXER_CHANNELS];
212 unsigned int pb[HDSPM_MIXER_CHANNELS];
213};
214
215struct hdspm_mixer {
216 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
217};
218
219struct hdspm_mixer_ioctl {
220 struct hdspm_mixer *mixer;
221};
222
223/* use indirect access due to the limit of ioctl bit size */
224#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
225
226#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sb16_csp.h created+123
...@@ -0,0 +1,123 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
4 * Takashi Iwai <tiwai@suse.de>
5 *
6 * SB16ASP/AWE32 CSP control
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_SB16_CSP_H
24#define __SOUND_SB16_CSP_H
25
26
27/* CSP modes */
28#define SNDRV_SB_CSP_MODE_NONE 0x00
29#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
30#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
31#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
32
33/* CSP load flags */
34#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
35#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
36
37/* CSP sample width */
38#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
39#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
40
41/* CSP channels */
42#define SNDRV_SB_CSP_MONO 0x01
43#define SNDRV_SB_CSP_STEREO 0x02
44
45/* CSP rates */
46#define SNDRV_SB_CSP_RATE_8000 0x01
47#define SNDRV_SB_CSP_RATE_11025 0x02
48#define SNDRV_SB_CSP_RATE_22050 0x04
49#define SNDRV_SB_CSP_RATE_44100 0x08
50#define SNDRV_SB_CSP_RATE_ALL 0x0f
51
52/* CSP running state */
53#define SNDRV_SB_CSP_ST_IDLE 0x00
54#define SNDRV_SB_CSP_ST_LOADED 0x01
55#define SNDRV_SB_CSP_ST_RUNNING 0x02
56#define SNDRV_SB_CSP_ST_PAUSED 0x04
57#define SNDRV_SB_CSP_ST_AUTO 0x08
58#define SNDRV_SB_CSP_ST_QSOUND 0x10
59
60/* maximum QSound value (180 degrees right) */
61#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
62
63/* maximum microcode RIFF file size */
64#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
65
66/* microcode header */
67struct snd_sb_csp_mc_header {
68 char codec_name[16]; /* id name of codec */
69 unsigned short func_req; /* requested function */
70};
71
72/* microcode to be loaded */
73struct snd_sb_csp_microcode {
74 struct snd_sb_csp_mc_header info;
75 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
76};
77
78/* start CSP with sample_width in mono/stereo */
79struct snd_sb_csp_start {
80 int sample_width; /* sample width, look above */
81 int channels; /* channels, look above */
82};
83
84/* CSP information */
85struct snd_sb_csp_info {
86 char codec_name[16]; /* id name of codec */
87 unsigned short func_nr; /* function number */
88 unsigned int acc_format; /* accepted PCM formats */
89 unsigned short acc_channels; /* accepted channels */
90 unsigned short acc_width; /* accepted sample width */
91 unsigned short acc_rates; /* accepted sample rates */
92 unsigned short csp_mode; /* CSP mode, see above */
93 unsigned short run_channels; /* current channels */
94 unsigned short run_width; /* current sample width */
95 unsigned short version; /* version id: 0x10 - 0x1f */
96 unsigned short state; /* state bits */
97};
98
99/* HWDEP controls */
100/* get CSP information */
101#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
102/* load microcode to CSP */
103/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
104 * defined for some architectures like MIPS, and it leads to build errors.
105 * (x86 and co have 14-bit size, thus it's valid, though.)
106 * As a workaround for skipping the size-limit check, here we don't use the
107 * normal _IOW() macro but _IOC() with the manual argument.
108 */
109#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
110 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
111/* unload microcode from CSP */
112#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
113/* start CSP */
114#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
115/* stop CSP */
116#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
117/* pause CSP and DMA transfer */
118#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
119/* restart CSP and DMA transfer */
120#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
121
122
123#endif /* __SOUND_SB16_CSP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sfnt_info.h created+213
...@@ -0,0 +1,213 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_SFNT_INFO_H
3#define __SOUND_SFNT_INFO_H
4
5/*
6 * Patch record compatible with AWE driver on OSS
7 *
8 * Copyright (C) 1999-2000 Takashi Iwai
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#include <sound/asound.h>
27
28/*
29 * patch information record
30 */
31
32#ifdef SNDRV_BIG_ENDIAN
33#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
34#else
35#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
36#endif
37
38/* patch interface header: 16 bytes */
39struct soundfont_patch_info {
40 unsigned short key; /* use the key below */
41#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
42
43 short device_no; /* synthesizer number */
44 unsigned short sf_id; /* file id (should be zero) */
45 short optarg; /* optional argument */
46 int len; /* data length (without this header) */
47
48 short type; /* patch operation type */
49#define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */
50#define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */
51#define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */
52#define SNDRV_SFNT_CLOSE_PATCH 3 /* none */
53 /* 4 is obsolete */
54#define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/
55#define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */
56 /* 7 is not used */
57#define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */
58#define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */
59
60 short reserved; /* word alignment data */
61
62 /* the actual patch data begins after this */
63};
64
65
66/*
67 * open patch
68 */
69
70#define SNDRV_SFNT_PATCH_NAME_LEN 32
71
72struct soundfont_open_parm {
73 unsigned short type; /* sample type */
74#define SNDRV_SFNT_PAT_TYPE_MISC 0
75#define SNDRV_SFNT_PAT_TYPE_GUS 6
76#define SNDRV_SFNT_PAT_TYPE_MAP 7
77#define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */
78#define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */
79
80 short reserved;
81 char name[SNDRV_SFNT_PATCH_NAME_LEN];
82};
83
84
85/*
86 * raw voice information record
87 */
88
89/* wave table envelope & effect parameters to control EMU8000 */
90struct soundfont_voice_parm {
91 unsigned short moddelay; /* modulation delay (0x8000) */
92 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
93 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
94 unsigned short modrelease; /* modulation release time (0x807f) */
95 short modkeyhold, modkeydecay; /* envelope change per key (not used) */
96 unsigned short voldelay; /* volume delay (0x8000) */
97 unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */
98 unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */
99 unsigned short volrelease; /* volume release time (0x807f) */
100 short volkeyhold, volkeydecay; /* envelope change per key (not used) */
101 unsigned short lfo1delay; /* LFO1 delay (0x8000) */
102 unsigned short lfo2delay; /* LFO2 delay (0x8000) */
103 unsigned short pefe; /* modulation pitch & cutoff (0x0000) */
104 unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */
105 unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */
106 unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */
107 unsigned char cutoff; /* initial cutoff (0xff) */
108 unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
109 unsigned char chorus; /* chorus send (0x00) */
110 unsigned char reverb; /* reverb send (0x00) */
111 unsigned short reserved[4]; /* not used */
112};
113
114
115/* wave table parameters: 92 bytes */
116struct soundfont_voice_info {
117 unsigned short sf_id; /* file id (should be zero) */
118 unsigned short sample; /* sample id */
119 int start, end; /* sample offset correction */
120 int loopstart, loopend; /* loop offset correction */
121 short rate_offset; /* sample rate pitch offset */
122 unsigned short mode; /* sample mode */
123#define SNDRV_SFNT_MODE_ROMSOUND 0x8000
124#define SNDRV_SFNT_MODE_STEREO 1
125#define SNDRV_SFNT_MODE_LOOPING 2
126#define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */
127#define SNDRV_SFNT_MODE_INIT_PARM 8
128
129 short root; /* midi root key */
130 short tune; /* pitch tuning (in cents) */
131 unsigned char low, high; /* key note range */
132 unsigned char vellow, velhigh; /* velocity range */
133 signed char fixkey, fixvel; /* fixed key, velocity */
134 signed char pan, fixpan; /* panning, fixed panning */
135 short exclusiveClass; /* exclusive class (0 = none) */
136 unsigned char amplitude; /* sample volume (127 max) */
137 unsigned char attenuation; /* attenuation (0.375dB) */
138 short scaleTuning; /* pitch scale tuning(%), normally 100 */
139 struct soundfont_voice_parm parm; /* voice envelope parameters */
140 unsigned short sample_mode; /* sample mode_flag (set by driver) */
141};
142
143
144/* instrument info header: 4 bytes */
145struct soundfont_voice_rec_hdr {
146 unsigned char bank; /* midi bank number */
147 unsigned char instr; /* midi preset number */
148 char nvoices; /* number of voices */
149 char write_mode; /* write mode; normally 0 */
150#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
151#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
152#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
153};
154
155
156/*
157 * sample wave information
158 */
159
160/* wave table sample header: 32 bytes */
161struct soundfont_sample_info {
162 unsigned short sf_id; /* file id (should be zero) */
163 unsigned short sample; /* sample id */
164 int start, end; /* start & end offset */
165 int loopstart, loopend; /* loop start & end offset */
166 int size; /* size (0 = ROM) */
167 short dummy; /* not used */
168 unsigned short mode_flags; /* mode flags */
169#define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */
170#define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */
171#define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */
172#define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */
173#define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */
174#define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */
175#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
176#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
177 unsigned int truesize; /* used memory size (set by driver) */
178};
179
180
181/*
182 * voice preset mapping (aliasing)
183 */
184
185struct soundfont_voice_map {
186 int map_bank, map_instr, map_key; /* key = -1 means all keys */
187 int src_bank, src_instr, src_key;
188};
189
190
191/*
192 * ioctls for hwdep
193 */
194
195#define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable"
196
197#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
198
199struct snd_emux_misc_mode {
200 int port; /* -1 = all */
201 int mode;
202 int value;
203 int value2; /* reserved */
204};
205
206#define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int)
207#define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info)
208#define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82)
209#define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83)
210#define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int)
211#define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode)
212
213#endif /* __SOUND_SFNT_INFO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/skl-tplg-interface.h created+241
...@@ -0,0 +1,241 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * skl-tplg-interface.h - Intel DSP FW private data interface
4 *
5 * Copyright (C) 2015 Intel Corp
6 * Author: Jeeja KP <jeeja.kp@intel.com>
7 * Nilofer, Samreen <samreen.nilofer@intel.com>
8 */
9
10#ifndef __HDA_TPLG_INTERFACE_H__
11#define __HDA_TPLG_INTERFACE_H__
12
13#include <linux/types.h>
14
15/*
16 * Default types range from 0~12. type can range from 0 to 0xff
17 * SST types start at higher to avoid any overlapping in future
18 */
19#define SKL_CONTROL_TYPE_BYTE_TLV 0x100
20#define SKL_CONTROL_TYPE_MIC_SELECT 0x102
21#define SKL_CONTROL_TYPE_MULTI_IO_SELECT 0x103
22#define SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC 0x104
23
24#define HDA_SST_CFG_MAX 900 /* size of copier cfg*/
25#define MAX_IN_QUEUE 8
26#define MAX_OUT_QUEUE 8
27
28#define SKL_UUID_STR_SZ 40
29/* Event types goes here */
30/* Reserve event type 0 for no event handlers */
31enum skl_event_types {
32 SKL_EVENT_NONE = 0,
33 SKL_MIXER_EVENT,
34 SKL_MUX_EVENT,
35 SKL_VMIXER_EVENT,
36 SKL_PGA_EVENT
37};
38
39/**
40 * enum skl_ch_cfg - channel configuration
41 *
42 * @SKL_CH_CFG_MONO: One channel only
43 * @SKL_CH_CFG_STEREO: L & R
44 * @SKL_CH_CFG_2_1: L, R & LFE
45 * @SKL_CH_CFG_3_0: L, C & R
46 * @SKL_CH_CFG_3_1: L, C, R & LFE
47 * @SKL_CH_CFG_QUATRO: L, R, Ls & Rs
48 * @SKL_CH_CFG_4_0: L, C, R & Cs
49 * @SKL_CH_CFG_5_0: L, C, R, Ls & Rs
50 * @SKL_CH_CFG_5_1: L, C, R, Ls, Rs & LFE
51 * @SKL_CH_CFG_DUAL_MONO: One channel replicated in two
52 * @SKL_CH_CFG_I2S_DUAL_STEREO_0: Stereo(L,R) in 4 slots, 1st stream:[ L, R, -, - ]
53 * @SKL_CH_CFG_I2S_DUAL_STEREO_1: Stereo(L,R) in 4 slots, 2nd stream:[ -, -, L, R ]
54 * @SKL_CH_CFG_INVALID: Invalid
55 */
56enum skl_ch_cfg {
57 SKL_CH_CFG_MONO = 0,
58 SKL_CH_CFG_STEREO = 1,
59 SKL_CH_CFG_2_1 = 2,
60 SKL_CH_CFG_3_0 = 3,
61 SKL_CH_CFG_3_1 = 4,
62 SKL_CH_CFG_QUATRO = 5,
63 SKL_CH_CFG_4_0 = 6,
64 SKL_CH_CFG_5_0 = 7,
65 SKL_CH_CFG_5_1 = 8,
66 SKL_CH_CFG_DUAL_MONO = 9,
67 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
68 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
69 SKL_CH_CFG_4_CHANNEL = 12,
70 SKL_CH_CFG_INVALID
71};
72
73enum skl_module_type {
74 SKL_MODULE_TYPE_MIXER = 0,
75 SKL_MODULE_TYPE_COPIER,
76 SKL_MODULE_TYPE_UPDWMIX,
77 SKL_MODULE_TYPE_SRCINT,
78 SKL_MODULE_TYPE_ALGO,
79 SKL_MODULE_TYPE_BASE_OUTFMT,
80 SKL_MODULE_TYPE_KPB,
81 SKL_MODULE_TYPE_MIC_SELECT,
82};
83
84enum skl_core_affinity {
85 SKL_AFFINITY_CORE_0 = 0,
86 SKL_AFFINITY_CORE_1,
87 SKL_AFFINITY_CORE_MAX
88};
89
90enum skl_pipe_conn_type {
91 SKL_PIPE_CONN_TYPE_NONE = 0,
92 SKL_PIPE_CONN_TYPE_FE,
93 SKL_PIPE_CONN_TYPE_BE
94};
95
96enum skl_hw_conn_type {
97 SKL_CONN_NONE = 0,
98 SKL_CONN_SOURCE = 1,
99 SKL_CONN_SINK = 2
100};
101
102enum skl_dev_type {
103 SKL_DEVICE_BT = 0x0,
104 SKL_DEVICE_DMIC = 0x1,
105 SKL_DEVICE_I2S = 0x2,
106 SKL_DEVICE_SLIMBUS = 0x3,
107 SKL_DEVICE_HDALINK = 0x4,
108 SKL_DEVICE_HDAHOST = 0x5,
109 SKL_DEVICE_NONE
110};
111
112/**
113 * enum skl_interleaving - interleaving style
114 *
115 * @SKL_INTERLEAVING_PER_CHANNEL: [s1_ch1...s1_chN,...,sM_ch1...sM_chN]
116 * @SKL_INTERLEAVING_PER_SAMPLE: [s1_ch1...sM_ch1,...,s1_chN...sM_chN]
117 */
118enum skl_interleaving {
119 SKL_INTERLEAVING_PER_CHANNEL = 0,
120 SKL_INTERLEAVING_PER_SAMPLE = 1,
121};
122
123enum skl_sample_type {
124 SKL_SAMPLE_TYPE_INT_MSB = 0,
125 SKL_SAMPLE_TYPE_INT_LSB = 1,
126 SKL_SAMPLE_TYPE_INT_SIGNED = 2,
127 SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
128 SKL_SAMPLE_TYPE_FLOAT = 4
129};
130
131enum module_pin_type {
132 /* All pins of the module takes same PCM inputs or outputs
133 * e.g. mixout
134 */
135 SKL_PIN_TYPE_HOMOGENEOUS,
136 /* All pins of the module takes different PCM inputs or outputs
137 * e.g mux
138 */
139 SKL_PIN_TYPE_HETEROGENEOUS,
140};
141
142enum skl_module_param_type {
143 SKL_PARAM_DEFAULT = 0,
144 SKL_PARAM_INIT,
145 SKL_PARAM_SET,
146 SKL_PARAM_BIND
147};
148
149struct skl_dfw_algo_data {
150 __u32 set_params:2;
151 __u32 rsvd:30;
152 __u32 param_id;
153 __u32 max;
154 char params[0];
155} __attribute__((packed));
156
157enum skl_tkn_dir {
158 SKL_DIR_IN,
159 SKL_DIR_OUT
160};
161
162enum skl_tuple_type {
163 SKL_TYPE_TUPLE,
164 SKL_TYPE_DATA
165};
166
167/* v4 configuration data */
168
169struct skl_dfw_v4_module_pin {
170 __u16 module_id;
171 __u16 instance_id;
172} __attribute__((packed));
173
174struct skl_dfw_v4_module_fmt {
175 __u32 channels;
176 __u32 freq;
177 __u32 bit_depth;
178 __u32 valid_bit_depth;
179 __u32 ch_cfg;
180 __u32 interleaving_style;
181 __u32 sample_type;
182 __u32 ch_map;
183} __attribute__((packed));
184
185struct skl_dfw_v4_module_caps {
186 __u32 set_params:2;
187 __u32 rsvd:30;
188 __u32 param_id;
189 __u32 caps_size;
190 __u32 caps[HDA_SST_CFG_MAX];
191} __attribute__((packed));
192
193struct skl_dfw_v4_pipe {
194 __u8 pipe_id;
195 __u8 pipe_priority;
196 __u16 conn_type:4;
197 __u16 rsvd:4;
198 __u16 memory_pages:8;
199} __attribute__((packed));
200
201struct skl_dfw_v4_module {
202 char uuid[SKL_UUID_STR_SZ];
203
204 __u16 module_id;
205 __u16 instance_id;
206 __u32 max_mcps;
207 __u32 mem_pages;
208 __u32 obs;
209 __u32 ibs;
210 __u32 vbus_id;
211
212 __u32 max_in_queue:8;
213 __u32 max_out_queue:8;
214 __u32 time_slot:8;
215 __u32 core_id:4;
216 __u32 rsvd1:4;
217
218 __u32 module_type:8;
219 __u32 conn_type:4;
220 __u32 dev_type:4;
221 __u32 hw_conn_type:4;
222 __u32 rsvd2:12;
223
224 __u32 params_fixup:8;
225 __u32 converter:8;
226 __u32 input_pin_type:1;
227 __u32 output_pin_type:1;
228 __u32 is_dynamic_in_pin:1;
229 __u32 is_dynamic_out_pin:1;
230 __u32 is_loadable:1;
231 __u32 rsvd3:11;
232
233 struct skl_dfw_v4_pipe pipe;
234 struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
235 struct skl_dfw_v4_module_fmt out_fmt[MAX_OUT_QUEUE];
236 struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
237 struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
238 struct skl_dfw_v4_module_caps caps;
239} __attribute__((packed));
240
241#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/snd_ar_tokens.h created+208
...@@ -0,0 +1,208 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __SND_AR_TOKENS_H__
4#define __SND_AR_TOKENS_H__
5
6#define APM_SUB_GRAPH_PERF_MODE_LOW_POWER 0x1
7#define APM_SUB_GRAPH_PERF_MODE_LOW_LATENCY 0x2
8
9#define APM_SUB_GRAPH_DIRECTION_TX 0x1
10#define APM_SUB_GRAPH_DIRECTION_RX 0x2
11
12/** Scenario ID Audio Playback */
13#define APM_SUB_GRAPH_SID_AUDIO_PLAYBACK 0x1
14/* Scenario ID Audio Record */
15#define APM_SUB_GRAPH_SID_AUDIO_RECORD 0x2
16/* Scenario ID Voice call. */
17#define APM_SUB_GRAPH_SID_VOICE_CALL 0x3
18
19/* container capability ID Pre/Post Processing (PP) */
20#define APM_CONTAINER_CAP_ID_PP 0x1
21/* container capability ID Compression/Decompression (CD) */
22#define APM_CONTAINER_CAP_ID_CD 0x2
23/* container capability ID End Point(EP) */
24#define APM_CONTAINER_CAP_ID_EP 0x3
25/* container capability ID Offload (OLC) */
26#define APM_CONTAINER_CAP_ID_OLC 0x4
27
28/* container graph position Stream */
29#define APM_CONT_GRAPH_POS_STREAM 0x1
30/* container graph position Per Stream Per Device*/
31#define APM_CONT_GRAPH_POS_PER_STR_PER_DEV 0x2
32/* container graph position Stream-Device */
33#define APM_CONT_GRAPH_POS_STR_DEV 0x3
34/* container graph position Global Device */
35#define APM_CONT_GRAPH_POS_GLOBAL_DEV 0x4
36
37#define APM_PROC_DOMAIN_ID_MDSP 0x1
38#define APM_PROC_DOMAIN_ID_ADSP 0x2
39#define APM_PROC_DOMAIN_ID_SDSP 0x4
40#define APM_PROC_DOMAIN_ID_CDSP 0x5
41
42#define PCM_INTERLEAVED 1
43#define PCM_DEINTERLEAVED_PACKED 2
44#define PCM_DEINTERLEAVED_UNPACKED 3
45#define AR_I2S_WS_SRC_EXTERNAL 0
46#define AR_I2S_WS_SRC_INTERNAL 1
47
48enum ar_event_types {
49 AR_EVENT_NONE = 0,
50 AR_PGA_DAPM_EVENT
51};
52
53/*
54 * Kcontrol IDs
55 */
56#define SND_SOC_AR_TPLG_FE_BE_GRAPH_CTL_MIX 256
57#define SND_SOC_AR_TPLG_VOL_CTL 257
58
59/**
60 * %AR_TKN_U32_SUB_GRAPH_INSTANCE_ID: Sub Graph Instance Id
61 *
62 * %AR_TKN_U32_SUB_GRAPH_PERF_MODE: Performance mode of subgraph
63 * APM_SUB_GRAPH_PERF_MODE_LOW_POWER = 1,
64 * APM_SUB_GRAPH_PERF_MODE_LOW_LATENCY = 2
65 *
66 * %AR_TKN_U32_SUB_GRAPH_DIRECTION: Direction of subgraph
67 * APM_SUB_GRAPH_DIRECTION_TX = 1,
68 * APM_SUB_GRAPH_DIRECTION_RX = 2
69 *
70 * %AR_TKN_U32_SUB_GRAPH_SCENARIO_ID: Scenario ID for subgraph
71 * APM_SUB_GRAPH_SID_AUDIO_PLAYBACK = 1,
72 * APM_SUB_GRAPH_SID_AUDIO_RECORD = 2,
73 * APM_SUB_GRAPH_SID_VOICE_CALL = 3
74 *
75 * %AR_TKN_U32_CONTAINER_INSTANCE_ID: Container Instance ID
76 *
77 * %AR_TKN_U32_CONTAINER_CAPABILITY_ID: Container capability ID
78 * APM_CONTAINER_CAP_ID_PP = 1,
79 * APM_CONTAINER_CAP_ID_CD = 2,
80 * APM_CONTAINER_CAP_ID_EP = 3,
81 * APM_CONTAINER_CAP_ID_OLC = 4
82 *
83 * %AR_TKN_U32_CONTAINER_STACK_SIZE: Stack size in the container.
84 *
85 * %AR_TKN_U32_CONTAINER_GRAPH_POS: Graph Position
86 * APM_CONT_GRAPH_POS_STREAM = 1,
87 * APM_CONT_GRAPH_POS_PER_STR_PER_DEV = 2,
88 * APM_CONT_GRAPH_POS_STR_DEV = 3,
89 * APM_CONT_GRAPH_POS_GLOBAL_DEV = 4
90 *
91 * %AR_TKN_U32_CONTAINER_PROC_DOMAIN: Processor domain of container
92 * APM_PROC_DOMAIN_ID_MDSP = 1,
93 * APM_PROC_DOMAIN_ID_ADSP = 2,
94 * APM_PROC_DOMAIN_ID_SDSP = 4,
95 * APM_PROC_DOMAIN_ID_CDSP = 5
96 *
97 * %AR_TKN_U32_MODULE_ID: Module ID
98 *
99 * %AR_TKN_U32_MODULE_INSTANCE_ID: Module Instance ID.
100 *
101 * %AR_TKN_U32_MODULE_MAX_IP_PORTS: Module maximum input ports
102 *
103 * %AR_TKN_U32_MODULE_MAX_OP_PORTS: Module maximum output ports.
104 *
105 * %AR_TKN_U32_MODULE_IN_PORTS: Number of in ports
106 *
107 * %AR_TKN_U32_MODULE_OUT_PORTS: Number of out ports.
108 *
109 * %AR_TKN_U32_MODULE_SRC_OP_PORT_ID: Source module output port ID
110 *
111 * %AR_TKN_U32_MODULE_DST_IN_PORT_ID: Destination module input port ID
112 *
113 * %AR_TKN_U32_MODULE_HW_IF_IDX: Interface index types for I2S/LPAIF
114 *
115 * %AR_TKN_U32_MODULE_HW_IF_TYPE: Interface type
116 * LPAIF = 0,
117 * LPAIF_RXTX = 1,
118 * LPAIF_WSA = 2,
119 * LPAIF_VA = 3,
120 * LPAIF_AXI = 4
121 *
122 * %AR_TKN_U32_MODULE_FMT_INTERLEAVE: PCM Interleaving
123 * PCM_INTERLEAVED = 1,
124 * PCM_DEINTERLEAVED_PACKED = 2,
125 * PCM_DEINTERLEAVED_UNPACKED = 3
126 *
127 * %AR_TKN_U32_MODULE_FMT_DATA: data format
128 * FIXED POINT = 1,
129 * IEC60958 PACKETIZED = 3,
130 * IEC60958 PACKETIZED NON LINEAR = 8,
131 * COMPR OVER PCM PACKETIZED = 7,
132 * IEC61937 PACKETIZED = 2,
133 * GENERIC COMPRESSED = 5
134 *
135 * %AR_TKN_U32_MODULE_FMT_SAMPLE_RATE: sample rate
136 *
137 * %AR_TKN_U32_MODULE_FMT_BIT_DEPTH: bit depth
138 *
139 * %AR_TKN_U32_MODULE_SD_LINE_IDX: I2S serial data line idx
140 * I2S_SD0 = 1,
141 * I2S_SD1 = 2,
142 * I2S_SD2 = 3,
143 * I2S_SD3 = 4,
144 * I2S_QUAD01 = 5,
145 * I2S_QUAD23 = 6,
146 * I2S_6CHS = 7,
147 * I2S_8CHS = 8
148 *
149 * %AR_TKN_U32_MODULE_WS_SRC: Word Select Source
150 * AR_I2S_WS_SRC_EXTERNAL = 0,
151 * AR_I2S_WS_SRC_INTERNAL = 1,
152 *
153 * %AR_TKN_U32_MODULE_FRAME_SZ_FACTOR: Frame size factor
154 *
155 * %AR_TKN_U32_MODULE_LOG_CODE: Log Module Code
156 *
157 * %AR_TKN_U32_MODULE_LOG_TAP_POINT_ID: logging tap point of this module
158 *
159 * %AR_TKN_U32_MODULE_LOG_MODE: logging mode
160 * LOG_WAIT = 0,
161 * LOG_IMMEDIATELY = 1
162 *
163 * %AR_TKN_DAI_INDEX: dai index
164 *
165 */
166
167/* DAI Tokens */
168#define AR_TKN_DAI_INDEX 1
169/* SUB GRAPH Tokens */
170#define AR_TKN_U32_SUB_GRAPH_INSTANCE_ID 2
171#define AR_TKN_U32_SUB_GRAPH_PERF_MODE 3
172#define AR_TKN_U32_SUB_GRAPH_DIRECTION 4
173#define AR_TKN_U32_SUB_GRAPH_SCENARIO_ID 5
174
175/* Container Tokens */
176#define AR_TKN_U32_CONTAINER_INSTANCE_ID 100
177#define AR_TKN_U32_CONTAINER_CAPABILITY_ID 101
178#define AR_TKN_U32_CONTAINER_STACK_SIZE 102
179#define AR_TKN_U32_CONTAINER_GRAPH_POS 103
180#define AR_TKN_U32_CONTAINER_PROC_DOMAIN 104
181
182/* Module Tokens */
183#define AR_TKN_U32_MODULE_ID 200
184#define AR_TKN_U32_MODULE_INSTANCE_ID 201
185#define AR_TKN_U32_MODULE_MAX_IP_PORTS 202
186#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
189#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID 206
190#define AR_TKN_U32_MODULE_DST_IN_PORT_ID 207
191#define AR_TKN_U32_MODULE_SRC_INSTANCE_ID 208
192#define AR_TKN_U32_MODULE_DST_INSTANCE_ID 209
193
194
195#define AR_TKN_U32_MODULE_HW_IF_IDX 250
196#define AR_TKN_U32_MODULE_HW_IF_TYPE 251
197#define AR_TKN_U32_MODULE_FMT_INTERLEAVE 252
198#define AR_TKN_U32_MODULE_FMT_DATA 253
199#define AR_TKN_U32_MODULE_FMT_SAMPLE_RATE 254
200#define AR_TKN_U32_MODULE_FMT_BIT_DEPTH 255
201#define AR_TKN_U32_MODULE_SD_LINE_IDX 256
202#define AR_TKN_U32_MODULE_WS_SRC 257
203#define AR_TKN_U32_MODULE_FRAME_SZ_FACTOR 258
204#define AR_TKN_U32_MODULE_LOG_CODE 259
205#define AR_TKN_U32_MODULE_LOG_TAP_POINT_ID 260
206#define AR_TKN_U32_MODULE_LOG_MODE 261
207
208#endif /* __SND_AR_TOKENS_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/snd_sst_tokens.h created+334
...@@ -0,0 +1,334 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * snd_sst_tokens.h - Intel SST tokens definition
4 *
5 * Copyright (C) 2016 Intel Corp
6 * Author: Shreyas NC <shreyas.nc@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18#ifndef __SND_SST_TOKENS_H__
19#define __SND_SST_TOKENS_H__
20
21/**
22 * %SKL_TKN_UUID: Module UUID
23 *
24 * %SKL_TKN_U8_BLOCK_TYPE: Type of the private data block.Can be:
25 * tuples, bytes, short and words
26 *
27 * %SKL_TKN_U8_IN_PIN_TYPE: Input pin type,
28 * homogenous=0, heterogenous=1
29 *
30 * %SKL_TKN_U8_OUT_PIN_TYPE: Output pin type,
31 * homogenous=0, heterogenous=1
32 * %SKL_TKN_U8_DYN_IN_PIN: Configure Input pin dynamically
33 * if true
34 *
35 * %SKL_TKN_U8_DYN_OUT_PIN: Configure Output pin dynamically
36 * if true
37 *
38 * %SKL_TKN_U8_IN_QUEUE_COUNT: Store the number of Input pins
39 *
40 * %SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
41 *
42 * %SKL_TKN_U8_TIME_SLOT: TDM slot number
43 *
44 * %SKL_TKN_U8_CORE_ID: Stores module affinity value.Can take
45 * the values:
46 * SKL_AFFINITY_CORE_0 = 0,
47 * SKL_AFFINITY_CORE_1,
48 * SKL_AFFINITY_CORE_MAX
49 *
50 * %SKL_TKN_U8_MOD_TYPE: Module type value.
51 *
52 * %SKL_TKN_U8_CONN_TYPE: Module connection type can be a FE,
53 * BE or NONE as defined :
54 * SKL_PIPE_CONN_TYPE_NONE = 0,
55 * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA)
56 * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA)
57 *
58 * %SKL_TKN_U8_DEV_TYPE: Type of device to which the module is
59 * connected
60 * Can take the values:
61 * SKL_DEVICE_BT = 0x0,
62 * SKL_DEVICE_DMIC = 0x1,
63 * SKL_DEVICE_I2S = 0x2,
64 * SKL_DEVICE_SLIMBUS = 0x3,
65 * SKL_DEVICE_HDALINK = 0x4,
66 * SKL_DEVICE_HDAHOST = 0x5,
67 * SKL_DEVICE_NONE
68 *
69 * %SKL_TKN_U8_HW_CONN_TYPE: Connection type of the HW to which the
70 * module is connected
71 * SKL_CONN_NONE = 0,
72 * SKL_CONN_SOURCE = 1,
73 * SKL_CONN_SINK = 2
74 *
75 * %SKL_TKN_U16_PIN_INST_ID: Stores the pin instance id
76 *
77 * %SKL_TKN_U16_MOD_INST_ID: Stores the mdule instance id
78 *
79 * %SKL_TKN_U32_MAX_MCPS: Module max mcps value
80 *
81 * %SKL_TKN_U32_MEM_PAGES: Module resource pages
82 *
83 * %SKL_TKN_U32_OBS: Stores Output Buffer size
84 *
85 * %SKL_TKN_U32_IBS: Stores input buffer size
86 *
87 * %SKL_TKN_U32_VBUS_ID: Module VBUS_ID. PDM=0, SSP0=0,
88 * SSP1=1,SSP2=2,
89 * SSP3=3, SSP4=4,
90 * SSP5=5, SSP6=6,INVALID
91 *
92 * %SKL_TKN_U32_PARAMS_FIXUP: Module Params fixup mask
93 * %SKL_TKN_U32_CONVERTER: Module params converter mask
94 * %SKL_TKN_U32_PIPE_ID: Stores the pipe id
95 *
96 * %SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
97 * connected to. It can be
98 * SKL_PIPE_CONN_TYPE_NONE = 0,
99 * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA),
100 * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA),
101 *
102 * %SKL_TKN_U32_PIPE_PRIORITY: Pipe priority value
103 * %SKL_TKN_U32_PIPE_MEM_PGS: Pipe resource pages
104 *
105 * %SKL_TKN_U32_DIR_PIN_COUNT: Value for the direction to set input/output
106 * formats and the pin count.
107 * The first 4 bits have the direction
108 * value and the next 4 have
109 * the pin count value.
110 * SKL_DIR_IN = 0, SKL_DIR_OUT = 1.
111 * The input and output formats
112 * share the same set of tokens
113 * with the distinction between input
114 * and output made by reading direction
115 * token.
116 *
117 * %SKL_TKN_U32_FMT_CH: Supported channel count
118 *
119 * %SKL_TKN_U32_FMT_FREQ: Supported frequency/sample rate
120 *
121 * %SKL_TKN_U32_FMT_BIT_DEPTH: Supported container size
122 *
123 * %SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
124 *
125 * %SKL_TKN_U32_FMT_CH_CONFIG: Supported channel configurations for the
126 * input/output.
127 *
128 * %SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
129 * channel or per sample. The values can be :
130 * SKL_INTERLEAVING_PER_CHANNEL = 0,
131 * SKL_INTERLEAVING_PER_SAMPLE = 1,
132 *
133 * %SKL_TKN_U32_FMT_SAMPLE_TYPE:
134 * Specifies the sample type. Can take the
135 * values: SKL_SAMPLE_TYPE_INT_MSB = 0,
136 * SKL_SAMPLE_TYPE_INT_LSB = 1,
137 * SKL_SAMPLE_TYPE_INT_SIGNED = 2,
138 * SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
139 * SKL_SAMPLE_TYPE_FLOAT = 4
140 *
141 * %SKL_TKN_U32_CH_MAP: Channel map values
142 * %SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
143 * SKL_PARAM_DEFAULT, SKL_PARAM_INIT,
144 * SKL_PARAM_SET, SKL_PARAM_BIND
145 *
146 * %SKL_TKN_U32_MOD_PARAM_ID: ID of the module params
147 *
148 * %SKL_TKN_U32_CAPS_SET_PARAMS:
149 * Set params value
150 *
151 * %SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
152 *
153 * %SKL_TKN_U32_CAPS_SIZE: Caps size
154 *
155 * %SKL_TKN_U32_PROC_DOMAIN: Specify processing domain
156 *
157 * %SKL_TKN_U32_LIB_COUNT: Specifies the number of libraries
158 *
159 * %SKL_TKN_STR_LIB_NAME: Specifies the library name
160 *
161 * %SKL_TKN_U32_PMODE: Specifies the power mode for pipe
162 *
163 * %SKL_TKL_U32_D0I3_CAPS: Specifies the D0i3 capability for module
164 *
165 * %SKL_TKN_U32_DMA_BUF_SIZE: DMA buffer size in millisec
166 *
167 * %SKL_TKN_U32_PIPE_DIR: Specifies pipe direction. Can be
168 * playback/capture.
169 *
170 * %SKL_TKN_U32_NUM_CONFIGS: Number of pipe configs
171 *
172 * %SKL_TKN_U32_PATH_MEM_PGS: Size of memory (in pages) required for pipeline
173 * and its data
174 *
175 * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
176 * and PCM params supported by that pipe
177 * config. This is used as index to fill
178 * up the pipe config and module config
179 * structure.
180 *
181 * %SKL_TKN_U32_CFG_FREQ:
182 * %SKL_TKN_U8_CFG_CHAN:
183 * %SKL_TKN_U8_CFG_BPS: PCM params (freq, channels, bits per sample)
184 * supported for each of the pipe configs.
185 *
186 * %SKL_TKN_CFG_MOD_RES_ID: Module's resource index for each of the
187 * pipe config
188 *
189 * %SKL_TKN_CFG_MOD_FMT_ID: Module's interface index for each of the
190 * pipe config
191 *
192 * %SKL_TKN_U8_NUM_MOD: Number of modules in the manifest
193 *
194 * %SKL_TKN_MM_U8_MOD_IDX: Current index of the module in the manifest
195 *
196 * %SKL_TKN_MM_U8_NUM_RES: Number of resources for the module
197 *
198 * %SKL_TKN_MM_U8_NUM_INTF: Number of interfaces for the module
199 *
200 * %SKL_TKN_MM_U32_RES_ID: Resource index for the resource info to
201 * be filled into.
202 * A module can support multiple resource
203 * configuration and is represnted as a
204 * resource table. This index is used to
205 * fill information into appropriate index.
206 *
207 * %SKL_TKN_MM_U32_CPS: DSP cycles per second
208 *
209 * %SKL_TKN_MM_U32_DMA_SIZE: Allocated buffer size for gateway DMA
210 *
211 * %SKL_TKN_MM_U32_CPC: DSP cycles allocated per frame
212 *
213 * %SKL_TKN_MM_U32_RES_PIN_ID: Resource pin index in the module
214 *
215 * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
216 *
217 * %SKL_TKN_MM_U32_PIN_BUF: Buffer size of the module pin
218 *
219 * %SKL_TKN_MM_U32_FMT_ID: Format index for each of the interface/
220 * format information to be filled into.
221 *
222 * %SKL_TKN_MM_U32_NUM_IN_FMT: Number of input formats
223 * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
224 *
225 * %SKL_TKN_U32_ASTATE_IDX: Table Index for the A-State entry to be filled
226 * with kcps and clock source
227 *
228 * %SKL_TKN_U32_ASTATE_COUNT: Number of valid entries in A-State table
229 *
230 * %SKL_TKN_U32_ASTATE_KCPS: Specifies the core load threshold (in kilo
231 * cycles per second) below which DSP is clocked
232 * from source specified by clock source.
233 *
234 * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
235 *
236 * %SKL_TKN_U32_FMT_CFG_IDX: Format config index
237 *
238 * module_id and loadable flags dont have tokens as these values will be
239 * read from the DSP FW manifest
240 *
241 * Tokens defined can be used either in the manifest or widget private data.
242 *
243 * SKL_TKN_MM is used as a suffix for all tokens that represent
244 * module data in the manifest.
245 */
246enum SKL_TKNS {
247 SKL_TKN_UUID = 1,
248 SKL_TKN_U8_NUM_BLOCKS,
249 SKL_TKN_U8_BLOCK_TYPE,
250 SKL_TKN_U8_IN_PIN_TYPE,
251 SKL_TKN_U8_OUT_PIN_TYPE,
252 SKL_TKN_U8_DYN_IN_PIN,
253 SKL_TKN_U8_DYN_OUT_PIN,
254 SKL_TKN_U8_IN_QUEUE_COUNT,
255 SKL_TKN_U8_OUT_QUEUE_COUNT,
256 SKL_TKN_U8_TIME_SLOT,
257 SKL_TKN_U8_CORE_ID,
258 SKL_TKN_U8_MOD_TYPE,
259 SKL_TKN_U8_CONN_TYPE,
260 SKL_TKN_U8_DEV_TYPE,
261 SKL_TKN_U8_HW_CONN_TYPE,
262 SKL_TKN_U16_MOD_INST_ID,
263 SKL_TKN_U16_BLOCK_SIZE,
264 SKL_TKN_U32_MAX_MCPS,
265 SKL_TKN_U32_MEM_PAGES,
266 SKL_TKN_U32_OBS,
267 SKL_TKN_U32_IBS,
268 SKL_TKN_U32_VBUS_ID,
269 SKL_TKN_U32_PARAMS_FIXUP,
270 SKL_TKN_U32_CONVERTER,
271 SKL_TKN_U32_PIPE_ID,
272 SKL_TKN_U32_PIPE_CONN_TYPE,
273 SKL_TKN_U32_PIPE_PRIORITY,
274 SKL_TKN_U32_PIPE_MEM_PGS,
275 SKL_TKN_U32_DIR_PIN_COUNT,
276 SKL_TKN_U32_FMT_CH,
277 SKL_TKN_U32_FMT_FREQ,
278 SKL_TKN_U32_FMT_BIT_DEPTH,
279 SKL_TKN_U32_FMT_SAMPLE_SIZE,
280 SKL_TKN_U32_FMT_CH_CONFIG,
281 SKL_TKN_U32_FMT_INTERLEAVE,
282 SKL_TKN_U32_FMT_SAMPLE_TYPE,
283 SKL_TKN_U32_FMT_CH_MAP,
284 SKL_TKN_U32_PIN_MOD_ID,
285 SKL_TKN_U32_PIN_INST_ID,
286 SKL_TKN_U32_MOD_SET_PARAMS,
287 SKL_TKN_U32_MOD_PARAM_ID,
288 SKL_TKN_U32_CAPS_SET_PARAMS,
289 SKL_TKN_U32_CAPS_PARAMS_ID,
290 SKL_TKN_U32_CAPS_SIZE,
291 SKL_TKN_U32_PROC_DOMAIN,
292 SKL_TKN_U32_LIB_COUNT,
293 SKL_TKN_STR_LIB_NAME,
294 SKL_TKN_U32_PMODE,
295 SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
296 SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
297 SKL_TKN_U32_DMA_BUF_SIZE,
298
299 SKL_TKN_U32_PIPE_DIRECTION,
300 SKL_TKN_U32_PIPE_CONFIG_ID,
301 SKL_TKN_U32_NUM_CONFIGS,
302 SKL_TKN_U32_PATH_MEM_PGS,
303
304 SKL_TKN_U32_CFG_FREQ,
305 SKL_TKN_U8_CFG_CHAN,
306 SKL_TKN_U8_CFG_BPS,
307 SKL_TKN_CFG_MOD_RES_ID,
308 SKL_TKN_CFG_MOD_FMT_ID,
309 SKL_TKN_U8_NUM_MOD,
310
311 SKL_TKN_MM_U8_MOD_IDX,
312 SKL_TKN_MM_U8_NUM_RES,
313 SKL_TKN_MM_U8_NUM_INTF,
314 SKL_TKN_MM_U32_RES_ID,
315 SKL_TKN_MM_U32_CPS,
316 SKL_TKN_MM_U32_DMA_SIZE,
317 SKL_TKN_MM_U32_CPC,
318 SKL_TKN_MM_U32_RES_PIN_ID,
319 SKL_TKN_MM_U32_INTF_PIN_ID,
320 SKL_TKN_MM_U32_PIN_BUF,
321 SKL_TKN_MM_U32_FMT_ID,
322 SKL_TKN_MM_U32_NUM_IN_FMT,
323 SKL_TKN_MM_U32_NUM_OUT_FMT,
324
325 SKL_TKN_U32_ASTATE_IDX,
326 SKL_TKN_U32_ASTATE_COUNT,
327 SKL_TKN_U32_ASTATE_KCPS,
328 SKL_TKN_U32_ASTATE_CLK_SRC,
329
330 SKL_TKN_U32_FMT_CFG_IDX = 96,
331 SKL_TKN_MAX = SKL_TKN_U32_FMT_CFG_IDX,
332};
333
334#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/abi.h created+62
...@@ -0,0 +1,62 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 */
8
9/**
10 * SOF ABI versioning is based on Semantic Versioning where we have a given
11 * MAJOR.MINOR.PATCH version number. See https://semver.org/
12 *
13 * Rules for incrementing or changing version :-
14 *
15 * 1) Increment MAJOR version if you make incompatible API changes. MINOR and
16 * PATCH should be reset to 0.
17 *
18 * 2) Increment MINOR version if you add backwards compatible features or
19 * changes. PATCH should be reset to 0.
20 *
21 * 3) Increment PATCH version if you add backwards compatible bug fixes.
22 */
23
24#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
25#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
26
27/* SOF ABI version major, minor and patch numbers */
28#define SOF_ABI_MAJOR 3
29#define SOF_ABI_MINOR 18
30#define SOF_ABI_PATCH 0
31
32/* SOF ABI version number. Format within 32bit word is MMmmmppp */
33#define SOF_ABI_MAJOR_SHIFT 24
34#define SOF_ABI_MAJOR_MASK 0xff
35#define SOF_ABI_MINOR_SHIFT 12
36#define SOF_ABI_MINOR_MASK 0xfff
37#define SOF_ABI_PATCH_SHIFT 0
38#define SOF_ABI_PATCH_MASK 0xfff
39
40#define SOF_ABI_VER(major, minor, patch) \
41 (((major) << SOF_ABI_MAJOR_SHIFT) | \
42 ((minor) << SOF_ABI_MINOR_SHIFT) | \
43 ((patch) << SOF_ABI_PATCH_SHIFT))
44
45#define SOF_ABI_VERSION_MAJOR(version) \
46 (((version) >> SOF_ABI_MAJOR_SHIFT) & SOF_ABI_MAJOR_MASK)
47#define SOF_ABI_VERSION_MINOR(version) \
48 (((version) >> SOF_ABI_MINOR_SHIFT) & SOF_ABI_MINOR_MASK)
49#define SOF_ABI_VERSION_PATCH(version) \
50 (((version) >> SOF_ABI_PATCH_SHIFT) & SOF_ABI_PATCH_MASK)
51
52#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver) \
53 (SOF_ABI_VERSION_MAJOR((sof_ver)) != \
54 SOF_ABI_VERSION_MAJOR((client_ver)) \
55 )
56
57#define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH)
58
59/* SOF ABI magic number "SOF\0". */
60#define SOF_ABI_MAGIC 0x00464F53
61
62#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/fw.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 */
8
9/*
10 * Firmware file format .
11 */
12
13#ifndef __INCLUDE_UAPI_SOF_FW_H__
14#define __INCLUDE_UAPI_SOF_FW_H__
15
16#include <linux/types.h>
17
18#define SND_SOF_FW_SIG_SIZE 4
19#define SND_SOF_FW_ABI 1
20#define SND_SOF_FW_SIG "Reef"
21
22/*
23 * Firmware module is made up of 1 . N blocks of different types. The
24 * Block header is used to determine where and how block is to be copied in the
25 * DSP/host memory space.
26 */
27enum snd_sof_fw_blk_type {
28 SOF_FW_BLK_TYPE_INVALID = -1,
29 SOF_FW_BLK_TYPE_START = 0,
30 SOF_FW_BLK_TYPE_RSRVD0 = SOF_FW_BLK_TYPE_START,
31 SOF_FW_BLK_TYPE_IRAM = 1, /* local instruction RAM */
32 SOF_FW_BLK_TYPE_DRAM = 2, /* local data RAM */
33 SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */
34 SOF_FW_BLK_TYPE_ROM = 4,
35 SOF_FW_BLK_TYPE_IMR = 5,
36 SOF_FW_BLK_TYPE_RSRVD6 = 6,
37 SOF_FW_BLK_TYPE_RSRVD7 = 7,
38 SOF_FW_BLK_TYPE_RSRVD8 = 8,
39 SOF_FW_BLK_TYPE_RSRVD9 = 9,
40 SOF_FW_BLK_TYPE_RSRVD10 = 10,
41 SOF_FW_BLK_TYPE_RSRVD11 = 11,
42 SOF_FW_BLK_TYPE_RSRVD12 = 12,
43 SOF_FW_BLK_TYPE_RSRVD13 = 13,
44 SOF_FW_BLK_TYPE_RSRVD14 = 14,
45 /* use SOF_FW_BLK_TYPE_RSVRDX for new block types */
46 SOF_FW_BLK_TYPE_NUM
47};
48
49struct snd_sof_blk_hdr {
50 enum snd_sof_fw_blk_type type;
51 __u32 size; /* bytes minus this header */
52 __u32 offset; /* offset from base */
53} __attribute__((packed));
54
55/*
56 * Firmware file is made up of 1 .. N different modules types. The module
57 * type is used to determine how to load and parse the module.
58 */
59enum snd_sof_fw_mod_type {
60 SOF_FW_BASE = 0, /* base firmware image */
61 SOF_FW_MODULE = 1, /* firmware module */
62};
63
64struct snd_sof_mod_hdr {
65 enum snd_sof_fw_mod_type type;
66 __u32 size; /* bytes minus this header */
67 __u32 num_blocks; /* number of blocks */
68} __attribute__((packed));
69
70/*
71 * Firmware file header.
72 */
73struct snd_sof_fw_header {
74 unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */
75 __u32 file_size; /* size of file minus this header */
76 __u32 num_modules; /* number of modules */
77 __u32 abi; /* version of header format */
78} __attribute__((packed));
79
80#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/header.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 */
8
9#ifndef __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
10#define __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
11
12#include <linux/types.h>
13
14/*
15 * Header for all non IPC ABI data.
16 *
17 * Identifies data type, size and ABI.
18 * Used by any bespoke component data structures or binary blobs.
19 */
20struct sof_abi_hdr {
21 __u32 magic; /**< 'S', 'O', 'F', '\0' */
22 __u32 type; /**< component specific type */
23 __u32 size; /**< size in bytes of data excl. this struct */
24 __u32 abi; /**< SOF ABI version */
25 __u32 reserved[4]; /**< reserved for future use */
26 __u32 data[0]; /**< Component data - opaque to core */
27} __attribute__((packed));
28
29#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/tokens.h created+143
...@@ -0,0 +1,143 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
8 * Keyon Jie <yang.jie@linux.intel.com>
9 */
10
11/*
12 * Topology IDs and tokens.
13 *
14 * ** MUST BE ALIGNED WITH TOPOLOGY CONFIGURATION TOKEN VALUES **
15 */
16
17#ifndef __INCLUDE_UAPI_SOF_TOPOLOGY_H__
18#define __INCLUDE_UAPI_SOF_TOPOLOGY_H__
19
20/*
21 * Kcontrol IDs
22 */
23#define SOF_TPLG_KCTL_VOL_ID 256
24#define SOF_TPLG_KCTL_ENUM_ID 257
25#define SOF_TPLG_KCTL_BYTES_ID 258
26#define SOF_TPLG_KCTL_SWITCH_ID 259
27#define SOF_TPLG_KCTL_BYTES_VOLATILE_RO 260
28#define SOF_TPLG_KCTL_BYTES_VOLATILE_RW 261
29#define SOF_TPLG_KCTL_BYTES_WO_ID 262
30
31/*
32 * Tokens - must match values in topology configurations
33 */
34
35/* buffers */
36#define SOF_TKN_BUF_SIZE 100
37#define SOF_TKN_BUF_CAPS 101
38
39/* DAI */
40/* Token retired with ABI 3.2, do not use for new capabilities
41 * #define SOF_TKN_DAI_DMAC_CONFIG 153
42 */
43#define SOF_TKN_DAI_TYPE 154
44#define SOF_TKN_DAI_INDEX 155
45#define SOF_TKN_DAI_DIRECTION 156
46
47/* scheduling */
48#define SOF_TKN_SCHED_PERIOD 200
49#define SOF_TKN_SCHED_PRIORITY 201
50#define SOF_TKN_SCHED_MIPS 202
51#define SOF_TKN_SCHED_CORE 203
52#define SOF_TKN_SCHED_FRAMES 204
53#define SOF_TKN_SCHED_TIME_DOMAIN 205
54#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 206
55
56/* volume */
57#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
58#define SOF_TKN_VOLUME_RAMP_STEP_MS 251
59
60/* SRC */
61#define SOF_TKN_SRC_RATE_IN 300
62#define SOF_TKN_SRC_RATE_OUT 301
63
64/* ASRC */
65#define SOF_TKN_ASRC_RATE_IN 320
66#define SOF_TKN_ASRC_RATE_OUT 321
67#define SOF_TKN_ASRC_ASYNCHRONOUS_MODE 322
68#define SOF_TKN_ASRC_OPERATION_MODE 323
69
70/* PCM */
71#define SOF_TKN_PCM_DMAC_CONFIG 353
72
73/* Generic components */
74#define SOF_TKN_COMP_PERIOD_SINK_COUNT 400
75#define SOF_TKN_COMP_PERIOD_SOURCE_COUNT 401
76#define SOF_TKN_COMP_FORMAT 402
77/* Token retired with ABI 3.2, do not use for new capabilities
78 * #define SOF_TKN_COMP_PRELOAD_COUNT 403
79 */
80#define SOF_TKN_COMP_CORE_ID 404
81#define SOF_TKN_COMP_UUID 405
82
83/* SSP */
84#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
85#define SOF_TKN_INTEL_SSP_MCLK_ID 501
86#define SOF_TKN_INTEL_SSP_SAMPLE_BITS 502
87#define SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH 503
88#define SOF_TKN_INTEL_SSP_QUIRKS 504
89#define SOF_TKN_INTEL_SSP_TDM_PADDING_PER_SLOT 505
90#define SOF_TKN_INTEL_SSP_BCLK_DELAY 506
91
92/* DMIC */
93#define SOF_TKN_INTEL_DMIC_DRIVER_VERSION 600
94#define SOF_TKN_INTEL_DMIC_CLK_MIN 601
95#define SOF_TKN_INTEL_DMIC_CLK_MAX 602
96#define SOF_TKN_INTEL_DMIC_DUTY_MIN 603
97#define SOF_TKN_INTEL_DMIC_DUTY_MAX 604
98#define SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE 605
99#define SOF_TKN_INTEL_DMIC_SAMPLE_RATE 608
100#define SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH 609
101#define SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME_MS 610
102
103/* DMIC PDM */
104#define SOF_TKN_INTEL_DMIC_PDM_CTRL_ID 700
105#define SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable 701
106#define SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable 702
107#define SOF_TKN_INTEL_DMIC_PDM_POLARITY_A 703
108#define SOF_TKN_INTEL_DMIC_PDM_POLARITY_B 704
109#define SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE 705
110#define SOF_TKN_INTEL_DMIC_PDM_SKEW 706
111
112/* Tone */
113#define SOF_TKN_TONE_SAMPLE_RATE 800
114
115/* Processing Components */
116#define SOF_TKN_PROCESS_TYPE 900
117
118/* for backward compatibility */
119#define SOF_TKN_EFFECT_TYPE SOF_TKN_PROCESS_TYPE
120
121/* SAI */
122#define SOF_TKN_IMX_SAI_MCLK_ID 1000
123
124/* ESAI */
125#define SOF_TKN_IMX_ESAI_MCLK_ID 1100
126
127/* Stream */
128#define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 1200
129#define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201
130
131/* Led control for mute switches */
132#define SOF_TKN_MUTE_LED_USE 1300
133#define SOF_TKN_MUTE_LED_DIRECTION 1301
134
135/* ALH */
136#define SOF_TKN_INTEL_ALH_RATE 1400
137#define SOF_TKN_INTEL_ALH_CH 1401
138
139/* HDA */
140#define SOF_TKN_INTEL_HDA_RATE 1500
141#define SOF_TKN_INTEL_HDA_CH 1501
142
143#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/tlv.h created+117
...@@ -0,0 +1,117 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __UAPI_SOUND_TLV_H
15#define __UAPI_SOUND_TLV_H
16
17#define SNDRV_CTL_TLVT_CONTAINER 0 /* one level down - group of TLVs */
18#define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */
19#define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */
20#define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */
21#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
22#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
23
24/*
25 * channel-mapping TLV items
26 * TLV length must match with num_channels
27 */
28#define SNDRV_CTL_TLVT_CHMAP_FIXED 0x101 /* fixed channel position */
29#define SNDRV_CTL_TLVT_CHMAP_VAR 0x102 /* channels freely swappable */
30#define SNDRV_CTL_TLVT_CHMAP_PAIRED 0x103 /* pair-wise swappable */
31
32/*
33 * TLV structure is right behind the struct snd_ctl_tlv:
34 * unsigned int type - see SNDRV_CTL_TLVT_*
35 * unsigned int length
36 * .... data aligned to sizeof(unsigned int), use
37 * block_length = (length + (sizeof(unsigned int) - 1)) &
38 * ~(sizeof(unsigned int) - 1)) ....
39 */
40#define SNDRV_CTL_TLVD_ITEM(type, ...) \
41 (type), SNDRV_CTL_TLVD_LENGTH(__VA_ARGS__), __VA_ARGS__
42#define SNDRV_CTL_TLVD_LENGTH(...) \
43 ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
44
45/* Accessor offsets for TLV data items */
46#define SNDRV_CTL_TLVO_TYPE 0
47#define SNDRV_CTL_TLVO_LEN 1
48
49#define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \
50 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
51#define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \
52 unsigned int name[] = { \
53 SNDRV_CTL_TLVD_CONTAINER_ITEM(__VA_ARGS__) \
54 }
55
56#define SNDRV_CTL_TLVD_DB_SCALE_MASK 0xffff
57#define SNDRV_CTL_TLVD_DB_SCALE_MUTE 0x10000
58#define SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
59 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
60 (min), \
61 ((step) & SNDRV_CTL_TLVD_DB_SCALE_MASK) | \
62 ((mute) ? SNDRV_CTL_TLVD_DB_SCALE_MUTE : 0))
63#define SNDRV_CTL_TLVD_DECLARE_DB_SCALE(name, min, step, mute) \
64 unsigned int name[] = { \
65 SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
66 }
67
68/* Accessor offsets for min, mute and step items in dB scale type TLV */
69#define SNDRV_CTL_TLVO_DB_SCALE_MIN 2
70#define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP 3
71
72/* dB scale specified with min/max values instead of step */
73#define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
74 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
75#define SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
76 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
77#define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(name, min_dB, max_dB) \
78 unsigned int name[] = { \
79 SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
80 }
81#define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX_MUTE(name, min_dB, max_dB) \
82 unsigned int name[] = { \
83 SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
84 }
85
86/* Accessor offsets for min, max items in db-minmax types of TLV. */
87#define SNDRV_CTL_TLVO_DB_MINMAX_MIN 2
88#define SNDRV_CTL_TLVO_DB_MINMAX_MAX 3
89
90/* linear volume between min_dB and max_dB (.01dB unit) */
91#define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
92 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
93#define SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(name, min_dB, max_dB) \
94 unsigned int name[] = { \
95 SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
96 }
97
98/* Accessor offsets for min, max items in db-linear type of TLV. */
99#define SNDRV_CTL_TLVO_DB_LINEAR_MIN 2
100#define SNDRV_CTL_TLVO_DB_LINEAR_MAX 3
101
102/* dB range container:
103 * Items in dB range container must be ordered by their values and by their
104 * dB values. This implies that larger values must correspond with larger
105 * dB values (which is also required for all other mixer controls).
106 */
107/* Each item is: <min> <max> <TLV> */
108#define SNDRV_CTL_TLVD_DB_RANGE_ITEM(...) \
109 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
110#define SNDRV_CTL_TLVD_DECLARE_DB_RANGE(name, ...) \
111 unsigned int name[] = { \
112 SNDRV_CTL_TLVD_DB_RANGE_ITEM(__VA_ARGS__) \
113 }
114
115#define SNDRV_CTL_TLVD_DB_GAIN_MUTE -9999999
116
117#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/usb_stream.h created+77
...@@ -0,0 +1,77 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef __SOUND_USB_STREAM_H
21#define __SOUND_USB_STREAM_H
22
23#define USB_STREAM_INTERFACE_VERSION 2
24
25#define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \
26 _IOW('H', 0x90, struct usb_stream_config)
27
28struct usb_stream_packet {
29 unsigned offset;
30 unsigned length;
31};
32
33
34struct usb_stream_config {
35 unsigned version;
36 unsigned sample_rate;
37 unsigned period_frames;
38 unsigned frame_size;
39};
40
41struct usb_stream {
42 struct usb_stream_config cfg;
43 unsigned read_size;
44 unsigned write_size;
45
46 int period_size;
47
48 unsigned state;
49
50 int idle_insize;
51 int idle_outsize;
52 int sync_packet;
53 unsigned insize_done;
54 unsigned periods_done;
55 unsigned periods_polled;
56
57 struct usb_stream_packet outpacket[2];
58 unsigned inpackets;
59 unsigned inpacket_head;
60 unsigned inpacket_split;
61 unsigned inpacket_split_at;
62 unsigned next_inpacket_split;
63 unsigned next_inpacket_split_at;
64 struct usb_stream_packet inpacket[0];
65};
66
67enum usb_stream_state {
68 usb_stream_invalid,
69 usb_stream_stopped,
70 usb_stream_sync0,
71 usb_stream_sync1,
72 usb_stream_ready,
73 usb_stream_running,
74 usb_stream_xrun,
75};
76
77#endif /* __SOUND_USB_STREAM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/video/edid.h created+10
...@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __linux_video_edid_h__
3#define __linux_video_edid_h__
4
5struct edid_info {
6 unsigned char dummy[128];
7};
8
9
10#endif /* __linux_video_edid_h__ */
\ No newline at end of file
lib/libc/include/any-linux-any/video/sisfb.h created+210
...@@ -0,0 +1,210 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * sisfb.h - definitions for the SiS framebuffer driver
4 *
5 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the named License,
10 * or any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20 */
21
22#ifndef _LINUX_SISFB_H_
23#define _LINUX_SISFB_H_
24
25#include <linux/types.h>
26#include <asm/ioctl.h>
27
28/**********************************************/
29/* PUBLIC */
30/**********************************************/
31
32/* vbflags, public (others in sis.h) */
33#define CRT2_DEFAULT 0x00000001
34#define CRT2_LCD 0x00000002
35#define CRT2_TV 0x00000004
36#define CRT2_VGA 0x00000008
37#define TV_NTSC 0x00000010
38#define TV_PAL 0x00000020
39#define TV_HIVISION 0x00000040
40#define TV_YPBPR 0x00000080
41#define TV_AVIDEO 0x00000100
42#define TV_SVIDEO 0x00000200
43#define TV_SCART 0x00000400
44#define TV_PALM 0x00001000
45#define TV_PALN 0x00002000
46#define TV_NTSCJ 0x00001000
47#define TV_CHSCART 0x00008000
48#define TV_CHYPBPR525I 0x00010000
49#define CRT1_VGA 0x00000000
50#define CRT1_LCDA 0x00020000
51#define VGA2_CONNECTED 0x00040000
52#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
53#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
54#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
55#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
56
57/* Aliases: */
58#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
59#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
60#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
61
62/* Only if TV_YPBPR is set: */
63#define TV_YPBPR525I TV_NTSC
64#define TV_YPBPR525P TV_PAL
65#define TV_YPBPR750P TV_PALM
66#define TV_YPBPR1080I TV_PALN
67#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
68
69#define VB_DISPTYPE_DISP2 CRT2_ENABLE
70#define VB_DISPTYPE_CRT2 CRT2_ENABLE
71#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
72#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
73#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
74#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
75#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
76
77/* Structure argument for SISFB_GET_INFO ioctl */
78struct sisfb_info {
79 __u32 sisfb_id; /* for identifying sisfb */
80#ifndef SISFB_ID
81#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
82#endif
83 __u32 chip_id; /* PCI-ID of detected chip */
84 __u32 memory; /* total video memory in KB */
85 __u32 heapstart; /* heap start offset in KB */
86 __u8 fbvidmode; /* current sisfb mode */
87
88 __u8 sisfb_version;
89 __u8 sisfb_revision;
90 __u8 sisfb_patchlevel;
91
92 __u8 sisfb_caps; /* sisfb capabilities */
93
94 __u32 sisfb_tqlen; /* turbo queue length (in KB) */
95
96 __u32 sisfb_pcibus; /* The card's PCI ID */
97 __u32 sisfb_pcislot;
98 __u32 sisfb_pcifunc;
99
100 __u8 sisfb_lcdpdc; /* PanelDelayCompensation */
101
102 __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
103
104 __u32 sisfb_vbflags;
105 __u32 sisfb_currentvbflags;
106
107 __u32 sisfb_scalelcd;
108 __u32 sisfb_specialtiming;
109
110 __u8 sisfb_haveemi;
111 __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
112 __u8 sisfb_haveemilcd;
113
114 __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
115
116 __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
117
118 __u32 sisfb_heapsize; /* heap size (in KB) */
119 __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */
120
121 __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */
122 __u32 sisfb_curdstn;
123
124 __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */
125
126 __u32 sisfb_vbflags2; /* ivideo->vbflags2 */
127
128 __u8 sisfb_can_post; /* sisfb can POST this card */
129 __u8 sisfb_card_posted; /* card is POSTED */
130 __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */
131
132 __u8 reserved[183]; /* for future use */
133};
134
135#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */
136#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */
137/* more to come */
138
139#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */
140#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */
141#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */
142#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */
143#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */
144/* more to come */
145#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */
146#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */
147
148/* Argument for SISFB_CMD ioctl */
149struct sisfb_cmd {
150 __u32 sisfb_cmd;
151 __u32 sisfb_arg[16];
152 __u32 sisfb_result[4];
153};
154
155/* Additional IOCTLs for communication sisfb <> X driver */
156/* If changing this, vgatypes.h must also be changed (for X driver) */
157
158/* ioctl for identifying and giving some info (esp. memory heap start) */
159#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
160#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
161
162/* ioctrl to get current vertical retrace status */
163#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
164
165/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
166#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
167#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
168
169/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
170#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
171#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
172
173/* ioctl for internal sisfb commands (sisfbctrl) */
174#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
175
176/* ioctl for locking sisfb (no register access during lock) */
177/* As of now, only used to avoid register access during
178 * the ioctls listed above.
179 */
180#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
181
182/* ioctls 0xF3 up to 0x3F reserved for sisfb */
183
184/****************************************************************/
185/* The following are deprecated and should not be used anymore: */
186/****************************************************************/
187/* ioctl for identifying and giving some info (esp. memory heap start) */
188#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
189/* ioctrl to get current vertical retrace status */
190#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
191/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
192#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
193#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
194/****************************************************************/
195/* End of deprecated ioctl numbers */
196/****************************************************************/
197
198/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
199struct sis_memreq {
200 __u32 offset;
201 __u32 size;
202};
203
204/**********************************************/
205/* PRIVATE */
206/* (for IN-KERNEL usage only) */
207/**********************************************/
208
209
210#endif /* _LINUX_SISFB_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/video/uvesafb.h created+61
...@@ -0,0 +1,61 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UVESAFB_H
3#define _UVESAFB_H
4
5#include <linux/types.h>
6
7struct v86_regs {
8 __u32 ebx;
9 __u32 ecx;
10 __u32 edx;
11 __u32 esi;
12 __u32 edi;
13 __u32 ebp;
14 __u32 eax;
15 __u32 eip;
16 __u32 eflags;
17 __u32 esp;
18 __u16 cs;
19 __u16 ss;
20 __u16 es;
21 __u16 ds;
22 __u16 fs;
23 __u16 gs;
24};
25
26/* Task flags */
27#define TF_VBEIB 0x01
28#define TF_BUF_ESDI 0x02
29#define TF_BUF_ESBX 0x04
30#define TF_BUF_RET 0x08
31#define TF_EXIT 0x10
32
33struct uvesafb_task {
34 __u8 flags;
35 int buf_len;
36 struct v86_regs regs;
37};
38
39/* Constants for the capabilities field
40 * in vbe_ib */
41#define VBE_CAP_CAN_SWITCH_DAC 0x01
42#define VBE_CAP_VGACOMPAT 0x02
43
44/* The VBE Info Block */
45struct vbe_ib {
46 char vbe_signature[4];
47 __u16 vbe_version;
48 __u32 oem_string_ptr;
49 __u32 capabilities;
50 __u32 mode_list_ptr;
51 __u16 total_memory;
52 __u16 oem_software_rev;
53 __u32 oem_vendor_name_ptr;
54 __u32 oem_product_name_ptr;
55 __u32 oem_product_rev_ptr;
56 __u8 reserved[222];
57 char oem_data[256];
58 char misc_data[512];
59} __attribute__ ((packed));
60
61#endif /* _UVESAFB_H */
\ No newline at end of file
lib/libc/include/any-linux-any/xen/evtchn.h created+104
...@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * evtchn.h
4 *
5 * Interface to /dev/xen/evtchn.
6 *
7 * Copyright (c) 2003-2005, K A Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef __LINUX_PUBLIC_EVTCHN_H__
35#define __LINUX_PUBLIC_EVTCHN_H__
36
37/*
38 * Bind a fresh port to VIRQ @virq.
39 * Return allocated port.
40 */
41#define IOCTL_EVTCHN_BIND_VIRQ \
42 _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq))
43struct ioctl_evtchn_bind_virq {
44 unsigned int virq;
45};
46
47/*
48 * Bind a fresh port to remote <@remote_domain, @remote_port>.
49 * Return allocated port.
50 */
51#define IOCTL_EVTCHN_BIND_INTERDOMAIN \
52 _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain))
53struct ioctl_evtchn_bind_interdomain {
54 unsigned int remote_domain, remote_port;
55};
56
57/*
58 * Allocate a fresh port for binding to @remote_domain.
59 * Return allocated port.
60 */
61#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \
62 _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port))
63struct ioctl_evtchn_bind_unbound_port {
64 unsigned int remote_domain;
65};
66
67/*
68 * Unbind previously allocated @port.
69 */
70#define IOCTL_EVTCHN_UNBIND \
71 _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind))
72struct ioctl_evtchn_unbind {
73 unsigned int port;
74};
75
76/*
77 * Unbind previously allocated @port.
78 */
79#define IOCTL_EVTCHN_NOTIFY \
80 _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify))
81struct ioctl_evtchn_notify {
82 unsigned int port;
83};
84
85/* Clear and reinitialise the event buffer. Clear error condition. */
86#define IOCTL_EVTCHN_RESET \
87 _IOC(_IOC_NONE, 'E', 5, 0)
88
89/*
90 * Restrict this file descriptor so that it can only be used to bind
91 * new interdomain events from one domain.
92 *
93 * Once a file descriptor has been restricted it cannot be
94 * de-restricted, and must be closed and re-opened. Event channels
95 * which were bound before restricting remain bound afterwards, and
96 * can be notified as usual.
97 */
98#define IOCTL_EVTCHN_RESTRICT_DOMID \
99 _IOC(_IOC_NONE, 'E', 6, sizeof(struct ioctl_evtchn_restrict_domid))
100struct ioctl_evtchn_restrict_domid {
101 domid_t domid;
102};
103
104#endif /* __LINUX_PUBLIC_EVTCHN_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/xen/gntalloc.h created+84
...@@ -0,0 +1,84 @@
1/******************************************************************************
2 * gntalloc.h
3 *
4 * Interface to /dev/xen/gntalloc.
5 *
6 * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
7 *
8 * This file is in the public domain.
9 */
10
11#ifndef __LINUX_PUBLIC_GNTALLOC_H__
12#define __LINUX_PUBLIC_GNTALLOC_H__
13
14#include <linux/types.h>
15
16/*
17 * Allocates a new page and creates a new grant reference.
18 */
19#define IOCTL_GNTALLOC_ALLOC_GREF \
20_IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref))
21struct ioctl_gntalloc_alloc_gref {
22 /* IN parameters */
23 /* The ID of the domain to be given access to the grants. */
24 __u16 domid;
25 /* Flags for this mapping */
26 __u16 flags;
27 /* Number of pages to map */
28 __u32 count;
29 /* OUT parameters */
30 /* The offset to be used on a subsequent call to mmap(). */
31 __u64 index;
32 /* The grant references of the newly created grant, one per page */
33 /* Variable size, depending on count */
34 __u32 gref_ids[1];
35};
36
37#define GNTALLOC_FLAG_WRITABLE 1
38
39/*
40 * Deallocates the grant reference, allowing the associated page to be freed if
41 * no other domains are using it.
42 */
43#define IOCTL_GNTALLOC_DEALLOC_GREF \
44_IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref))
45struct ioctl_gntalloc_dealloc_gref {
46 /* IN parameters */
47 /* The offset returned in the map operation */
48 __u64 index;
49 /* Number of references to unmap */
50 __u32 count;
51};
52
53/*
54 * Sets up an unmap notification within the page, so that the other side can do
55 * cleanup if this side crashes. Required to implement cross-domain robust
56 * mutexes or close notification on communication channels.
57 *
58 * Each mapped page only supports one notification; multiple calls referring to
59 * the same page overwrite the previous notification. You must clear the
60 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
61 * to occur.
62 */
63#define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \
64_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify))
65struct ioctl_gntalloc_unmap_notify {
66 /* IN parameters */
67 /* Offset in the file descriptor for a byte within the page (same as
68 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
69 * be cleared. Otherwise, it can be any byte in the page whose
70 * notification we are adjusting.
71 */
72 __u64 index;
73 /* Action(s) to take on unmap */
74 __u32 action;
75 /* Event channel to notify */
76 __u32 event_channel_port;
77};
78
79/* Clear (set to zero) the byte specified by index */
80#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
81/* Send an interrupt on the indicated event channel */
82#define UNMAP_NOTIFY_SEND_EVENT 0x2
83
84#endif /* __LINUX_PUBLIC_GNTALLOC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/xen/gntdev.h created+309
...@@ -0,0 +1,309 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * gntdev.h
4 *
5 * Interface to /dev/xen/gntdev.
6 *
7 * Copyright (c) 2007, D G Murray
8 * Copyright (c) 2018, Oleksandr Andrushchenko, EPAM Systems Inc.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation; or, when distributed
13 * separately from the Linux kernel or incorporated into other
14 * software packages, subject to the following license:
15 *
16 * Permission is hereby granted, free of charge, to any person obtaining a copy
17 * of this source file (the "Software"), to deal in the Software without
18 * restriction, including without limitation the rights to use, copy, modify,
19 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
20 * and to permit persons to whom the Software is furnished to do so, subject to
21 * the following conditions:
22 *
23 * The above copyright notice and this permission notice shall be included in
24 * all copies or substantial portions of the Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
31 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
32 * IN THE SOFTWARE.
33 */
34
35#ifndef __LINUX_PUBLIC_GNTDEV_H__
36#define __LINUX_PUBLIC_GNTDEV_H__
37
38#include <linux/types.h>
39
40struct ioctl_gntdev_grant_ref {
41 /* The domain ID of the grant to be mapped. */
42 __u32 domid;
43 /* The grant reference of the grant to be mapped. */
44 __u32 ref;
45};
46
47/*
48 * Inserts the grant references into the mapping table of an instance
49 * of gntdev. N.B. This does not perform the mapping, which is deferred
50 * until mmap() is called with @index as the offset.
51 */
52#define IOCTL_GNTDEV_MAP_GRANT_REF \
53_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
54struct ioctl_gntdev_map_grant_ref {
55 /* IN parameters */
56 /* The number of grants to be mapped. */
57 __u32 count;
58 __u32 pad;
59 /* OUT parameters */
60 /* The offset to be used on a subsequent call to mmap(). */
61 __u64 index;
62 /* Variable IN parameter. */
63 /* Array of grant references, of size @count. */
64 struct ioctl_gntdev_grant_ref refs[1];
65};
66
67/*
68 * Removes the grant references from the mapping table of an instance of
69 * gntdev. N.B. munmap() must be called on the relevant virtual address(es)
70 * before this ioctl is called, or an error will result.
71 */
72#define IOCTL_GNTDEV_UNMAP_GRANT_REF \
73_IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
74struct ioctl_gntdev_unmap_grant_ref {
75 /* IN parameters */
76 /* The offset was returned by the corresponding map operation. */
77 __u64 index;
78 /* The number of pages to be unmapped. */
79 __u32 count;
80 __u32 pad;
81};
82
83/*
84 * Returns the offset in the driver's address space that corresponds
85 * to @vaddr. This can be used to perform a munmap(), followed by an
86 * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
87 * the caller. The number of pages that were allocated at the same time as
88 * @vaddr is returned in @count.
89 *
90 * N.B. Where more than one page has been mapped into a contiguous range, the
91 * supplied @vaddr must correspond to the start of the range; otherwise
92 * an error will result. It is only possible to munmap() the entire
93 * contiguously-allocated range at once, and not any subrange thereof.
94 */
95#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \
96_IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
97struct ioctl_gntdev_get_offset_for_vaddr {
98 /* IN parameters */
99 /* The virtual address of the first mapped page in a range. */
100 __u64 vaddr;
101 /* OUT parameters */
102 /* The offset that was used in the initial mmap() operation. */
103 __u64 offset;
104 /* The number of pages mapped in the VM area that begins at @vaddr. */
105 __u32 count;
106 __u32 pad;
107};
108
109/*
110 * Sets the maximum number of grants that may mapped at once by this gntdev
111 * instance.
112 *
113 * N.B. This must be called before any other ioctl is performed on the device.
114 */
115#define IOCTL_GNTDEV_SET_MAX_GRANTS \
116_IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
117struct ioctl_gntdev_set_max_grants {
118 /* IN parameter */
119 /* The maximum number of grants that may be mapped at once. */
120 __u32 count;
121};
122
123/*
124 * Sets up an unmap notification within the page, so that the other side can do
125 * cleanup if this side crashes. Required to implement cross-domain robust
126 * mutexes or close notification on communication channels.
127 *
128 * Each mapped page only supports one notification; multiple calls referring to
129 * the same page overwrite the previous notification. You must clear the
130 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
131 * to occur.
132 */
133#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \
134_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
135struct ioctl_gntdev_unmap_notify {
136 /* IN parameters */
137 /* Offset in the file descriptor for a byte within the page (same as
138 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
139 * be cleared. Otherwise, it can be any byte in the page whose
140 * notification we are adjusting.
141 */
142 __u64 index;
143 /* Action(s) to take on unmap */
144 __u32 action;
145 /* Event channel to notify */
146 __u32 event_channel_port;
147};
148
149struct gntdev_grant_copy_segment {
150 union {
151 void *virt;
152 struct {
153 grant_ref_t ref;
154 __u16 offset;
155 domid_t domid;
156 } foreign;
157 } source, dest;
158 __u16 len;
159
160 __u16 flags; /* GNTCOPY_* */
161 __s16 status; /* GNTST_* */
162};
163
164/*
165 * Copy between grant references and local buffers.
166 *
167 * The copy is split into @count @segments, each of which can copy
168 * to/from one grant reference.
169 *
170 * Each segment is similar to struct gnttab_copy in the hypervisor ABI
171 * except the local buffer is specified using a virtual address
172 * (instead of a GFN and offset).
173 *
174 * The local buffer may cross a Xen page boundary -- the driver will
175 * split segments into multiple ops if required.
176 *
177 * Returns 0 if all segments have been processed and @status in each
178 * segment is valid. Note that one or more segments may have failed
179 * (status != GNTST_okay).
180 *
181 * If the driver had to split a segment into two or more ops, @status
182 * includes the status of the first failed op for that segment (or
183 * GNTST_okay if all ops were successful).
184 *
185 * If -1 is returned, the status of all segments is undefined.
186 *
187 * EINVAL: A segment has local buffers for both source and
188 * destination.
189 * EINVAL: A segment crosses the boundary of a foreign page.
190 * EFAULT: A segment's local buffer is not accessible.
191 */
192#define IOCTL_GNTDEV_GRANT_COPY \
193 _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
194struct ioctl_gntdev_grant_copy {
195 unsigned int count;
196 struct gntdev_grant_copy_segment *segments;
197};
198
199/* Clear (set to zero) the byte specified by index */
200#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
201/* Send an interrupt on the indicated event channel */
202#define UNMAP_NOTIFY_SEND_EVENT 0x2
203
204/*
205 * Flags to be used while requesting memory mapping's backing storage
206 * to be allocated with DMA API.
207 */
208
209/*
210 * The buffer is backed with memory allocated with dma_alloc_wc.
211 */
212#define GNTDEV_DMA_FLAG_WC (1 << 0)
213
214/*
215 * The buffer is backed with memory allocated with dma_alloc_coherent.
216 */
217#define GNTDEV_DMA_FLAG_COHERENT (1 << 1)
218
219/*
220 * Create a dma-buf [1] from grant references @refs of count @count provided
221 * by the foreign domain @domid with flags @flags.
222 *
223 * By default dma-buf is backed by system memory pages, but by providing
224 * one of the GNTDEV_DMA_FLAG_XXX flags it can also be created as
225 * a DMA write-combine or coherent buffer, e.g. allocated with dma_alloc_wc/
226 * dma_alloc_coherent.
227 *
228 * Returns 0 if dma-buf was successfully created and the corresponding
229 * dma-buf's file descriptor is returned in @fd.
230 *
231 * [1] Documentation/driver-api/dma-buf.rst
232 */
233
234#define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS \
235 _IOC(_IOC_NONE, 'G', 9, \
236 sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs))
237struct ioctl_gntdev_dmabuf_exp_from_refs {
238 /* IN parameters. */
239 /* Specific options for this dma-buf: see GNTDEV_DMA_FLAG_XXX. */
240 __u32 flags;
241 /* Number of grant references in @refs array. */
242 __u32 count;
243 /* OUT parameters. */
244 /* File descriptor of the dma-buf. */
245 __u32 fd;
246 /* The domain ID of the grant references to be mapped. */
247 __u32 domid;
248 /* Variable IN parameter. */
249 /* Array of grant references of size @count. */
250 __u32 refs[1];
251};
252
253/*
254 * This will block until the dma-buf with the file descriptor @fd is
255 * released. This is only valid for buffers created with
256 * IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS.
257 *
258 * If within @wait_to_ms milliseconds the buffer is not released
259 * then -ETIMEDOUT error is returned.
260 * If the buffer with the file descriptor @fd does not exist or has already
261 * been released, then -ENOENT is returned. For valid file descriptors
262 * this must not be treated as error.
263 */
264#define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED \
265 _IOC(_IOC_NONE, 'G', 10, \
266 sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released))
267struct ioctl_gntdev_dmabuf_exp_wait_released {
268 /* IN parameters */
269 __u32 fd;
270 __u32 wait_to_ms;
271};
272
273/*
274 * Import a dma-buf with file descriptor @fd and export granted references
275 * to the pages of that dma-buf into array @refs of size @count.
276 */
277#define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS \
278 _IOC(_IOC_NONE, 'G', 11, \
279 sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs))
280struct ioctl_gntdev_dmabuf_imp_to_refs {
281 /* IN parameters. */
282 /* File descriptor of the dma-buf. */
283 __u32 fd;
284 /* Number of grant references in @refs array. */
285 __u32 count;
286 /* The domain ID for which references to be granted. */
287 __u32 domid;
288 /* Reserved - must be zero. */
289 __u32 reserved;
290 /* OUT parameters. */
291 /* Array of grant references of size @count. */
292 __u32 refs[1];
293};
294
295/*
296 * This will close all references to the imported buffer with file descriptor
297 * @fd, so it can be released by the owner. This is only valid for buffers
298 * created with IOCTL_GNTDEV_DMABUF_IMP_TO_REFS.
299 */
300#define IOCTL_GNTDEV_DMABUF_IMP_RELEASE \
301 _IOC(_IOC_NONE, 'G', 12, \
302 sizeof(struct ioctl_gntdev_dmabuf_imp_release))
303struct ioctl_gntdev_dmabuf_imp_release {
304 /* IN parameters */
305 __u32 fd;
306 __u32 reserved;
307};
308
309#endif /* __LINUX_PUBLIC_GNTDEV_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/xen/privcmd.h created+129
...@@ -0,0 +1,129 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * privcmd.h
4 *
5 * Interface to /proc/xen/privcmd.
6 *
7 * Copyright (c) 2003-2005, K A Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef __LINUX_PUBLIC_PRIVCMD_H__
35#define __LINUX_PUBLIC_PRIVCMD_H__
36
37#include <linux/types.h>
38
39#include <xen/interface/xen.h>
40
41struct privcmd_hypercall {
42 __u64 op;
43 __u64 arg[5];
44};
45
46struct privcmd_mmap_entry {
47 __u64 va;
48 /*
49 * This should be a GFN. It's not possible to change the name because
50 * it's exposed to the user-space.
51 */
52 __u64 mfn;
53 __u64 npages;
54};
55
56struct privcmd_mmap {
57 int num;
58 domid_t dom; /* target domain */
59 struct privcmd_mmap_entry *entry;
60};
61
62struct privcmd_mmapbatch {
63 int num; /* number of pages to populate */
64 domid_t dom; /* target domain */
65 __u64 addr; /* virtual address */
66 xen_pfn_t *arr; /* array of mfns - or'd with
67 PRIVCMD_MMAPBATCH_*_ERROR on err */
68};
69
70#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
71#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
72
73struct privcmd_mmapbatch_v2 {
74 unsigned int num; /* number of pages to populate */
75 domid_t dom; /* target domain */
76 __u64 addr; /* virtual address */
77 const xen_pfn_t *arr; /* array of mfns */
78 int *err; /* array of error codes */
79};
80
81struct privcmd_dm_op_buf {
82 void *uptr;
83 size_t size;
84};
85
86struct privcmd_dm_op {
87 domid_t dom;
88 __u16 num;
89 const struct privcmd_dm_op_buf *ubufs;
90};
91
92struct privcmd_mmap_resource {
93 domid_t dom;
94 __u32 type;
95 __u32 id;
96 __u32 idx;
97 __u64 num;
98 __u64 addr;
99};
100
101/*
102 * @cmd: IOCTL_PRIVCMD_HYPERCALL
103 * @arg: &privcmd_hypercall_t
104 * Return: Value returned from execution of the specified hypercall.
105 *
106 * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2
107 * @arg: &struct privcmd_mmapbatch_v2
108 * Return: 0 on success (i.e., arg->err contains valid error codes for
109 * each frame). On an error other than a failed frame remap, -1 is
110 * returned and errno is set to EINVAL, EFAULT etc. As an exception,
111 * if the operation was otherwise successful but any frame failed with
112 * -ENOENT, then -1 is returned and errno is set to ENOENT.
113 */
114#define IOCTL_PRIVCMD_HYPERCALL \
115 _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
116#define IOCTL_PRIVCMD_MMAP \
117 _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
118#define IOCTL_PRIVCMD_MMAPBATCH \
119 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
120#define IOCTL_PRIVCMD_MMAPBATCH_V2 \
121 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
122#define IOCTL_PRIVCMD_DM_OP \
123 _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
124#define IOCTL_PRIVCMD_RESTRICT \
125 _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
126#define IOCTL_PRIVCMD_MMAP_RESOURCE \
127 _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
128
129#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/byteorder.h created+19
...@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __ASM_ARC_BYTEORDER_H
11#define __ASM_ARC_BYTEORDER_H
12
13#ifdef __BIG_ENDIAN__
14#include <linux/byteorder/big_endian.h>
15#else
16#include <linux/byteorder/little_endian.h>
17#endif
18
19#endif /* ASM_ARC_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/cachectl.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __ARC_ASM_CACHECTL_H
11#define __ARC_ASM_CACHECTL_H
12
13/*
14 * ARC ABI flags defined for Android's finegrained cacheflush requirements
15 */
16#define CF_I_INV 0x0002
17#define CF_D_FLUSH 0x0010
18#define CF_D_FLUSH_INV 0x0020
19
20#define CF_DEFAULT (CF_I_INV | CF_D_FLUSH)
21
22/*
23 * Standard flags expected by cacheflush system call users
24 */
25#define ICACHE CF_I_INV
26#define DCACHE CF_D_FLUSH
27#define BCACHE (CF_I_INV | CF_D_FLUSH)
28
29#endif
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/elf.h created+35
...@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __ASM_ARC_ELF_H
11#define __ASM_ARC_ELF_H
12
13#include <asm/ptrace.h> /* for user_regs_struct */
14
15/* Machine specific ELF Hdr flags */
16#define EF_ARC_OSABI_MSK 0x00000f00
17
18#define EF_ARC_OSABI_V3 0x00000300 /* v3 (no legacy syscalls) */
19#define EF_ARC_OSABI_V4 0x00000400 /* v4 (64bit data any reg align) */
20
21#if __GNUC__ < 6
22#define EF_ARC_OSABI_CURRENT EF_ARC_OSABI_V3
23#else
24#define EF_ARC_OSABI_CURRENT EF_ARC_OSABI_V4
25#endif
26
27typedef unsigned long elf_greg_t;
28typedef unsigned long elf_fpregset_t;
29
30#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
31#define ELF_ARCV2REG (sizeof(struct user_regs_arcv2) / sizeof(elf_greg_t))
32
33typedef elf_greg_t elf_gregset_t[ELF_NGREG];
34
35#endif
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/page.h created+36
...@@ -0,0 +1,36 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __ASM_ARC_PAGE_H
11#define __ASM_ARC_PAGE_H
12
13#include <linux/const.h>
14
15/* PAGE_SHIFT determines the page size */
16#if defined(CONFIG_ARC_PAGE_SIZE_16K)
17#define PAGE_SHIFT 14
18#elif defined(CONFIG_ARC_PAGE_SIZE_4K)
19#define PAGE_SHIFT 12
20#else
21/*
22 * Default 8k
23 * done this way (instead of under CONFIG_ARC_PAGE_SIZE_8K) because adhoc
24 * user code (busybox appletlib.h) expects PAGE_SHIFT to be defined w/o
25 * using the correct uClibc header and in their build our autoconf.h is
26 * not available
27 */
28#define PAGE_SHIFT 13
29#endif
30
31#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
32#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
33
34#define PAGE_MASK (~(PAGE_SIZE-1))
35
36#endif /* __ASM_ARC_PAGE_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/ptrace.h created+58
...@@ -0,0 +1,58 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
10 */
11
12#ifndef __ASM_ARC_PTRACE_H
13#define __ASM_ARC_PTRACE_H
14
15#define PTRACE_GET_THREAD_AREA 25
16
17#ifndef __ASSEMBLY__
18/*
19 * Userspace ABI: Register state needed by
20 * -ptrace (gdbserver)
21 * -sigcontext (SA_SIGNINFO signal frame)
22 *
23 * This is to decouple pt_regs from user-space ABI, to be able to change it
24 * w/o affecting the ABI.
25 *
26 * The intermediate pad,pad2 are relics of initial layout based on pt_regs
27 * for optimizations when copying pt_regs to/from user_regs_struct.
28 * We no longer need them, but can't be changed as they are part of ABI now.
29 *
30 * Also, sigcontext only care about the scratch regs as that is what we really
31 * save/restore for signal handling. However gdb also uses the same struct
32 * hence callee regs need to be in there too.
33*/
34struct user_regs_struct {
35
36 unsigned long pad;
37 struct {
38 unsigned long bta, lp_start, lp_end, lp_count;
39 unsigned long status32, ret, blink, fp, gp;
40 unsigned long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0;
41 unsigned long sp;
42 } scratch;
43 unsigned long pad2;
44 struct {
45 unsigned long r25, r24, r23, r22, r21, r20;
46 unsigned long r19, r18, r17, r16, r15, r14, r13;
47 } callee;
48 unsigned long efa; /* break pt addr, for break points in delay slots */
49 unsigned long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */
50};
51
52struct user_regs_arcv2 {
53 unsigned long r30, r58, r59;
54};
55
56#endif /* !__ASSEMBLY__ */
57
58#endif /* __ASM_ARC_PTRACE_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/setup.h created+6
...@@ -0,0 +1,6 @@
1/*
2 * setup.h is part of userspace header ABI so UAPI scripts have to generate it
3 * even if there's nothing to export - causing empty <uapi/asm/setup.h>
4 * However to prevent "patch" from discarding it we add this placeholder
5 * comment
6 */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/sigcontext.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef _ASM_ARC_SIGCONTEXT_H
11#define _ASM_ARC_SIGCONTEXT_H
12
13#include <asm/ptrace.h>
14
15/*
16 * Signal context structure - contains all info to do with the state
17 * before the signal handler was invoked.
18 */
19struct sigcontext {
20 struct user_regs_struct regs;
21 struct user_regs_arcv2 v2abi;
22};
23
24#endif /* _ASM_ARC_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/signal.h created+28
...@@ -0,0 +1,28 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
10 */
11
12#ifndef _ASM_ARC_SIGNAL_H
13#define _ASM_ARC_SIGNAL_H
14
15/*
16 * This is much needed for ARC sigreturn optimization.
17 * This allows uClibc to piggback the addr of a sigreturn stub in sigaction,
18 * which allows sigreturn based re-entry into kernel after handling signal.
19 * W/o this kernel needs to "synthesize" the sigreturn trampoline on user
20 * mode stack which in turn forces the following:
21 * -TLB Flush (after making the stack page executable)
22 * -Cache line Flush (to make I/D Cache lines coherent)
23 */
24#define SA_RESTORER 0x04000000
25
26#include <asm-generic/signal.h>
27
28#endif /* _ASM_ARC_SIGNAL_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/swab.h created+99
...@@ -0,0 +1,99 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * vineetg: May 2011
10 * -Support single cycle endian-swap insn in ARC700 4.10
11 *
12 * vineetg: June 2009
13 * -Better htonl implementation (5 instead of 9 ALU instructions)
14 * -Hardware assisted single cycle bswap (Use Case of ARC custom instrn)
15 */
16
17#ifndef __ASM_ARC_SWAB_H
18#define __ASM_ARC_SWAB_H
19
20#include <linux/types.h>
21
22/* Native single cycle endian swap insn */
23#ifdef CONFIG_ARC_HAS_SWAPE
24
25#define __arch_swab32(x) \
26({ \
27 unsigned int tmp = x; \
28 __asm__( \
29 " swape %0, %1 \n" \
30 : "=r" (tmp) \
31 : "r" (tmp)); \
32 tmp; \
33})
34
35#else
36
37/* Several ways of Endian-Swap Emulation for ARC
38 * 0: kernel generic
39 * 1: ARC optimised "C"
40 * 2: ARC Custom instruction
41 */
42#define ARC_BSWAP_TYPE 1
43
44#if (ARC_BSWAP_TYPE == 1) /******* Software only ********/
45
46/* The kernel default implementation of htonl is
47 * return x<<24 | x>>24 |
48 * (x & (__u32)0x0000ff00UL)<<8 | (x & (__u32)0x00ff0000UL)>>8;
49 *
50 * This generates 9 instructions on ARC (excluding the ld/st)
51 *
52 * 8051fd8c: ld r3,[r7,20] ; Mem op : Get the value to be swapped
53 * 8051fd98: asl r5,r3,24 ; get 3rd Byte
54 * 8051fd9c: lsr r2,r3,24 ; get 0th Byte
55 * 8051fda0: and r4,r3,0xff00
56 * 8051fda8: asl r4,r4,8 ; get 1st Byte
57 * 8051fdac: and r3,r3,0x00ff0000
58 * 8051fdb4: or r2,r2,r5 ; combine 0th and 3rd Bytes
59 * 8051fdb8: lsr r3,r3,8 ; 2nd Byte at correct place in Dst Reg
60 * 8051fdbc: or r2,r2,r4 ; combine 0,3 Bytes with 1st Byte
61 * 8051fdc0: or r2,r2,r3 ; combine 0,3,1 Bytes with 2nd Byte
62 * 8051fdc4: st r2,[r1,20] ; Mem op : save result back to mem
63 *
64 * Joern suggested a better "C" algorithm which is great since
65 * (1) It is portable to any architecure
66 * (2) At the same time it takes advantage of ARC ISA (rotate intrns)
67 */
68
69#define __arch_swab32(x) \
70({ unsigned long __in = (x), __tmp; \
71 __tmp = __in << 8 | __in >> 24; /* ror tmp,in,24 */ \
72 __in = __in << 24 | __in >> 8; /* ror in,in,8 */ \
73 __tmp ^= __in; \
74 __tmp &= 0xff00ff; \
75 __tmp ^ __in; \
76})
77
78#elif (ARC_BSWAP_TYPE == 2) /* Custom single cycle bswap instruction */
79
80#define __arch_swab32(x) \
81({ \
82 unsigned int tmp = x; \
83 __asm__( \
84 " .extInstruction bswap, 7, 0x00, SUFFIX_NONE, SYNTAX_2OP \n"\
85 " bswap %0, %1 \n"\
86 : "=r" (tmp) \
87 : "r" (tmp)); \
88 tmp; \
89})
90
91#endif /* ARC_BSWAP_TYPE=zzz */
92
93#endif /* CONFIG_ARC_HAS_SWAPE */
94
95#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
96#define __SWAB_64_THRU_32__
97#endif
98
99#endif
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/unistd.h created+52
...@@ -0,0 +1,52 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10/******** no-legacy-syscalls-ABI *******/
11
12/*
13 * Non-typical guard macro to enable inclusion twice in ARCH sys.c
14 * That is how the Generic syscall wrapper generator works
15 */
16#if !defined(_UAPI_ASM_ARC_UNISTD_H) || defined(__SYSCALL)
17#define _ASM_ARC_UNISTD_H
18
19#define __ARCH_WANT_RENAMEAT
20#define __ARCH_WANT_STAT64
21#define __ARCH_WANT_SET_GET_RLIMIT
22#define __ARCH_WANT_SYS_EXECVE
23#define __ARCH_WANT_SYS_CLONE
24#define __ARCH_WANT_SYS_CLONE3
25#define __ARCH_WANT_SYS_VFORK
26#define __ARCH_WANT_SYS_FORK
27#define __ARCH_WANT_TIME32_SYSCALLS
28
29#define sys_mmap2 sys_mmap_pgoff
30
31#include <asm-generic/unistd.h>
32
33#define NR_syscalls __NR_syscalls
34
35/* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */
36#define __NR_sysfs (__NR_arch_specific_syscall + 3)
37
38/* ARC specific syscall */
39#define __NR_cacheflush (__NR_arch_specific_syscall + 0)
40#define __NR_arc_settls (__NR_arch_specific_syscall + 1)
41#define __NR_arc_gettls (__NR_arch_specific_syscall + 2)
42#define __NR_arc_usr_cmpxchg (__NR_arch_specific_syscall + 4)
43
44__SYSCALL(__NR_cacheflush, sys_cacheflush)
45__SYSCALL(__NR_arc_settls, sys_arc_settls)
46__SYSCALL(__NR_arc_gettls, sys_arc_gettls)
47__SYSCALL(__NR_arc_usr_cmpxchg, sys_arc_usr_cmpxchg)
48__SYSCALL(__NR_sysfs, sys_sysfs)
49
50#undef __SYSCALL
51
52#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/auxvec.h created+8
...@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_AUXVEC_H
3#define __ASM_AUXVEC_H
4
5/* VDSO location */
6#define AT_SYSINFO_EHDR 33
7
8#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/byteorder.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/byteorder.h
4 *
5 * ARM Endian-ness. In little endian mode, the data bus is connected such
6 * that byte accesses appear as:
7 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
8 * and word accesses (data or instruction) appear as:
9 * d0...d31
10 *
11 * When in big endian mode, byte accesses appear as:
12 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
13 * and word accesses (data or instruction) appear as:
14 * d0...d31
15 */
16#ifndef __ASM_ARM_BYTEORDER_H
17#define __ASM_ARM_BYTEORDER_H
18
19#ifdef __ARMEB__
20#include <linux/byteorder/big_endian.h>
21#else
22#include <linux/byteorder/little_endian.h>
23#endif
24
25#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/hwcap.h created+41
...@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASMARM_HWCAP_H
3#define __ASMARM_HWCAP_H
4
5/*
6 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
7 */
8#define HWCAP_SWP (1 << 0)
9#define HWCAP_HALF (1 << 1)
10#define HWCAP_THUMB (1 << 2)
11#define HWCAP_26BIT (1 << 3) /* Play it safe */
12#define HWCAP_FAST_MULT (1 << 4)
13#define HWCAP_FPA (1 << 5)
14#define HWCAP_VFP (1 << 6)
15#define HWCAP_EDSP (1 << 7)
16#define HWCAP_JAVA (1 << 8)
17#define HWCAP_IWMMXT (1 << 9)
18#define HWCAP_CRUNCH (1 << 10) /* Obsolete */
19#define HWCAP_THUMBEE (1 << 11)
20#define HWCAP_NEON (1 << 12)
21#define HWCAP_VFPv3 (1 << 13)
22#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
23#define HWCAP_TLS (1 << 15)
24#define HWCAP_VFPv4 (1 << 16)
25#define HWCAP_IDIVA (1 << 17)
26#define HWCAP_IDIVT (1 << 18)
27#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
28#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
29#define HWCAP_LPAE (1 << 20)
30#define HWCAP_EVTSTRM (1 << 21)
31
32/*
33 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
34 */
35#define HWCAP2_AES (1 << 0)
36#define HWCAP2_PMULL (1 << 1)
37#define HWCAP2_SHA1 (1 << 2)
38#define HWCAP2_SHA2 (1 << 3)
39#define HWCAP2_CRC32 (1 << 4)
40
41#endif /* __ASMARM_HWCAP_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/perf_regs.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_ARM_PERF_REGS_H
3#define _ASM_ARM_PERF_REGS_H
4
5enum perf_event_arm_regs {
6 PERF_REG_ARM_R0,
7 PERF_REG_ARM_R1,
8 PERF_REG_ARM_R2,
9 PERF_REG_ARM_R3,
10 PERF_REG_ARM_R4,
11 PERF_REG_ARM_R5,
12 PERF_REG_ARM_R6,
13 PERF_REG_ARM_R7,
14 PERF_REG_ARM_R8,
15 PERF_REG_ARM_R9,
16 PERF_REG_ARM_R10,
17 PERF_REG_ARM_FP,
18 PERF_REG_ARM_IP,
19 PERF_REG_ARM_SP,
20 PERF_REG_ARM_LR,
21 PERF_REG_ARM_PC,
22 PERF_REG_ARM_MAX,
23};
24#endif /* _ASM_ARM_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/posix_types.h created+38
...@@ -0,0 +1,38 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/posix_types.h
4 *
5 * Copyright (C) 1996-1998 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Changelog:
12 * 27-06-1996 RMK Created
13 */
14#ifndef __ARCH_ARM_POSIX_TYPES_H
15#define __ARCH_ARM_POSIX_TYPES_H
16
17/*
18 * This file is generally used by user-level software, so you need to
19 * be a little careful about namespace pollution etc. Also, we cannot
20 * assume GCC is being used.
21 */
22
23typedef unsigned short __kernel_mode_t;
24#define __kernel_mode_t __kernel_mode_t
25
26typedef unsigned short __kernel_ipc_pid_t;
27#define __kernel_ipc_pid_t __kernel_ipc_pid_t
28
29typedef unsigned short __kernel_uid_t;
30typedef unsigned short __kernel_gid_t;
31#define __kernel_uid_t __kernel_uid_t
32
33typedef unsigned short __kernel_old_dev_t;
34#define __kernel_old_dev_t __kernel_old_dev_t
35
36#include <asm-generic/posix_types.h>
37
38#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/ptrace.h created+148
...@@ -0,0 +1,148 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/ptrace.h
4 *
5 * Copyright (C) 1996-2003 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_ARM_PTRACE_H
12#define __ASM_ARM_PTRACE_H
13
14#include <asm/hwcap.h>
15
16#define PTRACE_GETREGS 12
17#define PTRACE_SETREGS 13
18#define PTRACE_GETFPREGS 14
19#define PTRACE_SETFPREGS 15
20/* PTRACE_ATTACH is 16 */
21/* PTRACE_DETACH is 17 */
22#define PTRACE_GETWMMXREGS 18
23#define PTRACE_SETWMMXREGS 19
24/* 20 is unused */
25#define PTRACE_OLDSETOPTIONS 21
26#define PTRACE_GET_THREAD_AREA 22
27#define PTRACE_SET_SYSCALL 23
28/* PTRACE_SYSCALL is 24 */
29#define PTRACE_GETCRUNCHREGS 25 /* obsolete */
30#define PTRACE_SETCRUNCHREGS 26 /* obsolete */
31#define PTRACE_GETVFPREGS 27
32#define PTRACE_SETVFPREGS 28
33#define PTRACE_GETHBPREGS 29
34#define PTRACE_SETHBPREGS 30
35#define PTRACE_GETFDPIC 31
36
37#define PTRACE_GETFDPIC_EXEC 0
38#define PTRACE_GETFDPIC_INTERP 1
39
40/*
41 * PSR bits
42 * Note on V7M there is no mode contained in the PSR
43 */
44#define USR26_MODE 0x00000000
45#define FIQ26_MODE 0x00000001
46#define IRQ26_MODE 0x00000002
47#define SVC26_MODE 0x00000003
48#define USR_MODE 0x00000010
49#define SVC_MODE 0x00000013
50#define FIQ_MODE 0x00000011
51#define IRQ_MODE 0x00000012
52#define MON_MODE 0x00000016
53#define ABT_MODE 0x00000017
54#define HYP_MODE 0x0000001a
55#define UND_MODE 0x0000001b
56#define SYSTEM_MODE 0x0000001f
57#define MODE32_BIT 0x00000010
58#define MODE_MASK 0x0000001f
59
60#define V4_PSR_T_BIT 0x00000020 /* >= V4T, but not V7M */
61#define V7M_PSR_T_BIT 0x01000000
62/* for compatibility */
63#define PSR_T_BIT V4_PSR_T_BIT
64
65#define PSR_F_BIT 0x00000040 /* >= V4, but not V7M */
66#define PSR_I_BIT 0x00000080 /* >= V4, but not V7M */
67#define PSR_A_BIT 0x00000100 /* >= V6, but not V7M */
68#define PSR_E_BIT 0x00000200 /* >= V6, but not V7M */
69#define PSR_J_BIT 0x01000000 /* >= V5J, but not V7M */
70#define PSR_Q_BIT 0x08000000 /* >= V5E, including V7M */
71#define PSR_V_BIT 0x10000000
72#define PSR_C_BIT 0x20000000
73#define PSR_Z_BIT 0x40000000
74#define PSR_N_BIT 0x80000000
75
76/*
77 * Groups of PSR bits
78 */
79#define PSR_f 0xff000000 /* Flags */
80#define PSR_s 0x00ff0000 /* Status */
81#define PSR_x 0x0000ff00 /* Extension */
82#define PSR_c 0x000000ff /* Control */
83
84/*
85 * ARMv7 groups of PSR bits
86 */
87#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
88#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
89#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
90#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
91
92/*
93 * Default endianness state
94 */
95#ifdef CONFIG_CPU_ENDIAN_BE8
96#define PSR_ENDSTATE PSR_E_BIT
97#else
98#define PSR_ENDSTATE 0
99#endif
100
101/*
102 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
103 * process is located in memory.
104 */
105#define PT_TEXT_ADDR 0x10000
106#define PT_DATA_ADDR 0x10004
107#define PT_TEXT_END_ADDR 0x10008
108
109#ifndef __ASSEMBLY__
110
111/*
112 * This struct defines the way the registers are stored on the
113 * stack during a system call. Note that sizeof(struct pt_regs)
114 * has to be a multiple of 8.
115 */
116struct pt_regs {
117 long uregs[18];
118};
119
120#define ARM_cpsr uregs[16]
121#define ARM_pc uregs[15]
122#define ARM_lr uregs[14]
123#define ARM_sp uregs[13]
124#define ARM_ip uregs[12]
125#define ARM_fp uregs[11]
126#define ARM_r10 uregs[10]
127#define ARM_r9 uregs[9]
128#define ARM_r8 uregs[8]
129#define ARM_r7 uregs[7]
130#define ARM_r6 uregs[6]
131#define ARM_r5 uregs[5]
132#define ARM_r4 uregs[4]
133#define ARM_r3 uregs[3]
134#define ARM_r2 uregs[2]
135#define ARM_r1 uregs[1]
136#define ARM_r0 uregs[0]
137#define ARM_ORIG_r0 uregs[17]
138
139/*
140 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
141 * and core dumps.
142 */
143#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
144
145
146#endif /* __ASSEMBLY__ */
147
148#endif /* __ASM_ARM_PTRACE_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/setup.h created+188
...@@ -0,0 +1,188 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * linux/include/asm/setup.h
4 *
5 * Copyright (C) 1997-1999 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Structure passed to kernel to tell it about the
12 * hardware it's running on. See Documentation/arm/setup.rst
13 * for more info.
14 */
15#ifndef __ASMARM_SETUP_H
16#define __ASMARM_SETUP_H
17
18#include <linux/types.h>
19
20#define COMMAND_LINE_SIZE 1024
21
22/* The list ends with an ATAG_NONE node. */
23#define ATAG_NONE 0x00000000
24
25struct tag_header {
26 __u32 size;
27 __u32 tag;
28};
29
30/* The list must start with an ATAG_CORE node */
31#define ATAG_CORE 0x54410001
32
33struct tag_core {
34 __u32 flags; /* bit 0 = read-only */
35 __u32 pagesize;
36 __u32 rootdev;
37};
38
39/* it is allowed to have multiple ATAG_MEM nodes */
40#define ATAG_MEM 0x54410002
41
42struct tag_mem32 {
43 __u32 size;
44 __u32 start; /* physical start address */
45};
46
47/* VGA text type displays */
48#define ATAG_VIDEOTEXT 0x54410003
49
50struct tag_videotext {
51 __u8 x;
52 __u8 y;
53 __u16 video_page;
54 __u8 video_mode;
55 __u8 video_cols;
56 __u16 video_ega_bx;
57 __u8 video_lines;
58 __u8 video_isvga;
59 __u16 video_points;
60};
61
62/* describes how the ramdisk will be used in kernel */
63#define ATAG_RAMDISK 0x54410004
64
65struct tag_ramdisk {
66 __u32 flags; /* bit 0 = load, bit 1 = prompt */
67 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
68 __u32 start; /* starting block of floppy-based RAM disk image */
69};
70
71/* describes where the compressed ramdisk image lives (virtual address) */
72/*
73 * this one accidentally used virtual addresses - as such,
74 * it's deprecated.
75 */
76#define ATAG_INITRD 0x54410005
77
78/* describes where the compressed ramdisk image lives (physical address) */
79#define ATAG_INITRD2 0x54420005
80
81struct tag_initrd {
82 __u32 start; /* physical start address */
83 __u32 size; /* size of compressed ramdisk image in bytes */
84};
85
86/* board serial number. "64 bits should be enough for everybody" */
87#define ATAG_SERIAL 0x54410006
88
89struct tag_serialnr {
90 __u32 low;
91 __u32 high;
92};
93
94/* board revision */
95#define ATAG_REVISION 0x54410007
96
97struct tag_revision {
98 __u32 rev;
99};
100
101/* initial values for vesafb-type framebuffers. see struct screen_info
102 * in include/linux/tty.h
103 */
104#define ATAG_VIDEOLFB 0x54410008
105
106struct tag_videolfb {
107 __u16 lfb_width;
108 __u16 lfb_height;
109 __u16 lfb_depth;
110 __u16 lfb_linelength;
111 __u32 lfb_base;
112 __u32 lfb_size;
113 __u8 red_size;
114 __u8 red_pos;
115 __u8 green_size;
116 __u8 green_pos;
117 __u8 blue_size;
118 __u8 blue_pos;
119 __u8 rsvd_size;
120 __u8 rsvd_pos;
121};
122
123/* command line: \0 terminated string */
124#define ATAG_CMDLINE 0x54410009
125
126struct tag_cmdline {
127 char cmdline[1]; /* this is the minimum size */
128};
129
130/* acorn RiscPC specific information */
131#define ATAG_ACORN 0x41000101
132
133struct tag_acorn {
134 __u32 memc_control_reg;
135 __u32 vram_pages;
136 __u8 sounddefault;
137 __u8 adfsdrives;
138};
139
140/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
141#define ATAG_MEMCLK 0x41000402
142
143struct tag_memclk {
144 __u32 fmemclk;
145};
146
147struct tag {
148 struct tag_header hdr;
149 union {
150 struct tag_core core;
151 struct tag_mem32 mem;
152 struct tag_videotext videotext;
153 struct tag_ramdisk ramdisk;
154 struct tag_initrd initrd;
155 struct tag_serialnr serialnr;
156 struct tag_revision revision;
157 struct tag_videolfb videolfb;
158 struct tag_cmdline cmdline;
159
160 /*
161 * Acorn specific
162 */
163 struct tag_acorn acorn;
164
165 /*
166 * DC21285 specific
167 */
168 struct tag_memclk memclk;
169 } u;
170};
171
172struct tagtable {
173 __u32 tag;
174 int (*parse)(const struct tag *);
175};
176
177#define tag_member_present(tag,member) \
178 ((unsigned long)(&((struct tag *)0L)->member + 1) \
179 <= (tag)->hdr.size * 4)
180
181#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
182#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
183
184#define for_each_tag(t,base) \
185 for (t = base; t->hdr.size; t = tag_next(t))
186
187
188#endif /* __ASMARM_SETUP_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/sigcontext.h created+35
...@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_SIGCONTEXT_H
3#define _ASMARM_SIGCONTEXT_H
4
5/*
6 * Signal context structure - contains all info to do with the state
7 * before the signal handler was invoked. Note: only add new entries
8 * to the end of the structure.
9 */
10struct sigcontext {
11 unsigned long trap_no;
12 unsigned long error_code;
13 unsigned long oldmask;
14 unsigned long arm_r0;
15 unsigned long arm_r1;
16 unsigned long arm_r2;
17 unsigned long arm_r3;
18 unsigned long arm_r4;
19 unsigned long arm_r5;
20 unsigned long arm_r6;
21 unsigned long arm_r7;
22 unsigned long arm_r8;
23 unsigned long arm_r9;
24 unsigned long arm_r10;
25 unsigned long arm_fp;
26 unsigned long arm_ip;
27 unsigned long arm_sp;
28 unsigned long arm_lr;
29 unsigned long arm_pc;
30 unsigned long arm_cpsr;
31 unsigned long fault_address;
32};
33
34
35#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/signal.h created+96
...@@ -0,0 +1,96 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_SIGNAL_H
3#define _ASMARM_SIGNAL_H
4
5#include <linux/types.h>
6
7/* Avoid too many header ordering problems. */
8struct siginfo;
9
10/* Here we must cater to libcs that poke about in kernel headers. */
11
12#define NSIG 32
13typedef unsigned long sigset_t;
14
15
16#define SIGHUP 1
17#define SIGINT 2
18#define SIGQUIT 3
19#define SIGILL 4
20#define SIGTRAP 5
21#define SIGABRT 6
22#define SIGIOT 6
23#define SIGBUS 7
24#define SIGFPE 8
25#define SIGKILL 9
26#define SIGUSR1 10
27#define SIGSEGV 11
28#define SIGUSR2 12
29#define SIGPIPE 13
30#define SIGALRM 14
31#define SIGTERM 15
32#define SIGSTKFLT 16
33#define SIGCHLD 17
34#define SIGCONT 18
35#define SIGSTOP 19
36#define SIGTSTP 20
37#define SIGTTIN 21
38#define SIGTTOU 22
39#define SIGURG 23
40#define SIGXCPU 24
41#define SIGXFSZ 25
42#define SIGVTALRM 26
43#define SIGPROF 27
44#define SIGWINCH 28
45#define SIGIO 29
46#define SIGPOLL SIGIO
47/*
48#define SIGLOST 29
49*/
50#define SIGPWR 30
51#define SIGSYS 31
52#define SIGUNUSED 31
53
54/* These should not be considered constants from userland. */
55#define SIGRTMIN 32
56#define SIGRTMAX _NSIG
57
58#define SIGSWI 32
59
60/*
61 * SA_THIRTYTWO historically meant deliver the signal in 32-bit mode, even if
62 * the task is running in 26-bit. But since the kernel no longer supports
63 * 26-bit mode, the flag has no effect.
64 */
65#define SA_THIRTYTWO 0x02000000
66#define SA_RESTORER 0x04000000
67
68#define MINSIGSTKSZ 2048
69#define SIGSTKSZ 8192
70
71#include <asm-generic/signal-defs.h>
72
73/* Here we must cater to libcs that poke about in kernel headers. */
74
75struct sigaction {
76 union {
77 __sighandler_t _sa_handler;
78 void (*_sa_sigaction)(int, struct siginfo *, void *);
79 } _u;
80 sigset_t sa_mask;
81 unsigned long sa_flags;
82 void (*sa_restorer)(void);
83};
84
85#define sa_handler _u._sa_handler
86#define sa_sigaction _u._sa_sigaction
87
88
89typedef struct sigaltstack {
90 void *ss_sp;
91 int ss_flags;
92 size_t ss_size;
93} stack_t;
94
95
96#endif /* _ASMARM_SIGNAL_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/stat.h created+88
...@@ -0,0 +1,88 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_STAT_H
3#define _ASMARM_STAT_H
4
5struct __old_kernel_stat {
6 unsigned short st_dev;
7 unsigned short st_ino;
8 unsigned short st_mode;
9 unsigned short st_nlink;
10 unsigned short st_uid;
11 unsigned short st_gid;
12 unsigned short st_rdev;
13 unsigned long st_size;
14 unsigned long st_atime;
15 unsigned long st_mtime;
16 unsigned long st_ctime;
17};
18
19#define STAT_HAVE_NSEC
20
21struct stat {
22#if defined(__ARMEB__)
23 unsigned short st_dev;
24 unsigned short __pad1;
25#else
26 unsigned long st_dev;
27#endif
28 unsigned long st_ino;
29 unsigned short st_mode;
30 unsigned short st_nlink;
31 unsigned short st_uid;
32 unsigned short st_gid;
33#if defined(__ARMEB__)
34 unsigned short st_rdev;
35 unsigned short __pad2;
36#else
37 unsigned long st_rdev;
38#endif
39 unsigned long st_size;
40 unsigned long st_blksize;
41 unsigned long st_blocks;
42 unsigned long st_atime;
43 unsigned long st_atime_nsec;
44 unsigned long st_mtime;
45 unsigned long st_mtime_nsec;
46 unsigned long st_ctime;
47 unsigned long st_ctime_nsec;
48 unsigned long __unused4;
49 unsigned long __unused5;
50};
51
52/* This matches struct stat64 in glibc2.1, hence the absolutely
53 * insane amounts of padding around dev_t's.
54 * Note: The kernel zero's the padded region because glibc might read them
55 * in the hope that the kernel has stretched to using larger sizes.
56 */
57struct stat64 {
58 unsigned long long st_dev;
59 unsigned char __pad0[4];
60
61#define STAT64_HAS_BROKEN_ST_INO 1
62 unsigned long __st_ino;
63 unsigned int st_mode;
64 unsigned int st_nlink;
65
66 unsigned long st_uid;
67 unsigned long st_gid;
68
69 unsigned long long st_rdev;
70 unsigned char __pad3[4];
71
72 long long st_size;
73 unsigned long st_blksize;
74 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
75
76 unsigned long st_atime;
77 unsigned long st_atime_nsec;
78
79 unsigned long st_mtime;
80 unsigned long st_mtime_nsec;
81
82 unsigned long st_ctime;
83 unsigned long st_ctime_nsec;
84
85 unsigned long long st_ino;
86};
87
88#endif
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-eabi.h created+407
...@@ -0,0 +1,407 @@
1#ifndef _ASM_UNISTD_EABI_H
2#define _ASM_UNISTD_EABI_H
3
4#define __NR_restart_syscall (__NR_SYSCALL_BASE + 0)
5#define __NR_exit (__NR_SYSCALL_BASE + 1)
6#define __NR_fork (__NR_SYSCALL_BASE + 2)
7#define __NR_read (__NR_SYSCALL_BASE + 3)
8#define __NR_write (__NR_SYSCALL_BASE + 4)
9#define __NR_open (__NR_SYSCALL_BASE + 5)
10#define __NR_close (__NR_SYSCALL_BASE + 6)
11#define __NR_creat (__NR_SYSCALL_BASE + 8)
12#define __NR_link (__NR_SYSCALL_BASE + 9)
13#define __NR_unlink (__NR_SYSCALL_BASE + 10)
14#define __NR_execve (__NR_SYSCALL_BASE + 11)
15#define __NR_chdir (__NR_SYSCALL_BASE + 12)
16#define __NR_mknod (__NR_SYSCALL_BASE + 14)
17#define __NR_chmod (__NR_SYSCALL_BASE + 15)
18#define __NR_lchown (__NR_SYSCALL_BASE + 16)
19#define __NR_lseek (__NR_SYSCALL_BASE + 19)
20#define __NR_getpid (__NR_SYSCALL_BASE + 20)
21#define __NR_mount (__NR_SYSCALL_BASE + 21)
22#define __NR_setuid (__NR_SYSCALL_BASE + 23)
23#define __NR_getuid (__NR_SYSCALL_BASE + 24)
24#define __NR_ptrace (__NR_SYSCALL_BASE + 26)
25#define __NR_pause (__NR_SYSCALL_BASE + 29)
26#define __NR_access (__NR_SYSCALL_BASE + 33)
27#define __NR_nice (__NR_SYSCALL_BASE + 34)
28#define __NR_sync (__NR_SYSCALL_BASE + 36)
29#define __NR_kill (__NR_SYSCALL_BASE + 37)
30#define __NR_rename (__NR_SYSCALL_BASE + 38)
31#define __NR_mkdir (__NR_SYSCALL_BASE + 39)
32#define __NR_rmdir (__NR_SYSCALL_BASE + 40)
33#define __NR_dup (__NR_SYSCALL_BASE + 41)
34#define __NR_pipe (__NR_SYSCALL_BASE + 42)
35#define __NR_times (__NR_SYSCALL_BASE + 43)
36#define __NR_brk (__NR_SYSCALL_BASE + 45)
37#define __NR_setgid (__NR_SYSCALL_BASE + 46)
38#define __NR_getgid (__NR_SYSCALL_BASE + 47)
39#define __NR_geteuid (__NR_SYSCALL_BASE + 49)
40#define __NR_getegid (__NR_SYSCALL_BASE + 50)
41#define __NR_acct (__NR_SYSCALL_BASE + 51)
42#define __NR_umount2 (__NR_SYSCALL_BASE + 52)
43#define __NR_ioctl (__NR_SYSCALL_BASE + 54)
44#define __NR_fcntl (__NR_SYSCALL_BASE + 55)
45#define __NR_setpgid (__NR_SYSCALL_BASE + 57)
46#define __NR_umask (__NR_SYSCALL_BASE + 60)
47#define __NR_chroot (__NR_SYSCALL_BASE + 61)
48#define __NR_ustat (__NR_SYSCALL_BASE + 62)
49#define __NR_dup2 (__NR_SYSCALL_BASE + 63)
50#define __NR_getppid (__NR_SYSCALL_BASE + 64)
51#define __NR_getpgrp (__NR_SYSCALL_BASE + 65)
52#define __NR_setsid (__NR_SYSCALL_BASE + 66)
53#define __NR_sigaction (__NR_SYSCALL_BASE + 67)
54#define __NR_setreuid (__NR_SYSCALL_BASE + 70)
55#define __NR_setregid (__NR_SYSCALL_BASE + 71)
56#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
57#define __NR_sigpending (__NR_SYSCALL_BASE + 73)
58#define __NR_sethostname (__NR_SYSCALL_BASE + 74)
59#define __NR_setrlimit (__NR_SYSCALL_BASE + 75)
60#define __NR_getrusage (__NR_SYSCALL_BASE + 77)
61#define __NR_gettimeofday (__NR_SYSCALL_BASE + 78)
62#define __NR_settimeofday (__NR_SYSCALL_BASE + 79)
63#define __NR_getgroups (__NR_SYSCALL_BASE + 80)
64#define __NR_setgroups (__NR_SYSCALL_BASE + 81)
65#define __NR_symlink (__NR_SYSCALL_BASE + 83)
66#define __NR_readlink (__NR_SYSCALL_BASE + 85)
67#define __NR_uselib (__NR_SYSCALL_BASE + 86)
68#define __NR_swapon (__NR_SYSCALL_BASE + 87)
69#define __NR_reboot (__NR_SYSCALL_BASE + 88)
70#define __NR_munmap (__NR_SYSCALL_BASE + 91)
71#define __NR_truncate (__NR_SYSCALL_BASE + 92)
72#define __NR_ftruncate (__NR_SYSCALL_BASE + 93)
73#define __NR_fchmod (__NR_SYSCALL_BASE + 94)
74#define __NR_fchown (__NR_SYSCALL_BASE + 95)
75#define __NR_getpriority (__NR_SYSCALL_BASE + 96)
76#define __NR_setpriority (__NR_SYSCALL_BASE + 97)
77#define __NR_statfs (__NR_SYSCALL_BASE + 99)
78#define __NR_fstatfs (__NR_SYSCALL_BASE + 100)
79#define __NR_syslog (__NR_SYSCALL_BASE + 103)
80#define __NR_setitimer (__NR_SYSCALL_BASE + 104)
81#define __NR_getitimer (__NR_SYSCALL_BASE + 105)
82#define __NR_stat (__NR_SYSCALL_BASE + 106)
83#define __NR_lstat (__NR_SYSCALL_BASE + 107)
84#define __NR_fstat (__NR_SYSCALL_BASE + 108)
85#define __NR_vhangup (__NR_SYSCALL_BASE + 111)
86#define __NR_wait4 (__NR_SYSCALL_BASE + 114)
87#define __NR_swapoff (__NR_SYSCALL_BASE + 115)
88#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
89#define __NR_fsync (__NR_SYSCALL_BASE + 118)
90#define __NR_sigreturn (__NR_SYSCALL_BASE + 119)
91#define __NR_clone (__NR_SYSCALL_BASE + 120)
92#define __NR_setdomainname (__NR_SYSCALL_BASE + 121)
93#define __NR_uname (__NR_SYSCALL_BASE + 122)
94#define __NR_adjtimex (__NR_SYSCALL_BASE + 124)
95#define __NR_mprotect (__NR_SYSCALL_BASE + 125)
96#define __NR_sigprocmask (__NR_SYSCALL_BASE + 126)
97#define __NR_init_module (__NR_SYSCALL_BASE + 128)
98#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
99#define __NR_quotactl (__NR_SYSCALL_BASE + 131)
100#define __NR_getpgid (__NR_SYSCALL_BASE + 132)
101#define __NR_fchdir (__NR_SYSCALL_BASE + 133)
102#define __NR_bdflush (__NR_SYSCALL_BASE + 134)
103#define __NR_sysfs (__NR_SYSCALL_BASE + 135)
104#define __NR_personality (__NR_SYSCALL_BASE + 136)
105#define __NR_setfsuid (__NR_SYSCALL_BASE + 138)
106#define __NR_setfsgid (__NR_SYSCALL_BASE + 139)
107#define __NR__llseek (__NR_SYSCALL_BASE + 140)
108#define __NR_getdents (__NR_SYSCALL_BASE + 141)
109#define __NR__newselect (__NR_SYSCALL_BASE + 142)
110#define __NR_flock (__NR_SYSCALL_BASE + 143)
111#define __NR_msync (__NR_SYSCALL_BASE + 144)
112#define __NR_readv (__NR_SYSCALL_BASE + 145)
113#define __NR_writev (__NR_SYSCALL_BASE + 146)
114#define __NR_getsid (__NR_SYSCALL_BASE + 147)
115#define __NR_fdatasync (__NR_SYSCALL_BASE + 148)
116#define __NR__sysctl (__NR_SYSCALL_BASE + 149)
117#define __NR_mlock (__NR_SYSCALL_BASE + 150)
118#define __NR_munlock (__NR_SYSCALL_BASE + 151)
119#define __NR_mlockall (__NR_SYSCALL_BASE + 152)
120#define __NR_munlockall (__NR_SYSCALL_BASE + 153)
121#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154)
122#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155)
123#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156)
124#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157)
125#define __NR_sched_yield (__NR_SYSCALL_BASE + 158)
126#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159)
127#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160)
128#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161)
129#define __NR_nanosleep (__NR_SYSCALL_BASE + 162)
130#define __NR_mremap (__NR_SYSCALL_BASE + 163)
131#define __NR_setresuid (__NR_SYSCALL_BASE + 164)
132#define __NR_getresuid (__NR_SYSCALL_BASE + 165)
133#define __NR_poll (__NR_SYSCALL_BASE + 168)
134#define __NR_nfsservctl (__NR_SYSCALL_BASE + 169)
135#define __NR_setresgid (__NR_SYSCALL_BASE + 170)
136#define __NR_getresgid (__NR_SYSCALL_BASE + 171)
137#define __NR_prctl (__NR_SYSCALL_BASE + 172)
138#define __NR_rt_sigreturn (__NR_SYSCALL_BASE + 173)
139#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
140#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
141#define __NR_rt_sigpending (__NR_SYSCALL_BASE + 176)
142#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177)
143#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE + 178)
144#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE + 179)
145#define __NR_pread64 (__NR_SYSCALL_BASE + 180)
146#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181)
147#define __NR_chown (__NR_SYSCALL_BASE + 182)
148#define __NR_getcwd (__NR_SYSCALL_BASE + 183)
149#define __NR_capget (__NR_SYSCALL_BASE + 184)
150#define __NR_capset (__NR_SYSCALL_BASE + 185)
151#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186)
152#define __NR_sendfile (__NR_SYSCALL_BASE + 187)
153#define __NR_vfork (__NR_SYSCALL_BASE + 190)
154#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191)
155#define __NR_mmap2 (__NR_SYSCALL_BASE + 192)
156#define __NR_truncate64 (__NR_SYSCALL_BASE + 193)
157#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194)
158#define __NR_stat64 (__NR_SYSCALL_BASE + 195)
159#define __NR_lstat64 (__NR_SYSCALL_BASE + 196)
160#define __NR_fstat64 (__NR_SYSCALL_BASE + 197)
161#define __NR_lchown32 (__NR_SYSCALL_BASE + 198)
162#define __NR_getuid32 (__NR_SYSCALL_BASE + 199)
163#define __NR_getgid32 (__NR_SYSCALL_BASE + 200)
164#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201)
165#define __NR_getegid32 (__NR_SYSCALL_BASE + 202)
166#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203)
167#define __NR_setregid32 (__NR_SYSCALL_BASE + 204)
168#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205)
169#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206)
170#define __NR_fchown32 (__NR_SYSCALL_BASE + 207)
171#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208)
172#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209)
173#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210)
174#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211)
175#define __NR_chown32 (__NR_SYSCALL_BASE + 212)
176#define __NR_setuid32 (__NR_SYSCALL_BASE + 213)
177#define __NR_setgid32 (__NR_SYSCALL_BASE + 214)
178#define __NR_setfsuid32 (__NR_SYSCALL_BASE + 215)
179#define __NR_setfsgid32 (__NR_SYSCALL_BASE + 216)
180#define __NR_getdents64 (__NR_SYSCALL_BASE + 217)
181#define __NR_pivot_root (__NR_SYSCALL_BASE + 218)
182#define __NR_mincore (__NR_SYSCALL_BASE + 219)
183#define __NR_madvise (__NR_SYSCALL_BASE + 220)
184#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221)
185#define __NR_gettid (__NR_SYSCALL_BASE + 224)
186#define __NR_readahead (__NR_SYSCALL_BASE + 225)
187#define __NR_setxattr (__NR_SYSCALL_BASE + 226)
188#define __NR_lsetxattr (__NR_SYSCALL_BASE + 227)
189#define __NR_fsetxattr (__NR_SYSCALL_BASE + 228)
190#define __NR_getxattr (__NR_SYSCALL_BASE + 229)
191#define __NR_lgetxattr (__NR_SYSCALL_BASE + 230)
192#define __NR_fgetxattr (__NR_SYSCALL_BASE + 231)
193#define __NR_listxattr (__NR_SYSCALL_BASE + 232)
194#define __NR_llistxattr (__NR_SYSCALL_BASE + 233)
195#define __NR_flistxattr (__NR_SYSCALL_BASE + 234)
196#define __NR_removexattr (__NR_SYSCALL_BASE + 235)
197#define __NR_lremovexattr (__NR_SYSCALL_BASE + 236)
198#define __NR_fremovexattr (__NR_SYSCALL_BASE + 237)
199#define __NR_tkill (__NR_SYSCALL_BASE + 238)
200#define __NR_sendfile64 (__NR_SYSCALL_BASE + 239)
201#define __NR_futex (__NR_SYSCALL_BASE + 240)
202#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241)
203#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242)
204#define __NR_io_setup (__NR_SYSCALL_BASE + 243)
205#define __NR_io_destroy (__NR_SYSCALL_BASE + 244)
206#define __NR_io_getevents (__NR_SYSCALL_BASE + 245)
207#define __NR_io_submit (__NR_SYSCALL_BASE + 246)
208#define __NR_io_cancel (__NR_SYSCALL_BASE + 247)
209#define __NR_exit_group (__NR_SYSCALL_BASE + 248)
210#define __NR_lookup_dcookie (__NR_SYSCALL_BASE + 249)
211#define __NR_epoll_create (__NR_SYSCALL_BASE + 250)
212#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251)
213#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252)
214#define __NR_remap_file_pages (__NR_SYSCALL_BASE + 253)
215#define __NR_set_tid_address (__NR_SYSCALL_BASE + 256)
216#define __NR_timer_create (__NR_SYSCALL_BASE + 257)
217#define __NR_timer_settime (__NR_SYSCALL_BASE + 258)
218#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259)
219#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260)
220#define __NR_timer_delete (__NR_SYSCALL_BASE + 261)
221#define __NR_clock_settime (__NR_SYSCALL_BASE + 262)
222#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263)
223#define __NR_clock_getres (__NR_SYSCALL_BASE + 264)
224#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265)
225#define __NR_statfs64 (__NR_SYSCALL_BASE + 266)
226#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267)
227#define __NR_tgkill (__NR_SYSCALL_BASE + 268)
228#define __NR_utimes (__NR_SYSCALL_BASE + 269)
229#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE + 270)
230#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE + 271)
231#define __NR_pciconfig_read (__NR_SYSCALL_BASE + 272)
232#define __NR_pciconfig_write (__NR_SYSCALL_BASE + 273)
233#define __NR_mq_open (__NR_SYSCALL_BASE + 274)
234#define __NR_mq_unlink (__NR_SYSCALL_BASE + 275)
235#define __NR_mq_timedsend (__NR_SYSCALL_BASE + 276)
236#define __NR_mq_timedreceive (__NR_SYSCALL_BASE + 277)
237#define __NR_mq_notify (__NR_SYSCALL_BASE + 278)
238#define __NR_mq_getsetattr (__NR_SYSCALL_BASE + 279)
239#define __NR_waitid (__NR_SYSCALL_BASE + 280)
240#define __NR_socket (__NR_SYSCALL_BASE + 281)
241#define __NR_bind (__NR_SYSCALL_BASE + 282)
242#define __NR_connect (__NR_SYSCALL_BASE + 283)
243#define __NR_listen (__NR_SYSCALL_BASE + 284)
244#define __NR_accept (__NR_SYSCALL_BASE + 285)
245#define __NR_getsockname (__NR_SYSCALL_BASE + 286)
246#define __NR_getpeername (__NR_SYSCALL_BASE + 287)
247#define __NR_socketpair (__NR_SYSCALL_BASE + 288)
248#define __NR_send (__NR_SYSCALL_BASE + 289)
249#define __NR_sendto (__NR_SYSCALL_BASE + 290)
250#define __NR_recv (__NR_SYSCALL_BASE + 291)
251#define __NR_recvfrom (__NR_SYSCALL_BASE + 292)
252#define __NR_shutdown (__NR_SYSCALL_BASE + 293)
253#define __NR_setsockopt (__NR_SYSCALL_BASE + 294)
254#define __NR_getsockopt (__NR_SYSCALL_BASE + 295)
255#define __NR_sendmsg (__NR_SYSCALL_BASE + 296)
256#define __NR_recvmsg (__NR_SYSCALL_BASE + 297)
257#define __NR_semop (__NR_SYSCALL_BASE + 298)
258#define __NR_semget (__NR_SYSCALL_BASE + 299)
259#define __NR_semctl (__NR_SYSCALL_BASE + 300)
260#define __NR_msgsnd (__NR_SYSCALL_BASE + 301)
261#define __NR_msgrcv (__NR_SYSCALL_BASE + 302)
262#define __NR_msgget (__NR_SYSCALL_BASE + 303)
263#define __NR_msgctl (__NR_SYSCALL_BASE + 304)
264#define __NR_shmat (__NR_SYSCALL_BASE + 305)
265#define __NR_shmdt (__NR_SYSCALL_BASE + 306)
266#define __NR_shmget (__NR_SYSCALL_BASE + 307)
267#define __NR_shmctl (__NR_SYSCALL_BASE + 308)
268#define __NR_add_key (__NR_SYSCALL_BASE + 309)
269#define __NR_request_key (__NR_SYSCALL_BASE + 310)
270#define __NR_keyctl (__NR_SYSCALL_BASE + 311)
271#define __NR_semtimedop (__NR_SYSCALL_BASE + 312)
272#define __NR_vserver (__NR_SYSCALL_BASE + 313)
273#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
274#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
275#define __NR_inotify_init (__NR_SYSCALL_BASE + 316)
276#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317)
277#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318)
278#define __NR_mbind (__NR_SYSCALL_BASE + 319)
279#define __NR_get_mempolicy (__NR_SYSCALL_BASE + 320)
280#define __NR_set_mempolicy (__NR_SYSCALL_BASE + 321)
281#define __NR_openat (__NR_SYSCALL_BASE + 322)
282#define __NR_mkdirat (__NR_SYSCALL_BASE + 323)
283#define __NR_mknodat (__NR_SYSCALL_BASE + 324)
284#define __NR_fchownat (__NR_SYSCALL_BASE + 325)
285#define __NR_futimesat (__NR_SYSCALL_BASE + 326)
286#define __NR_fstatat64 (__NR_SYSCALL_BASE + 327)
287#define __NR_unlinkat (__NR_SYSCALL_BASE + 328)
288#define __NR_renameat (__NR_SYSCALL_BASE + 329)
289#define __NR_linkat (__NR_SYSCALL_BASE + 330)
290#define __NR_symlinkat (__NR_SYSCALL_BASE + 331)
291#define __NR_readlinkat (__NR_SYSCALL_BASE + 332)
292#define __NR_fchmodat (__NR_SYSCALL_BASE + 333)
293#define __NR_faccessat (__NR_SYSCALL_BASE + 334)
294#define __NR_pselect6 (__NR_SYSCALL_BASE + 335)
295#define __NR_ppoll (__NR_SYSCALL_BASE + 336)
296#define __NR_unshare (__NR_SYSCALL_BASE + 337)
297#define __NR_set_robust_list (__NR_SYSCALL_BASE + 338)
298#define __NR_get_robust_list (__NR_SYSCALL_BASE + 339)
299#define __NR_splice (__NR_SYSCALL_BASE + 340)
300#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE + 341)
301#define __NR_tee (__NR_SYSCALL_BASE + 342)
302#define __NR_vmsplice (__NR_SYSCALL_BASE + 343)
303#define __NR_move_pages (__NR_SYSCALL_BASE + 344)
304#define __NR_getcpu (__NR_SYSCALL_BASE + 345)
305#define __NR_epoll_pwait (__NR_SYSCALL_BASE + 346)
306#define __NR_kexec_load (__NR_SYSCALL_BASE + 347)
307#define __NR_utimensat (__NR_SYSCALL_BASE + 348)
308#define __NR_signalfd (__NR_SYSCALL_BASE + 349)
309#define __NR_timerfd_create (__NR_SYSCALL_BASE + 350)
310#define __NR_eventfd (__NR_SYSCALL_BASE + 351)
311#define __NR_fallocate (__NR_SYSCALL_BASE + 352)
312#define __NR_timerfd_settime (__NR_SYSCALL_BASE + 353)
313#define __NR_timerfd_gettime (__NR_SYSCALL_BASE + 354)
314#define __NR_signalfd4 (__NR_SYSCALL_BASE + 355)
315#define __NR_eventfd2 (__NR_SYSCALL_BASE + 356)
316#define __NR_epoll_create1 (__NR_SYSCALL_BASE + 357)
317#define __NR_dup3 (__NR_SYSCALL_BASE + 358)
318#define __NR_pipe2 (__NR_SYSCALL_BASE + 359)
319#define __NR_inotify_init1 (__NR_SYSCALL_BASE + 360)
320#define __NR_preadv (__NR_SYSCALL_BASE + 361)
321#define __NR_pwritev (__NR_SYSCALL_BASE + 362)
322#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE + 363)
323#define __NR_perf_event_open (__NR_SYSCALL_BASE + 364)
324#define __NR_recvmmsg (__NR_SYSCALL_BASE + 365)
325#define __NR_accept4 (__NR_SYSCALL_BASE + 366)
326#define __NR_fanotify_init (__NR_SYSCALL_BASE + 367)
327#define __NR_fanotify_mark (__NR_SYSCALL_BASE + 368)
328#define __NR_prlimit64 (__NR_SYSCALL_BASE + 369)
329#define __NR_name_to_handle_at (__NR_SYSCALL_BASE + 370)
330#define __NR_open_by_handle_at (__NR_SYSCALL_BASE + 371)
331#define __NR_clock_adjtime (__NR_SYSCALL_BASE + 372)
332#define __NR_syncfs (__NR_SYSCALL_BASE + 373)
333#define __NR_sendmmsg (__NR_SYSCALL_BASE + 374)
334#define __NR_setns (__NR_SYSCALL_BASE + 375)
335#define __NR_process_vm_readv (__NR_SYSCALL_BASE + 376)
336#define __NR_process_vm_writev (__NR_SYSCALL_BASE + 377)
337#define __NR_kcmp (__NR_SYSCALL_BASE + 378)
338#define __NR_finit_module (__NR_SYSCALL_BASE + 379)
339#define __NR_sched_setattr (__NR_SYSCALL_BASE + 380)
340#define __NR_sched_getattr (__NR_SYSCALL_BASE + 381)
341#define __NR_renameat2 (__NR_SYSCALL_BASE + 382)
342#define __NR_seccomp (__NR_SYSCALL_BASE + 383)
343#define __NR_getrandom (__NR_SYSCALL_BASE + 384)
344#define __NR_memfd_create (__NR_SYSCALL_BASE + 385)
345#define __NR_bpf (__NR_SYSCALL_BASE + 386)
346#define __NR_execveat (__NR_SYSCALL_BASE + 387)
347#define __NR_userfaultfd (__NR_SYSCALL_BASE + 388)
348#define __NR_membarrier (__NR_SYSCALL_BASE + 389)
349#define __NR_mlock2 (__NR_SYSCALL_BASE + 390)
350#define __NR_copy_file_range (__NR_SYSCALL_BASE + 391)
351#define __NR_preadv2 (__NR_SYSCALL_BASE + 392)
352#define __NR_pwritev2 (__NR_SYSCALL_BASE + 393)
353#define __NR_pkey_mprotect (__NR_SYSCALL_BASE + 394)
354#define __NR_pkey_alloc (__NR_SYSCALL_BASE + 395)
355#define __NR_pkey_free (__NR_SYSCALL_BASE + 396)
356#define __NR_statx (__NR_SYSCALL_BASE + 397)
357#define __NR_rseq (__NR_SYSCALL_BASE + 398)
358#define __NR_io_pgetevents (__NR_SYSCALL_BASE + 399)
359#define __NR_migrate_pages (__NR_SYSCALL_BASE + 400)
360#define __NR_kexec_file_load (__NR_SYSCALL_BASE + 401)
361#define __NR_clock_gettime64 (__NR_SYSCALL_BASE + 403)
362#define __NR_clock_settime64 (__NR_SYSCALL_BASE + 404)
363#define __NR_clock_adjtime64 (__NR_SYSCALL_BASE + 405)
364#define __NR_clock_getres_time64 (__NR_SYSCALL_BASE + 406)
365#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE + 407)
366#define __NR_timer_gettime64 (__NR_SYSCALL_BASE + 408)
367#define __NR_timer_settime64 (__NR_SYSCALL_BASE + 409)
368#define __NR_timerfd_gettime64 (__NR_SYSCALL_BASE + 410)
369#define __NR_timerfd_settime64 (__NR_SYSCALL_BASE + 411)
370#define __NR_utimensat_time64 (__NR_SYSCALL_BASE + 412)
371#define __NR_pselect6_time64 (__NR_SYSCALL_BASE + 413)
372#define __NR_ppoll_time64 (__NR_SYSCALL_BASE + 414)
373#define __NR_io_pgetevents_time64 (__NR_SYSCALL_BASE + 416)
374#define __NR_recvmmsg_time64 (__NR_SYSCALL_BASE + 417)
375#define __NR_mq_timedsend_time64 (__NR_SYSCALL_BASE + 418)
376#define __NR_mq_timedreceive_time64 (__NR_SYSCALL_BASE + 419)
377#define __NR_semtimedop_time64 (__NR_SYSCALL_BASE + 420)
378#define __NR_rt_sigtimedwait_time64 (__NR_SYSCALL_BASE + 421)
379#define __NR_futex_time64 (__NR_SYSCALL_BASE + 422)
380#define __NR_sched_rr_get_interval_time64 (__NR_SYSCALL_BASE + 423)
381#define __NR_pidfd_send_signal (__NR_SYSCALL_BASE + 424)
382#define __NR_io_uring_setup (__NR_SYSCALL_BASE + 425)
383#define __NR_io_uring_enter (__NR_SYSCALL_BASE + 426)
384#define __NR_io_uring_register (__NR_SYSCALL_BASE + 427)
385#define __NR_open_tree (__NR_SYSCALL_BASE + 428)
386#define __NR_move_mount (__NR_SYSCALL_BASE + 429)
387#define __NR_fsopen (__NR_SYSCALL_BASE + 430)
388#define __NR_fsconfig (__NR_SYSCALL_BASE + 431)
389#define __NR_fsmount (__NR_SYSCALL_BASE + 432)
390#define __NR_fspick (__NR_SYSCALL_BASE + 433)
391#define __NR_pidfd_open (__NR_SYSCALL_BASE + 434)
392#define __NR_clone3 (__NR_SYSCALL_BASE + 435)
393#define __NR_close_range (__NR_SYSCALL_BASE + 436)
394#define __NR_openat2 (__NR_SYSCALL_BASE + 437)
395#define __NR_pidfd_getfd (__NR_SYSCALL_BASE + 438)
396#define __NR_faccessat2 (__NR_SYSCALL_BASE + 439)
397#define __NR_process_madvise (__NR_SYSCALL_BASE + 440)
398#define __NR_epoll_pwait2 (__NR_SYSCALL_BASE + 441)
399#define __NR_mount_setattr (__NR_SYSCALL_BASE + 442)
400#define __NR_quotactl_fd (__NR_SYSCALL_BASE + 443)
401#define __NR_landlock_create_ruleset (__NR_SYSCALL_BASE + 444)
402#define __NR_landlock_add_rule (__NR_SYSCALL_BASE + 445)
403#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
404#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
405#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
406
407#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h created+419
...@@ -0,0 +1,419 @@
1#ifndef _ASM_UNISTD_OABI_H
2#define _ASM_UNISTD_OABI_H
3
4#define __NR_restart_syscall (__NR_SYSCALL_BASE + 0)
5#define __NR_exit (__NR_SYSCALL_BASE + 1)
6#define __NR_fork (__NR_SYSCALL_BASE + 2)
7#define __NR_read (__NR_SYSCALL_BASE + 3)
8#define __NR_write (__NR_SYSCALL_BASE + 4)
9#define __NR_open (__NR_SYSCALL_BASE + 5)
10#define __NR_close (__NR_SYSCALL_BASE + 6)
11#define __NR_creat (__NR_SYSCALL_BASE + 8)
12#define __NR_link (__NR_SYSCALL_BASE + 9)
13#define __NR_unlink (__NR_SYSCALL_BASE + 10)
14#define __NR_execve (__NR_SYSCALL_BASE + 11)
15#define __NR_chdir (__NR_SYSCALL_BASE + 12)
16#define __NR_time (__NR_SYSCALL_BASE + 13)
17#define __NR_mknod (__NR_SYSCALL_BASE + 14)
18#define __NR_chmod (__NR_SYSCALL_BASE + 15)
19#define __NR_lchown (__NR_SYSCALL_BASE + 16)
20#define __NR_lseek (__NR_SYSCALL_BASE + 19)
21#define __NR_getpid (__NR_SYSCALL_BASE + 20)
22#define __NR_mount (__NR_SYSCALL_BASE + 21)
23#define __NR_umount (__NR_SYSCALL_BASE + 22)
24#define __NR_setuid (__NR_SYSCALL_BASE + 23)
25#define __NR_getuid (__NR_SYSCALL_BASE + 24)
26#define __NR_stime (__NR_SYSCALL_BASE + 25)
27#define __NR_ptrace (__NR_SYSCALL_BASE + 26)
28#define __NR_alarm (__NR_SYSCALL_BASE + 27)
29#define __NR_pause (__NR_SYSCALL_BASE + 29)
30#define __NR_utime (__NR_SYSCALL_BASE + 30)
31#define __NR_access (__NR_SYSCALL_BASE + 33)
32#define __NR_nice (__NR_SYSCALL_BASE + 34)
33#define __NR_sync (__NR_SYSCALL_BASE + 36)
34#define __NR_kill (__NR_SYSCALL_BASE + 37)
35#define __NR_rename (__NR_SYSCALL_BASE + 38)
36#define __NR_mkdir (__NR_SYSCALL_BASE + 39)
37#define __NR_rmdir (__NR_SYSCALL_BASE + 40)
38#define __NR_dup (__NR_SYSCALL_BASE + 41)
39#define __NR_pipe (__NR_SYSCALL_BASE + 42)
40#define __NR_times (__NR_SYSCALL_BASE + 43)
41#define __NR_brk (__NR_SYSCALL_BASE + 45)
42#define __NR_setgid (__NR_SYSCALL_BASE + 46)
43#define __NR_getgid (__NR_SYSCALL_BASE + 47)
44#define __NR_geteuid (__NR_SYSCALL_BASE + 49)
45#define __NR_getegid (__NR_SYSCALL_BASE + 50)
46#define __NR_acct (__NR_SYSCALL_BASE + 51)
47#define __NR_umount2 (__NR_SYSCALL_BASE + 52)
48#define __NR_ioctl (__NR_SYSCALL_BASE + 54)
49#define __NR_fcntl (__NR_SYSCALL_BASE + 55)
50#define __NR_setpgid (__NR_SYSCALL_BASE + 57)
51#define __NR_umask (__NR_SYSCALL_BASE + 60)
52#define __NR_chroot (__NR_SYSCALL_BASE + 61)
53#define __NR_ustat (__NR_SYSCALL_BASE + 62)
54#define __NR_dup2 (__NR_SYSCALL_BASE + 63)
55#define __NR_getppid (__NR_SYSCALL_BASE + 64)
56#define __NR_getpgrp (__NR_SYSCALL_BASE + 65)
57#define __NR_setsid (__NR_SYSCALL_BASE + 66)
58#define __NR_sigaction (__NR_SYSCALL_BASE + 67)
59#define __NR_setreuid (__NR_SYSCALL_BASE + 70)
60#define __NR_setregid (__NR_SYSCALL_BASE + 71)
61#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
62#define __NR_sigpending (__NR_SYSCALL_BASE + 73)
63#define __NR_sethostname (__NR_SYSCALL_BASE + 74)
64#define __NR_setrlimit (__NR_SYSCALL_BASE + 75)
65#define __NR_getrlimit (__NR_SYSCALL_BASE + 76)
66#define __NR_getrusage (__NR_SYSCALL_BASE + 77)
67#define __NR_gettimeofday (__NR_SYSCALL_BASE + 78)
68#define __NR_settimeofday (__NR_SYSCALL_BASE + 79)
69#define __NR_getgroups (__NR_SYSCALL_BASE + 80)
70#define __NR_setgroups (__NR_SYSCALL_BASE + 81)
71#define __NR_select (__NR_SYSCALL_BASE + 82)
72#define __NR_symlink (__NR_SYSCALL_BASE + 83)
73#define __NR_readlink (__NR_SYSCALL_BASE + 85)
74#define __NR_uselib (__NR_SYSCALL_BASE + 86)
75#define __NR_swapon (__NR_SYSCALL_BASE + 87)
76#define __NR_reboot (__NR_SYSCALL_BASE + 88)
77#define __NR_readdir (__NR_SYSCALL_BASE + 89)
78#define __NR_mmap (__NR_SYSCALL_BASE + 90)
79#define __NR_munmap (__NR_SYSCALL_BASE + 91)
80#define __NR_truncate (__NR_SYSCALL_BASE + 92)
81#define __NR_ftruncate (__NR_SYSCALL_BASE + 93)
82#define __NR_fchmod (__NR_SYSCALL_BASE + 94)
83#define __NR_fchown (__NR_SYSCALL_BASE + 95)
84#define __NR_getpriority (__NR_SYSCALL_BASE + 96)
85#define __NR_setpriority (__NR_SYSCALL_BASE + 97)
86#define __NR_statfs (__NR_SYSCALL_BASE + 99)
87#define __NR_fstatfs (__NR_SYSCALL_BASE + 100)
88#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
89#define __NR_syslog (__NR_SYSCALL_BASE + 103)
90#define __NR_setitimer (__NR_SYSCALL_BASE + 104)
91#define __NR_getitimer (__NR_SYSCALL_BASE + 105)
92#define __NR_stat (__NR_SYSCALL_BASE + 106)
93#define __NR_lstat (__NR_SYSCALL_BASE + 107)
94#define __NR_fstat (__NR_SYSCALL_BASE + 108)
95#define __NR_vhangup (__NR_SYSCALL_BASE + 111)
96#define __NR_syscall (__NR_SYSCALL_BASE + 113)
97#define __NR_wait4 (__NR_SYSCALL_BASE + 114)
98#define __NR_swapoff (__NR_SYSCALL_BASE + 115)
99#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
100#define __NR_ipc (__NR_SYSCALL_BASE + 117)
101#define __NR_fsync (__NR_SYSCALL_BASE + 118)
102#define __NR_sigreturn (__NR_SYSCALL_BASE + 119)
103#define __NR_clone (__NR_SYSCALL_BASE + 120)
104#define __NR_setdomainname (__NR_SYSCALL_BASE + 121)
105#define __NR_uname (__NR_SYSCALL_BASE + 122)
106#define __NR_adjtimex (__NR_SYSCALL_BASE + 124)
107#define __NR_mprotect (__NR_SYSCALL_BASE + 125)
108#define __NR_sigprocmask (__NR_SYSCALL_BASE + 126)
109#define __NR_init_module (__NR_SYSCALL_BASE + 128)
110#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
111#define __NR_quotactl (__NR_SYSCALL_BASE + 131)
112#define __NR_getpgid (__NR_SYSCALL_BASE + 132)
113#define __NR_fchdir (__NR_SYSCALL_BASE + 133)
114#define __NR_bdflush (__NR_SYSCALL_BASE + 134)
115#define __NR_sysfs (__NR_SYSCALL_BASE + 135)
116#define __NR_personality (__NR_SYSCALL_BASE + 136)
117#define __NR_setfsuid (__NR_SYSCALL_BASE + 138)
118#define __NR_setfsgid (__NR_SYSCALL_BASE + 139)
119#define __NR__llseek (__NR_SYSCALL_BASE + 140)
120#define __NR_getdents (__NR_SYSCALL_BASE + 141)
121#define __NR__newselect (__NR_SYSCALL_BASE + 142)
122#define __NR_flock (__NR_SYSCALL_BASE + 143)
123#define __NR_msync (__NR_SYSCALL_BASE + 144)
124#define __NR_readv (__NR_SYSCALL_BASE + 145)
125#define __NR_writev (__NR_SYSCALL_BASE + 146)
126#define __NR_getsid (__NR_SYSCALL_BASE + 147)
127#define __NR_fdatasync (__NR_SYSCALL_BASE + 148)
128#define __NR__sysctl (__NR_SYSCALL_BASE + 149)
129#define __NR_mlock (__NR_SYSCALL_BASE + 150)
130#define __NR_munlock (__NR_SYSCALL_BASE + 151)
131#define __NR_mlockall (__NR_SYSCALL_BASE + 152)
132#define __NR_munlockall (__NR_SYSCALL_BASE + 153)
133#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154)
134#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155)
135#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156)
136#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157)
137#define __NR_sched_yield (__NR_SYSCALL_BASE + 158)
138#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159)
139#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160)
140#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161)
141#define __NR_nanosleep (__NR_SYSCALL_BASE + 162)
142#define __NR_mremap (__NR_SYSCALL_BASE + 163)
143#define __NR_setresuid (__NR_SYSCALL_BASE + 164)
144#define __NR_getresuid (__NR_SYSCALL_BASE + 165)
145#define __NR_poll (__NR_SYSCALL_BASE + 168)
146#define __NR_nfsservctl (__NR_SYSCALL_BASE + 169)
147#define __NR_setresgid (__NR_SYSCALL_BASE + 170)
148#define __NR_getresgid (__NR_SYSCALL_BASE + 171)
149#define __NR_prctl (__NR_SYSCALL_BASE + 172)
150#define __NR_rt_sigreturn (__NR_SYSCALL_BASE + 173)
151#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
152#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
153#define __NR_rt_sigpending (__NR_SYSCALL_BASE + 176)
154#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177)
155#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE + 178)
156#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE + 179)
157#define __NR_pread64 (__NR_SYSCALL_BASE + 180)
158#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181)
159#define __NR_chown (__NR_SYSCALL_BASE + 182)
160#define __NR_getcwd (__NR_SYSCALL_BASE + 183)
161#define __NR_capget (__NR_SYSCALL_BASE + 184)
162#define __NR_capset (__NR_SYSCALL_BASE + 185)
163#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186)
164#define __NR_sendfile (__NR_SYSCALL_BASE + 187)
165#define __NR_vfork (__NR_SYSCALL_BASE + 190)
166#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191)
167#define __NR_mmap2 (__NR_SYSCALL_BASE + 192)
168#define __NR_truncate64 (__NR_SYSCALL_BASE + 193)
169#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194)
170#define __NR_stat64 (__NR_SYSCALL_BASE + 195)
171#define __NR_lstat64 (__NR_SYSCALL_BASE + 196)
172#define __NR_fstat64 (__NR_SYSCALL_BASE + 197)
173#define __NR_lchown32 (__NR_SYSCALL_BASE + 198)
174#define __NR_getuid32 (__NR_SYSCALL_BASE + 199)
175#define __NR_getgid32 (__NR_SYSCALL_BASE + 200)
176#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201)
177#define __NR_getegid32 (__NR_SYSCALL_BASE + 202)
178#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203)
179#define __NR_setregid32 (__NR_SYSCALL_BASE + 204)
180#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205)
181#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206)
182#define __NR_fchown32 (__NR_SYSCALL_BASE + 207)
183#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208)
184#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209)
185#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210)
186#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211)
187#define __NR_chown32 (__NR_SYSCALL_BASE + 212)
188#define __NR_setuid32 (__NR_SYSCALL_BASE + 213)
189#define __NR_setgid32 (__NR_SYSCALL_BASE + 214)
190#define __NR_setfsuid32 (__NR_SYSCALL_BASE + 215)
191#define __NR_setfsgid32 (__NR_SYSCALL_BASE + 216)
192#define __NR_getdents64 (__NR_SYSCALL_BASE + 217)
193#define __NR_pivot_root (__NR_SYSCALL_BASE + 218)
194#define __NR_mincore (__NR_SYSCALL_BASE + 219)
195#define __NR_madvise (__NR_SYSCALL_BASE + 220)
196#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221)
197#define __NR_gettid (__NR_SYSCALL_BASE + 224)
198#define __NR_readahead (__NR_SYSCALL_BASE + 225)
199#define __NR_setxattr (__NR_SYSCALL_BASE + 226)
200#define __NR_lsetxattr (__NR_SYSCALL_BASE + 227)
201#define __NR_fsetxattr (__NR_SYSCALL_BASE + 228)
202#define __NR_getxattr (__NR_SYSCALL_BASE + 229)
203#define __NR_lgetxattr (__NR_SYSCALL_BASE + 230)
204#define __NR_fgetxattr (__NR_SYSCALL_BASE + 231)
205#define __NR_listxattr (__NR_SYSCALL_BASE + 232)
206#define __NR_llistxattr (__NR_SYSCALL_BASE + 233)
207#define __NR_flistxattr (__NR_SYSCALL_BASE + 234)
208#define __NR_removexattr (__NR_SYSCALL_BASE + 235)
209#define __NR_lremovexattr (__NR_SYSCALL_BASE + 236)
210#define __NR_fremovexattr (__NR_SYSCALL_BASE + 237)
211#define __NR_tkill (__NR_SYSCALL_BASE + 238)
212#define __NR_sendfile64 (__NR_SYSCALL_BASE + 239)
213#define __NR_futex (__NR_SYSCALL_BASE + 240)
214#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241)
215#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242)
216#define __NR_io_setup (__NR_SYSCALL_BASE + 243)
217#define __NR_io_destroy (__NR_SYSCALL_BASE + 244)
218#define __NR_io_getevents (__NR_SYSCALL_BASE + 245)
219#define __NR_io_submit (__NR_SYSCALL_BASE + 246)
220#define __NR_io_cancel (__NR_SYSCALL_BASE + 247)
221#define __NR_exit_group (__NR_SYSCALL_BASE + 248)
222#define __NR_lookup_dcookie (__NR_SYSCALL_BASE + 249)
223#define __NR_epoll_create (__NR_SYSCALL_BASE + 250)
224#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251)
225#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252)
226#define __NR_remap_file_pages (__NR_SYSCALL_BASE + 253)
227#define __NR_set_tid_address (__NR_SYSCALL_BASE + 256)
228#define __NR_timer_create (__NR_SYSCALL_BASE + 257)
229#define __NR_timer_settime (__NR_SYSCALL_BASE + 258)
230#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259)
231#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260)
232#define __NR_timer_delete (__NR_SYSCALL_BASE + 261)
233#define __NR_clock_settime (__NR_SYSCALL_BASE + 262)
234#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263)
235#define __NR_clock_getres (__NR_SYSCALL_BASE + 264)
236#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265)
237#define __NR_statfs64 (__NR_SYSCALL_BASE + 266)
238#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267)
239#define __NR_tgkill (__NR_SYSCALL_BASE + 268)
240#define __NR_utimes (__NR_SYSCALL_BASE + 269)
241#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE + 270)
242#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE + 271)
243#define __NR_pciconfig_read (__NR_SYSCALL_BASE + 272)
244#define __NR_pciconfig_write (__NR_SYSCALL_BASE + 273)
245#define __NR_mq_open (__NR_SYSCALL_BASE + 274)
246#define __NR_mq_unlink (__NR_SYSCALL_BASE + 275)
247#define __NR_mq_timedsend (__NR_SYSCALL_BASE + 276)
248#define __NR_mq_timedreceive (__NR_SYSCALL_BASE + 277)
249#define __NR_mq_notify (__NR_SYSCALL_BASE + 278)
250#define __NR_mq_getsetattr (__NR_SYSCALL_BASE + 279)
251#define __NR_waitid (__NR_SYSCALL_BASE + 280)
252#define __NR_socket (__NR_SYSCALL_BASE + 281)
253#define __NR_bind (__NR_SYSCALL_BASE + 282)
254#define __NR_connect (__NR_SYSCALL_BASE + 283)
255#define __NR_listen (__NR_SYSCALL_BASE + 284)
256#define __NR_accept (__NR_SYSCALL_BASE + 285)
257#define __NR_getsockname (__NR_SYSCALL_BASE + 286)
258#define __NR_getpeername (__NR_SYSCALL_BASE + 287)
259#define __NR_socketpair (__NR_SYSCALL_BASE + 288)
260#define __NR_send (__NR_SYSCALL_BASE + 289)
261#define __NR_sendto (__NR_SYSCALL_BASE + 290)
262#define __NR_recv (__NR_SYSCALL_BASE + 291)
263#define __NR_recvfrom (__NR_SYSCALL_BASE + 292)
264#define __NR_shutdown (__NR_SYSCALL_BASE + 293)
265#define __NR_setsockopt (__NR_SYSCALL_BASE + 294)
266#define __NR_getsockopt (__NR_SYSCALL_BASE + 295)
267#define __NR_sendmsg (__NR_SYSCALL_BASE + 296)
268#define __NR_recvmsg (__NR_SYSCALL_BASE + 297)
269#define __NR_semop (__NR_SYSCALL_BASE + 298)
270#define __NR_semget (__NR_SYSCALL_BASE + 299)
271#define __NR_semctl (__NR_SYSCALL_BASE + 300)
272#define __NR_msgsnd (__NR_SYSCALL_BASE + 301)
273#define __NR_msgrcv (__NR_SYSCALL_BASE + 302)
274#define __NR_msgget (__NR_SYSCALL_BASE + 303)
275#define __NR_msgctl (__NR_SYSCALL_BASE + 304)
276#define __NR_shmat (__NR_SYSCALL_BASE + 305)
277#define __NR_shmdt (__NR_SYSCALL_BASE + 306)
278#define __NR_shmget (__NR_SYSCALL_BASE + 307)
279#define __NR_shmctl (__NR_SYSCALL_BASE + 308)
280#define __NR_add_key (__NR_SYSCALL_BASE + 309)
281#define __NR_request_key (__NR_SYSCALL_BASE + 310)
282#define __NR_keyctl (__NR_SYSCALL_BASE + 311)
283#define __NR_semtimedop (__NR_SYSCALL_BASE + 312)
284#define __NR_vserver (__NR_SYSCALL_BASE + 313)
285#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
286#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
287#define __NR_inotify_init (__NR_SYSCALL_BASE + 316)
288#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317)
289#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318)
290#define __NR_mbind (__NR_SYSCALL_BASE + 319)
291#define __NR_get_mempolicy (__NR_SYSCALL_BASE + 320)
292#define __NR_set_mempolicy (__NR_SYSCALL_BASE + 321)
293#define __NR_openat (__NR_SYSCALL_BASE + 322)
294#define __NR_mkdirat (__NR_SYSCALL_BASE + 323)
295#define __NR_mknodat (__NR_SYSCALL_BASE + 324)
296#define __NR_fchownat (__NR_SYSCALL_BASE + 325)
297#define __NR_futimesat (__NR_SYSCALL_BASE + 326)
298#define __NR_fstatat64 (__NR_SYSCALL_BASE + 327)
299#define __NR_unlinkat (__NR_SYSCALL_BASE + 328)
300#define __NR_renameat (__NR_SYSCALL_BASE + 329)
301#define __NR_linkat (__NR_SYSCALL_BASE + 330)
302#define __NR_symlinkat (__NR_SYSCALL_BASE + 331)
303#define __NR_readlinkat (__NR_SYSCALL_BASE + 332)
304#define __NR_fchmodat (__NR_SYSCALL_BASE + 333)
305#define __NR_faccessat (__NR_SYSCALL_BASE + 334)
306#define __NR_pselect6 (__NR_SYSCALL_BASE + 335)
307#define __NR_ppoll (__NR_SYSCALL_BASE + 336)
308#define __NR_unshare (__NR_SYSCALL_BASE + 337)
309#define __NR_set_robust_list (__NR_SYSCALL_BASE + 338)
310#define __NR_get_robust_list (__NR_SYSCALL_BASE + 339)
311#define __NR_splice (__NR_SYSCALL_BASE + 340)
312#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE + 341)
313#define __NR_tee (__NR_SYSCALL_BASE + 342)
314#define __NR_vmsplice (__NR_SYSCALL_BASE + 343)
315#define __NR_move_pages (__NR_SYSCALL_BASE + 344)
316#define __NR_getcpu (__NR_SYSCALL_BASE + 345)
317#define __NR_epoll_pwait (__NR_SYSCALL_BASE + 346)
318#define __NR_kexec_load (__NR_SYSCALL_BASE + 347)
319#define __NR_utimensat (__NR_SYSCALL_BASE + 348)
320#define __NR_signalfd (__NR_SYSCALL_BASE + 349)
321#define __NR_timerfd_create (__NR_SYSCALL_BASE + 350)
322#define __NR_eventfd (__NR_SYSCALL_BASE + 351)
323#define __NR_fallocate (__NR_SYSCALL_BASE + 352)
324#define __NR_timerfd_settime (__NR_SYSCALL_BASE + 353)
325#define __NR_timerfd_gettime (__NR_SYSCALL_BASE + 354)
326#define __NR_signalfd4 (__NR_SYSCALL_BASE + 355)
327#define __NR_eventfd2 (__NR_SYSCALL_BASE + 356)
328#define __NR_epoll_create1 (__NR_SYSCALL_BASE + 357)
329#define __NR_dup3 (__NR_SYSCALL_BASE + 358)
330#define __NR_pipe2 (__NR_SYSCALL_BASE + 359)
331#define __NR_inotify_init1 (__NR_SYSCALL_BASE + 360)
332#define __NR_preadv (__NR_SYSCALL_BASE + 361)
333#define __NR_pwritev (__NR_SYSCALL_BASE + 362)
334#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE + 363)
335#define __NR_perf_event_open (__NR_SYSCALL_BASE + 364)
336#define __NR_recvmmsg (__NR_SYSCALL_BASE + 365)
337#define __NR_accept4 (__NR_SYSCALL_BASE + 366)
338#define __NR_fanotify_init (__NR_SYSCALL_BASE + 367)
339#define __NR_fanotify_mark (__NR_SYSCALL_BASE + 368)
340#define __NR_prlimit64 (__NR_SYSCALL_BASE + 369)
341#define __NR_name_to_handle_at (__NR_SYSCALL_BASE + 370)
342#define __NR_open_by_handle_at (__NR_SYSCALL_BASE + 371)
343#define __NR_clock_adjtime (__NR_SYSCALL_BASE + 372)
344#define __NR_syncfs (__NR_SYSCALL_BASE + 373)
345#define __NR_sendmmsg (__NR_SYSCALL_BASE + 374)
346#define __NR_setns (__NR_SYSCALL_BASE + 375)
347#define __NR_process_vm_readv (__NR_SYSCALL_BASE + 376)
348#define __NR_process_vm_writev (__NR_SYSCALL_BASE + 377)
349#define __NR_kcmp (__NR_SYSCALL_BASE + 378)
350#define __NR_finit_module (__NR_SYSCALL_BASE + 379)
351#define __NR_sched_setattr (__NR_SYSCALL_BASE + 380)
352#define __NR_sched_getattr (__NR_SYSCALL_BASE + 381)
353#define __NR_renameat2 (__NR_SYSCALL_BASE + 382)
354#define __NR_seccomp (__NR_SYSCALL_BASE + 383)
355#define __NR_getrandom (__NR_SYSCALL_BASE + 384)
356#define __NR_memfd_create (__NR_SYSCALL_BASE + 385)
357#define __NR_bpf (__NR_SYSCALL_BASE + 386)
358#define __NR_execveat (__NR_SYSCALL_BASE + 387)
359#define __NR_userfaultfd (__NR_SYSCALL_BASE + 388)
360#define __NR_membarrier (__NR_SYSCALL_BASE + 389)
361#define __NR_mlock2 (__NR_SYSCALL_BASE + 390)
362#define __NR_copy_file_range (__NR_SYSCALL_BASE + 391)
363#define __NR_preadv2 (__NR_SYSCALL_BASE + 392)
364#define __NR_pwritev2 (__NR_SYSCALL_BASE + 393)
365#define __NR_pkey_mprotect (__NR_SYSCALL_BASE + 394)
366#define __NR_pkey_alloc (__NR_SYSCALL_BASE + 395)
367#define __NR_pkey_free (__NR_SYSCALL_BASE + 396)
368#define __NR_statx (__NR_SYSCALL_BASE + 397)
369#define __NR_rseq (__NR_SYSCALL_BASE + 398)
370#define __NR_io_pgetevents (__NR_SYSCALL_BASE + 399)
371#define __NR_migrate_pages (__NR_SYSCALL_BASE + 400)
372#define __NR_kexec_file_load (__NR_SYSCALL_BASE + 401)
373#define __NR_clock_gettime64 (__NR_SYSCALL_BASE + 403)
374#define __NR_clock_settime64 (__NR_SYSCALL_BASE + 404)
375#define __NR_clock_adjtime64 (__NR_SYSCALL_BASE + 405)
376#define __NR_clock_getres_time64 (__NR_SYSCALL_BASE + 406)
377#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE + 407)
378#define __NR_timer_gettime64 (__NR_SYSCALL_BASE + 408)
379#define __NR_timer_settime64 (__NR_SYSCALL_BASE + 409)
380#define __NR_timerfd_gettime64 (__NR_SYSCALL_BASE + 410)
381#define __NR_timerfd_settime64 (__NR_SYSCALL_BASE + 411)
382#define __NR_utimensat_time64 (__NR_SYSCALL_BASE + 412)
383#define __NR_pselect6_time64 (__NR_SYSCALL_BASE + 413)
384#define __NR_ppoll_time64 (__NR_SYSCALL_BASE + 414)
385#define __NR_io_pgetevents_time64 (__NR_SYSCALL_BASE + 416)
386#define __NR_recvmmsg_time64 (__NR_SYSCALL_BASE + 417)
387#define __NR_mq_timedsend_time64 (__NR_SYSCALL_BASE + 418)
388#define __NR_mq_timedreceive_time64 (__NR_SYSCALL_BASE + 419)
389#define __NR_semtimedop_time64 (__NR_SYSCALL_BASE + 420)
390#define __NR_rt_sigtimedwait_time64 (__NR_SYSCALL_BASE + 421)
391#define __NR_futex_time64 (__NR_SYSCALL_BASE + 422)
392#define __NR_sched_rr_get_interval_time64 (__NR_SYSCALL_BASE + 423)
393#define __NR_pidfd_send_signal (__NR_SYSCALL_BASE + 424)
394#define __NR_io_uring_setup (__NR_SYSCALL_BASE + 425)
395#define __NR_io_uring_enter (__NR_SYSCALL_BASE + 426)
396#define __NR_io_uring_register (__NR_SYSCALL_BASE + 427)
397#define __NR_open_tree (__NR_SYSCALL_BASE + 428)
398#define __NR_move_mount (__NR_SYSCALL_BASE + 429)
399#define __NR_fsopen (__NR_SYSCALL_BASE + 430)
400#define __NR_fsconfig (__NR_SYSCALL_BASE + 431)
401#define __NR_fsmount (__NR_SYSCALL_BASE + 432)
402#define __NR_fspick (__NR_SYSCALL_BASE + 433)
403#define __NR_pidfd_open (__NR_SYSCALL_BASE + 434)
404#define __NR_clone3 (__NR_SYSCALL_BASE + 435)
405#define __NR_close_range (__NR_SYSCALL_BASE + 436)
406#define __NR_openat2 (__NR_SYSCALL_BASE + 437)
407#define __NR_pidfd_getfd (__NR_SYSCALL_BASE + 438)
408#define __NR_faccessat2 (__NR_SYSCALL_BASE + 439)
409#define __NR_process_madvise (__NR_SYSCALL_BASE + 440)
410#define __NR_epoll_pwait2 (__NR_SYSCALL_BASE + 441)
411#define __NR_mount_setattr (__NR_SYSCALL_BASE + 442)
412#define __NR_quotactl_fd (__NR_SYSCALL_BASE + 443)
413#define __NR_landlock_create_ruleset (__NR_SYSCALL_BASE + 444)
414#define __NR_landlock_add_rule (__NR_SYSCALL_BASE + 445)
415#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
416#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
417#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
418
419#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd.h created+41
...@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/unistd.h
4 *
5 * Copyright (C) 2001-2005 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
12 * no matter what the change is. Thanks!
13 */
14#ifndef __ASM_ARM_UNISTD_H
15#define __ASM_ARM_UNISTD_H
16
17#define __NR_OABI_SYSCALL_BASE 0x900000
18#define __NR_SYSCALL_MASK 0x0fffff
19
20#if defined(__thumb__) || defined(__ARM_EABI__)
21#define __NR_SYSCALL_BASE 0
22#include <asm/unistd-eabi.h>
23#else
24#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
25#include <asm/unistd-oabi.h>
26#endif
27
28#define __NR_sync_file_range2 __NR_arm_sync_file_range
29
30/*
31 * The following SWIs are ARM private.
32 */
33#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
34#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
35#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
36#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
37#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
38#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
39#define __ARM_NR_get_tls (__ARM_NR_BASE+6)
40
41#endif /* __ASM_ARM_UNISTD_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/auxvec.h created+26
...@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_AUXVEC_H
18#define __ASM_AUXVEC_H
19
20/* vDSO location */
21#define AT_SYSINFO_EHDR 33
22#define AT_MINSIGSTKSZ 51 /* stack needed for signal delivery */
23
24#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
25
26#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/bitsperlong.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BITSPERLONG_H
18#define __ASM_BITSPERLONG_H
19
20#define __BITS_PER_LONG 64
21
22#include <asm-generic/bitsperlong.h>
23
24#endif /* __ASM_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/bpf_perf_event.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/byteorder.h created+26
...@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_BYTEORDER_H
18#define __ASM_BYTEORDER_H
19
20#ifdef __AARCH64EB__
21#include <linux/byteorder/big_endian.h>
22#else
23#include <linux/byteorder/little_endian.h>
24#endif
25
26#endif /* __ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/fcntl.h created+30
...@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_FCNTL_H
18#define __ASM_FCNTL_H
19
20/*
21 * Using our own definitions for AArch32 (compat) support.
22 */
23#define O_DIRECTORY 040000 /* must be a directory */
24#define O_NOFOLLOW 0100000 /* don't follow links */
25#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
26#define O_LARGEFILE 0400000
27
28#include <asm-generic/fcntl.h>
29
30#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/hwcap.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_HWCAP_H
18#define __ASM_HWCAP_H
19
20/*
21 * HWCAP flags - for AT_HWCAP
22 */
23#define HWCAP_FP (1 << 0)
24#define HWCAP_ASIMD (1 << 1)
25#define HWCAP_EVTSTRM (1 << 2)
26#define HWCAP_AES (1 << 3)
27#define HWCAP_PMULL (1 << 4)
28#define HWCAP_SHA1 (1 << 5)
29#define HWCAP_SHA2 (1 << 6)
30#define HWCAP_CRC32 (1 << 7)
31#define HWCAP_ATOMICS (1 << 8)
32#define HWCAP_FPHP (1 << 9)
33#define HWCAP_ASIMDHP (1 << 10)
34#define HWCAP_CPUID (1 << 11)
35#define HWCAP_ASIMDRDM (1 << 12)
36#define HWCAP_JSCVT (1 << 13)
37#define HWCAP_FCMA (1 << 14)
38#define HWCAP_LRCPC (1 << 15)
39#define HWCAP_DCPOP (1 << 16)
40#define HWCAP_SHA3 (1 << 17)
41#define HWCAP_SM3 (1 << 18)
42#define HWCAP_SM4 (1 << 19)
43#define HWCAP_ASIMDDP (1 << 20)
44#define HWCAP_SHA512 (1 << 21)
45#define HWCAP_SVE (1 << 22)
46#define HWCAP_ASIMDFHM (1 << 23)
47#define HWCAP_DIT (1 << 24)
48#define HWCAP_USCAT (1 << 25)
49#define HWCAP_ILRCPC (1 << 26)
50#define HWCAP_FLAGM (1 << 27)
51#define HWCAP_SSBS (1 << 28)
52#define HWCAP_SB (1 << 29)
53#define HWCAP_PACA (1 << 30)
54#define HWCAP_PACG (1UL << 31)
55
56/*
57 * HWCAP2 flags - for AT_HWCAP2
58 */
59#define HWCAP2_DCPODP (1 << 0)
60#define HWCAP2_SVE2 (1 << 1)
61#define HWCAP2_SVEAES (1 << 2)
62#define HWCAP2_SVEPMULL (1 << 3)
63#define HWCAP2_SVEBITPERM (1 << 4)
64#define HWCAP2_SVESHA3 (1 << 5)
65#define HWCAP2_SVESM4 (1 << 6)
66#define HWCAP2_FLAGM2 (1 << 7)
67#define HWCAP2_FRINT (1 << 8)
68#define HWCAP2_SVEI8MM (1 << 9)
69#define HWCAP2_SVEF32MM (1 << 10)
70#define HWCAP2_SVEF64MM (1 << 11)
71#define HWCAP2_SVEBF16 (1 << 12)
72#define HWCAP2_I8MM (1 << 13)
73#define HWCAP2_BF16 (1 << 14)
74#define HWCAP2_DGH (1 << 15)
75#define HWCAP2_RNG (1 << 16)
76#define HWCAP2_BTI (1 << 17)
77#define HWCAP2_MTE (1 << 18)
78#define HWCAP2_ECV (1 << 19)
79
80#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/kvm.h created+416
...@@ -0,0 +1,416 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012,2013 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 *
6 * Derived from arch/arm/include/uapi/asm/kvm.h:
7 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
8 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __ARM_KVM_H__
24#define __ARM_KVM_H__
25
26#define KVM_SPSR_EL1 0
27#define KVM_SPSR_SVC KVM_SPSR_EL1
28#define KVM_SPSR_ABT 1
29#define KVM_SPSR_UND 2
30#define KVM_SPSR_IRQ 3
31#define KVM_SPSR_FIQ 4
32#define KVM_NR_SPSR 5
33
34#ifndef __ASSEMBLY__
35#include <linux/psci.h>
36#include <linux/types.h>
37#include <asm/ptrace.h>
38#include <asm/sve_context.h>
39
40#define __KVM_HAVE_GUEST_DEBUG
41#define __KVM_HAVE_IRQ_LINE
42#define __KVM_HAVE_READONLY_MEM
43#define __KVM_HAVE_VCPU_EVENTS
44
45#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
46
47#define KVM_REG_SIZE(id) \
48 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
49
50struct kvm_regs {
51 struct user_pt_regs regs; /* sp = sp_el0 */
52
53 __u64 sp_el1;
54 __u64 elr_el1;
55
56 __u64 spsr[KVM_NR_SPSR];
57
58 struct user_fpsimd_state fp_regs;
59};
60
61/*
62 * Supported CPU Targets - Adding a new target type is not recommended,
63 * unless there are some special registers not supported by the
64 * genericv8 syreg table.
65 */
66#define KVM_ARM_TARGET_AEM_V8 0
67#define KVM_ARM_TARGET_FOUNDATION_V8 1
68#define KVM_ARM_TARGET_CORTEX_A57 2
69#define KVM_ARM_TARGET_XGENE_POTENZA 3
70#define KVM_ARM_TARGET_CORTEX_A53 4
71/* Generic ARM v8 target */
72#define KVM_ARM_TARGET_GENERIC_V8 5
73
74#define KVM_ARM_NUM_TARGETS 6
75
76/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
77#define KVM_ARM_DEVICE_TYPE_SHIFT 0
78#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
79#define KVM_ARM_DEVICE_ID_SHIFT 16
80#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
81
82/* Supported device IDs */
83#define KVM_ARM_DEVICE_VGIC_V2 0
84
85/* Supported VGIC address types */
86#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
87#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
88
89#define KVM_VGIC_V2_DIST_SIZE 0x1000
90#define KVM_VGIC_V2_CPU_SIZE 0x2000
91
92/* Supported VGICv3 address types */
93#define KVM_VGIC_V3_ADDR_TYPE_DIST 2
94#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
95#define KVM_VGIC_ITS_ADDR_TYPE 4
96#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
97
98#define KVM_VGIC_V3_DIST_SIZE SZ_64K
99#define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
100#define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K)
101
102#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
103#define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */
104#define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */
105#define KVM_ARM_VCPU_PMU_V3 3 /* Support guest PMUv3 */
106#define KVM_ARM_VCPU_SVE 4 /* enable SVE for this CPU */
107#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */
108#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */
109
110struct kvm_vcpu_init {
111 __u32 target;
112 __u32 features[7];
113};
114
115struct kvm_sregs {
116};
117
118struct kvm_fpu {
119};
120
121/*
122 * See v8 ARM ARM D7.3: Debug Registers
123 *
124 * The architectural limit is 16 debug registers of each type although
125 * in practice there are usually less (see ID_AA64DFR0_EL1).
126 *
127 * Although the control registers are architecturally defined as 32
128 * bits wide we use a 64 bit structure here to keep parity with
129 * KVM_GET/SET_ONE_REG behaviour which treats all system registers as
130 * 64 bit values. It also allows for the possibility of the
131 * architecture expanding the control registers without having to
132 * change the userspace ABI.
133 */
134#define KVM_ARM_MAX_DBG_REGS 16
135struct kvm_guest_debug_arch {
136 __u64 dbg_bcr[KVM_ARM_MAX_DBG_REGS];
137 __u64 dbg_bvr[KVM_ARM_MAX_DBG_REGS];
138 __u64 dbg_wcr[KVM_ARM_MAX_DBG_REGS];
139 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
140};
141
142struct kvm_debug_exit_arch {
143 __u32 hsr;
144 __u64 far; /* used for watchpoints */
145};
146
147/*
148 * Architecture specific defines for kvm_guest_debug->control
149 */
150
151#define KVM_GUESTDBG_USE_SW_BP (1 << 16)
152#define KVM_GUESTDBG_USE_HW (1 << 17)
153
154struct kvm_sync_regs {
155 /* Used with KVM_CAP_ARM_USER_IRQ */
156 __u64 device_irq_level;
157};
158
159/*
160 * PMU filter structure. Describe a range of events with a particular
161 * action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER.
162 */
163struct kvm_pmu_event_filter {
164 __u16 base_event;
165 __u16 nevents;
166
167#define KVM_PMU_EVENT_ALLOW 0
168#define KVM_PMU_EVENT_DENY 1
169
170 __u8 action;
171 __u8 pad[3];
172};
173
174/* for KVM_GET/SET_VCPU_EVENTS */
175struct kvm_vcpu_events {
176 struct {
177 __u8 serror_pending;
178 __u8 serror_has_esr;
179 __u8 ext_dabt_pending;
180 /* Align it to 8 bytes */
181 __u8 pad[5];
182 __u64 serror_esr;
183 } exception;
184 __u32 reserved[12];
185};
186
187struct kvm_arm_copy_mte_tags {
188 __u64 guest_ipa;
189 __u64 length;
190 void *addr;
191 __u64 flags;
192 __u64 reserved[2];
193};
194
195#define KVM_ARM_TAGS_TO_GUEST 0
196#define KVM_ARM_TAGS_FROM_GUEST 1
197
198/* If you need to interpret the index values, here is the key: */
199#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
200#define KVM_REG_ARM_COPROC_SHIFT 16
201
202/* Normal registers are mapped as coprocessor 16. */
203#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
204#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / sizeof(__u32))
205
206/* Some registers need more space to represent values. */
207#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
208#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
209#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
210#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
211#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
212#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
213
214/* AArch64 system registers */
215#define KVM_REG_ARM64_SYSREG (0x0013 << KVM_REG_ARM_COPROC_SHIFT)
216#define KVM_REG_ARM64_SYSREG_OP0_MASK 0x000000000000c000
217#define KVM_REG_ARM64_SYSREG_OP0_SHIFT 14
218#define KVM_REG_ARM64_SYSREG_OP1_MASK 0x0000000000003800
219#define KVM_REG_ARM64_SYSREG_OP1_SHIFT 11
220#define KVM_REG_ARM64_SYSREG_CRN_MASK 0x0000000000000780
221#define KVM_REG_ARM64_SYSREG_CRN_SHIFT 7
222#define KVM_REG_ARM64_SYSREG_CRM_MASK 0x0000000000000078
223#define KVM_REG_ARM64_SYSREG_CRM_SHIFT 3
224#define KVM_REG_ARM64_SYSREG_OP2_MASK 0x0000000000000007
225#define KVM_REG_ARM64_SYSREG_OP2_SHIFT 0
226
227#define ARM64_SYS_REG_SHIFT_MASK(x,n) \
228 (((x) << KVM_REG_ARM64_SYSREG_ ## n ## _SHIFT) & \
229 KVM_REG_ARM64_SYSREG_ ## n ## _MASK)
230
231#define __ARM64_SYS_REG(op0,op1,crn,crm,op2) \
232 (KVM_REG_ARM64 | KVM_REG_ARM64_SYSREG | \
233 ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | \
234 ARM64_SYS_REG_SHIFT_MASK(op1, OP1) | \
235 ARM64_SYS_REG_SHIFT_MASK(crn, CRN) | \
236 ARM64_SYS_REG_SHIFT_MASK(crm, CRM) | \
237 ARM64_SYS_REG_SHIFT_MASK(op2, OP2))
238
239#define ARM64_SYS_REG(...) (__ARM64_SYS_REG(__VA_ARGS__) | KVM_REG_SIZE_U64)
240
241/* Physical Timer EL0 Registers */
242#define KVM_REG_ARM_PTIMER_CTL ARM64_SYS_REG(3, 3, 14, 2, 1)
243#define KVM_REG_ARM_PTIMER_CVAL ARM64_SYS_REG(3, 3, 14, 2, 2)
244#define KVM_REG_ARM_PTIMER_CNT ARM64_SYS_REG(3, 3, 14, 0, 1)
245
246/*
247 * EL0 Virtual Timer Registers
248 *
249 * WARNING:
250 * KVM_REG_ARM_TIMER_CVAL and KVM_REG_ARM_TIMER_CNT are not defined
251 * with the appropriate register encodings. Their values have been
252 * accidentally swapped. As this is set API, the definitions here
253 * must be used, rather than ones derived from the encodings.
254 */
255#define KVM_REG_ARM_TIMER_CTL ARM64_SYS_REG(3, 3, 14, 3, 1)
256#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
257#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
258
259/* KVM-as-firmware specific pseudo-registers */
260#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
261#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
262 KVM_REG_ARM_FW | ((r) & 0xffff))
263#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
264#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 KVM_REG_ARM_FW_REG(1)
265#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL 0
266#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL 1
267#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED 2
268
269/*
270 * Only two states can be presented by the host kernel:
271 * - NOT_REQUIRED: the guest doesn't need to do anything
272 * - NOT_AVAIL: the guest isn't mitigated (it can still use SSBS if available)
273 *
274 * All the other values are deprecated. The host still accepts all
275 * values (they are ABI), but will narrow them to the above two.
276 */
277#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 KVM_REG_ARM_FW_REG(2)
278#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL 0
279#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN 1
280#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_AVAIL 2
281#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3
282#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4)
283
284/* SVE registers */
285#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT)
286
287/* Z- and P-regs occupy blocks at the following offsets within this range: */
288#define KVM_REG_ARM64_SVE_ZREG_BASE 0
289#define KVM_REG_ARM64_SVE_PREG_BASE 0x400
290#define KVM_REG_ARM64_SVE_FFR_BASE 0x600
291
292#define KVM_ARM64_SVE_NUM_ZREGS __SVE_NUM_ZREGS
293#define KVM_ARM64_SVE_NUM_PREGS __SVE_NUM_PREGS
294
295#define KVM_ARM64_SVE_MAX_SLICES 32
296
297#define KVM_REG_ARM64_SVE_ZREG(n, i) \
298 (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_ZREG_BASE | \
299 KVM_REG_SIZE_U2048 | \
300 (((n) & (KVM_ARM64_SVE_NUM_ZREGS - 1)) << 5) | \
301 ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1)))
302
303#define KVM_REG_ARM64_SVE_PREG(n, i) \
304 (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_PREG_BASE | \
305 KVM_REG_SIZE_U256 | \
306 (((n) & (KVM_ARM64_SVE_NUM_PREGS - 1)) << 5) | \
307 ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1)))
308
309#define KVM_REG_ARM64_SVE_FFR(i) \
310 (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_FFR_BASE | \
311 KVM_REG_SIZE_U256 | \
312 ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1)))
313
314/*
315 * Register values for KVM_REG_ARM64_SVE_ZREG(), KVM_REG_ARM64_SVE_PREG() and
316 * KVM_REG_ARM64_SVE_FFR() are represented in memory in an endianness-
317 * invariant layout which differs from the layout used for the FPSIMD
318 * V-registers on big-endian systems: see sigcontext.h for more explanation.
319 */
320
321#define KVM_ARM64_SVE_VQ_MIN __SVE_VQ_MIN
322#define KVM_ARM64_SVE_VQ_MAX __SVE_VQ_MAX
323
324/* Vector lengths pseudo-register: */
325#define KVM_REG_ARM64_SVE_VLS (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | \
326 KVM_REG_SIZE_U512 | 0xffff)
327#define KVM_ARM64_SVE_VLS_WORDS \
328 ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)
329
330/* Device Control API: ARM VGIC */
331#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
332#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
333#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
334#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
335#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
336#define KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT 32
337#define KVM_DEV_ARM_VGIC_V3_MPIDR_MASK \
338 (0xffffffffULL << KVM_DEV_ARM_VGIC_V3_MPIDR_SHIFT)
339#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
340#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
341#define KVM_DEV_ARM_VGIC_SYSREG_INSTR_MASK (0xffff)
342#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS 3
343#define KVM_DEV_ARM_VGIC_GRP_CTRL 4
344#define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5
345#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
346#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
347#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
348#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
349#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
350 (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
351#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff
352#define VGIC_LEVEL_INFO_LINE_LEVEL 0
353
354#define KVM_DEV_ARM_VGIC_CTRL_INIT 0
355#define KVM_DEV_ARM_ITS_SAVE_TABLES 1
356#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2
357#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3
358#define KVM_DEV_ARM_ITS_CTRL_RESET 4
359
360/* Device Control API on vcpu fd */
361#define KVM_ARM_VCPU_PMU_V3_CTRL 0
362#define KVM_ARM_VCPU_PMU_V3_IRQ 0
363#define KVM_ARM_VCPU_PMU_V3_INIT 1
364#define KVM_ARM_VCPU_PMU_V3_FILTER 2
365#define KVM_ARM_VCPU_TIMER_CTRL 1
366#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
367#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
368#define KVM_ARM_VCPU_PVTIME_CTRL 2
369#define KVM_ARM_VCPU_PVTIME_IPA 0
370
371/* KVM_IRQ_LINE irq field index values */
372#define KVM_ARM_IRQ_VCPU2_SHIFT 28
373#define KVM_ARM_IRQ_VCPU2_MASK 0xf
374#define KVM_ARM_IRQ_TYPE_SHIFT 24
375#define KVM_ARM_IRQ_TYPE_MASK 0xf
376#define KVM_ARM_IRQ_VCPU_SHIFT 16
377#define KVM_ARM_IRQ_VCPU_MASK 0xff
378#define KVM_ARM_IRQ_NUM_SHIFT 0
379#define KVM_ARM_IRQ_NUM_MASK 0xffff
380
381/* irq_type field */
382#define KVM_ARM_IRQ_TYPE_CPU 0
383#define KVM_ARM_IRQ_TYPE_SPI 1
384#define KVM_ARM_IRQ_TYPE_PPI 2
385
386/* out-of-kernel GIC cpu interrupt injection irq_number field */
387#define KVM_ARM_IRQ_CPU_IRQ 0
388#define KVM_ARM_IRQ_CPU_FIQ 1
389
390/*
391 * This used to hold the highest supported SPI, but it is now obsolete
392 * and only here to provide source code level compatibility with older
393 * userland. The highest SPI number can be set via KVM_DEV_ARM_VGIC_GRP_NR_IRQS.
394 */
395#define KVM_ARM_IRQ_GIC_MAX 127
396
397/* One single KVM irqchip, ie. the VGIC */
398#define KVM_NR_IRQCHIPS 1
399
400/* PSCI interface */
401#define KVM_PSCI_FN_BASE 0x95c1ba5e
402#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
403
404#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
405#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
406#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
407#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
408
409#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
410#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
411#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
412#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
413
414#endif
415
416#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/mman.h created+10
...@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_MMAN_H
3#define __ASM_MMAN_H
4
5#include <asm-generic/mman.h>
6
7#define PROT_BTI 0x10 /* BTI guarded page */
8#define PROT_MTE 0x20 /* Normal Tagged mapping */
9
10#endif /* ! _UAPI__ASM_MMAN_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/param.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_PARAM_H
18#define __ASM_PARAM_H
19
20#define EXEC_PAGESIZE 65536
21
22#include <asm-generic/param.h>
23
24#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/perf_regs.h created+41
...@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_ARM64_PERF_REGS_H
3#define _ASM_ARM64_PERF_REGS_H
4
5enum perf_event_arm_regs {
6 PERF_REG_ARM64_X0,
7 PERF_REG_ARM64_X1,
8 PERF_REG_ARM64_X2,
9 PERF_REG_ARM64_X3,
10 PERF_REG_ARM64_X4,
11 PERF_REG_ARM64_X5,
12 PERF_REG_ARM64_X6,
13 PERF_REG_ARM64_X7,
14 PERF_REG_ARM64_X8,
15 PERF_REG_ARM64_X9,
16 PERF_REG_ARM64_X10,
17 PERF_REG_ARM64_X11,
18 PERF_REG_ARM64_X12,
19 PERF_REG_ARM64_X13,
20 PERF_REG_ARM64_X14,
21 PERF_REG_ARM64_X15,
22 PERF_REG_ARM64_X16,
23 PERF_REG_ARM64_X17,
24 PERF_REG_ARM64_X18,
25 PERF_REG_ARM64_X19,
26 PERF_REG_ARM64_X20,
27 PERF_REG_ARM64_X21,
28 PERF_REG_ARM64_X22,
29 PERF_REG_ARM64_X23,
30 PERF_REG_ARM64_X24,
31 PERF_REG_ARM64_X25,
32 PERF_REG_ARM64_X26,
33 PERF_REG_ARM64_X27,
34 PERF_REG_ARM64_X28,
35 PERF_REG_ARM64_X29,
36 PERF_REG_ARM64_LR,
37 PERF_REG_ARM64_SP,
38 PERF_REG_ARM64_PC,
39 PERF_REG_ARM64_MAX,
40};
41#endif /* _ASM_ARM64_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/posix_types.h created+11
...@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POSIX_TYPES_H
3#define __ASM_POSIX_TYPES_H
4
5typedef unsigned short __kernel_old_uid_t;
6typedef unsigned short __kernel_old_gid_t;
7#define __kernel_old_uid_t __kernel_old_uid_t
8
9#include <asm-generic/posix_types.h>
10
11#endif /* __ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/ptrace.h created+270
...@@ -0,0 +1,270 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/ptrace.h
4 *
5 * Copyright (C) 1996-2003 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_PTRACE_H
21#define __ASM_PTRACE_H
22
23#include <linux/types.h>
24
25#include <asm/hwcap.h>
26#include <asm/sve_context.h>
27
28
29/*
30 * PSR bits
31 */
32#define PSR_MODE_EL0t 0x00000000
33#define PSR_MODE_EL1t 0x00000004
34#define PSR_MODE_EL1h 0x00000005
35#define PSR_MODE_EL2t 0x00000008
36#define PSR_MODE_EL2h 0x00000009
37#define PSR_MODE_EL3t 0x0000000c
38#define PSR_MODE_EL3h 0x0000000d
39#define PSR_MODE_MASK 0x0000000f
40
41/* AArch32 CPSR bits */
42#define PSR_MODE32_BIT 0x00000010
43
44/* AArch64 SPSR bits */
45#define PSR_F_BIT 0x00000040
46#define PSR_I_BIT 0x00000080
47#define PSR_A_BIT 0x00000100
48#define PSR_D_BIT 0x00000200
49#define PSR_BTYPE_MASK 0x00000c00
50#define PSR_SSBS_BIT 0x00001000
51#define PSR_PAN_BIT 0x00400000
52#define PSR_UAO_BIT 0x00800000
53#define PSR_DIT_BIT 0x01000000
54#define PSR_TCO_BIT 0x02000000
55#define PSR_V_BIT 0x10000000
56#define PSR_C_BIT 0x20000000
57#define PSR_Z_BIT 0x40000000
58#define PSR_N_BIT 0x80000000
59
60#define PSR_BTYPE_SHIFT 10
61
62/*
63 * Groups of PSR bits
64 */
65#define PSR_f 0xff000000 /* Flags */
66#define PSR_s 0x00ff0000 /* Status */
67#define PSR_x 0x0000ff00 /* Extension */
68#define PSR_c 0x000000ff /* Control */
69
70/* Convenience names for the values of PSTATE.BTYPE */
71#define PSR_BTYPE_NONE (0b00 << PSR_BTYPE_SHIFT)
72#define PSR_BTYPE_JC (0b01 << PSR_BTYPE_SHIFT)
73#define PSR_BTYPE_C (0b10 << PSR_BTYPE_SHIFT)
74#define PSR_BTYPE_J (0b11 << PSR_BTYPE_SHIFT)
75
76/* syscall emulation path in ptrace */
77#define PTRACE_SYSEMU 31
78#define PTRACE_SYSEMU_SINGLESTEP 32
79/* MTE allocation tag access */
80#define PTRACE_PEEKMTETAGS 33
81#define PTRACE_POKEMTETAGS 34
82
83#ifndef __ASSEMBLY__
84
85/*
86 * User structures for general purpose, floating point and debug registers.
87 */
88struct user_pt_regs {
89 __u64 regs[31];
90 __u64 sp;
91 __u64 pc;
92 __u64 pstate;
93};
94
95struct user_fpsimd_state {
96 __uint128_t vregs[32];
97 __u32 fpsr;
98 __u32 fpcr;
99 __u32 __reserved[2];
100};
101
102struct user_hwdebug_state {
103 __u32 dbg_info;
104 __u32 pad;
105 struct {
106 __u64 addr;
107 __u32 ctrl;
108 __u32 pad;
109 } dbg_regs[16];
110};
111
112/* SVE/FP/SIMD state (NT_ARM_SVE) */
113
114struct user_sve_header {
115 __u32 size; /* total meaningful regset content in bytes */
116 __u32 max_size; /* maxmium possible size for this thread */
117 __u16 vl; /* current vector length */
118 __u16 max_vl; /* maximum possible vector length */
119 __u16 flags;
120 __u16 __reserved;
121};
122
123/* Definitions for user_sve_header.flags: */
124#define SVE_PT_REGS_MASK (1 << 0)
125
126#define SVE_PT_REGS_FPSIMD 0
127#define SVE_PT_REGS_SVE SVE_PT_REGS_MASK
128
129/*
130 * Common SVE_PT_* flags:
131 * These must be kept in sync with prctl interface in <linux/prctl.h>
132 */
133#define SVE_PT_VL_INHERIT ((1 << 17) /* PR_SVE_VL_INHERIT */ >> 16)
134#define SVE_PT_VL_ONEXEC ((1 << 18) /* PR_SVE_SET_VL_ONEXEC */ >> 16)
135
136
137/*
138 * The remainder of the SVE state follows struct user_sve_header. The
139 * total size of the SVE state (including header) depends on the
140 * metadata in the header: SVE_PT_SIZE(vq, flags) gives the total size
141 * of the state in bytes, including the header.
142 *
143 * Refer to <asm/sigcontext.h> for details of how to pass the correct
144 * "vq" argument to these macros.
145 */
146
147/* Offset from the start of struct user_sve_header to the register data */
148#define SVE_PT_REGS_OFFSET \
149 ((sizeof(struct user_sve_header) + (__SVE_VQ_BYTES - 1)) \
150 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
151
152/*
153 * The register data content and layout depends on the value of the
154 * flags field.
155 */
156
157/*
158 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_FPSIMD case:
159 *
160 * The payload starts at offset SVE_PT_FPSIMD_OFFSET, and is of type
161 * struct user_fpsimd_state. Additional data might be appended in the
162 * future: use SVE_PT_FPSIMD_SIZE(vq, flags) to compute the total size.
163 * SVE_PT_FPSIMD_SIZE(vq, flags) will never be less than
164 * sizeof(struct user_fpsimd_state).
165 */
166
167#define SVE_PT_FPSIMD_OFFSET SVE_PT_REGS_OFFSET
168
169#define SVE_PT_FPSIMD_SIZE(vq, flags) (sizeof(struct user_fpsimd_state))
170
171/*
172 * (flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE case:
173 *
174 * The payload starts at offset SVE_PT_SVE_OFFSET, and is of size
175 * SVE_PT_SVE_SIZE(vq, flags).
176 *
177 * Additional macros describe the contents and layout of the payload.
178 * For each, SVE_PT_SVE_x_OFFSET(args) is the start offset relative to
179 * the start of struct user_sve_header, and SVE_PT_SVE_x_SIZE(args) is
180 * the size in bytes:
181 *
182 * x type description
183 * - ---- -----------
184 * ZREGS \
185 * ZREG |
186 * PREGS | refer to <asm/sigcontext.h>
187 * PREG |
188 * FFR /
189 *
190 * FPSR uint32_t FPSR
191 * FPCR uint32_t FPCR
192 *
193 * Additional data might be appended in the future.
194 *
195 * The Z-, P- and FFR registers are represented in memory in an endianness-
196 * invariant layout which differs from the layout used for the FPSIMD
197 * V-registers on big-endian systems: see sigcontext.h for more explanation.
198 */
199
200#define SVE_PT_SVE_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
201#define SVE_PT_SVE_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
202#define SVE_PT_SVE_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
203#define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
204#define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
205
206#define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
207
208#define SVE_PT_SVE_ZREGS_OFFSET \
209 (SVE_PT_REGS_OFFSET + __SVE_ZREGS_OFFSET)
210#define SVE_PT_SVE_ZREG_OFFSET(vq, n) \
211 (SVE_PT_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
212#define SVE_PT_SVE_ZREGS_SIZE(vq) \
213 (SVE_PT_SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
214
215#define SVE_PT_SVE_PREGS_OFFSET(vq) \
216 (SVE_PT_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
217#define SVE_PT_SVE_PREG_OFFSET(vq, n) \
218 (SVE_PT_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
219#define SVE_PT_SVE_PREGS_SIZE(vq) \
220 (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \
221 SVE_PT_SVE_PREGS_OFFSET(vq))
222
223#define SVE_PT_SVE_FFR_OFFSET(vq) \
224 (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
225
226#define SVE_PT_SVE_FPSR_OFFSET(vq) \
227 ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + \
228 (__SVE_VQ_BYTES - 1)) \
229 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
230#define SVE_PT_SVE_FPCR_OFFSET(vq) \
231 (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
232
233/*
234 * Any future extension appended after FPCR must be aligned to the next
235 * 128-bit boundary.
236 */
237
238#define SVE_PT_SVE_SIZE(vq, flags) \
239 ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE \
240 - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) \
241 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
242
243#define SVE_PT_SIZE(vq, flags) \
244 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
245 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
246 : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
247
248/* pointer authentication masks (NT_ARM_PAC_MASK) */
249
250struct user_pac_mask {
251 __u64 data_mask;
252 __u64 insn_mask;
253};
254
255/* pointer authentication keys (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS) */
256
257struct user_pac_address_keys {
258 __uint128_t apiakey;
259 __uint128_t apibkey;
260 __uint128_t apdakey;
261 __uint128_t apdbkey;
262};
263
264struct user_pac_generic_keys {
265 __uint128_t apgakey;
266};
267
268#endif /* __ASSEMBLY__ */
269
270#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/setup.h created+27
...@@ -0,0 +1,27 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Based on arch/arm/include/asm/setup.h
4 *
5 * Copyright (C) 1997-1999 Russell King
6 * Copyright (C) 2012 ARM Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_SETUP_H
21#define __ASM_SETUP_H
22
23#include <linux/types.h>
24
25#define COMMAND_LINE_SIZE 2048
26
27#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/sigcontext.h created+252
...@@ -0,0 +1,252 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGCONTEXT_H
18#define __ASM_SIGCONTEXT_H
19
20#ifndef __ASSEMBLY__
21
22#include <linux/types.h>
23
24/*
25 * Signal context structure - contains all info to do with the state
26 * before the signal handler was invoked.
27 */
28struct sigcontext {
29 __u64 fault_address;
30 /* AArch64 registers */
31 __u64 regs[31];
32 __u64 sp;
33 __u64 pc;
34 __u64 pstate;
35 /* 4K reserved for FP/SIMD state and future expansion */
36 __u8 __reserved[4096] __attribute__((__aligned__(16)));
37};
38
39/*
40 * Allocation of __reserved[]:
41 * (Note: records do not necessarily occur in the order shown here.)
42 *
43 * size description
44 *
45 * 0x210 fpsimd_context
46 * 0x10 esr_context
47 * 0x8a0 sve_context (vl <= 64) (optional)
48 * 0x20 extra_context (optional)
49 * 0x10 terminator (null _aarch64_ctx)
50 *
51 * 0x510 (reserved for future allocation)
52 *
53 * New records that can exceed this space need to be opt-in for userspace, so
54 * that an expanded signal frame is not generated unexpectedly. The mechanism
55 * for opting in will depend on the extension that generates each new record.
56 * The above table documents the maximum set and sizes of records than can be
57 * generated when userspace does not opt in for any such extension.
58 */
59
60/*
61 * Header to be used at the beginning of structures extending the user
62 * context. Such structures must be placed after the rt_sigframe on the stack
63 * and be 16-byte aligned. The last structure must be a dummy one with the
64 * magic and size set to 0.
65 */
66struct _aarch64_ctx {
67 __u32 magic;
68 __u32 size;
69};
70
71#define FPSIMD_MAGIC 0x46508001
72
73struct fpsimd_context {
74 struct _aarch64_ctx head;
75 __u32 fpsr;
76 __u32 fpcr;
77 __uint128_t vregs[32];
78};
79
80/*
81 * Note: similarly to all other integer fields, each V-register is stored in an
82 * endianness-dependent format, with the byte at offset i from the start of the
83 * in-memory representation of the register value containing
84 *
85 * bits [(7 + 8 * i) : (8 * i)] of the register on little-endian hosts; or
86 * bits [(127 - 8 * i) : (120 - 8 * i)] on big-endian hosts.
87 */
88
89/* ESR_EL1 context */
90#define ESR_MAGIC 0x45535201
91
92struct esr_context {
93 struct _aarch64_ctx head;
94 __u64 esr;
95};
96
97/*
98 * extra_context: describes extra space in the signal frame for
99 * additional structures that don't fit in sigcontext.__reserved[].
100 *
101 * Note:
102 *
103 * 1) fpsimd_context, esr_context and extra_context must be placed in
104 * sigcontext.__reserved[] if present. They cannot be placed in the
105 * extra space. Any other record can be placed either in the extra
106 * space or in sigcontext.__reserved[], unless otherwise specified in
107 * this file.
108 *
109 * 2) There must not be more than one extra_context.
110 *
111 * 3) If extra_context is present, it must be followed immediately in
112 * sigcontext.__reserved[] by the terminating null _aarch64_ctx.
113 *
114 * 4) The extra space to which datap points must start at the first
115 * 16-byte aligned address immediately after the terminating null
116 * _aarch64_ctx that follows the extra_context structure in
117 * __reserved[]. The extra space may overrun the end of __reserved[],
118 * as indicated by a sufficiently large value for the size field.
119 *
120 * 5) The extra space must itself be terminated with a null
121 * _aarch64_ctx.
122 */
123#define EXTRA_MAGIC 0x45585401
124
125struct extra_context {
126 struct _aarch64_ctx head;
127 __u64 datap; /* 16-byte aligned pointer to extra space cast to __u64 */
128 __u32 size; /* size in bytes of the extra space */
129 __u32 __reserved[3];
130};
131
132#define SVE_MAGIC 0x53564501
133
134struct sve_context {
135 struct _aarch64_ctx head;
136 __u16 vl;
137 __u16 __reserved[3];
138};
139
140#endif /* !__ASSEMBLY__ */
141
142#include <asm/sve_context.h>
143
144/*
145 * The SVE architecture leaves space for future expansion of the
146 * vector length beyond its initial architectural limit of 2048 bits
147 * (16 quadwords).
148 *
149 * See linux/Documentation/arm64/sve.rst for a description of the VL/VQ
150 * terminology.
151 */
152#define SVE_VQ_BYTES __SVE_VQ_BYTES /* bytes per quadword */
153
154#define SVE_VQ_MIN __SVE_VQ_MIN
155#define SVE_VQ_MAX __SVE_VQ_MAX
156
157#define SVE_VL_MIN __SVE_VL_MIN
158#define SVE_VL_MAX __SVE_VL_MAX
159
160#define SVE_NUM_ZREGS __SVE_NUM_ZREGS
161#define SVE_NUM_PREGS __SVE_NUM_PREGS
162
163#define sve_vl_valid(vl) __sve_vl_valid(vl)
164#define sve_vq_from_vl(vl) __sve_vq_from_vl(vl)
165#define sve_vl_from_vq(vq) __sve_vl_from_vq(vq)
166
167/*
168 * If the SVE registers are currently live for the thread at signal delivery,
169 * sve_context.head.size >=
170 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl))
171 * and the register data may be accessed using the SVE_SIG_*() macros.
172 *
173 * If sve_context.head.size <
174 * SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)),
175 * the SVE registers were not live for the thread and no register data
176 * is included: in this case, the SVE_SIG_*() macros should not be
177 * used except for this check.
178 *
179 * The same convention applies when returning from a signal: a caller
180 * will need to remove or resize the sve_context block if it wants to
181 * make the SVE registers live when they were previously non-live or
182 * vice-versa. This may require the caller to allocate fresh
183 * memory and/or move other context blocks in the signal frame.
184 *
185 * Changing the vector length during signal return is not permitted:
186 * sve_context.vl must equal the thread's current vector length when
187 * doing a sigreturn.
188 *
189 *
190 * Note: for all these macros, the "vq" argument denotes the SVE
191 * vector length in quadwords (i.e., units of 128 bits).
192 *
193 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The
194 * result is valid if and only if sve_vl_valid(vl) is true. This is
195 * guaranteed for a struct sve_context written by the kernel.
196 *
197 *
198 * Additional macros describe the contents and layout of the payload.
199 * For each, SVE_SIG_x_OFFSET(args) is the start offset relative to
200 * the start of struct sve_context, and SVE_SIG_x_SIZE(args) is the
201 * size in bytes:
202 *
203 * x type description
204 * - ---- -----------
205 * REGS the entire SVE context
206 *
207 * ZREGS __uint128_t[SVE_NUM_ZREGS][vq] all Z-registers
208 * ZREG __uint128_t[vq] individual Z-register Zn
209 *
210 * PREGS uint16_t[SVE_NUM_PREGS][vq] all P-registers
211 * PREG uint16_t[vq] individual P-register Pn
212 *
213 * FFR uint16_t[vq] first-fault status register
214 *
215 * Additional data might be appended in the future.
216 *
217 * Unlike vregs[] in fpsimd_context, each SVE scalable register (Z-, P- or FFR)
218 * is encoded in memory in an endianness-invariant format, with the byte at
219 * offset i from the start of the in-memory representation containing bits
220 * [(7 + 8 * i) : (8 * i)] of the register value.
221 */
222
223#define SVE_SIG_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
224#define SVE_SIG_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
225#define SVE_SIG_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
226
227#define SVE_SIG_REGS_OFFSET \
228 ((sizeof(struct sve_context) + (__SVE_VQ_BYTES - 1)) \
229 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
230
231#define SVE_SIG_ZREGS_OFFSET \
232 (SVE_SIG_REGS_OFFSET + __SVE_ZREGS_OFFSET)
233#define SVE_SIG_ZREG_OFFSET(vq, n) \
234 (SVE_SIG_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
235#define SVE_SIG_ZREGS_SIZE(vq) __SVE_ZREGS_SIZE(vq)
236
237#define SVE_SIG_PREGS_OFFSET(vq) \
238 (SVE_SIG_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
239#define SVE_SIG_PREG_OFFSET(vq, n) \
240 (SVE_SIG_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
241#define SVE_SIG_PREGS_SIZE(vq) __SVE_PREGS_SIZE(vq)
242
243#define SVE_SIG_FFR_OFFSET(vq) \
244 (SVE_SIG_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
245
246#define SVE_SIG_REGS_SIZE(vq) \
247 (__SVE_FFR_OFFSET(vq) + __SVE_FFR_SIZE(vq))
248
249#define SVE_SIG_CONTEXT_SIZE(vq) \
250 (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
251
252#endif /* __ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/signal.h created+28
...@@ -0,0 +1,28 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGNAL_H
18#define __ASM_SIGNAL_H
19
20/* Required for AArch32 compatibility. */
21#define SA_RESTORER 0x04000000
22
23#define MINSIGSTKSZ 5120
24#define SIGSTKSZ 16384
25
26#include <asm-generic/signal.h>
27
28#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/statfs.h created+24
...@@ -0,0 +1,24 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_STATFS_H
18#define __ASM_STATFS_H
19
20#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
21
22#include <asm-generic/statfs.h>
23
24#endif
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/sve_context.h created+53
...@@ -0,0 +1,53 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (C) 2017-2018 ARM Limited */
3
4/*
5 * For use by other UAPI headers only.
6 * Do not make direct use of header or its definitions.
7 */
8
9#ifndef __ASM_SVE_CONTEXT_H
10#define __ASM_SVE_CONTEXT_H
11
12#include <linux/types.h>
13
14#define __SVE_VQ_BYTES 16 /* number of bytes per quadword */
15
16#define __SVE_VQ_MIN 1
17#define __SVE_VQ_MAX 512
18
19#define __SVE_VL_MIN (__SVE_VQ_MIN * __SVE_VQ_BYTES)
20#define __SVE_VL_MAX (__SVE_VQ_MAX * __SVE_VQ_BYTES)
21
22#define __SVE_NUM_ZREGS 32
23#define __SVE_NUM_PREGS 16
24
25#define __sve_vl_valid(vl) \
26 ((vl) % __SVE_VQ_BYTES == 0 && \
27 (vl) >= __SVE_VL_MIN && \
28 (vl) <= __SVE_VL_MAX)
29
30#define __sve_vq_from_vl(vl) ((vl) / __SVE_VQ_BYTES)
31#define __sve_vl_from_vq(vq) ((vq) * __SVE_VQ_BYTES)
32
33#define __SVE_ZREG_SIZE(vq) ((__u32)(vq) * __SVE_VQ_BYTES)
34#define __SVE_PREG_SIZE(vq) ((__u32)(vq) * (__SVE_VQ_BYTES / 8))
35#define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZE(vq)
36
37#define __SVE_ZREGS_OFFSET 0
38#define __SVE_ZREG_OFFSET(vq, n) \
39 (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE(vq) * (n))
40#define __SVE_ZREGS_SIZE(vq) \
41 (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - __SVE_ZREGS_OFFSET)
42
43#define __SVE_PREGS_OFFSET(vq) \
44 (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE(vq))
45#define __SVE_PREG_OFFSET(vq, n) \
46 (__SVE_PREGS_OFFSET(vq) + __SVE_PREG_SIZE(vq) * (n))
47#define __SVE_PREGS_SIZE(vq) \
48 (__SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - __SVE_PREGS_OFFSET(vq))
49
50#define __SVE_FFR_OFFSET(vq) \
51 (__SVE_PREGS_OFFSET(vq) + __SVE_PREGS_SIZE(vq))
52
53#endif /* ! _UAPI__ASM_SVE_CONTEXT_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/ucontext.h created+33
...@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_UCONTEXT_H
18#define __ASM_UCONTEXT_H
19
20#include <linux/types.h>
21
22struct ucontext {
23 unsigned long uc_flags;
24 struct ucontext *uc_link;
25 stack_t uc_stack;
26 sigset_t uc_sigmask;
27 /* glibc uses a 1024-bit sigset_t */
28 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
29 /* last for future expansion */
30 struct sigcontext uc_mcontext;
31};
32
33#endif /* __ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/arm64-linux-any/asm/unistd.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#define __ARCH_WANT_RENAMEAT
19#define __ARCH_WANT_NEW_STAT
20#define __ARCH_WANT_SET_GET_RLIMIT
21#define __ARCH_WANT_TIME32_SYSCALLS
22#define __ARCH_WANT_SYS_CLONE3
23#define __ARCH_WANT_MEMFD_SECRET
24
25#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/fcntl.h deleted-12
...@@ -1,12 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ARM_FCNTL_H
3#define _ARM_FCNTL_H
4
5#define O_DIRECTORY 040000 /* must be a directory */
6#define O_NOFOLLOW 0100000 /* don't follow links */
7#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
8#define O_LARGEFILE 0400000
9
10#include <asm-generic/fcntl.h>
11
12#endif
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/ioctls.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_ARM_IOCTLS_H
3#define __ASM_ARM_IOCTLS_H
4
5#define FIOQSIZE 0x545E
6
7#include <asm-generic/ioctls.h>
8
9#endif
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/mman.h deleted-4
...@@ -1,4 +0,0 @@
1#include <asm-generic/mman.h>
2
3#define arch_mmap_check(addr, len, flags) \
4 (((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/statfs.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMARM_STATFS_H
3#define _ASMARM_STATFS_H
4
5/*
6 * With EABI there is 4 bytes of padding added to this structure.
7 * Let's pack it so the padding goes away to simplify dual ABI support.
8 * Note that user space does NOT have to pack this structure.
9 */
10#define ARCH_PACK_STATFS64 __attribute__((packed,aligned(4)))
11
12#include <asm-generic/statfs.h>
13#endif
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/swab.h deleted-52
...@@ -1,52 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * arch/arm/include/asm/byteorder.h
4 *
5 * ARM Endian-ness. In little endian mode, the data bus is connected such
6 * that byte accesses appear as:
7 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
8 * and word accesses (data or instruction) appear as:
9 * d0...d31
10 *
11 * When in big endian mode, byte accesses appear as:
12 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
13 * and word accesses (data or instruction) appear as:
14 * d0...d31
15 */
16#ifndef __ASM_ARM_SWAB_H
17#define __ASM_ARM_SWAB_H
18
19
20#include <linux/types.h>
21
22#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
23# define __SWAB_64_THRU_32__
24#endif
25
26
27static __inline__ __u32 __arch_swab32(__u32 x)
28{
29 __u32 t;
30
31#ifndef __thumb__
32 if (!__builtin_constant_p(x)) {
33 /*
34 * The compiler needs a bit of a hint here to always do the
35 * right thing and not screw it up to different degrees
36 * depending on the gcc version.
37 */
38 __asm__ ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
39 } else
40#endif
41 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
42
43 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
44 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
45 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
46
47 return x;
48}
49#define __arch_swab32 __arch_swab32
50
51
52#endif /* __ASM_ARM_SWAB_H */
\ No newline at end of file
lib/libc/include/armeb-linux-any/asm/types.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_TYPES_H
3#define _ASM_TYPES_H
4
5#include <asm-generic/int-ll64.h>
6
7/*
8 * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
9 * unambiguous on ARM as you would expect. For the types below, there is a
10 * difference on ARM between GCC built for bare metal ARM, GCC built for glibc
11 * and the kernel itself, which results in build errors if you try to build with
12 * -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
13 * in order to use NEON intrinsics)
14 *
15 * As the typedefs for these types in 'stdint.h' are based on builtin defines
16 * supplied by GCC, we can tweak these to align with the kernel's idea of those
17 * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
18 * source file (provided that -ffreestanding is used).
19 *
20 * int32_t uint32_t uintptr_t
21 * bare metal GCC long unsigned long unsigned int
22 * glibc GCC int unsigned int unsigned int
23 * kernel int unsigned int unsigned long
24 */
25
26#ifdef __INT32_TYPE__
27#undef __INT32_TYPE__
28#define __INT32_TYPE__ int
29#endif
30
31#ifdef __UINT32_TYPE__
32#undef __UINT32_TYPE__
33#define __UINT32_TYPE__ unsigned int
34#endif
35
36#ifdef __UINTPTR_TYPE__
37#undef __UINTPTR_TYPE__
38#define __UINTPTR_TYPE__ unsigned long
39#endif
40
41#endif /* _ASM_TYPES_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/byteorder.h created+8
...@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __ASM_CSKY_BYTEORDER_H
4#define __ASM_CSKY_BYTEORDER_H
5
6#include <linux/byteorder/little_endian.h>
7
8#endif /* __ASM_CSKY_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/cachectl.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __ASM_CSKY_CACHECTL_H
4#define __ASM_CSKY_CACHECTL_H
5
6/*
7 * See "man cacheflush"
8 */
9#define ICACHE (1<<0)
10#define DCACHE (1<<1)
11#define BCACHE (ICACHE|DCACHE)
12
13#endif /* __ASM_CSKY_CACHECTL_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/perf_regs.h created+50
...@@ -0,0 +1,50 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _ASM_CSKY_PERF_REGS_H
4#define _ASM_CSKY_PERF_REGS_H
5
6/* Index of struct pt_regs */
7enum perf_event_csky_regs {
8 PERF_REG_CSKY_TLS,
9 PERF_REG_CSKY_LR,
10 PERF_REG_CSKY_PC,
11 PERF_REG_CSKY_SR,
12 PERF_REG_CSKY_SP,
13 PERF_REG_CSKY_ORIG_A0,
14 PERF_REG_CSKY_A0,
15 PERF_REG_CSKY_A1,
16 PERF_REG_CSKY_A2,
17 PERF_REG_CSKY_A3,
18 PERF_REG_CSKY_REGS0,
19 PERF_REG_CSKY_REGS1,
20 PERF_REG_CSKY_REGS2,
21 PERF_REG_CSKY_REGS3,
22 PERF_REG_CSKY_REGS4,
23 PERF_REG_CSKY_REGS5,
24 PERF_REG_CSKY_REGS6,
25 PERF_REG_CSKY_REGS7,
26 PERF_REG_CSKY_REGS8,
27 PERF_REG_CSKY_REGS9,
28#if defined(__CSKYABIV2__)
29 PERF_REG_CSKY_EXREGS0,
30 PERF_REG_CSKY_EXREGS1,
31 PERF_REG_CSKY_EXREGS2,
32 PERF_REG_CSKY_EXREGS3,
33 PERF_REG_CSKY_EXREGS4,
34 PERF_REG_CSKY_EXREGS5,
35 PERF_REG_CSKY_EXREGS6,
36 PERF_REG_CSKY_EXREGS7,
37 PERF_REG_CSKY_EXREGS8,
38 PERF_REG_CSKY_EXREGS9,
39 PERF_REG_CSKY_EXREGS10,
40 PERF_REG_CSKY_EXREGS11,
41 PERF_REG_CSKY_EXREGS12,
42 PERF_REG_CSKY_EXREGS13,
43 PERF_REG_CSKY_EXREGS14,
44 PERF_REG_CSKY_HI,
45 PERF_REG_CSKY_LO,
46 PERF_REG_CSKY_DCSR,
47#endif
48 PERF_REG_CSKY_MAX,
49};
50#endif /* _ASM_CSKY_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/ptrace.h created+51
...@@ -0,0 +1,51 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _CSKY_PTRACE_H
4#define _CSKY_PTRACE_H
5
6#ifndef __ASSEMBLY__
7
8struct pt_regs {
9 unsigned long tls;
10 unsigned long lr;
11 unsigned long pc;
12 unsigned long sr;
13 unsigned long usp;
14
15 /*
16 * a0, a1, a2, a3:
17 * abiv1: r2, r3, r4, r5
18 * abiv2: r0, r1, r2, r3
19 */
20 unsigned long orig_a0;
21 unsigned long a0;
22 unsigned long a1;
23 unsigned long a2;
24 unsigned long a3;
25
26 /*
27 * ABIV2: r4 ~ r13
28 * ABIV1: r6 ~ r14, r1
29 */
30 unsigned long regs[10];
31
32#if defined(__CSKYABIV2__)
33 /* r16 ~ r30 */
34 unsigned long exregs[15];
35
36 unsigned long rhi;
37 unsigned long rlo;
38 unsigned long dcsr;
39#endif
40};
41
42struct user_fp {
43 unsigned long vr[96];
44 unsigned long fcr;
45 unsigned long fesr;
46 unsigned long fid;
47 unsigned long reserved;
48};
49
50#endif /* __ASSEMBLY__ */
51#endif /* _CSKY_PTRACE_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/sigcontext.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef __ASM_CSKY_SIGCONTEXT_H
4#define __ASM_CSKY_SIGCONTEXT_H
5
6#include <asm/ptrace.h>
7
8struct sigcontext {
9 struct pt_regs sc_pt_regs;
10 struct user_fp sc_user_fp;
11};
12
13#endif /* __ASM_CSKY_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd.h created+14
...@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#define __ARCH_WANT_STAT64
4#define __ARCH_WANT_NEW_STAT
5#define __ARCH_WANT_SYS_CLONE
6#define __ARCH_WANT_SYS_CLONE3
7#define __ARCH_WANT_SET_GET_RLIMIT
8#define __ARCH_WANT_TIME32_SYSCALLS
9#include <asm-generic/unistd.h>
10
11#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
12__SYSCALL(__NR_set_thread_area, sys_set_thread_area)
13#define __NR_cacheflush (__NR_arch_specific_syscall + 1)
14__SYSCALL(__NR_cacheflush, sys_cacheflush)
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/byteorder.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_BYTEORDER_H
21#define _ASM_BYTEORDER_H
22
23#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
24# define __BYTEORDER_HAS_U64__
25#endif
26
27#include <linux/byteorder/little_endian.h>
28
29#endif /* _ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/param.h created+27
...@@ -0,0 +1,27 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_PARAM_H
21#define _ASM_PARAM_H
22
23#define EXEC_PAGESIZE 16384
24
25#include <asm-generic/param.h>
26
27#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/ptrace.h created+45
...@@ -0,0 +1,45 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Ptrace definitions for the Hexagon architecture
4 *
5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 and
9 * only version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA.
20 */
21
22#ifndef _ASM_PTRACE_H
23#define _ASM_PTRACE_H
24
25#include <asm/registers.h>
26
27#define instruction_pointer(regs) pt_elr(regs)
28#define user_stack_pointer(regs) ((regs)->r29)
29
30#define profile_pc(regs) instruction_pointer(regs)
31
32/* kprobe-based event tracer support */
33extern int regs_query_register_offset(const char *name);
34extern const char *regs_query_register_name(unsigned int offset);
35
36#define current_pt_regs() \
37 ((struct pt_regs *) \
38 ((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
39
40#if CONFIG_HEXAGON_ARCH_VERSION >= 4
41#define arch_has_single_step() (1)
42#endif
43
44
45#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/registers.h created+229
...@@ -0,0 +1,229 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Register definitions for the Hexagon architecture
4 */
5
6
7#ifndef _ASM_REGISTERS_H
8#define _ASM_REGISTERS_H
9
10#ifndef __ASSEMBLY__
11
12/* See kernel/entry.S for further documentation. */
13
14/*
15 * Entry code copies the event record out of guest registers into
16 * this structure (which is on the stack).
17 */
18
19struct hvm_event_record {
20 unsigned long vmel; /* Event Linkage (return address) */
21 unsigned long vmest; /* Event context - pre-event SSR values */
22 unsigned long vmpsp; /* Previous stack pointer */
23 unsigned long vmbadva; /* Bad virtual address for addressing events */
24};
25
26struct pt_regs {
27 long restart_r0; /* R0 checkpoint for syscall restart */
28 long syscall_nr; /* Only used in system calls */
29 union {
30 struct {
31 unsigned long usr;
32 unsigned long preds;
33 };
34 long long int predsusr;
35 };
36 union {
37 struct {
38 unsigned long m0;
39 unsigned long m1;
40 };
41 long long int m1m0;
42 };
43 union {
44 struct {
45 unsigned long sa1;
46 unsigned long lc1;
47 };
48 long long int lc1sa1;
49 };
50 union {
51 struct {
52 unsigned long sa0;
53 unsigned long lc0;
54 };
55 long long int lc0sa0;
56 };
57 union {
58 struct {
59 unsigned long ugp;
60 unsigned long gp;
61 };
62 long long int gpugp;
63 };
64 union {
65 struct {
66 unsigned long cs0;
67 unsigned long cs1;
68 };
69 long long int cs1cs0;
70 };
71 /*
72 * Be extremely careful with rearranging these, if at all. Some code
73 * assumes the 32 registers exist exactly like this in memory;
74 * e.g. kernel/ptrace.c
75 * e.g. kernel/signal.c (restore_sigcontext)
76 */
77 union {
78 struct {
79 unsigned long r00;
80 unsigned long r01;
81 };
82 long long int r0100;
83 };
84 union {
85 struct {
86 unsigned long r02;
87 unsigned long r03;
88 };
89 long long int r0302;
90 };
91 union {
92 struct {
93 unsigned long r04;
94 unsigned long r05;
95 };
96 long long int r0504;
97 };
98 union {
99 struct {
100 unsigned long r06;
101 unsigned long r07;
102 };
103 long long int r0706;
104 };
105 union {
106 struct {
107 unsigned long r08;
108 unsigned long r09;
109 };
110 long long int r0908;
111 };
112 union {
113 struct {
114 unsigned long r10;
115 unsigned long r11;
116 };
117 long long int r1110;
118 };
119 union {
120 struct {
121 unsigned long r12;
122 unsigned long r13;
123 };
124 long long int r1312;
125 };
126 union {
127 struct {
128 unsigned long r14;
129 unsigned long r15;
130 };
131 long long int r1514;
132 };
133 union {
134 struct {
135 unsigned long r16;
136 unsigned long r17;
137 };
138 long long int r1716;
139 };
140 union {
141 struct {
142 unsigned long r18;
143 unsigned long r19;
144 };
145 long long int r1918;
146 };
147 union {
148 struct {
149 unsigned long r20;
150 unsigned long r21;
151 };
152 long long int r2120;
153 };
154 union {
155 struct {
156 unsigned long r22;
157 unsigned long r23;
158 };
159 long long int r2322;
160 };
161 union {
162 struct {
163 unsigned long r24;
164 unsigned long r25;
165 };
166 long long int r2524;
167 };
168 union {
169 struct {
170 unsigned long r26;
171 unsigned long r27;
172 };
173 long long int r2726;
174 };
175 union {
176 struct {
177 unsigned long r28;
178 unsigned long r29;
179 };
180 long long int r2928;
181 };
182 union {
183 struct {
184 unsigned long r30;
185 unsigned long r31;
186 };
187 long long int r3130;
188 };
189 /* VM dispatch pushes event record onto stack - we can build on it */
190 struct hvm_event_record hvmer;
191};
192
193/* Defines to conveniently access the values */
194
195/*
196 * As of the VM spec 0.5, these registers are now set/retrieved via a
197 * VM call. On the in-bound side, we just fetch the values
198 * at the entry points and stuff them into the old record in pt_regs.
199 * However, on the outbound side, probably at VM rte, we set the
200 * registers back.
201 */
202
203#define pt_elr(regs) ((regs)->hvmer.vmel)
204#define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
205#define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
206#define user_mode(regs) \
207 (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
208#define ints_enabled(regs) \
209 (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
210#define pt_psp(regs) ((regs)->hvmer.vmpsp)
211#define pt_badva(regs) ((regs)->hvmer.vmbadva)
212
213#define pt_set_singlestep(regs) ((regs)->hvmer.vmest |= (1<<HVM_VMEST_SS_SFT))
214#define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT))
215
216#define pt_set_rte_sp(regs, sp) do {\
217 pt_psp(regs) = (regs)->r29 = (sp);\
218 } while (0)
219
220#define pt_set_kmode(regs) \
221 (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
222
223#define pt_set_usermode(regs) \
224 (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
225 | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
226
227#endif /* ifndef __ASSEMBLY */
228
229#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/setup.h created+31
...@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_SETUP_H
21#define _ASM_SETUP_H
22
23#define __init
24
25#include <asm-generic/setup.h>
26
27extern char external_cmdline_buffer;
28
29void __init setup_arch_memory(void);
30
31#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/sigcontext.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_SIGCONTEXT_H
21#define _ASM_SIGCONTEXT_H
22
23#include <asm/user.h>
24
25/*
26 * Signal context structure - contains all info to do with the state
27 * before the signal handler was invoked. Note: only add new entries
28 * to the end of the structure.
29 */
30struct sigcontext {
31 struct user_regs_struct sc_regs;
32} __aligned(8);
33
34#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/signal.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_SIGNAL_H
21#define _ASM_SIGNAL_H
22
23extern unsigned long __rt_sigtramp_template[2];
24
25void do_signal(struct pt_regs *regs);
26
27#include <asm-generic/signal.h>
28
29#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/swab.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20#ifndef _ASM_SWAB_H
21#define _ASM_SWAB_H
22
23#define __SWAB_64_THRU_32__
24
25#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd.h created+40
...@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Syscall support for Hexagon
4 *
5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 and
9 * only version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA.
20 */
21
22/*
23 * The kernel pulls this unistd.h in three different ways:
24 * 1. the "normal" way which gets all the __NR defines
25 * 2. with __SYSCALL defined to produce function declarations
26 * 3. with __SYSCALL defined to produce syscall table initialization
27 * See also: syscalltab.c
28 */
29
30#define sys_mmap2 sys_mmap_pgoff
31#define __ARCH_WANT_RENAMEAT
32#define __ARCH_WANT_STAT64
33#define __ARCH_WANT_SET_GET_RLIMIT
34#define __ARCH_WANT_SYS_EXECVE
35#define __ARCH_WANT_SYS_CLONE
36#define __ARCH_WANT_SYS_VFORK
37#define __ARCH_WANT_SYS_FORK
38#define __ARCH_WANT_TIME32_SYSCALLS
39
40#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/user.h created+70
...@@ -0,0 +1,70 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef HEXAGON_ASM_USER_H
3#define HEXAGON_ASM_USER_H
4
5/*
6 * Layout for registers passed in elf core dumps to userspace.
7 *
8 * Basically a rearranged subset of "pt_regs".
9 *
10 * Interested parties: libc, gdb...
11 */
12
13struct user_regs_struct {
14 unsigned long r0;
15 unsigned long r1;
16 unsigned long r2;
17 unsigned long r3;
18 unsigned long r4;
19 unsigned long r5;
20 unsigned long r6;
21 unsigned long r7;
22 unsigned long r8;
23 unsigned long r9;
24 unsigned long r10;
25 unsigned long r11;
26 unsigned long r12;
27 unsigned long r13;
28 unsigned long r14;
29 unsigned long r15;
30 unsigned long r16;
31 unsigned long r17;
32 unsigned long r18;
33 unsigned long r19;
34 unsigned long r20;
35 unsigned long r21;
36 unsigned long r22;
37 unsigned long r23;
38 unsigned long r24;
39 unsigned long r25;
40 unsigned long r26;
41 unsigned long r27;
42 unsigned long r28;
43 unsigned long r29;
44 unsigned long r30;
45 unsigned long r31;
46 unsigned long sa0;
47 unsigned long lc0;
48 unsigned long sa1;
49 unsigned long lc1;
50 unsigned long m0;
51 unsigned long m1;
52 unsigned long usr;
53 unsigned long p3_0;
54 unsigned long gp;
55 unsigned long ugp;
56 unsigned long pc;
57 unsigned long cause;
58 unsigned long badva;
59#if CONFIG_HEXAGON_ARCH_VERSION < 4
60 unsigned long pad1; /* pad out to 48 words total */
61 unsigned long pad2; /* pad out to 48 words total */
62 unsigned long pad3; /* pad out to 48 words total */
63#else
64 unsigned long cs0;
65 unsigned long cs1;
66 unsigned long pad1; /* pad out to 48 words total */
67#endif
68};
69
70#endif
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/auxvec.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_AUXVEC_H
3#define _ASM_X86_AUXVEC_H
4/*
5 * Architecture-neutral AT_ values in 0-17, leave some room
6 * for more of them, start the x86-specific ones at 32.
7 */
8#ifdef __i386__
9#define AT_SYSINFO 32
10#endif
11#define AT_SYSINFO_EHDR 33
12
13/* entries in ARCH_DLINFO: */
14#if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64)
15# define AT_VECTOR_SIZE_ARCH 2
16#else /* else it's non-compat x86-64 */
17# define AT_VECTOR_SIZE_ARCH 1
18#endif
19
20#endif /* _ASM_X86_AUXVEC_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/bitsperlong.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_BITSPERLONG_H
3#define __ASM_X86_BITSPERLONG_H
4
5#if defined(__x86_64__) && !defined(__ILP32__)
6# define __BITS_PER_LONG 64
7#else
8# define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_X86_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/byteorder.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_BYTEORDER_H
3#define _ASM_X86_BYTEORDER_H
4
5#include <linux/byteorder/little_endian.h>
6
7#endif /* _ASM_X86_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/kvm.h deleted-419
...@@ -1,419 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_H
3#define _ASM_X86_KVM_H
4
5/*
6 * KVM x86 specific structures and definitions
7 *
8 */
9
10#include <linux/types.h>
11#include <linux/ioctl.h>
12
13#define KVM_PIO_PAGE_OFFSET 1
14#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
15
16#define DE_VECTOR 0
17#define DB_VECTOR 1
18#define BP_VECTOR 3
19#define OF_VECTOR 4
20#define BR_VECTOR 5
21#define UD_VECTOR 6
22#define NM_VECTOR 7
23#define DF_VECTOR 8
24#define TS_VECTOR 10
25#define NP_VECTOR 11
26#define SS_VECTOR 12
27#define GP_VECTOR 13
28#define PF_VECTOR 14
29#define MF_VECTOR 16
30#define AC_VECTOR 17
31#define MC_VECTOR 18
32#define XM_VECTOR 19
33#define VE_VECTOR 20
34
35/* Select x86 specific features in <linux/kvm.h> */
36#define __KVM_HAVE_PIT
37#define __KVM_HAVE_IOAPIC
38#define __KVM_HAVE_IRQ_LINE
39#define __KVM_HAVE_MSI
40#define __KVM_HAVE_USER_NMI
41#define __KVM_HAVE_GUEST_DEBUG
42#define __KVM_HAVE_MSIX
43#define __KVM_HAVE_MCE
44#define __KVM_HAVE_PIT_STATE2
45#define __KVM_HAVE_XEN_HVM
46#define __KVM_HAVE_VCPU_EVENTS
47#define __KVM_HAVE_DEBUGREGS
48#define __KVM_HAVE_XSAVE
49#define __KVM_HAVE_XCRS
50#define __KVM_HAVE_READONLY_MEM
51
52/* Architectural interrupt line count. */
53#define KVM_NR_INTERRUPTS 256
54
55struct kvm_memory_alias {
56 __u32 slot; /* this has a different namespace than memory slots */
57 __u32 flags;
58 __u64 guest_phys_addr;
59 __u64 memory_size;
60 __u64 target_phys_addr;
61};
62
63/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
64struct kvm_pic_state {
65 __u8 last_irr; /* edge detection */
66 __u8 irr; /* interrupt request register */
67 __u8 imr; /* interrupt mask register */
68 __u8 isr; /* interrupt service register */
69 __u8 priority_add; /* highest irq priority */
70 __u8 irq_base;
71 __u8 read_reg_select;
72 __u8 poll;
73 __u8 special_mask;
74 __u8 init_state;
75 __u8 auto_eoi;
76 __u8 rotate_on_auto_eoi;
77 __u8 special_fully_nested_mode;
78 __u8 init4; /* true if 4 byte init */
79 __u8 elcr; /* PIIX edge/trigger selection */
80 __u8 elcr_mask;
81};
82
83#define KVM_IOAPIC_NUM_PINS 24
84struct kvm_ioapic_state {
85 __u64 base_address;
86 __u32 ioregsel;
87 __u32 id;
88 __u32 irr;
89 __u32 pad;
90 union {
91 __u64 bits;
92 struct {
93 __u8 vector;
94 __u8 delivery_mode:3;
95 __u8 dest_mode:1;
96 __u8 delivery_status:1;
97 __u8 polarity:1;
98 __u8 remote_irr:1;
99 __u8 trig_mode:1;
100 __u8 mask:1;
101 __u8 reserve:7;
102 __u8 reserved[4];
103 __u8 dest_id;
104 } fields;
105 } redirtbl[KVM_IOAPIC_NUM_PINS];
106};
107
108#define KVM_IRQCHIP_PIC_MASTER 0
109#define KVM_IRQCHIP_PIC_SLAVE 1
110#define KVM_IRQCHIP_IOAPIC 2
111#define KVM_NR_IRQCHIPS 3
112
113#define KVM_RUN_X86_SMM (1 << 0)
114
115/* for KVM_GET_REGS and KVM_SET_REGS */
116struct kvm_regs {
117 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
118 __u64 rax, rbx, rcx, rdx;
119 __u64 rsi, rdi, rsp, rbp;
120 __u64 r8, r9, r10, r11;
121 __u64 r12, r13, r14, r15;
122 __u64 rip, rflags;
123};
124
125/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
126#define KVM_APIC_REG_SIZE 0x400
127struct kvm_lapic_state {
128 char regs[KVM_APIC_REG_SIZE];
129};
130
131struct kvm_segment {
132 __u64 base;
133 __u32 limit;
134 __u16 selector;
135 __u8 type;
136 __u8 present, dpl, db, s, l, g, avl;
137 __u8 unusable;
138 __u8 padding;
139};
140
141struct kvm_dtable {
142 __u64 base;
143 __u16 limit;
144 __u16 padding[3];
145};
146
147
148/* for KVM_GET_SREGS and KVM_SET_SREGS */
149struct kvm_sregs {
150 /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
151 struct kvm_segment cs, ds, es, fs, gs, ss;
152 struct kvm_segment tr, ldt;
153 struct kvm_dtable gdt, idt;
154 __u64 cr0, cr2, cr3, cr4, cr8;
155 __u64 efer;
156 __u64 apic_base;
157 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
158};
159
160/* for KVM_GET_FPU and KVM_SET_FPU */
161struct kvm_fpu {
162 __u8 fpr[8][16];
163 __u16 fcw;
164 __u16 fsw;
165 __u8 ftwx; /* in fxsave format */
166 __u8 pad1;
167 __u16 last_opcode;
168 __u64 last_ip;
169 __u64 last_dp;
170 __u8 xmm[16][16];
171 __u32 mxcsr;
172 __u32 pad2;
173};
174
175struct kvm_msr_entry {
176 __u32 index;
177 __u32 reserved;
178 __u64 data;
179};
180
181/* for KVM_GET_MSRS and KVM_SET_MSRS */
182struct kvm_msrs {
183 __u32 nmsrs; /* number of msrs in entries */
184 __u32 pad;
185
186 struct kvm_msr_entry entries[0];
187};
188
189/* for KVM_GET_MSR_INDEX_LIST */
190struct kvm_msr_list {
191 __u32 nmsrs; /* number of msrs in entries */
192 __u32 indices[0];
193};
194
195
196struct kvm_cpuid_entry {
197 __u32 function;
198 __u32 eax;
199 __u32 ebx;
200 __u32 ecx;
201 __u32 edx;
202 __u32 padding;
203};
204
205/* for KVM_SET_CPUID */
206struct kvm_cpuid {
207 __u32 nent;
208 __u32 padding;
209 struct kvm_cpuid_entry entries[0];
210};
211
212struct kvm_cpuid_entry2 {
213 __u32 function;
214 __u32 index;
215 __u32 flags;
216 __u32 eax;
217 __u32 ebx;
218 __u32 ecx;
219 __u32 edx;
220 __u32 padding[3];
221};
222
223#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0)
224#define KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1)
225#define KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2)
226
227/* for KVM_SET_CPUID2 */
228struct kvm_cpuid2 {
229 __u32 nent;
230 __u32 padding;
231 struct kvm_cpuid_entry2 entries[0];
232};
233
234/* for KVM_GET_PIT and KVM_SET_PIT */
235struct kvm_pit_channel_state {
236 __u32 count; /* can be 65536 */
237 __u16 latched_count;
238 __u8 count_latched;
239 __u8 status_latched;
240 __u8 status;
241 __u8 read_state;
242 __u8 write_state;
243 __u8 write_latch;
244 __u8 rw_mode;
245 __u8 mode;
246 __u8 bcd;
247 __u8 gate;
248 __s64 count_load_time;
249};
250
251struct kvm_debug_exit_arch {
252 __u32 exception;
253 __u32 pad;
254 __u64 pc;
255 __u64 dr6;
256 __u64 dr7;
257};
258
259#define KVM_GUESTDBG_USE_SW_BP 0x00010000
260#define KVM_GUESTDBG_USE_HW_BP 0x00020000
261#define KVM_GUESTDBG_INJECT_DB 0x00040000
262#define KVM_GUESTDBG_INJECT_BP 0x00080000
263
264/* for KVM_SET_GUEST_DEBUG */
265struct kvm_guest_debug_arch {
266 __u64 debugreg[8];
267};
268
269struct kvm_pit_state {
270 struct kvm_pit_channel_state channels[3];
271};
272
273#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
274
275struct kvm_pit_state2 {
276 struct kvm_pit_channel_state channels[3];
277 __u32 flags;
278 __u32 reserved[9];
279};
280
281struct kvm_reinject_control {
282 __u8 pit_reinject;
283 __u8 reserved[31];
284};
285
286/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */
287#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001
288#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
289#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
290#define KVM_VCPUEVENT_VALID_SMM 0x00000008
291
292/* Interrupt shadow states */
293#define KVM_X86_SHADOW_INT_MOV_SS 0x01
294#define KVM_X86_SHADOW_INT_STI 0x02
295
296/* for KVM_GET/SET_VCPU_EVENTS */
297struct kvm_vcpu_events {
298 struct {
299 __u8 injected;
300 __u8 nr;
301 __u8 has_error_code;
302 __u8 pad;
303 __u32 error_code;
304 } exception;
305 struct {
306 __u8 injected;
307 __u8 nr;
308 __u8 soft;
309 __u8 shadow;
310 } interrupt;
311 struct {
312 __u8 injected;
313 __u8 pending;
314 __u8 masked;
315 __u8 pad;
316 } nmi;
317 __u32 sipi_vector;
318 __u32 flags;
319 struct {
320 __u8 smm;
321 __u8 pending;
322 __u8 smm_inside_nmi;
323 __u8 latched_init;
324 } smi;
325 __u32 reserved[9];
326};
327
328/* for KVM_GET/SET_DEBUGREGS */
329struct kvm_debugregs {
330 __u64 db[4];
331 __u64 dr6;
332 __u64 dr7;
333 __u64 flags;
334 __u64 reserved[9];
335};
336
337/* for KVM_CAP_XSAVE */
338struct kvm_xsave {
339 __u32 region[1024];
340};
341
342#define KVM_MAX_XCRS 16
343
344struct kvm_xcr {
345 __u32 xcr;
346 __u32 reserved;
347 __u64 value;
348};
349
350struct kvm_xcrs {
351 __u32 nr_xcrs;
352 __u32 flags;
353 struct kvm_xcr xcrs[KVM_MAX_XCRS];
354 __u64 padding[16];
355};
356
357#define KVM_SYNC_X86_REGS (1UL << 0)
358#define KVM_SYNC_X86_SREGS (1UL << 1)
359#define KVM_SYNC_X86_EVENTS (1UL << 2)
360
361#define KVM_SYNC_X86_VALID_FIELDS \
362 (KVM_SYNC_X86_REGS| \
363 KVM_SYNC_X86_SREGS| \
364 KVM_SYNC_X86_EVENTS)
365
366/* kvm_sync_regs struct included by kvm_run struct */
367struct kvm_sync_regs {
368 /* Members of this structure are potentially malicious.
369 * Care must be taken by code reading, esp. interpreting,
370 * data fields from them inside KVM to prevent TOCTOU and
371 * double-fetch types of vulnerabilities.
372 */
373 struct kvm_regs regs;
374 struct kvm_sregs sregs;
375 struct kvm_vcpu_events events;
376};
377
378#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
379#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
380#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
381
382#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
383#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
384
385#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
386#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
387
388struct kvm_vmx_nested_state {
389 __u64 vmxon_pa;
390 __u64 vmcs_pa;
391
392 struct {
393 __u16 flags;
394 } smm;
395};
396
397/* for KVM_CAP_NESTED_STATE */
398struct kvm_nested_state {
399 /* KVM_STATE_* flags */
400 __u16 flags;
401
402 /* 0 for VMX, 1 for SVM. */
403 __u16 format;
404
405 /* 128 for SVM, 128 + VMCS size for VMX. */
406 __u32 size;
407
408 union {
409 /* VMXON, VMCS */
410 struct kvm_vmx_nested_state vmx;
411
412 /* Pad the header to 128 bytes. */
413 __u8 pad[120];
414 };
415
416 __u8 data[0];
417};
418
419#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/kvm_para.h deleted-122
...@@ -1,122 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_PARA_H
3#define _ASM_X86_KVM_PARA_H
4
5#include <linux/types.h>
6
7/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
8 * should be used to determine that a VM is running under KVM.
9 */
10#define KVM_CPUID_SIGNATURE 0x40000000
11
12/* This CPUID returns two feature bitmaps in eax, edx. Before enabling
13 * a particular paravirtualization, the appropriate feature bit should
14 * be checked in eax. The performance hint feature bit should be checked
15 * in edx.
16 */
17#define KVM_CPUID_FEATURES 0x40000001
18#define KVM_FEATURE_CLOCKSOURCE 0
19#define KVM_FEATURE_NOP_IO_DELAY 1
20#define KVM_FEATURE_MMU_OP 2
21/* This indicates that the new set of kvmclock msrs
22 * are available. The use of 0x11 and 0x12 is deprecated
23 */
24#define KVM_FEATURE_CLOCKSOURCE2 3
25#define KVM_FEATURE_ASYNC_PF 4
26#define KVM_FEATURE_STEAL_TIME 5
27#define KVM_FEATURE_PV_EOI 6
28#define KVM_FEATURE_PV_UNHALT 7
29#define KVM_FEATURE_PV_TLB_FLUSH 9
30#define KVM_FEATURE_ASYNC_PF_VMEXIT 10
31#define KVM_FEATURE_PV_SEND_IPI 11
32
33#define KVM_HINTS_REALTIME 0
34
35/* The last 8 bits are used to indicate how to interpret the flags field
36 * in pvclock structure. If no bits are set, all flags are ignored.
37 */
38#define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 24
39
40#define MSR_KVM_WALL_CLOCK 0x11
41#define MSR_KVM_SYSTEM_TIME 0x12
42
43#define KVM_MSR_ENABLED 1
44/* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
45#define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00
46#define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
47#define MSR_KVM_ASYNC_PF_EN 0x4b564d02
48#define MSR_KVM_STEAL_TIME 0x4b564d03
49#define MSR_KVM_PV_EOI_EN 0x4b564d04
50
51struct kvm_steal_time {
52 __u64 steal;
53 __u32 version;
54 __u32 flags;
55 __u8 preempted;
56 __u8 u8_pad[3];
57 __u32 pad[11];
58};
59
60#define KVM_VCPU_PREEMPTED (1 << 0)
61#define KVM_VCPU_FLUSH_TLB (1 << 1)
62
63#define KVM_CLOCK_PAIRING_WALLCLOCK 0
64struct kvm_clock_pairing {
65 __s64 sec;
66 __s64 nsec;
67 __u64 tsc;
68 __u32 flags;
69 __u32 pad[9];
70};
71
72#define KVM_STEAL_ALIGNMENT_BITS 5
73#define KVM_STEAL_VALID_BITS ((-1ULL << (KVM_STEAL_ALIGNMENT_BITS + 1)))
74#define KVM_STEAL_RESERVED_MASK (((1 << KVM_STEAL_ALIGNMENT_BITS) - 1 ) << 1)
75
76#define KVM_MAX_MMU_OP_BATCH 32
77
78#define KVM_ASYNC_PF_ENABLED (1 << 0)
79#define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1)
80#define KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT (1 << 2)
81
82/* Operations for KVM_HC_MMU_OP */
83#define KVM_MMU_OP_WRITE_PTE 1
84#define KVM_MMU_OP_FLUSH_TLB 2
85#define KVM_MMU_OP_RELEASE_PT 3
86
87/* Payload for KVM_HC_MMU_OP */
88struct kvm_mmu_op_header {
89 __u32 op;
90 __u32 pad;
91};
92
93struct kvm_mmu_op_write_pte {
94 struct kvm_mmu_op_header header;
95 __u64 pte_phys;
96 __u64 pte_val;
97};
98
99struct kvm_mmu_op_flush_tlb {
100 struct kvm_mmu_op_header header;
101};
102
103struct kvm_mmu_op_release_pt {
104 struct kvm_mmu_op_header header;
105 __u64 pt_phys;
106};
107
108#define KVM_PV_REASON_PAGE_NOT_PRESENT 1
109#define KVM_PV_REASON_PAGE_READY 2
110
111struct kvm_vcpu_pv_apf_data {
112 __u32 reason;
113 __u8 pad[60];
114 __u32 enabled;
115};
116
117#define KVM_PV_EOI_BIT 0
118#define KVM_PV_EOI_MASK (0x1 << KVM_PV_EOI_BIT)
119#define KVM_PV_EOI_ENABLED KVM_PV_EOI_MASK
120#define KVM_PV_EOI_DISABLED 0x0
121
122#endif /* _ASM_X86_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/mman.h deleted-31
...@@ -1,31 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MMAN_H
3#define _ASM_X86_MMAN_H
4
5#define MAP_32BIT 0x40 /* only give out 32bit addresses */
6
7#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8/*
9 * Take the 4 protection key bits out of the vma->vm_flags
10 * value and turn them in to the bits that we can put in
11 * to a pte.
12 *
13 * Only override these if Protection Keys are available
14 * (which is only on 64-bit).
15 */
16#define arch_vm_get_page_prot(vm_flags) __pgprot( \
17 ((vm_flags) & VM_PKEY_BIT0 ? _PAGE_PKEY_BIT0 : 0) | \
18 ((vm_flags) & VM_PKEY_BIT1 ? _PAGE_PKEY_BIT1 : 0) | \
19 ((vm_flags) & VM_PKEY_BIT2 ? _PAGE_PKEY_BIT2 : 0) | \
20 ((vm_flags) & VM_PKEY_BIT3 ? _PAGE_PKEY_BIT3 : 0))
21
22#define arch_calc_vm_prot_bits(prot, key) ( \
23 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
24 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
25 ((key) & 0x4 ? VM_PKEY_BIT2 : 0) | \
26 ((key) & 0x8 ? VM_PKEY_BIT3 : 0))
27#endif
28
29#include <asm-generic/mman.h>
30
31#endif /* _ASM_X86_MMAN_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/msgbuf.h deleted-32
...@@ -1,32 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X64_MSGBUF_H
3#define __ASM_X64_MSGBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/msgbuf.h>
7#else
8/*
9 * The msqid64_ds structure for x86 architecture with x32 ABI.
10 *
11 * On x86-32 and x86-64 we can just use the generic definition, but
12 * x32 uses the same binary layout as x86_64, which is differnet
13 * from other 32-bit architectures.
14 */
15
16struct msqid64_ds {
17 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */
22 __kernel_ulong_t msg_qnum; /* number of messages in queue */
23 __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */
24 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25 __kernel_pid_t msg_lrpid; /* last receive pid */
26 __kernel_ulong_t __unused4;
27 __kernel_ulong_t __unused5;
28};
29
30#endif
31
32#endif /* __ASM_GENERIC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/perf_regs.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PERF_REGS_H
3#define _ASM_X86_PERF_REGS_H
4
5enum perf_event_x86_regs {
6 PERF_REG_X86_AX,
7 PERF_REG_X86_BX,
8 PERF_REG_X86_CX,
9 PERF_REG_X86_DX,
10 PERF_REG_X86_SI,
11 PERF_REG_X86_DI,
12 PERF_REG_X86_BP,
13 PERF_REG_X86_SP,
14 PERF_REG_X86_IP,
15 PERF_REG_X86_FLAGS,
16 PERF_REG_X86_CS,
17 PERF_REG_X86_SS,
18 PERF_REG_X86_DS,
19 PERF_REG_X86_ES,
20 PERF_REG_X86_FS,
21 PERF_REG_X86_GS,
22 PERF_REG_X86_R8,
23 PERF_REG_X86_R9,
24 PERF_REG_X86_R10,
25 PERF_REG_X86_R11,
26 PERF_REG_X86_R12,
27 PERF_REG_X86_R13,
28 PERF_REG_X86_R14,
29 PERF_REG_X86_R15,
30
31 PERF_REG_X86_32_MAX = PERF_REG_X86_GS + 1,
32 PERF_REG_X86_64_MAX = PERF_REG_X86_R15 + 1,
33};
34#endif /* _ASM_X86_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/posix_types.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2# ifdef __i386__
3# include <asm/posix_types_32.h>
4# elif defined(__ILP32__)
5# include <asm/posix_types_x32.h>
6# else
7# include <asm/posix_types_64.h>
8# endif
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/ptrace.h deleted-82
...@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PTRACE_H
3#define _ASM_X86_PTRACE_H
4
5 /* For */
6#include <asm/ptrace-abi.h>
7#include <asm/processor-flags.h>
8
9
10#ifndef __ASSEMBLY__
11
12#ifdef __i386__
13/* this struct defines the way the registers are stored on the
14 stack during a system call. */
15
16
17struct pt_regs {
18 long ebx;
19 long ecx;
20 long edx;
21 long esi;
22 long edi;
23 long ebp;
24 long eax;
25 int xds;
26 int xes;
27 int xfs;
28 int xgs;
29 long orig_eax;
30 long eip;
31 int xcs;
32 long eflags;
33 long esp;
34 int xss;
35};
36
37
38#else /* __i386__ */
39
40
41struct pt_regs {
42/*
43 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
44 * unless syscall needs a complete, fully filled "struct pt_regs".
45 */
46 unsigned long r15;
47 unsigned long r14;
48 unsigned long r13;
49 unsigned long r12;
50 unsigned long rbp;
51 unsigned long rbx;
52/* These regs are callee-clobbered. Always saved on kernel entry. */
53 unsigned long r11;
54 unsigned long r10;
55 unsigned long r9;
56 unsigned long r8;
57 unsigned long rax;
58 unsigned long rcx;
59 unsigned long rdx;
60 unsigned long rsi;
61 unsigned long rdi;
62/*
63 * On syscall entry, this is syscall#. On CPU exception, this is error code.
64 * On hw interrupt, it's IRQ number:
65 */
66 unsigned long orig_rax;
67/* Return frame for iretq */
68 unsigned long rip;
69 unsigned long cs;
70 unsigned long eflags;
71 unsigned long rsp;
72 unsigned long ss;
73/* top of stack page */
74};
75
76#endif /* !__i386__ */
77
78
79
80#endif /* !__ASSEMBLY__ */
81
82#endif /* _ASM_X86_PTRACE_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/sembuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SEMBUF_H
3#define _ASM_X86_SEMBUF_H
4
5/*
6 * The semid64_ds structure for x86 architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for:
11 * - 2 miscellaneous 32-bit values
12 *
13 * x86_64 and x32 incorrectly added padding here, so the structures
14 * are still incompatible with the padding on x86.
15 */
16struct semid64_ds {
17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
18#ifdef __i386__
19 unsigned long sem_otime; /* last semop time */
20 unsigned long sem_otime_high;
21 unsigned long sem_ctime; /* last change time */
22 unsigned long sem_ctime_high;
23#else
24 __kernel_time_t sem_otime; /* last semop time */
25 __kernel_ulong_t __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 __kernel_ulong_t __unused2;
28#endif
29 __kernel_ulong_t sem_nsems; /* no. of semaphores in array */
30 __kernel_ulong_t __unused3;
31 __kernel_ulong_t __unused4;
32};
33
34#endif /* _ASM_X86_SEMBUF_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/setup.h deleted-1
...@@ -1 +0,0 @@
1/* */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/shmbuf.h deleted-43
...@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_SHMBUF_H
3#define __ASM_X86_SHMBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/shmbuf.h>
7#else
8/*
9 * The shmid64_ds structure for x86 architecture with x32 ABI.
10 *
11 * On x86-32 and x86-64 we can just use the generic definition, but
12 * x32 uses the same binary layout as x86_64, which is differnet
13 * from other 32-bit architectures.
14 */
15
16struct shmid64_ds {
17 struct ipc64_perm shm_perm; /* operation perms */
18 size_t shm_segsz; /* size of segment (bytes) */
19 __kernel_time_t shm_atime; /* last attach time */
20 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
22 __kernel_pid_t shm_cpid; /* pid of creator */
23 __kernel_pid_t shm_lpid; /* pid of last operator */
24 __kernel_ulong_t shm_nattch; /* no. of current attaches */
25 __kernel_ulong_t __unused4;
26 __kernel_ulong_t __unused5;
27};
28
29struct shminfo64 {
30 __kernel_ulong_t shmmax;
31 __kernel_ulong_t shmmin;
32 __kernel_ulong_t shmmni;
33 __kernel_ulong_t shmseg;
34 __kernel_ulong_t shmall;
35 __kernel_ulong_t __unused1;
36 __kernel_ulong_t __unused2;
37 __kernel_ulong_t __unused3;
38 __kernel_ulong_t __unused4;
39};
40
41#endif
42
43#endif /* __ASM_X86_SHMBUF_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/sigcontext.h deleted-380
...@@ -1,380 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGCONTEXT_H
3#define _ASM_X86_SIGCONTEXT_H
4
5/*
6 * Linux signal context definitions. The sigcontext includes a complex
7 * hierarchy of CPU and FPU state, available to user-space (on the stack) when
8 * a signal handler is executed.
9 *
10 * As over the years this ABI grew from its very simple roots towards
11 * supporting more and more CPU state organically, some of the details (which
12 * were rather clever hacks back in the days) became a bit quirky by today.
13 *
14 * The current ABI includes flexible provisions for future extensions, so we
15 * won't have to grow new quirks for quite some time. Promise!
16 */
17
18
19#include <linux/types.h>
20
21#define FP_XSTATE_MAGIC1 0x46505853U
22#define FP_XSTATE_MAGIC2 0x46505845U
23#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
24
25/*
26 * Bytes 464..511 in the current 512-byte layout of the FXSAVE/FXRSTOR frame
27 * are reserved for SW usage. On CPUs supporting XSAVE/XRSTOR, these bytes are
28 * used to extend the fpstate pointer in the sigcontext, which now includes the
29 * extended state information along with fpstate information.
30 *
31 * If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then there's a
32 * sw_reserved.extended_size bytes large extended context area present. (The
33 * last 32-bit word of this extended area (at the
34 * fpstate+extended_size-FP_XSTATE_MAGIC2_SIZE address) is set to
35 * FP_XSTATE_MAGIC2 so that you can sanity check your size calculations.)
36 *
37 * This extended area typically grows with newer CPUs that have larger and
38 * larger XSAVE areas.
39 */
40struct _fpx_sw_bytes {
41 /*
42 * If set to FP_XSTATE_MAGIC1 then this is an xstate context.
43 * 0 if a legacy frame.
44 */
45 __u32 magic1;
46
47 /*
48 * Total size of the fpstate area:
49 *
50 * - if magic1 == 0 then it's sizeof(struct _fpstate)
51 * - if magic1 == FP_XSTATE_MAGIC1 then it's sizeof(struct _xstate)
52 * plus extensions (if any)
53 */
54 __u32 extended_size;
55
56 /*
57 * Feature bit mask (including FP/SSE/extended state) that is present
58 * in the memory layout:
59 */
60 __u64 xfeatures;
61
62 /*
63 * Actual XSAVE state size, based on the xfeatures saved in the layout.
64 * 'extended_size' is greater than 'xstate_size':
65 */
66 __u32 xstate_size;
67
68 /* For future use: */
69 __u32 padding[7];
70};
71
72/*
73 * As documented in the iBCS2 standard:
74 *
75 * The first part of "struct _fpstate" is just the normal i387 hardware setup,
76 * the extra "status" word is used to save the coprocessor status word before
77 * entering the handler.
78 *
79 * The FPU state data structure has had to grow to accommodate the extended FPU
80 * state required by the Streaming SIMD Extensions. There is no documented
81 * standard to accomplish this at the moment.
82 */
83
84/* 10-byte legacy floating point register: */
85struct _fpreg {
86 __u16 significand[4];
87 __u16 exponent;
88};
89
90/* 16-byte floating point register: */
91struct _fpxreg {
92 __u16 significand[4];
93 __u16 exponent;
94 __u16 padding[3];
95};
96
97/* 16-byte XMM register: */
98struct _xmmreg {
99 __u32 element[4];
100};
101
102#define X86_FXSR_MAGIC 0x0000
103
104/*
105 * The 32-bit FPU frame:
106 */
107struct _fpstate_32 {
108 /* Legacy FPU environment: */
109 __u32 cw;
110 __u32 sw;
111 __u32 tag;
112 __u32 ipoff;
113 __u32 cssel;
114 __u32 dataoff;
115 __u32 datasel;
116 struct _fpreg _st[8];
117 __u16 status;
118 __u16 magic; /* 0xffff: regular FPU data only */
119 /* 0x0000: FXSR FPU data */
120
121 /* FXSR FPU environment */
122 __u32 _fxsr_env[6]; /* FXSR FPU env is ignored */
123 __u32 mxcsr;
124 __u32 reserved;
125 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
126 struct _xmmreg _xmm[8]; /* First 8 XMM registers */
127 union {
128 __u32 padding1[44]; /* Second 8 XMM registers plus padding */
129 __u32 padding[44]; /* Alias name for old user-space */
130 };
131
132 union {
133 __u32 padding2[12];
134 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
135 };
136};
137
138/*
139 * The 64-bit FPU frame. (FXSAVE format and later)
140 *
141 * Note1: If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then the structure is
142 * larger: 'struct _xstate'. Note that 'struct _xstate' embedds
143 * 'struct _fpstate' so that you can always assume the _fpstate portion
144 * exists so that you can check the magic value.
145 *
146 * Note2: Reserved fields may someday contain valuable data. Always
147 * save/restore them when you change signal frames.
148 */
149struct _fpstate_64 {
150 __u16 cwd;
151 __u16 swd;
152 /* Note this is not the same as the 32-bit/x87/FSAVE twd: */
153 __u16 twd;
154 __u16 fop;
155 __u64 rip;
156 __u64 rdp;
157 __u32 mxcsr;
158 __u32 mxcsr_mask;
159 __u32 st_space[32]; /* 8x FP registers, 16 bytes each */
160 __u32 xmm_space[64]; /* 16x XMM registers, 16 bytes each */
161 __u32 reserved2[12];
162 union {
163 __u32 reserved3[12];
164 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
165 };
166};
167
168#ifdef __i386__
169# define _fpstate _fpstate_32
170#else
171# define _fpstate _fpstate_64
172#endif
173
174struct _header {
175 __u64 xfeatures;
176 __u64 reserved1[2];
177 __u64 reserved2[5];
178};
179
180struct _ymmh_state {
181 /* 16x YMM registers, 16 bytes each: */
182 __u32 ymmh_space[64];
183};
184
185/*
186 * Extended state pointed to by sigcontext::fpstate.
187 *
188 * In addition to the fpstate, information encoded in _xstate::xstate_hdr
189 * indicates the presence of other extended state information supported
190 * by the CPU and kernel:
191 */
192struct _xstate {
193 struct _fpstate fpstate;
194 struct _header xstate_hdr;
195 struct _ymmh_state ymmh;
196 /* New processor state extensions go here: */
197};
198
199/*
200 * The 32-bit signal frame:
201 */
202struct sigcontext_32 {
203 __u16 gs, __gsh;
204 __u16 fs, __fsh;
205 __u16 es, __esh;
206 __u16 ds, __dsh;
207 __u32 di;
208 __u32 si;
209 __u32 bp;
210 __u32 sp;
211 __u32 bx;
212 __u32 dx;
213 __u32 cx;
214 __u32 ax;
215 __u32 trapno;
216 __u32 err;
217 __u32 ip;
218 __u16 cs, __csh;
219 __u32 flags;
220 __u32 sp_at_signal;
221 __u16 ss, __ssh;
222
223 /*
224 * fpstate is really (struct _fpstate *) or (struct _xstate *)
225 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
226 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
227 * of extended memory layout. See comments at the definition of
228 * (struct _fpx_sw_bytes)
229 */
230 __u32 fpstate; /* Zero when no FPU/extended context */
231 __u32 oldmask;
232 __u32 cr2;
233};
234
235/*
236 * The 64-bit signal frame:
237 */
238struct sigcontext_64 {
239 __u64 r8;
240 __u64 r9;
241 __u64 r10;
242 __u64 r11;
243 __u64 r12;
244 __u64 r13;
245 __u64 r14;
246 __u64 r15;
247 __u64 di;
248 __u64 si;
249 __u64 bp;
250 __u64 bx;
251 __u64 dx;
252 __u64 ax;
253 __u64 cx;
254 __u64 sp;
255 __u64 ip;
256 __u64 flags;
257 __u16 cs;
258 __u16 gs;
259 __u16 fs;
260 __u16 ss;
261 __u64 err;
262 __u64 trapno;
263 __u64 oldmask;
264 __u64 cr2;
265
266 /*
267 * fpstate is really (struct _fpstate *) or (struct _xstate *)
268 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
269 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
270 * of extended memory layout. See comments at the definition of
271 * (struct _fpx_sw_bytes)
272 */
273 __u64 fpstate; /* Zero when no FPU/extended context */
274 __u64 reserved1[8];
275};
276
277/*
278 * Create the real 'struct sigcontext' type:
279 */
280
281/*
282 * The old user-space sigcontext definition, just in case user-space still
283 * relies on it. The kernel definition (in asm/sigcontext.h) has unified
284 * field names but otherwise the same layout.
285 */
286
287#define _fpstate_ia32 _fpstate_32
288#define sigcontext_ia32 sigcontext_32
289
290
291# ifdef __i386__
292struct sigcontext {
293 __u16 gs, __gsh;
294 __u16 fs, __fsh;
295 __u16 es, __esh;
296 __u16 ds, __dsh;
297 __u32 edi;
298 __u32 esi;
299 __u32 ebp;
300 __u32 esp;
301 __u32 ebx;
302 __u32 edx;
303 __u32 ecx;
304 __u32 eax;
305 __u32 trapno;
306 __u32 err;
307 __u32 eip;
308 __u16 cs, __csh;
309 __u32 eflags;
310 __u32 esp_at_signal;
311 __u16 ss, __ssh;
312 struct _fpstate *fpstate;
313 __u32 oldmask;
314 __u32 cr2;
315};
316# else /* __x86_64__: */
317struct sigcontext {
318 __u64 r8;
319 __u64 r9;
320 __u64 r10;
321 __u64 r11;
322 __u64 r12;
323 __u64 r13;
324 __u64 r14;
325 __u64 r15;
326 __u64 rdi;
327 __u64 rsi;
328 __u64 rbp;
329 __u64 rbx;
330 __u64 rdx;
331 __u64 rax;
332 __u64 rcx;
333 __u64 rsp;
334 __u64 rip;
335 __u64 eflags; /* RFLAGS */
336 __u16 cs;
337
338 /*
339 * Prior to 2.5.64 ("[PATCH] x86-64 updates for 2.5.64-bk3"),
340 * Linux saved and restored fs and gs in these slots. This
341 * was counterproductive, as fsbase and gsbase were never
342 * saved, so arch_prctl was presumably unreliable.
343 *
344 * These slots should never be reused without extreme caution:
345 *
346 * - Some DOSEMU versions stash fs and gs in these slots manually,
347 * thus overwriting anything the kernel expects to be preserved
348 * in these slots.
349 *
350 * - If these slots are ever needed for any other purpose,
351 * there is some risk that very old 64-bit binaries could get
352 * confused. I doubt that many such binaries still work,
353 * though, since the same patch in 2.5.64 also removed the
354 * 64-bit set_thread_area syscall, so it appears that there
355 * is no TLS API beyond modify_ldt that works in both pre-
356 * and post-2.5.64 kernels.
357 *
358 * If the kernel ever adds explicit fs, gs, fsbase, and gsbase
359 * save/restore, it will most likely need to be opt-in and use
360 * different context slots.
361 */
362 __u16 gs;
363 __u16 fs;
364 union {
365 __u16 ss; /* If UC_SIGCONTEXT_SS */
366 __u16 __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */
367 };
368 __u64 err;
369 __u64 trapno;
370 __u64 oldmask;
371 __u64 cr2;
372 struct _fpstate *fpstate; /* Zero when no FPU context */
373# ifdef __ILP32__
374 __u32 __fpstate_pad;
375# endif
376 __u64 reserved1[8];
377};
378# endif /* __x86_64__ */
379
380#endif /* _ASM_X86_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/siginfo.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGINFO_H
3#define _ASM_X86_SIGINFO_H
4
5#ifdef __x86_64__
6# ifdef __ILP32__ /* x32 */
7typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
8# define __ARCH_SI_CLOCK_T __kernel_si_clock_t
9# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
10# else /* x86-64 */
11# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
12# endif
13#endif
14
15#include <asm-generic/siginfo.h>
16
17#endif /* _ASM_X86_SIGINFO_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/signal.h deleted-132
...@@ -1,132 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGNAL_H
3#define _ASM_X86_SIGNAL_H
4
5#ifndef __ASSEMBLY__
6#include <linux/types.h>
7#include <linux/time.h>
8
9
10/* Avoid too many header ordering problems. */
11struct siginfo;
12
13/* Here we must cater to libcs that poke about in kernel headers. */
14
15#define NSIG 32
16typedef unsigned long sigset_t;
17
18#endif /* __ASSEMBLY__ */
19
20
21#define SIGHUP 1
22#define SIGINT 2
23#define SIGQUIT 3
24#define SIGILL 4
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28#define SIGBUS 7
29#define SIGFPE 8
30#define SIGKILL 9
31#define SIGUSR1 10
32#define SIGSEGV 11
33#define SIGUSR2 12
34#define SIGPIPE 13
35#define SIGALRM 14
36#define SIGTERM 15
37#define SIGSTKFLT 16
38#define SIGCHLD 17
39#define SIGCONT 18
40#define SIGSTOP 19
41#define SIGTSTP 20
42#define SIGTTIN 21
43#define SIGTTOU 22
44#define SIGURG 23
45#define SIGXCPU 24
46#define SIGXFSZ 25
47#define SIGVTALRM 26
48#define SIGPROF 27
49#define SIGWINCH 28
50#define SIGIO 29
51#define SIGPOLL SIGIO
52/*
53#define SIGLOST 29
54*/
55#define SIGPWR 30
56#define SIGSYS 31
57#define SIGUNUSED 31
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK indicates that a registered stack_t will be used.
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001u
77#define SA_NOCLDWAIT 0x00000002u
78#define SA_SIGINFO 0x00000004u
79#define SA_ONSTACK 0x08000000u
80#define SA_RESTART 0x10000000u
81#define SA_NODEFER 0x40000000u
82#define SA_RESETHAND 0x80000000u
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000
88
89#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192
91
92#include <asm-generic/signal-defs.h>
93
94#ifndef __ASSEMBLY__
95
96
97/* Here we must cater to libcs that poke about in kernel headers. */
98#ifdef __i386__
99
100struct sigaction {
101 union {
102 __sighandler_t _sa_handler;
103 void (*_sa_sigaction)(int, struct siginfo *, void *);
104 } _u;
105 sigset_t sa_mask;
106 unsigned long sa_flags;
107 void (*sa_restorer)(void);
108};
109
110#define sa_handler _u._sa_handler
111#define sa_sigaction _u._sa_sigaction
112
113#else /* __i386__ */
114
115struct sigaction {
116 __sighandler_t sa_handler;
117 unsigned long sa_flags;
118 __sigrestore_t sa_restorer;
119 sigset_t sa_mask; /* mask last for extensibility */
120};
121
122#endif /* !__i386__ */
123
124typedef struct sigaltstack {
125 void *ss_sp;
126 int ss_flags;
127 size_t ss_size;
128} stack_t;
129
130#endif /* __ASSEMBLY__ */
131
132#endif /* _ASM_X86_SIGNAL_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/stat.h deleted-138
...@@ -1,138 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STAT_H
3#define _ASM_X86_STAT_H
4
5#include <asm/posix_types.h>
6
7#define STAT_HAVE_NSEC 1
8
9#ifdef __i386__
10struct stat {
11 unsigned long st_dev;
12 unsigned long st_ino;
13 unsigned short st_mode;
14 unsigned short st_nlink;
15 unsigned short st_uid;
16 unsigned short st_gid;
17 unsigned long st_rdev;
18 unsigned long st_size;
19 unsigned long st_blksize;
20 unsigned long st_blocks;
21 unsigned long st_atime;
22 unsigned long st_atime_nsec;
23 unsigned long st_mtime;
24 unsigned long st_mtime_nsec;
25 unsigned long st_ctime;
26 unsigned long st_ctime_nsec;
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31/* We don't need to memset the whole thing just to initialize the padding */
32#define INIT_STRUCT_STAT_PADDING(st) do { \
33 st.__unused4 = 0; \
34 st.__unused5 = 0; \
35} while (0)
36
37#define STAT64_HAS_BROKEN_ST_INO 1
38
39/* This matches struct stat64 in glibc2.1, hence the absolutely
40 * insane amounts of padding around dev_t's.
41 */
42struct stat64 {
43 unsigned long long st_dev;
44 unsigned char __pad0[4];
45
46 unsigned long __st_ino;
47
48 unsigned int st_mode;
49 unsigned int st_nlink;
50
51 unsigned long st_uid;
52 unsigned long st_gid;
53
54 unsigned long long st_rdev;
55 unsigned char __pad3[4];
56
57 long long st_size;
58 unsigned long st_blksize;
59
60 /* Number 512-byte blocks allocated. */
61 unsigned long long st_blocks;
62
63 unsigned long st_atime;
64 unsigned long st_atime_nsec;
65
66 unsigned long st_mtime;
67 unsigned int st_mtime_nsec;
68
69 unsigned long st_ctime;
70 unsigned long st_ctime_nsec;
71
72 unsigned long long st_ino;
73};
74
75/* We don't need to memset the whole thing just to initialize the padding */
76#define INIT_STRUCT_STAT64_PADDING(st) do { \
77 memset(&st.__pad0, 0, sizeof(st.__pad0)); \
78 memset(&st.__pad3, 0, sizeof(st.__pad3)); \
79} while (0)
80
81#else /* __i386__ */
82
83struct stat {
84 __kernel_ulong_t st_dev;
85 __kernel_ulong_t st_ino;
86 __kernel_ulong_t st_nlink;
87
88 unsigned int st_mode;
89 unsigned int st_uid;
90 unsigned int st_gid;
91 unsigned int __pad0;
92 __kernel_ulong_t st_rdev;
93 __kernel_long_t st_size;
94 __kernel_long_t st_blksize;
95 __kernel_long_t st_blocks; /* Number 512-byte blocks allocated. */
96
97 __kernel_ulong_t st_atime;
98 __kernel_ulong_t st_atime_nsec;
99 __kernel_ulong_t st_mtime;
100 __kernel_ulong_t st_mtime_nsec;
101 __kernel_ulong_t st_ctime;
102 __kernel_ulong_t st_ctime_nsec;
103 __kernel_long_t __unused[3];
104};
105
106/* We don't need to memset the whole thing just to initialize the padding */
107#define INIT_STRUCT_STAT_PADDING(st) do { \
108 st.__pad0 = 0; \
109 st.__unused[0] = 0; \
110 st.__unused[1] = 0; \
111 st.__unused[2] = 0; \
112} while (0)
113
114#endif
115
116/* for 32bit emulation and 32 bit kernels */
117struct __old_kernel_stat {
118 unsigned short st_dev;
119 unsigned short st_ino;
120 unsigned short st_mode;
121 unsigned short st_nlink;
122 unsigned short st_uid;
123 unsigned short st_gid;
124 unsigned short st_rdev;
125#ifdef __i386__
126 unsigned long st_size;
127 unsigned long st_atime;
128 unsigned long st_mtime;
129 unsigned long st_ctime;
130#else
131 unsigned int st_size;
132 unsigned int st_atime;
133 unsigned int st_mtime;
134 unsigned int st_ctime;
135#endif
136};
137
138#endif /* _ASM_X86_STAT_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/statfs.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STATFS_H
3#define _ASM_X86_STATFS_H
4
5/*
6 * We need compat_statfs64 to be packed, because the i386 ABI won't
7 * add padding at the end to bring it to a multiple of 8 bytes, but
8 * the x86_64 ABI will.
9 */
10#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
11
12#include <asm-generic/statfs.h>
13#endif /* _ASM_X86_STATFS_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/swab.h deleted-37
...@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SWAB_H
3#define _ASM_X86_SWAB_H
4
5#include <linux/types.h>
6
7
8static __inline__ __u32 __arch_swab32(__u32 val)
9{
10 __asm__("bswapl %0" : "=r" (val) : "0" (val));
11 return val;
12}
13#define __arch_swab32 __arch_swab32
14
15static __inline__ __u64 __arch_swab64(__u64 val)
16{
17#ifdef __i386__
18 union {
19 struct {
20 __u32 a;
21 __u32 b;
22 } s;
23 __u64 u;
24 } v;
25 v.u = val;
26 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
27 : "=r" (v.s.a), "=r" (v.s.b)
28 : "0" (v.s.a), "1" (v.s.b));
29 return v.u;
30#else /* __i386__ */
31 __asm__("bswapq %0" : "=r" (val) : "0" (val));
32 return val;
33#endif
34}
35#define __arch_swab64 __arch_swab64
36
37#endif /* _ASM_X86_SWAB_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/types.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_TYPES_H
3#define _ASM_X86_TYPES_H
4
5#include <asm-generic/types.h>
6
7#endif /* _ASM_X86_TYPES_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/ucontext.h deleted-56
...@@ -1,56 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UCONTEXT_H
3#define _ASM_X86_UCONTEXT_H
4
5/*
6 * Indicates the presence of extended state information in the memory
7 * layout pointed by the fpstate pointer in the ucontext's sigcontext
8 * struct (uc_mcontext).
9 */
10#define UC_FP_XSTATE 0x1
11
12#ifdef __x86_64__
13/*
14 * UC_SIGCONTEXT_SS will be set when delivering 64-bit or x32 signals on
15 * kernels that save SS in the sigcontext. All kernels that set
16 * UC_SIGCONTEXT_SS will correctly restore at least the low 32 bits of esp
17 * regardless of SS (i.e. they implement espfix).
18 *
19 * Kernels that set UC_SIGCONTEXT_SS will also set UC_STRICT_RESTORE_SS
20 * when delivering a signal that came from 64-bit code.
21 *
22 * Sigreturn restores SS as follows:
23 *
24 * if (saved SS is valid || UC_STRICT_RESTORE_SS is set ||
25 * saved CS is not 64-bit)
26 * new SS = saved SS (will fail IRET and signal if invalid)
27 * else
28 * new SS = a flat 32-bit data segment
29 *
30 * This behavior serves three purposes:
31 *
32 * - Legacy programs that construct a 64-bit sigcontext from scratch
33 * with zero or garbage in the SS slot (e.g. old CRIU) and call
34 * sigreturn will still work.
35 *
36 * - Old DOSEMU versions sometimes catch a signal from a segmented
37 * context, delete the old SS segment (with modify_ldt), and change
38 * the saved CS to a 64-bit segment. These DOSEMU versions expect
39 * sigreturn to send them back to 64-bit mode without killing them,
40 * despite the fact that the SS selector when the signal was raised is
41 * no longer valid. UC_STRICT_RESTORE_SS will be clear, so the kernel
42 * will fix up SS for these DOSEMU versions.
43 *
44 * - Old and new programs that catch a signal and return without
45 * modifying the saved context will end up in exactly the state they
46 * started in, even if they were running in a segmented context when
47 * the signal was raised.. Old kernels would lose track of the
48 * previous SS value.
49 */
50#define UC_SIGCONTEXT_SS 0x2
51#define UC_STRICT_RESTORE_SS 0x4
52#endif
53
54#include <asm-generic/ucontext.h>
55
56#endif /* _ASM_X86_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/i386-linux-any/asm/unistd.h deleted-16
...@@ -1,16 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UNISTD_H
3#define _ASM_X86_UNISTD_H
4
5/* x32 syscall flag bit */
6#define __X32_SYSCALL_BIT 0x40000000
7
8# ifdef __i386__
9# include <asm/unistd_32.h>
10# elif defined(__ILP32__)
11# include <asm/unistd_x32.h>
12# else
13# include <asm/unistd_64.h>
14# endif
15
16#endif /* _ASM_X86_UNISTD_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/a.out.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __M68K_A_OUT_H__
3#define __M68K_A_OUT_H__
4
5struct exec
6{
7 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
8 unsigned a_text; /* length of text, in bytes */
9 unsigned a_data; /* length of data, in bytes */
10 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
11 unsigned a_syms; /* length of symbol table data in file, in bytes */
12 unsigned a_entry; /* start address */
13 unsigned a_trsize; /* length of relocation info for text, in bytes */
14 unsigned a_drsize; /* length of relocation info for data, in bytes */
15};
16
17#define N_TRSIZE(a) ((a).a_trsize)
18#define N_DRSIZE(a) ((a).a_drsize)
19#define N_SYMSIZE(a) ((a).a_syms)
20
21#endif /* __M68K_A_OUT_H__ */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-amiga.h created+64
...@@ -0,0 +1,64 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-amiga.h -- Amiga-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_AMIGA_H
7#define _ASM_M68K_BOOTINFO_AMIGA_H
8
9
10 /*
11 * Amiga-specific tags
12 */
13
14#define BI_AMIGA_MODEL 0x8000 /* model (__be32) */
15#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */
16 /* (AmigaOS struct ConfigDev) */
17#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (__be32) */
18#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (__u8) */
19#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (__u8) */
20#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (__be32) */
21#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (__be32) */
22#define BI_AMIGA_SERPER 0x8007 /* serial port period (__be16) */
23
24
25 /*
26 * Amiga models (BI_AMIGA_MODEL)
27 */
28
29#define AMI_UNKNOWN 0
30#define AMI_500 1
31#define AMI_500PLUS 2
32#define AMI_600 3
33#define AMI_1000 4
34#define AMI_1200 5
35#define AMI_2000 6
36#define AMI_2500 7
37#define AMI_3000 8
38#define AMI_3000T 9
39#define AMI_3000PLUS 10
40#define AMI_4000 11
41#define AMI_4000T 12
42#define AMI_CDTV 13
43#define AMI_CD32 14
44#define AMI_DRACO 15
45
46
47 /*
48 * Amiga chipsets (BI_AMIGA_CHIPSET)
49 */
50
51#define CS_STONEAGE 0
52#define CS_OCS 1
53#define CS_ECS 2
54#define CS_AGA 3
55
56
57 /*
58 * Latest Amiga bootinfo version
59 */
60
61#define AMIGA_BOOTI_VERSION MK_BI_VERSION(2, 0)
62
63
64#endif /* _ASM_M68K_BOOTINFO_AMIGA_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-apollo.h created+29
...@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-apollo.h -- Apollo-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_APOLLO_H
7#define _ASM_M68K_BOOTINFO_APOLLO_H
8
9
10 /*
11 * Apollo-specific tags
12 */
13
14#define BI_APOLLO_MODEL 0x8000 /* model (__be32) */
15
16
17 /*
18 * Apollo models (BI_APOLLO_MODEL)
19 */
20
21#define APOLLO_UNKNOWN 0
22#define APOLLO_DN3000 1
23#define APOLLO_DN3010 2
24#define APOLLO_DN3500 3
25#define APOLLO_DN4000 4
26#define APOLLO_DN4500 5
27
28
29#endif /* _ASM_M68K_BOOTINFO_APOLLO_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-atari.h created+45
...@@ -0,0 +1,45 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-atari.h -- Atari-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_ATARI_H
7#define _ASM_M68K_BOOTINFO_ATARI_H
8
9
10 /*
11 * Atari-specific tags
12 */
13
14#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (__be32) */
15#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (__be32) */
16
17
18 /*
19 * mch_cookie values (upper word of BI_ATARI_MCH_COOKIE)
20 */
21
22#define ATARI_MCH_ST 0
23#define ATARI_MCH_STE 1
24#define ATARI_MCH_TT 2
25#define ATARI_MCH_FALCON 3
26
27
28 /*
29 * Atari machine types (BI_ATARI_MCH_TYPE)
30 */
31
32#define ATARI_MACH_NORMAL 0 /* no special machine type */
33#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
34#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
35#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
36
37
38 /*
39 * Latest Atari bootinfo version
40 */
41
42#define ATARI_BOOTI_VERSION MK_BI_VERSION(2, 1)
43
44
45#endif /* _ASM_M68K_BOOTINFO_ATARI_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-hp300.h created+51
...@@ -0,0 +1,51 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-hp300.h -- HP9000/300-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_HP300_H
7#define _ASM_M68K_BOOTINFO_HP300_H
8
9
10 /*
11 * HP9000/300-specific tags
12 */
13
14#define BI_HP300_MODEL 0x8000 /* model (__be32) */
15#define BI_HP300_UART_SCODE 0x8001 /* UART select code (__be32) */
16#define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (__be32) */
17
18
19 /*
20 * HP9000/300 and /400 models (BI_HP300_MODEL)
21 *
22 * This information was taken from NetBSD
23 */
24
25#define HP_320 0 /* 16MHz 68020+HP MMU+16K external cache */
26#define HP_330 1 /* 16MHz 68020+68851 MMU */
27#define HP_340 2 /* 16MHz 68030 */
28#define HP_345 3 /* 50MHz 68030+32K external cache */
29#define HP_350 4 /* 25MHz 68020+HP MMU+32K external cache */
30#define HP_360 5 /* 25MHz 68030 */
31#define HP_370 6 /* 33MHz 68030+64K external cache */
32#define HP_375 7 /* 50MHz 68030+32K external cache */
33#define HP_380 8 /* 25MHz 68040 */
34#define HP_385 9 /* 33MHz 68040 */
35
36#define HP_400 10 /* 50MHz 68030+32K external cache */
37#define HP_425T 11 /* 25MHz 68040 - model 425t */
38#define HP_425S 12 /* 25MHz 68040 - model 425s */
39#define HP_425E 13 /* 25MHz 68040 - model 425e */
40#define HP_433T 14 /* 33MHz 68040 - model 433t */
41#define HP_433S 15 /* 33MHz 68040 - model 433s */
42
43
44 /*
45 * Latest HP9000/300 bootinfo version
46 */
47
48#define HP300_BOOTI_VERSION MK_BI_VERSION(2, 0)
49
50
51#endif /* _ASM_M68K_BOOTINFO_HP300_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-mac.h created+120
...@@ -0,0 +1,120 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-mac.h -- Macintosh-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_MAC_H
7#define _ASM_M68K_BOOTINFO_MAC_H
8
9
10 /*
11 * Macintosh-specific tags (all __be32)
12 */
13
14#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
15#define BI_MAC_VADDR 0x8001 /* Mac video base address */
16#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
17#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
18#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
19#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
20#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
21#define BI_MAC_BTIME 0x8007 /* Mac boot time */
22#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
23#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
24#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
25#define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */
26
27
28 /*
29 * Macintosh hardware profile data - unused, see macintosh.h for
30 * reasonable type values
31 */
32
33#define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */
34#define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */
35#define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */
36#define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */
37#define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */
38#define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */
39#define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */
40#define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */
41#define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */
42#define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */
43#define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */
44#define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */
45#define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */
46#define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */
47#define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */
48#define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */
49#define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */
50#define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */
51
52
53 /*
54 * Macintosh Gestalt numbers (BI_MAC_MODEL)
55 */
56
57#define MAC_MODEL_II 6
58#define MAC_MODEL_IIX 7
59#define MAC_MODEL_IICX 8
60#define MAC_MODEL_SE30 9
61#define MAC_MODEL_IICI 11
62#define MAC_MODEL_IIFX 13 /* And well numbered it is too */
63#define MAC_MODEL_IISI 18
64#define MAC_MODEL_LC 19
65#define MAC_MODEL_Q900 20
66#define MAC_MODEL_PB170 21
67#define MAC_MODEL_Q700 22
68#define MAC_MODEL_CLII 23 /* aka: P200 */
69#define MAC_MODEL_PB140 25
70#define MAC_MODEL_Q950 26 /* aka: WGS95 */
71#define MAC_MODEL_LCIII 27 /* aka: P450 */
72#define MAC_MODEL_PB210 29
73#define MAC_MODEL_C650 30
74#define MAC_MODEL_PB230 32
75#define MAC_MODEL_PB180 33
76#define MAC_MODEL_PB160 34
77#define MAC_MODEL_Q800 35 /* aka: WGS80 */
78#define MAC_MODEL_Q650 36
79#define MAC_MODEL_LCII 37 /* aka: P400/405/410/430 */
80#define MAC_MODEL_PB250 38
81#define MAC_MODEL_IIVI 44
82#define MAC_MODEL_P600 45 /* aka: P600CD */
83#define MAC_MODEL_IIVX 48
84#define MAC_MODEL_CCL 49 /* aka: P250 */
85#define MAC_MODEL_PB165C 50
86#define MAC_MODEL_C610 52 /* aka: WGS60 */
87#define MAC_MODEL_Q610 53
88#define MAC_MODEL_PB145 54 /* aka: PB145B */
89#define MAC_MODEL_P520 56 /* aka: LC520 */
90#define MAC_MODEL_C660 60
91#define MAC_MODEL_P460 62 /* aka: LCIII+, P466/P467 */
92#define MAC_MODEL_PB180C 71
93#define MAC_MODEL_PB520 72 /* aka: PB520C, PB540, PB540C, PB550C */
94#define MAC_MODEL_PB270C 77
95#define MAC_MODEL_Q840 78
96#define MAC_MODEL_P550 80 /* aka: LC550, P560 */
97#define MAC_MODEL_CCLII 83 /* aka: P275 */
98#define MAC_MODEL_PB165 84
99#define MAC_MODEL_PB190 85 /* aka: PB190CS */
100#define MAC_MODEL_TV 88
101#define MAC_MODEL_P475 89 /* aka: LC475, P476 */
102#define MAC_MODEL_P475F 90 /* aka: P475 w/ FPU (no LC040) */
103#define MAC_MODEL_P575 92 /* aka: LC575, P577/P578 */
104#define MAC_MODEL_Q605 94
105#define MAC_MODEL_Q605_ACC 95 /* Q605 accelerated to 33 MHz */
106#define MAC_MODEL_Q630 98 /* aka: LC630, P630/631/635/636/637/638/640 */
107#define MAC_MODEL_P588 99 /* aka: LC580, P580 */
108#define MAC_MODEL_PB280 102
109#define MAC_MODEL_PB280C 103
110#define MAC_MODEL_PB150 115
111
112
113 /*
114 * Latest Macintosh bootinfo version
115 */
116
117#define MAC_BOOTI_VERSION MK_BI_VERSION(2, 0)
118
119
120#endif /* _ASM_M68K_BOOTINFO_MAC_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-q40.h created+17
...@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-q40.h -- Q40-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_Q40_H
7#define _ASM_M68K_BOOTINFO_Q40_H
8
9
10 /*
11 * Latest Q40 bootinfo version
12 */
13
14#define Q40_BOOTI_VERSION MK_BI_VERSION(2, 0)
15
16
17#endif /* _ASM_M68K_BOOTINFO_Q40_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-vme.h created+71
...@@ -0,0 +1,71 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/bootinfo-vme.h -- VME-specific boot information definitions
4*/
5
6#ifndef _ASM_M68K_BOOTINFO_VME_H
7#define _ASM_M68K_BOOTINFO_VME_H
8
9
10#include <linux/types.h>
11
12
13 /*
14 * VME-specific tags
15 */
16
17#define BI_VME_TYPE 0x8000 /* VME sub-architecture (__be32) */
18#define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */
19
20
21 /*
22 * VME models (BI_VME_TYPE)
23 */
24
25#define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */
26#define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */
27#define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */
28#define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */
29#define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */
30#define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */
31#define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */
32#define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */
33#define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */
34
35
36#ifndef __ASSEMBLY__
37
38/*
39 * Board ID data structure - pointer to this retrieved from Bug by head.S
40 *
41 * BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on
42 * Motorola VME boards. Contains board number, Bug version, board
43 * configuration options, etc.
44 *
45 * Note, bytes 12 and 13 are board no in BCD (0162,0166,0167,0177,etc)
46 */
47
48typedef struct {
49 char bdid[4];
50 __u8 rev, mth, day, yr;
51 __be16 size, reserved;
52 __be16 brdno;
53 char brdsuffix[2];
54 __be32 options;
55 __be16 clun, dlun, ctype, dnum;
56 __be32 option2;
57} t_bdid, *p_bdid;
58
59#endif /* __ASSEMBLY__ */
60
61
62 /*
63 * Latest VME bootinfo versions
64 */
65
66#define MVME147_BOOTI_VERSION MK_BI_VERSION(2, 0)
67#define MVME16x_BOOTI_VERSION MK_BI_VERSION(2, 0)
68#define BVME6000_BOOTI_VERSION MK_BI_VERSION(2, 0)
69
70
71#endif /* _ASM_M68K_BOOTINFO_VME_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo.h created+176
...@@ -0,0 +1,176 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * asm/bootinfo.h -- Definition of the Linux/m68k boot information structure
4 *
5 * Copyright 1992 by Greg Harp
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef _ASM_M68K_BOOTINFO_H
13#define _ASM_M68K_BOOTINFO_H
14
15
16#include <linux/types.h>
17
18
19#ifndef __ASSEMBLY__
20
21 /*
22 * Bootinfo definitions
23 *
24 * This is an easily parsable and extendable structure containing all
25 * information to be passed from the bootstrap to the kernel.
26 *
27 * This way I hope to keep all future changes back/forewards compatible.
28 * Thus, keep your fingers crossed...
29 *
30 * This structure is copied right after the kernel by the bootstrap
31 * routine.
32 */
33
34struct bi_record {
35 __be16 tag; /* tag ID */
36 __be16 size; /* size of record (in bytes) */
37 __be32 data[0]; /* data */
38};
39
40
41struct mem_info {
42 __be32 addr; /* physical address of memory chunk */
43 __be32 size; /* length of memory chunk (in bytes) */
44};
45
46#endif /* __ASSEMBLY__ */
47
48
49 /*
50 * Tag Definitions
51 *
52 * Machine independent tags start counting from 0x0000
53 * Machine dependent tags start counting from 0x8000
54 */
55
56#define BI_LAST 0x0000 /* last record (sentinel) */
57#define BI_MACHTYPE 0x0001 /* machine type (__be32) */
58#define BI_CPUTYPE 0x0002 /* cpu type (__be32) */
59#define BI_FPUTYPE 0x0003 /* fpu type (__be32) */
60#define BI_MMUTYPE 0x0004 /* mmu type (__be32) */
61#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
62 /* (struct mem_info) */
63#define BI_RAMDISK 0x0006 /* ramdisk address and size */
64 /* (struct mem_info) */
65#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
66 /* (string) */
67
68
69 /*
70 * Linux/m68k Architectures (BI_MACHTYPE)
71 */
72
73#define MACH_AMIGA 1
74#define MACH_ATARI 2
75#define MACH_MAC 3
76#define MACH_APOLLO 4
77#define MACH_SUN3 5
78#define MACH_MVME147 6
79#define MACH_MVME16x 7
80#define MACH_BVME6000 8
81#define MACH_HP300 9
82#define MACH_Q40 10
83#define MACH_SUN3X 11
84#define MACH_M54XX 12
85#define MACH_M5441X 13
86
87
88 /*
89 * CPU, FPU and MMU types (BI_CPUTYPE, BI_FPUTYPE, BI_MMUTYPE)
90 *
91 * Note: we may rely on the following equalities:
92 *
93 * CPU_68020 == MMU_68851
94 * CPU_68030 == MMU_68030
95 * CPU_68040 == FPU_68040 == MMU_68040
96 * CPU_68060 == FPU_68060 == MMU_68060
97 */
98
99#define CPUB_68020 0
100#define CPUB_68030 1
101#define CPUB_68040 2
102#define CPUB_68060 3
103#define CPUB_COLDFIRE 4
104
105#define CPU_68020 (1 << CPUB_68020)
106#define CPU_68030 (1 << CPUB_68030)
107#define CPU_68040 (1 << CPUB_68040)
108#define CPU_68060 (1 << CPUB_68060)
109#define CPU_COLDFIRE (1 << CPUB_COLDFIRE)
110
111#define FPUB_68881 0
112#define FPUB_68882 1
113#define FPUB_68040 2 /* Internal FPU */
114#define FPUB_68060 3 /* Internal FPU */
115#define FPUB_SUNFPA 4 /* Sun-3 FPA */
116#define FPUB_COLDFIRE 5 /* ColdFire FPU */
117
118#define FPU_68881 (1 << FPUB_68881)
119#define FPU_68882 (1 << FPUB_68882)
120#define FPU_68040 (1 << FPUB_68040)
121#define FPU_68060 (1 << FPUB_68060)
122#define FPU_SUNFPA (1 << FPUB_SUNFPA)
123#define FPU_COLDFIRE (1 << FPUB_COLDFIRE)
124
125#define MMUB_68851 0
126#define MMUB_68030 1 /* Internal MMU */
127#define MMUB_68040 2 /* Internal MMU */
128#define MMUB_68060 3 /* Internal MMU */
129#define MMUB_APOLLO 4 /* Custom Apollo */
130#define MMUB_SUN3 5 /* Custom Sun-3 */
131#define MMUB_COLDFIRE 6 /* Internal MMU */
132
133#define MMU_68851 (1 << MMUB_68851)
134#define MMU_68030 (1 << MMUB_68030)
135#define MMU_68040 (1 << MMUB_68040)
136#define MMU_68060 (1 << MMUB_68060)
137#define MMU_SUN3 (1 << MMUB_SUN3)
138#define MMU_APOLLO (1 << MMUB_APOLLO)
139#define MMU_COLDFIRE (1 << MMUB_COLDFIRE)
140
141
142 /*
143 * Stuff for bootinfo interface versioning
144 *
145 * At the start of kernel code, a 'struct bootversion' is located.
146 * bootstrap checks for a matching version of the interface before booting
147 * a kernel, to avoid user confusion if kernel and bootstrap don't work
148 * together :-)
149 *
150 * If incompatible changes are made to the bootinfo interface, the major
151 * number below should be stepped (and the minor reset to 0) for the
152 * appropriate machine. If a change is backward-compatible, the minor
153 * should be stepped. "Backwards-compatible" means that booting will work,
154 * but certain features may not.
155 */
156
157#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
158#define MK_BI_VERSION(major, minor) (((major) << 16) + (minor))
159#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
160#define BI_VERSION_MINOR(v) ((v) & 0xffff)
161
162#ifndef __ASSEMBLY__
163
164struct bootversion {
165 __be16 branch;
166 __be32 magic;
167 struct {
168 __be32 machtype;
169 __be32 version;
170 } machversions[0];
171} __attribute__((packed));
172
173#endif /* __ASSEMBLY__ */
174
175
176#endif /* _ASM_M68K_BOOTINFO_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/byteorder.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_BYTEORDER_H
3#define _M68K_BYTEORDER_H
4
5#include <linux/byteorder/big_endian.h>
6
7#endif /* _M68K_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/cachectl.h created+15
...@@ -0,0 +1,15 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_CACHECTL_H
3#define _M68K_CACHECTL_H
4
5/* Definitions for the cacheflush system call. */
6
7#define FLUSH_SCOPE_LINE 1 /* Flush a cache line */
8#define FLUSH_SCOPE_PAGE 2 /* Flush a page */
9#define FLUSH_SCOPE_ALL 3 /* Flush the whole cache -- superuser only */
10
11#define FLUSH_CACHE_DATA 1 /* Writeback and flush data cache */
12#define FLUSH_CACHE_INSN 2 /* Flush instruction cache */
13#define FLUSH_CACHE_BOTH 3 /* Flush both caches */
14
15#endif /* _M68K_CACHECTL_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/fcntl.h created+12
...@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_FCNTL_H
3#define _M68K_FCNTL_H
4
5#define O_DIRECTORY 040000 /* must be a directory */
6#define O_NOFOLLOW 0100000 /* don't follow links */
7#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
8#define O_LARGEFILE 0400000
9
10#include <asm-generic/fcntl.h>
11
12#endif /* _M68K_FCNTL_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/ioctls.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ARCH_M68K_IOCTLS_H__
3#define __ARCH_M68K_IOCTLS_H__
4
5#define FIOQSIZE 0x545E
6
7#include <asm-generic/ioctls.h>
8
9#endif /* __ARCH_M68K_IOCTLS_H__ */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/param.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_PARAM_H
3#define _M68K_PARAM_H
4
5#ifdef __uClinux__
6#define EXEC_PAGESIZE 4096
7#else
8#define EXEC_PAGESIZE 8192
9#endif
10
11#include <asm-generic/param.h>
12
13#endif /* _M68K_PARAM_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/poll.h created+10
...@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __m68k_POLL_H
3#define __m68k_POLL_H
4
5#define POLLWRNORM POLLOUT
6#define POLLWRBAND 256
7
8#include <asm-generic/poll.h>
9
10#endif
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/posix_types.h created+26
...@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ARCH_M68K_POSIX_TYPES_H
3#define __ARCH_M68K_POSIX_TYPES_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11typedef unsigned short __kernel_mode_t;
12#define __kernel_mode_t __kernel_mode_t
13
14typedef unsigned short __kernel_ipc_pid_t;
15#define __kernel_ipc_pid_t __kernel_ipc_pid_t
16
17typedef unsigned short __kernel_uid_t;
18typedef unsigned short __kernel_gid_t;
19#define __kernel_uid_t __kernel_uid_t
20
21typedef unsigned short __kernel_old_dev_t;
22#define __kernel_old_dev_t __kernel_old_dev_t
23
24#include <asm-generic/posix_types.h>
25
26#endif
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/ptrace.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_PTRACE_H
3#define _M68K_PTRACE_H
4
5#define PT_D1 0
6#define PT_D2 1
7#define PT_D3 2
8#define PT_D4 3
9#define PT_D5 4
10#define PT_D6 5
11#define PT_D7 6
12#define PT_A0 7
13#define PT_A1 8
14#define PT_A2 9
15#define PT_A3 10
16#define PT_A4 11
17#define PT_A5 12
18#define PT_A6 13
19#define PT_D0 14
20#define PT_USP 15
21#define PT_ORIG_D0 16
22#define PT_SR 17
23#define PT_PC 18
24
25#ifndef __ASSEMBLY__
26
27/* this struct defines the way the registers are stored on the
28 stack during a system call. */
29
30struct pt_regs {
31 long d1;
32 long d2;
33 long d3;
34 long d4;
35 long d5;
36 long a0;
37 long a1;
38 long a2;
39 long d0;
40 long orig_d0;
41 long stkadj;
42#ifdef CONFIG_COLDFIRE
43 unsigned format : 4; /* frame format specifier */
44 unsigned vector : 12; /* vector offset */
45 unsigned short sr;
46 unsigned long pc;
47#else
48 unsigned short sr;
49 unsigned long pc;
50 unsigned format : 4; /* frame format specifier */
51 unsigned vector : 12; /* vector offset */
52#endif
53};
54
55/*
56 * This is the extended stack used by signal handlers and the context
57 * switcher: it's pushed after the normal "struct pt_regs".
58 */
59struct switch_stack {
60 unsigned long d6;
61 unsigned long d7;
62 unsigned long a3;
63 unsigned long a4;
64 unsigned long a5;
65 unsigned long a6;
66 unsigned long retpc;
67};
68
69/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
70#define PTRACE_GETREGS 12
71#define PTRACE_SETREGS 13
72#define PTRACE_GETFPREGS 14
73#define PTRACE_SETFPREGS 15
74
75#define PTRACE_GET_THREAD_AREA 25
76
77#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
78
79#endif /* __ASSEMBLY__ */
80#endif /* _M68K_PTRACE_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/setup.h created+17
...@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3** asm/setup.h -- Definition of the Linux/m68k setup information
4**
5** Copyright 1992 by Greg Harp
6**
7** This file is subject to the terms and conditions of the GNU General Public
8** License. See the file COPYING in the main directory of this archive
9** for more details.
10*/
11
12#ifndef _M68K_SETUP_H
13#define _M68K_SETUP_H
14
15#define COMMAND_LINE_SIZE 256
16
17#endif /* _M68K_SETUP_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/sigcontext.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_M68k_SIGCONTEXT_H
3#define _ASM_M68k_SIGCONTEXT_H
4
5struct sigcontext {
6 unsigned long sc_mask; /* old sigmask */
7 unsigned long sc_usp; /* old user stack pointer */
8 unsigned long sc_d0;
9 unsigned long sc_d1;
10 unsigned long sc_a0;
11 unsigned long sc_a1;
12#ifdef __uClinux__
13 unsigned long sc_a5;
14#endif
15 unsigned short sc_sr;
16 unsigned long sc_pc;
17 unsigned short sc_formatvec;
18#ifndef __uClinux__
19 unsigned long sc_fpregs[2*3]; /* room for two fp registers */
20 unsigned long sc_fpcntl[3];
21 unsigned char sc_fpstate[216];
22#endif
23};
24
25#endif
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/signal.h created+85
...@@ -0,0 +1,85 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_SIGNAL_H
3#define _M68K_SIGNAL_H
4
5#include <linux/types.h>
6
7/* Avoid too many header ordering problems. */
8struct siginfo;
9
10/* Here we must cater to libcs that poke about in kernel headers. */
11
12#define NSIG 32
13typedef unsigned long sigset_t;
14
15
16#define SIGHUP 1
17#define SIGINT 2
18#define SIGQUIT 3
19#define SIGILL 4
20#define SIGTRAP 5
21#define SIGABRT 6
22#define SIGIOT 6
23#define SIGBUS 7
24#define SIGFPE 8
25#define SIGKILL 9
26#define SIGUSR1 10
27#define SIGSEGV 11
28#define SIGUSR2 12
29#define SIGPIPE 13
30#define SIGALRM 14
31#define SIGTERM 15
32#define SIGSTKFLT 16
33#define SIGCHLD 17
34#define SIGCONT 18
35#define SIGSTOP 19
36#define SIGTSTP 20
37#define SIGTTIN 21
38#define SIGTTOU 22
39#define SIGURG 23
40#define SIGXCPU 24
41#define SIGXFSZ 25
42#define SIGVTALRM 26
43#define SIGPROF 27
44#define SIGWINCH 28
45#define SIGIO 29
46#define SIGPOLL SIGIO
47/*
48#define SIGLOST 29
49*/
50#define SIGPWR 30
51#define SIGSYS 31
52#define SIGUNUSED 31
53
54/* These should not be considered constants from userland. */
55#define SIGRTMIN 32
56#define SIGRTMAX _NSIG
57
58#define MINSIGSTKSZ 2048
59#define SIGSTKSZ 8192
60
61#include <asm-generic/signal-defs.h>
62
63/* Here we must cater to libcs that poke about in kernel headers. */
64
65struct sigaction {
66 union {
67 __sighandler_t _sa_handler;
68 void (*_sa_sigaction)(int, struct siginfo *, void *);
69 } _u;
70 sigset_t sa_mask;
71 unsigned long sa_flags;
72 void (*sa_restorer)(void);
73};
74
75#define sa_handler _u._sa_handler
76#define sa_sigaction _u._sa_sigaction
77
78
79typedef struct sigaltstack {
80 void *ss_sp;
81 int ss_flags;
82 size_t ss_size;
83} stack_t;
84
85#endif /* _M68K_SIGNAL_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/stat.h created+78
...@@ -0,0 +1,78 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_STAT_H
3#define _M68K_STAT_H
4
5struct __old_kernel_stat {
6 unsigned short st_dev;
7 unsigned short st_ino;
8 unsigned short st_mode;
9 unsigned short st_nlink;
10 unsigned short st_uid;
11 unsigned short st_gid;
12 unsigned short st_rdev;
13 unsigned long st_size;
14 unsigned long st_atime;
15 unsigned long st_mtime;
16 unsigned long st_ctime;
17};
18
19struct stat {
20 unsigned short st_dev;
21 unsigned short __pad1;
22 unsigned long st_ino;
23 unsigned short st_mode;
24 unsigned short st_nlink;
25 unsigned short st_uid;
26 unsigned short st_gid;
27 unsigned short st_rdev;
28 unsigned short __pad2;
29 unsigned long st_size;
30 unsigned long st_blksize;
31 unsigned long st_blocks;
32 unsigned long st_atime;
33 unsigned long __unused1;
34 unsigned long st_mtime;
35 unsigned long __unused2;
36 unsigned long st_ctime;
37 unsigned long __unused3;
38 unsigned long __unused4;
39 unsigned long __unused5;
40};
41
42/* This matches struct stat64 in glibc2.1, hence the absolutely
43 * insane amounts of padding around dev_t's.
44 */
45struct stat64 {
46 unsigned long long st_dev;
47 unsigned char __pad1[2];
48
49#define STAT64_HAS_BROKEN_ST_INO 1
50 unsigned long __st_ino;
51
52 unsigned int st_mode;
53 unsigned int st_nlink;
54
55 unsigned long st_uid;
56 unsigned long st_gid;
57
58 unsigned long long st_rdev;
59 unsigned char __pad3[2];
60
61 long long st_size;
62 unsigned long st_blksize;
63
64 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
65
66 unsigned long st_atime;
67 unsigned long st_atime_nsec;
68
69 unsigned long st_mtime;
70 unsigned long st_mtime_nsec;
71
72 unsigned long st_ctime;
73 unsigned long st_ctime_nsec;
74
75 unsigned long long st_ino;
76};
77
78#endif /* _M68K_STAT_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/swab.h created+28
...@@ -0,0 +1,28 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _M68K_SWAB_H
3#define _M68K_SWAB_H
4
5#include <linux/types.h>
6
7
8#define __SWAB_64_THRU_32__
9
10#if defined (__mcfisaaplus__) || defined (__mcfisac__)
11static __inline__ __u32 __arch_swab32(__u32 val)
12{
13 __asm__("byterev %0" : "=d" (val) : "0" (val));
14 return val;
15}
16
17#define __arch_swab32 __arch_swab32
18#elif !defined(__mcoldfire__)
19
20static __inline__ __u32 __arch_swab32(__u32 val)
21{
22 __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
23 return val;
24}
25#define __arch_swab32 __arch_swab32
26#endif
27
28#endif /* _M68K_SWAB_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_M68K_UNISTD_H_
3#define _ASM_M68K_UNISTD_H_
4
5#include <asm/unistd_32.h>
6
7#endif /* _ASM_M68K_UNISTD_H_ */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd_32.h created+427
...@@ -0,0 +1,427 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_restart_syscall 0
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_waitpid 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_chown 16
21#define __NR_oldstat 18
22#define __NR_lseek 19
23#define __NR_getpid 20
24#define __NR_mount 21
25#define __NR_umount 22
26#define __NR_setuid 23
27#define __NR_getuid 24
28#define __NR_stime 25
29#define __NR_ptrace 26
30#define __NR_alarm 27
31#define __NR_oldfstat 28
32#define __NR_pause 29
33#define __NR_utime 30
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_sync 36
37#define __NR_kill 37
38#define __NR_rename 38
39#define __NR_mkdir 39
40#define __NR_rmdir 40
41#define __NR_dup 41
42#define __NR_pipe 42
43#define __NR_times 43
44#define __NR_brk 45
45#define __NR_setgid 46
46#define __NR_getgid 47
47#define __NR_signal 48
48#define __NR_geteuid 49
49#define __NR_getegid 50
50#define __NR_acct 51
51#define __NR_umount2 52
52#define __NR_ioctl 54
53#define __NR_fcntl 55
54#define __NR_setpgid 57
55#define __NR_umask 60
56#define __NR_chroot 61
57#define __NR_ustat 62
58#define __NR_dup2 63
59#define __NR_getppid 64
60#define __NR_getpgrp 65
61#define __NR_setsid 66
62#define __NR_sigaction 67
63#define __NR_sgetmask 68
64#define __NR_ssetmask 69
65#define __NR_setreuid 70
66#define __NR_setregid 71
67#define __NR_sigsuspend 72
68#define __NR_sigpending 73
69#define __NR_sethostname 74
70#define __NR_setrlimit 75
71#define __NR_getrlimit 76
72#define __NR_getrusage 77
73#define __NR_gettimeofday 78
74#define __NR_settimeofday 79
75#define __NR_getgroups 80
76#define __NR_setgroups 81
77#define __NR_select 82
78#define __NR_symlink 83
79#define __NR_oldlstat 84
80#define __NR_readlink 85
81#define __NR_uselib 86
82#define __NR_swapon 87
83#define __NR_reboot 88
84#define __NR_readdir 89
85#define __NR_mmap 90
86#define __NR_munmap 91
87#define __NR_truncate 92
88#define __NR_ftruncate 93
89#define __NR_fchmod 94
90#define __NR_fchown 95
91#define __NR_getpriority 96
92#define __NR_setpriority 97
93#define __NR_statfs 99
94#define __NR_fstatfs 100
95#define __NR_socketcall 102
96#define __NR_syslog 103
97#define __NR_setitimer 104
98#define __NR_getitimer 105
99#define __NR_stat 106
100#define __NR_lstat 107
101#define __NR_fstat 108
102#define __NR_vhangup 111
103#define __NR_wait4 114
104#define __NR_swapoff 115
105#define __NR_sysinfo 116
106#define __NR_ipc 117
107#define __NR_fsync 118
108#define __NR_sigreturn 119
109#define __NR_clone 120
110#define __NR_setdomainname 121
111#define __NR_uname 122
112#define __NR_cacheflush 123
113#define __NR_adjtimex 124
114#define __NR_mprotect 125
115#define __NR_sigprocmask 126
116#define __NR_create_module 127
117#define __NR_init_module 128
118#define __NR_delete_module 129
119#define __NR_get_kernel_syms 130
120#define __NR_quotactl 131
121#define __NR_getpgid 132
122#define __NR_fchdir 133
123#define __NR_bdflush 134
124#define __NR_sysfs 135
125#define __NR_personality 136
126#define __NR_setfsuid 138
127#define __NR_setfsgid 139
128#define __NR__llseek 140
129#define __NR_getdents 141
130#define __NR__newselect 142
131#define __NR_flock 143
132#define __NR_msync 144
133#define __NR_readv 145
134#define __NR_writev 146
135#define __NR_getsid 147
136#define __NR_fdatasync 148
137#define __NR__sysctl 149
138#define __NR_mlock 150
139#define __NR_munlock 151
140#define __NR_mlockall 152
141#define __NR_munlockall 153
142#define __NR_sched_setparam 154
143#define __NR_sched_getparam 155
144#define __NR_sched_setscheduler 156
145#define __NR_sched_getscheduler 157
146#define __NR_sched_yield 158
147#define __NR_sched_get_priority_max 159
148#define __NR_sched_get_priority_min 160
149#define __NR_sched_rr_get_interval 161
150#define __NR_nanosleep 162
151#define __NR_mremap 163
152#define __NR_setresuid 164
153#define __NR_getresuid 165
154#define __NR_getpagesize 166
155#define __NR_query_module 167
156#define __NR_poll 168
157#define __NR_nfsservctl 169
158#define __NR_setresgid 170
159#define __NR_getresgid 171
160#define __NR_prctl 172
161#define __NR_rt_sigreturn 173
162#define __NR_rt_sigaction 174
163#define __NR_rt_sigprocmask 175
164#define __NR_rt_sigpending 176
165#define __NR_rt_sigtimedwait 177
166#define __NR_rt_sigqueueinfo 178
167#define __NR_rt_sigsuspend 179
168#define __NR_pread64 180
169#define __NR_pwrite64 181
170#define __NR_lchown 182
171#define __NR_getcwd 183
172#define __NR_capget 184
173#define __NR_capset 185
174#define __NR_sigaltstack 186
175#define __NR_sendfile 187
176#define __NR_getpmsg 188
177#define __NR_putpmsg 189
178#define __NR_vfork 190
179#define __NR_ugetrlimit 191
180#define __NR_mmap2 192
181#define __NR_truncate64 193
182#define __NR_ftruncate64 194
183#define __NR_stat64 195
184#define __NR_lstat64 196
185#define __NR_fstat64 197
186#define __NR_chown32 198
187#define __NR_getuid32 199
188#define __NR_getgid32 200
189#define __NR_geteuid32 201
190#define __NR_getegid32 202
191#define __NR_setreuid32 203
192#define __NR_setregid32 204
193#define __NR_getgroups32 205
194#define __NR_setgroups32 206
195#define __NR_fchown32 207
196#define __NR_setresuid32 208
197#define __NR_getresuid32 209
198#define __NR_setresgid32 210
199#define __NR_getresgid32 211
200#define __NR_lchown32 212
201#define __NR_setuid32 213
202#define __NR_setgid32 214
203#define __NR_setfsuid32 215
204#define __NR_setfsgid32 216
205#define __NR_pivot_root 217
206#define __NR_getdents64 220
207#define __NR_gettid 221
208#define __NR_tkill 222
209#define __NR_setxattr 223
210#define __NR_lsetxattr 224
211#define __NR_fsetxattr 225
212#define __NR_getxattr 226
213#define __NR_lgetxattr 227
214#define __NR_fgetxattr 228
215#define __NR_listxattr 229
216#define __NR_llistxattr 230
217#define __NR_flistxattr 231
218#define __NR_removexattr 232
219#define __NR_lremovexattr 233
220#define __NR_fremovexattr 234
221#define __NR_futex 235
222#define __NR_sendfile64 236
223#define __NR_mincore 237
224#define __NR_madvise 238
225#define __NR_fcntl64 239
226#define __NR_readahead 240
227#define __NR_io_setup 241
228#define __NR_io_destroy 242
229#define __NR_io_getevents 243
230#define __NR_io_submit 244
231#define __NR_io_cancel 245
232#define __NR_fadvise64 246
233#define __NR_exit_group 247
234#define __NR_lookup_dcookie 248
235#define __NR_epoll_create 249
236#define __NR_epoll_ctl 250
237#define __NR_epoll_wait 251
238#define __NR_remap_file_pages 252
239#define __NR_set_tid_address 253
240#define __NR_timer_create 254
241#define __NR_timer_settime 255
242#define __NR_timer_gettime 256
243#define __NR_timer_getoverrun 257
244#define __NR_timer_delete 258
245#define __NR_clock_settime 259
246#define __NR_clock_gettime 260
247#define __NR_clock_getres 261
248#define __NR_clock_nanosleep 262
249#define __NR_statfs64 263
250#define __NR_fstatfs64 264
251#define __NR_tgkill 265
252#define __NR_utimes 266
253#define __NR_fadvise64_64 267
254#define __NR_mbind 268
255#define __NR_get_mempolicy 269
256#define __NR_set_mempolicy 270
257#define __NR_mq_open 271
258#define __NR_mq_unlink 272
259#define __NR_mq_timedsend 273
260#define __NR_mq_timedreceive 274
261#define __NR_mq_notify 275
262#define __NR_mq_getsetattr 276
263#define __NR_waitid 277
264#define __NR_add_key 279
265#define __NR_request_key 280
266#define __NR_keyctl 281
267#define __NR_ioprio_set 282
268#define __NR_ioprio_get 283
269#define __NR_inotify_init 284
270#define __NR_inotify_add_watch 285
271#define __NR_inotify_rm_watch 286
272#define __NR_migrate_pages 287
273#define __NR_openat 288
274#define __NR_mkdirat 289
275#define __NR_mknodat 290
276#define __NR_fchownat 291
277#define __NR_futimesat 292
278#define __NR_fstatat64 293
279#define __NR_unlinkat 294
280#define __NR_renameat 295
281#define __NR_linkat 296
282#define __NR_symlinkat 297
283#define __NR_readlinkat 298
284#define __NR_fchmodat 299
285#define __NR_faccessat 300
286#define __NR_pselect6 301
287#define __NR_ppoll 302
288#define __NR_unshare 303
289#define __NR_set_robust_list 304
290#define __NR_get_robust_list 305
291#define __NR_splice 306
292#define __NR_sync_file_range 307
293#define __NR_tee 308
294#define __NR_vmsplice 309
295#define __NR_move_pages 310
296#define __NR_sched_setaffinity 311
297#define __NR_sched_getaffinity 312
298#define __NR_kexec_load 313
299#define __NR_getcpu 314
300#define __NR_epoll_pwait 315
301#define __NR_utimensat 316
302#define __NR_signalfd 317
303#define __NR_timerfd_create 318
304#define __NR_eventfd 319
305#define __NR_fallocate 320
306#define __NR_timerfd_settime 321
307#define __NR_timerfd_gettime 322
308#define __NR_signalfd4 323
309#define __NR_eventfd2 324
310#define __NR_epoll_create1 325
311#define __NR_dup3 326
312#define __NR_pipe2 327
313#define __NR_inotify_init1 328
314#define __NR_preadv 329
315#define __NR_pwritev 330
316#define __NR_rt_tgsigqueueinfo 331
317#define __NR_perf_event_open 332
318#define __NR_get_thread_area 333
319#define __NR_set_thread_area 334
320#define __NR_atomic_cmpxchg_32 335
321#define __NR_atomic_barrier 336
322#define __NR_fanotify_init 337
323#define __NR_fanotify_mark 338
324#define __NR_prlimit64 339
325#define __NR_name_to_handle_at 340
326#define __NR_open_by_handle_at 341
327#define __NR_clock_adjtime 342
328#define __NR_syncfs 343
329#define __NR_setns 344
330#define __NR_process_vm_readv 345
331#define __NR_process_vm_writev 346
332#define __NR_kcmp 347
333#define __NR_finit_module 348
334#define __NR_sched_setattr 349
335#define __NR_sched_getattr 350
336#define __NR_renameat2 351
337#define __NR_getrandom 352
338#define __NR_memfd_create 353
339#define __NR_bpf 354
340#define __NR_execveat 355
341#define __NR_socket 356
342#define __NR_socketpair 357
343#define __NR_bind 358
344#define __NR_connect 359
345#define __NR_listen 360
346#define __NR_accept4 361
347#define __NR_getsockopt 362
348#define __NR_setsockopt 363
349#define __NR_getsockname 364
350#define __NR_getpeername 365
351#define __NR_sendto 366
352#define __NR_sendmsg 367
353#define __NR_recvfrom 368
354#define __NR_recvmsg 369
355#define __NR_shutdown 370
356#define __NR_recvmmsg 371
357#define __NR_sendmmsg 372
358#define __NR_userfaultfd 373
359#define __NR_membarrier 374
360#define __NR_mlock2 375
361#define __NR_copy_file_range 376
362#define __NR_preadv2 377
363#define __NR_pwritev2 378
364#define __NR_statx 379
365#define __NR_seccomp 380
366#define __NR_pkey_mprotect 381
367#define __NR_pkey_alloc 382
368#define __NR_pkey_free 383
369#define __NR_rseq 384
370#define __NR_semget 393
371#define __NR_semctl 394
372#define __NR_shmget 395
373#define __NR_shmctl 396
374#define __NR_shmat 397
375#define __NR_shmdt 398
376#define __NR_msgget 399
377#define __NR_msgsnd 400
378#define __NR_msgrcv 401
379#define __NR_msgctl 402
380#define __NR_clock_gettime64 403
381#define __NR_clock_settime64 404
382#define __NR_clock_adjtime64 405
383#define __NR_clock_getres_time64 406
384#define __NR_clock_nanosleep_time64 407
385#define __NR_timer_gettime64 408
386#define __NR_timer_settime64 409
387#define __NR_timerfd_gettime64 410
388#define __NR_timerfd_settime64 411
389#define __NR_utimensat_time64 412
390#define __NR_pselect6_time64 413
391#define __NR_ppoll_time64 414
392#define __NR_io_pgetevents_time64 416
393#define __NR_recvmmsg_time64 417
394#define __NR_mq_timedsend_time64 418
395#define __NR_mq_timedreceive_time64 419
396#define __NR_semtimedop_time64 420
397#define __NR_rt_sigtimedwait_time64 421
398#define __NR_futex_time64 422
399#define __NR_sched_rr_get_interval_time64 423
400#define __NR_pidfd_send_signal 424
401#define __NR_io_uring_setup 425
402#define __NR_io_uring_enter 426
403#define __NR_io_uring_register 427
404#define __NR_open_tree 428
405#define __NR_move_mount 429
406#define __NR_fsopen 430
407#define __NR_fsconfig 431
408#define __NR_fsmount 432
409#define __NR_fspick 433
410#define __NR_pidfd_open 434
411#define __NR_clone3 435
412#define __NR_close_range 436
413#define __NR_openat2 437
414#define __NR_pidfd_getfd 438
415#define __NR_faccessat2 439
416#define __NR_process_madvise 440
417#define __NR_epoll_pwait2 441
418#define __NR_mount_setattr 442
419#define __NR_quotactl_fd 443
420#define __NR_landlock_create_ruleset 444
421#define __NR_landlock_add_rule 445
422#define __NR_landlock_restrict_self 446
423#define __NR_process_mrelease 448
424#define __NR_futex_waitv 449
425
426
427#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/bitfield.h created+30
...@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 2014 by Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __UAPI_ASM_BITFIELD_H
10#define __UAPI_ASM_BITFIELD_H
11
12/*
13 * * Damn ... bitfields depend from byteorder :-(
14 * */
15#ifdef __MIPSEB__
16#define __BITFIELD_FIELD(field, more) \
17 field; \
18 more
19
20#elif defined(__MIPSEL__)
21
22#define __BITFIELD_FIELD(field, more) \
23 more \
24 field;
25
26#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */
27#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
28#endif
29
30#endif /* __UAPI_ASM_BITFIELD_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/break.h created+32
...@@ -0,0 +1,32 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 2003 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef __UAPI_ASM_BREAK_H
11#define __UAPI_ASM_BREAK_H
12
13/*
14 * The following break codes are or were in use for specific purposes in
15 * other MIPS operating systems. Linux/MIPS doesn't use all of them. The
16 * unused ones are here as placeholders; we might encounter them in
17 * non-Linux/MIPS object files or make use of them in the future.
18 */
19#define BRK_USERBP 0 /* User bp (used by debuggers) */
20#define BRK_SSTEPBP 5 /* User bp (used by debuggers) */
21#define BRK_OVERFLOW 6 /* Overflow check */
22#define BRK_DIVZERO 7 /* Divide by zero check */
23#define BRK_RANGE 8 /* Range error check */
24#define BRK_BUG 12 /* Used by BUG() */
25#define BRK_UPROBE 13 /* See <asm/uprobes.h> */
26#define BRK_UPROBE_XOL 14 /* See <asm/uprobes.h> */
27#define BRK_MEMU 514 /* Used by FPU emulator */
28#define BRK_KPROBE_BP 515 /* Kprobe break */
29#define BRK_KPROBE_SSTEPBP 516 /* Kprobe single step software implementation */
30#define BRK_MULOVF 1023 /* Multiply overflow */
31
32#endif /* __UAPI_ASM_BREAK_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/cachectl.h created+27
...@@ -0,0 +1,27 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 1995, 1996 by Ralf Baechle
8 */
9#ifndef _ASM_CACHECTL
10#define _ASM_CACHECTL
11
12/*
13 * Options for cacheflush system call
14 */
15#define ICACHE (1<<0) /* flush instruction cache */
16#define DCACHE (1<<1) /* writeback and flush data cache */
17#define BCACHE (ICACHE|DCACHE) /* flush both caches */
18
19/*
20 * Caching modes for the cachectl(2) call
21 *
22 * cachectl(2) is currently not supported and returns ENOSYS.
23 */
24#define CACHEABLE 0 /* make pages cacheable */
25#define UNCACHEABLE 1 /* make pages uncacheable */
26
27#endif /* _ASM_CACHECTL */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/hwcap.h+12
...@@ -6,5 +6,17 @@...@@ -6,5 +6,17 @@
6#define HWCAP_MIPS_R6 (1 << 0)6#define HWCAP_MIPS_R6 (1 << 0)
7#define HWCAP_MIPS_MSA (1 << 1)7#define HWCAP_MIPS_MSA (1 << 1)
8#define HWCAP_MIPS_CRC32 (1 << 2)8#define HWCAP_MIPS_CRC32 (1 << 2)
9#define HWCAP_MIPS_MIPS16 (1 << 3)
10#define HWCAP_MIPS_MDMX (1 << 4)
11#define HWCAP_MIPS_MIPS3D (1 << 5)
12#define HWCAP_MIPS_SMARTMIPS (1 << 6)
13#define HWCAP_MIPS_DSP (1 << 7)
14#define HWCAP_MIPS_DSP2 (1 << 8)
15#define HWCAP_MIPS_DSP3 (1 << 9)
16#define HWCAP_MIPS_MIPS16E2 (1 << 10)
17#define HWCAP_LOONGSON_MMI (1 << 11)
18#define HWCAP_LOONGSON_EXT (1 << 12)
19#define HWCAP_LOONGSON_EXT2 (1 << 13)
20#define HWCAP_LOONGSON_CPUCFG (1 << 14)
921
10#endif /* _ASM_HWCAP_H */22#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/inst.h created+1141
...@@ -0,0 +1,1141 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Format of an instruction in memory.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1996, 2000 by Ralf Baechle
10 * Copyright (C) 2006 by Thiemo Seufer
11 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
12 * Copyright (C) 2014 Imagination Technologies Ltd.
13 */
14#ifndef _ASM_INST_H
15#define _ASM_INST_H
16
17#include <asm/bitfield.h>
18
19/*
20 * Major opcodes; before MIPS IV cop1x was called cop3.
21 */
22enum major_op {
23 spec_op, bcond_op, j_op, jal_op,
24 beq_op, bne_op, blez_op, bgtz_op,
25 addi_op, pop10_op = addi_op, addiu_op, slti_op, sltiu_op,
26 andi_op, ori_op, xori_op, lui_op,
27 cop0_op, cop1_op, cop2_op, cop1x_op,
28 beql_op, bnel_op, blezl_op, bgtzl_op,
29 daddi_op, pop30_op = daddi_op, daddiu_op, ldl_op, ldr_op,
30 spec2_op, jalx_op, mdmx_op, msa_op = mdmx_op, spec3_op,
31 lb_op, lh_op, lwl_op, lw_op,
32 lbu_op, lhu_op, lwr_op, lwu_op,
33 sb_op, sh_op, swl_op, sw_op,
34 sdl_op, sdr_op, swr_op, cache_op,
35 ll_op, lwc1_op, lwc2_op, bc6_op = lwc2_op, pref_op,
36 lld_op, ldc1_op, ldc2_op, pop66_op = ldc2_op, ld_op,
37 sc_op, swc1_op, swc2_op, balc6_op = swc2_op, major_3b_op,
38 scd_op, sdc1_op, sdc2_op, pop76_op = sdc2_op, sd_op
39};
40
41/*
42 * func field of spec opcode.
43 */
44enum spec_op {
45 sll_op, movc_op, srl_op, sra_op,
46 sllv_op, pmon_op, srlv_op, srav_op,
47 jr_op, jalr_op, movz_op, movn_op,
48 syscall_op, break_op, spim_op, sync_op,
49 mfhi_op, mthi_op, mflo_op, mtlo_op,
50 dsllv_op, spec2_unused_op, dsrlv_op, dsrav_op,
51 mult_op, multu_op, div_op, divu_op,
52 dmult_op, dmultu_op, ddiv_op, ddivu_op,
53 add_op, addu_op, sub_op, subu_op,
54 and_op, or_op, xor_op, nor_op,
55 spec3_unused_op, spec4_unused_op, slt_op, sltu_op,
56 dadd_op, daddu_op, dsub_op, dsubu_op,
57 tge_op, tgeu_op, tlt_op, tltu_op,
58 teq_op, seleqz_op, tne_op, selnez_op,
59 dsll_op, spec5_unused_op, dsrl_op, dsra_op,
60 dsll32_op, spec6_unused_op, dsrl32_op, dsra32_op
61};
62
63/*
64 * func field of spec2 opcode.
65 */
66enum spec2_op {
67 madd_op, maddu_op, mul_op, spec2_3_unused_op,
68 msub_op, msubu_op, /* more unused ops */
69 clz_op = 0x20, clo_op,
70 dclz_op = 0x24, dclo_op,
71 sdbpp_op = 0x3f
72};
73
74/*
75 * func field of spec3 opcode.
76 */
77enum spec3_op {
78 ext_op, dextm_op, dextu_op, dext_op,
79 ins_op, dinsm_op, dinsu_op, dins_op,
80 yield_op = 0x09, lx_op = 0x0a,
81 lwle_op = 0x19, lwre_op = 0x1a,
82 cachee_op = 0x1b, sbe_op = 0x1c,
83 she_op = 0x1d, sce_op = 0x1e,
84 swe_op = 0x1f, bshfl_op = 0x20,
85 swle_op = 0x21, swre_op = 0x22,
86 prefe_op = 0x23, dbshfl_op = 0x24,
87 cache6_op = 0x25, sc6_op = 0x26,
88 scd6_op = 0x27, lbue_op = 0x28,
89 lhue_op = 0x29, lbe_op = 0x2c,
90 lhe_op = 0x2d, lle_op = 0x2e,
91 lwe_op = 0x2f, pref6_op = 0x35,
92 ll6_op = 0x36, lld6_op = 0x37,
93 rdhwr_op = 0x3b
94};
95
96/*
97 * Bits 10-6 minor opcode for r6 spec mult/div encodings
98 */
99enum mult_op {
100 mult_mult_op = 0x0,
101 mult_mul_op = 0x2,
102 mult_muh_op = 0x3,
103};
104enum multu_op {
105 multu_multu_op = 0x0,
106 multu_mulu_op = 0x2,
107 multu_muhu_op = 0x3,
108};
109enum div_op {
110 div_div_op = 0x0,
111 div_div6_op = 0x2,
112 div_mod_op = 0x3,
113};
114enum divu_op {
115 divu_divu_op = 0x0,
116 divu_divu6_op = 0x2,
117 divu_modu_op = 0x3,
118};
119enum dmult_op {
120 dmult_dmult_op = 0x0,
121 dmult_dmul_op = 0x2,
122 dmult_dmuh_op = 0x3,
123};
124enum dmultu_op {
125 dmultu_dmultu_op = 0x0,
126 dmultu_dmulu_op = 0x2,
127 dmultu_dmuhu_op = 0x3,
128};
129enum ddiv_op {
130 ddiv_ddiv_op = 0x0,
131 ddiv_ddiv6_op = 0x2,
132 ddiv_dmod_op = 0x3,
133};
134enum ddivu_op {
135 ddivu_ddivu_op = 0x0,
136 ddivu_ddivu6_op = 0x2,
137 ddivu_dmodu_op = 0x3,
138};
139
140/*
141 * rt field of bcond opcodes.
142 */
143enum rt_op {
144 bltz_op, bgez_op, bltzl_op, bgezl_op,
145 spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07,
146 tgei_op, tgeiu_op, tlti_op, tltiu_op,
147 teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op,
148 bltzal_op, bgezal_op, bltzall_op, bgezall_op,
149 rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17,
150 rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b,
151 bposge32_op, rt_op_0x1d, rt_op_0x1e, synci_op
152};
153
154/*
155 * rs field of cop opcodes.
156 */
157enum cop_op {
158 mfc_op = 0x00, dmfc_op = 0x01,
159 cfc_op = 0x02, mfhc0_op = 0x02,
160 mfhc_op = 0x03, mtc_op = 0x04,
161 dmtc_op = 0x05, ctc_op = 0x06,
162 mthc0_op = 0x06, mthc_op = 0x07,
163 bc_op = 0x08, bc1eqz_op = 0x09,
164 mfmc0_op = 0x0b, bc1nez_op = 0x0d,
165 wrpgpr_op = 0x0e, cop_op = 0x10,
166 copm_op = 0x18
167};
168
169/*
170 * rt field of cop.bc_op opcodes
171 */
172enum bcop_op {
173 bcf_op, bct_op, bcfl_op, bctl_op
174};
175
176/*
177 * func field of cop0 coi opcodes.
178 */
179enum cop0_coi_func {
180 tlbr_op = 0x01, tlbwi_op = 0x02,
181 tlbwr_op = 0x06, tlbp_op = 0x08,
182 rfe_op = 0x10, eret_op = 0x18,
183 wait_op = 0x20, hypcall_op = 0x28
184};
185
186/*
187 * func field of cop0 com opcodes.
188 */
189enum cop0_com_func {
190 tlbr1_op = 0x01, tlbw_op = 0x02,
191 tlbp1_op = 0x08, dctr_op = 0x09,
192 dctw_op = 0x0a
193};
194
195/*
196 * fmt field of cop1 opcodes.
197 */
198enum cop1_fmt {
199 s_fmt, d_fmt, e_fmt, q_fmt,
200 w_fmt, l_fmt
201};
202
203/*
204 * func field of cop1 instructions using d, s or w format.
205 */
206enum cop1_sdw_func {
207 fadd_op = 0x00, fsub_op = 0x01,
208 fmul_op = 0x02, fdiv_op = 0x03,
209 fsqrt_op = 0x04, fabs_op = 0x05,
210 fmov_op = 0x06, fneg_op = 0x07,
211 froundl_op = 0x08, ftruncl_op = 0x09,
212 fceill_op = 0x0a, ffloorl_op = 0x0b,
213 fround_op = 0x0c, ftrunc_op = 0x0d,
214 fceil_op = 0x0e, ffloor_op = 0x0f,
215 fsel_op = 0x10,
216 fmovc_op = 0x11, fmovz_op = 0x12,
217 fmovn_op = 0x13, fseleqz_op = 0x14,
218 frecip_op = 0x15, frsqrt_op = 0x16,
219 fselnez_op = 0x17, fmaddf_op = 0x18,
220 fmsubf_op = 0x19, frint_op = 0x1a,
221 fclass_op = 0x1b, fmin_op = 0x1c,
222 fmina_op = 0x1d, fmax_op = 0x1e,
223 fmaxa_op = 0x1f, fcvts_op = 0x20,
224 fcvtd_op = 0x21, fcvte_op = 0x22,
225 fcvtw_op = 0x24, fcvtl_op = 0x25,
226 fcmp_op = 0x30
227};
228
229/*
230 * func field of cop1x opcodes (MIPS IV).
231 */
232enum cop1x_func {
233 lwxc1_op = 0x00, ldxc1_op = 0x01,
234 swxc1_op = 0x08, sdxc1_op = 0x09,
235 pfetch_op = 0x0f, madd_s_op = 0x20,
236 madd_d_op = 0x21, madd_e_op = 0x22,
237 msub_s_op = 0x28, msub_d_op = 0x29,
238 msub_e_op = 0x2a, nmadd_s_op = 0x30,
239 nmadd_d_op = 0x31, nmadd_e_op = 0x32,
240 nmsub_s_op = 0x38, nmsub_d_op = 0x39,
241 nmsub_e_op = 0x3a
242};
243
244/*
245 * func field for mad opcodes (MIPS IV).
246 */
247enum mad_func {
248 madd_fp_op = 0x08, msub_fp_op = 0x0a,
249 nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e
250};
251
252/*
253 * func field for page table walker (Loongson-3).
254 */
255enum ptw_func {
256 lwdir_op = 0x00,
257 lwpte_op = 0x01,
258 lddir_op = 0x02,
259 ldpte_op = 0x03,
260};
261
262/*
263 * func field for special3 lx opcodes (Cavium Octeon).
264 */
265enum lx_func {
266 lwx_op = 0x00,
267 lhx_op = 0x04,
268 lbux_op = 0x06,
269 ldx_op = 0x08,
270 lwux_op = 0x10,
271 lhux_op = 0x14,
272 lbx_op = 0x16,
273};
274
275/*
276 * BSHFL opcodes
277 */
278enum bshfl_func {
279 wsbh_op = 0x2,
280 seb_op = 0x10,
281 seh_op = 0x18,
282};
283
284/*
285 * DBSHFL opcodes
286 */
287enum dbshfl_func {
288 dsbh_op = 0x2,
289 dshd_op = 0x5,
290};
291
292/*
293 * MSA minor opcodes.
294 */
295enum msa_func {
296 msa_elm_op = 0x19,
297};
298
299/*
300 * MSA ELM opcodes.
301 */
302enum msa_elm {
303 msa_ctc_op = 0x3e,
304 msa_cfc_op = 0x7e,
305};
306
307/*
308 * func field for MSA MI10 format.
309 */
310enum msa_mi10_func {
311 msa_ld_op = 8,
312 msa_st_op = 9,
313};
314
315/*
316 * MSA 2 bit format fields.
317 */
318enum msa_2b_fmt {
319 msa_fmt_b = 0,
320 msa_fmt_h = 1,
321 msa_fmt_w = 2,
322 msa_fmt_d = 3,
323};
324
325/*
326 * (microMIPS) Major opcodes.
327 */
328enum mm_major_op {
329 mm_pool32a_op, mm_pool16a_op, mm_lbu16_op, mm_move16_op,
330 mm_addi32_op, mm_lbu32_op, mm_sb32_op, mm_lb32_op,
331 mm_pool32b_op, mm_pool16b_op, mm_lhu16_op, mm_andi16_op,
332 mm_addiu32_op, mm_lhu32_op, mm_sh32_op, mm_lh32_op,
333 mm_pool32i_op, mm_pool16c_op, mm_lwsp16_op, mm_pool16d_op,
334 mm_ori32_op, mm_pool32f_op, mm_pool32s_op, mm_reserved2_op,
335 mm_pool32c_op, mm_lwgp16_op, mm_lw16_op, mm_pool16e_op,
336 mm_xori32_op, mm_jals32_op, mm_addiupc_op, mm_reserved3_op,
337 mm_reserved4_op, mm_pool16f_op, mm_sb16_op, mm_beqz16_op,
338 mm_slti32_op, mm_beq32_op, mm_swc132_op, mm_lwc132_op,
339 mm_reserved5_op, mm_reserved6_op, mm_sh16_op, mm_bnez16_op,
340 mm_sltiu32_op, mm_bne32_op, mm_sdc132_op, mm_ldc132_op,
341 mm_reserved7_op, mm_reserved8_op, mm_swsp16_op, mm_b16_op,
342 mm_andi32_op, mm_j32_op, mm_sd32_op, mm_ld32_op,
343 mm_reserved11_op, mm_reserved12_op, mm_sw16_op, mm_li16_op,
344 mm_jalx32_op, mm_jal32_op, mm_sw32_op, mm_lw32_op,
345};
346
347/*
348 * (microMIPS) POOL32I minor opcodes.
349 */
350enum mm_32i_minor_op {
351 mm_bltz_op, mm_bltzal_op, mm_bgez_op, mm_bgezal_op,
352 mm_blez_op, mm_bnezc_op, mm_bgtz_op, mm_beqzc_op,
353 mm_tlti_op, mm_tgei_op, mm_tltiu_op, mm_tgeiu_op,
354 mm_tnei_op, mm_lui_op, mm_teqi_op, mm_reserved13_op,
355 mm_synci_op, mm_bltzals_op, mm_reserved14_op, mm_bgezals_op,
356 mm_bc2f_op, mm_bc2t_op, mm_reserved15_op, mm_reserved16_op,
357 mm_reserved17_op, mm_reserved18_op, mm_bposge64_op, mm_bposge32_op,
358 mm_bc1f_op, mm_bc1t_op, mm_reserved19_op, mm_reserved20_op,
359 mm_bc1any2f_op, mm_bc1any2t_op, mm_bc1any4f_op, mm_bc1any4t_op,
360};
361
362/*
363 * (microMIPS) POOL32A minor opcodes.
364 */
365enum mm_32a_minor_op {
366 mm_sll32_op = 0x000,
367 mm_ins_op = 0x00c,
368 mm_sllv32_op = 0x010,
369 mm_ext_op = 0x02c,
370 mm_pool32axf_op = 0x03c,
371 mm_srl32_op = 0x040,
372 mm_srlv32_op = 0x050,
373 mm_sra_op = 0x080,
374 mm_srav_op = 0x090,
375 mm_rotr_op = 0x0c0,
376 mm_lwxs_op = 0x118,
377 mm_addu32_op = 0x150,
378 mm_subu32_op = 0x1d0,
379 mm_wsbh_op = 0x1ec,
380 mm_mul_op = 0x210,
381 mm_and_op = 0x250,
382 mm_or32_op = 0x290,
383 mm_xor32_op = 0x310,
384 mm_slt_op = 0x350,
385 mm_sltu_op = 0x390,
386};
387
388/*
389 * (microMIPS) POOL32B functions.
390 */
391enum mm_32b_func {
392 mm_lwc2_func = 0x0,
393 mm_lwp_func = 0x1,
394 mm_ldc2_func = 0x2,
395 mm_ldp_func = 0x4,
396 mm_lwm32_func = 0x5,
397 mm_cache_func = 0x6,
398 mm_ldm_func = 0x7,
399 mm_swc2_func = 0x8,
400 mm_swp_func = 0x9,
401 mm_sdc2_func = 0xa,
402 mm_sdp_func = 0xc,
403 mm_swm32_func = 0xd,
404 mm_sdm_func = 0xf,
405};
406
407/*
408 * (microMIPS) POOL32C functions.
409 */
410enum mm_32c_func {
411 mm_pref_func = 0x2,
412 mm_ll_func = 0x3,
413 mm_swr_func = 0x9,
414 mm_sc_func = 0xb,
415 mm_lwu_func = 0xe,
416};
417
418/*
419 * (microMIPS) POOL32AXF minor opcodes.
420 */
421enum mm_32axf_minor_op {
422 mm_mfc0_op = 0x003,
423 mm_mtc0_op = 0x00b,
424 mm_tlbp_op = 0x00d,
425 mm_mfhi32_op = 0x035,
426 mm_jalr_op = 0x03c,
427 mm_tlbr_op = 0x04d,
428 mm_mflo32_op = 0x075,
429 mm_jalrhb_op = 0x07c,
430 mm_tlbwi_op = 0x08d,
431 mm_mthi32_op = 0x0b5,
432 mm_tlbwr_op = 0x0cd,
433 mm_mtlo32_op = 0x0f5,
434 mm_di_op = 0x11d,
435 mm_jalrs_op = 0x13c,
436 mm_jalrshb_op = 0x17c,
437 mm_sync_op = 0x1ad,
438 mm_syscall_op = 0x22d,
439 mm_wait_op = 0x24d,
440 mm_eret_op = 0x3cd,
441 mm_divu_op = 0x5dc,
442};
443
444/*
445 * (microMIPS) POOL32F minor opcodes.
446 */
447enum mm_32f_minor_op {
448 mm_32f_00_op = 0x00,
449 mm_32f_01_op = 0x01,
450 mm_32f_02_op = 0x02,
451 mm_32f_10_op = 0x08,
452 mm_32f_11_op = 0x09,
453 mm_32f_12_op = 0x0a,
454 mm_32f_20_op = 0x10,
455 mm_32f_30_op = 0x18,
456 mm_32f_40_op = 0x20,
457 mm_32f_41_op = 0x21,
458 mm_32f_42_op = 0x22,
459 mm_32f_50_op = 0x28,
460 mm_32f_51_op = 0x29,
461 mm_32f_52_op = 0x2a,
462 mm_32f_60_op = 0x30,
463 mm_32f_70_op = 0x38,
464 mm_32f_73_op = 0x3b,
465 mm_32f_74_op = 0x3c,
466};
467
468/*
469 * (microMIPS) POOL32F secondary minor opcodes.
470 */
471enum mm_32f_10_minor_op {
472 mm_lwxc1_op = 0x1,
473 mm_swxc1_op,
474 mm_ldxc1_op,
475 mm_sdxc1_op,
476 mm_luxc1_op,
477 mm_suxc1_op,
478};
479
480enum mm_32f_func {
481 mm_lwxc1_func = 0x048,
482 mm_swxc1_func = 0x088,
483 mm_ldxc1_func = 0x0c8,
484 mm_sdxc1_func = 0x108,
485};
486
487/*
488 * (microMIPS) POOL32F secondary minor opcodes.
489 */
490enum mm_32f_40_minor_op {
491 mm_fmovf_op,
492 mm_fmovt_op,
493};
494
495/*
496 * (microMIPS) POOL32F secondary minor opcodes.
497 */
498enum mm_32f_60_minor_op {
499 mm_fadd_op,
500 mm_fsub_op,
501 mm_fmul_op,
502 mm_fdiv_op,
503};
504
505/*
506 * (microMIPS) POOL32F secondary minor opcodes.
507 */
508enum mm_32f_70_minor_op {
509 mm_fmovn_op,
510 mm_fmovz_op,
511};
512
513/*
514 * (microMIPS) POOL32FXF secondary minor opcodes for POOL32F.
515 */
516enum mm_32f_73_minor_op {
517 mm_fmov0_op = 0x01,
518 mm_fcvtl_op = 0x04,
519 mm_movf0_op = 0x05,
520 mm_frsqrt_op = 0x08,
521 mm_ffloorl_op = 0x0c,
522 mm_fabs0_op = 0x0d,
523 mm_fcvtw_op = 0x24,
524 mm_movt0_op = 0x25,
525 mm_fsqrt_op = 0x28,
526 mm_ffloorw_op = 0x2c,
527 mm_fneg0_op = 0x2d,
528 mm_cfc1_op = 0x40,
529 mm_frecip_op = 0x48,
530 mm_fceill_op = 0x4c,
531 mm_fcvtd0_op = 0x4d,
532 mm_ctc1_op = 0x60,
533 mm_fceilw_op = 0x6c,
534 mm_fcvts0_op = 0x6d,
535 mm_mfc1_op = 0x80,
536 mm_fmov1_op = 0x81,
537 mm_movf1_op = 0x85,
538 mm_ftruncl_op = 0x8c,
539 mm_fabs1_op = 0x8d,
540 mm_mtc1_op = 0xa0,
541 mm_movt1_op = 0xa5,
542 mm_ftruncw_op = 0xac,
543 mm_fneg1_op = 0xad,
544 mm_mfhc1_op = 0xc0,
545 mm_froundl_op = 0xcc,
546 mm_fcvtd1_op = 0xcd,
547 mm_mthc1_op = 0xe0,
548 mm_froundw_op = 0xec,
549 mm_fcvts1_op = 0xed,
550};
551
552/*
553 * (microMIPS) POOL32S minor opcodes.
554 */
555enum mm_32s_minor_op {
556 mm_32s_elm_op = 0x16,
557};
558
559/*
560 * (microMIPS) POOL16C minor opcodes.
561 */
562enum mm_16c_minor_op {
563 mm_lwm16_op = 0x04,
564 mm_swm16_op = 0x05,
565 mm_jr16_op = 0x0c,
566 mm_jrc_op = 0x0d,
567 mm_jalr16_op = 0x0e,
568 mm_jalrs16_op = 0x0f,
569 mm_jraddiusp_op = 0x18,
570};
571
572/*
573 * (microMIPS) POOL16D minor opcodes.
574 */
575enum mm_16d_minor_op {
576 mm_addius5_func,
577 mm_addiusp_func,
578};
579
580/*
581 * (MIPS16e) opcodes.
582 */
583enum MIPS16e_ops {
584 MIPS16e_jal_op = 003,
585 MIPS16e_ld_op = 007,
586 MIPS16e_i8_op = 014,
587 MIPS16e_sd_op = 017,
588 MIPS16e_lb_op = 020,
589 MIPS16e_lh_op = 021,
590 MIPS16e_lwsp_op = 022,
591 MIPS16e_lw_op = 023,
592 MIPS16e_lbu_op = 024,
593 MIPS16e_lhu_op = 025,
594 MIPS16e_lwpc_op = 026,
595 MIPS16e_lwu_op = 027,
596 MIPS16e_sb_op = 030,
597 MIPS16e_sh_op = 031,
598 MIPS16e_swsp_op = 032,
599 MIPS16e_sw_op = 033,
600 MIPS16e_rr_op = 035,
601 MIPS16e_extend_op = 036,
602 MIPS16e_i64_op = 037,
603};
604
605enum MIPS16e_i64_func {
606 MIPS16e_ldsp_func,
607 MIPS16e_sdsp_func,
608 MIPS16e_sdrasp_func,
609 MIPS16e_dadjsp_func,
610 MIPS16e_ldpc_func,
611};
612
613enum MIPS16e_rr_func {
614 MIPS16e_jr_func,
615};
616
617enum MIPS6e_i8_func {
618 MIPS16e_swrasp_func = 02,
619};
620
621/*
622 * (microMIPS) NOP instruction.
623 */
624#define MM_NOP16 0x0c00
625
626struct j_format {
627 __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */
628 __BITFIELD_FIELD(unsigned int target : 26,
629 ;))
630};
631
632struct i_format { /* signed immediate format */
633 __BITFIELD_FIELD(unsigned int opcode : 6,
634 __BITFIELD_FIELD(unsigned int rs : 5,
635 __BITFIELD_FIELD(unsigned int rt : 5,
636 __BITFIELD_FIELD(signed int simmediate : 16,
637 ;))))
638};
639
640struct u_format { /* unsigned immediate format */
641 __BITFIELD_FIELD(unsigned int opcode : 6,
642 __BITFIELD_FIELD(unsigned int rs : 5,
643 __BITFIELD_FIELD(unsigned int rt : 5,
644 __BITFIELD_FIELD(unsigned int uimmediate : 16,
645 ;))))
646};
647
648struct c_format { /* Cache (>= R6000) format */
649 __BITFIELD_FIELD(unsigned int opcode : 6,
650 __BITFIELD_FIELD(unsigned int rs : 5,
651 __BITFIELD_FIELD(unsigned int c_op : 3,
652 __BITFIELD_FIELD(unsigned int cache : 2,
653 __BITFIELD_FIELD(unsigned int simmediate : 16,
654 ;)))))
655};
656
657struct r_format { /* Register format */
658 __BITFIELD_FIELD(unsigned int opcode : 6,
659 __BITFIELD_FIELD(unsigned int rs : 5,
660 __BITFIELD_FIELD(unsigned int rt : 5,
661 __BITFIELD_FIELD(unsigned int rd : 5,
662 __BITFIELD_FIELD(unsigned int re : 5,
663 __BITFIELD_FIELD(unsigned int func : 6,
664 ;))))))
665};
666
667struct c0r_format { /* C0 register format */
668 __BITFIELD_FIELD(unsigned int opcode : 6,
669 __BITFIELD_FIELD(unsigned int rs : 5,
670 __BITFIELD_FIELD(unsigned int rt : 5,
671 __BITFIELD_FIELD(unsigned int rd : 5,
672 __BITFIELD_FIELD(unsigned int z: 8,
673 __BITFIELD_FIELD(unsigned int sel : 3,
674 ;))))))
675};
676
677struct mfmc0_format { /* MFMC0 register format */
678 __BITFIELD_FIELD(unsigned int opcode : 6,
679 __BITFIELD_FIELD(unsigned int rs : 5,
680 __BITFIELD_FIELD(unsigned int rt : 5,
681 __BITFIELD_FIELD(unsigned int rd : 5,
682 __BITFIELD_FIELD(unsigned int re : 5,
683 __BITFIELD_FIELD(unsigned int sc : 1,
684 __BITFIELD_FIELD(unsigned int : 2,
685 __BITFIELD_FIELD(unsigned int sel : 3,
686 ;))))))))
687};
688
689struct co_format { /* C0 CO format */
690 __BITFIELD_FIELD(unsigned int opcode : 6,
691 __BITFIELD_FIELD(unsigned int co : 1,
692 __BITFIELD_FIELD(unsigned int code : 19,
693 __BITFIELD_FIELD(unsigned int func : 6,
694 ;))))
695};
696
697struct p_format { /* Performance counter format (R10000) */
698 __BITFIELD_FIELD(unsigned int opcode : 6,
699 __BITFIELD_FIELD(unsigned int rs : 5,
700 __BITFIELD_FIELD(unsigned int rt : 5,
701 __BITFIELD_FIELD(unsigned int rd : 5,
702 __BITFIELD_FIELD(unsigned int re : 5,
703 __BITFIELD_FIELD(unsigned int func : 6,
704 ;))))))
705};
706
707struct f_format { /* FPU register format */
708 __BITFIELD_FIELD(unsigned int opcode : 6,
709 __BITFIELD_FIELD(unsigned int : 1,
710 __BITFIELD_FIELD(unsigned int fmt : 4,
711 __BITFIELD_FIELD(unsigned int rt : 5,
712 __BITFIELD_FIELD(unsigned int rd : 5,
713 __BITFIELD_FIELD(unsigned int re : 5,
714 __BITFIELD_FIELD(unsigned int func : 6,
715 ;)))))))
716};
717
718struct ma_format { /* FPU multiply and add format (MIPS IV) */
719 __BITFIELD_FIELD(unsigned int opcode : 6,
720 __BITFIELD_FIELD(unsigned int fr : 5,
721 __BITFIELD_FIELD(unsigned int ft : 5,
722 __BITFIELD_FIELD(unsigned int fs : 5,
723 __BITFIELD_FIELD(unsigned int fd : 5,
724 __BITFIELD_FIELD(unsigned int func : 4,
725 __BITFIELD_FIELD(unsigned int fmt : 2,
726 ;)))))))
727};
728
729struct b_format { /* BREAK and SYSCALL */
730 __BITFIELD_FIELD(unsigned int opcode : 6,
731 __BITFIELD_FIELD(unsigned int code : 20,
732 __BITFIELD_FIELD(unsigned int func : 6,
733 ;)))
734};
735
736struct ps_format { /* MIPS-3D / paired single format */
737 __BITFIELD_FIELD(unsigned int opcode : 6,
738 __BITFIELD_FIELD(unsigned int rs : 5,
739 __BITFIELD_FIELD(unsigned int ft : 5,
740 __BITFIELD_FIELD(unsigned int fs : 5,
741 __BITFIELD_FIELD(unsigned int fd : 5,
742 __BITFIELD_FIELD(unsigned int func : 6,
743 ;))))))
744};
745
746struct v_format { /* MDMX vector format */
747 __BITFIELD_FIELD(unsigned int opcode : 6,
748 __BITFIELD_FIELD(unsigned int sel : 4,
749 __BITFIELD_FIELD(unsigned int fmt : 1,
750 __BITFIELD_FIELD(unsigned int vt : 5,
751 __BITFIELD_FIELD(unsigned int vs : 5,
752 __BITFIELD_FIELD(unsigned int vd : 5,
753 __BITFIELD_FIELD(unsigned int func : 6,
754 ;)))))))
755};
756
757struct msa_mi10_format { /* MSA MI10 */
758 __BITFIELD_FIELD(unsigned int opcode : 6,
759 __BITFIELD_FIELD(signed int s10 : 10,
760 __BITFIELD_FIELD(unsigned int rs : 5,
761 __BITFIELD_FIELD(unsigned int wd : 5,
762 __BITFIELD_FIELD(unsigned int func : 4,
763 __BITFIELD_FIELD(unsigned int df : 2,
764 ;))))))
765};
766
767struct dsp_format { /* SPEC3 DSP format instructions */
768 __BITFIELD_FIELD(unsigned int opcode : 6,
769 __BITFIELD_FIELD(unsigned int base : 5,
770 __BITFIELD_FIELD(unsigned int index : 5,
771 __BITFIELD_FIELD(unsigned int rd : 5,
772 __BITFIELD_FIELD(unsigned int op : 5,
773 __BITFIELD_FIELD(unsigned int func : 6,
774 ;))))))
775};
776
777struct spec3_format { /* SPEC3 */
778 __BITFIELD_FIELD(unsigned int opcode:6,
779 __BITFIELD_FIELD(unsigned int rs:5,
780 __BITFIELD_FIELD(unsigned int rt:5,
781 __BITFIELD_FIELD(signed int simmediate:9,
782 __BITFIELD_FIELD(unsigned int func:7,
783 ;)))))
784};
785
786/*
787 * microMIPS instruction formats (32-bit length)
788 *
789 * NOTE:
790 * Parenthesis denote whether the format is a microMIPS instruction or
791 * if it is MIPS32 instruction re-encoded for use in the microMIPS ASE.
792 */
793struct fb_format { /* FPU branch format (MIPS32) */
794 __BITFIELD_FIELD(unsigned int opcode : 6,
795 __BITFIELD_FIELD(unsigned int bc : 5,
796 __BITFIELD_FIELD(unsigned int cc : 3,
797 __BITFIELD_FIELD(unsigned int flag : 2,
798 __BITFIELD_FIELD(signed int simmediate : 16,
799 ;)))))
800};
801
802struct fp0_format { /* FPU multiply and add format (MIPS32) */
803 __BITFIELD_FIELD(unsigned int opcode : 6,
804 __BITFIELD_FIELD(unsigned int fmt : 5,
805 __BITFIELD_FIELD(unsigned int ft : 5,
806 __BITFIELD_FIELD(unsigned int fs : 5,
807 __BITFIELD_FIELD(unsigned int fd : 5,
808 __BITFIELD_FIELD(unsigned int func : 6,
809 ;))))))
810};
811
812struct mm_fp0_format { /* FPU multiply and add format (microMIPS) */
813 __BITFIELD_FIELD(unsigned int opcode : 6,
814 __BITFIELD_FIELD(unsigned int ft : 5,
815 __BITFIELD_FIELD(unsigned int fs : 5,
816 __BITFIELD_FIELD(unsigned int fd : 5,
817 __BITFIELD_FIELD(unsigned int fmt : 3,
818 __BITFIELD_FIELD(unsigned int op : 2,
819 __BITFIELD_FIELD(unsigned int func : 6,
820 ;)))))))
821};
822
823struct fp1_format { /* FPU mfc1 and cfc1 format (MIPS32) */
824 __BITFIELD_FIELD(unsigned int opcode : 6,
825 __BITFIELD_FIELD(unsigned int op : 5,
826 __BITFIELD_FIELD(unsigned int rt : 5,
827 __BITFIELD_FIELD(unsigned int fs : 5,
828 __BITFIELD_FIELD(unsigned int fd : 5,
829 __BITFIELD_FIELD(unsigned int func : 6,
830 ;))))))
831};
832
833struct mm_fp1_format { /* FPU mfc1 and cfc1 format (microMIPS) */
834 __BITFIELD_FIELD(unsigned int opcode : 6,
835 __BITFIELD_FIELD(unsigned int rt : 5,
836 __BITFIELD_FIELD(unsigned int fs : 5,
837 __BITFIELD_FIELD(unsigned int fmt : 2,
838 __BITFIELD_FIELD(unsigned int op : 8,
839 __BITFIELD_FIELD(unsigned int func : 6,
840 ;))))))
841};
842
843struct mm_fp2_format { /* FPU movt and movf format (microMIPS) */
844 __BITFIELD_FIELD(unsigned int opcode : 6,
845 __BITFIELD_FIELD(unsigned int fd : 5,
846 __BITFIELD_FIELD(unsigned int fs : 5,
847 __BITFIELD_FIELD(unsigned int cc : 3,
848 __BITFIELD_FIELD(unsigned int zero : 2,
849 __BITFIELD_FIELD(unsigned int fmt : 2,
850 __BITFIELD_FIELD(unsigned int op : 3,
851 __BITFIELD_FIELD(unsigned int func : 6,
852 ;))))))))
853};
854
855struct mm_fp3_format { /* FPU abs and neg format (microMIPS) */
856 __BITFIELD_FIELD(unsigned int opcode : 6,
857 __BITFIELD_FIELD(unsigned int rt : 5,
858 __BITFIELD_FIELD(unsigned int fs : 5,
859 __BITFIELD_FIELD(unsigned int fmt : 3,
860 __BITFIELD_FIELD(unsigned int op : 7,
861 __BITFIELD_FIELD(unsigned int func : 6,
862 ;))))))
863};
864
865struct mm_fp4_format { /* FPU c.cond format (microMIPS) */
866 __BITFIELD_FIELD(unsigned int opcode : 6,
867 __BITFIELD_FIELD(unsigned int rt : 5,
868 __BITFIELD_FIELD(unsigned int fs : 5,
869 __BITFIELD_FIELD(unsigned int cc : 3,
870 __BITFIELD_FIELD(unsigned int fmt : 3,
871 __BITFIELD_FIELD(unsigned int cond : 4,
872 __BITFIELD_FIELD(unsigned int func : 6,
873 ;)))))))
874};
875
876struct mm_fp5_format { /* FPU lwxc1 and swxc1 format (microMIPS) */
877 __BITFIELD_FIELD(unsigned int opcode : 6,
878 __BITFIELD_FIELD(unsigned int index : 5,
879 __BITFIELD_FIELD(unsigned int base : 5,
880 __BITFIELD_FIELD(unsigned int fd : 5,
881 __BITFIELD_FIELD(unsigned int op : 5,
882 __BITFIELD_FIELD(unsigned int func : 6,
883 ;))))))
884};
885
886struct fp6_format { /* FPU madd and msub format (MIPS IV) */
887 __BITFIELD_FIELD(unsigned int opcode : 6,
888 __BITFIELD_FIELD(unsigned int fr : 5,
889 __BITFIELD_FIELD(unsigned int ft : 5,
890 __BITFIELD_FIELD(unsigned int fs : 5,
891 __BITFIELD_FIELD(unsigned int fd : 5,
892 __BITFIELD_FIELD(unsigned int func : 6,
893 ;))))))
894};
895
896struct mm_fp6_format { /* FPU madd and msub format (microMIPS) */
897 __BITFIELD_FIELD(unsigned int opcode : 6,
898 __BITFIELD_FIELD(unsigned int ft : 5,
899 __BITFIELD_FIELD(unsigned int fs : 5,
900 __BITFIELD_FIELD(unsigned int fd : 5,
901 __BITFIELD_FIELD(unsigned int fr : 5,
902 __BITFIELD_FIELD(unsigned int func : 6,
903 ;))))))
904};
905
906struct mm_i_format { /* Immediate format (microMIPS) */
907 __BITFIELD_FIELD(unsigned int opcode : 6,
908 __BITFIELD_FIELD(unsigned int rt : 5,
909 __BITFIELD_FIELD(unsigned int rs : 5,
910 __BITFIELD_FIELD(signed int simmediate : 16,
911 ;))))
912};
913
914struct mm_m_format { /* Multi-word load/store format (microMIPS) */
915 __BITFIELD_FIELD(unsigned int opcode : 6,
916 __BITFIELD_FIELD(unsigned int rd : 5,
917 __BITFIELD_FIELD(unsigned int base : 5,
918 __BITFIELD_FIELD(unsigned int func : 4,
919 __BITFIELD_FIELD(signed int simmediate : 12,
920 ;)))))
921};
922
923struct mm_x_format { /* Scaled indexed load format (microMIPS) */
924 __BITFIELD_FIELD(unsigned int opcode : 6,
925 __BITFIELD_FIELD(unsigned int index : 5,
926 __BITFIELD_FIELD(unsigned int base : 5,
927 __BITFIELD_FIELD(unsigned int rd : 5,
928 __BITFIELD_FIELD(unsigned int func : 11,
929 ;)))))
930};
931
932struct mm_a_format { /* ADDIUPC format (microMIPS) */
933 __BITFIELD_FIELD(unsigned int opcode : 6,
934 __BITFIELD_FIELD(unsigned int rs : 3,
935 __BITFIELD_FIELD(signed int simmediate : 23,
936 ;)))
937};
938
939/*
940 * microMIPS instruction formats (16-bit length)
941 */
942struct mm_b0_format { /* Unconditional branch format (microMIPS) */
943 __BITFIELD_FIELD(unsigned int opcode : 6,
944 __BITFIELD_FIELD(signed int simmediate : 10,
945 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
946 ;)))
947};
948
949struct mm_b1_format { /* Conditional branch format (microMIPS) */
950 __BITFIELD_FIELD(unsigned int opcode : 6,
951 __BITFIELD_FIELD(unsigned int rs : 3,
952 __BITFIELD_FIELD(signed int simmediate : 7,
953 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
954 ;))))
955};
956
957struct mm16_m_format { /* Multi-word load/store format */
958 __BITFIELD_FIELD(unsigned int opcode : 6,
959 __BITFIELD_FIELD(unsigned int func : 4,
960 __BITFIELD_FIELD(unsigned int rlist : 2,
961 __BITFIELD_FIELD(unsigned int imm : 4,
962 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
963 ;)))))
964};
965
966struct mm16_rb_format { /* Signed immediate format */
967 __BITFIELD_FIELD(unsigned int opcode : 6,
968 __BITFIELD_FIELD(unsigned int rt : 3,
969 __BITFIELD_FIELD(unsigned int base : 3,
970 __BITFIELD_FIELD(signed int simmediate : 4,
971 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
972 ;)))))
973};
974
975struct mm16_r3_format { /* Load from global pointer format */
976 __BITFIELD_FIELD(unsigned int opcode : 6,
977 __BITFIELD_FIELD(unsigned int rt : 3,
978 __BITFIELD_FIELD(signed int simmediate : 7,
979 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
980 ;))))
981};
982
983struct mm16_r5_format { /* Load/store from stack pointer format */
984 __BITFIELD_FIELD(unsigned int opcode : 6,
985 __BITFIELD_FIELD(unsigned int rt : 5,
986 __BITFIELD_FIELD(unsigned int imm : 5,
987 __BITFIELD_FIELD(unsigned int : 16, /* Ignored */
988 ;))))
989};
990
991/*
992 * Loongson-3 overridden COP2 instruction formats (32-bit length)
993 */
994struct loongson3_lswc2_format { /* Loongson-3 overridden lwc2/swc2 Load/Store format */
995 __BITFIELD_FIELD(unsigned int opcode : 6,
996 __BITFIELD_FIELD(unsigned int base : 5,
997 __BITFIELD_FIELD(unsigned int rt : 5,
998 __BITFIELD_FIELD(unsigned int fr : 1,
999 __BITFIELD_FIELD(unsigned int offset : 9,
1000 __BITFIELD_FIELD(unsigned int ls : 1,
1001 __BITFIELD_FIELD(unsigned int rq : 5,
1002 ;)))))))
1003};
1004
1005struct loongson3_lsdc2_format { /* Loongson-3 overridden ldc2/sdc2 Load/Store format */
1006 __BITFIELD_FIELD(unsigned int opcode : 6,
1007 __BITFIELD_FIELD(unsigned int base : 5,
1008 __BITFIELD_FIELD(unsigned int rt : 5,
1009 __BITFIELD_FIELD(unsigned int index : 5,
1010 __BITFIELD_FIELD(unsigned int offset : 8,
1011 __BITFIELD_FIELD(unsigned int opcode1 : 3,
1012 ;))))))
1013};
1014
1015struct loongson3_lscsr_format { /* Loongson-3 CPUCFG&CSR read/write format */
1016 __BITFIELD_FIELD(unsigned int opcode : 6,
1017 __BITFIELD_FIELD(unsigned int rs : 5,
1018 __BITFIELD_FIELD(unsigned int fr : 5,
1019 __BITFIELD_FIELD(unsigned int rd : 5,
1020 __BITFIELD_FIELD(unsigned int fd : 5,
1021 __BITFIELD_FIELD(unsigned int func : 6,
1022 ;))))))
1023};
1024
1025/*
1026 * MIPS16e instruction formats (16-bit length)
1027 */
1028struct m16e_rr {
1029 __BITFIELD_FIELD(unsigned int opcode : 5,
1030 __BITFIELD_FIELD(unsigned int rx : 3,
1031 __BITFIELD_FIELD(unsigned int nd : 1,
1032 __BITFIELD_FIELD(unsigned int l : 1,
1033 __BITFIELD_FIELD(unsigned int ra : 1,
1034 __BITFIELD_FIELD(unsigned int func : 5,
1035 ;))))))
1036};
1037
1038struct m16e_jal {
1039 __BITFIELD_FIELD(unsigned int opcode : 5,
1040 __BITFIELD_FIELD(unsigned int x : 1,
1041 __BITFIELD_FIELD(unsigned int imm20_16 : 5,
1042 __BITFIELD_FIELD(signed int imm25_21 : 5,
1043 ;))))
1044};
1045
1046struct m16e_i64 {
1047 __BITFIELD_FIELD(unsigned int opcode : 5,
1048 __BITFIELD_FIELD(unsigned int func : 3,
1049 __BITFIELD_FIELD(unsigned int imm : 8,
1050 ;)))
1051};
1052
1053struct m16e_ri64 {
1054 __BITFIELD_FIELD(unsigned int opcode : 5,
1055 __BITFIELD_FIELD(unsigned int func : 3,
1056 __BITFIELD_FIELD(unsigned int ry : 3,
1057 __BITFIELD_FIELD(unsigned int imm : 5,
1058 ;))))
1059};
1060
1061struct m16e_ri {
1062 __BITFIELD_FIELD(unsigned int opcode : 5,
1063 __BITFIELD_FIELD(unsigned int rx : 3,
1064 __BITFIELD_FIELD(unsigned int imm : 8,
1065 ;)))
1066};
1067
1068struct m16e_rri {
1069 __BITFIELD_FIELD(unsigned int opcode : 5,
1070 __BITFIELD_FIELD(unsigned int rx : 3,
1071 __BITFIELD_FIELD(unsigned int ry : 3,
1072 __BITFIELD_FIELD(unsigned int imm : 5,
1073 ;))))
1074};
1075
1076struct m16e_i8 {
1077 __BITFIELD_FIELD(unsigned int opcode : 5,
1078 __BITFIELD_FIELD(unsigned int func : 3,
1079 __BITFIELD_FIELD(unsigned int imm : 8,
1080 ;)))
1081};
1082
1083union mips_instruction {
1084 unsigned int word;
1085 unsigned short halfword[2];
1086 unsigned char byte[4];
1087 struct j_format j_format;
1088 struct i_format i_format;
1089 struct u_format u_format;
1090 struct c_format c_format;
1091 struct r_format r_format;
1092 struct c0r_format c0r_format;
1093 struct mfmc0_format mfmc0_format;
1094 struct co_format co_format;
1095 struct p_format p_format;
1096 struct f_format f_format;
1097 struct ma_format ma_format;
1098 struct msa_mi10_format msa_mi10_format;
1099 struct b_format b_format;
1100 struct ps_format ps_format;
1101 struct v_format v_format;
1102 struct dsp_format dsp_format;
1103 struct spec3_format spec3_format;
1104 struct fb_format fb_format;
1105 struct fp0_format fp0_format;
1106 struct mm_fp0_format mm_fp0_format;
1107 struct fp1_format fp1_format;
1108 struct mm_fp1_format mm_fp1_format;
1109 struct mm_fp2_format mm_fp2_format;
1110 struct mm_fp3_format mm_fp3_format;
1111 struct mm_fp4_format mm_fp4_format;
1112 struct mm_fp5_format mm_fp5_format;
1113 struct fp6_format fp6_format;
1114 struct mm_fp6_format mm_fp6_format;
1115 struct mm_i_format mm_i_format;
1116 struct mm_m_format mm_m_format;
1117 struct mm_x_format mm_x_format;
1118 struct mm_a_format mm_a_format;
1119 struct mm_b0_format mm_b0_format;
1120 struct mm_b1_format mm_b1_format;
1121 struct mm16_m_format mm16_m_format ;
1122 struct mm16_rb_format mm16_rb_format;
1123 struct mm16_r3_format mm16_r3_format;
1124 struct mm16_r5_format mm16_r5_format;
1125 struct loongson3_lswc2_format loongson3_lswc2_format;
1126 struct loongson3_lsdc2_format loongson3_lsdc2_format;
1127 struct loongson3_lscsr_format loongson3_lscsr_format;
1128};
1129
1130union mips16e_instruction {
1131 unsigned int full : 16;
1132 struct m16e_rr rr;
1133 struct m16e_jal jal;
1134 struct m16e_i64 i64;
1135 struct m16e_ri64 ri64;
1136 struct m16e_ri ri;
1137 struct m16e_rri rri;
1138 struct m16e_i8 i8;
1139};
1140
1141#endif /* _ASM_INST_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/ioctls.h+2
...@@ -93,6 +93,8 @@...@@ -93,6 +93,8 @@
93#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */93#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
94#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */94#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
95#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */95#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
96#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
97#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
9698
97/* I hope the range from 0x5480 on is free ... */99/* I hope the range from 0x5480 on is free ... */
98#define TIOCSCTTY 0x5480 /* become controlling tty */100#define TIOCSCTTY 0x5480 /* become controlling tty */
lib/libc/include/mips-linux-any/asm/kvm_para.h deleted-5
...@@ -1,5 +0,0 @@
1#ifndef _ASM_MIPS_KVM_PARA_H
2#define _ASM_MIPS_KVM_PARA_H
3
4
5#endif /* _ASM_MIPS_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/mman.h+7-3
...@@ -27,9 +27,7 @@...@@ -27,9 +27,7 @@
27/*27/*
28 * Flags for mmap28 * Flags for mmap
29 */29 */
30#define MAP_SHARED 0x001 /* Share changes */30/* 0x01 - 0x03 are defined in linux/mman.h */
31#define MAP_PRIVATE 0x002 /* Changes are private */
32#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
33#define MAP_TYPE 0x00f /* Mask for type of mapping */31#define MAP_TYPE 0x00f /* Mask for type of mapping */
34#define MAP_FIXED 0x010 /* Interpret addr exactly */32#define MAP_FIXED 0x010 /* Interpret addr exactly */
3533
...@@ -97,6 +95,12 @@...@@ -97,6 +95,12 @@
97#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */95#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
98#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */96#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
9997
98#define MADV_COLD 20 /* deactivate these pages */
99#define MADV_PAGEOUT 21 /* reclaim these pages */
100
101#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
102#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
103
100/* compatibility flags */104/* compatibility flags */
101#define MAP_FILE 0105#define MAP_FILE 0
102106
lib/libc/include/mips-linux-any/asm/msgbuf.h+4-3
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef _ASM_MSGBUF_H2#ifndef _ASM_MSGBUF_H
3#define _ASM_MSGBUF_H3#define _ASM_MSGBUF_H
44
5#include <asm/ipcbuf.h>
56
6/*7/*
7 * The msqid64_ds structure for the MIPS architecture.8 * The msqid64_ds structure for the MIPS architecture.
...@@ -15,9 +16,9 @@...@@ -15,9 +16,9 @@
15#if defined(__mips64)16#if defined(__mips64)
16struct msqid64_ds {17struct msqid64_ds {
17 struct ipc64_perm msg_perm;18 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */19 long msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */20 long msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */21 long msg_ctime; /* last change time */
21 unsigned long msg_cbytes; /* current number of bytes on queue */22 unsigned long msg_cbytes; /* current number of bytes on queue */
22 unsigned long msg_qnum; /* number of messages in queue */23 unsigned long msg_qnum; /* number of messages in queue */
23 unsigned long msg_qbytes; /* max number of bytes on queue */24 unsigned long msg_qbytes; /* max number of bytes on queue */
lib/libc/include/mips-linux-any/asm/perf_regs.h created+40
...@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_MIPS_PERF_REGS_H
3#define _ASM_MIPS_PERF_REGS_H
4
5enum perf_event_mips_regs {
6 PERF_REG_MIPS_PC,
7 PERF_REG_MIPS_R1,
8 PERF_REG_MIPS_R2,
9 PERF_REG_MIPS_R3,
10 PERF_REG_MIPS_R4,
11 PERF_REG_MIPS_R5,
12 PERF_REG_MIPS_R6,
13 PERF_REG_MIPS_R7,
14 PERF_REG_MIPS_R8,
15 PERF_REG_MIPS_R9,
16 PERF_REG_MIPS_R10,
17 PERF_REG_MIPS_R11,
18 PERF_REG_MIPS_R12,
19 PERF_REG_MIPS_R13,
20 PERF_REG_MIPS_R14,
21 PERF_REG_MIPS_R15,
22 PERF_REG_MIPS_R16,
23 PERF_REG_MIPS_R17,
24 PERF_REG_MIPS_R18,
25 PERF_REG_MIPS_R19,
26 PERF_REG_MIPS_R20,
27 PERF_REG_MIPS_R21,
28 PERF_REG_MIPS_R22,
29 PERF_REG_MIPS_R23,
30 PERF_REG_MIPS_R24,
31 PERF_REG_MIPS_R25,
32 PERF_REG_MIPS_R26,
33 PERF_REG_MIPS_R27,
34 PERF_REG_MIPS_R28,
35 PERF_REG_MIPS_R29,
36 PERF_REG_MIPS_R30,
37 PERF_REG_MIPS_R31,
38 PERF_REG_MIPS_MAX = PERF_REG_MIPS_R31 + 1,
39};
40#endif /* _ASM_MIPS_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/posix_types.h-7
...@@ -21,13 +21,6 @@...@@ -21,13 +21,6 @@
21typedef long __kernel_daddr_t;21typedef long __kernel_daddr_t;
22#define __kernel_daddr_t __kernel_daddr_t22#define __kernel_daddr_t __kernel_daddr_t
2323
24#if (_MIPS_SZLONG == 32)
25typedef struct {
26 long val[2];
27} __kernel_fsid_t;
28#define __kernel_fsid_t __kernel_fsid_t
29#endif
30
31#include <asm-generic/posix_types.h>24#include <asm-generic/posix_types.h>
3225
33#endif /* _ASM_POSIX_TYPES_H */26#endif /* _ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/reg.h created+207
...@@ -0,0 +1,207 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Various register offset definitions for debuggers, core file
4 * examiners and whatnot.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995, 1999 Ralf Baechle
11 * Copyright (C) 1995, 1999 Silicon Graphics
12 */
13#ifndef __UAPI_ASM_MIPS_REG_H
14#define __UAPI_ASM_MIPS_REG_H
15
16#define MIPS32_EF_R0 6
17#define MIPS32_EF_R1 7
18#define MIPS32_EF_R2 8
19#define MIPS32_EF_R3 9
20#define MIPS32_EF_R4 10
21#define MIPS32_EF_R5 11
22#define MIPS32_EF_R6 12
23#define MIPS32_EF_R7 13
24#define MIPS32_EF_R8 14
25#define MIPS32_EF_R9 15
26#define MIPS32_EF_R10 16
27#define MIPS32_EF_R11 17
28#define MIPS32_EF_R12 18
29#define MIPS32_EF_R13 19
30#define MIPS32_EF_R14 20
31#define MIPS32_EF_R15 21
32#define MIPS32_EF_R16 22
33#define MIPS32_EF_R17 23
34#define MIPS32_EF_R18 24
35#define MIPS32_EF_R19 25
36#define MIPS32_EF_R20 26
37#define MIPS32_EF_R21 27
38#define MIPS32_EF_R22 28
39#define MIPS32_EF_R23 29
40#define MIPS32_EF_R24 30
41#define MIPS32_EF_R25 31
42
43/*
44 * k0/k1 unsaved
45 */
46#define MIPS32_EF_R26 32
47#define MIPS32_EF_R27 33
48
49#define MIPS32_EF_R28 34
50#define MIPS32_EF_R29 35
51#define MIPS32_EF_R30 36
52#define MIPS32_EF_R31 37
53
54/*
55 * Saved special registers
56 */
57#define MIPS32_EF_LO 38
58#define MIPS32_EF_HI 39
59
60#define MIPS32_EF_CP0_EPC 40
61#define MIPS32_EF_CP0_BADVADDR 41
62#define MIPS32_EF_CP0_STATUS 42
63#define MIPS32_EF_CP0_CAUSE 43
64#define MIPS32_EF_UNUSED0 44
65
66#define MIPS32_EF_SIZE 180
67
68#define MIPS64_EF_R0 0
69#define MIPS64_EF_R1 1
70#define MIPS64_EF_R2 2
71#define MIPS64_EF_R3 3
72#define MIPS64_EF_R4 4
73#define MIPS64_EF_R5 5
74#define MIPS64_EF_R6 6
75#define MIPS64_EF_R7 7
76#define MIPS64_EF_R8 8
77#define MIPS64_EF_R9 9
78#define MIPS64_EF_R10 10
79#define MIPS64_EF_R11 11
80#define MIPS64_EF_R12 12
81#define MIPS64_EF_R13 13
82#define MIPS64_EF_R14 14
83#define MIPS64_EF_R15 15
84#define MIPS64_EF_R16 16
85#define MIPS64_EF_R17 17
86#define MIPS64_EF_R18 18
87#define MIPS64_EF_R19 19
88#define MIPS64_EF_R20 20
89#define MIPS64_EF_R21 21
90#define MIPS64_EF_R22 22
91#define MIPS64_EF_R23 23
92#define MIPS64_EF_R24 24
93#define MIPS64_EF_R25 25
94
95/*
96 * k0/k1 unsaved
97 */
98#define MIPS64_EF_R26 26
99#define MIPS64_EF_R27 27
100
101
102#define MIPS64_EF_R28 28
103#define MIPS64_EF_R29 29
104#define MIPS64_EF_R30 30
105#define MIPS64_EF_R31 31
106
107/*
108 * Saved special registers
109 */
110#define MIPS64_EF_LO 32
111#define MIPS64_EF_HI 33
112
113#define MIPS64_EF_CP0_EPC 34
114#define MIPS64_EF_CP0_BADVADDR 35
115#define MIPS64_EF_CP0_STATUS 36
116#define MIPS64_EF_CP0_CAUSE 37
117
118#define MIPS64_EF_SIZE 304 /* size in bytes */
119
120#if _MIPS_SIM == _MIPS_SIM_ABI32
121
122#define EF_R0 MIPS32_EF_R0
123#define EF_R1 MIPS32_EF_R1
124#define EF_R2 MIPS32_EF_R2
125#define EF_R3 MIPS32_EF_R3
126#define EF_R4 MIPS32_EF_R4
127#define EF_R5 MIPS32_EF_R5
128#define EF_R6 MIPS32_EF_R6
129#define EF_R7 MIPS32_EF_R7
130#define EF_R8 MIPS32_EF_R8
131#define EF_R9 MIPS32_EF_R9
132#define EF_R10 MIPS32_EF_R10
133#define EF_R11 MIPS32_EF_R11
134#define EF_R12 MIPS32_EF_R12
135#define EF_R13 MIPS32_EF_R13
136#define EF_R14 MIPS32_EF_R14
137#define EF_R15 MIPS32_EF_R15
138#define EF_R16 MIPS32_EF_R16
139#define EF_R17 MIPS32_EF_R17
140#define EF_R18 MIPS32_EF_R18
141#define EF_R19 MIPS32_EF_R19
142#define EF_R20 MIPS32_EF_R20
143#define EF_R21 MIPS32_EF_R21
144#define EF_R22 MIPS32_EF_R22
145#define EF_R23 MIPS32_EF_R23
146#define EF_R24 MIPS32_EF_R24
147#define EF_R25 MIPS32_EF_R25
148#define EF_R26 MIPS32_EF_R26
149#define EF_R27 MIPS32_EF_R27
150#define EF_R28 MIPS32_EF_R28
151#define EF_R29 MIPS32_EF_R29
152#define EF_R30 MIPS32_EF_R30
153#define EF_R31 MIPS32_EF_R31
154#define EF_LO MIPS32_EF_LO
155#define EF_HI MIPS32_EF_HI
156#define EF_CP0_EPC MIPS32_EF_CP0_EPC
157#define EF_CP0_BADVADDR MIPS32_EF_CP0_BADVADDR
158#define EF_CP0_STATUS MIPS32_EF_CP0_STATUS
159#define EF_CP0_CAUSE MIPS32_EF_CP0_CAUSE
160#define EF_UNUSED0 MIPS32_EF_UNUSED0
161#define EF_SIZE MIPS32_EF_SIZE
162
163#elif _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
164
165#define EF_R0 MIPS64_EF_R0
166#define EF_R1 MIPS64_EF_R1
167#define EF_R2 MIPS64_EF_R2
168#define EF_R3 MIPS64_EF_R3
169#define EF_R4 MIPS64_EF_R4
170#define EF_R5 MIPS64_EF_R5
171#define EF_R6 MIPS64_EF_R6
172#define EF_R7 MIPS64_EF_R7
173#define EF_R8 MIPS64_EF_R8
174#define EF_R9 MIPS64_EF_R9
175#define EF_R10 MIPS64_EF_R10
176#define EF_R11 MIPS64_EF_R11
177#define EF_R12 MIPS64_EF_R12
178#define EF_R13 MIPS64_EF_R13
179#define EF_R14 MIPS64_EF_R14
180#define EF_R15 MIPS64_EF_R15
181#define EF_R16 MIPS64_EF_R16
182#define EF_R17 MIPS64_EF_R17
183#define EF_R18 MIPS64_EF_R18
184#define EF_R19 MIPS64_EF_R19
185#define EF_R20 MIPS64_EF_R20
186#define EF_R21 MIPS64_EF_R21
187#define EF_R22 MIPS64_EF_R22
188#define EF_R23 MIPS64_EF_R23
189#define EF_R24 MIPS64_EF_R24
190#define EF_R25 MIPS64_EF_R25
191#define EF_R26 MIPS64_EF_R26
192#define EF_R27 MIPS64_EF_R27
193#define EF_R28 MIPS64_EF_R28
194#define EF_R29 MIPS64_EF_R29
195#define EF_R30 MIPS64_EF_R30
196#define EF_R31 MIPS64_EF_R31
197#define EF_LO MIPS64_EF_LO
198#define EF_HI MIPS64_EF_HI
199#define EF_CP0_EPC MIPS64_EF_CP0_EPC
200#define EF_CP0_BADVADDR MIPS64_EF_CP0_BADVADDR
201#define EF_CP0_STATUS MIPS64_EF_CP0_STATUS
202#define EF_CP0_CAUSE MIPS64_EF_CP0_CAUSE
203#define EF_SIZE MIPS64_EF_SIZE
204
205#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
206
207#endif /* __UAPI_ASM_MIPS_REG_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/sembuf.h+4-2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef _ASM_SEMBUF_H2#ifndef _ASM_SEMBUF_H
3#define _ASM_SEMBUF_H3#define _ASM_SEMBUF_H
44
5#include <asm/ipcbuf.h>
6
5/*7/*
6 * The semid64_ds structure for the MIPS architecture.8 * The semid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth9 * Note extra padding because this structure is passed back and forth
...@@ -14,8 +16,8 @@...@@ -14,8 +16,8 @@
14#ifdef __mips6416#ifdef __mips64
15struct semid64_ds {17struct semid64_ds {
16 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */18 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
17 __kernel_time_t sem_otime; /* last semop time */19 long sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */20 long sem_ctime; /* last change time */
19 unsigned long sem_nsems; /* no. of semaphores in array */21 unsigned long sem_nsems; /* no. of semaphores in array */
20 unsigned long __unused1;22 unsigned long __unused1;
21 unsigned long __unused2;23 unsigned long __unused2;
lib/libc/include/mips-linux-any/asm/sgidefs.h created+37
...@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 1999, 2001 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
11#ifndef __ASM_SGIDEFS_H
12#define __ASM_SGIDEFS_H
13
14/*
15 * Definitions for the ISA levels
16 *
17 * With the introduction of MIPS32 / MIPS64 instruction sets definitions
18 * MIPS ISAs are no longer subsets of each other. Therefore comparisons
19 * on these symbols except with == may result in unexpected results and
20 * are forbidden!
21 */
22#define _MIPS_ISA_MIPS1 1
23#define _MIPS_ISA_MIPS2 2
24#define _MIPS_ISA_MIPS3 3
25#define _MIPS_ISA_MIPS4 4
26#define _MIPS_ISA_MIPS5 5
27#define _MIPS_ISA_MIPS32 6
28#define _MIPS_ISA_MIPS64 7
29
30/*
31 * Subprogram calling convention
32 */
33#define _MIPS_SIM_ABI32 1
34#define _MIPS_SIM_NABI32 2
35#define _MIPS_SIM_ABI64 3
36
37#endif /* __ASM_SGIDEFS_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/shmbuf.h+3-3
...@@ -17,9 +17,9 @@...@@ -17,9 +17,9 @@
17struct shmid64_ds {17struct shmid64_ds {
18 struct ipc64_perm shm_perm; /* operation perms */18 struct ipc64_perm shm_perm; /* operation perms */
19 size_t shm_segsz; /* size of segment (bytes) */19 size_t shm_segsz; /* size of segment (bytes) */
20 __kernel_time_t shm_atime; /* last attach time */20 long shm_atime; /* last attach time */
21 __kernel_time_t shm_dtime; /* last detach time */21 long shm_dtime; /* last detach time */
22 __kernel_time_t shm_ctime; /* last change time */22 long shm_ctime; /* last change time */
23 __kernel_pid_t shm_cpid; /* pid of creator */23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */25 unsigned long shm_nattch; /* no. of current attaches */
lib/libc/include/mips-linux-any/asm/siginfo.h-13
...@@ -10,20 +10,7 @@...@@ -10,20 +10,7 @@
10#ifndef _ASM_SIGINFO_H10#ifndef _ASM_SIGINFO_H
11#define _ASM_SIGINFO_H11#define _ASM_SIGINFO_H
1212
13
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
16
17/*
18 * Careful to keep union _sifields from shifting ...
19 */
20#if _MIPS_SZLONG == 32
21#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
22#elif _MIPS_SZLONG == 64
23#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
24#else
25#error _MIPS_SZLONG neither 32 nor 64
26#endif
2714
28#define __ARCH_HAS_SWAPPED_SIGINFO15#define __ARCH_HAS_SWAPPED_SIGINFO
2916
lib/libc/include/mips-linux-any/asm/signal.h-12
...@@ -62,18 +62,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */...@@ -62,18 +62,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
62#define SIGRTMAX _NSIG62#define SIGRTMAX _NSIG
6363
64/*64/*
65 * SA_FLAGS values:
66 *
67 * SA_ONSTACK indicates that a registered stack_t will be used.
68 * SA_RESTART flag to get restarting signals (which were the default long ago)
69 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
70 * SA_RESETHAND clears the handler when the signal is delivered.
71 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
72 * SA_NODEFER prevents the current signal from being masked in the handler.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 *
77 * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever65 * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
78 * supported its use and no libc was using it, so the entire sa-restorer66 * supported its use and no libc was using it, so the entire sa-restorer
79 * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.4867 * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
lib/libc/include/mips-linux-any/asm/socket.h+49-9
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#ifndef _ASM_SOCKET_H10#ifndef _ASM_SOCKET_H
11#define _ASM_SOCKET_H11#define _ASM_SOCKET_H
1212
13#include <linux/posix_types.h>
13#include <asm/sockios.h>14#include <asm/sockios.h>
1415
15/*16/*
...@@ -38,8 +39,8 @@...@@ -38,8 +39,8 @@
38#define SO_RCVBUF 0x1002 /* Receive buffer. */39#define SO_RCVBUF 0x1002 /* Receive buffer. */
39#define SO_SNDLOWAT 0x1003 /* send low-water mark */40#define SO_SNDLOWAT 0x1003 /* send low-water mark */
40#define SO_RCVLOWAT 0x1004 /* receive low-water mark */41#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
41#define SO_SNDTIMEO 0x1005 /* send timeout */42#define SO_SNDTIMEO_OLD 0x1005 /* send timeout */
42#define SO_RCVTIMEO 0x1006 /* receive timeout */43#define SO_RCVTIMEO_OLD 0x1006 /* receive timeout */
43#define SO_ACCEPTCONN 0x100944#define SO_ACCEPTCONN 0x1009
44#define SO_PROTOCOL 0x1028 /* protocol type */45#define SO_PROTOCOL 0x1028 /* protocol type */
45#define SO_DOMAIN 0x1029 /* domain/socket family */46#define SO_DOMAIN 0x1029 /* domain/socket family */
...@@ -65,21 +66,14 @@...@@ -65,21 +66,14 @@
65#define SO_GET_FILTER SO_ATTACH_FILTER66#define SO_GET_FILTER SO_ATTACH_FILTER
6667
67#define SO_PEERNAME 2868#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
7069
71#define SO_PEERSEC 3070#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 3171#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 3372#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 3473#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
7774
78#define SO_MARK 3675#define SO_MARK 36
7976
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 4077#define SO_RXQ_OVFL 40
8478
85#define SO_WIFI_STATUS 4179#define SO_WIFI_STATUS 41
...@@ -126,4 +120,50 @@...@@ -126,4 +120,50 @@
126#define SO_TXTIME 61120#define SO_TXTIME 61
127#define SCM_TXTIME SO_TXTIME121#define SCM_TXTIME SO_TXTIME
128122
123#define SO_BINDTOIFINDEX 62
124
125#define SO_TIMESTAMP_OLD 29
126#define SO_TIMESTAMPNS_OLD 35
127#define SO_TIMESTAMPING_OLD 37
128
129#define SO_TIMESTAMP_NEW 63
130#define SO_TIMESTAMPNS_NEW 64
131#define SO_TIMESTAMPING_NEW 65
132
133#define SO_RCVTIMEO_NEW 66
134#define SO_SNDTIMEO_NEW 67
135
136#define SO_DETACH_REUSEPORT_BPF 68
137
138#define SO_PREFER_BUSY_POLL 69
139#define SO_BUSY_POLL_BUDGET 70
140
141#define SO_NETNS_COOKIE 71
142
143#define SO_BUF_LOCK 72
144
145#define SO_RESERVE_MEM 73
146
147
148#if __BITS_PER_LONG == 64
149#define SO_TIMESTAMP SO_TIMESTAMP_OLD
150#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
151#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
152
153#define SO_RCVTIMEO SO_RCVTIMEO_OLD
154#define SO_SNDTIMEO SO_SNDTIMEO_OLD
155#else
156#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
157#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
158#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
159
160#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
161#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
162#endif
163
164#define SCM_TIMESTAMP SO_TIMESTAMP
165#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
166#define SCM_TIMESTAMPING SO_TIMESTAMPING
167
168
129#endif /* _ASM_SOCKET_H */169#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/sockios.h+2-2
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21#define SIOCSPGRP _IOW('s', 8, pid_t)21#define SIOCSPGRP _IOW('s', 8, pid_t)
22#define SIOCGPGRP _IOR('s', 9, pid_t)22#define SIOCGPGRP _IOR('s', 9, pid_t)
2323
24#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */24#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
25#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */25#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
2626
27#endif /* _ASM_SOCKIOS_H */27#endif /* _ASM_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/stat.h+8-8
...@@ -26,17 +26,17 @@ struct stat {...@@ -26,17 +26,17 @@ struct stat {
26 gid_t st_gid;26 gid_t st_gid;
27 unsigned st_rdev;27 unsigned st_rdev;
28 long st_pad2[2];28 long st_pad2[2];
29 off_t st_size;29 long st_size;
30 long st_pad3;30 long st_pad3;
31 /*31 /*
32 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime32 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
33 * but we don't have it under Linux.33 * but we don't have it under Linux.
34 */34 */
35 time_t st_atime;35 long st_atime;
36 long st_atime_nsec;36 long st_atime_nsec;
37 time_t st_mtime;37 long st_mtime;
38 long st_mtime_nsec;38 long st_mtime_nsec;
39 time_t st_ctime;39 long st_ctime;
40 long st_ctime_nsec;40 long st_ctime_nsec;
41 long st_blksize;41 long st_blksize;
42 long st_blocks;42 long st_blocks;
...@@ -70,13 +70,13 @@ struct stat64 {...@@ -70,13 +70,13 @@ struct stat64 {
70 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime70 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
71 * but we don't have it under Linux.71 * but we don't have it under Linux.
72 */72 */
73 time_t st_atime;73 long st_atime;
74 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */74 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
7575
76 time_t st_mtime;76 long st_mtime;
77 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */77 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
7878
79 time_t st_ctime;79 long st_ctime;
80 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */80 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
8181
82 unsigned long st_blksize;82 unsigned long st_blksize;
...@@ -105,7 +105,7 @@ struct stat {...@@ -105,7 +105,7 @@ struct stat {
105 unsigned int st_rdev;105 unsigned int st_rdev;
106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
107107
108 off_t st_size;108 long st_size;
109109
110 /*110 /*
111 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime111 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
lib/libc/include/mips-linux-any/asm/sysmips.h created+26
...@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Definitions for the MIPS sysmips(2) call
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995 by Ralf Baechle
10 */
11#ifndef _ASM_SYSMIPS_H
12#define _ASM_SYSMIPS_H
13
14/*
15 * Commands for the sysmips(2) call
16 *
17 * sysmips(2) is deprecated - though some existing software uses it.
18 * We only support the following commands.
19 */
20#define SETNAME 1 /* set hostname */
21#define FLUSH_CACHE 3 /* writeback and invalidate caches */
22#define MIPS_FIXADE 7 /* control address error fixing */
23#define MIPS_RDNVRAM 10 /* read NVRAM */
24#define MIPS_ATOMIC_SET 2001 /* atomically set variable */
25
26#endif /* _ASM_SYSMIPS_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/ucontext.h created+66
...@@ -0,0 +1,66 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __MIPS_UAPI_ASM_UCONTEXT_H
3#define __MIPS_UAPI_ASM_UCONTEXT_H
4
5/**
6 * struct extcontext - extended context header structure
7 * @magic: magic value identifying the type of extended context
8 * @size: the size in bytes of the enclosing structure
9 *
10 * Extended context structures provide context which does not fit within struct
11 * sigcontext. They are placed sequentially in memory at the end of struct
12 * ucontext and struct sigframe, with each extended context structure beginning
13 * with a header defined by this struct. The type of context represented is
14 * indicated by the magic field. Userland may check each extended context
15 * structure against magic values that it recognises. The size field allows any
16 * unrecognised context to be skipped, allowing for future expansion. The end
17 * of the extended context data is indicated by the magic value
18 * END_EXTCONTEXT_MAGIC.
19 */
20struct extcontext {
21 unsigned int magic;
22 unsigned int size;
23};
24
25/**
26 * struct msa_extcontext - MSA extended context structure
27 * @ext: the extended context header, with magic == MSA_EXTCONTEXT_MAGIC
28 * @wr: the most significant 64 bits of each MSA vector register
29 * @csr: the value of the MSA control & status register
30 *
31 * If MSA context is live for a task at the time a signal is delivered to it,
32 * this structure will hold the MSA context of the task as it was prior to the
33 * signal delivery.
34 */
35struct msa_extcontext {
36 struct extcontext ext;
37#define MSA_EXTCONTEXT_MAGIC 0x784d5341 /* xMSA */
38
39 unsigned long long wr[32];
40 unsigned int csr;
41};
42
43#define END_EXTCONTEXT_MAGIC 0x78454e44 /* xEND */
44
45/**
46 * struct ucontext - user context structure
47 * @uc_flags:
48 * @uc_link:
49 * @uc_stack:
50 * @uc_mcontext: holds basic processor state
51 * @uc_sigmask:
52 * @uc_extcontext: holds extended processor state
53 */
54struct ucontext {
55 /* Historic fields matching asm-generic */
56 unsigned long uc_flags;
57 struct ucontext *uc_link;
58 stack_t uc_stack;
59 struct sigcontext uc_mcontext;
60 sigset_t uc_sigmask;
61
62 /* Extended context structures may follow ucontext */
63 unsigned long long uc_extcontext[0];
64};
65
66#endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd.h+6-1068
...@@ -17,1085 +17,23 @@...@@ -17,1085 +17,23 @@
1717
18#if _MIPS_SIM == _MIPS_SIM_ABI3218#if _MIPS_SIM == _MIPS_SIM_ABI32
1919
20/*20#define __NR_Linux 4000
21 * Linux o32 style syscalls are in the range from 4000 to 4999.21#include <asm/unistd_o32.h>
22 */
23#define __NR_Linux 4000
24#define __NR_syscall (__NR_Linux + 0)
25#define __NR_exit (__NR_Linux + 1)
26#define __NR_fork (__NR_Linux + 2)
27#define __NR_read (__NR_Linux + 3)
28#define __NR_write (__NR_Linux + 4)
29#define __NR_open (__NR_Linux + 5)
30#define __NR_close (__NR_Linux + 6)
31#define __NR_waitpid (__NR_Linux + 7)
32#define __NR_creat (__NR_Linux + 8)
33#define __NR_link (__NR_Linux + 9)
34#define __NR_unlink (__NR_Linux + 10)
35#define __NR_execve (__NR_Linux + 11)
36#define __NR_chdir (__NR_Linux + 12)
37#define __NR_time (__NR_Linux + 13)
38#define __NR_mknod (__NR_Linux + 14)
39#define __NR_chmod (__NR_Linux + 15)
40#define __NR_lchown (__NR_Linux + 16)
41#define __NR_break (__NR_Linux + 17)
42#define __NR_unused18 (__NR_Linux + 18)
43#define __NR_lseek (__NR_Linux + 19)
44#define __NR_getpid (__NR_Linux + 20)
45#define __NR_mount (__NR_Linux + 21)
46#define __NR_umount (__NR_Linux + 22)
47#define __NR_setuid (__NR_Linux + 23)
48#define __NR_getuid (__NR_Linux + 24)
49#define __NR_stime (__NR_Linux + 25)
50#define __NR_ptrace (__NR_Linux + 26)
51#define __NR_alarm (__NR_Linux + 27)
52#define __NR_unused28 (__NR_Linux + 28)
53#define __NR_pause (__NR_Linux + 29)
54#define __NR_utime (__NR_Linux + 30)
55#define __NR_stty (__NR_Linux + 31)
56#define __NR_gtty (__NR_Linux + 32)
57#define __NR_access (__NR_Linux + 33)
58#define __NR_nice (__NR_Linux + 34)
59#define __NR_ftime (__NR_Linux + 35)
60#define __NR_sync (__NR_Linux + 36)
61#define __NR_kill (__NR_Linux + 37)
62#define __NR_rename (__NR_Linux + 38)
63#define __NR_mkdir (__NR_Linux + 39)
64#define __NR_rmdir (__NR_Linux + 40)
65#define __NR_dup (__NR_Linux + 41)
66#define __NR_pipe (__NR_Linux + 42)
67#define __NR_times (__NR_Linux + 43)
68#define __NR_prof (__NR_Linux + 44)
69#define __NR_brk (__NR_Linux + 45)
70#define __NR_setgid (__NR_Linux + 46)
71#define __NR_getgid (__NR_Linux + 47)
72#define __NR_signal (__NR_Linux + 48)
73#define __NR_geteuid (__NR_Linux + 49)
74#define __NR_getegid (__NR_Linux + 50)
75#define __NR_acct (__NR_Linux + 51)
76#define __NR_umount2 (__NR_Linux + 52)
77#define __NR_lock (__NR_Linux + 53)
78#define __NR_ioctl (__NR_Linux + 54)
79#define __NR_fcntl (__NR_Linux + 55)
80#define __NR_mpx (__NR_Linux + 56)
81#define __NR_setpgid (__NR_Linux + 57)
82#define __NR_ulimit (__NR_Linux + 58)
83#define __NR_unused59 (__NR_Linux + 59)
84#define __NR_umask (__NR_Linux + 60)
85#define __NR_chroot (__NR_Linux + 61)
86#define __NR_ustat (__NR_Linux + 62)
87#define __NR_dup2 (__NR_Linux + 63)
88#define __NR_getppid (__NR_Linux + 64)
89#define __NR_getpgrp (__NR_Linux + 65)
90#define __NR_setsid (__NR_Linux + 66)
91#define __NR_sigaction (__NR_Linux + 67)
92#define __NR_sgetmask (__NR_Linux + 68)
93#define __NR_ssetmask (__NR_Linux + 69)
94#define __NR_setreuid (__NR_Linux + 70)
95#define __NR_setregid (__NR_Linux + 71)
96#define __NR_sigsuspend (__NR_Linux + 72)
97#define __NR_sigpending (__NR_Linux + 73)
98#define __NR_sethostname (__NR_Linux + 74)
99#define __NR_setrlimit (__NR_Linux + 75)
100#define __NR_getrlimit (__NR_Linux + 76)
101#define __NR_getrusage (__NR_Linux + 77)
102#define __NR_gettimeofday (__NR_Linux + 78)
103#define __NR_settimeofday (__NR_Linux + 79)
104#define __NR_getgroups (__NR_Linux + 80)
105#define __NR_setgroups (__NR_Linux + 81)
106#define __NR_reserved82 (__NR_Linux + 82)
107#define __NR_symlink (__NR_Linux + 83)
108#define __NR_unused84 (__NR_Linux + 84)
109#define __NR_readlink (__NR_Linux + 85)
110#define __NR_uselib (__NR_Linux + 86)
111#define __NR_swapon (__NR_Linux + 87)
112#define __NR_reboot (__NR_Linux + 88)
113#define __NR_readdir (__NR_Linux + 89)
114#define __NR_mmap (__NR_Linux + 90)
115#define __NR_munmap (__NR_Linux + 91)
116#define __NR_truncate (__NR_Linux + 92)
117#define __NR_ftruncate (__NR_Linux + 93)
118#define __NR_fchmod (__NR_Linux + 94)
119#define __NR_fchown (__NR_Linux + 95)
120#define __NR_getpriority (__NR_Linux + 96)
121#define __NR_setpriority (__NR_Linux + 97)
122#define __NR_profil (__NR_Linux + 98)
123#define __NR_statfs (__NR_Linux + 99)
124#define __NR_fstatfs (__NR_Linux + 100)
125#define __NR_ioperm (__NR_Linux + 101)
126#define __NR_socketcall (__NR_Linux + 102)
127#define __NR_syslog (__NR_Linux + 103)
128#define __NR_setitimer (__NR_Linux + 104)
129#define __NR_getitimer (__NR_Linux + 105)
130#define __NR_stat (__NR_Linux + 106)
131#define __NR_lstat (__NR_Linux + 107)
132#define __NR_fstat (__NR_Linux + 108)
133#define __NR_unused109 (__NR_Linux + 109)
134#define __NR_iopl (__NR_Linux + 110)
135#define __NR_vhangup (__NR_Linux + 111)
136#define __NR_idle (__NR_Linux + 112)
137#define __NR_vm86 (__NR_Linux + 113)
138#define __NR_wait4 (__NR_Linux + 114)
139#define __NR_swapoff (__NR_Linux + 115)
140#define __NR_sysinfo (__NR_Linux + 116)
141#define __NR_ipc (__NR_Linux + 117)
142#define __NR_fsync (__NR_Linux + 118)
143#define __NR_sigreturn (__NR_Linux + 119)
144#define __NR_clone (__NR_Linux + 120)
145#define __NR_setdomainname (__NR_Linux + 121)
146#define __NR_uname (__NR_Linux + 122)
147#define __NR_modify_ldt (__NR_Linux + 123)
148#define __NR_adjtimex (__NR_Linux + 124)
149#define __NR_mprotect (__NR_Linux + 125)
150#define __NR_sigprocmask (__NR_Linux + 126)
151#define __NR_create_module (__NR_Linux + 127)
152#define __NR_init_module (__NR_Linux + 128)
153#define __NR_delete_module (__NR_Linux + 129)
154#define __NR_get_kernel_syms (__NR_Linux + 130)
155#define __NR_quotactl (__NR_Linux + 131)
156#define __NR_getpgid (__NR_Linux + 132)
157#define __NR_fchdir (__NR_Linux + 133)
158#define __NR_bdflush (__NR_Linux + 134)
159#define __NR_sysfs (__NR_Linux + 135)
160#define __NR_personality (__NR_Linux + 136)
161#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
162#define __NR_setfsuid (__NR_Linux + 138)
163#define __NR_setfsgid (__NR_Linux + 139)
164#define __NR__llseek (__NR_Linux + 140)
165#define __NR_getdents (__NR_Linux + 141)
166#define __NR__newselect (__NR_Linux + 142)
167#define __NR_flock (__NR_Linux + 143)
168#define __NR_msync (__NR_Linux + 144)
169#define __NR_readv (__NR_Linux + 145)
170#define __NR_writev (__NR_Linux + 146)
171#define __NR_cacheflush (__NR_Linux + 147)
172#define __NR_cachectl (__NR_Linux + 148)
173#define __NR_sysmips (__NR_Linux + 149)
174#define __NR_unused150 (__NR_Linux + 150)
175#define __NR_getsid (__NR_Linux + 151)
176#define __NR_fdatasync (__NR_Linux + 152)
177#define __NR__sysctl (__NR_Linux + 153)
178#define __NR_mlock (__NR_Linux + 154)
179#define __NR_munlock (__NR_Linux + 155)
180#define __NR_mlockall (__NR_Linux + 156)
181#define __NR_munlockall (__NR_Linux + 157)
182#define __NR_sched_setparam (__NR_Linux + 158)
183#define __NR_sched_getparam (__NR_Linux + 159)
184#define __NR_sched_setscheduler (__NR_Linux + 160)
185#define __NR_sched_getscheduler (__NR_Linux + 161)
186#define __NR_sched_yield (__NR_Linux + 162)
187#define __NR_sched_get_priority_max (__NR_Linux + 163)
188#define __NR_sched_get_priority_min (__NR_Linux + 164)
189#define __NR_sched_rr_get_interval (__NR_Linux + 165)
190#define __NR_nanosleep (__NR_Linux + 166)
191#define __NR_mremap (__NR_Linux + 167)
192#define __NR_accept (__NR_Linux + 168)
193#define __NR_bind (__NR_Linux + 169)
194#define __NR_connect (__NR_Linux + 170)
195#define __NR_getpeername (__NR_Linux + 171)
196#define __NR_getsockname (__NR_Linux + 172)
197#define __NR_getsockopt (__NR_Linux + 173)
198#define __NR_listen (__NR_Linux + 174)
199#define __NR_recv (__NR_Linux + 175)
200#define __NR_recvfrom (__NR_Linux + 176)
201#define __NR_recvmsg (__NR_Linux + 177)
202#define __NR_send (__NR_Linux + 178)
203#define __NR_sendmsg (__NR_Linux + 179)
204#define __NR_sendto (__NR_Linux + 180)
205#define __NR_setsockopt (__NR_Linux + 181)
206#define __NR_shutdown (__NR_Linux + 182)
207#define __NR_socket (__NR_Linux + 183)
208#define __NR_socketpair (__NR_Linux + 184)
209#define __NR_setresuid (__NR_Linux + 185)
210#define __NR_getresuid (__NR_Linux + 186)
211#define __NR_query_module (__NR_Linux + 187)
212#define __NR_poll (__NR_Linux + 188)
213#define __NR_nfsservctl (__NR_Linux + 189)
214#define __NR_setresgid (__NR_Linux + 190)
215#define __NR_getresgid (__NR_Linux + 191)
216#define __NR_prctl (__NR_Linux + 192)
217#define __NR_rt_sigreturn (__NR_Linux + 193)
218#define __NR_rt_sigaction (__NR_Linux + 194)
219#define __NR_rt_sigprocmask (__NR_Linux + 195)
220#define __NR_rt_sigpending (__NR_Linux + 196)
221#define __NR_rt_sigtimedwait (__NR_Linux + 197)
222#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
223#define __NR_rt_sigsuspend (__NR_Linux + 199)
224#define __NR_pread64 (__NR_Linux + 200)
225#define __NR_pwrite64 (__NR_Linux + 201)
226#define __NR_chown (__NR_Linux + 202)
227#define __NR_getcwd (__NR_Linux + 203)
228#define __NR_capget (__NR_Linux + 204)
229#define __NR_capset (__NR_Linux + 205)
230#define __NR_sigaltstack (__NR_Linux + 206)
231#define __NR_sendfile (__NR_Linux + 207)
232#define __NR_getpmsg (__NR_Linux + 208)
233#define __NR_putpmsg (__NR_Linux + 209)
234#define __NR_mmap2 (__NR_Linux + 210)
235#define __NR_truncate64 (__NR_Linux + 211)
236#define __NR_ftruncate64 (__NR_Linux + 212)
237#define __NR_stat64 (__NR_Linux + 213)
238#define __NR_lstat64 (__NR_Linux + 214)
239#define __NR_fstat64 (__NR_Linux + 215)
240#define __NR_pivot_root (__NR_Linux + 216)
241#define __NR_mincore (__NR_Linux + 217)
242#define __NR_madvise (__NR_Linux + 218)
243#define __NR_getdents64 (__NR_Linux + 219)
244#define __NR_fcntl64 (__NR_Linux + 220)
245#define __NR_reserved221 (__NR_Linux + 221)
246#define __NR_gettid (__NR_Linux + 222)
247#define __NR_readahead (__NR_Linux + 223)
248#define __NR_setxattr (__NR_Linux + 224)
249#define __NR_lsetxattr (__NR_Linux + 225)
250#define __NR_fsetxattr (__NR_Linux + 226)
251#define __NR_getxattr (__NR_Linux + 227)
252#define __NR_lgetxattr (__NR_Linux + 228)
253#define __NR_fgetxattr (__NR_Linux + 229)
254#define __NR_listxattr (__NR_Linux + 230)
255#define __NR_llistxattr (__NR_Linux + 231)
256#define __NR_flistxattr (__NR_Linux + 232)
257#define __NR_removexattr (__NR_Linux + 233)
258#define __NR_lremovexattr (__NR_Linux + 234)
259#define __NR_fremovexattr (__NR_Linux + 235)
260#define __NR_tkill (__NR_Linux + 236)
261#define __NR_sendfile64 (__NR_Linux + 237)
262#define __NR_futex (__NR_Linux + 238)
263#define __NR_sched_setaffinity (__NR_Linux + 239)
264#define __NR_sched_getaffinity (__NR_Linux + 240)
265#define __NR_io_setup (__NR_Linux + 241)
266#define __NR_io_destroy (__NR_Linux + 242)
267#define __NR_io_getevents (__NR_Linux + 243)
268#define __NR_io_submit (__NR_Linux + 244)
269#define __NR_io_cancel (__NR_Linux + 245)
270#define __NR_exit_group (__NR_Linux + 246)
271#define __NR_lookup_dcookie (__NR_Linux + 247)
272#define __NR_epoll_create (__NR_Linux + 248)
273#define __NR_epoll_ctl (__NR_Linux + 249)
274#define __NR_epoll_wait (__NR_Linux + 250)
275#define __NR_remap_file_pages (__NR_Linux + 251)
276#define __NR_set_tid_address (__NR_Linux + 252)
277#define __NR_restart_syscall (__NR_Linux + 253)
278#define __NR_fadvise64 (__NR_Linux + 254)
279#define __NR_statfs64 (__NR_Linux + 255)
280#define __NR_fstatfs64 (__NR_Linux + 256)
281#define __NR_timer_create (__NR_Linux + 257)
282#define __NR_timer_settime (__NR_Linux + 258)
283#define __NR_timer_gettime (__NR_Linux + 259)
284#define __NR_timer_getoverrun (__NR_Linux + 260)
285#define __NR_timer_delete (__NR_Linux + 261)
286#define __NR_clock_settime (__NR_Linux + 262)
287#define __NR_clock_gettime (__NR_Linux + 263)
288#define __NR_clock_getres (__NR_Linux + 264)
289#define __NR_clock_nanosleep (__NR_Linux + 265)
290#define __NR_tgkill (__NR_Linux + 266)
291#define __NR_utimes (__NR_Linux + 267)
292#define __NR_mbind (__NR_Linux + 268)
293#define __NR_get_mempolicy (__NR_Linux + 269)
294#define __NR_set_mempolicy (__NR_Linux + 270)
295#define __NR_mq_open (__NR_Linux + 271)
296#define __NR_mq_unlink (__NR_Linux + 272)
297#define __NR_mq_timedsend (__NR_Linux + 273)
298#define __NR_mq_timedreceive (__NR_Linux + 274)
299#define __NR_mq_notify (__NR_Linux + 275)
300#define __NR_mq_getsetattr (__NR_Linux + 276)
301#define __NR_vserver (__NR_Linux + 277)
302#define __NR_waitid (__NR_Linux + 278)
303/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
304#define __NR_add_key (__NR_Linux + 280)
305#define __NR_request_key (__NR_Linux + 281)
306#define __NR_keyctl (__NR_Linux + 282)
307#define __NR_set_thread_area (__NR_Linux + 283)
308#define __NR_inotify_init (__NR_Linux + 284)
309#define __NR_inotify_add_watch (__NR_Linux + 285)
310#define __NR_inotify_rm_watch (__NR_Linux + 286)
311#define __NR_migrate_pages (__NR_Linux + 287)
312#define __NR_openat (__NR_Linux + 288)
313#define __NR_mkdirat (__NR_Linux + 289)
314#define __NR_mknodat (__NR_Linux + 290)
315#define __NR_fchownat (__NR_Linux + 291)
316#define __NR_futimesat (__NR_Linux + 292)
317#define __NR_fstatat64 (__NR_Linux + 293)
318#define __NR_unlinkat (__NR_Linux + 294)
319#define __NR_renameat (__NR_Linux + 295)
320#define __NR_linkat (__NR_Linux + 296)
321#define __NR_symlinkat (__NR_Linux + 297)
322#define __NR_readlinkat (__NR_Linux + 298)
323#define __NR_fchmodat (__NR_Linux + 299)
324#define __NR_faccessat (__NR_Linux + 300)
325#define __NR_pselect6 (__NR_Linux + 301)
326#define __NR_ppoll (__NR_Linux + 302)
327#define __NR_unshare (__NR_Linux + 303)
328#define __NR_splice (__NR_Linux + 304)
329#define __NR_sync_file_range (__NR_Linux + 305)
330#define __NR_tee (__NR_Linux + 306)
331#define __NR_vmsplice (__NR_Linux + 307)
332#define __NR_move_pages (__NR_Linux + 308)
333#define __NR_set_robust_list (__NR_Linux + 309)
334#define __NR_get_robust_list (__NR_Linux + 310)
335#define __NR_kexec_load (__NR_Linux + 311)
336#define __NR_getcpu (__NR_Linux + 312)
337#define __NR_epoll_pwait (__NR_Linux + 313)
338#define __NR_ioprio_set (__NR_Linux + 314)
339#define __NR_ioprio_get (__NR_Linux + 315)
340#define __NR_utimensat (__NR_Linux + 316)
341#define __NR_signalfd (__NR_Linux + 317)
342#define __NR_timerfd (__NR_Linux + 318)
343#define __NR_eventfd (__NR_Linux + 319)
344#define __NR_fallocate (__NR_Linux + 320)
345#define __NR_timerfd_create (__NR_Linux + 321)
346#define __NR_timerfd_gettime (__NR_Linux + 322)
347#define __NR_timerfd_settime (__NR_Linux + 323)
348#define __NR_signalfd4 (__NR_Linux + 324)
349#define __NR_eventfd2 (__NR_Linux + 325)
350#define __NR_epoll_create1 (__NR_Linux + 326)
351#define __NR_dup3 (__NR_Linux + 327)
352#define __NR_pipe2 (__NR_Linux + 328)
353#define __NR_inotify_init1 (__NR_Linux + 329)
354#define __NR_preadv (__NR_Linux + 330)
355#define __NR_pwritev (__NR_Linux + 331)
356#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
357#define __NR_perf_event_open (__NR_Linux + 333)
358#define __NR_accept4 (__NR_Linux + 334)
359#define __NR_recvmmsg (__NR_Linux + 335)
360#define __NR_fanotify_init (__NR_Linux + 336)
361#define __NR_fanotify_mark (__NR_Linux + 337)
362#define __NR_prlimit64 (__NR_Linux + 338)
363#define __NR_name_to_handle_at (__NR_Linux + 339)
364#define __NR_open_by_handle_at (__NR_Linux + 340)
365#define __NR_clock_adjtime (__NR_Linux + 341)
366#define __NR_syncfs (__NR_Linux + 342)
367#define __NR_sendmmsg (__NR_Linux + 343)
368#define __NR_setns (__NR_Linux + 344)
369#define __NR_process_vm_readv (__NR_Linux + 345)
370#define __NR_process_vm_writev (__NR_Linux + 346)
371#define __NR_kcmp (__NR_Linux + 347)
372#define __NR_finit_module (__NR_Linux + 348)
373#define __NR_sched_setattr (__NR_Linux + 349)
374#define __NR_sched_getattr (__NR_Linux + 350)
375#define __NR_renameat2 (__NR_Linux + 351)
376#define __NR_seccomp (__NR_Linux + 352)
377#define __NR_getrandom (__NR_Linux + 353)
378#define __NR_memfd_create (__NR_Linux + 354)
379#define __NR_bpf (__NR_Linux + 355)
380#define __NR_execveat (__NR_Linux + 356)
381#define __NR_userfaultfd (__NR_Linux + 357)
382#define __NR_membarrier (__NR_Linux + 358)
383#define __NR_mlock2 (__NR_Linux + 359)
384#define __NR_copy_file_range (__NR_Linux + 360)
385#define __NR_preadv2 (__NR_Linux + 361)
386#define __NR_pwritev2 (__NR_Linux + 362)
387#define __NR_pkey_mprotect (__NR_Linux + 363)
388#define __NR_pkey_alloc (__NR_Linux + 364)
389#define __NR_pkey_free (__NR_Linux + 365)
390#define __NR_statx (__NR_Linux + 366)
391#define __NR_rseq (__NR_Linux + 367)
392#define __NR_io_pgetevents (__NR_Linux + 368)
393
394
395/*
396 * Offset of the last Linux o32 flavoured syscall
397 */
398#define __NR_Linux_syscalls 368
39922
400#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */23#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
40124
402#define __NR_O32_Linux 4000
403#define __NR_O32_Linux_syscalls 368
404
405#if _MIPS_SIM == _MIPS_SIM_ABI6425#if _MIPS_SIM == _MIPS_SIM_ABI64
40626
407/*27#define __NR_Linux 5000
408 * Linux 64-bit syscalls are in the range from 5000 to 5999.28#include <asm/unistd_n64.h>
409 */
410#define __NR_Linux 5000
411#define __NR_read (__NR_Linux + 0)
412#define __NR_write (__NR_Linux + 1)
413#define __NR_open (__NR_Linux + 2)
414#define __NR_close (__NR_Linux + 3)
415#define __NR_stat (__NR_Linux + 4)
416#define __NR_fstat (__NR_Linux + 5)
417#define __NR_lstat (__NR_Linux + 6)
418#define __NR_poll (__NR_Linux + 7)
419#define __NR_lseek (__NR_Linux + 8)
420#define __NR_mmap (__NR_Linux + 9)
421#define __NR_mprotect (__NR_Linux + 10)
422#define __NR_munmap (__NR_Linux + 11)
423#define __NR_brk (__NR_Linux + 12)
424#define __NR_rt_sigaction (__NR_Linux + 13)
425#define __NR_rt_sigprocmask (__NR_Linux + 14)
426#define __NR_ioctl (__NR_Linux + 15)
427#define __NR_pread64 (__NR_Linux + 16)
428#define __NR_pwrite64 (__NR_Linux + 17)
429#define __NR_readv (__NR_Linux + 18)
430#define __NR_writev (__NR_Linux + 19)
431#define __NR_access (__NR_Linux + 20)
432#define __NR_pipe (__NR_Linux + 21)
433#define __NR__newselect (__NR_Linux + 22)
434#define __NR_sched_yield (__NR_Linux + 23)
435#define __NR_mremap (__NR_Linux + 24)
436#define __NR_msync (__NR_Linux + 25)
437#define __NR_mincore (__NR_Linux + 26)
438#define __NR_madvise (__NR_Linux + 27)
439#define __NR_shmget (__NR_Linux + 28)
440#define __NR_shmat (__NR_Linux + 29)
441#define __NR_shmctl (__NR_Linux + 30)
442#define __NR_dup (__NR_Linux + 31)
443#define __NR_dup2 (__NR_Linux + 32)
444#define __NR_pause (__NR_Linux + 33)
445#define __NR_nanosleep (__NR_Linux + 34)
446#define __NR_getitimer (__NR_Linux + 35)
447#define __NR_setitimer (__NR_Linux + 36)
448#define __NR_alarm (__NR_Linux + 37)
449#define __NR_getpid (__NR_Linux + 38)
450#define __NR_sendfile (__NR_Linux + 39)
451#define __NR_socket (__NR_Linux + 40)
452#define __NR_connect (__NR_Linux + 41)
453#define __NR_accept (__NR_Linux + 42)
454#define __NR_sendto (__NR_Linux + 43)
455#define __NR_recvfrom (__NR_Linux + 44)
456#define __NR_sendmsg (__NR_Linux + 45)
457#define __NR_recvmsg (__NR_Linux + 46)
458#define __NR_shutdown (__NR_Linux + 47)
459#define __NR_bind (__NR_Linux + 48)
460#define __NR_listen (__NR_Linux + 49)
461#define __NR_getsockname (__NR_Linux + 50)
462#define __NR_getpeername (__NR_Linux + 51)
463#define __NR_socketpair (__NR_Linux + 52)
464#define __NR_setsockopt (__NR_Linux + 53)
465#define __NR_getsockopt (__NR_Linux + 54)
466#define __NR_clone (__NR_Linux + 55)
467#define __NR_fork (__NR_Linux + 56)
468#define __NR_execve (__NR_Linux + 57)
469#define __NR_exit (__NR_Linux + 58)
470#define __NR_wait4 (__NR_Linux + 59)
471#define __NR_kill (__NR_Linux + 60)
472#define __NR_uname (__NR_Linux + 61)
473#define __NR_semget (__NR_Linux + 62)
474#define __NR_semop (__NR_Linux + 63)
475#define __NR_semctl (__NR_Linux + 64)
476#define __NR_shmdt (__NR_Linux + 65)
477#define __NR_msgget (__NR_Linux + 66)
478#define __NR_msgsnd (__NR_Linux + 67)
479#define __NR_msgrcv (__NR_Linux + 68)
480#define __NR_msgctl (__NR_Linux + 69)
481#define __NR_fcntl (__NR_Linux + 70)
482#define __NR_flock (__NR_Linux + 71)
483#define __NR_fsync (__NR_Linux + 72)
484#define __NR_fdatasync (__NR_Linux + 73)
485#define __NR_truncate (__NR_Linux + 74)
486#define __NR_ftruncate (__NR_Linux + 75)
487#define __NR_getdents (__NR_Linux + 76)
488#define __NR_getcwd (__NR_Linux + 77)
489#define __NR_chdir (__NR_Linux + 78)
490#define __NR_fchdir (__NR_Linux + 79)
491#define __NR_rename (__NR_Linux + 80)
492#define __NR_mkdir (__NR_Linux + 81)
493#define __NR_rmdir (__NR_Linux + 82)
494#define __NR_creat (__NR_Linux + 83)
495#define __NR_link (__NR_Linux + 84)
496#define __NR_unlink (__NR_Linux + 85)
497#define __NR_symlink (__NR_Linux + 86)
498#define __NR_readlink (__NR_Linux + 87)
499#define __NR_chmod (__NR_Linux + 88)
500#define __NR_fchmod (__NR_Linux + 89)
501#define __NR_chown (__NR_Linux + 90)
502#define __NR_fchown (__NR_Linux + 91)
503#define __NR_lchown (__NR_Linux + 92)
504#define __NR_umask (__NR_Linux + 93)
505#define __NR_gettimeofday (__NR_Linux + 94)
506#define __NR_getrlimit (__NR_Linux + 95)
507#define __NR_getrusage (__NR_Linux + 96)
508#define __NR_sysinfo (__NR_Linux + 97)
509#define __NR_times (__NR_Linux + 98)
510#define __NR_ptrace (__NR_Linux + 99)
511#define __NR_getuid (__NR_Linux + 100)
512#define __NR_syslog (__NR_Linux + 101)
513#define __NR_getgid (__NR_Linux + 102)
514#define __NR_setuid (__NR_Linux + 103)
515#define __NR_setgid (__NR_Linux + 104)
516#define __NR_geteuid (__NR_Linux + 105)
517#define __NR_getegid (__NR_Linux + 106)
518#define __NR_setpgid (__NR_Linux + 107)
519#define __NR_getppid (__NR_Linux + 108)
520#define __NR_getpgrp (__NR_Linux + 109)
521#define __NR_setsid (__NR_Linux + 110)
522#define __NR_setreuid (__NR_Linux + 111)
523#define __NR_setregid (__NR_Linux + 112)
524#define __NR_getgroups (__NR_Linux + 113)
525#define __NR_setgroups (__NR_Linux + 114)
526#define __NR_setresuid (__NR_Linux + 115)
527#define __NR_getresuid (__NR_Linux + 116)
528#define __NR_setresgid (__NR_Linux + 117)
529#define __NR_getresgid (__NR_Linux + 118)
530#define __NR_getpgid (__NR_Linux + 119)
531#define __NR_setfsuid (__NR_Linux + 120)
532#define __NR_setfsgid (__NR_Linux + 121)
533#define __NR_getsid (__NR_Linux + 122)
534#define __NR_capget (__NR_Linux + 123)
535#define __NR_capset (__NR_Linux + 124)
536#define __NR_rt_sigpending (__NR_Linux + 125)
537#define __NR_rt_sigtimedwait (__NR_Linux + 126)
538#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
539#define __NR_rt_sigsuspend (__NR_Linux + 128)
540#define __NR_sigaltstack (__NR_Linux + 129)
541#define __NR_utime (__NR_Linux + 130)
542#define __NR_mknod (__NR_Linux + 131)
543#define __NR_personality (__NR_Linux + 132)
544#define __NR_ustat (__NR_Linux + 133)
545#define __NR_statfs (__NR_Linux + 134)
546#define __NR_fstatfs (__NR_Linux + 135)
547#define __NR_sysfs (__NR_Linux + 136)
548#define __NR_getpriority (__NR_Linux + 137)
549#define __NR_setpriority (__NR_Linux + 138)
550#define __NR_sched_setparam (__NR_Linux + 139)
551#define __NR_sched_getparam (__NR_Linux + 140)
552#define __NR_sched_setscheduler (__NR_Linux + 141)
553#define __NR_sched_getscheduler (__NR_Linux + 142)
554#define __NR_sched_get_priority_max (__NR_Linux + 143)
555#define __NR_sched_get_priority_min (__NR_Linux + 144)
556#define __NR_sched_rr_get_interval (__NR_Linux + 145)
557#define __NR_mlock (__NR_Linux + 146)
558#define __NR_munlock (__NR_Linux + 147)
559#define __NR_mlockall (__NR_Linux + 148)
560#define __NR_munlockall (__NR_Linux + 149)
561#define __NR_vhangup (__NR_Linux + 150)
562#define __NR_pivot_root (__NR_Linux + 151)
563#define __NR__sysctl (__NR_Linux + 152)
564#define __NR_prctl (__NR_Linux + 153)
565#define __NR_adjtimex (__NR_Linux + 154)
566#define __NR_setrlimit (__NR_Linux + 155)
567#define __NR_chroot (__NR_Linux + 156)
568#define __NR_sync (__NR_Linux + 157)
569#define __NR_acct (__NR_Linux + 158)
570#define __NR_settimeofday (__NR_Linux + 159)
571#define __NR_mount (__NR_Linux + 160)
572#define __NR_umount2 (__NR_Linux + 161)
573#define __NR_swapon (__NR_Linux + 162)
574#define __NR_swapoff (__NR_Linux + 163)
575#define __NR_reboot (__NR_Linux + 164)
576#define __NR_sethostname (__NR_Linux + 165)
577#define __NR_setdomainname (__NR_Linux + 166)
578#define __NR_create_module (__NR_Linux + 167)
579#define __NR_init_module (__NR_Linux + 168)
580#define __NR_delete_module (__NR_Linux + 169)
581#define __NR_get_kernel_syms (__NR_Linux + 170)
582#define __NR_query_module (__NR_Linux + 171)
583#define __NR_quotactl (__NR_Linux + 172)
584#define __NR_nfsservctl (__NR_Linux + 173)
585#define __NR_getpmsg (__NR_Linux + 174)
586#define __NR_putpmsg (__NR_Linux + 175)
587#define __NR_afs_syscall (__NR_Linux + 176)
588#define __NR_reserved177 (__NR_Linux + 177)
589#define __NR_gettid (__NR_Linux + 178)
590#define __NR_readahead (__NR_Linux + 179)
591#define __NR_setxattr (__NR_Linux + 180)
592#define __NR_lsetxattr (__NR_Linux + 181)
593#define __NR_fsetxattr (__NR_Linux + 182)
594#define __NR_getxattr (__NR_Linux + 183)
595#define __NR_lgetxattr (__NR_Linux + 184)
596#define __NR_fgetxattr (__NR_Linux + 185)
597#define __NR_listxattr (__NR_Linux + 186)
598#define __NR_llistxattr (__NR_Linux + 187)
599#define __NR_flistxattr (__NR_Linux + 188)
600#define __NR_removexattr (__NR_Linux + 189)
601#define __NR_lremovexattr (__NR_Linux + 190)
602#define __NR_fremovexattr (__NR_Linux + 191)
603#define __NR_tkill (__NR_Linux + 192)
604#define __NR_reserved193 (__NR_Linux + 193)
605#define __NR_futex (__NR_Linux + 194)
606#define __NR_sched_setaffinity (__NR_Linux + 195)
607#define __NR_sched_getaffinity (__NR_Linux + 196)
608#define __NR_cacheflush (__NR_Linux + 197)
609#define __NR_cachectl (__NR_Linux + 198)
610#define __NR_sysmips (__NR_Linux + 199)
611#define __NR_io_setup (__NR_Linux + 200)
612#define __NR_io_destroy (__NR_Linux + 201)
613#define __NR_io_getevents (__NR_Linux + 202)
614#define __NR_io_submit (__NR_Linux + 203)
615#define __NR_io_cancel (__NR_Linux + 204)
616#define __NR_exit_group (__NR_Linux + 205)
617#define __NR_lookup_dcookie (__NR_Linux + 206)
618#define __NR_epoll_create (__NR_Linux + 207)
619#define __NR_epoll_ctl (__NR_Linux + 208)
620#define __NR_epoll_wait (__NR_Linux + 209)
621#define __NR_remap_file_pages (__NR_Linux + 210)
622#define __NR_rt_sigreturn (__NR_Linux + 211)
623#define __NR_set_tid_address (__NR_Linux + 212)
624#define __NR_restart_syscall (__NR_Linux + 213)
625#define __NR_semtimedop (__NR_Linux + 214)
626#define __NR_fadvise64 (__NR_Linux + 215)
627#define __NR_timer_create (__NR_Linux + 216)
628#define __NR_timer_settime (__NR_Linux + 217)
629#define __NR_timer_gettime (__NR_Linux + 218)
630#define __NR_timer_getoverrun (__NR_Linux + 219)
631#define __NR_timer_delete (__NR_Linux + 220)
632#define __NR_clock_settime (__NR_Linux + 221)
633#define __NR_clock_gettime (__NR_Linux + 222)
634#define __NR_clock_getres (__NR_Linux + 223)
635#define __NR_clock_nanosleep (__NR_Linux + 224)
636#define __NR_tgkill (__NR_Linux + 225)
637#define __NR_utimes (__NR_Linux + 226)
638#define __NR_mbind (__NR_Linux + 227)
639#define __NR_get_mempolicy (__NR_Linux + 228)
640#define __NR_set_mempolicy (__NR_Linux + 229)
641#define __NR_mq_open (__NR_Linux + 230)
642#define __NR_mq_unlink (__NR_Linux + 231)
643#define __NR_mq_timedsend (__NR_Linux + 232)
644#define __NR_mq_timedreceive (__NR_Linux + 233)
645#define __NR_mq_notify (__NR_Linux + 234)
646#define __NR_mq_getsetattr (__NR_Linux + 235)
647#define __NR_vserver (__NR_Linux + 236)
648#define __NR_waitid (__NR_Linux + 237)
649/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
650#define __NR_add_key (__NR_Linux + 239)
651#define __NR_request_key (__NR_Linux + 240)
652#define __NR_keyctl (__NR_Linux + 241)
653#define __NR_set_thread_area (__NR_Linux + 242)
654#define __NR_inotify_init (__NR_Linux + 243)
655#define __NR_inotify_add_watch (__NR_Linux + 244)
656#define __NR_inotify_rm_watch (__NR_Linux + 245)
657#define __NR_migrate_pages (__NR_Linux + 246)
658#define __NR_openat (__NR_Linux + 247)
659#define __NR_mkdirat (__NR_Linux + 248)
660#define __NR_mknodat (__NR_Linux + 249)
661#define __NR_fchownat (__NR_Linux + 250)
662#define __NR_futimesat (__NR_Linux + 251)
663#define __NR_newfstatat (__NR_Linux + 252)
664#define __NR_unlinkat (__NR_Linux + 253)
665#define __NR_renameat (__NR_Linux + 254)
666#define __NR_linkat (__NR_Linux + 255)
667#define __NR_symlinkat (__NR_Linux + 256)
668#define __NR_readlinkat (__NR_Linux + 257)
669#define __NR_fchmodat (__NR_Linux + 258)
670#define __NR_faccessat (__NR_Linux + 259)
671#define __NR_pselect6 (__NR_Linux + 260)
672#define __NR_ppoll (__NR_Linux + 261)
673#define __NR_unshare (__NR_Linux + 262)
674#define __NR_splice (__NR_Linux + 263)
675#define __NR_sync_file_range (__NR_Linux + 264)
676#define __NR_tee (__NR_Linux + 265)
677#define __NR_vmsplice (__NR_Linux + 266)
678#define __NR_move_pages (__NR_Linux + 267)
679#define __NR_set_robust_list (__NR_Linux + 268)
680#define __NR_get_robust_list (__NR_Linux + 269)
681#define __NR_kexec_load (__NR_Linux + 270)
682#define __NR_getcpu (__NR_Linux + 271)
683#define __NR_epoll_pwait (__NR_Linux + 272)
684#define __NR_ioprio_set (__NR_Linux + 273)
685#define __NR_ioprio_get (__NR_Linux + 274)
686#define __NR_utimensat (__NR_Linux + 275)
687#define __NR_signalfd (__NR_Linux + 276)
688#define __NR_timerfd (__NR_Linux + 277)
689#define __NR_eventfd (__NR_Linux + 278)
690#define __NR_fallocate (__NR_Linux + 279)
691#define __NR_timerfd_create (__NR_Linux + 280)
692#define __NR_timerfd_gettime (__NR_Linux + 281)
693#define __NR_timerfd_settime (__NR_Linux + 282)
694#define __NR_signalfd4 (__NR_Linux + 283)
695#define __NR_eventfd2 (__NR_Linux + 284)
696#define __NR_epoll_create1 (__NR_Linux + 285)
697#define __NR_dup3 (__NR_Linux + 286)
698#define __NR_pipe2 (__NR_Linux + 287)
699#define __NR_inotify_init1 (__NR_Linux + 288)
700#define __NR_preadv (__NR_Linux + 289)
701#define __NR_pwritev (__NR_Linux + 290)
702#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
703#define __NR_perf_event_open (__NR_Linux + 292)
704#define __NR_accept4 (__NR_Linux + 293)
705#define __NR_recvmmsg (__NR_Linux + 294)
706#define __NR_fanotify_init (__NR_Linux + 295)
707#define __NR_fanotify_mark (__NR_Linux + 296)
708#define __NR_prlimit64 (__NR_Linux + 297)
709#define __NR_name_to_handle_at (__NR_Linux + 298)
710#define __NR_open_by_handle_at (__NR_Linux + 299)
711#define __NR_clock_adjtime (__NR_Linux + 300)
712#define __NR_syncfs (__NR_Linux + 301)
713#define __NR_sendmmsg (__NR_Linux + 302)
714#define __NR_setns (__NR_Linux + 303)
715#define __NR_process_vm_readv (__NR_Linux + 304)
716#define __NR_process_vm_writev (__NR_Linux + 305)
717#define __NR_kcmp (__NR_Linux + 306)
718#define __NR_finit_module (__NR_Linux + 307)
719#define __NR_getdents64 (__NR_Linux + 308)
720#define __NR_sched_setattr (__NR_Linux + 309)
721#define __NR_sched_getattr (__NR_Linux + 310)
722#define __NR_renameat2 (__NR_Linux + 311)
723#define __NR_seccomp (__NR_Linux + 312)
724#define __NR_getrandom (__NR_Linux + 313)
725#define __NR_memfd_create (__NR_Linux + 314)
726#define __NR_bpf (__NR_Linux + 315)
727#define __NR_execveat (__NR_Linux + 316)
728#define __NR_userfaultfd (__NR_Linux + 317)
729#define __NR_membarrier (__NR_Linux + 318)
730#define __NR_mlock2 (__NR_Linux + 319)
731#define __NR_copy_file_range (__NR_Linux + 320)
732#define __NR_preadv2 (__NR_Linux + 321)
733#define __NR_pwritev2 (__NR_Linux + 322)
734#define __NR_pkey_mprotect (__NR_Linux + 323)
735#define __NR_pkey_alloc (__NR_Linux + 324)
736#define __NR_pkey_free (__NR_Linux + 325)
737#define __NR_statx (__NR_Linux + 326)
738#define __NR_rseq (__NR_Linux + 327)
739#define __NR_io_pgetevents (__NR_Linux + 328)
740
741/*
742 * Offset of the last Linux 64-bit flavoured syscall
743 */
744#define __NR_Linux_syscalls 328
74529
746#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */30#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
74731
748#define __NR_64_Linux 5000
749#define __NR_64_Linux_syscalls 328
750
751#if _MIPS_SIM == _MIPS_SIM_NABI3232#if _MIPS_SIM == _MIPS_SIM_NABI32
75233
753/*34#define __NR_Linux 6000
754 * Linux N32 syscalls are in the range from 6000 to 6999.35#include <asm/unistd_n32.h>
755 */
756#define __NR_Linux 6000
757#define __NR_read (__NR_Linux + 0)
758#define __NR_write (__NR_Linux + 1)
759#define __NR_open (__NR_Linux + 2)
760#define __NR_close (__NR_Linux + 3)
761#define __NR_stat (__NR_Linux + 4)
762#define __NR_fstat (__NR_Linux + 5)
763#define __NR_lstat (__NR_Linux + 6)
764#define __NR_poll (__NR_Linux + 7)
765#define __NR_lseek (__NR_Linux + 8)
766#define __NR_mmap (__NR_Linux + 9)
767#define __NR_mprotect (__NR_Linux + 10)
768#define __NR_munmap (__NR_Linux + 11)
769#define __NR_brk (__NR_Linux + 12)
770#define __NR_rt_sigaction (__NR_Linux + 13)
771#define __NR_rt_sigprocmask (__NR_Linux + 14)
772#define __NR_ioctl (__NR_Linux + 15)
773#define __NR_pread64 (__NR_Linux + 16)
774#define __NR_pwrite64 (__NR_Linux + 17)
775#define __NR_readv (__NR_Linux + 18)
776#define __NR_writev (__NR_Linux + 19)
777#define __NR_access (__NR_Linux + 20)
778#define __NR_pipe (__NR_Linux + 21)
779#define __NR__newselect (__NR_Linux + 22)
780#define __NR_sched_yield (__NR_Linux + 23)
781#define __NR_mremap (__NR_Linux + 24)
782#define __NR_msync (__NR_Linux + 25)
783#define __NR_mincore (__NR_Linux + 26)
784#define __NR_madvise (__NR_Linux + 27)
785#define __NR_shmget (__NR_Linux + 28)
786#define __NR_shmat (__NR_Linux + 29)
787#define __NR_shmctl (__NR_Linux + 30)
788#define __NR_dup (__NR_Linux + 31)
789#define __NR_dup2 (__NR_Linux + 32)
790#define __NR_pause (__NR_Linux + 33)
791#define __NR_nanosleep (__NR_Linux + 34)
792#define __NR_getitimer (__NR_Linux + 35)
793#define __NR_setitimer (__NR_Linux + 36)
794#define __NR_alarm (__NR_Linux + 37)
795#define __NR_getpid (__NR_Linux + 38)
796#define __NR_sendfile (__NR_Linux + 39)
797#define __NR_socket (__NR_Linux + 40)
798#define __NR_connect (__NR_Linux + 41)
799#define __NR_accept (__NR_Linux + 42)
800#define __NR_sendto (__NR_Linux + 43)
801#define __NR_recvfrom (__NR_Linux + 44)
802#define __NR_sendmsg (__NR_Linux + 45)
803#define __NR_recvmsg (__NR_Linux + 46)
804#define __NR_shutdown (__NR_Linux + 47)
805#define __NR_bind (__NR_Linux + 48)
806#define __NR_listen (__NR_Linux + 49)
807#define __NR_getsockname (__NR_Linux + 50)
808#define __NR_getpeername (__NR_Linux + 51)
809#define __NR_socketpair (__NR_Linux + 52)
810#define __NR_setsockopt (__NR_Linux + 53)
811#define __NR_getsockopt (__NR_Linux + 54)
812#define __NR_clone (__NR_Linux + 55)
813#define __NR_fork (__NR_Linux + 56)
814#define __NR_execve (__NR_Linux + 57)
815#define __NR_exit (__NR_Linux + 58)
816#define __NR_wait4 (__NR_Linux + 59)
817#define __NR_kill (__NR_Linux + 60)
818#define __NR_uname (__NR_Linux + 61)
819#define __NR_semget (__NR_Linux + 62)
820#define __NR_semop (__NR_Linux + 63)
821#define __NR_semctl (__NR_Linux + 64)
822#define __NR_shmdt (__NR_Linux + 65)
823#define __NR_msgget (__NR_Linux + 66)
824#define __NR_msgsnd (__NR_Linux + 67)
825#define __NR_msgrcv (__NR_Linux + 68)
826#define __NR_msgctl (__NR_Linux + 69)
827#define __NR_fcntl (__NR_Linux + 70)
828#define __NR_flock (__NR_Linux + 71)
829#define __NR_fsync (__NR_Linux + 72)
830#define __NR_fdatasync (__NR_Linux + 73)
831#define __NR_truncate (__NR_Linux + 74)
832#define __NR_ftruncate (__NR_Linux + 75)
833#define __NR_getdents (__NR_Linux + 76)
834#define __NR_getcwd (__NR_Linux + 77)
835#define __NR_chdir (__NR_Linux + 78)
836#define __NR_fchdir (__NR_Linux + 79)
837#define __NR_rename (__NR_Linux + 80)
838#define __NR_mkdir (__NR_Linux + 81)
839#define __NR_rmdir (__NR_Linux + 82)
840#define __NR_creat (__NR_Linux + 83)
841#define __NR_link (__NR_Linux + 84)
842#define __NR_unlink (__NR_Linux + 85)
843#define __NR_symlink (__NR_Linux + 86)
844#define __NR_readlink (__NR_Linux + 87)
845#define __NR_chmod (__NR_Linux + 88)
846#define __NR_fchmod (__NR_Linux + 89)
847#define __NR_chown (__NR_Linux + 90)
848#define __NR_fchown (__NR_Linux + 91)
849#define __NR_lchown (__NR_Linux + 92)
850#define __NR_umask (__NR_Linux + 93)
851#define __NR_gettimeofday (__NR_Linux + 94)
852#define __NR_getrlimit (__NR_Linux + 95)
853#define __NR_getrusage (__NR_Linux + 96)
854#define __NR_sysinfo (__NR_Linux + 97)
855#define __NR_times (__NR_Linux + 98)
856#define __NR_ptrace (__NR_Linux + 99)
857#define __NR_getuid (__NR_Linux + 100)
858#define __NR_syslog (__NR_Linux + 101)
859#define __NR_getgid (__NR_Linux + 102)
860#define __NR_setuid (__NR_Linux + 103)
861#define __NR_setgid (__NR_Linux + 104)
862#define __NR_geteuid (__NR_Linux + 105)
863#define __NR_getegid (__NR_Linux + 106)
864#define __NR_setpgid (__NR_Linux + 107)
865#define __NR_getppid (__NR_Linux + 108)
866#define __NR_getpgrp (__NR_Linux + 109)
867#define __NR_setsid (__NR_Linux + 110)
868#define __NR_setreuid (__NR_Linux + 111)
869#define __NR_setregid (__NR_Linux + 112)
870#define __NR_getgroups (__NR_Linux + 113)
871#define __NR_setgroups (__NR_Linux + 114)
872#define __NR_setresuid (__NR_Linux + 115)
873#define __NR_getresuid (__NR_Linux + 116)
874#define __NR_setresgid (__NR_Linux + 117)
875#define __NR_getresgid (__NR_Linux + 118)
876#define __NR_getpgid (__NR_Linux + 119)
877#define __NR_setfsuid (__NR_Linux + 120)
878#define __NR_setfsgid (__NR_Linux + 121)
879#define __NR_getsid (__NR_Linux + 122)
880#define __NR_capget (__NR_Linux + 123)
881#define __NR_capset (__NR_Linux + 124)
882#define __NR_rt_sigpending (__NR_Linux + 125)
883#define __NR_rt_sigtimedwait (__NR_Linux + 126)
884#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
885#define __NR_rt_sigsuspend (__NR_Linux + 128)
886#define __NR_sigaltstack (__NR_Linux + 129)
887#define __NR_utime (__NR_Linux + 130)
888#define __NR_mknod (__NR_Linux + 131)
889#define __NR_personality (__NR_Linux + 132)
890#define __NR_ustat (__NR_Linux + 133)
891#define __NR_statfs (__NR_Linux + 134)
892#define __NR_fstatfs (__NR_Linux + 135)
893#define __NR_sysfs (__NR_Linux + 136)
894#define __NR_getpriority (__NR_Linux + 137)
895#define __NR_setpriority (__NR_Linux + 138)
896#define __NR_sched_setparam (__NR_Linux + 139)
897#define __NR_sched_getparam (__NR_Linux + 140)
898#define __NR_sched_setscheduler (__NR_Linux + 141)
899#define __NR_sched_getscheduler (__NR_Linux + 142)
900#define __NR_sched_get_priority_max (__NR_Linux + 143)
901#define __NR_sched_get_priority_min (__NR_Linux + 144)
902#define __NR_sched_rr_get_interval (__NR_Linux + 145)
903#define __NR_mlock (__NR_Linux + 146)
904#define __NR_munlock (__NR_Linux + 147)
905#define __NR_mlockall (__NR_Linux + 148)
906#define __NR_munlockall (__NR_Linux + 149)
907#define __NR_vhangup (__NR_Linux + 150)
908#define __NR_pivot_root (__NR_Linux + 151)
909#define __NR__sysctl (__NR_Linux + 152)
910#define __NR_prctl (__NR_Linux + 153)
911#define __NR_adjtimex (__NR_Linux + 154)
912#define __NR_setrlimit (__NR_Linux + 155)
913#define __NR_chroot (__NR_Linux + 156)
914#define __NR_sync (__NR_Linux + 157)
915#define __NR_acct (__NR_Linux + 158)
916#define __NR_settimeofday (__NR_Linux + 159)
917#define __NR_mount (__NR_Linux + 160)
918#define __NR_umount2 (__NR_Linux + 161)
919#define __NR_swapon (__NR_Linux + 162)
920#define __NR_swapoff (__NR_Linux + 163)
921#define __NR_reboot (__NR_Linux + 164)
922#define __NR_sethostname (__NR_Linux + 165)
923#define __NR_setdomainname (__NR_Linux + 166)
924#define __NR_create_module (__NR_Linux + 167)
925#define __NR_init_module (__NR_Linux + 168)
926#define __NR_delete_module (__NR_Linux + 169)
927#define __NR_get_kernel_syms (__NR_Linux + 170)
928#define __NR_query_module (__NR_Linux + 171)
929#define __NR_quotactl (__NR_Linux + 172)
930#define __NR_nfsservctl (__NR_Linux + 173)
931#define __NR_getpmsg (__NR_Linux + 174)
932#define __NR_putpmsg (__NR_Linux + 175)
933#define __NR_afs_syscall (__NR_Linux + 176)
934#define __NR_reserved177 (__NR_Linux + 177)
935#define __NR_gettid (__NR_Linux + 178)
936#define __NR_readahead (__NR_Linux + 179)
937#define __NR_setxattr (__NR_Linux + 180)
938#define __NR_lsetxattr (__NR_Linux + 181)
939#define __NR_fsetxattr (__NR_Linux + 182)
940#define __NR_getxattr (__NR_Linux + 183)
941#define __NR_lgetxattr (__NR_Linux + 184)
942#define __NR_fgetxattr (__NR_Linux + 185)
943#define __NR_listxattr (__NR_Linux + 186)
944#define __NR_llistxattr (__NR_Linux + 187)
945#define __NR_flistxattr (__NR_Linux + 188)
946#define __NR_removexattr (__NR_Linux + 189)
947#define __NR_lremovexattr (__NR_Linux + 190)
948#define __NR_fremovexattr (__NR_Linux + 191)
949#define __NR_tkill (__NR_Linux + 192)
950#define __NR_reserved193 (__NR_Linux + 193)
951#define __NR_futex (__NR_Linux + 194)
952#define __NR_sched_setaffinity (__NR_Linux + 195)
953#define __NR_sched_getaffinity (__NR_Linux + 196)
954#define __NR_cacheflush (__NR_Linux + 197)
955#define __NR_cachectl (__NR_Linux + 198)
956#define __NR_sysmips (__NR_Linux + 199)
957#define __NR_io_setup (__NR_Linux + 200)
958#define __NR_io_destroy (__NR_Linux + 201)
959#define __NR_io_getevents (__NR_Linux + 202)
960#define __NR_io_submit (__NR_Linux + 203)
961#define __NR_io_cancel (__NR_Linux + 204)
962#define __NR_exit_group (__NR_Linux + 205)
963#define __NR_lookup_dcookie (__NR_Linux + 206)
964#define __NR_epoll_create (__NR_Linux + 207)
965#define __NR_epoll_ctl (__NR_Linux + 208)
966#define __NR_epoll_wait (__NR_Linux + 209)
967#define __NR_remap_file_pages (__NR_Linux + 210)
968#define __NR_rt_sigreturn (__NR_Linux + 211)
969#define __NR_fcntl64 (__NR_Linux + 212)
970#define __NR_set_tid_address (__NR_Linux + 213)
971#define __NR_restart_syscall (__NR_Linux + 214)
972#define __NR_semtimedop (__NR_Linux + 215)
973#define __NR_fadvise64 (__NR_Linux + 216)
974#define __NR_statfs64 (__NR_Linux + 217)
975#define __NR_fstatfs64 (__NR_Linux + 218)
976#define __NR_sendfile64 (__NR_Linux + 219)
977#define __NR_timer_create (__NR_Linux + 220)
978#define __NR_timer_settime (__NR_Linux + 221)
979#define __NR_timer_gettime (__NR_Linux + 222)
980#define __NR_timer_getoverrun (__NR_Linux + 223)
981#define __NR_timer_delete (__NR_Linux + 224)
982#define __NR_clock_settime (__NR_Linux + 225)
983#define __NR_clock_gettime (__NR_Linux + 226)
984#define __NR_clock_getres (__NR_Linux + 227)
985#define __NR_clock_nanosleep (__NR_Linux + 228)
986#define __NR_tgkill (__NR_Linux + 229)
987#define __NR_utimes (__NR_Linux + 230)
988#define __NR_mbind (__NR_Linux + 231)
989#define __NR_get_mempolicy (__NR_Linux + 232)
990#define __NR_set_mempolicy (__NR_Linux + 233)
991#define __NR_mq_open (__NR_Linux + 234)
992#define __NR_mq_unlink (__NR_Linux + 235)
993#define __NR_mq_timedsend (__NR_Linux + 236)
994#define __NR_mq_timedreceive (__NR_Linux + 237)
995#define __NR_mq_notify (__NR_Linux + 238)
996#define __NR_mq_getsetattr (__NR_Linux + 239)
997#define __NR_vserver (__NR_Linux + 240)
998#define __NR_waitid (__NR_Linux + 241)
999/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
1000#define __NR_add_key (__NR_Linux + 243)
1001#define __NR_request_key (__NR_Linux + 244)
1002#define __NR_keyctl (__NR_Linux + 245)
1003#define __NR_set_thread_area (__NR_Linux + 246)
1004#define __NR_inotify_init (__NR_Linux + 247)
1005#define __NR_inotify_add_watch (__NR_Linux + 248)
1006#define __NR_inotify_rm_watch (__NR_Linux + 249)
1007#define __NR_migrate_pages (__NR_Linux + 250)
1008#define __NR_openat (__NR_Linux + 251)
1009#define __NR_mkdirat (__NR_Linux + 252)
1010#define __NR_mknodat (__NR_Linux + 253)
1011#define __NR_fchownat (__NR_Linux + 254)
1012#define __NR_futimesat (__NR_Linux + 255)
1013#define __NR_newfstatat (__NR_Linux + 256)
1014#define __NR_unlinkat (__NR_Linux + 257)
1015#define __NR_renameat (__NR_Linux + 258)
1016#define __NR_linkat (__NR_Linux + 259)
1017#define __NR_symlinkat (__NR_Linux + 260)
1018#define __NR_readlinkat (__NR_Linux + 261)
1019#define __NR_fchmodat (__NR_Linux + 262)
1020#define __NR_faccessat (__NR_Linux + 263)
1021#define __NR_pselect6 (__NR_Linux + 264)
1022#define __NR_ppoll (__NR_Linux + 265)
1023#define __NR_unshare (__NR_Linux + 266)
1024#define __NR_splice (__NR_Linux + 267)
1025#define __NR_sync_file_range (__NR_Linux + 268)
1026#define __NR_tee (__NR_Linux + 269)
1027#define __NR_vmsplice (__NR_Linux + 270)
1028#define __NR_move_pages (__NR_Linux + 271)
1029#define __NR_set_robust_list (__NR_Linux + 272)
1030#define __NR_get_robust_list (__NR_Linux + 273)
1031#define __NR_kexec_load (__NR_Linux + 274)
1032#define __NR_getcpu (__NR_Linux + 275)
1033#define __NR_epoll_pwait (__NR_Linux + 276)
1034#define __NR_ioprio_set (__NR_Linux + 277)
1035#define __NR_ioprio_get (__NR_Linux + 278)
1036#define __NR_utimensat (__NR_Linux + 279)
1037#define __NR_signalfd (__NR_Linux + 280)
1038#define __NR_timerfd (__NR_Linux + 281)
1039#define __NR_eventfd (__NR_Linux + 282)
1040#define __NR_fallocate (__NR_Linux + 283)
1041#define __NR_timerfd_create (__NR_Linux + 284)
1042#define __NR_timerfd_gettime (__NR_Linux + 285)
1043#define __NR_timerfd_settime (__NR_Linux + 286)
1044#define __NR_signalfd4 (__NR_Linux + 287)
1045#define __NR_eventfd2 (__NR_Linux + 288)
1046#define __NR_epoll_create1 (__NR_Linux + 289)
1047#define __NR_dup3 (__NR_Linux + 290)
1048#define __NR_pipe2 (__NR_Linux + 291)
1049#define __NR_inotify_init1 (__NR_Linux + 292)
1050#define __NR_preadv (__NR_Linux + 293)
1051#define __NR_pwritev (__NR_Linux + 294)
1052#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1053#define __NR_perf_event_open (__NR_Linux + 296)
1054#define __NR_accept4 (__NR_Linux + 297)
1055#define __NR_recvmmsg (__NR_Linux + 298)
1056#define __NR_getdents64 (__NR_Linux + 299)
1057#define __NR_fanotify_init (__NR_Linux + 300)
1058#define __NR_fanotify_mark (__NR_Linux + 301)
1059#define __NR_prlimit64 (__NR_Linux + 302)
1060#define __NR_name_to_handle_at (__NR_Linux + 303)
1061#define __NR_open_by_handle_at (__NR_Linux + 304)
1062#define __NR_clock_adjtime (__NR_Linux + 305)
1063#define __NR_syncfs (__NR_Linux + 306)
1064#define __NR_sendmmsg (__NR_Linux + 307)
1065#define __NR_setns (__NR_Linux + 308)
1066#define __NR_process_vm_readv (__NR_Linux + 309)
1067#define __NR_process_vm_writev (__NR_Linux + 310)
1068#define __NR_kcmp (__NR_Linux + 311)
1069#define __NR_finit_module (__NR_Linux + 312)
1070#define __NR_sched_setattr (__NR_Linux + 313)
1071#define __NR_sched_getattr (__NR_Linux + 314)
1072#define __NR_renameat2 (__NR_Linux + 315)
1073#define __NR_seccomp (__NR_Linux + 316)
1074#define __NR_getrandom (__NR_Linux + 317)
1075#define __NR_memfd_create (__NR_Linux + 318)
1076#define __NR_bpf (__NR_Linux + 319)
1077#define __NR_execveat (__NR_Linux + 320)
1078#define __NR_userfaultfd (__NR_Linux + 321)
1079#define __NR_membarrier (__NR_Linux + 322)
1080#define __NR_mlock2 (__NR_Linux + 323)
1081#define __NR_copy_file_range (__NR_Linux + 324)
1082#define __NR_preadv2 (__NR_Linux + 325)
1083#define __NR_pwritev2 (__NR_Linux + 326)
1084#define __NR_pkey_mprotect (__NR_Linux + 327)
1085#define __NR_pkey_alloc (__NR_Linux + 328)
1086#define __NR_pkey_free (__NR_Linux + 329)
1087#define __NR_statx (__NR_Linux + 330)
1088#define __NR_rseq (__NR_Linux + 331)
1089#define __NR_io_pgetevents (__NR_Linux + 332)
1090
1091/*
1092 * Offset of the last N32 flavoured syscall
1093 */
1094#define __NR_Linux_syscalls 332
109536
1096#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */37#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
109738
1098#define __NR_N32_Linux 6000
1099#define __NR_N32_Linux_syscalls 332
1100
1101#endif /* _ASM_UNISTD_H */39#endif /* _ASM_UNISTD_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n32.h created+382
...@@ -0,0 +1,382 @@
1#ifndef _ASM_UNISTD_N32_H
2#define _ASM_UNISTD_N32_H
3
4#define __NR_read (__NR_Linux + 0)
5#define __NR_write (__NR_Linux + 1)
6#define __NR_open (__NR_Linux + 2)
7#define __NR_close (__NR_Linux + 3)
8#define __NR_stat (__NR_Linux + 4)
9#define __NR_fstat (__NR_Linux + 5)
10#define __NR_lstat (__NR_Linux + 6)
11#define __NR_poll (__NR_Linux + 7)
12#define __NR_lseek (__NR_Linux + 8)
13#define __NR_mmap (__NR_Linux + 9)
14#define __NR_mprotect (__NR_Linux + 10)
15#define __NR_munmap (__NR_Linux + 11)
16#define __NR_brk (__NR_Linux + 12)
17#define __NR_rt_sigaction (__NR_Linux + 13)
18#define __NR_rt_sigprocmask (__NR_Linux + 14)
19#define __NR_ioctl (__NR_Linux + 15)
20#define __NR_pread64 (__NR_Linux + 16)
21#define __NR_pwrite64 (__NR_Linux + 17)
22#define __NR_readv (__NR_Linux + 18)
23#define __NR_writev (__NR_Linux + 19)
24#define __NR_access (__NR_Linux + 20)
25#define __NR_pipe (__NR_Linux + 21)
26#define __NR__newselect (__NR_Linux + 22)
27#define __NR_sched_yield (__NR_Linux + 23)
28#define __NR_mremap (__NR_Linux + 24)
29#define __NR_msync (__NR_Linux + 25)
30#define __NR_mincore (__NR_Linux + 26)
31#define __NR_madvise (__NR_Linux + 27)
32#define __NR_shmget (__NR_Linux + 28)
33#define __NR_shmat (__NR_Linux + 29)
34#define __NR_shmctl (__NR_Linux + 30)
35#define __NR_dup (__NR_Linux + 31)
36#define __NR_dup2 (__NR_Linux + 32)
37#define __NR_pause (__NR_Linux + 33)
38#define __NR_nanosleep (__NR_Linux + 34)
39#define __NR_getitimer (__NR_Linux + 35)
40#define __NR_setitimer (__NR_Linux + 36)
41#define __NR_alarm (__NR_Linux + 37)
42#define __NR_getpid (__NR_Linux + 38)
43#define __NR_sendfile (__NR_Linux + 39)
44#define __NR_socket (__NR_Linux + 40)
45#define __NR_connect (__NR_Linux + 41)
46#define __NR_accept (__NR_Linux + 42)
47#define __NR_sendto (__NR_Linux + 43)
48#define __NR_recvfrom (__NR_Linux + 44)
49#define __NR_sendmsg (__NR_Linux + 45)
50#define __NR_recvmsg (__NR_Linux + 46)
51#define __NR_shutdown (__NR_Linux + 47)
52#define __NR_bind (__NR_Linux + 48)
53#define __NR_listen (__NR_Linux + 49)
54#define __NR_getsockname (__NR_Linux + 50)
55#define __NR_getpeername (__NR_Linux + 51)
56#define __NR_socketpair (__NR_Linux + 52)
57#define __NR_setsockopt (__NR_Linux + 53)
58#define __NR_getsockopt (__NR_Linux + 54)
59#define __NR_clone (__NR_Linux + 55)
60#define __NR_fork (__NR_Linux + 56)
61#define __NR_execve (__NR_Linux + 57)
62#define __NR_exit (__NR_Linux + 58)
63#define __NR_wait4 (__NR_Linux + 59)
64#define __NR_kill (__NR_Linux + 60)
65#define __NR_uname (__NR_Linux + 61)
66#define __NR_semget (__NR_Linux + 62)
67#define __NR_semop (__NR_Linux + 63)
68#define __NR_semctl (__NR_Linux + 64)
69#define __NR_shmdt (__NR_Linux + 65)
70#define __NR_msgget (__NR_Linux + 66)
71#define __NR_msgsnd (__NR_Linux + 67)
72#define __NR_msgrcv (__NR_Linux + 68)
73#define __NR_msgctl (__NR_Linux + 69)
74#define __NR_fcntl (__NR_Linux + 70)
75#define __NR_flock (__NR_Linux + 71)
76#define __NR_fsync (__NR_Linux + 72)
77#define __NR_fdatasync (__NR_Linux + 73)
78#define __NR_truncate (__NR_Linux + 74)
79#define __NR_ftruncate (__NR_Linux + 75)
80#define __NR_getdents (__NR_Linux + 76)
81#define __NR_getcwd (__NR_Linux + 77)
82#define __NR_chdir (__NR_Linux + 78)
83#define __NR_fchdir (__NR_Linux + 79)
84#define __NR_rename (__NR_Linux + 80)
85#define __NR_mkdir (__NR_Linux + 81)
86#define __NR_rmdir (__NR_Linux + 82)
87#define __NR_creat (__NR_Linux + 83)
88#define __NR_link (__NR_Linux + 84)
89#define __NR_unlink (__NR_Linux + 85)
90#define __NR_symlink (__NR_Linux + 86)
91#define __NR_readlink (__NR_Linux + 87)
92#define __NR_chmod (__NR_Linux + 88)
93#define __NR_fchmod (__NR_Linux + 89)
94#define __NR_chown (__NR_Linux + 90)
95#define __NR_fchown (__NR_Linux + 91)
96#define __NR_lchown (__NR_Linux + 92)
97#define __NR_umask (__NR_Linux + 93)
98#define __NR_gettimeofday (__NR_Linux + 94)
99#define __NR_getrlimit (__NR_Linux + 95)
100#define __NR_getrusage (__NR_Linux + 96)
101#define __NR_sysinfo (__NR_Linux + 97)
102#define __NR_times (__NR_Linux + 98)
103#define __NR_ptrace (__NR_Linux + 99)
104#define __NR_getuid (__NR_Linux + 100)
105#define __NR_syslog (__NR_Linux + 101)
106#define __NR_getgid (__NR_Linux + 102)
107#define __NR_setuid (__NR_Linux + 103)
108#define __NR_setgid (__NR_Linux + 104)
109#define __NR_geteuid (__NR_Linux + 105)
110#define __NR_getegid (__NR_Linux + 106)
111#define __NR_setpgid (__NR_Linux + 107)
112#define __NR_getppid (__NR_Linux + 108)
113#define __NR_getpgrp (__NR_Linux + 109)
114#define __NR_setsid (__NR_Linux + 110)
115#define __NR_setreuid (__NR_Linux + 111)
116#define __NR_setregid (__NR_Linux + 112)
117#define __NR_getgroups (__NR_Linux + 113)
118#define __NR_setgroups (__NR_Linux + 114)
119#define __NR_setresuid (__NR_Linux + 115)
120#define __NR_getresuid (__NR_Linux + 116)
121#define __NR_setresgid (__NR_Linux + 117)
122#define __NR_getresgid (__NR_Linux + 118)
123#define __NR_getpgid (__NR_Linux + 119)
124#define __NR_setfsuid (__NR_Linux + 120)
125#define __NR_setfsgid (__NR_Linux + 121)
126#define __NR_getsid (__NR_Linux + 122)
127#define __NR_capget (__NR_Linux + 123)
128#define __NR_capset (__NR_Linux + 124)
129#define __NR_rt_sigpending (__NR_Linux + 125)
130#define __NR_rt_sigtimedwait (__NR_Linux + 126)
131#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
132#define __NR_rt_sigsuspend (__NR_Linux + 128)
133#define __NR_sigaltstack (__NR_Linux + 129)
134#define __NR_utime (__NR_Linux + 130)
135#define __NR_mknod (__NR_Linux + 131)
136#define __NR_personality (__NR_Linux + 132)
137#define __NR_ustat (__NR_Linux + 133)
138#define __NR_statfs (__NR_Linux + 134)
139#define __NR_fstatfs (__NR_Linux + 135)
140#define __NR_sysfs (__NR_Linux + 136)
141#define __NR_getpriority (__NR_Linux + 137)
142#define __NR_setpriority (__NR_Linux + 138)
143#define __NR_sched_setparam (__NR_Linux + 139)
144#define __NR_sched_getparam (__NR_Linux + 140)
145#define __NR_sched_setscheduler (__NR_Linux + 141)
146#define __NR_sched_getscheduler (__NR_Linux + 142)
147#define __NR_sched_get_priority_max (__NR_Linux + 143)
148#define __NR_sched_get_priority_min (__NR_Linux + 144)
149#define __NR_sched_rr_get_interval (__NR_Linux + 145)
150#define __NR_mlock (__NR_Linux + 146)
151#define __NR_munlock (__NR_Linux + 147)
152#define __NR_mlockall (__NR_Linux + 148)
153#define __NR_munlockall (__NR_Linux + 149)
154#define __NR_vhangup (__NR_Linux + 150)
155#define __NR_pivot_root (__NR_Linux + 151)
156#define __NR__sysctl (__NR_Linux + 152)
157#define __NR_prctl (__NR_Linux + 153)
158#define __NR_adjtimex (__NR_Linux + 154)
159#define __NR_setrlimit (__NR_Linux + 155)
160#define __NR_chroot (__NR_Linux + 156)
161#define __NR_sync (__NR_Linux + 157)
162#define __NR_acct (__NR_Linux + 158)
163#define __NR_settimeofday (__NR_Linux + 159)
164#define __NR_mount (__NR_Linux + 160)
165#define __NR_umount2 (__NR_Linux + 161)
166#define __NR_swapon (__NR_Linux + 162)
167#define __NR_swapoff (__NR_Linux + 163)
168#define __NR_reboot (__NR_Linux + 164)
169#define __NR_sethostname (__NR_Linux + 165)
170#define __NR_setdomainname (__NR_Linux + 166)
171#define __NR_create_module (__NR_Linux + 167)
172#define __NR_init_module (__NR_Linux + 168)
173#define __NR_delete_module (__NR_Linux + 169)
174#define __NR_get_kernel_syms (__NR_Linux + 170)
175#define __NR_query_module (__NR_Linux + 171)
176#define __NR_quotactl (__NR_Linux + 172)
177#define __NR_nfsservctl (__NR_Linux + 173)
178#define __NR_getpmsg (__NR_Linux + 174)
179#define __NR_putpmsg (__NR_Linux + 175)
180#define __NR_afs_syscall (__NR_Linux + 176)
181#define __NR_reserved177 (__NR_Linux + 177)
182#define __NR_gettid (__NR_Linux + 178)
183#define __NR_readahead (__NR_Linux + 179)
184#define __NR_setxattr (__NR_Linux + 180)
185#define __NR_lsetxattr (__NR_Linux + 181)
186#define __NR_fsetxattr (__NR_Linux + 182)
187#define __NR_getxattr (__NR_Linux + 183)
188#define __NR_lgetxattr (__NR_Linux + 184)
189#define __NR_fgetxattr (__NR_Linux + 185)
190#define __NR_listxattr (__NR_Linux + 186)
191#define __NR_llistxattr (__NR_Linux + 187)
192#define __NR_flistxattr (__NR_Linux + 188)
193#define __NR_removexattr (__NR_Linux + 189)
194#define __NR_lremovexattr (__NR_Linux + 190)
195#define __NR_fremovexattr (__NR_Linux + 191)
196#define __NR_tkill (__NR_Linux + 192)
197#define __NR_reserved193 (__NR_Linux + 193)
198#define __NR_futex (__NR_Linux + 194)
199#define __NR_sched_setaffinity (__NR_Linux + 195)
200#define __NR_sched_getaffinity (__NR_Linux + 196)
201#define __NR_cacheflush (__NR_Linux + 197)
202#define __NR_cachectl (__NR_Linux + 198)
203#define __NR_sysmips (__NR_Linux + 199)
204#define __NR_io_setup (__NR_Linux + 200)
205#define __NR_io_destroy (__NR_Linux + 201)
206#define __NR_io_getevents (__NR_Linux + 202)
207#define __NR_io_submit (__NR_Linux + 203)
208#define __NR_io_cancel (__NR_Linux + 204)
209#define __NR_exit_group (__NR_Linux + 205)
210#define __NR_lookup_dcookie (__NR_Linux + 206)
211#define __NR_epoll_create (__NR_Linux + 207)
212#define __NR_epoll_ctl (__NR_Linux + 208)
213#define __NR_epoll_wait (__NR_Linux + 209)
214#define __NR_remap_file_pages (__NR_Linux + 210)
215#define __NR_rt_sigreturn (__NR_Linux + 211)
216#define __NR_fcntl64 (__NR_Linux + 212)
217#define __NR_set_tid_address (__NR_Linux + 213)
218#define __NR_restart_syscall (__NR_Linux + 214)
219#define __NR_semtimedop (__NR_Linux + 215)
220#define __NR_fadvise64 (__NR_Linux + 216)
221#define __NR_statfs64 (__NR_Linux + 217)
222#define __NR_fstatfs64 (__NR_Linux + 218)
223#define __NR_sendfile64 (__NR_Linux + 219)
224#define __NR_timer_create (__NR_Linux + 220)
225#define __NR_timer_settime (__NR_Linux + 221)
226#define __NR_timer_gettime (__NR_Linux + 222)
227#define __NR_timer_getoverrun (__NR_Linux + 223)
228#define __NR_timer_delete (__NR_Linux + 224)
229#define __NR_clock_settime (__NR_Linux + 225)
230#define __NR_clock_gettime (__NR_Linux + 226)
231#define __NR_clock_getres (__NR_Linux + 227)
232#define __NR_clock_nanosleep (__NR_Linux + 228)
233#define __NR_tgkill (__NR_Linux + 229)
234#define __NR_utimes (__NR_Linux + 230)
235#define __NR_mbind (__NR_Linux + 231)
236#define __NR_get_mempolicy (__NR_Linux + 232)
237#define __NR_set_mempolicy (__NR_Linux + 233)
238#define __NR_mq_open (__NR_Linux + 234)
239#define __NR_mq_unlink (__NR_Linux + 235)
240#define __NR_mq_timedsend (__NR_Linux + 236)
241#define __NR_mq_timedreceive (__NR_Linux + 237)
242#define __NR_mq_notify (__NR_Linux + 238)
243#define __NR_mq_getsetattr (__NR_Linux + 239)
244#define __NR_vserver (__NR_Linux + 240)
245#define __NR_waitid (__NR_Linux + 241)
246#define __NR_add_key (__NR_Linux + 243)
247#define __NR_request_key (__NR_Linux + 244)
248#define __NR_keyctl (__NR_Linux + 245)
249#define __NR_set_thread_area (__NR_Linux + 246)
250#define __NR_inotify_init (__NR_Linux + 247)
251#define __NR_inotify_add_watch (__NR_Linux + 248)
252#define __NR_inotify_rm_watch (__NR_Linux + 249)
253#define __NR_migrate_pages (__NR_Linux + 250)
254#define __NR_openat (__NR_Linux + 251)
255#define __NR_mkdirat (__NR_Linux + 252)
256#define __NR_mknodat (__NR_Linux + 253)
257#define __NR_fchownat (__NR_Linux + 254)
258#define __NR_futimesat (__NR_Linux + 255)
259#define __NR_newfstatat (__NR_Linux + 256)
260#define __NR_unlinkat (__NR_Linux + 257)
261#define __NR_renameat (__NR_Linux + 258)
262#define __NR_linkat (__NR_Linux + 259)
263#define __NR_symlinkat (__NR_Linux + 260)
264#define __NR_readlinkat (__NR_Linux + 261)
265#define __NR_fchmodat (__NR_Linux + 262)
266#define __NR_faccessat (__NR_Linux + 263)
267#define __NR_pselect6 (__NR_Linux + 264)
268#define __NR_ppoll (__NR_Linux + 265)
269#define __NR_unshare (__NR_Linux + 266)
270#define __NR_splice (__NR_Linux + 267)
271#define __NR_sync_file_range (__NR_Linux + 268)
272#define __NR_tee (__NR_Linux + 269)
273#define __NR_vmsplice (__NR_Linux + 270)
274#define __NR_move_pages (__NR_Linux + 271)
275#define __NR_set_robust_list (__NR_Linux + 272)
276#define __NR_get_robust_list (__NR_Linux + 273)
277#define __NR_kexec_load (__NR_Linux + 274)
278#define __NR_getcpu (__NR_Linux + 275)
279#define __NR_epoll_pwait (__NR_Linux + 276)
280#define __NR_ioprio_set (__NR_Linux + 277)
281#define __NR_ioprio_get (__NR_Linux + 278)
282#define __NR_utimensat (__NR_Linux + 279)
283#define __NR_signalfd (__NR_Linux + 280)
284#define __NR_timerfd (__NR_Linux + 281)
285#define __NR_eventfd (__NR_Linux + 282)
286#define __NR_fallocate (__NR_Linux + 283)
287#define __NR_timerfd_create (__NR_Linux + 284)
288#define __NR_timerfd_gettime (__NR_Linux + 285)
289#define __NR_timerfd_settime (__NR_Linux + 286)
290#define __NR_signalfd4 (__NR_Linux + 287)
291#define __NR_eventfd2 (__NR_Linux + 288)
292#define __NR_epoll_create1 (__NR_Linux + 289)
293#define __NR_dup3 (__NR_Linux + 290)
294#define __NR_pipe2 (__NR_Linux + 291)
295#define __NR_inotify_init1 (__NR_Linux + 292)
296#define __NR_preadv (__NR_Linux + 293)
297#define __NR_pwritev (__NR_Linux + 294)
298#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
299#define __NR_perf_event_open (__NR_Linux + 296)
300#define __NR_accept4 (__NR_Linux + 297)
301#define __NR_recvmmsg (__NR_Linux + 298)
302#define __NR_getdents64 (__NR_Linux + 299)
303#define __NR_fanotify_init (__NR_Linux + 300)
304#define __NR_fanotify_mark (__NR_Linux + 301)
305#define __NR_prlimit64 (__NR_Linux + 302)
306#define __NR_name_to_handle_at (__NR_Linux + 303)
307#define __NR_open_by_handle_at (__NR_Linux + 304)
308#define __NR_clock_adjtime (__NR_Linux + 305)
309#define __NR_syncfs (__NR_Linux + 306)
310#define __NR_sendmmsg (__NR_Linux + 307)
311#define __NR_setns (__NR_Linux + 308)
312#define __NR_process_vm_readv (__NR_Linux + 309)
313#define __NR_process_vm_writev (__NR_Linux + 310)
314#define __NR_kcmp (__NR_Linux + 311)
315#define __NR_finit_module (__NR_Linux + 312)
316#define __NR_sched_setattr (__NR_Linux + 313)
317#define __NR_sched_getattr (__NR_Linux + 314)
318#define __NR_renameat2 (__NR_Linux + 315)
319#define __NR_seccomp (__NR_Linux + 316)
320#define __NR_getrandom (__NR_Linux + 317)
321#define __NR_memfd_create (__NR_Linux + 318)
322#define __NR_bpf (__NR_Linux + 319)
323#define __NR_execveat (__NR_Linux + 320)
324#define __NR_userfaultfd (__NR_Linux + 321)
325#define __NR_membarrier (__NR_Linux + 322)
326#define __NR_mlock2 (__NR_Linux + 323)
327#define __NR_copy_file_range (__NR_Linux + 324)
328#define __NR_preadv2 (__NR_Linux + 325)
329#define __NR_pwritev2 (__NR_Linux + 326)
330#define __NR_pkey_mprotect (__NR_Linux + 327)
331#define __NR_pkey_alloc (__NR_Linux + 328)
332#define __NR_pkey_free (__NR_Linux + 329)
333#define __NR_statx (__NR_Linux + 330)
334#define __NR_rseq (__NR_Linux + 331)
335#define __NR_io_pgetevents (__NR_Linux + 332)
336#define __NR_clock_gettime64 (__NR_Linux + 403)
337#define __NR_clock_settime64 (__NR_Linux + 404)
338#define __NR_clock_adjtime64 (__NR_Linux + 405)
339#define __NR_clock_getres_time64 (__NR_Linux + 406)
340#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
341#define __NR_timer_gettime64 (__NR_Linux + 408)
342#define __NR_timer_settime64 (__NR_Linux + 409)
343#define __NR_timerfd_gettime64 (__NR_Linux + 410)
344#define __NR_timerfd_settime64 (__NR_Linux + 411)
345#define __NR_utimensat_time64 (__NR_Linux + 412)
346#define __NR_pselect6_time64 (__NR_Linux + 413)
347#define __NR_ppoll_time64 (__NR_Linux + 414)
348#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
349#define __NR_recvmmsg_time64 (__NR_Linux + 417)
350#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
351#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
352#define __NR_semtimedop_time64 (__NR_Linux + 420)
353#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
354#define __NR_futex_time64 (__NR_Linux + 422)
355#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
356#define __NR_pidfd_send_signal (__NR_Linux + 424)
357#define __NR_io_uring_setup (__NR_Linux + 425)
358#define __NR_io_uring_enter (__NR_Linux + 426)
359#define __NR_io_uring_register (__NR_Linux + 427)
360#define __NR_open_tree (__NR_Linux + 428)
361#define __NR_move_mount (__NR_Linux + 429)
362#define __NR_fsopen (__NR_Linux + 430)
363#define __NR_fsconfig (__NR_Linux + 431)
364#define __NR_fsmount (__NR_Linux + 432)
365#define __NR_fspick (__NR_Linux + 433)
366#define __NR_pidfd_open (__NR_Linux + 434)
367#define __NR_clone3 (__NR_Linux + 435)
368#define __NR_close_range (__NR_Linux + 436)
369#define __NR_openat2 (__NR_Linux + 437)
370#define __NR_pidfd_getfd (__NR_Linux + 438)
371#define __NR_faccessat2 (__NR_Linux + 439)
372#define __NR_process_madvise (__NR_Linux + 440)
373#define __NR_epoll_pwait2 (__NR_Linux + 441)
374#define __NR_mount_setattr (__NR_Linux + 442)
375#define __NR_quotactl_fd (__NR_Linux + 443)
376#define __NR_landlock_create_ruleset (__NR_Linux + 444)
377#define __NR_landlock_add_rule (__NR_Linux + 445)
378#define __NR_landlock_restrict_self (__NR_Linux + 446)
379#define __NR_process_mrelease (__NR_Linux + 448)
380#define __NR_futex_waitv (__NR_Linux + 449)
381
382#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h created+358
...@@ -0,0 +1,358 @@
1#ifndef _ASM_UNISTD_N64_H
2#define _ASM_UNISTD_N64_H
3
4#define __NR_read (__NR_Linux + 0)
5#define __NR_write (__NR_Linux + 1)
6#define __NR_open (__NR_Linux + 2)
7#define __NR_close (__NR_Linux + 3)
8#define __NR_stat (__NR_Linux + 4)
9#define __NR_fstat (__NR_Linux + 5)
10#define __NR_lstat (__NR_Linux + 6)
11#define __NR_poll (__NR_Linux + 7)
12#define __NR_lseek (__NR_Linux + 8)
13#define __NR_mmap (__NR_Linux + 9)
14#define __NR_mprotect (__NR_Linux + 10)
15#define __NR_munmap (__NR_Linux + 11)
16#define __NR_brk (__NR_Linux + 12)
17#define __NR_rt_sigaction (__NR_Linux + 13)
18#define __NR_rt_sigprocmask (__NR_Linux + 14)
19#define __NR_ioctl (__NR_Linux + 15)
20#define __NR_pread64 (__NR_Linux + 16)
21#define __NR_pwrite64 (__NR_Linux + 17)
22#define __NR_readv (__NR_Linux + 18)
23#define __NR_writev (__NR_Linux + 19)
24#define __NR_access (__NR_Linux + 20)
25#define __NR_pipe (__NR_Linux + 21)
26#define __NR__newselect (__NR_Linux + 22)
27#define __NR_sched_yield (__NR_Linux + 23)
28#define __NR_mremap (__NR_Linux + 24)
29#define __NR_msync (__NR_Linux + 25)
30#define __NR_mincore (__NR_Linux + 26)
31#define __NR_madvise (__NR_Linux + 27)
32#define __NR_shmget (__NR_Linux + 28)
33#define __NR_shmat (__NR_Linux + 29)
34#define __NR_shmctl (__NR_Linux + 30)
35#define __NR_dup (__NR_Linux + 31)
36#define __NR_dup2 (__NR_Linux + 32)
37#define __NR_pause (__NR_Linux + 33)
38#define __NR_nanosleep (__NR_Linux + 34)
39#define __NR_getitimer (__NR_Linux + 35)
40#define __NR_setitimer (__NR_Linux + 36)
41#define __NR_alarm (__NR_Linux + 37)
42#define __NR_getpid (__NR_Linux + 38)
43#define __NR_sendfile (__NR_Linux + 39)
44#define __NR_socket (__NR_Linux + 40)
45#define __NR_connect (__NR_Linux + 41)
46#define __NR_accept (__NR_Linux + 42)
47#define __NR_sendto (__NR_Linux + 43)
48#define __NR_recvfrom (__NR_Linux + 44)
49#define __NR_sendmsg (__NR_Linux + 45)
50#define __NR_recvmsg (__NR_Linux + 46)
51#define __NR_shutdown (__NR_Linux + 47)
52#define __NR_bind (__NR_Linux + 48)
53#define __NR_listen (__NR_Linux + 49)
54#define __NR_getsockname (__NR_Linux + 50)
55#define __NR_getpeername (__NR_Linux + 51)
56#define __NR_socketpair (__NR_Linux + 52)
57#define __NR_setsockopt (__NR_Linux + 53)
58#define __NR_getsockopt (__NR_Linux + 54)
59#define __NR_clone (__NR_Linux + 55)
60#define __NR_fork (__NR_Linux + 56)
61#define __NR_execve (__NR_Linux + 57)
62#define __NR_exit (__NR_Linux + 58)
63#define __NR_wait4 (__NR_Linux + 59)
64#define __NR_kill (__NR_Linux + 60)
65#define __NR_uname (__NR_Linux + 61)
66#define __NR_semget (__NR_Linux + 62)
67#define __NR_semop (__NR_Linux + 63)
68#define __NR_semctl (__NR_Linux + 64)
69#define __NR_shmdt (__NR_Linux + 65)
70#define __NR_msgget (__NR_Linux + 66)
71#define __NR_msgsnd (__NR_Linux + 67)
72#define __NR_msgrcv (__NR_Linux + 68)
73#define __NR_msgctl (__NR_Linux + 69)
74#define __NR_fcntl (__NR_Linux + 70)
75#define __NR_flock (__NR_Linux + 71)
76#define __NR_fsync (__NR_Linux + 72)
77#define __NR_fdatasync (__NR_Linux + 73)
78#define __NR_truncate (__NR_Linux + 74)
79#define __NR_ftruncate (__NR_Linux + 75)
80#define __NR_getdents (__NR_Linux + 76)
81#define __NR_getcwd (__NR_Linux + 77)
82#define __NR_chdir (__NR_Linux + 78)
83#define __NR_fchdir (__NR_Linux + 79)
84#define __NR_rename (__NR_Linux + 80)
85#define __NR_mkdir (__NR_Linux + 81)
86#define __NR_rmdir (__NR_Linux + 82)
87#define __NR_creat (__NR_Linux + 83)
88#define __NR_link (__NR_Linux + 84)
89#define __NR_unlink (__NR_Linux + 85)
90#define __NR_symlink (__NR_Linux + 86)
91#define __NR_readlink (__NR_Linux + 87)
92#define __NR_chmod (__NR_Linux + 88)
93#define __NR_fchmod (__NR_Linux + 89)
94#define __NR_chown (__NR_Linux + 90)
95#define __NR_fchown (__NR_Linux + 91)
96#define __NR_lchown (__NR_Linux + 92)
97#define __NR_umask (__NR_Linux + 93)
98#define __NR_gettimeofday (__NR_Linux + 94)
99#define __NR_getrlimit (__NR_Linux + 95)
100#define __NR_getrusage (__NR_Linux + 96)
101#define __NR_sysinfo (__NR_Linux + 97)
102#define __NR_times (__NR_Linux + 98)
103#define __NR_ptrace (__NR_Linux + 99)
104#define __NR_getuid (__NR_Linux + 100)
105#define __NR_syslog (__NR_Linux + 101)
106#define __NR_getgid (__NR_Linux + 102)
107#define __NR_setuid (__NR_Linux + 103)
108#define __NR_setgid (__NR_Linux + 104)
109#define __NR_geteuid (__NR_Linux + 105)
110#define __NR_getegid (__NR_Linux + 106)
111#define __NR_setpgid (__NR_Linux + 107)
112#define __NR_getppid (__NR_Linux + 108)
113#define __NR_getpgrp (__NR_Linux + 109)
114#define __NR_setsid (__NR_Linux + 110)
115#define __NR_setreuid (__NR_Linux + 111)
116#define __NR_setregid (__NR_Linux + 112)
117#define __NR_getgroups (__NR_Linux + 113)
118#define __NR_setgroups (__NR_Linux + 114)
119#define __NR_setresuid (__NR_Linux + 115)
120#define __NR_getresuid (__NR_Linux + 116)
121#define __NR_setresgid (__NR_Linux + 117)
122#define __NR_getresgid (__NR_Linux + 118)
123#define __NR_getpgid (__NR_Linux + 119)
124#define __NR_setfsuid (__NR_Linux + 120)
125#define __NR_setfsgid (__NR_Linux + 121)
126#define __NR_getsid (__NR_Linux + 122)
127#define __NR_capget (__NR_Linux + 123)
128#define __NR_capset (__NR_Linux + 124)
129#define __NR_rt_sigpending (__NR_Linux + 125)
130#define __NR_rt_sigtimedwait (__NR_Linux + 126)
131#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
132#define __NR_rt_sigsuspend (__NR_Linux + 128)
133#define __NR_sigaltstack (__NR_Linux + 129)
134#define __NR_utime (__NR_Linux + 130)
135#define __NR_mknod (__NR_Linux + 131)
136#define __NR_personality (__NR_Linux + 132)
137#define __NR_ustat (__NR_Linux + 133)
138#define __NR_statfs (__NR_Linux + 134)
139#define __NR_fstatfs (__NR_Linux + 135)
140#define __NR_sysfs (__NR_Linux + 136)
141#define __NR_getpriority (__NR_Linux + 137)
142#define __NR_setpriority (__NR_Linux + 138)
143#define __NR_sched_setparam (__NR_Linux + 139)
144#define __NR_sched_getparam (__NR_Linux + 140)
145#define __NR_sched_setscheduler (__NR_Linux + 141)
146#define __NR_sched_getscheduler (__NR_Linux + 142)
147#define __NR_sched_get_priority_max (__NR_Linux + 143)
148#define __NR_sched_get_priority_min (__NR_Linux + 144)
149#define __NR_sched_rr_get_interval (__NR_Linux + 145)
150#define __NR_mlock (__NR_Linux + 146)
151#define __NR_munlock (__NR_Linux + 147)
152#define __NR_mlockall (__NR_Linux + 148)
153#define __NR_munlockall (__NR_Linux + 149)
154#define __NR_vhangup (__NR_Linux + 150)
155#define __NR_pivot_root (__NR_Linux + 151)
156#define __NR__sysctl (__NR_Linux + 152)
157#define __NR_prctl (__NR_Linux + 153)
158#define __NR_adjtimex (__NR_Linux + 154)
159#define __NR_setrlimit (__NR_Linux + 155)
160#define __NR_chroot (__NR_Linux + 156)
161#define __NR_sync (__NR_Linux + 157)
162#define __NR_acct (__NR_Linux + 158)
163#define __NR_settimeofday (__NR_Linux + 159)
164#define __NR_mount (__NR_Linux + 160)
165#define __NR_umount2 (__NR_Linux + 161)
166#define __NR_swapon (__NR_Linux + 162)
167#define __NR_swapoff (__NR_Linux + 163)
168#define __NR_reboot (__NR_Linux + 164)
169#define __NR_sethostname (__NR_Linux + 165)
170#define __NR_setdomainname (__NR_Linux + 166)
171#define __NR_create_module (__NR_Linux + 167)
172#define __NR_init_module (__NR_Linux + 168)
173#define __NR_delete_module (__NR_Linux + 169)
174#define __NR_get_kernel_syms (__NR_Linux + 170)
175#define __NR_query_module (__NR_Linux + 171)
176#define __NR_quotactl (__NR_Linux + 172)
177#define __NR_nfsservctl (__NR_Linux + 173)
178#define __NR_getpmsg (__NR_Linux + 174)
179#define __NR_putpmsg (__NR_Linux + 175)
180#define __NR_afs_syscall (__NR_Linux + 176)
181#define __NR_reserved177 (__NR_Linux + 177)
182#define __NR_gettid (__NR_Linux + 178)
183#define __NR_readahead (__NR_Linux + 179)
184#define __NR_setxattr (__NR_Linux + 180)
185#define __NR_lsetxattr (__NR_Linux + 181)
186#define __NR_fsetxattr (__NR_Linux + 182)
187#define __NR_getxattr (__NR_Linux + 183)
188#define __NR_lgetxattr (__NR_Linux + 184)
189#define __NR_fgetxattr (__NR_Linux + 185)
190#define __NR_listxattr (__NR_Linux + 186)
191#define __NR_llistxattr (__NR_Linux + 187)
192#define __NR_flistxattr (__NR_Linux + 188)
193#define __NR_removexattr (__NR_Linux + 189)
194#define __NR_lremovexattr (__NR_Linux + 190)
195#define __NR_fremovexattr (__NR_Linux + 191)
196#define __NR_tkill (__NR_Linux + 192)
197#define __NR_reserved193 (__NR_Linux + 193)
198#define __NR_futex (__NR_Linux + 194)
199#define __NR_sched_setaffinity (__NR_Linux + 195)
200#define __NR_sched_getaffinity (__NR_Linux + 196)
201#define __NR_cacheflush (__NR_Linux + 197)
202#define __NR_cachectl (__NR_Linux + 198)
203#define __NR_sysmips (__NR_Linux + 199)
204#define __NR_io_setup (__NR_Linux + 200)
205#define __NR_io_destroy (__NR_Linux + 201)
206#define __NR_io_getevents (__NR_Linux + 202)
207#define __NR_io_submit (__NR_Linux + 203)
208#define __NR_io_cancel (__NR_Linux + 204)
209#define __NR_exit_group (__NR_Linux + 205)
210#define __NR_lookup_dcookie (__NR_Linux + 206)
211#define __NR_epoll_create (__NR_Linux + 207)
212#define __NR_epoll_ctl (__NR_Linux + 208)
213#define __NR_epoll_wait (__NR_Linux + 209)
214#define __NR_remap_file_pages (__NR_Linux + 210)
215#define __NR_rt_sigreturn (__NR_Linux + 211)
216#define __NR_set_tid_address (__NR_Linux + 212)
217#define __NR_restart_syscall (__NR_Linux + 213)
218#define __NR_semtimedop (__NR_Linux + 214)
219#define __NR_fadvise64 (__NR_Linux + 215)
220#define __NR_timer_create (__NR_Linux + 216)
221#define __NR_timer_settime (__NR_Linux + 217)
222#define __NR_timer_gettime (__NR_Linux + 218)
223#define __NR_timer_getoverrun (__NR_Linux + 219)
224#define __NR_timer_delete (__NR_Linux + 220)
225#define __NR_clock_settime (__NR_Linux + 221)
226#define __NR_clock_gettime (__NR_Linux + 222)
227#define __NR_clock_getres (__NR_Linux + 223)
228#define __NR_clock_nanosleep (__NR_Linux + 224)
229#define __NR_tgkill (__NR_Linux + 225)
230#define __NR_utimes (__NR_Linux + 226)
231#define __NR_mbind (__NR_Linux + 227)
232#define __NR_get_mempolicy (__NR_Linux + 228)
233#define __NR_set_mempolicy (__NR_Linux + 229)
234#define __NR_mq_open (__NR_Linux + 230)
235#define __NR_mq_unlink (__NR_Linux + 231)
236#define __NR_mq_timedsend (__NR_Linux + 232)
237#define __NR_mq_timedreceive (__NR_Linux + 233)
238#define __NR_mq_notify (__NR_Linux + 234)
239#define __NR_mq_getsetattr (__NR_Linux + 235)
240#define __NR_vserver (__NR_Linux + 236)
241#define __NR_waitid (__NR_Linux + 237)
242#define __NR_add_key (__NR_Linux + 239)
243#define __NR_request_key (__NR_Linux + 240)
244#define __NR_keyctl (__NR_Linux + 241)
245#define __NR_set_thread_area (__NR_Linux + 242)
246#define __NR_inotify_init (__NR_Linux + 243)
247#define __NR_inotify_add_watch (__NR_Linux + 244)
248#define __NR_inotify_rm_watch (__NR_Linux + 245)
249#define __NR_migrate_pages (__NR_Linux + 246)
250#define __NR_openat (__NR_Linux + 247)
251#define __NR_mkdirat (__NR_Linux + 248)
252#define __NR_mknodat (__NR_Linux + 249)
253#define __NR_fchownat (__NR_Linux + 250)
254#define __NR_futimesat (__NR_Linux + 251)
255#define __NR_newfstatat (__NR_Linux + 252)
256#define __NR_unlinkat (__NR_Linux + 253)
257#define __NR_renameat (__NR_Linux + 254)
258#define __NR_linkat (__NR_Linux + 255)
259#define __NR_symlinkat (__NR_Linux + 256)
260#define __NR_readlinkat (__NR_Linux + 257)
261#define __NR_fchmodat (__NR_Linux + 258)
262#define __NR_faccessat (__NR_Linux + 259)
263#define __NR_pselect6 (__NR_Linux + 260)
264#define __NR_ppoll (__NR_Linux + 261)
265#define __NR_unshare (__NR_Linux + 262)
266#define __NR_splice (__NR_Linux + 263)
267#define __NR_sync_file_range (__NR_Linux + 264)
268#define __NR_tee (__NR_Linux + 265)
269#define __NR_vmsplice (__NR_Linux + 266)
270#define __NR_move_pages (__NR_Linux + 267)
271#define __NR_set_robust_list (__NR_Linux + 268)
272#define __NR_get_robust_list (__NR_Linux + 269)
273#define __NR_kexec_load (__NR_Linux + 270)
274#define __NR_getcpu (__NR_Linux + 271)
275#define __NR_epoll_pwait (__NR_Linux + 272)
276#define __NR_ioprio_set (__NR_Linux + 273)
277#define __NR_ioprio_get (__NR_Linux + 274)
278#define __NR_utimensat (__NR_Linux + 275)
279#define __NR_signalfd (__NR_Linux + 276)
280#define __NR_timerfd (__NR_Linux + 277)
281#define __NR_eventfd (__NR_Linux + 278)
282#define __NR_fallocate (__NR_Linux + 279)
283#define __NR_timerfd_create (__NR_Linux + 280)
284#define __NR_timerfd_gettime (__NR_Linux + 281)
285#define __NR_timerfd_settime (__NR_Linux + 282)
286#define __NR_signalfd4 (__NR_Linux + 283)
287#define __NR_eventfd2 (__NR_Linux + 284)
288#define __NR_epoll_create1 (__NR_Linux + 285)
289#define __NR_dup3 (__NR_Linux + 286)
290#define __NR_pipe2 (__NR_Linux + 287)
291#define __NR_inotify_init1 (__NR_Linux + 288)
292#define __NR_preadv (__NR_Linux + 289)
293#define __NR_pwritev (__NR_Linux + 290)
294#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
295#define __NR_perf_event_open (__NR_Linux + 292)
296#define __NR_accept4 (__NR_Linux + 293)
297#define __NR_recvmmsg (__NR_Linux + 294)
298#define __NR_fanotify_init (__NR_Linux + 295)
299#define __NR_fanotify_mark (__NR_Linux + 296)
300#define __NR_prlimit64 (__NR_Linux + 297)
301#define __NR_name_to_handle_at (__NR_Linux + 298)
302#define __NR_open_by_handle_at (__NR_Linux + 299)
303#define __NR_clock_adjtime (__NR_Linux + 300)
304#define __NR_syncfs (__NR_Linux + 301)
305#define __NR_sendmmsg (__NR_Linux + 302)
306#define __NR_setns (__NR_Linux + 303)
307#define __NR_process_vm_readv (__NR_Linux + 304)
308#define __NR_process_vm_writev (__NR_Linux + 305)
309#define __NR_kcmp (__NR_Linux + 306)
310#define __NR_finit_module (__NR_Linux + 307)
311#define __NR_getdents64 (__NR_Linux + 308)
312#define __NR_sched_setattr (__NR_Linux + 309)
313#define __NR_sched_getattr (__NR_Linux + 310)
314#define __NR_renameat2 (__NR_Linux + 311)
315#define __NR_seccomp (__NR_Linux + 312)
316#define __NR_getrandom (__NR_Linux + 313)
317#define __NR_memfd_create (__NR_Linux + 314)
318#define __NR_bpf (__NR_Linux + 315)
319#define __NR_execveat (__NR_Linux + 316)
320#define __NR_userfaultfd (__NR_Linux + 317)
321#define __NR_membarrier (__NR_Linux + 318)
322#define __NR_mlock2 (__NR_Linux + 319)
323#define __NR_copy_file_range (__NR_Linux + 320)
324#define __NR_preadv2 (__NR_Linux + 321)
325#define __NR_pwritev2 (__NR_Linux + 322)
326#define __NR_pkey_mprotect (__NR_Linux + 323)
327#define __NR_pkey_alloc (__NR_Linux + 324)
328#define __NR_pkey_free (__NR_Linux + 325)
329#define __NR_statx (__NR_Linux + 326)
330#define __NR_rseq (__NR_Linux + 327)
331#define __NR_io_pgetevents (__NR_Linux + 328)
332#define __NR_pidfd_send_signal (__NR_Linux + 424)
333#define __NR_io_uring_setup (__NR_Linux + 425)
334#define __NR_io_uring_enter (__NR_Linux + 426)
335#define __NR_io_uring_register (__NR_Linux + 427)
336#define __NR_open_tree (__NR_Linux + 428)
337#define __NR_move_mount (__NR_Linux + 429)
338#define __NR_fsopen (__NR_Linux + 430)
339#define __NR_fsconfig (__NR_Linux + 431)
340#define __NR_fsmount (__NR_Linux + 432)
341#define __NR_fspick (__NR_Linux + 433)
342#define __NR_pidfd_open (__NR_Linux + 434)
343#define __NR_clone3 (__NR_Linux + 435)
344#define __NR_close_range (__NR_Linux + 436)
345#define __NR_openat2 (__NR_Linux + 437)
346#define __NR_pidfd_getfd (__NR_Linux + 438)
347#define __NR_faccessat2 (__NR_Linux + 439)
348#define __NR_process_madvise (__NR_Linux + 440)
349#define __NR_epoll_pwait2 (__NR_Linux + 441)
350#define __NR_mount_setattr (__NR_Linux + 442)
351#define __NR_quotactl_fd (__NR_Linux + 443)
352#define __NR_landlock_create_ruleset (__NR_Linux + 444)
353#define __NR_landlock_add_rule (__NR_Linux + 445)
354#define __NR_landlock_restrict_self (__NR_Linux + 446)
355#define __NR_process_mrelease (__NR_Linux + 448)
356#define __NR_futex_waitv (__NR_Linux + 449)
357
358#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h created+428
...@@ -0,0 +1,428 @@
1#ifndef _ASM_UNISTD_O32_H
2#define _ASM_UNISTD_O32_H
3
4#define __NR_syscall (__NR_Linux + 0)
5#define __NR_exit (__NR_Linux + 1)
6#define __NR_fork (__NR_Linux + 2)
7#define __NR_read (__NR_Linux + 3)
8#define __NR_write (__NR_Linux + 4)
9#define __NR_open (__NR_Linux + 5)
10#define __NR_close (__NR_Linux + 6)
11#define __NR_waitpid (__NR_Linux + 7)
12#define __NR_creat (__NR_Linux + 8)
13#define __NR_link (__NR_Linux + 9)
14#define __NR_unlink (__NR_Linux + 10)
15#define __NR_execve (__NR_Linux + 11)
16#define __NR_chdir (__NR_Linux + 12)
17#define __NR_time (__NR_Linux + 13)
18#define __NR_mknod (__NR_Linux + 14)
19#define __NR_chmod (__NR_Linux + 15)
20#define __NR_lchown (__NR_Linux + 16)
21#define __NR_break (__NR_Linux + 17)
22#define __NR_unused18 (__NR_Linux + 18)
23#define __NR_lseek (__NR_Linux + 19)
24#define __NR_getpid (__NR_Linux + 20)
25#define __NR_mount (__NR_Linux + 21)
26#define __NR_umount (__NR_Linux + 22)
27#define __NR_setuid (__NR_Linux + 23)
28#define __NR_getuid (__NR_Linux + 24)
29#define __NR_stime (__NR_Linux + 25)
30#define __NR_ptrace (__NR_Linux + 26)
31#define __NR_alarm (__NR_Linux + 27)
32#define __NR_unused28 (__NR_Linux + 28)
33#define __NR_pause (__NR_Linux + 29)
34#define __NR_utime (__NR_Linux + 30)
35#define __NR_stty (__NR_Linux + 31)
36#define __NR_gtty (__NR_Linux + 32)
37#define __NR_access (__NR_Linux + 33)
38#define __NR_nice (__NR_Linux + 34)
39#define __NR_ftime (__NR_Linux + 35)
40#define __NR_sync (__NR_Linux + 36)
41#define __NR_kill (__NR_Linux + 37)
42#define __NR_rename (__NR_Linux + 38)
43#define __NR_mkdir (__NR_Linux + 39)
44#define __NR_rmdir (__NR_Linux + 40)
45#define __NR_dup (__NR_Linux + 41)
46#define __NR_pipe (__NR_Linux + 42)
47#define __NR_times (__NR_Linux + 43)
48#define __NR_prof (__NR_Linux + 44)
49#define __NR_brk (__NR_Linux + 45)
50#define __NR_setgid (__NR_Linux + 46)
51#define __NR_getgid (__NR_Linux + 47)
52#define __NR_signal (__NR_Linux + 48)
53#define __NR_geteuid (__NR_Linux + 49)
54#define __NR_getegid (__NR_Linux + 50)
55#define __NR_acct (__NR_Linux + 51)
56#define __NR_umount2 (__NR_Linux + 52)
57#define __NR_lock (__NR_Linux + 53)
58#define __NR_ioctl (__NR_Linux + 54)
59#define __NR_fcntl (__NR_Linux + 55)
60#define __NR_mpx (__NR_Linux + 56)
61#define __NR_setpgid (__NR_Linux + 57)
62#define __NR_ulimit (__NR_Linux + 58)
63#define __NR_unused59 (__NR_Linux + 59)
64#define __NR_umask (__NR_Linux + 60)
65#define __NR_chroot (__NR_Linux + 61)
66#define __NR_ustat (__NR_Linux + 62)
67#define __NR_dup2 (__NR_Linux + 63)
68#define __NR_getppid (__NR_Linux + 64)
69#define __NR_getpgrp (__NR_Linux + 65)
70#define __NR_setsid (__NR_Linux + 66)
71#define __NR_sigaction (__NR_Linux + 67)
72#define __NR_sgetmask (__NR_Linux + 68)
73#define __NR_ssetmask (__NR_Linux + 69)
74#define __NR_setreuid (__NR_Linux + 70)
75#define __NR_setregid (__NR_Linux + 71)
76#define __NR_sigsuspend (__NR_Linux + 72)
77#define __NR_sigpending (__NR_Linux + 73)
78#define __NR_sethostname (__NR_Linux + 74)
79#define __NR_setrlimit (__NR_Linux + 75)
80#define __NR_getrlimit (__NR_Linux + 76)
81#define __NR_getrusage (__NR_Linux + 77)
82#define __NR_gettimeofday (__NR_Linux + 78)
83#define __NR_settimeofday (__NR_Linux + 79)
84#define __NR_getgroups (__NR_Linux + 80)
85#define __NR_setgroups (__NR_Linux + 81)
86#define __NR_reserved82 (__NR_Linux + 82)
87#define __NR_symlink (__NR_Linux + 83)
88#define __NR_unused84 (__NR_Linux + 84)
89#define __NR_readlink (__NR_Linux + 85)
90#define __NR_uselib (__NR_Linux + 86)
91#define __NR_swapon (__NR_Linux + 87)
92#define __NR_reboot (__NR_Linux + 88)
93#define __NR_readdir (__NR_Linux + 89)
94#define __NR_mmap (__NR_Linux + 90)
95#define __NR_munmap (__NR_Linux + 91)
96#define __NR_truncate (__NR_Linux + 92)
97#define __NR_ftruncate (__NR_Linux + 93)
98#define __NR_fchmod (__NR_Linux + 94)
99#define __NR_fchown (__NR_Linux + 95)
100#define __NR_getpriority (__NR_Linux + 96)
101#define __NR_setpriority (__NR_Linux + 97)
102#define __NR_profil (__NR_Linux + 98)
103#define __NR_statfs (__NR_Linux + 99)
104#define __NR_fstatfs (__NR_Linux + 100)
105#define __NR_ioperm (__NR_Linux + 101)
106#define __NR_socketcall (__NR_Linux + 102)
107#define __NR_syslog (__NR_Linux + 103)
108#define __NR_setitimer (__NR_Linux + 104)
109#define __NR_getitimer (__NR_Linux + 105)
110#define __NR_stat (__NR_Linux + 106)
111#define __NR_lstat (__NR_Linux + 107)
112#define __NR_fstat (__NR_Linux + 108)
113#define __NR_unused109 (__NR_Linux + 109)
114#define __NR_iopl (__NR_Linux + 110)
115#define __NR_vhangup (__NR_Linux + 111)
116#define __NR_idle (__NR_Linux + 112)
117#define __NR_vm86 (__NR_Linux + 113)
118#define __NR_wait4 (__NR_Linux + 114)
119#define __NR_swapoff (__NR_Linux + 115)
120#define __NR_sysinfo (__NR_Linux + 116)
121#define __NR_ipc (__NR_Linux + 117)
122#define __NR_fsync (__NR_Linux + 118)
123#define __NR_sigreturn (__NR_Linux + 119)
124#define __NR_clone (__NR_Linux + 120)
125#define __NR_setdomainname (__NR_Linux + 121)
126#define __NR_uname (__NR_Linux + 122)
127#define __NR_modify_ldt (__NR_Linux + 123)
128#define __NR_adjtimex (__NR_Linux + 124)
129#define __NR_mprotect (__NR_Linux + 125)
130#define __NR_sigprocmask (__NR_Linux + 126)
131#define __NR_create_module (__NR_Linux + 127)
132#define __NR_init_module (__NR_Linux + 128)
133#define __NR_delete_module (__NR_Linux + 129)
134#define __NR_get_kernel_syms (__NR_Linux + 130)
135#define __NR_quotactl (__NR_Linux + 131)
136#define __NR_getpgid (__NR_Linux + 132)
137#define __NR_fchdir (__NR_Linux + 133)
138#define __NR_bdflush (__NR_Linux + 134)
139#define __NR_sysfs (__NR_Linux + 135)
140#define __NR_personality (__NR_Linux + 136)
141#define __NR_afs_syscall (__NR_Linux + 137)
142#define __NR_setfsuid (__NR_Linux + 138)
143#define __NR_setfsgid (__NR_Linux + 139)
144#define __NR__llseek (__NR_Linux + 140)
145#define __NR_getdents (__NR_Linux + 141)
146#define __NR__newselect (__NR_Linux + 142)
147#define __NR_flock (__NR_Linux + 143)
148#define __NR_msync (__NR_Linux + 144)
149#define __NR_readv (__NR_Linux + 145)
150#define __NR_writev (__NR_Linux + 146)
151#define __NR_cacheflush (__NR_Linux + 147)
152#define __NR_cachectl (__NR_Linux + 148)
153#define __NR_sysmips (__NR_Linux + 149)
154#define __NR_unused150 (__NR_Linux + 150)
155#define __NR_getsid (__NR_Linux + 151)
156#define __NR_fdatasync (__NR_Linux + 152)
157#define __NR__sysctl (__NR_Linux + 153)
158#define __NR_mlock (__NR_Linux + 154)
159#define __NR_munlock (__NR_Linux + 155)
160#define __NR_mlockall (__NR_Linux + 156)
161#define __NR_munlockall (__NR_Linux + 157)
162#define __NR_sched_setparam (__NR_Linux + 158)
163#define __NR_sched_getparam (__NR_Linux + 159)
164#define __NR_sched_setscheduler (__NR_Linux + 160)
165#define __NR_sched_getscheduler (__NR_Linux + 161)
166#define __NR_sched_yield (__NR_Linux + 162)
167#define __NR_sched_get_priority_max (__NR_Linux + 163)
168#define __NR_sched_get_priority_min (__NR_Linux + 164)
169#define __NR_sched_rr_get_interval (__NR_Linux + 165)
170#define __NR_nanosleep (__NR_Linux + 166)
171#define __NR_mremap (__NR_Linux + 167)
172#define __NR_accept (__NR_Linux + 168)
173#define __NR_bind (__NR_Linux + 169)
174#define __NR_connect (__NR_Linux + 170)
175#define __NR_getpeername (__NR_Linux + 171)
176#define __NR_getsockname (__NR_Linux + 172)
177#define __NR_getsockopt (__NR_Linux + 173)
178#define __NR_listen (__NR_Linux + 174)
179#define __NR_recv (__NR_Linux + 175)
180#define __NR_recvfrom (__NR_Linux + 176)
181#define __NR_recvmsg (__NR_Linux + 177)
182#define __NR_send (__NR_Linux + 178)
183#define __NR_sendmsg (__NR_Linux + 179)
184#define __NR_sendto (__NR_Linux + 180)
185#define __NR_setsockopt (__NR_Linux + 181)
186#define __NR_shutdown (__NR_Linux + 182)
187#define __NR_socket (__NR_Linux + 183)
188#define __NR_socketpair (__NR_Linux + 184)
189#define __NR_setresuid (__NR_Linux + 185)
190#define __NR_getresuid (__NR_Linux + 186)
191#define __NR_query_module (__NR_Linux + 187)
192#define __NR_poll (__NR_Linux + 188)
193#define __NR_nfsservctl (__NR_Linux + 189)
194#define __NR_setresgid (__NR_Linux + 190)
195#define __NR_getresgid (__NR_Linux + 191)
196#define __NR_prctl (__NR_Linux + 192)
197#define __NR_rt_sigreturn (__NR_Linux + 193)
198#define __NR_rt_sigaction (__NR_Linux + 194)
199#define __NR_rt_sigprocmask (__NR_Linux + 195)
200#define __NR_rt_sigpending (__NR_Linux + 196)
201#define __NR_rt_sigtimedwait (__NR_Linux + 197)
202#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
203#define __NR_rt_sigsuspend (__NR_Linux + 199)
204#define __NR_pread64 (__NR_Linux + 200)
205#define __NR_pwrite64 (__NR_Linux + 201)
206#define __NR_chown (__NR_Linux + 202)
207#define __NR_getcwd (__NR_Linux + 203)
208#define __NR_capget (__NR_Linux + 204)
209#define __NR_capset (__NR_Linux + 205)
210#define __NR_sigaltstack (__NR_Linux + 206)
211#define __NR_sendfile (__NR_Linux + 207)
212#define __NR_getpmsg (__NR_Linux + 208)
213#define __NR_putpmsg (__NR_Linux + 209)
214#define __NR_mmap2 (__NR_Linux + 210)
215#define __NR_truncate64 (__NR_Linux + 211)
216#define __NR_ftruncate64 (__NR_Linux + 212)
217#define __NR_stat64 (__NR_Linux + 213)
218#define __NR_lstat64 (__NR_Linux + 214)
219#define __NR_fstat64 (__NR_Linux + 215)
220#define __NR_pivot_root (__NR_Linux + 216)
221#define __NR_mincore (__NR_Linux + 217)
222#define __NR_madvise (__NR_Linux + 218)
223#define __NR_getdents64 (__NR_Linux + 219)
224#define __NR_fcntl64 (__NR_Linux + 220)
225#define __NR_reserved221 (__NR_Linux + 221)
226#define __NR_gettid (__NR_Linux + 222)
227#define __NR_readahead (__NR_Linux + 223)
228#define __NR_setxattr (__NR_Linux + 224)
229#define __NR_lsetxattr (__NR_Linux + 225)
230#define __NR_fsetxattr (__NR_Linux + 226)
231#define __NR_getxattr (__NR_Linux + 227)
232#define __NR_lgetxattr (__NR_Linux + 228)
233#define __NR_fgetxattr (__NR_Linux + 229)
234#define __NR_listxattr (__NR_Linux + 230)
235#define __NR_llistxattr (__NR_Linux + 231)
236#define __NR_flistxattr (__NR_Linux + 232)
237#define __NR_removexattr (__NR_Linux + 233)
238#define __NR_lremovexattr (__NR_Linux + 234)
239#define __NR_fremovexattr (__NR_Linux + 235)
240#define __NR_tkill (__NR_Linux + 236)
241#define __NR_sendfile64 (__NR_Linux + 237)
242#define __NR_futex (__NR_Linux + 238)
243#define __NR_sched_setaffinity (__NR_Linux + 239)
244#define __NR_sched_getaffinity (__NR_Linux + 240)
245#define __NR_io_setup (__NR_Linux + 241)
246#define __NR_io_destroy (__NR_Linux + 242)
247#define __NR_io_getevents (__NR_Linux + 243)
248#define __NR_io_submit (__NR_Linux + 244)
249#define __NR_io_cancel (__NR_Linux + 245)
250#define __NR_exit_group (__NR_Linux + 246)
251#define __NR_lookup_dcookie (__NR_Linux + 247)
252#define __NR_epoll_create (__NR_Linux + 248)
253#define __NR_epoll_ctl (__NR_Linux + 249)
254#define __NR_epoll_wait (__NR_Linux + 250)
255#define __NR_remap_file_pages (__NR_Linux + 251)
256#define __NR_set_tid_address (__NR_Linux + 252)
257#define __NR_restart_syscall (__NR_Linux + 253)
258#define __NR_fadvise64 (__NR_Linux + 254)
259#define __NR_statfs64 (__NR_Linux + 255)
260#define __NR_fstatfs64 (__NR_Linux + 256)
261#define __NR_timer_create (__NR_Linux + 257)
262#define __NR_timer_settime (__NR_Linux + 258)
263#define __NR_timer_gettime (__NR_Linux + 259)
264#define __NR_timer_getoverrun (__NR_Linux + 260)
265#define __NR_timer_delete (__NR_Linux + 261)
266#define __NR_clock_settime (__NR_Linux + 262)
267#define __NR_clock_gettime (__NR_Linux + 263)
268#define __NR_clock_getres (__NR_Linux + 264)
269#define __NR_clock_nanosleep (__NR_Linux + 265)
270#define __NR_tgkill (__NR_Linux + 266)
271#define __NR_utimes (__NR_Linux + 267)
272#define __NR_mbind (__NR_Linux + 268)
273#define __NR_get_mempolicy (__NR_Linux + 269)
274#define __NR_set_mempolicy (__NR_Linux + 270)
275#define __NR_mq_open (__NR_Linux + 271)
276#define __NR_mq_unlink (__NR_Linux + 272)
277#define __NR_mq_timedsend (__NR_Linux + 273)
278#define __NR_mq_timedreceive (__NR_Linux + 274)
279#define __NR_mq_notify (__NR_Linux + 275)
280#define __NR_mq_getsetattr (__NR_Linux + 276)
281#define __NR_vserver (__NR_Linux + 277)
282#define __NR_waitid (__NR_Linux + 278)
283#define __NR_add_key (__NR_Linux + 280)
284#define __NR_request_key (__NR_Linux + 281)
285#define __NR_keyctl (__NR_Linux + 282)
286#define __NR_set_thread_area (__NR_Linux + 283)
287#define __NR_inotify_init (__NR_Linux + 284)
288#define __NR_inotify_add_watch (__NR_Linux + 285)
289#define __NR_inotify_rm_watch (__NR_Linux + 286)
290#define __NR_migrate_pages (__NR_Linux + 287)
291#define __NR_openat (__NR_Linux + 288)
292#define __NR_mkdirat (__NR_Linux + 289)
293#define __NR_mknodat (__NR_Linux + 290)
294#define __NR_fchownat (__NR_Linux + 291)
295#define __NR_futimesat (__NR_Linux + 292)
296#define __NR_fstatat64 (__NR_Linux + 293)
297#define __NR_unlinkat (__NR_Linux + 294)
298#define __NR_renameat (__NR_Linux + 295)
299#define __NR_linkat (__NR_Linux + 296)
300#define __NR_symlinkat (__NR_Linux + 297)
301#define __NR_readlinkat (__NR_Linux + 298)
302#define __NR_fchmodat (__NR_Linux + 299)
303#define __NR_faccessat (__NR_Linux + 300)
304#define __NR_pselect6 (__NR_Linux + 301)
305#define __NR_ppoll (__NR_Linux + 302)
306#define __NR_unshare (__NR_Linux + 303)
307#define __NR_splice (__NR_Linux + 304)
308#define __NR_sync_file_range (__NR_Linux + 305)
309#define __NR_tee (__NR_Linux + 306)
310#define __NR_vmsplice (__NR_Linux + 307)
311#define __NR_move_pages (__NR_Linux + 308)
312#define __NR_set_robust_list (__NR_Linux + 309)
313#define __NR_get_robust_list (__NR_Linux + 310)
314#define __NR_kexec_load (__NR_Linux + 311)
315#define __NR_getcpu (__NR_Linux + 312)
316#define __NR_epoll_pwait (__NR_Linux + 313)
317#define __NR_ioprio_set (__NR_Linux + 314)
318#define __NR_ioprio_get (__NR_Linux + 315)
319#define __NR_utimensat (__NR_Linux + 316)
320#define __NR_signalfd (__NR_Linux + 317)
321#define __NR_timerfd (__NR_Linux + 318)
322#define __NR_eventfd (__NR_Linux + 319)
323#define __NR_fallocate (__NR_Linux + 320)
324#define __NR_timerfd_create (__NR_Linux + 321)
325#define __NR_timerfd_gettime (__NR_Linux + 322)
326#define __NR_timerfd_settime (__NR_Linux + 323)
327#define __NR_signalfd4 (__NR_Linux + 324)
328#define __NR_eventfd2 (__NR_Linux + 325)
329#define __NR_epoll_create1 (__NR_Linux + 326)
330#define __NR_dup3 (__NR_Linux + 327)
331#define __NR_pipe2 (__NR_Linux + 328)
332#define __NR_inotify_init1 (__NR_Linux + 329)
333#define __NR_preadv (__NR_Linux + 330)
334#define __NR_pwritev (__NR_Linux + 331)
335#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
336#define __NR_perf_event_open (__NR_Linux + 333)
337#define __NR_accept4 (__NR_Linux + 334)
338#define __NR_recvmmsg (__NR_Linux + 335)
339#define __NR_fanotify_init (__NR_Linux + 336)
340#define __NR_fanotify_mark (__NR_Linux + 337)
341#define __NR_prlimit64 (__NR_Linux + 338)
342#define __NR_name_to_handle_at (__NR_Linux + 339)
343#define __NR_open_by_handle_at (__NR_Linux + 340)
344#define __NR_clock_adjtime (__NR_Linux + 341)
345#define __NR_syncfs (__NR_Linux + 342)
346#define __NR_sendmmsg (__NR_Linux + 343)
347#define __NR_setns (__NR_Linux + 344)
348#define __NR_process_vm_readv (__NR_Linux + 345)
349#define __NR_process_vm_writev (__NR_Linux + 346)
350#define __NR_kcmp (__NR_Linux + 347)
351#define __NR_finit_module (__NR_Linux + 348)
352#define __NR_sched_setattr (__NR_Linux + 349)
353#define __NR_sched_getattr (__NR_Linux + 350)
354#define __NR_renameat2 (__NR_Linux + 351)
355#define __NR_seccomp (__NR_Linux + 352)
356#define __NR_getrandom (__NR_Linux + 353)
357#define __NR_memfd_create (__NR_Linux + 354)
358#define __NR_bpf (__NR_Linux + 355)
359#define __NR_execveat (__NR_Linux + 356)
360#define __NR_userfaultfd (__NR_Linux + 357)
361#define __NR_membarrier (__NR_Linux + 358)
362#define __NR_mlock2 (__NR_Linux + 359)
363#define __NR_copy_file_range (__NR_Linux + 360)
364#define __NR_preadv2 (__NR_Linux + 361)
365#define __NR_pwritev2 (__NR_Linux + 362)
366#define __NR_pkey_mprotect (__NR_Linux + 363)
367#define __NR_pkey_alloc (__NR_Linux + 364)
368#define __NR_pkey_free (__NR_Linux + 365)
369#define __NR_statx (__NR_Linux + 366)
370#define __NR_rseq (__NR_Linux + 367)
371#define __NR_io_pgetevents (__NR_Linux + 368)
372#define __NR_semget (__NR_Linux + 393)
373#define __NR_semctl (__NR_Linux + 394)
374#define __NR_shmget (__NR_Linux + 395)
375#define __NR_shmctl (__NR_Linux + 396)
376#define __NR_shmat (__NR_Linux + 397)
377#define __NR_shmdt (__NR_Linux + 398)
378#define __NR_msgget (__NR_Linux + 399)
379#define __NR_msgsnd (__NR_Linux + 400)
380#define __NR_msgrcv (__NR_Linux + 401)
381#define __NR_msgctl (__NR_Linux + 402)
382#define __NR_clock_gettime64 (__NR_Linux + 403)
383#define __NR_clock_settime64 (__NR_Linux + 404)
384#define __NR_clock_adjtime64 (__NR_Linux + 405)
385#define __NR_clock_getres_time64 (__NR_Linux + 406)
386#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
387#define __NR_timer_gettime64 (__NR_Linux + 408)
388#define __NR_timer_settime64 (__NR_Linux + 409)
389#define __NR_timerfd_gettime64 (__NR_Linux + 410)
390#define __NR_timerfd_settime64 (__NR_Linux + 411)
391#define __NR_utimensat_time64 (__NR_Linux + 412)
392#define __NR_pselect6_time64 (__NR_Linux + 413)
393#define __NR_ppoll_time64 (__NR_Linux + 414)
394#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
395#define __NR_recvmmsg_time64 (__NR_Linux + 417)
396#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
397#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
398#define __NR_semtimedop_time64 (__NR_Linux + 420)
399#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
400#define __NR_futex_time64 (__NR_Linux + 422)
401#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
402#define __NR_pidfd_send_signal (__NR_Linux + 424)
403#define __NR_io_uring_setup (__NR_Linux + 425)
404#define __NR_io_uring_enter (__NR_Linux + 426)
405#define __NR_io_uring_register (__NR_Linux + 427)
406#define __NR_open_tree (__NR_Linux + 428)
407#define __NR_move_mount (__NR_Linux + 429)
408#define __NR_fsopen (__NR_Linux + 430)
409#define __NR_fsconfig (__NR_Linux + 431)
410#define __NR_fsmount (__NR_Linux + 432)
411#define __NR_fspick (__NR_Linux + 433)
412#define __NR_pidfd_open (__NR_Linux + 434)
413#define __NR_clone3 (__NR_Linux + 435)
414#define __NR_close_range (__NR_Linux + 436)
415#define __NR_openat2 (__NR_Linux + 437)
416#define __NR_pidfd_getfd (__NR_Linux + 438)
417#define __NR_faccessat2 (__NR_Linux + 439)
418#define __NR_process_madvise (__NR_Linux + 440)
419#define __NR_epoll_pwait2 (__NR_Linux + 441)
420#define __NR_mount_setattr (__NR_Linux + 442)
421#define __NR_quotactl_fd (__NR_Linux + 443)
422#define __NR_landlock_create_ruleset (__NR_Linux + 444)
423#define __NR_landlock_add_rule (__NR_Linux + 445)
424#define __NR_landlock_restrict_self (__NR_Linux + 446)
425#define __NR_process_mrelease (__NR_Linux + 448)
426#define __NR_futex_waitv (__NR_Linux + 449)
427
428#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/auxvec.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 Imagination Technologies
4 * Author: Alex Smith <alex.smith@imgtec.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __ASM_AUXVEC_H
13#define __ASM_AUXVEC_H
14
15/* Location of VDSO image. */
16#define AT_SYSINFO_EHDR 33
17
18#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
19
20#endif /* __ASM_AUXVEC_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/bitsperlong.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_MIPS_BITSPERLONG_H
3#define __ASM_MIPS_BITSPERLONG_H
4
5#define __BITS_PER_LONG _MIPS_SZLONG
6
7#include <asm-generic/bitsperlong.h>
8
9#endif /* __ASM_MIPS_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/byteorder.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_BYTEORDER_H
10#define _ASM_BYTEORDER_H
11
12#if defined(__MIPSEB__)
13#include <linux/byteorder/big_endian.h>
14#elif defined(__MIPSEL__)
15#include <linux/byteorder/little_endian.h>
16#else
17# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
18#endif
19
20#endif /* _ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/errno.h deleted-130
...@@ -1,130 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_ERRNO_H
10#define _ASM_ERRNO_H
11
12/*
13 * These error numbers are intended to be MIPS ABI compatible
14 */
15
16#include <asm-generic/errno-base.h>
17
18#define ENOMSG 35 /* No message of desired type */
19#define EIDRM 36 /* Identifier removed */
20#define ECHRNG 37 /* Channel number out of range */
21#define EL2NSYNC 38 /* Level 2 not synchronized */
22#define EL3HLT 39 /* Level 3 halted */
23#define EL3RST 40 /* Level 3 reset */
24#define ELNRNG 41 /* Link number out of range */
25#define EUNATCH 42 /* Protocol driver not attached */
26#define ENOCSI 43 /* No CSI structure available */
27#define EL2HLT 44 /* Level 2 halted */
28#define EDEADLK 45 /* Resource deadlock would occur */
29#define ENOLCK 46 /* No record locks available */
30#define EBADE 50 /* Invalid exchange */
31#define EBADR 51 /* Invalid request descriptor */
32#define EXFULL 52 /* Exchange full */
33#define ENOANO 53 /* No anode */
34#define EBADRQC 54 /* Invalid request code */
35#define EBADSLT 55 /* Invalid slot */
36#define EDEADLOCK 56 /* File locking deadlock error */
37#define EBFONT 59 /* Bad font file format */
38#define ENOSTR 60 /* Device not a stream */
39#define ENODATA 61 /* No data available */
40#define ETIME 62 /* Timer expired */
41#define ENOSR 63 /* Out of streams resources */
42#define ENONET 64 /* Machine is not on the network */
43#define ENOPKG 65 /* Package not installed */
44#define EREMOTE 66 /* Object is remote */
45#define ENOLINK 67 /* Link has been severed */
46#define EADV 68 /* Advertise error */
47#define ESRMNT 69 /* Srmount error */
48#define ECOMM 70 /* Communication error on send */
49#define EPROTO 71 /* Protocol error */
50#define EDOTDOT 73 /* RFS specific error */
51#define EMULTIHOP 74 /* Multihop attempted */
52#define EBADMSG 77 /* Not a data message */
53#define ENAMETOOLONG 78 /* File name too long */
54#define EOVERFLOW 79 /* Value too large for defined data type */
55#define ENOTUNIQ 80 /* Name not unique on network */
56#define EBADFD 81 /* File descriptor in bad state */
57#define EREMCHG 82 /* Remote address changed */
58#define ELIBACC 83 /* Can not access a needed shared library */
59#define ELIBBAD 84 /* Accessing a corrupted shared library */
60#define ELIBSCN 85 /* .lib section in a.out corrupted */
61#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
62#define ELIBEXEC 87 /* Cannot exec a shared library directly */
63#define EILSEQ 88 /* Illegal byte sequence */
64#define ENOSYS 89 /* Function not implemented */
65#define ELOOP 90 /* Too many symbolic links encountered */
66#define ERESTART 91 /* Interrupted system call should be restarted */
67#define ESTRPIPE 92 /* Streams pipe error */
68#define ENOTEMPTY 93 /* Directory not empty */
69#define EUSERS 94 /* Too many users */
70#define ENOTSOCK 95 /* Socket operation on non-socket */
71#define EDESTADDRREQ 96 /* Destination address required */
72#define EMSGSIZE 97 /* Message too long */
73#define EPROTOTYPE 98 /* Protocol wrong type for socket */
74#define ENOPROTOOPT 99 /* Protocol not available */
75#define EPROTONOSUPPORT 120 /* Protocol not supported */
76#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
77#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
78#define EPFNOSUPPORT 123 /* Protocol family not supported */
79#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
80#define EADDRINUSE 125 /* Address already in use */
81#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
82#define ENETDOWN 127 /* Network is down */
83#define ENETUNREACH 128 /* Network is unreachable */
84#define ENETRESET 129 /* Network dropped connection because of reset */
85#define ECONNABORTED 130 /* Software caused connection abort */
86#define ECONNRESET 131 /* Connection reset by peer */
87#define ENOBUFS 132 /* No buffer space available */
88#define EISCONN 133 /* Transport endpoint is already connected */
89#define ENOTCONN 134 /* Transport endpoint is not connected */
90#define EUCLEAN 135 /* Structure needs cleaning */
91#define ENOTNAM 137 /* Not a XENIX named type file */
92#define ENAVAIL 138 /* No XENIX semaphores available */
93#define EISNAM 139 /* Is a named type file */
94#define EREMOTEIO 140 /* Remote I/O error */
95#define EINIT 141 /* Reserved */
96#define EREMDEV 142 /* Error 142 */
97#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
98#define ETOOMANYREFS 144 /* Too many references: cannot splice */
99#define ETIMEDOUT 145 /* Connection timed out */
100#define ECONNREFUSED 146 /* Connection refused */
101#define EHOSTDOWN 147 /* Host is down */
102#define EHOSTUNREACH 148 /* No route to host */
103#define EWOULDBLOCK EAGAIN /* Operation would block */
104#define EALREADY 149 /* Operation already in progress */
105#define EINPROGRESS 150 /* Operation now in progress */
106#define ESTALE 151 /* Stale file handle */
107#define ECANCELED 158 /* AIO operation canceled */
108
109/*
110 * These error are Linux extensions.
111 */
112#define ENOMEDIUM 159 /* No medium found */
113#define EMEDIUMTYPE 160 /* Wrong medium type */
114#define ENOKEY 161 /* Required key not available */
115#define EKEYEXPIRED 162 /* Key has expired */
116#define EKEYREVOKED 163 /* Key has been revoked */
117#define EKEYREJECTED 164 /* Key was rejected by service */
118
119/* for robust mutexes */
120#define EOWNERDEAD 165 /* Owner died */
121#define ENOTRECOVERABLE 166 /* State not recoverable */
122
123#define ERFKILL 167 /* Operation not possible due to RF-kill */
124
125#define EHWPOISON 168 /* Memory page has hardware error */
126
127#define EDQUOT 1133 /* Quota exceeded */
128
129
130#endif /* _ASM_ERRNO_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/fcntl.h deleted-80
...@@ -1,80 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
8 */
9#ifndef _ASM_FCNTL_H
10#define _ASM_FCNTL_H
11
12#include <asm/sgidefs.h>
13
14#define O_APPEND 0x0008
15#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */
16#define O_NONBLOCK 0x0080
17#define O_CREAT 0x0100 /* not fcntl */
18#define O_TRUNC 0x0200 /* not fcntl */
19#define O_EXCL 0x0400 /* not fcntl */
20#define O_NOCTTY 0x0800 /* not fcntl */
21#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
22#define O_LARGEFILE 0x2000 /* allow large file opens */
23/*
24 * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
25 * the O_SYNC flag. We continue to use the existing numerical value
26 * for O_DSYNC semantics now, but using the correct symbolic name for it.
27 * This new value is used to request true Posix O_SYNC semantics. It is
28 * defined in this strange way to make sure applications compiled against
29 * new headers get at least O_DSYNC semantics on older kernels.
30 *
31 * This has the nice side-effect that we can simply test for O_DSYNC
32 * wherever we do not care if O_DSYNC or O_SYNC is used.
33 *
34 * Note: __O_SYNC must never be used directly.
35 */
36#define __O_SYNC 0x4000
37#define O_SYNC (__O_SYNC|O_DSYNC)
38#define O_DIRECT 0x8000 /* direct disk access hint */
39
40#define F_GETLK 14
41#define F_SETLK 6
42#define F_SETLKW 7
43
44#define F_SETOWN 24 /* for sockets. */
45#define F_GETOWN 23 /* for sockets. */
46
47#ifndef __mips64
48#define F_GETLK64 33 /* using 'struct flock64' */
49#define F_SETLK64 34
50#define F_SETLKW64 35
51#endif
52
53/*
54 * The flavours of struct flock. "struct flock" is the ABI compliant
55 * variant. Finally struct flock64 is the LFS variant of struct flock. As
56 * a historic accident and inconsistence with the ABI definition it doesn't
57 * contain all the same fields as struct flock.
58 */
59
60#if _MIPS_SIM != _MIPS_SIM_ABI64
61
62#include <linux/types.h>
63
64struct flock {
65 short l_type;
66 short l_whence;
67 __kernel_off_t l_start;
68 __kernel_off_t l_len;
69 long l_sysid;
70 __kernel_pid_t l_pid;
71 long pad[4];
72};
73
74#define HAVE_ARCH_STRUCT_FLOCK
75
76#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
77
78#include <asm-generic/fcntl.h>
79
80#endif /* _ASM_FCNTL_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/hwcap.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_HWCAP_H
3#define _ASM_HWCAP_H
4
5/* HWCAP flags */
6#define HWCAP_MIPS_R6 (1 << 0)
7#define HWCAP_MIPS_MSA (1 << 1)
8#define HWCAP_MIPS_CRC32 (1 << 2)
9
10#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/ioctl.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle <ralf@linux-mips.org>
8 * Copyright (C) 2009 Wind River Systems
9 * Written by Ralf Baechle <ralf@linux-mips.org>
10 */
11#ifndef __ASM_IOCTL_H
12#define __ASM_IOCTL_H
13
14#define _IOC_SIZEBITS 13
15#define _IOC_DIRBITS 3
16
17/*
18 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
19 * And this turns out useful to catch old ioctl numbers in header
20 * files for us.
21 */
22#define _IOC_NONE 1U
23#define _IOC_READ 2U
24#define _IOC_WRITE 4U
25
26#include <asm-generic/ioctl.h>
27
28#endif /* __ASM_IOCTL_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/ioctls.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef __ASM_IOCTLS_H
11#define __ASM_IOCTLS_H
12
13#include <asm/ioctl.h>
14
15#define TCGETA 0x5401
16#define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
17#define TCSETAW 0x5403
18#define TCSETAF 0x5404
19
20#define TCSBRK 0x5405
21#define TCXONC 0x5406
22#define TCFLSH 0x5407
23
24#define TCGETS 0x540d
25#define TCSETS 0x540e
26#define TCSETSW 0x540f
27#define TCSETSF 0x5410
28
29#define TIOCEXCL 0x740d /* set exclusive use of tty */
30#define TIOCNXCL 0x740e /* reset exclusive use of tty */
31#define TIOCOUTQ 0x7472 /* output queue size */
32#define TIOCSTI 0x5472 /* simulate terminal input */
33#define TIOCMGET 0x741d /* get all modem bits */
34#define TIOCMBIS 0x741b /* bis modem bits */
35#define TIOCMBIC 0x741c /* bic modem bits */
36#define TIOCMSET 0x741a /* set all modem bits */
37#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
38#define TIOCPKT_DATA 0x00 /* data packet */
39#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
40#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
41#define TIOCPKT_STOP 0x04 /* stop output */
42#define TIOCPKT_START 0x08 /* start output */
43#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
44#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
45#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
46#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
47#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
48#define TIOCNOTTY 0x5471 /* void tty association */
49#define TIOCSETD 0x7401
50#define TIOCGETD 0x7400
51
52#define FIOCLEX 0x6601
53#define FIONCLEX 0x6602
54#define FIOASYNC 0x667d
55#define FIONBIO 0x667e
56#define FIOQSIZE 0x667f
57
58#define TIOCGLTC 0x7474 /* get special local chars */
59#define TIOCSLTC 0x7475 /* set special local chars */
60#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
61#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
62#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
63
64#define FIONREAD 0x467f
65#define TIOCINQ FIONREAD
66
67#define TIOCGETP 0x7408
68#define TIOCSETP 0x7409
69#define TIOCSETN 0x740a /* TIOCSETP wo flush */
70
71/* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */
72/* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */
73/* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */
74/* #define TIOCGETD _IOR('t', 26, int) get line discipline */
75/* #define TIOCSETD _IOW('t', 27, int) set line discipline */
76 /* 127-124 compat */
77
78#define TIOCSBRK 0x5427 /* BSD compatibility */
79#define TIOCCBRK 0x5428 /* BSD compatibility */
80#define TIOCGSID 0x7416 /* Return the session ID of FD */
81#define TCGETS2 _IOR('T', 0x2A, struct termios2)
82#define TCSETS2 _IOW('T', 0x2B, struct termios2)
83#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
84#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
85#define TIOCGRS485 _IOR('T', 0x2E, struct serial_rs485)
86#define TIOCSRS485 _IOWR('T', 0x2F, struct serial_rs485)
87#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
88#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
89#define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
90#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
91#define TIOCVHANGUP 0x5437
92#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
93#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
94#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
95#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
96
97/* I hope the range from 0x5480 on is free ... */
98#define TIOCSCTTY 0x5480 /* become controlling tty */
99#define TIOCGSOFTCAR 0x5481
100#define TIOCSSOFTCAR 0x5482
101#define TIOCLINUX 0x5483
102#define TIOCGSERIAL 0x5484
103#define TIOCSSERIAL 0x5485
104#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
105#define TIOCSERCONFIG 0x5488
106#define TIOCSERGWILD 0x5489
107#define TIOCSERSWILD 0x548a
108#define TIOCGLCKTRMIOS 0x548b
109#define TIOCSLCKTRMIOS 0x548c
110#define TIOCSERGSTRUCT 0x548d /* For debugging only */
111#define TIOCSERGETLSR 0x548e /* Get line status register */
112#define TIOCSERGETMULTI 0x548f /* Get multiport config */
113#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
114#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
115#define TIOCGICOUNT 0x5492 /* read serial port __inline__ interrupt counts */
116
117#endif /* __ASM_IOCTLS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/kvm.h deleted-227
...@@ -1,227 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
8 * Copyright (C) 2013 Cavium, Inc.
9 * Authors: Sanjay Lal <sanjayl@kymasys.com>
10 */
11
12#ifndef __LINUX_KVM_MIPS_H
13#define __LINUX_KVM_MIPS_H
14
15#include <linux/types.h>
16
17/*
18 * KVM MIPS specific structures and definitions.
19 *
20 * Some parts derived from the x86 version of this file.
21 */
22
23#define __KVM_HAVE_READONLY_MEM
24
25#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
26
27/*
28 * for KVM_GET_REGS and KVM_SET_REGS
29 *
30 * If Config[AT] is zero (32-bit CPU), the register contents are
31 * stored in the lower 32-bits of the struct kvm_regs fields and sign
32 * extended to 64-bits.
33 */
34struct kvm_regs {
35 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
36 __u64 gpr[32];
37 __u64 hi;
38 __u64 lo;
39 __u64 pc;
40};
41
42/*
43 * for KVM_GET_FPU and KVM_SET_FPU
44 */
45struct kvm_fpu {
46};
47
48
49/*
50 * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access various
51 * registers. The id field is broken down as follows:
52 *
53 * bits[63..52] - As per linux/kvm.h
54 * bits[51..32] - Must be zero.
55 * bits[31..16] - Register set.
56 *
57 * Register set = 0: GP registers from kvm_regs (see definitions below).
58 *
59 * Register set = 1: CP0 registers.
60 * bits[15..8] - COP0 register set.
61 *
62 * COP0 register set = 0: Main CP0 registers.
63 * bits[7..3] - Register 'rd' index.
64 * bits[2..0] - Register 'sel' index.
65 *
66 * COP0 register set = 1: MAARs.
67 * bits[7..0] - MAAR index.
68 *
69 * Register set = 2: KVM specific registers (see definitions below).
70 *
71 * Register set = 3: FPU / MSA registers (see definitions below).
72 *
73 * Other sets registers may be added in the future. Each set would
74 * have its own identifier in bits[31..16].
75 */
76
77#define KVM_REG_MIPS_GP (KVM_REG_MIPS | 0x0000000000000000ULL)
78#define KVM_REG_MIPS_CP0 (KVM_REG_MIPS | 0x0000000000010000ULL)
79#define KVM_REG_MIPS_KVM (KVM_REG_MIPS | 0x0000000000020000ULL)
80#define KVM_REG_MIPS_FPU (KVM_REG_MIPS | 0x0000000000030000ULL)
81
82
83/*
84 * KVM_REG_MIPS_GP - General purpose registers from kvm_regs.
85 */
86
87#define KVM_REG_MIPS_R0 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 0)
88#define KVM_REG_MIPS_R1 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 1)
89#define KVM_REG_MIPS_R2 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 2)
90#define KVM_REG_MIPS_R3 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 3)
91#define KVM_REG_MIPS_R4 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 4)
92#define KVM_REG_MIPS_R5 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 5)
93#define KVM_REG_MIPS_R6 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 6)
94#define KVM_REG_MIPS_R7 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 7)
95#define KVM_REG_MIPS_R8 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 8)
96#define KVM_REG_MIPS_R9 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 9)
97#define KVM_REG_MIPS_R10 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 10)
98#define KVM_REG_MIPS_R11 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 11)
99#define KVM_REG_MIPS_R12 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 12)
100#define KVM_REG_MIPS_R13 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 13)
101#define KVM_REG_MIPS_R14 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 14)
102#define KVM_REG_MIPS_R15 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 15)
103#define KVM_REG_MIPS_R16 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 16)
104#define KVM_REG_MIPS_R17 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 17)
105#define KVM_REG_MIPS_R18 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 18)
106#define KVM_REG_MIPS_R19 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 19)
107#define KVM_REG_MIPS_R20 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 20)
108#define KVM_REG_MIPS_R21 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 21)
109#define KVM_REG_MIPS_R22 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 22)
110#define KVM_REG_MIPS_R23 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 23)
111#define KVM_REG_MIPS_R24 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 24)
112#define KVM_REG_MIPS_R25 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 25)
113#define KVM_REG_MIPS_R26 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 26)
114#define KVM_REG_MIPS_R27 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 27)
115#define KVM_REG_MIPS_R28 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 28)
116#define KVM_REG_MIPS_R29 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 29)
117#define KVM_REG_MIPS_R30 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 30)
118#define KVM_REG_MIPS_R31 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 31)
119
120#define KVM_REG_MIPS_HI (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 32)
121#define KVM_REG_MIPS_LO (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 33)
122#define KVM_REG_MIPS_PC (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 34)
123
124
125/*
126 * KVM_REG_MIPS_CP0 - Coprocessor 0 registers.
127 */
128
129#define KVM_REG_MIPS_MAAR (KVM_REG_MIPS_CP0 | (1 << 8))
130#define KVM_REG_MIPS_CP0_MAAR(n) (KVM_REG_MIPS_MAAR | \
131 KVM_REG_SIZE_U64 | (n))
132
133
134/*
135 * KVM_REG_MIPS_KVM - KVM specific control registers.
136 */
137
138/*
139 * CP0_Count control
140 * DC: Set 0: Master disable CP0_Count and set COUNT_RESUME to now
141 * Set 1: Master re-enable CP0_Count with unchanged bias, handling timer
142 * interrupts since COUNT_RESUME
143 * This can be used to freeze the timer to get a consistent snapshot of
144 * the CP0_Count and timer interrupt pending state, while also resuming
145 * safely without losing time or guest timer interrupts.
146 * Other: Reserved, do not change.
147 */
148#define KVM_REG_MIPS_COUNT_CTL (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 0)
149#define KVM_REG_MIPS_COUNT_CTL_DC 0x00000001
150
151/*
152 * CP0_Count resume monotonic nanoseconds
153 * The monotonic nanosecond time of the last set of COUNT_CTL.DC (master
154 * disable). Any reads and writes of Count related registers while
155 * COUNT_CTL.DC=1 will appear to occur at this time. When COUNT_CTL.DC is
156 * cleared again (master enable) any timer interrupts since this time will be
157 * emulated.
158 * Modifications to times in the future are rejected.
159 */
160#define KVM_REG_MIPS_COUNT_RESUME (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 1)
161/*
162 * CP0_Count rate in Hz
163 * Specifies the rate of the CP0_Count timer in Hz. Modifications occur without
164 * discontinuities in CP0_Count.
165 */
166#define KVM_REG_MIPS_COUNT_HZ (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 2)
167
168
169/*
170 * KVM_REG_MIPS_FPU - Floating Point and MIPS SIMD Architecture (MSA) registers.
171 *
172 * bits[15..8] - Register subset (see definitions below).
173 * bits[7..5] - Must be zero.
174 * bits[4..0] - Register number within register subset.
175 */
176
177#define KVM_REG_MIPS_FPR (KVM_REG_MIPS_FPU | 0x0000000000000000ULL)
178#define KVM_REG_MIPS_FCR (KVM_REG_MIPS_FPU | 0x0000000000000100ULL)
179#define KVM_REG_MIPS_MSACR (KVM_REG_MIPS_FPU | 0x0000000000000200ULL)
180
181/*
182 * KVM_REG_MIPS_FPR - Floating point / Vector registers.
183 */
184#define KVM_REG_MIPS_FPR_32(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U32 | (n))
185#define KVM_REG_MIPS_FPR_64(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U64 | (n))
186#define KVM_REG_MIPS_VEC_128(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U128 | (n))
187
188/*
189 * KVM_REG_MIPS_FCR - Floating point control registers.
190 */
191#define KVM_REG_MIPS_FCR_IR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 0)
192#define KVM_REG_MIPS_FCR_CSR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 31)
193
194/*
195 * KVM_REG_MIPS_MSACR - MIPS SIMD Architecture (MSA) control registers.
196 */
197#define KVM_REG_MIPS_MSA_IR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 0)
198#define KVM_REG_MIPS_MSA_CSR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 1)
199
200
201/*
202 * KVM MIPS specific structures and definitions
203 *
204 */
205struct kvm_debug_exit_arch {
206 __u64 epc;
207};
208
209/* for KVM_SET_GUEST_DEBUG */
210struct kvm_guest_debug_arch {
211};
212
213/* definition of registers in kvm_run */
214struct kvm_sync_regs {
215};
216
217/* dummy definition */
218struct kvm_sregs {
219};
220
221struct kvm_mips_interrupt {
222 /* in */
223 __u32 cpu;
224 __u32 irq;
225};
226
227#endif /* __LINUX_KVM_MIPS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/kvm_para.h deleted-5
...@@ -1,5 +0,0 @@
1#ifndef _ASM_MIPS_KVM_PARA_H
2#define _ASM_MIPS_KVM_PARA_H
3
4
5#endif /* _ASM_MIPS_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/mman.h deleted-108
...@@ -1,108 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_MMAN_H
10#define _ASM_MMAN_H
11
12/*
13 * Protections are chosen from these bits, OR'd together. The
14 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
15 * without PROT_READ. The only guarantees are that no writing will be
16 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
17 */
18#define PROT_NONE 0x00 /* page can not be accessed */
19#define PROT_READ 0x01 /* page can be read */
20#define PROT_WRITE 0x02 /* page can be written */
21#define PROT_EXEC 0x04 /* page can be executed */
22/* 0x08 reserved for PROT_EXEC_NOFLUSH */
23#define PROT_SEM 0x10 /* page may be used for atomic ops */
24#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
25#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
26
27/*
28 * Flags for mmap
29 */
30#define MAP_SHARED 0x001 /* Share changes */
31#define MAP_PRIVATE 0x002 /* Changes are private */
32#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
33#define MAP_TYPE 0x00f /* Mask for type of mapping */
34#define MAP_FIXED 0x010 /* Interpret addr exactly */
35
36/* not used by linux, but here to make sure we don't clash with ABI defines */
37#define MAP_RENAME 0x020 /* Assign page to file */
38#define MAP_AUTOGROW 0x040 /* File may grow by writing */
39#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
40#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
41
42/* These are linux-specific */
43#define MAP_NORESERVE 0x0400 /* don't check for reservations */
44#define MAP_ANONYMOUS 0x0800 /* don't use a file */
45#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
46#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
47#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
48#define MAP_LOCKED 0x8000 /* pages are locked */
49#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
50#define MAP_NONBLOCK 0x20000 /* do not block on IO */
51#define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */
52#define MAP_HUGETLB 0x80000 /* create a huge page mapping */
53#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
54
55/*
56 * Flags for msync
57 */
58#define MS_ASYNC 0x0001 /* sync memory asynchronously */
59#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
60#define MS_SYNC 0x0004 /* synchronous memory sync */
61
62/*
63 * Flags for mlockall
64 */
65#define MCL_CURRENT 1 /* lock all current mappings */
66#define MCL_FUTURE 2 /* lock all future mappings */
67#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
68
69/*
70 * Flags for mlock
71 */
72#define MLOCK_ONFAULT 0x01 /* Lock pages in range after they are faulted in, do not prefault */
73
74#define MADV_NORMAL 0 /* no further special treatment */
75#define MADV_RANDOM 1 /* expect random page references */
76#define MADV_SEQUENTIAL 2 /* expect sequential page references */
77#define MADV_WILLNEED 3 /* will need these pages */
78#define MADV_DONTNEED 4 /* don't need these pages */
79
80/* common parameters: try to keep these consistent across architectures */
81#define MADV_FREE 8 /* free pages only if memory pressure */
82#define MADV_REMOVE 9 /* remove these pages & resources */
83#define MADV_DONTFORK 10 /* don't inherit across fork */
84#define MADV_DOFORK 11 /* do inherit across fork */
85
86#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
87#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
88#define MADV_HWPOISON 100 /* poison a page for testing */
89
90#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
91#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
92
93#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
94 overrides the coredump filter bits */
95#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
96
97#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
98#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
99
100/* compatibility flags */
101#define MAP_FILE 0
102
103#define PKEY_DISABLE_ACCESS 0x1
104#define PKEY_DISABLE_WRITE 0x2
105#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
106 PKEY_DISABLE_WRITE)
107
108#endif /* _ASM_MMAN_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/msgbuf.h deleted-67
...@@ -1,67 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_MSGBUF_H
3#define _ASM_MSGBUF_H
4
5
6/*
7 * The msqid64_ds structure for the MIPS architecture.
8 * Note extra padding because this structure is passed back and forth
9 * between kernel and user space.
10 *
11 * Pad space is left for:
12 * - 2 miscellaneous unsigned long values
13 */
14
15#if defined(__mips64)
16struct msqid64_ds {
17 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long msg_cbytes; /* current number of bytes on queue */
22 unsigned long msg_qnum; /* number of messages in queue */
23 unsigned long msg_qbytes; /* max number of bytes on queue */
24 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25 __kernel_pid_t msg_lrpid; /* last receive pid */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29#elif defined (__MIPSEB__)
30struct msqid64_ds {
31 struct ipc64_perm msg_perm;
32 unsigned long msg_stime_high;
33 unsigned long msg_stime; /* last msgsnd time */
34 unsigned long msg_rtime_high;
35 unsigned long msg_rtime; /* last msgrcv time */
36 unsigned long msg_ctime_high;
37 unsigned long msg_ctime; /* last change time */
38 unsigned long msg_cbytes; /* current number of bytes on queue */
39 unsigned long msg_qnum; /* number of messages in queue */
40 unsigned long msg_qbytes; /* max number of bytes on queue */
41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
42 __kernel_pid_t msg_lrpid; /* last receive pid */
43 unsigned long __unused4;
44 unsigned long __unused5;
45};
46#elif defined (__MIPSEL__)
47struct msqid64_ds {
48 struct ipc64_perm msg_perm;
49 unsigned long msg_stime; /* last msgsnd time */
50 unsigned long msg_stime_high;
51 unsigned long msg_rtime; /* last msgrcv time */
52 unsigned long msg_rtime_high;
53 unsigned long msg_ctime; /* last change time */
54 unsigned long msg_ctime_high;
55 unsigned long msg_cbytes; /* current number of bytes on queue */
56 unsigned long msg_qnum; /* number of messages in queue */
57 unsigned long msg_qbytes; /* max number of bytes on queue */
58 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
59 __kernel_pid_t msg_lrpid; /* last receive pid */
60 unsigned long __unused4;
61 unsigned long __unused5;
62};
63#else
64#warning no endianess set
65#endif
66
67#endif /* _ASM_MSGBUF_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/param.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org)
8 * Copyright 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PARAM_H
11#define _ASM_PARAM_H
12
13#define EXEC_PAGESIZE 65536
14
15#include <asm-generic/param.h>
16
17#endif /* _ASM_PARAM_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/poll.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POLL_H
3#define __ASM_POLL_H
4
5#define POLLWRNORM POLLOUT
6#define POLLWRBAND 0x0100
7
8#include <asm-generic/poll.h>
9
10#endif /* __ASM_POLL_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/posix_types.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_POSIX_TYPES_H
11#define _ASM_POSIX_TYPES_H
12
13#include <asm/sgidefs.h>
14
15/*
16 * This file is generally used by user-level software, so you need to
17 * be a little careful about namespace pollution etc. Also, we cannot
18 * assume GCC is being used.
19 */
20
21typedef long __kernel_daddr_t;
22#define __kernel_daddr_t __kernel_daddr_t
23
24#if (_MIPS_SZLONG == 32)
25typedef struct {
26 long val[2];
27} __kernel_fsid_t;
28#define __kernel_fsid_t __kernel_fsid_t
29#endif
30
31#include <asm-generic/posix_types.h>
32
33#endif /* _ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/ptrace.h deleted-105
...@@ -1,105 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PTRACE_H
11#define _ASM_PTRACE_H
12
13#include <linux/types.h>
14
15/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
16#define FPR_BASE 32
17#define PC 64
18#define CAUSE 65
19#define BADVADDR 66
20#define MMHI 67
21#define MMLO 68
22#define FPC_CSR 69
23#define FPC_EIR 70
24#define DSP_BASE 71 /* 3 more hi / lo register pairs */
25#define DSP_CONTROL 77
26#define ACX 78
27
28/*
29 * This struct defines the registers as used by PTRACE_{GET,SET}REGS. The
30 * format is the same for both 32- and 64-bit processes. Registers for 32-bit
31 * processes are sign extended.
32 */
33struct pt_regs {
34 /* Saved main processor registers. */
35 __u64 regs[32];
36
37 /* Saved special registers. */
38 __u64 lo;
39 __u64 hi;
40 __u64 cp0_epc;
41 __u64 cp0_badvaddr;
42 __u64 cp0_status;
43 __u64 cp0_cause;
44} __attribute__ ((aligned (8)));
45
46/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
47#define PTRACE_GETREGS 12
48#define PTRACE_SETREGS 13
49#define PTRACE_GETFPREGS 14
50#define PTRACE_SETFPREGS 15
51/* #define PTRACE_GETFPXREGS 18 */
52/* #define PTRACE_SETFPXREGS 19 */
53
54#define PTRACE_OLDSETOPTIONS 21
55
56#define PTRACE_GET_THREAD_AREA 25
57#define PTRACE_SET_THREAD_AREA 26
58
59/* Calls to trace a 64bit program from a 32bit program. */
60#define PTRACE_PEEKTEXT_3264 0xc0
61#define PTRACE_PEEKDATA_3264 0xc1
62#define PTRACE_POKETEXT_3264 0xc2
63#define PTRACE_POKEDATA_3264 0xc3
64#define PTRACE_GET_THREAD_AREA_3264 0xc4
65
66/* Read and write watchpoint registers. */
67enum pt_watch_style {
68 pt_watch_style_mips32,
69 pt_watch_style_mips64
70};
71struct mips32_watch_regs {
72 unsigned int watchlo[8];
73 /* Lower 16 bits of watchhi. */
74 unsigned short watchhi[8];
75 /* Valid mask and I R W bits.
76 * bit 0 -- 1 if W bit is usable.
77 * bit 1 -- 1 if R bit is usable.
78 * bit 2 -- 1 if I bit is usable.
79 * bits 3 - 11 -- Valid watchhi mask bits.
80 */
81 unsigned short watch_masks[8];
82 /* The number of valid watch register pairs. */
83 unsigned int num_valid;
84} __attribute__((aligned(8)));
85
86struct mips64_watch_regs {
87 unsigned long long watchlo[8];
88 unsigned short watchhi[8];
89 unsigned short watch_masks[8];
90 unsigned int num_valid;
91} __attribute__((aligned(8)));
92
93struct pt_watch_regs {
94 enum pt_watch_style style;
95 union {
96 struct mips32_watch_regs mips32;
97 struct mips64_watch_regs mips64;
98 };
99};
100
101#define PTRACE_GET_WATCH_REGS 0xd0
102#define PTRACE_SET_WATCH_REGS 0xd1
103
104
105#endif /* _ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/resource.h deleted-36
...@@ -1,36 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_RESOURCE_H
11#define _ASM_RESOURCE_H
12
13
14/*
15 * These five resource limit IDs have a MIPS/Linux-specific ordering,
16 * the rest comes from the generic header:
17 */
18#define RLIMIT_NOFILE 5 /* max number of open files */
19#define RLIMIT_AS 6 /* address space limit */
20#define RLIMIT_RSS 7 /* max resident set size */
21#define RLIMIT_NPROC 8 /* max number of processes */
22#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
23
24/*
25 * SuS says limits have to be unsigned.
26 * Which makes a ton more sense anyway,
27 * but we keep the old value on MIPS32,
28 * for compatibility:
29 */
30#ifndef __mips64
31# define RLIM_INFINITY 0x7fffffffUL
32#endif
33
34#include <asm-generic/resource.h>
35
36#endif /* _ASM_RESOURCE_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/sembuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SEMBUF_H
3#define _ASM_SEMBUF_H
4
5/*
6 * The semid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for 2 miscellaneous 64-bit values on mips64,
11 * but used for the upper 32 bit of the time values on mips32.
12 */
13
14#ifdef __mips64
15struct semid64_ds {
16 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
17 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long sem_nsems; /* no. of semaphores in array */
20 unsigned long __unused1;
21 unsigned long __unused2;
22};
23#else
24struct semid64_ds {
25 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
26 unsigned long sem_otime; /* last semop time */
27 unsigned long sem_ctime; /* last change time */
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long sem_otime_high;
30 unsigned long sem_ctime_high;
31};
32#endif
33
34#endif /* _ASM_SEMBUF_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/setup.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _MIPS_SETUP_H
3#define _MIPS_SETUP_H
4
5#define COMMAND_LINE_SIZE 4096
6
7
8#endif /* _MIPS_SETUP_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/shmbuf.h deleted-58
...@@ -1,58 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SHMBUF_H
3#define _ASM_SHMBUF_H
4
5/*
6 * The shmid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * As MIPS was lacking proper padding after shm_?time, we use 48 bits
11 * of the padding at the end to store a few additional bits of the time.
12 * libc implementations need to take care to convert this into a proper
13 * data structure when moving to 64-bit time_t.
14 */
15
16#ifdef __mips64
17struct shmid64_ds {
18 struct ipc64_perm shm_perm; /* operation perms */
19 size_t shm_segsz; /* size of segment (bytes) */
20 __kernel_time_t shm_atime; /* last attach time */
21 __kernel_time_t shm_dtime; /* last detach time */
22 __kernel_time_t shm_ctime; /* last change time */
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused1;
27 unsigned long __unused2;
28};
29#else
30struct shmid64_ds {
31 struct ipc64_perm shm_perm; /* operation perms */
32 size_t shm_segsz; /* size of segment (bytes) */
33 unsigned long shm_atime; /* last attach time */
34 unsigned long shm_dtime; /* last detach time */
35 unsigned long shm_ctime; /* last change time */
36 __kernel_pid_t shm_cpid; /* pid of creator */
37 __kernel_pid_t shm_lpid; /* pid of last operator */
38 unsigned long shm_nattch; /* no. of current attaches */
39 unsigned short shm_atime_high;
40 unsigned short shm_dtime_high;
41 unsigned short shm_ctime_high;
42 unsigned short __unused1;
43};
44#endif
45
46struct shminfo64 {
47 unsigned long shmmax;
48 unsigned long shmmin;
49 unsigned long shmmni;
50 unsigned long shmseg;
51 unsigned long shmall;
52 unsigned long __unused1;
53 unsigned long __unused2;
54 unsigned long __unused3;
55 unsigned long __unused4;
56};
57
58#endif /* _ASM_SHMBUF_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/sigcontext.h deleted-91
...@@ -1,91 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGCONTEXT_H
11#define _ASM_SIGCONTEXT_H
12
13#include <linux/types.h>
14#include <asm/sgidefs.h>
15
16/* scalar FP context was used */
17#define USED_FP (1 << 0)
18
19/* the value of Status.FR when context was saved */
20#define USED_FR1 (1 << 1)
21
22/* FR=1, but with odd singles in bits 63:32 of preceding even double */
23#define USED_HYBRID_FPRS (1 << 2)
24
25/* extended context was used, see struct extcontext for details */
26#define USED_EXTCONTEXT (1 << 3)
27
28#if _MIPS_SIM == _MIPS_SIM_ABI32
29
30/*
31 * Keep this struct definition in sync with the sigcontext fragment
32 * in arch/mips/kernel/asm-offsets.c
33 */
34struct sigcontext {
35 unsigned int sc_regmask; /* Unused */
36 unsigned int sc_status; /* Unused */
37 unsigned long long sc_pc;
38 unsigned long long sc_regs[32];
39 unsigned long long sc_fpregs[32];
40 unsigned int sc_acx; /* Was sc_ownedfp */
41 unsigned int sc_fpc_csr;
42 unsigned int sc_fpc_eir; /* Unused */
43 unsigned int sc_used_math;
44 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
45 unsigned long long sc_mdhi;
46 unsigned long long sc_mdlo;
47 unsigned long sc_hi1; /* Was sc_cause */
48 unsigned long sc_lo1; /* Was sc_badvaddr */
49 unsigned long sc_hi2; /* Was sc_sigset[4] */
50 unsigned long sc_lo2;
51 unsigned long sc_hi3;
52 unsigned long sc_lo3;
53};
54
55#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
56
57#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
58
59#include <linux/posix_types.h>
60/*
61 * Keep this struct definition in sync with the sigcontext fragment
62 * in arch/mips/kernel/asm-offsets.c
63 *
64 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
65 * int so it was changed to unsigned long in 2.6.0-test1. This may break
66 * binary compatibility - no prisoners.
67 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
68 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
69 */
70struct sigcontext {
71 __u64 sc_regs[32];
72 __u64 sc_fpregs[32];
73 __u64 sc_mdhi;
74 __u64 sc_hi1;
75 __u64 sc_hi2;
76 __u64 sc_hi3;
77 __u64 sc_mdlo;
78 __u64 sc_lo1;
79 __u64 sc_lo2;
80 __u64 sc_lo3;
81 __u64 sc_pc;
82 __u32 sc_fpc_csr;
83 __u32 sc_used_math;
84 __u32 sc_dsp;
85 __u32 sc_reserved;
86};
87
88
89#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
90
91#endif /* _ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/siginfo.h deleted-43
...@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGINFO_H
11#define _ASM_SIGINFO_H
12
13
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
16
17/*
18 * Careful to keep union _sifields from shifting ...
19 */
20#if _MIPS_SZLONG == 32
21#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
22#elif _MIPS_SZLONG == 64
23#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
24#else
25#error _MIPS_SZLONG neither 32 nor 64
26#endif
27
28#define __ARCH_HAS_SWAPPED_SIGINFO
29
30#include <asm-generic/siginfo.h>
31
32/*
33 * si_code values
34 * Again these have been chosen to be IRIX compatible.
35 */
36#undef SI_ASYNCIO
37#undef SI_TIMER
38#undef SI_MESGQ
39#define SI_ASYNCIO -2 /* sent by AIO completion */
40#define SI_TIMER -3 /* sent by timer expiration */
41#define SI_MESGQ -4 /* sent by real time mesq state change */
42
43#endif /* _ASM_SIGINFO_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/signal.h deleted-118
...@@ -1,118 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGNAL_H
11#define _ASM_SIGNAL_H
12
13#include <linux/types.h>
14
15#define _NSIG 128
16#define _NSIG_BPW (sizeof(unsigned long) * 8)
17#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23typedef unsigned long old_sigset_t; /* at least 32 bits */
24
25#define SIGHUP 1 /* Hangup (POSIX). */
26#define SIGINT 2 /* Interrupt (ANSI). */
27#define SIGQUIT 3 /* Quit (POSIX). */
28#define SIGILL 4 /* Illegal instruction (ANSI). */
29#define SIGTRAP 5 /* Trace trap (POSIX). */
30#define SIGIOT 6 /* IOT trap (4.2 BSD). */
31#define SIGABRT SIGIOT /* Abort (ANSI). */
32#define SIGEMT 7
33#define SIGFPE 8 /* Floating-point exception (ANSI). */
34#define SIGKILL 9 /* Kill, unblockable (POSIX). */
35#define SIGBUS 10 /* BUS error (4.2 BSD). */
36#define SIGSEGV 11 /* Segmentation violation (ANSI). */
37#define SIGSYS 12
38#define SIGPIPE 13 /* Broken pipe (POSIX). */
39#define SIGALRM 14 /* Alarm clock (POSIX). */
40#define SIGTERM 15 /* Termination (ANSI). */
41#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
42#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
43#define SIGCHLD 18 /* Child status has changed (POSIX). */
44#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
45#define SIGPWR 19 /* Power failure restart (System V). */
46#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
47#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
48#define SIGIO 22 /* I/O now possible (4.2 BSD). */
49#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
50#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
51#define SIGTSTP 24 /* Keyboard stop (POSIX). */
52#define SIGCONT 25 /* Continue (POSIX). */
53#define SIGTTIN 26 /* Background read from tty (POSIX). */
54#define SIGTTOU 27 /* Background write to tty (POSIX). */
55#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
56#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
57#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
58#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
59
60/* These should not be considered constants from userland. */
61#define SIGRTMIN 32
62#define SIGRTMAX _NSIG
63
64/*
65 * SA_FLAGS values:
66 *
67 * SA_ONSTACK indicates that a registered stack_t will be used.
68 * SA_RESTART flag to get restarting signals (which were the default long ago)
69 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
70 * SA_RESETHAND clears the handler when the signal is delivered.
71 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
72 * SA_NODEFER prevents the current signal from being masked in the handler.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 *
77 * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
78 * supported its use and no libc was using it, so the entire sa-restorer
79 * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
80 * retaining only the SA_RESTORER definition as a reminder to avoid
81 * accidental reuse of the mask bit.
82 */
83#define SA_ONSTACK 0x08000000
84#define SA_RESETHAND 0x80000000
85#define SA_RESTART 0x10000000
86#define SA_SIGINFO 0x00000008
87#define SA_NODEFER 0x40000000
88#define SA_NOCLDWAIT 0x00010000
89#define SA_NOCLDSTOP 0x00000001
90
91#define SA_NOMASK SA_NODEFER
92#define SA_ONESHOT SA_RESETHAND
93
94#define MINSIGSTKSZ 2048
95#define SIGSTKSZ 8192
96
97
98#define SIG_BLOCK 1 /* for blocking signals */
99#define SIG_UNBLOCK 2 /* for unblocking signals */
100#define SIG_SETMASK 3 /* for setting the signal mask */
101
102#include <asm-generic/signal-defs.h>
103
104struct sigaction {
105 unsigned int sa_flags;
106 __sighandler_t sa_handler;
107 sigset_t sa_mask;
108};
109
110/* IRIX compatible stack_t */
111typedef struct sigaltstack {
112 void *ss_sp;
113 size_t ss_size;
114 int ss_flags;
115} stack_t;
116
117
118#endif /* _ASM_SIGNAL_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/socket.h deleted-129
...@@ -1,129 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SOCKET_H
11#define _ASM_SOCKET_H
12
13#include <asm/sockios.h>
14
15/*
16 * For setsockopt(2)
17 *
18 * This defines are ABI conformant as far as Linux supports these ...
19 */
20#define SOL_SOCKET 0xffff
21
22#define SO_DEBUG 0x0001 /* Record debugging information. */
23#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
24#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
25 SIGPIPE when they die. */
26#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
27#define SO_BROADCAST 0x0020 /* Allow transmission of
28 broadcast messages. */
29#define SO_LINGER 0x0080 /* Block on close of a reliable
30 socket to transmit pending data. */
31#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
32#define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33
34#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
35#define SO_STYLE SO_TYPE /* Synonym */
36#define SO_ERROR 0x1007 /* get error status and clear */
37#define SO_SNDBUF 0x1001 /* Send buffer size. */
38#define SO_RCVBUF 0x1002 /* Receive buffer. */
39#define SO_SNDLOWAT 0x1003 /* send low-water mark */
40#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
41#define SO_SNDTIMEO 0x1005 /* send timeout */
42#define SO_RCVTIMEO 0x1006 /* receive timeout */
43#define SO_ACCEPTCONN 0x1009
44#define SO_PROTOCOL 0x1028 /* protocol type */
45#define SO_DOMAIN 0x1029 /* domain/socket family */
46
47/* linux-specific, might as well be the same as on i386 */
48#define SO_NO_CHECK 11
49#define SO_PRIORITY 12
50#define SO_BSDCOMPAT 14
51
52#define SO_PASSCRED 17
53#define SO_PEERCRED 18
54
55/* Security levels - as per NRL IPv6 - don't actually do anything */
56#define SO_SECURITY_AUTHENTICATION 22
57#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
58#define SO_SECURITY_ENCRYPTION_NETWORK 24
59
60#define SO_BINDTODEVICE 25
61
62/* Socket filtering */
63#define SO_ATTACH_FILTER 26
64#define SO_DETACH_FILTER 27
65#define SO_GET_FILTER SO_ATTACH_FILTER
66
67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70
71#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77
78#define SO_MARK 36
79
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40
84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87#define SO_PEEK_OFF 42
88
89/* Instruct lower device to use last 4-bytes of skb data as FCS */
90#define SO_NOFCS 43
91
92#define SO_LOCK_FILTER 44
93
94#define SO_SELECT_ERR_QUEUE 45
95
96#define SO_BUSY_POLL 46
97
98#define SO_MAX_PACING_RATE 47
99
100#define SO_BPF_EXTENSIONS 48
101
102#define SO_INCOMING_CPU 49
103
104#define SO_ATTACH_BPF 50
105#define SO_DETACH_BPF SO_DETACH_FILTER
106
107#define SO_ATTACH_REUSEPORT_CBPF 51
108#define SO_ATTACH_REUSEPORT_EBPF 52
109
110#define SO_CNX_ADVICE 53
111
112#define SCM_TIMESTAMPING_OPT_STATS 54
113
114#define SO_MEMINFO 55
115
116#define SO_INCOMING_NAPI_ID 56
117
118#define SO_COOKIE 57
119
120#define SCM_TIMESTAMPING_PKTINFO 58
121
122#define SO_PEERGROUPS 59
123
124#define SO_ZEROCOPY 60
125
126#define SO_TXTIME 61
127#define SCM_TXTIME SO_TXTIME
128
129#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/sockios.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Socket-level I/O control calls.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995 by Ralf Baechle
10 */
11#ifndef _ASM_SOCKIOS_H
12#define _ASM_SOCKIOS_H
13
14#include <asm/ioctl.h>
15
16/* Socket-level I/O control calls. */
17#define FIOGETOWN _IOR('f', 123, int)
18#define FIOSETOWN _IOW('f', 124, int)
19
20#define SIOCATMARK _IOR('s', 7, int)
21#define SIOCSPGRP _IOW('s', 8, pid_t)
22#define SIOCGPGRP _IOR('s', 9, pid_t)
23
24#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
25#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
26
27#endif /* _ASM_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/stat.h deleted-133
...@@ -1,133 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2000 Ralf Baechle
8 * Copyright (C) 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_STAT_H
11#define _ASM_STAT_H
12
13#include <linux/types.h>
14
15#include <asm/sgidefs.h>
16
17#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
18
19struct stat {
20 unsigned st_dev;
21 long st_pad1[3]; /* Reserved for network id */
22 ino_t st_ino;
23 mode_t st_mode;
24 __u32 st_nlink;
25 uid_t st_uid;
26 gid_t st_gid;
27 unsigned st_rdev;
28 long st_pad2[2];
29 off_t st_size;
30 long st_pad3;
31 /*
32 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
33 * but we don't have it under Linux.
34 */
35 time_t st_atime;
36 long st_atime_nsec;
37 time_t st_mtime;
38 long st_mtime_nsec;
39 time_t st_ctime;
40 long st_ctime_nsec;
41 long st_blksize;
42 long st_blocks;
43 long st_pad4[14];
44};
45
46/*
47 * This matches struct stat64 in glibc2.1, hence the absolutely insane
48 * amounts of padding around dev_t's. The memory layout is the same as of
49 * struct stat of the 64-bit kernel.
50 */
51
52struct stat64 {
53 unsigned long st_dev;
54 unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
55
56 unsigned long long st_ino;
57
58 mode_t st_mode;
59 __u32 st_nlink;
60
61 uid_t st_uid;
62 gid_t st_gid;
63
64 unsigned long st_rdev;
65 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
66
67 long long st_size;
68
69 /*
70 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
71 * but we don't have it under Linux.
72 */
73 time_t st_atime;
74 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
75
76 time_t st_mtime;
77 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
78
79 time_t st_ctime;
80 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
81
82 unsigned long st_blksize;
83 unsigned long st_pad2;
84
85 long long st_blocks;
86};
87
88#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
89
90#if _MIPS_SIM == _MIPS_SIM_ABI64
91
92/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
93struct stat {
94 unsigned int st_dev;
95 unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
96
97 unsigned long st_ino;
98
99 mode_t st_mode;
100 __u32 st_nlink;
101
102 uid_t st_uid;
103 gid_t st_gid;
104
105 unsigned int st_rdev;
106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
107
108 off_t st_size;
109
110 /*
111 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
112 * but we don't have it under Linux.
113 */
114 unsigned int st_atime;
115 unsigned int st_atime_nsec;
116
117 unsigned int st_mtime;
118 unsigned int st_mtime_nsec;
119
120 unsigned int st_ctime;
121 unsigned int st_ctime_nsec;
122
123 unsigned int st_blksize;
124 unsigned int st_pad2;
125
126 unsigned long st_blocks;
127};
128
129#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
130
131#define STAT_HAVE_NSEC 1
132
133#endif /* _ASM_STAT_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/statfs.h deleted-101
...@@ -1,101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999 by Ralf Baechle
8 */
9#ifndef _ASM_STATFS_H
10#define _ASM_STATFS_H
11
12#include <linux/posix_types.h>
13#include <asm/sgidefs.h>
14
15#ifndef __KERNEL_STRICT_NAMES
16
17#include <linux/types.h>
18
19typedef __kernel_fsid_t fsid_t;
20
21#endif
22
23struct statfs {
24 long f_type;
25#define f_fstyp f_type
26 long f_bsize;
27 long f_frsize; /* Fragment size - unsupported */
28 long f_blocks;
29 long f_bfree;
30 long f_files;
31 long f_ffree;
32 long f_bavail;
33
34 /* Linux specials */
35 __kernel_fsid_t f_fsid;
36 long f_namelen;
37 long f_flags;
38 long f_spare[5];
39};
40
41#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
42
43/*
44 * Unlike the traditional version the LFAPI version has none of the ABI junk
45 */
46struct statfs64 {
47 __u32 f_type;
48 __u32 f_bsize;
49 __u32 f_frsize; /* Fragment size - unsupported */
50 __u32 __pad;
51 __u64 f_blocks;
52 __u64 f_bfree;
53 __u64 f_files;
54 __u64 f_ffree;
55 __u64 f_bavail;
56 __kernel_fsid_t f_fsid;
57 __u32 f_namelen;
58 __u32 f_flags;
59 __u32 f_spare[5];
60};
61
62#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
63
64#if _MIPS_SIM == _MIPS_SIM_ABI64
65
66struct statfs64 { /* Same as struct statfs */
67 long f_type;
68 long f_bsize;
69 long f_frsize; /* Fragment size - unsupported */
70 long f_blocks;
71 long f_bfree;
72 long f_files;
73 long f_ffree;
74 long f_bavail;
75
76 /* Linux specials */
77 __kernel_fsid_t f_fsid;
78 long f_namelen;
79 long f_flags;
80 long f_spare[5];
81};
82
83struct compat_statfs64 {
84 __u32 f_type;
85 __u32 f_bsize;
86 __u32 f_frsize; /* Fragment size - unsupported */
87 __u32 __pad;
88 __u64 f_blocks;
89 __u64 f_bfree;
90 __u64 f_files;
91 __u64 f_ffree;
92 __u64 f_bavail;
93 __kernel_fsid_t f_fsid;
94 __u32 f_namelen;
95 __u32 f_flags;
96 __u32 f_spare[5];
97};
98
99#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
100
101#endif /* _ASM_STATFS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/swab.h deleted-71
...@@ -1,71 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_SWAB_H
10#define _ASM_SWAB_H
11
12
13#include <linux/types.h>
14
15#define __SWAB_64_THRU_32__
16
17#if !defined(__mips16) && \
18 ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
19 defined(_MIPS_ARCH_LOONGSON3A))
20
21static __inline__ __u16 __arch_swab16(__u16 x)
22{
23 __asm__(
24 " .set push \n"
25 " .set arch=mips32r2 \n"
26 " wsbh %0, %1 \n"
27 " .set pop \n"
28 : "=r" (x)
29 : "r" (x));
30
31 return x;
32}
33#define __arch_swab16 __arch_swab16
34
35static __inline__ __u32 __arch_swab32(__u32 x)
36{
37 __asm__(
38 " .set push \n"
39 " .set arch=mips32r2 \n"
40 " wsbh %0, %1 \n"
41 " rotr %0, %0, 16 \n"
42 " .set pop \n"
43 : "=r" (x)
44 : "r" (x));
45
46 return x;
47}
48#define __arch_swab32 __arch_swab32
49
50/*
51 * Having already checked for MIPS R2, enable the optimized version for
52 * 64-bit kernel on r2 CPUs.
53 */
54#ifdef __mips64
55static __inline__ __u64 __arch_swab64(__u64 x)
56{
57 __asm__(
58 " .set push \n"
59 " .set arch=mips64r2 \n"
60 " dsbh %0, %1 \n"
61 " dshd %0, %0 \n"
62 " .set pop \n"
63 : "=r" (x)
64 : "r" (x));
65
66 return x;
67}
68#define __arch_swab64 __arch_swab64
69#endif /* __mips64 */
70#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */
71#endif /* _ASM_SWAB_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/termbits.h deleted-228
...@@ -1,228 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
11#ifndef _ASM_TERMBITS_H
12#define _ASM_TERMBITS_H
13
14#include <linux/posix_types.h>
15
16typedef unsigned char cc_t;
17typedef unsigned int speed_t;
18typedef unsigned int tcflag_t;
19
20/*
21 * The ABI says nothing about NCC but seems to use NCCS as
22 * replacement for it in struct termio
23 */
24#define NCCS 23
25struct termios {
26 tcflag_t c_iflag; /* input mode flags */
27 tcflag_t c_oflag; /* output mode flags */
28 tcflag_t c_cflag; /* control mode flags */
29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */
32};
33
34struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 speed_t c_ispeed; /* input speed */
42 speed_t c_ospeed; /* output speed */
43};
44
45struct ktermios {
46 tcflag_t c_iflag; /* input mode flags */
47 tcflag_t c_oflag; /* output mode flags */
48 tcflag_t c_cflag; /* control mode flags */
49 tcflag_t c_lflag; /* local mode flags */
50 cc_t c_line; /* line discipline */
51 cc_t c_cc[NCCS]; /* control characters */
52 speed_t c_ispeed; /* input speed */
53 speed_t c_ospeed; /* output speed */
54};
55
56/* c_cc characters */
57#define VINTR 0 /* Interrupt character [ISIG]. */
58#define VQUIT 1 /* Quit character [ISIG]. */
59#define VERASE 2 /* Erase character [ICANON]. */
60#define VKILL 3 /* Kill-line character [ICANON]. */
61#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
62#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
63#define VEOL2 6 /* Second EOL character [ICANON]. */
64#define VSWTC 7 /* ??? */
65#define VSWTCH VSWTC
66#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
67#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
68#define VSUSP 10 /* Suspend character [ISIG]. */
69#if 0
70/*
71 * VDSUSP is not supported
72 */
73#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
74#endif
75#define VREPRINT 12 /* Reprint-line character [ICANON]. */
76#define VDISCARD 13 /* Discard character [IEXTEN]. */
77#define VWERASE 14 /* Word-erase character [ICANON]. */
78#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
79#define VEOF 16 /* End-of-file character [ICANON]. */
80#define VEOL 17 /* End-of-line character [ICANON]. */
81
82/* c_iflag bits */
83#define IGNBRK 0000001 /* Ignore break condition. */
84#define BRKINT 0000002 /* Signal interrupt on break. */
85#define IGNPAR 0000004 /* Ignore characters with parity errors. */
86#define PARMRK 0000010 /* Mark parity and framing errors. */
87#define INPCK 0000020 /* Enable input parity check. */
88#define ISTRIP 0000040 /* Strip 8th bit off characters. */
89#define INLCR 0000100 /* Map NL to CR on input. */
90#define IGNCR 0000200 /* Ignore CR. */
91#define ICRNL 0000400 /* Map CR to NL on input. */
92#define IUCLC 0001000 /* Map upper case to lower case on input. */
93#define IXON 0002000 /* Enable start/stop output control. */
94#define IXANY 0004000 /* Any character will restart after stop. */
95#define IXOFF 0010000 /* Enable start/stop input control. */
96#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
97#define IUTF8 0040000 /* Input is UTF-8 */
98
99/* c_oflag bits */
100#define OPOST 0000001 /* Perform output processing. */
101#define OLCUC 0000002 /* Map lower case to upper case on output. */
102#define ONLCR 0000004 /* Map NL to CR-NL on output. */
103#define OCRNL 0000010
104#define ONOCR 0000020
105#define ONLRET 0000040
106#define OFILL 0000100
107#define OFDEL 0000200
108#define NLDLY 0000400
109#define NL0 0000000
110#define NL1 0000400
111#define CRDLY 0003000
112#define CR0 0000000
113#define CR1 0001000
114#define CR2 0002000
115#define CR3 0003000
116#define TABDLY 0014000
117#define TAB0 0000000
118#define TAB1 0004000
119#define TAB2 0010000
120#define TAB3 0014000
121#define XTABS 0014000
122#define BSDLY 0020000
123#define BS0 0000000
124#define BS1 0020000
125#define VTDLY 0040000
126#define VT0 0000000
127#define VT1 0040000
128#define FFDLY 0100000
129#define FF0 0000000
130#define FF1 0100000
131/*
132#define PAGEOUT ???
133#define WRAP ???
134 */
135
136/* c_cflag bit meaning */
137#define CBAUD 0010017
138#define B0 0000000 /* hang up */
139#define B50 0000001
140#define B75 0000002
141#define B110 0000003
142#define B134 0000004
143#define B150 0000005
144#define B200 0000006
145#define B300 0000007
146#define B600 0000010
147#define B1200 0000011
148#define B1800 0000012
149#define B2400 0000013
150#define B4800 0000014
151#define B9600 0000015
152#define B19200 0000016
153#define B38400 0000017
154#define EXTA B19200
155#define EXTB B38400
156#define CSIZE 0000060 /* Number of bits per byte (mask). */
157#define CS5 0000000 /* 5 bits per byte. */
158#define CS6 0000020 /* 6 bits per byte. */
159#define CS7 0000040 /* 7 bits per byte. */
160#define CS8 0000060 /* 8 bits per byte. */
161#define CSTOPB 0000100 /* Two stop bits instead of one. */
162#define CREAD 0000200 /* Enable receiver. */
163#define PARENB 0000400 /* Parity enable. */
164#define PARODD 0001000 /* Odd parity instead of even. */
165#define HUPCL 0002000 /* Hang up on last close. */
166#define CLOCAL 0004000 /* Ignore modem status lines. */
167#define CBAUDEX 0010000
168#define BOTHER 0010000
169#define B57600 0010001
170#define B115200 0010002
171#define B230400 0010003
172#define B460800 0010004
173#define B500000 0010005
174#define B576000 0010006
175#define B921600 0010007
176#define B1000000 0010010
177#define B1152000 0010011
178#define B1500000 0010012
179#define B2000000 0010013
180#define B2500000 0010014
181#define B3000000 0010015
182#define B3500000 0010016
183#define B4000000 0010017
184#define CIBAUD 002003600000 /* input baud rate */
185#define CMSPAR 010000000000 /* mark or space (stick) parity */
186#define CRTSCTS 020000000000 /* flow control */
187
188#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
189
190/* c_lflag bits */
191#define ISIG 0000001 /* Enable signals. */
192#define ICANON 0000002 /* Do erase and kill processing. */
193#define XCASE 0000004
194#define ECHO 0000010 /* Enable echo. */
195#define ECHOE 0000020 /* Visual erase for ERASE. */
196#define ECHOK 0000040 /* Echo NL after KILL. */
197#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
198#define NOFLSH 0000200 /* Disable flush after interrupt. */
199#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
200#define ECHOCTL 0001000 /* Echo control characters as ^X. */
201#define ECHOPRT 0002000 /* Hardcopy visual erase. */
202#define ECHOKE 0004000 /* Visual erase for KILL. */
203#define FLUSHO 0020000
204#define PENDIN 0040000 /* Retype pending input (state). */
205#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
206#define ITOSTOP TOSTOP
207#define EXTPROC 0200000 /* External processing on pty */
208
209/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
210#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
211
212/* tcflow() and TCXONC use these */
213#define TCOOFF 0 /* Suspend output. */
214#define TCOON 1 /* Restart suspended output. */
215#define TCIOFF 2 /* Send a STOP character. */
216#define TCION 3 /* Send a START character. */
217
218/* tcflush() and TCFLSH use these */
219#define TCIFLUSH 0 /* Discard data received but not yet read. */
220#define TCOFLUSH 1 /* Discard data written but not yet sent. */
221#define TCIOFLUSH 2 /* Discard all pending data. */
222
223/* tcsetattr uses these */
224#define TCSANOW TCSETS /* Change immediately. */
225#define TCSADRAIN TCSETSW /* Change when pending output is written. */
226#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
227
228#endif /* _ASM_TERMBITS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/termios.h deleted-81
...@@ -1,81 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_TERMIOS_H
11#define _ASM_TERMIOS_H
12
13#include <linux/errno.h>
14#include <asm/termbits.h>
15#include <asm/ioctls.h>
16
17struct sgttyb {
18 char sg_ispeed;
19 char sg_ospeed;
20 char sg_erase;
21 char sg_kill;
22 int sg_flags; /* SGI special - int, not short */
23};
24
25struct tchars {
26 char t_intrc;
27 char t_quitc;
28 char t_startc;
29 char t_stopc;
30 char t_eofc;
31 char t_brkc;
32};
33
34struct ltchars {
35 char t_suspc; /* stop process signal */
36 char t_dsuspc; /* delayed stop process signal */
37 char t_rprntc; /* reprint line */
38 char t_flushc; /* flush output (toggles) */
39 char t_werasc; /* word erase */
40 char t_lnextc; /* literal next character */
41};
42
43/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
44 compatibility anyway ... */
45
46struct winsize {
47 unsigned short ws_row;
48 unsigned short ws_col;
49 unsigned short ws_xpixel;
50 unsigned short ws_ypixel;
51};
52
53#define NCC 8
54struct termio {
55 unsigned short c_iflag; /* input mode flags */
56 unsigned short c_oflag; /* output mode flags */
57 unsigned short c_cflag; /* control mode flags */
58 unsigned short c_lflag; /* local mode flags */
59 char c_line; /* line discipline */
60 unsigned char c_cc[NCCS]; /* control characters */
61};
62
63
64/* modem lines */
65#define TIOCM_LE 0x001 /* line enable */
66#define TIOCM_DTR 0x002 /* data terminal ready */
67#define TIOCM_RTS 0x004 /* request to send */
68#define TIOCM_ST 0x010 /* secondary transmit */
69#define TIOCM_SR 0x020 /* secondary receive */
70#define TIOCM_CTS 0x040 /* clear to send */
71#define TIOCM_CAR 0x100 /* carrier detect */
72#define TIOCM_CD TIOCM_CAR
73#define TIOCM_RNG 0x200 /* ring */
74#define TIOCM_RI TIOCM_RNG
75#define TIOCM_DSR 0x400 /* data set ready */
76#define TIOCM_OUT1 0x2000
77#define TIOCM_OUT2 0x4000
78#define TIOCM_LOOP 0x8000
79
80
81#endif /* _ASM_TERMIOS_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/types.h deleted-29
...@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
8 * Copyright (C) 2008 Wind River Systems,
9 * written by Ralf Baechle
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12#ifndef _ASM_TYPES_H
13#define _ASM_TYPES_H
14
15/*
16 * We don't use int-l64.h for the kernel anymore but still use it for
17 * userspace to avoid code changes.
18 *
19 * However, some user programs (e.g. perf) may not want this. They can
20 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
21 */
22# if _MIPS_SZLONG == 64 && !defined(__SANE_USERSPACE_TYPES__)
23# include <asm-generic/int-l64.h>
24# else
25# include <asm-generic/int-ll64.h>
26# endif
27
28
29#endif /* _ASM_TYPES_H */
\ No newline at end of file
lib/libc/include/mips64-linux-any/asm/unistd.h deleted-1101
...@@ -1,1101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 *
10 * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
11 * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
12 */
13#ifndef _ASM_UNISTD_H
14#define _ASM_UNISTD_H
15
16#include <asm/sgidefs.h>
17
18#if _MIPS_SIM == _MIPS_SIM_ABI32
19
20/*
21 * Linux o32 style syscalls are in the range from 4000 to 4999.
22 */
23#define __NR_Linux 4000
24#define __NR_syscall (__NR_Linux + 0)
25#define __NR_exit (__NR_Linux + 1)
26#define __NR_fork (__NR_Linux + 2)
27#define __NR_read (__NR_Linux + 3)
28#define __NR_write (__NR_Linux + 4)
29#define __NR_open (__NR_Linux + 5)
30#define __NR_close (__NR_Linux + 6)
31#define __NR_waitpid (__NR_Linux + 7)
32#define __NR_creat (__NR_Linux + 8)
33#define __NR_link (__NR_Linux + 9)
34#define __NR_unlink (__NR_Linux + 10)
35#define __NR_execve (__NR_Linux + 11)
36#define __NR_chdir (__NR_Linux + 12)
37#define __NR_time (__NR_Linux + 13)
38#define __NR_mknod (__NR_Linux + 14)
39#define __NR_chmod (__NR_Linux + 15)
40#define __NR_lchown (__NR_Linux + 16)
41#define __NR_break (__NR_Linux + 17)
42#define __NR_unused18 (__NR_Linux + 18)
43#define __NR_lseek (__NR_Linux + 19)
44#define __NR_getpid (__NR_Linux + 20)
45#define __NR_mount (__NR_Linux + 21)
46#define __NR_umount (__NR_Linux + 22)
47#define __NR_setuid (__NR_Linux + 23)
48#define __NR_getuid (__NR_Linux + 24)
49#define __NR_stime (__NR_Linux + 25)
50#define __NR_ptrace (__NR_Linux + 26)
51#define __NR_alarm (__NR_Linux + 27)
52#define __NR_unused28 (__NR_Linux + 28)
53#define __NR_pause (__NR_Linux + 29)
54#define __NR_utime (__NR_Linux + 30)
55#define __NR_stty (__NR_Linux + 31)
56#define __NR_gtty (__NR_Linux + 32)
57#define __NR_access (__NR_Linux + 33)
58#define __NR_nice (__NR_Linux + 34)
59#define __NR_ftime (__NR_Linux + 35)
60#define __NR_sync (__NR_Linux + 36)
61#define __NR_kill (__NR_Linux + 37)
62#define __NR_rename (__NR_Linux + 38)
63#define __NR_mkdir (__NR_Linux + 39)
64#define __NR_rmdir (__NR_Linux + 40)
65#define __NR_dup (__NR_Linux + 41)
66#define __NR_pipe (__NR_Linux + 42)
67#define __NR_times (__NR_Linux + 43)
68#define __NR_prof (__NR_Linux + 44)
69#define __NR_brk (__NR_Linux + 45)
70#define __NR_setgid (__NR_Linux + 46)
71#define __NR_getgid (__NR_Linux + 47)
72#define __NR_signal (__NR_Linux + 48)
73#define __NR_geteuid (__NR_Linux + 49)
74#define __NR_getegid (__NR_Linux + 50)
75#define __NR_acct (__NR_Linux + 51)
76#define __NR_umount2 (__NR_Linux + 52)
77#define __NR_lock (__NR_Linux + 53)
78#define __NR_ioctl (__NR_Linux + 54)
79#define __NR_fcntl (__NR_Linux + 55)
80#define __NR_mpx (__NR_Linux + 56)
81#define __NR_setpgid (__NR_Linux + 57)
82#define __NR_ulimit (__NR_Linux + 58)
83#define __NR_unused59 (__NR_Linux + 59)
84#define __NR_umask (__NR_Linux + 60)
85#define __NR_chroot (__NR_Linux + 61)
86#define __NR_ustat (__NR_Linux + 62)
87#define __NR_dup2 (__NR_Linux + 63)
88#define __NR_getppid (__NR_Linux + 64)
89#define __NR_getpgrp (__NR_Linux + 65)
90#define __NR_setsid (__NR_Linux + 66)
91#define __NR_sigaction (__NR_Linux + 67)
92#define __NR_sgetmask (__NR_Linux + 68)
93#define __NR_ssetmask (__NR_Linux + 69)
94#define __NR_setreuid (__NR_Linux + 70)
95#define __NR_setregid (__NR_Linux + 71)
96#define __NR_sigsuspend (__NR_Linux + 72)
97#define __NR_sigpending (__NR_Linux + 73)
98#define __NR_sethostname (__NR_Linux + 74)
99#define __NR_setrlimit (__NR_Linux + 75)
100#define __NR_getrlimit (__NR_Linux + 76)
101#define __NR_getrusage (__NR_Linux + 77)
102#define __NR_gettimeofday (__NR_Linux + 78)
103#define __NR_settimeofday (__NR_Linux + 79)
104#define __NR_getgroups (__NR_Linux + 80)
105#define __NR_setgroups (__NR_Linux + 81)
106#define __NR_reserved82 (__NR_Linux + 82)
107#define __NR_symlink (__NR_Linux + 83)
108#define __NR_unused84 (__NR_Linux + 84)
109#define __NR_readlink (__NR_Linux + 85)
110#define __NR_uselib (__NR_Linux + 86)
111#define __NR_swapon (__NR_Linux + 87)
112#define __NR_reboot (__NR_Linux + 88)
113#define __NR_readdir (__NR_Linux + 89)
114#define __NR_mmap (__NR_Linux + 90)
115#define __NR_munmap (__NR_Linux + 91)
116#define __NR_truncate (__NR_Linux + 92)
117#define __NR_ftruncate (__NR_Linux + 93)
118#define __NR_fchmod (__NR_Linux + 94)
119#define __NR_fchown (__NR_Linux + 95)
120#define __NR_getpriority (__NR_Linux + 96)
121#define __NR_setpriority (__NR_Linux + 97)
122#define __NR_profil (__NR_Linux + 98)
123#define __NR_statfs (__NR_Linux + 99)
124#define __NR_fstatfs (__NR_Linux + 100)
125#define __NR_ioperm (__NR_Linux + 101)
126#define __NR_socketcall (__NR_Linux + 102)
127#define __NR_syslog (__NR_Linux + 103)
128#define __NR_setitimer (__NR_Linux + 104)
129#define __NR_getitimer (__NR_Linux + 105)
130#define __NR_stat (__NR_Linux + 106)
131#define __NR_lstat (__NR_Linux + 107)
132#define __NR_fstat (__NR_Linux + 108)
133#define __NR_unused109 (__NR_Linux + 109)
134#define __NR_iopl (__NR_Linux + 110)
135#define __NR_vhangup (__NR_Linux + 111)
136#define __NR_idle (__NR_Linux + 112)
137#define __NR_vm86 (__NR_Linux + 113)
138#define __NR_wait4 (__NR_Linux + 114)
139#define __NR_swapoff (__NR_Linux + 115)
140#define __NR_sysinfo (__NR_Linux + 116)
141#define __NR_ipc (__NR_Linux + 117)
142#define __NR_fsync (__NR_Linux + 118)
143#define __NR_sigreturn (__NR_Linux + 119)
144#define __NR_clone (__NR_Linux + 120)
145#define __NR_setdomainname (__NR_Linux + 121)
146#define __NR_uname (__NR_Linux + 122)
147#define __NR_modify_ldt (__NR_Linux + 123)
148#define __NR_adjtimex (__NR_Linux + 124)
149#define __NR_mprotect (__NR_Linux + 125)
150#define __NR_sigprocmask (__NR_Linux + 126)
151#define __NR_create_module (__NR_Linux + 127)
152#define __NR_init_module (__NR_Linux + 128)
153#define __NR_delete_module (__NR_Linux + 129)
154#define __NR_get_kernel_syms (__NR_Linux + 130)
155#define __NR_quotactl (__NR_Linux + 131)
156#define __NR_getpgid (__NR_Linux + 132)
157#define __NR_fchdir (__NR_Linux + 133)
158#define __NR_bdflush (__NR_Linux + 134)
159#define __NR_sysfs (__NR_Linux + 135)
160#define __NR_personality (__NR_Linux + 136)
161#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
162#define __NR_setfsuid (__NR_Linux + 138)
163#define __NR_setfsgid (__NR_Linux + 139)
164#define __NR__llseek (__NR_Linux + 140)
165#define __NR_getdents (__NR_Linux + 141)
166#define __NR__newselect (__NR_Linux + 142)
167#define __NR_flock (__NR_Linux + 143)
168#define __NR_msync (__NR_Linux + 144)
169#define __NR_readv (__NR_Linux + 145)
170#define __NR_writev (__NR_Linux + 146)
171#define __NR_cacheflush (__NR_Linux + 147)
172#define __NR_cachectl (__NR_Linux + 148)
173#define __NR_sysmips (__NR_Linux + 149)
174#define __NR_unused150 (__NR_Linux + 150)
175#define __NR_getsid (__NR_Linux + 151)
176#define __NR_fdatasync (__NR_Linux + 152)
177#define __NR__sysctl (__NR_Linux + 153)
178#define __NR_mlock (__NR_Linux + 154)
179#define __NR_munlock (__NR_Linux + 155)
180#define __NR_mlockall (__NR_Linux + 156)
181#define __NR_munlockall (__NR_Linux + 157)
182#define __NR_sched_setparam (__NR_Linux + 158)
183#define __NR_sched_getparam (__NR_Linux + 159)
184#define __NR_sched_setscheduler (__NR_Linux + 160)
185#define __NR_sched_getscheduler (__NR_Linux + 161)
186#define __NR_sched_yield (__NR_Linux + 162)
187#define __NR_sched_get_priority_max (__NR_Linux + 163)
188#define __NR_sched_get_priority_min (__NR_Linux + 164)
189#define __NR_sched_rr_get_interval (__NR_Linux + 165)
190#define __NR_nanosleep (__NR_Linux + 166)
191#define __NR_mremap (__NR_Linux + 167)
192#define __NR_accept (__NR_Linux + 168)
193#define __NR_bind (__NR_Linux + 169)
194#define __NR_connect (__NR_Linux + 170)
195#define __NR_getpeername (__NR_Linux + 171)
196#define __NR_getsockname (__NR_Linux + 172)
197#define __NR_getsockopt (__NR_Linux + 173)
198#define __NR_listen (__NR_Linux + 174)
199#define __NR_recv (__NR_Linux + 175)
200#define __NR_recvfrom (__NR_Linux + 176)
201#define __NR_recvmsg (__NR_Linux + 177)
202#define __NR_send (__NR_Linux + 178)
203#define __NR_sendmsg (__NR_Linux + 179)
204#define __NR_sendto (__NR_Linux + 180)
205#define __NR_setsockopt (__NR_Linux + 181)
206#define __NR_shutdown (__NR_Linux + 182)
207#define __NR_socket (__NR_Linux + 183)
208#define __NR_socketpair (__NR_Linux + 184)
209#define __NR_setresuid (__NR_Linux + 185)
210#define __NR_getresuid (__NR_Linux + 186)
211#define __NR_query_module (__NR_Linux + 187)
212#define __NR_poll (__NR_Linux + 188)
213#define __NR_nfsservctl (__NR_Linux + 189)
214#define __NR_setresgid (__NR_Linux + 190)
215#define __NR_getresgid (__NR_Linux + 191)
216#define __NR_prctl (__NR_Linux + 192)
217#define __NR_rt_sigreturn (__NR_Linux + 193)
218#define __NR_rt_sigaction (__NR_Linux + 194)
219#define __NR_rt_sigprocmask (__NR_Linux + 195)
220#define __NR_rt_sigpending (__NR_Linux + 196)
221#define __NR_rt_sigtimedwait (__NR_Linux + 197)
222#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
223#define __NR_rt_sigsuspend (__NR_Linux + 199)
224#define __NR_pread64 (__NR_Linux + 200)
225#define __NR_pwrite64 (__NR_Linux + 201)
226#define __NR_chown (__NR_Linux + 202)
227#define __NR_getcwd (__NR_Linux + 203)
228#define __NR_capget (__NR_Linux + 204)
229#define __NR_capset (__NR_Linux + 205)
230#define __NR_sigaltstack (__NR_Linux + 206)
231#define __NR_sendfile (__NR_Linux + 207)
232#define __NR_getpmsg (__NR_Linux + 208)
233#define __NR_putpmsg (__NR_Linux + 209)
234#define __NR_mmap2 (__NR_Linux + 210)
235#define __NR_truncate64 (__NR_Linux + 211)
236#define __NR_ftruncate64 (__NR_Linux + 212)
237#define __NR_stat64 (__NR_Linux + 213)
238#define __NR_lstat64 (__NR_Linux + 214)
239#define __NR_fstat64 (__NR_Linux + 215)
240#define __NR_pivot_root (__NR_Linux + 216)
241#define __NR_mincore (__NR_Linux + 217)
242#define __NR_madvise (__NR_Linux + 218)
243#define __NR_getdents64 (__NR_Linux + 219)
244#define __NR_fcntl64 (__NR_Linux + 220)
245#define __NR_reserved221 (__NR_Linux + 221)
246#define __NR_gettid (__NR_Linux + 222)
247#define __NR_readahead (__NR_Linux + 223)
248#define __NR_setxattr (__NR_Linux + 224)
249#define __NR_lsetxattr (__NR_Linux + 225)
250#define __NR_fsetxattr (__NR_Linux + 226)
251#define __NR_getxattr (__NR_Linux + 227)
252#define __NR_lgetxattr (__NR_Linux + 228)
253#define __NR_fgetxattr (__NR_Linux + 229)
254#define __NR_listxattr (__NR_Linux + 230)
255#define __NR_llistxattr (__NR_Linux + 231)
256#define __NR_flistxattr (__NR_Linux + 232)
257#define __NR_removexattr (__NR_Linux + 233)
258#define __NR_lremovexattr (__NR_Linux + 234)
259#define __NR_fremovexattr (__NR_Linux + 235)
260#define __NR_tkill (__NR_Linux + 236)
261#define __NR_sendfile64 (__NR_Linux + 237)
262#define __NR_futex (__NR_Linux + 238)
263#define __NR_sched_setaffinity (__NR_Linux + 239)
264#define __NR_sched_getaffinity (__NR_Linux + 240)
265#define __NR_io_setup (__NR_Linux + 241)
266#define __NR_io_destroy (__NR_Linux + 242)
267#define __NR_io_getevents (__NR_Linux + 243)
268#define __NR_io_submit (__NR_Linux + 244)
269#define __NR_io_cancel (__NR_Linux + 245)
270#define __NR_exit_group (__NR_Linux + 246)
271#define __NR_lookup_dcookie (__NR_Linux + 247)
272#define __NR_epoll_create (__NR_Linux + 248)
273#define __NR_epoll_ctl (__NR_Linux + 249)
274#define __NR_epoll_wait (__NR_Linux + 250)
275#define __NR_remap_file_pages (__NR_Linux + 251)
276#define __NR_set_tid_address (__NR_Linux + 252)
277#define __NR_restart_syscall (__NR_Linux + 253)
278#define __NR_fadvise64 (__NR_Linux + 254)
279#define __NR_statfs64 (__NR_Linux + 255)
280#define __NR_fstatfs64 (__NR_Linux + 256)
281#define __NR_timer_create (__NR_Linux + 257)
282#define __NR_timer_settime (__NR_Linux + 258)
283#define __NR_timer_gettime (__NR_Linux + 259)
284#define __NR_timer_getoverrun (__NR_Linux + 260)
285#define __NR_timer_delete (__NR_Linux + 261)
286#define __NR_clock_settime (__NR_Linux + 262)
287#define __NR_clock_gettime (__NR_Linux + 263)
288#define __NR_clock_getres (__NR_Linux + 264)
289#define __NR_clock_nanosleep (__NR_Linux + 265)
290#define __NR_tgkill (__NR_Linux + 266)
291#define __NR_utimes (__NR_Linux + 267)
292#define __NR_mbind (__NR_Linux + 268)
293#define __NR_get_mempolicy (__NR_Linux + 269)
294#define __NR_set_mempolicy (__NR_Linux + 270)
295#define __NR_mq_open (__NR_Linux + 271)
296#define __NR_mq_unlink (__NR_Linux + 272)
297#define __NR_mq_timedsend (__NR_Linux + 273)
298#define __NR_mq_timedreceive (__NR_Linux + 274)
299#define __NR_mq_notify (__NR_Linux + 275)
300#define __NR_mq_getsetattr (__NR_Linux + 276)
301#define __NR_vserver (__NR_Linux + 277)
302#define __NR_waitid (__NR_Linux + 278)
303/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
304#define __NR_add_key (__NR_Linux + 280)
305#define __NR_request_key (__NR_Linux + 281)
306#define __NR_keyctl (__NR_Linux + 282)
307#define __NR_set_thread_area (__NR_Linux + 283)
308#define __NR_inotify_init (__NR_Linux + 284)
309#define __NR_inotify_add_watch (__NR_Linux + 285)
310#define __NR_inotify_rm_watch (__NR_Linux + 286)
311#define __NR_migrate_pages (__NR_Linux + 287)
312#define __NR_openat (__NR_Linux + 288)
313#define __NR_mkdirat (__NR_Linux + 289)
314#define __NR_mknodat (__NR_Linux + 290)
315#define __NR_fchownat (__NR_Linux + 291)
316#define __NR_futimesat (__NR_Linux + 292)
317#define __NR_fstatat64 (__NR_Linux + 293)
318#define __NR_unlinkat (__NR_Linux + 294)
319#define __NR_renameat (__NR_Linux + 295)
320#define __NR_linkat (__NR_Linux + 296)
321#define __NR_symlinkat (__NR_Linux + 297)
322#define __NR_readlinkat (__NR_Linux + 298)
323#define __NR_fchmodat (__NR_Linux + 299)
324#define __NR_faccessat (__NR_Linux + 300)
325#define __NR_pselect6 (__NR_Linux + 301)
326#define __NR_ppoll (__NR_Linux + 302)
327#define __NR_unshare (__NR_Linux + 303)
328#define __NR_splice (__NR_Linux + 304)
329#define __NR_sync_file_range (__NR_Linux + 305)
330#define __NR_tee (__NR_Linux + 306)
331#define __NR_vmsplice (__NR_Linux + 307)
332#define __NR_move_pages (__NR_Linux + 308)
333#define __NR_set_robust_list (__NR_Linux + 309)
334#define __NR_get_robust_list (__NR_Linux + 310)
335#define __NR_kexec_load (__NR_Linux + 311)
336#define __NR_getcpu (__NR_Linux + 312)
337#define __NR_epoll_pwait (__NR_Linux + 313)
338#define __NR_ioprio_set (__NR_Linux + 314)
339#define __NR_ioprio_get (__NR_Linux + 315)
340#define __NR_utimensat (__NR_Linux + 316)
341#define __NR_signalfd (__NR_Linux + 317)
342#define __NR_timerfd (__NR_Linux + 318)
343#define __NR_eventfd (__NR_Linux + 319)
344#define __NR_fallocate (__NR_Linux + 320)
345#define __NR_timerfd_create (__NR_Linux + 321)
346#define __NR_timerfd_gettime (__NR_Linux + 322)
347#define __NR_timerfd_settime (__NR_Linux + 323)
348#define __NR_signalfd4 (__NR_Linux + 324)
349#define __NR_eventfd2 (__NR_Linux + 325)
350#define __NR_epoll_create1 (__NR_Linux + 326)
351#define __NR_dup3 (__NR_Linux + 327)
352#define __NR_pipe2 (__NR_Linux + 328)
353#define __NR_inotify_init1 (__NR_Linux + 329)
354#define __NR_preadv (__NR_Linux + 330)
355#define __NR_pwritev (__NR_Linux + 331)
356#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
357#define __NR_perf_event_open (__NR_Linux + 333)
358#define __NR_accept4 (__NR_Linux + 334)
359#define __NR_recvmmsg (__NR_Linux + 335)
360#define __NR_fanotify_init (__NR_Linux + 336)
361#define __NR_fanotify_mark (__NR_Linux + 337)
362#define __NR_prlimit64 (__NR_Linux + 338)
363#define __NR_name_to_handle_at (__NR_Linux + 339)
364#define __NR_open_by_handle_at (__NR_Linux + 340)
365#define __NR_clock_adjtime (__NR_Linux + 341)
366#define __NR_syncfs (__NR_Linux + 342)
367#define __NR_sendmmsg (__NR_Linux + 343)
368#define __NR_setns (__NR_Linux + 344)
369#define __NR_process_vm_readv (__NR_Linux + 345)
370#define __NR_process_vm_writev (__NR_Linux + 346)
371#define __NR_kcmp (__NR_Linux + 347)
372#define __NR_finit_module (__NR_Linux + 348)
373#define __NR_sched_setattr (__NR_Linux + 349)
374#define __NR_sched_getattr (__NR_Linux + 350)
375#define __NR_renameat2 (__NR_Linux + 351)
376#define __NR_seccomp (__NR_Linux + 352)
377#define __NR_getrandom (__NR_Linux + 353)
378#define __NR_memfd_create (__NR_Linux + 354)
379#define __NR_bpf (__NR_Linux + 355)
380#define __NR_execveat (__NR_Linux + 356)
381#define __NR_userfaultfd (__NR_Linux + 357)
382#define __NR_membarrier (__NR_Linux + 358)
383#define __NR_mlock2 (__NR_Linux + 359)
384#define __NR_copy_file_range (__NR_Linux + 360)
385#define __NR_preadv2 (__NR_Linux + 361)
386#define __NR_pwritev2 (__NR_Linux + 362)
387#define __NR_pkey_mprotect (__NR_Linux + 363)
388#define __NR_pkey_alloc (__NR_Linux + 364)
389#define __NR_pkey_free (__NR_Linux + 365)
390#define __NR_statx (__NR_Linux + 366)
391#define __NR_rseq (__NR_Linux + 367)
392#define __NR_io_pgetevents (__NR_Linux + 368)
393
394
395/*
396 * Offset of the last Linux o32 flavoured syscall
397 */
398#define __NR_Linux_syscalls 368
399
400#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
401
402#define __NR_O32_Linux 4000
403#define __NR_O32_Linux_syscalls 368
404
405#if _MIPS_SIM == _MIPS_SIM_ABI64
406
407/*
408 * Linux 64-bit syscalls are in the range from 5000 to 5999.
409 */
410#define __NR_Linux 5000
411#define __NR_read (__NR_Linux + 0)
412#define __NR_write (__NR_Linux + 1)
413#define __NR_open (__NR_Linux + 2)
414#define __NR_close (__NR_Linux + 3)
415#define __NR_stat (__NR_Linux + 4)
416#define __NR_fstat (__NR_Linux + 5)
417#define __NR_lstat (__NR_Linux + 6)
418#define __NR_poll (__NR_Linux + 7)
419#define __NR_lseek (__NR_Linux + 8)
420#define __NR_mmap (__NR_Linux + 9)
421#define __NR_mprotect (__NR_Linux + 10)
422#define __NR_munmap (__NR_Linux + 11)
423#define __NR_brk (__NR_Linux + 12)
424#define __NR_rt_sigaction (__NR_Linux + 13)
425#define __NR_rt_sigprocmask (__NR_Linux + 14)
426#define __NR_ioctl (__NR_Linux + 15)
427#define __NR_pread64 (__NR_Linux + 16)
428#define __NR_pwrite64 (__NR_Linux + 17)
429#define __NR_readv (__NR_Linux + 18)
430#define __NR_writev (__NR_Linux + 19)
431#define __NR_access (__NR_Linux + 20)
432#define __NR_pipe (__NR_Linux + 21)
433#define __NR__newselect (__NR_Linux + 22)
434#define __NR_sched_yield (__NR_Linux + 23)
435#define __NR_mremap (__NR_Linux + 24)
436#define __NR_msync (__NR_Linux + 25)
437#define __NR_mincore (__NR_Linux + 26)
438#define __NR_madvise (__NR_Linux + 27)
439#define __NR_shmget (__NR_Linux + 28)
440#define __NR_shmat (__NR_Linux + 29)
441#define __NR_shmctl (__NR_Linux + 30)
442#define __NR_dup (__NR_Linux + 31)
443#define __NR_dup2 (__NR_Linux + 32)
444#define __NR_pause (__NR_Linux + 33)
445#define __NR_nanosleep (__NR_Linux + 34)
446#define __NR_getitimer (__NR_Linux + 35)
447#define __NR_setitimer (__NR_Linux + 36)
448#define __NR_alarm (__NR_Linux + 37)
449#define __NR_getpid (__NR_Linux + 38)
450#define __NR_sendfile (__NR_Linux + 39)
451#define __NR_socket (__NR_Linux + 40)
452#define __NR_connect (__NR_Linux + 41)
453#define __NR_accept (__NR_Linux + 42)
454#define __NR_sendto (__NR_Linux + 43)
455#define __NR_recvfrom (__NR_Linux + 44)
456#define __NR_sendmsg (__NR_Linux + 45)
457#define __NR_recvmsg (__NR_Linux + 46)
458#define __NR_shutdown (__NR_Linux + 47)
459#define __NR_bind (__NR_Linux + 48)
460#define __NR_listen (__NR_Linux + 49)
461#define __NR_getsockname (__NR_Linux + 50)
462#define __NR_getpeername (__NR_Linux + 51)
463#define __NR_socketpair (__NR_Linux + 52)
464#define __NR_setsockopt (__NR_Linux + 53)
465#define __NR_getsockopt (__NR_Linux + 54)
466#define __NR_clone (__NR_Linux + 55)
467#define __NR_fork (__NR_Linux + 56)
468#define __NR_execve (__NR_Linux + 57)
469#define __NR_exit (__NR_Linux + 58)
470#define __NR_wait4 (__NR_Linux + 59)
471#define __NR_kill (__NR_Linux + 60)
472#define __NR_uname (__NR_Linux + 61)
473#define __NR_semget (__NR_Linux + 62)
474#define __NR_semop (__NR_Linux + 63)
475#define __NR_semctl (__NR_Linux + 64)
476#define __NR_shmdt (__NR_Linux + 65)
477#define __NR_msgget (__NR_Linux + 66)
478#define __NR_msgsnd (__NR_Linux + 67)
479#define __NR_msgrcv (__NR_Linux + 68)
480#define __NR_msgctl (__NR_Linux + 69)
481#define __NR_fcntl (__NR_Linux + 70)
482#define __NR_flock (__NR_Linux + 71)
483#define __NR_fsync (__NR_Linux + 72)
484#define __NR_fdatasync (__NR_Linux + 73)
485#define __NR_truncate (__NR_Linux + 74)
486#define __NR_ftruncate (__NR_Linux + 75)
487#define __NR_getdents (__NR_Linux + 76)
488#define __NR_getcwd (__NR_Linux + 77)
489#define __NR_chdir (__NR_Linux + 78)
490#define __NR_fchdir (__NR_Linux + 79)
491#define __NR_rename (__NR_Linux + 80)
492#define __NR_mkdir (__NR_Linux + 81)
493#define __NR_rmdir (__NR_Linux + 82)
494#define __NR_creat (__NR_Linux + 83)
495#define __NR_link (__NR_Linux + 84)
496#define __NR_unlink (__NR_Linux + 85)
497#define __NR_symlink (__NR_Linux + 86)
498#define __NR_readlink (__NR_Linux + 87)
499#define __NR_chmod (__NR_Linux + 88)
500#define __NR_fchmod (__NR_Linux + 89)
501#define __NR_chown (__NR_Linux + 90)
502#define __NR_fchown (__NR_Linux + 91)
503#define __NR_lchown (__NR_Linux + 92)
504#define __NR_umask (__NR_Linux + 93)
505#define __NR_gettimeofday (__NR_Linux + 94)
506#define __NR_getrlimit (__NR_Linux + 95)
507#define __NR_getrusage (__NR_Linux + 96)
508#define __NR_sysinfo (__NR_Linux + 97)
509#define __NR_times (__NR_Linux + 98)
510#define __NR_ptrace (__NR_Linux + 99)
511#define __NR_getuid (__NR_Linux + 100)
512#define __NR_syslog (__NR_Linux + 101)
513#define __NR_getgid (__NR_Linux + 102)
514#define __NR_setuid (__NR_Linux + 103)
515#define __NR_setgid (__NR_Linux + 104)
516#define __NR_geteuid (__NR_Linux + 105)
517#define __NR_getegid (__NR_Linux + 106)
518#define __NR_setpgid (__NR_Linux + 107)
519#define __NR_getppid (__NR_Linux + 108)
520#define __NR_getpgrp (__NR_Linux + 109)
521#define __NR_setsid (__NR_Linux + 110)
522#define __NR_setreuid (__NR_Linux + 111)
523#define __NR_setregid (__NR_Linux + 112)
524#define __NR_getgroups (__NR_Linux + 113)
525#define __NR_setgroups (__NR_Linux + 114)
526#define __NR_setresuid (__NR_Linux + 115)
527#define __NR_getresuid (__NR_Linux + 116)
528#define __NR_setresgid (__NR_Linux + 117)
529#define __NR_getresgid (__NR_Linux + 118)
530#define __NR_getpgid (__NR_Linux + 119)
531#define __NR_setfsuid (__NR_Linux + 120)
532#define __NR_setfsgid (__NR_Linux + 121)
533#define __NR_getsid (__NR_Linux + 122)
534#define __NR_capget (__NR_Linux + 123)
535#define __NR_capset (__NR_Linux + 124)
536#define __NR_rt_sigpending (__NR_Linux + 125)
537#define __NR_rt_sigtimedwait (__NR_Linux + 126)
538#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
539#define __NR_rt_sigsuspend (__NR_Linux + 128)
540#define __NR_sigaltstack (__NR_Linux + 129)
541#define __NR_utime (__NR_Linux + 130)
542#define __NR_mknod (__NR_Linux + 131)
543#define __NR_personality (__NR_Linux + 132)
544#define __NR_ustat (__NR_Linux + 133)
545#define __NR_statfs (__NR_Linux + 134)
546#define __NR_fstatfs (__NR_Linux + 135)
547#define __NR_sysfs (__NR_Linux + 136)
548#define __NR_getpriority (__NR_Linux + 137)
549#define __NR_setpriority (__NR_Linux + 138)
550#define __NR_sched_setparam (__NR_Linux + 139)
551#define __NR_sched_getparam (__NR_Linux + 140)
552#define __NR_sched_setscheduler (__NR_Linux + 141)
553#define __NR_sched_getscheduler (__NR_Linux + 142)
554#define __NR_sched_get_priority_max (__NR_Linux + 143)
555#define __NR_sched_get_priority_min (__NR_Linux + 144)
556#define __NR_sched_rr_get_interval (__NR_Linux + 145)
557#define __NR_mlock (__NR_Linux + 146)
558#define __NR_munlock (__NR_Linux + 147)
559#define __NR_mlockall (__NR_Linux + 148)
560#define __NR_munlockall (__NR_Linux + 149)
561#define __NR_vhangup (__NR_Linux + 150)
562#define __NR_pivot_root (__NR_Linux + 151)
563#define __NR__sysctl (__NR_Linux + 152)
564#define __NR_prctl (__NR_Linux + 153)
565#define __NR_adjtimex (__NR_Linux + 154)
566#define __NR_setrlimit (__NR_Linux + 155)
567#define __NR_chroot (__NR_Linux + 156)
568#define __NR_sync (__NR_Linux + 157)
569#define __NR_acct (__NR_Linux + 158)
570#define __NR_settimeofday (__NR_Linux + 159)
571#define __NR_mount (__NR_Linux + 160)
572#define __NR_umount2 (__NR_Linux + 161)
573#define __NR_swapon (__NR_Linux + 162)
574#define __NR_swapoff (__NR_Linux + 163)
575#define __NR_reboot (__NR_Linux + 164)
576#define __NR_sethostname (__NR_Linux + 165)
577#define __NR_setdomainname (__NR_Linux + 166)
578#define __NR_create_module (__NR_Linux + 167)
579#define __NR_init_module (__NR_Linux + 168)
580#define __NR_delete_module (__NR_Linux + 169)
581#define __NR_get_kernel_syms (__NR_Linux + 170)
582#define __NR_query_module (__NR_Linux + 171)
583#define __NR_quotactl (__NR_Linux + 172)
584#define __NR_nfsservctl (__NR_Linux + 173)
585#define __NR_getpmsg (__NR_Linux + 174)
586#define __NR_putpmsg (__NR_Linux + 175)
587#define __NR_afs_syscall (__NR_Linux + 176)
588#define __NR_reserved177 (__NR_Linux + 177)
589#define __NR_gettid (__NR_Linux + 178)
590#define __NR_readahead (__NR_Linux + 179)
591#define __NR_setxattr (__NR_Linux + 180)
592#define __NR_lsetxattr (__NR_Linux + 181)
593#define __NR_fsetxattr (__NR_Linux + 182)
594#define __NR_getxattr (__NR_Linux + 183)
595#define __NR_lgetxattr (__NR_Linux + 184)
596#define __NR_fgetxattr (__NR_Linux + 185)
597#define __NR_listxattr (__NR_Linux + 186)
598#define __NR_llistxattr (__NR_Linux + 187)
599#define __NR_flistxattr (__NR_Linux + 188)
600#define __NR_removexattr (__NR_Linux + 189)
601#define __NR_lremovexattr (__NR_Linux + 190)
602#define __NR_fremovexattr (__NR_Linux + 191)
603#define __NR_tkill (__NR_Linux + 192)
604#define __NR_reserved193 (__NR_Linux + 193)
605#define __NR_futex (__NR_Linux + 194)
606#define __NR_sched_setaffinity (__NR_Linux + 195)
607#define __NR_sched_getaffinity (__NR_Linux + 196)
608#define __NR_cacheflush (__NR_Linux + 197)
609#define __NR_cachectl (__NR_Linux + 198)
610#define __NR_sysmips (__NR_Linux + 199)
611#define __NR_io_setup (__NR_Linux + 200)
612#define __NR_io_destroy (__NR_Linux + 201)
613#define __NR_io_getevents (__NR_Linux + 202)
614#define __NR_io_submit (__NR_Linux + 203)
615#define __NR_io_cancel (__NR_Linux + 204)
616#define __NR_exit_group (__NR_Linux + 205)
617#define __NR_lookup_dcookie (__NR_Linux + 206)
618#define __NR_epoll_create (__NR_Linux + 207)
619#define __NR_epoll_ctl (__NR_Linux + 208)
620#define __NR_epoll_wait (__NR_Linux + 209)
621#define __NR_remap_file_pages (__NR_Linux + 210)
622#define __NR_rt_sigreturn (__NR_Linux + 211)
623#define __NR_set_tid_address (__NR_Linux + 212)
624#define __NR_restart_syscall (__NR_Linux + 213)
625#define __NR_semtimedop (__NR_Linux + 214)
626#define __NR_fadvise64 (__NR_Linux + 215)
627#define __NR_timer_create (__NR_Linux + 216)
628#define __NR_timer_settime (__NR_Linux + 217)
629#define __NR_timer_gettime (__NR_Linux + 218)
630#define __NR_timer_getoverrun (__NR_Linux + 219)
631#define __NR_timer_delete (__NR_Linux + 220)
632#define __NR_clock_settime (__NR_Linux + 221)
633#define __NR_clock_gettime (__NR_Linux + 222)
634#define __NR_clock_getres (__NR_Linux + 223)
635#define __NR_clock_nanosleep (__NR_Linux + 224)
636#define __NR_tgkill (__NR_Linux + 225)
637#define __NR_utimes (__NR_Linux + 226)
638#define __NR_mbind (__NR_Linux + 227)
639#define __NR_get_mempolicy (__NR_Linux + 228)
640#define __NR_set_mempolicy (__NR_Linux + 229)
641#define __NR_mq_open (__NR_Linux + 230)
642#define __NR_mq_unlink (__NR_Linux + 231)
643#define __NR_mq_timedsend (__NR_Linux + 232)
644#define __NR_mq_timedreceive (__NR_Linux + 233)
645#define __NR_mq_notify (__NR_Linux + 234)
646#define __NR_mq_getsetattr (__NR_Linux + 235)
647#define __NR_vserver (__NR_Linux + 236)
648#define __NR_waitid (__NR_Linux + 237)
649/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
650#define __NR_add_key (__NR_Linux + 239)
651#define __NR_request_key (__NR_Linux + 240)
652#define __NR_keyctl (__NR_Linux + 241)
653#define __NR_set_thread_area (__NR_Linux + 242)
654#define __NR_inotify_init (__NR_Linux + 243)
655#define __NR_inotify_add_watch (__NR_Linux + 244)
656#define __NR_inotify_rm_watch (__NR_Linux + 245)
657#define __NR_migrate_pages (__NR_Linux + 246)
658#define __NR_openat (__NR_Linux + 247)
659#define __NR_mkdirat (__NR_Linux + 248)
660#define __NR_mknodat (__NR_Linux + 249)
661#define __NR_fchownat (__NR_Linux + 250)
662#define __NR_futimesat (__NR_Linux + 251)
663#define __NR_newfstatat (__NR_Linux + 252)
664#define __NR_unlinkat (__NR_Linux + 253)
665#define __NR_renameat (__NR_Linux + 254)
666#define __NR_linkat (__NR_Linux + 255)
667#define __NR_symlinkat (__NR_Linux + 256)
668#define __NR_readlinkat (__NR_Linux + 257)
669#define __NR_fchmodat (__NR_Linux + 258)
670#define __NR_faccessat (__NR_Linux + 259)
671#define __NR_pselect6 (__NR_Linux + 260)
672#define __NR_ppoll (__NR_Linux + 261)
673#define __NR_unshare (__NR_Linux + 262)
674#define __NR_splice (__NR_Linux + 263)
675#define __NR_sync_file_range (__NR_Linux + 264)
676#define __NR_tee (__NR_Linux + 265)
677#define __NR_vmsplice (__NR_Linux + 266)
678#define __NR_move_pages (__NR_Linux + 267)
679#define __NR_set_robust_list (__NR_Linux + 268)
680#define __NR_get_robust_list (__NR_Linux + 269)
681#define __NR_kexec_load (__NR_Linux + 270)
682#define __NR_getcpu (__NR_Linux + 271)
683#define __NR_epoll_pwait (__NR_Linux + 272)
684#define __NR_ioprio_set (__NR_Linux + 273)
685#define __NR_ioprio_get (__NR_Linux + 274)
686#define __NR_utimensat (__NR_Linux + 275)
687#define __NR_signalfd (__NR_Linux + 276)
688#define __NR_timerfd (__NR_Linux + 277)
689#define __NR_eventfd (__NR_Linux + 278)
690#define __NR_fallocate (__NR_Linux + 279)
691#define __NR_timerfd_create (__NR_Linux + 280)
692#define __NR_timerfd_gettime (__NR_Linux + 281)
693#define __NR_timerfd_settime (__NR_Linux + 282)
694#define __NR_signalfd4 (__NR_Linux + 283)
695#define __NR_eventfd2 (__NR_Linux + 284)
696#define __NR_epoll_create1 (__NR_Linux + 285)
697#define __NR_dup3 (__NR_Linux + 286)
698#define __NR_pipe2 (__NR_Linux + 287)
699#define __NR_inotify_init1 (__NR_Linux + 288)
700#define __NR_preadv (__NR_Linux + 289)
701#define __NR_pwritev (__NR_Linux + 290)
702#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
703#define __NR_perf_event_open (__NR_Linux + 292)
704#define __NR_accept4 (__NR_Linux + 293)
705#define __NR_recvmmsg (__NR_Linux + 294)
706#define __NR_fanotify_init (__NR_Linux + 295)
707#define __NR_fanotify_mark (__NR_Linux + 296)
708#define __NR_prlimit64 (__NR_Linux + 297)
709#define __NR_name_to_handle_at (__NR_Linux + 298)
710#define __NR_open_by_handle_at (__NR_Linux + 299)
711#define __NR_clock_adjtime (__NR_Linux + 300)
712#define __NR_syncfs (__NR_Linux + 301)
713#define __NR_sendmmsg (__NR_Linux + 302)
714#define __NR_setns (__NR_Linux + 303)
715#define __NR_process_vm_readv (__NR_Linux + 304)
716#define __NR_process_vm_writev (__NR_Linux + 305)
717#define __NR_kcmp (__NR_Linux + 306)
718#define __NR_finit_module (__NR_Linux + 307)
719#define __NR_getdents64 (__NR_Linux + 308)
720#define __NR_sched_setattr (__NR_Linux + 309)
721#define __NR_sched_getattr (__NR_Linux + 310)
722#define __NR_renameat2 (__NR_Linux + 311)
723#define __NR_seccomp (__NR_Linux + 312)
724#define __NR_getrandom (__NR_Linux + 313)
725#define __NR_memfd_create (__NR_Linux + 314)
726#define __NR_bpf (__NR_Linux + 315)
727#define __NR_execveat (__NR_Linux + 316)
728#define __NR_userfaultfd (__NR_Linux + 317)
729#define __NR_membarrier (__NR_Linux + 318)
730#define __NR_mlock2 (__NR_Linux + 319)
731#define __NR_copy_file_range (__NR_Linux + 320)
732#define __NR_preadv2 (__NR_Linux + 321)
733#define __NR_pwritev2 (__NR_Linux + 322)
734#define __NR_pkey_mprotect (__NR_Linux + 323)
735#define __NR_pkey_alloc (__NR_Linux + 324)
736#define __NR_pkey_free (__NR_Linux + 325)
737#define __NR_statx (__NR_Linux + 326)
738#define __NR_rseq (__NR_Linux + 327)
739#define __NR_io_pgetevents (__NR_Linux + 328)
740
741/*
742 * Offset of the last Linux 64-bit flavoured syscall
743 */
744#define __NR_Linux_syscalls 328
745
746#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
747
748#define __NR_64_Linux 5000
749#define __NR_64_Linux_syscalls 328
750
751#if _MIPS_SIM == _MIPS_SIM_NABI32
752
753/*
754 * Linux N32 syscalls are in the range from 6000 to 6999.
755 */
756#define __NR_Linux 6000
757#define __NR_read (__NR_Linux + 0)
758#define __NR_write (__NR_Linux + 1)
759#define __NR_open (__NR_Linux + 2)
760#define __NR_close (__NR_Linux + 3)
761#define __NR_stat (__NR_Linux + 4)
762#define __NR_fstat (__NR_Linux + 5)
763#define __NR_lstat (__NR_Linux + 6)
764#define __NR_poll (__NR_Linux + 7)
765#define __NR_lseek (__NR_Linux + 8)
766#define __NR_mmap (__NR_Linux + 9)
767#define __NR_mprotect (__NR_Linux + 10)
768#define __NR_munmap (__NR_Linux + 11)
769#define __NR_brk (__NR_Linux + 12)
770#define __NR_rt_sigaction (__NR_Linux + 13)
771#define __NR_rt_sigprocmask (__NR_Linux + 14)
772#define __NR_ioctl (__NR_Linux + 15)
773#define __NR_pread64 (__NR_Linux + 16)
774#define __NR_pwrite64 (__NR_Linux + 17)
775#define __NR_readv (__NR_Linux + 18)
776#define __NR_writev (__NR_Linux + 19)
777#define __NR_access (__NR_Linux + 20)
778#define __NR_pipe (__NR_Linux + 21)
779#define __NR__newselect (__NR_Linux + 22)
780#define __NR_sched_yield (__NR_Linux + 23)
781#define __NR_mremap (__NR_Linux + 24)
782#define __NR_msync (__NR_Linux + 25)
783#define __NR_mincore (__NR_Linux + 26)
784#define __NR_madvise (__NR_Linux + 27)
785#define __NR_shmget (__NR_Linux + 28)
786#define __NR_shmat (__NR_Linux + 29)
787#define __NR_shmctl (__NR_Linux + 30)
788#define __NR_dup (__NR_Linux + 31)
789#define __NR_dup2 (__NR_Linux + 32)
790#define __NR_pause (__NR_Linux + 33)
791#define __NR_nanosleep (__NR_Linux + 34)
792#define __NR_getitimer (__NR_Linux + 35)
793#define __NR_setitimer (__NR_Linux + 36)
794#define __NR_alarm (__NR_Linux + 37)
795#define __NR_getpid (__NR_Linux + 38)
796#define __NR_sendfile (__NR_Linux + 39)
797#define __NR_socket (__NR_Linux + 40)
798#define __NR_connect (__NR_Linux + 41)
799#define __NR_accept (__NR_Linux + 42)
800#define __NR_sendto (__NR_Linux + 43)
801#define __NR_recvfrom (__NR_Linux + 44)
802#define __NR_sendmsg (__NR_Linux + 45)
803#define __NR_recvmsg (__NR_Linux + 46)
804#define __NR_shutdown (__NR_Linux + 47)
805#define __NR_bind (__NR_Linux + 48)
806#define __NR_listen (__NR_Linux + 49)
807#define __NR_getsockname (__NR_Linux + 50)
808#define __NR_getpeername (__NR_Linux + 51)
809#define __NR_socketpair (__NR_Linux + 52)
810#define __NR_setsockopt (__NR_Linux + 53)
811#define __NR_getsockopt (__NR_Linux + 54)
812#define __NR_clone (__NR_Linux + 55)
813#define __NR_fork (__NR_Linux + 56)
814#define __NR_execve (__NR_Linux + 57)
815#define __NR_exit (__NR_Linux + 58)
816#define __NR_wait4 (__NR_Linux + 59)
817#define __NR_kill (__NR_Linux + 60)
818#define __NR_uname (__NR_Linux + 61)
819#define __NR_semget (__NR_Linux + 62)
820#define __NR_semop (__NR_Linux + 63)
821#define __NR_semctl (__NR_Linux + 64)
822#define __NR_shmdt (__NR_Linux + 65)
823#define __NR_msgget (__NR_Linux + 66)
824#define __NR_msgsnd (__NR_Linux + 67)
825#define __NR_msgrcv (__NR_Linux + 68)
826#define __NR_msgctl (__NR_Linux + 69)
827#define __NR_fcntl (__NR_Linux + 70)
828#define __NR_flock (__NR_Linux + 71)
829#define __NR_fsync (__NR_Linux + 72)
830#define __NR_fdatasync (__NR_Linux + 73)
831#define __NR_truncate (__NR_Linux + 74)
832#define __NR_ftruncate (__NR_Linux + 75)
833#define __NR_getdents (__NR_Linux + 76)
834#define __NR_getcwd (__NR_Linux + 77)
835#define __NR_chdir (__NR_Linux + 78)
836#define __NR_fchdir (__NR_Linux + 79)
837#define __NR_rename (__NR_Linux + 80)
838#define __NR_mkdir (__NR_Linux + 81)
839#define __NR_rmdir (__NR_Linux + 82)
840#define __NR_creat (__NR_Linux + 83)
841#define __NR_link (__NR_Linux + 84)
842#define __NR_unlink (__NR_Linux + 85)
843#define __NR_symlink (__NR_Linux + 86)
844#define __NR_readlink (__NR_Linux + 87)
845#define __NR_chmod (__NR_Linux + 88)
846#define __NR_fchmod (__NR_Linux + 89)
847#define __NR_chown (__NR_Linux + 90)
848#define __NR_fchown (__NR_Linux + 91)
849#define __NR_lchown (__NR_Linux + 92)
850#define __NR_umask (__NR_Linux + 93)
851#define __NR_gettimeofday (__NR_Linux + 94)
852#define __NR_getrlimit (__NR_Linux + 95)
853#define __NR_getrusage (__NR_Linux + 96)
854#define __NR_sysinfo (__NR_Linux + 97)
855#define __NR_times (__NR_Linux + 98)
856#define __NR_ptrace (__NR_Linux + 99)
857#define __NR_getuid (__NR_Linux + 100)
858#define __NR_syslog (__NR_Linux + 101)
859#define __NR_getgid (__NR_Linux + 102)
860#define __NR_setuid (__NR_Linux + 103)
861#define __NR_setgid (__NR_Linux + 104)
862#define __NR_geteuid (__NR_Linux + 105)
863#define __NR_getegid (__NR_Linux + 106)
864#define __NR_setpgid (__NR_Linux + 107)
865#define __NR_getppid (__NR_Linux + 108)
866#define __NR_getpgrp (__NR_Linux + 109)
867#define __NR_setsid (__NR_Linux + 110)
868#define __NR_setreuid (__NR_Linux + 111)
869#define __NR_setregid (__NR_Linux + 112)
870#define __NR_getgroups (__NR_Linux + 113)
871#define __NR_setgroups (__NR_Linux + 114)
872#define __NR_setresuid (__NR_Linux + 115)
873#define __NR_getresuid (__NR_Linux + 116)
874#define __NR_setresgid (__NR_Linux + 117)
875#define __NR_getresgid (__NR_Linux + 118)
876#define __NR_getpgid (__NR_Linux + 119)
877#define __NR_setfsuid (__NR_Linux + 120)
878#define __NR_setfsgid (__NR_Linux + 121)
879#define __NR_getsid (__NR_Linux + 122)
880#define __NR_capget (__NR_Linux + 123)
881#define __NR_capset (__NR_Linux + 124)
882#define __NR_rt_sigpending (__NR_Linux + 125)
883#define __NR_rt_sigtimedwait (__NR_Linux + 126)
884#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
885#define __NR_rt_sigsuspend (__NR_Linux + 128)
886#define __NR_sigaltstack (__NR_Linux + 129)
887#define __NR_utime (__NR_Linux + 130)
888#define __NR_mknod (__NR_Linux + 131)
889#define __NR_personality (__NR_Linux + 132)
890#define __NR_ustat (__NR_Linux + 133)
891#define __NR_statfs (__NR_Linux + 134)
892#define __NR_fstatfs (__NR_Linux + 135)
893#define __NR_sysfs (__NR_Linux + 136)
894#define __NR_getpriority (__NR_Linux + 137)
895#define __NR_setpriority (__NR_Linux + 138)
896#define __NR_sched_setparam (__NR_Linux + 139)
897#define __NR_sched_getparam (__NR_Linux + 140)
898#define __NR_sched_setscheduler (__NR_Linux + 141)
899#define __NR_sched_getscheduler (__NR_Linux + 142)
900#define __NR_sched_get_priority_max (__NR_Linux + 143)
901#define __NR_sched_get_priority_min (__NR_Linux + 144)
902#define __NR_sched_rr_get_interval (__NR_Linux + 145)
903#define __NR_mlock (__NR_Linux + 146)
904#define __NR_munlock (__NR_Linux + 147)
905#define __NR_mlockall (__NR_Linux + 148)
906#define __NR_munlockall (__NR_Linux + 149)
907#define __NR_vhangup (__NR_Linux + 150)
908#define __NR_pivot_root (__NR_Linux + 151)
909#define __NR__sysctl (__NR_Linux + 152)
910#define __NR_prctl (__NR_Linux + 153)
911#define __NR_adjtimex (__NR_Linux + 154)
912#define __NR_setrlimit (__NR_Linux + 155)
913#define __NR_chroot (__NR_Linux + 156)
914#define __NR_sync (__NR_Linux + 157)
915#define __NR_acct (__NR_Linux + 158)
916#define __NR_settimeofday (__NR_Linux + 159)
917#define __NR_mount (__NR_Linux + 160)
918#define __NR_umount2 (__NR_Linux + 161)
919#define __NR_swapon (__NR_Linux + 162)
920#define __NR_swapoff (__NR_Linux + 163)
921#define __NR_reboot (__NR_Linux + 164)
922#define __NR_sethostname (__NR_Linux + 165)
923#define __NR_setdomainname (__NR_Linux + 166)
924#define __NR_create_module (__NR_Linux + 167)
925#define __NR_init_module (__NR_Linux + 168)
926#define __NR_delete_module (__NR_Linux + 169)
927#define __NR_get_kernel_syms (__NR_Linux + 170)
928#define __NR_query_module (__NR_Linux + 171)
929#define __NR_quotactl (__NR_Linux + 172)
930#define __NR_nfsservctl (__NR_Linux + 173)
931#define __NR_getpmsg (__NR_Linux + 174)
932#define __NR_putpmsg (__NR_Linux + 175)
933#define __NR_afs_syscall (__NR_Linux + 176)
934#define __NR_reserved177 (__NR_Linux + 177)
935#define __NR_gettid (__NR_Linux + 178)
936#define __NR_readahead (__NR_Linux + 179)
937#define __NR_setxattr (__NR_Linux + 180)
938#define __NR_lsetxattr (__NR_Linux + 181)
939#define __NR_fsetxattr (__NR_Linux + 182)
940#define __NR_getxattr (__NR_Linux + 183)
941#define __NR_lgetxattr (__NR_Linux + 184)
942#define __NR_fgetxattr (__NR_Linux + 185)
943#define __NR_listxattr (__NR_Linux + 186)
944#define __NR_llistxattr (__NR_Linux + 187)
945#define __NR_flistxattr (__NR_Linux + 188)
946#define __NR_removexattr (__NR_Linux + 189)
947#define __NR_lremovexattr (__NR_Linux + 190)
948#define __NR_fremovexattr (__NR_Linux + 191)
949#define __NR_tkill (__NR_Linux + 192)
950#define __NR_reserved193 (__NR_Linux + 193)
951#define __NR_futex (__NR_Linux + 194)
952#define __NR_sched_setaffinity (__NR_Linux + 195)
953#define __NR_sched_getaffinity (__NR_Linux + 196)
954#define __NR_cacheflush (__NR_Linux + 197)
955#define __NR_cachectl (__NR_Linux + 198)
956#define __NR_sysmips (__NR_Linux + 199)
957#define __NR_io_setup (__NR_Linux + 200)
958#define __NR_io_destroy (__NR_Linux + 201)
959#define __NR_io_getevents (__NR_Linux + 202)
960#define __NR_io_submit (__NR_Linux + 203)
961#define __NR_io_cancel (__NR_Linux + 204)
962#define __NR_exit_group (__NR_Linux + 205)
963#define __NR_lookup_dcookie (__NR_Linux + 206)
964#define __NR_epoll_create (__NR_Linux + 207)
965#define __NR_epoll_ctl (__NR_Linux + 208)
966#define __NR_epoll_wait (__NR_Linux + 209)
967#define __NR_remap_file_pages (__NR_Linux + 210)
968#define __NR_rt_sigreturn (__NR_Linux + 211)
969#define __NR_fcntl64 (__NR_Linux + 212)
970#define __NR_set_tid_address (__NR_Linux + 213)
971#define __NR_restart_syscall (__NR_Linux + 214)
972#define __NR_semtimedop (__NR_Linux + 215)
973#define __NR_fadvise64 (__NR_Linux + 216)
974#define __NR_statfs64 (__NR_Linux + 217)
975#define __NR_fstatfs64 (__NR_Linux + 218)
976#define __NR_sendfile64 (__NR_Linux + 219)
977#define __NR_timer_create (__NR_Linux + 220)
978#define __NR_timer_settime (__NR_Linux + 221)
979#define __NR_timer_gettime (__NR_Linux + 222)
980#define __NR_timer_getoverrun (__NR_Linux + 223)
981#define __NR_timer_delete (__NR_Linux + 224)
982#define __NR_clock_settime (__NR_Linux + 225)
983#define __NR_clock_gettime (__NR_Linux + 226)
984#define __NR_clock_getres (__NR_Linux + 227)
985#define __NR_clock_nanosleep (__NR_Linux + 228)
986#define __NR_tgkill (__NR_Linux + 229)
987#define __NR_utimes (__NR_Linux + 230)
988#define __NR_mbind (__NR_Linux + 231)
989#define __NR_get_mempolicy (__NR_Linux + 232)
990#define __NR_set_mempolicy (__NR_Linux + 233)
991#define __NR_mq_open (__NR_Linux + 234)
992#define __NR_mq_unlink (__NR_Linux + 235)
993#define __NR_mq_timedsend (__NR_Linux + 236)
994#define __NR_mq_timedreceive (__NR_Linux + 237)
995#define __NR_mq_notify (__NR_Linux + 238)
996#define __NR_mq_getsetattr (__NR_Linux + 239)
997#define __NR_vserver (__NR_Linux + 240)
998#define __NR_waitid (__NR_Linux + 241)
999/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
1000#define __NR_add_key (__NR_Linux + 243)
1001#define __NR_request_key (__NR_Linux + 244)
1002#define __NR_keyctl (__NR_Linux + 245)
1003#define __NR_set_thread_area (__NR_Linux + 246)
1004#define __NR_inotify_init (__NR_Linux + 247)
1005#define __NR_inotify_add_watch (__NR_Linux + 248)
1006#define __NR_inotify_rm_watch (__NR_Linux + 249)
1007#define __NR_migrate_pages (__NR_Linux + 250)
1008#define __NR_openat (__NR_Linux + 251)
1009#define __NR_mkdirat (__NR_Linux + 252)
1010#define __NR_mknodat (__NR_Linux + 253)
1011#define __NR_fchownat (__NR_Linux + 254)
1012#define __NR_futimesat (__NR_Linux + 255)
1013#define __NR_newfstatat (__NR_Linux + 256)
1014#define __NR_unlinkat (__NR_Linux + 257)
1015#define __NR_renameat (__NR_Linux + 258)
1016#define __NR_linkat (__NR_Linux + 259)
1017#define __NR_symlinkat (__NR_Linux + 260)
1018#define __NR_readlinkat (__NR_Linux + 261)
1019#define __NR_fchmodat (__NR_Linux + 262)
1020#define __NR_faccessat (__NR_Linux + 263)
1021#define __NR_pselect6 (__NR_Linux + 264)
1022#define __NR_ppoll (__NR_Linux + 265)
1023#define __NR_unshare (__NR_Linux + 266)
1024#define __NR_splice (__NR_Linux + 267)
1025#define __NR_sync_file_range (__NR_Linux + 268)
1026#define __NR_tee (__NR_Linux + 269)
1027#define __NR_vmsplice (__NR_Linux + 270)
1028#define __NR_move_pages (__NR_Linux + 271)
1029#define __NR_set_robust_list (__NR_Linux + 272)
1030#define __NR_get_robust_list (__NR_Linux + 273)
1031#define __NR_kexec_load (__NR_Linux + 274)
1032#define __NR_getcpu (__NR_Linux + 275)
1033#define __NR_epoll_pwait (__NR_Linux + 276)
1034#define __NR_ioprio_set (__NR_Linux + 277)
1035#define __NR_ioprio_get (__NR_Linux + 278)
1036#define __NR_utimensat (__NR_Linux + 279)
1037#define __NR_signalfd (__NR_Linux + 280)
1038#define __NR_timerfd (__NR_Linux + 281)
1039#define __NR_eventfd (__NR_Linux + 282)
1040#define __NR_fallocate (__NR_Linux + 283)
1041#define __NR_timerfd_create (__NR_Linux + 284)
1042#define __NR_timerfd_gettime (__NR_Linux + 285)
1043#define __NR_timerfd_settime (__NR_Linux + 286)
1044#define __NR_signalfd4 (__NR_Linux + 287)
1045#define __NR_eventfd2 (__NR_Linux + 288)
1046#define __NR_epoll_create1 (__NR_Linux + 289)
1047#define __NR_dup3 (__NR_Linux + 290)
1048#define __NR_pipe2 (__NR_Linux + 291)
1049#define __NR_inotify_init1 (__NR_Linux + 292)
1050#define __NR_preadv (__NR_Linux + 293)
1051#define __NR_pwritev (__NR_Linux + 294)
1052#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1053#define __NR_perf_event_open (__NR_Linux + 296)
1054#define __NR_accept4 (__NR_Linux + 297)
1055#define __NR_recvmmsg (__NR_Linux + 298)
1056#define __NR_getdents64 (__NR_Linux + 299)
1057#define __NR_fanotify_init (__NR_Linux + 300)
1058#define __NR_fanotify_mark (__NR_Linux + 301)
1059#define __NR_prlimit64 (__NR_Linux + 302)
1060#define __NR_name_to_handle_at (__NR_Linux + 303)
1061#define __NR_open_by_handle_at (__NR_Linux + 304)
1062#define __NR_clock_adjtime (__NR_Linux + 305)
1063#define __NR_syncfs (__NR_Linux + 306)
1064#define __NR_sendmmsg (__NR_Linux + 307)
1065#define __NR_setns (__NR_Linux + 308)
1066#define __NR_process_vm_readv (__NR_Linux + 309)
1067#define __NR_process_vm_writev (__NR_Linux + 310)
1068#define __NR_kcmp (__NR_Linux + 311)
1069#define __NR_finit_module (__NR_Linux + 312)
1070#define __NR_sched_setattr (__NR_Linux + 313)
1071#define __NR_sched_getattr (__NR_Linux + 314)
1072#define __NR_renameat2 (__NR_Linux + 315)
1073#define __NR_seccomp (__NR_Linux + 316)
1074#define __NR_getrandom (__NR_Linux + 317)
1075#define __NR_memfd_create (__NR_Linux + 318)
1076#define __NR_bpf (__NR_Linux + 319)
1077#define __NR_execveat (__NR_Linux + 320)
1078#define __NR_userfaultfd (__NR_Linux + 321)
1079#define __NR_membarrier (__NR_Linux + 322)
1080#define __NR_mlock2 (__NR_Linux + 323)
1081#define __NR_copy_file_range (__NR_Linux + 324)
1082#define __NR_preadv2 (__NR_Linux + 325)
1083#define __NR_pwritev2 (__NR_Linux + 326)
1084#define __NR_pkey_mprotect (__NR_Linux + 327)
1085#define __NR_pkey_alloc (__NR_Linux + 328)
1086#define __NR_pkey_free (__NR_Linux + 329)
1087#define __NR_statx (__NR_Linux + 330)
1088#define __NR_rseq (__NR_Linux + 331)
1089#define __NR_io_pgetevents (__NR_Linux + 332)
1090
1091/*
1092 * Offset of the last N32 flavoured syscall
1093 */
1094#define __NR_Linux_syscalls 332
1095
1096#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1097
1098#define __NR_N32_Linux 6000
1099#define __NR_N32_Linux_syscalls 332
1100
1101#endif /* _ASM_UNISTD_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/auxvec.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 Imagination Technologies
4 * Author: Alex Smith <alex.smith@imgtec.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __ASM_AUXVEC_H
13#define __ASM_AUXVEC_H
14
15/* Location of VDSO image. */
16#define AT_SYSINFO_EHDR 33
17
18#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
19
20#endif /* __ASM_AUXVEC_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/bitsperlong.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_MIPS_BITSPERLONG_H
3#define __ASM_MIPS_BITSPERLONG_H
4
5#define __BITS_PER_LONG _MIPS_SZLONG
6
7#include <asm-generic/bitsperlong.h>
8
9#endif /* __ASM_MIPS_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/byteorder.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_BYTEORDER_H
10#define _ASM_BYTEORDER_H
11
12#if defined(__MIPSEB__)
13#include <linux/byteorder/big_endian.h>
14#elif defined(__MIPSEL__)
15#include <linux/byteorder/little_endian.h>
16#else
17# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
18#endif
19
20#endif /* _ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/errno.h deleted-130
...@@ -1,130 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_ERRNO_H
10#define _ASM_ERRNO_H
11
12/*
13 * These error numbers are intended to be MIPS ABI compatible
14 */
15
16#include <asm-generic/errno-base.h>
17
18#define ENOMSG 35 /* No message of desired type */
19#define EIDRM 36 /* Identifier removed */
20#define ECHRNG 37 /* Channel number out of range */
21#define EL2NSYNC 38 /* Level 2 not synchronized */
22#define EL3HLT 39 /* Level 3 halted */
23#define EL3RST 40 /* Level 3 reset */
24#define ELNRNG 41 /* Link number out of range */
25#define EUNATCH 42 /* Protocol driver not attached */
26#define ENOCSI 43 /* No CSI structure available */
27#define EL2HLT 44 /* Level 2 halted */
28#define EDEADLK 45 /* Resource deadlock would occur */
29#define ENOLCK 46 /* No record locks available */
30#define EBADE 50 /* Invalid exchange */
31#define EBADR 51 /* Invalid request descriptor */
32#define EXFULL 52 /* Exchange full */
33#define ENOANO 53 /* No anode */
34#define EBADRQC 54 /* Invalid request code */
35#define EBADSLT 55 /* Invalid slot */
36#define EDEADLOCK 56 /* File locking deadlock error */
37#define EBFONT 59 /* Bad font file format */
38#define ENOSTR 60 /* Device not a stream */
39#define ENODATA 61 /* No data available */
40#define ETIME 62 /* Timer expired */
41#define ENOSR 63 /* Out of streams resources */
42#define ENONET 64 /* Machine is not on the network */
43#define ENOPKG 65 /* Package not installed */
44#define EREMOTE 66 /* Object is remote */
45#define ENOLINK 67 /* Link has been severed */
46#define EADV 68 /* Advertise error */
47#define ESRMNT 69 /* Srmount error */
48#define ECOMM 70 /* Communication error on send */
49#define EPROTO 71 /* Protocol error */
50#define EDOTDOT 73 /* RFS specific error */
51#define EMULTIHOP 74 /* Multihop attempted */
52#define EBADMSG 77 /* Not a data message */
53#define ENAMETOOLONG 78 /* File name too long */
54#define EOVERFLOW 79 /* Value too large for defined data type */
55#define ENOTUNIQ 80 /* Name not unique on network */
56#define EBADFD 81 /* File descriptor in bad state */
57#define EREMCHG 82 /* Remote address changed */
58#define ELIBACC 83 /* Can not access a needed shared library */
59#define ELIBBAD 84 /* Accessing a corrupted shared library */
60#define ELIBSCN 85 /* .lib section in a.out corrupted */
61#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
62#define ELIBEXEC 87 /* Cannot exec a shared library directly */
63#define EILSEQ 88 /* Illegal byte sequence */
64#define ENOSYS 89 /* Function not implemented */
65#define ELOOP 90 /* Too many symbolic links encountered */
66#define ERESTART 91 /* Interrupted system call should be restarted */
67#define ESTRPIPE 92 /* Streams pipe error */
68#define ENOTEMPTY 93 /* Directory not empty */
69#define EUSERS 94 /* Too many users */
70#define ENOTSOCK 95 /* Socket operation on non-socket */
71#define EDESTADDRREQ 96 /* Destination address required */
72#define EMSGSIZE 97 /* Message too long */
73#define EPROTOTYPE 98 /* Protocol wrong type for socket */
74#define ENOPROTOOPT 99 /* Protocol not available */
75#define EPROTONOSUPPORT 120 /* Protocol not supported */
76#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
77#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
78#define EPFNOSUPPORT 123 /* Protocol family not supported */
79#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
80#define EADDRINUSE 125 /* Address already in use */
81#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
82#define ENETDOWN 127 /* Network is down */
83#define ENETUNREACH 128 /* Network is unreachable */
84#define ENETRESET 129 /* Network dropped connection because of reset */
85#define ECONNABORTED 130 /* Software caused connection abort */
86#define ECONNRESET 131 /* Connection reset by peer */
87#define ENOBUFS 132 /* No buffer space available */
88#define EISCONN 133 /* Transport endpoint is already connected */
89#define ENOTCONN 134 /* Transport endpoint is not connected */
90#define EUCLEAN 135 /* Structure needs cleaning */
91#define ENOTNAM 137 /* Not a XENIX named type file */
92#define ENAVAIL 138 /* No XENIX semaphores available */
93#define EISNAM 139 /* Is a named type file */
94#define EREMOTEIO 140 /* Remote I/O error */
95#define EINIT 141 /* Reserved */
96#define EREMDEV 142 /* Error 142 */
97#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
98#define ETOOMANYREFS 144 /* Too many references: cannot splice */
99#define ETIMEDOUT 145 /* Connection timed out */
100#define ECONNREFUSED 146 /* Connection refused */
101#define EHOSTDOWN 147 /* Host is down */
102#define EHOSTUNREACH 148 /* No route to host */
103#define EWOULDBLOCK EAGAIN /* Operation would block */
104#define EALREADY 149 /* Operation already in progress */
105#define EINPROGRESS 150 /* Operation now in progress */
106#define ESTALE 151 /* Stale file handle */
107#define ECANCELED 158 /* AIO operation canceled */
108
109/*
110 * These error are Linux extensions.
111 */
112#define ENOMEDIUM 159 /* No medium found */
113#define EMEDIUMTYPE 160 /* Wrong medium type */
114#define ENOKEY 161 /* Required key not available */
115#define EKEYEXPIRED 162 /* Key has expired */
116#define EKEYREVOKED 163 /* Key has been revoked */
117#define EKEYREJECTED 164 /* Key was rejected by service */
118
119/* for robust mutexes */
120#define EOWNERDEAD 165 /* Owner died */
121#define ENOTRECOVERABLE 166 /* State not recoverable */
122
123#define ERFKILL 167 /* Operation not possible due to RF-kill */
124
125#define EHWPOISON 168 /* Memory page has hardware error */
126
127#define EDQUOT 1133 /* Quota exceeded */
128
129
130#endif /* _ASM_ERRNO_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/fcntl.h deleted-80
...@@ -1,80 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
8 */
9#ifndef _ASM_FCNTL_H
10#define _ASM_FCNTL_H
11
12#include <asm/sgidefs.h>
13
14#define O_APPEND 0x0008
15#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */
16#define O_NONBLOCK 0x0080
17#define O_CREAT 0x0100 /* not fcntl */
18#define O_TRUNC 0x0200 /* not fcntl */
19#define O_EXCL 0x0400 /* not fcntl */
20#define O_NOCTTY 0x0800 /* not fcntl */
21#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
22#define O_LARGEFILE 0x2000 /* allow large file opens */
23/*
24 * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
25 * the O_SYNC flag. We continue to use the existing numerical value
26 * for O_DSYNC semantics now, but using the correct symbolic name for it.
27 * This new value is used to request true Posix O_SYNC semantics. It is
28 * defined in this strange way to make sure applications compiled against
29 * new headers get at least O_DSYNC semantics on older kernels.
30 *
31 * This has the nice side-effect that we can simply test for O_DSYNC
32 * wherever we do not care if O_DSYNC or O_SYNC is used.
33 *
34 * Note: __O_SYNC must never be used directly.
35 */
36#define __O_SYNC 0x4000
37#define O_SYNC (__O_SYNC|O_DSYNC)
38#define O_DIRECT 0x8000 /* direct disk access hint */
39
40#define F_GETLK 14
41#define F_SETLK 6
42#define F_SETLKW 7
43
44#define F_SETOWN 24 /* for sockets. */
45#define F_GETOWN 23 /* for sockets. */
46
47#ifndef __mips64
48#define F_GETLK64 33 /* using 'struct flock64' */
49#define F_SETLK64 34
50#define F_SETLKW64 35
51#endif
52
53/*
54 * The flavours of struct flock. "struct flock" is the ABI compliant
55 * variant. Finally struct flock64 is the LFS variant of struct flock. As
56 * a historic accident and inconsistence with the ABI definition it doesn't
57 * contain all the same fields as struct flock.
58 */
59
60#if _MIPS_SIM != _MIPS_SIM_ABI64
61
62#include <linux/types.h>
63
64struct flock {
65 short l_type;
66 short l_whence;
67 __kernel_off_t l_start;
68 __kernel_off_t l_len;
69 long l_sysid;
70 __kernel_pid_t l_pid;
71 long pad[4];
72};
73
74#define HAVE_ARCH_STRUCT_FLOCK
75
76#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
77
78#include <asm-generic/fcntl.h>
79
80#endif /* _ASM_FCNTL_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/hwcap.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_HWCAP_H
3#define _ASM_HWCAP_H
4
5/* HWCAP flags */
6#define HWCAP_MIPS_R6 (1 << 0)
7#define HWCAP_MIPS_MSA (1 << 1)
8#define HWCAP_MIPS_CRC32 (1 << 2)
9
10#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/ioctl.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle <ralf@linux-mips.org>
8 * Copyright (C) 2009 Wind River Systems
9 * Written by Ralf Baechle <ralf@linux-mips.org>
10 */
11#ifndef __ASM_IOCTL_H
12#define __ASM_IOCTL_H
13
14#define _IOC_SIZEBITS 13
15#define _IOC_DIRBITS 3
16
17/*
18 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
19 * And this turns out useful to catch old ioctl numbers in header
20 * files for us.
21 */
22#define _IOC_NONE 1U
23#define _IOC_READ 2U
24#define _IOC_WRITE 4U
25
26#include <asm-generic/ioctl.h>
27
28#endif /* __ASM_IOCTL_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/ioctls.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef __ASM_IOCTLS_H
11#define __ASM_IOCTLS_H
12
13#include <asm/ioctl.h>
14
15#define TCGETA 0x5401
16#define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
17#define TCSETAW 0x5403
18#define TCSETAF 0x5404
19
20#define TCSBRK 0x5405
21#define TCXONC 0x5406
22#define TCFLSH 0x5407
23
24#define TCGETS 0x540d
25#define TCSETS 0x540e
26#define TCSETSW 0x540f
27#define TCSETSF 0x5410
28
29#define TIOCEXCL 0x740d /* set exclusive use of tty */
30#define TIOCNXCL 0x740e /* reset exclusive use of tty */
31#define TIOCOUTQ 0x7472 /* output queue size */
32#define TIOCSTI 0x5472 /* simulate terminal input */
33#define TIOCMGET 0x741d /* get all modem bits */
34#define TIOCMBIS 0x741b /* bis modem bits */
35#define TIOCMBIC 0x741c /* bic modem bits */
36#define TIOCMSET 0x741a /* set all modem bits */
37#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
38#define TIOCPKT_DATA 0x00 /* data packet */
39#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
40#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
41#define TIOCPKT_STOP 0x04 /* stop output */
42#define TIOCPKT_START 0x08 /* start output */
43#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
44#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
45#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
46#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
47#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
48#define TIOCNOTTY 0x5471 /* void tty association */
49#define TIOCSETD 0x7401
50#define TIOCGETD 0x7400
51
52#define FIOCLEX 0x6601
53#define FIONCLEX 0x6602
54#define FIOASYNC 0x667d
55#define FIONBIO 0x667e
56#define FIOQSIZE 0x667f
57
58#define TIOCGLTC 0x7474 /* get special local chars */
59#define TIOCSLTC 0x7475 /* set special local chars */
60#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
61#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
62#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
63
64#define FIONREAD 0x467f
65#define TIOCINQ FIONREAD
66
67#define TIOCGETP 0x7408
68#define TIOCSETP 0x7409
69#define TIOCSETN 0x740a /* TIOCSETP wo flush */
70
71/* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */
72/* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */
73/* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */
74/* #define TIOCGETD _IOR('t', 26, int) get line discipline */
75/* #define TIOCSETD _IOW('t', 27, int) set line discipline */
76 /* 127-124 compat */
77
78#define TIOCSBRK 0x5427 /* BSD compatibility */
79#define TIOCCBRK 0x5428 /* BSD compatibility */
80#define TIOCGSID 0x7416 /* Return the session ID of FD */
81#define TCGETS2 _IOR('T', 0x2A, struct termios2)
82#define TCSETS2 _IOW('T', 0x2B, struct termios2)
83#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
84#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
85#define TIOCGRS485 _IOR('T', 0x2E, struct serial_rs485)
86#define TIOCSRS485 _IOWR('T', 0x2F, struct serial_rs485)
87#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
88#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
89#define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
90#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
91#define TIOCVHANGUP 0x5437
92#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
93#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
94#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
95#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
96
97/* I hope the range from 0x5480 on is free ... */
98#define TIOCSCTTY 0x5480 /* become controlling tty */
99#define TIOCGSOFTCAR 0x5481
100#define TIOCSSOFTCAR 0x5482
101#define TIOCLINUX 0x5483
102#define TIOCGSERIAL 0x5484
103#define TIOCSSERIAL 0x5485
104#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
105#define TIOCSERCONFIG 0x5488
106#define TIOCSERGWILD 0x5489
107#define TIOCSERSWILD 0x548a
108#define TIOCGLCKTRMIOS 0x548b
109#define TIOCSLCKTRMIOS 0x548c
110#define TIOCSERGSTRUCT 0x548d /* For debugging only */
111#define TIOCSERGETLSR 0x548e /* Get line status register */
112#define TIOCSERGETMULTI 0x548f /* Get multiport config */
113#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
114#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
115#define TIOCGICOUNT 0x5492 /* read serial port __inline__ interrupt counts */
116
117#endif /* __ASM_IOCTLS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/kvm.h deleted-227
...@@ -1,227 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
8 * Copyright (C) 2013 Cavium, Inc.
9 * Authors: Sanjay Lal <sanjayl@kymasys.com>
10 */
11
12#ifndef __LINUX_KVM_MIPS_H
13#define __LINUX_KVM_MIPS_H
14
15#include <linux/types.h>
16
17/*
18 * KVM MIPS specific structures and definitions.
19 *
20 * Some parts derived from the x86 version of this file.
21 */
22
23#define __KVM_HAVE_READONLY_MEM
24
25#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
26
27/*
28 * for KVM_GET_REGS and KVM_SET_REGS
29 *
30 * If Config[AT] is zero (32-bit CPU), the register contents are
31 * stored in the lower 32-bits of the struct kvm_regs fields and sign
32 * extended to 64-bits.
33 */
34struct kvm_regs {
35 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
36 __u64 gpr[32];
37 __u64 hi;
38 __u64 lo;
39 __u64 pc;
40};
41
42/*
43 * for KVM_GET_FPU and KVM_SET_FPU
44 */
45struct kvm_fpu {
46};
47
48
49/*
50 * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access various
51 * registers. The id field is broken down as follows:
52 *
53 * bits[63..52] - As per linux/kvm.h
54 * bits[51..32] - Must be zero.
55 * bits[31..16] - Register set.
56 *
57 * Register set = 0: GP registers from kvm_regs (see definitions below).
58 *
59 * Register set = 1: CP0 registers.
60 * bits[15..8] - COP0 register set.
61 *
62 * COP0 register set = 0: Main CP0 registers.
63 * bits[7..3] - Register 'rd' index.
64 * bits[2..0] - Register 'sel' index.
65 *
66 * COP0 register set = 1: MAARs.
67 * bits[7..0] - MAAR index.
68 *
69 * Register set = 2: KVM specific registers (see definitions below).
70 *
71 * Register set = 3: FPU / MSA registers (see definitions below).
72 *
73 * Other sets registers may be added in the future. Each set would
74 * have its own identifier in bits[31..16].
75 */
76
77#define KVM_REG_MIPS_GP (KVM_REG_MIPS | 0x0000000000000000ULL)
78#define KVM_REG_MIPS_CP0 (KVM_REG_MIPS | 0x0000000000010000ULL)
79#define KVM_REG_MIPS_KVM (KVM_REG_MIPS | 0x0000000000020000ULL)
80#define KVM_REG_MIPS_FPU (KVM_REG_MIPS | 0x0000000000030000ULL)
81
82
83/*
84 * KVM_REG_MIPS_GP - General purpose registers from kvm_regs.
85 */
86
87#define KVM_REG_MIPS_R0 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 0)
88#define KVM_REG_MIPS_R1 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 1)
89#define KVM_REG_MIPS_R2 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 2)
90#define KVM_REG_MIPS_R3 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 3)
91#define KVM_REG_MIPS_R4 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 4)
92#define KVM_REG_MIPS_R5 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 5)
93#define KVM_REG_MIPS_R6 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 6)
94#define KVM_REG_MIPS_R7 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 7)
95#define KVM_REG_MIPS_R8 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 8)
96#define KVM_REG_MIPS_R9 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 9)
97#define KVM_REG_MIPS_R10 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 10)
98#define KVM_REG_MIPS_R11 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 11)
99#define KVM_REG_MIPS_R12 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 12)
100#define KVM_REG_MIPS_R13 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 13)
101#define KVM_REG_MIPS_R14 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 14)
102#define KVM_REG_MIPS_R15 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 15)
103#define KVM_REG_MIPS_R16 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 16)
104#define KVM_REG_MIPS_R17 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 17)
105#define KVM_REG_MIPS_R18 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 18)
106#define KVM_REG_MIPS_R19 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 19)
107#define KVM_REG_MIPS_R20 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 20)
108#define KVM_REG_MIPS_R21 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 21)
109#define KVM_REG_MIPS_R22 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 22)
110#define KVM_REG_MIPS_R23 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 23)
111#define KVM_REG_MIPS_R24 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 24)
112#define KVM_REG_MIPS_R25 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 25)
113#define KVM_REG_MIPS_R26 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 26)
114#define KVM_REG_MIPS_R27 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 27)
115#define KVM_REG_MIPS_R28 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 28)
116#define KVM_REG_MIPS_R29 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 29)
117#define KVM_REG_MIPS_R30 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 30)
118#define KVM_REG_MIPS_R31 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 31)
119
120#define KVM_REG_MIPS_HI (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 32)
121#define KVM_REG_MIPS_LO (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 33)
122#define KVM_REG_MIPS_PC (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 34)
123
124
125/*
126 * KVM_REG_MIPS_CP0 - Coprocessor 0 registers.
127 */
128
129#define KVM_REG_MIPS_MAAR (KVM_REG_MIPS_CP0 | (1 << 8))
130#define KVM_REG_MIPS_CP0_MAAR(n) (KVM_REG_MIPS_MAAR | \
131 KVM_REG_SIZE_U64 | (n))
132
133
134/*
135 * KVM_REG_MIPS_KVM - KVM specific control registers.
136 */
137
138/*
139 * CP0_Count control
140 * DC: Set 0: Master disable CP0_Count and set COUNT_RESUME to now
141 * Set 1: Master re-enable CP0_Count with unchanged bias, handling timer
142 * interrupts since COUNT_RESUME
143 * This can be used to freeze the timer to get a consistent snapshot of
144 * the CP0_Count and timer interrupt pending state, while also resuming
145 * safely without losing time or guest timer interrupts.
146 * Other: Reserved, do not change.
147 */
148#define KVM_REG_MIPS_COUNT_CTL (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 0)
149#define KVM_REG_MIPS_COUNT_CTL_DC 0x00000001
150
151/*
152 * CP0_Count resume monotonic nanoseconds
153 * The monotonic nanosecond time of the last set of COUNT_CTL.DC (master
154 * disable). Any reads and writes of Count related registers while
155 * COUNT_CTL.DC=1 will appear to occur at this time. When COUNT_CTL.DC is
156 * cleared again (master enable) any timer interrupts since this time will be
157 * emulated.
158 * Modifications to times in the future are rejected.
159 */
160#define KVM_REG_MIPS_COUNT_RESUME (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 1)
161/*
162 * CP0_Count rate in Hz
163 * Specifies the rate of the CP0_Count timer in Hz. Modifications occur without
164 * discontinuities in CP0_Count.
165 */
166#define KVM_REG_MIPS_COUNT_HZ (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 2)
167
168
169/*
170 * KVM_REG_MIPS_FPU - Floating Point and MIPS SIMD Architecture (MSA) registers.
171 *
172 * bits[15..8] - Register subset (see definitions below).
173 * bits[7..5] - Must be zero.
174 * bits[4..0] - Register number within register subset.
175 */
176
177#define KVM_REG_MIPS_FPR (KVM_REG_MIPS_FPU | 0x0000000000000000ULL)
178#define KVM_REG_MIPS_FCR (KVM_REG_MIPS_FPU | 0x0000000000000100ULL)
179#define KVM_REG_MIPS_MSACR (KVM_REG_MIPS_FPU | 0x0000000000000200ULL)
180
181/*
182 * KVM_REG_MIPS_FPR - Floating point / Vector registers.
183 */
184#define KVM_REG_MIPS_FPR_32(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U32 | (n))
185#define KVM_REG_MIPS_FPR_64(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U64 | (n))
186#define KVM_REG_MIPS_VEC_128(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U128 | (n))
187
188/*
189 * KVM_REG_MIPS_FCR - Floating point control registers.
190 */
191#define KVM_REG_MIPS_FCR_IR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 0)
192#define KVM_REG_MIPS_FCR_CSR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 31)
193
194/*
195 * KVM_REG_MIPS_MSACR - MIPS SIMD Architecture (MSA) control registers.
196 */
197#define KVM_REG_MIPS_MSA_IR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 0)
198#define KVM_REG_MIPS_MSA_CSR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 1)
199
200
201/*
202 * KVM MIPS specific structures and definitions
203 *
204 */
205struct kvm_debug_exit_arch {
206 __u64 epc;
207};
208
209/* for KVM_SET_GUEST_DEBUG */
210struct kvm_guest_debug_arch {
211};
212
213/* definition of registers in kvm_run */
214struct kvm_sync_regs {
215};
216
217/* dummy definition */
218struct kvm_sregs {
219};
220
221struct kvm_mips_interrupt {
222 /* in */
223 __u32 cpu;
224 __u32 irq;
225};
226
227#endif /* __LINUX_KVM_MIPS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/kvm_para.h deleted-5
...@@ -1,5 +0,0 @@
1#ifndef _ASM_MIPS_KVM_PARA_H
2#define _ASM_MIPS_KVM_PARA_H
3
4
5#endif /* _ASM_MIPS_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/mman.h deleted-108
...@@ -1,108 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_MMAN_H
10#define _ASM_MMAN_H
11
12/*
13 * Protections are chosen from these bits, OR'd together. The
14 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
15 * without PROT_READ. The only guarantees are that no writing will be
16 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
17 */
18#define PROT_NONE 0x00 /* page can not be accessed */
19#define PROT_READ 0x01 /* page can be read */
20#define PROT_WRITE 0x02 /* page can be written */
21#define PROT_EXEC 0x04 /* page can be executed */
22/* 0x08 reserved for PROT_EXEC_NOFLUSH */
23#define PROT_SEM 0x10 /* page may be used for atomic ops */
24#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
25#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
26
27/*
28 * Flags for mmap
29 */
30#define MAP_SHARED 0x001 /* Share changes */
31#define MAP_PRIVATE 0x002 /* Changes are private */
32#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
33#define MAP_TYPE 0x00f /* Mask for type of mapping */
34#define MAP_FIXED 0x010 /* Interpret addr exactly */
35
36/* not used by linux, but here to make sure we don't clash with ABI defines */
37#define MAP_RENAME 0x020 /* Assign page to file */
38#define MAP_AUTOGROW 0x040 /* File may grow by writing */
39#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
40#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
41
42/* These are linux-specific */
43#define MAP_NORESERVE 0x0400 /* don't check for reservations */
44#define MAP_ANONYMOUS 0x0800 /* don't use a file */
45#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
46#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
47#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
48#define MAP_LOCKED 0x8000 /* pages are locked */
49#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
50#define MAP_NONBLOCK 0x20000 /* do not block on IO */
51#define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */
52#define MAP_HUGETLB 0x80000 /* create a huge page mapping */
53#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
54
55/*
56 * Flags for msync
57 */
58#define MS_ASYNC 0x0001 /* sync memory asynchronously */
59#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
60#define MS_SYNC 0x0004 /* synchronous memory sync */
61
62/*
63 * Flags for mlockall
64 */
65#define MCL_CURRENT 1 /* lock all current mappings */
66#define MCL_FUTURE 2 /* lock all future mappings */
67#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
68
69/*
70 * Flags for mlock
71 */
72#define MLOCK_ONFAULT 0x01 /* Lock pages in range after they are faulted in, do not prefault */
73
74#define MADV_NORMAL 0 /* no further special treatment */
75#define MADV_RANDOM 1 /* expect random page references */
76#define MADV_SEQUENTIAL 2 /* expect sequential page references */
77#define MADV_WILLNEED 3 /* will need these pages */
78#define MADV_DONTNEED 4 /* don't need these pages */
79
80/* common parameters: try to keep these consistent across architectures */
81#define MADV_FREE 8 /* free pages only if memory pressure */
82#define MADV_REMOVE 9 /* remove these pages & resources */
83#define MADV_DONTFORK 10 /* don't inherit across fork */
84#define MADV_DOFORK 11 /* do inherit across fork */
85
86#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
87#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
88#define MADV_HWPOISON 100 /* poison a page for testing */
89
90#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
91#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
92
93#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
94 overrides the coredump filter bits */
95#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
96
97#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
98#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
99
100/* compatibility flags */
101#define MAP_FILE 0
102
103#define PKEY_DISABLE_ACCESS 0x1
104#define PKEY_DISABLE_WRITE 0x2
105#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
106 PKEY_DISABLE_WRITE)
107
108#endif /* _ASM_MMAN_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/msgbuf.h deleted-67
...@@ -1,67 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_MSGBUF_H
3#define _ASM_MSGBUF_H
4
5
6/*
7 * The msqid64_ds structure for the MIPS architecture.
8 * Note extra padding because this structure is passed back and forth
9 * between kernel and user space.
10 *
11 * Pad space is left for:
12 * - 2 miscellaneous unsigned long values
13 */
14
15#if defined(__mips64)
16struct msqid64_ds {
17 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long msg_cbytes; /* current number of bytes on queue */
22 unsigned long msg_qnum; /* number of messages in queue */
23 unsigned long msg_qbytes; /* max number of bytes on queue */
24 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25 __kernel_pid_t msg_lrpid; /* last receive pid */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29#elif defined (__MIPSEB__)
30struct msqid64_ds {
31 struct ipc64_perm msg_perm;
32 unsigned long msg_stime_high;
33 unsigned long msg_stime; /* last msgsnd time */
34 unsigned long msg_rtime_high;
35 unsigned long msg_rtime; /* last msgrcv time */
36 unsigned long msg_ctime_high;
37 unsigned long msg_ctime; /* last change time */
38 unsigned long msg_cbytes; /* current number of bytes on queue */
39 unsigned long msg_qnum; /* number of messages in queue */
40 unsigned long msg_qbytes; /* max number of bytes on queue */
41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
42 __kernel_pid_t msg_lrpid; /* last receive pid */
43 unsigned long __unused4;
44 unsigned long __unused5;
45};
46#elif defined (__MIPSEL__)
47struct msqid64_ds {
48 struct ipc64_perm msg_perm;
49 unsigned long msg_stime; /* last msgsnd time */
50 unsigned long msg_stime_high;
51 unsigned long msg_rtime; /* last msgrcv time */
52 unsigned long msg_rtime_high;
53 unsigned long msg_ctime; /* last change time */
54 unsigned long msg_ctime_high;
55 unsigned long msg_cbytes; /* current number of bytes on queue */
56 unsigned long msg_qnum; /* number of messages in queue */
57 unsigned long msg_qbytes; /* max number of bytes on queue */
58 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
59 __kernel_pid_t msg_lrpid; /* last receive pid */
60 unsigned long __unused4;
61 unsigned long __unused5;
62};
63#else
64#warning no endianess set
65#endif
66
67#endif /* _ASM_MSGBUF_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/param.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org)
8 * Copyright 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PARAM_H
11#define _ASM_PARAM_H
12
13#define EXEC_PAGESIZE 65536
14
15#include <asm-generic/param.h>
16
17#endif /* _ASM_PARAM_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/poll.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POLL_H
3#define __ASM_POLL_H
4
5#define POLLWRNORM POLLOUT
6#define POLLWRBAND 0x0100
7
8#include <asm-generic/poll.h>
9
10#endif /* __ASM_POLL_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/posix_types.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_POSIX_TYPES_H
11#define _ASM_POSIX_TYPES_H
12
13#include <asm/sgidefs.h>
14
15/*
16 * This file is generally used by user-level software, so you need to
17 * be a little careful about namespace pollution etc. Also, we cannot
18 * assume GCC is being used.
19 */
20
21typedef long __kernel_daddr_t;
22#define __kernel_daddr_t __kernel_daddr_t
23
24#if (_MIPS_SZLONG == 32)
25typedef struct {
26 long val[2];
27} __kernel_fsid_t;
28#define __kernel_fsid_t __kernel_fsid_t
29#endif
30
31#include <asm-generic/posix_types.h>
32
33#endif /* _ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/ptrace.h deleted-105
...@@ -1,105 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PTRACE_H
11#define _ASM_PTRACE_H
12
13#include <linux/types.h>
14
15/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
16#define FPR_BASE 32
17#define PC 64
18#define CAUSE 65
19#define BADVADDR 66
20#define MMHI 67
21#define MMLO 68
22#define FPC_CSR 69
23#define FPC_EIR 70
24#define DSP_BASE 71 /* 3 more hi / lo register pairs */
25#define DSP_CONTROL 77
26#define ACX 78
27
28/*
29 * This struct defines the registers as used by PTRACE_{GET,SET}REGS. The
30 * format is the same for both 32- and 64-bit processes. Registers for 32-bit
31 * processes are sign extended.
32 */
33struct pt_regs {
34 /* Saved main processor registers. */
35 __u64 regs[32];
36
37 /* Saved special registers. */
38 __u64 lo;
39 __u64 hi;
40 __u64 cp0_epc;
41 __u64 cp0_badvaddr;
42 __u64 cp0_status;
43 __u64 cp0_cause;
44} __attribute__ ((aligned (8)));
45
46/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
47#define PTRACE_GETREGS 12
48#define PTRACE_SETREGS 13
49#define PTRACE_GETFPREGS 14
50#define PTRACE_SETFPREGS 15
51/* #define PTRACE_GETFPXREGS 18 */
52/* #define PTRACE_SETFPXREGS 19 */
53
54#define PTRACE_OLDSETOPTIONS 21
55
56#define PTRACE_GET_THREAD_AREA 25
57#define PTRACE_SET_THREAD_AREA 26
58
59/* Calls to trace a 64bit program from a 32bit program. */
60#define PTRACE_PEEKTEXT_3264 0xc0
61#define PTRACE_PEEKDATA_3264 0xc1
62#define PTRACE_POKETEXT_3264 0xc2
63#define PTRACE_POKEDATA_3264 0xc3
64#define PTRACE_GET_THREAD_AREA_3264 0xc4
65
66/* Read and write watchpoint registers. */
67enum pt_watch_style {
68 pt_watch_style_mips32,
69 pt_watch_style_mips64
70};
71struct mips32_watch_regs {
72 unsigned int watchlo[8];
73 /* Lower 16 bits of watchhi. */
74 unsigned short watchhi[8];
75 /* Valid mask and I R W bits.
76 * bit 0 -- 1 if W bit is usable.
77 * bit 1 -- 1 if R bit is usable.
78 * bit 2 -- 1 if I bit is usable.
79 * bits 3 - 11 -- Valid watchhi mask bits.
80 */
81 unsigned short watch_masks[8];
82 /* The number of valid watch register pairs. */
83 unsigned int num_valid;
84} __attribute__((aligned(8)));
85
86struct mips64_watch_regs {
87 unsigned long long watchlo[8];
88 unsigned short watchhi[8];
89 unsigned short watch_masks[8];
90 unsigned int num_valid;
91} __attribute__((aligned(8)));
92
93struct pt_watch_regs {
94 enum pt_watch_style style;
95 union {
96 struct mips32_watch_regs mips32;
97 struct mips64_watch_regs mips64;
98 };
99};
100
101#define PTRACE_GET_WATCH_REGS 0xd0
102#define PTRACE_SET_WATCH_REGS 0xd1
103
104
105#endif /* _ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/resource.h deleted-36
...@@ -1,36 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_RESOURCE_H
11#define _ASM_RESOURCE_H
12
13
14/*
15 * These five resource limit IDs have a MIPS/Linux-specific ordering,
16 * the rest comes from the generic header:
17 */
18#define RLIMIT_NOFILE 5 /* max number of open files */
19#define RLIMIT_AS 6 /* address space limit */
20#define RLIMIT_RSS 7 /* max resident set size */
21#define RLIMIT_NPROC 8 /* max number of processes */
22#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
23
24/*
25 * SuS says limits have to be unsigned.
26 * Which makes a ton more sense anyway,
27 * but we keep the old value on MIPS32,
28 * for compatibility:
29 */
30#ifndef __mips64
31# define RLIM_INFINITY 0x7fffffffUL
32#endif
33
34#include <asm-generic/resource.h>
35
36#endif /* _ASM_RESOURCE_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/sembuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SEMBUF_H
3#define _ASM_SEMBUF_H
4
5/*
6 * The semid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for 2 miscellaneous 64-bit values on mips64,
11 * but used for the upper 32 bit of the time values on mips32.
12 */
13
14#ifdef __mips64
15struct semid64_ds {
16 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
17 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long sem_nsems; /* no. of semaphores in array */
20 unsigned long __unused1;
21 unsigned long __unused2;
22};
23#else
24struct semid64_ds {
25 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
26 unsigned long sem_otime; /* last semop time */
27 unsigned long sem_ctime; /* last change time */
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long sem_otime_high;
30 unsigned long sem_ctime_high;
31};
32#endif
33
34#endif /* _ASM_SEMBUF_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/setup.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _MIPS_SETUP_H
3#define _MIPS_SETUP_H
4
5#define COMMAND_LINE_SIZE 4096
6
7
8#endif /* _MIPS_SETUP_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/shmbuf.h deleted-58
...@@ -1,58 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SHMBUF_H
3#define _ASM_SHMBUF_H
4
5/*
6 * The shmid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * As MIPS was lacking proper padding after shm_?time, we use 48 bits
11 * of the padding at the end to store a few additional bits of the time.
12 * libc implementations need to take care to convert this into a proper
13 * data structure when moving to 64-bit time_t.
14 */
15
16#ifdef __mips64
17struct shmid64_ds {
18 struct ipc64_perm shm_perm; /* operation perms */
19 size_t shm_segsz; /* size of segment (bytes) */
20 __kernel_time_t shm_atime; /* last attach time */
21 __kernel_time_t shm_dtime; /* last detach time */
22 __kernel_time_t shm_ctime; /* last change time */
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused1;
27 unsigned long __unused2;
28};
29#else
30struct shmid64_ds {
31 struct ipc64_perm shm_perm; /* operation perms */
32 size_t shm_segsz; /* size of segment (bytes) */
33 unsigned long shm_atime; /* last attach time */
34 unsigned long shm_dtime; /* last detach time */
35 unsigned long shm_ctime; /* last change time */
36 __kernel_pid_t shm_cpid; /* pid of creator */
37 __kernel_pid_t shm_lpid; /* pid of last operator */
38 unsigned long shm_nattch; /* no. of current attaches */
39 unsigned short shm_atime_high;
40 unsigned short shm_dtime_high;
41 unsigned short shm_ctime_high;
42 unsigned short __unused1;
43};
44#endif
45
46struct shminfo64 {
47 unsigned long shmmax;
48 unsigned long shmmin;
49 unsigned long shmmni;
50 unsigned long shmseg;
51 unsigned long shmall;
52 unsigned long __unused1;
53 unsigned long __unused2;
54 unsigned long __unused3;
55 unsigned long __unused4;
56};
57
58#endif /* _ASM_SHMBUF_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/sigcontext.h deleted-91
...@@ -1,91 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGCONTEXT_H
11#define _ASM_SIGCONTEXT_H
12
13#include <linux/types.h>
14#include <asm/sgidefs.h>
15
16/* scalar FP context was used */
17#define USED_FP (1 << 0)
18
19/* the value of Status.FR when context was saved */
20#define USED_FR1 (1 << 1)
21
22/* FR=1, but with odd singles in bits 63:32 of preceding even double */
23#define USED_HYBRID_FPRS (1 << 2)
24
25/* extended context was used, see struct extcontext for details */
26#define USED_EXTCONTEXT (1 << 3)
27
28#if _MIPS_SIM == _MIPS_SIM_ABI32
29
30/*
31 * Keep this struct definition in sync with the sigcontext fragment
32 * in arch/mips/kernel/asm-offsets.c
33 */
34struct sigcontext {
35 unsigned int sc_regmask; /* Unused */
36 unsigned int sc_status; /* Unused */
37 unsigned long long sc_pc;
38 unsigned long long sc_regs[32];
39 unsigned long long sc_fpregs[32];
40 unsigned int sc_acx; /* Was sc_ownedfp */
41 unsigned int sc_fpc_csr;
42 unsigned int sc_fpc_eir; /* Unused */
43 unsigned int sc_used_math;
44 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
45 unsigned long long sc_mdhi;
46 unsigned long long sc_mdlo;
47 unsigned long sc_hi1; /* Was sc_cause */
48 unsigned long sc_lo1; /* Was sc_badvaddr */
49 unsigned long sc_hi2; /* Was sc_sigset[4] */
50 unsigned long sc_lo2;
51 unsigned long sc_hi3;
52 unsigned long sc_lo3;
53};
54
55#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
56
57#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
58
59#include <linux/posix_types.h>
60/*
61 * Keep this struct definition in sync with the sigcontext fragment
62 * in arch/mips/kernel/asm-offsets.c
63 *
64 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
65 * int so it was changed to unsigned long in 2.6.0-test1. This may break
66 * binary compatibility - no prisoners.
67 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
68 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
69 */
70struct sigcontext {
71 __u64 sc_regs[32];
72 __u64 sc_fpregs[32];
73 __u64 sc_mdhi;
74 __u64 sc_hi1;
75 __u64 sc_hi2;
76 __u64 sc_hi3;
77 __u64 sc_mdlo;
78 __u64 sc_lo1;
79 __u64 sc_lo2;
80 __u64 sc_lo3;
81 __u64 sc_pc;
82 __u32 sc_fpc_csr;
83 __u32 sc_used_math;
84 __u32 sc_dsp;
85 __u32 sc_reserved;
86};
87
88
89#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
90
91#endif /* _ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/siginfo.h deleted-43
...@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGINFO_H
11#define _ASM_SIGINFO_H
12
13
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
16
17/*
18 * Careful to keep union _sifields from shifting ...
19 */
20#if _MIPS_SZLONG == 32
21#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
22#elif _MIPS_SZLONG == 64
23#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
24#else
25#error _MIPS_SZLONG neither 32 nor 64
26#endif
27
28#define __ARCH_HAS_SWAPPED_SIGINFO
29
30#include <asm-generic/siginfo.h>
31
32/*
33 * si_code values
34 * Again these have been chosen to be IRIX compatible.
35 */
36#undef SI_ASYNCIO
37#undef SI_TIMER
38#undef SI_MESGQ
39#define SI_ASYNCIO -2 /* sent by AIO completion */
40#define SI_TIMER -3 /* sent by timer expiration */
41#define SI_MESGQ -4 /* sent by real time mesq state change */
42
43#endif /* _ASM_SIGINFO_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/signal.h deleted-118
...@@ -1,118 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGNAL_H
11#define _ASM_SIGNAL_H
12
13#include <linux/types.h>
14
15#define _NSIG 128
16#define _NSIG_BPW (sizeof(unsigned long) * 8)
17#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23typedef unsigned long old_sigset_t; /* at least 32 bits */
24
25#define SIGHUP 1 /* Hangup (POSIX). */
26#define SIGINT 2 /* Interrupt (ANSI). */
27#define SIGQUIT 3 /* Quit (POSIX). */
28#define SIGILL 4 /* Illegal instruction (ANSI). */
29#define SIGTRAP 5 /* Trace trap (POSIX). */
30#define SIGIOT 6 /* IOT trap (4.2 BSD). */
31#define SIGABRT SIGIOT /* Abort (ANSI). */
32#define SIGEMT 7
33#define SIGFPE 8 /* Floating-point exception (ANSI). */
34#define SIGKILL 9 /* Kill, unblockable (POSIX). */
35#define SIGBUS 10 /* BUS error (4.2 BSD). */
36#define SIGSEGV 11 /* Segmentation violation (ANSI). */
37#define SIGSYS 12
38#define SIGPIPE 13 /* Broken pipe (POSIX). */
39#define SIGALRM 14 /* Alarm clock (POSIX). */
40#define SIGTERM 15 /* Termination (ANSI). */
41#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
42#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
43#define SIGCHLD 18 /* Child status has changed (POSIX). */
44#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
45#define SIGPWR 19 /* Power failure restart (System V). */
46#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
47#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
48#define SIGIO 22 /* I/O now possible (4.2 BSD). */
49#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
50#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
51#define SIGTSTP 24 /* Keyboard stop (POSIX). */
52#define SIGCONT 25 /* Continue (POSIX). */
53#define SIGTTIN 26 /* Background read from tty (POSIX). */
54#define SIGTTOU 27 /* Background write to tty (POSIX). */
55#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
56#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
57#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
58#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
59
60/* These should not be considered constants from userland. */
61#define SIGRTMIN 32
62#define SIGRTMAX _NSIG
63
64/*
65 * SA_FLAGS values:
66 *
67 * SA_ONSTACK indicates that a registered stack_t will be used.
68 * SA_RESTART flag to get restarting signals (which were the default long ago)
69 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
70 * SA_RESETHAND clears the handler when the signal is delivered.
71 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
72 * SA_NODEFER prevents the current signal from being masked in the handler.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 *
77 * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
78 * supported its use and no libc was using it, so the entire sa-restorer
79 * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
80 * retaining only the SA_RESTORER definition as a reminder to avoid
81 * accidental reuse of the mask bit.
82 */
83#define SA_ONSTACK 0x08000000
84#define SA_RESETHAND 0x80000000
85#define SA_RESTART 0x10000000
86#define SA_SIGINFO 0x00000008
87#define SA_NODEFER 0x40000000
88#define SA_NOCLDWAIT 0x00010000
89#define SA_NOCLDSTOP 0x00000001
90
91#define SA_NOMASK SA_NODEFER
92#define SA_ONESHOT SA_RESETHAND
93
94#define MINSIGSTKSZ 2048
95#define SIGSTKSZ 8192
96
97
98#define SIG_BLOCK 1 /* for blocking signals */
99#define SIG_UNBLOCK 2 /* for unblocking signals */
100#define SIG_SETMASK 3 /* for setting the signal mask */
101
102#include <asm-generic/signal-defs.h>
103
104struct sigaction {
105 unsigned int sa_flags;
106 __sighandler_t sa_handler;
107 sigset_t sa_mask;
108};
109
110/* IRIX compatible stack_t */
111typedef struct sigaltstack {
112 void *ss_sp;
113 size_t ss_size;
114 int ss_flags;
115} stack_t;
116
117
118#endif /* _ASM_SIGNAL_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/socket.h deleted-129
...@@ -1,129 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SOCKET_H
11#define _ASM_SOCKET_H
12
13#include <asm/sockios.h>
14
15/*
16 * For setsockopt(2)
17 *
18 * This defines are ABI conformant as far as Linux supports these ...
19 */
20#define SOL_SOCKET 0xffff
21
22#define SO_DEBUG 0x0001 /* Record debugging information. */
23#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
24#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
25 SIGPIPE when they die. */
26#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
27#define SO_BROADCAST 0x0020 /* Allow transmission of
28 broadcast messages. */
29#define SO_LINGER 0x0080 /* Block on close of a reliable
30 socket to transmit pending data. */
31#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
32#define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33
34#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
35#define SO_STYLE SO_TYPE /* Synonym */
36#define SO_ERROR 0x1007 /* get error status and clear */
37#define SO_SNDBUF 0x1001 /* Send buffer size. */
38#define SO_RCVBUF 0x1002 /* Receive buffer. */
39#define SO_SNDLOWAT 0x1003 /* send low-water mark */
40#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
41#define SO_SNDTIMEO 0x1005 /* send timeout */
42#define SO_RCVTIMEO 0x1006 /* receive timeout */
43#define SO_ACCEPTCONN 0x1009
44#define SO_PROTOCOL 0x1028 /* protocol type */
45#define SO_DOMAIN 0x1029 /* domain/socket family */
46
47/* linux-specific, might as well be the same as on i386 */
48#define SO_NO_CHECK 11
49#define SO_PRIORITY 12
50#define SO_BSDCOMPAT 14
51
52#define SO_PASSCRED 17
53#define SO_PEERCRED 18
54
55/* Security levels - as per NRL IPv6 - don't actually do anything */
56#define SO_SECURITY_AUTHENTICATION 22
57#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
58#define SO_SECURITY_ENCRYPTION_NETWORK 24
59
60#define SO_BINDTODEVICE 25
61
62/* Socket filtering */
63#define SO_ATTACH_FILTER 26
64#define SO_DETACH_FILTER 27
65#define SO_GET_FILTER SO_ATTACH_FILTER
66
67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70
71#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77
78#define SO_MARK 36
79
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40
84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87#define SO_PEEK_OFF 42
88
89/* Instruct lower device to use last 4-bytes of skb data as FCS */
90#define SO_NOFCS 43
91
92#define SO_LOCK_FILTER 44
93
94#define SO_SELECT_ERR_QUEUE 45
95
96#define SO_BUSY_POLL 46
97
98#define SO_MAX_PACING_RATE 47
99
100#define SO_BPF_EXTENSIONS 48
101
102#define SO_INCOMING_CPU 49
103
104#define SO_ATTACH_BPF 50
105#define SO_DETACH_BPF SO_DETACH_FILTER
106
107#define SO_ATTACH_REUSEPORT_CBPF 51
108#define SO_ATTACH_REUSEPORT_EBPF 52
109
110#define SO_CNX_ADVICE 53
111
112#define SCM_TIMESTAMPING_OPT_STATS 54
113
114#define SO_MEMINFO 55
115
116#define SO_INCOMING_NAPI_ID 56
117
118#define SO_COOKIE 57
119
120#define SCM_TIMESTAMPING_PKTINFO 58
121
122#define SO_PEERGROUPS 59
123
124#define SO_ZEROCOPY 60
125
126#define SO_TXTIME 61
127#define SCM_TXTIME SO_TXTIME
128
129#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/sockios.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Socket-level I/O control calls.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995 by Ralf Baechle
10 */
11#ifndef _ASM_SOCKIOS_H
12#define _ASM_SOCKIOS_H
13
14#include <asm/ioctl.h>
15
16/* Socket-level I/O control calls. */
17#define FIOGETOWN _IOR('f', 123, int)
18#define FIOSETOWN _IOW('f', 124, int)
19
20#define SIOCATMARK _IOR('s', 7, int)
21#define SIOCSPGRP _IOW('s', 8, pid_t)
22#define SIOCGPGRP _IOR('s', 9, pid_t)
23
24#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
25#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
26
27#endif /* _ASM_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/stat.h deleted-133
...@@ -1,133 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2000 Ralf Baechle
8 * Copyright (C) 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_STAT_H
11#define _ASM_STAT_H
12
13#include <linux/types.h>
14
15#include <asm/sgidefs.h>
16
17#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
18
19struct stat {
20 unsigned st_dev;
21 long st_pad1[3]; /* Reserved for network id */
22 ino_t st_ino;
23 mode_t st_mode;
24 __u32 st_nlink;
25 uid_t st_uid;
26 gid_t st_gid;
27 unsigned st_rdev;
28 long st_pad2[2];
29 off_t st_size;
30 long st_pad3;
31 /*
32 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
33 * but we don't have it under Linux.
34 */
35 time_t st_atime;
36 long st_atime_nsec;
37 time_t st_mtime;
38 long st_mtime_nsec;
39 time_t st_ctime;
40 long st_ctime_nsec;
41 long st_blksize;
42 long st_blocks;
43 long st_pad4[14];
44};
45
46/*
47 * This matches struct stat64 in glibc2.1, hence the absolutely insane
48 * amounts of padding around dev_t's. The memory layout is the same as of
49 * struct stat of the 64-bit kernel.
50 */
51
52struct stat64 {
53 unsigned long st_dev;
54 unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
55
56 unsigned long long st_ino;
57
58 mode_t st_mode;
59 __u32 st_nlink;
60
61 uid_t st_uid;
62 gid_t st_gid;
63
64 unsigned long st_rdev;
65 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
66
67 long long st_size;
68
69 /*
70 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
71 * but we don't have it under Linux.
72 */
73 time_t st_atime;
74 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
75
76 time_t st_mtime;
77 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
78
79 time_t st_ctime;
80 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
81
82 unsigned long st_blksize;
83 unsigned long st_pad2;
84
85 long long st_blocks;
86};
87
88#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
89
90#if _MIPS_SIM == _MIPS_SIM_ABI64
91
92/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
93struct stat {
94 unsigned int st_dev;
95 unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
96
97 unsigned long st_ino;
98
99 mode_t st_mode;
100 __u32 st_nlink;
101
102 uid_t st_uid;
103 gid_t st_gid;
104
105 unsigned int st_rdev;
106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
107
108 off_t st_size;
109
110 /*
111 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
112 * but we don't have it under Linux.
113 */
114 unsigned int st_atime;
115 unsigned int st_atime_nsec;
116
117 unsigned int st_mtime;
118 unsigned int st_mtime_nsec;
119
120 unsigned int st_ctime;
121 unsigned int st_ctime_nsec;
122
123 unsigned int st_blksize;
124 unsigned int st_pad2;
125
126 unsigned long st_blocks;
127};
128
129#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
130
131#define STAT_HAVE_NSEC 1
132
133#endif /* _ASM_STAT_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/statfs.h deleted-101
...@@ -1,101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999 by Ralf Baechle
8 */
9#ifndef _ASM_STATFS_H
10#define _ASM_STATFS_H
11
12#include <linux/posix_types.h>
13#include <asm/sgidefs.h>
14
15#ifndef __KERNEL_STRICT_NAMES
16
17#include <linux/types.h>
18
19typedef __kernel_fsid_t fsid_t;
20
21#endif
22
23struct statfs {
24 long f_type;
25#define f_fstyp f_type
26 long f_bsize;
27 long f_frsize; /* Fragment size - unsupported */
28 long f_blocks;
29 long f_bfree;
30 long f_files;
31 long f_ffree;
32 long f_bavail;
33
34 /* Linux specials */
35 __kernel_fsid_t f_fsid;
36 long f_namelen;
37 long f_flags;
38 long f_spare[5];
39};
40
41#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
42
43/*
44 * Unlike the traditional version the LFAPI version has none of the ABI junk
45 */
46struct statfs64 {
47 __u32 f_type;
48 __u32 f_bsize;
49 __u32 f_frsize; /* Fragment size - unsupported */
50 __u32 __pad;
51 __u64 f_blocks;
52 __u64 f_bfree;
53 __u64 f_files;
54 __u64 f_ffree;
55 __u64 f_bavail;
56 __kernel_fsid_t f_fsid;
57 __u32 f_namelen;
58 __u32 f_flags;
59 __u32 f_spare[5];
60};
61
62#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
63
64#if _MIPS_SIM == _MIPS_SIM_ABI64
65
66struct statfs64 { /* Same as struct statfs */
67 long f_type;
68 long f_bsize;
69 long f_frsize; /* Fragment size - unsupported */
70 long f_blocks;
71 long f_bfree;
72 long f_files;
73 long f_ffree;
74 long f_bavail;
75
76 /* Linux specials */
77 __kernel_fsid_t f_fsid;
78 long f_namelen;
79 long f_flags;
80 long f_spare[5];
81};
82
83struct compat_statfs64 {
84 __u32 f_type;
85 __u32 f_bsize;
86 __u32 f_frsize; /* Fragment size - unsupported */
87 __u32 __pad;
88 __u64 f_blocks;
89 __u64 f_bfree;
90 __u64 f_files;
91 __u64 f_ffree;
92 __u64 f_bavail;
93 __kernel_fsid_t f_fsid;
94 __u32 f_namelen;
95 __u32 f_flags;
96 __u32 f_spare[5];
97};
98
99#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
100
101#endif /* _ASM_STATFS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/swab.h deleted-71
...@@ -1,71 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_SWAB_H
10#define _ASM_SWAB_H
11
12
13#include <linux/types.h>
14
15#define __SWAB_64_THRU_32__
16
17#if !defined(__mips16) && \
18 ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
19 defined(_MIPS_ARCH_LOONGSON3A))
20
21static __inline__ __u16 __arch_swab16(__u16 x)
22{
23 __asm__(
24 " .set push \n"
25 " .set arch=mips32r2 \n"
26 " wsbh %0, %1 \n"
27 " .set pop \n"
28 : "=r" (x)
29 : "r" (x));
30
31 return x;
32}
33#define __arch_swab16 __arch_swab16
34
35static __inline__ __u32 __arch_swab32(__u32 x)
36{
37 __asm__(
38 " .set push \n"
39 " .set arch=mips32r2 \n"
40 " wsbh %0, %1 \n"
41 " rotr %0, %0, 16 \n"
42 " .set pop \n"
43 : "=r" (x)
44 : "r" (x));
45
46 return x;
47}
48#define __arch_swab32 __arch_swab32
49
50/*
51 * Having already checked for MIPS R2, enable the optimized version for
52 * 64-bit kernel on r2 CPUs.
53 */
54#ifdef __mips64
55static __inline__ __u64 __arch_swab64(__u64 x)
56{
57 __asm__(
58 " .set push \n"
59 " .set arch=mips64r2 \n"
60 " dsbh %0, %1 \n"
61 " dshd %0, %0 \n"
62 " .set pop \n"
63 : "=r" (x)
64 : "r" (x));
65
66 return x;
67}
68#define __arch_swab64 __arch_swab64
69#endif /* __mips64 */
70#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */
71#endif /* _ASM_SWAB_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/termbits.h deleted-228
...@@ -1,228 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
11#ifndef _ASM_TERMBITS_H
12#define _ASM_TERMBITS_H
13
14#include <linux/posix_types.h>
15
16typedef unsigned char cc_t;
17typedef unsigned int speed_t;
18typedef unsigned int tcflag_t;
19
20/*
21 * The ABI says nothing about NCC but seems to use NCCS as
22 * replacement for it in struct termio
23 */
24#define NCCS 23
25struct termios {
26 tcflag_t c_iflag; /* input mode flags */
27 tcflag_t c_oflag; /* output mode flags */
28 tcflag_t c_cflag; /* control mode flags */
29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */
32};
33
34struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 speed_t c_ispeed; /* input speed */
42 speed_t c_ospeed; /* output speed */
43};
44
45struct ktermios {
46 tcflag_t c_iflag; /* input mode flags */
47 tcflag_t c_oflag; /* output mode flags */
48 tcflag_t c_cflag; /* control mode flags */
49 tcflag_t c_lflag; /* local mode flags */
50 cc_t c_line; /* line discipline */
51 cc_t c_cc[NCCS]; /* control characters */
52 speed_t c_ispeed; /* input speed */
53 speed_t c_ospeed; /* output speed */
54};
55
56/* c_cc characters */
57#define VINTR 0 /* Interrupt character [ISIG]. */
58#define VQUIT 1 /* Quit character [ISIG]. */
59#define VERASE 2 /* Erase character [ICANON]. */
60#define VKILL 3 /* Kill-line character [ICANON]. */
61#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
62#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
63#define VEOL2 6 /* Second EOL character [ICANON]. */
64#define VSWTC 7 /* ??? */
65#define VSWTCH VSWTC
66#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
67#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
68#define VSUSP 10 /* Suspend character [ISIG]. */
69#if 0
70/*
71 * VDSUSP is not supported
72 */
73#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
74#endif
75#define VREPRINT 12 /* Reprint-line character [ICANON]. */
76#define VDISCARD 13 /* Discard character [IEXTEN]. */
77#define VWERASE 14 /* Word-erase character [ICANON]. */
78#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
79#define VEOF 16 /* End-of-file character [ICANON]. */
80#define VEOL 17 /* End-of-line character [ICANON]. */
81
82/* c_iflag bits */
83#define IGNBRK 0000001 /* Ignore break condition. */
84#define BRKINT 0000002 /* Signal interrupt on break. */
85#define IGNPAR 0000004 /* Ignore characters with parity errors. */
86#define PARMRK 0000010 /* Mark parity and framing errors. */
87#define INPCK 0000020 /* Enable input parity check. */
88#define ISTRIP 0000040 /* Strip 8th bit off characters. */
89#define INLCR 0000100 /* Map NL to CR on input. */
90#define IGNCR 0000200 /* Ignore CR. */
91#define ICRNL 0000400 /* Map CR to NL on input. */
92#define IUCLC 0001000 /* Map upper case to lower case on input. */
93#define IXON 0002000 /* Enable start/stop output control. */
94#define IXANY 0004000 /* Any character will restart after stop. */
95#define IXOFF 0010000 /* Enable start/stop input control. */
96#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
97#define IUTF8 0040000 /* Input is UTF-8 */
98
99/* c_oflag bits */
100#define OPOST 0000001 /* Perform output processing. */
101#define OLCUC 0000002 /* Map lower case to upper case on output. */
102#define ONLCR 0000004 /* Map NL to CR-NL on output. */
103#define OCRNL 0000010
104#define ONOCR 0000020
105#define ONLRET 0000040
106#define OFILL 0000100
107#define OFDEL 0000200
108#define NLDLY 0000400
109#define NL0 0000000
110#define NL1 0000400
111#define CRDLY 0003000
112#define CR0 0000000
113#define CR1 0001000
114#define CR2 0002000
115#define CR3 0003000
116#define TABDLY 0014000
117#define TAB0 0000000
118#define TAB1 0004000
119#define TAB2 0010000
120#define TAB3 0014000
121#define XTABS 0014000
122#define BSDLY 0020000
123#define BS0 0000000
124#define BS1 0020000
125#define VTDLY 0040000
126#define VT0 0000000
127#define VT1 0040000
128#define FFDLY 0100000
129#define FF0 0000000
130#define FF1 0100000
131/*
132#define PAGEOUT ???
133#define WRAP ???
134 */
135
136/* c_cflag bit meaning */
137#define CBAUD 0010017
138#define B0 0000000 /* hang up */
139#define B50 0000001
140#define B75 0000002
141#define B110 0000003
142#define B134 0000004
143#define B150 0000005
144#define B200 0000006
145#define B300 0000007
146#define B600 0000010
147#define B1200 0000011
148#define B1800 0000012
149#define B2400 0000013
150#define B4800 0000014
151#define B9600 0000015
152#define B19200 0000016
153#define B38400 0000017
154#define EXTA B19200
155#define EXTB B38400
156#define CSIZE 0000060 /* Number of bits per byte (mask). */
157#define CS5 0000000 /* 5 bits per byte. */
158#define CS6 0000020 /* 6 bits per byte. */
159#define CS7 0000040 /* 7 bits per byte. */
160#define CS8 0000060 /* 8 bits per byte. */
161#define CSTOPB 0000100 /* Two stop bits instead of one. */
162#define CREAD 0000200 /* Enable receiver. */
163#define PARENB 0000400 /* Parity enable. */
164#define PARODD 0001000 /* Odd parity instead of even. */
165#define HUPCL 0002000 /* Hang up on last close. */
166#define CLOCAL 0004000 /* Ignore modem status lines. */
167#define CBAUDEX 0010000
168#define BOTHER 0010000
169#define B57600 0010001
170#define B115200 0010002
171#define B230400 0010003
172#define B460800 0010004
173#define B500000 0010005
174#define B576000 0010006
175#define B921600 0010007
176#define B1000000 0010010
177#define B1152000 0010011
178#define B1500000 0010012
179#define B2000000 0010013
180#define B2500000 0010014
181#define B3000000 0010015
182#define B3500000 0010016
183#define B4000000 0010017
184#define CIBAUD 002003600000 /* input baud rate */
185#define CMSPAR 010000000000 /* mark or space (stick) parity */
186#define CRTSCTS 020000000000 /* flow control */
187
188#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
189
190/* c_lflag bits */
191#define ISIG 0000001 /* Enable signals. */
192#define ICANON 0000002 /* Do erase and kill processing. */
193#define XCASE 0000004
194#define ECHO 0000010 /* Enable echo. */
195#define ECHOE 0000020 /* Visual erase for ERASE. */
196#define ECHOK 0000040 /* Echo NL after KILL. */
197#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
198#define NOFLSH 0000200 /* Disable flush after interrupt. */
199#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
200#define ECHOCTL 0001000 /* Echo control characters as ^X. */
201#define ECHOPRT 0002000 /* Hardcopy visual erase. */
202#define ECHOKE 0004000 /* Visual erase for KILL. */
203#define FLUSHO 0020000
204#define PENDIN 0040000 /* Retype pending input (state). */
205#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
206#define ITOSTOP TOSTOP
207#define EXTPROC 0200000 /* External processing on pty */
208
209/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
210#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
211
212/* tcflow() and TCXONC use these */
213#define TCOOFF 0 /* Suspend output. */
214#define TCOON 1 /* Restart suspended output. */
215#define TCIOFF 2 /* Send a STOP character. */
216#define TCION 3 /* Send a START character. */
217
218/* tcflush() and TCFLSH use these */
219#define TCIFLUSH 0 /* Discard data received but not yet read. */
220#define TCOFLUSH 1 /* Discard data written but not yet sent. */
221#define TCIOFLUSH 2 /* Discard all pending data. */
222
223/* tcsetattr uses these */
224#define TCSANOW TCSETS /* Change immediately. */
225#define TCSADRAIN TCSETSW /* Change when pending output is written. */
226#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
227
228#endif /* _ASM_TERMBITS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/termios.h deleted-81
...@@ -1,81 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_TERMIOS_H
11#define _ASM_TERMIOS_H
12
13#include <linux/errno.h>
14#include <asm/termbits.h>
15#include <asm/ioctls.h>
16
17struct sgttyb {
18 char sg_ispeed;
19 char sg_ospeed;
20 char sg_erase;
21 char sg_kill;
22 int sg_flags; /* SGI special - int, not short */
23};
24
25struct tchars {
26 char t_intrc;
27 char t_quitc;
28 char t_startc;
29 char t_stopc;
30 char t_eofc;
31 char t_brkc;
32};
33
34struct ltchars {
35 char t_suspc; /* stop process signal */
36 char t_dsuspc; /* delayed stop process signal */
37 char t_rprntc; /* reprint line */
38 char t_flushc; /* flush output (toggles) */
39 char t_werasc; /* word erase */
40 char t_lnextc; /* literal next character */
41};
42
43/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
44 compatibility anyway ... */
45
46struct winsize {
47 unsigned short ws_row;
48 unsigned short ws_col;
49 unsigned short ws_xpixel;
50 unsigned short ws_ypixel;
51};
52
53#define NCC 8
54struct termio {
55 unsigned short c_iflag; /* input mode flags */
56 unsigned short c_oflag; /* output mode flags */
57 unsigned short c_cflag; /* control mode flags */
58 unsigned short c_lflag; /* local mode flags */
59 char c_line; /* line discipline */
60 unsigned char c_cc[NCCS]; /* control characters */
61};
62
63
64/* modem lines */
65#define TIOCM_LE 0x001 /* line enable */
66#define TIOCM_DTR 0x002 /* data terminal ready */
67#define TIOCM_RTS 0x004 /* request to send */
68#define TIOCM_ST 0x010 /* secondary transmit */
69#define TIOCM_SR 0x020 /* secondary receive */
70#define TIOCM_CTS 0x040 /* clear to send */
71#define TIOCM_CAR 0x100 /* carrier detect */
72#define TIOCM_CD TIOCM_CAR
73#define TIOCM_RNG 0x200 /* ring */
74#define TIOCM_RI TIOCM_RNG
75#define TIOCM_DSR 0x400 /* data set ready */
76#define TIOCM_OUT1 0x2000
77#define TIOCM_OUT2 0x4000
78#define TIOCM_LOOP 0x8000
79
80
81#endif /* _ASM_TERMIOS_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/types.h deleted-29
...@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
8 * Copyright (C) 2008 Wind River Systems,
9 * written by Ralf Baechle
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12#ifndef _ASM_TYPES_H
13#define _ASM_TYPES_H
14
15/*
16 * We don't use int-l64.h for the kernel anymore but still use it for
17 * userspace to avoid code changes.
18 *
19 * However, some user programs (e.g. perf) may not want this. They can
20 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
21 */
22# if _MIPS_SZLONG == 64 && !defined(__SANE_USERSPACE_TYPES__)
23# include <asm-generic/int-l64.h>
24# else
25# include <asm-generic/int-ll64.h>
26# endif
27
28
29#endif /* _ASM_TYPES_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-any/asm/unistd.h deleted-1101
...@@ -1,1101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 *
10 * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
11 * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
12 */
13#ifndef _ASM_UNISTD_H
14#define _ASM_UNISTD_H
15
16#include <asm/sgidefs.h>
17
18#if _MIPS_SIM == _MIPS_SIM_ABI32
19
20/*
21 * Linux o32 style syscalls are in the range from 4000 to 4999.
22 */
23#define __NR_Linux 4000
24#define __NR_syscall (__NR_Linux + 0)
25#define __NR_exit (__NR_Linux + 1)
26#define __NR_fork (__NR_Linux + 2)
27#define __NR_read (__NR_Linux + 3)
28#define __NR_write (__NR_Linux + 4)
29#define __NR_open (__NR_Linux + 5)
30#define __NR_close (__NR_Linux + 6)
31#define __NR_waitpid (__NR_Linux + 7)
32#define __NR_creat (__NR_Linux + 8)
33#define __NR_link (__NR_Linux + 9)
34#define __NR_unlink (__NR_Linux + 10)
35#define __NR_execve (__NR_Linux + 11)
36#define __NR_chdir (__NR_Linux + 12)
37#define __NR_time (__NR_Linux + 13)
38#define __NR_mknod (__NR_Linux + 14)
39#define __NR_chmod (__NR_Linux + 15)
40#define __NR_lchown (__NR_Linux + 16)
41#define __NR_break (__NR_Linux + 17)
42#define __NR_unused18 (__NR_Linux + 18)
43#define __NR_lseek (__NR_Linux + 19)
44#define __NR_getpid (__NR_Linux + 20)
45#define __NR_mount (__NR_Linux + 21)
46#define __NR_umount (__NR_Linux + 22)
47#define __NR_setuid (__NR_Linux + 23)
48#define __NR_getuid (__NR_Linux + 24)
49#define __NR_stime (__NR_Linux + 25)
50#define __NR_ptrace (__NR_Linux + 26)
51#define __NR_alarm (__NR_Linux + 27)
52#define __NR_unused28 (__NR_Linux + 28)
53#define __NR_pause (__NR_Linux + 29)
54#define __NR_utime (__NR_Linux + 30)
55#define __NR_stty (__NR_Linux + 31)
56#define __NR_gtty (__NR_Linux + 32)
57#define __NR_access (__NR_Linux + 33)
58#define __NR_nice (__NR_Linux + 34)
59#define __NR_ftime (__NR_Linux + 35)
60#define __NR_sync (__NR_Linux + 36)
61#define __NR_kill (__NR_Linux + 37)
62#define __NR_rename (__NR_Linux + 38)
63#define __NR_mkdir (__NR_Linux + 39)
64#define __NR_rmdir (__NR_Linux + 40)
65#define __NR_dup (__NR_Linux + 41)
66#define __NR_pipe (__NR_Linux + 42)
67#define __NR_times (__NR_Linux + 43)
68#define __NR_prof (__NR_Linux + 44)
69#define __NR_brk (__NR_Linux + 45)
70#define __NR_setgid (__NR_Linux + 46)
71#define __NR_getgid (__NR_Linux + 47)
72#define __NR_signal (__NR_Linux + 48)
73#define __NR_geteuid (__NR_Linux + 49)
74#define __NR_getegid (__NR_Linux + 50)
75#define __NR_acct (__NR_Linux + 51)
76#define __NR_umount2 (__NR_Linux + 52)
77#define __NR_lock (__NR_Linux + 53)
78#define __NR_ioctl (__NR_Linux + 54)
79#define __NR_fcntl (__NR_Linux + 55)
80#define __NR_mpx (__NR_Linux + 56)
81#define __NR_setpgid (__NR_Linux + 57)
82#define __NR_ulimit (__NR_Linux + 58)
83#define __NR_unused59 (__NR_Linux + 59)
84#define __NR_umask (__NR_Linux + 60)
85#define __NR_chroot (__NR_Linux + 61)
86#define __NR_ustat (__NR_Linux + 62)
87#define __NR_dup2 (__NR_Linux + 63)
88#define __NR_getppid (__NR_Linux + 64)
89#define __NR_getpgrp (__NR_Linux + 65)
90#define __NR_setsid (__NR_Linux + 66)
91#define __NR_sigaction (__NR_Linux + 67)
92#define __NR_sgetmask (__NR_Linux + 68)
93#define __NR_ssetmask (__NR_Linux + 69)
94#define __NR_setreuid (__NR_Linux + 70)
95#define __NR_setregid (__NR_Linux + 71)
96#define __NR_sigsuspend (__NR_Linux + 72)
97#define __NR_sigpending (__NR_Linux + 73)
98#define __NR_sethostname (__NR_Linux + 74)
99#define __NR_setrlimit (__NR_Linux + 75)
100#define __NR_getrlimit (__NR_Linux + 76)
101#define __NR_getrusage (__NR_Linux + 77)
102#define __NR_gettimeofday (__NR_Linux + 78)
103#define __NR_settimeofday (__NR_Linux + 79)
104#define __NR_getgroups (__NR_Linux + 80)
105#define __NR_setgroups (__NR_Linux + 81)
106#define __NR_reserved82 (__NR_Linux + 82)
107#define __NR_symlink (__NR_Linux + 83)
108#define __NR_unused84 (__NR_Linux + 84)
109#define __NR_readlink (__NR_Linux + 85)
110#define __NR_uselib (__NR_Linux + 86)
111#define __NR_swapon (__NR_Linux + 87)
112#define __NR_reboot (__NR_Linux + 88)
113#define __NR_readdir (__NR_Linux + 89)
114#define __NR_mmap (__NR_Linux + 90)
115#define __NR_munmap (__NR_Linux + 91)
116#define __NR_truncate (__NR_Linux + 92)
117#define __NR_ftruncate (__NR_Linux + 93)
118#define __NR_fchmod (__NR_Linux + 94)
119#define __NR_fchown (__NR_Linux + 95)
120#define __NR_getpriority (__NR_Linux + 96)
121#define __NR_setpriority (__NR_Linux + 97)
122#define __NR_profil (__NR_Linux + 98)
123#define __NR_statfs (__NR_Linux + 99)
124#define __NR_fstatfs (__NR_Linux + 100)
125#define __NR_ioperm (__NR_Linux + 101)
126#define __NR_socketcall (__NR_Linux + 102)
127#define __NR_syslog (__NR_Linux + 103)
128#define __NR_setitimer (__NR_Linux + 104)
129#define __NR_getitimer (__NR_Linux + 105)
130#define __NR_stat (__NR_Linux + 106)
131#define __NR_lstat (__NR_Linux + 107)
132#define __NR_fstat (__NR_Linux + 108)
133#define __NR_unused109 (__NR_Linux + 109)
134#define __NR_iopl (__NR_Linux + 110)
135#define __NR_vhangup (__NR_Linux + 111)
136#define __NR_idle (__NR_Linux + 112)
137#define __NR_vm86 (__NR_Linux + 113)
138#define __NR_wait4 (__NR_Linux + 114)
139#define __NR_swapoff (__NR_Linux + 115)
140#define __NR_sysinfo (__NR_Linux + 116)
141#define __NR_ipc (__NR_Linux + 117)
142#define __NR_fsync (__NR_Linux + 118)
143#define __NR_sigreturn (__NR_Linux + 119)
144#define __NR_clone (__NR_Linux + 120)
145#define __NR_setdomainname (__NR_Linux + 121)
146#define __NR_uname (__NR_Linux + 122)
147#define __NR_modify_ldt (__NR_Linux + 123)
148#define __NR_adjtimex (__NR_Linux + 124)
149#define __NR_mprotect (__NR_Linux + 125)
150#define __NR_sigprocmask (__NR_Linux + 126)
151#define __NR_create_module (__NR_Linux + 127)
152#define __NR_init_module (__NR_Linux + 128)
153#define __NR_delete_module (__NR_Linux + 129)
154#define __NR_get_kernel_syms (__NR_Linux + 130)
155#define __NR_quotactl (__NR_Linux + 131)
156#define __NR_getpgid (__NR_Linux + 132)
157#define __NR_fchdir (__NR_Linux + 133)
158#define __NR_bdflush (__NR_Linux + 134)
159#define __NR_sysfs (__NR_Linux + 135)
160#define __NR_personality (__NR_Linux + 136)
161#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
162#define __NR_setfsuid (__NR_Linux + 138)
163#define __NR_setfsgid (__NR_Linux + 139)
164#define __NR__llseek (__NR_Linux + 140)
165#define __NR_getdents (__NR_Linux + 141)
166#define __NR__newselect (__NR_Linux + 142)
167#define __NR_flock (__NR_Linux + 143)
168#define __NR_msync (__NR_Linux + 144)
169#define __NR_readv (__NR_Linux + 145)
170#define __NR_writev (__NR_Linux + 146)
171#define __NR_cacheflush (__NR_Linux + 147)
172#define __NR_cachectl (__NR_Linux + 148)
173#define __NR_sysmips (__NR_Linux + 149)
174#define __NR_unused150 (__NR_Linux + 150)
175#define __NR_getsid (__NR_Linux + 151)
176#define __NR_fdatasync (__NR_Linux + 152)
177#define __NR__sysctl (__NR_Linux + 153)
178#define __NR_mlock (__NR_Linux + 154)
179#define __NR_munlock (__NR_Linux + 155)
180#define __NR_mlockall (__NR_Linux + 156)
181#define __NR_munlockall (__NR_Linux + 157)
182#define __NR_sched_setparam (__NR_Linux + 158)
183#define __NR_sched_getparam (__NR_Linux + 159)
184#define __NR_sched_setscheduler (__NR_Linux + 160)
185#define __NR_sched_getscheduler (__NR_Linux + 161)
186#define __NR_sched_yield (__NR_Linux + 162)
187#define __NR_sched_get_priority_max (__NR_Linux + 163)
188#define __NR_sched_get_priority_min (__NR_Linux + 164)
189#define __NR_sched_rr_get_interval (__NR_Linux + 165)
190#define __NR_nanosleep (__NR_Linux + 166)
191#define __NR_mremap (__NR_Linux + 167)
192#define __NR_accept (__NR_Linux + 168)
193#define __NR_bind (__NR_Linux + 169)
194#define __NR_connect (__NR_Linux + 170)
195#define __NR_getpeername (__NR_Linux + 171)
196#define __NR_getsockname (__NR_Linux + 172)
197#define __NR_getsockopt (__NR_Linux + 173)
198#define __NR_listen (__NR_Linux + 174)
199#define __NR_recv (__NR_Linux + 175)
200#define __NR_recvfrom (__NR_Linux + 176)
201#define __NR_recvmsg (__NR_Linux + 177)
202#define __NR_send (__NR_Linux + 178)
203#define __NR_sendmsg (__NR_Linux + 179)
204#define __NR_sendto (__NR_Linux + 180)
205#define __NR_setsockopt (__NR_Linux + 181)
206#define __NR_shutdown (__NR_Linux + 182)
207#define __NR_socket (__NR_Linux + 183)
208#define __NR_socketpair (__NR_Linux + 184)
209#define __NR_setresuid (__NR_Linux + 185)
210#define __NR_getresuid (__NR_Linux + 186)
211#define __NR_query_module (__NR_Linux + 187)
212#define __NR_poll (__NR_Linux + 188)
213#define __NR_nfsservctl (__NR_Linux + 189)
214#define __NR_setresgid (__NR_Linux + 190)
215#define __NR_getresgid (__NR_Linux + 191)
216#define __NR_prctl (__NR_Linux + 192)
217#define __NR_rt_sigreturn (__NR_Linux + 193)
218#define __NR_rt_sigaction (__NR_Linux + 194)
219#define __NR_rt_sigprocmask (__NR_Linux + 195)
220#define __NR_rt_sigpending (__NR_Linux + 196)
221#define __NR_rt_sigtimedwait (__NR_Linux + 197)
222#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
223#define __NR_rt_sigsuspend (__NR_Linux + 199)
224#define __NR_pread64 (__NR_Linux + 200)
225#define __NR_pwrite64 (__NR_Linux + 201)
226#define __NR_chown (__NR_Linux + 202)
227#define __NR_getcwd (__NR_Linux + 203)
228#define __NR_capget (__NR_Linux + 204)
229#define __NR_capset (__NR_Linux + 205)
230#define __NR_sigaltstack (__NR_Linux + 206)
231#define __NR_sendfile (__NR_Linux + 207)
232#define __NR_getpmsg (__NR_Linux + 208)
233#define __NR_putpmsg (__NR_Linux + 209)
234#define __NR_mmap2 (__NR_Linux + 210)
235#define __NR_truncate64 (__NR_Linux + 211)
236#define __NR_ftruncate64 (__NR_Linux + 212)
237#define __NR_stat64 (__NR_Linux + 213)
238#define __NR_lstat64 (__NR_Linux + 214)
239#define __NR_fstat64 (__NR_Linux + 215)
240#define __NR_pivot_root (__NR_Linux + 216)
241#define __NR_mincore (__NR_Linux + 217)
242#define __NR_madvise (__NR_Linux + 218)
243#define __NR_getdents64 (__NR_Linux + 219)
244#define __NR_fcntl64 (__NR_Linux + 220)
245#define __NR_reserved221 (__NR_Linux + 221)
246#define __NR_gettid (__NR_Linux + 222)
247#define __NR_readahead (__NR_Linux + 223)
248#define __NR_setxattr (__NR_Linux + 224)
249#define __NR_lsetxattr (__NR_Linux + 225)
250#define __NR_fsetxattr (__NR_Linux + 226)
251#define __NR_getxattr (__NR_Linux + 227)
252#define __NR_lgetxattr (__NR_Linux + 228)
253#define __NR_fgetxattr (__NR_Linux + 229)
254#define __NR_listxattr (__NR_Linux + 230)
255#define __NR_llistxattr (__NR_Linux + 231)
256#define __NR_flistxattr (__NR_Linux + 232)
257#define __NR_removexattr (__NR_Linux + 233)
258#define __NR_lremovexattr (__NR_Linux + 234)
259#define __NR_fremovexattr (__NR_Linux + 235)
260#define __NR_tkill (__NR_Linux + 236)
261#define __NR_sendfile64 (__NR_Linux + 237)
262#define __NR_futex (__NR_Linux + 238)
263#define __NR_sched_setaffinity (__NR_Linux + 239)
264#define __NR_sched_getaffinity (__NR_Linux + 240)
265#define __NR_io_setup (__NR_Linux + 241)
266#define __NR_io_destroy (__NR_Linux + 242)
267#define __NR_io_getevents (__NR_Linux + 243)
268#define __NR_io_submit (__NR_Linux + 244)
269#define __NR_io_cancel (__NR_Linux + 245)
270#define __NR_exit_group (__NR_Linux + 246)
271#define __NR_lookup_dcookie (__NR_Linux + 247)
272#define __NR_epoll_create (__NR_Linux + 248)
273#define __NR_epoll_ctl (__NR_Linux + 249)
274#define __NR_epoll_wait (__NR_Linux + 250)
275#define __NR_remap_file_pages (__NR_Linux + 251)
276#define __NR_set_tid_address (__NR_Linux + 252)
277#define __NR_restart_syscall (__NR_Linux + 253)
278#define __NR_fadvise64 (__NR_Linux + 254)
279#define __NR_statfs64 (__NR_Linux + 255)
280#define __NR_fstatfs64 (__NR_Linux + 256)
281#define __NR_timer_create (__NR_Linux + 257)
282#define __NR_timer_settime (__NR_Linux + 258)
283#define __NR_timer_gettime (__NR_Linux + 259)
284#define __NR_timer_getoverrun (__NR_Linux + 260)
285#define __NR_timer_delete (__NR_Linux + 261)
286#define __NR_clock_settime (__NR_Linux + 262)
287#define __NR_clock_gettime (__NR_Linux + 263)
288#define __NR_clock_getres (__NR_Linux + 264)
289#define __NR_clock_nanosleep (__NR_Linux + 265)
290#define __NR_tgkill (__NR_Linux + 266)
291#define __NR_utimes (__NR_Linux + 267)
292#define __NR_mbind (__NR_Linux + 268)
293#define __NR_get_mempolicy (__NR_Linux + 269)
294#define __NR_set_mempolicy (__NR_Linux + 270)
295#define __NR_mq_open (__NR_Linux + 271)
296#define __NR_mq_unlink (__NR_Linux + 272)
297#define __NR_mq_timedsend (__NR_Linux + 273)
298#define __NR_mq_timedreceive (__NR_Linux + 274)
299#define __NR_mq_notify (__NR_Linux + 275)
300#define __NR_mq_getsetattr (__NR_Linux + 276)
301#define __NR_vserver (__NR_Linux + 277)
302#define __NR_waitid (__NR_Linux + 278)
303/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
304#define __NR_add_key (__NR_Linux + 280)
305#define __NR_request_key (__NR_Linux + 281)
306#define __NR_keyctl (__NR_Linux + 282)
307#define __NR_set_thread_area (__NR_Linux + 283)
308#define __NR_inotify_init (__NR_Linux + 284)
309#define __NR_inotify_add_watch (__NR_Linux + 285)
310#define __NR_inotify_rm_watch (__NR_Linux + 286)
311#define __NR_migrate_pages (__NR_Linux + 287)
312#define __NR_openat (__NR_Linux + 288)
313#define __NR_mkdirat (__NR_Linux + 289)
314#define __NR_mknodat (__NR_Linux + 290)
315#define __NR_fchownat (__NR_Linux + 291)
316#define __NR_futimesat (__NR_Linux + 292)
317#define __NR_fstatat64 (__NR_Linux + 293)
318#define __NR_unlinkat (__NR_Linux + 294)
319#define __NR_renameat (__NR_Linux + 295)
320#define __NR_linkat (__NR_Linux + 296)
321#define __NR_symlinkat (__NR_Linux + 297)
322#define __NR_readlinkat (__NR_Linux + 298)
323#define __NR_fchmodat (__NR_Linux + 299)
324#define __NR_faccessat (__NR_Linux + 300)
325#define __NR_pselect6 (__NR_Linux + 301)
326#define __NR_ppoll (__NR_Linux + 302)
327#define __NR_unshare (__NR_Linux + 303)
328#define __NR_splice (__NR_Linux + 304)
329#define __NR_sync_file_range (__NR_Linux + 305)
330#define __NR_tee (__NR_Linux + 306)
331#define __NR_vmsplice (__NR_Linux + 307)
332#define __NR_move_pages (__NR_Linux + 308)
333#define __NR_set_robust_list (__NR_Linux + 309)
334#define __NR_get_robust_list (__NR_Linux + 310)
335#define __NR_kexec_load (__NR_Linux + 311)
336#define __NR_getcpu (__NR_Linux + 312)
337#define __NR_epoll_pwait (__NR_Linux + 313)
338#define __NR_ioprio_set (__NR_Linux + 314)
339#define __NR_ioprio_get (__NR_Linux + 315)
340#define __NR_utimensat (__NR_Linux + 316)
341#define __NR_signalfd (__NR_Linux + 317)
342#define __NR_timerfd (__NR_Linux + 318)
343#define __NR_eventfd (__NR_Linux + 319)
344#define __NR_fallocate (__NR_Linux + 320)
345#define __NR_timerfd_create (__NR_Linux + 321)
346#define __NR_timerfd_gettime (__NR_Linux + 322)
347#define __NR_timerfd_settime (__NR_Linux + 323)
348#define __NR_signalfd4 (__NR_Linux + 324)
349#define __NR_eventfd2 (__NR_Linux + 325)
350#define __NR_epoll_create1 (__NR_Linux + 326)
351#define __NR_dup3 (__NR_Linux + 327)
352#define __NR_pipe2 (__NR_Linux + 328)
353#define __NR_inotify_init1 (__NR_Linux + 329)
354#define __NR_preadv (__NR_Linux + 330)
355#define __NR_pwritev (__NR_Linux + 331)
356#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
357#define __NR_perf_event_open (__NR_Linux + 333)
358#define __NR_accept4 (__NR_Linux + 334)
359#define __NR_recvmmsg (__NR_Linux + 335)
360#define __NR_fanotify_init (__NR_Linux + 336)
361#define __NR_fanotify_mark (__NR_Linux + 337)
362#define __NR_prlimit64 (__NR_Linux + 338)
363#define __NR_name_to_handle_at (__NR_Linux + 339)
364#define __NR_open_by_handle_at (__NR_Linux + 340)
365#define __NR_clock_adjtime (__NR_Linux + 341)
366#define __NR_syncfs (__NR_Linux + 342)
367#define __NR_sendmmsg (__NR_Linux + 343)
368#define __NR_setns (__NR_Linux + 344)
369#define __NR_process_vm_readv (__NR_Linux + 345)
370#define __NR_process_vm_writev (__NR_Linux + 346)
371#define __NR_kcmp (__NR_Linux + 347)
372#define __NR_finit_module (__NR_Linux + 348)
373#define __NR_sched_setattr (__NR_Linux + 349)
374#define __NR_sched_getattr (__NR_Linux + 350)
375#define __NR_renameat2 (__NR_Linux + 351)
376#define __NR_seccomp (__NR_Linux + 352)
377#define __NR_getrandom (__NR_Linux + 353)
378#define __NR_memfd_create (__NR_Linux + 354)
379#define __NR_bpf (__NR_Linux + 355)
380#define __NR_execveat (__NR_Linux + 356)
381#define __NR_userfaultfd (__NR_Linux + 357)
382#define __NR_membarrier (__NR_Linux + 358)
383#define __NR_mlock2 (__NR_Linux + 359)
384#define __NR_copy_file_range (__NR_Linux + 360)
385#define __NR_preadv2 (__NR_Linux + 361)
386#define __NR_pwritev2 (__NR_Linux + 362)
387#define __NR_pkey_mprotect (__NR_Linux + 363)
388#define __NR_pkey_alloc (__NR_Linux + 364)
389#define __NR_pkey_free (__NR_Linux + 365)
390#define __NR_statx (__NR_Linux + 366)
391#define __NR_rseq (__NR_Linux + 367)
392#define __NR_io_pgetevents (__NR_Linux + 368)
393
394
395/*
396 * Offset of the last Linux o32 flavoured syscall
397 */
398#define __NR_Linux_syscalls 368
399
400#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
401
402#define __NR_O32_Linux 4000
403#define __NR_O32_Linux_syscalls 368
404
405#if _MIPS_SIM == _MIPS_SIM_ABI64
406
407/*
408 * Linux 64-bit syscalls are in the range from 5000 to 5999.
409 */
410#define __NR_Linux 5000
411#define __NR_read (__NR_Linux + 0)
412#define __NR_write (__NR_Linux + 1)
413#define __NR_open (__NR_Linux + 2)
414#define __NR_close (__NR_Linux + 3)
415#define __NR_stat (__NR_Linux + 4)
416#define __NR_fstat (__NR_Linux + 5)
417#define __NR_lstat (__NR_Linux + 6)
418#define __NR_poll (__NR_Linux + 7)
419#define __NR_lseek (__NR_Linux + 8)
420#define __NR_mmap (__NR_Linux + 9)
421#define __NR_mprotect (__NR_Linux + 10)
422#define __NR_munmap (__NR_Linux + 11)
423#define __NR_brk (__NR_Linux + 12)
424#define __NR_rt_sigaction (__NR_Linux + 13)
425#define __NR_rt_sigprocmask (__NR_Linux + 14)
426#define __NR_ioctl (__NR_Linux + 15)
427#define __NR_pread64 (__NR_Linux + 16)
428#define __NR_pwrite64 (__NR_Linux + 17)
429#define __NR_readv (__NR_Linux + 18)
430#define __NR_writev (__NR_Linux + 19)
431#define __NR_access (__NR_Linux + 20)
432#define __NR_pipe (__NR_Linux + 21)
433#define __NR__newselect (__NR_Linux + 22)
434#define __NR_sched_yield (__NR_Linux + 23)
435#define __NR_mremap (__NR_Linux + 24)
436#define __NR_msync (__NR_Linux + 25)
437#define __NR_mincore (__NR_Linux + 26)
438#define __NR_madvise (__NR_Linux + 27)
439#define __NR_shmget (__NR_Linux + 28)
440#define __NR_shmat (__NR_Linux + 29)
441#define __NR_shmctl (__NR_Linux + 30)
442#define __NR_dup (__NR_Linux + 31)
443#define __NR_dup2 (__NR_Linux + 32)
444#define __NR_pause (__NR_Linux + 33)
445#define __NR_nanosleep (__NR_Linux + 34)
446#define __NR_getitimer (__NR_Linux + 35)
447#define __NR_setitimer (__NR_Linux + 36)
448#define __NR_alarm (__NR_Linux + 37)
449#define __NR_getpid (__NR_Linux + 38)
450#define __NR_sendfile (__NR_Linux + 39)
451#define __NR_socket (__NR_Linux + 40)
452#define __NR_connect (__NR_Linux + 41)
453#define __NR_accept (__NR_Linux + 42)
454#define __NR_sendto (__NR_Linux + 43)
455#define __NR_recvfrom (__NR_Linux + 44)
456#define __NR_sendmsg (__NR_Linux + 45)
457#define __NR_recvmsg (__NR_Linux + 46)
458#define __NR_shutdown (__NR_Linux + 47)
459#define __NR_bind (__NR_Linux + 48)
460#define __NR_listen (__NR_Linux + 49)
461#define __NR_getsockname (__NR_Linux + 50)
462#define __NR_getpeername (__NR_Linux + 51)
463#define __NR_socketpair (__NR_Linux + 52)
464#define __NR_setsockopt (__NR_Linux + 53)
465#define __NR_getsockopt (__NR_Linux + 54)
466#define __NR_clone (__NR_Linux + 55)
467#define __NR_fork (__NR_Linux + 56)
468#define __NR_execve (__NR_Linux + 57)
469#define __NR_exit (__NR_Linux + 58)
470#define __NR_wait4 (__NR_Linux + 59)
471#define __NR_kill (__NR_Linux + 60)
472#define __NR_uname (__NR_Linux + 61)
473#define __NR_semget (__NR_Linux + 62)
474#define __NR_semop (__NR_Linux + 63)
475#define __NR_semctl (__NR_Linux + 64)
476#define __NR_shmdt (__NR_Linux + 65)
477#define __NR_msgget (__NR_Linux + 66)
478#define __NR_msgsnd (__NR_Linux + 67)
479#define __NR_msgrcv (__NR_Linux + 68)
480#define __NR_msgctl (__NR_Linux + 69)
481#define __NR_fcntl (__NR_Linux + 70)
482#define __NR_flock (__NR_Linux + 71)
483#define __NR_fsync (__NR_Linux + 72)
484#define __NR_fdatasync (__NR_Linux + 73)
485#define __NR_truncate (__NR_Linux + 74)
486#define __NR_ftruncate (__NR_Linux + 75)
487#define __NR_getdents (__NR_Linux + 76)
488#define __NR_getcwd (__NR_Linux + 77)
489#define __NR_chdir (__NR_Linux + 78)
490#define __NR_fchdir (__NR_Linux + 79)
491#define __NR_rename (__NR_Linux + 80)
492#define __NR_mkdir (__NR_Linux + 81)
493#define __NR_rmdir (__NR_Linux + 82)
494#define __NR_creat (__NR_Linux + 83)
495#define __NR_link (__NR_Linux + 84)
496#define __NR_unlink (__NR_Linux + 85)
497#define __NR_symlink (__NR_Linux + 86)
498#define __NR_readlink (__NR_Linux + 87)
499#define __NR_chmod (__NR_Linux + 88)
500#define __NR_fchmod (__NR_Linux + 89)
501#define __NR_chown (__NR_Linux + 90)
502#define __NR_fchown (__NR_Linux + 91)
503#define __NR_lchown (__NR_Linux + 92)
504#define __NR_umask (__NR_Linux + 93)
505#define __NR_gettimeofday (__NR_Linux + 94)
506#define __NR_getrlimit (__NR_Linux + 95)
507#define __NR_getrusage (__NR_Linux + 96)
508#define __NR_sysinfo (__NR_Linux + 97)
509#define __NR_times (__NR_Linux + 98)
510#define __NR_ptrace (__NR_Linux + 99)
511#define __NR_getuid (__NR_Linux + 100)
512#define __NR_syslog (__NR_Linux + 101)
513#define __NR_getgid (__NR_Linux + 102)
514#define __NR_setuid (__NR_Linux + 103)
515#define __NR_setgid (__NR_Linux + 104)
516#define __NR_geteuid (__NR_Linux + 105)
517#define __NR_getegid (__NR_Linux + 106)
518#define __NR_setpgid (__NR_Linux + 107)
519#define __NR_getppid (__NR_Linux + 108)
520#define __NR_getpgrp (__NR_Linux + 109)
521#define __NR_setsid (__NR_Linux + 110)
522#define __NR_setreuid (__NR_Linux + 111)
523#define __NR_setregid (__NR_Linux + 112)
524#define __NR_getgroups (__NR_Linux + 113)
525#define __NR_setgroups (__NR_Linux + 114)
526#define __NR_setresuid (__NR_Linux + 115)
527#define __NR_getresuid (__NR_Linux + 116)
528#define __NR_setresgid (__NR_Linux + 117)
529#define __NR_getresgid (__NR_Linux + 118)
530#define __NR_getpgid (__NR_Linux + 119)
531#define __NR_setfsuid (__NR_Linux + 120)
532#define __NR_setfsgid (__NR_Linux + 121)
533#define __NR_getsid (__NR_Linux + 122)
534#define __NR_capget (__NR_Linux + 123)
535#define __NR_capset (__NR_Linux + 124)
536#define __NR_rt_sigpending (__NR_Linux + 125)
537#define __NR_rt_sigtimedwait (__NR_Linux + 126)
538#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
539#define __NR_rt_sigsuspend (__NR_Linux + 128)
540#define __NR_sigaltstack (__NR_Linux + 129)
541#define __NR_utime (__NR_Linux + 130)
542#define __NR_mknod (__NR_Linux + 131)
543#define __NR_personality (__NR_Linux + 132)
544#define __NR_ustat (__NR_Linux + 133)
545#define __NR_statfs (__NR_Linux + 134)
546#define __NR_fstatfs (__NR_Linux + 135)
547#define __NR_sysfs (__NR_Linux + 136)
548#define __NR_getpriority (__NR_Linux + 137)
549#define __NR_setpriority (__NR_Linux + 138)
550#define __NR_sched_setparam (__NR_Linux + 139)
551#define __NR_sched_getparam (__NR_Linux + 140)
552#define __NR_sched_setscheduler (__NR_Linux + 141)
553#define __NR_sched_getscheduler (__NR_Linux + 142)
554#define __NR_sched_get_priority_max (__NR_Linux + 143)
555#define __NR_sched_get_priority_min (__NR_Linux + 144)
556#define __NR_sched_rr_get_interval (__NR_Linux + 145)
557#define __NR_mlock (__NR_Linux + 146)
558#define __NR_munlock (__NR_Linux + 147)
559#define __NR_mlockall (__NR_Linux + 148)
560#define __NR_munlockall (__NR_Linux + 149)
561#define __NR_vhangup (__NR_Linux + 150)
562#define __NR_pivot_root (__NR_Linux + 151)
563#define __NR__sysctl (__NR_Linux + 152)
564#define __NR_prctl (__NR_Linux + 153)
565#define __NR_adjtimex (__NR_Linux + 154)
566#define __NR_setrlimit (__NR_Linux + 155)
567#define __NR_chroot (__NR_Linux + 156)
568#define __NR_sync (__NR_Linux + 157)
569#define __NR_acct (__NR_Linux + 158)
570#define __NR_settimeofday (__NR_Linux + 159)
571#define __NR_mount (__NR_Linux + 160)
572#define __NR_umount2 (__NR_Linux + 161)
573#define __NR_swapon (__NR_Linux + 162)
574#define __NR_swapoff (__NR_Linux + 163)
575#define __NR_reboot (__NR_Linux + 164)
576#define __NR_sethostname (__NR_Linux + 165)
577#define __NR_setdomainname (__NR_Linux + 166)
578#define __NR_create_module (__NR_Linux + 167)
579#define __NR_init_module (__NR_Linux + 168)
580#define __NR_delete_module (__NR_Linux + 169)
581#define __NR_get_kernel_syms (__NR_Linux + 170)
582#define __NR_query_module (__NR_Linux + 171)
583#define __NR_quotactl (__NR_Linux + 172)
584#define __NR_nfsservctl (__NR_Linux + 173)
585#define __NR_getpmsg (__NR_Linux + 174)
586#define __NR_putpmsg (__NR_Linux + 175)
587#define __NR_afs_syscall (__NR_Linux + 176)
588#define __NR_reserved177 (__NR_Linux + 177)
589#define __NR_gettid (__NR_Linux + 178)
590#define __NR_readahead (__NR_Linux + 179)
591#define __NR_setxattr (__NR_Linux + 180)
592#define __NR_lsetxattr (__NR_Linux + 181)
593#define __NR_fsetxattr (__NR_Linux + 182)
594#define __NR_getxattr (__NR_Linux + 183)
595#define __NR_lgetxattr (__NR_Linux + 184)
596#define __NR_fgetxattr (__NR_Linux + 185)
597#define __NR_listxattr (__NR_Linux + 186)
598#define __NR_llistxattr (__NR_Linux + 187)
599#define __NR_flistxattr (__NR_Linux + 188)
600#define __NR_removexattr (__NR_Linux + 189)
601#define __NR_lremovexattr (__NR_Linux + 190)
602#define __NR_fremovexattr (__NR_Linux + 191)
603#define __NR_tkill (__NR_Linux + 192)
604#define __NR_reserved193 (__NR_Linux + 193)
605#define __NR_futex (__NR_Linux + 194)
606#define __NR_sched_setaffinity (__NR_Linux + 195)
607#define __NR_sched_getaffinity (__NR_Linux + 196)
608#define __NR_cacheflush (__NR_Linux + 197)
609#define __NR_cachectl (__NR_Linux + 198)
610#define __NR_sysmips (__NR_Linux + 199)
611#define __NR_io_setup (__NR_Linux + 200)
612#define __NR_io_destroy (__NR_Linux + 201)
613#define __NR_io_getevents (__NR_Linux + 202)
614#define __NR_io_submit (__NR_Linux + 203)
615#define __NR_io_cancel (__NR_Linux + 204)
616#define __NR_exit_group (__NR_Linux + 205)
617#define __NR_lookup_dcookie (__NR_Linux + 206)
618#define __NR_epoll_create (__NR_Linux + 207)
619#define __NR_epoll_ctl (__NR_Linux + 208)
620#define __NR_epoll_wait (__NR_Linux + 209)
621#define __NR_remap_file_pages (__NR_Linux + 210)
622#define __NR_rt_sigreturn (__NR_Linux + 211)
623#define __NR_set_tid_address (__NR_Linux + 212)
624#define __NR_restart_syscall (__NR_Linux + 213)
625#define __NR_semtimedop (__NR_Linux + 214)
626#define __NR_fadvise64 (__NR_Linux + 215)
627#define __NR_timer_create (__NR_Linux + 216)
628#define __NR_timer_settime (__NR_Linux + 217)
629#define __NR_timer_gettime (__NR_Linux + 218)
630#define __NR_timer_getoverrun (__NR_Linux + 219)
631#define __NR_timer_delete (__NR_Linux + 220)
632#define __NR_clock_settime (__NR_Linux + 221)
633#define __NR_clock_gettime (__NR_Linux + 222)
634#define __NR_clock_getres (__NR_Linux + 223)
635#define __NR_clock_nanosleep (__NR_Linux + 224)
636#define __NR_tgkill (__NR_Linux + 225)
637#define __NR_utimes (__NR_Linux + 226)
638#define __NR_mbind (__NR_Linux + 227)
639#define __NR_get_mempolicy (__NR_Linux + 228)
640#define __NR_set_mempolicy (__NR_Linux + 229)
641#define __NR_mq_open (__NR_Linux + 230)
642#define __NR_mq_unlink (__NR_Linux + 231)
643#define __NR_mq_timedsend (__NR_Linux + 232)
644#define __NR_mq_timedreceive (__NR_Linux + 233)
645#define __NR_mq_notify (__NR_Linux + 234)
646#define __NR_mq_getsetattr (__NR_Linux + 235)
647#define __NR_vserver (__NR_Linux + 236)
648#define __NR_waitid (__NR_Linux + 237)
649/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
650#define __NR_add_key (__NR_Linux + 239)
651#define __NR_request_key (__NR_Linux + 240)
652#define __NR_keyctl (__NR_Linux + 241)
653#define __NR_set_thread_area (__NR_Linux + 242)
654#define __NR_inotify_init (__NR_Linux + 243)
655#define __NR_inotify_add_watch (__NR_Linux + 244)
656#define __NR_inotify_rm_watch (__NR_Linux + 245)
657#define __NR_migrate_pages (__NR_Linux + 246)
658#define __NR_openat (__NR_Linux + 247)
659#define __NR_mkdirat (__NR_Linux + 248)
660#define __NR_mknodat (__NR_Linux + 249)
661#define __NR_fchownat (__NR_Linux + 250)
662#define __NR_futimesat (__NR_Linux + 251)
663#define __NR_newfstatat (__NR_Linux + 252)
664#define __NR_unlinkat (__NR_Linux + 253)
665#define __NR_renameat (__NR_Linux + 254)
666#define __NR_linkat (__NR_Linux + 255)
667#define __NR_symlinkat (__NR_Linux + 256)
668#define __NR_readlinkat (__NR_Linux + 257)
669#define __NR_fchmodat (__NR_Linux + 258)
670#define __NR_faccessat (__NR_Linux + 259)
671#define __NR_pselect6 (__NR_Linux + 260)
672#define __NR_ppoll (__NR_Linux + 261)
673#define __NR_unshare (__NR_Linux + 262)
674#define __NR_splice (__NR_Linux + 263)
675#define __NR_sync_file_range (__NR_Linux + 264)
676#define __NR_tee (__NR_Linux + 265)
677#define __NR_vmsplice (__NR_Linux + 266)
678#define __NR_move_pages (__NR_Linux + 267)
679#define __NR_set_robust_list (__NR_Linux + 268)
680#define __NR_get_robust_list (__NR_Linux + 269)
681#define __NR_kexec_load (__NR_Linux + 270)
682#define __NR_getcpu (__NR_Linux + 271)
683#define __NR_epoll_pwait (__NR_Linux + 272)
684#define __NR_ioprio_set (__NR_Linux + 273)
685#define __NR_ioprio_get (__NR_Linux + 274)
686#define __NR_utimensat (__NR_Linux + 275)
687#define __NR_signalfd (__NR_Linux + 276)
688#define __NR_timerfd (__NR_Linux + 277)
689#define __NR_eventfd (__NR_Linux + 278)
690#define __NR_fallocate (__NR_Linux + 279)
691#define __NR_timerfd_create (__NR_Linux + 280)
692#define __NR_timerfd_gettime (__NR_Linux + 281)
693#define __NR_timerfd_settime (__NR_Linux + 282)
694#define __NR_signalfd4 (__NR_Linux + 283)
695#define __NR_eventfd2 (__NR_Linux + 284)
696#define __NR_epoll_create1 (__NR_Linux + 285)
697#define __NR_dup3 (__NR_Linux + 286)
698#define __NR_pipe2 (__NR_Linux + 287)
699#define __NR_inotify_init1 (__NR_Linux + 288)
700#define __NR_preadv (__NR_Linux + 289)
701#define __NR_pwritev (__NR_Linux + 290)
702#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
703#define __NR_perf_event_open (__NR_Linux + 292)
704#define __NR_accept4 (__NR_Linux + 293)
705#define __NR_recvmmsg (__NR_Linux + 294)
706#define __NR_fanotify_init (__NR_Linux + 295)
707#define __NR_fanotify_mark (__NR_Linux + 296)
708#define __NR_prlimit64 (__NR_Linux + 297)
709#define __NR_name_to_handle_at (__NR_Linux + 298)
710#define __NR_open_by_handle_at (__NR_Linux + 299)
711#define __NR_clock_adjtime (__NR_Linux + 300)
712#define __NR_syncfs (__NR_Linux + 301)
713#define __NR_sendmmsg (__NR_Linux + 302)
714#define __NR_setns (__NR_Linux + 303)
715#define __NR_process_vm_readv (__NR_Linux + 304)
716#define __NR_process_vm_writev (__NR_Linux + 305)
717#define __NR_kcmp (__NR_Linux + 306)
718#define __NR_finit_module (__NR_Linux + 307)
719#define __NR_getdents64 (__NR_Linux + 308)
720#define __NR_sched_setattr (__NR_Linux + 309)
721#define __NR_sched_getattr (__NR_Linux + 310)
722#define __NR_renameat2 (__NR_Linux + 311)
723#define __NR_seccomp (__NR_Linux + 312)
724#define __NR_getrandom (__NR_Linux + 313)
725#define __NR_memfd_create (__NR_Linux + 314)
726#define __NR_bpf (__NR_Linux + 315)
727#define __NR_execveat (__NR_Linux + 316)
728#define __NR_userfaultfd (__NR_Linux + 317)
729#define __NR_membarrier (__NR_Linux + 318)
730#define __NR_mlock2 (__NR_Linux + 319)
731#define __NR_copy_file_range (__NR_Linux + 320)
732#define __NR_preadv2 (__NR_Linux + 321)
733#define __NR_pwritev2 (__NR_Linux + 322)
734#define __NR_pkey_mprotect (__NR_Linux + 323)
735#define __NR_pkey_alloc (__NR_Linux + 324)
736#define __NR_pkey_free (__NR_Linux + 325)
737#define __NR_statx (__NR_Linux + 326)
738#define __NR_rseq (__NR_Linux + 327)
739#define __NR_io_pgetevents (__NR_Linux + 328)
740
741/*
742 * Offset of the last Linux 64-bit flavoured syscall
743 */
744#define __NR_Linux_syscalls 328
745
746#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
747
748#define __NR_64_Linux 5000
749#define __NR_64_Linux_syscalls 328
750
751#if _MIPS_SIM == _MIPS_SIM_NABI32
752
753/*
754 * Linux N32 syscalls are in the range from 6000 to 6999.
755 */
756#define __NR_Linux 6000
757#define __NR_read (__NR_Linux + 0)
758#define __NR_write (__NR_Linux + 1)
759#define __NR_open (__NR_Linux + 2)
760#define __NR_close (__NR_Linux + 3)
761#define __NR_stat (__NR_Linux + 4)
762#define __NR_fstat (__NR_Linux + 5)
763#define __NR_lstat (__NR_Linux + 6)
764#define __NR_poll (__NR_Linux + 7)
765#define __NR_lseek (__NR_Linux + 8)
766#define __NR_mmap (__NR_Linux + 9)
767#define __NR_mprotect (__NR_Linux + 10)
768#define __NR_munmap (__NR_Linux + 11)
769#define __NR_brk (__NR_Linux + 12)
770#define __NR_rt_sigaction (__NR_Linux + 13)
771#define __NR_rt_sigprocmask (__NR_Linux + 14)
772#define __NR_ioctl (__NR_Linux + 15)
773#define __NR_pread64 (__NR_Linux + 16)
774#define __NR_pwrite64 (__NR_Linux + 17)
775#define __NR_readv (__NR_Linux + 18)
776#define __NR_writev (__NR_Linux + 19)
777#define __NR_access (__NR_Linux + 20)
778#define __NR_pipe (__NR_Linux + 21)
779#define __NR__newselect (__NR_Linux + 22)
780#define __NR_sched_yield (__NR_Linux + 23)
781#define __NR_mremap (__NR_Linux + 24)
782#define __NR_msync (__NR_Linux + 25)
783#define __NR_mincore (__NR_Linux + 26)
784#define __NR_madvise (__NR_Linux + 27)
785#define __NR_shmget (__NR_Linux + 28)
786#define __NR_shmat (__NR_Linux + 29)
787#define __NR_shmctl (__NR_Linux + 30)
788#define __NR_dup (__NR_Linux + 31)
789#define __NR_dup2 (__NR_Linux + 32)
790#define __NR_pause (__NR_Linux + 33)
791#define __NR_nanosleep (__NR_Linux + 34)
792#define __NR_getitimer (__NR_Linux + 35)
793#define __NR_setitimer (__NR_Linux + 36)
794#define __NR_alarm (__NR_Linux + 37)
795#define __NR_getpid (__NR_Linux + 38)
796#define __NR_sendfile (__NR_Linux + 39)
797#define __NR_socket (__NR_Linux + 40)
798#define __NR_connect (__NR_Linux + 41)
799#define __NR_accept (__NR_Linux + 42)
800#define __NR_sendto (__NR_Linux + 43)
801#define __NR_recvfrom (__NR_Linux + 44)
802#define __NR_sendmsg (__NR_Linux + 45)
803#define __NR_recvmsg (__NR_Linux + 46)
804#define __NR_shutdown (__NR_Linux + 47)
805#define __NR_bind (__NR_Linux + 48)
806#define __NR_listen (__NR_Linux + 49)
807#define __NR_getsockname (__NR_Linux + 50)
808#define __NR_getpeername (__NR_Linux + 51)
809#define __NR_socketpair (__NR_Linux + 52)
810#define __NR_setsockopt (__NR_Linux + 53)
811#define __NR_getsockopt (__NR_Linux + 54)
812#define __NR_clone (__NR_Linux + 55)
813#define __NR_fork (__NR_Linux + 56)
814#define __NR_execve (__NR_Linux + 57)
815#define __NR_exit (__NR_Linux + 58)
816#define __NR_wait4 (__NR_Linux + 59)
817#define __NR_kill (__NR_Linux + 60)
818#define __NR_uname (__NR_Linux + 61)
819#define __NR_semget (__NR_Linux + 62)
820#define __NR_semop (__NR_Linux + 63)
821#define __NR_semctl (__NR_Linux + 64)
822#define __NR_shmdt (__NR_Linux + 65)
823#define __NR_msgget (__NR_Linux + 66)
824#define __NR_msgsnd (__NR_Linux + 67)
825#define __NR_msgrcv (__NR_Linux + 68)
826#define __NR_msgctl (__NR_Linux + 69)
827#define __NR_fcntl (__NR_Linux + 70)
828#define __NR_flock (__NR_Linux + 71)
829#define __NR_fsync (__NR_Linux + 72)
830#define __NR_fdatasync (__NR_Linux + 73)
831#define __NR_truncate (__NR_Linux + 74)
832#define __NR_ftruncate (__NR_Linux + 75)
833#define __NR_getdents (__NR_Linux + 76)
834#define __NR_getcwd (__NR_Linux + 77)
835#define __NR_chdir (__NR_Linux + 78)
836#define __NR_fchdir (__NR_Linux + 79)
837#define __NR_rename (__NR_Linux + 80)
838#define __NR_mkdir (__NR_Linux + 81)
839#define __NR_rmdir (__NR_Linux + 82)
840#define __NR_creat (__NR_Linux + 83)
841#define __NR_link (__NR_Linux + 84)
842#define __NR_unlink (__NR_Linux + 85)
843#define __NR_symlink (__NR_Linux + 86)
844#define __NR_readlink (__NR_Linux + 87)
845#define __NR_chmod (__NR_Linux + 88)
846#define __NR_fchmod (__NR_Linux + 89)
847#define __NR_chown (__NR_Linux + 90)
848#define __NR_fchown (__NR_Linux + 91)
849#define __NR_lchown (__NR_Linux + 92)
850#define __NR_umask (__NR_Linux + 93)
851#define __NR_gettimeofday (__NR_Linux + 94)
852#define __NR_getrlimit (__NR_Linux + 95)
853#define __NR_getrusage (__NR_Linux + 96)
854#define __NR_sysinfo (__NR_Linux + 97)
855#define __NR_times (__NR_Linux + 98)
856#define __NR_ptrace (__NR_Linux + 99)
857#define __NR_getuid (__NR_Linux + 100)
858#define __NR_syslog (__NR_Linux + 101)
859#define __NR_getgid (__NR_Linux + 102)
860#define __NR_setuid (__NR_Linux + 103)
861#define __NR_setgid (__NR_Linux + 104)
862#define __NR_geteuid (__NR_Linux + 105)
863#define __NR_getegid (__NR_Linux + 106)
864#define __NR_setpgid (__NR_Linux + 107)
865#define __NR_getppid (__NR_Linux + 108)
866#define __NR_getpgrp (__NR_Linux + 109)
867#define __NR_setsid (__NR_Linux + 110)
868#define __NR_setreuid (__NR_Linux + 111)
869#define __NR_setregid (__NR_Linux + 112)
870#define __NR_getgroups (__NR_Linux + 113)
871#define __NR_setgroups (__NR_Linux + 114)
872#define __NR_setresuid (__NR_Linux + 115)
873#define __NR_getresuid (__NR_Linux + 116)
874#define __NR_setresgid (__NR_Linux + 117)
875#define __NR_getresgid (__NR_Linux + 118)
876#define __NR_getpgid (__NR_Linux + 119)
877#define __NR_setfsuid (__NR_Linux + 120)
878#define __NR_setfsgid (__NR_Linux + 121)
879#define __NR_getsid (__NR_Linux + 122)
880#define __NR_capget (__NR_Linux + 123)
881#define __NR_capset (__NR_Linux + 124)
882#define __NR_rt_sigpending (__NR_Linux + 125)
883#define __NR_rt_sigtimedwait (__NR_Linux + 126)
884#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
885#define __NR_rt_sigsuspend (__NR_Linux + 128)
886#define __NR_sigaltstack (__NR_Linux + 129)
887#define __NR_utime (__NR_Linux + 130)
888#define __NR_mknod (__NR_Linux + 131)
889#define __NR_personality (__NR_Linux + 132)
890#define __NR_ustat (__NR_Linux + 133)
891#define __NR_statfs (__NR_Linux + 134)
892#define __NR_fstatfs (__NR_Linux + 135)
893#define __NR_sysfs (__NR_Linux + 136)
894#define __NR_getpriority (__NR_Linux + 137)
895#define __NR_setpriority (__NR_Linux + 138)
896#define __NR_sched_setparam (__NR_Linux + 139)
897#define __NR_sched_getparam (__NR_Linux + 140)
898#define __NR_sched_setscheduler (__NR_Linux + 141)
899#define __NR_sched_getscheduler (__NR_Linux + 142)
900#define __NR_sched_get_priority_max (__NR_Linux + 143)
901#define __NR_sched_get_priority_min (__NR_Linux + 144)
902#define __NR_sched_rr_get_interval (__NR_Linux + 145)
903#define __NR_mlock (__NR_Linux + 146)
904#define __NR_munlock (__NR_Linux + 147)
905#define __NR_mlockall (__NR_Linux + 148)
906#define __NR_munlockall (__NR_Linux + 149)
907#define __NR_vhangup (__NR_Linux + 150)
908#define __NR_pivot_root (__NR_Linux + 151)
909#define __NR__sysctl (__NR_Linux + 152)
910#define __NR_prctl (__NR_Linux + 153)
911#define __NR_adjtimex (__NR_Linux + 154)
912#define __NR_setrlimit (__NR_Linux + 155)
913#define __NR_chroot (__NR_Linux + 156)
914#define __NR_sync (__NR_Linux + 157)
915#define __NR_acct (__NR_Linux + 158)
916#define __NR_settimeofday (__NR_Linux + 159)
917#define __NR_mount (__NR_Linux + 160)
918#define __NR_umount2 (__NR_Linux + 161)
919#define __NR_swapon (__NR_Linux + 162)
920#define __NR_swapoff (__NR_Linux + 163)
921#define __NR_reboot (__NR_Linux + 164)
922#define __NR_sethostname (__NR_Linux + 165)
923#define __NR_setdomainname (__NR_Linux + 166)
924#define __NR_create_module (__NR_Linux + 167)
925#define __NR_init_module (__NR_Linux + 168)
926#define __NR_delete_module (__NR_Linux + 169)
927#define __NR_get_kernel_syms (__NR_Linux + 170)
928#define __NR_query_module (__NR_Linux + 171)
929#define __NR_quotactl (__NR_Linux + 172)
930#define __NR_nfsservctl (__NR_Linux + 173)
931#define __NR_getpmsg (__NR_Linux + 174)
932#define __NR_putpmsg (__NR_Linux + 175)
933#define __NR_afs_syscall (__NR_Linux + 176)
934#define __NR_reserved177 (__NR_Linux + 177)
935#define __NR_gettid (__NR_Linux + 178)
936#define __NR_readahead (__NR_Linux + 179)
937#define __NR_setxattr (__NR_Linux + 180)
938#define __NR_lsetxattr (__NR_Linux + 181)
939#define __NR_fsetxattr (__NR_Linux + 182)
940#define __NR_getxattr (__NR_Linux + 183)
941#define __NR_lgetxattr (__NR_Linux + 184)
942#define __NR_fgetxattr (__NR_Linux + 185)
943#define __NR_listxattr (__NR_Linux + 186)
944#define __NR_llistxattr (__NR_Linux + 187)
945#define __NR_flistxattr (__NR_Linux + 188)
946#define __NR_removexattr (__NR_Linux + 189)
947#define __NR_lremovexattr (__NR_Linux + 190)
948#define __NR_fremovexattr (__NR_Linux + 191)
949#define __NR_tkill (__NR_Linux + 192)
950#define __NR_reserved193 (__NR_Linux + 193)
951#define __NR_futex (__NR_Linux + 194)
952#define __NR_sched_setaffinity (__NR_Linux + 195)
953#define __NR_sched_getaffinity (__NR_Linux + 196)
954#define __NR_cacheflush (__NR_Linux + 197)
955#define __NR_cachectl (__NR_Linux + 198)
956#define __NR_sysmips (__NR_Linux + 199)
957#define __NR_io_setup (__NR_Linux + 200)
958#define __NR_io_destroy (__NR_Linux + 201)
959#define __NR_io_getevents (__NR_Linux + 202)
960#define __NR_io_submit (__NR_Linux + 203)
961#define __NR_io_cancel (__NR_Linux + 204)
962#define __NR_exit_group (__NR_Linux + 205)
963#define __NR_lookup_dcookie (__NR_Linux + 206)
964#define __NR_epoll_create (__NR_Linux + 207)
965#define __NR_epoll_ctl (__NR_Linux + 208)
966#define __NR_epoll_wait (__NR_Linux + 209)
967#define __NR_remap_file_pages (__NR_Linux + 210)
968#define __NR_rt_sigreturn (__NR_Linux + 211)
969#define __NR_fcntl64 (__NR_Linux + 212)
970#define __NR_set_tid_address (__NR_Linux + 213)
971#define __NR_restart_syscall (__NR_Linux + 214)
972#define __NR_semtimedop (__NR_Linux + 215)
973#define __NR_fadvise64 (__NR_Linux + 216)
974#define __NR_statfs64 (__NR_Linux + 217)
975#define __NR_fstatfs64 (__NR_Linux + 218)
976#define __NR_sendfile64 (__NR_Linux + 219)
977#define __NR_timer_create (__NR_Linux + 220)
978#define __NR_timer_settime (__NR_Linux + 221)
979#define __NR_timer_gettime (__NR_Linux + 222)
980#define __NR_timer_getoverrun (__NR_Linux + 223)
981#define __NR_timer_delete (__NR_Linux + 224)
982#define __NR_clock_settime (__NR_Linux + 225)
983#define __NR_clock_gettime (__NR_Linux + 226)
984#define __NR_clock_getres (__NR_Linux + 227)
985#define __NR_clock_nanosleep (__NR_Linux + 228)
986#define __NR_tgkill (__NR_Linux + 229)
987#define __NR_utimes (__NR_Linux + 230)
988#define __NR_mbind (__NR_Linux + 231)
989#define __NR_get_mempolicy (__NR_Linux + 232)
990#define __NR_set_mempolicy (__NR_Linux + 233)
991#define __NR_mq_open (__NR_Linux + 234)
992#define __NR_mq_unlink (__NR_Linux + 235)
993#define __NR_mq_timedsend (__NR_Linux + 236)
994#define __NR_mq_timedreceive (__NR_Linux + 237)
995#define __NR_mq_notify (__NR_Linux + 238)
996#define __NR_mq_getsetattr (__NR_Linux + 239)
997#define __NR_vserver (__NR_Linux + 240)
998#define __NR_waitid (__NR_Linux + 241)
999/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
1000#define __NR_add_key (__NR_Linux + 243)
1001#define __NR_request_key (__NR_Linux + 244)
1002#define __NR_keyctl (__NR_Linux + 245)
1003#define __NR_set_thread_area (__NR_Linux + 246)
1004#define __NR_inotify_init (__NR_Linux + 247)
1005#define __NR_inotify_add_watch (__NR_Linux + 248)
1006#define __NR_inotify_rm_watch (__NR_Linux + 249)
1007#define __NR_migrate_pages (__NR_Linux + 250)
1008#define __NR_openat (__NR_Linux + 251)
1009#define __NR_mkdirat (__NR_Linux + 252)
1010#define __NR_mknodat (__NR_Linux + 253)
1011#define __NR_fchownat (__NR_Linux + 254)
1012#define __NR_futimesat (__NR_Linux + 255)
1013#define __NR_newfstatat (__NR_Linux + 256)
1014#define __NR_unlinkat (__NR_Linux + 257)
1015#define __NR_renameat (__NR_Linux + 258)
1016#define __NR_linkat (__NR_Linux + 259)
1017#define __NR_symlinkat (__NR_Linux + 260)
1018#define __NR_readlinkat (__NR_Linux + 261)
1019#define __NR_fchmodat (__NR_Linux + 262)
1020#define __NR_faccessat (__NR_Linux + 263)
1021#define __NR_pselect6 (__NR_Linux + 264)
1022#define __NR_ppoll (__NR_Linux + 265)
1023#define __NR_unshare (__NR_Linux + 266)
1024#define __NR_splice (__NR_Linux + 267)
1025#define __NR_sync_file_range (__NR_Linux + 268)
1026#define __NR_tee (__NR_Linux + 269)
1027#define __NR_vmsplice (__NR_Linux + 270)
1028#define __NR_move_pages (__NR_Linux + 271)
1029#define __NR_set_robust_list (__NR_Linux + 272)
1030#define __NR_get_robust_list (__NR_Linux + 273)
1031#define __NR_kexec_load (__NR_Linux + 274)
1032#define __NR_getcpu (__NR_Linux + 275)
1033#define __NR_epoll_pwait (__NR_Linux + 276)
1034#define __NR_ioprio_set (__NR_Linux + 277)
1035#define __NR_ioprio_get (__NR_Linux + 278)
1036#define __NR_utimensat (__NR_Linux + 279)
1037#define __NR_signalfd (__NR_Linux + 280)
1038#define __NR_timerfd (__NR_Linux + 281)
1039#define __NR_eventfd (__NR_Linux + 282)
1040#define __NR_fallocate (__NR_Linux + 283)
1041#define __NR_timerfd_create (__NR_Linux + 284)
1042#define __NR_timerfd_gettime (__NR_Linux + 285)
1043#define __NR_timerfd_settime (__NR_Linux + 286)
1044#define __NR_signalfd4 (__NR_Linux + 287)
1045#define __NR_eventfd2 (__NR_Linux + 288)
1046#define __NR_epoll_create1 (__NR_Linux + 289)
1047#define __NR_dup3 (__NR_Linux + 290)
1048#define __NR_pipe2 (__NR_Linux + 291)
1049#define __NR_inotify_init1 (__NR_Linux + 292)
1050#define __NR_preadv (__NR_Linux + 293)
1051#define __NR_pwritev (__NR_Linux + 294)
1052#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1053#define __NR_perf_event_open (__NR_Linux + 296)
1054#define __NR_accept4 (__NR_Linux + 297)
1055#define __NR_recvmmsg (__NR_Linux + 298)
1056#define __NR_getdents64 (__NR_Linux + 299)
1057#define __NR_fanotify_init (__NR_Linux + 300)
1058#define __NR_fanotify_mark (__NR_Linux + 301)
1059#define __NR_prlimit64 (__NR_Linux + 302)
1060#define __NR_name_to_handle_at (__NR_Linux + 303)
1061#define __NR_open_by_handle_at (__NR_Linux + 304)
1062#define __NR_clock_adjtime (__NR_Linux + 305)
1063#define __NR_syncfs (__NR_Linux + 306)
1064#define __NR_sendmmsg (__NR_Linux + 307)
1065#define __NR_setns (__NR_Linux + 308)
1066#define __NR_process_vm_readv (__NR_Linux + 309)
1067#define __NR_process_vm_writev (__NR_Linux + 310)
1068#define __NR_kcmp (__NR_Linux + 311)
1069#define __NR_finit_module (__NR_Linux + 312)
1070#define __NR_sched_setattr (__NR_Linux + 313)
1071#define __NR_sched_getattr (__NR_Linux + 314)
1072#define __NR_renameat2 (__NR_Linux + 315)
1073#define __NR_seccomp (__NR_Linux + 316)
1074#define __NR_getrandom (__NR_Linux + 317)
1075#define __NR_memfd_create (__NR_Linux + 318)
1076#define __NR_bpf (__NR_Linux + 319)
1077#define __NR_execveat (__NR_Linux + 320)
1078#define __NR_userfaultfd (__NR_Linux + 321)
1079#define __NR_membarrier (__NR_Linux + 322)
1080#define __NR_mlock2 (__NR_Linux + 323)
1081#define __NR_copy_file_range (__NR_Linux + 324)
1082#define __NR_preadv2 (__NR_Linux + 325)
1083#define __NR_pwritev2 (__NR_Linux + 326)
1084#define __NR_pkey_mprotect (__NR_Linux + 327)
1085#define __NR_pkey_alloc (__NR_Linux + 328)
1086#define __NR_pkey_free (__NR_Linux + 329)
1087#define __NR_statx (__NR_Linux + 330)
1088#define __NR_rseq (__NR_Linux + 331)
1089#define __NR_io_pgetevents (__NR_Linux + 332)
1090
1091/*
1092 * Offset of the last N32 flavoured syscall
1093 */
1094#define __NR_Linux_syscalls 332
1095
1096#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1097
1098#define __NR_N32_Linux 6000
1099#define __NR_N32_Linux_syscalls 332
1100
1101#endif /* _ASM_UNISTD_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/auxvec.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 Imagination Technologies
4 * Author: Alex Smith <alex.smith@imgtec.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __ASM_AUXVEC_H
13#define __ASM_AUXVEC_H
14
15/* Location of VDSO image. */
16#define AT_SYSINFO_EHDR 33
17
18#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
19
20#endif /* __ASM_AUXVEC_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/bitsperlong.h deleted-9
...@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_MIPS_BITSPERLONG_H
3#define __ASM_MIPS_BITSPERLONG_H
4
5#define __BITS_PER_LONG _MIPS_SZLONG
6
7#include <asm-generic/bitsperlong.h>
8
9#endif /* __ASM_MIPS_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/byteorder.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_BYTEORDER_H
10#define _ASM_BYTEORDER_H
11
12#if defined(__MIPSEB__)
13#include <linux/byteorder/big_endian.h>
14#elif defined(__MIPSEL__)
15#include <linux/byteorder/little_endian.h>
16#else
17# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
18#endif
19
20#endif /* _ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/errno.h deleted-130
...@@ -1,130 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_ERRNO_H
10#define _ASM_ERRNO_H
11
12/*
13 * These error numbers are intended to be MIPS ABI compatible
14 */
15
16#include <asm-generic/errno-base.h>
17
18#define ENOMSG 35 /* No message of desired type */
19#define EIDRM 36 /* Identifier removed */
20#define ECHRNG 37 /* Channel number out of range */
21#define EL2NSYNC 38 /* Level 2 not synchronized */
22#define EL3HLT 39 /* Level 3 halted */
23#define EL3RST 40 /* Level 3 reset */
24#define ELNRNG 41 /* Link number out of range */
25#define EUNATCH 42 /* Protocol driver not attached */
26#define ENOCSI 43 /* No CSI structure available */
27#define EL2HLT 44 /* Level 2 halted */
28#define EDEADLK 45 /* Resource deadlock would occur */
29#define ENOLCK 46 /* No record locks available */
30#define EBADE 50 /* Invalid exchange */
31#define EBADR 51 /* Invalid request descriptor */
32#define EXFULL 52 /* Exchange full */
33#define ENOANO 53 /* No anode */
34#define EBADRQC 54 /* Invalid request code */
35#define EBADSLT 55 /* Invalid slot */
36#define EDEADLOCK 56 /* File locking deadlock error */
37#define EBFONT 59 /* Bad font file format */
38#define ENOSTR 60 /* Device not a stream */
39#define ENODATA 61 /* No data available */
40#define ETIME 62 /* Timer expired */
41#define ENOSR 63 /* Out of streams resources */
42#define ENONET 64 /* Machine is not on the network */
43#define ENOPKG 65 /* Package not installed */
44#define EREMOTE 66 /* Object is remote */
45#define ENOLINK 67 /* Link has been severed */
46#define EADV 68 /* Advertise error */
47#define ESRMNT 69 /* Srmount error */
48#define ECOMM 70 /* Communication error on send */
49#define EPROTO 71 /* Protocol error */
50#define EDOTDOT 73 /* RFS specific error */
51#define EMULTIHOP 74 /* Multihop attempted */
52#define EBADMSG 77 /* Not a data message */
53#define ENAMETOOLONG 78 /* File name too long */
54#define EOVERFLOW 79 /* Value too large for defined data type */
55#define ENOTUNIQ 80 /* Name not unique on network */
56#define EBADFD 81 /* File descriptor in bad state */
57#define EREMCHG 82 /* Remote address changed */
58#define ELIBACC 83 /* Can not access a needed shared library */
59#define ELIBBAD 84 /* Accessing a corrupted shared library */
60#define ELIBSCN 85 /* .lib section in a.out corrupted */
61#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
62#define ELIBEXEC 87 /* Cannot exec a shared library directly */
63#define EILSEQ 88 /* Illegal byte sequence */
64#define ENOSYS 89 /* Function not implemented */
65#define ELOOP 90 /* Too many symbolic links encountered */
66#define ERESTART 91 /* Interrupted system call should be restarted */
67#define ESTRPIPE 92 /* Streams pipe error */
68#define ENOTEMPTY 93 /* Directory not empty */
69#define EUSERS 94 /* Too many users */
70#define ENOTSOCK 95 /* Socket operation on non-socket */
71#define EDESTADDRREQ 96 /* Destination address required */
72#define EMSGSIZE 97 /* Message too long */
73#define EPROTOTYPE 98 /* Protocol wrong type for socket */
74#define ENOPROTOOPT 99 /* Protocol not available */
75#define EPROTONOSUPPORT 120 /* Protocol not supported */
76#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
77#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
78#define EPFNOSUPPORT 123 /* Protocol family not supported */
79#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
80#define EADDRINUSE 125 /* Address already in use */
81#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
82#define ENETDOWN 127 /* Network is down */
83#define ENETUNREACH 128 /* Network is unreachable */
84#define ENETRESET 129 /* Network dropped connection because of reset */
85#define ECONNABORTED 130 /* Software caused connection abort */
86#define ECONNRESET 131 /* Connection reset by peer */
87#define ENOBUFS 132 /* No buffer space available */
88#define EISCONN 133 /* Transport endpoint is already connected */
89#define ENOTCONN 134 /* Transport endpoint is not connected */
90#define EUCLEAN 135 /* Structure needs cleaning */
91#define ENOTNAM 137 /* Not a XENIX named type file */
92#define ENAVAIL 138 /* No XENIX semaphores available */
93#define EISNAM 139 /* Is a named type file */
94#define EREMOTEIO 140 /* Remote I/O error */
95#define EINIT 141 /* Reserved */
96#define EREMDEV 142 /* Error 142 */
97#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
98#define ETOOMANYREFS 144 /* Too many references: cannot splice */
99#define ETIMEDOUT 145 /* Connection timed out */
100#define ECONNREFUSED 146 /* Connection refused */
101#define EHOSTDOWN 147 /* Host is down */
102#define EHOSTUNREACH 148 /* No route to host */
103#define EWOULDBLOCK EAGAIN /* Operation would block */
104#define EALREADY 149 /* Operation already in progress */
105#define EINPROGRESS 150 /* Operation now in progress */
106#define ESTALE 151 /* Stale file handle */
107#define ECANCELED 158 /* AIO operation canceled */
108
109/*
110 * These error are Linux extensions.
111 */
112#define ENOMEDIUM 159 /* No medium found */
113#define EMEDIUMTYPE 160 /* Wrong medium type */
114#define ENOKEY 161 /* Required key not available */
115#define EKEYEXPIRED 162 /* Key has expired */
116#define EKEYREVOKED 163 /* Key has been revoked */
117#define EKEYREJECTED 164 /* Key was rejected by service */
118
119/* for robust mutexes */
120#define EOWNERDEAD 165 /* Owner died */
121#define ENOTRECOVERABLE 166 /* State not recoverable */
122
123#define ERFKILL 167 /* Operation not possible due to RF-kill */
124
125#define EHWPOISON 168 /* Memory page has hardware error */
126
127#define EDQUOT 1133 /* Quota exceeded */
128
129
130#endif /* _ASM_ERRNO_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/fcntl.h deleted-80
...@@ -1,80 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
8 */
9#ifndef _ASM_FCNTL_H
10#define _ASM_FCNTL_H
11
12#include <asm/sgidefs.h>
13
14#define O_APPEND 0x0008
15#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */
16#define O_NONBLOCK 0x0080
17#define O_CREAT 0x0100 /* not fcntl */
18#define O_TRUNC 0x0200 /* not fcntl */
19#define O_EXCL 0x0400 /* not fcntl */
20#define O_NOCTTY 0x0800 /* not fcntl */
21#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
22#define O_LARGEFILE 0x2000 /* allow large file opens */
23/*
24 * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
25 * the O_SYNC flag. We continue to use the existing numerical value
26 * for O_DSYNC semantics now, but using the correct symbolic name for it.
27 * This new value is used to request true Posix O_SYNC semantics. It is
28 * defined in this strange way to make sure applications compiled against
29 * new headers get at least O_DSYNC semantics on older kernels.
30 *
31 * This has the nice side-effect that we can simply test for O_DSYNC
32 * wherever we do not care if O_DSYNC or O_SYNC is used.
33 *
34 * Note: __O_SYNC must never be used directly.
35 */
36#define __O_SYNC 0x4000
37#define O_SYNC (__O_SYNC|O_DSYNC)
38#define O_DIRECT 0x8000 /* direct disk access hint */
39
40#define F_GETLK 14
41#define F_SETLK 6
42#define F_SETLKW 7
43
44#define F_SETOWN 24 /* for sockets. */
45#define F_GETOWN 23 /* for sockets. */
46
47#ifndef __mips64
48#define F_GETLK64 33 /* using 'struct flock64' */
49#define F_SETLK64 34
50#define F_SETLKW64 35
51#endif
52
53/*
54 * The flavours of struct flock. "struct flock" is the ABI compliant
55 * variant. Finally struct flock64 is the LFS variant of struct flock. As
56 * a historic accident and inconsistence with the ABI definition it doesn't
57 * contain all the same fields as struct flock.
58 */
59
60#if _MIPS_SIM != _MIPS_SIM_ABI64
61
62#include <linux/types.h>
63
64struct flock {
65 short l_type;
66 short l_whence;
67 __kernel_off_t l_start;
68 __kernel_off_t l_len;
69 long l_sysid;
70 __kernel_pid_t l_pid;
71 long pad[4];
72};
73
74#define HAVE_ARCH_STRUCT_FLOCK
75
76#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
77
78#include <asm-generic/fcntl.h>
79
80#endif /* _ASM_FCNTL_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/hwcap.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_HWCAP_H
3#define _ASM_HWCAP_H
4
5/* HWCAP flags */
6#define HWCAP_MIPS_R6 (1 << 0)
7#define HWCAP_MIPS_MSA (1 << 1)
8#define HWCAP_MIPS_CRC32 (1 << 2)
9
10#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/ioctl.h deleted-28
...@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle <ralf@linux-mips.org>
8 * Copyright (C) 2009 Wind River Systems
9 * Written by Ralf Baechle <ralf@linux-mips.org>
10 */
11#ifndef __ASM_IOCTL_H
12#define __ASM_IOCTL_H
13
14#define _IOC_SIZEBITS 13
15#define _IOC_DIRBITS 3
16
17/*
18 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
19 * And this turns out useful to catch old ioctl numbers in header
20 * files for us.
21 */
22#define _IOC_NONE 1U
23#define _IOC_READ 2U
24#define _IOC_WRITE 4U
25
26#include <asm-generic/ioctl.h>
27
28#endif /* __ASM_IOCTL_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/ioctls.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef __ASM_IOCTLS_H
11#define __ASM_IOCTLS_H
12
13#include <asm/ioctl.h>
14
15#define TCGETA 0x5401
16#define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
17#define TCSETAW 0x5403
18#define TCSETAF 0x5404
19
20#define TCSBRK 0x5405
21#define TCXONC 0x5406
22#define TCFLSH 0x5407
23
24#define TCGETS 0x540d
25#define TCSETS 0x540e
26#define TCSETSW 0x540f
27#define TCSETSF 0x5410
28
29#define TIOCEXCL 0x740d /* set exclusive use of tty */
30#define TIOCNXCL 0x740e /* reset exclusive use of tty */
31#define TIOCOUTQ 0x7472 /* output queue size */
32#define TIOCSTI 0x5472 /* simulate terminal input */
33#define TIOCMGET 0x741d /* get all modem bits */
34#define TIOCMBIS 0x741b /* bis modem bits */
35#define TIOCMBIC 0x741c /* bic modem bits */
36#define TIOCMSET 0x741a /* set all modem bits */
37#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
38#define TIOCPKT_DATA 0x00 /* data packet */
39#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
40#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
41#define TIOCPKT_STOP 0x04 /* stop output */
42#define TIOCPKT_START 0x08 /* start output */
43#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
44#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
45#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
46#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
47#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
48#define TIOCNOTTY 0x5471 /* void tty association */
49#define TIOCSETD 0x7401
50#define TIOCGETD 0x7400
51
52#define FIOCLEX 0x6601
53#define FIONCLEX 0x6602
54#define FIOASYNC 0x667d
55#define FIONBIO 0x667e
56#define FIOQSIZE 0x667f
57
58#define TIOCGLTC 0x7474 /* get special local chars */
59#define TIOCSLTC 0x7475 /* set special local chars */
60#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
61#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
62#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
63
64#define FIONREAD 0x467f
65#define TIOCINQ FIONREAD
66
67#define TIOCGETP 0x7408
68#define TIOCSETP 0x7409
69#define TIOCSETN 0x740a /* TIOCSETP wo flush */
70
71/* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */
72/* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */
73/* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */
74/* #define TIOCGETD _IOR('t', 26, int) get line discipline */
75/* #define TIOCSETD _IOW('t', 27, int) set line discipline */
76 /* 127-124 compat */
77
78#define TIOCSBRK 0x5427 /* BSD compatibility */
79#define TIOCCBRK 0x5428 /* BSD compatibility */
80#define TIOCGSID 0x7416 /* Return the session ID of FD */
81#define TCGETS2 _IOR('T', 0x2A, struct termios2)
82#define TCSETS2 _IOW('T', 0x2B, struct termios2)
83#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
84#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
85#define TIOCGRS485 _IOR('T', 0x2E, struct serial_rs485)
86#define TIOCSRS485 _IOWR('T', 0x2F, struct serial_rs485)
87#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
88#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
89#define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
90#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
91#define TIOCVHANGUP 0x5437
92#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
93#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
94#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
95#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
96
97/* I hope the range from 0x5480 on is free ... */
98#define TIOCSCTTY 0x5480 /* become controlling tty */
99#define TIOCGSOFTCAR 0x5481
100#define TIOCSSOFTCAR 0x5482
101#define TIOCLINUX 0x5483
102#define TIOCGSERIAL 0x5484
103#define TIOCSSERIAL 0x5485
104#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
105#define TIOCSERCONFIG 0x5488
106#define TIOCSERGWILD 0x5489
107#define TIOCSERSWILD 0x548a
108#define TIOCGLCKTRMIOS 0x548b
109#define TIOCSLCKTRMIOS 0x548c
110#define TIOCSERGSTRUCT 0x548d /* For debugging only */
111#define TIOCSERGETLSR 0x548e /* Get line status register */
112#define TIOCSERGETMULTI 0x548f /* Get multiport config */
113#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
114#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
115#define TIOCGICOUNT 0x5492 /* read serial port __inline__ interrupt counts */
116
117#endif /* __ASM_IOCTLS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/kvm.h deleted-227
...@@ -1,227 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
8 * Copyright (C) 2013 Cavium, Inc.
9 * Authors: Sanjay Lal <sanjayl@kymasys.com>
10 */
11
12#ifndef __LINUX_KVM_MIPS_H
13#define __LINUX_KVM_MIPS_H
14
15#include <linux/types.h>
16
17/*
18 * KVM MIPS specific structures and definitions.
19 *
20 * Some parts derived from the x86 version of this file.
21 */
22
23#define __KVM_HAVE_READONLY_MEM
24
25#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
26
27/*
28 * for KVM_GET_REGS and KVM_SET_REGS
29 *
30 * If Config[AT] is zero (32-bit CPU), the register contents are
31 * stored in the lower 32-bits of the struct kvm_regs fields and sign
32 * extended to 64-bits.
33 */
34struct kvm_regs {
35 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
36 __u64 gpr[32];
37 __u64 hi;
38 __u64 lo;
39 __u64 pc;
40};
41
42/*
43 * for KVM_GET_FPU and KVM_SET_FPU
44 */
45struct kvm_fpu {
46};
47
48
49/*
50 * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access various
51 * registers. The id field is broken down as follows:
52 *
53 * bits[63..52] - As per linux/kvm.h
54 * bits[51..32] - Must be zero.
55 * bits[31..16] - Register set.
56 *
57 * Register set = 0: GP registers from kvm_regs (see definitions below).
58 *
59 * Register set = 1: CP0 registers.
60 * bits[15..8] - COP0 register set.
61 *
62 * COP0 register set = 0: Main CP0 registers.
63 * bits[7..3] - Register 'rd' index.
64 * bits[2..0] - Register 'sel' index.
65 *
66 * COP0 register set = 1: MAARs.
67 * bits[7..0] - MAAR index.
68 *
69 * Register set = 2: KVM specific registers (see definitions below).
70 *
71 * Register set = 3: FPU / MSA registers (see definitions below).
72 *
73 * Other sets registers may be added in the future. Each set would
74 * have its own identifier in bits[31..16].
75 */
76
77#define KVM_REG_MIPS_GP (KVM_REG_MIPS | 0x0000000000000000ULL)
78#define KVM_REG_MIPS_CP0 (KVM_REG_MIPS | 0x0000000000010000ULL)
79#define KVM_REG_MIPS_KVM (KVM_REG_MIPS | 0x0000000000020000ULL)
80#define KVM_REG_MIPS_FPU (KVM_REG_MIPS | 0x0000000000030000ULL)
81
82
83/*
84 * KVM_REG_MIPS_GP - General purpose registers from kvm_regs.
85 */
86
87#define KVM_REG_MIPS_R0 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 0)
88#define KVM_REG_MIPS_R1 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 1)
89#define KVM_REG_MIPS_R2 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 2)
90#define KVM_REG_MIPS_R3 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 3)
91#define KVM_REG_MIPS_R4 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 4)
92#define KVM_REG_MIPS_R5 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 5)
93#define KVM_REG_MIPS_R6 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 6)
94#define KVM_REG_MIPS_R7 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 7)
95#define KVM_REG_MIPS_R8 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 8)
96#define KVM_REG_MIPS_R9 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 9)
97#define KVM_REG_MIPS_R10 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 10)
98#define KVM_REG_MIPS_R11 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 11)
99#define KVM_REG_MIPS_R12 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 12)
100#define KVM_REG_MIPS_R13 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 13)
101#define KVM_REG_MIPS_R14 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 14)
102#define KVM_REG_MIPS_R15 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 15)
103#define KVM_REG_MIPS_R16 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 16)
104#define KVM_REG_MIPS_R17 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 17)
105#define KVM_REG_MIPS_R18 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 18)
106#define KVM_REG_MIPS_R19 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 19)
107#define KVM_REG_MIPS_R20 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 20)
108#define KVM_REG_MIPS_R21 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 21)
109#define KVM_REG_MIPS_R22 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 22)
110#define KVM_REG_MIPS_R23 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 23)
111#define KVM_REG_MIPS_R24 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 24)
112#define KVM_REG_MIPS_R25 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 25)
113#define KVM_REG_MIPS_R26 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 26)
114#define KVM_REG_MIPS_R27 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 27)
115#define KVM_REG_MIPS_R28 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 28)
116#define KVM_REG_MIPS_R29 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 29)
117#define KVM_REG_MIPS_R30 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 30)
118#define KVM_REG_MIPS_R31 (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 31)
119
120#define KVM_REG_MIPS_HI (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 32)
121#define KVM_REG_MIPS_LO (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 33)
122#define KVM_REG_MIPS_PC (KVM_REG_MIPS_GP | KVM_REG_SIZE_U64 | 34)
123
124
125/*
126 * KVM_REG_MIPS_CP0 - Coprocessor 0 registers.
127 */
128
129#define KVM_REG_MIPS_MAAR (KVM_REG_MIPS_CP0 | (1 << 8))
130#define KVM_REG_MIPS_CP0_MAAR(n) (KVM_REG_MIPS_MAAR | \
131 KVM_REG_SIZE_U64 | (n))
132
133
134/*
135 * KVM_REG_MIPS_KVM - KVM specific control registers.
136 */
137
138/*
139 * CP0_Count control
140 * DC: Set 0: Master disable CP0_Count and set COUNT_RESUME to now
141 * Set 1: Master re-enable CP0_Count with unchanged bias, handling timer
142 * interrupts since COUNT_RESUME
143 * This can be used to freeze the timer to get a consistent snapshot of
144 * the CP0_Count and timer interrupt pending state, while also resuming
145 * safely without losing time or guest timer interrupts.
146 * Other: Reserved, do not change.
147 */
148#define KVM_REG_MIPS_COUNT_CTL (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 0)
149#define KVM_REG_MIPS_COUNT_CTL_DC 0x00000001
150
151/*
152 * CP0_Count resume monotonic nanoseconds
153 * The monotonic nanosecond time of the last set of COUNT_CTL.DC (master
154 * disable). Any reads and writes of Count related registers while
155 * COUNT_CTL.DC=1 will appear to occur at this time. When COUNT_CTL.DC is
156 * cleared again (master enable) any timer interrupts since this time will be
157 * emulated.
158 * Modifications to times in the future are rejected.
159 */
160#define KVM_REG_MIPS_COUNT_RESUME (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 1)
161/*
162 * CP0_Count rate in Hz
163 * Specifies the rate of the CP0_Count timer in Hz. Modifications occur without
164 * discontinuities in CP0_Count.
165 */
166#define KVM_REG_MIPS_COUNT_HZ (KVM_REG_MIPS_KVM | KVM_REG_SIZE_U64 | 2)
167
168
169/*
170 * KVM_REG_MIPS_FPU - Floating Point and MIPS SIMD Architecture (MSA) registers.
171 *
172 * bits[15..8] - Register subset (see definitions below).
173 * bits[7..5] - Must be zero.
174 * bits[4..0] - Register number within register subset.
175 */
176
177#define KVM_REG_MIPS_FPR (KVM_REG_MIPS_FPU | 0x0000000000000000ULL)
178#define KVM_REG_MIPS_FCR (KVM_REG_MIPS_FPU | 0x0000000000000100ULL)
179#define KVM_REG_MIPS_MSACR (KVM_REG_MIPS_FPU | 0x0000000000000200ULL)
180
181/*
182 * KVM_REG_MIPS_FPR - Floating point / Vector registers.
183 */
184#define KVM_REG_MIPS_FPR_32(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U32 | (n))
185#define KVM_REG_MIPS_FPR_64(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U64 | (n))
186#define KVM_REG_MIPS_VEC_128(n) (KVM_REG_MIPS_FPR | KVM_REG_SIZE_U128 | (n))
187
188/*
189 * KVM_REG_MIPS_FCR - Floating point control registers.
190 */
191#define KVM_REG_MIPS_FCR_IR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 0)
192#define KVM_REG_MIPS_FCR_CSR (KVM_REG_MIPS_FCR | KVM_REG_SIZE_U32 | 31)
193
194/*
195 * KVM_REG_MIPS_MSACR - MIPS SIMD Architecture (MSA) control registers.
196 */
197#define KVM_REG_MIPS_MSA_IR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 0)
198#define KVM_REG_MIPS_MSA_CSR (KVM_REG_MIPS_MSACR | KVM_REG_SIZE_U32 | 1)
199
200
201/*
202 * KVM MIPS specific structures and definitions
203 *
204 */
205struct kvm_debug_exit_arch {
206 __u64 epc;
207};
208
209/* for KVM_SET_GUEST_DEBUG */
210struct kvm_guest_debug_arch {
211};
212
213/* definition of registers in kvm_run */
214struct kvm_sync_regs {
215};
216
217/* dummy definition */
218struct kvm_sregs {
219};
220
221struct kvm_mips_interrupt {
222 /* in */
223 __u32 cpu;
224 __u32 irq;
225};
226
227#endif /* __LINUX_KVM_MIPS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/kvm_para.h deleted-5
...@@ -1,5 +0,0 @@
1#ifndef _ASM_MIPS_KVM_PARA_H
2#define _ASM_MIPS_KVM_PARA_H
3
4
5#endif /* _ASM_MIPS_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/mman.h deleted-108
...@@ -1,108 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2002 by Ralf Baechle
8 */
9#ifndef _ASM_MMAN_H
10#define _ASM_MMAN_H
11
12/*
13 * Protections are chosen from these bits, OR'd together. The
14 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
15 * without PROT_READ. The only guarantees are that no writing will be
16 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
17 */
18#define PROT_NONE 0x00 /* page can not be accessed */
19#define PROT_READ 0x01 /* page can be read */
20#define PROT_WRITE 0x02 /* page can be written */
21#define PROT_EXEC 0x04 /* page can be executed */
22/* 0x08 reserved for PROT_EXEC_NOFLUSH */
23#define PROT_SEM 0x10 /* page may be used for atomic ops */
24#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
25#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
26
27/*
28 * Flags for mmap
29 */
30#define MAP_SHARED 0x001 /* Share changes */
31#define MAP_PRIVATE 0x002 /* Changes are private */
32#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
33#define MAP_TYPE 0x00f /* Mask for type of mapping */
34#define MAP_FIXED 0x010 /* Interpret addr exactly */
35
36/* not used by linux, but here to make sure we don't clash with ABI defines */
37#define MAP_RENAME 0x020 /* Assign page to file */
38#define MAP_AUTOGROW 0x040 /* File may grow by writing */
39#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
40#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
41
42/* These are linux-specific */
43#define MAP_NORESERVE 0x0400 /* don't check for reservations */
44#define MAP_ANONYMOUS 0x0800 /* don't use a file */
45#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
46#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
47#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
48#define MAP_LOCKED 0x8000 /* pages are locked */
49#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
50#define MAP_NONBLOCK 0x20000 /* do not block on IO */
51#define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */
52#define MAP_HUGETLB 0x80000 /* create a huge page mapping */
53#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
54
55/*
56 * Flags for msync
57 */
58#define MS_ASYNC 0x0001 /* sync memory asynchronously */
59#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
60#define MS_SYNC 0x0004 /* synchronous memory sync */
61
62/*
63 * Flags for mlockall
64 */
65#define MCL_CURRENT 1 /* lock all current mappings */
66#define MCL_FUTURE 2 /* lock all future mappings */
67#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
68
69/*
70 * Flags for mlock
71 */
72#define MLOCK_ONFAULT 0x01 /* Lock pages in range after they are faulted in, do not prefault */
73
74#define MADV_NORMAL 0 /* no further special treatment */
75#define MADV_RANDOM 1 /* expect random page references */
76#define MADV_SEQUENTIAL 2 /* expect sequential page references */
77#define MADV_WILLNEED 3 /* will need these pages */
78#define MADV_DONTNEED 4 /* don't need these pages */
79
80/* common parameters: try to keep these consistent across architectures */
81#define MADV_FREE 8 /* free pages only if memory pressure */
82#define MADV_REMOVE 9 /* remove these pages & resources */
83#define MADV_DONTFORK 10 /* don't inherit across fork */
84#define MADV_DOFORK 11 /* do inherit across fork */
85
86#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
87#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
88#define MADV_HWPOISON 100 /* poison a page for testing */
89
90#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
91#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
92
93#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
94 overrides the coredump filter bits */
95#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
96
97#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
98#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
99
100/* compatibility flags */
101#define MAP_FILE 0
102
103#define PKEY_DISABLE_ACCESS 0x1
104#define PKEY_DISABLE_WRITE 0x2
105#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
106 PKEY_DISABLE_WRITE)
107
108#endif /* _ASM_MMAN_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/msgbuf.h deleted-67
...@@ -1,67 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_MSGBUF_H
3#define _ASM_MSGBUF_H
4
5
6/*
7 * The msqid64_ds structure for the MIPS architecture.
8 * Note extra padding because this structure is passed back and forth
9 * between kernel and user space.
10 *
11 * Pad space is left for:
12 * - 2 miscellaneous unsigned long values
13 */
14
15#if defined(__mips64)
16struct msqid64_ds {
17 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long msg_cbytes; /* current number of bytes on queue */
22 unsigned long msg_qnum; /* number of messages in queue */
23 unsigned long msg_qbytes; /* max number of bytes on queue */
24 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25 __kernel_pid_t msg_lrpid; /* last receive pid */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29#elif defined (__MIPSEB__)
30struct msqid64_ds {
31 struct ipc64_perm msg_perm;
32 unsigned long msg_stime_high;
33 unsigned long msg_stime; /* last msgsnd time */
34 unsigned long msg_rtime_high;
35 unsigned long msg_rtime; /* last msgrcv time */
36 unsigned long msg_ctime_high;
37 unsigned long msg_ctime; /* last change time */
38 unsigned long msg_cbytes; /* current number of bytes on queue */
39 unsigned long msg_qnum; /* number of messages in queue */
40 unsigned long msg_qbytes; /* max number of bytes on queue */
41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
42 __kernel_pid_t msg_lrpid; /* last receive pid */
43 unsigned long __unused4;
44 unsigned long __unused5;
45};
46#elif defined (__MIPSEL__)
47struct msqid64_ds {
48 struct ipc64_perm msg_perm;
49 unsigned long msg_stime; /* last msgsnd time */
50 unsigned long msg_stime_high;
51 unsigned long msg_rtime; /* last msgrcv time */
52 unsigned long msg_rtime_high;
53 unsigned long msg_ctime; /* last change time */
54 unsigned long msg_ctime_high;
55 unsigned long msg_cbytes; /* current number of bytes on queue */
56 unsigned long msg_qnum; /* number of messages in queue */
57 unsigned long msg_qbytes; /* max number of bytes on queue */
58 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
59 __kernel_pid_t msg_lrpid; /* last receive pid */
60 unsigned long __unused4;
61 unsigned long __unused5;
62};
63#else
64#warning no endianess set
65#endif
66
67#endif /* _ASM_MSGBUF_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/param.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org)
8 * Copyright 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PARAM_H
11#define _ASM_PARAM_H
12
13#define EXEC_PAGESIZE 65536
14
15#include <asm-generic/param.h>
16
17#endif /* _ASM_PARAM_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/poll.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POLL_H
3#define __ASM_POLL_H
4
5#define POLLWRNORM POLLOUT
6#define POLLWRBAND 0x0100
7
8#include <asm-generic/poll.h>
9
10#endif /* __ASM_POLL_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/posix_types.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_POSIX_TYPES_H
11#define _ASM_POSIX_TYPES_H
12
13#include <asm/sgidefs.h>
14
15/*
16 * This file is generally used by user-level software, so you need to
17 * be a little careful about namespace pollution etc. Also, we cannot
18 * assume GCC is being used.
19 */
20
21typedef long __kernel_daddr_t;
22#define __kernel_daddr_t __kernel_daddr_t
23
24#if (_MIPS_SZLONG == 32)
25typedef struct {
26 long val[2];
27} __kernel_fsid_t;
28#define __kernel_fsid_t __kernel_fsid_t
29#endif
30
31#include <asm-generic/posix_types.h>
32
33#endif /* _ASM_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/ptrace.h deleted-105
...@@ -1,105 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_PTRACE_H
11#define _ASM_PTRACE_H
12
13#include <linux/types.h>
14
15/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
16#define FPR_BASE 32
17#define PC 64
18#define CAUSE 65
19#define BADVADDR 66
20#define MMHI 67
21#define MMLO 68
22#define FPC_CSR 69
23#define FPC_EIR 70
24#define DSP_BASE 71 /* 3 more hi / lo register pairs */
25#define DSP_CONTROL 77
26#define ACX 78
27
28/*
29 * This struct defines the registers as used by PTRACE_{GET,SET}REGS. The
30 * format is the same for both 32- and 64-bit processes. Registers for 32-bit
31 * processes are sign extended.
32 */
33struct pt_regs {
34 /* Saved main processor registers. */
35 __u64 regs[32];
36
37 /* Saved special registers. */
38 __u64 lo;
39 __u64 hi;
40 __u64 cp0_epc;
41 __u64 cp0_badvaddr;
42 __u64 cp0_status;
43 __u64 cp0_cause;
44} __attribute__ ((aligned (8)));
45
46/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
47#define PTRACE_GETREGS 12
48#define PTRACE_SETREGS 13
49#define PTRACE_GETFPREGS 14
50#define PTRACE_SETFPREGS 15
51/* #define PTRACE_GETFPXREGS 18 */
52/* #define PTRACE_SETFPXREGS 19 */
53
54#define PTRACE_OLDSETOPTIONS 21
55
56#define PTRACE_GET_THREAD_AREA 25
57#define PTRACE_SET_THREAD_AREA 26
58
59/* Calls to trace a 64bit program from a 32bit program. */
60#define PTRACE_PEEKTEXT_3264 0xc0
61#define PTRACE_PEEKDATA_3264 0xc1
62#define PTRACE_POKETEXT_3264 0xc2
63#define PTRACE_POKEDATA_3264 0xc3
64#define PTRACE_GET_THREAD_AREA_3264 0xc4
65
66/* Read and write watchpoint registers. */
67enum pt_watch_style {
68 pt_watch_style_mips32,
69 pt_watch_style_mips64
70};
71struct mips32_watch_regs {
72 unsigned int watchlo[8];
73 /* Lower 16 bits of watchhi. */
74 unsigned short watchhi[8];
75 /* Valid mask and I R W bits.
76 * bit 0 -- 1 if W bit is usable.
77 * bit 1 -- 1 if R bit is usable.
78 * bit 2 -- 1 if I bit is usable.
79 * bits 3 - 11 -- Valid watchhi mask bits.
80 */
81 unsigned short watch_masks[8];
82 /* The number of valid watch register pairs. */
83 unsigned int num_valid;
84} __attribute__((aligned(8)));
85
86struct mips64_watch_regs {
87 unsigned long long watchlo[8];
88 unsigned short watchhi[8];
89 unsigned short watch_masks[8];
90 unsigned int num_valid;
91} __attribute__((aligned(8)));
92
93struct pt_watch_regs {
94 enum pt_watch_style style;
95 union {
96 struct mips32_watch_regs mips32;
97 struct mips64_watch_regs mips64;
98 };
99};
100
101#define PTRACE_GET_WATCH_REGS 0xd0
102#define PTRACE_SET_WATCH_REGS 0xd1
103
104
105#endif /* _ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/resource.h deleted-36
...@@ -1,36 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_RESOURCE_H
11#define _ASM_RESOURCE_H
12
13
14/*
15 * These five resource limit IDs have a MIPS/Linux-specific ordering,
16 * the rest comes from the generic header:
17 */
18#define RLIMIT_NOFILE 5 /* max number of open files */
19#define RLIMIT_AS 6 /* address space limit */
20#define RLIMIT_RSS 7 /* max resident set size */
21#define RLIMIT_NPROC 8 /* max number of processes */
22#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
23
24/*
25 * SuS says limits have to be unsigned.
26 * Which makes a ton more sense anyway,
27 * but we keep the old value on MIPS32,
28 * for compatibility:
29 */
30#ifndef __mips64
31# define RLIM_INFINITY 0x7fffffffUL
32#endif
33
34#include <asm-generic/resource.h>
35
36#endif /* _ASM_RESOURCE_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/sembuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SEMBUF_H
3#define _ASM_SEMBUF_H
4
5/*
6 * The semid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for 2 miscellaneous 64-bit values on mips64,
11 * but used for the upper 32 bit of the time values on mips32.
12 */
13
14#ifdef __mips64
15struct semid64_ds {
16 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
17 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long sem_nsems; /* no. of semaphores in array */
20 unsigned long __unused1;
21 unsigned long __unused2;
22};
23#else
24struct semid64_ds {
25 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
26 unsigned long sem_otime; /* last semop time */
27 unsigned long sem_ctime; /* last change time */
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long sem_otime_high;
30 unsigned long sem_ctime_high;
31};
32#endif
33
34#endif /* _ASM_SEMBUF_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/setup.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _MIPS_SETUP_H
3#define _MIPS_SETUP_H
4
5#define COMMAND_LINE_SIZE 4096
6
7
8#endif /* _MIPS_SETUP_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/shmbuf.h deleted-58
...@@ -1,58 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SHMBUF_H
3#define _ASM_SHMBUF_H
4
5/*
6 * The shmid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * As MIPS was lacking proper padding after shm_?time, we use 48 bits
11 * of the padding at the end to store a few additional bits of the time.
12 * libc implementations need to take care to convert this into a proper
13 * data structure when moving to 64-bit time_t.
14 */
15
16#ifdef __mips64
17struct shmid64_ds {
18 struct ipc64_perm shm_perm; /* operation perms */
19 size_t shm_segsz; /* size of segment (bytes) */
20 __kernel_time_t shm_atime; /* last attach time */
21 __kernel_time_t shm_dtime; /* last detach time */
22 __kernel_time_t shm_ctime; /* last change time */
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused1;
27 unsigned long __unused2;
28};
29#else
30struct shmid64_ds {
31 struct ipc64_perm shm_perm; /* operation perms */
32 size_t shm_segsz; /* size of segment (bytes) */
33 unsigned long shm_atime; /* last attach time */
34 unsigned long shm_dtime; /* last detach time */
35 unsigned long shm_ctime; /* last change time */
36 __kernel_pid_t shm_cpid; /* pid of creator */
37 __kernel_pid_t shm_lpid; /* pid of last operator */
38 unsigned long shm_nattch; /* no. of current attaches */
39 unsigned short shm_atime_high;
40 unsigned short shm_dtime_high;
41 unsigned short shm_ctime_high;
42 unsigned short __unused1;
43};
44#endif
45
46struct shminfo64 {
47 unsigned long shmmax;
48 unsigned long shmmin;
49 unsigned long shmmni;
50 unsigned long shmseg;
51 unsigned long shmall;
52 unsigned long __unused1;
53 unsigned long __unused2;
54 unsigned long __unused3;
55 unsigned long __unused4;
56};
57
58#endif /* _ASM_SHMBUF_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/sigcontext.h deleted-91
...@@ -1,91 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGCONTEXT_H
11#define _ASM_SIGCONTEXT_H
12
13#include <linux/types.h>
14#include <asm/sgidefs.h>
15
16/* scalar FP context was used */
17#define USED_FP (1 << 0)
18
19/* the value of Status.FR when context was saved */
20#define USED_FR1 (1 << 1)
21
22/* FR=1, but with odd singles in bits 63:32 of preceding even double */
23#define USED_HYBRID_FPRS (1 << 2)
24
25/* extended context was used, see struct extcontext for details */
26#define USED_EXTCONTEXT (1 << 3)
27
28#if _MIPS_SIM == _MIPS_SIM_ABI32
29
30/*
31 * Keep this struct definition in sync with the sigcontext fragment
32 * in arch/mips/kernel/asm-offsets.c
33 */
34struct sigcontext {
35 unsigned int sc_regmask; /* Unused */
36 unsigned int sc_status; /* Unused */
37 unsigned long long sc_pc;
38 unsigned long long sc_regs[32];
39 unsigned long long sc_fpregs[32];
40 unsigned int sc_acx; /* Was sc_ownedfp */
41 unsigned int sc_fpc_csr;
42 unsigned int sc_fpc_eir; /* Unused */
43 unsigned int sc_used_math;
44 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
45 unsigned long long sc_mdhi;
46 unsigned long long sc_mdlo;
47 unsigned long sc_hi1; /* Was sc_cause */
48 unsigned long sc_lo1; /* Was sc_badvaddr */
49 unsigned long sc_hi2; /* Was sc_sigset[4] */
50 unsigned long sc_lo2;
51 unsigned long sc_hi3;
52 unsigned long sc_lo3;
53};
54
55#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
56
57#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
58
59#include <linux/posix_types.h>
60/*
61 * Keep this struct definition in sync with the sigcontext fragment
62 * in arch/mips/kernel/asm-offsets.c
63 *
64 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
65 * int so it was changed to unsigned long in 2.6.0-test1. This may break
66 * binary compatibility - no prisoners.
67 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
68 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
69 */
70struct sigcontext {
71 __u64 sc_regs[32];
72 __u64 sc_fpregs[32];
73 __u64 sc_mdhi;
74 __u64 sc_hi1;
75 __u64 sc_hi2;
76 __u64 sc_hi3;
77 __u64 sc_mdlo;
78 __u64 sc_lo1;
79 __u64 sc_lo2;
80 __u64 sc_lo3;
81 __u64 sc_pc;
82 __u32 sc_fpc_csr;
83 __u32 sc_used_math;
84 __u32 sc_dsp;
85 __u32 sc_reserved;
86};
87
88
89#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
90
91#endif /* _ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/siginfo.h deleted-43
...@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGINFO_H
11#define _ASM_SIGINFO_H
12
13
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
16
17/*
18 * Careful to keep union _sifields from shifting ...
19 */
20#if _MIPS_SZLONG == 32
21#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
22#elif _MIPS_SZLONG == 64
23#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
24#else
25#error _MIPS_SZLONG neither 32 nor 64
26#endif
27
28#define __ARCH_HAS_SWAPPED_SIGINFO
29
30#include <asm-generic/siginfo.h>
31
32/*
33 * si_code values
34 * Again these have been chosen to be IRIX compatible.
35 */
36#undef SI_ASYNCIO
37#undef SI_TIMER
38#undef SI_MESGQ
39#define SI_ASYNCIO -2 /* sent by AIO completion */
40#define SI_TIMER -3 /* sent by timer expiration */
41#define SI_MESGQ -4 /* sent by real time mesq state change */
42
43#endif /* _ASM_SIGINFO_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/signal.h deleted-118
...@@ -1,118 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SIGNAL_H
11#define _ASM_SIGNAL_H
12
13#include <linux/types.h>
14
15#define _NSIG 128
16#define _NSIG_BPW (sizeof(unsigned long) * 8)
17#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23typedef unsigned long old_sigset_t; /* at least 32 bits */
24
25#define SIGHUP 1 /* Hangup (POSIX). */
26#define SIGINT 2 /* Interrupt (ANSI). */
27#define SIGQUIT 3 /* Quit (POSIX). */
28#define SIGILL 4 /* Illegal instruction (ANSI). */
29#define SIGTRAP 5 /* Trace trap (POSIX). */
30#define SIGIOT 6 /* IOT trap (4.2 BSD). */
31#define SIGABRT SIGIOT /* Abort (ANSI). */
32#define SIGEMT 7
33#define SIGFPE 8 /* Floating-point exception (ANSI). */
34#define SIGKILL 9 /* Kill, unblockable (POSIX). */
35#define SIGBUS 10 /* BUS error (4.2 BSD). */
36#define SIGSEGV 11 /* Segmentation violation (ANSI). */
37#define SIGSYS 12
38#define SIGPIPE 13 /* Broken pipe (POSIX). */
39#define SIGALRM 14 /* Alarm clock (POSIX). */
40#define SIGTERM 15 /* Termination (ANSI). */
41#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
42#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
43#define SIGCHLD 18 /* Child status has changed (POSIX). */
44#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
45#define SIGPWR 19 /* Power failure restart (System V). */
46#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
47#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
48#define SIGIO 22 /* I/O now possible (4.2 BSD). */
49#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
50#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
51#define SIGTSTP 24 /* Keyboard stop (POSIX). */
52#define SIGCONT 25 /* Continue (POSIX). */
53#define SIGTTIN 26 /* Background read from tty (POSIX). */
54#define SIGTTOU 27 /* Background write to tty (POSIX). */
55#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
56#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
57#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
58#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
59
60/* These should not be considered constants from userland. */
61#define SIGRTMIN 32
62#define SIGRTMAX _NSIG
63
64/*
65 * SA_FLAGS values:
66 *
67 * SA_ONSTACK indicates that a registered stack_t will be used.
68 * SA_RESTART flag to get restarting signals (which were the default long ago)
69 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
70 * SA_RESETHAND clears the handler when the signal is delivered.
71 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
72 * SA_NODEFER prevents the current signal from being masked in the handler.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 *
77 * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
78 * supported its use and no libc was using it, so the entire sa-restorer
79 * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
80 * retaining only the SA_RESTORER definition as a reminder to avoid
81 * accidental reuse of the mask bit.
82 */
83#define SA_ONSTACK 0x08000000
84#define SA_RESETHAND 0x80000000
85#define SA_RESTART 0x10000000
86#define SA_SIGINFO 0x00000008
87#define SA_NODEFER 0x40000000
88#define SA_NOCLDWAIT 0x00010000
89#define SA_NOCLDSTOP 0x00000001
90
91#define SA_NOMASK SA_NODEFER
92#define SA_ONESHOT SA_RESETHAND
93
94#define MINSIGSTKSZ 2048
95#define SIGSTKSZ 8192
96
97
98#define SIG_BLOCK 1 /* for blocking signals */
99#define SIG_UNBLOCK 2 /* for unblocking signals */
100#define SIG_SETMASK 3 /* for setting the signal mask */
101
102#include <asm-generic/signal-defs.h>
103
104struct sigaction {
105 unsigned int sa_flags;
106 __sighandler_t sa_handler;
107 sigset_t sa_mask;
108};
109
110/* IRIX compatible stack_t */
111typedef struct sigaltstack {
112 void *ss_sp;
113 size_t ss_size;
114 int ss_flags;
115} stack_t;
116
117
118#endif /* _ASM_SIGNAL_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/socket.h deleted-129
...@@ -1,129 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_SOCKET_H
11#define _ASM_SOCKET_H
12
13#include <asm/sockios.h>
14
15/*
16 * For setsockopt(2)
17 *
18 * This defines are ABI conformant as far as Linux supports these ...
19 */
20#define SOL_SOCKET 0xffff
21
22#define SO_DEBUG 0x0001 /* Record debugging information. */
23#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
24#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
25 SIGPIPE when they die. */
26#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
27#define SO_BROADCAST 0x0020 /* Allow transmission of
28 broadcast messages. */
29#define SO_LINGER 0x0080 /* Block on close of a reliable
30 socket to transmit pending data. */
31#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
32#define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33
34#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
35#define SO_STYLE SO_TYPE /* Synonym */
36#define SO_ERROR 0x1007 /* get error status and clear */
37#define SO_SNDBUF 0x1001 /* Send buffer size. */
38#define SO_RCVBUF 0x1002 /* Receive buffer. */
39#define SO_SNDLOWAT 0x1003 /* send low-water mark */
40#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
41#define SO_SNDTIMEO 0x1005 /* send timeout */
42#define SO_RCVTIMEO 0x1006 /* receive timeout */
43#define SO_ACCEPTCONN 0x1009
44#define SO_PROTOCOL 0x1028 /* protocol type */
45#define SO_DOMAIN 0x1029 /* domain/socket family */
46
47/* linux-specific, might as well be the same as on i386 */
48#define SO_NO_CHECK 11
49#define SO_PRIORITY 12
50#define SO_BSDCOMPAT 14
51
52#define SO_PASSCRED 17
53#define SO_PEERCRED 18
54
55/* Security levels - as per NRL IPv6 - don't actually do anything */
56#define SO_SECURITY_AUTHENTICATION 22
57#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
58#define SO_SECURITY_ENCRYPTION_NETWORK 24
59
60#define SO_BINDTODEVICE 25
61
62/* Socket filtering */
63#define SO_ATTACH_FILTER 26
64#define SO_DETACH_FILTER 27
65#define SO_GET_FILTER SO_ATTACH_FILTER
66
67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70
71#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77
78#define SO_MARK 36
79
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40
84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87#define SO_PEEK_OFF 42
88
89/* Instruct lower device to use last 4-bytes of skb data as FCS */
90#define SO_NOFCS 43
91
92#define SO_LOCK_FILTER 44
93
94#define SO_SELECT_ERR_QUEUE 45
95
96#define SO_BUSY_POLL 46
97
98#define SO_MAX_PACING_RATE 47
99
100#define SO_BPF_EXTENSIONS 48
101
102#define SO_INCOMING_CPU 49
103
104#define SO_ATTACH_BPF 50
105#define SO_DETACH_BPF SO_DETACH_FILTER
106
107#define SO_ATTACH_REUSEPORT_CBPF 51
108#define SO_ATTACH_REUSEPORT_EBPF 52
109
110#define SO_CNX_ADVICE 53
111
112#define SCM_TIMESTAMPING_OPT_STATS 54
113
114#define SO_MEMINFO 55
115
116#define SO_INCOMING_NAPI_ID 56
117
118#define SO_COOKIE 57
119
120#define SCM_TIMESTAMPING_PKTINFO 58
121
122#define SO_PEERGROUPS 59
123
124#define SO_ZEROCOPY 60
125
126#define SO_TXTIME 61
127#define SCM_TXTIME SO_TXTIME
128
129#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/sockios.h deleted-27
...@@ -1,27 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Socket-level I/O control calls.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995 by Ralf Baechle
10 */
11#ifndef _ASM_SOCKIOS_H
12#define _ASM_SOCKIOS_H
13
14#include <asm/ioctl.h>
15
16/* Socket-level I/O control calls. */
17#define FIOGETOWN _IOR('f', 123, int)
18#define FIOSETOWN _IOW('f', 124, int)
19
20#define SIOCATMARK _IOR('s', 7, int)
21#define SIOCSPGRP _IOW('s', 8, pid_t)
22#define SIOCGPGRP _IOR('s', 9, pid_t)
23
24#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
25#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
26
27#endif /* _ASM_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/stat.h deleted-133
...@@ -1,133 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2000 Ralf Baechle
8 * Copyright (C) 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_STAT_H
11#define _ASM_STAT_H
12
13#include <linux/types.h>
14
15#include <asm/sgidefs.h>
16
17#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
18
19struct stat {
20 unsigned st_dev;
21 long st_pad1[3]; /* Reserved for network id */
22 ino_t st_ino;
23 mode_t st_mode;
24 __u32 st_nlink;
25 uid_t st_uid;
26 gid_t st_gid;
27 unsigned st_rdev;
28 long st_pad2[2];
29 off_t st_size;
30 long st_pad3;
31 /*
32 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
33 * but we don't have it under Linux.
34 */
35 time_t st_atime;
36 long st_atime_nsec;
37 time_t st_mtime;
38 long st_mtime_nsec;
39 time_t st_ctime;
40 long st_ctime_nsec;
41 long st_blksize;
42 long st_blocks;
43 long st_pad4[14];
44};
45
46/*
47 * This matches struct stat64 in glibc2.1, hence the absolutely insane
48 * amounts of padding around dev_t's. The memory layout is the same as of
49 * struct stat of the 64-bit kernel.
50 */
51
52struct stat64 {
53 unsigned long st_dev;
54 unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
55
56 unsigned long long st_ino;
57
58 mode_t st_mode;
59 __u32 st_nlink;
60
61 uid_t st_uid;
62 gid_t st_gid;
63
64 unsigned long st_rdev;
65 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
66
67 long long st_size;
68
69 /*
70 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
71 * but we don't have it under Linux.
72 */
73 time_t st_atime;
74 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
75
76 time_t st_mtime;
77 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
78
79 time_t st_ctime;
80 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
81
82 unsigned long st_blksize;
83 unsigned long st_pad2;
84
85 long long st_blocks;
86};
87
88#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
89
90#if _MIPS_SIM == _MIPS_SIM_ABI64
91
92/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
93struct stat {
94 unsigned int st_dev;
95 unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
96
97 unsigned long st_ino;
98
99 mode_t st_mode;
100 __u32 st_nlink;
101
102 uid_t st_uid;
103 gid_t st_gid;
104
105 unsigned int st_rdev;
106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
107
108 off_t st_size;
109
110 /*
111 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
112 * but we don't have it under Linux.
113 */
114 unsigned int st_atime;
115 unsigned int st_atime_nsec;
116
117 unsigned int st_mtime;
118 unsigned int st_mtime_nsec;
119
120 unsigned int st_ctime;
121 unsigned int st_ctime_nsec;
122
123 unsigned int st_blksize;
124 unsigned int st_pad2;
125
126 unsigned long st_blocks;
127};
128
129#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
130
131#define STAT_HAVE_NSEC 1
132
133#endif /* _ASM_STAT_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/statfs.h deleted-101
...@@ -1,101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999 by Ralf Baechle
8 */
9#ifndef _ASM_STATFS_H
10#define _ASM_STATFS_H
11
12#include <linux/posix_types.h>
13#include <asm/sgidefs.h>
14
15#ifndef __KERNEL_STRICT_NAMES
16
17#include <linux/types.h>
18
19typedef __kernel_fsid_t fsid_t;
20
21#endif
22
23struct statfs {
24 long f_type;
25#define f_fstyp f_type
26 long f_bsize;
27 long f_frsize; /* Fragment size - unsupported */
28 long f_blocks;
29 long f_bfree;
30 long f_files;
31 long f_ffree;
32 long f_bavail;
33
34 /* Linux specials */
35 __kernel_fsid_t f_fsid;
36 long f_namelen;
37 long f_flags;
38 long f_spare[5];
39};
40
41#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
42
43/*
44 * Unlike the traditional version the LFAPI version has none of the ABI junk
45 */
46struct statfs64 {
47 __u32 f_type;
48 __u32 f_bsize;
49 __u32 f_frsize; /* Fragment size - unsupported */
50 __u32 __pad;
51 __u64 f_blocks;
52 __u64 f_bfree;
53 __u64 f_files;
54 __u64 f_ffree;
55 __u64 f_bavail;
56 __kernel_fsid_t f_fsid;
57 __u32 f_namelen;
58 __u32 f_flags;
59 __u32 f_spare[5];
60};
61
62#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
63
64#if _MIPS_SIM == _MIPS_SIM_ABI64
65
66struct statfs64 { /* Same as struct statfs */
67 long f_type;
68 long f_bsize;
69 long f_frsize; /* Fragment size - unsupported */
70 long f_blocks;
71 long f_bfree;
72 long f_files;
73 long f_ffree;
74 long f_bavail;
75
76 /* Linux specials */
77 __kernel_fsid_t f_fsid;
78 long f_namelen;
79 long f_flags;
80 long f_spare[5];
81};
82
83struct compat_statfs64 {
84 __u32 f_type;
85 __u32 f_bsize;
86 __u32 f_frsize; /* Fragment size - unsupported */
87 __u32 __pad;
88 __u64 f_blocks;
89 __u64 f_bfree;
90 __u64 f_files;
91 __u64 f_ffree;
92 __u64 f_bavail;
93 __kernel_fsid_t f_fsid;
94 __u32 f_namelen;
95 __u32 f_flags;
96 __u32 f_spare[5];
97};
98
99#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
100
101#endif /* _ASM_STATFS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/swab.h deleted-71
...@@ -1,71 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
8 */
9#ifndef _ASM_SWAB_H
10#define _ASM_SWAB_H
11
12
13#include <linux/types.h>
14
15#define __SWAB_64_THRU_32__
16
17#if !defined(__mips16) && \
18 ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
19 defined(_MIPS_ARCH_LOONGSON3A))
20
21static __inline__ __u16 __arch_swab16(__u16 x)
22{
23 __asm__(
24 " .set push \n"
25 " .set arch=mips32r2 \n"
26 " wsbh %0, %1 \n"
27 " .set pop \n"
28 : "=r" (x)
29 : "r" (x));
30
31 return x;
32}
33#define __arch_swab16 __arch_swab16
34
35static __inline__ __u32 __arch_swab32(__u32 x)
36{
37 __asm__(
38 " .set push \n"
39 " .set arch=mips32r2 \n"
40 " wsbh %0, %1 \n"
41 " rotr %0, %0, 16 \n"
42 " .set pop \n"
43 : "=r" (x)
44 : "r" (x));
45
46 return x;
47}
48#define __arch_swab32 __arch_swab32
49
50/*
51 * Having already checked for MIPS R2, enable the optimized version for
52 * 64-bit kernel on r2 CPUs.
53 */
54#ifdef __mips64
55static __inline__ __u64 __arch_swab64(__u64 x)
56{
57 __asm__(
58 " .set push \n"
59 " .set arch=mips64r2 \n"
60 " dsbh %0, %1 \n"
61 " dshd %0, %0 \n"
62 " .set pop \n"
63 : "=r" (x)
64 : "r" (x));
65
66 return x;
67}
68#define __arch_swab64 __arch_swab64
69#endif /* __mips64 */
70#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */
71#endif /* _ASM_SWAB_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/termbits.h deleted-228
...@@ -1,228 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
11#ifndef _ASM_TERMBITS_H
12#define _ASM_TERMBITS_H
13
14#include <linux/posix_types.h>
15
16typedef unsigned char cc_t;
17typedef unsigned int speed_t;
18typedef unsigned int tcflag_t;
19
20/*
21 * The ABI says nothing about NCC but seems to use NCCS as
22 * replacement for it in struct termio
23 */
24#define NCCS 23
25struct termios {
26 tcflag_t c_iflag; /* input mode flags */
27 tcflag_t c_oflag; /* output mode flags */
28 tcflag_t c_cflag; /* control mode flags */
29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */
32};
33
34struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 speed_t c_ispeed; /* input speed */
42 speed_t c_ospeed; /* output speed */
43};
44
45struct ktermios {
46 tcflag_t c_iflag; /* input mode flags */
47 tcflag_t c_oflag; /* output mode flags */
48 tcflag_t c_cflag; /* control mode flags */
49 tcflag_t c_lflag; /* local mode flags */
50 cc_t c_line; /* line discipline */
51 cc_t c_cc[NCCS]; /* control characters */
52 speed_t c_ispeed; /* input speed */
53 speed_t c_ospeed; /* output speed */
54};
55
56/* c_cc characters */
57#define VINTR 0 /* Interrupt character [ISIG]. */
58#define VQUIT 1 /* Quit character [ISIG]. */
59#define VERASE 2 /* Erase character [ICANON]. */
60#define VKILL 3 /* Kill-line character [ICANON]. */
61#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
62#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
63#define VEOL2 6 /* Second EOL character [ICANON]. */
64#define VSWTC 7 /* ??? */
65#define VSWTCH VSWTC
66#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
67#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
68#define VSUSP 10 /* Suspend character [ISIG]. */
69#if 0
70/*
71 * VDSUSP is not supported
72 */
73#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
74#endif
75#define VREPRINT 12 /* Reprint-line character [ICANON]. */
76#define VDISCARD 13 /* Discard character [IEXTEN]. */
77#define VWERASE 14 /* Word-erase character [ICANON]. */
78#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
79#define VEOF 16 /* End-of-file character [ICANON]. */
80#define VEOL 17 /* End-of-line character [ICANON]. */
81
82/* c_iflag bits */
83#define IGNBRK 0000001 /* Ignore break condition. */
84#define BRKINT 0000002 /* Signal interrupt on break. */
85#define IGNPAR 0000004 /* Ignore characters with parity errors. */
86#define PARMRK 0000010 /* Mark parity and framing errors. */
87#define INPCK 0000020 /* Enable input parity check. */
88#define ISTRIP 0000040 /* Strip 8th bit off characters. */
89#define INLCR 0000100 /* Map NL to CR on input. */
90#define IGNCR 0000200 /* Ignore CR. */
91#define ICRNL 0000400 /* Map CR to NL on input. */
92#define IUCLC 0001000 /* Map upper case to lower case on input. */
93#define IXON 0002000 /* Enable start/stop output control. */
94#define IXANY 0004000 /* Any character will restart after stop. */
95#define IXOFF 0010000 /* Enable start/stop input control. */
96#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
97#define IUTF8 0040000 /* Input is UTF-8 */
98
99/* c_oflag bits */
100#define OPOST 0000001 /* Perform output processing. */
101#define OLCUC 0000002 /* Map lower case to upper case on output. */
102#define ONLCR 0000004 /* Map NL to CR-NL on output. */
103#define OCRNL 0000010
104#define ONOCR 0000020
105#define ONLRET 0000040
106#define OFILL 0000100
107#define OFDEL 0000200
108#define NLDLY 0000400
109#define NL0 0000000
110#define NL1 0000400
111#define CRDLY 0003000
112#define CR0 0000000
113#define CR1 0001000
114#define CR2 0002000
115#define CR3 0003000
116#define TABDLY 0014000
117#define TAB0 0000000
118#define TAB1 0004000
119#define TAB2 0010000
120#define TAB3 0014000
121#define XTABS 0014000
122#define BSDLY 0020000
123#define BS0 0000000
124#define BS1 0020000
125#define VTDLY 0040000
126#define VT0 0000000
127#define VT1 0040000
128#define FFDLY 0100000
129#define FF0 0000000
130#define FF1 0100000
131/*
132#define PAGEOUT ???
133#define WRAP ???
134 */
135
136/* c_cflag bit meaning */
137#define CBAUD 0010017
138#define B0 0000000 /* hang up */
139#define B50 0000001
140#define B75 0000002
141#define B110 0000003
142#define B134 0000004
143#define B150 0000005
144#define B200 0000006
145#define B300 0000007
146#define B600 0000010
147#define B1200 0000011
148#define B1800 0000012
149#define B2400 0000013
150#define B4800 0000014
151#define B9600 0000015
152#define B19200 0000016
153#define B38400 0000017
154#define EXTA B19200
155#define EXTB B38400
156#define CSIZE 0000060 /* Number of bits per byte (mask). */
157#define CS5 0000000 /* 5 bits per byte. */
158#define CS6 0000020 /* 6 bits per byte. */
159#define CS7 0000040 /* 7 bits per byte. */
160#define CS8 0000060 /* 8 bits per byte. */
161#define CSTOPB 0000100 /* Two stop bits instead of one. */
162#define CREAD 0000200 /* Enable receiver. */
163#define PARENB 0000400 /* Parity enable. */
164#define PARODD 0001000 /* Odd parity instead of even. */
165#define HUPCL 0002000 /* Hang up on last close. */
166#define CLOCAL 0004000 /* Ignore modem status lines. */
167#define CBAUDEX 0010000
168#define BOTHER 0010000
169#define B57600 0010001
170#define B115200 0010002
171#define B230400 0010003
172#define B460800 0010004
173#define B500000 0010005
174#define B576000 0010006
175#define B921600 0010007
176#define B1000000 0010010
177#define B1152000 0010011
178#define B1500000 0010012
179#define B2000000 0010013
180#define B2500000 0010014
181#define B3000000 0010015
182#define B3500000 0010016
183#define B4000000 0010017
184#define CIBAUD 002003600000 /* input baud rate */
185#define CMSPAR 010000000000 /* mark or space (stick) parity */
186#define CRTSCTS 020000000000 /* flow control */
187
188#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
189
190/* c_lflag bits */
191#define ISIG 0000001 /* Enable signals. */
192#define ICANON 0000002 /* Do erase and kill processing. */
193#define XCASE 0000004
194#define ECHO 0000010 /* Enable echo. */
195#define ECHOE 0000020 /* Visual erase for ERASE. */
196#define ECHOK 0000040 /* Echo NL after KILL. */
197#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
198#define NOFLSH 0000200 /* Disable flush after interrupt. */
199#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
200#define ECHOCTL 0001000 /* Echo control characters as ^X. */
201#define ECHOPRT 0002000 /* Hardcopy visual erase. */
202#define ECHOKE 0004000 /* Visual erase for KILL. */
203#define FLUSHO 0020000
204#define PENDIN 0040000 /* Retype pending input (state). */
205#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
206#define ITOSTOP TOSTOP
207#define EXTPROC 0200000 /* External processing on pty */
208
209/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
210#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
211
212/* tcflow() and TCXONC use these */
213#define TCOOFF 0 /* Suspend output. */
214#define TCOON 1 /* Restart suspended output. */
215#define TCIOFF 2 /* Send a STOP character. */
216#define TCION 3 /* Send a START character. */
217
218/* tcflush() and TCFLSH use these */
219#define TCIFLUSH 0 /* Discard data received but not yet read. */
220#define TCOFLUSH 1 /* Discard data written but not yet sent. */
221#define TCIOFLUSH 2 /* Discard all pending data. */
222
223/* tcsetattr uses these */
224#define TCSANOW TCSETS /* Change immediately. */
225#define TCSADRAIN TCSETSW /* Change when pending output is written. */
226#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
227
228#endif /* _ASM_TERMBITS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/termios.h deleted-81
...@@ -1,81 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_TERMIOS_H
11#define _ASM_TERMIOS_H
12
13#include <linux/errno.h>
14#include <asm/termbits.h>
15#include <asm/ioctls.h>
16
17struct sgttyb {
18 char sg_ispeed;
19 char sg_ospeed;
20 char sg_erase;
21 char sg_kill;
22 int sg_flags; /* SGI special - int, not short */
23};
24
25struct tchars {
26 char t_intrc;
27 char t_quitc;
28 char t_startc;
29 char t_stopc;
30 char t_eofc;
31 char t_brkc;
32};
33
34struct ltchars {
35 char t_suspc; /* stop process signal */
36 char t_dsuspc; /* delayed stop process signal */
37 char t_rprntc; /* reprint line */
38 char t_flushc; /* flush output (toggles) */
39 char t_werasc; /* word erase */
40 char t_lnextc; /* literal next character */
41};
42
43/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
44 compatibility anyway ... */
45
46struct winsize {
47 unsigned short ws_row;
48 unsigned short ws_col;
49 unsigned short ws_xpixel;
50 unsigned short ws_ypixel;
51};
52
53#define NCC 8
54struct termio {
55 unsigned short c_iflag; /* input mode flags */
56 unsigned short c_oflag; /* output mode flags */
57 unsigned short c_cflag; /* control mode flags */
58 unsigned short c_lflag; /* local mode flags */
59 char c_line; /* line discipline */
60 unsigned char c_cc[NCCS]; /* control characters */
61};
62
63
64/* modem lines */
65#define TIOCM_LE 0x001 /* line enable */
66#define TIOCM_DTR 0x002 /* data terminal ready */
67#define TIOCM_RTS 0x004 /* request to send */
68#define TIOCM_ST 0x010 /* secondary transmit */
69#define TIOCM_SR 0x020 /* secondary receive */
70#define TIOCM_CTS 0x040 /* clear to send */
71#define TIOCM_CAR 0x100 /* carrier detect */
72#define TIOCM_CD TIOCM_CAR
73#define TIOCM_RNG 0x200 /* ring */
74#define TIOCM_RI TIOCM_RNG
75#define TIOCM_DSR 0x400 /* data set ready */
76#define TIOCM_OUT1 0x2000
77#define TIOCM_OUT2 0x4000
78#define TIOCM_LOOP 0x8000
79
80
81#endif /* _ASM_TERMIOS_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/types.h deleted-29
...@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
8 * Copyright (C) 2008 Wind River Systems,
9 * written by Ralf Baechle
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12#ifndef _ASM_TYPES_H
13#define _ASM_TYPES_H
14
15/*
16 * We don't use int-l64.h for the kernel anymore but still use it for
17 * userspace to avoid code changes.
18 *
19 * However, some user programs (e.g. perf) may not want this. They can
20 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
21 */
22# if _MIPS_SZLONG == 64 && !defined(__SANE_USERSPACE_TYPES__)
23# include <asm-generic/int-l64.h>
24# else
25# include <asm-generic/int-ll64.h>
26# endif
27
28
29#endif /* _ASM_TYPES_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-any/asm/unistd.h deleted-1101
...@@ -1,1101 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 *
10 * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
11 * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
12 */
13#ifndef _ASM_UNISTD_H
14#define _ASM_UNISTD_H
15
16#include <asm/sgidefs.h>
17
18#if _MIPS_SIM == _MIPS_SIM_ABI32
19
20/*
21 * Linux o32 style syscalls are in the range from 4000 to 4999.
22 */
23#define __NR_Linux 4000
24#define __NR_syscall (__NR_Linux + 0)
25#define __NR_exit (__NR_Linux + 1)
26#define __NR_fork (__NR_Linux + 2)
27#define __NR_read (__NR_Linux + 3)
28#define __NR_write (__NR_Linux + 4)
29#define __NR_open (__NR_Linux + 5)
30#define __NR_close (__NR_Linux + 6)
31#define __NR_waitpid (__NR_Linux + 7)
32#define __NR_creat (__NR_Linux + 8)
33#define __NR_link (__NR_Linux + 9)
34#define __NR_unlink (__NR_Linux + 10)
35#define __NR_execve (__NR_Linux + 11)
36#define __NR_chdir (__NR_Linux + 12)
37#define __NR_time (__NR_Linux + 13)
38#define __NR_mknod (__NR_Linux + 14)
39#define __NR_chmod (__NR_Linux + 15)
40#define __NR_lchown (__NR_Linux + 16)
41#define __NR_break (__NR_Linux + 17)
42#define __NR_unused18 (__NR_Linux + 18)
43#define __NR_lseek (__NR_Linux + 19)
44#define __NR_getpid (__NR_Linux + 20)
45#define __NR_mount (__NR_Linux + 21)
46#define __NR_umount (__NR_Linux + 22)
47#define __NR_setuid (__NR_Linux + 23)
48#define __NR_getuid (__NR_Linux + 24)
49#define __NR_stime (__NR_Linux + 25)
50#define __NR_ptrace (__NR_Linux + 26)
51#define __NR_alarm (__NR_Linux + 27)
52#define __NR_unused28 (__NR_Linux + 28)
53#define __NR_pause (__NR_Linux + 29)
54#define __NR_utime (__NR_Linux + 30)
55#define __NR_stty (__NR_Linux + 31)
56#define __NR_gtty (__NR_Linux + 32)
57#define __NR_access (__NR_Linux + 33)
58#define __NR_nice (__NR_Linux + 34)
59#define __NR_ftime (__NR_Linux + 35)
60#define __NR_sync (__NR_Linux + 36)
61#define __NR_kill (__NR_Linux + 37)
62#define __NR_rename (__NR_Linux + 38)
63#define __NR_mkdir (__NR_Linux + 39)
64#define __NR_rmdir (__NR_Linux + 40)
65#define __NR_dup (__NR_Linux + 41)
66#define __NR_pipe (__NR_Linux + 42)
67#define __NR_times (__NR_Linux + 43)
68#define __NR_prof (__NR_Linux + 44)
69#define __NR_brk (__NR_Linux + 45)
70#define __NR_setgid (__NR_Linux + 46)
71#define __NR_getgid (__NR_Linux + 47)
72#define __NR_signal (__NR_Linux + 48)
73#define __NR_geteuid (__NR_Linux + 49)
74#define __NR_getegid (__NR_Linux + 50)
75#define __NR_acct (__NR_Linux + 51)
76#define __NR_umount2 (__NR_Linux + 52)
77#define __NR_lock (__NR_Linux + 53)
78#define __NR_ioctl (__NR_Linux + 54)
79#define __NR_fcntl (__NR_Linux + 55)
80#define __NR_mpx (__NR_Linux + 56)
81#define __NR_setpgid (__NR_Linux + 57)
82#define __NR_ulimit (__NR_Linux + 58)
83#define __NR_unused59 (__NR_Linux + 59)
84#define __NR_umask (__NR_Linux + 60)
85#define __NR_chroot (__NR_Linux + 61)
86#define __NR_ustat (__NR_Linux + 62)
87#define __NR_dup2 (__NR_Linux + 63)
88#define __NR_getppid (__NR_Linux + 64)
89#define __NR_getpgrp (__NR_Linux + 65)
90#define __NR_setsid (__NR_Linux + 66)
91#define __NR_sigaction (__NR_Linux + 67)
92#define __NR_sgetmask (__NR_Linux + 68)
93#define __NR_ssetmask (__NR_Linux + 69)
94#define __NR_setreuid (__NR_Linux + 70)
95#define __NR_setregid (__NR_Linux + 71)
96#define __NR_sigsuspend (__NR_Linux + 72)
97#define __NR_sigpending (__NR_Linux + 73)
98#define __NR_sethostname (__NR_Linux + 74)
99#define __NR_setrlimit (__NR_Linux + 75)
100#define __NR_getrlimit (__NR_Linux + 76)
101#define __NR_getrusage (__NR_Linux + 77)
102#define __NR_gettimeofday (__NR_Linux + 78)
103#define __NR_settimeofday (__NR_Linux + 79)
104#define __NR_getgroups (__NR_Linux + 80)
105#define __NR_setgroups (__NR_Linux + 81)
106#define __NR_reserved82 (__NR_Linux + 82)
107#define __NR_symlink (__NR_Linux + 83)
108#define __NR_unused84 (__NR_Linux + 84)
109#define __NR_readlink (__NR_Linux + 85)
110#define __NR_uselib (__NR_Linux + 86)
111#define __NR_swapon (__NR_Linux + 87)
112#define __NR_reboot (__NR_Linux + 88)
113#define __NR_readdir (__NR_Linux + 89)
114#define __NR_mmap (__NR_Linux + 90)
115#define __NR_munmap (__NR_Linux + 91)
116#define __NR_truncate (__NR_Linux + 92)
117#define __NR_ftruncate (__NR_Linux + 93)
118#define __NR_fchmod (__NR_Linux + 94)
119#define __NR_fchown (__NR_Linux + 95)
120#define __NR_getpriority (__NR_Linux + 96)
121#define __NR_setpriority (__NR_Linux + 97)
122#define __NR_profil (__NR_Linux + 98)
123#define __NR_statfs (__NR_Linux + 99)
124#define __NR_fstatfs (__NR_Linux + 100)
125#define __NR_ioperm (__NR_Linux + 101)
126#define __NR_socketcall (__NR_Linux + 102)
127#define __NR_syslog (__NR_Linux + 103)
128#define __NR_setitimer (__NR_Linux + 104)
129#define __NR_getitimer (__NR_Linux + 105)
130#define __NR_stat (__NR_Linux + 106)
131#define __NR_lstat (__NR_Linux + 107)
132#define __NR_fstat (__NR_Linux + 108)
133#define __NR_unused109 (__NR_Linux + 109)
134#define __NR_iopl (__NR_Linux + 110)
135#define __NR_vhangup (__NR_Linux + 111)
136#define __NR_idle (__NR_Linux + 112)
137#define __NR_vm86 (__NR_Linux + 113)
138#define __NR_wait4 (__NR_Linux + 114)
139#define __NR_swapoff (__NR_Linux + 115)
140#define __NR_sysinfo (__NR_Linux + 116)
141#define __NR_ipc (__NR_Linux + 117)
142#define __NR_fsync (__NR_Linux + 118)
143#define __NR_sigreturn (__NR_Linux + 119)
144#define __NR_clone (__NR_Linux + 120)
145#define __NR_setdomainname (__NR_Linux + 121)
146#define __NR_uname (__NR_Linux + 122)
147#define __NR_modify_ldt (__NR_Linux + 123)
148#define __NR_adjtimex (__NR_Linux + 124)
149#define __NR_mprotect (__NR_Linux + 125)
150#define __NR_sigprocmask (__NR_Linux + 126)
151#define __NR_create_module (__NR_Linux + 127)
152#define __NR_init_module (__NR_Linux + 128)
153#define __NR_delete_module (__NR_Linux + 129)
154#define __NR_get_kernel_syms (__NR_Linux + 130)
155#define __NR_quotactl (__NR_Linux + 131)
156#define __NR_getpgid (__NR_Linux + 132)
157#define __NR_fchdir (__NR_Linux + 133)
158#define __NR_bdflush (__NR_Linux + 134)
159#define __NR_sysfs (__NR_Linux + 135)
160#define __NR_personality (__NR_Linux + 136)
161#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
162#define __NR_setfsuid (__NR_Linux + 138)
163#define __NR_setfsgid (__NR_Linux + 139)
164#define __NR__llseek (__NR_Linux + 140)
165#define __NR_getdents (__NR_Linux + 141)
166#define __NR__newselect (__NR_Linux + 142)
167#define __NR_flock (__NR_Linux + 143)
168#define __NR_msync (__NR_Linux + 144)
169#define __NR_readv (__NR_Linux + 145)
170#define __NR_writev (__NR_Linux + 146)
171#define __NR_cacheflush (__NR_Linux + 147)
172#define __NR_cachectl (__NR_Linux + 148)
173#define __NR_sysmips (__NR_Linux + 149)
174#define __NR_unused150 (__NR_Linux + 150)
175#define __NR_getsid (__NR_Linux + 151)
176#define __NR_fdatasync (__NR_Linux + 152)
177#define __NR__sysctl (__NR_Linux + 153)
178#define __NR_mlock (__NR_Linux + 154)
179#define __NR_munlock (__NR_Linux + 155)
180#define __NR_mlockall (__NR_Linux + 156)
181#define __NR_munlockall (__NR_Linux + 157)
182#define __NR_sched_setparam (__NR_Linux + 158)
183#define __NR_sched_getparam (__NR_Linux + 159)
184#define __NR_sched_setscheduler (__NR_Linux + 160)
185#define __NR_sched_getscheduler (__NR_Linux + 161)
186#define __NR_sched_yield (__NR_Linux + 162)
187#define __NR_sched_get_priority_max (__NR_Linux + 163)
188#define __NR_sched_get_priority_min (__NR_Linux + 164)
189#define __NR_sched_rr_get_interval (__NR_Linux + 165)
190#define __NR_nanosleep (__NR_Linux + 166)
191#define __NR_mremap (__NR_Linux + 167)
192#define __NR_accept (__NR_Linux + 168)
193#define __NR_bind (__NR_Linux + 169)
194#define __NR_connect (__NR_Linux + 170)
195#define __NR_getpeername (__NR_Linux + 171)
196#define __NR_getsockname (__NR_Linux + 172)
197#define __NR_getsockopt (__NR_Linux + 173)
198#define __NR_listen (__NR_Linux + 174)
199#define __NR_recv (__NR_Linux + 175)
200#define __NR_recvfrom (__NR_Linux + 176)
201#define __NR_recvmsg (__NR_Linux + 177)
202#define __NR_send (__NR_Linux + 178)
203#define __NR_sendmsg (__NR_Linux + 179)
204#define __NR_sendto (__NR_Linux + 180)
205#define __NR_setsockopt (__NR_Linux + 181)
206#define __NR_shutdown (__NR_Linux + 182)
207#define __NR_socket (__NR_Linux + 183)
208#define __NR_socketpair (__NR_Linux + 184)
209#define __NR_setresuid (__NR_Linux + 185)
210#define __NR_getresuid (__NR_Linux + 186)
211#define __NR_query_module (__NR_Linux + 187)
212#define __NR_poll (__NR_Linux + 188)
213#define __NR_nfsservctl (__NR_Linux + 189)
214#define __NR_setresgid (__NR_Linux + 190)
215#define __NR_getresgid (__NR_Linux + 191)
216#define __NR_prctl (__NR_Linux + 192)
217#define __NR_rt_sigreturn (__NR_Linux + 193)
218#define __NR_rt_sigaction (__NR_Linux + 194)
219#define __NR_rt_sigprocmask (__NR_Linux + 195)
220#define __NR_rt_sigpending (__NR_Linux + 196)
221#define __NR_rt_sigtimedwait (__NR_Linux + 197)
222#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
223#define __NR_rt_sigsuspend (__NR_Linux + 199)
224#define __NR_pread64 (__NR_Linux + 200)
225#define __NR_pwrite64 (__NR_Linux + 201)
226#define __NR_chown (__NR_Linux + 202)
227#define __NR_getcwd (__NR_Linux + 203)
228#define __NR_capget (__NR_Linux + 204)
229#define __NR_capset (__NR_Linux + 205)
230#define __NR_sigaltstack (__NR_Linux + 206)
231#define __NR_sendfile (__NR_Linux + 207)
232#define __NR_getpmsg (__NR_Linux + 208)
233#define __NR_putpmsg (__NR_Linux + 209)
234#define __NR_mmap2 (__NR_Linux + 210)
235#define __NR_truncate64 (__NR_Linux + 211)
236#define __NR_ftruncate64 (__NR_Linux + 212)
237#define __NR_stat64 (__NR_Linux + 213)
238#define __NR_lstat64 (__NR_Linux + 214)
239#define __NR_fstat64 (__NR_Linux + 215)
240#define __NR_pivot_root (__NR_Linux + 216)
241#define __NR_mincore (__NR_Linux + 217)
242#define __NR_madvise (__NR_Linux + 218)
243#define __NR_getdents64 (__NR_Linux + 219)
244#define __NR_fcntl64 (__NR_Linux + 220)
245#define __NR_reserved221 (__NR_Linux + 221)
246#define __NR_gettid (__NR_Linux + 222)
247#define __NR_readahead (__NR_Linux + 223)
248#define __NR_setxattr (__NR_Linux + 224)
249#define __NR_lsetxattr (__NR_Linux + 225)
250#define __NR_fsetxattr (__NR_Linux + 226)
251#define __NR_getxattr (__NR_Linux + 227)
252#define __NR_lgetxattr (__NR_Linux + 228)
253#define __NR_fgetxattr (__NR_Linux + 229)
254#define __NR_listxattr (__NR_Linux + 230)
255#define __NR_llistxattr (__NR_Linux + 231)
256#define __NR_flistxattr (__NR_Linux + 232)
257#define __NR_removexattr (__NR_Linux + 233)
258#define __NR_lremovexattr (__NR_Linux + 234)
259#define __NR_fremovexattr (__NR_Linux + 235)
260#define __NR_tkill (__NR_Linux + 236)
261#define __NR_sendfile64 (__NR_Linux + 237)
262#define __NR_futex (__NR_Linux + 238)
263#define __NR_sched_setaffinity (__NR_Linux + 239)
264#define __NR_sched_getaffinity (__NR_Linux + 240)
265#define __NR_io_setup (__NR_Linux + 241)
266#define __NR_io_destroy (__NR_Linux + 242)
267#define __NR_io_getevents (__NR_Linux + 243)
268#define __NR_io_submit (__NR_Linux + 244)
269#define __NR_io_cancel (__NR_Linux + 245)
270#define __NR_exit_group (__NR_Linux + 246)
271#define __NR_lookup_dcookie (__NR_Linux + 247)
272#define __NR_epoll_create (__NR_Linux + 248)
273#define __NR_epoll_ctl (__NR_Linux + 249)
274#define __NR_epoll_wait (__NR_Linux + 250)
275#define __NR_remap_file_pages (__NR_Linux + 251)
276#define __NR_set_tid_address (__NR_Linux + 252)
277#define __NR_restart_syscall (__NR_Linux + 253)
278#define __NR_fadvise64 (__NR_Linux + 254)
279#define __NR_statfs64 (__NR_Linux + 255)
280#define __NR_fstatfs64 (__NR_Linux + 256)
281#define __NR_timer_create (__NR_Linux + 257)
282#define __NR_timer_settime (__NR_Linux + 258)
283#define __NR_timer_gettime (__NR_Linux + 259)
284#define __NR_timer_getoverrun (__NR_Linux + 260)
285#define __NR_timer_delete (__NR_Linux + 261)
286#define __NR_clock_settime (__NR_Linux + 262)
287#define __NR_clock_gettime (__NR_Linux + 263)
288#define __NR_clock_getres (__NR_Linux + 264)
289#define __NR_clock_nanosleep (__NR_Linux + 265)
290#define __NR_tgkill (__NR_Linux + 266)
291#define __NR_utimes (__NR_Linux + 267)
292#define __NR_mbind (__NR_Linux + 268)
293#define __NR_get_mempolicy (__NR_Linux + 269)
294#define __NR_set_mempolicy (__NR_Linux + 270)
295#define __NR_mq_open (__NR_Linux + 271)
296#define __NR_mq_unlink (__NR_Linux + 272)
297#define __NR_mq_timedsend (__NR_Linux + 273)
298#define __NR_mq_timedreceive (__NR_Linux + 274)
299#define __NR_mq_notify (__NR_Linux + 275)
300#define __NR_mq_getsetattr (__NR_Linux + 276)
301#define __NR_vserver (__NR_Linux + 277)
302#define __NR_waitid (__NR_Linux + 278)
303/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
304#define __NR_add_key (__NR_Linux + 280)
305#define __NR_request_key (__NR_Linux + 281)
306#define __NR_keyctl (__NR_Linux + 282)
307#define __NR_set_thread_area (__NR_Linux + 283)
308#define __NR_inotify_init (__NR_Linux + 284)
309#define __NR_inotify_add_watch (__NR_Linux + 285)
310#define __NR_inotify_rm_watch (__NR_Linux + 286)
311#define __NR_migrate_pages (__NR_Linux + 287)
312#define __NR_openat (__NR_Linux + 288)
313#define __NR_mkdirat (__NR_Linux + 289)
314#define __NR_mknodat (__NR_Linux + 290)
315#define __NR_fchownat (__NR_Linux + 291)
316#define __NR_futimesat (__NR_Linux + 292)
317#define __NR_fstatat64 (__NR_Linux + 293)
318#define __NR_unlinkat (__NR_Linux + 294)
319#define __NR_renameat (__NR_Linux + 295)
320#define __NR_linkat (__NR_Linux + 296)
321#define __NR_symlinkat (__NR_Linux + 297)
322#define __NR_readlinkat (__NR_Linux + 298)
323#define __NR_fchmodat (__NR_Linux + 299)
324#define __NR_faccessat (__NR_Linux + 300)
325#define __NR_pselect6 (__NR_Linux + 301)
326#define __NR_ppoll (__NR_Linux + 302)
327#define __NR_unshare (__NR_Linux + 303)
328#define __NR_splice (__NR_Linux + 304)
329#define __NR_sync_file_range (__NR_Linux + 305)
330#define __NR_tee (__NR_Linux + 306)
331#define __NR_vmsplice (__NR_Linux + 307)
332#define __NR_move_pages (__NR_Linux + 308)
333#define __NR_set_robust_list (__NR_Linux + 309)
334#define __NR_get_robust_list (__NR_Linux + 310)
335#define __NR_kexec_load (__NR_Linux + 311)
336#define __NR_getcpu (__NR_Linux + 312)
337#define __NR_epoll_pwait (__NR_Linux + 313)
338#define __NR_ioprio_set (__NR_Linux + 314)
339#define __NR_ioprio_get (__NR_Linux + 315)
340#define __NR_utimensat (__NR_Linux + 316)
341#define __NR_signalfd (__NR_Linux + 317)
342#define __NR_timerfd (__NR_Linux + 318)
343#define __NR_eventfd (__NR_Linux + 319)
344#define __NR_fallocate (__NR_Linux + 320)
345#define __NR_timerfd_create (__NR_Linux + 321)
346#define __NR_timerfd_gettime (__NR_Linux + 322)
347#define __NR_timerfd_settime (__NR_Linux + 323)
348#define __NR_signalfd4 (__NR_Linux + 324)
349#define __NR_eventfd2 (__NR_Linux + 325)
350#define __NR_epoll_create1 (__NR_Linux + 326)
351#define __NR_dup3 (__NR_Linux + 327)
352#define __NR_pipe2 (__NR_Linux + 328)
353#define __NR_inotify_init1 (__NR_Linux + 329)
354#define __NR_preadv (__NR_Linux + 330)
355#define __NR_pwritev (__NR_Linux + 331)
356#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
357#define __NR_perf_event_open (__NR_Linux + 333)
358#define __NR_accept4 (__NR_Linux + 334)
359#define __NR_recvmmsg (__NR_Linux + 335)
360#define __NR_fanotify_init (__NR_Linux + 336)
361#define __NR_fanotify_mark (__NR_Linux + 337)
362#define __NR_prlimit64 (__NR_Linux + 338)
363#define __NR_name_to_handle_at (__NR_Linux + 339)
364#define __NR_open_by_handle_at (__NR_Linux + 340)
365#define __NR_clock_adjtime (__NR_Linux + 341)
366#define __NR_syncfs (__NR_Linux + 342)
367#define __NR_sendmmsg (__NR_Linux + 343)
368#define __NR_setns (__NR_Linux + 344)
369#define __NR_process_vm_readv (__NR_Linux + 345)
370#define __NR_process_vm_writev (__NR_Linux + 346)
371#define __NR_kcmp (__NR_Linux + 347)
372#define __NR_finit_module (__NR_Linux + 348)
373#define __NR_sched_setattr (__NR_Linux + 349)
374#define __NR_sched_getattr (__NR_Linux + 350)
375#define __NR_renameat2 (__NR_Linux + 351)
376#define __NR_seccomp (__NR_Linux + 352)
377#define __NR_getrandom (__NR_Linux + 353)
378#define __NR_memfd_create (__NR_Linux + 354)
379#define __NR_bpf (__NR_Linux + 355)
380#define __NR_execveat (__NR_Linux + 356)
381#define __NR_userfaultfd (__NR_Linux + 357)
382#define __NR_membarrier (__NR_Linux + 358)
383#define __NR_mlock2 (__NR_Linux + 359)
384#define __NR_copy_file_range (__NR_Linux + 360)
385#define __NR_preadv2 (__NR_Linux + 361)
386#define __NR_pwritev2 (__NR_Linux + 362)
387#define __NR_pkey_mprotect (__NR_Linux + 363)
388#define __NR_pkey_alloc (__NR_Linux + 364)
389#define __NR_pkey_free (__NR_Linux + 365)
390#define __NR_statx (__NR_Linux + 366)
391#define __NR_rseq (__NR_Linux + 367)
392#define __NR_io_pgetevents (__NR_Linux + 368)
393
394
395/*
396 * Offset of the last Linux o32 flavoured syscall
397 */
398#define __NR_Linux_syscalls 368
399
400#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
401
402#define __NR_O32_Linux 4000
403#define __NR_O32_Linux_syscalls 368
404
405#if _MIPS_SIM == _MIPS_SIM_ABI64
406
407/*
408 * Linux 64-bit syscalls are in the range from 5000 to 5999.
409 */
410#define __NR_Linux 5000
411#define __NR_read (__NR_Linux + 0)
412#define __NR_write (__NR_Linux + 1)
413#define __NR_open (__NR_Linux + 2)
414#define __NR_close (__NR_Linux + 3)
415#define __NR_stat (__NR_Linux + 4)
416#define __NR_fstat (__NR_Linux + 5)
417#define __NR_lstat (__NR_Linux + 6)
418#define __NR_poll (__NR_Linux + 7)
419#define __NR_lseek (__NR_Linux + 8)
420#define __NR_mmap (__NR_Linux + 9)
421#define __NR_mprotect (__NR_Linux + 10)
422#define __NR_munmap (__NR_Linux + 11)
423#define __NR_brk (__NR_Linux + 12)
424#define __NR_rt_sigaction (__NR_Linux + 13)
425#define __NR_rt_sigprocmask (__NR_Linux + 14)
426#define __NR_ioctl (__NR_Linux + 15)
427#define __NR_pread64 (__NR_Linux + 16)
428#define __NR_pwrite64 (__NR_Linux + 17)
429#define __NR_readv (__NR_Linux + 18)
430#define __NR_writev (__NR_Linux + 19)
431#define __NR_access (__NR_Linux + 20)
432#define __NR_pipe (__NR_Linux + 21)
433#define __NR__newselect (__NR_Linux + 22)
434#define __NR_sched_yield (__NR_Linux + 23)
435#define __NR_mremap (__NR_Linux + 24)
436#define __NR_msync (__NR_Linux + 25)
437#define __NR_mincore (__NR_Linux + 26)
438#define __NR_madvise (__NR_Linux + 27)
439#define __NR_shmget (__NR_Linux + 28)
440#define __NR_shmat (__NR_Linux + 29)
441#define __NR_shmctl (__NR_Linux + 30)
442#define __NR_dup (__NR_Linux + 31)
443#define __NR_dup2 (__NR_Linux + 32)
444#define __NR_pause (__NR_Linux + 33)
445#define __NR_nanosleep (__NR_Linux + 34)
446#define __NR_getitimer (__NR_Linux + 35)
447#define __NR_setitimer (__NR_Linux + 36)
448#define __NR_alarm (__NR_Linux + 37)
449#define __NR_getpid (__NR_Linux + 38)
450#define __NR_sendfile (__NR_Linux + 39)
451#define __NR_socket (__NR_Linux + 40)
452#define __NR_connect (__NR_Linux + 41)
453#define __NR_accept (__NR_Linux + 42)
454#define __NR_sendto (__NR_Linux + 43)
455#define __NR_recvfrom (__NR_Linux + 44)
456#define __NR_sendmsg (__NR_Linux + 45)
457#define __NR_recvmsg (__NR_Linux + 46)
458#define __NR_shutdown (__NR_Linux + 47)
459#define __NR_bind (__NR_Linux + 48)
460#define __NR_listen (__NR_Linux + 49)
461#define __NR_getsockname (__NR_Linux + 50)
462#define __NR_getpeername (__NR_Linux + 51)
463#define __NR_socketpair (__NR_Linux + 52)
464#define __NR_setsockopt (__NR_Linux + 53)
465#define __NR_getsockopt (__NR_Linux + 54)
466#define __NR_clone (__NR_Linux + 55)
467#define __NR_fork (__NR_Linux + 56)
468#define __NR_execve (__NR_Linux + 57)
469#define __NR_exit (__NR_Linux + 58)
470#define __NR_wait4 (__NR_Linux + 59)
471#define __NR_kill (__NR_Linux + 60)
472#define __NR_uname (__NR_Linux + 61)
473#define __NR_semget (__NR_Linux + 62)
474#define __NR_semop (__NR_Linux + 63)
475#define __NR_semctl (__NR_Linux + 64)
476#define __NR_shmdt (__NR_Linux + 65)
477#define __NR_msgget (__NR_Linux + 66)
478#define __NR_msgsnd (__NR_Linux + 67)
479#define __NR_msgrcv (__NR_Linux + 68)
480#define __NR_msgctl (__NR_Linux + 69)
481#define __NR_fcntl (__NR_Linux + 70)
482#define __NR_flock (__NR_Linux + 71)
483#define __NR_fsync (__NR_Linux + 72)
484#define __NR_fdatasync (__NR_Linux + 73)
485#define __NR_truncate (__NR_Linux + 74)
486#define __NR_ftruncate (__NR_Linux + 75)
487#define __NR_getdents (__NR_Linux + 76)
488#define __NR_getcwd (__NR_Linux + 77)
489#define __NR_chdir (__NR_Linux + 78)
490#define __NR_fchdir (__NR_Linux + 79)
491#define __NR_rename (__NR_Linux + 80)
492#define __NR_mkdir (__NR_Linux + 81)
493#define __NR_rmdir (__NR_Linux + 82)
494#define __NR_creat (__NR_Linux + 83)
495#define __NR_link (__NR_Linux + 84)
496#define __NR_unlink (__NR_Linux + 85)
497#define __NR_symlink (__NR_Linux + 86)
498#define __NR_readlink (__NR_Linux + 87)
499#define __NR_chmod (__NR_Linux + 88)
500#define __NR_fchmod (__NR_Linux + 89)
501#define __NR_chown (__NR_Linux + 90)
502#define __NR_fchown (__NR_Linux + 91)
503#define __NR_lchown (__NR_Linux + 92)
504#define __NR_umask (__NR_Linux + 93)
505#define __NR_gettimeofday (__NR_Linux + 94)
506#define __NR_getrlimit (__NR_Linux + 95)
507#define __NR_getrusage (__NR_Linux + 96)
508#define __NR_sysinfo (__NR_Linux + 97)
509#define __NR_times (__NR_Linux + 98)
510#define __NR_ptrace (__NR_Linux + 99)
511#define __NR_getuid (__NR_Linux + 100)
512#define __NR_syslog (__NR_Linux + 101)
513#define __NR_getgid (__NR_Linux + 102)
514#define __NR_setuid (__NR_Linux + 103)
515#define __NR_setgid (__NR_Linux + 104)
516#define __NR_geteuid (__NR_Linux + 105)
517#define __NR_getegid (__NR_Linux + 106)
518#define __NR_setpgid (__NR_Linux + 107)
519#define __NR_getppid (__NR_Linux + 108)
520#define __NR_getpgrp (__NR_Linux + 109)
521#define __NR_setsid (__NR_Linux + 110)
522#define __NR_setreuid (__NR_Linux + 111)
523#define __NR_setregid (__NR_Linux + 112)
524#define __NR_getgroups (__NR_Linux + 113)
525#define __NR_setgroups (__NR_Linux + 114)
526#define __NR_setresuid (__NR_Linux + 115)
527#define __NR_getresuid (__NR_Linux + 116)
528#define __NR_setresgid (__NR_Linux + 117)
529#define __NR_getresgid (__NR_Linux + 118)
530#define __NR_getpgid (__NR_Linux + 119)
531#define __NR_setfsuid (__NR_Linux + 120)
532#define __NR_setfsgid (__NR_Linux + 121)
533#define __NR_getsid (__NR_Linux + 122)
534#define __NR_capget (__NR_Linux + 123)
535#define __NR_capset (__NR_Linux + 124)
536#define __NR_rt_sigpending (__NR_Linux + 125)
537#define __NR_rt_sigtimedwait (__NR_Linux + 126)
538#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
539#define __NR_rt_sigsuspend (__NR_Linux + 128)
540#define __NR_sigaltstack (__NR_Linux + 129)
541#define __NR_utime (__NR_Linux + 130)
542#define __NR_mknod (__NR_Linux + 131)
543#define __NR_personality (__NR_Linux + 132)
544#define __NR_ustat (__NR_Linux + 133)
545#define __NR_statfs (__NR_Linux + 134)
546#define __NR_fstatfs (__NR_Linux + 135)
547#define __NR_sysfs (__NR_Linux + 136)
548#define __NR_getpriority (__NR_Linux + 137)
549#define __NR_setpriority (__NR_Linux + 138)
550#define __NR_sched_setparam (__NR_Linux + 139)
551#define __NR_sched_getparam (__NR_Linux + 140)
552#define __NR_sched_setscheduler (__NR_Linux + 141)
553#define __NR_sched_getscheduler (__NR_Linux + 142)
554#define __NR_sched_get_priority_max (__NR_Linux + 143)
555#define __NR_sched_get_priority_min (__NR_Linux + 144)
556#define __NR_sched_rr_get_interval (__NR_Linux + 145)
557#define __NR_mlock (__NR_Linux + 146)
558#define __NR_munlock (__NR_Linux + 147)
559#define __NR_mlockall (__NR_Linux + 148)
560#define __NR_munlockall (__NR_Linux + 149)
561#define __NR_vhangup (__NR_Linux + 150)
562#define __NR_pivot_root (__NR_Linux + 151)
563#define __NR__sysctl (__NR_Linux + 152)
564#define __NR_prctl (__NR_Linux + 153)
565#define __NR_adjtimex (__NR_Linux + 154)
566#define __NR_setrlimit (__NR_Linux + 155)
567#define __NR_chroot (__NR_Linux + 156)
568#define __NR_sync (__NR_Linux + 157)
569#define __NR_acct (__NR_Linux + 158)
570#define __NR_settimeofday (__NR_Linux + 159)
571#define __NR_mount (__NR_Linux + 160)
572#define __NR_umount2 (__NR_Linux + 161)
573#define __NR_swapon (__NR_Linux + 162)
574#define __NR_swapoff (__NR_Linux + 163)
575#define __NR_reboot (__NR_Linux + 164)
576#define __NR_sethostname (__NR_Linux + 165)
577#define __NR_setdomainname (__NR_Linux + 166)
578#define __NR_create_module (__NR_Linux + 167)
579#define __NR_init_module (__NR_Linux + 168)
580#define __NR_delete_module (__NR_Linux + 169)
581#define __NR_get_kernel_syms (__NR_Linux + 170)
582#define __NR_query_module (__NR_Linux + 171)
583#define __NR_quotactl (__NR_Linux + 172)
584#define __NR_nfsservctl (__NR_Linux + 173)
585#define __NR_getpmsg (__NR_Linux + 174)
586#define __NR_putpmsg (__NR_Linux + 175)
587#define __NR_afs_syscall (__NR_Linux + 176)
588#define __NR_reserved177 (__NR_Linux + 177)
589#define __NR_gettid (__NR_Linux + 178)
590#define __NR_readahead (__NR_Linux + 179)
591#define __NR_setxattr (__NR_Linux + 180)
592#define __NR_lsetxattr (__NR_Linux + 181)
593#define __NR_fsetxattr (__NR_Linux + 182)
594#define __NR_getxattr (__NR_Linux + 183)
595#define __NR_lgetxattr (__NR_Linux + 184)
596#define __NR_fgetxattr (__NR_Linux + 185)
597#define __NR_listxattr (__NR_Linux + 186)
598#define __NR_llistxattr (__NR_Linux + 187)
599#define __NR_flistxattr (__NR_Linux + 188)
600#define __NR_removexattr (__NR_Linux + 189)
601#define __NR_lremovexattr (__NR_Linux + 190)
602#define __NR_fremovexattr (__NR_Linux + 191)
603#define __NR_tkill (__NR_Linux + 192)
604#define __NR_reserved193 (__NR_Linux + 193)
605#define __NR_futex (__NR_Linux + 194)
606#define __NR_sched_setaffinity (__NR_Linux + 195)
607#define __NR_sched_getaffinity (__NR_Linux + 196)
608#define __NR_cacheflush (__NR_Linux + 197)
609#define __NR_cachectl (__NR_Linux + 198)
610#define __NR_sysmips (__NR_Linux + 199)
611#define __NR_io_setup (__NR_Linux + 200)
612#define __NR_io_destroy (__NR_Linux + 201)
613#define __NR_io_getevents (__NR_Linux + 202)
614#define __NR_io_submit (__NR_Linux + 203)
615#define __NR_io_cancel (__NR_Linux + 204)
616#define __NR_exit_group (__NR_Linux + 205)
617#define __NR_lookup_dcookie (__NR_Linux + 206)
618#define __NR_epoll_create (__NR_Linux + 207)
619#define __NR_epoll_ctl (__NR_Linux + 208)
620#define __NR_epoll_wait (__NR_Linux + 209)
621#define __NR_remap_file_pages (__NR_Linux + 210)
622#define __NR_rt_sigreturn (__NR_Linux + 211)
623#define __NR_set_tid_address (__NR_Linux + 212)
624#define __NR_restart_syscall (__NR_Linux + 213)
625#define __NR_semtimedop (__NR_Linux + 214)
626#define __NR_fadvise64 (__NR_Linux + 215)
627#define __NR_timer_create (__NR_Linux + 216)
628#define __NR_timer_settime (__NR_Linux + 217)
629#define __NR_timer_gettime (__NR_Linux + 218)
630#define __NR_timer_getoverrun (__NR_Linux + 219)
631#define __NR_timer_delete (__NR_Linux + 220)
632#define __NR_clock_settime (__NR_Linux + 221)
633#define __NR_clock_gettime (__NR_Linux + 222)
634#define __NR_clock_getres (__NR_Linux + 223)
635#define __NR_clock_nanosleep (__NR_Linux + 224)
636#define __NR_tgkill (__NR_Linux + 225)
637#define __NR_utimes (__NR_Linux + 226)
638#define __NR_mbind (__NR_Linux + 227)
639#define __NR_get_mempolicy (__NR_Linux + 228)
640#define __NR_set_mempolicy (__NR_Linux + 229)
641#define __NR_mq_open (__NR_Linux + 230)
642#define __NR_mq_unlink (__NR_Linux + 231)
643#define __NR_mq_timedsend (__NR_Linux + 232)
644#define __NR_mq_timedreceive (__NR_Linux + 233)
645#define __NR_mq_notify (__NR_Linux + 234)
646#define __NR_mq_getsetattr (__NR_Linux + 235)
647#define __NR_vserver (__NR_Linux + 236)
648#define __NR_waitid (__NR_Linux + 237)
649/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
650#define __NR_add_key (__NR_Linux + 239)
651#define __NR_request_key (__NR_Linux + 240)
652#define __NR_keyctl (__NR_Linux + 241)
653#define __NR_set_thread_area (__NR_Linux + 242)
654#define __NR_inotify_init (__NR_Linux + 243)
655#define __NR_inotify_add_watch (__NR_Linux + 244)
656#define __NR_inotify_rm_watch (__NR_Linux + 245)
657#define __NR_migrate_pages (__NR_Linux + 246)
658#define __NR_openat (__NR_Linux + 247)
659#define __NR_mkdirat (__NR_Linux + 248)
660#define __NR_mknodat (__NR_Linux + 249)
661#define __NR_fchownat (__NR_Linux + 250)
662#define __NR_futimesat (__NR_Linux + 251)
663#define __NR_newfstatat (__NR_Linux + 252)
664#define __NR_unlinkat (__NR_Linux + 253)
665#define __NR_renameat (__NR_Linux + 254)
666#define __NR_linkat (__NR_Linux + 255)
667#define __NR_symlinkat (__NR_Linux + 256)
668#define __NR_readlinkat (__NR_Linux + 257)
669#define __NR_fchmodat (__NR_Linux + 258)
670#define __NR_faccessat (__NR_Linux + 259)
671#define __NR_pselect6 (__NR_Linux + 260)
672#define __NR_ppoll (__NR_Linux + 261)
673#define __NR_unshare (__NR_Linux + 262)
674#define __NR_splice (__NR_Linux + 263)
675#define __NR_sync_file_range (__NR_Linux + 264)
676#define __NR_tee (__NR_Linux + 265)
677#define __NR_vmsplice (__NR_Linux + 266)
678#define __NR_move_pages (__NR_Linux + 267)
679#define __NR_set_robust_list (__NR_Linux + 268)
680#define __NR_get_robust_list (__NR_Linux + 269)
681#define __NR_kexec_load (__NR_Linux + 270)
682#define __NR_getcpu (__NR_Linux + 271)
683#define __NR_epoll_pwait (__NR_Linux + 272)
684#define __NR_ioprio_set (__NR_Linux + 273)
685#define __NR_ioprio_get (__NR_Linux + 274)
686#define __NR_utimensat (__NR_Linux + 275)
687#define __NR_signalfd (__NR_Linux + 276)
688#define __NR_timerfd (__NR_Linux + 277)
689#define __NR_eventfd (__NR_Linux + 278)
690#define __NR_fallocate (__NR_Linux + 279)
691#define __NR_timerfd_create (__NR_Linux + 280)
692#define __NR_timerfd_gettime (__NR_Linux + 281)
693#define __NR_timerfd_settime (__NR_Linux + 282)
694#define __NR_signalfd4 (__NR_Linux + 283)
695#define __NR_eventfd2 (__NR_Linux + 284)
696#define __NR_epoll_create1 (__NR_Linux + 285)
697#define __NR_dup3 (__NR_Linux + 286)
698#define __NR_pipe2 (__NR_Linux + 287)
699#define __NR_inotify_init1 (__NR_Linux + 288)
700#define __NR_preadv (__NR_Linux + 289)
701#define __NR_pwritev (__NR_Linux + 290)
702#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
703#define __NR_perf_event_open (__NR_Linux + 292)
704#define __NR_accept4 (__NR_Linux + 293)
705#define __NR_recvmmsg (__NR_Linux + 294)
706#define __NR_fanotify_init (__NR_Linux + 295)
707#define __NR_fanotify_mark (__NR_Linux + 296)
708#define __NR_prlimit64 (__NR_Linux + 297)
709#define __NR_name_to_handle_at (__NR_Linux + 298)
710#define __NR_open_by_handle_at (__NR_Linux + 299)
711#define __NR_clock_adjtime (__NR_Linux + 300)
712#define __NR_syncfs (__NR_Linux + 301)
713#define __NR_sendmmsg (__NR_Linux + 302)
714#define __NR_setns (__NR_Linux + 303)
715#define __NR_process_vm_readv (__NR_Linux + 304)
716#define __NR_process_vm_writev (__NR_Linux + 305)
717#define __NR_kcmp (__NR_Linux + 306)
718#define __NR_finit_module (__NR_Linux + 307)
719#define __NR_getdents64 (__NR_Linux + 308)
720#define __NR_sched_setattr (__NR_Linux + 309)
721#define __NR_sched_getattr (__NR_Linux + 310)
722#define __NR_renameat2 (__NR_Linux + 311)
723#define __NR_seccomp (__NR_Linux + 312)
724#define __NR_getrandom (__NR_Linux + 313)
725#define __NR_memfd_create (__NR_Linux + 314)
726#define __NR_bpf (__NR_Linux + 315)
727#define __NR_execveat (__NR_Linux + 316)
728#define __NR_userfaultfd (__NR_Linux + 317)
729#define __NR_membarrier (__NR_Linux + 318)
730#define __NR_mlock2 (__NR_Linux + 319)
731#define __NR_copy_file_range (__NR_Linux + 320)
732#define __NR_preadv2 (__NR_Linux + 321)
733#define __NR_pwritev2 (__NR_Linux + 322)
734#define __NR_pkey_mprotect (__NR_Linux + 323)
735#define __NR_pkey_alloc (__NR_Linux + 324)
736#define __NR_pkey_free (__NR_Linux + 325)
737#define __NR_statx (__NR_Linux + 326)
738#define __NR_rseq (__NR_Linux + 327)
739#define __NR_io_pgetevents (__NR_Linux + 328)
740
741/*
742 * Offset of the last Linux 64-bit flavoured syscall
743 */
744#define __NR_Linux_syscalls 328
745
746#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
747
748#define __NR_64_Linux 5000
749#define __NR_64_Linux_syscalls 328
750
751#if _MIPS_SIM == _MIPS_SIM_NABI32
752
753/*
754 * Linux N32 syscalls are in the range from 6000 to 6999.
755 */
756#define __NR_Linux 6000
757#define __NR_read (__NR_Linux + 0)
758#define __NR_write (__NR_Linux + 1)
759#define __NR_open (__NR_Linux + 2)
760#define __NR_close (__NR_Linux + 3)
761#define __NR_stat (__NR_Linux + 4)
762#define __NR_fstat (__NR_Linux + 5)
763#define __NR_lstat (__NR_Linux + 6)
764#define __NR_poll (__NR_Linux + 7)
765#define __NR_lseek (__NR_Linux + 8)
766#define __NR_mmap (__NR_Linux + 9)
767#define __NR_mprotect (__NR_Linux + 10)
768#define __NR_munmap (__NR_Linux + 11)
769#define __NR_brk (__NR_Linux + 12)
770#define __NR_rt_sigaction (__NR_Linux + 13)
771#define __NR_rt_sigprocmask (__NR_Linux + 14)
772#define __NR_ioctl (__NR_Linux + 15)
773#define __NR_pread64 (__NR_Linux + 16)
774#define __NR_pwrite64 (__NR_Linux + 17)
775#define __NR_readv (__NR_Linux + 18)
776#define __NR_writev (__NR_Linux + 19)
777#define __NR_access (__NR_Linux + 20)
778#define __NR_pipe (__NR_Linux + 21)
779#define __NR__newselect (__NR_Linux + 22)
780#define __NR_sched_yield (__NR_Linux + 23)
781#define __NR_mremap (__NR_Linux + 24)
782#define __NR_msync (__NR_Linux + 25)
783#define __NR_mincore (__NR_Linux + 26)
784#define __NR_madvise (__NR_Linux + 27)
785#define __NR_shmget (__NR_Linux + 28)
786#define __NR_shmat (__NR_Linux + 29)
787#define __NR_shmctl (__NR_Linux + 30)
788#define __NR_dup (__NR_Linux + 31)
789#define __NR_dup2 (__NR_Linux + 32)
790#define __NR_pause (__NR_Linux + 33)
791#define __NR_nanosleep (__NR_Linux + 34)
792#define __NR_getitimer (__NR_Linux + 35)
793#define __NR_setitimer (__NR_Linux + 36)
794#define __NR_alarm (__NR_Linux + 37)
795#define __NR_getpid (__NR_Linux + 38)
796#define __NR_sendfile (__NR_Linux + 39)
797#define __NR_socket (__NR_Linux + 40)
798#define __NR_connect (__NR_Linux + 41)
799#define __NR_accept (__NR_Linux + 42)
800#define __NR_sendto (__NR_Linux + 43)
801#define __NR_recvfrom (__NR_Linux + 44)
802#define __NR_sendmsg (__NR_Linux + 45)
803#define __NR_recvmsg (__NR_Linux + 46)
804#define __NR_shutdown (__NR_Linux + 47)
805#define __NR_bind (__NR_Linux + 48)
806#define __NR_listen (__NR_Linux + 49)
807#define __NR_getsockname (__NR_Linux + 50)
808#define __NR_getpeername (__NR_Linux + 51)
809#define __NR_socketpair (__NR_Linux + 52)
810#define __NR_setsockopt (__NR_Linux + 53)
811#define __NR_getsockopt (__NR_Linux + 54)
812#define __NR_clone (__NR_Linux + 55)
813#define __NR_fork (__NR_Linux + 56)
814#define __NR_execve (__NR_Linux + 57)
815#define __NR_exit (__NR_Linux + 58)
816#define __NR_wait4 (__NR_Linux + 59)
817#define __NR_kill (__NR_Linux + 60)
818#define __NR_uname (__NR_Linux + 61)
819#define __NR_semget (__NR_Linux + 62)
820#define __NR_semop (__NR_Linux + 63)
821#define __NR_semctl (__NR_Linux + 64)
822#define __NR_shmdt (__NR_Linux + 65)
823#define __NR_msgget (__NR_Linux + 66)
824#define __NR_msgsnd (__NR_Linux + 67)
825#define __NR_msgrcv (__NR_Linux + 68)
826#define __NR_msgctl (__NR_Linux + 69)
827#define __NR_fcntl (__NR_Linux + 70)
828#define __NR_flock (__NR_Linux + 71)
829#define __NR_fsync (__NR_Linux + 72)
830#define __NR_fdatasync (__NR_Linux + 73)
831#define __NR_truncate (__NR_Linux + 74)
832#define __NR_ftruncate (__NR_Linux + 75)
833#define __NR_getdents (__NR_Linux + 76)
834#define __NR_getcwd (__NR_Linux + 77)
835#define __NR_chdir (__NR_Linux + 78)
836#define __NR_fchdir (__NR_Linux + 79)
837#define __NR_rename (__NR_Linux + 80)
838#define __NR_mkdir (__NR_Linux + 81)
839#define __NR_rmdir (__NR_Linux + 82)
840#define __NR_creat (__NR_Linux + 83)
841#define __NR_link (__NR_Linux + 84)
842#define __NR_unlink (__NR_Linux + 85)
843#define __NR_symlink (__NR_Linux + 86)
844#define __NR_readlink (__NR_Linux + 87)
845#define __NR_chmod (__NR_Linux + 88)
846#define __NR_fchmod (__NR_Linux + 89)
847#define __NR_chown (__NR_Linux + 90)
848#define __NR_fchown (__NR_Linux + 91)
849#define __NR_lchown (__NR_Linux + 92)
850#define __NR_umask (__NR_Linux + 93)
851#define __NR_gettimeofday (__NR_Linux + 94)
852#define __NR_getrlimit (__NR_Linux + 95)
853#define __NR_getrusage (__NR_Linux + 96)
854#define __NR_sysinfo (__NR_Linux + 97)
855#define __NR_times (__NR_Linux + 98)
856#define __NR_ptrace (__NR_Linux + 99)
857#define __NR_getuid (__NR_Linux + 100)
858#define __NR_syslog (__NR_Linux + 101)
859#define __NR_getgid (__NR_Linux + 102)
860#define __NR_setuid (__NR_Linux + 103)
861#define __NR_setgid (__NR_Linux + 104)
862#define __NR_geteuid (__NR_Linux + 105)
863#define __NR_getegid (__NR_Linux + 106)
864#define __NR_setpgid (__NR_Linux + 107)
865#define __NR_getppid (__NR_Linux + 108)
866#define __NR_getpgrp (__NR_Linux + 109)
867#define __NR_setsid (__NR_Linux + 110)
868#define __NR_setreuid (__NR_Linux + 111)
869#define __NR_setregid (__NR_Linux + 112)
870#define __NR_getgroups (__NR_Linux + 113)
871#define __NR_setgroups (__NR_Linux + 114)
872#define __NR_setresuid (__NR_Linux + 115)
873#define __NR_getresuid (__NR_Linux + 116)
874#define __NR_setresgid (__NR_Linux + 117)
875#define __NR_getresgid (__NR_Linux + 118)
876#define __NR_getpgid (__NR_Linux + 119)
877#define __NR_setfsuid (__NR_Linux + 120)
878#define __NR_setfsgid (__NR_Linux + 121)
879#define __NR_getsid (__NR_Linux + 122)
880#define __NR_capget (__NR_Linux + 123)
881#define __NR_capset (__NR_Linux + 124)
882#define __NR_rt_sigpending (__NR_Linux + 125)
883#define __NR_rt_sigtimedwait (__NR_Linux + 126)
884#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
885#define __NR_rt_sigsuspend (__NR_Linux + 128)
886#define __NR_sigaltstack (__NR_Linux + 129)
887#define __NR_utime (__NR_Linux + 130)
888#define __NR_mknod (__NR_Linux + 131)
889#define __NR_personality (__NR_Linux + 132)
890#define __NR_ustat (__NR_Linux + 133)
891#define __NR_statfs (__NR_Linux + 134)
892#define __NR_fstatfs (__NR_Linux + 135)
893#define __NR_sysfs (__NR_Linux + 136)
894#define __NR_getpriority (__NR_Linux + 137)
895#define __NR_setpriority (__NR_Linux + 138)
896#define __NR_sched_setparam (__NR_Linux + 139)
897#define __NR_sched_getparam (__NR_Linux + 140)
898#define __NR_sched_setscheduler (__NR_Linux + 141)
899#define __NR_sched_getscheduler (__NR_Linux + 142)
900#define __NR_sched_get_priority_max (__NR_Linux + 143)
901#define __NR_sched_get_priority_min (__NR_Linux + 144)
902#define __NR_sched_rr_get_interval (__NR_Linux + 145)
903#define __NR_mlock (__NR_Linux + 146)
904#define __NR_munlock (__NR_Linux + 147)
905#define __NR_mlockall (__NR_Linux + 148)
906#define __NR_munlockall (__NR_Linux + 149)
907#define __NR_vhangup (__NR_Linux + 150)
908#define __NR_pivot_root (__NR_Linux + 151)
909#define __NR__sysctl (__NR_Linux + 152)
910#define __NR_prctl (__NR_Linux + 153)
911#define __NR_adjtimex (__NR_Linux + 154)
912#define __NR_setrlimit (__NR_Linux + 155)
913#define __NR_chroot (__NR_Linux + 156)
914#define __NR_sync (__NR_Linux + 157)
915#define __NR_acct (__NR_Linux + 158)
916#define __NR_settimeofday (__NR_Linux + 159)
917#define __NR_mount (__NR_Linux + 160)
918#define __NR_umount2 (__NR_Linux + 161)
919#define __NR_swapon (__NR_Linux + 162)
920#define __NR_swapoff (__NR_Linux + 163)
921#define __NR_reboot (__NR_Linux + 164)
922#define __NR_sethostname (__NR_Linux + 165)
923#define __NR_setdomainname (__NR_Linux + 166)
924#define __NR_create_module (__NR_Linux + 167)
925#define __NR_init_module (__NR_Linux + 168)
926#define __NR_delete_module (__NR_Linux + 169)
927#define __NR_get_kernel_syms (__NR_Linux + 170)
928#define __NR_query_module (__NR_Linux + 171)
929#define __NR_quotactl (__NR_Linux + 172)
930#define __NR_nfsservctl (__NR_Linux + 173)
931#define __NR_getpmsg (__NR_Linux + 174)
932#define __NR_putpmsg (__NR_Linux + 175)
933#define __NR_afs_syscall (__NR_Linux + 176)
934#define __NR_reserved177 (__NR_Linux + 177)
935#define __NR_gettid (__NR_Linux + 178)
936#define __NR_readahead (__NR_Linux + 179)
937#define __NR_setxattr (__NR_Linux + 180)
938#define __NR_lsetxattr (__NR_Linux + 181)
939#define __NR_fsetxattr (__NR_Linux + 182)
940#define __NR_getxattr (__NR_Linux + 183)
941#define __NR_lgetxattr (__NR_Linux + 184)
942#define __NR_fgetxattr (__NR_Linux + 185)
943#define __NR_listxattr (__NR_Linux + 186)
944#define __NR_llistxattr (__NR_Linux + 187)
945#define __NR_flistxattr (__NR_Linux + 188)
946#define __NR_removexattr (__NR_Linux + 189)
947#define __NR_lremovexattr (__NR_Linux + 190)
948#define __NR_fremovexattr (__NR_Linux + 191)
949#define __NR_tkill (__NR_Linux + 192)
950#define __NR_reserved193 (__NR_Linux + 193)
951#define __NR_futex (__NR_Linux + 194)
952#define __NR_sched_setaffinity (__NR_Linux + 195)
953#define __NR_sched_getaffinity (__NR_Linux + 196)
954#define __NR_cacheflush (__NR_Linux + 197)
955#define __NR_cachectl (__NR_Linux + 198)
956#define __NR_sysmips (__NR_Linux + 199)
957#define __NR_io_setup (__NR_Linux + 200)
958#define __NR_io_destroy (__NR_Linux + 201)
959#define __NR_io_getevents (__NR_Linux + 202)
960#define __NR_io_submit (__NR_Linux + 203)
961#define __NR_io_cancel (__NR_Linux + 204)
962#define __NR_exit_group (__NR_Linux + 205)
963#define __NR_lookup_dcookie (__NR_Linux + 206)
964#define __NR_epoll_create (__NR_Linux + 207)
965#define __NR_epoll_ctl (__NR_Linux + 208)
966#define __NR_epoll_wait (__NR_Linux + 209)
967#define __NR_remap_file_pages (__NR_Linux + 210)
968#define __NR_rt_sigreturn (__NR_Linux + 211)
969#define __NR_fcntl64 (__NR_Linux + 212)
970#define __NR_set_tid_address (__NR_Linux + 213)
971#define __NR_restart_syscall (__NR_Linux + 214)
972#define __NR_semtimedop (__NR_Linux + 215)
973#define __NR_fadvise64 (__NR_Linux + 216)
974#define __NR_statfs64 (__NR_Linux + 217)
975#define __NR_fstatfs64 (__NR_Linux + 218)
976#define __NR_sendfile64 (__NR_Linux + 219)
977#define __NR_timer_create (__NR_Linux + 220)
978#define __NR_timer_settime (__NR_Linux + 221)
979#define __NR_timer_gettime (__NR_Linux + 222)
980#define __NR_timer_getoverrun (__NR_Linux + 223)
981#define __NR_timer_delete (__NR_Linux + 224)
982#define __NR_clock_settime (__NR_Linux + 225)
983#define __NR_clock_gettime (__NR_Linux + 226)
984#define __NR_clock_getres (__NR_Linux + 227)
985#define __NR_clock_nanosleep (__NR_Linux + 228)
986#define __NR_tgkill (__NR_Linux + 229)
987#define __NR_utimes (__NR_Linux + 230)
988#define __NR_mbind (__NR_Linux + 231)
989#define __NR_get_mempolicy (__NR_Linux + 232)
990#define __NR_set_mempolicy (__NR_Linux + 233)
991#define __NR_mq_open (__NR_Linux + 234)
992#define __NR_mq_unlink (__NR_Linux + 235)
993#define __NR_mq_timedsend (__NR_Linux + 236)
994#define __NR_mq_timedreceive (__NR_Linux + 237)
995#define __NR_mq_notify (__NR_Linux + 238)
996#define __NR_mq_getsetattr (__NR_Linux + 239)
997#define __NR_vserver (__NR_Linux + 240)
998#define __NR_waitid (__NR_Linux + 241)
999/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
1000#define __NR_add_key (__NR_Linux + 243)
1001#define __NR_request_key (__NR_Linux + 244)
1002#define __NR_keyctl (__NR_Linux + 245)
1003#define __NR_set_thread_area (__NR_Linux + 246)
1004#define __NR_inotify_init (__NR_Linux + 247)
1005#define __NR_inotify_add_watch (__NR_Linux + 248)
1006#define __NR_inotify_rm_watch (__NR_Linux + 249)
1007#define __NR_migrate_pages (__NR_Linux + 250)
1008#define __NR_openat (__NR_Linux + 251)
1009#define __NR_mkdirat (__NR_Linux + 252)
1010#define __NR_mknodat (__NR_Linux + 253)
1011#define __NR_fchownat (__NR_Linux + 254)
1012#define __NR_futimesat (__NR_Linux + 255)
1013#define __NR_newfstatat (__NR_Linux + 256)
1014#define __NR_unlinkat (__NR_Linux + 257)
1015#define __NR_renameat (__NR_Linux + 258)
1016#define __NR_linkat (__NR_Linux + 259)
1017#define __NR_symlinkat (__NR_Linux + 260)
1018#define __NR_readlinkat (__NR_Linux + 261)
1019#define __NR_fchmodat (__NR_Linux + 262)
1020#define __NR_faccessat (__NR_Linux + 263)
1021#define __NR_pselect6 (__NR_Linux + 264)
1022#define __NR_ppoll (__NR_Linux + 265)
1023#define __NR_unshare (__NR_Linux + 266)
1024#define __NR_splice (__NR_Linux + 267)
1025#define __NR_sync_file_range (__NR_Linux + 268)
1026#define __NR_tee (__NR_Linux + 269)
1027#define __NR_vmsplice (__NR_Linux + 270)
1028#define __NR_move_pages (__NR_Linux + 271)
1029#define __NR_set_robust_list (__NR_Linux + 272)
1030#define __NR_get_robust_list (__NR_Linux + 273)
1031#define __NR_kexec_load (__NR_Linux + 274)
1032#define __NR_getcpu (__NR_Linux + 275)
1033#define __NR_epoll_pwait (__NR_Linux + 276)
1034#define __NR_ioprio_set (__NR_Linux + 277)
1035#define __NR_ioprio_get (__NR_Linux + 278)
1036#define __NR_utimensat (__NR_Linux + 279)
1037#define __NR_signalfd (__NR_Linux + 280)
1038#define __NR_timerfd (__NR_Linux + 281)
1039#define __NR_eventfd (__NR_Linux + 282)
1040#define __NR_fallocate (__NR_Linux + 283)
1041#define __NR_timerfd_create (__NR_Linux + 284)
1042#define __NR_timerfd_gettime (__NR_Linux + 285)
1043#define __NR_timerfd_settime (__NR_Linux + 286)
1044#define __NR_signalfd4 (__NR_Linux + 287)
1045#define __NR_eventfd2 (__NR_Linux + 288)
1046#define __NR_epoll_create1 (__NR_Linux + 289)
1047#define __NR_dup3 (__NR_Linux + 290)
1048#define __NR_pipe2 (__NR_Linux + 291)
1049#define __NR_inotify_init1 (__NR_Linux + 292)
1050#define __NR_preadv (__NR_Linux + 293)
1051#define __NR_pwritev (__NR_Linux + 294)
1052#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1053#define __NR_perf_event_open (__NR_Linux + 296)
1054#define __NR_accept4 (__NR_Linux + 297)
1055#define __NR_recvmmsg (__NR_Linux + 298)
1056#define __NR_getdents64 (__NR_Linux + 299)
1057#define __NR_fanotify_init (__NR_Linux + 300)
1058#define __NR_fanotify_mark (__NR_Linux + 301)
1059#define __NR_prlimit64 (__NR_Linux + 302)
1060#define __NR_name_to_handle_at (__NR_Linux + 303)
1061#define __NR_open_by_handle_at (__NR_Linux + 304)
1062#define __NR_clock_adjtime (__NR_Linux + 305)
1063#define __NR_syncfs (__NR_Linux + 306)
1064#define __NR_sendmmsg (__NR_Linux + 307)
1065#define __NR_setns (__NR_Linux + 308)
1066#define __NR_process_vm_readv (__NR_Linux + 309)
1067#define __NR_process_vm_writev (__NR_Linux + 310)
1068#define __NR_kcmp (__NR_Linux + 311)
1069#define __NR_finit_module (__NR_Linux + 312)
1070#define __NR_sched_setattr (__NR_Linux + 313)
1071#define __NR_sched_getattr (__NR_Linux + 314)
1072#define __NR_renameat2 (__NR_Linux + 315)
1073#define __NR_seccomp (__NR_Linux + 316)
1074#define __NR_getrandom (__NR_Linux + 317)
1075#define __NR_memfd_create (__NR_Linux + 318)
1076#define __NR_bpf (__NR_Linux + 319)
1077#define __NR_execveat (__NR_Linux + 320)
1078#define __NR_userfaultfd (__NR_Linux + 321)
1079#define __NR_membarrier (__NR_Linux + 322)
1080#define __NR_mlock2 (__NR_Linux + 323)
1081#define __NR_copy_file_range (__NR_Linux + 324)
1082#define __NR_preadv2 (__NR_Linux + 325)
1083#define __NR_pwritev2 (__NR_Linux + 326)
1084#define __NR_pkey_mprotect (__NR_Linux + 327)
1085#define __NR_pkey_alloc (__NR_Linux + 328)
1086#define __NR_pkey_free (__NR_Linux + 329)
1087#define __NR_statx (__NR_Linux + 330)
1088#define __NR_rseq (__NR_Linux + 331)
1089#define __NR_io_pgetevents (__NR_Linux + 332)
1090
1091/*
1092 * Offset of the last N32 flavoured syscall
1093 */
1094#define __NR_Linux_syscalls 332
1095
1096#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1097
1098#define __NR_N32_Linux 6000
1099#define __NR_N32_Linux_syscalls 332
1100
1101#endif /* _ASM_UNISTD_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/bootx.h created+133
...@@ -0,0 +1,133 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file describes the structure passed from the BootX application
4 * (for MacOS) when it is used to boot Linux.
5 *
6 * Written by Benjamin Herrenschmidt.
7 */
8
9
10#ifndef __ASM_BOOTX_H__
11#define __ASM_BOOTX_H__
12
13#include <linux/types.h>
14
15#ifdef macintosh
16#include <Types.h>
17#include "linux_type_defs.h"
18#endif
19
20#ifdef macintosh
21/* All this requires PowerPC alignment */
22#pragma options align=power
23#endif
24
25/* On kernel entry:
26 *
27 * r3 = 0x426f6f58 ('BooX')
28 * r4 = pointer to boot_infos
29 * r5 = NULL
30 *
31 * Data and instruction translation disabled, interrupts
32 * disabled, kernel loaded at physical 0x00000000 on PCI
33 * machines (will be different on NuBus).
34 */
35
36#define BOOT_INFO_VERSION 5
37#define BOOT_INFO_COMPATIBLE_VERSION 1
38
39/* Bit in the architecture flag mask. More to be defined in
40 future versions. Note that either BOOT_ARCH_PCI or
41 BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
42 set additionally when BOOT_ARCH_NUBUS is set.
43 */
44#define BOOT_ARCH_PCI 0x00000001UL
45#define BOOT_ARCH_NUBUS 0x00000002UL
46#define BOOT_ARCH_NUBUS_PDM 0x00000010UL
47#define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL
48#define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL
49
50/* Maximum number of ranges in phys memory map */
51#define MAX_MEM_MAP_SIZE 26
52
53/* This is the format of an element in the physical memory map. Note that
54 the map is optional and current BootX will only build it for pre-PCI
55 machines */
56typedef struct boot_info_map_entry
57{
58 __u32 physAddr; /* Physical starting address */
59 __u32 size; /* Size in bytes */
60} boot_info_map_entry_t;
61
62
63/* Here are the boot informations that are passed to the bootstrap
64 * Note that the kernel arguments and the device tree are appended
65 * at the end of this structure. */
66typedef struct boot_infos
67{
68 /* Version of this structure */
69 __u32 version;
70 /* backward compatible down to version: */
71 __u32 compatible_version;
72
73 /* NEW (vers. 2) this holds the current _logical_ base addr of
74 the frame buffer (for use by early boot message) */
75 __u8* logicalDisplayBase;
76
77 /* NEW (vers. 4) Apple's machine identification */
78 __u32 machineID;
79
80 /* NEW (vers. 4) Detected hw architecture */
81 __u32 architecture;
82
83 /* The device tree (internal addresses relative to the beginning of the tree,
84 * device tree offset relative to the beginning of this structure).
85 * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
86 * field is 0.
87 */
88 __u32 deviceTreeOffset; /* Device tree offset */
89 __u32 deviceTreeSize; /* Size of the device tree */
90
91 /* Some infos about the current MacOS display */
92 __u32 dispDeviceRect[4]; /* left,top,right,bottom */
93 __u32 dispDeviceDepth; /* (8, 16 or 32) */
94 __u8* dispDeviceBase; /* base address (physical) */
95 __u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
96 __u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
97 /* Optional offset in the registry to the current
98 * MacOS display. (Can be 0 when not detected) */
99 __u32 dispDeviceRegEntryOffset;
100
101 /* Optional pointer to boot ramdisk (offset from this structure) */
102 __u32 ramDisk;
103 __u32 ramDiskSize; /* size of ramdisk image */
104
105 /* Kernel command line arguments (offset from this structure) */
106 __u32 kernelParamsOffset;
107
108 /* ALL BELOW NEW (vers. 4) */
109
110 /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
111 (non-PCI) only. On PCI, memory is contiguous and it's size is in the
112 device-tree. */
113 boot_info_map_entry_t
114 physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
115 __u32 physMemoryMapSize; /* How many entries in map */
116
117
118 /* The framebuffer size (optional, currently 0) */
119 __u32 frameBufferSize; /* Represents a max size, can be 0. */
120
121 /* NEW (vers. 5) */
122
123 /* Total params size (args + colormap + device tree + ramdisk) */
124 __u32 totalParamsSize;
125
126} boot_infos_t;
127
128
129#ifdef macintosh
130#pragma options align=reset
131#endif
132
133#endif /* __ASM_BOOTX_H__ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/bpf_perf_event.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/cputable.h created+63
...@@ -0,0 +1,63 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POWERPC_CPUTABLE_H
3#define __ASM_POWERPC_CPUTABLE_H
4
5/* in AT_HWCAP */
6#define PPC_FEATURE_32 0x80000000
7#define PPC_FEATURE_64 0x40000000
8#define PPC_FEATURE_601_INSTR 0x20000000
9#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
10#define PPC_FEATURE_HAS_FPU 0x08000000
11#define PPC_FEATURE_HAS_MMU 0x04000000
12#define PPC_FEATURE_HAS_4xxMAC 0x02000000
13#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
14#define PPC_FEATURE_HAS_SPE 0x00800000
15#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
16#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
17#define PPC_FEATURE_NO_TB 0x00100000
18#define PPC_FEATURE_POWER4 0x00080000
19#define PPC_FEATURE_POWER5 0x00040000
20#define PPC_FEATURE_POWER5_PLUS 0x00020000
21#define PPC_FEATURE_CELL 0x00010000
22#define PPC_FEATURE_BOOKE 0x00008000
23#define PPC_FEATURE_SMT 0x00004000
24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
25#define PPC_FEATURE_ARCH_2_05 0x00001000
26#define PPC_FEATURE_PA6T 0x00000800
27#define PPC_FEATURE_HAS_DFP 0x00000400
28#define PPC_FEATURE_POWER6_EXT 0x00000200
29#define PPC_FEATURE_ARCH_2_06 0x00000100
30#define PPC_FEATURE_HAS_VSX 0x00000080
31
32#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
33 0x00000040
34
35/* Reserved - do not use 0x00000004 */
36#define PPC_FEATURE_TRUE_LE 0x00000002
37#define PPC_FEATURE_PPC_LE 0x00000001
38
39/* in AT_HWCAP2 */
40#define PPC_FEATURE2_ARCH_2_07 0x80000000
41#define PPC_FEATURE2_HTM 0x40000000
42#define PPC_FEATURE2_DSCR 0x20000000
43#define PPC_FEATURE2_EBB 0x10000000
44#define PPC_FEATURE2_ISEL 0x08000000
45#define PPC_FEATURE2_TAR 0x04000000
46#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
47#define PPC_FEATURE2_HTM_NOSC 0x01000000
48#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */
49#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */
50#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
51#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
52#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended state */
53#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1 */
54#define PPC_FEATURE2_MMA 0x00020000 /* Matrix Multiply Assist */
55
56/*
57 * IMPORTANT!
58 * All future PPC_FEATURE definitions should be allocated in cooperation with
59 * OPAL / skiboot firmware, in accordance with the ibm,powerpc-cpu-features
60 * device tree binding.
61 */
62
63#endif /* __ASM_POWERPC_CPUTABLE_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/eeh.h created+57
...@@ -0,0 +1,57 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2015
17 *
18 * Authors: Gavin Shan <gwshan@linux.vnet.ibm.com>
19 */
20
21#ifndef _ASM_POWERPC_EEH_H
22#define _ASM_POWERPC_EEH_H
23
24/* PE states */
25#define EEH_PE_STATE_NORMAL 0 /* Normal state */
26#define EEH_PE_STATE_RESET 1 /* PE reset asserted */
27#define EEH_PE_STATE_STOPPED_IO_DMA 2 /* Frozen PE */
28#define EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
29#define EEH_PE_STATE_UNAVAIL 5 /* Unavailable */
30
31/* EEH error types and functions */
32#define EEH_ERR_TYPE_32 0 /* 32-bits error */
33#define EEH_ERR_TYPE_64 1 /* 64-bits error */
34#define EEH_ERR_FUNC_MIN 0
35#define EEH_ERR_FUNC_LD_MEM_ADDR 0 /* Memory load */
36#define EEH_ERR_FUNC_LD_MEM_DATA 1
37#define EEH_ERR_FUNC_LD_IO_ADDR 2 /* IO load */
38#define EEH_ERR_FUNC_LD_IO_DATA 3
39#define EEH_ERR_FUNC_LD_CFG_ADDR 4 /* Config load */
40#define EEH_ERR_FUNC_LD_CFG_DATA 5
41#define EEH_ERR_FUNC_ST_MEM_ADDR 6 /* Memory store */
42#define EEH_ERR_FUNC_ST_MEM_DATA 7
43#define EEH_ERR_FUNC_ST_IO_ADDR 8 /* IO store */
44#define EEH_ERR_FUNC_ST_IO_DATA 9
45#define EEH_ERR_FUNC_ST_CFG_ADDR 10 /* Config store */
46#define EEH_ERR_FUNC_ST_CFG_DATA 11
47#define EEH_ERR_FUNC_DMA_RD_ADDR 12 /* DMA read */
48#define EEH_ERR_FUNC_DMA_RD_DATA 13
49#define EEH_ERR_FUNC_DMA_RD_MASTER 14
50#define EEH_ERR_FUNC_DMA_RD_TARGET 15
51#define EEH_ERR_FUNC_DMA_WR_ADDR 16 /* DMA write */
52#define EEH_ERR_FUNC_DMA_WR_DATA 17
53#define EEH_ERR_FUNC_DMA_WR_MASTER 18
54#define EEH_ERR_FUNC_DMA_WR_TARGET 19
55#define EEH_ERR_FUNC_MAX 19
56
57#endif /* _ASM_POWERPC_EEH_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/elf.h created+300
...@@ -0,0 +1,300 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * ELF register definitions..
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#ifndef _ASM_POWERPC_ELF_H
11#define _ASM_POWERPC_ELF_H
12
13
14#include <linux/types.h>
15
16#include <asm/ptrace.h>
17#include <asm/cputable.h>
18#include <asm/auxvec.h>
19
20/* PowerPC relocations defined by the ABIs */
21#define R_PPC_NONE 0
22#define R_PPC_ADDR32 1 /* 32bit absolute address */
23#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
24#define R_PPC_ADDR16 3 /* 16bit absolute address */
25#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
26#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
27#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
28#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
29#define R_PPC_ADDR14_BRTAKEN 8
30#define R_PPC_ADDR14_BRNTAKEN 9
31#define R_PPC_REL24 10 /* PC relative 26 bit */
32#define R_PPC_REL14 11 /* PC relative 16 bit */
33#define R_PPC_REL14_BRTAKEN 12
34#define R_PPC_REL14_BRNTAKEN 13
35#define R_PPC_GOT16 14
36#define R_PPC_GOT16_LO 15
37#define R_PPC_GOT16_HI 16
38#define R_PPC_GOT16_HA 17
39#define R_PPC_PLTREL24 18
40#define R_PPC_COPY 19
41#define R_PPC_GLOB_DAT 20
42#define R_PPC_JMP_SLOT 21
43#define R_PPC_RELATIVE 22
44#define R_PPC_LOCAL24PC 23
45#define R_PPC_UADDR32 24
46#define R_PPC_UADDR16 25
47#define R_PPC_REL32 26
48#define R_PPC_PLT32 27
49#define R_PPC_PLTREL32 28
50#define R_PPC_PLT16_LO 29
51#define R_PPC_PLT16_HI 30
52#define R_PPC_PLT16_HA 31
53#define R_PPC_SDAREL16 32
54#define R_PPC_SECTOFF 33
55#define R_PPC_SECTOFF_LO 34
56#define R_PPC_SECTOFF_HI 35
57#define R_PPC_SECTOFF_HA 36
58
59/* PowerPC relocations defined for the TLS access ABI. */
60#define R_PPC_TLS 67 /* none (sym+add)@tls */
61#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */
62#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */
63#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
64#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
65#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
66#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */
67#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */
68#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
69#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
70#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
71#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */
72#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
73#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
74#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
75#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
76#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
77#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
78#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
79#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
80#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */
81#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */
82#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
83#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
84#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */
85#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */
86#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */
87#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */
88
89/* keep this the last entry. */
90#define R_PPC_NUM 95
91
92
93#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
94#define ELF_NFPREG 33 /* includes fpscr */
95#define ELF_NVMX 34 /* includes all vector registers */
96#define ELF_NVSX 32 /* includes all VSX registers */
97#define ELF_NTMSPRREG 3 /* include tfhar, tfiar, texasr */
98#define ELF_NEBB 3 /* includes ebbrr, ebbhr, bescr */
99#define ELF_NPMU 5 /* includes siar, sdar, sier, mmcr2, mmcr0 */
100#define ELF_NPKEY 3 /* includes amr, iamr, uamor */
101
102typedef unsigned long elf_greg_t64;
103typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG];
104
105typedef unsigned int elf_greg_t32;
106typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
107typedef elf_gregset_t32 compat_elf_gregset_t;
108
109/*
110 * ELF_ARCH, CLASS, and DATA are used to set parameters in the core dumps.
111 */
112#ifdef __powerpc64__
113# define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */
114# define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */
115# define ELF_NVSRHALFREG 32 /* Half the vsx registers */
116# define ELF_GREG_TYPE elf_greg_t64
117# define ELF_ARCH EM_PPC64
118# define ELF_CLASS ELFCLASS64
119typedef elf_greg_t64 elf_greg_t;
120typedef elf_gregset_t64 elf_gregset_t;
121#else
122# define ELF_NEVRREG 34 /* includes acc (as 2) */
123# define ELF_NVRREG 33 /* includes vscr */
124# define ELF_GREG_TYPE elf_greg_t32
125# define ELF_ARCH EM_PPC
126# define ELF_CLASS ELFCLASS32
127typedef elf_greg_t32 elf_greg_t;
128typedef elf_gregset_t32 elf_gregset_t;
129#endif /* __powerpc64__ */
130
131#ifdef __BIG_ENDIAN__
132#define ELF_DATA ELFDATA2MSB
133#else
134#define ELF_DATA ELFDATA2LSB
135#endif
136
137/* Floating point registers */
138typedef double elf_fpreg_t;
139typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
140
141/* Altivec registers */
142/*
143 * The entries with indexes 0-31 contain the corresponding vector registers.
144 * The entry with index 32 contains the vscr as the last word (offset 12)
145 * within the quadword. This allows the vscr to be stored as either a
146 * quadword (since it must be copied via a vector register to/from storage)
147 * or as a word.
148 *
149 * 64-bit kernel notes: The entry at index 33 contains the vrsave as the first
150 * word (offset 0) within the quadword.
151 *
152 * This definition of the VMX state is compatible with the current PPC32
153 * ptrace interface. This allows signal handling and ptrace to use the same
154 * structures. This also simplifies the implementation of a bi-arch
155 * (combined (32- and 64-bit) gdb.
156 *
157 * Note that it's _not_ compatible with 32 bits ucontext which stuffs the
158 * vrsave along with vscr and so only uses 33 vectors for the register set
159 */
160typedef __vector128 elf_vrreg_t;
161typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
162#ifdef __powerpc64__
163typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
164typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
165#endif
166
167/* PowerPC64 relocations defined by the ABIs */
168#define R_PPC64_NONE R_PPC_NONE
169#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address. */
170#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned. */
171#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address. */
172#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of abs. address. */
173#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of abs. address. */
174#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */
175#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned. */
176#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
177#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
178#define R_PPC64_REL24 R_PPC_REL24 /* PC relative 26 bit, word aligned. */
179#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit. */
180#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
181#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
182#define R_PPC64_GOT16 R_PPC_GOT16
183#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
184#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
185#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
186
187#define R_PPC64_COPY R_PPC_COPY
188#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
189#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
190#define R_PPC64_RELATIVE R_PPC_RELATIVE
191
192#define R_PPC64_UADDR32 R_PPC_UADDR32
193#define R_PPC64_UADDR16 R_PPC_UADDR16
194#define R_PPC64_REL32 R_PPC_REL32
195#define R_PPC64_PLT32 R_PPC_PLT32
196#define R_PPC64_PLTREL32 R_PPC_PLTREL32
197#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
198#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
199#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
200
201#define R_PPC64_SECTOFF R_PPC_SECTOFF
202#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
203#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
204#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
205#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2. */
206#define R_PPC64_ADDR64 38 /* doubleword64 S + A. */
207#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A). */
208#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A). */
209#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A). */
210#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A). */
211#define R_PPC64_UADDR64 43 /* doubleword64 S + A. */
212#define R_PPC64_REL64 44 /* doubleword64 S + A - P. */
213#define R_PPC64_PLT64 45 /* doubleword64 L + A. */
214#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P. */
215#define R_PPC64_TOC16 47 /* half16* S + A - .TOC. */
216#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.). */
217#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.). */
218#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.). */
219#define R_PPC64_TOC 51 /* doubleword64 .TOC. */
220#define R_PPC64_PLTGOT16 52 /* half16* M + A. */
221#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A). */
222#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A). */
223#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A). */
224
225#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2. */
226#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2. */
227#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2. */
228#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2. */
229#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2. */
230#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2. */
231#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2. */
232#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2. */
233#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2. */
234#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2. */
235#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2. */
236
237/* PowerPC64 relocations defined for the TLS access ABI. */
238#define R_PPC64_TLS 67 /* none (sym+add)@tls */
239#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */
240#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */
241#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
242#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
243#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
244#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */
245#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */
246#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
247#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
248#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
249#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */
250#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
251#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
252#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
253#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
254#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
255#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
256#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
257#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
258#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */
259#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
260#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
261#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
262#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */
263#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
264#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */
265#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */
266#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */
267#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */
268#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */
269#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */
270#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */
271#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */
272#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */
273#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */
274#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */
275#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */
276#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */
277#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */
278#define R_PPC64_TLSGD 107
279#define R_PPC64_TLSLD 108
280#define R_PPC64_TOCSAVE 109
281
282#define R_PPC64_ENTRY 118
283
284#define R_PPC64_REL16 249
285#define R_PPC64_REL16_LO 250
286#define R_PPC64_REL16_HI 251
287#define R_PPC64_REL16_HA 252
288
289/* Keep this the last entry. */
290#define R_PPC64_NUM 253
291
292/* There's actually a third entry here, but it's unused */
293struct ppc64_opd_entry
294{
295 unsigned long funcaddr;
296 unsigned long r2;
297};
298
299
300#endif /* _ASM_POWERPC_ELF_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/epapr_hcalls.h created+99
...@@ -0,0 +1,99 @@
1/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * ePAPR hcall interface
4 *
5 * Copyright 2008-2011 Freescale Semiconductor, Inc.
6 *
7 * Author: Timur Tabi <timur@freescale.com>
8 *
9 * This file is provided under a dual BSD/GPL license. When using or
10 * redistributing this file, you may do so under either license.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * * Neither the name of Freescale Semiconductor nor the
20 * names of its contributors may be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 *
24 * ALTERNATIVELY, this software may be distributed under the terms of the
25 * GNU General Public License ("GPL") as published by the Free Software
26 * Foundation, either version 2 of that License or (at your option) any
27 * later version.
28 *
29 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
30 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 */
40
41#ifndef _ASM_POWERPC_EPAPR_HCALLS_H
42#define _ASM_POWERPC_EPAPR_HCALLS_H
43
44#define EV_BYTE_CHANNEL_SEND 1
45#define EV_BYTE_CHANNEL_RECEIVE 2
46#define EV_BYTE_CHANNEL_POLL 3
47#define EV_INT_SET_CONFIG 4
48#define EV_INT_GET_CONFIG 5
49#define EV_INT_SET_MASK 6
50#define EV_INT_GET_MASK 7
51#define EV_INT_IACK 9
52#define EV_INT_EOI 10
53#define EV_INT_SEND_IPI 11
54#define EV_INT_SET_TASK_PRIORITY 12
55#define EV_INT_GET_TASK_PRIORITY 13
56#define EV_DOORBELL_SEND 14
57#define EV_MSGSND 15
58#define EV_IDLE 16
59
60/* vendor ID: epapr */
61#define EV_LOCAL_VENDOR_ID 0 /* for private use */
62#define EV_EPAPR_VENDOR_ID 1
63#define EV_FSL_VENDOR_ID 2 /* Freescale Semiconductor */
64#define EV_IBM_VENDOR_ID 3 /* IBM */
65#define EV_GHS_VENDOR_ID 4 /* Green Hills Software */
66#define EV_ENEA_VENDOR_ID 5 /* Enea */
67#define EV_WR_VENDOR_ID 6 /* Wind River Systems */
68#define EV_AMCC_VENDOR_ID 7 /* Applied Micro Circuits */
69#define EV_KVM_VENDOR_ID 42 /* KVM */
70
71/* The max number of bytes that a byte channel can send or receive per call */
72#define EV_BYTE_CHANNEL_MAX_BYTES 16
73
74
75#define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
76#define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)
77
78/* epapr return codes */
79#define EV_SUCCESS 0
80#define EV_EPERM 1 /* Operation not permitted */
81#define EV_ENOENT 2 /* Entry Not Found */
82#define EV_EIO 3 /* I/O error occurred */
83#define EV_EAGAIN 4 /* The operation had insufficient
84 * resources to complete and should be
85 * retried
86 */
87#define EV_ENOMEM 5 /* There was insufficient memory to
88 * complete the operation */
89#define EV_EFAULT 6 /* Bad guest address */
90#define EV_ENODEV 7 /* No such device */
91#define EV_EINVAL 8 /* An argument supplied to the hcall
92 was out of range or invalid */
93#define EV_INTERNAL 9 /* An internal error occurred */
94#define EV_CONFIG 10 /* A configuration error was detected */
95#define EV_INVALID_STATE 11 /* The object is in an invalid state */
96#define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */
97#define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */
98
99#endif /* _ASM_POWERPC_EPAPR_HCALLS_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/errno.h+1
...@@ -2,6 +2,7 @@...@@ -2,6 +2,7 @@
2#ifndef _ASM_POWERPC_ERRNO_H2#ifndef _ASM_POWERPC_ERRNO_H
3#define _ASM_POWERPC_ERRNO_H3#define _ASM_POWERPC_ERRNO_H
44
5#undef EDEADLOCK
5#include <asm-generic/errno.h>6#include <asm-generic/errno.h>
67
7#undef EDEADLOCK8#undef EDEADLOCK
lib/libc/include/powerpc-linux-any/asm/ioctls.h+2
...@@ -102,6 +102,8 @@...@@ -102,6 +102,8 @@
102#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */102#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
103#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */103#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
104#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */104#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
105#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
106#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
105107
106#define TIOCSERCONFIG 0x5453108#define TIOCSERCONFIG 0x5453
107#define TIOCSERGWILD 0x5454109#define TIOCSERGWILD 0x5454
lib/libc/include/powerpc-linux-any/asm/kvm.h+59
...@@ -463,10 +463,12 @@ struct kvm_ppc_cpu_char {...@@ -463,10 +463,12 @@ struct kvm_ppc_cpu_char {
463#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)463#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)
464#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)464#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
465#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)465#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
466#define KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST (1ull << 54)
466467
467#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)468#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
468#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)469#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
469#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)470#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
471#define KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE (1ull << 58)
470472
471/* Per-vcpu XICS interrupt controller state */473/* Per-vcpu XICS interrupt controller state */
472#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)474#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
...@@ -480,6 +482,8 @@ struct kvm_ppc_cpu_char {...@@ -480,6 +482,8 @@ struct kvm_ppc_cpu_char {
480#define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */482#define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */
481#define KVM_REG_PPC_ICP_PPRI_MASK 0xff483#define KVM_REG_PPC_ICP_PPRI_MASK 0xff
482484
485#define KVM_REG_PPC_VP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x8d)
486
483/* Device control API: PPC-specific devices */487/* Device control API: PPC-specific devices */
484#define KVM_DEV_MPIC_GRP_MISC 1488#define KVM_DEV_MPIC_GRP_MISC 1
485#define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */489#define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */
...@@ -634,6 +638,14 @@ struct kvm_ppc_cpu_char {...@@ -634,6 +638,14 @@ struct kvm_ppc_cpu_char {
634638
635#define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)639#define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
636#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)640#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)
641#define KVM_REG_PPC_PTCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc0)
642
643/* POWER10 registers */
644#define KVM_REG_PPC_MMCR3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc1)
645#define KVM_REG_PPC_SIER2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc2)
646#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)
647#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)
648#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)
637649
638/* Transactional Memory checkpointed state:650/* Transactional Memory checkpointed state:
639 * This is all GPRs, all VSX regs and a subset of SPRs651 * This is all GPRs, all VSX regs and a subset of SPRs
...@@ -662,6 +674,8 @@ struct kvm_ppc_cpu_char {...@@ -662,6 +674,8 @@ struct kvm_ppc_cpu_char {
662674
663/* PPC64 eXternal Interrupt Controller Specification */675/* PPC64 eXternal Interrupt Controller Specification */
664#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */676#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
677#define KVM_DEV_XICS_GRP_CTRL 2
678#define KVM_DEV_XICS_NR_SERVERS 1
665679
666/* Layout of 64-bit source attribute values */680/* Layout of 64-bit source attribute values */
667#define KVM_XICS_DESTINATION_SHIFT 0681#define KVM_XICS_DESTINATION_SHIFT 0
...@@ -674,4 +688,49 @@ struct kvm_ppc_cpu_char {...@@ -674,4 +688,49 @@ struct kvm_ppc_cpu_char {
674#define KVM_XICS_PRESENTED (1ULL << 43)688#define KVM_XICS_PRESENTED (1ULL << 43)
675#define KVM_XICS_QUEUED (1ULL << 44)689#define KVM_XICS_QUEUED (1ULL << 44)
676690
691/* POWER9 XIVE Native Interrupt Controller */
692#define KVM_DEV_XIVE_GRP_CTRL 1
693#define KVM_DEV_XIVE_RESET 1
694#define KVM_DEV_XIVE_EQ_SYNC 2
695#define KVM_DEV_XIVE_NR_SERVERS 3
696#define KVM_DEV_XIVE_GRP_SOURCE 2 /* 64-bit source identifier */
697#define KVM_DEV_XIVE_GRP_SOURCE_CONFIG 3 /* 64-bit source identifier */
698#define KVM_DEV_XIVE_GRP_EQ_CONFIG 4 /* 64-bit EQ identifier */
699#define KVM_DEV_XIVE_GRP_SOURCE_SYNC 5 /* 64-bit source identifier */
700
701/* Layout of 64-bit XIVE source attribute values */
702#define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0)
703#define KVM_XIVE_LEVEL_ASSERTED (1ULL << 1)
704
705/* Layout of 64-bit XIVE source configuration attribute values */
706#define KVM_XIVE_SOURCE_PRIORITY_SHIFT 0
707#define KVM_XIVE_SOURCE_PRIORITY_MASK 0x7
708#define KVM_XIVE_SOURCE_SERVER_SHIFT 3
709#define KVM_XIVE_SOURCE_SERVER_MASK 0xfffffff8ULL
710#define KVM_XIVE_SOURCE_MASKED_SHIFT 32
711#define KVM_XIVE_SOURCE_MASKED_MASK 0x100000000ULL
712#define KVM_XIVE_SOURCE_EISN_SHIFT 33
713#define KVM_XIVE_SOURCE_EISN_MASK 0xfffffffe00000000ULL
714
715/* Layout of 64-bit EQ identifier */
716#define KVM_XIVE_EQ_PRIORITY_SHIFT 0
717#define KVM_XIVE_EQ_PRIORITY_MASK 0x7
718#define KVM_XIVE_EQ_SERVER_SHIFT 3
719#define KVM_XIVE_EQ_SERVER_MASK 0xfffffff8ULL
720
721/* Layout of EQ configuration values (64 bytes) */
722struct kvm_ppc_xive_eq {
723 __u32 flags;
724 __u32 qshift;
725 __u64 qaddr;
726 __u32 qtoggle;
727 __u32 qindex;
728 __u8 pad[40];
729};
730
731#define KVM_XIVE_EQ_ALWAYS_NOTIFY 0x00000001
732
733#define KVM_XIVE_TIMA_PAGE_OFFSET 0
734#define KVM_XIVE_ESB_PAGE_OFFSET 4
735
677#endif /* __LINUX_KVM_POWERPC_H */736#endif /* __LINUX_KVM_POWERPC_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/kvm_para.h+1-1
...@@ -31,7 +31,7 @@...@@ -31,7 +31,7 @@
31 * Struct fields are always 32 or 64 bit aligned, depending on them being 3231 * Struct fields are always 32 or 64 bit aligned, depending on them being 32
32 * or 64 bit wide respectively.32 * or 64 bit wide respectively.
33 *33 *
34 * See Documentation/virtual/kvm/ppc-pv.txt34 * See Documentation/virt/kvm/ppc-pv.rst
35 */35 */
36struct kvm_vcpu_arch_shared {36struct kvm_vcpu_arch_shared {
37 __u64 scratch1;37 __u64 scratch1;
lib/libc/include/powerpc-linux-any/asm/mman.h+1-5
...@@ -21,15 +21,11 @@...@@ -21,15 +21,11 @@
21#define MAP_DENYWRITE 0x0800 /* ETXTBSY */21#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
22#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */22#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
2323
24
24#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */25#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
25#define MCL_FUTURE 0x4000 /* lock all additions to address space */26#define MCL_FUTURE 0x4000 /* lock all additions to address space */
26#define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */27#define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */
2728
28#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
29#define MAP_NONBLOCK 0x10000 /* do not block on IO */
30#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
31#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
32
33/* Override any generic PKEY permission defines */29/* Override any generic PKEY permission defines */
34#define PKEY_DISABLE_EXECUTE 0x430#define PKEY_DISABLE_EXECUTE 0x4
35#undef PKEY_ACCESS_MASK31#undef PKEY_ACCESS_MASK
lib/libc/include/powerpc-linux-any/asm/msgbuf.h+5-3
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef _ASM_POWERPC_MSGBUF_H2#ifndef _ASM_POWERPC_MSGBUF_H
3#define _ASM_POWERPC_MSGBUF_H3#define _ASM_POWERPC_MSGBUF_H
44
5#include <asm/ipcbuf.h>
6
5/*7/*
6 * The msqid64_ds structure for the PowerPC architecture.8 * The msqid64_ds structure for the PowerPC architecture.
7 * Note extra padding because this structure is passed back and forth9 * Note extra padding because this structure is passed back and forth
...@@ -11,9 +13,9 @@...@@ -11,9 +13,9 @@
11struct msqid64_ds {13struct msqid64_ds {
12 struct ipc64_perm msg_perm;14 struct ipc64_perm msg_perm;
13#ifdef __powerpc64__15#ifdef __powerpc64__
14 __kernel_time_t msg_stime; /* last msgsnd time */16 long msg_stime; /* last msgsnd time */
15 __kernel_time_t msg_rtime; /* last msgrcv time */17 long msg_rtime; /* last msgrcv time */
16 __kernel_time_t msg_ctime; /* last change time */18 long msg_ctime; /* last change time */
17#else19#else
18 unsigned long msg_stime_high;20 unsigned long msg_stime_high;
19 unsigned long msg_stime; /* last msgsnd time */21 unsigned long msg_stime; /* last msgsnd time */
lib/libc/include/powerpc-linux-any/asm/nvram.h created+63
...@@ -0,0 +1,63 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * NVRAM definitions and access functions.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _ASM_POWERPC_NVRAM_H
12#define _ASM_POWERPC_NVRAM_H
13
14/* Signatures for nvram partitions */
15#define NVRAM_SIG_SP 0x02 /* support processor */
16#define NVRAM_SIG_OF 0x50 /* open firmware config */
17#define NVRAM_SIG_FW 0x51 /* general firmware */
18#define NVRAM_SIG_HW 0x52 /* hardware (VPD) */
19#define NVRAM_SIG_FLIP 0x5a /* Apple flip/flop header */
20#define NVRAM_SIG_APPL 0x5f /* Apple "system" (???) */
21#define NVRAM_SIG_SYS 0x70 /* system env vars */
22#define NVRAM_SIG_CFG 0x71 /* config data */
23#define NVRAM_SIG_ELOG 0x72 /* error log */
24#define NVRAM_SIG_VEND 0x7e /* vendor defined */
25#define NVRAM_SIG_FREE 0x7f /* Free space */
26#define NVRAM_SIG_OS 0xa0 /* OS defined */
27#define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */
28
29
30/* PowerMac specific nvram stuffs */
31
32enum {
33 pmac_nvram_OF, /* Open Firmware partition */
34 pmac_nvram_XPRAM, /* MacOS XPRAM partition */
35 pmac_nvram_NR /* MacOS Name Registry partition */
36};
37
38
39/* Some offsets in XPRAM */
40#define PMAC_XPRAM_MACHINE_LOC 0xe4
41#define PMAC_XPRAM_SOUND_VOLUME 0x08
42
43/* Machine location structure in PowerMac XPRAM */
44struct pmac_machine_location {
45 unsigned int latitude; /* 2+30 bit Fractional number */
46 unsigned int longitude; /* 2+30 bit Fractional number */
47 unsigned int delta; /* mix of GMT delta and DLS */
48};
49
50/*
51 * /dev/nvram ioctls
52 *
53 * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
54 * definitely obsolete. Do not use it if you can avoid it
55 */
56
57#define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
58 _IOWR('p', 0x40, int)
59
60#define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */
61#define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */
62
63#endif /* _ASM_POWERPC_NVRAM_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/opal-prd.h created+59
...@@ -0,0 +1,59 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * OPAL Runtime Diagnostics interface driver
4 * Supported on POWERNV platform
5 *
6 * (C) Copyright IBM 2015
7 *
8 * Author: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
9 * Author: Jeremy Kerr <jk@ozlabs.org>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
14 * any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 */
21
22#ifndef _ASM_POWERPC_OPAL_PRD_H_
23#define _ASM_POWERPC_OPAL_PRD_H_
24
25#include <linux/types.h>
26
27/**
28 * The version of the kernel interface of the PRD system. This describes the
29 * interface available for the /dev/opal-prd device. The actual PRD message
30 * layout and content is private to the firmware <--> userspace interface, so
31 * is not covered by this versioning.
32 *
33 * Future interface versions are backwards-compatible; if a later kernel
34 * version is encountered, functionality provided in earlier versions
35 * will work.
36 */
37#define OPAL_PRD_KERNEL_VERSION 1
38
39#define OPAL_PRD_GET_INFO _IOR('o', 0x01, struct opal_prd_info)
40#define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom)
41#define OPAL_PRD_SCOM_WRITE _IOW('o', 0x03, struct opal_prd_scom)
42
43#ifndef __ASSEMBLY__
44
45struct opal_prd_info {
46 __u64 version;
47 __u64 reserved[3];
48};
49
50struct opal_prd_scom {
51 __u64 chip;
52 __u64 addr;
53 __u64 data;
54 __s64 rc;
55};
56
57#endif /* __ASSEMBLY__ */
58
59#endif /* _ASM_POWERPC_OPAL_PRD_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr_pdsm.h created+147
...@@ -0,0 +1,147 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
4 *
5 * (C) Copyright IBM 2020
6 *
7 * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
8 */
9
10#ifndef _ASM_POWERPC_PAPR_PDSM_H_
11#define _ASM_POWERPC_PAPR_PDSM_H_
12
13#include <linux/types.h>
14#include <linux/ndctl.h>
15
16/*
17 * PDSM Envelope:
18 *
19 * The ioctl ND_CMD_CALL exchange data between user-space and kernel via
20 * envelope which consists of 2 headers sections and payload sections as
21 * illustrated below:
22 * +-----------------+---------------+---------------------------+
23 * | 64-Bytes | 8-Bytes | Max 184-Bytes |
24 * +-----------------+---------------+---------------------------+
25 * | ND-HEADER | PDSM-HEADER | PDSM-PAYLOAD |
26 * +-----------------+---------------+---------------------------+
27 * | nd_family | | |
28 * | nd_size_out | cmd_status | |
29 * | nd_size_in | reserved | nd_pdsm_payload |
30 * | nd_command | payload --> | |
31 * | nd_fw_size | | |
32 * | nd_payload ---> | | |
33 * +---------------+-----------------+---------------------------+
34 *
35 * ND Header:
36 * This is the generic libnvdimm header described as 'struct nd_cmd_pkg'
37 * which is interpreted by libnvdimm before passed on to papr_scm. Important
38 * member fields used are:
39 * 'nd_family' : (In) NVDIMM_FAMILY_PAPR_SCM
40 * 'nd_size_in' : (In) PDSM-HEADER + PDSM-IN-PAYLOAD (usually 0)
41 * 'nd_size_out' : (In) PDSM-HEADER + PDSM-RETURN-PAYLOAD
42 * 'nd_command' : (In) One of PAPR_PDSM_XXX
43 * 'nd_fw_size' : (Out) PDSM-HEADER + size of actual payload returned
44 *
45 * PDSM Header:
46 * This is papr-scm specific header that precedes the payload. This is defined
47 * as nd_cmd_pdsm_pkg. Following fields aare available in this header:
48 *
49 * 'cmd_status' : (Out) Errors if any encountered while servicing PDSM.
50 * 'reserved' : Not used, reserved for future and should be set to 0.
51 * 'payload' : A union of all the possible payload structs
52 *
53 * PDSM Payload:
54 *
55 * The layout of the PDSM Payload is defined by various structs shared between
56 * papr_scm and libndctl so that contents of payload can be interpreted. As such
57 * its defined as a union of all possible payload structs as
58 * 'union nd_pdsm_payload'. Based on the value of 'nd_cmd_pkg.nd_command'
59 * appropriate member of the union is accessed.
60 */
61
62/* Max payload size that we can handle */
63#define ND_PDSM_PAYLOAD_MAX_SIZE 184
64
65/* Max payload size that we can handle */
66#define ND_PDSM_HDR_SIZE \
67 (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
68
69/* Various nvdimm health indicators */
70#define PAPR_PDSM_DIMM_HEALTHY 0
71#define PAPR_PDSM_DIMM_UNHEALTHY 1
72#define PAPR_PDSM_DIMM_CRITICAL 2
73#define PAPR_PDSM_DIMM_FATAL 3
74
75/* struct nd_papr_pdsm_health.extension_flags field flags */
76
77/* Indicate that the 'dimm_fuel_gauge' field is valid */
78#define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
79
80/* Indicate that the 'dimm_dsc' field is valid */
81#define PDSM_DIMM_DSC_VALID 2
82
83/*
84 * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
85 * Various flags indicate the health status of the dimm.
86 *
87 * extension_flags : Any extension fields present in the struct.
88 * dimm_unarmed : Dimm not armed. So contents wont persist.
89 * dimm_bad_shutdown : Previous shutdown did not persist contents.
90 * dimm_bad_restore : Contents from previous shutdown werent restored.
91 * dimm_scrubbed : Contents of the dimm have been scrubbed.
92 * dimm_locked : Contents of the dimm cant be modified until CEC reboot
93 * dimm_encrypted : Contents of dimm are encrypted.
94 * dimm_health : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
95 * dimm_fuel_gauge : Life remaining of DIMM as a percentage from 0-100
96 */
97struct nd_papr_pdsm_health {
98 union {
99 struct {
100 __u32 extension_flags;
101 __u8 dimm_unarmed;
102 __u8 dimm_bad_shutdown;
103 __u8 dimm_bad_restore;
104 __u8 dimm_scrubbed;
105 __u8 dimm_locked;
106 __u8 dimm_encrypted;
107 __u16 dimm_health;
108
109 /* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
110 __u16 dimm_fuel_gauge;
111
112 /* Extension flag PDSM_DIMM_DSC_VALID */
113 __u64 dimm_dsc;
114 };
115 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
116 };
117};
118
119/*
120 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
121 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
122 */
123enum papr_pdsm {
124 PAPR_PDSM_MIN = 0x0,
125 PAPR_PDSM_HEALTH,
126 PAPR_PDSM_MAX,
127};
128
129/* Maximal union that can hold all possible payload types */
130union nd_pdsm_payload {
131 struct nd_papr_pdsm_health health;
132 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
133} __attribute__((packed));
134
135/*
136 * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
137 * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
138 * that should always precede this struct when sent to papr_scm via CMD_CALL
139 * interface.
140 */
141struct nd_pkg_pdsm {
142 __s32 cmd_status; /* Out: Sub-cmd status returned back */
143 __u16 reserved[2]; /* Ignored and to be set as '0' */
144 union nd_pdsm_payload payload;
145} __attribute__((packed));
146
147#endif /* _ASM_POWERPC_PAPR_PDSM_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/perf_event.h created+19
...@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 2013 Michael Ellerman, IBM Corp.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; version 2 of the
8 * License.
9 */
10
11#ifndef _ASM_POWERPC_PERF_EVENT_H
12#define _ASM_POWERPC_PERF_EVENT_H
13
14/*
15 * We use bit 63 of perf_event_attr.config as a flag to request EBB.
16 */
17#define PERF_EVENT_CONFIG_EBB_SHIFT 63
18
19#endif /* _ASM_POWERPC_PERF_EVENT_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/perf_regs.h+45-1
...@@ -46,6 +46,50 @@ enum perf_event_powerpc_regs {...@@ -46,6 +46,50 @@ enum perf_event_powerpc_regs {
46 PERF_REG_POWERPC_TRAP,46 PERF_REG_POWERPC_TRAP,
47 PERF_REG_POWERPC_DAR,47 PERF_REG_POWERPC_DAR,
48 PERF_REG_POWERPC_DSISR,48 PERF_REG_POWERPC_DSISR,
49 PERF_REG_POWERPC_MAX,49 PERF_REG_POWERPC_SIER,
50 PERF_REG_POWERPC_MMCRA,
51 /* Extended registers */
52 PERF_REG_POWERPC_MMCR0,
53 PERF_REG_POWERPC_MMCR1,
54 PERF_REG_POWERPC_MMCR2,
55 PERF_REG_POWERPC_MMCR3,
56 PERF_REG_POWERPC_SIER2,
57 PERF_REG_POWERPC_SIER3,
58 PERF_REG_POWERPC_PMC1,
59 PERF_REG_POWERPC_PMC2,
60 PERF_REG_POWERPC_PMC3,
61 PERF_REG_POWERPC_PMC4,
62 PERF_REG_POWERPC_PMC5,
63 PERF_REG_POWERPC_PMC6,
64 PERF_REG_POWERPC_SDAR,
65 PERF_REG_POWERPC_SIAR,
66 /* Max mask value for interrupt regs w/o extended regs */
67 PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
68 /* Max mask value for interrupt regs including extended regs */
69 PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_SIAR + 1,
50};70};
71
72#define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)
73
74/*
75 * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300
76 * includes 11 SPRS from MMCR0 to SIAR excluding the
77 * unsupported SPRS MMCR3, SIER2 and SIER3.
78 */
79#define PERF_REG_PMU_MASK_300 \
80 ((1ULL << PERF_REG_POWERPC_MMCR0) | (1ULL << PERF_REG_POWERPC_MMCR1) | \
81 (1ULL << PERF_REG_POWERPC_MMCR2) | (1ULL << PERF_REG_POWERPC_PMC1) | \
82 (1ULL << PERF_REG_POWERPC_PMC2) | (1ULL << PERF_REG_POWERPC_PMC3) | \
83 (1ULL << PERF_REG_POWERPC_PMC4) | (1ULL << PERF_REG_POWERPC_PMC5) | \
84 (1ULL << PERF_REG_POWERPC_PMC6) | (1ULL << PERF_REG_POWERPC_SDAR) | \
85 (1ULL << PERF_REG_POWERPC_SIAR))
86
87/*
88 * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31
89 * includes 14 SPRs from MMCR0 to SIAR.
90 */
91#define PERF_REG_PMU_MASK_31 \
92 (PERF_REG_PMU_MASK_300 | (1ULL << PERF_REG_POWERPC_MMCR3) | \
93 (1ULL << PERF_REG_POWERPC_SIER2) | (1ULL << PERF_REG_POWERPC_SIER3))
94
51#endif /* _ASM_POWERPC_PERF_REGS_H */95#endif /* _ASM_POWERPC_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/posix_types.h-5
...@@ -12,11 +12,6 @@...@@ -12,11 +12,6 @@
12typedef unsigned long __kernel_old_dev_t;12typedef unsigned long __kernel_old_dev_t;
13#define __kernel_old_dev_t __kernel_old_dev_t13#define __kernel_old_dev_t __kernel_old_dev_t
14#else14#else
15typedef unsigned int __kernel_size_t;
16typedef int __kernel_ssize_t;
17typedef long __kernel_ptrdiff_t;
18#define __kernel_size_t __kernel_size_t
19
20typedef short __kernel_ipc_pid_t;15typedef short __kernel_ipc_pid_t;
21#define __kernel_ipc_pid_t __kernel_ipc_pid_t16#define __kernel_ipc_pid_t __kernel_ipc_pid_t
22#endif17#endif
lib/libc/include/powerpc-linux-any/asm/ps3fb.h created+46
...@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2006 Sony Computer Entertainment Inc.
4 * Copyright 2006, 2007 Sony Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef _ASM_POWERPC_PS3FB_H_
21#define _ASM_POWERPC_PS3FB_H_
22
23#include <linux/types.h>
24#include <linux/ioctl.h>
25
26/* ioctl */
27#define PS3FB_IOCTL_SETMODE _IOW('r', 1, int) /* set video mode */
28#define PS3FB_IOCTL_GETMODE _IOR('r', 2, int) /* get video mode */
29#define PS3FB_IOCTL_SCREENINFO _IOR('r', 3, int) /* get screen info */
30#define PS3FB_IOCTL_ON _IO('r', 4) /* use IOCTL_FSEL */
31#define PS3FB_IOCTL_OFF _IO('r', 5) /* return to normal-flip */
32#define PS3FB_IOCTL_FSEL _IOW('r', 6, int) /* blit and flip request */
33
34#ifndef FBIO_WAITFORVSYNC
35#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) /* wait for vsync */
36#endif
37
38struct ps3fb_ioctl_res {
39 __u32 xres; /* frame buffer x_size */
40 __u32 yres; /* frame buffer y_size */
41 __u32 xoff; /* margine x */
42 __u32 yoff; /* margine y */
43 __u32 num_frames; /* num of frame buffers */
44};
45
46#endif /* _ASM_POWERPC_PS3FB_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/ptrace.h+7-1
...@@ -29,7 +29,8 @@...@@ -29,7 +29,8 @@
2929
30#ifndef __ASSEMBLY__30#ifndef __ASSEMBLY__
3131
32struct pt_regs {32struct pt_regs
33{
33 unsigned long gpr[32];34 unsigned long gpr[32];
34 unsigned long nip;35 unsigned long nip;
35 unsigned long msr;36 unsigned long msr;
...@@ -160,6 +161,10 @@ struct pt_regs {...@@ -160,6 +161,10 @@ struct pt_regs {
160#define PTRACE_GETVSRREGS 0x1b161#define PTRACE_GETVSRREGS 0x1b
161#define PTRACE_SETVSRREGS 0x1c162#define PTRACE_SETVSRREGS 0x1c
162163
164/* Syscall emulation defines */
165#define PTRACE_SYSEMU 0x1d
166#define PTRACE_SYSEMU_SINGLESTEP 0x1e
167
163/*168/*
164 * Get or set a debug register. The first 16 are DABR registers and the169 * Get or set a debug register. The first 16 are DABR registers and the
165 * second 16 are IABR registers.170 * second 16 are IABR registers.
...@@ -213,6 +218,7 @@ struct ppc_debug_info {...@@ -213,6 +218,7 @@ struct ppc_debug_info {
213#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004218#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004
214#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008219#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008
215#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010220#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010
221#define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x0000000000000020
216222
217#ifndef __ASSEMBLY__223#ifndef __ASSEMBLY__
218224
lib/libc/include/powerpc-linux-any/asm/sembuf.h+4-2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef _ASM_POWERPC_SEMBUF_H2#ifndef _ASM_POWERPC_SEMBUF_H
3#define _ASM_POWERPC_SEMBUF_H3#define _ASM_POWERPC_SEMBUF_H
44
5#include <asm/ipcbuf.h>
6
5/*7/*
6 * This program is free software; you can redistribute it and/or8 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License9 * modify it under the terms of the GNU General Public License
...@@ -26,8 +28,8 @@ struct semid64_ds {...@@ -26,8 +28,8 @@ struct semid64_ds {
26 unsigned long sem_ctime_high;28 unsigned long sem_ctime_high;
27 unsigned long sem_ctime; /* last change time */29 unsigned long sem_ctime; /* last change time */
28#else30#else
29 __kernel_time_t sem_otime; /* last semop time */31 long sem_otime; /* last semop time */
30 __kernel_time_t sem_ctime; /* last change time */32 long sem_ctime; /* last change time */
31#endif33#endif
32 unsigned long sem_nsems; /* no. of semaphores in array */34 unsigned long sem_nsems; /* no. of semaphores in array */
33 unsigned long __unused3;35 unsigned long __unused3;
lib/libc/include/powerpc-linux-any/asm/shmbuf.h+3-3
...@@ -22,9 +22,9 @@...@@ -22,9 +22,9 @@
22struct shmid64_ds {22struct shmid64_ds {
23 struct ipc64_perm shm_perm; /* operation perms */23 struct ipc64_perm shm_perm; /* operation perms */
24#ifdef __powerpc64__24#ifdef __powerpc64__
25 __kernel_time_t shm_atime; /* last attach time */25 long shm_atime; /* last attach time */
26 __kernel_time_t shm_dtime; /* last detach time */26 long shm_dtime; /* last detach time */
27 __kernel_time_t shm_ctime; /* last change time */27 long shm_ctime; /* last change time */
28#else28#else
29 unsigned long shm_atime_high;29 unsigned long shm_atime_high;
30 unsigned long shm_atime; /* last attach time */30 unsigned long shm_atime; /* last attach time */
lib/libc/include/powerpc-linux-any/asm/siginfo.h deleted-18
...@@ -1,18 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGINFO_H
3#define _ASM_POWERPC_SIGINFO_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifdef __powerpc64__
13# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
14#endif
15
16#include <asm-generic/siginfo.h>
17
18#endif /* _ASM_POWERPC_SIGINFO_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/signal.h-24
...@@ -60,30 +60,6 @@ typedef struct {...@@ -60,30 +60,6 @@ typedef struct {
60#define SIGRTMIN 3260#define SIGRTMIN 32
61#define SIGRTMAX _NSIG61#define SIGRTMAX _NSIG
6262
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001U
77#define SA_NOCLDWAIT 0x00000002U
78#define SA_SIGINFO 0x00000004U
79#define SA_ONSTACK 0x08000000U
80#define SA_RESTART 0x10000000U
81#define SA_NODEFER 0x40000000U
82#define SA_RESETHAND 0x80000000U
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000U63#define SA_RESTORER 0x04000000U
8864
89#define MINSIGSTKSZ 204865#define MINSIGSTKSZ 2048
lib/libc/include/powerpc-linux-any/asm/socket.h+2-2
...@@ -11,8 +11,8 @@...@@ -11,8 +11,8 @@
1111
12#define SO_RCVLOWAT 1612#define SO_RCVLOWAT 16
13#define SO_SNDLOWAT 1713#define SO_SNDLOWAT 17
14#define SO_RCVTIMEO 1814#define SO_RCVTIMEO_OLD 18
15#define SO_SNDTIMEO 1915#define SO_SNDTIMEO_OLD 19
16#define SO_PASSCRED 2016#define SO_PASSCRED 20
17#define SO_PEERCRED 2117#define SO_PEERCRED 21
1818
lib/libc/include/powerpc-linux-any/asm/spu_info.h created+38
...@@ -0,0 +1,38 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * SPU info structures
4 *
5 * (C) Copyright 2006 IBM Corp.
6 *
7 * Author: Dwayne Grant McConnell <decimal@us.ibm.com>
8 */
9
10#ifndef _SPU_INFO_H
11#define _SPU_INFO_H
12
13#include <linux/types.h>
14
15struct mfc_cq_sr {
16 __u64 mfc_cq_data0_RW;
17 __u64 mfc_cq_data1_RW;
18 __u64 mfc_cq_data2_RW;
19 __u64 mfc_cq_data3_RW;
20};
21
22struct spu_dma_info {
23 __u64 dma_info_type;
24 __u64 dma_info_mask;
25 __u64 dma_info_status;
26 __u64 dma_info_stall_and_notify;
27 __u64 dma_info_atomic_command_status;
28 struct mfc_cq_sr dma_info_command_data[16];
29};
30
31struct spu_proxydma_info {
32 __u64 proxydma_info_type;
33 __u64 proxydma_info_mask;
34 __u64 proxydma_info_status;
35 struct mfc_cq_sr proxydma_info_command_data[8];
36};
37
38#endif /* _SPU_INFO_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/stat.h+1-1
...@@ -40,7 +40,7 @@ struct stat {...@@ -40,7 +40,7 @@ struct stat {
40 uid_t st_uid;40 uid_t st_uid;
41 gid_t st_gid;41 gid_t st_gid;
42 unsigned long st_rdev;42 unsigned long st_rdev;
43 off_t st_size;43 long st_size;
44 unsigned long st_blksize;44 unsigned long st_blksize;
45 unsigned long st_blocks;45 unsigned long st_blocks;
46 unsigned long st_atime;46 unsigned long st_atime;
lib/libc/include/powerpc-linux-any/asm/tm.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_TM_H
3#define _ASM_POWERPC_TM_H
4
5/* Reason codes describing kernel causes for transaction aborts. By
6 * convention, bit0 is copied to TEXASR[56] (IBM bit 7) which is set if
7 * the failure is persistent. PAPR saves 0xff-0xe0 for the hypervisor.
8 */
9#define TM_CAUSE_PERSISTENT 0x01
10#define TM_CAUSE_KVM_RESCHED 0xe0 /* From PAPR */
11#define TM_CAUSE_KVM_FAC_UNAV 0xe2 /* From PAPR */
12#define TM_CAUSE_RESCHED 0xde
13#define TM_CAUSE_TLBI 0xdc
14#define TM_CAUSE_FAC_UNAV 0xda
15#define TM_CAUSE_SYSCALL 0xd8
16#define TM_CAUSE_MISC 0xd6 /* future use */
17#define TM_CAUSE_SIGNAL 0xd4
18#define TM_CAUSE_ALIGNMENT 0xd2
19#define TM_CAUSE_EMULATE 0xd0
20
21#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd.h+2-387
...@@ -10,395 +10,10 @@...@@ -10,395 +10,10 @@
10#ifndef _ASM_POWERPC_UNISTD_H_10#ifndef _ASM_POWERPC_UNISTD_H_
11#define _ASM_POWERPC_UNISTD_H_11#define _ASM_POWERPC_UNISTD_H_
1212
13
14#define __NR_restart_syscall 0
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_waitpid 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_time 13
28#define __NR_mknod 14
29#define __NR_chmod 15
30#define __NR_lchown 16
31#define __NR_break 17
32#define __NR_oldstat 18
33#define __NR_lseek 19
34#define __NR_getpid 20
35#define __NR_mount 21
36#define __NR_umount 22
37#define __NR_setuid 23
38#define __NR_getuid 24
39#define __NR_stime 25
40#define __NR_ptrace 26
41#define __NR_alarm 27
42#define __NR_oldfstat 28
43#define __NR_pause 29
44#define __NR_utime 30
45#define __NR_stty 31
46#define __NR_gtty 32
47#define __NR_access 33
48#define __NR_nice 34
49#define __NR_ftime 35
50#define __NR_sync 36
51#define __NR_kill 37
52#define __NR_rename 38
53#define __NR_mkdir 39
54#define __NR_rmdir 40
55#define __NR_dup 41
56#define __NR_pipe 42
57#define __NR_times 43
58#define __NR_prof 44
59#define __NR_brk 45
60#define __NR_setgid 46
61#define __NR_getgid 47
62#define __NR_signal 48
63#define __NR_geteuid 49
64#define __NR_getegid 50
65#define __NR_acct 51
66#define __NR_umount2 52
67#define __NR_lock 53
68#define __NR_ioctl 54
69#define __NR_fcntl 55
70#define __NR_mpx 56
71#define __NR_setpgid 57
72#define __NR_ulimit 58
73#define __NR_oldolduname 59
74#define __NR_umask 60
75#define __NR_chroot 61
76#define __NR_ustat 62
77#define __NR_dup2 63
78#define __NR_getppid 64
79#define __NR_getpgrp 65
80#define __NR_setsid 66
81#define __NR_sigaction 67
82#define __NR_sgetmask 68
83#define __NR_ssetmask 69
84#define __NR_setreuid 70
85#define __NR_setregid 71
86#define __NR_sigsuspend 72
87#define __NR_sigpending 73
88#define __NR_sethostname 74
89#define __NR_setrlimit 75
90#define __NR_getrlimit 76
91#define __NR_getrusage 77
92#define __NR_gettimeofday 78
93#define __NR_settimeofday 79
94#define __NR_getgroups 80
95#define __NR_setgroups 81
96#define __NR_select 82
97#define __NR_symlink 83
98#define __NR_oldlstat 84
99#define __NR_readlink 85
100#define __NR_uselib 86
101#define __NR_swapon 87
102#define __NR_reboot 88
103#define __NR_readdir 89
104#define __NR_mmap 90
105#define __NR_munmap 91
106#define __NR_truncate 92
107#define __NR_ftruncate 93
108#define __NR_fchmod 94
109#define __NR_fchown 95
110#define __NR_getpriority 96
111#define __NR_setpriority 97
112#define __NR_profil 98
113#define __NR_statfs 99
114#define __NR_fstatfs 100
115#define __NR_ioperm 101
116#define __NR_socketcall 102
117#define __NR_syslog 103
118#define __NR_setitimer 104
119#define __NR_getitimer 105
120#define __NR_stat 106
121#define __NR_lstat 107
122#define __NR_fstat 108
123#define __NR_olduname 109
124#define __NR_iopl 110
125#define __NR_vhangup 111
126#define __NR_idle 112
127#define __NR_vm86 113
128#define __NR_wait4 114
129#define __NR_swapoff 115
130#define __NR_sysinfo 116
131#define __NR_ipc 117
132#define __NR_fsync 118
133#define __NR_sigreturn 119
134#define __NR_clone 120
135#define __NR_setdomainname 121
136#define __NR_uname 122
137#define __NR_modify_ldt 123
138#define __NR_adjtimex 124
139#define __NR_mprotect 125
140#define __NR_sigprocmask 126
141#define __NR_create_module 127
142#define __NR_init_module 128
143#define __NR_delete_module 129
144#define __NR_get_kernel_syms 130
145#define __NR_quotactl 131
146#define __NR_getpgid 132
147#define __NR_fchdir 133
148#define __NR_bdflush 134
149#define __NR_sysfs 135
150#define __NR_personality 136
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138
153#define __NR_setfsgid 139
154#define __NR__llseek 140
155#define __NR_getdents 141
156#define __NR__newselect 142
157#define __NR_flock 143
158#define __NR_msync 144
159#define __NR_readv 145
160#define __NR_writev 146
161#define __NR_getsid 147
162#define __NR_fdatasync 148
163#define __NR__sysctl 149
164#define __NR_mlock 150
165#define __NR_munlock 151
166#define __NR_mlockall 152
167#define __NR_munlockall 153
168#define __NR_sched_setparam 154
169#define __NR_sched_getparam 155
170#define __NR_sched_setscheduler 156
171#define __NR_sched_getscheduler 157
172#define __NR_sched_yield 158
173#define __NR_sched_get_priority_max 159
174#define __NR_sched_get_priority_min 160
175#define __NR_sched_rr_get_interval 161
176#define __NR_nanosleep 162
177#define __NR_mremap 163
178#define __NR_setresuid 164
179#define __NR_getresuid 165
180#define __NR_query_module 166
181#define __NR_poll 167
182#define __NR_nfsservctl 168
183#define __NR_setresgid 169
184#define __NR_getresgid 170
185#define __NR_prctl 171
186#define __NR_rt_sigreturn 172
187#define __NR_rt_sigaction 173
188#define __NR_rt_sigprocmask 174
189#define __NR_rt_sigpending 175
190#define __NR_rt_sigtimedwait 176
191#define __NR_rt_sigqueueinfo 177
192#define __NR_rt_sigsuspend 178
193#define __NR_pread64 179
194#define __NR_pwrite64 180
195#define __NR_chown 181
196#define __NR_getcwd 182
197#define __NR_capget 183
198#define __NR_capset 184
199#define __NR_sigaltstack 185
200#define __NR_sendfile 186
201#define __NR_getpmsg 187 /* some people actually want streams */
202#define __NR_putpmsg 188 /* some people actually want streams */
203#define __NR_vfork 189
204#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
205#define __NR_readahead 191
206#ifndef __powerpc64__ /* these are 32-bit only */
207#define __NR_mmap2 192
208#define __NR_truncate64 193
209#define __NR_ftruncate64 194
210#define __NR_stat64 195
211#define __NR_lstat64 196
212#define __NR_fstat64 197
213#endif
214#define __NR_pciconfig_read 198
215#define __NR_pciconfig_write 199
216#define __NR_pciconfig_iobase 200
217#define __NR_multiplexer 201
218#define __NR_getdents64 202
219#define __NR_pivot_root 203
220#ifndef __powerpc64__
221#define __NR_fcntl64 204
222#endif
223#define __NR_madvise 205
224#define __NR_mincore 206
225#define __NR_gettid 207
226#define __NR_tkill 208
227#define __NR_setxattr 209
228#define __NR_lsetxattr 210
229#define __NR_fsetxattr 211
230#define __NR_getxattr 212
231#define __NR_lgetxattr 213
232#define __NR_fgetxattr 214
233#define __NR_listxattr 215
234#define __NR_llistxattr 216
235#define __NR_flistxattr 217
236#define __NR_removexattr 218
237#define __NR_lremovexattr 219
238#define __NR_fremovexattr 220
239#define __NR_futex 221
240#define __NR_sched_setaffinity 222
241#define __NR_sched_getaffinity 223
242/* 224 currently unused */
243#define __NR_tuxcall 225
244#ifndef __powerpc64__13#ifndef __powerpc64__
245#define __NR_sendfile64 22614#include <asm/unistd_32.h>
246#endif
247#define __NR_io_setup 227
248#define __NR_io_destroy 228
249#define __NR_io_getevents 229
250#define __NR_io_submit 230
251#define __NR_io_cancel 231
252#define __NR_set_tid_address 232
253#define __NR_fadvise64 233
254#define __NR_exit_group 234
255#define __NR_lookup_dcookie 235
256#define __NR_epoll_create 236
257#define __NR_epoll_ctl 237
258#define __NR_epoll_wait 238
259#define __NR_remap_file_pages 239
260#define __NR_timer_create 240
261#define __NR_timer_settime 241
262#define __NR_timer_gettime 242
263#define __NR_timer_getoverrun 243
264#define __NR_timer_delete 244
265#define __NR_clock_settime 245
266#define __NR_clock_gettime 246
267#define __NR_clock_getres 247
268#define __NR_clock_nanosleep 248
269#define __NR_swapcontext 249
270#define __NR_tgkill 250
271#define __NR_utimes 251
272#define __NR_statfs64 252
273#define __NR_fstatfs64 253
274#ifndef __powerpc64__
275#define __NR_fadvise64_64 254
276#endif
277#define __NR_rtas 255
278#define __NR_sys_debug_setcontext 256
279/* Number 257 is reserved for vserver */
280#define __NR_migrate_pages 258
281#define __NR_mbind 259
282#define __NR_get_mempolicy 260
283#define __NR_set_mempolicy 261
284#define __NR_mq_open 262
285#define __NR_mq_unlink 263
286#define __NR_mq_timedsend 264
287#define __NR_mq_timedreceive 265
288#define __NR_mq_notify 266
289#define __NR_mq_getsetattr 267
290#define __NR_kexec_load 268
291#define __NR_add_key 269
292#define __NR_request_key 270
293#define __NR_keyctl 271
294#define __NR_waitid 272
295#define __NR_ioprio_set 273
296#define __NR_ioprio_get 274
297#define __NR_inotify_init 275
298#define __NR_inotify_add_watch 276
299#define __NR_inotify_rm_watch 277
300#define __NR_spu_run 278
301#define __NR_spu_create 279
302#define __NR_pselect6 280
303#define __NR_ppoll 281
304#define __NR_unshare 282
305#define __NR_splice 283
306#define __NR_tee 284
307#define __NR_vmsplice 285
308#define __NR_openat 286
309#define __NR_mkdirat 287
310#define __NR_mknodat 288
311#define __NR_fchownat 289
312#define __NR_futimesat 290
313#ifdef __powerpc64__
314#define __NR_newfstatat 291
315#else15#else
316#define __NR_fstatat64 29116#include <asm/unistd_64.h>
317#endif17#endif
318#define __NR_unlinkat 292
319#define __NR_renameat 293
320#define __NR_linkat 294
321#define __NR_symlinkat 295
322#define __NR_readlinkat 296
323#define __NR_fchmodat 297
324#define __NR_faccessat 298
325#define __NR_get_robust_list 299
326#define __NR_set_robust_list 300
327#define __NR_move_pages 301
328#define __NR_getcpu 302
329#define __NR_epoll_pwait 303
330#define __NR_utimensat 304
331#define __NR_signalfd 305
332#define __NR_timerfd_create 306
333#define __NR_eventfd 307
334#define __NR_sync_file_range2 308
335#define __NR_fallocate 309
336#define __NR_subpage_prot 310
337#define __NR_timerfd_settime 311
338#define __NR_timerfd_gettime 312
339#define __NR_signalfd4 313
340#define __NR_eventfd2 314
341#define __NR_epoll_create1 315
342#define __NR_dup3 316
343#define __NR_pipe2 317
344#define __NR_inotify_init1 318
345#define __NR_perf_event_open 319
346#define __NR_preadv 320
347#define __NR_pwritev 321
348#define __NR_rt_tgsigqueueinfo 322
349#define __NR_fanotify_init 323
350#define __NR_fanotify_mark 324
351#define __NR_prlimit64 325
352#define __NR_socket 326
353#define __NR_bind 327
354#define __NR_connect 328
355#define __NR_listen 329
356#define __NR_accept 330
357#define __NR_getsockname 331
358#define __NR_getpeername 332
359#define __NR_socketpair 333
360#define __NR_send 334
361#define __NR_sendto 335
362#define __NR_recv 336
363#define __NR_recvfrom 337
364#define __NR_shutdown 338
365#define __NR_setsockopt 339
366#define __NR_getsockopt 340
367#define __NR_sendmsg 341
368#define __NR_recvmsg 342
369#define __NR_recvmmsg 343
370#define __NR_accept4 344
371#define __NR_name_to_handle_at 345
372#define __NR_open_by_handle_at 346
373#define __NR_clock_adjtime 347
374#define __NR_syncfs 348
375#define __NR_sendmmsg 349
376#define __NR_setns 350
377#define __NR_process_vm_readv 351
378#define __NR_process_vm_writev 352
379#define __NR_finit_module 353
380#define __NR_kcmp 354
381#define __NR_sched_setattr 355
382#define __NR_sched_getattr 356
383#define __NR_renameat2 357
384#define __NR_seccomp 358
385#define __NR_getrandom 359
386#define __NR_memfd_create 360
387#define __NR_bpf 361
388#define __NR_execveat 362
389#define __NR_switch_endian 363
390#define __NR_userfaultfd 364
391#define __NR_membarrier 365
392#define __NR_mlock2 378
393#define __NR_copy_file_range 379
394#define __NR_preadv2 380
395#define __NR_pwritev2 381
396#define __NR_kexec_file_load 382
397#define __NR_statx 383
398#define __NR_pkey_alloc 384
399#define __NR_pkey_free 385
400#define __NR_pkey_mprotect 386
401#define __NR_rseq 387
402#define __NR_io_pgetevents 388
40318
404#endif /* _ASM_POWERPC_UNISTD_H_ */19#endif /* _ASM_POWERPC_UNISTD_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_32.h created+436
...@@ -0,0 +1,436 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_restart_syscall 0
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_waitpid 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_break 17
22#define __NR_oldstat 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_mount 21
26#define __NR_umount 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_stime 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_oldfstat 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_stty 31
36#define __NR_gtty 32
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_ftime 35
40#define __NR_sync 36
41#define __NR_kill 37
42#define __NR_rename 38
43#define __NR_mkdir 39
44#define __NR_rmdir 40
45#define __NR_dup 41
46#define __NR_pipe 42
47#define __NR_times 43
48#define __NR_prof 44
49#define __NR_brk 45
50#define __NR_setgid 46
51#define __NR_getgid 47
52#define __NR_signal 48
53#define __NR_geteuid 49
54#define __NR_getegid 50
55#define __NR_acct 51
56#define __NR_umount2 52
57#define __NR_lock 53
58#define __NR_ioctl 54
59#define __NR_fcntl 55
60#define __NR_mpx 56
61#define __NR_setpgid 57
62#define __NR_ulimit 58
63#define __NR_oldolduname 59
64#define __NR_umask 60
65#define __NR_chroot 61
66#define __NR_ustat 62
67#define __NR_dup2 63
68#define __NR_getppid 64
69#define __NR_getpgrp 65
70#define __NR_setsid 66
71#define __NR_sigaction 67
72#define __NR_sgetmask 68
73#define __NR_ssetmask 69
74#define __NR_setreuid 70
75#define __NR_setregid 71
76#define __NR_sigsuspend 72
77#define __NR_sigpending 73
78#define __NR_sethostname 74
79#define __NR_setrlimit 75
80#define __NR_getrlimit 76
81#define __NR_getrusage 77
82#define __NR_gettimeofday 78
83#define __NR_settimeofday 79
84#define __NR_getgroups 80
85#define __NR_setgroups 81
86#define __NR_select 82
87#define __NR_symlink 83
88#define __NR_oldlstat 84
89#define __NR_readlink 85
90#define __NR_uselib 86
91#define __NR_swapon 87
92#define __NR_reboot 88
93#define __NR_readdir 89
94#define __NR_mmap 90
95#define __NR_munmap 91
96#define __NR_truncate 92
97#define __NR_ftruncate 93
98#define __NR_fchmod 94
99#define __NR_fchown 95
100#define __NR_getpriority 96
101#define __NR_setpriority 97
102#define __NR_profil 98
103#define __NR_statfs 99
104#define __NR_fstatfs 100
105#define __NR_ioperm 101
106#define __NR_socketcall 102
107#define __NR_syslog 103
108#define __NR_setitimer 104
109#define __NR_getitimer 105
110#define __NR_stat 106
111#define __NR_lstat 107
112#define __NR_fstat 108
113#define __NR_olduname 109
114#define __NR_iopl 110
115#define __NR_vhangup 111
116#define __NR_idle 112
117#define __NR_vm86 113
118#define __NR_wait4 114
119#define __NR_swapoff 115
120#define __NR_sysinfo 116
121#define __NR_ipc 117
122#define __NR_fsync 118
123#define __NR_sigreturn 119
124#define __NR_clone 120
125#define __NR_setdomainname 121
126#define __NR_uname 122
127#define __NR_modify_ldt 123
128#define __NR_adjtimex 124
129#define __NR_mprotect 125
130#define __NR_sigprocmask 126
131#define __NR_create_module 127
132#define __NR_init_module 128
133#define __NR_delete_module 129
134#define __NR_get_kernel_syms 130
135#define __NR_quotactl 131
136#define __NR_getpgid 132
137#define __NR_fchdir 133
138#define __NR_bdflush 134
139#define __NR_sysfs 135
140#define __NR_personality 136
141#define __NR_afs_syscall 137
142#define __NR_setfsuid 138
143#define __NR_setfsgid 139
144#define __NR__llseek 140
145#define __NR_getdents 141
146#define __NR__newselect 142
147#define __NR_flock 143
148#define __NR_msync 144
149#define __NR_readv 145
150#define __NR_writev 146
151#define __NR_getsid 147
152#define __NR_fdatasync 148
153#define __NR__sysctl 149
154#define __NR_mlock 150
155#define __NR_munlock 151
156#define __NR_mlockall 152
157#define __NR_munlockall 153
158#define __NR_sched_setparam 154
159#define __NR_sched_getparam 155
160#define __NR_sched_setscheduler 156
161#define __NR_sched_getscheduler 157
162#define __NR_sched_yield 158
163#define __NR_sched_get_priority_max 159
164#define __NR_sched_get_priority_min 160
165#define __NR_sched_rr_get_interval 161
166#define __NR_nanosleep 162
167#define __NR_mremap 163
168#define __NR_setresuid 164
169#define __NR_getresuid 165
170#define __NR_query_module 166
171#define __NR_poll 167
172#define __NR_nfsservctl 168
173#define __NR_setresgid 169
174#define __NR_getresgid 170
175#define __NR_prctl 171
176#define __NR_rt_sigreturn 172
177#define __NR_rt_sigaction 173
178#define __NR_rt_sigprocmask 174
179#define __NR_rt_sigpending 175
180#define __NR_rt_sigtimedwait 176
181#define __NR_rt_sigqueueinfo 177
182#define __NR_rt_sigsuspend 178
183#define __NR_pread64 179
184#define __NR_pwrite64 180
185#define __NR_chown 181
186#define __NR_getcwd 182
187#define __NR_capget 183
188#define __NR_capset 184
189#define __NR_sigaltstack 185
190#define __NR_sendfile 186
191#define __NR_getpmsg 187
192#define __NR_putpmsg 188
193#define __NR_vfork 189
194#define __NR_ugetrlimit 190
195#define __NR_readahead 191
196#define __NR_mmap2 192
197#define __NR_truncate64 193
198#define __NR_ftruncate64 194
199#define __NR_stat64 195
200#define __NR_lstat64 196
201#define __NR_fstat64 197
202#define __NR_pciconfig_read 198
203#define __NR_pciconfig_write 199
204#define __NR_pciconfig_iobase 200
205#define __NR_multiplexer 201
206#define __NR_getdents64 202
207#define __NR_pivot_root 203
208#define __NR_fcntl64 204
209#define __NR_madvise 205
210#define __NR_mincore 206
211#define __NR_gettid 207
212#define __NR_tkill 208
213#define __NR_setxattr 209
214#define __NR_lsetxattr 210
215#define __NR_fsetxattr 211
216#define __NR_getxattr 212
217#define __NR_lgetxattr 213
218#define __NR_fgetxattr 214
219#define __NR_listxattr 215
220#define __NR_llistxattr 216
221#define __NR_flistxattr 217
222#define __NR_removexattr 218
223#define __NR_lremovexattr 219
224#define __NR_fremovexattr 220
225#define __NR_futex 221
226#define __NR_sched_setaffinity 222
227#define __NR_sched_getaffinity 223
228#define __NR_tuxcall 225
229#define __NR_sendfile64 226
230#define __NR_io_setup 227
231#define __NR_io_destroy 228
232#define __NR_io_getevents 229
233#define __NR_io_submit 230
234#define __NR_io_cancel 231
235#define __NR_set_tid_address 232
236#define __NR_fadvise64 233
237#define __NR_exit_group 234
238#define __NR_lookup_dcookie 235
239#define __NR_epoll_create 236
240#define __NR_epoll_ctl 237
241#define __NR_epoll_wait 238
242#define __NR_remap_file_pages 239
243#define __NR_timer_create 240
244#define __NR_timer_settime 241
245#define __NR_timer_gettime 242
246#define __NR_timer_getoverrun 243
247#define __NR_timer_delete 244
248#define __NR_clock_settime 245
249#define __NR_clock_gettime 246
250#define __NR_clock_getres 247
251#define __NR_clock_nanosleep 248
252#define __NR_swapcontext 249
253#define __NR_tgkill 250
254#define __NR_utimes 251
255#define __NR_statfs64 252
256#define __NR_fstatfs64 253
257#define __NR_fadvise64_64 254
258#define __NR_rtas 255
259#define __NR_sys_debug_setcontext 256
260#define __NR_migrate_pages 258
261#define __NR_mbind 259
262#define __NR_get_mempolicy 260
263#define __NR_set_mempolicy 261
264#define __NR_mq_open 262
265#define __NR_mq_unlink 263
266#define __NR_mq_timedsend 264
267#define __NR_mq_timedreceive 265
268#define __NR_mq_notify 266
269#define __NR_mq_getsetattr 267
270#define __NR_kexec_load 268
271#define __NR_add_key 269
272#define __NR_request_key 270
273#define __NR_keyctl 271
274#define __NR_waitid 272
275#define __NR_ioprio_set 273
276#define __NR_ioprio_get 274
277#define __NR_inotify_init 275
278#define __NR_inotify_add_watch 276
279#define __NR_inotify_rm_watch 277
280#define __NR_spu_run 278
281#define __NR_spu_create 279
282#define __NR_pselect6 280
283#define __NR_ppoll 281
284#define __NR_unshare 282
285#define __NR_splice 283
286#define __NR_tee 284
287#define __NR_vmsplice 285
288#define __NR_openat 286
289#define __NR_mkdirat 287
290#define __NR_mknodat 288
291#define __NR_fchownat 289
292#define __NR_futimesat 290
293#define __NR_fstatat64 291
294#define __NR_unlinkat 292
295#define __NR_renameat 293
296#define __NR_linkat 294
297#define __NR_symlinkat 295
298#define __NR_readlinkat 296
299#define __NR_fchmodat 297
300#define __NR_faccessat 298
301#define __NR_get_robust_list 299
302#define __NR_set_robust_list 300
303#define __NR_move_pages 301
304#define __NR_getcpu 302
305#define __NR_epoll_pwait 303
306#define __NR_utimensat 304
307#define __NR_signalfd 305
308#define __NR_timerfd_create 306
309#define __NR_eventfd 307
310#define __NR_sync_file_range2 308
311#define __NR_fallocate 309
312#define __NR_subpage_prot 310
313#define __NR_timerfd_settime 311
314#define __NR_timerfd_gettime 312
315#define __NR_signalfd4 313
316#define __NR_eventfd2 314
317#define __NR_epoll_create1 315
318#define __NR_dup3 316
319#define __NR_pipe2 317
320#define __NR_inotify_init1 318
321#define __NR_perf_event_open 319
322#define __NR_preadv 320
323#define __NR_pwritev 321
324#define __NR_rt_tgsigqueueinfo 322
325#define __NR_fanotify_init 323
326#define __NR_fanotify_mark 324
327#define __NR_prlimit64 325
328#define __NR_socket 326
329#define __NR_bind 327
330#define __NR_connect 328
331#define __NR_listen 329
332#define __NR_accept 330
333#define __NR_getsockname 331
334#define __NR_getpeername 332
335#define __NR_socketpair 333
336#define __NR_send 334
337#define __NR_sendto 335
338#define __NR_recv 336
339#define __NR_recvfrom 337
340#define __NR_shutdown 338
341#define __NR_setsockopt 339
342#define __NR_getsockopt 340
343#define __NR_sendmsg 341
344#define __NR_recvmsg 342
345#define __NR_recvmmsg 343
346#define __NR_accept4 344
347#define __NR_name_to_handle_at 345
348#define __NR_open_by_handle_at 346
349#define __NR_clock_adjtime 347
350#define __NR_syncfs 348
351#define __NR_sendmmsg 349
352#define __NR_setns 350
353#define __NR_process_vm_readv 351
354#define __NR_process_vm_writev 352
355#define __NR_finit_module 353
356#define __NR_kcmp 354
357#define __NR_sched_setattr 355
358#define __NR_sched_getattr 356
359#define __NR_renameat2 357
360#define __NR_seccomp 358
361#define __NR_getrandom 359
362#define __NR_memfd_create 360
363#define __NR_bpf 361
364#define __NR_execveat 362
365#define __NR_switch_endian 363
366#define __NR_userfaultfd 364
367#define __NR_membarrier 365
368#define __NR_mlock2 378
369#define __NR_copy_file_range 379
370#define __NR_preadv2 380
371#define __NR_pwritev2 381
372#define __NR_kexec_file_load 382
373#define __NR_statx 383
374#define __NR_pkey_alloc 384
375#define __NR_pkey_free 385
376#define __NR_pkey_mprotect 386
377#define __NR_rseq 387
378#define __NR_io_pgetevents 388
379#define __NR_semget 393
380#define __NR_semctl 394
381#define __NR_shmget 395
382#define __NR_shmctl 396
383#define __NR_shmat 397
384#define __NR_shmdt 398
385#define __NR_msgget 399
386#define __NR_msgsnd 400
387#define __NR_msgrcv 401
388#define __NR_msgctl 402
389#define __NR_clock_gettime64 403
390#define __NR_clock_settime64 404
391#define __NR_clock_adjtime64 405
392#define __NR_clock_getres_time64 406
393#define __NR_clock_nanosleep_time64 407
394#define __NR_timer_gettime64 408
395#define __NR_timer_settime64 409
396#define __NR_timerfd_gettime64 410
397#define __NR_timerfd_settime64 411
398#define __NR_utimensat_time64 412
399#define __NR_pselect6_time64 413
400#define __NR_ppoll_time64 414
401#define __NR_io_pgetevents_time64 416
402#define __NR_recvmmsg_time64 417
403#define __NR_mq_timedsend_time64 418
404#define __NR_mq_timedreceive_time64 419
405#define __NR_semtimedop_time64 420
406#define __NR_rt_sigtimedwait_time64 421
407#define __NR_futex_time64 422
408#define __NR_sched_rr_get_interval_time64 423
409#define __NR_pidfd_send_signal 424
410#define __NR_io_uring_setup 425
411#define __NR_io_uring_enter 426
412#define __NR_io_uring_register 427
413#define __NR_open_tree 428
414#define __NR_move_mount 429
415#define __NR_fsopen 430
416#define __NR_fsconfig 431
417#define __NR_fsmount 432
418#define __NR_fspick 433
419#define __NR_pidfd_open 434
420#define __NR_clone3 435
421#define __NR_close_range 436
422#define __NR_openat2 437
423#define __NR_pidfd_getfd 438
424#define __NR_faccessat2 439
425#define __NR_process_madvise 440
426#define __NR_epoll_pwait2 441
427#define __NR_mount_setattr 442
428#define __NR_quotactl_fd 443
429#define __NR_landlock_create_ruleset 444
430#define __NR_landlock_add_rule 445
431#define __NR_landlock_restrict_self 446
432#define __NR_process_mrelease 448
433#define __NR_futex_waitv 449
434
435
436#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h created+408
...@@ -0,0 +1,408 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_restart_syscall 0
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_waitpid 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_break 17
22#define __NR_oldstat 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_mount 21
26#define __NR_umount 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_stime 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_oldfstat 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_stty 31
36#define __NR_gtty 32
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_ftime 35
40#define __NR_sync 36
41#define __NR_kill 37
42#define __NR_rename 38
43#define __NR_mkdir 39
44#define __NR_rmdir 40
45#define __NR_dup 41
46#define __NR_pipe 42
47#define __NR_times 43
48#define __NR_prof 44
49#define __NR_brk 45
50#define __NR_setgid 46
51#define __NR_getgid 47
52#define __NR_signal 48
53#define __NR_geteuid 49
54#define __NR_getegid 50
55#define __NR_acct 51
56#define __NR_umount2 52
57#define __NR_lock 53
58#define __NR_ioctl 54
59#define __NR_fcntl 55
60#define __NR_mpx 56
61#define __NR_setpgid 57
62#define __NR_ulimit 58
63#define __NR_oldolduname 59
64#define __NR_umask 60
65#define __NR_chroot 61
66#define __NR_ustat 62
67#define __NR_dup2 63
68#define __NR_getppid 64
69#define __NR_getpgrp 65
70#define __NR_setsid 66
71#define __NR_sigaction 67
72#define __NR_sgetmask 68
73#define __NR_ssetmask 69
74#define __NR_setreuid 70
75#define __NR_setregid 71
76#define __NR_sigsuspend 72
77#define __NR_sigpending 73
78#define __NR_sethostname 74
79#define __NR_setrlimit 75
80#define __NR_getrlimit 76
81#define __NR_getrusage 77
82#define __NR_gettimeofday 78
83#define __NR_settimeofday 79
84#define __NR_getgroups 80
85#define __NR_setgroups 81
86#define __NR_select 82
87#define __NR_symlink 83
88#define __NR_oldlstat 84
89#define __NR_readlink 85
90#define __NR_uselib 86
91#define __NR_swapon 87
92#define __NR_reboot 88
93#define __NR_readdir 89
94#define __NR_mmap 90
95#define __NR_munmap 91
96#define __NR_truncate 92
97#define __NR_ftruncate 93
98#define __NR_fchmod 94
99#define __NR_fchown 95
100#define __NR_getpriority 96
101#define __NR_setpriority 97
102#define __NR_profil 98
103#define __NR_statfs 99
104#define __NR_fstatfs 100
105#define __NR_ioperm 101
106#define __NR_socketcall 102
107#define __NR_syslog 103
108#define __NR_setitimer 104
109#define __NR_getitimer 105
110#define __NR_stat 106
111#define __NR_lstat 107
112#define __NR_fstat 108
113#define __NR_olduname 109
114#define __NR_iopl 110
115#define __NR_vhangup 111
116#define __NR_idle 112
117#define __NR_vm86 113
118#define __NR_wait4 114
119#define __NR_swapoff 115
120#define __NR_sysinfo 116
121#define __NR_ipc 117
122#define __NR_fsync 118
123#define __NR_sigreturn 119
124#define __NR_clone 120
125#define __NR_setdomainname 121
126#define __NR_uname 122
127#define __NR_modify_ldt 123
128#define __NR_adjtimex 124
129#define __NR_mprotect 125
130#define __NR_sigprocmask 126
131#define __NR_create_module 127
132#define __NR_init_module 128
133#define __NR_delete_module 129
134#define __NR_get_kernel_syms 130
135#define __NR_quotactl 131
136#define __NR_getpgid 132
137#define __NR_fchdir 133
138#define __NR_bdflush 134
139#define __NR_sysfs 135
140#define __NR_personality 136
141#define __NR_afs_syscall 137
142#define __NR_setfsuid 138
143#define __NR_setfsgid 139
144#define __NR__llseek 140
145#define __NR_getdents 141
146#define __NR__newselect 142
147#define __NR_flock 143
148#define __NR_msync 144
149#define __NR_readv 145
150#define __NR_writev 146
151#define __NR_getsid 147
152#define __NR_fdatasync 148
153#define __NR__sysctl 149
154#define __NR_mlock 150
155#define __NR_munlock 151
156#define __NR_mlockall 152
157#define __NR_munlockall 153
158#define __NR_sched_setparam 154
159#define __NR_sched_getparam 155
160#define __NR_sched_setscheduler 156
161#define __NR_sched_getscheduler 157
162#define __NR_sched_yield 158
163#define __NR_sched_get_priority_max 159
164#define __NR_sched_get_priority_min 160
165#define __NR_sched_rr_get_interval 161
166#define __NR_nanosleep 162
167#define __NR_mremap 163
168#define __NR_setresuid 164
169#define __NR_getresuid 165
170#define __NR_query_module 166
171#define __NR_poll 167
172#define __NR_nfsservctl 168
173#define __NR_setresgid 169
174#define __NR_getresgid 170
175#define __NR_prctl 171
176#define __NR_rt_sigreturn 172
177#define __NR_rt_sigaction 173
178#define __NR_rt_sigprocmask 174
179#define __NR_rt_sigpending 175
180#define __NR_rt_sigtimedwait 176
181#define __NR_rt_sigqueueinfo 177
182#define __NR_rt_sigsuspend 178
183#define __NR_pread64 179
184#define __NR_pwrite64 180
185#define __NR_chown 181
186#define __NR_getcwd 182
187#define __NR_capget 183
188#define __NR_capset 184
189#define __NR_sigaltstack 185
190#define __NR_sendfile 186
191#define __NR_getpmsg 187
192#define __NR_putpmsg 188
193#define __NR_vfork 189
194#define __NR_ugetrlimit 190
195#define __NR_readahead 191
196#define __NR_pciconfig_read 198
197#define __NR_pciconfig_write 199
198#define __NR_pciconfig_iobase 200
199#define __NR_multiplexer 201
200#define __NR_getdents64 202
201#define __NR_pivot_root 203
202#define __NR_madvise 205
203#define __NR_mincore 206
204#define __NR_gettid 207
205#define __NR_tkill 208
206#define __NR_setxattr 209
207#define __NR_lsetxattr 210
208#define __NR_fsetxattr 211
209#define __NR_getxattr 212
210#define __NR_lgetxattr 213
211#define __NR_fgetxattr 214
212#define __NR_listxattr 215
213#define __NR_llistxattr 216
214#define __NR_flistxattr 217
215#define __NR_removexattr 218
216#define __NR_lremovexattr 219
217#define __NR_fremovexattr 220
218#define __NR_futex 221
219#define __NR_sched_setaffinity 222
220#define __NR_sched_getaffinity 223
221#define __NR_tuxcall 225
222#define __NR_io_setup 227
223#define __NR_io_destroy 228
224#define __NR_io_getevents 229
225#define __NR_io_submit 230
226#define __NR_io_cancel 231
227#define __NR_set_tid_address 232
228#define __NR_fadvise64 233
229#define __NR_exit_group 234
230#define __NR_lookup_dcookie 235
231#define __NR_epoll_create 236
232#define __NR_epoll_ctl 237
233#define __NR_epoll_wait 238
234#define __NR_remap_file_pages 239
235#define __NR_timer_create 240
236#define __NR_timer_settime 241
237#define __NR_timer_gettime 242
238#define __NR_timer_getoverrun 243
239#define __NR_timer_delete 244
240#define __NR_clock_settime 245
241#define __NR_clock_gettime 246
242#define __NR_clock_getres 247
243#define __NR_clock_nanosleep 248
244#define __NR_swapcontext 249
245#define __NR_tgkill 250
246#define __NR_utimes 251
247#define __NR_statfs64 252
248#define __NR_fstatfs64 253
249#define __NR_rtas 255
250#define __NR_sys_debug_setcontext 256
251#define __NR_migrate_pages 258
252#define __NR_mbind 259
253#define __NR_get_mempolicy 260
254#define __NR_set_mempolicy 261
255#define __NR_mq_open 262
256#define __NR_mq_unlink 263
257#define __NR_mq_timedsend 264
258#define __NR_mq_timedreceive 265
259#define __NR_mq_notify 266
260#define __NR_mq_getsetattr 267
261#define __NR_kexec_load 268
262#define __NR_add_key 269
263#define __NR_request_key 270
264#define __NR_keyctl 271
265#define __NR_waitid 272
266#define __NR_ioprio_set 273
267#define __NR_ioprio_get 274
268#define __NR_inotify_init 275
269#define __NR_inotify_add_watch 276
270#define __NR_inotify_rm_watch 277
271#define __NR_spu_run 278
272#define __NR_spu_create 279
273#define __NR_pselect6 280
274#define __NR_ppoll 281
275#define __NR_unshare 282
276#define __NR_splice 283
277#define __NR_tee 284
278#define __NR_vmsplice 285
279#define __NR_openat 286
280#define __NR_mkdirat 287
281#define __NR_mknodat 288
282#define __NR_fchownat 289
283#define __NR_futimesat 290
284#define __NR_newfstatat 291
285#define __NR_unlinkat 292
286#define __NR_renameat 293
287#define __NR_linkat 294
288#define __NR_symlinkat 295
289#define __NR_readlinkat 296
290#define __NR_fchmodat 297
291#define __NR_faccessat 298
292#define __NR_get_robust_list 299
293#define __NR_set_robust_list 300
294#define __NR_move_pages 301
295#define __NR_getcpu 302
296#define __NR_epoll_pwait 303
297#define __NR_utimensat 304
298#define __NR_signalfd 305
299#define __NR_timerfd_create 306
300#define __NR_eventfd 307
301#define __NR_sync_file_range2 308
302#define __NR_fallocate 309
303#define __NR_subpage_prot 310
304#define __NR_timerfd_settime 311
305#define __NR_timerfd_gettime 312
306#define __NR_signalfd4 313
307#define __NR_eventfd2 314
308#define __NR_epoll_create1 315
309#define __NR_dup3 316
310#define __NR_pipe2 317
311#define __NR_inotify_init1 318
312#define __NR_perf_event_open 319
313#define __NR_preadv 320
314#define __NR_pwritev 321
315#define __NR_rt_tgsigqueueinfo 322
316#define __NR_fanotify_init 323
317#define __NR_fanotify_mark 324
318#define __NR_prlimit64 325
319#define __NR_socket 326
320#define __NR_bind 327
321#define __NR_connect 328
322#define __NR_listen 329
323#define __NR_accept 330
324#define __NR_getsockname 331
325#define __NR_getpeername 332
326#define __NR_socketpair 333
327#define __NR_send 334
328#define __NR_sendto 335
329#define __NR_recv 336
330#define __NR_recvfrom 337
331#define __NR_shutdown 338
332#define __NR_setsockopt 339
333#define __NR_getsockopt 340
334#define __NR_sendmsg 341
335#define __NR_recvmsg 342
336#define __NR_recvmmsg 343
337#define __NR_accept4 344
338#define __NR_name_to_handle_at 345
339#define __NR_open_by_handle_at 346
340#define __NR_clock_adjtime 347
341#define __NR_syncfs 348
342#define __NR_sendmmsg 349
343#define __NR_setns 350
344#define __NR_process_vm_readv 351
345#define __NR_process_vm_writev 352
346#define __NR_finit_module 353
347#define __NR_kcmp 354
348#define __NR_sched_setattr 355
349#define __NR_sched_getattr 356
350#define __NR_renameat2 357
351#define __NR_seccomp 358
352#define __NR_getrandom 359
353#define __NR_memfd_create 360
354#define __NR_bpf 361
355#define __NR_execveat 362
356#define __NR_switch_endian 363
357#define __NR_userfaultfd 364
358#define __NR_membarrier 365
359#define __NR_mlock2 378
360#define __NR_copy_file_range 379
361#define __NR_preadv2 380
362#define __NR_pwritev2 381
363#define __NR_kexec_file_load 382
364#define __NR_statx 383
365#define __NR_pkey_alloc 384
366#define __NR_pkey_free 385
367#define __NR_pkey_mprotect 386
368#define __NR_rseq 387
369#define __NR_io_pgetevents 388
370#define __NR_semtimedop 392
371#define __NR_semget 393
372#define __NR_semctl 394
373#define __NR_shmget 395
374#define __NR_shmctl 396
375#define __NR_shmat 397
376#define __NR_shmdt 398
377#define __NR_msgget 399
378#define __NR_msgsnd 400
379#define __NR_msgrcv 401
380#define __NR_msgctl 402
381#define __NR_pidfd_send_signal 424
382#define __NR_io_uring_setup 425
383#define __NR_io_uring_enter 426
384#define __NR_io_uring_register 427
385#define __NR_open_tree 428
386#define __NR_move_mount 429
387#define __NR_fsopen 430
388#define __NR_fsconfig 431
389#define __NR_fsmount 432
390#define __NR_fspick 433
391#define __NR_pidfd_open 434
392#define __NR_clone3 435
393#define __NR_close_range 436
394#define __NR_openat2 437
395#define __NR_pidfd_getfd 438
396#define __NR_faccessat2 439
397#define __NR_process_madvise 440
398#define __NR_epoll_pwait2 441
399#define __NR_mount_setattr 442
400#define __NR_quotactl_fd 443
401#define __NR_landlock_create_ruleset 444
402#define __NR_landlock_add_rule 445
403#define __NR_landlock_restrict_self 446
404#define __NR_process_mrelease 448
405#define __NR_futex_waitv 449
406
407
408#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/vas-api.h created+28
...@@ -0,0 +1,28 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright 2019 IBM Corp.
4 */
5
6#ifndef _MISC_VAS_H
7#define _MISC_VAS_H
8
9#include <linux/types.h>
10
11#include <asm/ioctl.h>
12
13#define VAS_MAGIC 'v'
14#define VAS_TX_WIN_OPEN _IOW(VAS_MAGIC, 0x20, struct vas_tx_win_open_attr)
15
16/* Flags to VAS TX open window ioctl */
17/* To allocate a window with QoS credit, otherwise use default credit */
18#define VAS_TX_WIN_FLAG_QOS_CREDIT 0x0000000000000001
19
20struct vas_tx_win_open_attr {
21 __u32 version;
22 __s16 vas_id; /* specific instance of vas or -1 for default */
23 __u16 reserved1;
24 __u64 flags;
25 __u64 reserved2[6];
26};
27
28#endif /* _MISC_VAS_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/auxvec.h deleted-53
...@@ -1,53 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_AUXVEC_H
3#define _ASM_POWERPC_AUXVEC_H
4
5/*
6 * We need to put in some extra aux table entries to tell glibc what
7 * the cache block size is, so it can use the dcbz instruction safely.
8 */
9#define AT_DCACHEBSIZE 19
10#define AT_ICACHEBSIZE 20
11#define AT_UCACHEBSIZE 21
12/* A special ignored type value for PPC, for glibc compatibility. */
13#define AT_IGNOREPPC 22
14
15/* The vDSO location. We have to use the same value as x86 for glibc's
16 * sake :-)
17 */
18#define AT_SYSINFO_EHDR 33
19
20/*
21 * AT_*CACHEBSIZE above represent the cache *block* size which is
22 * the size that is affected by the cache management instructions.
23 *
24 * It doesn't nececssarily matches the cache *line* size which is
25 * more of a performance tuning hint. Additionally the latter can
26 * be different for the different cache levels.
27 *
28 * The set of entries below represent more extensive information
29 * about the caches, in the form of two entry per cache type,
30 * one entry containing the cache size in bytes, and the other
31 * containing the cache line size in bytes in the bottom 16 bits
32 * and the cache associativity in the next 16 bits.
33 *
34 * The associativity is such that if N is the 16-bit value, the
35 * cache is N way set associative. A value if 0xffff means fully
36 * associative, a value of 1 means directly mapped.
37 *
38 * For all these fields, a value of 0 means that the information
39 * is not known.
40 */
41
42#define AT_L1I_CACHESIZE 40
43#define AT_L1I_CACHEGEOMETRY 41
44#define AT_L1D_CACHESIZE 42
45#define AT_L1D_CACHEGEOMETRY 43
46#define AT_L2_CACHESIZE 44
47#define AT_L2_CACHEGEOMETRY 45
48#define AT_L3_CACHESIZE 46
49#define AT_L3_CACHEGEOMETRY 47
50
51#define AT_VECTOR_SIZE_ARCH 14 /* entries in ARCH_DLINFO */
52
53#endif
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/bitsperlong.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POWERPC_BITSPERLONG_H
3#define __ASM_POWERPC_BITSPERLONG_H
4
5#if defined(__powerpc64__)
6# define __BITS_PER_LONG 64
7#else
8# define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_POWERPC_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/byteorder.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_BYTEORDER_H
3#define _ASM_POWERPC_BYTEORDER_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifdef __LITTLE_ENDIAN__
12#include <linux/byteorder/little_endian.h>
13#else
14#include <linux/byteorder/big_endian.h>
15#endif
16
17#endif /* _ASM_POWERPC_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/errno.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_ERRNO_H
3#define _ASM_POWERPC_ERRNO_H
4
5#include <asm-generic/errno.h>
6
7#undef EDEADLOCK
8#define EDEADLOCK 58 /* File locking deadlock error */
9
10#endif /* _ASM_POWERPC_ERRNO_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/fcntl.h deleted-12
...@@ -1,12 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_FCNTL_H
3#define _ASM_FCNTL_H
4
5#define O_DIRECTORY 040000 /* must be a directory */
6#define O_NOFOLLOW 0100000 /* don't follow links */
7#define O_LARGEFILE 0200000
8#define O_DIRECT 0400000 /* direct disk access hint */
9
10#include <asm-generic/fcntl.h>
11
12#endif /* _ASM_FCNTL_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/ioctl.h deleted-14
...@@ -1,14 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IOCTL_H
3#define _ASM_POWERPC_IOCTL_H
4
5#define _IOC_SIZEBITS 13
6#define _IOC_DIRBITS 3
7
8#define _IOC_NONE 1U
9#define _IOC_READ 2U
10#define _IOC_WRITE 4U
11
12#include <asm-generic/ioctl.h>
13
14#endif /* _ASM_POWERPC_IOCTL_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/ioctls.h deleted-121
...@@ -1,121 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IOCTLS_H
3#define _ASM_POWERPC_IOCTLS_H
4
5#include <asm/ioctl.h>
6
7#define FIOCLEX _IO('f', 1)
8#define FIONCLEX _IO('f', 2)
9#define FIOASYNC _IOW('f', 125, int)
10#define FIONBIO _IOW('f', 126, int)
11#define FIONREAD _IOR('f', 127, int)
12#define TIOCINQ FIONREAD
13#define FIOQSIZE _IOR('f', 128, loff_t)
14
15#define TIOCGETP _IOR('t', 8, struct sgttyb)
16#define TIOCSETP _IOW('t', 9, struct sgttyb)
17#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
18
19#define TIOCSETC _IOW('t', 17, struct tchars)
20#define TIOCGETC _IOR('t', 18, struct tchars)
21#define TCGETS _IOR('t', 19, struct termios)
22#define TCSETS _IOW('t', 20, struct termios)
23#define TCSETSW _IOW('t', 21, struct termios)
24#define TCSETSF _IOW('t', 22, struct termios)
25
26#define TCGETA _IOR('t', 23, struct termio)
27#define TCSETA _IOW('t', 24, struct termio)
28#define TCSETAW _IOW('t', 25, struct termio)
29#define TCSETAF _IOW('t', 28, struct termio)
30
31#define TCSBRK _IO('t', 29)
32#define TCXONC _IO('t', 30)
33#define TCFLSH _IO('t', 31)
34
35#define TIOCSWINSZ _IOW('t', 103, struct winsize)
36#define TIOCGWINSZ _IOR('t', 104, struct winsize)
37#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
38#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
39#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
40
41#define TIOCGLTC _IOR('t', 116, struct ltchars)
42#define TIOCSLTC _IOW('t', 117, struct ltchars)
43#define TIOCSPGRP _IOW('t', 118, int)
44#define TIOCGPGRP _IOR('t', 119, int)
45
46#define TIOCEXCL 0x540C
47#define TIOCNXCL 0x540D
48#define TIOCSCTTY 0x540E
49
50#define TIOCSTI 0x5412
51#define TIOCMGET 0x5415
52#define TIOCMBIS 0x5416
53#define TIOCMBIC 0x5417
54#define TIOCMSET 0x5418
55# define TIOCM_LE 0x001
56# define TIOCM_DTR 0x002
57# define TIOCM_RTS 0x004
58# define TIOCM_ST 0x008
59# define TIOCM_SR 0x010
60# define TIOCM_CTS 0x020
61# define TIOCM_CAR 0x040
62# define TIOCM_RNG 0x080
63# define TIOCM_DSR 0x100
64# define TIOCM_CD TIOCM_CAR
65# define TIOCM_RI TIOCM_RNG
66#define TIOCM_OUT1 0x2000
67#define TIOCM_OUT2 0x4000
68#define TIOCM_LOOP 0x8000
69
70#define TIOCGSOFTCAR 0x5419
71#define TIOCSSOFTCAR 0x541A
72#define TIOCLINUX 0x541C
73#define TIOCCONS 0x541D
74#define TIOCGSERIAL 0x541E
75#define TIOCSSERIAL 0x541F
76#define TIOCPKT 0x5420
77# define TIOCPKT_DATA 0
78# define TIOCPKT_FLUSHREAD 1
79# define TIOCPKT_FLUSHWRITE 2
80# define TIOCPKT_STOP 4
81# define TIOCPKT_START 8
82# define TIOCPKT_NOSTOP 16
83# define TIOCPKT_DOSTOP 32
84# define TIOCPKT_IOCTL 64
85
86
87#define TIOCNOTTY 0x5422
88#define TIOCSETD 0x5423
89#define TIOCGETD 0x5424
90#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
91#define TIOCSBRK 0x5427 /* BSD compatibility */
92#define TIOCCBRK 0x5428 /* BSD compatibility */
93#define TIOCGSID 0x5429 /* Return the session ID of FD */
94#define TIOCGRS485 0x542e
95#define TIOCSRS485 0x542f
96#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
97#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
98#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
99#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
100#define TIOCVHANGUP 0x5437
101#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
102#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
103#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
104#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
105
106#define TIOCSERCONFIG 0x5453
107#define TIOCSERGWILD 0x5454
108#define TIOCSERSWILD 0x5455
109#define TIOCGLCKTRMIOS 0x5456
110#define TIOCSLCKTRMIOS 0x5457
111#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
112#define TIOCSERGETLSR 0x5459 /* Get line status register */
113 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
114# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
115#define TIOCSERGETMULTI 0x545A /* Get multiport config */
116#define TIOCSERSETMULTI 0x545B /* Set multiport config */
117
118#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
119#define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */
120
121#endif /* _ASM_POWERPC_IOCTLS_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/ipcbuf.h deleted-35
...@@ -1,35 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IPCBUF_H
3#define _ASM_POWERPC_IPCBUF_H
4
5/*
6 * The ipc64_perm structure for the powerpc is identical to
7 * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the
8 * kernel. Note extra padding because this structure is passed back
9 * and forth between kernel and user space. Pad space is left for:
10 * - 1 32-bit value to fill up for 8-byte alignment
11 * - 2 miscellaneous 64-bit values
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18
19#include <linux/types.h>
20
21struct ipc64_perm
22{
23 __kernel_key_t key;
24 __kernel_uid_t uid;
25 __kernel_gid_t gid;
26 __kernel_uid_t cuid;
27 __kernel_gid_t cgid;
28 __kernel_mode_t mode;
29 unsigned int seq;
30 unsigned int __pad1;
31 unsigned long long __unused1;
32 unsigned long long __unused2;
33};
34
35#endif /* _ASM_POWERPC_IPCBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/kvm.h deleted-677
...@@ -1,677 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2007
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
20
21#ifndef __LINUX_KVM_POWERPC_H
22#define __LINUX_KVM_POWERPC_H
23
24#include <linux/types.h>
25
26/* Select powerpc specific features in <linux/kvm.h> */
27#define __KVM_HAVE_SPAPR_TCE
28#define __KVM_HAVE_PPC_SMT
29#define __KVM_HAVE_IRQCHIP
30#define __KVM_HAVE_IRQ_LINE
31#define __KVM_HAVE_GUEST_DEBUG
32
33/* Not always available, but if it is, this is the correct offset. */
34#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
35
36struct kvm_regs {
37 __u64 pc;
38 __u64 cr;
39 __u64 ctr;
40 __u64 lr;
41 __u64 xer;
42 __u64 msr;
43 __u64 srr0;
44 __u64 srr1;
45 __u64 pid;
46
47 __u64 sprg0;
48 __u64 sprg1;
49 __u64 sprg2;
50 __u64 sprg3;
51 __u64 sprg4;
52 __u64 sprg5;
53 __u64 sprg6;
54 __u64 sprg7;
55
56 __u64 gpr[32];
57};
58
59#define KVM_SREGS_E_IMPL_NONE 0
60#define KVM_SREGS_E_IMPL_FSL 1
61
62#define KVM_SREGS_E_FSL_PIDn (1 << 0) /* PID1/PID2 */
63
64/* flags for kvm_run.flags */
65#define KVM_RUN_PPC_NMI_DISP_MASK (3 << 0)
66#define KVM_RUN_PPC_NMI_DISP_FULLY_RECOV (1 << 0)
67#define KVM_RUN_PPC_NMI_DISP_LIMITED_RECOV (2 << 0)
68#define KVM_RUN_PPC_NMI_DISP_NOT_RECOV (3 << 0)
69
70/*
71 * Feature bits indicate which sections of the sregs struct are valid,
72 * both in KVM_GET_SREGS and KVM_SET_SREGS. On KVM_SET_SREGS, registers
73 * corresponding to unset feature bits will not be modified. This allows
74 * restoring a checkpoint made without that feature, while keeping the
75 * default values of the new registers.
76 *
77 * KVM_SREGS_E_BASE contains:
78 * CSRR0/1 (refers to SRR2/3 on 40x)
79 * ESR
80 * DEAR
81 * MCSR
82 * TSR
83 * TCR
84 * DEC
85 * TB
86 * VRSAVE (USPRG0)
87 */
88#define KVM_SREGS_E_BASE (1 << 0)
89
90/*
91 * KVM_SREGS_E_ARCH206 contains:
92 *
93 * PIR
94 * MCSRR0/1
95 * DECAR
96 * IVPR
97 */
98#define KVM_SREGS_E_ARCH206 (1 << 1)
99
100/*
101 * Contains EPCR, plus the upper half of 64-bit registers
102 * that are 32-bit on 32-bit implementations.
103 */
104#define KVM_SREGS_E_64 (1 << 2)
105
106#define KVM_SREGS_E_SPRG8 (1 << 3)
107#define KVM_SREGS_E_MCIVPR (1 << 4)
108
109/*
110 * IVORs are used -- contains IVOR0-15, plus additional IVORs
111 * in combination with an appropriate feature bit.
112 */
113#define KVM_SREGS_E_IVOR (1 << 5)
114
115/*
116 * Contains MAS0-4, MAS6-7, TLBnCFG, MMUCFG.
117 * Also TLBnPS if MMUCFG[MAVN] = 1.
118 */
119#define KVM_SREGS_E_ARCH206_MMU (1 << 6)
120
121/* DBSR, DBCR, IAC, DAC, DVC */
122#define KVM_SREGS_E_DEBUG (1 << 7)
123
124/* Enhanced debug -- DSRR0/1, SPRG9 */
125#define KVM_SREGS_E_ED (1 << 8)
126
127/* Embedded Floating Point (SPE) -- IVOR32-34 if KVM_SREGS_E_IVOR */
128#define KVM_SREGS_E_SPE (1 << 9)
129
130/*
131 * DEPRECATED! USE ONE_REG FOR THIS ONE!
132 * External Proxy (EXP) -- EPR
133 */
134#define KVM_SREGS_EXP (1 << 10)
135
136/* External PID (E.PD) -- EPSC/EPLC */
137#define KVM_SREGS_E_PD (1 << 11)
138
139/* Processor Control (E.PC) -- IVOR36-37 if KVM_SREGS_E_IVOR */
140#define KVM_SREGS_E_PC (1 << 12)
141
142/* Page table (E.PT) -- EPTCFG */
143#define KVM_SREGS_E_PT (1 << 13)
144
145/* Embedded Performance Monitor (E.PM) -- IVOR35 if KVM_SREGS_E_IVOR */
146#define KVM_SREGS_E_PM (1 << 14)
147
148/*
149 * Special updates:
150 *
151 * Some registers may change even while a vcpu is not running.
152 * To avoid losing these changes, by default these registers are
153 * not updated by KVM_SET_SREGS. To force an update, set the bit
154 * in u.e.update_special corresponding to the register to be updated.
155 *
156 * The update_special field is zero on return from KVM_GET_SREGS.
157 *
158 * When restoring a checkpoint, the caller can set update_special
159 * to 0xffffffff to ensure that everything is restored, even new features
160 * that the caller doesn't know about.
161 */
162#define KVM_SREGS_E_UPDATE_MCSR (1 << 0)
163#define KVM_SREGS_E_UPDATE_TSR (1 << 1)
164#define KVM_SREGS_E_UPDATE_DEC (1 << 2)
165#define KVM_SREGS_E_UPDATE_DBSR (1 << 3)
166
167/*
168 * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a
169 * previous KVM_GET_REGS.
170 *
171 * Unless otherwise indicated, setting any register with KVM_SET_SREGS
172 * directly sets its value. It does not trigger any special semantics such
173 * as write-one-to-clear. Calling KVM_SET_SREGS on an unmodified struct
174 * just received from KVM_GET_SREGS is always a no-op.
175 */
176struct kvm_sregs {
177 __u32 pvr;
178 union {
179 struct {
180 __u64 sdr1;
181 struct {
182 struct {
183 __u64 slbe;
184 __u64 slbv;
185 } slb[64];
186 } ppc64;
187 struct {
188 __u32 sr[16];
189 __u64 ibat[8];
190 __u64 dbat[8];
191 } ppc32;
192 } s;
193 struct {
194 union {
195 struct { /* KVM_SREGS_E_IMPL_FSL */
196 __u32 features; /* KVM_SREGS_E_FSL_ */
197 __u32 svr;
198 __u64 mcar;
199 __u32 hid0;
200
201 /* KVM_SREGS_E_FSL_PIDn */
202 __u32 pid1, pid2;
203 } fsl;
204 __u8 pad[256];
205 } impl;
206
207 __u32 features; /* KVM_SREGS_E_ */
208 __u32 impl_id; /* KVM_SREGS_E_IMPL_ */
209 __u32 update_special; /* KVM_SREGS_E_UPDATE_ */
210 __u32 pir; /* read-only */
211 __u64 sprg8;
212 __u64 sprg9; /* E.ED */
213 __u64 csrr0;
214 __u64 dsrr0; /* E.ED */
215 __u64 mcsrr0;
216 __u32 csrr1;
217 __u32 dsrr1; /* E.ED */
218 __u32 mcsrr1;
219 __u32 esr;
220 __u64 dear;
221 __u64 ivpr;
222 __u64 mcivpr;
223 __u64 mcsr; /* KVM_SREGS_E_UPDATE_MCSR */
224
225 __u32 tsr; /* KVM_SREGS_E_UPDATE_TSR */
226 __u32 tcr;
227 __u32 decar;
228 __u32 dec; /* KVM_SREGS_E_UPDATE_DEC */
229
230 /*
231 * Userspace can read TB directly, but the
232 * value reported here is consistent with "dec".
233 *
234 * Read-only.
235 */
236 __u64 tb;
237
238 __u32 dbsr; /* KVM_SREGS_E_UPDATE_DBSR */
239 __u32 dbcr[3];
240 /*
241 * iac/dac registers are 64bit wide, while this API
242 * interface provides only lower 32 bits on 64 bit
243 * processors. ONE_REG interface is added for 64bit
244 * iac/dac registers.
245 */
246 __u32 iac[4];
247 __u32 dac[2];
248 __u32 dvc[2];
249 __u8 num_iac; /* read-only */
250 __u8 num_dac; /* read-only */
251 __u8 num_dvc; /* read-only */
252 __u8 pad;
253
254 __u32 epr; /* EXP */
255 __u32 vrsave; /* a.k.a. USPRG0 */
256 __u32 epcr; /* KVM_SREGS_E_64 */
257
258 __u32 mas0;
259 __u32 mas1;
260 __u64 mas2;
261 __u64 mas7_3;
262 __u32 mas4;
263 __u32 mas6;
264
265 __u32 ivor_low[16]; /* IVOR0-15 */
266 __u32 ivor_high[18]; /* IVOR32+, plus room to expand */
267
268 __u32 mmucfg; /* read-only */
269 __u32 eptcfg; /* E.PT, read-only */
270 __u32 tlbcfg[4];/* read-only */
271 __u32 tlbps[4]; /* read-only */
272
273 __u32 eplc, epsc; /* E.PD */
274 } e;
275 __u8 pad[1020];
276 } u;
277};
278
279struct kvm_fpu {
280 __u64 fpr[32];
281};
282
283/*
284 * Defines for h/w breakpoint, watchpoint (read, write or both) and
285 * software breakpoint.
286 * These are used as "type" in KVM_SET_GUEST_DEBUG ioctl and "status"
287 * for KVM_DEBUG_EXIT.
288 */
289#define KVMPPC_DEBUG_NONE 0x0
290#define KVMPPC_DEBUG_BREAKPOINT (1UL << 1)
291#define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2)
292#define KVMPPC_DEBUG_WATCH_READ (1UL << 3)
293struct kvm_debug_exit_arch {
294 __u64 address;
295 /*
296 * exiting to userspace because of h/w breakpoint, watchpoint
297 * (read, write or both) and software breakpoint.
298 */
299 __u32 status;
300 __u32 reserved;
301};
302
303/* for KVM_SET_GUEST_DEBUG */
304struct kvm_guest_debug_arch {
305 struct {
306 /* H/W breakpoint/watchpoint address */
307 __u64 addr;
308 /*
309 * Type denotes h/w breakpoint, read watchpoint, write
310 * watchpoint or watchpoint (both read and write).
311 */
312 __u32 type;
313 __u32 reserved;
314 } bp[16];
315};
316
317/* Debug related defines */
318/*
319 * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic
320 * and upper 16 bits are architecture specific. Architecture specific defines
321 * that ioctl is for setting hardware breakpoint or software breakpoint.
322 */
323#define KVM_GUESTDBG_USE_SW_BP 0x00010000
324#define KVM_GUESTDBG_USE_HW_BP 0x00020000
325
326/* definition of registers in kvm_run */
327struct kvm_sync_regs {
328};
329
330#define KVM_INTERRUPT_SET -1U
331#define KVM_INTERRUPT_UNSET -2U
332#define KVM_INTERRUPT_SET_LEVEL -3U
333
334#define KVM_CPU_440 1
335#define KVM_CPU_E500V2 2
336#define KVM_CPU_3S_32 3
337#define KVM_CPU_3S_64 4
338#define KVM_CPU_E500MC 5
339
340/* for KVM_CAP_SPAPR_TCE */
341struct kvm_create_spapr_tce {
342 __u64 liobn;
343 __u32 window_size;
344};
345
346/* for KVM_CAP_SPAPR_TCE_64 */
347struct kvm_create_spapr_tce_64 {
348 __u64 liobn;
349 __u32 page_shift;
350 __u32 flags;
351 __u64 offset; /* in pages */
352 __u64 size; /* in pages */
353};
354
355/* for KVM_ALLOCATE_RMA */
356struct kvm_allocate_rma {
357 __u64 rma_size;
358};
359
360/* for KVM_CAP_PPC_RTAS */
361struct kvm_rtas_token_args {
362 char name[120];
363 __u64 token; /* Use a token of 0 to undefine a mapping */
364};
365
366struct kvm_book3e_206_tlb_entry {
367 __u32 mas8;
368 __u32 mas1;
369 __u64 mas2;
370 __u64 mas7_3;
371};
372
373struct kvm_book3e_206_tlb_params {
374 /*
375 * For mmu types KVM_MMU_FSL_BOOKE_NOHV and KVM_MMU_FSL_BOOKE_HV:
376 *
377 * - The number of ways of TLB0 must be a power of two between 2 and
378 * 16.
379 * - TLB1 must be fully associative.
380 * - The size of TLB0 must be a multiple of the number of ways, and
381 * the number of sets must be a power of two.
382 * - The size of TLB1 may not exceed 64 entries.
383 * - TLB0 supports 4 KiB pages.
384 * - The page sizes supported by TLB1 are as indicated by
385 * TLB1CFG (if MMUCFG[MAVN] = 0) or TLB1PS (if MMUCFG[MAVN] = 1)
386 * as returned by KVM_GET_SREGS.
387 * - TLB2 and TLB3 are reserved, and their entries in tlb_sizes[]
388 * and tlb_ways[] must be zero.
389 *
390 * tlb_ways[n] = tlb_sizes[n] means the array is fully associative.
391 *
392 * KVM will adjust TLBnCFG based on the sizes configured here,
393 * though arrays greater than 2048 entries will have TLBnCFG[NENTRY]
394 * set to zero.
395 */
396 __u32 tlb_sizes[4];
397 __u32 tlb_ways[4];
398 __u32 reserved[8];
399};
400
401/* For KVM_PPC_GET_HTAB_FD */
402struct kvm_get_htab_fd {
403 __u64 flags;
404 __u64 start_index;
405 __u64 reserved[2];
406};
407
408/* Values for kvm_get_htab_fd.flags */
409#define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)
410#define KVM_GET_HTAB_WRITE ((__u64)0x2)
411
412/*
413 * Data read on the file descriptor is formatted as a series of
414 * records, each consisting of a header followed by a series of
415 * `n_valid' HPTEs (16 bytes each), which are all valid. Following
416 * those valid HPTEs there are `n_invalid' invalid HPTEs, which
417 * are not represented explicitly in the stream. The same format
418 * is used for writing.
419 */
420struct kvm_get_htab_header {
421 __u32 index;
422 __u16 n_valid;
423 __u16 n_invalid;
424};
425
426/* For KVM_PPC_CONFIGURE_V3_MMU */
427struct kvm_ppc_mmuv3_cfg {
428 __u64 flags;
429 __u64 process_table; /* second doubleword of partition table entry */
430};
431
432/* Flag values for KVM_PPC_CONFIGURE_V3_MMU */
433#define KVM_PPC_MMUV3_RADIX 1 /* 1 = radix mode, 0 = HPT */
434#define KVM_PPC_MMUV3_GTSE 2 /* global translation shootdown enb. */
435
436/* For KVM_PPC_GET_RMMU_INFO */
437struct kvm_ppc_rmmu_info {
438 struct kvm_ppc_radix_geom {
439 __u8 page_shift;
440 __u8 level_bits[4];
441 __u8 pad[3];
442 } geometries[8];
443 __u32 ap_encodings[8];
444};
445
446/* For KVM_PPC_GET_CPU_CHAR */
447struct kvm_ppc_cpu_char {
448 __u64 character; /* characteristics of the CPU */
449 __u64 behaviour; /* recommended software behaviour */
450 __u64 character_mask; /* valid bits in character */
451 __u64 behaviour_mask; /* valid bits in behaviour */
452};
453
454/*
455 * Values for character and character_mask.
456 * These are identical to the values used by H_GET_CPU_CHARACTERISTICS.
457 */
458#define KVM_PPC_CPU_CHAR_SPEC_BAR_ORI31 (1ULL << 63)
459#define KVM_PPC_CPU_CHAR_BCCTRL_SERIALISED (1ULL << 62)
460#define KVM_PPC_CPU_CHAR_L1D_FLUSH_ORI30 (1ULL << 61)
461#define KVM_PPC_CPU_CHAR_L1D_FLUSH_TRIG2 (1ULL << 60)
462#define KVM_PPC_CPU_CHAR_L1D_THREAD_PRIV (1ULL << 59)
463#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)
464#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
465#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
466
467#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
468#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
469#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
470
471/* Per-vcpu XICS interrupt controller state */
472#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
473
474#define KVM_REG_PPC_ICP_CPPR_SHIFT 56 /* current proc priority */
475#define KVM_REG_PPC_ICP_CPPR_MASK 0xff
476#define KVM_REG_PPC_ICP_XISR_SHIFT 32 /* interrupt status field */
477#define KVM_REG_PPC_ICP_XISR_MASK 0xffffff
478#define KVM_REG_PPC_ICP_MFRR_SHIFT 24 /* pending IPI priority */
479#define KVM_REG_PPC_ICP_MFRR_MASK 0xff
480#define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */
481#define KVM_REG_PPC_ICP_PPRI_MASK 0xff
482
483/* Device control API: PPC-specific devices */
484#define KVM_DEV_MPIC_GRP_MISC 1
485#define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */
486
487#define KVM_DEV_MPIC_GRP_REGISTER 2 /* 32-bit */
488#define KVM_DEV_MPIC_GRP_IRQ_ACTIVE 3 /* 32-bit */
489
490/* One-Reg API: PPC-specific registers */
491#define KVM_REG_PPC_HIOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
492#define KVM_REG_PPC_IAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2)
493#define KVM_REG_PPC_IAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3)
494#define KVM_REG_PPC_IAC3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x4)
495#define KVM_REG_PPC_IAC4 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x5)
496#define KVM_REG_PPC_DAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x6)
497#define KVM_REG_PPC_DAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x7)
498#define KVM_REG_PPC_DABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8)
499#define KVM_REG_PPC_DSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9)
500#define KVM_REG_PPC_PURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa)
501#define KVM_REG_PPC_SPURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb)
502#define KVM_REG_PPC_DAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc)
503#define KVM_REG_PPC_DSISR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xd)
504#define KVM_REG_PPC_AMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xe)
505#define KVM_REG_PPC_UAMOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xf)
506
507#define KVM_REG_PPC_MMCR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10)
508#define KVM_REG_PPC_MMCR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11)
509#define KVM_REG_PPC_MMCRA (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12)
510#define KVM_REG_PPC_MMCR2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13)
511#define KVM_REG_PPC_MMCRS (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x14)
512#define KVM_REG_PPC_SIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x15)
513#define KVM_REG_PPC_SDAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x16)
514#define KVM_REG_PPC_SIER (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x17)
515
516#define KVM_REG_PPC_PMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18)
517#define KVM_REG_PPC_PMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19)
518#define KVM_REG_PPC_PMC3 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1a)
519#define KVM_REG_PPC_PMC4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1b)
520#define KVM_REG_PPC_PMC5 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1c)
521#define KVM_REG_PPC_PMC6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1d)
522#define KVM_REG_PPC_PMC7 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1e)
523#define KVM_REG_PPC_PMC8 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1f)
524
525/* 32 floating-point registers */
526#define KVM_REG_PPC_FPR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x20)
527#define KVM_REG_PPC_FPR(n) (KVM_REG_PPC_FPR0 + (n))
528#define KVM_REG_PPC_FPR31 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3f)
529
530/* 32 VMX/Altivec vector registers */
531#define KVM_REG_PPC_VR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x40)
532#define KVM_REG_PPC_VR(n) (KVM_REG_PPC_VR0 + (n))
533#define KVM_REG_PPC_VR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x5f)
534
535/* 32 double-width FP registers for VSX */
536/* High-order halves overlap with FP regs */
537#define KVM_REG_PPC_VSR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x60)
538#define KVM_REG_PPC_VSR(n) (KVM_REG_PPC_VSR0 + (n))
539#define KVM_REG_PPC_VSR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x7f)
540
541/* FP and vector status/control registers */
542#define KVM_REG_PPC_FPSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x80)
543/*
544 * VSCR register is documented as a 32-bit register in the ISA, but it can
545 * only be accesses via a vector register. Expose VSCR as a 32-bit register
546 * even though the kernel represents it as a 128-bit vector.
547 */
548#define KVM_REG_PPC_VSCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x81)
549
550/* Virtual processor areas */
551/* For SLB & DTL, address in high (first) half, length in low half */
552#define KVM_REG_PPC_VPA_ADDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x82)
553#define KVM_REG_PPC_VPA_SLB (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x83)
554#define KVM_REG_PPC_VPA_DTL (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x84)
555
556#define KVM_REG_PPC_EPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x85)
557#define KVM_REG_PPC_EPR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x86)
558
559/* Timer Status Register OR/CLEAR interface */
560#define KVM_REG_PPC_OR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x87)
561#define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88)
562#define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89)
563#define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a)
564
565/* Debugging: Special instruction for software breakpoint */
566#define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b)
567
568/* MMU registers */
569#define KVM_REG_PPC_MAS0 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8c)
570#define KVM_REG_PPC_MAS1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8d)
571#define KVM_REG_PPC_MAS2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8e)
572#define KVM_REG_PPC_MAS7_3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8f)
573#define KVM_REG_PPC_MAS4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x90)
574#define KVM_REG_PPC_MAS6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x91)
575#define KVM_REG_PPC_MMUCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x92)
576/*
577 * TLBnCFG fields TLBnCFG_N_ENTRY and TLBnCFG_ASSOC can be changed only using
578 * KVM_CAP_SW_TLB ioctl
579 */
580#define KVM_REG_PPC_TLB0CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x93)
581#define KVM_REG_PPC_TLB1CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x94)
582#define KVM_REG_PPC_TLB2CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x95)
583#define KVM_REG_PPC_TLB3CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x96)
584#define KVM_REG_PPC_TLB0PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x97)
585#define KVM_REG_PPC_TLB1PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x98)
586#define KVM_REG_PPC_TLB2PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x99)
587#define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a)
588#define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b)
589
590/* Timebase offset */
591#define KVM_REG_PPC_TB_OFFSET (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9c)
592
593/* POWER8 registers */
594#define KVM_REG_PPC_SPMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9d)
595#define KVM_REG_PPC_SPMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9e)
596#define KVM_REG_PPC_IAMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9f)
597#define KVM_REG_PPC_TFHAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa0)
598#define KVM_REG_PPC_TFIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa1)
599#define KVM_REG_PPC_TEXASR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa2)
600#define KVM_REG_PPC_FSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa3)
601#define KVM_REG_PPC_PSPB (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xa4)
602#define KVM_REG_PPC_EBBHR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa5)
603#define KVM_REG_PPC_EBBRR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa6)
604#define KVM_REG_PPC_BESCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa7)
605#define KVM_REG_PPC_TAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa8)
606#define KVM_REG_PPC_DPDES (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa9)
607#define KVM_REG_PPC_DAWR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaa)
608#define KVM_REG_PPC_DAWRX (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xab)
609#define KVM_REG_PPC_CIABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xac)
610#define KVM_REG_PPC_IC (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xad)
611#define KVM_REG_PPC_VTB (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xae)
612#define KVM_REG_PPC_CSIGR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaf)
613#define KVM_REG_PPC_TACR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb0)
614#define KVM_REG_PPC_TCSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb1)
615#define KVM_REG_PPC_PID (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb2)
616#define KVM_REG_PPC_ACOP (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb3)
617
618#define KVM_REG_PPC_VRSAVE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb4)
619#define KVM_REG_PPC_LPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb5)
620#define KVM_REG_PPC_LPCR_64 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb5)
621#define KVM_REG_PPC_PPR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb6)
622
623/* Architecture compatibility level */
624#define KVM_REG_PPC_ARCH_COMPAT (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb7)
625
626#define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8)
627#define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9)
628#define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
629#define KVM_REG_PPC_DBSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb)
630
631/* POWER9 registers */
632#define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc)
633#define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
634
635#define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
636#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)
637
638/* Transactional Memory checkpointed state:
639 * This is all GPRs, all VSX regs and a subset of SPRs
640 */
641#define KVM_REG_PPC_TM (KVM_REG_PPC | 0x80000000)
642/* TM GPRs */
643#define KVM_REG_PPC_TM_GPR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0)
644#define KVM_REG_PPC_TM_GPR(n) (KVM_REG_PPC_TM_GPR0 + (n))
645#define KVM_REG_PPC_TM_GPR31 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x1f)
646/* TM VSX */
647#define KVM_REG_PPC_TM_VSR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x20)
648#define KVM_REG_PPC_TM_VSR(n) (KVM_REG_PPC_TM_VSR0 + (n))
649#define KVM_REG_PPC_TM_VSR63 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x5f)
650/* TM SPRS */
651#define KVM_REG_PPC_TM_CR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x60)
652#define KVM_REG_PPC_TM_LR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x61)
653#define KVM_REG_PPC_TM_CTR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x62)
654#define KVM_REG_PPC_TM_FPSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x63)
655#define KVM_REG_PPC_TM_AMR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x64)
656#define KVM_REG_PPC_TM_PPR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x65)
657#define KVM_REG_PPC_TM_VRSAVE (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x66)
658#define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67)
659#define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68)
660#define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69)
661#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a)
662
663/* PPC64 eXternal Interrupt Controller Specification */
664#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
665
666/* Layout of 64-bit source attribute values */
667#define KVM_XICS_DESTINATION_SHIFT 0
668#define KVM_XICS_DESTINATION_MASK 0xffffffffULL
669#define KVM_XICS_PRIORITY_SHIFT 32
670#define KVM_XICS_PRIORITY_MASK 0xff
671#define KVM_XICS_LEVEL_SENSITIVE (1ULL << 40)
672#define KVM_XICS_MASKED (1ULL << 41)
673#define KVM_XICS_PENDING (1ULL << 42)
674#define KVM_XICS_PRESENTED (1ULL << 43)
675#define KVM_XICS_QUEUED (1ULL << 44)
676
677#endif /* __LINUX_KVM_POWERPC_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/kvm_para.h deleted-98
...@@ -1,98 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2008
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
20
21#ifndef __POWERPC_KVM_PARA_H__
22#define __POWERPC_KVM_PARA_H__
23
24#include <linux/types.h>
25
26/*
27 * Additions to this struct must only occur at the end, and should be
28 * accompanied by a KVM_MAGIC_FEAT flag to advertise that they are present
29 * (albeit not necessarily relevant to the current target hardware platform).
30 *
31 * Struct fields are always 32 or 64 bit aligned, depending on them being 32
32 * or 64 bit wide respectively.
33 *
34 * See Documentation/virtual/kvm/ppc-pv.txt
35 */
36struct kvm_vcpu_arch_shared {
37 __u64 scratch1;
38 __u64 scratch2;
39 __u64 scratch3;
40 __u64 critical; /* Guest may not get interrupts if == r1 */
41 __u64 sprg0;
42 __u64 sprg1;
43 __u64 sprg2;
44 __u64 sprg3;
45 __u64 srr0;
46 __u64 srr1;
47 __u64 dar; /* dear on BookE */
48 __u64 msr;
49 __u32 dsisr;
50 __u32 int_pending; /* Tells the guest if we have an interrupt */
51 __u32 sr[16];
52 __u32 mas0;
53 __u32 mas1;
54 __u64 mas7_3;
55 __u64 mas2;
56 __u32 mas4;
57 __u32 mas6;
58 __u32 esr;
59 __u32 pir;
60
61 /*
62 * SPRG4-7 are user-readable, so we can only keep these consistent
63 * between the shared area and the real registers when there's an
64 * intervening exit to KVM. This also applies to SPRG3 on some
65 * chips.
66 *
67 * This suffices for access by guest userspace, since in PR-mode
68 * KVM, an exit must occur when changing the guest's MSR[PR].
69 * If the guest kernel writes to SPRG3-7 via the shared area, it
70 * must also use the shared area for reading while in kernel space.
71 */
72 __u64 sprg4;
73 __u64 sprg5;
74 __u64 sprg6;
75 __u64 sprg7;
76};
77
78#define KVM_SC_MAGIC_R0 0x4b564d21 /* "KVM!" */
79
80#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)
81
82#include <asm/epapr_hcalls.h>
83
84#define KVM_FEATURE_MAGIC_PAGE 1
85
86/* Magic page flags from host to guest */
87
88#define KVM_MAGIC_FEAT_SR (1 << 0)
89
90/* MASn, ESR, PIR, and high SPRGs */
91#define KVM_MAGIC_FEAT_MAS0_TO_SPRG7 (1 << 1)
92
93/* Magic page flags from guest to host */
94
95#define MAGIC_PAGE_FLAG_NOT_MAPPED_NX (1 << 0)
96
97
98#endif /* __POWERPC_KVM_PARA_H__ */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/mman.h deleted-39
...@@ -1,39 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 */
8#ifndef _ASM_POWERPC_MMAN_H
9#define _ASM_POWERPC_MMAN_H
10
11#include <asm-generic/mman-common.h>
12
13
14#define PROT_SAO 0x10 /* Strong Access Ordering */
15
16#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
17#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
18#define MAP_LOCKED 0x80
19
20#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
21#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
22#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
23
24#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
25#define MCL_FUTURE 0x4000 /* lock all additions to address space */
26#define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */
27
28#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
29#define MAP_NONBLOCK 0x10000 /* do not block on IO */
30#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
31#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
32
33/* Override any generic PKEY permission defines */
34#define PKEY_DISABLE_EXECUTE 0x4
35#undef PKEY_ACCESS_MASK
36#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
37 PKEY_DISABLE_WRITE |\
38 PKEY_DISABLE_EXECUTE)
39#endif /* _ASM_POWERPC_MMAN_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/msgbuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_MSGBUF_H
3#define _ASM_POWERPC_MSGBUF_H
4
5/*
6 * The msqid64_ds structure for the PowerPC architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 */
10
11struct msqid64_ds {
12 struct ipc64_perm msg_perm;
13#ifdef __powerpc64__
14 __kernel_time_t msg_stime; /* last msgsnd time */
15 __kernel_time_t msg_rtime; /* last msgrcv time */
16 __kernel_time_t msg_ctime; /* last change time */
17#else
18 unsigned long msg_stime_high;
19 unsigned long msg_stime; /* last msgsnd time */
20 unsigned long msg_rtime_high;
21 unsigned long msg_rtime; /* last msgrcv time */
22 unsigned long msg_ctime_high;
23 unsigned long msg_ctime; /* last change time */
24#endif
25 unsigned long msg_cbytes; /* current number of bytes on queue */
26 unsigned long msg_qnum; /* number of messages in queue */
27 unsigned long msg_qbytes; /* max number of bytes on queue */
28 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
29 __kernel_pid_t msg_lrpid; /* last receive pid */
30 unsigned long __unused4;
31 unsigned long __unused5;
32};
33
34#endif /* _ASM_POWERPC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/perf_regs.h deleted-51
...@@ -1,51 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_PERF_REGS_H
3#define _ASM_POWERPC_PERF_REGS_H
4
5enum perf_event_powerpc_regs {
6 PERF_REG_POWERPC_R0,
7 PERF_REG_POWERPC_R1,
8 PERF_REG_POWERPC_R2,
9 PERF_REG_POWERPC_R3,
10 PERF_REG_POWERPC_R4,
11 PERF_REG_POWERPC_R5,
12 PERF_REG_POWERPC_R6,
13 PERF_REG_POWERPC_R7,
14 PERF_REG_POWERPC_R8,
15 PERF_REG_POWERPC_R9,
16 PERF_REG_POWERPC_R10,
17 PERF_REG_POWERPC_R11,
18 PERF_REG_POWERPC_R12,
19 PERF_REG_POWERPC_R13,
20 PERF_REG_POWERPC_R14,
21 PERF_REG_POWERPC_R15,
22 PERF_REG_POWERPC_R16,
23 PERF_REG_POWERPC_R17,
24 PERF_REG_POWERPC_R18,
25 PERF_REG_POWERPC_R19,
26 PERF_REG_POWERPC_R20,
27 PERF_REG_POWERPC_R21,
28 PERF_REG_POWERPC_R22,
29 PERF_REG_POWERPC_R23,
30 PERF_REG_POWERPC_R24,
31 PERF_REG_POWERPC_R25,
32 PERF_REG_POWERPC_R26,
33 PERF_REG_POWERPC_R27,
34 PERF_REG_POWERPC_R28,
35 PERF_REG_POWERPC_R29,
36 PERF_REG_POWERPC_R30,
37 PERF_REG_POWERPC_R31,
38 PERF_REG_POWERPC_NIP,
39 PERF_REG_POWERPC_MSR,
40 PERF_REG_POWERPC_ORIG_R3,
41 PERF_REG_POWERPC_CTR,
42 PERF_REG_POWERPC_LINK,
43 PERF_REG_POWERPC_XER,
44 PERF_REG_POWERPC_CCR,
45 PERF_REG_POWERPC_SOFTE,
46 PERF_REG_POWERPC_TRAP,
47 PERF_REG_POWERPC_DAR,
48 PERF_REG_POWERPC_DSISR,
49 PERF_REG_POWERPC_MAX,
50};
51#endif /* _ASM_POWERPC_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/posix_types.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_POSIX_TYPES_H
3#define _ASM_POWERPC_POSIX_TYPES_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11#ifdef __powerpc64__
12typedef unsigned long __kernel_old_dev_t;
13#define __kernel_old_dev_t __kernel_old_dev_t
14#else
15typedef unsigned int __kernel_size_t;
16typedef int __kernel_ssize_t;
17typedef long __kernel_ptrdiff_t;
18#define __kernel_size_t __kernel_size_t
19
20typedef short __kernel_ipc_pid_t;
21#define __kernel_ipc_pid_t __kernel_ipc_pid_t
22#endif
23
24#include <asm-generic/posix_types.h>
25
26#endif /* _ASM_POWERPC_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/ptrace.h deleted-262
...@@ -1,262 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2001 PPC64 Team, IBM Corp
4 *
5 * This struct defines the way the registers are stored on the
6 * kernel stack during a system call or other kernel entry.
7 *
8 * this should only contain __volatile__ regs
9 * since we can keep non-volatile in the thread_struct
10 * should set this up when only volatiles are saved
11 * by intr code.
12 *
13 * Since this is going on the stack, *CARE MUST BE TAKEN* to insure
14 * that the overall structure is a multiple of 16 bytes in length.
15 *
16 * Note that the offsets of the fields in this struct correspond with
17 * the PT_* values below. This simplifies arch/powerpc/kernel/ptrace.c.
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24#ifndef _ASM_POWERPC_PTRACE_H
25#define _ASM_POWERPC_PTRACE_H
26
27
28#include <linux/types.h>
29
30#ifndef __ASSEMBLY__
31
32struct pt_regs {
33 unsigned long gpr[32];
34 unsigned long nip;
35 unsigned long msr;
36 unsigned long orig_gpr3; /* Used for restarting system calls */
37 unsigned long ctr;
38 unsigned long link;
39 unsigned long xer;
40 unsigned long ccr;
41#ifdef __powerpc64__
42 unsigned long softe; /* Soft enabled/disabled */
43#else
44 unsigned long mq; /* 601 only (not used at present) */
45 /* Used on APUS to hold IPL value. */
46#endif
47 unsigned long trap; /* Reason for being here */
48 /* N.B. for critical exceptions on 4xx, the dar and dsisr
49 fields are overloaded to hold srr0 and srr1. */
50 unsigned long dar; /* Fault registers */
51 unsigned long dsisr; /* on 4xx/Book-E used for ESR */
52 unsigned long result; /* Result of a system call */
53};
54
55#endif /* __ASSEMBLY__ */
56
57
58/*
59 * Offsets used by 'ptrace' system call interface.
60 * These can't be changed without breaking binary compatibility
61 * with MkLinux, etc.
62 */
63#define PT_R0 0
64#define PT_R1 1
65#define PT_R2 2
66#define PT_R3 3
67#define PT_R4 4
68#define PT_R5 5
69#define PT_R6 6
70#define PT_R7 7
71#define PT_R8 8
72#define PT_R9 9
73#define PT_R10 10
74#define PT_R11 11
75#define PT_R12 12
76#define PT_R13 13
77#define PT_R14 14
78#define PT_R15 15
79#define PT_R16 16
80#define PT_R17 17
81#define PT_R18 18
82#define PT_R19 19
83#define PT_R20 20
84#define PT_R21 21
85#define PT_R22 22
86#define PT_R23 23
87#define PT_R24 24
88#define PT_R25 25
89#define PT_R26 26
90#define PT_R27 27
91#define PT_R28 28
92#define PT_R29 29
93#define PT_R30 30
94#define PT_R31 31
95
96#define PT_NIP 32
97#define PT_MSR 33
98#define PT_ORIG_R3 34
99#define PT_CTR 35
100#define PT_LNK 36
101#define PT_XER 37
102#define PT_CCR 38
103#ifndef __powerpc64__
104#define PT_MQ 39
105#else
106#define PT_SOFTE 39
107#endif
108#define PT_TRAP 40
109#define PT_DAR 41
110#define PT_DSISR 42
111#define PT_RESULT 43
112#define PT_DSCR 44
113#define PT_REGS_COUNT 44
114
115#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
116
117#ifndef __powerpc64__
118
119#define PT_FPR31 (PT_FPR0 + 2*31)
120#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
121
122#else /* __powerpc64__ */
123
124#define PT_FPSCR (PT_FPR0 + 32) /* each FP reg occupies 1 slot in 64-bit space */
125
126
127#define PT_VR0 82 /* each Vector reg occupies 2 slots in 64-bit */
128#define PT_VSCR (PT_VR0 + 32*2 + 1)
129#define PT_VRSAVE (PT_VR0 + 33*2)
130
131
132/*
133 * Only store first 32 VSRs here. The second 32 VSRs in VR0-31
134 */
135#define PT_VSR0 150 /* each VSR reg occupies 2 slots in 64-bit */
136#define PT_VSR31 (PT_VSR0 + 2*31)
137#endif /* __powerpc64__ */
138
139/*
140 * Get/set all the altivec registers v0..v31, vscr, vrsave, in one go.
141 * The transfer totals 34 quadword. Quadwords 0-31 contain the
142 * corresponding vector registers. Quadword 32 contains the vscr as the
143 * last word (offset 12) within that quadword. Quadword 33 contains the
144 * vrsave as the first word (offset 0) within the quadword.
145 *
146 * This definition of the VMX state is compatible with the current PPC32
147 * ptrace interface. This allows signal handling and ptrace to use the same
148 * structures. This also simplifies the implementation of a bi-arch
149 * (combined (32- and 64-bit) gdb.
150 */
151#define PTRACE_GETVRREGS 0x12
152#define PTRACE_SETVRREGS 0x13
153
154/* Get/set all the upper 32-bits of the SPE registers, accumulator, and
155 * spefscr, in one go */
156#define PTRACE_GETEVRREGS 0x14
157#define PTRACE_SETEVRREGS 0x15
158
159/* Get the first 32 128bit VSX registers */
160#define PTRACE_GETVSRREGS 0x1b
161#define PTRACE_SETVSRREGS 0x1c
162
163/*
164 * Get or set a debug register. The first 16 are DABR registers and the
165 * second 16 are IABR registers.
166 */
167#define PTRACE_GET_DEBUGREG 0x19
168#define PTRACE_SET_DEBUGREG 0x1a
169
170/* (new) PTRACE requests using the same numbers as x86 and the same
171 * argument ordering. Additionally, they support more registers too
172 */
173#define PTRACE_GETREGS 0xc
174#define PTRACE_SETREGS 0xd
175#define PTRACE_GETFPREGS 0xe
176#define PTRACE_SETFPREGS 0xf
177#define PTRACE_GETREGS64 0x16
178#define PTRACE_SETREGS64 0x17
179
180/* Calls to trace a 64bit program from a 32bit program */
181#define PPC_PTRACE_PEEKTEXT_3264 0x95
182#define PPC_PTRACE_PEEKDATA_3264 0x94
183#define PPC_PTRACE_POKETEXT_3264 0x93
184#define PPC_PTRACE_POKEDATA_3264 0x92
185#define PPC_PTRACE_PEEKUSR_3264 0x91
186#define PPC_PTRACE_POKEUSR_3264 0x90
187
188#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */
189
190#define PPC_PTRACE_GETHWDBGINFO 0x89
191#define PPC_PTRACE_SETHWDEBUG 0x88
192#define PPC_PTRACE_DELHWDEBUG 0x87
193
194#ifndef __ASSEMBLY__
195
196struct ppc_debug_info {
197 __u32 version; /* Only version 1 exists to date */
198 __u32 num_instruction_bps;
199 __u32 num_data_bps;
200 __u32 num_condition_regs;
201 __u32 data_bp_alignment;
202 __u32 sizeof_condition; /* size of the DVC register */
203 __u64 features;
204};
205
206#endif /* __ASSEMBLY__ */
207
208/*
209 * features will have bits indication whether there is support for:
210 */
211#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x0000000000000001
212#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x0000000000000002
213#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004
214#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008
215#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010
216
217#ifndef __ASSEMBLY__
218
219struct ppc_hw_breakpoint {
220 __u32 version; /* currently, version must be 1 */
221 __u32 trigger_type; /* only some combinations allowed */
222 __u32 addr_mode; /* address match mode */
223 __u32 condition_mode; /* break/watchpoint condition flags */
224 __u64 addr; /* break/watchpoint address */
225 __u64 addr2; /* range end or mask */
226 __u64 condition_value; /* contents of the DVC register */
227};
228
229#endif /* __ASSEMBLY__ */
230
231/*
232 * Trigger Type
233 */
234#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x00000001
235#define PPC_BREAKPOINT_TRIGGER_READ 0x00000002
236#define PPC_BREAKPOINT_TRIGGER_WRITE 0x00000004
237#define PPC_BREAKPOINT_TRIGGER_RW \
238 (PPC_BREAKPOINT_TRIGGER_READ | PPC_BREAKPOINT_TRIGGER_WRITE)
239
240/*
241 * Address Mode
242 */
243#define PPC_BREAKPOINT_MODE_EXACT 0x00000000
244#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x00000001
245#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x00000002
246#define PPC_BREAKPOINT_MODE_MASK 0x00000003
247
248/*
249 * Condition Mode
250 */
251#define PPC_BREAKPOINT_CONDITION_MODE 0x00000003
252#define PPC_BREAKPOINT_CONDITION_NONE 0x00000000
253#define PPC_BREAKPOINT_CONDITION_AND 0x00000001
254#define PPC_BREAKPOINT_CONDITION_EXACT PPC_BREAKPOINT_CONDITION_AND
255#define PPC_BREAKPOINT_CONDITION_OR 0x00000002
256#define PPC_BREAKPOINT_CONDITION_AND_OR 0x00000003
257#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000
258#define PPC_BREAKPOINT_CONDITION_BE_SHIFT 16
259#define PPC_BREAKPOINT_CONDITION_BE(n) \
260 (1<<((n)+PPC_BREAKPOINT_CONDITION_BE_SHIFT))
261
262#endif /* _ASM_POWERPC_PTRACE_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/sembuf.h deleted-37
...@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SEMBUF_H
3#define _ASM_POWERPC_SEMBUF_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/*
13 * The semid64_ds structure for PPC architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 2 miscellaneous 32/64-bit values
19 */
20
21struct semid64_ds {
22 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
23#ifndef __powerpc64__
24 unsigned long sem_otime_high;
25 unsigned long sem_otime; /* last semop time */
26 unsigned long sem_ctime_high;
27 unsigned long sem_ctime; /* last change time */
28#else
29 __kernel_time_t sem_otime; /* last semop time */
30 __kernel_time_t sem_ctime; /* last change time */
31#endif
32 unsigned long sem_nsems; /* no. of semaphores in array */
33 unsigned long __unused3;
34 unsigned long __unused4;
35};
36
37#endif /* _ASM_POWERPC_SEMBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/setup.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SETUP_H
3#define _ASM_POWERPC_SETUP_H
4
5#define COMMAND_LINE_SIZE 2048
6
7#endif /* _ASM_POWERPC_SETUP_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/shmbuf.h deleted-57
...@@ -1,57 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SHMBUF_H
3#define _ASM_POWERPC_SHMBUF_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/*
13 * The shmid64_ds structure for PPC architecture.
14 *
15 * Note extra padding because this structure is passed back and forth
16 * between kernel and user space.
17 *
18 * Pad space is left for:
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct shmid64_ds {
23 struct ipc64_perm shm_perm; /* operation perms */
24#ifdef __powerpc64__
25 __kernel_time_t shm_atime; /* last attach time */
26 __kernel_time_t shm_dtime; /* last detach time */
27 __kernel_time_t shm_ctime; /* last change time */
28#else
29 unsigned long shm_atime_high;
30 unsigned long shm_atime; /* last attach time */
31 unsigned long shm_dtime_high;
32 unsigned long shm_dtime; /* last detach time */
33 unsigned long shm_ctime_high;
34 unsigned long shm_ctime; /* last change time */
35 unsigned long __unused4;
36#endif
37 size_t shm_segsz; /* size of segment (bytes) */
38 __kernel_pid_t shm_cpid; /* pid of creator */
39 __kernel_pid_t shm_lpid; /* pid of last operator */
40 unsigned long shm_nattch; /* no. of current attaches */
41 unsigned long __unused5;
42 unsigned long __unused6;
43};
44
45struct shminfo64 {
46 unsigned long shmmax;
47 unsigned long shmmin;
48 unsigned long shmmni;
49 unsigned long shmseg;
50 unsigned long shmall;
51 unsigned long __unused1;
52 unsigned long __unused2;
53 unsigned long __unused3;
54 unsigned long __unused4;
55};
56
57#endif /* _ASM_POWERPC_SHMBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/sigcontext.h deleted-88
...@@ -1,88 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGCONTEXT_H
3#define _ASM_POWERPC_SIGCONTEXT_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <asm/ptrace.h>
13#ifdef __powerpc64__
14#include <asm/elf.h>
15#endif
16
17struct sigcontext {
18 unsigned long _unused[4];
19 int signal;
20#ifdef __powerpc64__
21 int _pad0;
22#endif
23 unsigned long handler;
24 unsigned long oldmask;
25 struct pt_regs *regs;
26#ifdef __powerpc64__
27 elf_gregset_t gp_regs;
28 elf_fpregset_t fp_regs;
29/*
30 * To maintain compatibility with current implementations the sigcontext is
31 * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
32 * followed by an unstructured (vmx_reserve) field of 101 doublewords. This
33 * allows the array of vector registers to be quadword aligned independent of
34 * the alignment of the containing sigcontext or ucontext. It is the
35 * responsibility of the code setting the sigcontext to set this pointer to
36 * either NULL (if this processor does not support the VMX feature) or the
37 * address of the first quadword within the allocated (vmx_reserve) area.
38 *
39 * The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with
40 * an array of 34 quadword entries (elf_vrregset_t). The entries with
41 * indexes 0-31 contain the corresponding vector registers. The entry with
42 * index 32 contains the vscr as the last word (offset 12) within the
43 * quadword. This allows the vscr to be stored as either a quadword (since
44 * it must be copied via a vector register to/from storage) or as a word.
45 * The entry with index 33 contains the vrsave as the first word (offset 0)
46 * within the quadword.
47 *
48 * Part of the VSX data is stored here also by extending vmx_restore
49 * by an additional 32 double words. Architecturally the layout of
50 * the VSR registers and how they overlap on top of the legacy FPR and
51 * VR registers is shown below:
52 *
53 * VSR doubleword 0 VSR doubleword 1
54 * ----------------------------------------------------------------
55 * VSR[0] | FPR[0] | |
56 * ----------------------------------------------------------------
57 * VSR[1] | FPR[1] | |
58 * ----------------------------------------------------------------
59 * | ... | |
60 * | ... | |
61 * ----------------------------------------------------------------
62 * VSR[30] | FPR[30] | |
63 * ----------------------------------------------------------------
64 * VSR[31] | FPR[31] | |
65 * ----------------------------------------------------------------
66 * VSR[32] | VR[0] |
67 * ----------------------------------------------------------------
68 * VSR[33] | VR[1] |
69 * ----------------------------------------------------------------
70 * | ... |
71 * | ... |
72 * ----------------------------------------------------------------
73 * VSR[62] | VR[30] |
74 * ----------------------------------------------------------------
75 * VSR[63] | VR[31] |
76 * ----------------------------------------------------------------
77 *
78 * FPR/VSR 0-31 doubleword 0 is stored in fp_regs, and VMX/VSR 32-63
79 * is stored at the start of vmx_reserve. vmx_reserve is extended for
80 * backwards compatility to store VSR 0-31 doubleword 1 after the VMX
81 * registers and vscr/vrsave.
82 */
83 elf_vrreg_t *v_regs;
84 long vmx_reserve[ELF_NVRREG + ELF_NVRREG + 1 + 32];
85#endif
86};
87
88#endif /* _ASM_POWERPC_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/siginfo.h deleted-18
...@@ -1,18 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGINFO_H
3#define _ASM_POWERPC_SIGINFO_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifdef __powerpc64__
13# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
14#endif
15
16#include <asm-generic/siginfo.h>
17
18#endif /* _ASM_POWERPC_SIGINFO_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/signal.h deleted-136
...@@ -1,136 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGNAL_H
3#define _ASM_POWERPC_SIGNAL_H
4
5#include <linux/types.h>
6
7#define _NSIG 64
8#ifdef __powerpc64__
9#define _NSIG_BPW 64
10#else
11#define _NSIG_BPW 32
12#endif
13#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
14
15typedef unsigned long old_sigset_t; /* at least 32 bits */
16
17typedef struct {
18 unsigned long sig[_NSIG_WORDS];
19} sigset_t;
20
21#define SIGHUP 1
22#define SIGINT 2
23#define SIGQUIT 3
24#define SIGILL 4
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28#define SIGBUS 7
29#define SIGFPE 8
30#define SIGKILL 9
31#define SIGUSR1 10
32#define SIGSEGV 11
33#define SIGUSR2 12
34#define SIGPIPE 13
35#define SIGALRM 14
36#define SIGTERM 15
37#define SIGSTKFLT 16
38#define SIGCHLD 17
39#define SIGCONT 18
40#define SIGSTOP 19
41#define SIGTSTP 20
42#define SIGTTIN 21
43#define SIGTTOU 22
44#define SIGURG 23
45#define SIGXCPU 24
46#define SIGXFSZ 25
47#define SIGVTALRM 26
48#define SIGPROF 27
49#define SIGWINCH 28
50#define SIGIO 29
51#define SIGPOLL SIGIO
52/*
53#define SIGLOST 29
54*/
55#define SIGPWR 30
56#define SIGSYS 31
57#define SIGUNUSED 31
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001U
77#define SA_NOCLDWAIT 0x00000002U
78#define SA_SIGINFO 0x00000004U
79#define SA_ONSTACK 0x08000000U
80#define SA_RESTART 0x10000000U
81#define SA_NODEFER 0x40000000U
82#define SA_RESETHAND 0x80000000U
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000U
88
89#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192
91
92#include <asm-generic/signal-defs.h>
93
94struct old_sigaction {
95 __sighandler_t sa_handler;
96 old_sigset_t sa_mask;
97 unsigned long sa_flags;
98 __sigrestore_t sa_restorer;
99};
100
101struct sigaction {
102 __sighandler_t sa_handler;
103 unsigned long sa_flags;
104 __sigrestore_t sa_restorer;
105 sigset_t sa_mask; /* mask last for extensibility */
106};
107
108typedef struct sigaltstack {
109 void *ss_sp;
110 int ss_flags;
111 size_t ss_size;
112} stack_t;
113
114
115#ifndef __powerpc64__
116/*
117 * These are parameters to dbg_sigreturn syscall. They enable or
118 * disable certain debugging things that can be done from signal
119 * handlers. The dbg_sigreturn syscall *must* be called from a
120 * SA_SIGINFO signal so the ucontext can be passed to it. It takes an
121 * array of struct sig_dbg_op, which has the debug operations to
122 * perform before returning from the signal.
123 */
124struct sig_dbg_op {
125 int dbg_type;
126 unsigned long dbg_value;
127};
128
129/* Enable or disable single-stepping. The value sets the state. */
130#define SIG_DBG_SINGLE_STEPPING 1
131
132/* Enable or disable branch tracing. The value sets the state. */
133#define SIG_DBG_BRANCH_TRACING 2
134#endif /* ! __powerpc64__ */
135
136#endif /* _ASM_POWERPC_SIGNAL_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/socket.h deleted-21
...@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SOCKET_H
3#define _ASM_POWERPC_SOCKET_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#define SO_RCVLOWAT 16
13#define SO_SNDLOWAT 17
14#define SO_RCVTIMEO 18
15#define SO_SNDTIMEO 19
16#define SO_PASSCRED 20
17#define SO_PEERCRED 21
18
19#include <asm-generic/socket.h>
20
21#endif /* _ASM_POWERPC_SOCKET_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/stat.h deleted-82
...@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_STAT_H
3#define _ASM_POWERPC_STAT_H
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#include <linux/types.h>
11
12#define STAT_HAVE_NSEC 1
13
14#ifndef __powerpc64__
15struct __old_kernel_stat {
16 unsigned short st_dev;
17 unsigned short st_ino;
18 unsigned short st_mode;
19 unsigned short st_nlink;
20 unsigned short st_uid;
21 unsigned short st_gid;
22 unsigned short st_rdev;
23 unsigned long st_size;
24 unsigned long st_atime;
25 unsigned long st_mtime;
26 unsigned long st_ctime;
27};
28#endif /* !__powerpc64__ */
29
30struct stat {
31 unsigned long st_dev;
32 ino_t st_ino;
33#ifdef __powerpc64__
34 unsigned long st_nlink;
35 mode_t st_mode;
36#else
37 mode_t st_mode;
38 unsigned short st_nlink;
39#endif
40 uid_t st_uid;
41 gid_t st_gid;
42 unsigned long st_rdev;
43 off_t st_size;
44 unsigned long st_blksize;
45 unsigned long st_blocks;
46 unsigned long st_atime;
47 unsigned long st_atime_nsec;
48 unsigned long st_mtime;
49 unsigned long st_mtime_nsec;
50 unsigned long st_ctime;
51 unsigned long st_ctime_nsec;
52 unsigned long __unused4;
53 unsigned long __unused5;
54#ifdef __powerpc64__
55 unsigned long __unused6;
56#endif
57};
58
59/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
60struct stat64 {
61 unsigned long long st_dev; /* Device. */
62 unsigned long long st_ino; /* File serial number. */
63 unsigned int st_mode; /* File mode. */
64 unsigned int st_nlink; /* Link count. */
65 unsigned int st_uid; /* User ID of the file's owner. */
66 unsigned int st_gid; /* Group ID of the file's group. */
67 unsigned long long st_rdev; /* Device number, if device. */
68 unsigned short __pad2;
69 long long st_size; /* Size of file, in bytes. */
70 int st_blksize; /* Optimal block size for I/O. */
71 long long st_blocks; /* Number 512-byte blocks allocated. */
72 int st_atime; /* Time of last access. */
73 unsigned int st_atime_nsec;
74 int st_mtime; /* Time of last modification. */
75 unsigned int st_mtime_nsec;
76 int st_ctime; /* Time of last status change. */
77 unsigned int st_ctime_nsec;
78 unsigned int __unused4;
79 unsigned int __unused5;
80};
81
82#endif /* _ASM_POWERPC_STAT_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/swab.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 */
8#ifndef _ASM_POWERPC_SWAB_H
9#define _ASM_POWERPC_SWAB_H
10
11
12#include <linux/types.h>
13
14
15#ifdef __GNUC__
16
17#ifndef __powerpc64__
18#define __SWAB_64_THRU_32__
19#endif /* __powerpc64__ */
20
21
22#endif /* __GNUC__ */
23
24#endif /* _ASM_POWERPC_SWAB_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/termbits.h deleted-211
...@@ -1,211 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_TERMBITS_H
3#define _ASM_POWERPC_TERMBITS_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12typedef unsigned char cc_t;
13typedef unsigned int speed_t;
14typedef unsigned int tcflag_t;
15
16/*
17 * termios type and macro definitions. Be careful about adding stuff
18 * to this file since it's used in GNU libc and there are strict rules
19 * concerning namespace pollution.
20 */
21
22#define NCCS 19
23struct termios {
24 tcflag_t c_iflag; /* input mode flags */
25 tcflag_t c_oflag; /* output mode flags */
26 tcflag_t c_cflag; /* control mode flags */
27 tcflag_t c_lflag; /* local mode flags */
28 cc_t c_cc[NCCS]; /* control characters */
29 cc_t c_line; /* line discipline (== c_cc[19]) */
30 speed_t c_ispeed; /* input speed */
31 speed_t c_ospeed; /* output speed */
32};
33
34/* For PowerPC the termios and ktermios are the same */
35
36struct ktermios {
37 tcflag_t c_iflag; /* input mode flags */
38 tcflag_t c_oflag; /* output mode flags */
39 tcflag_t c_cflag; /* control mode flags */
40 tcflag_t c_lflag; /* local mode flags */
41 cc_t c_cc[NCCS]; /* control characters */
42 cc_t c_line; /* line discipline (== c_cc[19]) */
43 speed_t c_ispeed; /* input speed */
44 speed_t c_ospeed; /* output speed */
45};
46
47/* c_cc characters */
48#define VINTR 0
49#define VQUIT 1
50#define VERASE 2
51#define VKILL 3
52#define VEOF 4
53#define VMIN 5
54#define VEOL 6
55#define VTIME 7
56#define VEOL2 8
57#define VSWTC 9
58#define VWERASE 10
59#define VREPRINT 11
60#define VSUSP 12
61#define VSTART 13
62#define VSTOP 14
63#define VLNEXT 15
64#define VDISCARD 16
65
66/* c_iflag bits */
67#define IGNBRK 0000001
68#define BRKINT 0000002
69#define IGNPAR 0000004
70#define PARMRK 0000010
71#define INPCK 0000020
72#define ISTRIP 0000040
73#define INLCR 0000100
74#define IGNCR 0000200
75#define ICRNL 0000400
76#define IXON 0001000
77#define IXOFF 0002000
78#define IXANY 0004000
79#define IUCLC 0010000
80#define IMAXBEL 0020000
81#define IUTF8 0040000
82
83/* c_oflag bits */
84#define OPOST 0000001
85#define ONLCR 0000002
86#define OLCUC 0000004
87
88#define OCRNL 0000010
89#define ONOCR 0000020
90#define ONLRET 0000040
91
92#define OFILL 00000100
93#define OFDEL 00000200
94#define NLDLY 00001400
95#define NL0 00000000
96#define NL1 00000400
97#define NL2 00001000
98#define NL3 00001400
99#define TABDLY 00006000
100#define TAB0 00000000
101#define TAB1 00002000
102#define TAB2 00004000
103#define TAB3 00006000
104#define XTABS 00006000 /* required by POSIX to == TAB3 */
105#define CRDLY 00030000
106#define CR0 00000000
107#define CR1 00010000
108#define CR2 00020000
109#define CR3 00030000
110#define FFDLY 00040000
111#define FF0 00000000
112#define FF1 00040000
113#define BSDLY 00100000
114#define BS0 00000000
115#define BS1 00100000
116#define VTDLY 00200000
117#define VT0 00000000
118#define VT1 00200000
119
120/* c_cflag bit meaning */
121#define CBAUD 0000377
122#define B0 0000000 /* hang up */
123#define B50 0000001
124#define B75 0000002
125#define B110 0000003
126#define B134 0000004
127#define B150 0000005
128#define B200 0000006
129#define B300 0000007
130#define B600 0000010
131#define B1200 0000011
132#define B1800 0000012
133#define B2400 0000013
134#define B4800 0000014
135#define B9600 0000015
136#define B19200 0000016
137#define B38400 0000017
138#define EXTA B19200
139#define EXTB B38400
140#define CBAUDEX 0000000
141#define B57600 00020
142#define B115200 00021
143#define B230400 00022
144#define B460800 00023
145#define B500000 00024
146#define B576000 00025
147#define B921600 00026
148#define B1000000 00027
149#define B1152000 00030
150#define B1500000 00031
151#define B2000000 00032
152#define B2500000 00033
153#define B3000000 00034
154#define B3500000 00035
155#define B4000000 00036
156#define BOTHER 00037
157
158#define CIBAUD 077600000
159#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
160
161#define CSIZE 00001400
162#define CS5 00000000
163#define CS6 00000400
164#define CS7 00001000
165#define CS8 00001400
166
167#define CSTOPB 00002000
168#define CREAD 00004000
169#define PARENB 00010000
170#define PARODD 00020000
171#define HUPCL 00040000
172
173#define CLOCAL 00100000
174#define CMSPAR 010000000000 /* mark or space (stick) parity */
175#define CRTSCTS 020000000000 /* flow control */
176
177/* c_lflag bits */
178#define ISIG 0x00000080
179#define ICANON 0x00000100
180#define XCASE 0x00004000
181#define ECHO 0x00000008
182#define ECHOE 0x00000002
183#define ECHOK 0x00000004
184#define ECHONL 0x00000010
185#define NOFLSH 0x80000000
186#define TOSTOP 0x00400000
187#define ECHOCTL 0x00000040
188#define ECHOPRT 0x00000020
189#define ECHOKE 0x00000001
190#define FLUSHO 0x00800000
191#define PENDIN 0x20000000
192#define IEXTEN 0x00000400
193#define EXTPROC 0x10000000
194
195/* Values for the ACTION argument to `tcflow'. */
196#define TCOOFF 0
197#define TCOON 1
198#define TCIOFF 2
199#define TCION 3
200
201/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
202#define TCIFLUSH 0
203#define TCOFLUSH 1
204#define TCIOFLUSH 2
205
206/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
207#define TCSANOW 0
208#define TCSADRAIN 1
209#define TCSAFLUSH 2
210
211#endif /* _ASM_POWERPC_TERMBITS_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/termios.h deleted-77
...@@ -1,77 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Liberally adapted from alpha/termios.h. In particular, the c_cc[]
4 * fields have been reordered so that termio & termios share the
5 * common subset in the same order (for brain dead programs that don't
6 * know or care about the differences).
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef _ASM_POWERPC_TERMIOS_H
14#define _ASM_POWERPC_TERMIOS_H
15
16
17#include <asm/ioctls.h>
18#include <asm/termbits.h>
19
20struct sgttyb {
21 char sg_ispeed;
22 char sg_ospeed;
23 char sg_erase;
24 char sg_kill;
25 short sg_flags;
26};
27
28struct tchars {
29 char t_intrc;
30 char t_quitc;
31 char t_startc;
32 char t_stopc;
33 char t_eofc;
34 char t_brkc;
35};
36
37struct ltchars {
38 char t_suspc;
39 char t_dsuspc;
40 char t_rprntc;
41 char t_flushc;
42 char t_werasc;
43 char t_lnextc;
44};
45
46struct winsize {
47 unsigned short ws_row;
48 unsigned short ws_col;
49 unsigned short ws_xpixel;
50 unsigned short ws_ypixel;
51};
52
53#define NCC 10
54struct termio {
55 unsigned short c_iflag; /* input mode flags */
56 unsigned short c_oflag; /* output mode flags */
57 unsigned short c_cflag; /* control mode flags */
58 unsigned short c_lflag; /* local mode flags */
59 unsigned char c_line; /* line discipline */
60 unsigned char c_cc[NCC]; /* control characters */
61};
62
63/* c_cc characters */
64#define _VINTR 0
65#define _VQUIT 1
66#define _VERASE 2
67#define _VKILL 3
68#define _VEOF 4
69#define _VMIN 5
70#define _VEOL 6
71#define _VTIME 7
72#define _VEOL2 8
73#define _VSWTC 9
74
75
76
77#endif /* _ASM_POWERPC_TERMIOS_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/types.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This file is never included by application software unless
4 * explicitly requested (e.g., via linux/types.h) in which case the
5 * application is Linux specific so (user-) name space pollution is
6 * not a major issue. However, for interoperability, libraries still
7 * need to be careful to avoid a name clashes.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14#ifndef _ASM_POWERPC_TYPES_H
15#define _ASM_POWERPC_TYPES_H
16
17/*
18 * This is here because we used to use l64 for 64bit powerpc
19 * and we don't want to impact user mode with our change to ll64
20 * in the kernel.
21 *
22 * However, some user programs are fine with this. They can
23 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
24 */
25#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
26# include <asm-generic/int-l64.h>
27#else
28# include <asm-generic/int-ll64.h>
29#endif
30
31#ifndef __ASSEMBLY__
32
33
34typedef struct {
35 __u32 u[4];
36} __attribute__((aligned(16))) __vector128;
37
38#endif /* __ASSEMBLY__ */
39
40
41#endif /* _ASM_POWERPC_TYPES_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/ucontext.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_UCONTEXT_H
3#define _ASM_POWERPC_UCONTEXT_H
4
5#ifdef __powerpc64__
6#include <asm/sigcontext.h>
7#else
8#include <asm/elf.h>
9#endif
10#include <asm/signal.h>
11
12#ifndef __powerpc64__
13struct mcontext {
14 elf_gregset_t mc_gregs;
15 elf_fpregset_t mc_fregs;
16 unsigned long mc_pad[2];
17 elf_vrregset_t mc_vregs __attribute__((__aligned__(16)));
18};
19#endif
20
21struct ucontext {
22 unsigned long uc_flags;
23 struct ucontext *uc_link;
24 stack_t uc_stack;
25#ifndef __powerpc64__
26 int uc_pad[7];
27 struct mcontext *uc_regs;/* points to uc_mcontext field */
28#endif
29 sigset_t uc_sigmask;
30 /* glibc has 1024-bit signal masks, ours are 64-bit */
31#ifdef __powerpc64__
32 sigset_t __unused[15]; /* Allow for uc_sigmask growth */
33 struct sigcontext uc_mcontext; /* last for extensibility */
34#else
35 int uc_maskext[30];
36 int uc_pad2[3];
37 struct mcontext uc_mcontext;
38#endif
39};
40
41#endif /* _ASM_POWERPC_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-any/asm/unistd.h deleted-404
...@@ -1,404 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This file contains the system call numbers.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#ifndef _ASM_POWERPC_UNISTD_H_
11#define _ASM_POWERPC_UNISTD_H_
12
13
14#define __NR_restart_syscall 0
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_waitpid 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_time 13
28#define __NR_mknod 14
29#define __NR_chmod 15
30#define __NR_lchown 16
31#define __NR_break 17
32#define __NR_oldstat 18
33#define __NR_lseek 19
34#define __NR_getpid 20
35#define __NR_mount 21
36#define __NR_umount 22
37#define __NR_setuid 23
38#define __NR_getuid 24
39#define __NR_stime 25
40#define __NR_ptrace 26
41#define __NR_alarm 27
42#define __NR_oldfstat 28
43#define __NR_pause 29
44#define __NR_utime 30
45#define __NR_stty 31
46#define __NR_gtty 32
47#define __NR_access 33
48#define __NR_nice 34
49#define __NR_ftime 35
50#define __NR_sync 36
51#define __NR_kill 37
52#define __NR_rename 38
53#define __NR_mkdir 39
54#define __NR_rmdir 40
55#define __NR_dup 41
56#define __NR_pipe 42
57#define __NR_times 43
58#define __NR_prof 44
59#define __NR_brk 45
60#define __NR_setgid 46
61#define __NR_getgid 47
62#define __NR_signal 48
63#define __NR_geteuid 49
64#define __NR_getegid 50
65#define __NR_acct 51
66#define __NR_umount2 52
67#define __NR_lock 53
68#define __NR_ioctl 54
69#define __NR_fcntl 55
70#define __NR_mpx 56
71#define __NR_setpgid 57
72#define __NR_ulimit 58
73#define __NR_oldolduname 59
74#define __NR_umask 60
75#define __NR_chroot 61
76#define __NR_ustat 62
77#define __NR_dup2 63
78#define __NR_getppid 64
79#define __NR_getpgrp 65
80#define __NR_setsid 66
81#define __NR_sigaction 67
82#define __NR_sgetmask 68
83#define __NR_ssetmask 69
84#define __NR_setreuid 70
85#define __NR_setregid 71
86#define __NR_sigsuspend 72
87#define __NR_sigpending 73
88#define __NR_sethostname 74
89#define __NR_setrlimit 75
90#define __NR_getrlimit 76
91#define __NR_getrusage 77
92#define __NR_gettimeofday 78
93#define __NR_settimeofday 79
94#define __NR_getgroups 80
95#define __NR_setgroups 81
96#define __NR_select 82
97#define __NR_symlink 83
98#define __NR_oldlstat 84
99#define __NR_readlink 85
100#define __NR_uselib 86
101#define __NR_swapon 87
102#define __NR_reboot 88
103#define __NR_readdir 89
104#define __NR_mmap 90
105#define __NR_munmap 91
106#define __NR_truncate 92
107#define __NR_ftruncate 93
108#define __NR_fchmod 94
109#define __NR_fchown 95
110#define __NR_getpriority 96
111#define __NR_setpriority 97
112#define __NR_profil 98
113#define __NR_statfs 99
114#define __NR_fstatfs 100
115#define __NR_ioperm 101
116#define __NR_socketcall 102
117#define __NR_syslog 103
118#define __NR_setitimer 104
119#define __NR_getitimer 105
120#define __NR_stat 106
121#define __NR_lstat 107
122#define __NR_fstat 108
123#define __NR_olduname 109
124#define __NR_iopl 110
125#define __NR_vhangup 111
126#define __NR_idle 112
127#define __NR_vm86 113
128#define __NR_wait4 114
129#define __NR_swapoff 115
130#define __NR_sysinfo 116
131#define __NR_ipc 117
132#define __NR_fsync 118
133#define __NR_sigreturn 119
134#define __NR_clone 120
135#define __NR_setdomainname 121
136#define __NR_uname 122
137#define __NR_modify_ldt 123
138#define __NR_adjtimex 124
139#define __NR_mprotect 125
140#define __NR_sigprocmask 126
141#define __NR_create_module 127
142#define __NR_init_module 128
143#define __NR_delete_module 129
144#define __NR_get_kernel_syms 130
145#define __NR_quotactl 131
146#define __NR_getpgid 132
147#define __NR_fchdir 133
148#define __NR_bdflush 134
149#define __NR_sysfs 135
150#define __NR_personality 136
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138
153#define __NR_setfsgid 139
154#define __NR__llseek 140
155#define __NR_getdents 141
156#define __NR__newselect 142
157#define __NR_flock 143
158#define __NR_msync 144
159#define __NR_readv 145
160#define __NR_writev 146
161#define __NR_getsid 147
162#define __NR_fdatasync 148
163#define __NR__sysctl 149
164#define __NR_mlock 150
165#define __NR_munlock 151
166#define __NR_mlockall 152
167#define __NR_munlockall 153
168#define __NR_sched_setparam 154
169#define __NR_sched_getparam 155
170#define __NR_sched_setscheduler 156
171#define __NR_sched_getscheduler 157
172#define __NR_sched_yield 158
173#define __NR_sched_get_priority_max 159
174#define __NR_sched_get_priority_min 160
175#define __NR_sched_rr_get_interval 161
176#define __NR_nanosleep 162
177#define __NR_mremap 163
178#define __NR_setresuid 164
179#define __NR_getresuid 165
180#define __NR_query_module 166
181#define __NR_poll 167
182#define __NR_nfsservctl 168
183#define __NR_setresgid 169
184#define __NR_getresgid 170
185#define __NR_prctl 171
186#define __NR_rt_sigreturn 172
187#define __NR_rt_sigaction 173
188#define __NR_rt_sigprocmask 174
189#define __NR_rt_sigpending 175
190#define __NR_rt_sigtimedwait 176
191#define __NR_rt_sigqueueinfo 177
192#define __NR_rt_sigsuspend 178
193#define __NR_pread64 179
194#define __NR_pwrite64 180
195#define __NR_chown 181
196#define __NR_getcwd 182
197#define __NR_capget 183
198#define __NR_capset 184
199#define __NR_sigaltstack 185
200#define __NR_sendfile 186
201#define __NR_getpmsg 187 /* some people actually want streams */
202#define __NR_putpmsg 188 /* some people actually want streams */
203#define __NR_vfork 189
204#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
205#define __NR_readahead 191
206#ifndef __powerpc64__ /* these are 32-bit only */
207#define __NR_mmap2 192
208#define __NR_truncate64 193
209#define __NR_ftruncate64 194
210#define __NR_stat64 195
211#define __NR_lstat64 196
212#define __NR_fstat64 197
213#endif
214#define __NR_pciconfig_read 198
215#define __NR_pciconfig_write 199
216#define __NR_pciconfig_iobase 200
217#define __NR_multiplexer 201
218#define __NR_getdents64 202
219#define __NR_pivot_root 203
220#ifndef __powerpc64__
221#define __NR_fcntl64 204
222#endif
223#define __NR_madvise 205
224#define __NR_mincore 206
225#define __NR_gettid 207
226#define __NR_tkill 208
227#define __NR_setxattr 209
228#define __NR_lsetxattr 210
229#define __NR_fsetxattr 211
230#define __NR_getxattr 212
231#define __NR_lgetxattr 213
232#define __NR_fgetxattr 214
233#define __NR_listxattr 215
234#define __NR_llistxattr 216
235#define __NR_flistxattr 217
236#define __NR_removexattr 218
237#define __NR_lremovexattr 219
238#define __NR_fremovexattr 220
239#define __NR_futex 221
240#define __NR_sched_setaffinity 222
241#define __NR_sched_getaffinity 223
242/* 224 currently unused */
243#define __NR_tuxcall 225
244#ifndef __powerpc64__
245#define __NR_sendfile64 226
246#endif
247#define __NR_io_setup 227
248#define __NR_io_destroy 228
249#define __NR_io_getevents 229
250#define __NR_io_submit 230
251#define __NR_io_cancel 231
252#define __NR_set_tid_address 232
253#define __NR_fadvise64 233
254#define __NR_exit_group 234
255#define __NR_lookup_dcookie 235
256#define __NR_epoll_create 236
257#define __NR_epoll_ctl 237
258#define __NR_epoll_wait 238
259#define __NR_remap_file_pages 239
260#define __NR_timer_create 240
261#define __NR_timer_settime 241
262#define __NR_timer_gettime 242
263#define __NR_timer_getoverrun 243
264#define __NR_timer_delete 244
265#define __NR_clock_settime 245
266#define __NR_clock_gettime 246
267#define __NR_clock_getres 247
268#define __NR_clock_nanosleep 248
269#define __NR_swapcontext 249
270#define __NR_tgkill 250
271#define __NR_utimes 251
272#define __NR_statfs64 252
273#define __NR_fstatfs64 253
274#ifndef __powerpc64__
275#define __NR_fadvise64_64 254
276#endif
277#define __NR_rtas 255
278#define __NR_sys_debug_setcontext 256
279/* Number 257 is reserved for vserver */
280#define __NR_migrate_pages 258
281#define __NR_mbind 259
282#define __NR_get_mempolicy 260
283#define __NR_set_mempolicy 261
284#define __NR_mq_open 262
285#define __NR_mq_unlink 263
286#define __NR_mq_timedsend 264
287#define __NR_mq_timedreceive 265
288#define __NR_mq_notify 266
289#define __NR_mq_getsetattr 267
290#define __NR_kexec_load 268
291#define __NR_add_key 269
292#define __NR_request_key 270
293#define __NR_keyctl 271
294#define __NR_waitid 272
295#define __NR_ioprio_set 273
296#define __NR_ioprio_get 274
297#define __NR_inotify_init 275
298#define __NR_inotify_add_watch 276
299#define __NR_inotify_rm_watch 277
300#define __NR_spu_run 278
301#define __NR_spu_create 279
302#define __NR_pselect6 280
303#define __NR_ppoll 281
304#define __NR_unshare 282
305#define __NR_splice 283
306#define __NR_tee 284
307#define __NR_vmsplice 285
308#define __NR_openat 286
309#define __NR_mkdirat 287
310#define __NR_mknodat 288
311#define __NR_fchownat 289
312#define __NR_futimesat 290
313#ifdef __powerpc64__
314#define __NR_newfstatat 291
315#else
316#define __NR_fstatat64 291
317#endif
318#define __NR_unlinkat 292
319#define __NR_renameat 293
320#define __NR_linkat 294
321#define __NR_symlinkat 295
322#define __NR_readlinkat 296
323#define __NR_fchmodat 297
324#define __NR_faccessat 298
325#define __NR_get_robust_list 299
326#define __NR_set_robust_list 300
327#define __NR_move_pages 301
328#define __NR_getcpu 302
329#define __NR_epoll_pwait 303
330#define __NR_utimensat 304
331#define __NR_signalfd 305
332#define __NR_timerfd_create 306
333#define __NR_eventfd 307
334#define __NR_sync_file_range2 308
335#define __NR_fallocate 309
336#define __NR_subpage_prot 310
337#define __NR_timerfd_settime 311
338#define __NR_timerfd_gettime 312
339#define __NR_signalfd4 313
340#define __NR_eventfd2 314
341#define __NR_epoll_create1 315
342#define __NR_dup3 316
343#define __NR_pipe2 317
344#define __NR_inotify_init1 318
345#define __NR_perf_event_open 319
346#define __NR_preadv 320
347#define __NR_pwritev 321
348#define __NR_rt_tgsigqueueinfo 322
349#define __NR_fanotify_init 323
350#define __NR_fanotify_mark 324
351#define __NR_prlimit64 325
352#define __NR_socket 326
353#define __NR_bind 327
354#define __NR_connect 328
355#define __NR_listen 329
356#define __NR_accept 330
357#define __NR_getsockname 331
358#define __NR_getpeername 332
359#define __NR_socketpair 333
360#define __NR_send 334
361#define __NR_sendto 335
362#define __NR_recv 336
363#define __NR_recvfrom 337
364#define __NR_shutdown 338
365#define __NR_setsockopt 339
366#define __NR_getsockopt 340
367#define __NR_sendmsg 341
368#define __NR_recvmsg 342
369#define __NR_recvmmsg 343
370#define __NR_accept4 344
371#define __NR_name_to_handle_at 345
372#define __NR_open_by_handle_at 346
373#define __NR_clock_adjtime 347
374#define __NR_syncfs 348
375#define __NR_sendmmsg 349
376#define __NR_setns 350
377#define __NR_process_vm_readv 351
378#define __NR_process_vm_writev 352
379#define __NR_finit_module 353
380#define __NR_kcmp 354
381#define __NR_sched_setattr 355
382#define __NR_sched_getattr 356
383#define __NR_renameat2 357
384#define __NR_seccomp 358
385#define __NR_getrandom 359
386#define __NR_memfd_create 360
387#define __NR_bpf 361
388#define __NR_execveat 362
389#define __NR_switch_endian 363
390#define __NR_userfaultfd 364
391#define __NR_membarrier 365
392#define __NR_mlock2 378
393#define __NR_copy_file_range 379
394#define __NR_preadv2 380
395#define __NR_pwritev2 381
396#define __NR_kexec_file_load 382
397#define __NR_statx 383
398#define __NR_pkey_alloc 384
399#define __NR_pkey_free 385
400#define __NR_pkey_mprotect 386
401#define __NR_rseq 387
402#define __NR_io_pgetevents 388
403
404#endif /* _ASM_POWERPC_UNISTD_H_ */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/auxvec.h deleted-53
...@@ -1,53 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_AUXVEC_H
3#define _ASM_POWERPC_AUXVEC_H
4
5/*
6 * We need to put in some extra aux table entries to tell glibc what
7 * the cache block size is, so it can use the dcbz instruction safely.
8 */
9#define AT_DCACHEBSIZE 19
10#define AT_ICACHEBSIZE 20
11#define AT_UCACHEBSIZE 21
12/* A special ignored type value for PPC, for glibc compatibility. */
13#define AT_IGNOREPPC 22
14
15/* The vDSO location. We have to use the same value as x86 for glibc's
16 * sake :-)
17 */
18#define AT_SYSINFO_EHDR 33
19
20/*
21 * AT_*CACHEBSIZE above represent the cache *block* size which is
22 * the size that is affected by the cache management instructions.
23 *
24 * It doesn't nececssarily matches the cache *line* size which is
25 * more of a performance tuning hint. Additionally the latter can
26 * be different for the different cache levels.
27 *
28 * The set of entries below represent more extensive information
29 * about the caches, in the form of two entry per cache type,
30 * one entry containing the cache size in bytes, and the other
31 * containing the cache line size in bytes in the bottom 16 bits
32 * and the cache associativity in the next 16 bits.
33 *
34 * The associativity is such that if N is the 16-bit value, the
35 * cache is N way set associative. A value if 0xffff means fully
36 * associative, a value of 1 means directly mapped.
37 *
38 * For all these fields, a value of 0 means that the information
39 * is not known.
40 */
41
42#define AT_L1I_CACHESIZE 40
43#define AT_L1I_CACHEGEOMETRY 41
44#define AT_L1D_CACHESIZE 42
45#define AT_L1D_CACHEGEOMETRY 43
46#define AT_L2_CACHESIZE 44
47#define AT_L2_CACHEGEOMETRY 45
48#define AT_L3_CACHESIZE 46
49#define AT_L3_CACHEGEOMETRY 47
50
51#define AT_VECTOR_SIZE_ARCH 14 /* entries in ARCH_DLINFO */
52
53#endif
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/bitsperlong.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_POWERPC_BITSPERLONG_H
3#define __ASM_POWERPC_BITSPERLONG_H
4
5#if defined(__powerpc64__)
6# define __BITS_PER_LONG 64
7#else
8# define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_POWERPC_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/byteorder.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_BYTEORDER_H
3#define _ASM_POWERPC_BYTEORDER_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifdef __LITTLE_ENDIAN__
12#include <linux/byteorder/little_endian.h>
13#else
14#include <linux/byteorder/big_endian.h>
15#endif
16
17#endif /* _ASM_POWERPC_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/errno.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_ERRNO_H
3#define _ASM_POWERPC_ERRNO_H
4
5#include <asm-generic/errno.h>
6
7#undef EDEADLOCK
8#define EDEADLOCK 58 /* File locking deadlock error */
9
10#endif /* _ASM_POWERPC_ERRNO_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/fcntl.h deleted-12
...@@ -1,12 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_FCNTL_H
3#define _ASM_FCNTL_H
4
5#define O_DIRECTORY 040000 /* must be a directory */
6#define O_NOFOLLOW 0100000 /* don't follow links */
7#define O_LARGEFILE 0200000
8#define O_DIRECT 0400000 /* direct disk access hint */
9
10#include <asm-generic/fcntl.h>
11
12#endif /* _ASM_FCNTL_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/ioctl.h deleted-14
...@@ -1,14 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IOCTL_H
3#define _ASM_POWERPC_IOCTL_H
4
5#define _IOC_SIZEBITS 13
6#define _IOC_DIRBITS 3
7
8#define _IOC_NONE 1U
9#define _IOC_READ 2U
10#define _IOC_WRITE 4U
11
12#include <asm-generic/ioctl.h>
13
14#endif /* _ASM_POWERPC_IOCTL_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/ioctls.h deleted-121
...@@ -1,121 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IOCTLS_H
3#define _ASM_POWERPC_IOCTLS_H
4
5#include <asm/ioctl.h>
6
7#define FIOCLEX _IO('f', 1)
8#define FIONCLEX _IO('f', 2)
9#define FIOASYNC _IOW('f', 125, int)
10#define FIONBIO _IOW('f', 126, int)
11#define FIONREAD _IOR('f', 127, int)
12#define TIOCINQ FIONREAD
13#define FIOQSIZE _IOR('f', 128, loff_t)
14
15#define TIOCGETP _IOR('t', 8, struct sgttyb)
16#define TIOCSETP _IOW('t', 9, struct sgttyb)
17#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
18
19#define TIOCSETC _IOW('t', 17, struct tchars)
20#define TIOCGETC _IOR('t', 18, struct tchars)
21#define TCGETS _IOR('t', 19, struct termios)
22#define TCSETS _IOW('t', 20, struct termios)
23#define TCSETSW _IOW('t', 21, struct termios)
24#define TCSETSF _IOW('t', 22, struct termios)
25
26#define TCGETA _IOR('t', 23, struct termio)
27#define TCSETA _IOW('t', 24, struct termio)
28#define TCSETAW _IOW('t', 25, struct termio)
29#define TCSETAF _IOW('t', 28, struct termio)
30
31#define TCSBRK _IO('t', 29)
32#define TCXONC _IO('t', 30)
33#define TCFLSH _IO('t', 31)
34
35#define TIOCSWINSZ _IOW('t', 103, struct winsize)
36#define TIOCGWINSZ _IOR('t', 104, struct winsize)
37#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
38#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
39#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
40
41#define TIOCGLTC _IOR('t', 116, struct ltchars)
42#define TIOCSLTC _IOW('t', 117, struct ltchars)
43#define TIOCSPGRP _IOW('t', 118, int)
44#define TIOCGPGRP _IOR('t', 119, int)
45
46#define TIOCEXCL 0x540C
47#define TIOCNXCL 0x540D
48#define TIOCSCTTY 0x540E
49
50#define TIOCSTI 0x5412
51#define TIOCMGET 0x5415
52#define TIOCMBIS 0x5416
53#define TIOCMBIC 0x5417
54#define TIOCMSET 0x5418
55# define TIOCM_LE 0x001
56# define TIOCM_DTR 0x002
57# define TIOCM_RTS 0x004
58# define TIOCM_ST 0x008
59# define TIOCM_SR 0x010
60# define TIOCM_CTS 0x020
61# define TIOCM_CAR 0x040
62# define TIOCM_RNG 0x080
63# define TIOCM_DSR 0x100
64# define TIOCM_CD TIOCM_CAR
65# define TIOCM_RI TIOCM_RNG
66#define TIOCM_OUT1 0x2000
67#define TIOCM_OUT2 0x4000
68#define TIOCM_LOOP 0x8000
69
70#define TIOCGSOFTCAR 0x5419
71#define TIOCSSOFTCAR 0x541A
72#define TIOCLINUX 0x541C
73#define TIOCCONS 0x541D
74#define TIOCGSERIAL 0x541E
75#define TIOCSSERIAL 0x541F
76#define TIOCPKT 0x5420
77# define TIOCPKT_DATA 0
78# define TIOCPKT_FLUSHREAD 1
79# define TIOCPKT_FLUSHWRITE 2
80# define TIOCPKT_STOP 4
81# define TIOCPKT_START 8
82# define TIOCPKT_NOSTOP 16
83# define TIOCPKT_DOSTOP 32
84# define TIOCPKT_IOCTL 64
85
86
87#define TIOCNOTTY 0x5422
88#define TIOCSETD 0x5423
89#define TIOCGETD 0x5424
90#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
91#define TIOCSBRK 0x5427 /* BSD compatibility */
92#define TIOCCBRK 0x5428 /* BSD compatibility */
93#define TIOCGSID 0x5429 /* Return the session ID of FD */
94#define TIOCGRS485 0x542e
95#define TIOCSRS485 0x542f
96#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
97#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
98#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
99#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
100#define TIOCVHANGUP 0x5437
101#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
102#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
103#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
104#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
105
106#define TIOCSERCONFIG 0x5453
107#define TIOCSERGWILD 0x5454
108#define TIOCSERSWILD 0x5455
109#define TIOCGLCKTRMIOS 0x5456
110#define TIOCSLCKTRMIOS 0x5457
111#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
112#define TIOCSERGETLSR 0x5459 /* Get line status register */
113 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
114# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
115#define TIOCSERGETMULTI 0x545A /* Get multiport config */
116#define TIOCSERSETMULTI 0x545B /* Set multiport config */
117
118#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
119#define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */
120
121#endif /* _ASM_POWERPC_IOCTLS_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/ipcbuf.h deleted-35
...@@ -1,35 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_IPCBUF_H
3#define _ASM_POWERPC_IPCBUF_H
4
5/*
6 * The ipc64_perm structure for the powerpc is identical to
7 * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the
8 * kernel. Note extra padding because this structure is passed back
9 * and forth between kernel and user space. Pad space is left for:
10 * - 1 32-bit value to fill up for 8-byte alignment
11 * - 2 miscellaneous 64-bit values
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18
19#include <linux/types.h>
20
21struct ipc64_perm
22{
23 __kernel_key_t key;
24 __kernel_uid_t uid;
25 __kernel_gid_t gid;
26 __kernel_uid_t cuid;
27 __kernel_gid_t cgid;
28 __kernel_mode_t mode;
29 unsigned int seq;
30 unsigned int __pad1;
31 unsigned long long __unused1;
32 unsigned long long __unused2;
33};
34
35#endif /* _ASM_POWERPC_IPCBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/kvm.h deleted-677
...@@ -1,677 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2007
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
20
21#ifndef __LINUX_KVM_POWERPC_H
22#define __LINUX_KVM_POWERPC_H
23
24#include <linux/types.h>
25
26/* Select powerpc specific features in <linux/kvm.h> */
27#define __KVM_HAVE_SPAPR_TCE
28#define __KVM_HAVE_PPC_SMT
29#define __KVM_HAVE_IRQCHIP
30#define __KVM_HAVE_IRQ_LINE
31#define __KVM_HAVE_GUEST_DEBUG
32
33/* Not always available, but if it is, this is the correct offset. */
34#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
35
36struct kvm_regs {
37 __u64 pc;
38 __u64 cr;
39 __u64 ctr;
40 __u64 lr;
41 __u64 xer;
42 __u64 msr;
43 __u64 srr0;
44 __u64 srr1;
45 __u64 pid;
46
47 __u64 sprg0;
48 __u64 sprg1;
49 __u64 sprg2;
50 __u64 sprg3;
51 __u64 sprg4;
52 __u64 sprg5;
53 __u64 sprg6;
54 __u64 sprg7;
55
56 __u64 gpr[32];
57};
58
59#define KVM_SREGS_E_IMPL_NONE 0
60#define KVM_SREGS_E_IMPL_FSL 1
61
62#define KVM_SREGS_E_FSL_PIDn (1 << 0) /* PID1/PID2 */
63
64/* flags for kvm_run.flags */
65#define KVM_RUN_PPC_NMI_DISP_MASK (3 << 0)
66#define KVM_RUN_PPC_NMI_DISP_FULLY_RECOV (1 << 0)
67#define KVM_RUN_PPC_NMI_DISP_LIMITED_RECOV (2 << 0)
68#define KVM_RUN_PPC_NMI_DISP_NOT_RECOV (3 << 0)
69
70/*
71 * Feature bits indicate which sections of the sregs struct are valid,
72 * both in KVM_GET_SREGS and KVM_SET_SREGS. On KVM_SET_SREGS, registers
73 * corresponding to unset feature bits will not be modified. This allows
74 * restoring a checkpoint made without that feature, while keeping the
75 * default values of the new registers.
76 *
77 * KVM_SREGS_E_BASE contains:
78 * CSRR0/1 (refers to SRR2/3 on 40x)
79 * ESR
80 * DEAR
81 * MCSR
82 * TSR
83 * TCR
84 * DEC
85 * TB
86 * VRSAVE (USPRG0)
87 */
88#define KVM_SREGS_E_BASE (1 << 0)
89
90/*
91 * KVM_SREGS_E_ARCH206 contains:
92 *
93 * PIR
94 * MCSRR0/1
95 * DECAR
96 * IVPR
97 */
98#define KVM_SREGS_E_ARCH206 (1 << 1)
99
100/*
101 * Contains EPCR, plus the upper half of 64-bit registers
102 * that are 32-bit on 32-bit implementations.
103 */
104#define KVM_SREGS_E_64 (1 << 2)
105
106#define KVM_SREGS_E_SPRG8 (1 << 3)
107#define KVM_SREGS_E_MCIVPR (1 << 4)
108
109/*
110 * IVORs are used -- contains IVOR0-15, plus additional IVORs
111 * in combination with an appropriate feature bit.
112 */
113#define KVM_SREGS_E_IVOR (1 << 5)
114
115/*
116 * Contains MAS0-4, MAS6-7, TLBnCFG, MMUCFG.
117 * Also TLBnPS if MMUCFG[MAVN] = 1.
118 */
119#define KVM_SREGS_E_ARCH206_MMU (1 << 6)
120
121/* DBSR, DBCR, IAC, DAC, DVC */
122#define KVM_SREGS_E_DEBUG (1 << 7)
123
124/* Enhanced debug -- DSRR0/1, SPRG9 */
125#define KVM_SREGS_E_ED (1 << 8)
126
127/* Embedded Floating Point (SPE) -- IVOR32-34 if KVM_SREGS_E_IVOR */
128#define KVM_SREGS_E_SPE (1 << 9)
129
130/*
131 * DEPRECATED! USE ONE_REG FOR THIS ONE!
132 * External Proxy (EXP) -- EPR
133 */
134#define KVM_SREGS_EXP (1 << 10)
135
136/* External PID (E.PD) -- EPSC/EPLC */
137#define KVM_SREGS_E_PD (1 << 11)
138
139/* Processor Control (E.PC) -- IVOR36-37 if KVM_SREGS_E_IVOR */
140#define KVM_SREGS_E_PC (1 << 12)
141
142/* Page table (E.PT) -- EPTCFG */
143#define KVM_SREGS_E_PT (1 << 13)
144
145/* Embedded Performance Monitor (E.PM) -- IVOR35 if KVM_SREGS_E_IVOR */
146#define KVM_SREGS_E_PM (1 << 14)
147
148/*
149 * Special updates:
150 *
151 * Some registers may change even while a vcpu is not running.
152 * To avoid losing these changes, by default these registers are
153 * not updated by KVM_SET_SREGS. To force an update, set the bit
154 * in u.e.update_special corresponding to the register to be updated.
155 *
156 * The update_special field is zero on return from KVM_GET_SREGS.
157 *
158 * When restoring a checkpoint, the caller can set update_special
159 * to 0xffffffff to ensure that everything is restored, even new features
160 * that the caller doesn't know about.
161 */
162#define KVM_SREGS_E_UPDATE_MCSR (1 << 0)
163#define KVM_SREGS_E_UPDATE_TSR (1 << 1)
164#define KVM_SREGS_E_UPDATE_DEC (1 << 2)
165#define KVM_SREGS_E_UPDATE_DBSR (1 << 3)
166
167/*
168 * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a
169 * previous KVM_GET_REGS.
170 *
171 * Unless otherwise indicated, setting any register with KVM_SET_SREGS
172 * directly sets its value. It does not trigger any special semantics such
173 * as write-one-to-clear. Calling KVM_SET_SREGS on an unmodified struct
174 * just received from KVM_GET_SREGS is always a no-op.
175 */
176struct kvm_sregs {
177 __u32 pvr;
178 union {
179 struct {
180 __u64 sdr1;
181 struct {
182 struct {
183 __u64 slbe;
184 __u64 slbv;
185 } slb[64];
186 } ppc64;
187 struct {
188 __u32 sr[16];
189 __u64 ibat[8];
190 __u64 dbat[8];
191 } ppc32;
192 } s;
193 struct {
194 union {
195 struct { /* KVM_SREGS_E_IMPL_FSL */
196 __u32 features; /* KVM_SREGS_E_FSL_ */
197 __u32 svr;
198 __u64 mcar;
199 __u32 hid0;
200
201 /* KVM_SREGS_E_FSL_PIDn */
202 __u32 pid1, pid2;
203 } fsl;
204 __u8 pad[256];
205 } impl;
206
207 __u32 features; /* KVM_SREGS_E_ */
208 __u32 impl_id; /* KVM_SREGS_E_IMPL_ */
209 __u32 update_special; /* KVM_SREGS_E_UPDATE_ */
210 __u32 pir; /* read-only */
211 __u64 sprg8;
212 __u64 sprg9; /* E.ED */
213 __u64 csrr0;
214 __u64 dsrr0; /* E.ED */
215 __u64 mcsrr0;
216 __u32 csrr1;
217 __u32 dsrr1; /* E.ED */
218 __u32 mcsrr1;
219 __u32 esr;
220 __u64 dear;
221 __u64 ivpr;
222 __u64 mcivpr;
223 __u64 mcsr; /* KVM_SREGS_E_UPDATE_MCSR */
224
225 __u32 tsr; /* KVM_SREGS_E_UPDATE_TSR */
226 __u32 tcr;
227 __u32 decar;
228 __u32 dec; /* KVM_SREGS_E_UPDATE_DEC */
229
230 /*
231 * Userspace can read TB directly, but the
232 * value reported here is consistent with "dec".
233 *
234 * Read-only.
235 */
236 __u64 tb;
237
238 __u32 dbsr; /* KVM_SREGS_E_UPDATE_DBSR */
239 __u32 dbcr[3];
240 /*
241 * iac/dac registers are 64bit wide, while this API
242 * interface provides only lower 32 bits on 64 bit
243 * processors. ONE_REG interface is added for 64bit
244 * iac/dac registers.
245 */
246 __u32 iac[4];
247 __u32 dac[2];
248 __u32 dvc[2];
249 __u8 num_iac; /* read-only */
250 __u8 num_dac; /* read-only */
251 __u8 num_dvc; /* read-only */
252 __u8 pad;
253
254 __u32 epr; /* EXP */
255 __u32 vrsave; /* a.k.a. USPRG0 */
256 __u32 epcr; /* KVM_SREGS_E_64 */
257
258 __u32 mas0;
259 __u32 mas1;
260 __u64 mas2;
261 __u64 mas7_3;
262 __u32 mas4;
263 __u32 mas6;
264
265 __u32 ivor_low[16]; /* IVOR0-15 */
266 __u32 ivor_high[18]; /* IVOR32+, plus room to expand */
267
268 __u32 mmucfg; /* read-only */
269 __u32 eptcfg; /* E.PT, read-only */
270 __u32 tlbcfg[4];/* read-only */
271 __u32 tlbps[4]; /* read-only */
272
273 __u32 eplc, epsc; /* E.PD */
274 } e;
275 __u8 pad[1020];
276 } u;
277};
278
279struct kvm_fpu {
280 __u64 fpr[32];
281};
282
283/*
284 * Defines for h/w breakpoint, watchpoint (read, write or both) and
285 * software breakpoint.
286 * These are used as "type" in KVM_SET_GUEST_DEBUG ioctl and "status"
287 * for KVM_DEBUG_EXIT.
288 */
289#define KVMPPC_DEBUG_NONE 0x0
290#define KVMPPC_DEBUG_BREAKPOINT (1UL << 1)
291#define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2)
292#define KVMPPC_DEBUG_WATCH_READ (1UL << 3)
293struct kvm_debug_exit_arch {
294 __u64 address;
295 /*
296 * exiting to userspace because of h/w breakpoint, watchpoint
297 * (read, write or both) and software breakpoint.
298 */
299 __u32 status;
300 __u32 reserved;
301};
302
303/* for KVM_SET_GUEST_DEBUG */
304struct kvm_guest_debug_arch {
305 struct {
306 /* H/W breakpoint/watchpoint address */
307 __u64 addr;
308 /*
309 * Type denotes h/w breakpoint, read watchpoint, write
310 * watchpoint or watchpoint (both read and write).
311 */
312 __u32 type;
313 __u32 reserved;
314 } bp[16];
315};
316
317/* Debug related defines */
318/*
319 * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic
320 * and upper 16 bits are architecture specific. Architecture specific defines
321 * that ioctl is for setting hardware breakpoint or software breakpoint.
322 */
323#define KVM_GUESTDBG_USE_SW_BP 0x00010000
324#define KVM_GUESTDBG_USE_HW_BP 0x00020000
325
326/* definition of registers in kvm_run */
327struct kvm_sync_regs {
328};
329
330#define KVM_INTERRUPT_SET -1U
331#define KVM_INTERRUPT_UNSET -2U
332#define KVM_INTERRUPT_SET_LEVEL -3U
333
334#define KVM_CPU_440 1
335#define KVM_CPU_E500V2 2
336#define KVM_CPU_3S_32 3
337#define KVM_CPU_3S_64 4
338#define KVM_CPU_E500MC 5
339
340/* for KVM_CAP_SPAPR_TCE */
341struct kvm_create_spapr_tce {
342 __u64 liobn;
343 __u32 window_size;
344};
345
346/* for KVM_CAP_SPAPR_TCE_64 */
347struct kvm_create_spapr_tce_64 {
348 __u64 liobn;
349 __u32 page_shift;
350 __u32 flags;
351 __u64 offset; /* in pages */
352 __u64 size; /* in pages */
353};
354
355/* for KVM_ALLOCATE_RMA */
356struct kvm_allocate_rma {
357 __u64 rma_size;
358};
359
360/* for KVM_CAP_PPC_RTAS */
361struct kvm_rtas_token_args {
362 char name[120];
363 __u64 token; /* Use a token of 0 to undefine a mapping */
364};
365
366struct kvm_book3e_206_tlb_entry {
367 __u32 mas8;
368 __u32 mas1;
369 __u64 mas2;
370 __u64 mas7_3;
371};
372
373struct kvm_book3e_206_tlb_params {
374 /*
375 * For mmu types KVM_MMU_FSL_BOOKE_NOHV and KVM_MMU_FSL_BOOKE_HV:
376 *
377 * - The number of ways of TLB0 must be a power of two between 2 and
378 * 16.
379 * - TLB1 must be fully associative.
380 * - The size of TLB0 must be a multiple of the number of ways, and
381 * the number of sets must be a power of two.
382 * - The size of TLB1 may not exceed 64 entries.
383 * - TLB0 supports 4 KiB pages.
384 * - The page sizes supported by TLB1 are as indicated by
385 * TLB1CFG (if MMUCFG[MAVN] = 0) or TLB1PS (if MMUCFG[MAVN] = 1)
386 * as returned by KVM_GET_SREGS.
387 * - TLB2 and TLB3 are reserved, and their entries in tlb_sizes[]
388 * and tlb_ways[] must be zero.
389 *
390 * tlb_ways[n] = tlb_sizes[n] means the array is fully associative.
391 *
392 * KVM will adjust TLBnCFG based on the sizes configured here,
393 * though arrays greater than 2048 entries will have TLBnCFG[NENTRY]
394 * set to zero.
395 */
396 __u32 tlb_sizes[4];
397 __u32 tlb_ways[4];
398 __u32 reserved[8];
399};
400
401/* For KVM_PPC_GET_HTAB_FD */
402struct kvm_get_htab_fd {
403 __u64 flags;
404 __u64 start_index;
405 __u64 reserved[2];
406};
407
408/* Values for kvm_get_htab_fd.flags */
409#define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)
410#define KVM_GET_HTAB_WRITE ((__u64)0x2)
411
412/*
413 * Data read on the file descriptor is formatted as a series of
414 * records, each consisting of a header followed by a series of
415 * `n_valid' HPTEs (16 bytes each), which are all valid. Following
416 * those valid HPTEs there are `n_invalid' invalid HPTEs, which
417 * are not represented explicitly in the stream. The same format
418 * is used for writing.
419 */
420struct kvm_get_htab_header {
421 __u32 index;
422 __u16 n_valid;
423 __u16 n_invalid;
424};
425
426/* For KVM_PPC_CONFIGURE_V3_MMU */
427struct kvm_ppc_mmuv3_cfg {
428 __u64 flags;
429 __u64 process_table; /* second doubleword of partition table entry */
430};
431
432/* Flag values for KVM_PPC_CONFIGURE_V3_MMU */
433#define KVM_PPC_MMUV3_RADIX 1 /* 1 = radix mode, 0 = HPT */
434#define KVM_PPC_MMUV3_GTSE 2 /* global translation shootdown enb. */
435
436/* For KVM_PPC_GET_RMMU_INFO */
437struct kvm_ppc_rmmu_info {
438 struct kvm_ppc_radix_geom {
439 __u8 page_shift;
440 __u8 level_bits[4];
441 __u8 pad[3];
442 } geometries[8];
443 __u32 ap_encodings[8];
444};
445
446/* For KVM_PPC_GET_CPU_CHAR */
447struct kvm_ppc_cpu_char {
448 __u64 character; /* characteristics of the CPU */
449 __u64 behaviour; /* recommended software behaviour */
450 __u64 character_mask; /* valid bits in character */
451 __u64 behaviour_mask; /* valid bits in behaviour */
452};
453
454/*
455 * Values for character and character_mask.
456 * These are identical to the values used by H_GET_CPU_CHARACTERISTICS.
457 */
458#define KVM_PPC_CPU_CHAR_SPEC_BAR_ORI31 (1ULL << 63)
459#define KVM_PPC_CPU_CHAR_BCCTRL_SERIALISED (1ULL << 62)
460#define KVM_PPC_CPU_CHAR_L1D_FLUSH_ORI30 (1ULL << 61)
461#define KVM_PPC_CPU_CHAR_L1D_FLUSH_TRIG2 (1ULL << 60)
462#define KVM_PPC_CPU_CHAR_L1D_THREAD_PRIV (1ULL << 59)
463#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)
464#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
465#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
466
467#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
468#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
469#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
470
471/* Per-vcpu XICS interrupt controller state */
472#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
473
474#define KVM_REG_PPC_ICP_CPPR_SHIFT 56 /* current proc priority */
475#define KVM_REG_PPC_ICP_CPPR_MASK 0xff
476#define KVM_REG_PPC_ICP_XISR_SHIFT 32 /* interrupt status field */
477#define KVM_REG_PPC_ICP_XISR_MASK 0xffffff
478#define KVM_REG_PPC_ICP_MFRR_SHIFT 24 /* pending IPI priority */
479#define KVM_REG_PPC_ICP_MFRR_MASK 0xff
480#define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */
481#define KVM_REG_PPC_ICP_PPRI_MASK 0xff
482
483/* Device control API: PPC-specific devices */
484#define KVM_DEV_MPIC_GRP_MISC 1
485#define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */
486
487#define KVM_DEV_MPIC_GRP_REGISTER 2 /* 32-bit */
488#define KVM_DEV_MPIC_GRP_IRQ_ACTIVE 3 /* 32-bit */
489
490/* One-Reg API: PPC-specific registers */
491#define KVM_REG_PPC_HIOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
492#define KVM_REG_PPC_IAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2)
493#define KVM_REG_PPC_IAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3)
494#define KVM_REG_PPC_IAC3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x4)
495#define KVM_REG_PPC_IAC4 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x5)
496#define KVM_REG_PPC_DAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x6)
497#define KVM_REG_PPC_DAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x7)
498#define KVM_REG_PPC_DABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8)
499#define KVM_REG_PPC_DSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9)
500#define KVM_REG_PPC_PURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa)
501#define KVM_REG_PPC_SPURR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb)
502#define KVM_REG_PPC_DAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc)
503#define KVM_REG_PPC_DSISR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xd)
504#define KVM_REG_PPC_AMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xe)
505#define KVM_REG_PPC_UAMOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xf)
506
507#define KVM_REG_PPC_MMCR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10)
508#define KVM_REG_PPC_MMCR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11)
509#define KVM_REG_PPC_MMCRA (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12)
510#define KVM_REG_PPC_MMCR2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13)
511#define KVM_REG_PPC_MMCRS (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x14)
512#define KVM_REG_PPC_SIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x15)
513#define KVM_REG_PPC_SDAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x16)
514#define KVM_REG_PPC_SIER (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x17)
515
516#define KVM_REG_PPC_PMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18)
517#define KVM_REG_PPC_PMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19)
518#define KVM_REG_PPC_PMC3 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1a)
519#define KVM_REG_PPC_PMC4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1b)
520#define KVM_REG_PPC_PMC5 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1c)
521#define KVM_REG_PPC_PMC6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1d)
522#define KVM_REG_PPC_PMC7 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1e)
523#define KVM_REG_PPC_PMC8 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1f)
524
525/* 32 floating-point registers */
526#define KVM_REG_PPC_FPR0 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x20)
527#define KVM_REG_PPC_FPR(n) (KVM_REG_PPC_FPR0 + (n))
528#define KVM_REG_PPC_FPR31 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3f)
529
530/* 32 VMX/Altivec vector registers */
531#define KVM_REG_PPC_VR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x40)
532#define KVM_REG_PPC_VR(n) (KVM_REG_PPC_VR0 + (n))
533#define KVM_REG_PPC_VR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x5f)
534
535/* 32 double-width FP registers for VSX */
536/* High-order halves overlap with FP regs */
537#define KVM_REG_PPC_VSR0 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x60)
538#define KVM_REG_PPC_VSR(n) (KVM_REG_PPC_VSR0 + (n))
539#define KVM_REG_PPC_VSR31 (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x7f)
540
541/* FP and vector status/control registers */
542#define KVM_REG_PPC_FPSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x80)
543/*
544 * VSCR register is documented as a 32-bit register in the ISA, but it can
545 * only be accesses via a vector register. Expose VSCR as a 32-bit register
546 * even though the kernel represents it as a 128-bit vector.
547 */
548#define KVM_REG_PPC_VSCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x81)
549
550/* Virtual processor areas */
551/* For SLB & DTL, address in high (first) half, length in low half */
552#define KVM_REG_PPC_VPA_ADDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x82)
553#define KVM_REG_PPC_VPA_SLB (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x83)
554#define KVM_REG_PPC_VPA_DTL (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x84)
555
556#define KVM_REG_PPC_EPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x85)
557#define KVM_REG_PPC_EPR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x86)
558
559/* Timer Status Register OR/CLEAR interface */
560#define KVM_REG_PPC_OR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x87)
561#define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88)
562#define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89)
563#define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a)
564
565/* Debugging: Special instruction for software breakpoint */
566#define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b)
567
568/* MMU registers */
569#define KVM_REG_PPC_MAS0 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8c)
570#define KVM_REG_PPC_MAS1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8d)
571#define KVM_REG_PPC_MAS2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8e)
572#define KVM_REG_PPC_MAS7_3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8f)
573#define KVM_REG_PPC_MAS4 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x90)
574#define KVM_REG_PPC_MAS6 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x91)
575#define KVM_REG_PPC_MMUCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x92)
576/*
577 * TLBnCFG fields TLBnCFG_N_ENTRY and TLBnCFG_ASSOC can be changed only using
578 * KVM_CAP_SW_TLB ioctl
579 */
580#define KVM_REG_PPC_TLB0CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x93)
581#define KVM_REG_PPC_TLB1CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x94)
582#define KVM_REG_PPC_TLB2CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x95)
583#define KVM_REG_PPC_TLB3CFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x96)
584#define KVM_REG_PPC_TLB0PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x97)
585#define KVM_REG_PPC_TLB1PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x98)
586#define KVM_REG_PPC_TLB2PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x99)
587#define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a)
588#define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b)
589
590/* Timebase offset */
591#define KVM_REG_PPC_TB_OFFSET (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9c)
592
593/* POWER8 registers */
594#define KVM_REG_PPC_SPMC1 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9d)
595#define KVM_REG_PPC_SPMC2 (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9e)
596#define KVM_REG_PPC_IAMR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9f)
597#define KVM_REG_PPC_TFHAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa0)
598#define KVM_REG_PPC_TFIAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa1)
599#define KVM_REG_PPC_TEXASR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa2)
600#define KVM_REG_PPC_FSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa3)
601#define KVM_REG_PPC_PSPB (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xa4)
602#define KVM_REG_PPC_EBBHR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa5)
603#define KVM_REG_PPC_EBBRR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa6)
604#define KVM_REG_PPC_BESCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa7)
605#define KVM_REG_PPC_TAR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa8)
606#define KVM_REG_PPC_DPDES (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa9)
607#define KVM_REG_PPC_DAWR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaa)
608#define KVM_REG_PPC_DAWRX (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xab)
609#define KVM_REG_PPC_CIABR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xac)
610#define KVM_REG_PPC_IC (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xad)
611#define KVM_REG_PPC_VTB (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xae)
612#define KVM_REG_PPC_CSIGR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xaf)
613#define KVM_REG_PPC_TACR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb0)
614#define KVM_REG_PPC_TCSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb1)
615#define KVM_REG_PPC_PID (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb2)
616#define KVM_REG_PPC_ACOP (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb3)
617
618#define KVM_REG_PPC_VRSAVE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb4)
619#define KVM_REG_PPC_LPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb5)
620#define KVM_REG_PPC_LPCR_64 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb5)
621#define KVM_REG_PPC_PPR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb6)
622
623/* Architecture compatibility level */
624#define KVM_REG_PPC_ARCH_COMPAT (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb7)
625
626#define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8)
627#define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9)
628#define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
629#define KVM_REG_PPC_DBSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb)
630
631/* POWER9 registers */
632#define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc)
633#define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
634
635#define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
636#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)
637
638/* Transactional Memory checkpointed state:
639 * This is all GPRs, all VSX regs and a subset of SPRs
640 */
641#define KVM_REG_PPC_TM (KVM_REG_PPC | 0x80000000)
642/* TM GPRs */
643#define KVM_REG_PPC_TM_GPR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0)
644#define KVM_REG_PPC_TM_GPR(n) (KVM_REG_PPC_TM_GPR0 + (n))
645#define KVM_REG_PPC_TM_GPR31 (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x1f)
646/* TM VSX */
647#define KVM_REG_PPC_TM_VSR0 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x20)
648#define KVM_REG_PPC_TM_VSR(n) (KVM_REG_PPC_TM_VSR0 + (n))
649#define KVM_REG_PPC_TM_VSR63 (KVM_REG_PPC_TM | KVM_REG_SIZE_U128 | 0x5f)
650/* TM SPRS */
651#define KVM_REG_PPC_TM_CR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x60)
652#define KVM_REG_PPC_TM_LR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x61)
653#define KVM_REG_PPC_TM_CTR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x62)
654#define KVM_REG_PPC_TM_FPSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x63)
655#define KVM_REG_PPC_TM_AMR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x64)
656#define KVM_REG_PPC_TM_PPR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x65)
657#define KVM_REG_PPC_TM_VRSAVE (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x66)
658#define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67)
659#define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68)
660#define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69)
661#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a)
662
663/* PPC64 eXternal Interrupt Controller Specification */
664#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
665
666/* Layout of 64-bit source attribute values */
667#define KVM_XICS_DESTINATION_SHIFT 0
668#define KVM_XICS_DESTINATION_MASK 0xffffffffULL
669#define KVM_XICS_PRIORITY_SHIFT 32
670#define KVM_XICS_PRIORITY_MASK 0xff
671#define KVM_XICS_LEVEL_SENSITIVE (1ULL << 40)
672#define KVM_XICS_MASKED (1ULL << 41)
673#define KVM_XICS_PENDING (1ULL << 42)
674#define KVM_XICS_PRESENTED (1ULL << 43)
675#define KVM_XICS_QUEUED (1ULL << 44)
676
677#endif /* __LINUX_KVM_POWERPC_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/kvm_para.h deleted-98
...@@ -1,98 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright IBM Corp. 2008
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
20
21#ifndef __POWERPC_KVM_PARA_H__
22#define __POWERPC_KVM_PARA_H__
23
24#include <linux/types.h>
25
26/*
27 * Additions to this struct must only occur at the end, and should be
28 * accompanied by a KVM_MAGIC_FEAT flag to advertise that they are present
29 * (albeit not necessarily relevant to the current target hardware platform).
30 *
31 * Struct fields are always 32 or 64 bit aligned, depending on them being 32
32 * or 64 bit wide respectively.
33 *
34 * See Documentation/virtual/kvm/ppc-pv.txt
35 */
36struct kvm_vcpu_arch_shared {
37 __u64 scratch1;
38 __u64 scratch2;
39 __u64 scratch3;
40 __u64 critical; /* Guest may not get interrupts if == r1 */
41 __u64 sprg0;
42 __u64 sprg1;
43 __u64 sprg2;
44 __u64 sprg3;
45 __u64 srr0;
46 __u64 srr1;
47 __u64 dar; /* dear on BookE */
48 __u64 msr;
49 __u32 dsisr;
50 __u32 int_pending; /* Tells the guest if we have an interrupt */
51 __u32 sr[16];
52 __u32 mas0;
53 __u32 mas1;
54 __u64 mas7_3;
55 __u64 mas2;
56 __u32 mas4;
57 __u32 mas6;
58 __u32 esr;
59 __u32 pir;
60
61 /*
62 * SPRG4-7 are user-readable, so we can only keep these consistent
63 * between the shared area and the real registers when there's an
64 * intervening exit to KVM. This also applies to SPRG3 on some
65 * chips.
66 *
67 * This suffices for access by guest userspace, since in PR-mode
68 * KVM, an exit must occur when changing the guest's MSR[PR].
69 * If the guest kernel writes to SPRG3-7 via the shared area, it
70 * must also use the shared area for reading while in kernel space.
71 */
72 __u64 sprg4;
73 __u64 sprg5;
74 __u64 sprg6;
75 __u64 sprg7;
76};
77
78#define KVM_SC_MAGIC_R0 0x4b564d21 /* "KVM!" */
79
80#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)
81
82#include <asm/epapr_hcalls.h>
83
84#define KVM_FEATURE_MAGIC_PAGE 1
85
86/* Magic page flags from host to guest */
87
88#define KVM_MAGIC_FEAT_SR (1 << 0)
89
90/* MASn, ESR, PIR, and high SPRGs */
91#define KVM_MAGIC_FEAT_MAS0_TO_SPRG7 (1 << 1)
92
93/* Magic page flags from guest to host */
94
95#define MAGIC_PAGE_FLAG_NOT_MAPPED_NX (1 << 0)
96
97
98#endif /* __POWERPC_KVM_PARA_H__ */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/mman.h deleted-39
...@@ -1,39 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 */
8#ifndef _ASM_POWERPC_MMAN_H
9#define _ASM_POWERPC_MMAN_H
10
11#include <asm-generic/mman-common.h>
12
13
14#define PROT_SAO 0x10 /* Strong Access Ordering */
15
16#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
17#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
18#define MAP_LOCKED 0x80
19
20#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
21#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
22#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
23
24#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
25#define MCL_FUTURE 0x4000 /* lock all additions to address space */
26#define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */
27
28#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
29#define MAP_NONBLOCK 0x10000 /* do not block on IO */
30#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
31#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
32
33/* Override any generic PKEY permission defines */
34#define PKEY_DISABLE_EXECUTE 0x4
35#undef PKEY_ACCESS_MASK
36#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
37 PKEY_DISABLE_WRITE |\
38 PKEY_DISABLE_EXECUTE)
39#endif /* _ASM_POWERPC_MMAN_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/msgbuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_MSGBUF_H
3#define _ASM_POWERPC_MSGBUF_H
4
5/*
6 * The msqid64_ds structure for the PowerPC architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 */
10
11struct msqid64_ds {
12 struct ipc64_perm msg_perm;
13#ifdef __powerpc64__
14 __kernel_time_t msg_stime; /* last msgsnd time */
15 __kernel_time_t msg_rtime; /* last msgrcv time */
16 __kernel_time_t msg_ctime; /* last change time */
17#else
18 unsigned long msg_stime_high;
19 unsigned long msg_stime; /* last msgsnd time */
20 unsigned long msg_rtime_high;
21 unsigned long msg_rtime; /* last msgrcv time */
22 unsigned long msg_ctime_high;
23 unsigned long msg_ctime; /* last change time */
24#endif
25 unsigned long msg_cbytes; /* current number of bytes on queue */
26 unsigned long msg_qnum; /* number of messages in queue */
27 unsigned long msg_qbytes; /* max number of bytes on queue */
28 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
29 __kernel_pid_t msg_lrpid; /* last receive pid */
30 unsigned long __unused4;
31 unsigned long __unused5;
32};
33
34#endif /* _ASM_POWERPC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/perf_regs.h deleted-51
...@@ -1,51 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_PERF_REGS_H
3#define _ASM_POWERPC_PERF_REGS_H
4
5enum perf_event_powerpc_regs {
6 PERF_REG_POWERPC_R0,
7 PERF_REG_POWERPC_R1,
8 PERF_REG_POWERPC_R2,
9 PERF_REG_POWERPC_R3,
10 PERF_REG_POWERPC_R4,
11 PERF_REG_POWERPC_R5,
12 PERF_REG_POWERPC_R6,
13 PERF_REG_POWERPC_R7,
14 PERF_REG_POWERPC_R8,
15 PERF_REG_POWERPC_R9,
16 PERF_REG_POWERPC_R10,
17 PERF_REG_POWERPC_R11,
18 PERF_REG_POWERPC_R12,
19 PERF_REG_POWERPC_R13,
20 PERF_REG_POWERPC_R14,
21 PERF_REG_POWERPC_R15,
22 PERF_REG_POWERPC_R16,
23 PERF_REG_POWERPC_R17,
24 PERF_REG_POWERPC_R18,
25 PERF_REG_POWERPC_R19,
26 PERF_REG_POWERPC_R20,
27 PERF_REG_POWERPC_R21,
28 PERF_REG_POWERPC_R22,
29 PERF_REG_POWERPC_R23,
30 PERF_REG_POWERPC_R24,
31 PERF_REG_POWERPC_R25,
32 PERF_REG_POWERPC_R26,
33 PERF_REG_POWERPC_R27,
34 PERF_REG_POWERPC_R28,
35 PERF_REG_POWERPC_R29,
36 PERF_REG_POWERPC_R30,
37 PERF_REG_POWERPC_R31,
38 PERF_REG_POWERPC_NIP,
39 PERF_REG_POWERPC_MSR,
40 PERF_REG_POWERPC_ORIG_R3,
41 PERF_REG_POWERPC_CTR,
42 PERF_REG_POWERPC_LINK,
43 PERF_REG_POWERPC_XER,
44 PERF_REG_POWERPC_CCR,
45 PERF_REG_POWERPC_SOFTE,
46 PERF_REG_POWERPC_TRAP,
47 PERF_REG_POWERPC_DAR,
48 PERF_REG_POWERPC_DSISR,
49 PERF_REG_POWERPC_MAX,
50};
51#endif /* _ASM_POWERPC_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/posix_types.h deleted-26
...@@ -1,26 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_POSIX_TYPES_H
3#define _ASM_POWERPC_POSIX_TYPES_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11#ifdef __powerpc64__
12typedef unsigned long __kernel_old_dev_t;
13#define __kernel_old_dev_t __kernel_old_dev_t
14#else
15typedef unsigned int __kernel_size_t;
16typedef int __kernel_ssize_t;
17typedef long __kernel_ptrdiff_t;
18#define __kernel_size_t __kernel_size_t
19
20typedef short __kernel_ipc_pid_t;
21#define __kernel_ipc_pid_t __kernel_ipc_pid_t
22#endif
23
24#include <asm-generic/posix_types.h>
25
26#endif /* _ASM_POWERPC_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/ptrace.h deleted-262
...@@ -1,262 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2001 PPC64 Team, IBM Corp
4 *
5 * This struct defines the way the registers are stored on the
6 * kernel stack during a system call or other kernel entry.
7 *
8 * this should only contain __volatile__ regs
9 * since we can keep non-volatile in the thread_struct
10 * should set this up when only volatiles are saved
11 * by intr code.
12 *
13 * Since this is going on the stack, *CARE MUST BE TAKEN* to insure
14 * that the overall structure is a multiple of 16 bytes in length.
15 *
16 * Note that the offsets of the fields in this struct correspond with
17 * the PT_* values below. This simplifies arch/powerpc/kernel/ptrace.c.
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24#ifndef _ASM_POWERPC_PTRACE_H
25#define _ASM_POWERPC_PTRACE_H
26
27
28#include <linux/types.h>
29
30#ifndef __ASSEMBLY__
31
32struct pt_regs {
33 unsigned long gpr[32];
34 unsigned long nip;
35 unsigned long msr;
36 unsigned long orig_gpr3; /* Used for restarting system calls */
37 unsigned long ctr;
38 unsigned long link;
39 unsigned long xer;
40 unsigned long ccr;
41#ifdef __powerpc64__
42 unsigned long softe; /* Soft enabled/disabled */
43#else
44 unsigned long mq; /* 601 only (not used at present) */
45 /* Used on APUS to hold IPL value. */
46#endif
47 unsigned long trap; /* Reason for being here */
48 /* N.B. for critical exceptions on 4xx, the dar and dsisr
49 fields are overloaded to hold srr0 and srr1. */
50 unsigned long dar; /* Fault registers */
51 unsigned long dsisr; /* on 4xx/Book-E used for ESR */
52 unsigned long result; /* Result of a system call */
53};
54
55#endif /* __ASSEMBLY__ */
56
57
58/*
59 * Offsets used by 'ptrace' system call interface.
60 * These can't be changed without breaking binary compatibility
61 * with MkLinux, etc.
62 */
63#define PT_R0 0
64#define PT_R1 1
65#define PT_R2 2
66#define PT_R3 3
67#define PT_R4 4
68#define PT_R5 5
69#define PT_R6 6
70#define PT_R7 7
71#define PT_R8 8
72#define PT_R9 9
73#define PT_R10 10
74#define PT_R11 11
75#define PT_R12 12
76#define PT_R13 13
77#define PT_R14 14
78#define PT_R15 15
79#define PT_R16 16
80#define PT_R17 17
81#define PT_R18 18
82#define PT_R19 19
83#define PT_R20 20
84#define PT_R21 21
85#define PT_R22 22
86#define PT_R23 23
87#define PT_R24 24
88#define PT_R25 25
89#define PT_R26 26
90#define PT_R27 27
91#define PT_R28 28
92#define PT_R29 29
93#define PT_R30 30
94#define PT_R31 31
95
96#define PT_NIP 32
97#define PT_MSR 33
98#define PT_ORIG_R3 34
99#define PT_CTR 35
100#define PT_LNK 36
101#define PT_XER 37
102#define PT_CCR 38
103#ifndef __powerpc64__
104#define PT_MQ 39
105#else
106#define PT_SOFTE 39
107#endif
108#define PT_TRAP 40
109#define PT_DAR 41
110#define PT_DSISR 42
111#define PT_RESULT 43
112#define PT_DSCR 44
113#define PT_REGS_COUNT 44
114
115#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
116
117#ifndef __powerpc64__
118
119#define PT_FPR31 (PT_FPR0 + 2*31)
120#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
121
122#else /* __powerpc64__ */
123
124#define PT_FPSCR (PT_FPR0 + 32) /* each FP reg occupies 1 slot in 64-bit space */
125
126
127#define PT_VR0 82 /* each Vector reg occupies 2 slots in 64-bit */
128#define PT_VSCR (PT_VR0 + 32*2 + 1)
129#define PT_VRSAVE (PT_VR0 + 33*2)
130
131
132/*
133 * Only store first 32 VSRs here. The second 32 VSRs in VR0-31
134 */
135#define PT_VSR0 150 /* each VSR reg occupies 2 slots in 64-bit */
136#define PT_VSR31 (PT_VSR0 + 2*31)
137#endif /* __powerpc64__ */
138
139/*
140 * Get/set all the altivec registers v0..v31, vscr, vrsave, in one go.
141 * The transfer totals 34 quadword. Quadwords 0-31 contain the
142 * corresponding vector registers. Quadword 32 contains the vscr as the
143 * last word (offset 12) within that quadword. Quadword 33 contains the
144 * vrsave as the first word (offset 0) within the quadword.
145 *
146 * This definition of the VMX state is compatible with the current PPC32
147 * ptrace interface. This allows signal handling and ptrace to use the same
148 * structures. This also simplifies the implementation of a bi-arch
149 * (combined (32- and 64-bit) gdb.
150 */
151#define PTRACE_GETVRREGS 0x12
152#define PTRACE_SETVRREGS 0x13
153
154/* Get/set all the upper 32-bits of the SPE registers, accumulator, and
155 * spefscr, in one go */
156#define PTRACE_GETEVRREGS 0x14
157#define PTRACE_SETEVRREGS 0x15
158
159/* Get the first 32 128bit VSX registers */
160#define PTRACE_GETVSRREGS 0x1b
161#define PTRACE_SETVSRREGS 0x1c
162
163/*
164 * Get or set a debug register. The first 16 are DABR registers and the
165 * second 16 are IABR registers.
166 */
167#define PTRACE_GET_DEBUGREG 0x19
168#define PTRACE_SET_DEBUGREG 0x1a
169
170/* (new) PTRACE requests using the same numbers as x86 and the same
171 * argument ordering. Additionally, they support more registers too
172 */
173#define PTRACE_GETREGS 0xc
174#define PTRACE_SETREGS 0xd
175#define PTRACE_GETFPREGS 0xe
176#define PTRACE_SETFPREGS 0xf
177#define PTRACE_GETREGS64 0x16
178#define PTRACE_SETREGS64 0x17
179
180/* Calls to trace a 64bit program from a 32bit program */
181#define PPC_PTRACE_PEEKTEXT_3264 0x95
182#define PPC_PTRACE_PEEKDATA_3264 0x94
183#define PPC_PTRACE_POKETEXT_3264 0x93
184#define PPC_PTRACE_POKEDATA_3264 0x92
185#define PPC_PTRACE_PEEKUSR_3264 0x91
186#define PPC_PTRACE_POKEUSR_3264 0x90
187
188#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */
189
190#define PPC_PTRACE_GETHWDBGINFO 0x89
191#define PPC_PTRACE_SETHWDEBUG 0x88
192#define PPC_PTRACE_DELHWDEBUG 0x87
193
194#ifndef __ASSEMBLY__
195
196struct ppc_debug_info {
197 __u32 version; /* Only version 1 exists to date */
198 __u32 num_instruction_bps;
199 __u32 num_data_bps;
200 __u32 num_condition_regs;
201 __u32 data_bp_alignment;
202 __u32 sizeof_condition; /* size of the DVC register */
203 __u64 features;
204};
205
206#endif /* __ASSEMBLY__ */
207
208/*
209 * features will have bits indication whether there is support for:
210 */
211#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x0000000000000001
212#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x0000000000000002
213#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004
214#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008
215#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010
216
217#ifndef __ASSEMBLY__
218
219struct ppc_hw_breakpoint {
220 __u32 version; /* currently, version must be 1 */
221 __u32 trigger_type; /* only some combinations allowed */
222 __u32 addr_mode; /* address match mode */
223 __u32 condition_mode; /* break/watchpoint condition flags */
224 __u64 addr; /* break/watchpoint address */
225 __u64 addr2; /* range end or mask */
226 __u64 condition_value; /* contents of the DVC register */
227};
228
229#endif /* __ASSEMBLY__ */
230
231/*
232 * Trigger Type
233 */
234#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x00000001
235#define PPC_BREAKPOINT_TRIGGER_READ 0x00000002
236#define PPC_BREAKPOINT_TRIGGER_WRITE 0x00000004
237#define PPC_BREAKPOINT_TRIGGER_RW \
238 (PPC_BREAKPOINT_TRIGGER_READ | PPC_BREAKPOINT_TRIGGER_WRITE)
239
240/*
241 * Address Mode
242 */
243#define PPC_BREAKPOINT_MODE_EXACT 0x00000000
244#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x00000001
245#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x00000002
246#define PPC_BREAKPOINT_MODE_MASK 0x00000003
247
248/*
249 * Condition Mode
250 */
251#define PPC_BREAKPOINT_CONDITION_MODE 0x00000003
252#define PPC_BREAKPOINT_CONDITION_NONE 0x00000000
253#define PPC_BREAKPOINT_CONDITION_AND 0x00000001
254#define PPC_BREAKPOINT_CONDITION_EXACT PPC_BREAKPOINT_CONDITION_AND
255#define PPC_BREAKPOINT_CONDITION_OR 0x00000002
256#define PPC_BREAKPOINT_CONDITION_AND_OR 0x00000003
257#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000
258#define PPC_BREAKPOINT_CONDITION_BE_SHIFT 16
259#define PPC_BREAKPOINT_CONDITION_BE(n) \
260 (1<<((n)+PPC_BREAKPOINT_CONDITION_BE_SHIFT))
261
262#endif /* _ASM_POWERPC_PTRACE_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/sembuf.h deleted-37
...@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SEMBUF_H
3#define _ASM_POWERPC_SEMBUF_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/*
13 * The semid64_ds structure for PPC architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 2 miscellaneous 32/64-bit values
19 */
20
21struct semid64_ds {
22 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
23#ifndef __powerpc64__
24 unsigned long sem_otime_high;
25 unsigned long sem_otime; /* last semop time */
26 unsigned long sem_ctime_high;
27 unsigned long sem_ctime; /* last change time */
28#else
29 __kernel_time_t sem_otime; /* last semop time */
30 __kernel_time_t sem_ctime; /* last change time */
31#endif
32 unsigned long sem_nsems; /* no. of semaphores in array */
33 unsigned long __unused3;
34 unsigned long __unused4;
35};
36
37#endif /* _ASM_POWERPC_SEMBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/setup.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SETUP_H
3#define _ASM_POWERPC_SETUP_H
4
5#define COMMAND_LINE_SIZE 2048
6
7#endif /* _ASM_POWERPC_SETUP_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/shmbuf.h deleted-57
...@@ -1,57 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SHMBUF_H
3#define _ASM_POWERPC_SHMBUF_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/*
13 * The shmid64_ds structure for PPC architecture.
14 *
15 * Note extra padding because this structure is passed back and forth
16 * between kernel and user space.
17 *
18 * Pad space is left for:
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct shmid64_ds {
23 struct ipc64_perm shm_perm; /* operation perms */
24#ifdef __powerpc64__
25 __kernel_time_t shm_atime; /* last attach time */
26 __kernel_time_t shm_dtime; /* last detach time */
27 __kernel_time_t shm_ctime; /* last change time */
28#else
29 unsigned long shm_atime_high;
30 unsigned long shm_atime; /* last attach time */
31 unsigned long shm_dtime_high;
32 unsigned long shm_dtime; /* last detach time */
33 unsigned long shm_ctime_high;
34 unsigned long shm_ctime; /* last change time */
35 unsigned long __unused4;
36#endif
37 size_t shm_segsz; /* size of segment (bytes) */
38 __kernel_pid_t shm_cpid; /* pid of creator */
39 __kernel_pid_t shm_lpid; /* pid of last operator */
40 unsigned long shm_nattch; /* no. of current attaches */
41 unsigned long __unused5;
42 unsigned long __unused6;
43};
44
45struct shminfo64 {
46 unsigned long shmmax;
47 unsigned long shmmin;
48 unsigned long shmmni;
49 unsigned long shmseg;
50 unsigned long shmall;
51 unsigned long __unused1;
52 unsigned long __unused2;
53 unsigned long __unused3;
54 unsigned long __unused4;
55};
56
57#endif /* _ASM_POWERPC_SHMBUF_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/sigcontext.h deleted-88
...@@ -1,88 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGCONTEXT_H
3#define _ASM_POWERPC_SIGCONTEXT_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <asm/ptrace.h>
13#ifdef __powerpc64__
14#include <asm/elf.h>
15#endif
16
17struct sigcontext {
18 unsigned long _unused[4];
19 int signal;
20#ifdef __powerpc64__
21 int _pad0;
22#endif
23 unsigned long handler;
24 unsigned long oldmask;
25 struct pt_regs *regs;
26#ifdef __powerpc64__
27 elf_gregset_t gp_regs;
28 elf_fpregset_t fp_regs;
29/*
30 * To maintain compatibility with current implementations the sigcontext is
31 * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
32 * followed by an unstructured (vmx_reserve) field of 101 doublewords. This
33 * allows the array of vector registers to be quadword aligned independent of
34 * the alignment of the containing sigcontext or ucontext. It is the
35 * responsibility of the code setting the sigcontext to set this pointer to
36 * either NULL (if this processor does not support the VMX feature) or the
37 * address of the first quadword within the allocated (vmx_reserve) area.
38 *
39 * The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with
40 * an array of 34 quadword entries (elf_vrregset_t). The entries with
41 * indexes 0-31 contain the corresponding vector registers. The entry with
42 * index 32 contains the vscr as the last word (offset 12) within the
43 * quadword. This allows the vscr to be stored as either a quadword (since
44 * it must be copied via a vector register to/from storage) or as a word.
45 * The entry with index 33 contains the vrsave as the first word (offset 0)
46 * within the quadword.
47 *
48 * Part of the VSX data is stored here also by extending vmx_restore
49 * by an additional 32 double words. Architecturally the layout of
50 * the VSR registers and how they overlap on top of the legacy FPR and
51 * VR registers is shown below:
52 *
53 * VSR doubleword 0 VSR doubleword 1
54 * ----------------------------------------------------------------
55 * VSR[0] | FPR[0] | |
56 * ----------------------------------------------------------------
57 * VSR[1] | FPR[1] | |
58 * ----------------------------------------------------------------
59 * | ... | |
60 * | ... | |
61 * ----------------------------------------------------------------
62 * VSR[30] | FPR[30] | |
63 * ----------------------------------------------------------------
64 * VSR[31] | FPR[31] | |
65 * ----------------------------------------------------------------
66 * VSR[32] | VR[0] |
67 * ----------------------------------------------------------------
68 * VSR[33] | VR[1] |
69 * ----------------------------------------------------------------
70 * | ... |
71 * | ... |
72 * ----------------------------------------------------------------
73 * VSR[62] | VR[30] |
74 * ----------------------------------------------------------------
75 * VSR[63] | VR[31] |
76 * ----------------------------------------------------------------
77 *
78 * FPR/VSR 0-31 doubleword 0 is stored in fp_regs, and VMX/VSR 32-63
79 * is stored at the start of vmx_reserve. vmx_reserve is extended for
80 * backwards compatility to store VSR 0-31 doubleword 1 after the VMX
81 * registers and vscr/vrsave.
82 */
83 elf_vrreg_t *v_regs;
84 long vmx_reserve[ELF_NVRREG + ELF_NVRREG + 1 + 32];
85#endif
86};
87
88#endif /* _ASM_POWERPC_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/siginfo.h deleted-18
...@@ -1,18 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGINFO_H
3#define _ASM_POWERPC_SIGINFO_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifdef __powerpc64__
13# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
14#endif
15
16#include <asm-generic/siginfo.h>
17
18#endif /* _ASM_POWERPC_SIGINFO_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/signal.h deleted-136
...@@ -1,136 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SIGNAL_H
3#define _ASM_POWERPC_SIGNAL_H
4
5#include <linux/types.h>
6
7#define _NSIG 64
8#ifdef __powerpc64__
9#define _NSIG_BPW 64
10#else
11#define _NSIG_BPW 32
12#endif
13#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
14
15typedef unsigned long old_sigset_t; /* at least 32 bits */
16
17typedef struct {
18 unsigned long sig[_NSIG_WORDS];
19} sigset_t;
20
21#define SIGHUP 1
22#define SIGINT 2
23#define SIGQUIT 3
24#define SIGILL 4
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28#define SIGBUS 7
29#define SIGFPE 8
30#define SIGKILL 9
31#define SIGUSR1 10
32#define SIGSEGV 11
33#define SIGUSR2 12
34#define SIGPIPE 13
35#define SIGALRM 14
36#define SIGTERM 15
37#define SIGSTKFLT 16
38#define SIGCHLD 17
39#define SIGCONT 18
40#define SIGSTOP 19
41#define SIGTSTP 20
42#define SIGTTIN 21
43#define SIGTTOU 22
44#define SIGURG 23
45#define SIGXCPU 24
46#define SIGXFSZ 25
47#define SIGVTALRM 26
48#define SIGPROF 27
49#define SIGWINCH 28
50#define SIGIO 29
51#define SIGPOLL SIGIO
52/*
53#define SIGLOST 29
54*/
55#define SIGPWR 30
56#define SIGSYS 31
57#define SIGUNUSED 31
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001U
77#define SA_NOCLDWAIT 0x00000002U
78#define SA_SIGINFO 0x00000004U
79#define SA_ONSTACK 0x08000000U
80#define SA_RESTART 0x10000000U
81#define SA_NODEFER 0x40000000U
82#define SA_RESETHAND 0x80000000U
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000U
88
89#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192
91
92#include <asm-generic/signal-defs.h>
93
94struct old_sigaction {
95 __sighandler_t sa_handler;
96 old_sigset_t sa_mask;
97 unsigned long sa_flags;
98 __sigrestore_t sa_restorer;
99};
100
101struct sigaction {
102 __sighandler_t sa_handler;
103 unsigned long sa_flags;
104 __sigrestore_t sa_restorer;
105 sigset_t sa_mask; /* mask last for extensibility */
106};
107
108typedef struct sigaltstack {
109 void *ss_sp;
110 int ss_flags;
111 size_t ss_size;
112} stack_t;
113
114
115#ifndef __powerpc64__
116/*
117 * These are parameters to dbg_sigreturn syscall. They enable or
118 * disable certain debugging things that can be done from signal
119 * handlers. The dbg_sigreturn syscall *must* be called from a
120 * SA_SIGINFO signal so the ucontext can be passed to it. It takes an
121 * array of struct sig_dbg_op, which has the debug operations to
122 * perform before returning from the signal.
123 */
124struct sig_dbg_op {
125 int dbg_type;
126 unsigned long dbg_value;
127};
128
129/* Enable or disable single-stepping. The value sets the state. */
130#define SIG_DBG_SINGLE_STEPPING 1
131
132/* Enable or disable branch tracing. The value sets the state. */
133#define SIG_DBG_BRANCH_TRACING 2
134#endif /* ! __powerpc64__ */
135
136#endif /* _ASM_POWERPC_SIGNAL_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/socket.h deleted-21
...@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_SOCKET_H
3#define _ASM_POWERPC_SOCKET_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#define SO_RCVLOWAT 16
13#define SO_SNDLOWAT 17
14#define SO_RCVTIMEO 18
15#define SO_SNDTIMEO 19
16#define SO_PASSCRED 20
17#define SO_PEERCRED 21
18
19#include <asm-generic/socket.h>
20
21#endif /* _ASM_POWERPC_SOCKET_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/stat.h deleted-82
...@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_STAT_H
3#define _ASM_POWERPC_STAT_H
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#include <linux/types.h>
11
12#define STAT_HAVE_NSEC 1
13
14#ifndef __powerpc64__
15struct __old_kernel_stat {
16 unsigned short st_dev;
17 unsigned short st_ino;
18 unsigned short st_mode;
19 unsigned short st_nlink;
20 unsigned short st_uid;
21 unsigned short st_gid;
22 unsigned short st_rdev;
23 unsigned long st_size;
24 unsigned long st_atime;
25 unsigned long st_mtime;
26 unsigned long st_ctime;
27};
28#endif /* !__powerpc64__ */
29
30struct stat {
31 unsigned long st_dev;
32 ino_t st_ino;
33#ifdef __powerpc64__
34 unsigned long st_nlink;
35 mode_t st_mode;
36#else
37 mode_t st_mode;
38 unsigned short st_nlink;
39#endif
40 uid_t st_uid;
41 gid_t st_gid;
42 unsigned long st_rdev;
43 off_t st_size;
44 unsigned long st_blksize;
45 unsigned long st_blocks;
46 unsigned long st_atime;
47 unsigned long st_atime_nsec;
48 unsigned long st_mtime;
49 unsigned long st_mtime_nsec;
50 unsigned long st_ctime;
51 unsigned long st_ctime_nsec;
52 unsigned long __unused4;
53 unsigned long __unused5;
54#ifdef __powerpc64__
55 unsigned long __unused6;
56#endif
57};
58
59/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
60struct stat64 {
61 unsigned long long st_dev; /* Device. */
62 unsigned long long st_ino; /* File serial number. */
63 unsigned int st_mode; /* File mode. */
64 unsigned int st_nlink; /* Link count. */
65 unsigned int st_uid; /* User ID of the file's owner. */
66 unsigned int st_gid; /* Group ID of the file's group. */
67 unsigned long long st_rdev; /* Device number, if device. */
68 unsigned short __pad2;
69 long long st_size; /* Size of file, in bytes. */
70 int st_blksize; /* Optimal block size for I/O. */
71 long long st_blocks; /* Number 512-byte blocks allocated. */
72 int st_atime; /* Time of last access. */
73 unsigned int st_atime_nsec;
74 int st_mtime; /* Time of last modification. */
75 unsigned int st_mtime_nsec;
76 int st_ctime; /* Time of last status change. */
77 unsigned int st_ctime_nsec;
78 unsigned int __unused4;
79 unsigned int __unused5;
80};
81
82#endif /* _ASM_POWERPC_STAT_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/swab.h deleted-24
...@@ -1,24 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 */
8#ifndef _ASM_POWERPC_SWAB_H
9#define _ASM_POWERPC_SWAB_H
10
11
12#include <linux/types.h>
13
14
15#ifdef __GNUC__
16
17#ifndef __powerpc64__
18#define __SWAB_64_THRU_32__
19#endif /* __powerpc64__ */
20
21
22#endif /* __GNUC__ */
23
24#endif /* _ASM_POWERPC_SWAB_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/termbits.h deleted-211
...@@ -1,211 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_TERMBITS_H
3#define _ASM_POWERPC_TERMBITS_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12typedef unsigned char cc_t;
13typedef unsigned int speed_t;
14typedef unsigned int tcflag_t;
15
16/*
17 * termios type and macro definitions. Be careful about adding stuff
18 * to this file since it's used in GNU libc and there are strict rules
19 * concerning namespace pollution.
20 */
21
22#define NCCS 19
23struct termios {
24 tcflag_t c_iflag; /* input mode flags */
25 tcflag_t c_oflag; /* output mode flags */
26 tcflag_t c_cflag; /* control mode flags */
27 tcflag_t c_lflag; /* local mode flags */
28 cc_t c_cc[NCCS]; /* control characters */
29 cc_t c_line; /* line discipline (== c_cc[19]) */
30 speed_t c_ispeed; /* input speed */
31 speed_t c_ospeed; /* output speed */
32};
33
34/* For PowerPC the termios and ktermios are the same */
35
36struct ktermios {
37 tcflag_t c_iflag; /* input mode flags */
38 tcflag_t c_oflag; /* output mode flags */
39 tcflag_t c_cflag; /* control mode flags */
40 tcflag_t c_lflag; /* local mode flags */
41 cc_t c_cc[NCCS]; /* control characters */
42 cc_t c_line; /* line discipline (== c_cc[19]) */
43 speed_t c_ispeed; /* input speed */
44 speed_t c_ospeed; /* output speed */
45};
46
47/* c_cc characters */
48#define VINTR 0
49#define VQUIT 1
50#define VERASE 2
51#define VKILL 3
52#define VEOF 4
53#define VMIN 5
54#define VEOL 6
55#define VTIME 7
56#define VEOL2 8
57#define VSWTC 9
58#define VWERASE 10
59#define VREPRINT 11
60#define VSUSP 12
61#define VSTART 13
62#define VSTOP 14
63#define VLNEXT 15
64#define VDISCARD 16
65
66/* c_iflag bits */
67#define IGNBRK 0000001
68#define BRKINT 0000002
69#define IGNPAR 0000004
70#define PARMRK 0000010
71#define INPCK 0000020
72#define ISTRIP 0000040
73#define INLCR 0000100
74#define IGNCR 0000200
75#define ICRNL 0000400
76#define IXON 0001000
77#define IXOFF 0002000
78#define IXANY 0004000
79#define IUCLC 0010000
80#define IMAXBEL 0020000
81#define IUTF8 0040000
82
83/* c_oflag bits */
84#define OPOST 0000001
85#define ONLCR 0000002
86#define OLCUC 0000004
87
88#define OCRNL 0000010
89#define ONOCR 0000020
90#define ONLRET 0000040
91
92#define OFILL 00000100
93#define OFDEL 00000200
94#define NLDLY 00001400
95#define NL0 00000000
96#define NL1 00000400
97#define NL2 00001000
98#define NL3 00001400
99#define TABDLY 00006000
100#define TAB0 00000000
101#define TAB1 00002000
102#define TAB2 00004000
103#define TAB3 00006000
104#define XTABS 00006000 /* required by POSIX to == TAB3 */
105#define CRDLY 00030000
106#define CR0 00000000
107#define CR1 00010000
108#define CR2 00020000
109#define CR3 00030000
110#define FFDLY 00040000
111#define FF0 00000000
112#define FF1 00040000
113#define BSDLY 00100000
114#define BS0 00000000
115#define BS1 00100000
116#define VTDLY 00200000
117#define VT0 00000000
118#define VT1 00200000
119
120/* c_cflag bit meaning */
121#define CBAUD 0000377
122#define B0 0000000 /* hang up */
123#define B50 0000001
124#define B75 0000002
125#define B110 0000003
126#define B134 0000004
127#define B150 0000005
128#define B200 0000006
129#define B300 0000007
130#define B600 0000010
131#define B1200 0000011
132#define B1800 0000012
133#define B2400 0000013
134#define B4800 0000014
135#define B9600 0000015
136#define B19200 0000016
137#define B38400 0000017
138#define EXTA B19200
139#define EXTB B38400
140#define CBAUDEX 0000000
141#define B57600 00020
142#define B115200 00021
143#define B230400 00022
144#define B460800 00023
145#define B500000 00024
146#define B576000 00025
147#define B921600 00026
148#define B1000000 00027
149#define B1152000 00030
150#define B1500000 00031
151#define B2000000 00032
152#define B2500000 00033
153#define B3000000 00034
154#define B3500000 00035
155#define B4000000 00036
156#define BOTHER 00037
157
158#define CIBAUD 077600000
159#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
160
161#define CSIZE 00001400
162#define CS5 00000000
163#define CS6 00000400
164#define CS7 00001000
165#define CS8 00001400
166
167#define CSTOPB 00002000
168#define CREAD 00004000
169#define PARENB 00010000
170#define PARODD 00020000
171#define HUPCL 00040000
172
173#define CLOCAL 00100000
174#define CMSPAR 010000000000 /* mark or space (stick) parity */
175#define CRTSCTS 020000000000 /* flow control */
176
177/* c_lflag bits */
178#define ISIG 0x00000080
179#define ICANON 0x00000100
180#define XCASE 0x00004000
181#define ECHO 0x00000008
182#define ECHOE 0x00000002
183#define ECHOK 0x00000004
184#define ECHONL 0x00000010
185#define NOFLSH 0x80000000
186#define TOSTOP 0x00400000
187#define ECHOCTL 0x00000040
188#define ECHOPRT 0x00000020
189#define ECHOKE 0x00000001
190#define FLUSHO 0x00800000
191#define PENDIN 0x20000000
192#define IEXTEN 0x00000400
193#define EXTPROC 0x10000000
194
195/* Values for the ACTION argument to `tcflow'. */
196#define TCOOFF 0
197#define TCOON 1
198#define TCIOFF 2
199#define TCION 3
200
201/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
202#define TCIFLUSH 0
203#define TCOFLUSH 1
204#define TCIOFLUSH 2
205
206/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
207#define TCSANOW 0
208#define TCSADRAIN 1
209#define TCSAFLUSH 2
210
211#endif /* _ASM_POWERPC_TERMBITS_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/termios.h deleted-77
...@@ -1,77 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Liberally adapted from alpha/termios.h. In particular, the c_cc[]
4 * fields have been reordered so that termio & termios share the
5 * common subset in the same order (for brain dead programs that don't
6 * know or care about the differences).
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef _ASM_POWERPC_TERMIOS_H
14#define _ASM_POWERPC_TERMIOS_H
15
16
17#include <asm/ioctls.h>
18#include <asm/termbits.h>
19
20struct sgttyb {
21 char sg_ispeed;
22 char sg_ospeed;
23 char sg_erase;
24 char sg_kill;
25 short sg_flags;
26};
27
28struct tchars {
29 char t_intrc;
30 char t_quitc;
31 char t_startc;
32 char t_stopc;
33 char t_eofc;
34 char t_brkc;
35};
36
37struct ltchars {
38 char t_suspc;
39 char t_dsuspc;
40 char t_rprntc;
41 char t_flushc;
42 char t_werasc;
43 char t_lnextc;
44};
45
46struct winsize {
47 unsigned short ws_row;
48 unsigned short ws_col;
49 unsigned short ws_xpixel;
50 unsigned short ws_ypixel;
51};
52
53#define NCC 10
54struct termio {
55 unsigned short c_iflag; /* input mode flags */
56 unsigned short c_oflag; /* output mode flags */
57 unsigned short c_cflag; /* control mode flags */
58 unsigned short c_lflag; /* local mode flags */
59 unsigned char c_line; /* line discipline */
60 unsigned char c_cc[NCC]; /* control characters */
61};
62
63/* c_cc characters */
64#define _VINTR 0
65#define _VQUIT 1
66#define _VERASE 2
67#define _VKILL 3
68#define _VEOF 4
69#define _VMIN 5
70#define _VEOL 6
71#define _VTIME 7
72#define _VEOL2 8
73#define _VSWTC 9
74
75
76
77#endif /* _ASM_POWERPC_TERMIOS_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/types.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This file is never included by application software unless
4 * explicitly requested (e.g., via linux/types.h) in which case the
5 * application is Linux specific so (user-) name space pollution is
6 * not a major issue. However, for interoperability, libraries still
7 * need to be careful to avoid a name clashes.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14#ifndef _ASM_POWERPC_TYPES_H
15#define _ASM_POWERPC_TYPES_H
16
17/*
18 * This is here because we used to use l64 for 64bit powerpc
19 * and we don't want to impact user mode with our change to ll64
20 * in the kernel.
21 *
22 * However, some user programs are fine with this. They can
23 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
24 */
25#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
26# include <asm-generic/int-l64.h>
27#else
28# include <asm-generic/int-ll64.h>
29#endif
30
31#ifndef __ASSEMBLY__
32
33
34typedef struct {
35 __u32 u[4];
36} __attribute__((aligned(16))) __vector128;
37
38#endif /* __ASSEMBLY__ */
39
40
41#endif /* _ASM_POWERPC_TYPES_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/ucontext.h deleted-41
...@@ -1,41 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_UCONTEXT_H
3#define _ASM_POWERPC_UCONTEXT_H
4
5#ifdef __powerpc64__
6#include <asm/sigcontext.h>
7#else
8#include <asm/elf.h>
9#endif
10#include <asm/signal.h>
11
12#ifndef __powerpc64__
13struct mcontext {
14 elf_gregset_t mc_gregs;
15 elf_fpregset_t mc_fregs;
16 unsigned long mc_pad[2];
17 elf_vrregset_t mc_vregs __attribute__((__aligned__(16)));
18};
19#endif
20
21struct ucontext {
22 unsigned long uc_flags;
23 struct ucontext *uc_link;
24 stack_t uc_stack;
25#ifndef __powerpc64__
26 int uc_pad[7];
27 struct mcontext *uc_regs;/* points to uc_mcontext field */
28#endif
29 sigset_t uc_sigmask;
30 /* glibc has 1024-bit signal masks, ours are 64-bit */
31#ifdef __powerpc64__
32 sigset_t __unused[15]; /* Allow for uc_sigmask growth */
33 struct sigcontext uc_mcontext; /* last for extensibility */
34#else
35 int uc_maskext[30];
36 int uc_pad2[3];
37 struct mcontext uc_mcontext;
38#endif
39};
40
41#endif /* _ASM_POWERPC_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-any/asm/unistd.h deleted-404
...@@ -1,404 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This file contains the system call numbers.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#ifndef _ASM_POWERPC_UNISTD_H_
11#define _ASM_POWERPC_UNISTD_H_
12
13
14#define __NR_restart_syscall 0
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_waitpid 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_time 13
28#define __NR_mknod 14
29#define __NR_chmod 15
30#define __NR_lchown 16
31#define __NR_break 17
32#define __NR_oldstat 18
33#define __NR_lseek 19
34#define __NR_getpid 20
35#define __NR_mount 21
36#define __NR_umount 22
37#define __NR_setuid 23
38#define __NR_getuid 24
39#define __NR_stime 25
40#define __NR_ptrace 26
41#define __NR_alarm 27
42#define __NR_oldfstat 28
43#define __NR_pause 29
44#define __NR_utime 30
45#define __NR_stty 31
46#define __NR_gtty 32
47#define __NR_access 33
48#define __NR_nice 34
49#define __NR_ftime 35
50#define __NR_sync 36
51#define __NR_kill 37
52#define __NR_rename 38
53#define __NR_mkdir 39
54#define __NR_rmdir 40
55#define __NR_dup 41
56#define __NR_pipe 42
57#define __NR_times 43
58#define __NR_prof 44
59#define __NR_brk 45
60#define __NR_setgid 46
61#define __NR_getgid 47
62#define __NR_signal 48
63#define __NR_geteuid 49
64#define __NR_getegid 50
65#define __NR_acct 51
66#define __NR_umount2 52
67#define __NR_lock 53
68#define __NR_ioctl 54
69#define __NR_fcntl 55
70#define __NR_mpx 56
71#define __NR_setpgid 57
72#define __NR_ulimit 58
73#define __NR_oldolduname 59
74#define __NR_umask 60
75#define __NR_chroot 61
76#define __NR_ustat 62
77#define __NR_dup2 63
78#define __NR_getppid 64
79#define __NR_getpgrp 65
80#define __NR_setsid 66
81#define __NR_sigaction 67
82#define __NR_sgetmask 68
83#define __NR_ssetmask 69
84#define __NR_setreuid 70
85#define __NR_setregid 71
86#define __NR_sigsuspend 72
87#define __NR_sigpending 73
88#define __NR_sethostname 74
89#define __NR_setrlimit 75
90#define __NR_getrlimit 76
91#define __NR_getrusage 77
92#define __NR_gettimeofday 78
93#define __NR_settimeofday 79
94#define __NR_getgroups 80
95#define __NR_setgroups 81
96#define __NR_select 82
97#define __NR_symlink 83
98#define __NR_oldlstat 84
99#define __NR_readlink 85
100#define __NR_uselib 86
101#define __NR_swapon 87
102#define __NR_reboot 88
103#define __NR_readdir 89
104#define __NR_mmap 90
105#define __NR_munmap 91
106#define __NR_truncate 92
107#define __NR_ftruncate 93
108#define __NR_fchmod 94
109#define __NR_fchown 95
110#define __NR_getpriority 96
111#define __NR_setpriority 97
112#define __NR_profil 98
113#define __NR_statfs 99
114#define __NR_fstatfs 100
115#define __NR_ioperm 101
116#define __NR_socketcall 102
117#define __NR_syslog 103
118#define __NR_setitimer 104
119#define __NR_getitimer 105
120#define __NR_stat 106
121#define __NR_lstat 107
122#define __NR_fstat 108
123#define __NR_olduname 109
124#define __NR_iopl 110
125#define __NR_vhangup 111
126#define __NR_idle 112
127#define __NR_vm86 113
128#define __NR_wait4 114
129#define __NR_swapoff 115
130#define __NR_sysinfo 116
131#define __NR_ipc 117
132#define __NR_fsync 118
133#define __NR_sigreturn 119
134#define __NR_clone 120
135#define __NR_setdomainname 121
136#define __NR_uname 122
137#define __NR_modify_ldt 123
138#define __NR_adjtimex 124
139#define __NR_mprotect 125
140#define __NR_sigprocmask 126
141#define __NR_create_module 127
142#define __NR_init_module 128
143#define __NR_delete_module 129
144#define __NR_get_kernel_syms 130
145#define __NR_quotactl 131
146#define __NR_getpgid 132
147#define __NR_fchdir 133
148#define __NR_bdflush 134
149#define __NR_sysfs 135
150#define __NR_personality 136
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138
153#define __NR_setfsgid 139
154#define __NR__llseek 140
155#define __NR_getdents 141
156#define __NR__newselect 142
157#define __NR_flock 143
158#define __NR_msync 144
159#define __NR_readv 145
160#define __NR_writev 146
161#define __NR_getsid 147
162#define __NR_fdatasync 148
163#define __NR__sysctl 149
164#define __NR_mlock 150
165#define __NR_munlock 151
166#define __NR_mlockall 152
167#define __NR_munlockall 153
168#define __NR_sched_setparam 154
169#define __NR_sched_getparam 155
170#define __NR_sched_setscheduler 156
171#define __NR_sched_getscheduler 157
172#define __NR_sched_yield 158
173#define __NR_sched_get_priority_max 159
174#define __NR_sched_get_priority_min 160
175#define __NR_sched_rr_get_interval 161
176#define __NR_nanosleep 162
177#define __NR_mremap 163
178#define __NR_setresuid 164
179#define __NR_getresuid 165
180#define __NR_query_module 166
181#define __NR_poll 167
182#define __NR_nfsservctl 168
183#define __NR_setresgid 169
184#define __NR_getresgid 170
185#define __NR_prctl 171
186#define __NR_rt_sigreturn 172
187#define __NR_rt_sigaction 173
188#define __NR_rt_sigprocmask 174
189#define __NR_rt_sigpending 175
190#define __NR_rt_sigtimedwait 176
191#define __NR_rt_sigqueueinfo 177
192#define __NR_rt_sigsuspend 178
193#define __NR_pread64 179
194#define __NR_pwrite64 180
195#define __NR_chown 181
196#define __NR_getcwd 182
197#define __NR_capget 183
198#define __NR_capset 184
199#define __NR_sigaltstack 185
200#define __NR_sendfile 186
201#define __NR_getpmsg 187 /* some people actually want streams */
202#define __NR_putpmsg 188 /* some people actually want streams */
203#define __NR_vfork 189
204#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
205#define __NR_readahead 191
206#ifndef __powerpc64__ /* these are 32-bit only */
207#define __NR_mmap2 192
208#define __NR_truncate64 193
209#define __NR_ftruncate64 194
210#define __NR_stat64 195
211#define __NR_lstat64 196
212#define __NR_fstat64 197
213#endif
214#define __NR_pciconfig_read 198
215#define __NR_pciconfig_write 199
216#define __NR_pciconfig_iobase 200
217#define __NR_multiplexer 201
218#define __NR_getdents64 202
219#define __NR_pivot_root 203
220#ifndef __powerpc64__
221#define __NR_fcntl64 204
222#endif
223#define __NR_madvise 205
224#define __NR_mincore 206
225#define __NR_gettid 207
226#define __NR_tkill 208
227#define __NR_setxattr 209
228#define __NR_lsetxattr 210
229#define __NR_fsetxattr 211
230#define __NR_getxattr 212
231#define __NR_lgetxattr 213
232#define __NR_fgetxattr 214
233#define __NR_listxattr 215
234#define __NR_llistxattr 216
235#define __NR_flistxattr 217
236#define __NR_removexattr 218
237#define __NR_lremovexattr 219
238#define __NR_fremovexattr 220
239#define __NR_futex 221
240#define __NR_sched_setaffinity 222
241#define __NR_sched_getaffinity 223
242/* 224 currently unused */
243#define __NR_tuxcall 225
244#ifndef __powerpc64__
245#define __NR_sendfile64 226
246#endif
247#define __NR_io_setup 227
248#define __NR_io_destroy 228
249#define __NR_io_getevents 229
250#define __NR_io_submit 230
251#define __NR_io_cancel 231
252#define __NR_set_tid_address 232
253#define __NR_fadvise64 233
254#define __NR_exit_group 234
255#define __NR_lookup_dcookie 235
256#define __NR_epoll_create 236
257#define __NR_epoll_ctl 237
258#define __NR_epoll_wait 238
259#define __NR_remap_file_pages 239
260#define __NR_timer_create 240
261#define __NR_timer_settime 241
262#define __NR_timer_gettime 242
263#define __NR_timer_getoverrun 243
264#define __NR_timer_delete 244
265#define __NR_clock_settime 245
266#define __NR_clock_gettime 246
267#define __NR_clock_getres 247
268#define __NR_clock_nanosleep 248
269#define __NR_swapcontext 249
270#define __NR_tgkill 250
271#define __NR_utimes 251
272#define __NR_statfs64 252
273#define __NR_fstatfs64 253
274#ifndef __powerpc64__
275#define __NR_fadvise64_64 254
276#endif
277#define __NR_rtas 255
278#define __NR_sys_debug_setcontext 256
279/* Number 257 is reserved for vserver */
280#define __NR_migrate_pages 258
281#define __NR_mbind 259
282#define __NR_get_mempolicy 260
283#define __NR_set_mempolicy 261
284#define __NR_mq_open 262
285#define __NR_mq_unlink 263
286#define __NR_mq_timedsend 264
287#define __NR_mq_timedreceive 265
288#define __NR_mq_notify 266
289#define __NR_mq_getsetattr 267
290#define __NR_kexec_load 268
291#define __NR_add_key 269
292#define __NR_request_key 270
293#define __NR_keyctl 271
294#define __NR_waitid 272
295#define __NR_ioprio_set 273
296#define __NR_ioprio_get 274
297#define __NR_inotify_init 275
298#define __NR_inotify_add_watch 276
299#define __NR_inotify_rm_watch 277
300#define __NR_spu_run 278
301#define __NR_spu_create 279
302#define __NR_pselect6 280
303#define __NR_ppoll 281
304#define __NR_unshare 282
305#define __NR_splice 283
306#define __NR_tee 284
307#define __NR_vmsplice 285
308#define __NR_openat 286
309#define __NR_mkdirat 287
310#define __NR_mknodat 288
311#define __NR_fchownat 289
312#define __NR_futimesat 290
313#ifdef __powerpc64__
314#define __NR_newfstatat 291
315#else
316#define __NR_fstatat64 291
317#endif
318#define __NR_unlinkat 292
319#define __NR_renameat 293
320#define __NR_linkat 294
321#define __NR_symlinkat 295
322#define __NR_readlinkat 296
323#define __NR_fchmodat 297
324#define __NR_faccessat 298
325#define __NR_get_robust_list 299
326#define __NR_set_robust_list 300
327#define __NR_move_pages 301
328#define __NR_getcpu 302
329#define __NR_epoll_pwait 303
330#define __NR_utimensat 304
331#define __NR_signalfd 305
332#define __NR_timerfd_create 306
333#define __NR_eventfd 307
334#define __NR_sync_file_range2 308
335#define __NR_fallocate 309
336#define __NR_subpage_prot 310
337#define __NR_timerfd_settime 311
338#define __NR_timerfd_gettime 312
339#define __NR_signalfd4 313
340#define __NR_eventfd2 314
341#define __NR_epoll_create1 315
342#define __NR_dup3 316
343#define __NR_pipe2 317
344#define __NR_inotify_init1 318
345#define __NR_perf_event_open 319
346#define __NR_preadv 320
347#define __NR_pwritev 321
348#define __NR_rt_tgsigqueueinfo 322
349#define __NR_fanotify_init 323
350#define __NR_fanotify_mark 324
351#define __NR_prlimit64 325
352#define __NR_socket 326
353#define __NR_bind 327
354#define __NR_connect 328
355#define __NR_listen 329
356#define __NR_accept 330
357#define __NR_getsockname 331
358#define __NR_getpeername 332
359#define __NR_socketpair 333
360#define __NR_send 334
361#define __NR_sendto 335
362#define __NR_recv 336
363#define __NR_recvfrom 337
364#define __NR_shutdown 338
365#define __NR_setsockopt 339
366#define __NR_getsockopt 340
367#define __NR_sendmsg 341
368#define __NR_recvmsg 342
369#define __NR_recvmmsg 343
370#define __NR_accept4 344
371#define __NR_name_to_handle_at 345
372#define __NR_open_by_handle_at 346
373#define __NR_clock_adjtime 347
374#define __NR_syncfs 348
375#define __NR_sendmmsg 349
376#define __NR_setns 350
377#define __NR_process_vm_readv 351
378#define __NR_process_vm_writev 352
379#define __NR_finit_module 353
380#define __NR_kcmp 354
381#define __NR_sched_setattr 355
382#define __NR_sched_getattr 356
383#define __NR_renameat2 357
384#define __NR_seccomp 358
385#define __NR_getrandom 359
386#define __NR_memfd_create 360
387#define __NR_bpf 361
388#define __NR_execveat 362
389#define __NR_switch_endian 363
390#define __NR_userfaultfd 364
391#define __NR_membarrier 365
392#define __NR_mlock2 378
393#define __NR_copy_file_range 379
394#define __NR_preadv2 380
395#define __NR_pwritev2 381
396#define __NR_kexec_file_load 382
397#define __NR_statx 383
398#define __NR_pkey_alloc 384
399#define __NR_pkey_free 385
400#define __NR_pkey_mprotect 386
401#define __NR_rseq 387
402#define __NR_io_pgetevents 388
403
404#endif /* _ASM_POWERPC_UNISTD_H_ */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/auxvec.h created+37
...@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Copyright (C) 2015 Regents of the University of California
5 */
6
7#ifndef _ASM_RISCV_AUXVEC_H
8#define _ASM_RISCV_AUXVEC_H
9
10/* vDSO location */
11#define AT_SYSINFO_EHDR 33
12
13/*
14 * The set of entries below represent more extensive information
15 * about the caches, in the form of two entry per cache type,
16 * one entry containing the cache size in bytes, and the other
17 * containing the cache line size in bytes in the bottom 16 bits
18 * and the cache associativity in the next 16 bits.
19 *
20 * The associativity is such that if N is the 16-bit value, the
21 * cache is N way set associative. A value if 0xffff means fully
22 * associative, a value of 1 means directly mapped.
23 *
24 * For all these fields, a value of 0 means that the information
25 * is not known.
26 */
27#define AT_L1I_CACHESIZE 40
28#define AT_L1I_CACHEGEOMETRY 41
29#define AT_L1D_CACHESIZE 42
30#define AT_L1D_CACHEGEOMETRY 43
31#define AT_L2_CACHESIZE 44
32#define AT_L2_CACHEGEOMETRY 45
33
34/* entries in ARCH_DLINFO */
35#define AT_VECTOR_SIZE_ARCH 7
36
37#endif /* _ASM_RISCV_AUXVEC_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/bitsperlong.h created+14
...@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Copyright (C) 2015 Regents of the University of California
5 */
6
7#ifndef _ASM_RISCV_BITSPERLONG_H
8#define _ASM_RISCV_BITSPERLONG_H
9
10#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
11
12#include <asm-generic/bitsperlong.h>
13
14#endif /* _ASM_RISCV_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/bpf_perf_event.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_regs_struct bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/byteorder.h created+12
...@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Copyright (C) 2015 Regents of the University of California
5 */
6
7#ifndef _ASM_RISCV_BYTEORDER_H
8#define _ASM_RISCV_BYTEORDER_H
9
10#include <linux/byteorder/little_endian.h>
11
12#endif /* _ASM_RISCV_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/elf.h created+98
...@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
3 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
4 * Copyright (C) 2012 Regents of the University of California
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef _ASM_RISCV_ELF_H
13#define _ASM_RISCV_ELF_H
14
15#include <asm/ptrace.h>
16
17/* ELF register definitions */
18typedef unsigned long elf_greg_t;
19typedef struct user_regs_struct elf_gregset_t;
20#define ELF_NGREG (sizeof(elf_gregset_t) / sizeof(elf_greg_t))
21
22/* We don't support f without d, or q. */
23typedef __u64 elf_fpreg_t;
24typedef union __riscv_fp_state elf_fpregset_t;
25#define ELF_NFPREG (sizeof(struct __riscv_d_ext_state) / sizeof(elf_fpreg_t))
26
27#if __riscv_xlen == 64
28#define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info)
29#define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info)
30#else
31#define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info)
32#define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info)
33#endif
34
35/*
36 * RISC-V relocation types
37 */
38
39/* Relocation types used by the dynamic linker */
40#define R_RISCV_NONE 0
41#define R_RISCV_32 1
42#define R_RISCV_64 2
43#define R_RISCV_RELATIVE 3
44#define R_RISCV_COPY 4
45#define R_RISCV_JUMP_SLOT 5
46#define R_RISCV_TLS_DTPMOD32 6
47#define R_RISCV_TLS_DTPMOD64 7
48#define R_RISCV_TLS_DTPREL32 8
49#define R_RISCV_TLS_DTPREL64 9
50#define R_RISCV_TLS_TPREL32 10
51#define R_RISCV_TLS_TPREL64 11
52
53/* Relocation types not used by the dynamic linker */
54#define R_RISCV_BRANCH 16
55#define R_RISCV_JAL 17
56#define R_RISCV_CALL 18
57#define R_RISCV_CALL_PLT 19
58#define R_RISCV_GOT_HI20 20
59#define R_RISCV_TLS_GOT_HI20 21
60#define R_RISCV_TLS_GD_HI20 22
61#define R_RISCV_PCREL_HI20 23
62#define R_RISCV_PCREL_LO12_I 24
63#define R_RISCV_PCREL_LO12_S 25
64#define R_RISCV_HI20 26
65#define R_RISCV_LO12_I 27
66#define R_RISCV_LO12_S 28
67#define R_RISCV_TPREL_HI20 29
68#define R_RISCV_TPREL_LO12_I 30
69#define R_RISCV_TPREL_LO12_S 31
70#define R_RISCV_TPREL_ADD 32
71#define R_RISCV_ADD8 33
72#define R_RISCV_ADD16 34
73#define R_RISCV_ADD32 35
74#define R_RISCV_ADD64 36
75#define R_RISCV_SUB8 37
76#define R_RISCV_SUB16 38
77#define R_RISCV_SUB32 39
78#define R_RISCV_SUB64 40
79#define R_RISCV_GNU_VTINHERIT 41
80#define R_RISCV_GNU_VTENTRY 42
81#define R_RISCV_ALIGN 43
82#define R_RISCV_RVC_BRANCH 44
83#define R_RISCV_RVC_JUMP 45
84#define R_RISCV_LUI 46
85#define R_RISCV_GPREL_I 47
86#define R_RISCV_GPREL_S 48
87#define R_RISCV_TPREL_I 49
88#define R_RISCV_TPREL_S 50
89#define R_RISCV_RELAX 51
90#define R_RISCV_SUB6 52
91#define R_RISCV_SET6 53
92#define R_RISCV_SET8 54
93#define R_RISCV_SET16 55
94#define R_RISCV_SET32 56
95#define R_RISCV_32_PCREL 57
96
97
98#endif /* _ASM_RISCV_ELF_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwcap.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copied from arch/arm64/include/asm/hwcap.h
4 *
5 * Copyright (C) 2012 ARM Ltd.
6 * Copyright (C) 2017 SiFive
7 */
8#ifndef _ASM_RISCV_HWCAP_H
9#define _ASM_RISCV_HWCAP_H
10
11/*
12 * Linux saves the floating-point registers according to the ISA Linux is
13 * executing on, as opposed to the ISA the user program is compiled for. This
14 * is necessary for a handful of esoteric use cases: for example, userspace
15 * threading libraries must be able to examine the actual machine state in
16 * order to fully reconstruct the state of a thread.
17 */
18#define COMPAT_HWCAP_ISA_I (1 << ('I' - 'A'))
19#define COMPAT_HWCAP_ISA_M (1 << ('M' - 'A'))
20#define COMPAT_HWCAP_ISA_A (1 << ('A' - 'A'))
21#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
22#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
23#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
24
25#endif /* _ASM_RISCV_HWCAP_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/kvm.h created+128
...@@ -0,0 +1,128 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2019 Western Digital Corporation or its affiliates.
4 *
5 * Authors:
6 * Anup Patel <anup.patel@wdc.com>
7 */
8
9#ifndef __LINUX_KVM_RISCV_H
10#define __LINUX_KVM_RISCV_H
11
12#ifndef __ASSEMBLY__
13
14#include <linux/types.h>
15#include <asm/ptrace.h>
16
17#define __KVM_HAVE_READONLY_MEM
18
19#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
20
21#define KVM_INTERRUPT_SET -1U
22#define KVM_INTERRUPT_UNSET -2U
23
24/* for KVM_GET_REGS and KVM_SET_REGS */
25struct kvm_regs {
26};
27
28/* for KVM_GET_FPU and KVM_SET_FPU */
29struct kvm_fpu {
30};
31
32/* KVM Debug exit structure */
33struct kvm_debug_exit_arch {
34};
35
36/* for KVM_SET_GUEST_DEBUG */
37struct kvm_guest_debug_arch {
38};
39
40/* definition of registers in kvm_run */
41struct kvm_sync_regs {
42};
43
44/* for KVM_GET_SREGS and KVM_SET_SREGS */
45struct kvm_sregs {
46};
47
48/* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
49struct kvm_riscv_config {
50 unsigned long isa;
51};
52
53/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
54struct kvm_riscv_core {
55 struct user_regs_struct regs;
56 unsigned long mode;
57};
58
59/* Possible privilege modes for kvm_riscv_core */
60#define KVM_RISCV_MODE_S 1
61#define KVM_RISCV_MODE_U 0
62
63/* CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
64struct kvm_riscv_csr {
65 unsigned long sstatus;
66 unsigned long sie;
67 unsigned long stvec;
68 unsigned long sscratch;
69 unsigned long sepc;
70 unsigned long scause;
71 unsigned long stval;
72 unsigned long sip;
73 unsigned long satp;
74 unsigned long scounteren;
75};
76
77/* TIMER registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
78struct kvm_riscv_timer {
79 __u64 frequency;
80 __u64 time;
81 __u64 compare;
82 __u64 state;
83};
84
85/* Possible states for kvm_riscv_timer */
86#define KVM_RISCV_TIMER_STATE_OFF 0
87#define KVM_RISCV_TIMER_STATE_ON 1
88
89#define KVM_REG_SIZE(id) \
90 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
91
92/* If you need to interpret the index values, here is the key: */
93#define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
94#define KVM_REG_RISCV_TYPE_SHIFT 24
95
96/* Config registers are mapped as type 1 */
97#define KVM_REG_RISCV_CONFIG (0x01 << KVM_REG_RISCV_TYPE_SHIFT)
98#define KVM_REG_RISCV_CONFIG_REG(name) \
99 (offsetof(struct kvm_riscv_config, name) / sizeof(unsigned long))
100
101/* Core registers are mapped as type 2 */
102#define KVM_REG_RISCV_CORE (0x02 << KVM_REG_RISCV_TYPE_SHIFT)
103#define KVM_REG_RISCV_CORE_REG(name) \
104 (offsetof(struct kvm_riscv_core, name) / sizeof(unsigned long))
105
106/* Control and status registers are mapped as type 3 */
107#define KVM_REG_RISCV_CSR (0x03 << KVM_REG_RISCV_TYPE_SHIFT)
108#define KVM_REG_RISCV_CSR_REG(name) \
109 (offsetof(struct kvm_riscv_csr, name) / sizeof(unsigned long))
110
111/* Timer registers are mapped as type 4 */
112#define KVM_REG_RISCV_TIMER (0x04 << KVM_REG_RISCV_TYPE_SHIFT)
113#define KVM_REG_RISCV_TIMER_REG(name) \
114 (offsetof(struct kvm_riscv_timer, name) / sizeof(__u64))
115
116/* F extension registers are mapped as type 5 */
117#define KVM_REG_RISCV_FP_F (0x05 << KVM_REG_RISCV_TYPE_SHIFT)
118#define KVM_REG_RISCV_FP_F_REG(name) \
119 (offsetof(struct __riscv_f_ext_state, name) / sizeof(__u32))
120
121/* D extension registers are mapped as type 6 */
122#define KVM_REG_RISCV_FP_D (0x06 << KVM_REG_RISCV_TYPE_SHIFT)
123#define KVM_REG_RISCV_FP_D_REG(name) \
124 (offsetof(struct __riscv_d_ext_state, name) / sizeof(__u64))
125
126#endif
127
128#endif /* __LINUX_KVM_RISCV_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/perf_regs.h created+42
...@@ -0,0 +1,42 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. */
3
4#ifndef _ASM_RISCV_PERF_REGS_H
5#define _ASM_RISCV_PERF_REGS_H
6
7enum perf_event_riscv_regs {
8 PERF_REG_RISCV_PC,
9 PERF_REG_RISCV_RA,
10 PERF_REG_RISCV_SP,
11 PERF_REG_RISCV_GP,
12 PERF_REG_RISCV_TP,
13 PERF_REG_RISCV_T0,
14 PERF_REG_RISCV_T1,
15 PERF_REG_RISCV_T2,
16 PERF_REG_RISCV_S0,
17 PERF_REG_RISCV_S1,
18 PERF_REG_RISCV_A0,
19 PERF_REG_RISCV_A1,
20 PERF_REG_RISCV_A2,
21 PERF_REG_RISCV_A3,
22 PERF_REG_RISCV_A4,
23 PERF_REG_RISCV_A5,
24 PERF_REG_RISCV_A6,
25 PERF_REG_RISCV_A7,
26 PERF_REG_RISCV_S2,
27 PERF_REG_RISCV_S3,
28 PERF_REG_RISCV_S4,
29 PERF_REG_RISCV_S5,
30 PERF_REG_RISCV_S6,
31 PERF_REG_RISCV_S7,
32 PERF_REG_RISCV_S8,
33 PERF_REG_RISCV_S9,
34 PERF_REG_RISCV_S10,
35 PERF_REG_RISCV_S11,
36 PERF_REG_RISCV_T3,
37 PERF_REG_RISCV_T4,
38 PERF_REG_RISCV_T5,
39 PERF_REG_RISCV_T6,
40 PERF_REG_RISCV_MAX,
41};
42#endif /* _ASM_RISCV_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/ptrace.h created+82
...@@ -0,0 +1,82 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 Regents of the University of California
4 */
5
6#ifndef _ASM_RISCV_PTRACE_H
7#define _ASM_RISCV_PTRACE_H
8
9#ifndef __ASSEMBLY__
10
11#include <linux/types.h>
12
13/*
14 * User-mode register state for core dumps, ptrace, sigcontext
15 *
16 * This decouples struct pt_regs from the userspace ABI.
17 * struct user_regs_struct must form a prefix of struct pt_regs.
18 */
19struct user_regs_struct {
20 unsigned long pc;
21 unsigned long ra;
22 unsigned long sp;
23 unsigned long gp;
24 unsigned long tp;
25 unsigned long t0;
26 unsigned long t1;
27 unsigned long t2;
28 unsigned long s0;
29 unsigned long s1;
30 unsigned long a0;
31 unsigned long a1;
32 unsigned long a2;
33 unsigned long a3;
34 unsigned long a4;
35 unsigned long a5;
36 unsigned long a6;
37 unsigned long a7;
38 unsigned long s2;
39 unsigned long s3;
40 unsigned long s4;
41 unsigned long s5;
42 unsigned long s6;
43 unsigned long s7;
44 unsigned long s8;
45 unsigned long s9;
46 unsigned long s10;
47 unsigned long s11;
48 unsigned long t3;
49 unsigned long t4;
50 unsigned long t5;
51 unsigned long t6;
52};
53
54struct __riscv_f_ext_state {
55 __u32 f[32];
56 __u32 fcsr;
57};
58
59struct __riscv_d_ext_state {
60 __u64 f[32];
61 __u32 fcsr;
62};
63
64struct __riscv_q_ext_state {
65 __u64 f[64] __attribute__((aligned(16)));
66 __u32 fcsr;
67 /*
68 * Reserved for expansion of sigcontext structure. Currently zeroed
69 * upon signal, and must be zero upon sigreturn.
70 */
71 __u32 reserved[3];
72};
73
74union __riscv_fp_state {
75 struct __riscv_f_ext_state f;
76 struct __riscv_d_ext_state d;
77 struct __riscv_q_ext_state q;
78};
79
80#endif /* __ASSEMBLY__ */
81
82#endif /* _ASM_RISCV_PTRACE_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/sigcontext.h created+22
...@@ -0,0 +1,22 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 Regents of the University of California
4 */
5
6#ifndef _ASM_RISCV_SIGCONTEXT_H
7#define _ASM_RISCV_SIGCONTEXT_H
8
9#include <asm/ptrace.h>
10
11/*
12 * Signal context structure
13 *
14 * This contains the context saved before a signal handler is invoked;
15 * it is restored by sys_sigreturn / sys_rt_sigreturn.
16 */
17struct sigcontext {
18 struct user_regs_struct sc_regs;
19 union __riscv_fp_state sc_fpregs;
20};
21
22#endif /* _ASM_RISCV_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/ucontext.h created+34
...@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Copyright (C) 2017 SiFive, Inc.
5 *
6 * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
7 */
8#ifndef _ASM_RISCV_UCONTEXT_H
9#define _ASM_RISCV_UCONTEXT_H
10
11#include <linux/types.h>
12
13struct ucontext {
14 unsigned long uc_flags;
15 struct ucontext *uc_link;
16 stack_t uc_stack;
17 sigset_t uc_sigmask;
18 /* There's some padding here to allow sigset_t to be expanded in the
19 * future. Though this is unlikely, other architectures put uc_sigmask
20 * at the end of this structure and explicitly state it can be
21 * expanded, so we didn't want to box ourselves in here. */
22 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
23 /* We can't put uc_sigmask at the end of this structure because we need
24 * to be able to expand sigcontext in the future. For example, the
25 * vector ISA extension will almost certainly add ISA state. We want
26 * to ensure all user-visible ISA state can be saved and restored via a
27 * ucontext, so we're putting this at the end in order to allow for
28 * infinite extensibility. Since we know this will be extended and we
29 * assume sigset_t won't be extended an extreme amount, we're
30 * prioritizing this. */
31 struct sigcontext uc_mcontext;
32};
33
34#endif /* _ASM_RISCV_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd.h created+44
...@@ -0,0 +1,44 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2018 David Abdurachmanov <david.abdurachmanov@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifdef __LP64__
19#define __ARCH_WANT_NEW_STAT
20#define __ARCH_WANT_SET_GET_RLIMIT
21#endif /* __LP64__ */
22
23#define __ARCH_WANT_SYS_CLONE3
24
25#include <asm-generic/unistd.h>
26
27/*
28 * Allows the instruction cache to be flushed from userspace. Despite RISC-V
29 * having a direct 'fence.i' instruction available to userspace (which we
30 * can't trap!), that's not actually viable when running on Linux because the
31 * kernel might schedule a process on another hart. There is no way for
32 * userspace to handle this without invoking the kernel (as it doesn't know the
33 * thread->hart mappings), so we've defined a RISC-V specific system call to
34 * flush the instruction cache.
35 *
36 * __NR_riscv_flush_icache is defined to flush the instruction cache over an
37 * address range, with the flush applying to either all threads or just the
38 * caller. We don't currently do anything with the address range, that's just
39 * in there for forwards compatibility.
40 */
41#ifndef __NR_riscv_flush_icache
42#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
43#endif
44__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/auxvec.h deleted-24
...@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_AUXVEC_H
19#define _ASM_RISCV_AUXVEC_H
20
21/* vDSO location */
22#define AT_SYSINFO_EHDR 33
23
24#endif /* _ASM_RISCV_AUXVEC_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/bitsperlong.h deleted-25
...@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_BITSPERLONG_H
19#define _ASM_RISCV_BITSPERLONG_H
20
21#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
22
23#include <asm-generic/bitsperlong.h>
24
25#endif /* _ASM_RISCV_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/byteorder.h deleted-23
...@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_BYTEORDER_H
19#define _ASM_RISCV_BYTEORDER_H
20
21#include <linux/byteorder/little_endian.h>
22
23#endif /* _ASM_RISCV_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/elf.h deleted-95
...@@ -1,95 +0,0 @@
1/*
2 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
3 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
4 * Copyright (C) 2012 Regents of the University of California
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef _ASM_ELF_H
13#define _ASM_ELF_H
14
15#include <asm/ptrace.h>
16
17/* ELF register definitions */
18typedef unsigned long elf_greg_t;
19typedef struct user_regs_struct elf_gregset_t;
20#define ELF_NGREG (sizeof(elf_gregset_t) / sizeof(elf_greg_t))
21
22typedef union __riscv_fp_state elf_fpregset_t;
23
24#if __riscv_xlen == 64
25#define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info)
26#define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info)
27#else
28#define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info)
29#define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info)
30#endif
31
32/*
33 * RISC-V relocation types
34 */
35
36/* Relocation types used by the dynamic linker */
37#define R_RISCV_NONE 0
38#define R_RISCV_32 1
39#define R_RISCV_64 2
40#define R_RISCV_RELATIVE 3
41#define R_RISCV_COPY 4
42#define R_RISCV_JUMP_SLOT 5
43#define R_RISCV_TLS_DTPMOD32 6
44#define R_RISCV_TLS_DTPMOD64 7
45#define R_RISCV_TLS_DTPREL32 8
46#define R_RISCV_TLS_DTPREL64 9
47#define R_RISCV_TLS_TPREL32 10
48#define R_RISCV_TLS_TPREL64 11
49
50/* Relocation types not used by the dynamic linker */
51#define R_RISCV_BRANCH 16
52#define R_RISCV_JAL 17
53#define R_RISCV_CALL 18
54#define R_RISCV_CALL_PLT 19
55#define R_RISCV_GOT_HI20 20
56#define R_RISCV_TLS_GOT_HI20 21
57#define R_RISCV_TLS_GD_HI20 22
58#define R_RISCV_PCREL_HI20 23
59#define R_RISCV_PCREL_LO12_I 24
60#define R_RISCV_PCREL_LO12_S 25
61#define R_RISCV_HI20 26
62#define R_RISCV_LO12_I 27
63#define R_RISCV_LO12_S 28
64#define R_RISCV_TPREL_HI20 29
65#define R_RISCV_TPREL_LO12_I 30
66#define R_RISCV_TPREL_LO12_S 31
67#define R_RISCV_TPREL_ADD 32
68#define R_RISCV_ADD8 33
69#define R_RISCV_ADD16 34
70#define R_RISCV_ADD32 35
71#define R_RISCV_ADD64 36
72#define R_RISCV_SUB8 37
73#define R_RISCV_SUB16 38
74#define R_RISCV_SUB32 39
75#define R_RISCV_SUB64 40
76#define R_RISCV_GNU_VTINHERIT 41
77#define R_RISCV_GNU_VTENTRY 42
78#define R_RISCV_ALIGN 43
79#define R_RISCV_RVC_BRANCH 44
80#define R_RISCV_RVC_JUMP 45
81#define R_RISCV_LUI 46
82#define R_RISCV_GPREL_I 47
83#define R_RISCV_GPREL_S 48
84#define R_RISCV_TPREL_I 49
85#define R_RISCV_TPREL_S 50
86#define R_RISCV_RELAX 51
87#define R_RISCV_SUB6 52
88#define R_RISCV_SET6 53
89#define R_RISCV_SET8 54
90#define R_RISCV_SET16 55
91#define R_RISCV_SET32 56
92#define R_RISCV_32_PCREL 57
93
94
95#endif /* _ASM_ELF_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/hwcap.h deleted-36
...@@ -1,36 +0,0 @@
1/*
2 * Copied from arch/arm64/include/asm/hwcap.h
3 *
4 * Copyright (C) 2012 ARM Ltd.
5 * Copyright (C) 2017 SiFive
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef __UAPI_ASM_HWCAP_H
20#define __UAPI_ASM_HWCAP_H
21
22/*
23 * Linux saves the floating-point registers according to the ISA Linux is
24 * executing on, as opposed to the ISA the user program is compiled for. This
25 * is necessary for a handful of esoteric use cases: for example, userpsace
26 * threading libraries must be able to examine the actual machine state in
27 * order to fully reconstruct the state of a thread.
28 */
29#define COMPAT_HWCAP_ISA_I (1 << ('I' - 'A'))
30#define COMPAT_HWCAP_ISA_M (1 << ('M' - 'A'))
31#define COMPAT_HWCAP_ISA_A (1 << ('A' - 'A'))
32#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
33#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
34#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
35
36#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/posix_types.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/posix_types.h>
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/ptrace.h deleted-90
...@@ -1,90 +0,0 @@
1/*
2 * Copyright (C) 2012 Regents of the University of California
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _ASM_RISCV_PTRACE_H
15#define _ASM_RISCV_PTRACE_H
16
17#ifndef __ASSEMBLY__
18
19#include <linux/types.h>
20
21/*
22 * User-mode register state for core dumps, ptrace, sigcontext
23 *
24 * This decouples struct pt_regs from the userspace ABI.
25 * struct user_regs_struct must form a prefix of struct pt_regs.
26 */
27struct user_regs_struct {
28 unsigned long pc;
29 unsigned long ra;
30 unsigned long sp;
31 unsigned long gp;
32 unsigned long tp;
33 unsigned long t0;
34 unsigned long t1;
35 unsigned long t2;
36 unsigned long s0;
37 unsigned long s1;
38 unsigned long a0;
39 unsigned long a1;
40 unsigned long a2;
41 unsigned long a3;
42 unsigned long a4;
43 unsigned long a5;
44 unsigned long a6;
45 unsigned long a7;
46 unsigned long s2;
47 unsigned long s3;
48 unsigned long s4;
49 unsigned long s5;
50 unsigned long s6;
51 unsigned long s7;
52 unsigned long s8;
53 unsigned long s9;
54 unsigned long s10;
55 unsigned long s11;
56 unsigned long t3;
57 unsigned long t4;
58 unsigned long t5;
59 unsigned long t6;
60};
61
62struct __riscv_f_ext_state {
63 __u32 f[32];
64 __u32 fcsr;
65};
66
67struct __riscv_d_ext_state {
68 __u64 f[32];
69 __u32 fcsr;
70};
71
72struct __riscv_q_ext_state {
73 __u64 f[64] __attribute__((aligned(16)));
74 __u32 fcsr;
75 /*
76 * Reserved for expansion of sigcontext structure. Currently zeroed
77 * upon signal, and must be zero upon sigreturn.
78 */
79 __u32 reserved[3];
80};
81
82union __riscv_fp_state {
83 struct __riscv_f_ext_state f;
84 struct __riscv_d_ext_state d;
85 struct __riscv_q_ext_state q;
86};
87
88#endif /* __ASSEMBLY__ */
89
90#endif /* _ASM_RISCV_PTRACE_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/setup.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/setup.h>
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/sigcontext.h deleted-30
...@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2012 Regents of the University of California
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _ASM_RISCV_SIGCONTEXT_H
15#define _ASM_RISCV_SIGCONTEXT_H
16
17#include <asm/ptrace.h>
18
19/*
20 * Signal context structure
21 *
22 * This contains the context saved before a signal handler is invoked;
23 * it is restored by sys_sigreturn / sys_rt_sigreturn.
24 */
25struct sigcontext {
26 struct user_regs_struct sc_regs;
27 union __riscv_fp_state sc_fpregs;
28};
29
30#endif /* _ASM_RISCV_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/siginfo.h deleted-24
...@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2016 SiFive, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGINFO_H
18#define __ASM_SIGINFO_H
19
20#define __ARCH_SI_PREAMBLE_SIZE (__SIZEOF_POINTER__ == 4 ? 12 : 16)
21
22#include <asm-generic/siginfo.h>
23
24#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/signal.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/signal.h>
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/stat.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/stat.h>
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/ucontext.h deleted-45
...@@ -1,45 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2017 SiFive, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
18 */
19#ifndef __ASM_UCONTEXT_H
20#define __ASM_UCONTEXT_H
21
22#include <linux/types.h>
23
24struct ucontext {
25 unsigned long uc_flags;
26 struct ucontext *uc_link;
27 stack_t uc_stack;
28 sigset_t uc_sigmask;
29 /* There's some padding here to allow sigset_t to be expanded in the
30 * future. Though this is unlikely, other architectures put uc_sigmask
31 * at the end of this structure and explicitly state it can be
32 * expanded, so we didn't want to box ourselves in here. */
33 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
34 /* We can't put uc_sigmask at the end of this structure because we need
35 * to be able to expand sigcontext in the future. For example, the
36 * vector ISA extension will almost certainly add ISA state. We want
37 * to ensure all user-visible ISA state can be saved and restored via a
38 * ucontext, so we're putting this at the end in order to allow for
39 * infinite extensibility. Since we know this will be extended and we
40 * assume sigset_t won't be extended an extreme amount, we're
41 * prioritizing this. */
42 struct sigcontext uc_mcontext;
43};
44
45#endif /* __ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-any/asm/unistd.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/auxvec.h deleted-24
...@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_AUXVEC_H
19#define _ASM_RISCV_AUXVEC_H
20
21/* vDSO location */
22#define AT_SYSINFO_EHDR 33
23
24#endif /* _ASM_RISCV_AUXVEC_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/bitsperlong.h deleted-25
...@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_BITSPERLONG_H
19#define _ASM_RISCV_BITSPERLONG_H
20
21#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
22
23#include <asm-generic/bitsperlong.h>
24
25#endif /* _ASM_RISCV_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/byteorder.h deleted-23
...@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2015 Regents of the University of California
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_RISCV_BYTEORDER_H
19#define _ASM_RISCV_BYTEORDER_H
20
21#include <linux/byteorder/little_endian.h>
22
23#endif /* _ASM_RISCV_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/elf.h deleted-95
...@@ -1,95 +0,0 @@
1/*
2 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
3 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
4 * Copyright (C) 2012 Regents of the University of California
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef _ASM_ELF_H
13#define _ASM_ELF_H
14
15#include <asm/ptrace.h>
16
17/* ELF register definitions */
18typedef unsigned long elf_greg_t;
19typedef struct user_regs_struct elf_gregset_t;
20#define ELF_NGREG (sizeof(elf_gregset_t) / sizeof(elf_greg_t))
21
22typedef union __riscv_fp_state elf_fpregset_t;
23
24#if __riscv_xlen == 64
25#define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info)
26#define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info)
27#else
28#define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info)
29#define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info)
30#endif
31
32/*
33 * RISC-V relocation types
34 */
35
36/* Relocation types used by the dynamic linker */
37#define R_RISCV_NONE 0
38#define R_RISCV_32 1
39#define R_RISCV_64 2
40#define R_RISCV_RELATIVE 3
41#define R_RISCV_COPY 4
42#define R_RISCV_JUMP_SLOT 5
43#define R_RISCV_TLS_DTPMOD32 6
44#define R_RISCV_TLS_DTPMOD64 7
45#define R_RISCV_TLS_DTPREL32 8
46#define R_RISCV_TLS_DTPREL64 9
47#define R_RISCV_TLS_TPREL32 10
48#define R_RISCV_TLS_TPREL64 11
49
50/* Relocation types not used by the dynamic linker */
51#define R_RISCV_BRANCH 16
52#define R_RISCV_JAL 17
53#define R_RISCV_CALL 18
54#define R_RISCV_CALL_PLT 19
55#define R_RISCV_GOT_HI20 20
56#define R_RISCV_TLS_GOT_HI20 21
57#define R_RISCV_TLS_GD_HI20 22
58#define R_RISCV_PCREL_HI20 23
59#define R_RISCV_PCREL_LO12_I 24
60#define R_RISCV_PCREL_LO12_S 25
61#define R_RISCV_HI20 26
62#define R_RISCV_LO12_I 27
63#define R_RISCV_LO12_S 28
64#define R_RISCV_TPREL_HI20 29
65#define R_RISCV_TPREL_LO12_I 30
66#define R_RISCV_TPREL_LO12_S 31
67#define R_RISCV_TPREL_ADD 32
68#define R_RISCV_ADD8 33
69#define R_RISCV_ADD16 34
70#define R_RISCV_ADD32 35
71#define R_RISCV_ADD64 36
72#define R_RISCV_SUB8 37
73#define R_RISCV_SUB16 38
74#define R_RISCV_SUB32 39
75#define R_RISCV_SUB64 40
76#define R_RISCV_GNU_VTINHERIT 41
77#define R_RISCV_GNU_VTENTRY 42
78#define R_RISCV_ALIGN 43
79#define R_RISCV_RVC_BRANCH 44
80#define R_RISCV_RVC_JUMP 45
81#define R_RISCV_LUI 46
82#define R_RISCV_GPREL_I 47
83#define R_RISCV_GPREL_S 48
84#define R_RISCV_TPREL_I 49
85#define R_RISCV_TPREL_S 50
86#define R_RISCV_RELAX 51
87#define R_RISCV_SUB6 52
88#define R_RISCV_SET6 53
89#define R_RISCV_SET8 54
90#define R_RISCV_SET16 55
91#define R_RISCV_SET32 56
92#define R_RISCV_32_PCREL 57
93
94
95#endif /* _ASM_ELF_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/hwcap.h deleted-36
...@@ -1,36 +0,0 @@
1/*
2 * Copied from arch/arm64/include/asm/hwcap.h
3 *
4 * Copyright (C) 2012 ARM Ltd.
5 * Copyright (C) 2017 SiFive
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef __UAPI_ASM_HWCAP_H
20#define __UAPI_ASM_HWCAP_H
21
22/*
23 * Linux saves the floating-point registers according to the ISA Linux is
24 * executing on, as opposed to the ISA the user program is compiled for. This
25 * is necessary for a handful of esoteric use cases: for example, userpsace
26 * threading libraries must be able to examine the actual machine state in
27 * order to fully reconstruct the state of a thread.
28 */
29#define COMPAT_HWCAP_ISA_I (1 << ('I' - 'A'))
30#define COMPAT_HWCAP_ISA_M (1 << ('M' - 'A'))
31#define COMPAT_HWCAP_ISA_A (1 << ('A' - 'A'))
32#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
33#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
34#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
35
36#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/posix_types.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/posix_types.h>
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/ptrace.h deleted-90
...@@ -1,90 +0,0 @@
1/*
2 * Copyright (C) 2012 Regents of the University of California
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _ASM_RISCV_PTRACE_H
15#define _ASM_RISCV_PTRACE_H
16
17#ifndef __ASSEMBLY__
18
19#include <linux/types.h>
20
21/*
22 * User-mode register state for core dumps, ptrace, sigcontext
23 *
24 * This decouples struct pt_regs from the userspace ABI.
25 * struct user_regs_struct must form a prefix of struct pt_regs.
26 */
27struct user_regs_struct {
28 unsigned long pc;
29 unsigned long ra;
30 unsigned long sp;
31 unsigned long gp;
32 unsigned long tp;
33 unsigned long t0;
34 unsigned long t1;
35 unsigned long t2;
36 unsigned long s0;
37 unsigned long s1;
38 unsigned long a0;
39 unsigned long a1;
40 unsigned long a2;
41 unsigned long a3;
42 unsigned long a4;
43 unsigned long a5;
44 unsigned long a6;
45 unsigned long a7;
46 unsigned long s2;
47 unsigned long s3;
48 unsigned long s4;
49 unsigned long s5;
50 unsigned long s6;
51 unsigned long s7;
52 unsigned long s8;
53 unsigned long s9;
54 unsigned long s10;
55 unsigned long s11;
56 unsigned long t3;
57 unsigned long t4;
58 unsigned long t5;
59 unsigned long t6;
60};
61
62struct __riscv_f_ext_state {
63 __u32 f[32];
64 __u32 fcsr;
65};
66
67struct __riscv_d_ext_state {
68 __u64 f[32];
69 __u32 fcsr;
70};
71
72struct __riscv_q_ext_state {
73 __u64 f[64] __attribute__((aligned(16)));
74 __u32 fcsr;
75 /*
76 * Reserved for expansion of sigcontext structure. Currently zeroed
77 * upon signal, and must be zero upon sigreturn.
78 */
79 __u32 reserved[3];
80};
81
82union __riscv_fp_state {
83 struct __riscv_f_ext_state f;
84 struct __riscv_d_ext_state d;
85 struct __riscv_q_ext_state q;
86};
87
88#endif /* __ASSEMBLY__ */
89
90#endif /* _ASM_RISCV_PTRACE_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/setup.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/setup.h>
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/sigcontext.h deleted-30
...@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2012 Regents of the University of California
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _ASM_RISCV_SIGCONTEXT_H
15#define _ASM_RISCV_SIGCONTEXT_H
16
17#include <asm/ptrace.h>
18
19/*
20 * Signal context structure
21 *
22 * This contains the context saved before a signal handler is invoked;
23 * it is restored by sys_sigreturn / sys_rt_sigreturn.
24 */
25struct sigcontext {
26 struct user_regs_struct sc_regs;
27 union __riscv_fp_state sc_fpregs;
28};
29
30#endif /* _ASM_RISCV_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/siginfo.h deleted-24
...@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2016 SiFive, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __ASM_SIGINFO_H
18#define __ASM_SIGINFO_H
19
20#define __ARCH_SI_PREAMBLE_SIZE (__SIZEOF_POINTER__ == 4 ? 12 : 16)
21
22#include <asm-generic/siginfo.h>
23
24#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/signal.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/signal.h>
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/stat.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/stat.h>
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/ucontext.h deleted-45
...@@ -1,45 +0,0 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Copyright (C) 2017 SiFive, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
18 */
19#ifndef __ASM_UCONTEXT_H
20#define __ASM_UCONTEXT_H
21
22#include <linux/types.h>
23
24struct ucontext {
25 unsigned long uc_flags;
26 struct ucontext *uc_link;
27 stack_t uc_stack;
28 sigset_t uc_sigmask;
29 /* There's some padding here to allow sigset_t to be expanded in the
30 * future. Though this is unlikely, other architectures put uc_sigmask
31 * at the end of this structure and explicitly state it can be
32 * expanded, so we didn't want to box ourselves in here. */
33 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
34 /* We can't put uc_sigmask at the end of this structure because we need
35 * to be able to expand sigcontext in the future. For example, the
36 * vector ISA extension will almost certainly add ISA state. We want
37 * to ensure all user-visible ISA state can be saved and restored via a
38 * ucontext, so we're putting this at the end in order to allow for
39 * infinite extensibility. Since we know this will be extended and we
40 * assume sigset_t won't be extended an extreme amount, we're
41 * prioritizing this. */
42 struct sigcontext uc_mcontext;
43};
44
45#endif /* __ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-any/asm/unistd.h deleted-1
...@@ -1 +0,0 @@
1#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/bpf_perf_event.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__3#define __ASM_BPF_PERF_EVENT_H__
44
lib/libc/include/s390x-linux-any/asm/dasd.h+79-75
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* 2/*
3 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>3 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
4 * Bugreports.to..: <Linux390@de.ibm.com>4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * Copyright IBM Corp. 1999, 20005 * Copyright IBM Corp. 1999, 2000
...@@ -21,40 +21,40 @@...@@ -21,40 +21,40 @@
2121
22#define DASD_API_VERSION 622#define DASD_API_VERSION 6
2323
24/* 24/*
25 * struct dasd_information2_t25 * struct dasd_information2_t
26 * represents any data about the device, which is visible to userspace.26 * represents any data about the device, which is visible to userspace.
27 * including foramt and featueres.27 * including foramt and featueres.
28 */28 */
29typedef struct dasd_information2_t {29typedef struct dasd_information2_t {
30 unsigned int devno; /* S/390 devno */30 unsigned int devno; /* S/390 devno */
31 unsigned int real_devno; /* for aliases */31 unsigned int real_devno; /* for aliases */
32 unsigned int schid; /* S/390 subchannel identifier */32 unsigned int schid; /* S/390 subchannel identifier */
33 unsigned int cu_type : 16; /* from SenseID */33 unsigned int cu_type : 16; /* from SenseID */
34 unsigned int cu_model : 8; /* from SenseID */34 unsigned int cu_model : 8; /* from SenseID */
35 unsigned int dev_type : 16; /* from SenseID */35 unsigned int dev_type : 16; /* from SenseID */
36 unsigned int dev_model : 8; /* from SenseID */36 unsigned int dev_model : 8; /* from SenseID */
37 unsigned int open_count; 37 unsigned int open_count;
38 unsigned int req_queue_len; 38 unsigned int req_queue_len;
39 unsigned int chanq_len; /* length of chanq */39 unsigned int chanq_len; /* length of chanq */
40 char type[4]; /* from discipline.name, 'none' for unknown */40 char type[4]; /* from discipline.name, 'none' for unknown */
41 unsigned int status; /* current device level */41 unsigned int status; /* current device level */
42 unsigned int label_block; /* where to find the VOLSER */42 unsigned int label_block; /* where to find the VOLSER */
43 unsigned int FBA_layout; /* fixed block size (like AIXVOL) */43 unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
44 unsigned int characteristics_size;44 unsigned int characteristics_size;
45 unsigned int confdata_size;45 unsigned int confdata_size;
46 char characteristics[64]; /* from read_device_characteristics */46 char characteristics[64]; /* from read_device_characteristics */
47 char configuration_data[256]; /* from read_configuration_data */47 char configuration_data[256]; /* from read_configuration_data */
48 unsigned int format; /* format info like formatted/cdl/ldl/... */48 unsigned int format; /* format info like formatted/cdl/ldl/... */
49 unsigned int features; /* dasd features like 'ro',... */49 unsigned int features; /* dasd features like 'ro',... */
50 unsigned int reserved0; /* reserved for further use ,... */50 unsigned int reserved0; /* reserved for further use ,... */
51 unsigned int reserved1; /* reserved for further use ,... */51 unsigned int reserved1; /* reserved for further use ,... */
52 unsigned int reserved2; /* reserved for further use ,... */52 unsigned int reserved2; /* reserved for further use ,... */
53 unsigned int reserved3; /* reserved for further use ,... */53 unsigned int reserved3; /* reserved for further use ,... */
54 unsigned int reserved4; /* reserved for further use ,... */54 unsigned int reserved4; /* reserved for further use ,... */
55 unsigned int reserved5; /* reserved for further use ,... */55 unsigned int reserved5; /* reserved for further use ,... */
56 unsigned int reserved6; /* reserved for further use ,... */56 unsigned int reserved6; /* reserved for further use ,... */
57 unsigned int reserved7; /* reserved for further use ,... */57 unsigned int reserved7; /* reserved for further use ,... */
58} dasd_information2_t;58} dasd_information2_t;
5959
60/*60/*
...@@ -92,34 +92,34 @@ typedef struct dasd_information2_t {...@@ -92,34 +92,34 @@ typedef struct dasd_information2_t {
9292
93#define DASD_PARTN_BITS 293#define DASD_PARTN_BITS 2
9494
95/* 95/*
96 * struct dasd_information_t96 * struct dasd_information_t
97 * represents any data about the data, which is visible to userspace97 * represents any data about the data, which is visible to userspace
98 */98 */
99typedef struct dasd_information_t {99typedef struct dasd_information_t {
100 unsigned int devno; /* S/390 devno */100 unsigned int devno; /* S/390 devno */
101 unsigned int real_devno; /* for aliases */101 unsigned int real_devno; /* for aliases */
102 unsigned int schid; /* S/390 subchannel identifier */102 unsigned int schid; /* S/390 subchannel identifier */
103 unsigned int cu_type : 16; /* from SenseID */103 unsigned int cu_type : 16; /* from SenseID */
104 unsigned int cu_model : 8; /* from SenseID */104 unsigned int cu_model : 8; /* from SenseID */
105 unsigned int dev_type : 16; /* from SenseID */105 unsigned int dev_type : 16; /* from SenseID */
106 unsigned int dev_model : 8; /* from SenseID */106 unsigned int dev_model : 8; /* from SenseID */
107 unsigned int open_count; 107 unsigned int open_count;
108 unsigned int req_queue_len; 108 unsigned int req_queue_len;
109 unsigned int chanq_len; /* length of chanq */109 unsigned int chanq_len; /* length of chanq */
110 char type[4]; /* from discipline.name, 'none' for unknown */110 char type[4]; /* from discipline.name, 'none' for unknown */
111 unsigned int status; /* current device level */111 unsigned int status; /* current device level */
112 unsigned int label_block; /* where to find the VOLSER */112 unsigned int label_block; /* where to find the VOLSER */
113 unsigned int FBA_layout; /* fixed block size (like AIXVOL) */113 unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
114 unsigned int characteristics_size;114 unsigned int characteristics_size;
115 unsigned int confdata_size;115 unsigned int confdata_size;
116 char characteristics[64]; /* from read_device_characteristics */116 char characteristics[64]; /* from read_device_characteristics */
117 char configuration_data[256]; /* from read_configuration_data */117 char configuration_data[256]; /* from read_configuration_data */
118} dasd_information_t;118} dasd_information_t;
119119
120/*120/*
121 * Read Subsystem Data - Performance Statistics121 * Read Subsystem Data - Performance Statistics
122 */ 122 */
123typedef struct dasd_rssd_perf_stats_t {123typedef struct dasd_rssd_perf_stats_t {
124 unsigned char invalid:1;124 unsigned char invalid:1;
125 unsigned char format:3;125 unsigned char format:3;
...@@ -154,21 +154,21 @@ typedef struct dasd_rssd_perf_stats_t {...@@ -154,21 +154,21 @@ typedef struct dasd_rssd_perf_stats_t {
154 unsigned char reseved2[96];154 unsigned char reseved2[96];
155} __attribute__((packed)) dasd_rssd_perf_stats_t;155} __attribute__((packed)) dasd_rssd_perf_stats_t;
156156
157/* 157/*
158 * struct profile_info_t158 * struct profile_info_t
159 * holds the profinling information 159 * holds the profinling information
160 */160 */
161typedef struct dasd_profile_info_t {161typedef struct dasd_profile_info_t {
162 unsigned int dasd_io_reqs; /* number of requests processed at all */162 unsigned int dasd_io_reqs; /* number of requests processed at all */
163 unsigned int dasd_io_sects; /* number of sectors processed at all */163 unsigned int dasd_io_sects; /* number of sectors processed at all */
164 unsigned int dasd_io_secs[32]; /* histogram of request's sizes */164 unsigned int dasd_io_secs[32]; /* histogram of request's sizes */
165 unsigned int dasd_io_times[32]; /* histogram of requests's times */165 unsigned int dasd_io_times[32]; /* histogram of requests's times */
166 unsigned int dasd_io_timps[32]; /* histogram of requests's times per sector */166 unsigned int dasd_io_timps[32]; /* histogram of requests's times per sector */
167 unsigned int dasd_io_time1[32]; /* histogram of time from build to start */167 unsigned int dasd_io_time1[32]; /* histogram of time from build to start */
168 unsigned int dasd_io_time2[32]; /* histogram of time from start to irq */168 unsigned int dasd_io_time2[32]; /* histogram of time from start to irq */
169 unsigned int dasd_io_time2ps[32]; /* histogram of time from start to irq */169 unsigned int dasd_io_time2ps[32]; /* histogram of time from start to irq */
170 unsigned int dasd_io_time3[32]; /* histogram of time from irq to end */170 unsigned int dasd_io_time3[32]; /* histogram of time from irq to end */
171 unsigned int dasd_io_nr_req[32]; /* histogram of # of requests in chanq */171 unsigned int dasd_io_nr_req[32]; /* histogram of # of requests in chanq */
172} dasd_profile_info_t;172} dasd_profile_info_t;
173173
174/*174/*
...@@ -189,10 +189,12 @@ typedef struct format_data_t {...@@ -189,10 +189,12 @@ typedef struct format_data_t {
189 * 3/11: also write home address189 * 3/11: also write home address
190 * 4/12: invalidate track190 * 4/12: invalidate track
191 */191 */
192#define DASD_FMT_INT_FMT_R0 1 /* write record zero */192#define DASD_FMT_INT_FMT_R0 1 /* write record zero */
193#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */193#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */
194#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */194#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */
195#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */195#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */
196#define DASD_FMT_INT_FMT_NOR0 16 /* remove permission to write record zero */
197#define DASD_FMT_INT_ESE_FULL 32 /* release space for entire volume */
196198
197/*199/*
198 * struct format_check_t200 * struct format_check_t
...@@ -225,7 +227,7 @@ typedef struct format_check_t {...@@ -225,7 +227,7 @@ typedef struct format_check_t {
225/* If key-length was != 0 */227/* If key-length was != 0 */
226#define DASD_FMT_ERR_KEY_LENGTH 5228#define DASD_FMT_ERR_KEY_LENGTH 5
227229
228/* 230/*
229 * struct attrib_data_t231 * struct attrib_data_t
230 * represents the operation (cache) bits for the device.232 * represents the operation (cache) bits for the device.
231 * Used in DE to influence caching of the DASD.233 * Used in DE to influence caching of the DASD.
...@@ -281,13 +283,13 @@ struct dasd_snid_ioctl_data {...@@ -281,13 +283,13 @@ struct dasd_snid_ioctl_data {
281 * Here ist how the ioctl-nr should be used:283 * Here ist how the ioctl-nr should be used:
282 * 0 - 31 DASD driver itself284 * 0 - 31 DASD driver itself
283 * 32 - 239 still open285 * 32 - 239 still open
284 * 240 - 255 reserved for EMC 286 * 240 - 255 reserved for EMC
285 *******************************************************************************/287 *******************************************************************************/
286288
287/* Disable the volume (for Linux) */289/* Disable the volume (for Linux) */
288#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0) 290#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)
289/* Enable the volume (for Linux) */291/* Enable the volume (for Linux) */
290#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1) 292#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)
291/* Issue a reserve/release command, rsp. */293/* Issue a reserve/release command, rsp. */
292#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2) /* reserve */294#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2) /* reserve */
293#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3) /* release */295#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3) /* release */
...@@ -295,9 +297,9 @@ struct dasd_snid_ioctl_data {...@@ -295,9 +297,9 @@ struct dasd_snid_ioctl_data {
295/* reset profiling information of a device */297/* reset profiling information of a device */
296#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)298#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)
297/* Quiesce IO on device */299/* Quiesce IO on device */
298#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6) 300#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
299/* Resume IO on device */301/* Resume IO on device */
300#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7) 302#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)
301/* Abort all I/O on a device */303/* Abort all I/O on a device */
302#define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)304#define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)
303/* Allow I/O on a device */305/* Allow I/O on a device */
...@@ -315,13 +317,15 @@ struct dasd_snid_ioctl_data {...@@ -315,13 +317,15 @@ struct dasd_snid_ioctl_data {
315/* Performance Statistics Read */317/* Performance Statistics Read */
316#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)318#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
317/* Get Attributes (cache operations) */319/* Get Attributes (cache operations) */
318#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t) 320#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)
319321
320322
321/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */323/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */
322#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t) 324#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)
323/* Set Attributes (cache operations) */325/* Set Attributes (cache operations) */
324#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t) 326#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
327/* Release Allocated Space */
328#define BIODASDRAS _IOW(DASD_IOCTL_LETTER, 3, format_data_t)
325329
326/* Get Sense Path Group ID (SNID) data */330/* Get Sense Path Group ID (SNID) data */
327#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)331#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
lib/libc/include/s390x-linux-any/asm/debug.h deleted-35
...@@ -1,35 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S/390 debug facility
4 *
5 * Copyright IBM Corp. 1999, 2000
6 */
7
8#ifndef DEBUG_H
9#define DEBUG_H
10
11#include <linux/fs.h>
12
13/* Note:
14 * struct __debug_entry must be defined outside of #ifdef __KERNEL__
15 * in order to allow a user program to analyze the 'raw'-view.
16 */
17
18struct __debug_entry{
19 union {
20 struct {
21 unsigned long long clock:52;
22 unsigned long long exception:1;
23 unsigned long long level:3;
24 unsigned long long cpuid:8;
25 } fields;
26
27 unsigned long long stck;
28 } id;
29 void* caller;
30} __attribute__((packed));
31
32
33#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
34
35#endif /* DEBUG_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/hwctrset.h created+51
...@@ -0,0 +1,51 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright IBM Corp. 2021
4 * Interface implementation for communication with the CPU Measurement
5 * counter facility device driver.
6 *
7 * Author(s): Thomas Richter <tmricht@linux.ibm.com>
8 *
9 * Define for ioctl() commands to communicate with the CPU Measurement
10 * counter facility device driver.
11 */
12
13#ifndef _PERF_CPUM_CF_DIAG_H
14#define _PERF_CPUM_CF_DIAG_H
15
16#include <linux/ioctl.h>
17#include <linux/types.h>
18
19#define S390_HWCTR_DEVICE "hwctr"
20#define S390_HWCTR_START_VERSION 1
21
22struct s390_ctrset_start { /* Set CPUs to operate on */
23 __u64 version; /* Version of interface */
24 __u64 data_bytes; /* # of bytes required */
25 __u64 cpumask_len; /* Length of CPU mask in bytes */
26 __u64 *cpumask; /* Pointer to CPU mask */
27 __u64 counter_sets; /* Bit mask of counter sets to get */
28};
29
30struct s390_ctrset_setdata { /* Counter set data */
31 __u32 set; /* Counter set number */
32 __u32 no_cnts; /* # of counters stored in cv[] */
33 __u64 cv[0]; /* Counter values (variable length) */
34};
35
36struct s390_ctrset_cpudata { /* Counter set data per CPU */
37 __u32 cpu_nr; /* CPU number */
38 __u32 no_sets; /* # of counters sets in data[] */
39 struct s390_ctrset_setdata data[0];
40};
41
42struct s390_ctrset_read { /* Structure to get all ctr sets */
43 __u64 no_cpus; /* Total # of CPUs data taken from */
44 struct s390_ctrset_cpudata data[0];
45};
46
47#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
48#define S390_HWCTR_START _IOWR(S390_HWCTR_MAGIC, 1, struct s390_ctrset_start)
49#define S390_HWCTR_STOP _IO(S390_HWCTR_MAGIC, 2)
50#define S390_HWCTR_READ _IOWR(S390_HWCTR_MAGIC, 3, struct s390_ctrset_read)
51#endif
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/ipcbuf.h+2
...@@ -2,6 +2,8 @@...@@ -2,6 +2,8 @@
2#ifndef __S390_IPCBUF_H__2#ifndef __S390_IPCBUF_H__
3#define __S390_IPCBUF_H__3#define __S390_IPCBUF_H__
44
5#include <linux/posix_types.h>
6
5/*7/*
6 * The user_ipc_perm structure for S/390 architecture.8 * The user_ipc_perm structure for S/390 architecture.
7 * Note extra padding because this structure is passed back and forth9 * Note extra padding because this structure is passed back and forth
lib/libc/include/s390x-linux-any/asm/ipl.h created+179
...@@ -0,0 +1,179 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_S390_UAPI_IPL_H
3#define _ASM_S390_UAPI_IPL_H
4
5#include <linux/types.h>
6
7/* IPL Parameter List header */
8struct ipl_pl_hdr {
9 __u32 len;
10 __u8 flags;
11 __u8 reserved1[2];
12 __u8 version;
13} __attribute__((packed));
14
15#define IPL_PL_FLAG_IPLPS 0x80
16#define IPL_PL_FLAG_SIPL 0x40
17#define IPL_PL_FLAG_IPLSR 0x20
18
19/* IPL Parameter Block header */
20struct ipl_pb_hdr {
21 __u32 len;
22 __u8 pbt;
23} __attribute__((packed));
24
25/* IPL Parameter Block types */
26enum ipl_pbt {
27 IPL_PBT_FCP = 0,
28 IPL_PBT_SCP_DATA = 1,
29 IPL_PBT_CCW = 2,
30 IPL_PBT_NVME = 4,
31};
32
33/* IPL Parameter Block 0 with common fields */
34struct ipl_pb0_common {
35 __u32 len;
36 __u8 pbt;
37 __u8 flags;
38 __u8 reserved1[2];
39 __u8 loadparm[8];
40 __u8 reserved2[84];
41} __attribute__((packed));
42
43#define IPL_PB0_FLAG_LOADPARM 0x80
44
45/* IPL Parameter Block 0 for FCP */
46struct ipl_pb0_fcp {
47 __u32 len;
48 __u8 pbt;
49 __u8 reserved1[3];
50 __u8 loadparm[8];
51 __u8 reserved2[304];
52 __u8 opt;
53 __u8 reserved3[3];
54 __u8 cssid;
55 __u8 reserved4[1];
56 __u16 devno;
57 __u8 reserved5[4];
58 __u64 wwpn;
59 __u64 lun;
60 __u32 bootprog;
61 __u8 reserved6[12];
62 __u64 br_lba;
63 __u32 scp_data_len;
64 __u8 reserved7[260];
65 __u8 scp_data[];
66} __attribute__((packed));
67
68#define IPL_PB0_FCP_OPT_IPL 0x10
69#define IPL_PB0_FCP_OPT_DUMP 0x20
70
71/* IPL Parameter Block 0 for NVMe */
72struct ipl_pb0_nvme {
73 __u32 len;
74 __u8 pbt;
75 __u8 reserved1[3];
76 __u8 loadparm[8];
77 __u8 reserved2[304];
78 __u8 opt;
79 __u8 reserved3[3];
80 __u32 fid;
81 __u8 reserved4[12];
82 __u32 nsid;
83 __u8 reserved5[4];
84 __u32 bootprog;
85 __u8 reserved6[12];
86 __u64 br_lba;
87 __u32 scp_data_len;
88 __u8 reserved7[260];
89 __u8 scp_data[];
90} __attribute__((packed));
91
92#define IPL_PB0_NVME_OPT_IPL 0x10
93#define IPL_PB0_NVME_OPT_DUMP 0x20
94
95/* IPL Parameter Block 0 for CCW */
96struct ipl_pb0_ccw {
97 __u32 len;
98 __u8 pbt;
99 __u8 flags;
100 __u8 reserved1[2];
101 __u8 loadparm[8];
102 __u8 reserved2[84];
103 __u16 reserved3 : 13;
104 __u8 ssid : 3;
105 __u16 devno;
106 __u8 vm_flags;
107 __u8 reserved4[3];
108 __u32 vm_parm_len;
109 __u8 nss_name[8];
110 __u8 vm_parm[64];
111 __u8 reserved5[8];
112} __attribute__((packed));
113
114#define IPL_PB0_CCW_VM_FLAG_NSS 0x80
115#define IPL_PB0_CCW_VM_FLAG_VP 0x40
116
117/* IPL Parameter Block 1 for additional SCP data */
118struct ipl_pb1_scp_data {
119 __u32 len;
120 __u8 pbt;
121 __u8 scp_data[];
122} __attribute__((packed));
123
124/* IPL Report List header */
125struct ipl_rl_hdr {
126 __u32 len;
127 __u8 flags;
128 __u8 reserved1[2];
129 __u8 version;
130 __u8 reserved2[8];
131} __attribute__((packed));
132
133/* IPL Report Block header */
134struct ipl_rb_hdr {
135 __u32 len;
136 __u8 rbt;
137 __u8 reserved1[11];
138} __attribute__((packed));
139
140/* IPL Report Block types */
141enum ipl_rbt {
142 IPL_RBT_CERTIFICATES = 1,
143 IPL_RBT_COMPONENTS = 2,
144};
145
146/* IPL Report Block for the certificate list */
147struct ipl_rb_certificate_entry {
148 __u64 addr;
149 __u64 len;
150} __attribute__((packed));
151
152struct ipl_rb_certificates {
153 __u32 len;
154 __u8 rbt;
155 __u8 reserved1[11];
156 struct ipl_rb_certificate_entry entries[];
157} __attribute__((packed));
158
159/* IPL Report Block for the component list */
160struct ipl_rb_component_entry {
161 __u64 addr;
162 __u64 len;
163 __u8 flags;
164 __u8 reserved1[5];
165 __u16 certificate_index;
166 __u8 reserved2[8];
167};
168
169#define IPL_RB_COMPONENT_FLAG_SIGNED 0x80
170#define IPL_RB_COMPONENT_FLAG_VERIFIED 0x40
171
172struct ipl_rb_components {
173 __u32 len;
174 __u8 rbt;
175 __u8 reserved1[11];
176 struct ipl_rb_component_entry entries[];
177} __attribute__((packed));
178
179#endif
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/kvm.h+16-2
...@@ -152,7 +152,10 @@ struct kvm_s390_vm_cpu_subfunc {...@@ -152,7 +152,10 @@ struct kvm_s390_vm_cpu_subfunc {
152 __u8 pcc[16]; /* with MSA4 */152 __u8 pcc[16]; /* with MSA4 */
153 __u8 ppno[16]; /* with MSA5 */153 __u8 ppno[16]; /* with MSA5 */
154 __u8 kma[16]; /* with MSA8 */154 __u8 kma[16]; /* with MSA8 */
155 __u8 reserved[1808];155 __u8 kdsa[16]; /* with MSA9 */
156 __u8 sortl[32]; /* with STFLE.150 */
157 __u8 dfltcc[32]; /* with STFLE.151 */
158 __u8 reserved[1728];
156};159};
157160
158/* kvm attributes for crypto */161/* kvm attributes for crypto */
...@@ -160,6 +163,8 @@ struct kvm_s390_vm_cpu_subfunc {...@@ -160,6 +163,8 @@ struct kvm_s390_vm_cpu_subfunc {
160#define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1163#define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1
161#define KVM_S390_VM_CRYPTO_DISABLE_AES_KW 2164#define KVM_S390_VM_CRYPTO_DISABLE_AES_KW 2
162#define KVM_S390_VM_CRYPTO_DISABLE_DEA_KW 3165#define KVM_S390_VM_CRYPTO_DISABLE_DEA_KW 3
166#define KVM_S390_VM_CRYPTO_ENABLE_APIE 4
167#define KVM_S390_VM_CRYPTO_DISABLE_APIE 5
163168
164/* kvm attributes for migration mode */169/* kvm attributes for migration mode */
165#define KVM_S390_VM_MIGRATION_STOP 0170#define KVM_S390_VM_MIGRATION_STOP 0
...@@ -226,6 +231,14 @@ struct kvm_guest_debug_arch {...@@ -226,6 +231,14 @@ struct kvm_guest_debug_arch {
226#define KVM_SYNC_GSCB (1UL << 9)231#define KVM_SYNC_GSCB (1UL << 9)
227#define KVM_SYNC_BPBC (1UL << 10)232#define KVM_SYNC_BPBC (1UL << 10)
228#define KVM_SYNC_ETOKEN (1UL << 11)233#define KVM_SYNC_ETOKEN (1UL << 11)
234#define KVM_SYNC_DIAG318 (1UL << 12)
235
236#define KVM_SYNC_S390_VALID_FIELDS \
237 (KVM_SYNC_PREFIX | KVM_SYNC_GPRS | KVM_SYNC_ACRS | KVM_SYNC_CRS | \
238 KVM_SYNC_ARCH0 | KVM_SYNC_PFAULT | KVM_SYNC_VRS | KVM_SYNC_RICCB | \
239 KVM_SYNC_FPRS | KVM_SYNC_GSCB | KVM_SYNC_BPBC | KVM_SYNC_ETOKEN | \
240 KVM_SYNC_DIAG318)
241
229/* length and alignment of the sdnx as a power of two */242/* length and alignment of the sdnx as a power of two */
230#define SDNXC 8243#define SDNXC 8
231#define SDNXL (1UL << SDNXC)244#define SDNXL (1UL << SDNXC)
...@@ -253,7 +266,8 @@ struct kvm_sync_regs {...@@ -253,7 +266,8 @@ struct kvm_sync_regs {
253 __u8 reserved2 : 7;266 __u8 reserved2 : 7;
254 __u8 padding1[51]; /* riccb needs to be 64byte aligned */267 __u8 padding1[51]; /* riccb needs to be 64byte aligned */
255 __u8 riccb[64]; /* runtime instrumentation controls block */268 __u8 riccb[64]; /* runtime instrumentation controls block */
256 __u8 padding2[192]; /* sdnx needs to be 256byte aligned */269 __u64 diag318; /* diagnose 0x318 info */
270 __u8 padding2[184]; /* sdnx needs to be 256byte aligned */
257 union {271 union {
258 __u8 sdnx[SDNXL]; /* state description annex */272 __u8 sdnx[SDNXL]; /* state description annex */
259 struct {273 struct {
lib/libc/include/s390x-linux-any/asm/pkey.h+331-16
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2/*2/*
3 * Userspace interface to the pkey device driver3 * Userspace interface to the pkey device driver
4 *4 *
5 * Copyright IBM Corp. 20175 * Copyright IBM Corp. 2017, 2019
6 *6 *
7 * Author: Harald Freudenberger <freude@de.ibm.com>7 * Author: Harald Freudenberger <freude@de.ibm.com>
8 *8 *
...@@ -20,34 +20,94 @@...@@ -20,34 +20,94 @@
2020
21#define PKEY_IOCTL_MAGIC 'p'21#define PKEY_IOCTL_MAGIC 'p'
2222
23#define SECKEYBLOBSIZE 64 /* secure key blob size is always 64 bytes */23#define SECKEYBLOBSIZE 64 /* secure key blob size is always 64 bytes */
24#define MAXPROTKEYSIZE 64 /* a protected key blob may be up to 64 bytes */24#define PROTKEYBLOBSIZE 80 /* protected key blob size is always 80 bytes */
25#define MAXCLRKEYSIZE 32 /* a clear key value may be up to 32 bytes */25#define MAXPROTKEYSIZE 64 /* a protected key blob may be up to 64 bytes */
26#define MAXCLRKEYSIZE 32 /* a clear key value may be up to 32 bytes */
27#define MAXAESCIPHERKEYSIZE 136 /* our aes cipher keys have always 136 bytes */
28#define MINEP11AESKEYBLOBSIZE 256 /* min EP11 AES key blob size */
29#define MAXEP11AESKEYBLOBSIZE 320 /* max EP11 AES key blob size */
30
31/* Minimum size of a key blob */
32#define MINKEYBLOBSIZE SECKEYBLOBSIZE
2633
27/* defines for the type field within the pkey_protkey struct */34/* defines for the type field within the pkey_protkey struct */
28#define PKEY_KEYTYPE_AES_128 135#define PKEY_KEYTYPE_AES_128 1
29#define PKEY_KEYTYPE_AES_192 236#define PKEY_KEYTYPE_AES_192 2
30#define PKEY_KEYTYPE_AES_256 337#define PKEY_KEYTYPE_AES_256 3
38#define PKEY_KEYTYPE_ECC 4
39
40/* the newer ioctls use a pkey_key_type enum for type information */
41enum pkey_key_type {
42 PKEY_TYPE_CCA_DATA = (__u32) 1,
43 PKEY_TYPE_CCA_CIPHER = (__u32) 2,
44 PKEY_TYPE_EP11 = (__u32) 3,
45 PKEY_TYPE_CCA_ECC = (__u32) 0x1f,
46 PKEY_TYPE_EP11_AES = (__u32) 6,
47 PKEY_TYPE_EP11_ECC = (__u32) 7,
48};
49
50/* the newer ioctls use a pkey_key_size enum for key size information */
51enum pkey_key_size {
52 PKEY_SIZE_AES_128 = (__u32) 128,
53 PKEY_SIZE_AES_192 = (__u32) 192,
54 PKEY_SIZE_AES_256 = (__u32) 256,
55 PKEY_SIZE_UNKNOWN = (__u32) 0xFFFFFFFF,
56};
57
58/* some of the newer ioctls use these flags */
59#define PKEY_FLAGS_MATCH_CUR_MKVP 0x00000002
60#define PKEY_FLAGS_MATCH_ALT_MKVP 0x00000004
61
62/* keygenflags defines for CCA AES cipher keys */
63#define PKEY_KEYGEN_XPRT_SYM 0x00008000
64#define PKEY_KEYGEN_XPRT_UASY 0x00004000
65#define PKEY_KEYGEN_XPRT_AASY 0x00002000
66#define PKEY_KEYGEN_XPRT_RAW 0x00001000
67#define PKEY_KEYGEN_XPRT_CPAC 0x00000800
68#define PKEY_KEYGEN_XPRT_DES 0x00000080
69#define PKEY_KEYGEN_XPRT_AES 0x00000040
70#define PKEY_KEYGEN_XPRT_RSA 0x00000008
3171
32/* Struct to hold a secure key blob */72/* Struct to hold apqn target info (card/domain pair) */
73struct pkey_apqn {
74 __u16 card;
75 __u16 domain;
76};
77
78/* Struct to hold a CCA AES secure key blob */
33struct pkey_seckey {79struct pkey_seckey {
34 __u8 seckey[SECKEYBLOBSIZE]; /* the secure key blob */80 __u8 seckey[SECKEYBLOBSIZE]; /* the secure key blob */
35};81};
3682
37/* Struct to hold protected key and length info */83/* Struct to hold protected key and length info */
38struct pkey_protkey {84struct pkey_protkey {
39 __u32 type; /* key type, one of the PKEY_KEYTYPE values */85 __u32 type; /* key type, one of the PKEY_KEYTYPE_AES values */
40 __u32 len; /* bytes actually stored in protkey[] */86 __u32 len; /* bytes actually stored in protkey[] */
41 __u8 protkey[MAXPROTKEYSIZE]; /* the protected key blob */87 __u8 protkey[MAXPROTKEYSIZE]; /* the protected key blob */
42};88};
4389
44/* Struct to hold a clear key value */90/* Struct to hold an AES clear key value */
45struct pkey_clrkey {91struct pkey_clrkey {
46 __u8 clrkey[MAXCLRKEYSIZE]; /* 16, 24, or 32 byte clear key value */92 __u8 clrkey[MAXCLRKEYSIZE]; /* 16, 24, or 32 byte clear key value */
47};93};
4894
49/*95/*
50 * Generate secure key96 * EP11 key blobs of type PKEY_TYPE_EP11_AES and PKEY_TYPE_EP11_ECC
97 * are ep11 blobs prepended by this header:
98 */
99struct ep11kblob_header {
100 __u8 type; /* always 0x00 */
101 __u8 hver; /* header version, currently needs to be 0x00 */
102 __u16 len; /* total length in bytes (including this header) */
103 __u8 version; /* PKEY_TYPE_EP11_AES or PKEY_TYPE_EP11_ECC */
104 __u8 res0; /* unused */
105 __u16 bitlen; /* clear key bit len, 0 for unknown */
106 __u8 res1[8]; /* unused */
107} __attribute__((packed));
108
109/*
110 * Generate CCA AES secure key.
51 */111 */
52struct pkey_genseck {112struct pkey_genseck {
53 __u16 cardnr; /* in: card to use or FFFF for any */113 __u16 cardnr; /* in: card to use or FFFF for any */
...@@ -58,7 +118,7 @@ struct pkey_genseck {...@@ -58,7 +118,7 @@ struct pkey_genseck {
58#define PKEY_GENSECK _IOWR(PKEY_IOCTL_MAGIC, 0x01, struct pkey_genseck)118#define PKEY_GENSECK _IOWR(PKEY_IOCTL_MAGIC, 0x01, struct pkey_genseck)
59119
60/*120/*
61 * Construct secure key from clear key value121 * Construct CCA AES secure key from clear key value
62 */122 */
63struct pkey_clr2seck {123struct pkey_clr2seck {
64 __u16 cardnr; /* in: card to use or FFFF for any */124 __u16 cardnr; /* in: card to use or FFFF for any */
...@@ -70,7 +130,7 @@ struct pkey_clr2seck {...@@ -70,7 +130,7 @@ struct pkey_clr2seck {
70#define PKEY_CLR2SECK _IOWR(PKEY_IOCTL_MAGIC, 0x02, struct pkey_clr2seck)130#define PKEY_CLR2SECK _IOWR(PKEY_IOCTL_MAGIC, 0x02, struct pkey_clr2seck)
71131
72/*132/*
73 * Fabricate protected key from a secure key133 * Fabricate AES protected key from a CCA AES secure key
74 */134 */
75struct pkey_sec2protk {135struct pkey_sec2protk {
76 __u16 cardnr; /* in: card to use or FFFF for any */136 __u16 cardnr; /* in: card to use or FFFF for any */
...@@ -81,7 +141,7 @@ struct pkey_sec2protk {...@@ -81,7 +141,7 @@ struct pkey_sec2protk {
81#define PKEY_SEC2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x03, struct pkey_sec2protk)141#define PKEY_SEC2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x03, struct pkey_sec2protk)
82142
83/*143/*
84 * Fabricate protected key from an clear key value144 * Fabricate AES protected key from clear key value
85 */145 */
86struct pkey_clr2protk {146struct pkey_clr2protk {
87 __u32 keytype; /* in: key type to generate */147 __u32 keytype; /* in: key type to generate */
...@@ -92,7 +152,7 @@ struct pkey_clr2protk {...@@ -92,7 +152,7 @@ struct pkey_clr2protk {
92152
93/*153/*
94 * Search for matching crypto card based on the Master Key154 * Search for matching crypto card based on the Master Key
95 * Verification Pattern provided inside a secure key.155 * Verification Pattern provided inside a CCA AES secure key.
96 */156 */
97struct pkey_findcard {157struct pkey_findcard {
98 struct pkey_seckey seckey; /* in: the secure key blob */158 struct pkey_seckey seckey; /* in: the secure key blob */
...@@ -111,7 +171,7 @@ struct pkey_skey2pkey {...@@ -111,7 +171,7 @@ struct pkey_skey2pkey {
111#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)171#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)
112172
113/*173/*
114 * Verify the given secure key for being able to be useable with174 * Verify the given CCA AES secure key for being able to be useable with
115 * the pkey module. Check for correct key type and check for having at175 * the pkey module. Check for correct key type and check for having at
116 * least one crypto card being able to handle this key (master key176 * least one crypto card being able to handle this key (master key
117 * or old master key verification pattern matches).177 * or old master key verification pattern matches).
...@@ -129,4 +189,259 @@ struct pkey_verifykey {...@@ -129,4 +189,259 @@ struct pkey_verifykey {
129#define PKEY_VERIFY_ATTR_AES 0x00000001 /* key is an AES key */189#define PKEY_VERIFY_ATTR_AES 0x00000001 /* key is an AES key */
130#define PKEY_VERIFY_ATTR_OLD_MKVP 0x00000100 /* key has old MKVP value */190#define PKEY_VERIFY_ATTR_OLD_MKVP 0x00000100 /* key has old MKVP value */
131191
192/*
193 * Generate AES random protected key.
194 */
195struct pkey_genprotk {
196 __u32 keytype; /* in: key type to generate */
197 struct pkey_protkey protkey; /* out: the protected key */
198};
199
200#define PKEY_GENPROTK _IOWR(PKEY_IOCTL_MAGIC, 0x08, struct pkey_genprotk)
201
202/*
203 * Verify an AES protected key.
204 */
205struct pkey_verifyprotk {
206 struct pkey_protkey protkey; /* in: the protected key to verify */
207};
208
209#define PKEY_VERIFYPROTK _IOW(PKEY_IOCTL_MAGIC, 0x09, struct pkey_verifyprotk)
210
211/*
212 * Transform an key blob (of any type) into a protected key
213 */
214struct pkey_kblob2pkey {
215 __u8 *key; /* in: the key blob */
216 __u32 keylen; /* in: the key blob length */
217 struct pkey_protkey protkey; /* out: the protected key */
218};
219#define PKEY_KBLOB2PROTK _IOWR(PKEY_IOCTL_MAGIC, 0x0A, struct pkey_kblob2pkey)
220
221/*
222 * Generate secure key, version 2.
223 * Generate CCA AES secure key, CCA AES cipher key or EP11 AES secure key.
224 * There needs to be a list of apqns given with at least one entry in there.
225 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain
226 * is not supported. The implementation walks through the list of apqns and
227 * tries to send the request to each apqn without any further checking (like
228 * card type or online state). If the apqn fails, simple the next one in the
229 * list is tried until success (return 0) or the end of the list is reached
230 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4KT ioctl to
231 * generate a list of apqns based on the key type to generate.
232 * The keygenflags argument is passed to the low level generation functions
233 * individual for the key type and has a key type specific meaning. When
234 * generating CCA cipher keys you can use one or more of the PKEY_KEYGEN_*
235 * flags to widen the export possibilities. By default a cipher key is
236 * only exportable for CPACF (PKEY_KEYGEN_XPRT_CPAC).
237 * The keygenflag argument for generating an EP11 AES key should either be 0
238 * to use the defaults which are XCP_BLOB_ENCRYPT, XCP_BLOB_DECRYPT and
239 * XCP_BLOB_PROTKEY_EXTRACTABLE or a valid combination of XCP_BLOB_* flags.
240 */
241struct pkey_genseck2 {
242 struct pkey_apqn *apqns; /* in: ptr to list of apqn targets*/
243 __u32 apqn_entries; /* in: # of apqn target list entries */
244 enum pkey_key_type type; /* in: key type to generate */
245 enum pkey_key_size size; /* in: key size to generate */
246 __u32 keygenflags; /* in: key generation flags */
247 __u8 *key; /* in: pointer to key blob buffer */
248 __u32 keylen; /* in: available key blob buffer size */
249 /* out: actual key blob size */
250};
251#define PKEY_GENSECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x11, struct pkey_genseck2)
252
253/*
254 * Generate secure key from clear key value, version 2.
255 * Construct an CCA AES secure key, CCA AES cipher key or EP11 AES secure
256 * key from a given clear key value.
257 * There needs to be a list of apqns given with at least one entry in there.
258 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain
259 * is not supported. The implementation walks through the list of apqns and
260 * tries to send the request to each apqn without any further checking (like
261 * card type or online state). If the apqn fails, simple the next one in the
262 * list is tried until success (return 0) or the end of the list is reached
263 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4KT ioctl to
264 * generate a list of apqns based on the key type to generate.
265 * The keygenflags argument is passed to the low level generation functions
266 * individual for the key type and has a key type specific meaning. When
267 * generating CCA cipher keys you can use one or more of the PKEY_KEYGEN_*
268 * flags to widen the export possibilities. By default a cipher key is
269 * only exportable for CPACF (PKEY_KEYGEN_XPRT_CPAC).
270 * The keygenflag argument for generating an EP11 AES key should either be 0
271 * to use the defaults which are XCP_BLOB_ENCRYPT, XCP_BLOB_DECRYPT and
272 * XCP_BLOB_PROTKEY_EXTRACTABLE or a valid combination of XCP_BLOB_* flags.
273 */
274struct pkey_clr2seck2 {
275 struct pkey_apqn *apqns; /* in: ptr to list of apqn targets */
276 __u32 apqn_entries; /* in: # of apqn target list entries */
277 enum pkey_key_type type; /* in: key type to generate */
278 enum pkey_key_size size; /* in: key size to generate */
279 __u32 keygenflags; /* in: key generation flags */
280 struct pkey_clrkey clrkey; /* in: the clear key value */
281 __u8 *key; /* in: pointer to key blob buffer */
282 __u32 keylen; /* in: available key blob buffer size */
283 /* out: actual key blob size */
284};
285#define PKEY_CLR2SECK2 _IOWR(PKEY_IOCTL_MAGIC, 0x12, struct pkey_clr2seck2)
286
287/*
288 * Verify the given secure key, version 2.
289 * Check for correct key type. If cardnr and domain are given (are not
290 * 0xFFFF) also check if this apqn is able to handle this type of key.
291 * If cardnr and/or domain is 0xFFFF, on return these values are filled
292 * with one apqn able to handle this key.
293 * The function also checks for the master key verification patterns
294 * of the key matching to the current or alternate mkvp of the apqn.
295 * For CCA AES secure keys and CCA AES cipher keys this means to check
296 * the key's mkvp against the current or old mkvp of the apqns. The flags
297 * field is updated with some additional info about the apqn mkvp
298 * match: If the current mkvp matches to the key's mkvp then the
299 * PKEY_FLAGS_MATCH_CUR_MKVP bit is set, if the alternate mkvp matches to
300 * the key's mkvp the PKEY_FLAGS_MATCH_ALT_MKVP is set. For CCA keys the
301 * alternate mkvp is the old master key verification pattern.
302 * CCA AES secure keys are also checked to have the CPACF export allowed
303 * bit enabled (XPRTCPAC) in the kmf1 field.
304 * EP11 keys are also supported and the wkvp of the key is checked against
305 * the current wkvp of the apqns. There is no alternate for this type of
306 * key and so on a match the flag PKEY_FLAGS_MATCH_CUR_MKVP always is set.
307 * EP11 keys are also checked to have XCP_BLOB_PROTKEY_EXTRACTABLE set.
308 * The ioctl returns 0 as long as the given or found apqn matches to
309 * matches with the current or alternate mkvp to the key's mkvp. If the given
310 * apqn does not match or there is no such apqn found, -1 with errno
311 * ENODEV is returned.
312 */
313struct pkey_verifykey2 {
314 __u8 *key; /* in: pointer to key blob */
315 __u32 keylen; /* in: key blob size */
316 __u16 cardnr; /* in/out: card number */
317 __u16 domain; /* in/out: domain number */
318 enum pkey_key_type type; /* out: the key type */
319 enum pkey_key_size size; /* out: the key size */
320 __u32 flags; /* out: additional key info flags */
321};
322#define PKEY_VERIFYKEY2 _IOWR(PKEY_IOCTL_MAGIC, 0x17, struct pkey_verifykey2)
323
324/*
325 * Transform a key blob into a protected key, version 2.
326 * There needs to be a list of apqns given with at least one entry in there.
327 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain
328 * is not supported. The implementation walks through the list of apqns and
329 * tries to send the request to each apqn without any further checking (like
330 * card type or online state). If the apqn fails, simple the next one in the
331 * list is tried until success (return 0) or the end of the list is reached
332 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4K ioctl to
333 * generate a list of apqns based on the key.
334 * Deriving ECC protected keys from ECC secure keys is not supported with
335 * this ioctl, use PKEY_KBLOB2PROTK3 for this purpose.
336 */
337struct pkey_kblob2pkey2 {
338 __u8 *key; /* in: pointer to key blob */
339 __u32 keylen; /* in: key blob size */
340 struct pkey_apqn *apqns; /* in: ptr to list of apqn targets */
341 __u32 apqn_entries; /* in: # of apqn target list entries */
342 struct pkey_protkey protkey; /* out: the protected key */
343};
344#define PKEY_KBLOB2PROTK2 _IOWR(PKEY_IOCTL_MAGIC, 0x1A, struct pkey_kblob2pkey2)
345
346/*
347 * Build a list of APQNs based on a key blob given.
348 * Is able to find out which type of secure key is given (CCA AES secure
349 * key, CCA AES cipher key, CCA ECC private key, EP11 AES key, EP11 ECC private
350 * key) and tries to find all matching crypto cards based on the MKVP and maybe
351 * other criterias (like CCA AES cipher keys need a CEX5C or higher, EP11 keys
352 * with BLOB_PKEY_EXTRACTABLE need a CEX7 and EP11 api version 4). The list of
353 * APQNs is further filtered by the key's mkvp which needs to match to either
354 * the current mkvp (CCA and EP11) or the alternate mkvp (old mkvp, CCA adapters
355 * only) of the apqns. The flags argument may be used to limit the matching
356 * apqns. If the PKEY_FLAGS_MATCH_CUR_MKVP is given, only the current mkvp of
357 * each apqn is compared. Likewise with the PKEY_FLAGS_MATCH_ALT_MKVP. If both
358 * are given, it is assumed to return apqns where either the current or the
359 * alternate mkvp matches. At least one of the matching flags needs to be given.
360 * The flags argument for EP11 keys has no further action and is currently
361 * ignored (but needs to be given as PKEY_FLAGS_MATCH_CUR_MKVP) as there is only
362 * the wkvp from the key to match against the apqn's wkvp.
363 * The list of matching apqns is stored into the space given by the apqns
364 * argument and the number of stored entries goes into apqn_entries. If the list
365 * is empty (apqn_entries is 0) the apqn_entries field is updated to the number
366 * of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
367 * but the number of apqn targets does not fit into the list, the apqn_targets
368 * field is updatedd with the number of reqired entries but there are no apqn
369 * values stored in the list and the ioctl returns with ENOSPC. If no matching
370 * APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
371 */
372struct pkey_apqns4key {
373 __u8 *key; /* in: pointer to key blob */
374 __u32 keylen; /* in: key blob size */
375 __u32 flags; /* in: match controlling flags */
376 struct pkey_apqn *apqns; /* in/out: ptr to list of apqn targets*/
377 __u32 apqn_entries; /* in: max # of apqn entries in the list */
378 /* out: # apqns stored into the list */
379};
380#define PKEY_APQNS4K _IOWR(PKEY_IOCTL_MAGIC, 0x1B, struct pkey_apqns4key)
381
382/*
383 * Build a list of APQNs based on a key type given.
384 * Build a list of APQNs based on a given key type and maybe further
385 * restrict the list by given master key verification patterns.
386 * For different key types there may be different ways to match the
387 * master key verification patterns. For CCA keys (CCA data key and CCA
388 * cipher key) the first 8 bytes of cur_mkvp refer to the current AES mkvp value
389 * of the apqn and the first 8 bytes of the alt_mkvp refer to the old AES mkvp.
390 * For CCA ECC keys it is similar but the match is against the APKA current/old
391 * mkvp. The flags argument controls if the apqns current and/or alternate mkvp
392 * should match. If the PKEY_FLAGS_MATCH_CUR_MKVP is given, only the current
393 * mkvp of each apqn is compared. Likewise with the PKEY_FLAGS_MATCH_ALT_MKVP.
394 * If both are given, it is assumed to return apqns where either the
395 * current or the alternate mkvp matches. If no match flag is given
396 * (flags is 0) the mkvp values are ignored for the match process.
397 * For EP11 keys there is only the current wkvp. So if the apqns should also
398 * match to a given wkvp, then the PKEY_FLAGS_MATCH_CUR_MKVP flag should be
399 * set. The wkvp value is 32 bytes but only the leftmost 16 bytes are compared
400 * against the leftmost 16 byte of the wkvp of the apqn.
401 * The list of matching apqns is stored into the space given by the apqns
402 * argument and the number of stored entries goes into apqn_entries. If the list
403 * is empty (apqn_entries is 0) the apqn_entries field is updated to the number
404 * of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
405 * but the number of apqn targets does not fit into the list, the apqn_targets
406 * field is updatedd with the number of reqired entries but there are no apqn
407 * values stored in the list and the ioctl returns with ENOSPC. If no matching
408 * APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
409 */
410struct pkey_apqns4keytype {
411 enum pkey_key_type type; /* in: key type */
412 __u8 cur_mkvp[32]; /* in: current mkvp */
413 __u8 alt_mkvp[32]; /* in: alternate mkvp */
414 __u32 flags; /* in: match controlling flags */
415 struct pkey_apqn *apqns; /* in/out: ptr to list of apqn targets*/
416 __u32 apqn_entries; /* in: max # of apqn entries in the list */
417 /* out: # apqns stored into the list */
418};
419#define PKEY_APQNS4KT _IOWR(PKEY_IOCTL_MAGIC, 0x1C, struct pkey_apqns4keytype)
420
421/*
422 * Transform a key blob into a protected key, version 3.
423 * The difference to version 2 of this ioctl is that the protected key
424 * buffer is now explicitly and not within a struct pkey_protkey any more.
425 * So this ioctl is also able to handle EP11 and CCA ECC secure keys and
426 * provide ECC protected keys.
427 * There needs to be a list of apqns given with at least one entry in there.
428 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain
429 * is not supported. The implementation walks through the list of apqns and
430 * tries to send the request to each apqn without any further checking (like
431 * card type or online state). If the apqn fails, simple the next one in the
432 * list is tried until success (return 0) or the end of the list is reached
433 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4K ioctl to
434 * generate a list of apqns based on the key.
435 */
436struct pkey_kblob2pkey3 {
437 __u8 *key; /* in: pointer to key blob */
438 __u32 keylen; /* in: key blob size */
439 struct pkey_apqn *apqns; /* in: ptr to list of apqn targets */
440 __u32 apqn_entries; /* in: # of apqn target list entries */
441 __u32 pkeytype; /* out: prot key type (enum pkey_key_type) */
442 __u32 pkeylen; /* in/out: size of pkey buffer/actual len of pkey */
443 __u8 *pkey; /* in: pkey blob buffer space ptr */
444};
445#define PKEY_KBLOB2PROTK3 _IOWR(PKEY_IOCTL_MAGIC, 0x1D, struct pkey_kblob2pkey3)
446
132#endif /* _PKEY_H */447#endif /* _PKEY_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/posix_types.h+1
...@@ -20,6 +20,7 @@ typedef long __kernel_ssize_t;...@@ -20,6 +20,7 @@ typedef long __kernel_ssize_t;
20typedef unsigned short __kernel_old_dev_t;20typedef unsigned short __kernel_old_dev_t;
21#define __kernel_old_dev_t __kernel_old_dev_t21#define __kernel_old_dev_t __kernel_old_dev_t
2222
23
23#ifndef __s390x__24#ifndef __s390x__
2425
25typedef unsigned long __kernel_ino_t;26typedef unsigned long __kernel_ino_t;
lib/libc/include/s390x-linux-any/asm/ptrace.h+3-2
...@@ -179,8 +179,9 @@...@@ -179,8 +179,9 @@
179#define ACR_SIZE 4179#define ACR_SIZE 4
180180
181181
182#define PTRACE_OLDSETOPTIONS 21182#define PTRACE_OLDSETOPTIONS 21
183183#define PTRACE_SYSEMU 31
184#define PTRACE_SYSEMU_SINGLESTEP 32
184#ifndef __ASSEMBLY__185#ifndef __ASSEMBLY__
185#include <linux/stddef.h>186#include <linux/stddef.h>
186#include <linux/types.h>187#include <linux/types.h>
lib/libc/include/s390x-linux-any/asm/runtime_instr.h+1-1
...@@ -57,7 +57,7 @@ struct runtime_instr_cb {...@@ -57,7 +57,7 @@ struct runtime_instr_cb {
57 __u64 sf;57 __u64 sf;
58 __u64 rsic;58 __u64 rsic;
59 __u64 reserved8;59 __u64 reserved8;
60} __attribute__((packed)) __aligned(8);60} __attribute__((__packed__, __aligned__(8)));
6161
62static __inline__ void load_runtime_instr_cb(struct runtime_instr_cb *cb)62static __inline__ void load_runtime_instr_cb(struct runtime_instr_cb *cb)
63{63{
lib/libc/include/s390x-linux-any/asm/schid.h+3
...@@ -4,6 +4,8 @@...@@ -4,6 +4,8 @@
44
5#include <linux/types.h>5#include <linux/types.h>
66
7#ifndef __ASSEMBLY__
8
7struct subchannel_id {9struct subchannel_id {
8 __u32 cssid : 8;10 __u32 cssid : 8;
9 __u32 : 4;11 __u32 : 4;
...@@ -13,5 +15,6 @@ struct subchannel_id {...@@ -13,5 +15,6 @@ struct subchannel_id {
13 __u32 sch_no : 16;15 __u32 sch_no : 16;
14} __attribute__ ((packed, aligned(4)));16} __attribute__ ((packed, aligned(4)));
1517
18#endif /* __ASSEMBLY__ */
1619
17#endif /* ASM_SCHID_H */20#endif /* ASM_SCHID_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/setup.h+1-14
...@@ -1,14 +1 @@...@@ -1,14 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 * Copyright IBM Corp. 1999, 2010
5 */
6
7#ifndef _ASM_S390_SETUP_H
8#define _ASM_S390_SETUP_H
9
10#define COMMAND_LINE_SIZE 4096
11
12#define ARCH_COMMAND_LINE_SIZE 896
13
14#endif /* _ASM_S390_SETUP_H */
\ No newline at end of file
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/sie.h+1-1
...@@ -29,7 +29,7 @@...@@ -29,7 +29,7 @@
29 { 0x13, "SIGP conditional emergency signal" }, \29 { 0x13, "SIGP conditional emergency signal" }, \
30 { 0x15, "SIGP sense running" }, \30 { 0x15, "SIGP sense running" }, \
31 { 0x16, "SIGP set multithreading"}, \31 { 0x16, "SIGP set multithreading"}, \
32 { 0x17, "SIGP store additional status ait address"}32 { 0x17, "SIGP store additional status at address"}
3333
34#define icpt_prog_codes \34#define icpt_prog_codes \
35 { 0x0001, "Prog Operation" }, \35 { 0x0001, "Prog Operation" }, \
lib/libc/include/s390x-linux-any/asm/siginfo.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 *
5 * Derived from "include/asm-i386/siginfo.h"
6 */
7
8#ifndef _S390_SIGINFO_H
9#define _S390_SIGINFO_H
10
11#ifdef __s390x__
12#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
13#endif
14
15#include <asm-generic/siginfo.h>
16
17#endif
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/signal.h-24
...@@ -63,30 +63,6 @@ typedef unsigned long sigset_t;...@@ -63,30 +63,6 @@ typedef unsigned long sigset_t;
63#define SIGRTMIN 3263#define SIGRTMIN 32
64#define SIGRTMAX _NSIG64#define SIGRTMAX _NSIG
6565
66/*
67 * SA_FLAGS values:
68 *
69 * SA_ONSTACK indicates that a registered stack_t will be used.
70 * SA_RESTART flag to get restarting signals (which were the default long ago)
71 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
72 * SA_RESETHAND clears the handler when the signal is delivered.
73 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
74 * SA_NODEFER prevents the current signal from being masked in the handler.
75 *
76 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
77 * Unix names RESETHAND and NODEFER respectively.
78 */
79#define SA_NOCLDSTOP 0x00000001
80#define SA_NOCLDWAIT 0x00000002
81#define SA_SIGINFO 0x00000004
82#define SA_ONSTACK 0x08000000
83#define SA_RESTART 0x10000000
84#define SA_NODEFER 0x40000000
85#define SA_RESETHAND 0x80000000
86
87#define SA_NOMASK SA_NODEFER
88#define SA_ONESHOT SA_RESETHAND
89
90#define SA_RESTORER 0x0400000066#define SA_RESTORER 0x04000000
9167
92#define MINSIGSTKSZ 204868#define MINSIGSTKSZ 2048
lib/libc/include/s390x-linux-any/asm/socket.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 *
5 * Derived from "include/asm-i386/socket.h"
6 */
7
8#ifndef _ASM_SOCKET_H
9#define _ASM_SOCKET_H
10
11#include <asm/sockios.h>
12
13/* For setsockopt(2) */
14#define SOL_SOCKET 1
15
16#define SO_DEBUG 1
17#define SO_REUSEADDR 2
18#define SO_TYPE 3
19#define SO_ERROR 4
20#define SO_DONTROUTE 5
21#define SO_BROADCAST 6
22#define SO_SNDBUF 7
23#define SO_RCVBUF 8
24#define SO_SNDBUFFORCE 32
25#define SO_RCVBUFFORCE 33
26#define SO_KEEPALIVE 9
27#define SO_OOBINLINE 10
28#define SO_NO_CHECK 11
29#define SO_PRIORITY 12
30#define SO_LINGER 13
31#define SO_BSDCOMPAT 14
32#define SO_REUSEPORT 15
33#define SO_PASSCRED 16
34#define SO_PEERCRED 17
35#define SO_RCVLOWAT 18
36#define SO_SNDLOWAT 19
37#define SO_RCVTIMEO 20
38#define SO_SNDTIMEO 21
39
40/* Security levels - as per NRL IPv6 - don't actually do anything */
41#define SO_SECURITY_AUTHENTICATION 22
42#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
43#define SO_SECURITY_ENCRYPTION_NETWORK 24
44
45#define SO_BINDTODEVICE 25
46
47/* Socket filtering */
48#define SO_ATTACH_FILTER 26
49#define SO_DETACH_FILTER 27
50#define SO_GET_FILTER SO_ATTACH_FILTER
51
52#define SO_PEERNAME 28
53#define SO_TIMESTAMP 29
54#define SCM_TIMESTAMP SO_TIMESTAMP
55
56#define SO_ACCEPTCONN 30
57
58#define SO_PEERSEC 31
59#define SO_PASSSEC 34
60#define SO_TIMESTAMPNS 35
61#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
62
63#define SO_MARK 36
64
65#define SO_TIMESTAMPING 37
66#define SCM_TIMESTAMPING SO_TIMESTAMPING
67
68#define SO_PROTOCOL 38
69#define SO_DOMAIN 39
70
71#define SO_RXQ_OVFL 40
72
73#define SO_WIFI_STATUS 41
74#define SCM_WIFI_STATUS SO_WIFI_STATUS
75#define SO_PEEK_OFF 42
76
77/* Instruct lower device to use last 4-bytes of skb data as FCS */
78#define SO_NOFCS 43
79
80#define SO_LOCK_FILTER 44
81
82#define SO_SELECT_ERR_QUEUE 45
83
84#define SO_BUSY_POLL 46
85
86#define SO_MAX_PACING_RATE 47
87
88#define SO_BPF_EXTENSIONS 48
89
90#define SO_INCOMING_CPU 49
91
92#define SO_ATTACH_BPF 50
93#define SO_DETACH_BPF SO_DETACH_FILTER
94
95#define SO_ATTACH_REUSEPORT_CBPF 51
96#define SO_ATTACH_REUSEPORT_EBPF 52
97
98#define SO_CNX_ADVICE 53
99
100#define SCM_TIMESTAMPING_OPT_STATS 54
101
102#define SO_MEMINFO 55
103
104#define SO_INCOMING_NAPI_ID 56
105
106#define SO_COOKIE 57
107
108#define SCM_TIMESTAMPING_PKTINFO 58
109
110#define SO_PEERGROUPS 59
111
112#define SO_ZEROCOPY 60
113
114#define SO_TXTIME 61
115#define SCM_TXTIME SO_TXTIME
116
117#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_32.h+58
...@@ -363,5 +363,63 @@...@@ -363,5 +363,63 @@
363#define __NR_kexec_file_load 381363#define __NR_kexec_file_load 381
364#define __NR_io_pgetevents 382364#define __NR_io_pgetevents 382
365#define __NR_rseq 383365#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_process_mrelease 448
423#define __NR_futex_waitv 449
366424
367#endif /* _ASM_S390_UNISTD_32_H */425#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+39
...@@ -330,5 +330,44 @@...@@ -330,5 +330,44 @@
330#define __NR_kexec_file_load 381330#define __NR_kexec_file_load 381
331#define __NR_io_pgetevents 382331#define __NR_io_pgetevents 382
332#define __NR_rseq 383332#define __NR_rseq 383
333#define __NR_pkey_mprotect 384
334#define __NR_pkey_alloc 385
335#define __NR_pkey_free 386
336#define __NR_semtimedop 392
337#define __NR_semget 393
338#define __NR_semctl 394
339#define __NR_shmget 395
340#define __NR_shmctl 396
341#define __NR_shmat 397
342#define __NR_shmdt 398
343#define __NR_msgget 399
344#define __NR_msgsnd 400
345#define __NR_msgrcv 401
346#define __NR_msgctl 402
347#define __NR_pidfd_send_signal 424
348#define __NR_io_uring_setup 425
349#define __NR_io_uring_enter 426
350#define __NR_io_uring_register 427
351#define __NR_open_tree 428
352#define __NR_move_mount 429
353#define __NR_fsopen 430
354#define __NR_fsconfig 431
355#define __NR_fsmount 432
356#define __NR_fspick 433
357#define __NR_pidfd_open 434
358#define __NR_clone3 435
359#define __NR_close_range 436
360#define __NR_openat2 437
361#define __NR_pidfd_getfd 438
362#define __NR_faccessat2 439
363#define __NR_process_madvise 440
364#define __NR_epoll_pwait2 441
365#define __NR_mount_setattr 442
366#define __NR_quotactl_fd 443
367#define __NR_landlock_create_ruleset 444
368#define __NR_landlock_add_rule 445
369#define __NR_landlock_restrict_self 446
370#define __NR_process_mrelease 448
371#define __NR_futex_waitv 449
333372
334#endif /* _ASM_S390_UNISTD_64_H */373#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/zcrypt.h+112-96
...@@ -2,9 +2,9 @@...@@ -2,9 +2,9 @@
2/*2/*
3 * include/asm-s390/zcrypt.h3 * include/asm-s390/zcrypt.h
4 *4 *
5 * zcrypt 2.1.0 (user-visible header)5 * zcrypt 2.2.1 (user-visible header)
6 *6 *
7 * Copyright IBM Corp. 2001, 20067 * Copyright IBM Corp. 2001, 2019
8 * Author(s): Robert Burroughs8 * Author(s): Robert Burroughs
9 * Eric Rossman (edrossma@us.ibm.com)9 * Eric Rossman (edrossma@us.ibm.com)
10 *10 *
...@@ -15,11 +15,15 @@...@@ -15,11 +15,15 @@
15#define __ASM_S390_ZCRYPT_H15#define __ASM_S390_ZCRYPT_H
1616
17#define ZCRYPT_VERSION 217#define ZCRYPT_VERSION 2
18#define ZCRYPT_RELEASE 118#define ZCRYPT_RELEASE 2
19#define ZCRYPT_VARIANT 119#define ZCRYPT_VARIANT 1
2020
21#include <linux/ioctl.h>21#include <linux/ioctl.h>
2222
23#include <linux/types.h>
24
25/* Name of the zcrypt device driver. */
26#define ZCRYPT_NAME "zcrypt"
2327
24/**28/**
25 * struct ica_rsa_modexpo29 * struct ica_rsa_modexpo
...@@ -32,12 +36,12 @@...@@ -32,12 +36,12 @@
32 * - length(n_modulus) = inputdatalength36 * - length(n_modulus) = inputdatalength
33 */37 */
34struct ica_rsa_modexpo {38struct ica_rsa_modexpo {
35 char *inputdata;39 __u8 *inputdata;
36 unsigned int inputdatalength;40 __u32 inputdatalength;
37 char *outputdata;41 __u8 *outputdata;
38 unsigned int outputdatalength;42 __u32 outputdatalength;
39 char *b_key;43 __u8 *b_key;
40 char *n_modulus;44 __u8 *n_modulus;
41};45};
4246
43/**47/**
...@@ -55,15 +59,15 @@ struct ica_rsa_modexpo {...@@ -55,15 +59,15 @@ struct ica_rsa_modexpo {
55 * - length(u_mult_inv) = inputdatalength/2 + 859 * - length(u_mult_inv) = inputdatalength/2 + 8
56 */60 */
57struct ica_rsa_modexpo_crt {61struct ica_rsa_modexpo_crt {
58 char *inputdata;62 __u8 *inputdata;
59 unsigned int inputdatalength;63 __u32 inputdatalength;
60 char *outputdata;64 __u8 *outputdata;
61 unsigned int outputdatalength;65 __u32 outputdatalength;
62 char *bp_key;66 __u8 *bp_key;
63 char *bq_key;67 __u8 *bq_key;
64 char *np_prime;68 __u8 *np_prime;
65 char *nq_prime;69 __u8 *nq_prime;
66 char *u_mult_inv;70 __u8 *u_mult_inv;
67};71};
6872
69/**73/**
...@@ -79,67 +83,67 @@ struct ica_rsa_modexpo_crt {...@@ -79,67 +83,67 @@ struct ica_rsa_modexpo_crt {
79 * key block83 * key block
80 */84 */
81struct CPRBX {85struct CPRBX {
82 unsigned short cprb_len; /* CPRB length 220 */86 __u16 cprb_len; /* CPRB length 220 */
83 unsigned char cprb_ver_id; /* CPRB version id. 0x02 */87 __u8 cprb_ver_id; /* CPRB version id. 0x02 */
84 unsigned char pad_000[3]; /* Alignment pad bytes */88 __u8 pad_000[3]; /* Alignment pad bytes */
85 unsigned char func_id[2]; /* function id 0x5432 */89 __u8 func_id[2]; /* function id 0x5432 */
86 unsigned char cprb_flags[4]; /* Flags */90 __u8 cprb_flags[4]; /* Flags */
87 unsigned int req_parml; /* request parameter buffer len */91 __u32 req_parml; /* request parameter buffer len */
88 unsigned int req_datal; /* request data buffer */92 __u32 req_datal; /* request data buffer */
89 unsigned int rpl_msgbl; /* reply message block length */93 __u32 rpl_msgbl; /* reply message block length */
90 unsigned int rpld_parml; /* replied parameter block len */94 __u32 rpld_parml; /* replied parameter block len */
91 unsigned int rpl_datal; /* reply data block len */95 __u32 rpl_datal; /* reply data block len */
92 unsigned int rpld_datal; /* replied data block len */96 __u32 rpld_datal; /* replied data block len */
93 unsigned int req_extbl; /* request extension block len */97 __u32 req_extbl; /* request extension block len */
94 unsigned char pad_001[4]; /* reserved */98 __u8 pad_001[4]; /* reserved */
95 unsigned int rpld_extbl; /* replied extension block len */99 __u32 rpld_extbl; /* replied extension block len */
96 unsigned char padx000[16 - sizeof(char *)];100 __u8 padx000[16 - sizeof(__u8 *)];
97 unsigned char *req_parmb; /* request parm block 'address' */101 __u8 *req_parmb; /* request parm block 'address' */
98 unsigned char padx001[16 - sizeof(char *)];102 __u8 padx001[16 - sizeof(__u8 *)];
99 unsigned char *req_datab; /* request data block 'address' */103 __u8 *req_datab; /* request data block 'address' */
100 unsigned char padx002[16 - sizeof(char *)];104 __u8 padx002[16 - sizeof(__u8 *)];
101 unsigned char *rpl_parmb; /* reply parm block 'address' */105 __u8 *rpl_parmb; /* reply parm block 'address' */
102 unsigned char padx003[16 - sizeof(char *)];106 __u8 padx003[16 - sizeof(__u8 *)];
103 unsigned char *rpl_datab; /* reply data block 'address' */107 __u8 *rpl_datab; /* reply data block 'address' */
104 unsigned char padx004[16 - sizeof(char *)];108 __u8 padx004[16 - sizeof(__u8 *)];
105 unsigned char *req_extb; /* request extension block 'addr'*/109 __u8 *req_extb; /* request extension block 'addr'*/
106 unsigned char padx005[16 - sizeof(char *)];110 __u8 padx005[16 - sizeof(__u8 *)];
107 unsigned char *rpl_extb; /* reply extension block 'address'*/111 __u8 *rpl_extb; /* reply extension block 'address'*/
108 unsigned short ccp_rtcode; /* server return code */112 __u16 ccp_rtcode; /* server return code */
109 unsigned short ccp_rscode; /* server reason code */113 __u16 ccp_rscode; /* server reason code */
110 unsigned int mac_data_len; /* Mac Data Length */114 __u32 mac_data_len; /* Mac Data Length */
111 unsigned char logon_id[8]; /* Logon Identifier */115 __u8 logon_id[8]; /* Logon Identifier */
112 unsigned char mac_value[8]; /* Mac Value */116 __u8 mac_value[8]; /* Mac Value */
113 unsigned char mac_content_flgs;/* Mac content flag byte */117 __u8 mac_content_flgs; /* Mac content flag byte */
114 unsigned char pad_002; /* Alignment */118 __u8 pad_002; /* Alignment */
115 unsigned short domain; /* Domain */119 __u16 domain; /* Domain */
116 unsigned char usage_domain[4];/* Usage domain */120 __u8 usage_domain[4]; /* Usage domain */
117 unsigned char cntrl_domain[4];/* Control domain */121 __u8 cntrl_domain[4]; /* Control domain */
118 unsigned char S390enf_mask[4];/* S/390 enforcement mask */122 __u8 S390enf_mask[4]; /* S/390 enforcement mask */
119 unsigned char pad_004[36]; /* reserved */123 __u8 pad_004[36]; /* reserved */
120} __attribute__((packed));124} __attribute__((packed));
121125
122/**126/**
123 * xcRB127 * xcRB
124 */128 */
125struct ica_xcRB {129struct ica_xcRB {
126 unsigned short agent_ID;130 __u16 agent_ID;
127 unsigned int user_defined;131 __u32 user_defined;
128 unsigned short request_ID;132 __u16 request_ID;
129 unsigned int request_control_blk_length;133 __u32 request_control_blk_length;
130 unsigned char padding1[16 - sizeof(char *)];134 __u8 _padding1[16 - sizeof(__u8 *)];
131 char *request_control_blk_addr;135 __u8 *request_control_blk_addr;
132 unsigned int request_data_length;136 __u32 request_data_length;
133 char padding2[16 - sizeof(char *)];137 __u8 _padding2[16 - sizeof(__u8 *)];
134 char *request_data_address;138 __u8 *request_data_address;
135 unsigned int reply_control_blk_length;139 __u32 reply_control_blk_length;
136 char padding3[16 - sizeof(char *)];140 __u8 _padding3[16 - sizeof(__u8 *)];
137 char *reply_control_blk_addr;141 __u8 *reply_control_blk_addr;
138 unsigned int reply_data_length;142 __u32 reply_data_length;
139 char padding4[16 - sizeof(char *)];143 __u8 __padding4[16 - sizeof(__u8 *)];
140 char *reply_data_addr;144 __u8 *reply_data_addr;
141 unsigned short priority_window;145 __u16 priority_window;
142 unsigned int status;146 __u32 status;
143} __attribute__((packed));147} __attribute__((packed));
144148
145/**149/**
...@@ -157,17 +161,17 @@ struct ica_xcRB {...@@ -157,17 +161,17 @@ struct ica_xcRB {
157 * @payload_len: Payload length161 * @payload_len: Payload length
158 */162 */
159struct ep11_cprb {163struct ep11_cprb {
160 uint16_t cprb_len;164 __u16 cprb_len;
161 unsigned char cprb_ver_id;165 __u8 cprb_ver_id;
162 unsigned char pad_000[2];166 __u8 pad_000[2];
163 unsigned char flags;167 __u8 flags;
164 unsigned char func_id[2];168 __u8 func_id[2];
165 uint32_t source_id;169 __u32 source_id;
166 uint32_t target_id;170 __u32 target_id;
167 uint32_t ret_code;171 __u32 ret_code;
168 uint32_t reserved1;172 __u32 reserved1;
169 uint32_t reserved2;173 __u32 reserved2;
170 uint32_t payload_len;174 __u32 payload_len;
171} __attribute__((packed));175} __attribute__((packed));
172176
173/**177/**
...@@ -176,8 +180,8 @@ struct ep11_cprb {...@@ -176,8 +180,8 @@ struct ep11_cprb {
176 * @dom_id: Usage domain id180 * @dom_id: Usage domain id
177 */181 */
178struct ep11_target_dev {182struct ep11_target_dev {
179 uint16_t ap_id;183 __u16 ap_id;
180 uint16_t dom_id;184 __u16 dom_id;
181};185};
182186
183/**187/**
...@@ -192,14 +196,14 @@ struct ep11_target_dev {...@@ -192,14 +196,14 @@ struct ep11_target_dev {
192 * @resp: Addr to response block196 * @resp: Addr to response block
193 */197 */
194struct ep11_urb {198struct ep11_urb {
195 uint16_t targets_num;199 __u16 targets_num;
196 uint64_t targets;200 __u8 *targets;
197 uint64_t weight;201 __u64 weight;
198 uint64_t req_no;202 __u64 req_no;
199 uint64_t req_len;203 __u64 req_len;
200 uint64_t req;204 __u8 *req;
201 uint64_t resp_len;205 __u64 resp_len;
202 uint64_t resp;206 __u8 *resp;
203} __attribute__((packed));207} __attribute__((packed));
204208
205/**209/**
...@@ -233,7 +237,9 @@ struct zcrypt_device_matrix_ext {...@@ -233,7 +237,9 @@ struct zcrypt_device_matrix_ext {
233 struct zcrypt_device_status_ext device[MAX_ZDEV_ENTRIES_EXT];237 struct zcrypt_device_status_ext device[MAX_ZDEV_ENTRIES_EXT];
234};238};
235239
236#define AUTOSELECT 0xFFFFFFFF240#define AUTOSELECT 0xFFFFFFFF
241#define AUTOSEL_AP ((__u16) 0xFFFF)
242#define AUTOSEL_DOM ((__u16) 0xFFFF)
237243
238#define ZCRYPT_IOCTL_MAGIC 'z'244#define ZCRYPT_IOCTL_MAGIC 'z'
239245
...@@ -282,7 +288,7 @@ struct zcrypt_device_matrix_ext {...@@ -282,7 +288,7 @@ struct zcrypt_device_matrix_ext {
282 * 0x08: CEX3A288 * 0x08: CEX3A
283 * 0x0a: CEX4289 * 0x0a: CEX4
284 * 0x0b: CEX5290 * 0x0b: CEX5
285 * 0x0c: CEX6291 * 0x0c: CEX6 and CEX7
286 * 0x0d: device is disabled292 * 0x0d: device is disabled
287 *293 *
288 * ZCRYPT_QDEPTH_MASK294 * ZCRYPT_QDEPTH_MASK
...@@ -309,6 +315,16 @@ struct zcrypt_device_matrix_ext {...@@ -309,6 +315,16 @@ struct zcrypt_device_matrix_ext {
309#define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])315#define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])
310#define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])316#define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])
311317
318/*
319 * Support for multiple zcrypt device nodes.
320 */
321
322/* Nr of minor device node numbers to allocate. */
323#define ZCRYPT_MAX_MINOR_NODES 256
324
325/* Max amount of possible ioctls */
326#define MAX_ZDEV_IOCTLS (1 << _IOC_NRBITS)
327
312/*328/*
313 * Only deprecated defines, structs and ioctls below this line.329 * Only deprecated defines, structs and ioctls below this line.
314 */330 */
lib/libc/include/sparc-linux-any/asm/apc.h created+65
...@@ -0,0 +1,65 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* apc - Driver definitions for power management functions
3 * of Aurora Personality Chip (APC) on SPARCstation-4/5 and
4 * derivatives
5 *
6 * Copyright (c) 2001 Eric Brower (ebrower@usa.net)
7 *
8 */
9
10#ifndef _SPARC_APC_H
11#define _SPARC_APC_H
12
13#include <linux/ioctl.h>
14
15#define APC_IOC 'A'
16
17#define APCIOCGFANCTL _IOR(APC_IOC, 0x00, int) /* Get fan speed */
18#define APCIOCSFANCTL _IOW(APC_IOC, 0x01, int) /* Set fan speed */
19
20#define APCIOCGCPWR _IOR(APC_IOC, 0x02, int) /* Get CPOWER state */
21#define APCIOCSCPWR _IOW(APC_IOC, 0x03, int) /* Set CPOWER state */
22
23#define APCIOCGBPORT _IOR(APC_IOC, 0x04, int) /* Get BPORT state */
24#define APCIOCSBPORT _IOW(APC_IOC, 0x05, int) /* Set BPORT state */
25
26/*
27 * Register offsets
28 */
29#define APC_IDLE_REG 0x00
30#define APC_FANCTL_REG 0x20
31#define APC_CPOWER_REG 0x24
32#define APC_BPORT_REG 0x30
33
34#define APC_REGMASK 0x01
35#define APC_BPMASK 0x03
36
37/*
38 * IDLE - CPU standby values (set to initiate standby)
39 */
40#define APC_IDLE_ON 0x01
41
42/*
43 * FANCTL - Fan speed control state values
44 */
45#define APC_FANCTL_HI 0x00 /* Fan speed high */
46#define APC_FANCTL_LO 0x01 /* Fan speed low */
47
48/*
49 * CPWR - Convenience power outlet state values
50 */
51#define APC_CPOWER_ON 0x00 /* Conv power on */
52#define APC_CPOWER_OFF 0x01 /* Conv power off */
53
54/*
55 * BPA/BPB - Read-Write "Bit Ports" state values (reset to 0 at power-on)
56 *
57 * WARNING: Internal usage of bit ports is platform dependent--
58 * don't modify BPORT settings unless you know what you are doing.
59 *
60 * On SS5 BPA seems to toggle onboard ethernet loopback... -E
61 */
62#define APC_BPORT_A 0x01 /* Bit Port A */
63#define APC_BPORT_B 0x02 /* Bit Port B */
64
65#endif /* !(_SPARC_APC_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/asi.h created+303
...@@ -0,0 +1,303 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_ASI_H
3#define _SPARC_ASI_H
4
5/* asi.h: Address Space Identifier values for the sparc.
6 *
7 * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
8 *
9 * Pioneer work for sun4m: Paul Hatchman (paul@sfe.com.au)
10 * Joint edition for sun4c+sun4m: Pete A. Zaitcev <zaitcev@ipmce.su>
11 */
12
13/* The first batch are for the sun4c. */
14
15#define ASI_NULL1 0x00
16#define ASI_NULL2 0x01
17
18/* sun4c and sun4 control registers and mmu/vac ops */
19#define ASI_CONTROL 0x02
20#define ASI_SEGMAP 0x03
21#define ASI_PTE 0x04
22#define ASI_HWFLUSHSEG 0x05
23#define ASI_HWFLUSHPAGE 0x06
24#define ASI_REGMAP 0x06
25#define ASI_HWFLUSHCONTEXT 0x07
26
27#define ASI_USERTXT 0x08
28#define ASI_KERNELTXT 0x09
29#define ASI_USERDATA 0x0a
30#define ASI_KERNELDATA 0x0b
31
32/* VAC Cache flushing on sun4c and sun4 */
33#define ASI_FLUSHSEG 0x0c
34#define ASI_FLUSHPG 0x0d
35#define ASI_FLUSHCTX 0x0e
36
37/* SPARCstation-5: only 6 bits are decoded. */
38/* wo = Write Only, rw = Read Write; */
39/* ss = Single Size, as = All Sizes; */
40#define ASI_M_RES00 0x00 /* Don't touch... */
41#define ASI_M_UNA01 0x01 /* Same here... */
42#define ASI_M_MXCC 0x02 /* Access to TI VIKING MXCC registers */
43#define ASI_M_FLUSH_PROBE 0x03 /* Reference MMU Flush/Probe; rw, ss */
44#define ASI_M_MMUREGS 0x04 /* MMU Registers; rw, ss */
45#define ASI_M_TLBDIAG 0x05 /* MMU TLB only Diagnostics */
46#define ASI_M_DIAGS 0x06 /* Reference MMU Diagnostics */
47#define ASI_M_IODIAG 0x07 /* MMU I/O TLB only Diagnostics */
48#define ASI_M_USERTXT 0x08 /* Same as ASI_USERTXT; rw, as */
49#define ASI_M_KERNELTXT 0x09 /* Same as ASI_KERNELTXT; rw, as */
50#define ASI_M_USERDATA 0x0A /* Same as ASI_USERDATA; rw, as */
51#define ASI_M_KERNELDATA 0x0B /* Same as ASI_KERNELDATA; rw, as */
52#define ASI_M_TXTC_TAG 0x0C /* Instruction Cache Tag; rw, ss */
53#define ASI_M_TXTC_DATA 0x0D /* Instruction Cache Data; rw, ss */
54#define ASI_M_DATAC_TAG 0x0E /* Data Cache Tag; rw, ss */
55#define ASI_M_DATAC_DATA 0x0F /* Data Cache Data; rw, ss */
56
57/* The following cache flushing ASIs work only with the 'sta'
58 * instruction. Results are unpredictable for 'swap' and 'ldstuba',
59 * so don't do it.
60 */
61
62/* These ASI flushes affect external caches too. */
63#define ASI_M_FLUSH_PAGE 0x10 /* Flush I&D Cache Line (page); wo, ss */
64#define ASI_M_FLUSH_SEG 0x11 /* Flush I&D Cache Line (seg); wo, ss */
65#define ASI_M_FLUSH_REGION 0x12 /* Flush I&D Cache Line (region); wo, ss */
66#define ASI_M_FLUSH_CTX 0x13 /* Flush I&D Cache Line (context); wo, ss */
67#define ASI_M_FLUSH_USER 0x14 /* Flush I&D Cache Line (user); wo, ss */
68
69/* Block-copy operations are available only on certain V8 cpus. */
70#define ASI_M_BCOPY 0x17 /* Block copy */
71
72/* These affect only the ICACHE and are Ross HyperSparc and TurboSparc specific. */
73#define ASI_M_IFLUSH_PAGE 0x18 /* Flush I Cache Line (page); wo, ss */
74#define ASI_M_IFLUSH_SEG 0x19 /* Flush I Cache Line (seg); wo, ss */
75#define ASI_M_IFLUSH_REGION 0x1A /* Flush I Cache Line (region); wo, ss */
76#define ASI_M_IFLUSH_CTX 0x1B /* Flush I Cache Line (context); wo, ss */
77#define ASI_M_IFLUSH_USER 0x1C /* Flush I Cache Line (user); wo, ss */
78
79/* Block-fill operations are available on certain V8 cpus */
80#define ASI_M_BFILL 0x1F
81
82/* This allows direct access to main memory, actually 0x20 to 0x2f are
83 * the available ASI's for physical ram pass-through, but I don't have
84 * any idea what the other ones do....
85 */
86
87#define ASI_M_BYPASS 0x20 /* Reference MMU bypass; rw, as */
88#define ASI_M_FBMEM 0x29 /* Graphics card frame buffer access */
89#define ASI_M_VMEUS 0x2A /* VME user 16-bit access */
90#define ASI_M_VMEPS 0x2B /* VME priv 16-bit access */
91#define ASI_M_VMEUT 0x2C /* VME user 32-bit access */
92#define ASI_M_VMEPT 0x2D /* VME priv 32-bit access */
93#define ASI_M_SBUS 0x2E /* Direct SBus access */
94#define ASI_M_CTL 0x2F /* Control Space (ECC and MXCC are here) */
95
96
97/* This is ROSS HyperSparc only. */
98#define ASI_M_FLUSH_IWHOLE 0x31 /* Flush entire ICACHE; wo, ss */
99
100/* Tsunami/Viking/TurboSparc i/d cache flash clear. */
101#define ASI_M_IC_FLCLEAR 0x36
102#define ASI_M_DC_FLCLEAR 0x37
103
104#define ASI_M_DCDR 0x39 /* Data Cache Diagnostics Register rw, ss */
105
106#define ASI_M_VIKING_TMP1 0x40 /* Emulation temporary 1 on Viking */
107/* only available on SuperSparc I */
108/* #define ASI_M_VIKING_TMP2 0x41 */ /* Emulation temporary 2 on Viking */
109
110#define ASI_M_ACTION 0x4c /* Breakpoint Action Register (GNU/Viking) */
111
112/* LEON ASI */
113#define ASI_LEON_NOCACHE 0x01
114
115#define ASI_LEON_DCACHE_MISS 0x01
116
117#define ASI_LEON_CACHEREGS 0x02
118#define ASI_LEON_IFLUSH 0x10
119#define ASI_LEON_DFLUSH 0x11
120
121#define ASI_LEON_MMUFLUSH 0x18
122#define ASI_LEON_MMUREGS 0x19
123#define ASI_LEON_BYPASS 0x1c
124#define ASI_LEON_FLUSH_PAGE 0x10
125
126/* V9 Architecture mandary ASIs. */
127#define ASI_N 0x04 /* Nucleus */
128#define ASI_NL 0x0c /* Nucleus, little endian */
129#define ASI_AIUP 0x10 /* Primary, user */
130#define ASI_AIUS 0x11 /* Secondary, user */
131#define ASI_AIUPL 0x18 /* Primary, user, little endian */
132#define ASI_AIUSL 0x19 /* Secondary, user, little endian */
133#define ASI_P 0x80 /* Primary, implicit */
134#define ASI_S 0x81 /* Secondary, implicit */
135#define ASI_PNF 0x82 /* Primary, no fault */
136#define ASI_SNF 0x83 /* Secondary, no fault */
137#define ASI_PL 0x88 /* Primary, implicit, l-endian */
138#define ASI_SL 0x89 /* Secondary, implicit, l-endian */
139#define ASI_PNFL 0x8a /* Primary, no fault, l-endian */
140#define ASI_SNFL 0x8b /* Secondary, no fault, l-endian */
141
142/* SpitFire and later extended ASIs. The "(III)" marker designates
143 * UltraSparc-III and later specific ASIs. The "(CMT)" marker designates
144 * Chip Multi Threading specific ASIs. "(NG)" designates Niagara specific
145 * ASIs, "(4V)" designates SUN4V specific ASIs. "(NG4)" designates SPARC-T4
146 * and later ASIs.
147 */
148#define ASI_MCD_PRIV_PRIMARY 0x02 /* (NG7) Privileged MCD version VA */
149#define ASI_MCD_REAL 0x05 /* (NG7) Privileged MCD version PA */
150#define ASI_PHYS_USE_EC 0x14 /* PADDR, E-cachable */
151#define ASI_PHYS_BYPASS_EC_E 0x15 /* PADDR, E-bit */
152#define ASI_BLK_AIUP_4V 0x16 /* (4V) Prim, user, block ld/st */
153#define ASI_BLK_AIUS_4V 0x17 /* (4V) Sec, user, block ld/st */
154#define ASI_PHYS_USE_EC_L 0x1c /* PADDR, E-cachable, little endian*/
155#define ASI_PHYS_BYPASS_EC_E_L 0x1d /* PADDR, E-bit, little endian */
156#define ASI_BLK_AIUP_L_4V 0x1e /* (4V) Prim, user, block, l-endian*/
157#define ASI_BLK_AIUS_L_4V 0x1f /* (4V) Sec, user, block, l-endian */
158#define ASI_SCRATCHPAD 0x20 /* (4V) Scratch Pad Registers */
159#define ASI_MMU 0x21 /* (4V) MMU Context Registers */
160#define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23 /* (NG) init-store, twin load,
161 * secondary, user
162 */
163#define ASI_NUCLEUS_QUAD_LDD 0x24 /* Cachable, qword load */
164#define ASI_QUEUE 0x25 /* (4V) Interrupt Queue Registers */
165#define ASI_QUAD_LDD_PHYS_4V 0x26 /* (4V) Physical, qword load */
166#define ASI_NUCLEUS_QUAD_LDD_L 0x2c /* Cachable, qword load, l-endian */
167#define ASI_QUAD_LDD_PHYS_L_4V 0x2e /* (4V) Phys, qword load, l-endian */
168#define ASI_PCACHE_DATA_STATUS 0x30 /* (III) PCache data stat RAM diag */
169#define ASI_PCACHE_DATA 0x31 /* (III) PCache data RAM diag */
170#define ASI_PCACHE_TAG 0x32 /* (III) PCache tag RAM diag */
171#define ASI_PCACHE_SNOOP_TAG 0x33 /* (III) PCache snoop tag RAM diag */
172#define ASI_QUAD_LDD_PHYS 0x34 /* (III+) PADDR, qword load */
173#define ASI_WCACHE_VALID_BITS 0x38 /* (III) WCache Valid Bits diag */
174#define ASI_WCACHE_DATA 0x39 /* (III) WCache data RAM diag */
175#define ASI_WCACHE_TAG 0x3a /* (III) WCache tag RAM diag */
176#define ASI_WCACHE_SNOOP_TAG 0x3b /* (III) WCache snoop tag RAM diag */
177#define ASI_QUAD_LDD_PHYS_L 0x3c /* (III+) PADDR, qw-load, l-endian */
178#define ASI_SRAM_FAST_INIT 0x40 /* (III+) Fast SRAM init */
179#define ASI_CORE_AVAILABLE 0x41 /* (CMT) LP Available */
180#define ASI_CORE_ENABLE_STAT 0x41 /* (CMT) LP Enable Status */
181#define ASI_CORE_ENABLE 0x41 /* (CMT) LP Enable RW */
182#define ASI_XIR_STEERING 0x41 /* (CMT) XIR Steering RW */
183#define ASI_CORE_RUNNING_RW 0x41 /* (CMT) LP Running RW */
184#define ASI_CORE_RUNNING_W1S 0x41 /* (CMT) LP Running Write-One Set */
185#define ASI_CORE_RUNNING_W1C 0x41 /* (CMT) LP Running Write-One Clr */
186#define ASI_CORE_RUNNING_STAT 0x41 /* (CMT) LP Running Status */
187#define ASI_CMT_ERROR_STEERING 0x41 /* (CMT) Error Steering RW */
188#define ASI_DCACHE_INVALIDATE 0x42 /* (III) DCache Invalidate diag */
189#define ASI_DCACHE_UTAG 0x43 /* (III) DCache uTag diag */
190#define ASI_DCACHE_SNOOP_TAG 0x44 /* (III) DCache snoop tag RAM diag */
191#define ASI_LSU_CONTROL 0x45 /* Load-store control unit */
192#define ASI_DCU_CONTROL_REG 0x45 /* (III) DCache Unit Control reg */
193#define ASI_DCACHE_DATA 0x46 /* DCache data-ram diag access */
194#define ASI_DCACHE_TAG 0x47 /* Dcache tag/valid ram diag access*/
195#define ASI_INTR_DISPATCH_STAT 0x48 /* IRQ vector dispatch status */
196#define ASI_INTR_RECEIVE 0x49 /* IRQ vector receive status */
197#define ASI_UPA_CONFIG 0x4a /* UPA config space */
198#define ASI_JBUS_CONFIG 0x4a /* (IIIi) JBUS Config Register */
199#define ASI_SAFARI_CONFIG 0x4a /* (III) Safari Config Register */
200#define ASI_SAFARI_ADDRESS 0x4a /* (III) Safari Address Register */
201#define ASI_ESTATE_ERROR_EN 0x4b /* E-cache error enable space */
202#define ASI_AFSR 0x4c /* Async fault status register */
203#define ASI_AFAR 0x4d /* Async fault address register */
204#define ASI_EC_TAG_DATA 0x4e /* E-cache tag/valid ram diag acc */
205#define ASI_IMMU 0x50 /* Insn-MMU main register space */
206#define ASI_IMMU_TSB_8KB_PTR 0x51 /* Insn-MMU 8KB TSB pointer reg */
207#define ASI_IMMU_TSB_64KB_PTR 0x52 /* Insn-MMU 64KB TSB pointer reg */
208#define ASI_ITLB_DATA_IN 0x54 /* Insn-MMU TLB data in reg */
209#define ASI_ITLB_DATA_ACCESS 0x55 /* Insn-MMU TLB data access reg */
210#define ASI_ITLB_TAG_READ 0x56 /* Insn-MMU TLB tag read reg */
211#define ASI_IMMU_DEMAP 0x57 /* Insn-MMU TLB demap */
212#define ASI_DMMU 0x58 /* Data-MMU main register space */
213#define ASI_DMMU_TSB_8KB_PTR 0x59 /* Data-MMU 8KB TSB pointer reg */
214#define ASI_DMMU_TSB_64KB_PTR 0x5a /* Data-MMU 16KB TSB pointer reg */
215#define ASI_DMMU_TSB_DIRECT_PTR 0x5b /* Data-MMU TSB direct pointer reg */
216#define ASI_DTLB_DATA_IN 0x5c /* Data-MMU TLB data in reg */
217#define ASI_DTLB_DATA_ACCESS 0x5d /* Data-MMU TLB data access reg */
218#define ASI_DTLB_TAG_READ 0x5e /* Data-MMU TLB tag read reg */
219#define ASI_DMMU_DEMAP 0x5f /* Data-MMU TLB demap */
220#define ASI_IIU_INST_TRAP 0x60 /* (III) Instruction Breakpoint */
221#define ASI_INTR_ID 0x63 /* (CMT) Interrupt ID register */
222#define ASI_CORE_ID 0x63 /* (CMT) LP ID register */
223#define ASI_CESR_ID 0x63 /* (CMT) CESR ID register */
224#define ASI_IC_INSTR 0x66 /* Insn cache instrucion ram diag */
225#define ASI_IC_TAG 0x67 /* Insn cache tag/valid ram diag */
226#define ASI_IC_STAG 0x68 /* (III) Insn cache snoop tag ram */
227#define ASI_IC_PRE_DECODE 0x6e /* Insn cache pre-decode ram diag */
228#define ASI_IC_NEXT_FIELD 0x6f /* Insn cache next-field ram diag */
229#define ASI_BRPRED_ARRAY 0x6f /* (III) Branch Prediction RAM diag*/
230#define ASI_BLK_AIUP 0x70 /* Primary, user, block load/store */
231#define ASI_BLK_AIUS 0x71 /* Secondary, user, block ld/st */
232#define ASI_MCU_CTRL_REG 0x72 /* (III) Memory controller regs */
233#define ASI_EC_DATA 0x74 /* (III) E-cache data staging reg */
234#define ASI_EC_CTRL 0x75 /* (III) E-cache control reg */
235#define ASI_EC_W 0x76 /* E-cache diag write access */
236#define ASI_UDB_ERROR_W 0x77 /* External UDB error regs W */
237#define ASI_UDB_CONTROL_W 0x77 /* External UDB control regs W */
238#define ASI_INTR_W 0x77 /* IRQ vector dispatch write */
239#define ASI_INTR_DATAN_W 0x77 /* (III) Out irq vector data reg N */
240#define ASI_INTR_DISPATCH_W 0x77 /* (III) Interrupt vector dispatch */
241#define ASI_BLK_AIUPL 0x78 /* Primary, user, little, blk ld/st*/
242#define ASI_BLK_AIUSL 0x79 /* Secondary, user, little, blk ld/st*/
243#define ASI_EC_R 0x7e /* E-cache diag read access */
244#define ASI_UDBH_ERROR_R 0x7f /* External UDB error regs rd hi */
245#define ASI_UDBL_ERROR_R 0x7f /* External UDB error regs rd low */
246#define ASI_UDBH_CONTROL_R 0x7f /* External UDB control regs rd hi */
247#define ASI_UDBL_CONTROL_R 0x7f /* External UDB control regs rd low*/
248#define ASI_INTR_R 0x7f /* IRQ vector dispatch read */
249#define ASI_INTR_DATAN_R 0x7f /* (III) In irq vector data reg N */
250#define ASI_MCD_PRIMARY 0x90 /* (NG7) MCD version load/store */
251#define ASI_MCD_ST_BLKINIT_PRIMARY \
252 0x92 /* (NG7) MCD store BLKINIT primary */
253#define ASI_PIC 0xb0 /* (NG4) PIC registers */
254#define ASI_PST8_P 0xc0 /* Primary, 8 8-bit, partial */
255#define ASI_PST8_S 0xc1 /* Secondary, 8 8-bit, partial */
256#define ASI_PST16_P 0xc2 /* Primary, 4 16-bit, partial */
257#define ASI_PST16_S 0xc3 /* Secondary, 4 16-bit, partial */
258#define ASI_PST32_P 0xc4 /* Primary, 2 32-bit, partial */
259#define ASI_PST32_S 0xc5 /* Secondary, 2 32-bit, partial */
260#define ASI_PST8_PL 0xc8 /* Primary, 8 8-bit, partial, L */
261#define ASI_PST8_SL 0xc9 /* Secondary, 8 8-bit, partial, L */
262#define ASI_PST16_PL 0xca /* Primary, 4 16-bit, partial, L */
263#define ASI_PST16_SL 0xcb /* Secondary, 4 16-bit, partial, L */
264#define ASI_PST32_PL 0xcc /* Primary, 2 32-bit, partial, L */
265#define ASI_PST32_SL 0xcd /* Secondary, 2 32-bit, partial, L */
266#define ASI_FL8_P 0xd0 /* Primary, 1 8-bit, fpu ld/st */
267#define ASI_FL8_S 0xd1 /* Secondary, 1 8-bit, fpu ld/st */
268#define ASI_FL16_P 0xd2 /* Primary, 1 16-bit, fpu ld/st */
269#define ASI_FL16_S 0xd3 /* Secondary, 1 16-bit, fpu ld/st */
270#define ASI_FL8_PL 0xd8 /* Primary, 1 8-bit, fpu ld/st, L */
271#define ASI_FL8_SL 0xd9 /* Secondary, 1 8-bit, fpu ld/st, L*/
272#define ASI_FL16_PL 0xda /* Primary, 1 16-bit, fpu ld/st, L */
273#define ASI_FL16_SL 0xdb /* Secondary, 1 16-bit, fpu ld/st,L*/
274#define ASI_BLK_COMMIT_P 0xe0 /* Primary, blk store commit */
275#define ASI_BLK_COMMIT_S 0xe1 /* Secondary, blk store commit */
276#define ASI_BLK_INIT_QUAD_LDD_P 0xe2 /* (NG) init-store, twin load,
277 * primary, implicit
278 */
279#define ASI_BLK_INIT_QUAD_LDD_S 0xe3 /* (NG) init-store, twin load,
280 * secondary, implicit
281 */
282#define ASI_BLK_P 0xf0 /* Primary, blk ld/st */
283#define ASI_BLK_S 0xf1 /* Secondary, blk ld/st */
284#define ASI_ST_BLKINIT_MRU_P 0xf2 /* (NG4) init-store, twin load,
285 * Most-Recently-Used, primary,
286 * implicit
287 */
288#define ASI_ST_BLKINIT_MRU_S 0xf3 /* (NG4) init-store, twin load,
289 * Most-Recently-Used, secondary,
290 * implicit
291 */
292#define ASI_BLK_PL 0xf8 /* Primary, blk ld/st, little */
293#define ASI_BLK_SL 0xf9 /* Secondary, blk ld/st, little */
294#define ASI_ST_BLKINIT_MRU_PL 0xfa /* (NG4) init-store, twin load,
295 * Most-Recently-Used, primary,
296 * implicit, little-endian
297 */
298#define ASI_ST_BLKINIT_MRU_SL 0xfb /* (NG4) init-store, twin load,
299 * Most-Recently-Used, secondary,
300 * implicit, little-endian
301 */
302
303#endif /* _SPARC_ASI_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/auxvec.h created+15
...@@ -0,0 +1,15 @@
1#ifndef __ASMSPARC_AUXVEC_H
2#define __ASMSPARC_AUXVEC_H
3
4#define AT_SYSINFO_EHDR 33
5
6/* Avoid overlap with other AT_* values since they are consolidated in
7 * glibc and any overlaps can cause problems
8 */
9#define AT_ADI_BLKSZ 48
10#define AT_ADI_NBITS 49
11#define AT_ADI_UEONADI 50
12
13#define AT_VECTOR_SIZE_ARCH 4
14
15#endif /* !(__ASMSPARC_AUXVEC_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/bitsperlong.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_ALPHA_BITSPERLONG_H
3#define __ASM_ALPHA_BITSPERLONG_H
4
5#if defined(__sparc__) && defined(__arch64__)
6#define __BITS_PER_LONG 64
7#else
8#define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_ALPHA_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/byteorder.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_BYTEORDER_H
3#define _SPARC_BYTEORDER_H
4
5#include <linux/byteorder/big_endian.h>
6
7#endif /* _SPARC_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/display7seg.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 *
4 * display7seg - Driver interface for the 7-segment display
5 * present on Sun Microsystems CP1400 and CP1500
6 *
7 * Copyright (c) 2000 Eric Brower <ebrower@usa.net>
8 *
9 */
10
11#ifndef __display7seg_h__
12#define __display7seg_h__
13
14#define D7S_IOC 'p'
15
16#define D7SIOCRD _IOR(D7S_IOC, 0x45, int) /* Read device state */
17#define D7SIOCWR _IOW(D7S_IOC, 0x46, int) /* Write device state */
18#define D7SIOCTM _IO (D7S_IOC, 0x47) /* Translate mode (FLIP)*/
19
20/*
21 * ioctl flag definitions
22 *
23 * POINT - Toggle decimal point (0=absent 1=present)
24 * ALARM - Toggle alarm LED (0=green 1=red)
25 * FLIP - Toggle inverted mode (0=normal 1=flipped)
26 * bits 0-4 - Character displayed (see definitions below)
27 *
28 * Display segments are defined as follows,
29 * subject to D7S_FLIP register state:
30 *
31 * a
32 * ---
33 * f| |b
34 * -g-
35 * e| |c
36 * ---
37 * d
38 */
39
40#define D7S_POINT (1 << 7) /* Decimal point*/
41#define D7S_ALARM (1 << 6) /* Alarm LED */
42#define D7S_FLIP (1 << 5) /* Flip display */
43
44#define D7S_0 0x00 /* Numerals 0-9 */
45#define D7S_1 0x01
46#define D7S_2 0x02
47#define D7S_3 0x03
48#define D7S_4 0x04
49#define D7S_5 0x05
50#define D7S_6 0x06
51#define D7S_7 0x07
52#define D7S_8 0x08
53#define D7S_9 0x09
54#define D7S_A 0x0A /* Letters A-F, H, L, P */
55#define D7S_B 0x0B
56#define D7S_C 0x0C
57#define D7S_D 0x0D
58#define D7S_E 0x0E
59#define D7S_F 0x0F
60#define D7S_H 0x10
61#define D7S_E2 0x11
62#define D7S_L 0x12
63#define D7S_P 0x13
64#define D7S_SEGA 0x14 /* Individual segments */
65#define D7S_SEGB 0x15
66#define D7S_SEGC 0x16
67#define D7S_SEGD 0x17
68#define D7S_SEGE 0x18
69#define D7S_SEGF 0x19
70#define D7S_SEGG 0x1A
71#define D7S_SEGABFG 0x1B /* Segment groupings */
72#define D7S_SEGCDEG 0x1C
73#define D7S_SEGBCEF 0x1D
74#define D7S_SEGADG 0x1E
75#define D7S_BLANK 0x1F /* Clear all segments */
76
77#define D7S_MIN_VAL 0x0
78#define D7S_MAX_VAL 0x1F
79
80#endif /* ifndef __display7seg_h__ */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/envctrl.h created+104
...@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 *
4 * envctrl.h: Definitions for access to the i2c environment
5 * monitoring on Ultrasparc systems.
6 *
7 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
8 * Copyright (C) 2000 Vinh Truong (vinh.truong@eng.sun.com)
9 * VT - Add all ioctl commands and environment status definitions
10 * VT - Add application note
11 */
12#ifndef _SPARC64_ENVCTRL_H
13#define _SPARC64_ENVCTRL_H 1
14
15#include <linux/ioctl.h>
16
17/* Application note:
18 *
19 * The driver supports 4 operations: open(), close(), ioctl(), read()
20 * The device name is /dev/envctrl.
21 * Below is sample usage:
22 *
23 * fd = open("/dev/envtrl", O_RDONLY);
24 * if (ioctl(fd, ENVCTRL_READ_SHUTDOWN_TEMPERATURE, 0) < 0)
25 * printf("error\n");
26 * ret = read(fd, buf, 10);
27 * close(fd);
28 *
29 * Notice in the case of cpu voltage and temperature, the default is
30 * cpu0. If we need to know the info of cpu1, cpu2, cpu3, we need to
31 * pass in cpu number in ioctl() last parameter. For example, to
32 * get the voltage of cpu2:
33 *
34 * ioctlbuf[0] = 2;
35 * if (ioctl(fd, ENVCTRL_READ_CPU_VOLTAGE, ioctlbuf) < 0)
36 * printf("error\n");
37 * ret = read(fd, buf, 10);
38 *
39 * All the return values are in ascii. So check read return value
40 * and do appropriate conversions in your application.
41 */
42
43/* IOCTL commands */
44
45/* Note: these commands reflect possible monitor features.
46 * Some boards choose to support some of the features only.
47 */
48#define ENVCTRL_RD_CPU_TEMPERATURE _IOR('p', 0x40, int)
49#define ENVCTRL_RD_CPU_VOLTAGE _IOR('p', 0x41, int)
50#define ENVCTRL_RD_FAN_STATUS _IOR('p', 0x42, int)
51#define ENVCTRL_RD_WARNING_TEMPERATURE _IOR('p', 0x43, int)
52#define ENVCTRL_RD_SHUTDOWN_TEMPERATURE _IOR('p', 0x44, int)
53#define ENVCTRL_RD_VOLTAGE_STATUS _IOR('p', 0x45, int)
54#define ENVCTRL_RD_SCSI_TEMPERATURE _IOR('p', 0x46, int)
55#define ENVCTRL_RD_ETHERNET_TEMPERATURE _IOR('p', 0x47, int)
56#define ENVCTRL_RD_MTHRBD_TEMPERATURE _IOR('p', 0x48, int)
57
58#define ENVCTRL_RD_GLOBALADDRESS _IOR('p', 0x49, int)
59
60/* Read return values for a voltage status request. */
61#define ENVCTRL_VOLTAGE_POWERSUPPLY_GOOD 0x01
62#define ENVCTRL_VOLTAGE_BAD 0x02
63#define ENVCTRL_POWERSUPPLY_BAD 0x03
64#define ENVCTRL_VOLTAGE_POWERSUPPLY_BAD 0x04
65
66/* Read return values for a fan status request.
67 * A failure match means either the fan fails or
68 * the fan is not connected. Some boards have optional
69 * connectors to connect extra fans.
70 *
71 * There are maximum 8 monitor fans. Some are cpu fans
72 * some are system fans. The mask below only indicates
73 * fan by order number.
74 * Below is a sample application:
75 *
76 * if (ioctl(fd, ENVCTRL_READ_FAN_STATUS, 0) < 0) {
77 * printf("ioctl fan failed\n");
78 * }
79 * if (read(fd, rslt, 1) <= 0) {
80 * printf("error or fan not monitored\n");
81 * } else {
82 * if (rslt[0] == ENVCTRL_ALL_FANS_GOOD) {
83 * printf("all fans good\n");
84 * } else if (rslt[0] == ENVCTRL_ALL_FANS_BAD) {
85 * printf("all fans bad\n");
86 * } else {
87 * if (rslt[0] & ENVCTRL_FAN0_FAILURE_MASK) {
88 * printf("fan 0 failed or not connected\n");
89 * }
90 * ......
91 */
92
93#define ENVCTRL_ALL_FANS_GOOD 0x00
94#define ENVCTRL_FAN0_FAILURE_MASK 0x01
95#define ENVCTRL_FAN1_FAILURE_MASK 0x02
96#define ENVCTRL_FAN2_FAILURE_MASK 0x04
97#define ENVCTRL_FAN3_FAILURE_MASK 0x08
98#define ENVCTRL_FAN4_FAILURE_MASK 0x10
99#define ENVCTRL_FAN5_FAILURE_MASK 0x20
100#define ENVCTRL_FAN6_FAILURE_MASK 0x40
101#define ENVCTRL_FAN7_FAILURE_MASK 0x80
102#define ENVCTRL_ALL_FANS_BAD 0xFF
103
104#endif /* !(_SPARC64_ENVCTRL_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/errno.h created+118
...@@ -0,0 +1,118 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_ERRNO_H
3#define _SPARC_ERRNO_H
4
5/* These match the SunOS error numbering scheme. */
6
7#include <asm-generic/errno-base.h>
8
9#define EWOULDBLOCK EAGAIN /* Operation would block */
10#define EINPROGRESS 36 /* Operation now in progress */
11#define EALREADY 37 /* Operation already in progress */
12#define ENOTSOCK 38 /* Socket operation on non-socket */
13#define EDESTADDRREQ 39 /* Destination address required */
14#define EMSGSIZE 40 /* Message too long */
15#define EPROTOTYPE 41 /* Protocol wrong type for socket */
16#define ENOPROTOOPT 42 /* Protocol not available */
17#define EPROTONOSUPPORT 43 /* Protocol not supported */
18#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
19#define EOPNOTSUPP 45 /* Op not supported on transport endpoint */
20#define EPFNOSUPPORT 46 /* Protocol family not supported */
21#define EAFNOSUPPORT 47 /* Address family not supported by protocol */
22#define EADDRINUSE 48 /* Address already in use */
23#define EADDRNOTAVAIL 49 /* Cannot assign requested address */
24#define ENETDOWN 50 /* Network is down */
25#define ENETUNREACH 51 /* Network is unreachable */
26#define ENETRESET 52 /* Net dropped connection because of reset */
27#define ECONNABORTED 53 /* Software caused connection abort */
28#define ECONNRESET 54 /* Connection reset by peer */
29#define ENOBUFS 55 /* No buffer space available */
30#define EISCONN 56 /* Transport endpoint is already connected */
31#define ENOTCONN 57 /* Transport endpoint is not connected */
32#define ESHUTDOWN 58 /* No send after transport endpoint shutdown */
33#define ETOOMANYREFS 59 /* Too many references: cannot splice */
34#define ETIMEDOUT 60 /* Connection timed out */
35#define ECONNREFUSED 61 /* Connection refused */
36#define ELOOP 62 /* Too many symbolic links encountered */
37#define ENAMETOOLONG 63 /* File name too long */
38#define EHOSTDOWN 64 /* Host is down */
39#define EHOSTUNREACH 65 /* No route to host */
40#define ENOTEMPTY 66 /* Directory not empty */
41#define EPROCLIM 67 /* SUNOS: Too many processes */
42#define EUSERS 68 /* Too many users */
43#define EDQUOT 69 /* Quota exceeded */
44#define ESTALE 70 /* Stale file handle */
45#define EREMOTE 71 /* Object is remote */
46#define ENOSTR 72 /* Device not a stream */
47#define ETIME 73 /* Timer expired */
48#define ENOSR 74 /* Out of streams resources */
49#define ENOMSG 75 /* No message of desired type */
50#define EBADMSG 76 /* Not a data message */
51#define EIDRM 77 /* Identifier removed */
52#define EDEADLK 78 /* Resource deadlock would occur */
53#define ENOLCK 79 /* No record locks available */
54#define ENONET 80 /* Machine is not on the network */
55#define ERREMOTE 81 /* SunOS: Too many lvls of remote in path */
56#define ENOLINK 82 /* Link has been severed */
57#define EADV 83 /* Advertise error */
58#define ESRMNT 84 /* Srmount error */
59#define ECOMM 85 /* Communication error on send */
60#define EPROTO 86 /* Protocol error */
61#define EMULTIHOP 87 /* Multihop attempted */
62#define EDOTDOT 88 /* RFS specific error */
63#define EREMCHG 89 /* Remote address changed */
64#define ENOSYS 90 /* Function not implemented */
65
66/* The rest have no SunOS equivalent. */
67#define ESTRPIPE 91 /* Streams pipe error */
68#define EOVERFLOW 92 /* Value too large for defined data type */
69#define EBADFD 93 /* File descriptor in bad state */
70#define ECHRNG 94 /* Channel number out of range */
71#define EL2NSYNC 95 /* Level 2 not synchronized */
72#define EL3HLT 96 /* Level 3 halted */
73#define EL3RST 97 /* Level 3 reset */
74#define ELNRNG 98 /* Link number out of range */
75#define EUNATCH 99 /* Protocol driver not attached */
76#define ENOCSI 100 /* No CSI structure available */
77#define EL2HLT 101 /* Level 2 halted */
78#define EBADE 102 /* Invalid exchange */
79#define EBADR 103 /* Invalid request descriptor */
80#define EXFULL 104 /* Exchange full */
81#define ENOANO 105 /* No anode */
82#define EBADRQC 106 /* Invalid request code */
83#define EBADSLT 107 /* Invalid slot */
84#define EDEADLOCK 108 /* File locking deadlock error */
85#define EBFONT 109 /* Bad font file format */
86#define ELIBEXEC 110 /* Cannot exec a shared library directly */
87#define ENODATA 111 /* No data available */
88#define ELIBBAD 112 /* Accessing a corrupted shared library */
89#define ENOPKG 113 /* Package not installed */
90#define ELIBACC 114 /* Can not access a needed shared library */
91#define ENOTUNIQ 115 /* Name not unique on network */
92#define ERESTART 116 /* Interrupted syscall should be restarted */
93#define EUCLEAN 117 /* Structure needs cleaning */
94#define ENOTNAM 118 /* Not a XENIX named type file */
95#define ENAVAIL 119 /* No XENIX semaphores available */
96#define EISNAM 120 /* Is a named type file */
97#define EREMOTEIO 121 /* Remote I/O error */
98#define EILSEQ 122 /* Illegal byte sequence */
99#define ELIBMAX 123 /* Atmpt to link in too many shared libs */
100#define ELIBSCN 124 /* .lib section in a.out corrupted */
101
102#define ENOMEDIUM 125 /* No medium found */
103#define EMEDIUMTYPE 126 /* Wrong medium type */
104#define ECANCELED 127 /* Operation Cancelled */
105#define ENOKEY 128 /* Required key not available */
106#define EKEYEXPIRED 129 /* Key has expired */
107#define EKEYREVOKED 130 /* Key has been revoked */
108#define EKEYREJECTED 131 /* Key was rejected by service */
109
110/* for robust mutexes */
111#define EOWNERDEAD 132 /* Owner died */
112#define ENOTRECOVERABLE 133 /* State not recoverable */
113
114#define ERFKILL 134 /* Operation not possible due to RF-kill */
115
116#define EHWPOISON 135 /* Memory page has hardware error */
117
118#endif
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/fbio.h created+258
...@@ -0,0 +1,258 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __LINUX_FBIO_H
3#define __LINUX_FBIO_H
4
5
6#include <linux/types.h>
7
8/* Constants used for fbio SunOS compatibility */
9/* (C) 1996 Miguel de Icaza */
10
11/* Frame buffer types */
12#define FBTYPE_NOTYPE -1
13#define FBTYPE_SUN1BW 0 /* mono */
14#define FBTYPE_SUN1COLOR 1
15#define FBTYPE_SUN2BW 2
16#define FBTYPE_SUN2COLOR 3
17#define FBTYPE_SUN2GP 4
18#define FBTYPE_SUN5COLOR 5
19#define FBTYPE_SUN3COLOR 6
20#define FBTYPE_MEMCOLOR 7
21#define FBTYPE_SUN4COLOR 8
22
23#define FBTYPE_NOTSUN1 9
24#define FBTYPE_NOTSUN2 10
25#define FBTYPE_NOTSUN3 11
26
27#define FBTYPE_SUNFAST_COLOR 12 /* cg6 */
28#define FBTYPE_SUNROP_COLOR 13
29#define FBTYPE_SUNFB_VIDEO 14
30#define FBTYPE_SUNGIFB 15
31#define FBTYPE_SUNGPLAS 16
32#define FBTYPE_SUNGP3 17
33#define FBTYPE_SUNGT 18
34#define FBTYPE_SUNLEO 19 /* zx Leo card */
35#define FBTYPE_MDICOLOR 20 /* cg14 */
36#define FBTYPE_TCXCOLOR 21 /* SUNW,tcx card */
37
38#define FBTYPE_LASTPLUSONE 21 /* This is not last + 1 in fact... */
39
40/* Does not seem to be listed in the Sun file either */
41#define FBTYPE_CREATOR 22
42#define FBTYPE_PCI_IGA1682 23
43#define FBTYPE_P9100COLOR 24
44
45#define FBTYPE_PCI_GENERIC 1000
46#define FBTYPE_PCI_MACH64 1001
47
48/* fbio ioctls */
49/* Returned by FBIOGTYPE */
50struct fbtype {
51 int fb_type; /* fb type, see above */
52 int fb_height; /* pixels */
53 int fb_width; /* pixels */
54 int fb_depth;
55 int fb_cmsize; /* color map entries */
56 int fb_size; /* fb size in bytes */
57};
58#define FBIOGTYPE _IOR('F', 0, struct fbtype)
59
60struct fbcmap {
61 int index; /* first element (0 origin) */
62 int count;
63 unsigned char *red;
64 unsigned char *green;
65 unsigned char *blue;
66};
67
68#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
69#define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
70
71/* # of device specific values */
72#define FB_ATTR_NDEVSPECIFIC 8
73/* # of possible emulations */
74#define FB_ATTR_NEMUTYPES 4
75
76struct fbsattr {
77 int flags;
78 int emu_type; /* -1 if none */
79 int dev_specific[FB_ATTR_NDEVSPECIFIC];
80};
81
82struct fbgattr {
83 int real_type; /* real frame buffer type */
84 int owner; /* unknown */
85 struct fbtype fbtype; /* real frame buffer fbtype */
86 struct fbsattr sattr;
87 int emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
88};
89#define FBIOSATTR _IOW('F', 5, struct fbgattr) /* Unsupported: */
90#define FBIOGATTR _IOR('F', 6, struct fbgattr) /* supported */
91
92#define FBIOSVIDEO _IOW('F', 7, int)
93#define FBIOGVIDEO _IOR('F', 8, int)
94
95struct fbcursor {
96 short set; /* what to set, choose from the list above */
97 short enable; /* cursor on/off */
98 struct fbcurpos pos; /* cursor position */
99 struct fbcurpos hot; /* cursor hot spot */
100 struct fbcmap cmap; /* color map info */
101 struct fbcurpos size; /* cursor bit map size */
102 char *image; /* cursor image bits */
103 char *mask; /* cursor mask bits */
104};
105
106/* set/get cursor attributes/shape */
107#define FBIOSCURSOR _IOW('F', 24, struct fbcursor)
108#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor)
109
110/* set/get cursor position */
111#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos)
112#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos)
113
114/* get max cursor size */
115#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos)
116
117/* wid manipulation */
118struct fb_wid_alloc {
119#define FB_WID_SHARED_8 0
120#define FB_WID_SHARED_24 1
121#define FB_WID_DBL_8 2
122#define FB_WID_DBL_24 3
123 __u32 wa_type;
124 __s32 wa_index; /* Set on return */
125 __u32 wa_count;
126};
127struct fb_wid_item {
128 __u32 wi_type;
129 __s32 wi_index;
130 __u32 wi_attrs;
131 __u32 wi_values[32];
132};
133struct fb_wid_list {
134 __u32 wl_flags;
135 __u32 wl_count;
136 struct fb_wid_item *wl_list;
137};
138
139#define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc)
140#define FBIO_WID_FREE _IOW('F', 31, struct fb_wid_alloc)
141#define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list)
142#define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list)
143
144/* Creator ioctls */
145#define FFB_IOCTL ('F'<<8)
146#define FFB_SYS_INFO (FFB_IOCTL|80)
147#define FFB_CLUTREAD (FFB_IOCTL|81)
148#define FFB_CLUTPOST (FFB_IOCTL|82)
149#define FFB_SETDIAGMODE (FFB_IOCTL|83)
150#define FFB_GETMONITORID (FFB_IOCTL|84)
151#define FFB_GETVIDEOMODE (FFB_IOCTL|85)
152#define FFB_SETVIDEOMODE (FFB_IOCTL|86)
153#define FFB_SETSERVER (FFB_IOCTL|87)
154#define FFB_SETOVCTL (FFB_IOCTL|88)
155#define FFB_GETOVCTL (FFB_IOCTL|89)
156#define FFB_GETSAXNUM (FFB_IOCTL|90)
157#define FFB_FBDEBUG (FFB_IOCTL|91)
158
159/* Cg14 ioctls */
160#define MDI_IOCTL ('M'<<8)
161#define MDI_RESET (MDI_IOCTL|1)
162#define MDI_GET_CFGINFO (MDI_IOCTL|2)
163#define MDI_SET_PIXELMODE (MDI_IOCTL|3)
164# define MDI_32_PIX 32
165# define MDI_16_PIX 16
166# define MDI_8_PIX 8
167
168struct mdi_cfginfo {
169 int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
170 int mdi_type; /* FBTYPE name */
171 int mdi_height; /* height */
172 int mdi_width; /* width */
173 int mdi_size; /* available ram */
174 int mdi_mode; /* 8bpp, 16bpp or 32bpp */
175 int mdi_pixfreq; /* pixel clock (from PROM) */
176};
177
178/* SparcLinux specific ioctl for the MDI, should be replaced for
179 * the SET_XLUT/SET_CLUTn ioctls instead
180 */
181#define MDI_CLEAR_XLUT (MDI_IOCTL|9)
182
183/* leo & ffb ioctls */
184struct fb_clut_alloc {
185 __u32 clutid; /* Set on return */
186 __u32 flag;
187 __u32 index;
188};
189
190struct fb_clut {
191#define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */
192 __u32 flag;
193 __u32 clutid;
194 __u32 offset;
195 __u32 count;
196 char * red;
197 char * green;
198 char * blue;
199};
200
201struct fb_clut32 {
202 __u32 flag;
203 __u32 clutid;
204 __u32 offset;
205 __u32 count;
206 __u32 red;
207 __u32 green;
208 __u32 blue;
209};
210
211#define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc)
212#define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc)
213#define LEO_CLUTREAD _IOW('L', 55, struct fb_clut)
214#define LEO_CLUTPOST _IOW('L', 56, struct fb_clut)
215#define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */
216#define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */
217
218
219/* These are exported to userland for applications to use */
220/* Mappable offsets for the cg14: control registers */
221#define MDI_DIRECT_MAP 0x10000000
222#define MDI_CTLREG_MAP 0x20000000
223#define MDI_CURSOR_MAP 0x30000000
224#define MDI_SHDW_VRT_MAP 0x40000000
225
226/* Mappable offsets for the cg14: frame buffer resolutions */
227/* 32 bits */
228#define MDI_CHUNKY_XBGR_MAP 0x50000000
229#define MDI_CHUNKY_BGR_MAP 0x60000000
230
231/* 16 bits */
232#define MDI_PLANAR_X16_MAP 0x70000000
233#define MDI_PLANAR_C16_MAP 0x80000000
234
235/* 8 bit is done as CG3 MMAP offset */
236/* 32 bits, planar */
237#define MDI_PLANAR_X32_MAP 0x90000000
238#define MDI_PLANAR_B32_MAP 0xa0000000
239#define MDI_PLANAR_G32_MAP 0xb0000000
240#define MDI_PLANAR_R32_MAP 0xc0000000
241
242/* Mappable offsets on leo */
243#define LEO_SS0_MAP 0x00000000
244#define LEO_LC_SS0_USR_MAP 0x00800000
245#define LEO_LD_SS0_MAP 0x00801000
246#define LEO_LX_CURSOR_MAP 0x00802000
247#define LEO_SS1_MAP 0x00803000
248#define LEO_LC_SS1_USR_MAP 0x01003000
249#define LEO_LD_SS1_MAP 0x01004000
250#define LEO_UNK_MAP 0x01005000
251#define LEO_LX_KRN_MAP 0x01006000
252#define LEO_LC_SS0_KRN_MAP 0x01007000
253#define LEO_LC_SS1_KRN_MAP 0x01008000
254#define LEO_LD_GBL_MAP 0x01009000
255#define LEO_UNK2_MAP 0x0100a000
256
257
258#endif /* __LINUX_FBIO_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/fcntl.h created+57
...@@ -0,0 +1,57 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_FCNTL_H
3#define _SPARC_FCNTL_H
4
5#define O_APPEND 0x0008
6#define FASYNC 0x0040 /* fcntl, for BSD compatibility */
7#define O_CREAT 0x0200 /* not fcntl */
8#define O_TRUNC 0x0400 /* not fcntl */
9#define O_EXCL 0x0800 /* not fcntl */
10#define O_DSYNC 0x2000 /* used to be O_SYNC, see below */
11#define O_NONBLOCK 0x4000
12#if defined(__sparc__) && defined(__arch64__)
13#define O_NDELAY 0x0004
14#else
15#define O_NDELAY (0x0004 | O_NONBLOCK)
16#endif
17#define O_NOCTTY 0x8000 /* not fcntl */
18#define O_LARGEFILE 0x40000
19#define O_DIRECT 0x100000 /* direct disk access hint */
20#define O_NOATIME 0x200000
21#define O_CLOEXEC 0x400000
22/*
23 * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
24 * the O_SYNC flag. We continue to use the existing numerical value
25 * for O_DSYNC semantics now, but using the correct symbolic name for it.
26 * This new value is used to request true Posix O_SYNC semantics. It is
27 * defined in this strange way to make sure applications compiled against
28 * new headers get at least O_DSYNC semantics on older kernels.
29 *
30 * This has the nice side-effect that we can simply test for O_DSYNC
31 * wherever we do not care if O_DSYNC or O_SYNC is used.
32 *
33 * Note: __O_SYNC must never be used directly.
34 */
35#define __O_SYNC 0x800000
36#define O_SYNC (__O_SYNC|O_DSYNC)
37
38#define O_PATH 0x1000000
39#define __O_TMPFILE 0x2000000
40
41#define F_GETOWN 5 /* for sockets. */
42#define F_SETOWN 6 /* for sockets. */
43#define F_GETLK 7
44#define F_SETLK 8
45#define F_SETLKW 9
46
47/* for posix fcntl() and lockf() */
48#define F_RDLCK 1
49#define F_WRLCK 2
50#define F_UNLCK 3
51
52#define __ARCH_FLOCK_PAD short __unused;
53#define __ARCH_FLOCK64_PAD short __unused;
54
55#include <asm-generic/fcntl.h>
56
57#endif
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/ioctl.h created+68
...@@ -0,0 +1,68 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_IOCTL_H
3#define _SPARC_IOCTL_H
4
5/*
6 * Our DIR and SIZE overlap in order to simulteneously provide
7 * a non-zero _IOC_NONE (for binary compatibility) and
8 * 14 bits of size as on i386. Here's the layout:
9 *
10 * 0xE0000000 DIR
11 * 0x80000000 DIR = WRITE
12 * 0x40000000 DIR = READ
13 * 0x20000000 DIR = NONE
14 * 0x3FFF0000 SIZE (overlaps NONE bit)
15 * 0x0000FF00 TYPE
16 * 0x000000FF NR (CMD)
17 */
18
19#define _IOC_NRBITS 8
20#define _IOC_TYPEBITS 8
21#define _IOC_SIZEBITS 13 /* Actually 14, see below. */
22#define _IOC_DIRBITS 3
23
24#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
25#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
26#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
27#define _IOC_XSIZEMASK ((1 << (_IOC_SIZEBITS+1))-1)
28#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
29
30#define _IOC_NRSHIFT 0
31#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
32#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
33#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
34
35#define _IOC_NONE 1U
36#define _IOC_READ 2U
37#define _IOC_WRITE 4U
38
39#define _IOC(dir,type,nr,size) \
40 (((dir) << _IOC_DIRSHIFT) | \
41 ((type) << _IOC_TYPESHIFT) | \
42 ((nr) << _IOC_NRSHIFT) | \
43 ((size) << _IOC_SIZESHIFT))
44
45#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
46#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
47#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
48#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
49
50/* Used to decode ioctl numbers in drivers despite the leading underscore... */
51#define _IOC_DIR(nr) \
52 ( (((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) != 0)? \
53 (((nr) >> _IOC_DIRSHIFT) & (_IOC_WRITE|_IOC_READ)): \
54 (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) )
55#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
56#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
57#define _IOC_SIZE(nr) \
58 ((((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) == 0)? \
59 0: (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK))
60
61/* ...and for the PCMCIA and sound. */
62#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
63#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
64#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
65#define IOCSIZE_MASK (_IOC_XSIZEMASK << _IOC_SIZESHIFT)
66#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
67
68#endif /* !(_SPARC_IOCTL_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/ioctls.h created+140
...@@ -0,0 +1,140 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SPARC_IOCTLS_H
3#define _ASM_SPARC_IOCTLS_H
4
5#include <asm/ioctl.h>
6
7/* Big T */
8#define TCGETA _IOR('T', 1, struct termio)
9#define TCSETA _IOW('T', 2, struct termio)
10#define TCSETAW _IOW('T', 3, struct termio)
11#define TCSETAF _IOW('T', 4, struct termio)
12#define TCSBRK _IO('T', 5)
13#define TCXONC _IO('T', 6)
14#define TCFLSH _IO('T', 7)
15#define TCGETS _IOR('T', 8, struct termios)
16#define TCSETS _IOW('T', 9, struct termios)
17#define TCSETSW _IOW('T', 10, struct termios)
18#define TCSETSF _IOW('T', 11, struct termios)
19#define TCGETS2 _IOR('T', 12, struct termios2)
20#define TCSETS2 _IOW('T', 13, struct termios2)
21#define TCSETSW2 _IOW('T', 14, struct termios2)
22#define TCSETSF2 _IOW('T', 15, struct termios2)
23#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
24#define TIOCVHANGUP _IO('T', 0x37)
25#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
26#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
27#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
28#define TIOCGRS485 _IOR('T', 0x41, struct serial_rs485)
29#define TIOCSRS485 _IOWR('T', 0x42, struct serial_rs485)
30#define TIOCGISO7816 _IOR('T', 0x43, struct serial_iso7816)
31#define TIOCSISO7816 _IOWR('T', 0x44, struct serial_iso7816)
32
33/* Note that all the ioctls that are not available in Linux have a
34 * double underscore on the front to: a) avoid some programs to
35 * think we support some ioctls under Linux (autoconfiguration stuff)
36 */
37/* Little t */
38#define TIOCGETD _IOR('t', 0, int)
39#define TIOCSETD _IOW('t', 1, int)
40#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */
41#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */
42#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */
43#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */
44#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */
45#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */
46#define TIOCEXCL _IO('t', 13)
47#define TIOCNXCL _IO('t', 14)
48#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */
49#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */
50#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */
51#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */
52#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */
53#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
54#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
55#define TIOCCONS _IO('t', 36)
56#define TIOCGSOFTCAR _IOR('t', 100, int)
57#define TIOCSSOFTCAR _IOW('t', 101, int)
58#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
59#define TIOCSWINSZ _IOW('t', 103, struct winsize)
60#define TIOCGWINSZ _IOR('t', 104, struct winsize)
61#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */
62#define TIOCMGET _IOR('t', 106, int)
63#define TIOCMBIC _IOW('t', 107, int)
64#define TIOCMBIS _IOW('t', 108, int)
65#define TIOCMSET _IOW('t', 109, int)
66#define TIOCSTART _IO('t', 110)
67#define TIOCSTOP _IO('t', 111)
68#define TIOCPKT _IOW('t', 112, int)
69#define TIOCNOTTY _IO('t', 113)
70#define TIOCSTI _IOW('t', 114, char)
71#define TIOCOUTQ _IOR('t', 115, int)
72#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */
73#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */
74/* 118 is the non-posix setpgrp tty ioctl */
75/* 119 is the non-posix getpgrp tty ioctl */
76#define __TIOCCDTR _IO('t', 120) /* SunOS Specific */
77#define __TIOCSDTR _IO('t', 121) /* SunOS Specific */
78#define TIOCCBRK _IO('t', 122)
79#define TIOCSBRK _IO('t', 123)
80#define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */
81#define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */
82#define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */
83#define __TIOCLBIS _IOW('t', 127, int) /* SunOS Specific */
84#define __TIOCISPACE _IOR('t', 128, int) /* SunOS Specific */
85#define __TIOCISIZE _IOR('t', 129, int) /* SunOS Specific */
86#define TIOCSPGRP _IOW('t', 130, int)
87#define TIOCGPGRP _IOR('t', 131, int)
88#define TIOCSCTTY _IO('t', 132)
89#define TIOCGSID _IOR('t', 133, int)
90/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
91#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
92#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
93#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
94#define TIOCGPTPEER _IO('t', 137) /* Safely open the slave */
95
96/* Little f */
97#define FIOCLEX _IO('f', 1)
98#define FIONCLEX _IO('f', 2)
99#define FIOASYNC _IOW('f', 125, int)
100#define FIONBIO _IOW('f', 126, int)
101#define FIONREAD _IOR('f', 127, int)
102#define TIOCINQ FIONREAD
103#define FIOQSIZE _IOR('f', 128, loff_t)
104
105/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
106 * someday. This is completely bogus, I know...
107 */
108#define __TCGETSTAT _IO('T', 200) /* Rutgers specific */
109#define __TCSETSTAT _IO('T', 201) /* Rutgers specific */
110
111/* Linux specific, no SunOS equivalent. */
112#define TIOCLINUX 0x541C
113#define TIOCGSERIAL 0x541E
114#define TIOCSSERIAL 0x541F
115#define TCSBRKP 0x5425
116#define TIOCSERCONFIG 0x5453
117#define TIOCSERGWILD 0x5454
118#define TIOCSERSWILD 0x5455
119#define TIOCGLCKTRMIOS 0x5456
120#define TIOCSLCKTRMIOS 0x5457
121#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
122#define TIOCSERGETLSR 0x5459 /* Get line status register */
123#define TIOCSERGETMULTI 0x545A /* Get multiport config */
124#define TIOCSERSETMULTI 0x545B /* Set multiport config */
125#define TIOCMIWAIT 0x545C /* Wait for change on serial input line(s) */
126#define TIOCGICOUNT 0x545D /* Read serial port __inline__ interrupt counts */
127
128/* Kernel definitions */
129
130/* Used for packet mode */
131#define TIOCPKT_DATA 0
132#define TIOCPKT_FLUSHREAD 1
133#define TIOCPKT_FLUSHWRITE 2
134#define TIOCPKT_STOP 4
135#define TIOCPKT_START 8
136#define TIOCPKT_NOSTOP 16
137#define TIOCPKT_DOSTOP 32
138#define TIOCPKT_IOCTL 64
139
140#endif /* _ASM_SPARC_IOCTLS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/ipcbuf.h created+35
...@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_IPCBUF_H
3#define __SPARC_IPCBUF_H
4
5#include <linux/posix_types.h>
6
7/*
8 * The ipc64_perm structure for sparc/sparc64 architecture.
9 * Note extra padding because this structure is passed back and forth
10 * between kernel and user space.
11 *
12 * Pad space is left for:
13 * - 32-bit seq
14 * - on sparc for 32 bit mode (it is 32 bit on sparc64)
15 * - 2 miscellaneous 64-bit values
16 */
17
18struct ipc64_perm
19{
20 __kernel_key_t key;
21 __kernel_uid32_t uid;
22 __kernel_gid32_t gid;
23 __kernel_uid32_t cuid;
24 __kernel_gid32_t cgid;
25#ifndef __arch64__
26 unsigned short __pad0;
27#endif
28 __kernel_mode_t mode;
29 unsigned short __pad1;
30 unsigned short seq;
31 unsigned long long __unused1;
32 unsigned long long __unused2;
33};
34
35#endif /* __SPARC_IPCBUF_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/mman.h created+25
...@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_MMAN_H__
3#define __SPARC_MMAN_H__
4
5#include <asm-generic/mman-common.h>
6
7/* SunOS'ified... */
8
9#define PROT_ADI 0x10 /* ADI enabled */
10
11#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
12#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
13#define MAP_INHERIT 0x80 /* SunOS doesn't do this, but... */
14#define MAP_LOCKED 0x100 /* lock the mapping */
15#define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */
16
17#define MAP_GROWSDOWN 0x0200 /* stack-like segment */
18#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
19#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
20
21#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
22#define MCL_FUTURE 0x4000 /* lock all additions to address space */
23#define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */
24
25#endif /* __SPARC_MMAN_H__ */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/msgbuf.h created+37
...@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_MSGBUF_H
3#define _SPARC_MSGBUF_H
4
5#include <asm/ipcbuf.h>
6
7/*
8 * The msqid64_ds structure for sparc64 architecture.
9 * Note extra padding because this structure is passed back and forth
10 * between kernel and user space.
11 *
12 * Pad space is left for:
13 * - 2 miscellaneous 32-bit values
14 */
15struct msqid64_ds {
16 struct ipc64_perm msg_perm;
17#if defined(__sparc__) && defined(__arch64__)
18 long msg_stime; /* last msgsnd time */
19 long msg_rtime; /* last msgrcv time */
20 long msg_ctime; /* last change time */
21#else
22 unsigned long msg_stime_high;
23 unsigned long msg_stime; /* last msgsnd time */
24 unsigned long msg_rtime_high;
25 unsigned long msg_rtime; /* last msgrcv time */
26 unsigned long msg_ctime_high;
27 unsigned long msg_ctime; /* last change time */
28#endif
29 unsigned long msg_cbytes; /* current number of bytes on queue */
30 unsigned long msg_qnum; /* number of messages in queue */
31 unsigned long msg_qbytes; /* max number of bytes on queue */
32 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
33 __kernel_pid_t msg_lrpid; /* last receive pid */
34 unsigned long __unused1;
35 unsigned long __unused2;
36};
37#endif /* _SPARC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/openpromio.h created+68
...@@ -0,0 +1,68 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_OPENPROMIO_H
3#define _SPARC_OPENPROMIO_H
4
5
6#include <linux/ioctl.h>
7
8/*
9 * SunOS and Solaris /dev/openprom definitions. The ioctl values
10 * were chosen to be exactly equal to the SunOS equivalents.
11 */
12
13struct openpromio
14{
15 unsigned int oprom_size; /* Actual size of the oprom_array. */
16 char oprom_array[1]; /* Holds property names and values. */
17};
18
19#define OPROMMAXPARAM 4096 /* Maximum size of oprom_array. */
20
21#define OPROMGETOPT 0x20004F01
22#define OPROMSETOPT 0x20004F02
23#define OPROMNXTOPT 0x20004F03
24#define OPROMSETOPT2 0x20004F04
25#define OPROMNEXT 0x20004F05
26#define OPROMCHILD 0x20004F06
27#define OPROMGETPROP 0x20004F07
28#define OPROMNXTPROP 0x20004F08
29#define OPROMU2P 0x20004F09
30#define OPROMGETCONS 0x20004F0A
31#define OPROMGETFBNAME 0x20004F0B
32#define OPROMGETBOOTARGS 0x20004F0C
33/* Linux extensions */ /* Arguments in oprom_array: */
34#define OPROMSETCUR 0x20004FF0 /* int node - Sets current node */
35#define OPROMPCI2NODE 0x20004FF1 /* int pci_bus, pci_devfn - Sets current node to PCI device's node */
36#define OPROMPATH2NODE 0x20004FF2 /* char path[] - Set current node from fully qualified PROM path */
37
38/*
39 * Return values from OPROMGETCONS:
40 */
41
42#define OPROMCONS_NOT_WSCONS 0
43#define OPROMCONS_STDIN_IS_KBD 0x1 /* stdin device is kbd */
44#define OPROMCONS_STDOUT_IS_FB 0x2 /* stdout is a framebuffer */
45#define OPROMCONS_OPENPROM 0x4 /* supports openboot */
46
47
48/*
49 * NetBSD/OpenBSD /dev/openprom definitions.
50 */
51
52struct opiocdesc
53{
54 int op_nodeid; /* PROM Node ID (value-result) */
55 int op_namelen; /* Length of op_name. */
56 char *op_name; /* Pointer to the property name. */
57 int op_buflen; /* Length of op_buf (value-result) */
58 char *op_buf; /* Pointer to buffer. */
59};
60
61#define OPIOCGET _IOWR('O', 1, struct opiocdesc)
62#define OPIOCSET _IOW('O', 2, struct opiocdesc)
63#define OPIOCNEXTPROP _IOWR('O', 3, struct opiocdesc)
64#define OPIOCGETOPTNODE _IOR('O', 4, int)
65#define OPIOCGETNEXT _IOWR('O', 5, int)
66#define OPIOCGETCHILD _IOWR('O', 6, int)
67
68#endif /* _SPARC_OPENPROMIO_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/oradax.h created+79
...@@ -0,0 +1,79 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
4 */
5
6/*
7 * Oracle DAX driver API definitions
8 */
9
10#ifndef _ORADAX_H
11#define _ORADAX_H
12
13#include <linux/types.h>
14
15#define CCB_KILL 0
16#define CCB_INFO 1
17#define CCB_DEQUEUE 2
18
19struct dax_command {
20 __u16 command; /* CCB_KILL/INFO/DEQUEUE */
21 __u16 ca_offset; /* offset into mmapped completion area */
22};
23
24struct ccb_kill_result {
25 __u16 action; /* action taken to kill ccb */
26};
27
28struct ccb_info_result {
29 __u16 state; /* state of enqueued ccb */
30 __u16 inst_num; /* dax instance number of enqueued ccb */
31 __u16 q_num; /* queue number of enqueued ccb */
32 __u16 q_pos; /* ccb position in queue */
33};
34
35struct ccb_exec_result {
36 __u64 status_data; /* additional status data (e.g. bad VA) */
37 __u32 status; /* one of DAX_SUBMIT_* */
38};
39
40union ccb_result {
41 struct ccb_exec_result exec;
42 struct ccb_info_result info;
43 struct ccb_kill_result kill;
44};
45
46#define DAX_MMAP_LEN (16 * 1024)
47#define DAX_MAX_CCBS 15
48#define DAX_CCB_BUF_MAXLEN (DAX_MAX_CCBS * 64)
49#define DAX_NAME "oradax"
50
51/* CCB_EXEC status */
52#define DAX_SUBMIT_OK 0
53#define DAX_SUBMIT_ERR_RETRY 1
54#define DAX_SUBMIT_ERR_WOULDBLOCK 2
55#define DAX_SUBMIT_ERR_BUSY 3
56#define DAX_SUBMIT_ERR_THR_INIT 4
57#define DAX_SUBMIT_ERR_ARG_INVAL 5
58#define DAX_SUBMIT_ERR_CCB_INVAL 6
59#define DAX_SUBMIT_ERR_NO_CA_AVAIL 7
60#define DAX_SUBMIT_ERR_CCB_ARR_MMU_MISS 8
61#define DAX_SUBMIT_ERR_NOMAP 9
62#define DAX_SUBMIT_ERR_NOACCESS 10
63#define DAX_SUBMIT_ERR_TOOMANY 11
64#define DAX_SUBMIT_ERR_UNAVAIL 12
65#define DAX_SUBMIT_ERR_INTERNAL 13
66
67/* CCB_INFO states - must match HV_CCB_STATE_* definitions */
68#define DAX_CCB_COMPLETED 0
69#define DAX_CCB_ENQUEUED 1
70#define DAX_CCB_INPROGRESS 2
71#define DAX_CCB_NOTFOUND 3
72
73/* CCB_KILL actions - must match HV_CCB_KILL_* definitions */
74#define DAX_KILL_COMPLETED 0
75#define DAX_KILL_DEQUEUED 1
76#define DAX_KILL_KILLED 2
77#define DAX_KILL_NOTFOUND 3
78
79#endif /* _ORADAX_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/param.h created+8
...@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASMSPARC_PARAM_H
3#define _ASMSPARC_PARAM_H
4
5#define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
6#include <asm-generic/param.h>
7
8#endif /* _ASMSPARC_PARAM_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/perfctr.h created+167
...@@ -0,0 +1,167 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*----------------------------------------
3 PERFORMANCE INSTRUMENTATION
4 Guillaume Thouvenin 08/10/98
5 David S. Miller 10/06/98
6 ---------------------------------------*/
7#ifndef PERF_COUNTER_API
8#define PERF_COUNTER_API
9
10/* sys_perfctr() interface. First arg is operation code
11 * from enumeration below. The meaning of further arguments
12 * are determined by the operation code.
13 *
14 * NOTE: This system call is no longer provided, use the perf_events
15 * infrastructure.
16 *
17 * Pointers which are passed by the user are pointers to 64-bit
18 * integers.
19 *
20 * Once enabled, performance counter state is retained until the
21 * process either exits or performs an exec. That is, performance
22 * counters remain enabled for fork/clone children.
23 */
24enum perfctr_opcode {
25 /* Enable UltraSparc performance counters, ARG0 is pointer
26 * to 64-bit accumulator for D0 counter in PIC, ARG1 is pointer
27 * to 64-bit accumulator for D1 counter. ARG2 is a pointer to
28 * the initial PCR register value to use.
29 */
30 PERFCTR_ON,
31
32 /* Disable UltraSparc performance counters. The PCR is written
33 * with zero and the user counter accumulator pointers and
34 * working PCR register value are forgotten.
35 */
36 PERFCTR_OFF,
37
38 /* Add current D0 and D1 PIC values into user pointers given
39 * in PERFCTR_ON operation. The PIC is cleared before returning.
40 */
41 PERFCTR_READ,
42
43 /* Clear the PIC register. */
44 PERFCTR_CLRPIC,
45
46 /* Begin using a new PCR value, the pointer to which is passed
47 * in ARG0. The PIC is also cleared after the new PCR value is
48 * written.
49 */
50 PERFCTR_SETPCR,
51
52 /* Store in pointer given in ARG0 the current PCR register value
53 * being used.
54 */
55 PERFCTR_GETPCR
56};
57
58#define PRIV 0x00000001
59#define SYS 0x00000002
60#define USR 0x00000004
61
62/* Pic.S0 Selection Bit Field Encoding, Ultra-I/II */
63#define CYCLE_CNT 0x00000000
64#define INSTR_CNT 0x00000010
65#define DISPATCH0_IC_MISS 0x00000020
66#define DISPATCH0_STOREBUF 0x00000030
67#define IC_REF 0x00000080
68#define DC_RD 0x00000090
69#define DC_WR 0x000000A0
70#define LOAD_USE 0x000000B0
71#define EC_REF 0x000000C0
72#define EC_WRITE_HIT_RDO 0x000000D0
73#define EC_SNOOP_INV 0x000000E0
74#define EC_RD_HIT 0x000000F0
75
76/* Pic.S0 Selection Bit Field Encoding, Ultra-III */
77#define US3_CYCLE_CNT 0x00000000
78#define US3_INSTR_CNT 0x00000010
79#define US3_DISPATCH0_IC_MISS 0x00000020
80#define US3_DISPATCH0_BR_TGT 0x00000030
81#define US3_DISPATCH0_2ND_BR 0x00000040
82#define US3_RSTALL_STOREQ 0x00000050
83#define US3_RSTALL_IU_USE 0x00000060
84#define US3_IC_REF 0x00000080
85#define US3_DC_RD 0x00000090
86#define US3_DC_WR 0x000000a0
87#define US3_EC_REF 0x000000c0
88#define US3_EC_WR_HIT_RTO 0x000000d0
89#define US3_EC_SNOOP_INV 0x000000e0
90#define US3_EC_RD_MISS 0x000000f0
91#define US3_PC_PORT0_RD 0x00000100
92#define US3_SI_SNOOP 0x00000110
93#define US3_SI_CIQ_FLOW 0x00000120
94#define US3_SI_OWNED 0x00000130
95#define US3_SW_COUNT_0 0x00000140
96#define US3_IU_BR_MISS_TAKEN 0x00000150
97#define US3_IU_BR_COUNT_TAKEN 0x00000160
98#define US3_DISP_RS_MISPRED 0x00000170
99#define US3_FA_PIPE_COMPL 0x00000180
100#define US3_MC_READS_0 0x00000200
101#define US3_MC_READS_1 0x00000210
102#define US3_MC_READS_2 0x00000220
103#define US3_MC_READS_3 0x00000230
104#define US3_MC_STALLS_0 0x00000240
105#define US3_MC_STALLS_2 0x00000250
106
107/* Pic.S1 Selection Bit Field Encoding, Ultra-I/II */
108#define CYCLE_CNT_D1 0x00000000
109#define INSTR_CNT_D1 0x00000800
110#define DISPATCH0_IC_MISPRED 0x00001000
111#define DISPATCH0_FP_USE 0x00001800
112#define IC_HIT 0x00004000
113#define DC_RD_HIT 0x00004800
114#define DC_WR_HIT 0x00005000
115#define LOAD_USE_RAW 0x00005800
116#define EC_HIT 0x00006000
117#define EC_WB 0x00006800
118#define EC_SNOOP_CB 0x00007000
119#define EC_IT_HIT 0x00007800
120
121/* Pic.S1 Selection Bit Field Encoding, Ultra-III */
122#define US3_CYCLE_CNT_D1 0x00000000
123#define US3_INSTR_CNT_D1 0x00000800
124#define US3_DISPATCH0_MISPRED 0x00001000
125#define US3_IC_MISS_CANCELLED 0x00001800
126#define US3_RE_ENDIAN_MISS 0x00002000
127#define US3_RE_FPU_BYPASS 0x00002800
128#define US3_RE_DC_MISS 0x00003000
129#define US3_RE_EC_MISS 0x00003800
130#define US3_IC_MISS 0x00004000
131#define US3_DC_RD_MISS 0x00004800
132#define US3_DC_WR_MISS 0x00005000
133#define US3_RSTALL_FP_USE 0x00005800
134#define US3_EC_MISSES 0x00006000
135#define US3_EC_WB 0x00006800
136#define US3_EC_SNOOP_CB 0x00007000
137#define US3_EC_IC_MISS 0x00007800
138#define US3_RE_PC_MISS 0x00008000
139#define US3_ITLB_MISS 0x00008800
140#define US3_DTLB_MISS 0x00009000
141#define US3_WC_MISS 0x00009800
142#define US3_WC_SNOOP_CB 0x0000a000
143#define US3_WC_SCRUBBED 0x0000a800
144#define US3_WC_WB_WO_READ 0x0000b000
145#define US3_PC_SOFT_HIT 0x0000c000
146#define US3_PC_SNOOP_INV 0x0000c800
147#define US3_PC_HARD_HIT 0x0000d000
148#define US3_PC_PORT1_RD 0x0000d800
149#define US3_SW_COUNT_1 0x0000e000
150#define US3_IU_STAT_BR_MIS_UNTAKEN 0x0000e800
151#define US3_IU_STAT_BR_COUNT_UNTAKEN 0x0000f000
152#define US3_PC_MS_MISSES 0x0000f800
153#define US3_MC_WRITES_0 0x00010800
154#define US3_MC_WRITES_1 0x00011000
155#define US3_MC_WRITES_2 0x00011800
156#define US3_MC_WRITES_3 0x00012000
157#define US3_MC_STALLS_1 0x00012800
158#define US3_MC_STALLS_3 0x00013000
159#define US3_RE_RAW_MISS 0x00013800
160#define US3_FM_PIPE_COMPLETION 0x00014000
161
162struct vcounter_struct {
163 unsigned long long vcnt0;
164 unsigned long long vcnt1;
165};
166
167#endif /* !(PERF_COUNTER_API) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/poll.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_POLL_H
3#define __SPARC_POLL_H
4
5#define POLLWRNORM POLLOUT
6#define POLLWRBAND 256
7#define POLLMSG 512
8#define POLLREMOVE 1024
9#define POLLRDHUP 2048
10
11#include <asm-generic/poll.h>
12
13#endif
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/posix_types.h created+60
...@@ -0,0 +1,60 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is generally used by user-level software, so you need to
4 * be a little careful about namespace pollution etc. Also, we cannot
5 * assume GCC is being used.
6 */
7
8#ifndef __SPARC_POSIX_TYPES_H
9#define __SPARC_POSIX_TYPES_H
10
11#if defined(__sparc__) && defined(__arch64__)
12/* sparc 64 bit */
13
14typedef unsigned short __kernel_old_uid_t;
15typedef unsigned short __kernel_old_gid_t;
16#define __kernel_old_uid_t __kernel_old_uid_t
17
18/* Note this piece of asymmetry from the v9 ABI. */
19typedef int __kernel_suseconds_t;
20#define __kernel_suseconds_t __kernel_suseconds_t
21
22typedef long __kernel_long_t;
23typedef unsigned long __kernel_ulong_t;
24#define __kernel_long_t __kernel_long_t
25
26struct __kernel_old_timeval {
27 __kernel_long_t tv_sec;
28 __kernel_suseconds_t tv_usec;
29};
30#define __kernel_old_timeval __kernel_old_timeval
31
32#else
33/* sparc 32 bit */
34
35typedef unsigned int __kernel_size_t;
36typedef int __kernel_ssize_t;
37typedef long int __kernel_ptrdiff_t;
38#define __kernel_size_t __kernel_size_t
39
40typedef unsigned short __kernel_ipc_pid_t;
41#define __kernel_ipc_pid_t __kernel_ipc_pid_t
42
43typedef unsigned short __kernel_uid_t;
44typedef unsigned short __kernel_gid_t;
45#define __kernel_uid_t __kernel_uid_t
46
47typedef unsigned short __kernel_mode_t;
48#define __kernel_mode_t __kernel_mode_t
49
50typedef long __kernel_daddr_t;
51#define __kernel_daddr_t __kernel_daddr_t
52
53typedef unsigned short __kernel_old_dev_t;
54#define __kernel_old_dev_t __kernel_old_dev_t
55
56#endif /* defined(__sparc__) && defined(__arch64__) */
57
58#include <asm-generic/posix_types.h>
59
60#endif /* __SPARC_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/psr.h created+48
...@@ -0,0 +1,48 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * psr.h: This file holds the macros for masking off various parts of
4 * the processor status register on the Sparc. This is valid
5 * for Version 8. On the V9 this is renamed to the PSTATE
6 * register and its members are accessed as fields like
7 * PSTATE.PRIV for the current CPU privilege level.
8 *
9 * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
10 */
11
12#ifndef __LINUX_SPARC_PSR_H
13#define __LINUX_SPARC_PSR_H
14
15/* The Sparc PSR fields are laid out as the following:
16 *
17 * ------------------------------------------------------------------------
18 * | impl | vers | icc | resv | EC | EF | PIL | S | PS | ET | CWP |
19 * | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6 | 5 | 4-0 |
20 * ------------------------------------------------------------------------
21 */
22#define PSR_CWP 0x0000001f /* current window pointer */
23#define PSR_ET 0x00000020 /* enable traps field */
24#define PSR_PS 0x00000040 /* previous privilege level */
25#define PSR_S 0x00000080 /* current privilege level */
26#define PSR_PIL 0x00000f00 /* processor interrupt level */
27#define PSR_EF 0x00001000 /* enable floating point */
28#define PSR_EC 0x00002000 /* enable co-processor */
29#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
30#define PSR_LE 0x00008000 /* SuperSparcII little-endian */
31#define PSR_ICC 0x00f00000 /* integer condition codes */
32#define PSR_C 0x00100000 /* carry bit */
33#define PSR_V 0x00200000 /* overflow bit */
34#define PSR_Z 0x00400000 /* zero bit */
35#define PSR_N 0x00800000 /* negative bit */
36#define PSR_VERS 0x0f000000 /* cpu-version field */
37#define PSR_IMPL 0xf0000000 /* cpu-implementation field */
38
39#define PSR_VERS_SHIFT 24
40#define PSR_IMPL_SHIFT 28
41#define PSR_VERS_SHIFTED_MASK 0xf
42#define PSR_IMPL_SHIFTED_MASK 0xf
43
44#define PSR_IMPL_TI 0x4
45#define PSR_IMPL_LEON 0xf
46
47
48#endif /* __LINUX_SPARC_PSR_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/psrcompat.h created+46
...@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC64_PSRCOMPAT_H
3#define _SPARC64_PSRCOMPAT_H
4
5#include <asm/pstate.h>
6
7/* Old 32-bit PSR fields for the compatibility conversion code. */
8#define PSR_CWP 0x0000001f /* current window pointer */
9#define PSR_ET 0x00000020 /* enable traps field */
10#define PSR_PS 0x00000040 /* previous privilege level */
11#define PSR_S 0x00000080 /* current privilege level */
12#define PSR_PIL 0x00000f00 /* processor interrupt level */
13#define PSR_EF 0x00001000 /* enable floating point */
14#define PSR_EC 0x00002000 /* enable co-processor */
15#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
16#define PSR_LE 0x00008000 /* SuperSparcII little-endian */
17#define PSR_ICC 0x00f00000 /* integer condition codes */
18#define PSR_C 0x00100000 /* carry bit */
19#define PSR_V 0x00200000 /* overflow bit */
20#define PSR_Z 0x00400000 /* zero bit */
21#define PSR_N 0x00800000 /* negative bit */
22#define PSR_VERS 0x0f000000 /* cpu-version field */
23#define PSR_IMPL 0xf0000000 /* cpu-implementation field */
24
25#define PSR_V8PLUS 0xff000000 /* fake impl/ver, meaning a 64bit CPU is present */
26#define PSR_XCC 0x000f0000 /* if PSR_V8PLUS, this is %xcc */
27
28static __inline__ unsigned int tstate_to_psr(unsigned long tstate)
29{
30 return ((tstate & TSTATE_CWP) |
31 PSR_S |
32 ((tstate & TSTATE_ICC) >> 12) |
33 ((tstate & TSTATE_XCC) >> 20) |
34 ((tstate & TSTATE_SYSCALL) ? PSR_SYSCALL : 0) |
35 PSR_V8PLUS);
36}
37
38static __inline__ unsigned long psr_to_tstate_icc(unsigned int psr)
39{
40 unsigned long tstate = ((unsigned long)(psr & PSR_ICC)) << 12;
41 if ((psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS)
42 tstate |= ((unsigned long)(psr & PSR_XCC)) << 20;
43 return tstate;
44}
45
46#endif /* !(_SPARC64_PSRCOMPAT_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/pstate.h created+116
...@@ -0,0 +1,116 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC64_PSTATE_H
3#define _SPARC64_PSTATE_H
4
5#include <linux/const.h>
6
7/* The V9 PSTATE Register (with SpitFire extensions).
8 *
9 * -----------------------------------------------------------------------
10 * | Resv | IG | MG | CLE | TLE | MM | RED | PEF | AM | PRIV | IE | AG |
11 * -----------------------------------------------------------------------
12 * 63 12 11 10 9 8 7 6 5 4 3 2 1 0
13 */
14/* IG on V9 conflicts with MCDE on M7. PSTATE_MCDE will only be used on
15 * processors that support ADI which do not use IG, hence there is no
16 * functional conflict
17 */
18#define PSTATE_IG _AC(0x0000000000000800,UL) /* Interrupt Globals. */
19#define PSTATE_MCDE _AC(0x0000000000000800,UL) /* MCD Enable */
20#define PSTATE_MG _AC(0x0000000000000400,UL) /* MMU Globals. */
21#define PSTATE_CLE _AC(0x0000000000000200,UL) /* Current Little Endian.*/
22#define PSTATE_TLE _AC(0x0000000000000100,UL) /* Trap Little Endian. */
23#define PSTATE_MM _AC(0x00000000000000c0,UL) /* Memory Model. */
24#define PSTATE_TSO _AC(0x0000000000000000,UL) /* MM: TotalStoreOrder */
25#define PSTATE_PSO _AC(0x0000000000000040,UL) /* MM: PartialStoreOrder */
26#define PSTATE_RMO _AC(0x0000000000000080,UL) /* MM: RelaxedMemoryOrder*/
27#define PSTATE_RED _AC(0x0000000000000020,UL) /* Reset Error Debug. */
28#define PSTATE_PEF _AC(0x0000000000000010,UL) /* Floating Point Enable.*/
29#define PSTATE_AM _AC(0x0000000000000008,UL) /* Address Mask. */
30#define PSTATE_PRIV _AC(0x0000000000000004,UL) /* Privilege. */
31#define PSTATE_IE _AC(0x0000000000000002,UL) /* Interrupt Enable. */
32#define PSTATE_AG _AC(0x0000000000000001,UL) /* Alternate Globals. */
33
34/* The V9 TSTATE Register (with SpitFire and Linux extensions).
35 *
36 * ---------------------------------------------------------------------
37 * | Resv | GL | CCR | ASI | %pil | PSTATE | Resv | CWP |
38 * ---------------------------------------------------------------------
39 * 63 43 42 40 39 32 31 24 23 20 19 8 7 5 4 0
40 */
41#define TSTATE_GL _AC(0x0000070000000000,UL) /* Global reg level */
42#define TSTATE_CCR _AC(0x000000ff00000000,UL) /* Condition Codes. */
43#define TSTATE_XCC _AC(0x000000f000000000,UL) /* Condition Codes. */
44#define TSTATE_XNEG _AC(0x0000008000000000,UL) /* %xcc Negative. */
45#define TSTATE_XZERO _AC(0x0000004000000000,UL) /* %xcc Zero. */
46#define TSTATE_XOVFL _AC(0x0000002000000000,UL) /* %xcc Overflow. */
47#define TSTATE_XCARRY _AC(0x0000001000000000,UL) /* %xcc Carry. */
48#define TSTATE_ICC _AC(0x0000000f00000000,UL) /* Condition Codes. */
49#define TSTATE_INEG _AC(0x0000000800000000,UL) /* %icc Negative. */
50#define TSTATE_IZERO _AC(0x0000000400000000,UL) /* %icc Zero. */
51#define TSTATE_IOVFL _AC(0x0000000200000000,UL) /* %icc Overflow. */
52#define TSTATE_ICARRY _AC(0x0000000100000000,UL) /* %icc Carry. */
53#define TSTATE_ASI _AC(0x00000000ff000000,UL) /* AddrSpace ID. */
54#define TSTATE_PIL _AC(0x0000000000f00000,UL) /* %pil (Linux traps)*/
55#define TSTATE_PSTATE _AC(0x00000000000fff00,UL) /* PSTATE. */
56/* IG on V9 conflicts with MCDE on M7. TSTATE_MCDE will only be used on
57 * processors that support ADI which do not support IG, hence there is
58 * no functional conflict
59 */
60#define TSTATE_IG _AC(0x0000000000080000,UL) /* Interrupt Globals.*/
61#define TSTATE_MCDE _AC(0x0000000000080000,UL) /* MCD enable. */
62#define TSTATE_MG _AC(0x0000000000040000,UL) /* MMU Globals. */
63#define TSTATE_CLE _AC(0x0000000000020000,UL) /* CurrLittleEndian. */
64#define TSTATE_TLE _AC(0x0000000000010000,UL) /* TrapLittleEndian. */
65#define TSTATE_MM _AC(0x000000000000c000,UL) /* Memory Model. */
66#define TSTATE_TSO _AC(0x0000000000000000,UL) /* MM: TSO */
67#define TSTATE_PSO _AC(0x0000000000004000,UL) /* MM: PSO */
68#define TSTATE_RMO _AC(0x0000000000008000,UL) /* MM: RMO */
69#define TSTATE_RED _AC(0x0000000000002000,UL) /* Reset Error Debug.*/
70#define TSTATE_PEF _AC(0x0000000000001000,UL) /* FPU Enable. */
71#define TSTATE_AM _AC(0x0000000000000800,UL) /* Address Mask. */
72#define TSTATE_PRIV _AC(0x0000000000000400,UL) /* Privilege. */
73#define TSTATE_IE _AC(0x0000000000000200,UL) /* Interrupt Enable. */
74#define TSTATE_AG _AC(0x0000000000000100,UL) /* Alternate Globals.*/
75#define TSTATE_SYSCALL _AC(0x0000000000000020,UL) /* in syscall trap */
76#define TSTATE_CWP _AC(0x000000000000001f,UL) /* Curr Win-Pointer. */
77
78/* Floating-Point Registers State Register.
79 *
80 * --------------------------------
81 * | Resv | FEF | DU | DL |
82 * --------------------------------
83 * 63 3 2 1 0
84 */
85#define FPRS_FEF _AC(0x0000000000000004,UL) /* FPU Enable. */
86#define FPRS_DU _AC(0x0000000000000002,UL) /* Dirty Upper. */
87#define FPRS_DL _AC(0x0000000000000001,UL) /* Dirty Lower. */
88
89/* Version Register.
90 *
91 * ------------------------------------------------------
92 * | MANUF | IMPL | MASK | Resv | MAXTL | Resv | MAXWIN |
93 * ------------------------------------------------------
94 * 63 48 47 32 31 24 23 16 15 8 7 5 4 0
95 */
96#define VERS_MANUF _AC(0xffff000000000000,UL) /* Manufacturer. */
97#define VERS_IMPL _AC(0x0000ffff00000000,UL) /* Implementation. */
98#define VERS_MASK _AC(0x00000000ff000000,UL) /* Mask Set Revision.*/
99#define VERS_MAXTL _AC(0x000000000000ff00,UL) /* Max Trap Level. */
100#define VERS_MAXWIN _AC(0x000000000000001f,UL) /* Max RegWindow Idx.*/
101
102/* Compatibility Feature Register (%asr26), SPARC-T4 and later */
103#define CFR_AES _AC(0x0000000000000001,UL) /* Supports AES opcodes */
104#define CFR_DES _AC(0x0000000000000002,UL) /* Supports DES opcodes */
105#define CFR_KASUMI _AC(0x0000000000000004,UL) /* Supports KASUMI opcodes */
106#define CFR_CAMELLIA _AC(0x0000000000000008,UL) /* Supports CAMELLIA opcodes*/
107#define CFR_MD5 _AC(0x0000000000000010,UL) /* Supports MD5 opcodes */
108#define CFR_SHA1 _AC(0x0000000000000020,UL) /* Supports SHA1 opcodes */
109#define CFR_SHA256 _AC(0x0000000000000040,UL) /* Supports SHA256 opcodes */
110#define CFR_SHA512 _AC(0x0000000000000080,UL) /* Supports SHA512 opcodes */
111#define CFR_MPMUL _AC(0x0000000000000100,UL) /* Supports MPMUL opcodes */
112#define CFR_MONTMUL _AC(0x0000000000000200,UL) /* Supports MONTMUL opcodes */
113#define CFR_MONTSQR _AC(0x0000000000000400,UL) /* Supports MONTSQR opcodes */
114#define CFR_CRC32C _AC(0x0000000000000800,UL) /* Supports CRC32C opcodes */
115
116#endif /* !(_SPARC64_PSTATE_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/ptrace.h created+353
...@@ -0,0 +1,353 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_PTRACE_H
3#define __SPARC_PTRACE_H
4
5#if defined(__sparc__) && defined(__arch64__)
6/* 64 bit sparc */
7#include <asm/pstate.h>
8
9/* This struct defines the way the registers are stored on the
10 * stack during a system call and basically all traps.
11 */
12
13/* This magic value must have the low 9 bits clear,
14 * as that is where we encode the %tt value, see below.
15 */
16#define PT_REGS_MAGIC 0x57ac6c00
17
18#ifndef __ASSEMBLY__
19
20#include <linux/types.h>
21
22struct pt_regs {
23 unsigned long u_regs[16]; /* globals and ins */
24 unsigned long tstate;
25 unsigned long tpc;
26 unsigned long tnpc;
27 unsigned int y;
28
29 /* We encode a magic number, PT_REGS_MAGIC, along
30 * with the %tt (trap type) register value at trap
31 * entry time. The magic number allows us to identify
32 * accurately a trap stack frame in the stack
33 * unwinder, and the %tt value allows us to test
34 * things like "in a system call" etc. for an arbitray
35 * process.
36 *
37 * The PT_REGS_MAGIC is chosen such that it can be
38 * loaded completely using just a sethi instruction.
39 */
40 unsigned int magic;
41};
42
43struct pt_regs32 {
44 unsigned int psr;
45 unsigned int pc;
46 unsigned int npc;
47 unsigned int y;
48 unsigned int u_regs[16]; /* globals and ins */
49};
50
51/* A V9 register window */
52struct reg_window {
53 unsigned long locals[8];
54 unsigned long ins[8];
55};
56
57/* A 32-bit register window. */
58struct reg_window32 {
59 unsigned int locals[8];
60 unsigned int ins[8];
61};
62
63/* A V9 Sparc stack frame */
64struct sparc_stackf {
65 unsigned long locals[8];
66 unsigned long ins[6];
67 struct sparc_stackf *fp;
68 unsigned long callers_pc;
69 char *structptr;
70 unsigned long xargs[6];
71 unsigned long xxargs[1];
72};
73
74/* A 32-bit Sparc stack frame */
75struct sparc_stackf32 {
76 unsigned int locals[8];
77 unsigned int ins[6];
78 unsigned int fp;
79 unsigned int callers_pc;
80 unsigned int structptr;
81 unsigned int xargs[6];
82 unsigned int xxargs[1];
83};
84
85struct sparc_trapf {
86 unsigned long locals[8];
87 unsigned long ins[8];
88 unsigned long _unused;
89 struct pt_regs *regs;
90};
91#endif /* (!__ASSEMBLY__) */
92#else
93/* 32 bit sparc */
94
95#include <asm/psr.h>
96
97/* This struct defines the way the registers are stored on the
98 * stack during a system call and basically all traps.
99 */
100#ifndef __ASSEMBLY__
101
102#include <linux/types.h>
103
104struct pt_regs {
105 unsigned long psr;
106 unsigned long pc;
107 unsigned long npc;
108 unsigned long y;
109 unsigned long u_regs[16]; /* globals and ins */
110};
111
112/* A 32-bit register window. */
113struct reg_window32 {
114 unsigned long locals[8];
115 unsigned long ins[8];
116};
117
118/* A Sparc stack frame */
119struct sparc_stackf {
120 unsigned long locals[8];
121 unsigned long ins[6];
122 struct sparc_stackf *fp;
123 unsigned long callers_pc;
124 char *structptr;
125 unsigned long xargs[6];
126 unsigned long xxargs[1];
127};
128#endif /* (!__ASSEMBLY__) */
129
130#endif /* (defined(__sparc__) && defined(__arch64__))*/
131
132#ifndef __ASSEMBLY__
133
134#define TRACEREG_SZ sizeof(struct pt_regs)
135#define STACKFRAME_SZ sizeof(struct sparc_stackf)
136
137#define TRACEREG32_SZ sizeof(struct pt_regs32)
138#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
139
140#endif /* (!__ASSEMBLY__) */
141
142#define UREG_G0 0
143#define UREG_G1 1
144#define UREG_G2 2
145#define UREG_G3 3
146#define UREG_G4 4
147#define UREG_G5 5
148#define UREG_G6 6
149#define UREG_G7 7
150#define UREG_I0 8
151#define UREG_I1 9
152#define UREG_I2 10
153#define UREG_I3 11
154#define UREG_I4 12
155#define UREG_I5 13
156#define UREG_I6 14
157#define UREG_I7 15
158#define UREG_FP UREG_I6
159#define UREG_RETPC UREG_I7
160
161#if defined(__sparc__) && defined(__arch64__)
162/* 64 bit sparc */
163
164#ifndef __ASSEMBLY__
165
166
167#else /* __ASSEMBLY__ */
168/* For assembly code. */
169#define TRACEREG_SZ 0xa0
170#define STACKFRAME_SZ 0xc0
171
172#define TRACEREG32_SZ 0x50
173#define STACKFRAME32_SZ 0x60
174#endif /* __ASSEMBLY__ */
175
176#else /* (defined(__sparc__) && defined(__arch64__)) */
177
178/* 32 bit sparc */
179
180#ifndef __ASSEMBLY__
181
182
183#else /* (!__ASSEMBLY__) */
184/* For assembly code. */
185#define TRACEREG_SZ 0x50
186#define STACKFRAME_SZ 0x60
187#endif /* (!__ASSEMBLY__) */
188
189#endif /* (defined(__sparc__) && defined(__arch64__)) */
190
191
192/* These are for pt_regs. */
193#define PT_V9_G0 0x00
194#define PT_V9_G1 0x08
195#define PT_V9_G2 0x10
196#define PT_V9_G3 0x18
197#define PT_V9_G4 0x20
198#define PT_V9_G5 0x28
199#define PT_V9_G6 0x30
200#define PT_V9_G7 0x38
201#define PT_V9_I0 0x40
202#define PT_V9_I1 0x48
203#define PT_V9_I2 0x50
204#define PT_V9_I3 0x58
205#define PT_V9_I4 0x60
206#define PT_V9_I5 0x68
207#define PT_V9_I6 0x70
208#define PT_V9_FP PT_V9_I6
209#define PT_V9_I7 0x78
210#define PT_V9_TSTATE 0x80
211#define PT_V9_TPC 0x88
212#define PT_V9_TNPC 0x90
213#define PT_V9_Y 0x98
214#define PT_V9_MAGIC 0x9c
215#define PT_TSTATE PT_V9_TSTATE
216#define PT_TPC PT_V9_TPC
217#define PT_TNPC PT_V9_TNPC
218
219/* These for pt_regs32. */
220#define PT_PSR 0x0
221#define PT_PC 0x4
222#define PT_NPC 0x8
223#define PT_Y 0xc
224#define PT_G0 0x10
225#define PT_WIM PT_G0
226#define PT_G1 0x14
227#define PT_G2 0x18
228#define PT_G3 0x1c
229#define PT_G4 0x20
230#define PT_G5 0x24
231#define PT_G6 0x28
232#define PT_G7 0x2c
233#define PT_I0 0x30
234#define PT_I1 0x34
235#define PT_I2 0x38
236#define PT_I3 0x3c
237#define PT_I4 0x40
238#define PT_I5 0x44
239#define PT_I6 0x48
240#define PT_FP PT_I6
241#define PT_I7 0x4c
242
243/* Reg_window offsets */
244#define RW_V9_L0 0x00
245#define RW_V9_L1 0x08
246#define RW_V9_L2 0x10
247#define RW_V9_L3 0x18
248#define RW_V9_L4 0x20
249#define RW_V9_L5 0x28
250#define RW_V9_L6 0x30
251#define RW_V9_L7 0x38
252#define RW_V9_I0 0x40
253#define RW_V9_I1 0x48
254#define RW_V9_I2 0x50
255#define RW_V9_I3 0x58
256#define RW_V9_I4 0x60
257#define RW_V9_I5 0x68
258#define RW_V9_I6 0x70
259#define RW_V9_I7 0x78
260
261#define RW_L0 0x00
262#define RW_L1 0x04
263#define RW_L2 0x08
264#define RW_L3 0x0c
265#define RW_L4 0x10
266#define RW_L5 0x14
267#define RW_L6 0x18
268#define RW_L7 0x1c
269#define RW_I0 0x20
270#define RW_I1 0x24
271#define RW_I2 0x28
272#define RW_I3 0x2c
273#define RW_I4 0x30
274#define RW_I5 0x34
275#define RW_I6 0x38
276#define RW_I7 0x3c
277
278/* Stack_frame offsets */
279#define SF_V9_L0 0x00
280#define SF_V9_L1 0x08
281#define SF_V9_L2 0x10
282#define SF_V9_L3 0x18
283#define SF_V9_L4 0x20
284#define SF_V9_L5 0x28
285#define SF_V9_L6 0x30
286#define SF_V9_L7 0x38
287#define SF_V9_I0 0x40
288#define SF_V9_I1 0x48
289#define SF_V9_I2 0x50
290#define SF_V9_I3 0x58
291#define SF_V9_I4 0x60
292#define SF_V9_I5 0x68
293#define SF_V9_FP 0x70
294#define SF_V9_PC 0x78
295#define SF_V9_RETP 0x80
296#define SF_V9_XARG0 0x88
297#define SF_V9_XARG1 0x90
298#define SF_V9_XARG2 0x98
299#define SF_V9_XARG3 0xa0
300#define SF_V9_XARG4 0xa8
301#define SF_V9_XARG5 0xb0
302#define SF_V9_XXARG 0xb8
303
304#define SF_L0 0x00
305#define SF_L1 0x04
306#define SF_L2 0x08
307#define SF_L3 0x0c
308#define SF_L4 0x10
309#define SF_L5 0x14
310#define SF_L6 0x18
311#define SF_L7 0x1c
312#define SF_I0 0x20
313#define SF_I1 0x24
314#define SF_I2 0x28
315#define SF_I3 0x2c
316#define SF_I4 0x30
317#define SF_I5 0x34
318#define SF_FP 0x38
319#define SF_PC 0x3c
320#define SF_RETP 0x40
321#define SF_XARG0 0x44
322#define SF_XARG1 0x48
323#define SF_XARG2 0x4c
324#define SF_XARG3 0x50
325#define SF_XARG4 0x54
326#define SF_XARG5 0x58
327#define SF_XXARG 0x5c
328
329
330/* Stuff for the ptrace system call */
331#define PTRACE_SPARC_DETACH 11
332#define PTRACE_GETREGS 12
333#define PTRACE_SETREGS 13
334#define PTRACE_GETFPREGS 14
335#define PTRACE_SETFPREGS 15
336#define PTRACE_READDATA 16
337#define PTRACE_WRITEDATA 17
338#define PTRACE_READTEXT 18
339#define PTRACE_WRITETEXT 19
340#define PTRACE_GETFPAREGS 20
341#define PTRACE_SETFPAREGS 21
342
343/* There are for debugging 64-bit processes, either from a 32 or 64 bit
344 * parent. Thus their complements are for debugging 32-bit processes only.
345 */
346
347#define PTRACE_GETREGS64 22
348#define PTRACE_SETREGS64 23
349/* PTRACE_SYSCALL is 24 */
350#define PTRACE_GETFPREGS64 25
351#define PTRACE_SETFPREGS64 26
352
353#endif /* __SPARC_PTRACE_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/resource.h created+31
...@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * resource.h: Resource definitions.
4 *
5 * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC_RESOURCE_H
9#define _SPARC_RESOURCE_H
10
11/*
12 * These two resource limit IDs have a Sparc/Linux-specific ordering,
13 * the rest comes from the generic header:
14 */
15#define RLIMIT_NOFILE 6 /* max number of open files */
16#define RLIMIT_NPROC 7 /* max number of processes */
17
18#if defined(__sparc__) && defined(__arch64__)
19/* Use generic version */
20#else
21/*
22 * SuS says limits have to be unsigned.
23 * We make this unsigned, but keep the
24 * old value for compatibility:
25 */
26#define RLIM_INFINITY 0x7fffffff
27#endif
28
29#include <asm-generic/resource.h>
30
31#endif /* !(_SPARC_RESOURCE_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/sembuf.h created+32
...@@ -0,0 +1,32 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_SEMBUF_H
3#define _SPARC_SEMBUF_H
4
5#include <asm/ipcbuf.h>
6
7/*
8 * The semid64_ds structure for sparc architecture.
9 * Note extra padding because this structure is passed back and forth
10 * between kernel and user space.
11 *
12 * Pad space is left for:
13 * - 2 miscellaneous 32-bit values
14 */
15
16struct semid64_ds {
17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
18#if defined(__sparc__) && defined(__arch64__)
19 long sem_otime; /* last semop time */
20 long sem_ctime; /* last change time */
21#else
22 unsigned long sem_otime_high;
23 unsigned long sem_otime; /* last semop time */
24 unsigned long sem_ctime_high;
25 unsigned long sem_ctime; /* last change time */
26#endif
27 unsigned long sem_nsems; /* no. of semaphores in array */
28 unsigned long __unused1;
29 unsigned long __unused2;
30};
31
32#endif /* _SPARC64_SEMBUF_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/setup.h created+16
...@@ -0,0 +1,16 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Just a place holder.
4 */
5
6#ifndef _SPARC_SETUP_H
7#define _SPARC_SETUP_H
8
9#if defined(__sparc__) && defined(__arch64__)
10# define COMMAND_LINE_SIZE 2048
11#else
12# define COMMAND_LINE_SIZE 256
13#endif
14
15
16#endif /* _SPARC_SETUP_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/shmbuf.h created+48
...@@ -0,0 +1,48 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_SHMBUF_H
3#define _SPARC_SHMBUF_H
4
5/*
6 * The shmid64_ds structure for sparc architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for:
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16#if defined(__sparc__) && defined(__arch64__)
17 long shm_atime; /* last attach time */
18 long shm_dtime; /* last detach time */
19 long shm_ctime; /* last change time */
20#else
21 unsigned long shm_atime_high;
22 unsigned long shm_atime; /* last attach time */
23 unsigned long shm_dtime_high;
24 unsigned long shm_dtime; /* last detach time */
25 unsigned long shm_ctime_high;
26 unsigned long shm_ctime; /* last change time */
27#endif
28 size_t shm_segsz; /* size of segment (bytes) */
29 __kernel_pid_t shm_cpid; /* pid of creator */
30 __kernel_pid_t shm_lpid; /* pid of last operator */
31 unsigned long shm_nattch; /* no. of current attaches */
32 unsigned long __unused1;
33 unsigned long __unused2;
34};
35
36struct shminfo64 {
37 unsigned long shmmax;
38 unsigned long shmmin;
39 unsigned long shmmni;
40 unsigned long shmseg;
41 unsigned long shmall;
42 unsigned long __unused1;
43 unsigned long __unused2;
44 unsigned long __unused3;
45 unsigned long __unused4;
46};
47
48#endif /* _SPARC_SHMBUF_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/sigcontext.h created+5
...@@ -0,0 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * There isn't anything here anymore, but the file must not be empty or patch
4 * will delete it.
5 */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/siginfo.h created+16
...@@ -0,0 +1,16 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_SIGINFO_H
3#define __SPARC_SIGINFO_H
4
5#if defined(__sparc__) && defined(__arch64__)
6
7#define __ARCH_SI_BAND_T int
8
9#endif /* defined(__sparc__) && defined(__arch64__) */
10
11#include <asm-generic/siginfo.h>
12
13
14#define SI_NOINFO 32767 /* no information in siginfo_t */
15
16#endif /* __SPARC_SIGINFO_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/signal.h created+178
...@@ -0,0 +1,178 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_SIGNAL_H
3#define __SPARC_SIGNAL_H
4
5#include <asm/sigcontext.h>
6
7
8
9/* On the Sparc the signal handlers get passed a 'sub-signal' code
10 * for certain signal types, which we document here.
11 */
12#define SIGHUP 1
13#define SIGINT 2
14#define SIGQUIT 3
15#define SIGILL 4
16#define SUBSIG_STACK 0
17#define SUBSIG_ILLINST 2
18#define SUBSIG_PRIVINST 3
19#define SUBSIG_BADTRAP(t) (0x80 + (t))
20
21#define SIGTRAP 5
22#define SIGABRT 6
23#define SIGIOT 6
24
25#define SIGEMT 7
26#define SUBSIG_TAG 10
27
28#define SIGFPE 8
29#define SUBSIG_FPDISABLED 0x400
30#define SUBSIG_FPERROR 0x404
31#define SUBSIG_FPINTOVFL 0x001
32#define SUBSIG_FPSTSIG 0x002
33#define SUBSIG_IDIVZERO 0x014
34#define SUBSIG_FPINEXACT 0x0c4
35#define SUBSIG_FPDIVZERO 0x0c8
36#define SUBSIG_FPUNFLOW 0x0cc
37#define SUBSIG_FPOPERROR 0x0d0
38#define SUBSIG_FPOVFLOW 0x0d4
39
40#define SIGKILL 9
41#define SIGBUS 10
42#define SUBSIG_BUSTIMEOUT 1
43#define SUBSIG_ALIGNMENT 2
44#define SUBSIG_MISCERROR 5
45
46#define SIGSEGV 11
47#define SUBSIG_NOMAPPING 3
48#define SUBSIG_PROTECTION 4
49#define SUBSIG_SEGERROR 5
50
51#define SIGSYS 12
52
53#define SIGPIPE 13
54#define SIGALRM 14
55#define SIGTERM 15
56#define SIGURG 16
57
58/* SunOS values which deviate from the Linux/i386 ones */
59#define SIGSTOP 17
60#define SIGTSTP 18
61#define SIGCONT 19
62#define SIGCHLD 20
63#define SIGTTIN 21
64#define SIGTTOU 22
65#define SIGIO 23
66#define SIGPOLL SIGIO /* SysV name for SIGIO */
67#define SIGXCPU 24
68#define SIGXFSZ 25
69#define SIGVTALRM 26
70#define SIGPROF 27
71#define SIGWINCH 28
72#define SIGLOST 29
73#define SIGPWR SIGLOST
74#define SIGUSR1 30
75#define SIGUSR2 31
76
77/* Most things should be clean enough to redefine this at will, if care
78 is taken to make libc match. */
79
80#define __OLD_NSIG 32
81#define __NEW_NSIG 64
82#ifdef __arch64__
83#define _NSIG_BPW 64
84#else
85#define _NSIG_BPW 32
86#endif
87#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
88
89#define SIGRTMIN 32
90#define SIGRTMAX __NEW_NSIG
91
92#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
93#define _NSIG __NEW_NSIG
94#define __new_sigset_t sigset_t
95#define __new_sigaction sigaction
96#define __new_sigaction32 sigaction32
97#define __old_sigset_t old_sigset_t
98#define __old_sigaction old_sigaction
99#define __old_sigaction32 old_sigaction32
100#else
101#define _NSIG __OLD_NSIG
102#define NSIG _NSIG
103#define __old_sigset_t sigset_t
104#define __old_sigaction sigaction
105#define __old_sigaction32 sigaction32
106#endif
107
108#ifndef __ASSEMBLY__
109
110typedef unsigned long __old_sigset_t; /* at least 32 bits */
111
112typedef struct {
113 unsigned long sig[_NSIG_WORDS];
114} __new_sigset_t;
115
116/* A SunOS sigstack */
117struct sigstack {
118 /* XXX 32-bit pointers pinhead XXX */
119 char *the_stack;
120 int cur_status;
121};
122
123/* Sigvec flags */
124#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
125#define _SV_INTR 2u /* Sig return should not restart system call */
126#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
127#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
128
129/*
130 * sa_flags values: SA_STACK is not currently supported, but will allow the
131 * usage of signal stacks by using the (now obsolete) sa_restorer field in
132 * the sigaction structure as a stack pointer. This is now possible due to
133 * the changes in signal handling. LBT 010493.
134 * SA_RESTART flag to get restarting signals (which were the default long ago)
135 */
136#define SA_NOCLDSTOP _SV_IGNCHILD
137#define SA_STACK _SV_SSTACK
138#define SA_ONSTACK _SV_SSTACK
139#define SA_RESTART _SV_INTR
140#define SA_RESETHAND _SV_RESET
141#define SA_NODEFER 0x20u
142#define SA_NOCLDWAIT 0x100u
143#define SA_SIGINFO 0x200u
144
145#define SIG_BLOCK 0x01 /* for blocking signals */
146#define SIG_UNBLOCK 0x02 /* for unblocking signals */
147#define SIG_SETMASK 0x04 /* for setting the signal mask */
148
149#define MINSIGSTKSZ 4096
150#define SIGSTKSZ 16384
151
152
153#include <asm-generic/signal-defs.h>
154
155struct __new_sigaction {
156 __sighandler_t sa_handler;
157 unsigned long sa_flags;
158 __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
159 __new_sigset_t sa_mask;
160};
161
162struct __old_sigaction {
163 __sighandler_t sa_handler;
164 __old_sigset_t sa_mask;
165 unsigned long sa_flags;
166 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
167};
168
169typedef struct sigaltstack {
170 void *ss_sp;
171 int ss_flags;
172 size_t ss_size;
173} stack_t;
174
175
176#endif /* !(__ASSEMBLY__) */
177
178#endif /* __SPARC_SIGNAL_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/socket.h created+153
...@@ -0,0 +1,153 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SOCKET_H
3#define _ASM_SOCKET_H
4
5#include <linux/posix_types.h>
6#include <asm/sockios.h>
7
8/* For setsockopt(2) */
9#define SOL_SOCKET 0xffff
10
11#define SO_DEBUG 0x0001
12#define SO_PASSCRED 0x0002
13#define SO_REUSEADDR 0x0004
14#define SO_KEEPALIVE 0x0008
15#define SO_DONTROUTE 0x0010
16#define SO_BROADCAST 0x0020
17#define SO_PEERCRED 0x0040
18#define SO_LINGER 0x0080
19#define SO_OOBINLINE 0x0100
20#define SO_REUSEPORT 0x0200
21#define SO_BSDCOMPAT 0x0400
22#define SO_RCVLOWAT 0x0800
23#define SO_SNDLOWAT 0x1000
24#define SO_RCVTIMEO_OLD 0x2000
25#define SO_SNDTIMEO_OLD 0x4000
26#define SO_ACCEPTCONN 0x8000
27
28#define SO_SNDBUF 0x1001
29#define SO_RCVBUF 0x1002
30#define SO_SNDBUFFORCE 0x100a
31#define SO_RCVBUFFORCE 0x100b
32#define SO_ERROR 0x1007
33#define SO_TYPE 0x1008
34#define SO_PROTOCOL 0x1028
35#define SO_DOMAIN 0x1029
36
37/* Linux specific, keep the same. */
38#define SO_NO_CHECK 0x000b
39#define SO_PRIORITY 0x000c
40
41#define SO_BINDTODEVICE 0x000d
42
43#define SO_ATTACH_FILTER 0x001a
44#define SO_DETACH_FILTER 0x001b
45#define SO_GET_FILTER SO_ATTACH_FILTER
46
47#define SO_PEERNAME 0x001c
48
49#define SO_PEERSEC 0x001e
50#define SO_PASSSEC 0x001f
51
52#define SO_MARK 0x0022
53
54#define SO_RXQ_OVFL 0x0024
55
56#define SO_WIFI_STATUS 0x0025
57#define SCM_WIFI_STATUS SO_WIFI_STATUS
58#define SO_PEEK_OFF 0x0026
59
60/* Instruct lower device to use last 4-bytes of skb data as FCS */
61#define SO_NOFCS 0x0027
62
63#define SO_LOCK_FILTER 0x0028
64
65#define SO_SELECT_ERR_QUEUE 0x0029
66
67#define SO_BUSY_POLL 0x0030
68
69#define SO_MAX_PACING_RATE 0x0031
70
71#define SO_BPF_EXTENSIONS 0x0032
72
73#define SO_INCOMING_CPU 0x0033
74
75#define SO_ATTACH_BPF 0x0034
76#define SO_DETACH_BPF SO_DETACH_FILTER
77
78#define SO_ATTACH_REUSEPORT_CBPF 0x0035
79#define SO_ATTACH_REUSEPORT_EBPF 0x0036
80
81#define SO_CNX_ADVICE 0x0037
82
83#define SCM_TIMESTAMPING_OPT_STATS 0x0038
84
85#define SO_MEMINFO 0x0039
86
87#define SO_INCOMING_NAPI_ID 0x003a
88
89#define SO_COOKIE 0x003b
90
91#define SCM_TIMESTAMPING_PKTINFO 0x003c
92
93#define SO_PEERGROUPS 0x003d
94
95#define SO_ZEROCOPY 0x003e
96
97#define SO_TXTIME 0x003f
98#define SCM_TXTIME SO_TXTIME
99
100#define SO_BINDTOIFINDEX 0x0041
101
102/* Security levels - as per NRL IPv6 - don't actually do anything */
103#define SO_SECURITY_AUTHENTICATION 0x5001
104#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
105#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004
106
107#define SO_TIMESTAMP_OLD 0x001d
108#define SO_TIMESTAMPNS_OLD 0x0021
109#define SO_TIMESTAMPING_OLD 0x0023
110
111#define SO_TIMESTAMP_NEW 0x0046
112#define SO_TIMESTAMPNS_NEW 0x0042
113#define SO_TIMESTAMPING_NEW 0x0043
114
115#define SO_RCVTIMEO_NEW 0x0044
116#define SO_SNDTIMEO_NEW 0x0045
117
118#define SO_DETACH_REUSEPORT_BPF 0x0047
119
120#define SO_PREFER_BUSY_POLL 0x0048
121#define SO_BUSY_POLL_BUDGET 0x0049
122
123#define SO_NETNS_COOKIE 0x0050
124
125#define SO_BUF_LOCK 0x0051
126
127#define SO_RESERVE_MEM 0x0052
128
129
130
131
132#if __BITS_PER_LONG == 64
133#define SO_TIMESTAMP SO_TIMESTAMP_OLD
134#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
135#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
136
137#define SO_RCVTIMEO SO_RCVTIMEO_OLD
138#define SO_SNDTIMEO SO_SNDTIMEO_OLD
139#else
140#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
141#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
142#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
143
144#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
145#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
146#endif
147
148#define SCM_TIMESTAMP SO_TIMESTAMP
149#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
150#define SCM_TIMESTAMPING SO_TIMESTAMPING
151
152
153#endif /* _ASM_SOCKET_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/stat.h created+108
...@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SPARC_STAT_H
3#define __SPARC_STAT_H
4
5#include <linux/types.h>
6
7#if defined(__sparc__) && defined(__arch64__)
8/* 64 bit sparc */
9struct stat {
10 unsigned int st_dev;
11 ino_t st_ino;
12 mode_t st_mode;
13 short st_nlink;
14 uid_t st_uid;
15 gid_t st_gid;
16 unsigned int st_rdev;
17 long st_size;
18 long st_atime;
19 long st_mtime;
20 long st_ctime;
21 long st_blksize;
22 long st_blocks;
23 unsigned long __unused4[2];
24};
25
26struct stat64 {
27 unsigned long st_dev;
28 unsigned long st_ino;
29 unsigned long st_nlink;
30
31 unsigned int st_mode;
32 unsigned int st_uid;
33 unsigned int st_gid;
34 unsigned int __pad0;
35
36 unsigned long st_rdev;
37 long st_size;
38 long st_blksize;
39 long st_blocks;
40
41 unsigned long st_atime;
42 unsigned long st_atime_nsec;
43 unsigned long st_mtime;
44 unsigned long st_mtime_nsec;
45 unsigned long st_ctime;
46 unsigned long st_ctime_nsec;
47 long __unused[3];
48};
49
50#else
51/* 32 bit sparc */
52struct stat {
53 unsigned short st_dev;
54 ino_t st_ino;
55 mode_t st_mode;
56 short st_nlink;
57 unsigned short st_uid;
58 unsigned short st_gid;
59 unsigned short st_rdev;
60 long st_size;
61 long st_atime;
62 unsigned long st_atime_nsec;
63 long st_mtime;
64 unsigned long st_mtime_nsec;
65 long st_ctime;
66 unsigned long st_ctime_nsec;
67 long st_blksize;
68 long st_blocks;
69 unsigned long __unused4[2];
70};
71
72#define STAT_HAVE_NSEC 1
73
74struct stat64 {
75 unsigned long long st_dev;
76
77 unsigned long long st_ino;
78
79 unsigned int st_mode;
80 unsigned int st_nlink;
81
82 unsigned int st_uid;
83 unsigned int st_gid;
84
85 unsigned long long st_rdev;
86
87 unsigned char __pad3[8];
88
89 long long st_size;
90 unsigned int st_blksize;
91
92 unsigned char __pad4[8];
93 unsigned int st_blocks;
94
95 unsigned int st_atime;
96 unsigned int st_atime_nsec;
97
98 unsigned int st_mtime;
99 unsigned int st_mtime_nsec;
100
101 unsigned int st_ctime;
102 unsigned int st_ctime_nsec;
103
104 unsigned int __unused4;
105 unsigned int __unused5;
106};
107#endif /* defined(__sparc__) && defined(__arch64__) */
108#endif /* __SPARC_STAT_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/swab.h created+46
...@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_SWAB_H
3#define _SPARC_SWAB_H
4
5#include <linux/types.h>
6#include <asm/asi.h>
7
8#if defined(__sparc__) && defined(__arch64__)
9static __inline__ __u16 __arch_swab16p(const __u16 *addr)
10{
11 __u16 ret;
12
13 __asm__ __volatile__ ("lduha [%2] %3, %0"
14 : "=r" (ret)
15 : "m" (*addr), "r" (addr), "i" (ASI_PL));
16 return ret;
17}
18#define __arch_swab16p __arch_swab16p
19
20static __inline__ __u32 __arch_swab32p(const __u32 *addr)
21{
22 __u32 ret;
23
24 __asm__ __volatile__ ("lduwa [%2] %3, %0"
25 : "=r" (ret)
26 : "m" (*addr), "r" (addr), "i" (ASI_PL));
27 return ret;
28}
29#define __arch_swab32p __arch_swab32p
30
31static __inline__ __u64 __arch_swab64p(const __u64 *addr)
32{
33 __u64 ret;
34
35 __asm__ __volatile__ ("ldxa [%2] %3, %0"
36 : "=r" (ret)
37 : "m" (*addr), "r" (addr), "i" (ASI_PL));
38 return ret;
39}
40#define __arch_swab64p __arch_swab64p
41
42#else
43#define __SWAB_64_THRU_32__
44#endif /* defined(__sparc__) && defined(__arch64__) */
45
46#endif /* _SPARC_SWAB_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/termbits.h created+257
...@@ -0,0 +1,257 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_TERMBITS_H
3#define _SPARC_TERMBITS_H
4
5#include <linux/posix_types.h>
6
7typedef unsigned char cc_t;
8typedef unsigned int speed_t;
9
10#if defined(__sparc__) && defined(__arch64__)
11typedef unsigned int tcflag_t;
12#else
13typedef unsigned long tcflag_t;
14#endif
15
16#define NCC 8
17struct termio {
18 unsigned short c_iflag; /* input mode flags */
19 unsigned short c_oflag; /* output mode flags */
20 unsigned short c_cflag; /* control mode flags */
21 unsigned short c_lflag; /* local mode flags */
22 unsigned char c_line; /* line discipline */
23 unsigned char c_cc[NCC]; /* control characters */
24};
25
26#define NCCS 17
27struct termios {
28 tcflag_t c_iflag; /* input mode flags */
29 tcflag_t c_oflag; /* output mode flags */
30 tcflag_t c_cflag; /* control mode flags */
31 tcflag_t c_lflag; /* local mode flags */
32 cc_t c_line; /* line discipline */
33 cc_t c_cc[NCCS]; /* control characters */
34};
35
36struct termios2 {
37 tcflag_t c_iflag; /* input mode flags */
38 tcflag_t c_oflag; /* output mode flags */
39 tcflag_t c_cflag; /* control mode flags */
40 tcflag_t c_lflag; /* local mode flags */
41 cc_t c_line; /* line discipline */
42 cc_t c_cc[NCCS+2]; /* control characters */
43 speed_t c_ispeed; /* input speed */
44 speed_t c_ospeed; /* output speed */
45};
46
47struct ktermios {
48 tcflag_t c_iflag; /* input mode flags */
49 tcflag_t c_oflag; /* output mode flags */
50 tcflag_t c_cflag; /* control mode flags */
51 tcflag_t c_lflag; /* local mode flags */
52 cc_t c_line; /* line discipline */
53 cc_t c_cc[NCCS+2]; /* control characters */
54 speed_t c_ispeed; /* input speed */
55 speed_t c_ospeed; /* output speed */
56};
57
58/* c_cc characters */
59#define VINTR 0
60#define VQUIT 1
61#define VERASE 2
62#define VKILL 3
63#define VEOF 4
64#define VEOL 5
65#define VEOL2 6
66#define VSWTC 7
67#define VSTART 8
68#define VSTOP 9
69
70
71
72#define VSUSP 10
73#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
74#define VREPRINT 12
75#define VDISCARD 13
76#define VWERASE 14
77#define VLNEXT 15
78
79/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
80 * shared with eof/eol
81 */
82#define VMIN VEOF
83#define VTIME VEOL
84
85/* c_iflag bits */
86#define IGNBRK 0x00000001
87#define BRKINT 0x00000002
88#define IGNPAR 0x00000004
89#define PARMRK 0x00000008
90#define INPCK 0x00000010
91#define ISTRIP 0x00000020
92#define INLCR 0x00000040
93#define IGNCR 0x00000080
94#define ICRNL 0x00000100
95#define IUCLC 0x00000200
96#define IXON 0x00000400
97#define IXANY 0x00000800
98#define IXOFF 0x00001000
99#define IMAXBEL 0x00002000
100#define IUTF8 0x00004000
101
102/* c_oflag bits */
103#define OPOST 0x00000001
104#define OLCUC 0x00000002
105#define ONLCR 0x00000004
106#define OCRNL 0x00000008
107#define ONOCR 0x00000010
108#define ONLRET 0x00000020
109#define OFILL 0x00000040
110#define OFDEL 0x00000080
111#define NLDLY 0x00000100
112#define NL0 0x00000000
113#define NL1 0x00000100
114#define CRDLY 0x00000600
115#define CR0 0x00000000
116#define CR1 0x00000200
117#define CR2 0x00000400
118#define CR3 0x00000600
119#define TABDLY 0x00001800
120#define TAB0 0x00000000
121#define TAB1 0x00000800
122#define TAB2 0x00001000
123#define TAB3 0x00001800
124#define XTABS 0x00001800
125#define BSDLY 0x00002000
126#define BS0 0x00000000
127#define BS1 0x00002000
128#define VTDLY 0x00004000
129#define VT0 0x00000000
130#define VT1 0x00004000
131#define FFDLY 0x00008000
132#define FF0 0x00000000
133#define FF1 0x00008000
134#define PAGEOUT 0x00010000 /* SUNOS specific */
135#define WRAP 0x00020000 /* SUNOS specific */
136
137/* c_cflag bit meaning */
138#define CBAUD 0x0000100f
139#define B0 0x00000000 /* hang up */
140#define B50 0x00000001
141#define B75 0x00000002
142#define B110 0x00000003
143#define B134 0x00000004
144#define B150 0x00000005
145#define B200 0x00000006
146#define B300 0x00000007
147#define B600 0x00000008
148#define B1200 0x00000009
149#define B1800 0x0000000a
150#define B2400 0x0000000b
151#define B4800 0x0000000c
152#define B9600 0x0000000d
153#define B19200 0x0000000e
154#define B38400 0x0000000f
155#define EXTA B19200
156#define EXTB B38400
157#define CSIZE 0x00000030
158#define CS5 0x00000000
159#define CS6 0x00000010
160#define CS7 0x00000020
161#define CS8 0x00000030
162#define CSTOPB 0x00000040
163#define CREAD 0x00000080
164#define PARENB 0x00000100
165#define PARODD 0x00000200
166#define HUPCL 0x00000400
167#define CLOCAL 0x00000800
168#define CBAUDEX 0x00001000
169/* We'll never see these speeds with the Zilogs, but for completeness... */
170#define BOTHER 0x00001000
171#define B57600 0x00001001
172#define B115200 0x00001002
173#define B230400 0x00001003
174#define B460800 0x00001004
175/* This is what we can do with the Zilogs. */
176#define B76800 0x00001005
177/* This is what we can do with the SAB82532. */
178#define B153600 0x00001006
179#define B307200 0x00001007
180#define B614400 0x00001008
181#define B921600 0x00001009
182/* And these are the rest... */
183#define B500000 0x0000100a
184#define B576000 0x0000100b
185#define B1000000 0x0000100c
186#define B1152000 0x0000100d
187#define B1500000 0x0000100e
188#define B2000000 0x0000100f
189/* These have totally bogus values and nobody uses them
190 so far. Later on we'd have to use say 0x10000x and
191 adjust CBAUD constant and drivers accordingly.
192#define B2500000 0x00001010
193#define B3000000 0x00001011
194#define B3500000 0x00001012
195#define B4000000 0x00001013 */
196#define CIBAUD 0x100f0000 /* input baud rate (not used) */
197#define CMSPAR 0x40000000 /* mark or space (stick) parity */
198#define CRTSCTS 0x80000000 /* flow control */
199
200#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
201
202/* c_lflag bits */
203#define ISIG 0x00000001
204#define ICANON 0x00000002
205#define XCASE 0x00000004
206#define ECHO 0x00000008
207#define ECHOE 0x00000010
208#define ECHOK 0x00000020
209#define ECHONL 0x00000040
210#define NOFLSH 0x00000080
211#define TOSTOP 0x00000100
212#define ECHOCTL 0x00000200
213#define ECHOPRT 0x00000400
214#define ECHOKE 0x00000800
215#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
216#define FLUSHO 0x00002000
217#define PENDIN 0x00004000
218#define IEXTEN 0x00008000
219#define EXTPROC 0x00010000
220
221/* modem lines */
222#define TIOCM_LE 0x001
223#define TIOCM_DTR 0x002
224#define TIOCM_RTS 0x004
225#define TIOCM_ST 0x008
226#define TIOCM_SR 0x010
227#define TIOCM_CTS 0x020
228#define TIOCM_CAR 0x040
229#define TIOCM_RNG 0x080
230#define TIOCM_DSR 0x100
231#define TIOCM_CD TIOCM_CAR
232#define TIOCM_RI TIOCM_RNG
233#define TIOCM_OUT1 0x2000
234#define TIOCM_OUT2 0x4000
235#define TIOCM_LOOP 0x8000
236
237/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
238#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
239
240
241/* tcflow() and TCXONC use these */
242#define TCOOFF 0
243#define TCOON 1
244#define TCIOFF 2
245#define TCION 3
246
247/* tcflush() and TCFLSH use these */
248#define TCIFLUSH 0
249#define TCOFLUSH 1
250#define TCIOFLUSH 2
251
252/* tcsetattr uses these */
253#define TCSANOW 0
254#define TCSADRAIN 1
255#define TCSAFLUSH 2
256
257#endif /* _SPARC_TERMBITS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/termios.h created+44
...@@ -0,0 +1,44 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_TERMIOS_H
3#define _SPARC_TERMIOS_H
4
5#include <asm/ioctls.h>
6#include <asm/termbits.h>
7
8#if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS)
9struct sgttyb {
10 char sg_ispeed;
11 char sg_ospeed;
12 char sg_erase;
13 char sg_kill;
14 short sg_flags;
15};
16
17struct tchars {
18 char t_intrc;
19 char t_quitc;
20 char t_startc;
21 char t_stopc;
22 char t_eofc;
23 char t_brkc;
24};
25
26struct ltchars {
27 char t_suspc;
28 char t_dsuspc;
29 char t_rprntc;
30 char t_flushc;
31 char t_werasc;
32 char t_lnextc;
33};
34#endif /* __KERNEL__ */
35
36struct winsize {
37 unsigned short ws_row;
38 unsigned short ws_col;
39 unsigned short ws_xpixel;
40 unsigned short ws_ypixel;
41};
42
43
44#endif /* _SPARC_TERMIOS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/traps.h created+121
...@@ -0,0 +1,121 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * traps.h: Format of entries for the Sparc trap table.
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC_TRAPS_H
9#define _SPARC_TRAPS_H
10
11#define NUM_SPARC_TRAPS 255
12
13#ifndef __ASSEMBLY__
14#endif /* !(__ASSEMBLY__) */
15
16/* For patching the trap table at boot time, we need to know how to
17 * form various common Sparc instructions. Thus these macros...
18 */
19
20#define SPARC_MOV_CONST_L3(const) (0xa6102000 | (const&0xfff))
21
22/* The following assumes that the branch lies before the place we
23 * are branching to. This is the case for a trap vector...
24 * You have been warned.
25 */
26#define SPARC_BRANCH(dest_addr, inst_addr) \
27 (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
28
29#define SPARC_RD_PSR_L0 (0xa1480000)
30#define SPARC_RD_WIM_L3 (0xa7500000)
31#define SPARC_NOP (0x01000000)
32
33/* Various interesting trap levels. */
34/* First, hardware traps. */
35#define SP_TRAP_TFLT 0x1 /* Text fault */
36#define SP_TRAP_II 0x2 /* Illegal Instruction */
37#define SP_TRAP_PI 0x3 /* Privileged Instruction */
38#define SP_TRAP_FPD 0x4 /* Floating Point Disabled */
39#define SP_TRAP_WOVF 0x5 /* Window Overflow */
40#define SP_TRAP_WUNF 0x6 /* Window Underflow */
41#define SP_TRAP_MNA 0x7 /* Memory Address Unaligned */
42#define SP_TRAP_FPE 0x8 /* Floating Point Exception */
43#define SP_TRAP_DFLT 0x9 /* Data Fault */
44#define SP_TRAP_TOF 0xa /* Tag Overflow */
45#define SP_TRAP_WDOG 0xb /* Watchpoint Detected */
46#define SP_TRAP_IRQ1 0x11 /* IRQ level 1 */
47#define SP_TRAP_IRQ2 0x12 /* IRQ level 2 */
48#define SP_TRAP_IRQ3 0x13 /* IRQ level 3 */
49#define SP_TRAP_IRQ4 0x14 /* IRQ level 4 */
50#define SP_TRAP_IRQ5 0x15 /* IRQ level 5 */
51#define SP_TRAP_IRQ6 0x16 /* IRQ level 6 */
52#define SP_TRAP_IRQ7 0x17 /* IRQ level 7 */
53#define SP_TRAP_IRQ8 0x18 /* IRQ level 8 */
54#define SP_TRAP_IRQ9 0x19 /* IRQ level 9 */
55#define SP_TRAP_IRQ10 0x1a /* IRQ level 10 */
56#define SP_TRAP_IRQ11 0x1b /* IRQ level 11 */
57#define SP_TRAP_IRQ12 0x1c /* IRQ level 12 */
58#define SP_TRAP_IRQ13 0x1d /* IRQ level 13 */
59#define SP_TRAP_IRQ14 0x1e /* IRQ level 14 */
60#define SP_TRAP_IRQ15 0x1f /* IRQ level 15 Non-maskable */
61#define SP_TRAP_RACC 0x20 /* Register Access Error ??? */
62#define SP_TRAP_IACC 0x21 /* Instruction Access Error */
63#define SP_TRAP_CPDIS 0x24 /* Co-Processor Disabled */
64#define SP_TRAP_BADFL 0x25 /* Unimplemented Flush Instruction */
65#define SP_TRAP_CPEXP 0x28 /* Co-Processor Exception */
66#define SP_TRAP_DACC 0x29 /* Data Access Error */
67#define SP_TRAP_DIVZ 0x2a /* Divide By Zero */
68#define SP_TRAP_DSTORE 0x2b /* Data Store Error ??? */
69#define SP_TRAP_DMM 0x2c /* Data Access MMU Miss ??? */
70#define SP_TRAP_IMM 0x3c /* Instruction Access MMU Miss ??? */
71
72/* Now the Software Traps... */
73#define SP_TRAP_SUNOS 0x80 /* SunOS System Call */
74#define SP_TRAP_SBPT 0x81 /* Software Breakpoint */
75#define SP_TRAP_SDIVZ 0x82 /* Software Divide-by-Zero trap */
76#define SP_TRAP_FWIN 0x83 /* Flush Windows */
77#define SP_TRAP_CWIN 0x84 /* Clean Windows */
78#define SP_TRAP_RCHK 0x85 /* Range Check */
79#define SP_TRAP_FUNA 0x86 /* Fix Unaligned Access */
80#define SP_TRAP_IOWFL 0x87 /* Integer Overflow */
81#define SP_TRAP_SOLARIS 0x88 /* Solaris System Call */
82#define SP_TRAP_NETBSD 0x89 /* NetBSD System Call */
83#define SP_TRAP_LINUX 0x90 /* Linux System Call */
84
85/* Names used for compatibility with SunOS */
86#define ST_SYSCALL 0x00
87#define ST_BREAKPOINT 0x01
88#define ST_DIV0 0x02
89#define ST_FLUSH_WINDOWS 0x03
90#define ST_CLEAN_WINDOWS 0x04
91#define ST_RANGE_CHECK 0x05
92#define ST_FIX_ALIGN 0x06
93#define ST_INT_OVERFLOW 0x07
94
95/* Special traps... */
96#define SP_TRAP_KBPT1 0xfe /* KADB/PROM Breakpoint one */
97#define SP_TRAP_KBPT2 0xff /* KADB/PROM Breakpoint two */
98
99/* Handy Macros */
100/* Is this a trap we never expect to get? */
101#define BAD_TRAP_P(level) \
102 ((level > SP_TRAP_WDOG && level < SP_TRAP_IRQ1) || \
103 (level > SP_TRAP_IACC && level < SP_TRAP_CPDIS) || \
104 (level > SP_TRAP_BADFL && level < SP_TRAP_CPEXP) || \
105 (level > SP_TRAP_DMM && level < SP_TRAP_IMM) || \
106 (level > SP_TRAP_IMM && level < SP_TRAP_SUNOS) || \
107 (level > SP_TRAP_LINUX && level < SP_TRAP_KBPT1))
108
109/* Is this a Hardware trap? */
110#define HW_TRAP_P(level) ((level > 0) && (level < SP_TRAP_SUNOS))
111
112/* Is this a Software trap? */
113#define SW_TRAP_P(level) ((level >= SP_TRAP_SUNOS) && (level <= SP_TRAP_KBPT2))
114
115/* Is this a system call for some OS we know about? */
116#define SCALL_TRAP_P(level) ((level == SP_TRAP_SUNOS) || \
117 (level == SP_TRAP_SOLARIS) || \
118 (level == SP_TRAP_NETBSD) || \
119 (level == SP_TRAP_LINUX))
120
121#endif /* _SPARC_TRAPS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/uctx.h created+72
...@@ -0,0 +1,72 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * uctx.h: Sparc64 {set,get}context() register state layouts.
4 *
5 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef __SPARC64_UCTX_H
9#define __SPARC64_UCTX_H
10
11#define MC_TSTATE 0
12#define MC_PC 1
13#define MC_NPC 2
14#define MC_Y 3
15#define MC_G1 4
16#define MC_G2 5
17#define MC_G3 6
18#define MC_G4 7
19#define MC_G5 8
20#define MC_G6 9
21#define MC_G7 10
22#define MC_O0 11
23#define MC_O1 12
24#define MC_O2 13
25#define MC_O3 14
26#define MC_O4 15
27#define MC_O5 16
28#define MC_O6 17
29#define MC_O7 18
30#define MC_NGREG 19
31
32typedef unsigned long mc_greg_t;
33typedef mc_greg_t mc_gregset_t[MC_NGREG];
34
35#define MC_MAXFPQ 16
36struct mc_fq {
37 unsigned long *mcfq_addr;
38 unsigned int mcfq_insn;
39};
40
41struct mc_fpu {
42 union {
43 unsigned int sregs[32];
44 unsigned long dregs[32];
45 long double qregs[16];
46 } mcfpu_fregs;
47 unsigned long mcfpu_fsr;
48 unsigned long mcfpu_fprs;
49 unsigned long mcfpu_gsr;
50 struct mc_fq *mcfpu_fq;
51 unsigned char mcfpu_qcnt;
52 unsigned char mcfpu_qentsz;
53 unsigned char mcfpu_enab;
54};
55typedef struct mc_fpu mc_fpu_t;
56
57typedef struct {
58 mc_gregset_t mc_gregs;
59 mc_greg_t mc_fp;
60 mc_greg_t mc_i7;
61 mc_fpu_t mc_fpregs;
62} mcontext_t;
63
64struct ucontext {
65 struct ucontext *uc_link;
66 unsigned long uc_flags;
67 sigset_t uc_sigmask;
68 mcontext_t uc_mcontext;
69};
70typedef struct ucontext ucontext_t;
71
72#endif /* __SPARC64_UCTX_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd.h created+33
...@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * System calls under the Sparc.
4 *
5 * Don't be scared by the ugly clobbers, it is the only way I can
6 * think of right now to force the arguments into fixed registers
7 * before the trap into the system call with gcc 'asm' statements.
8 *
9 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
10 *
11 * SunOS compatibility based upon preliminary work which is:
12 *
13 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
14 */
15#ifndef _SPARC_UNISTD_H
16#define _SPARC_UNISTD_H
17
18#ifndef __32bit_syscall_numbers__
19#ifndef __arch64__
20#define __32bit_syscall_numbers__
21#endif
22#endif
23
24#ifdef __arch64__
25#include <asm/unistd_64.h>
26#else
27#include <asm/unistd_32.h>
28#endif
29
30/* Bitmask values returned from kern_features system call. */
31#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
32
33#endif /* _SPARC_UNISTD_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_32.h created+424
...@@ -0,0 +1,424 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_restart_syscall 0
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_wait4 7
12#define __NR_creat 8
13#define __NR_link 9
14#define __NR_unlink 10
15#define __NR_execv 11
16#define __NR_chdir 12
17#define __NR_chown 13
18#define __NR_mknod 14
19#define __NR_chmod 15
20#define __NR_lchown 16
21#define __NR_brk 17
22#define __NR_perfctr 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_capget 21
26#define __NR_capset 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_vmsplice 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_sigaltstack 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_lchown32 31
36#define __NR_fchown32 32
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_chown32 35
40#define __NR_sync 36
41#define __NR_kill 37
42#define __NR_stat 38
43#define __NR_sendfile 39
44#define __NR_lstat 40
45#define __NR_dup 41
46#define __NR_pipe 42
47#define __NR_times 43
48#define __NR_getuid32 44
49#define __NR_umount2 45
50#define __NR_setgid 46
51#define __NR_getgid 47
52#define __NR_signal 48
53#define __NR_geteuid 49
54#define __NR_getegid 50
55#define __NR_acct 51
56#define __NR_getgid32 53
57#define __NR_ioctl 54
58#define __NR_reboot 55
59#define __NR_mmap2 56
60#define __NR_symlink 57
61#define __NR_readlink 58
62#define __NR_execve 59
63#define __NR_umask 60
64#define __NR_chroot 61
65#define __NR_fstat 62
66#define __NR_fstat64 63
67#define __NR_getpagesize 64
68#define __NR_msync 65
69#define __NR_vfork 66
70#define __NR_pread64 67
71#define __NR_pwrite64 68
72#define __NR_geteuid32 69
73#define __NR_getegid32 70
74#define __NR_mmap 71
75#define __NR_setreuid32 72
76#define __NR_munmap 73
77#define __NR_mprotect 74
78#define __NR_madvise 75
79#define __NR_vhangup 76
80#define __NR_truncate64 77
81#define __NR_mincore 78
82#define __NR_getgroups 79
83#define __NR_setgroups 80
84#define __NR_getpgrp 81
85#define __NR_setgroups32 82
86#define __NR_setitimer 83
87#define __NR_ftruncate64 84
88#define __NR_swapon 85
89#define __NR_getitimer 86
90#define __NR_setuid32 87
91#define __NR_sethostname 88
92#define __NR_setgid32 89
93#define __NR_dup2 90
94#define __NR_setfsuid32 91
95#define __NR_fcntl 92
96#define __NR_select 93
97#define __NR_setfsgid32 94
98#define __NR_fsync 95
99#define __NR_setpriority 96
100#define __NR_socket 97
101#define __NR_connect 98
102#define __NR_accept 99
103#define __NR_getpriority 100
104#define __NR_rt_sigreturn 101
105#define __NR_rt_sigaction 102
106#define __NR_rt_sigprocmask 103
107#define __NR_rt_sigpending 104
108#define __NR_rt_sigtimedwait 105
109#define __NR_rt_sigqueueinfo 106
110#define __NR_rt_sigsuspend 107
111#define __NR_setresuid32 108
112#define __NR_getresuid32 109
113#define __NR_setresgid32 110
114#define __NR_getresgid32 111
115#define __NR_setregid32 112
116#define __NR_recvmsg 113
117#define __NR_sendmsg 114
118#define __NR_getgroups32 115
119#define __NR_gettimeofday 116
120#define __NR_getrusage 117
121#define __NR_getsockopt 118
122#define __NR_getcwd 119
123#define __NR_readv 120
124#define __NR_writev 121
125#define __NR_settimeofday 122
126#define __NR_fchown 123
127#define __NR_fchmod 124
128#define __NR_recvfrom 125
129#define __NR_setreuid 126
130#define __NR_setregid 127
131#define __NR_rename 128
132#define __NR_truncate 129
133#define __NR_ftruncate 130
134#define __NR_flock 131
135#define __NR_lstat64 132
136#define __NR_sendto 133
137#define __NR_shutdown 134
138#define __NR_socketpair 135
139#define __NR_mkdir 136
140#define __NR_rmdir 137
141#define __NR_utimes 138
142#define __NR_stat64 139
143#define __NR_sendfile64 140
144#define __NR_getpeername 141
145#define __NR_futex 142
146#define __NR_gettid 143
147#define __NR_getrlimit 144
148#define __NR_setrlimit 145
149#define __NR_pivot_root 146
150#define __NR_prctl 147
151#define __NR_pciconfig_read 148
152#define __NR_pciconfig_write 149
153#define __NR_getsockname 150
154#define __NR_inotify_init 151
155#define __NR_inotify_add_watch 152
156#define __NR_poll 153
157#define __NR_getdents64 154
158#define __NR_fcntl64 155
159#define __NR_inotify_rm_watch 156
160#define __NR_statfs 157
161#define __NR_fstatfs 158
162#define __NR_umount 159
163#define __NR_sched_set_affinity 160
164#define __NR_sched_get_affinity 161
165#define __NR_getdomainname 162
166#define __NR_setdomainname 163
167#define __NR_quotactl 165
168#define __NR_set_tid_address 166
169#define __NR_mount 167
170#define __NR_ustat 168
171#define __NR_setxattr 169
172#define __NR_lsetxattr 170
173#define __NR_fsetxattr 171
174#define __NR_getxattr 172
175#define __NR_lgetxattr 173
176#define __NR_getdents 174
177#define __NR_setsid 175
178#define __NR_fchdir 176
179#define __NR_fgetxattr 177
180#define __NR_listxattr 178
181#define __NR_llistxattr 179
182#define __NR_flistxattr 180
183#define __NR_removexattr 181
184#define __NR_lremovexattr 182
185#define __NR_sigpending 183
186#define __NR_query_module 184
187#define __NR_setpgid 185
188#define __NR_fremovexattr 186
189#define __NR_tkill 187
190#define __NR_exit_group 188
191#define __NR_uname 189
192#define __NR_init_module 190
193#define __NR_personality 191
194#define __NR_remap_file_pages 192
195#define __NR_epoll_create 193
196#define __NR_epoll_ctl 194
197#define __NR_epoll_wait 195
198#define __NR_ioprio_set 196
199#define __NR_getppid 197
200#define __NR_sigaction 198
201#define __NR_sgetmask 199
202#define __NR_ssetmask 200
203#define __NR_sigsuspend 201
204#define __NR_oldlstat 202
205#define __NR_uselib 203
206#define __NR_readdir 204
207#define __NR_readahead 205
208#define __NR_socketcall 206
209#define __NR_syslog 207
210#define __NR_lookup_dcookie 208
211#define __NR_fadvise64 209
212#define __NR_fadvise64_64 210
213#define __NR_tgkill 211
214#define __NR_waitpid 212
215#define __NR_swapoff 213
216#define __NR_sysinfo 214
217#define __NR_ipc 215
218#define __NR_sigreturn 216
219#define __NR_clone 217
220#define __NR_ioprio_get 218
221#define __NR_adjtimex 219
222#define __NR_sigprocmask 220
223#define __NR_create_module 221
224#define __NR_delete_module 222
225#define __NR_get_kernel_syms 223
226#define __NR_getpgid 224
227#define __NR_bdflush 225
228#define __NR_sysfs 226
229#define __NR_afs_syscall 227
230#define __NR_setfsuid 228
231#define __NR_setfsgid 229
232#define __NR__newselect 230
233#define __NR_time 231
234#define __NR_splice 232
235#define __NR_stime 233
236#define __NR_statfs64 234
237#define __NR_fstatfs64 235
238#define __NR__llseek 236
239#define __NR_mlock 237
240#define __NR_munlock 238
241#define __NR_mlockall 239
242#define __NR_munlockall 240
243#define __NR_sched_setparam 241
244#define __NR_sched_getparam 242
245#define __NR_sched_setscheduler 243
246#define __NR_sched_getscheduler 244
247#define __NR_sched_yield 245
248#define __NR_sched_get_priority_max 246
249#define __NR_sched_get_priority_min 247
250#define __NR_sched_rr_get_interval 248
251#define __NR_nanosleep 249
252#define __NR_mremap 250
253#define __NR__sysctl 251
254#define __NR_getsid 252
255#define __NR_fdatasync 253
256#define __NR_nfsservctl 254
257#define __NR_sync_file_range 255
258#define __NR_clock_settime 256
259#define __NR_clock_gettime 257
260#define __NR_clock_getres 258
261#define __NR_clock_nanosleep 259
262#define __NR_sched_getaffinity 260
263#define __NR_sched_setaffinity 261
264#define __NR_timer_settime 262
265#define __NR_timer_gettime 263
266#define __NR_timer_getoverrun 264
267#define __NR_timer_delete 265
268#define __NR_timer_create 266
269#define __NR_vserver 267
270#define __NR_io_setup 268
271#define __NR_io_destroy 269
272#define __NR_io_submit 270
273#define __NR_io_cancel 271
274#define __NR_io_getevents 272
275#define __NR_mq_open 273
276#define __NR_mq_unlink 274
277#define __NR_mq_timedsend 275
278#define __NR_mq_timedreceive 276
279#define __NR_mq_notify 277
280#define __NR_mq_getsetattr 278
281#define __NR_waitid 279
282#define __NR_tee 280
283#define __NR_add_key 281
284#define __NR_request_key 282
285#define __NR_keyctl 283
286#define __NR_openat 284
287#define __NR_mkdirat 285
288#define __NR_mknodat 286
289#define __NR_fchownat 287
290#define __NR_futimesat 288
291#define __NR_fstatat64 289
292#define __NR_unlinkat 290
293#define __NR_renameat 291
294#define __NR_linkat 292
295#define __NR_symlinkat 293
296#define __NR_readlinkat 294
297#define __NR_fchmodat 295
298#define __NR_faccessat 296
299#define __NR_pselect6 297
300#define __NR_ppoll 298
301#define __NR_unshare 299
302#define __NR_set_robust_list 300
303#define __NR_get_robust_list 301
304#define __NR_migrate_pages 302
305#define __NR_mbind 303
306#define __NR_get_mempolicy 304
307#define __NR_set_mempolicy 305
308#define __NR_kexec_load 306
309#define __NR_move_pages 307
310#define __NR_getcpu 308
311#define __NR_epoll_pwait 309
312#define __NR_utimensat 310
313#define __NR_signalfd 311
314#define __NR_timerfd_create 312
315#define __NR_eventfd 313
316#define __NR_fallocate 314
317#define __NR_timerfd_settime 315
318#define __NR_timerfd_gettime 316
319#define __NR_signalfd4 317
320#define __NR_eventfd2 318
321#define __NR_epoll_create1 319
322#define __NR_dup3 320
323#define __NR_pipe2 321
324#define __NR_inotify_init1 322
325#define __NR_accept4 323
326#define __NR_preadv 324
327#define __NR_pwritev 325
328#define __NR_rt_tgsigqueueinfo 326
329#define __NR_perf_event_open 327
330#define __NR_recvmmsg 328
331#define __NR_fanotify_init 329
332#define __NR_fanotify_mark 330
333#define __NR_prlimit64 331
334#define __NR_name_to_handle_at 332
335#define __NR_open_by_handle_at 333
336#define __NR_clock_adjtime 334
337#define __NR_syncfs 335
338#define __NR_sendmmsg 336
339#define __NR_setns 337
340#define __NR_process_vm_readv 338
341#define __NR_process_vm_writev 339
342#define __NR_kern_features 340
343#define __NR_kcmp 341
344#define __NR_finit_module 342
345#define __NR_sched_setattr 343
346#define __NR_sched_getattr 344
347#define __NR_renameat2 345
348#define __NR_seccomp 346
349#define __NR_getrandom 347
350#define __NR_memfd_create 348
351#define __NR_bpf 349
352#define __NR_execveat 350
353#define __NR_membarrier 351
354#define __NR_userfaultfd 352
355#define __NR_bind 353
356#define __NR_listen 354
357#define __NR_setsockopt 355
358#define __NR_mlock2 356
359#define __NR_copy_file_range 357
360#define __NR_preadv2 358
361#define __NR_pwritev2 359
362#define __NR_statx 360
363#define __NR_io_pgetevents 361
364#define __NR_pkey_mprotect 362
365#define __NR_pkey_alloc 363
366#define __NR_pkey_free 364
367#define __NR_rseq 365
368#define __NR_semget 393
369#define __NR_semctl 394
370#define __NR_shmget 395
371#define __NR_shmctl 396
372#define __NR_shmat 397
373#define __NR_shmdt 398
374#define __NR_msgget 399
375#define __NR_msgsnd 400
376#define __NR_msgrcv 401
377#define __NR_msgctl 402
378#define __NR_clock_gettime64 403
379#define __NR_clock_settime64 404
380#define __NR_clock_adjtime64 405
381#define __NR_clock_getres_time64 406
382#define __NR_clock_nanosleep_time64 407
383#define __NR_timer_gettime64 408
384#define __NR_timer_settime64 409
385#define __NR_timerfd_gettime64 410
386#define __NR_timerfd_settime64 411
387#define __NR_utimensat_time64 412
388#define __NR_pselect6_time64 413
389#define __NR_ppoll_time64 414
390#define __NR_io_pgetevents_time64 416
391#define __NR_recvmmsg_time64 417
392#define __NR_mq_timedsend_time64 418
393#define __NR_mq_timedreceive_time64 419
394#define __NR_semtimedop_time64 420
395#define __NR_rt_sigtimedwait_time64 421
396#define __NR_futex_time64 422
397#define __NR_sched_rr_get_interval_time64 423
398#define __NR_pidfd_send_signal 424
399#define __NR_io_uring_setup 425
400#define __NR_io_uring_enter 426
401#define __NR_io_uring_register 427
402#define __NR_open_tree 428
403#define __NR_move_mount 429
404#define __NR_fsopen 430
405#define __NR_fsconfig 431
406#define __NR_fsmount 432
407#define __NR_fspick 433
408#define __NR_pidfd_open 434
409#define __NR_close_range 436
410#define __NR_openat2 437
411#define __NR_pidfd_getfd 438
412#define __NR_faccessat2 439
413#define __NR_process_madvise 440
414#define __NR_epoll_pwait2 441
415#define __NR_mount_setattr 442
416#define __NR_quotactl_fd 443
417#define __NR_landlock_create_ruleset 444
418#define __NR_landlock_add_rule 445
419#define __NR_landlock_restrict_self 446
420#define __NR_process_mrelease 448
421#define __NR_futex_waitv 449
422
423
424#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h created+387
...@@ -0,0 +1,387 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_restart_syscall 0
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_wait4 7
12#define __NR_creat 8
13#define __NR_link 9
14#define __NR_unlink 10
15#define __NR_execv 11
16#define __NR_chdir 12
17#define __NR_chown 13
18#define __NR_mknod 14
19#define __NR_chmod 15
20#define __NR_lchown 16
21#define __NR_brk 17
22#define __NR_perfctr 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_capget 21
26#define __NR_capset 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_vmsplice 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_sigaltstack 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_access 33
36#define __NR_nice 34
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_stat 38
40#define __NR_sendfile 39
41#define __NR_lstat 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_umount2 45
46#define __NR_setgid 46
47#define __NR_getgid 47
48#define __NR_signal 48
49#define __NR_geteuid 49
50#define __NR_getegid 50
51#define __NR_acct 51
52#define __NR_memory_ordering 52
53#define __NR_ioctl 54
54#define __NR_reboot 55
55#define __NR_symlink 57
56#define __NR_readlink 58
57#define __NR_execve 59
58#define __NR_umask 60
59#define __NR_chroot 61
60#define __NR_fstat 62
61#define __NR_fstat64 63
62#define __NR_getpagesize 64
63#define __NR_msync 65
64#define __NR_vfork 66
65#define __NR_pread64 67
66#define __NR_pwrite64 68
67#define __NR_mmap 71
68#define __NR_munmap 73
69#define __NR_mprotect 74
70#define __NR_madvise 75
71#define __NR_vhangup 76
72#define __NR_mincore 78
73#define __NR_getgroups 79
74#define __NR_setgroups 80
75#define __NR_getpgrp 81
76#define __NR_setitimer 83
77#define __NR_swapon 85
78#define __NR_getitimer 86
79#define __NR_sethostname 88
80#define __NR_dup2 90
81#define __NR_fcntl 92
82#define __NR_select 93
83#define __NR_fsync 95
84#define __NR_setpriority 96
85#define __NR_socket 97
86#define __NR_connect 98
87#define __NR_accept 99
88#define __NR_getpriority 100
89#define __NR_rt_sigreturn 101
90#define __NR_rt_sigaction 102
91#define __NR_rt_sigprocmask 103
92#define __NR_rt_sigpending 104
93#define __NR_rt_sigtimedwait 105
94#define __NR_rt_sigqueueinfo 106
95#define __NR_rt_sigsuspend 107
96#define __NR_setresuid 108
97#define __NR_getresuid 109
98#define __NR_setresgid 110
99#define __NR_getresgid 111
100#define __NR_recvmsg 113
101#define __NR_sendmsg 114
102#define __NR_gettimeofday 116
103#define __NR_getrusage 117
104#define __NR_getsockopt 118
105#define __NR_getcwd 119
106#define __NR_readv 120
107#define __NR_writev 121
108#define __NR_settimeofday 122
109#define __NR_fchown 123
110#define __NR_fchmod 124
111#define __NR_recvfrom 125
112#define __NR_setreuid 126
113#define __NR_setregid 127
114#define __NR_rename 128
115#define __NR_truncate 129
116#define __NR_ftruncate 130
117#define __NR_flock 131
118#define __NR_lstat64 132
119#define __NR_sendto 133
120#define __NR_shutdown 134
121#define __NR_socketpair 135
122#define __NR_mkdir 136
123#define __NR_rmdir 137
124#define __NR_utimes 138
125#define __NR_stat64 139
126#define __NR_sendfile64 140
127#define __NR_getpeername 141
128#define __NR_futex 142
129#define __NR_gettid 143
130#define __NR_getrlimit 144
131#define __NR_setrlimit 145
132#define __NR_pivot_root 146
133#define __NR_prctl 147
134#define __NR_pciconfig_read 148
135#define __NR_pciconfig_write 149
136#define __NR_getsockname 150
137#define __NR_inotify_init 151
138#define __NR_inotify_add_watch 152
139#define __NR_poll 153
140#define __NR_getdents64 154
141#define __NR_inotify_rm_watch 156
142#define __NR_statfs 157
143#define __NR_fstatfs 158
144#define __NR_umount 159
145#define __NR_sched_set_affinity 160
146#define __NR_sched_get_affinity 161
147#define __NR_getdomainname 162
148#define __NR_setdomainname 163
149#define __NR_utrap_install 164
150#define __NR_quotactl 165
151#define __NR_set_tid_address 166
152#define __NR_mount 167
153#define __NR_ustat 168
154#define __NR_setxattr 169
155#define __NR_lsetxattr 170
156#define __NR_fsetxattr 171
157#define __NR_getxattr 172
158#define __NR_lgetxattr 173
159#define __NR_getdents 174
160#define __NR_setsid 175
161#define __NR_fchdir 176
162#define __NR_fgetxattr 177
163#define __NR_listxattr 178
164#define __NR_llistxattr 179
165#define __NR_flistxattr 180
166#define __NR_removexattr 181
167#define __NR_lremovexattr 182
168#define __NR_sigpending 183
169#define __NR_query_module 184
170#define __NR_setpgid 185
171#define __NR_fremovexattr 186
172#define __NR_tkill 187
173#define __NR_exit_group 188
174#define __NR_uname 189
175#define __NR_init_module 190
176#define __NR_personality 191
177#define __NR_remap_file_pages 192
178#define __NR_epoll_create 193
179#define __NR_epoll_ctl 194
180#define __NR_epoll_wait 195
181#define __NR_ioprio_set 196
182#define __NR_getppid 197
183#define __NR_sigaction 198
184#define __NR_sgetmask 199
185#define __NR_ssetmask 200
186#define __NR_sigsuspend 201
187#define __NR_oldlstat 202
188#define __NR_uselib 203
189#define __NR_readdir 204
190#define __NR_readahead 205
191#define __NR_socketcall 206
192#define __NR_syslog 207
193#define __NR_lookup_dcookie 208
194#define __NR_fadvise64 209
195#define __NR_fadvise64_64 210
196#define __NR_tgkill 211
197#define __NR_waitpid 212
198#define __NR_swapoff 213
199#define __NR_sysinfo 214
200#define __NR_ipc 215
201#define __NR_sigreturn 216
202#define __NR_clone 217
203#define __NR_ioprio_get 218
204#define __NR_adjtimex 219
205#define __NR_sigprocmask 220
206#define __NR_create_module 221
207#define __NR_delete_module 222
208#define __NR_get_kernel_syms 223
209#define __NR_getpgid 224
210#define __NR_bdflush 225
211#define __NR_sysfs 226
212#define __NR_afs_syscall 227
213#define __NR_setfsuid 228
214#define __NR_setfsgid 229
215#define __NR__newselect 230
216#define __NR_splice 232
217#define __NR_stime 233
218#define __NR_statfs64 234
219#define __NR_fstatfs64 235
220#define __NR__llseek 236
221#define __NR_mlock 237
222#define __NR_munlock 238
223#define __NR_mlockall 239
224#define __NR_munlockall 240
225#define __NR_sched_setparam 241
226#define __NR_sched_getparam 242
227#define __NR_sched_setscheduler 243
228#define __NR_sched_getscheduler 244
229#define __NR_sched_yield 245
230#define __NR_sched_get_priority_max 246
231#define __NR_sched_get_priority_min 247
232#define __NR_sched_rr_get_interval 248
233#define __NR_nanosleep 249
234#define __NR_mremap 250
235#define __NR__sysctl 251
236#define __NR_getsid 252
237#define __NR_fdatasync 253
238#define __NR_nfsservctl 254
239#define __NR_sync_file_range 255
240#define __NR_clock_settime 256
241#define __NR_clock_gettime 257
242#define __NR_clock_getres 258
243#define __NR_clock_nanosleep 259
244#define __NR_sched_getaffinity 260
245#define __NR_sched_setaffinity 261
246#define __NR_timer_settime 262
247#define __NR_timer_gettime 263
248#define __NR_timer_getoverrun 264
249#define __NR_timer_delete 265
250#define __NR_timer_create 266
251#define __NR_vserver 267
252#define __NR_io_setup 268
253#define __NR_io_destroy 269
254#define __NR_io_submit 270
255#define __NR_io_cancel 271
256#define __NR_io_getevents 272
257#define __NR_mq_open 273
258#define __NR_mq_unlink 274
259#define __NR_mq_timedsend 275
260#define __NR_mq_timedreceive 276
261#define __NR_mq_notify 277
262#define __NR_mq_getsetattr 278
263#define __NR_waitid 279
264#define __NR_tee 280
265#define __NR_add_key 281
266#define __NR_request_key 282
267#define __NR_keyctl 283
268#define __NR_openat 284
269#define __NR_mkdirat 285
270#define __NR_mknodat 286
271#define __NR_fchownat 287
272#define __NR_futimesat 288
273#define __NR_fstatat64 289
274#define __NR_unlinkat 290
275#define __NR_renameat 291
276#define __NR_linkat 292
277#define __NR_symlinkat 293
278#define __NR_readlinkat 294
279#define __NR_fchmodat 295
280#define __NR_faccessat 296
281#define __NR_pselect6 297
282#define __NR_ppoll 298
283#define __NR_unshare 299
284#define __NR_set_robust_list 300
285#define __NR_get_robust_list 301
286#define __NR_migrate_pages 302
287#define __NR_mbind 303
288#define __NR_get_mempolicy 304
289#define __NR_set_mempolicy 305
290#define __NR_kexec_load 306
291#define __NR_move_pages 307
292#define __NR_getcpu 308
293#define __NR_epoll_pwait 309
294#define __NR_utimensat 310
295#define __NR_signalfd 311
296#define __NR_timerfd_create 312
297#define __NR_eventfd 313
298#define __NR_fallocate 314
299#define __NR_timerfd_settime 315
300#define __NR_timerfd_gettime 316
301#define __NR_signalfd4 317
302#define __NR_eventfd2 318
303#define __NR_epoll_create1 319
304#define __NR_dup3 320
305#define __NR_pipe2 321
306#define __NR_inotify_init1 322
307#define __NR_accept4 323
308#define __NR_preadv 324
309#define __NR_pwritev 325
310#define __NR_rt_tgsigqueueinfo 326
311#define __NR_perf_event_open 327
312#define __NR_recvmmsg 328
313#define __NR_fanotify_init 329
314#define __NR_fanotify_mark 330
315#define __NR_prlimit64 331
316#define __NR_name_to_handle_at 332
317#define __NR_open_by_handle_at 333
318#define __NR_clock_adjtime 334
319#define __NR_syncfs 335
320#define __NR_sendmmsg 336
321#define __NR_setns 337
322#define __NR_process_vm_readv 338
323#define __NR_process_vm_writev 339
324#define __NR_kern_features 340
325#define __NR_kcmp 341
326#define __NR_finit_module 342
327#define __NR_sched_setattr 343
328#define __NR_sched_getattr 344
329#define __NR_renameat2 345
330#define __NR_seccomp 346
331#define __NR_getrandom 347
332#define __NR_memfd_create 348
333#define __NR_bpf 349
334#define __NR_execveat 350
335#define __NR_membarrier 351
336#define __NR_userfaultfd 352
337#define __NR_bind 353
338#define __NR_listen 354
339#define __NR_setsockopt 355
340#define __NR_mlock2 356
341#define __NR_copy_file_range 357
342#define __NR_preadv2 358
343#define __NR_pwritev2 359
344#define __NR_statx 360
345#define __NR_io_pgetevents 361
346#define __NR_pkey_mprotect 362
347#define __NR_pkey_alloc 363
348#define __NR_pkey_free 364
349#define __NR_rseq 365
350#define __NR_semtimedop 392
351#define __NR_semget 393
352#define __NR_semctl 394
353#define __NR_shmget 395
354#define __NR_shmctl 396
355#define __NR_shmat 397
356#define __NR_shmdt 398
357#define __NR_msgget 399
358#define __NR_msgsnd 400
359#define __NR_msgrcv 401
360#define __NR_msgctl 402
361#define __NR_pidfd_send_signal 424
362#define __NR_io_uring_setup 425
363#define __NR_io_uring_enter 426
364#define __NR_io_uring_register 427
365#define __NR_open_tree 428
366#define __NR_move_mount 429
367#define __NR_fsopen 430
368#define __NR_fsconfig 431
369#define __NR_fsmount 432
370#define __NR_fspick 433
371#define __NR_pidfd_open 434
372#define __NR_close_range 436
373#define __NR_openat2 437
374#define __NR_pidfd_getfd 438
375#define __NR_faccessat2 439
376#define __NR_process_madvise 440
377#define __NR_epoll_pwait2 441
378#define __NR_mount_setattr 442
379#define __NR_quotactl_fd 443
380#define __NR_landlock_create_ruleset 444
381#define __NR_landlock_add_rule 445
382#define __NR_landlock_restrict_self 446
383#define __NR_process_mrelease 448
384#define __NR_futex_waitv 449
385
386
387#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/utrap.h created+52
...@@ -0,0 +1,52 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm/utrap.h
4 *
5 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
6 */
7
8#ifndef __ASM_SPARC64_UTRAP_H
9#define __ASM_SPARC64_UTRAP_H
10
11#define UT_INSTRUCTION_EXCEPTION 1
12#define UT_INSTRUCTION_ERROR 2
13#define UT_INSTRUCTION_PROTECTION 3
14#define UT_ILLTRAP_INSTRUCTION 4
15#define UT_ILLEGAL_INSTRUCTION 5
16#define UT_PRIVILEGED_OPCODE 6
17#define UT_FP_DISABLED 7
18#define UT_FP_EXCEPTION_IEEE_754 8
19#define UT_FP_EXCEPTION_OTHER 9
20#define UT_TAG_OVERVIEW 10
21#define UT_DIVISION_BY_ZERO 11
22#define UT_DATA_EXCEPTION 12
23#define UT_DATA_ERROR 13
24#define UT_DATA_PROTECTION 14
25#define UT_MEM_ADDRESS_NOT_ALIGNED 15
26#define UT_PRIVILEGED_ACTION 16
27#define UT_ASYNC_DATA_ERROR 17
28#define UT_TRAP_INSTRUCTION_16 18
29#define UT_TRAP_INSTRUCTION_17 19
30#define UT_TRAP_INSTRUCTION_18 20
31#define UT_TRAP_INSTRUCTION_19 21
32#define UT_TRAP_INSTRUCTION_20 22
33#define UT_TRAP_INSTRUCTION_21 23
34#define UT_TRAP_INSTRUCTION_22 24
35#define UT_TRAP_INSTRUCTION_23 25
36#define UT_TRAP_INSTRUCTION_24 26
37#define UT_TRAP_INSTRUCTION_25 27
38#define UT_TRAP_INSTRUCTION_26 28
39#define UT_TRAP_INSTRUCTION_27 29
40#define UT_TRAP_INSTRUCTION_28 30
41#define UT_TRAP_INSTRUCTION_29 31
42#define UT_TRAP_INSTRUCTION_30 32
43#define UT_TRAP_INSTRUCTION_31 33
44
45#define UTH_NOCHANGE (-1)
46
47#ifndef __ASSEMBLY__
48typedef int utrap_entry_t;
49typedef void *utrap_handler_t;
50#endif /* __ASSEMBLY__ */
51
52#endif /* !(__ASM_SPARC64_PROCESSOR_H) */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/watchdog.h created+31
...@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 *
4 * watchdog - Driver interface for the hardware watchdog timers
5 * present on Sun Microsystems boardsets
6 *
7 * Copyright (c) 2000 Eric Brower <ebrower@usa.net>
8 *
9 */
10
11#ifndef _SPARC64_WATCHDOG_H
12#define _SPARC64_WATCHDOG_H
13
14#include <linux/watchdog.h>
15
16/* Solaris compatibility ioctls--
17 * Ref. <linux/watchdog.h> for standard linux watchdog ioctls
18 */
19#define WIOCSTART _IO (WATCHDOG_IOCTL_BASE, 10) /* Start Timer */
20#define WIOCSTOP _IO (WATCHDOG_IOCTL_BASE, 11) /* Stop Timer */
21#define WIOCGSTAT _IOR(WATCHDOG_IOCTL_BASE, 12, int)/* Get Timer Status */
22
23/* Status flags from WIOCGSTAT ioctl
24 */
25#define WD_FREERUN 0x01 /* timer is running, interrupts disabled */
26#define WD_EXPIRED 0x02 /* timer has expired */
27#define WD_RUNNING 0x04 /* timer is running, interrupts enabled */
28#define WD_STOPPED 0x08 /* timer has not been started */
29#define WD_SERVICED 0x10 /* timer interrupt was serviced */
30
31#endif /* ifndef _SPARC64_WATCHDOG_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/a.out.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_A_OUT_H
3#define _ASM_X86_A_OUT_H
4
5struct exec
6{
7 unsigned int a_info; /* Use macros N_MAGIC, etc for access */
8 unsigned a_text; /* length of text, in bytes */
9 unsigned a_data; /* length of data, in bytes */
10 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
11 unsigned a_syms; /* length of symbol table data in file, in bytes */
12 unsigned a_entry; /* start address */
13 unsigned a_trsize; /* length of relocation info for text, in bytes */
14 unsigned a_drsize; /* length of relocation info for data, in bytes */
15};
16
17#define N_TRSIZE(a) ((a).a_trsize)
18#define N_DRSIZE(a) ((a).a_drsize)
19#define N_SYMSIZE(a) ((a).a_syms)
20
21#endif /* _ASM_X86_A_OUT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/auxvec.h created+20
...@@ -0,0 +1,20 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_AUXVEC_H
3#define _ASM_X86_AUXVEC_H
4/*
5 * Architecture-neutral AT_ values in 0-17, leave some room
6 * for more of them, start the x86-specific ones at 32.
7 */
8#ifdef __i386__
9#define AT_SYSINFO 32
10#endif
11#define AT_SYSINFO_EHDR 33
12
13/* entries in ARCH_DLINFO: */
14#if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64)
15# define AT_VECTOR_SIZE_ARCH 3
16#else /* else it's non-compat x86-64 */
17# define AT_VECTOR_SIZE_ARCH 2
18#endif
19
20#endif /* _ASM_X86_AUXVEC_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/bitsperlong.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_BITSPERLONG_H
3#define __ASM_X86_BITSPERLONG_H
4
5#if defined(__x86_64__) && !defined(__ILP32__)
6# define __BITS_PER_LONG 64
7#else
8# define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_X86_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/boot.h created+11
...@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_BOOT_H
3#define _ASM_X86_BOOT_H
4
5/* Internal svga startup constants */
6#define NORMAL_VGA 0xffff /* 80x25 mode */
7#define EXTENDED_VGA 0xfffe /* 80x50 mode */
8#define ASK_VGA 0xfffd /* ask for it at bootup */
9
10
11#endif /* _ASM_X86_BOOT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/bootparam.h created+273
...@@ -0,0 +1,273 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_BOOTPARAM_H
3#define _ASM_X86_BOOTPARAM_H
4
5/* setup_data/setup_indirect types */
6#define SETUP_NONE 0
7#define SETUP_E820_EXT 1
8#define SETUP_DTB 2
9#define SETUP_PCI 3
10#define SETUP_EFI 4
11#define SETUP_APPLE_PROPERTIES 5
12#define SETUP_JAILHOUSE 6
13
14#define SETUP_INDIRECT (1<<31)
15
16/* SETUP_INDIRECT | max(SETUP_*) */
17#define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE)
18
19/* ram_size flags */
20#define RAMDISK_IMAGE_START_MASK 0x07FF
21#define RAMDISK_PROMPT_FLAG 0x8000
22#define RAMDISK_LOAD_FLAG 0x4000
23
24/* loadflags */
25#define LOADED_HIGH (1<<0)
26#define KASLR_FLAG (1<<1)
27#define QUIET_FLAG (1<<5)
28#define KEEP_SEGMENTS (1<<6)
29#define CAN_USE_HEAP (1<<7)
30
31/* xloadflags */
32#define XLF_KERNEL_64 (1<<0)
33#define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1)
34#define XLF_EFI_HANDOVER_32 (1<<2)
35#define XLF_EFI_HANDOVER_64 (1<<3)
36#define XLF_EFI_KEXEC (1<<4)
37#define XLF_5LEVEL (1<<5)
38#define XLF_5LEVEL_ENABLED (1<<6)
39
40#ifndef __ASSEMBLY__
41
42#include <linux/types.h>
43#include <linux/screen_info.h>
44#include <linux/apm_bios.h>
45#include <linux/edd.h>
46#include <asm/ist.h>
47#include <video/edid.h>
48
49/* extensible setup data list node */
50struct setup_data {
51 __u64 next;
52 __u32 type;
53 __u32 len;
54 __u8 data[0];
55};
56
57/* extensible setup indirect data node */
58struct setup_indirect {
59 __u32 type;
60 __u32 reserved; /* Reserved, must be set to zero. */
61 __u64 len;
62 __u64 addr;
63};
64
65struct setup_header {
66 __u8 setup_sects;
67 __u16 root_flags;
68 __u32 syssize;
69 __u16 ram_size;
70 __u16 vid_mode;
71 __u16 root_dev;
72 __u16 boot_flag;
73 __u16 jump;
74 __u32 header;
75 __u16 version;
76 __u32 realmode_swtch;
77 __u16 start_sys_seg;
78 __u16 kernel_version;
79 __u8 type_of_loader;
80 __u8 loadflags;
81 __u16 setup_move_size;
82 __u32 code32_start;
83 __u32 ramdisk_image;
84 __u32 ramdisk_size;
85 __u32 bootsect_kludge;
86 __u16 heap_end_ptr;
87 __u8 ext_loader_ver;
88 __u8 ext_loader_type;
89 __u32 cmd_line_ptr;
90 __u32 initrd_addr_max;
91 __u32 kernel_alignment;
92 __u8 relocatable_kernel;
93 __u8 min_alignment;
94 __u16 xloadflags;
95 __u32 cmdline_size;
96 __u32 hardware_subarch;
97 __u64 hardware_subarch_data;
98 __u32 payload_offset;
99 __u32 payload_length;
100 __u64 setup_data;
101 __u64 pref_address;
102 __u32 init_size;
103 __u32 handover_offset;
104 __u32 kernel_info_offset;
105} __attribute__((packed));
106
107struct sys_desc_table {
108 __u16 length;
109 __u8 table[14];
110};
111
112/* Gleaned from OFW's set-parameters in cpu/x86/pc/linux.fth */
113struct olpc_ofw_header {
114 __u32 ofw_magic; /* OFW signature */
115 __u32 ofw_version;
116 __u32 cif_handler; /* callback into OFW */
117 __u32 irq_desc_table;
118} __attribute__((packed));
119
120struct efi_info {
121 __u32 efi_loader_signature;
122 __u32 efi_systab;
123 __u32 efi_memdesc_size;
124 __u32 efi_memdesc_version;
125 __u32 efi_memmap;
126 __u32 efi_memmap_size;
127 __u32 efi_systab_hi;
128 __u32 efi_memmap_hi;
129};
130
131/*
132 * This is the maximum number of entries in struct boot_params::e820_table
133 * (the zeropage), which is part of the x86 boot protocol ABI:
134 */
135#define E820_MAX_ENTRIES_ZEROPAGE 128
136
137/*
138 * The E820 memory region entry of the boot protocol ABI:
139 */
140struct boot_e820_entry {
141 __u64 addr;
142 __u64 size;
143 __u32 type;
144} __attribute__((packed));
145
146/*
147 * Smallest compatible version of jailhouse_setup_data required by this kernel.
148 */
149#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
150
151/*
152 * The boot loader is passing platform information via this Jailhouse-specific
153 * setup data structure.
154 */
155struct jailhouse_setup_data {
156 struct {
157 __u16 version;
158 __u16 compatible_version;
159 } __attribute__((packed)) hdr;
160 struct {
161 __u16 pm_timer_address;
162 __u16 num_cpus;
163 __u64 pci_mmconfig_base;
164 __u32 tsc_khz;
165 __u32 apic_khz;
166 __u8 standard_ioapic;
167 __u8 cpu_ids[255];
168 } __attribute__((packed)) v1;
169 struct {
170 __u32 flags;
171 } __attribute__((packed)) v2;
172} __attribute__((packed));
173
174/* The so-called "zeropage" */
175struct boot_params {
176 struct screen_info screen_info; /* 0x000 */
177 struct apm_bios_info apm_bios_info; /* 0x040 */
178 __u8 _pad2[4]; /* 0x054 */
179 __u64 tboot_addr; /* 0x058 */
180 struct ist_info ist_info; /* 0x060 */
181 __u64 acpi_rsdp_addr; /* 0x070 */
182 __u8 _pad3[8]; /* 0x078 */
183 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
184 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
185 struct sys_desc_table sys_desc_table; /* obsolete! */ /* 0x0a0 */
186 struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */
187 __u32 ext_ramdisk_image; /* 0x0c0 */
188 __u32 ext_ramdisk_size; /* 0x0c4 */
189 __u32 ext_cmd_line_ptr; /* 0x0c8 */
190 __u8 _pad4[116]; /* 0x0cc */
191 struct edid_info edid_info; /* 0x140 */
192 struct efi_info efi_info; /* 0x1c0 */
193 __u32 alt_mem_k; /* 0x1e0 */
194 __u32 scratch; /* Scratch field! */ /* 0x1e4 */
195 __u8 e820_entries; /* 0x1e8 */
196 __u8 eddbuf_entries; /* 0x1e9 */
197 __u8 edd_mbr_sig_buf_entries; /* 0x1ea */
198 __u8 kbd_status; /* 0x1eb */
199 __u8 secure_boot; /* 0x1ec */
200 __u8 _pad5[2]; /* 0x1ed */
201 /*
202 * The sentinel is set to a nonzero value (0xff) in header.S.
203 *
204 * A bootloader is supposed to only take setup_header and put
205 * it into a clean boot_params buffer. If it turns out that
206 * it is clumsy or too generous with the buffer, it most
207 * probably will pick up the sentinel variable too. The fact
208 * that this variable then is still 0xff will let kernel
209 * know that some variables in boot_params are invalid and
210 * kernel should zero out certain portions of boot_params.
211 */
212 __u8 sentinel; /* 0x1ef */
213 __u8 _pad6[1]; /* 0x1f0 */
214 struct setup_header hdr; /* setup header */ /* 0x1f1 */
215 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
216 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
217 struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE]; /* 0x2d0 */
218 __u8 _pad8[48]; /* 0xcd0 */
219 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
220 __u8 _pad9[276]; /* 0xeec */
221} __attribute__((packed));
222
223/**
224 * enum x86_hardware_subarch - x86 hardware subarchitecture
225 *
226 * The x86 hardware_subarch and hardware_subarch_data were added as of the x86
227 * boot protocol 2.07 to help distinguish and support custom x86 boot
228 * sequences. This enum represents accepted values for the x86
229 * hardware_subarch. Custom x86 boot sequences (not X86_SUBARCH_PC) do not
230 * have or simply *cannot* make use of natural stubs like BIOS or EFI, the
231 * hardware_subarch can be used on the Linux entry path to revector to a
232 * subarchitecture stub when needed. This subarchitecture stub can be used to
233 * set up Linux boot parameters or for special care to account for nonstandard
234 * handling of page tables.
235 *
236 * These enums should only ever be used by x86 code, and the code that uses
237 * it should be well contained and compartmentalized.
238 *
239 * KVM and Xen HVM do not have a subarch as these are expected to follow
240 * standard x86 boot entries. If there is a genuine need for "hypervisor" type
241 * that should be considered separately in the future. Future guest types
242 * should seriously consider working with standard x86 boot stubs such as
243 * the BIOS or EFI boot stubs.
244 *
245 * WARNING: this enum is only used for legacy hacks, for platform features that
246 * are not easily enumerated or discoverable. You should not ever use
247 * this for new features.
248 *
249 * @X86_SUBARCH_PC: Should be used if the hardware is enumerable using standard
250 * PC mechanisms (PCI, ACPI) and doesn't need a special boot flow.
251 * @X86_SUBARCH_LGUEST: Used for x86 hypervisor demo, lguest, deprecated
252 * @X86_SUBARCH_XEN: Used for Xen guest types which follow the PV boot path,
253 * which start at __asm__ startup_xen() entry point and later jump to the C
254 * xen_start_kernel() entry point. Both domU and dom0 type of guests are
255 * currently supported through this PV boot path.
256 * @X86_SUBARCH_INTEL_MID: Used for Intel MID (Mobile Internet Device) platform
257 * systems which do not have the PCI legacy interfaces.
258 * @X86_SUBARCH_CE4100: Used for Intel CE media processor (CE4100) SoC
259 * for settop boxes and media devices, the use of a subarch for CE4100
260 * is more of a hack...
261 */
262enum x86_hardware_subarch {
263 X86_SUBARCH_PC = 0,
264 X86_SUBARCH_LGUEST,
265 X86_SUBARCH_XEN,
266 X86_SUBARCH_INTEL_MID,
267 X86_SUBARCH_CE4100,
268 X86_NR_SUBARCHS,
269};
270
271#endif /* __ASSEMBLY__ */
272
273#endif /* _ASM_X86_BOOTPARAM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/byteorder.h created+7
...@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_BYTEORDER_H
3#define _ASM_X86_BYTEORDER_H
4
5#include <linux/byteorder/little_endian.h>
6
7#endif /* _ASM_X86_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/debugreg.h created+82
...@@ -0,0 +1,82 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_DEBUGREG_H
3#define _ASM_X86_DEBUGREG_H
4
5
6/* Indicate the register numbers for a number of the specific
7 debug registers. Registers 0-3 contain the addresses we wish to trap on */
8#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
9#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
10
11#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
12#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
13
14/* Define a few things for the status register. We can use this to determine
15 which debugging register was responsible for the trap. The other bits
16 are either reserved or not of interest to us. */
17
18/* Define reserved bits in DR6 which are always set to 1 */
19#define DR6_RESERVED (0xFFFF0FF0)
20
21#define DR_TRAP0 (0x1) /* db0 */
22#define DR_TRAP1 (0x2) /* db1 */
23#define DR_TRAP2 (0x4) /* db2 */
24#define DR_TRAP3 (0x8) /* db3 */
25#define DR_TRAP_BITS (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)
26
27#define DR_BUS_LOCK (0x800) /* bus_lock */
28#define DR_STEP (0x4000) /* single-step */
29#define DR_SWITCH (0x8000) /* task switch */
30
31/* Now define a bunch of things for manipulating the control register.
32 The top two bytes of the control register consist of 4 fields of 4
33 bits - each field corresponds to one of the four debug registers,
34 and indicates what types of access we trap on, and how large the data
35 field is that we are looking at */
36
37#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
38#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
39
40#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
41#define DR_RW_WRITE (0x1)
42#define DR_RW_READ (0x3)
43
44#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
45#define DR_LEN_2 (0x4)
46#define DR_LEN_4 (0xC)
47#define DR_LEN_8 (0x8)
48
49/* The low byte to the control register determine which registers are
50 enabled. There are 4 fields of two bits. One bit is "local", meaning
51 that the processor will reset the bit after a task switch and the other
52 is global meaning that we have to explicitly reset the bit. With linux,
53 you can use either one, since we explicitly zero the register when we enter
54 kernel mode. */
55
56#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
57#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
58#define DR_LOCAL_ENABLE (0x1) /* Local enable for reg 0 */
59#define DR_GLOBAL_ENABLE (0x2) /* Global enable for reg 0 */
60#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
61
62#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
63#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
64
65/* The second byte to the control register has a few special things.
66 We can slow the instruction pipeline for instructions coming via the
67 gdt or the ldt if we want to. I am not sure why this is an advantage */
68
69#ifdef __i386__
70#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
71#else
72#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
73#endif
74
75#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
76#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
77
78/*
79 * HW breakpoint additions
80 */
81
82#endif /* _ASM_X86_DEBUGREG_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/e820.h created+80
...@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_E820_H
3#define _ASM_X86_E820_H
4#define E820MAP 0x2d0 /* our map */
5#define E820MAX 128 /* number of entries in E820MAP */
6
7/*
8 * Legacy E820 BIOS limits us to 128 (E820MAX) nodes due to the
9 * constrained space in the zeropage. If we have more nodes than
10 * that, and if we've booted off EFI firmware, then the EFI tables
11 * passed us from the EFI firmware can list more nodes. Size our
12 * internal memory map tables to have room for these additional
13 * nodes, based on up to three entries per node for which the
14 * kernel was built: MAX_NUMNODES == (1 << CONFIG_NODES_SHIFT),
15 * plus E820MAX, allowing space for the possible duplicate E820
16 * entries that might need room in the same arrays, prior to the
17 * call to sanitize_e820_map() to remove duplicates. The allowance
18 * of three memory map entries per node is "enough" entries for
19 * the initial hardware platform motivating this mechanism to make
20 * use of additional EFI map entries. Future platforms may want
21 * to allow more than three entries per node or otherwise refine
22 * this size.
23 */
24
25#define E820_X_MAX E820MAX
26
27#define E820NR 0x1e8 /* # entries in E820MAP */
28
29#define E820_RAM 1
30#define E820_RESERVED 2
31#define E820_ACPI 3
32#define E820_NVS 4
33#define E820_UNUSABLE 5
34#define E820_PMEM 7
35
36/*
37 * This is a non-standardized way to represent ADR or NVDIMM regions that
38 * persist over a reboot. The kernel will ignore their special capabilities
39 * unless the CONFIG_X86_PMEM_LEGACY option is set.
40 *
41 * ( Note that older platforms also used 6 for the same type of memory,
42 * but newer versions switched to 12 as 6 was assigned differently. Some
43 * time they will learn... )
44 */
45#define E820_PRAM 12
46
47/*
48 * reserved RAM used by kernel itself
49 * if CONFIG_INTEL_TXT is enabled, memory of this type will be
50 * included in the S3 integrity calculation and so should not include
51 * any memory that BIOS might alter over the S3 transition
52 */
53#define E820_RESERVED_KERN 128
54
55#ifndef __ASSEMBLY__
56#include <linux/types.h>
57struct e820entry {
58 __u64 addr; /* start of memory segment */
59 __u64 size; /* size of memory segment */
60 __u32 type; /* type of memory segment */
61} __attribute__((packed));
62
63struct e820map {
64 __u32 nr_map;
65 struct e820entry map[E820_X_MAX];
66};
67
68#define ISA_START_ADDRESS 0xa0000
69#define ISA_END_ADDRESS 0x100000
70
71#define BIOS_BEGIN 0x000a0000
72#define BIOS_END 0x00100000
73
74#define BIOS_ROM_BASE 0xffe00000
75#define BIOS_ROM_END 0xffffffff
76
77#endif /* __ASSEMBLY__ */
78
79
80#endif /* _ASM_X86_E820_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/hw_breakpoint.h created+2
...@@ -0,0 +1,2 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/hwcap2.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_HWCAP2_H
3#define _ASM_X86_HWCAP2_H
4
5#include <linux/const.h>
6
7/* MONITOR/MWAIT enabled in Ring 3 */
8#define HWCAP2_RING3MWAIT _BITUL(0)
9
10/* Kernel allows FSGSBASE instructions available in Ring 3 */
11#define HWCAP2_FSGSBASE _BITUL(1)
12
13#endif
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ist.h created+30
...@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Include file for the interface to IST BIOS
4 * Copyright 2002 Andy Grover <andrew.grover@intel.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16#ifndef _ASM_X86_IST_H
17#define _ASM_X86_IST_H
18
19
20
21#include <linux/types.h>
22
23struct ist_info {
24 __u32 signature;
25 __u32 command;
26 __u32 event;
27 __u32 perf_level;
28};
29
30#endif /* _ASM_X86_IST_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm.h created+511
...@@ -0,0 +1,511 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_H
3#define _ASM_X86_KVM_H
4
5/*
6 * KVM x86 specific structures and definitions
7 *
8 */
9
10#include <linux/types.h>
11#include <linux/ioctl.h>
12
13#define KVM_PIO_PAGE_OFFSET 1
14#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
15#define KVM_DIRTY_LOG_PAGE_OFFSET 64
16
17#define DE_VECTOR 0
18#define DB_VECTOR 1
19#define BP_VECTOR 3
20#define OF_VECTOR 4
21#define BR_VECTOR 5
22#define UD_VECTOR 6
23#define NM_VECTOR 7
24#define DF_VECTOR 8
25#define TS_VECTOR 10
26#define NP_VECTOR 11
27#define SS_VECTOR 12
28#define GP_VECTOR 13
29#define PF_VECTOR 14
30#define MF_VECTOR 16
31#define AC_VECTOR 17
32#define MC_VECTOR 18
33#define XM_VECTOR 19
34#define VE_VECTOR 20
35
36/* Select x86 specific features in <linux/kvm.h> */
37#define __KVM_HAVE_PIT
38#define __KVM_HAVE_IOAPIC
39#define __KVM_HAVE_IRQ_LINE
40#define __KVM_HAVE_MSI
41#define __KVM_HAVE_USER_NMI
42#define __KVM_HAVE_GUEST_DEBUG
43#define __KVM_HAVE_MSIX
44#define __KVM_HAVE_MCE
45#define __KVM_HAVE_PIT_STATE2
46#define __KVM_HAVE_XEN_HVM
47#define __KVM_HAVE_VCPU_EVENTS
48#define __KVM_HAVE_DEBUGREGS
49#define __KVM_HAVE_XSAVE
50#define __KVM_HAVE_XCRS
51#define __KVM_HAVE_READONLY_MEM
52
53/* Architectural interrupt line count. */
54#define KVM_NR_INTERRUPTS 256
55
56struct kvm_memory_alias {
57 __u32 slot; /* this has a different namespace than memory slots */
58 __u32 flags;
59 __u64 guest_phys_addr;
60 __u64 memory_size;
61 __u64 target_phys_addr;
62};
63
64/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
65struct kvm_pic_state {
66 __u8 last_irr; /* edge detection */
67 __u8 irr; /* interrupt request register */
68 __u8 imr; /* interrupt mask register */
69 __u8 isr; /* interrupt service register */
70 __u8 priority_add; /* highest irq priority */
71 __u8 irq_base;
72 __u8 read_reg_select;
73 __u8 poll;
74 __u8 special_mask;
75 __u8 init_state;
76 __u8 auto_eoi;
77 __u8 rotate_on_auto_eoi;
78 __u8 special_fully_nested_mode;
79 __u8 init4; /* true if 4 byte init */
80 __u8 elcr; /* PIIX edge/trigger selection */
81 __u8 elcr_mask;
82};
83
84#define KVM_IOAPIC_NUM_PINS 24
85struct kvm_ioapic_state {
86 __u64 base_address;
87 __u32 ioregsel;
88 __u32 id;
89 __u32 irr;
90 __u32 pad;
91 union {
92 __u64 bits;
93 struct {
94 __u8 vector;
95 __u8 delivery_mode:3;
96 __u8 dest_mode:1;
97 __u8 delivery_status:1;
98 __u8 polarity:1;
99 __u8 remote_irr:1;
100 __u8 trig_mode:1;
101 __u8 mask:1;
102 __u8 reserve:7;
103 __u8 reserved[4];
104 __u8 dest_id;
105 } fields;
106 } redirtbl[KVM_IOAPIC_NUM_PINS];
107};
108
109#define KVM_IRQCHIP_PIC_MASTER 0
110#define KVM_IRQCHIP_PIC_SLAVE 1
111#define KVM_IRQCHIP_IOAPIC 2
112#define KVM_NR_IRQCHIPS 3
113
114#define KVM_RUN_X86_SMM (1 << 0)
115#define KVM_RUN_X86_BUS_LOCK (1 << 1)
116
117/* for KVM_GET_REGS and KVM_SET_REGS */
118struct kvm_regs {
119 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
120 __u64 rax, rbx, rcx, rdx;
121 __u64 rsi, rdi, rsp, rbp;
122 __u64 r8, r9, r10, r11;
123 __u64 r12, r13, r14, r15;
124 __u64 rip, rflags;
125};
126
127/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
128#define KVM_APIC_REG_SIZE 0x400
129struct kvm_lapic_state {
130 char regs[KVM_APIC_REG_SIZE];
131};
132
133struct kvm_segment {
134 __u64 base;
135 __u32 limit;
136 __u16 selector;
137 __u8 type;
138 __u8 present, dpl, db, s, l, g, avl;
139 __u8 unusable;
140 __u8 padding;
141};
142
143struct kvm_dtable {
144 __u64 base;
145 __u16 limit;
146 __u16 padding[3];
147};
148
149
150/* for KVM_GET_SREGS and KVM_SET_SREGS */
151struct kvm_sregs {
152 /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
153 struct kvm_segment cs, ds, es, fs, gs, ss;
154 struct kvm_segment tr, ldt;
155 struct kvm_dtable gdt, idt;
156 __u64 cr0, cr2, cr3, cr4, cr8;
157 __u64 efer;
158 __u64 apic_base;
159 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
160};
161
162struct kvm_sregs2 {
163 /* out (KVM_GET_SREGS2) / in (KVM_SET_SREGS2) */
164 struct kvm_segment cs, ds, es, fs, gs, ss;
165 struct kvm_segment tr, ldt;
166 struct kvm_dtable gdt, idt;
167 __u64 cr0, cr2, cr3, cr4, cr8;
168 __u64 efer;
169 __u64 apic_base;
170 __u64 flags;
171 __u64 pdptrs[4];
172};
173#define KVM_SREGS2_FLAGS_PDPTRS_VALID 1
174
175/* for KVM_GET_FPU and KVM_SET_FPU */
176struct kvm_fpu {
177 __u8 fpr[8][16];
178 __u16 fcw;
179 __u16 fsw;
180 __u8 ftwx; /* in fxsave format */
181 __u8 pad1;
182 __u16 last_opcode;
183 __u64 last_ip;
184 __u64 last_dp;
185 __u8 xmm[16][16];
186 __u32 mxcsr;
187 __u32 pad2;
188};
189
190struct kvm_msr_entry {
191 __u32 index;
192 __u32 reserved;
193 __u64 data;
194};
195
196/* for KVM_GET_MSRS and KVM_SET_MSRS */
197struct kvm_msrs {
198 __u32 nmsrs; /* number of msrs in entries */
199 __u32 pad;
200
201 struct kvm_msr_entry entries[0];
202};
203
204/* for KVM_GET_MSR_INDEX_LIST */
205struct kvm_msr_list {
206 __u32 nmsrs; /* number of msrs in entries */
207 __u32 indices[0];
208};
209
210/* Maximum size of any access bitmap in bytes */
211#define KVM_MSR_FILTER_MAX_BITMAP_SIZE 0x600
212
213/* for KVM_X86_SET_MSR_FILTER */
214struct kvm_msr_filter_range {
215#define KVM_MSR_FILTER_READ (1 << 0)
216#define KVM_MSR_FILTER_WRITE (1 << 1)
217 __u32 flags;
218 __u32 nmsrs; /* number of msrs in bitmap */
219 __u32 base; /* MSR index the bitmap starts at */
220 __u8 *bitmap; /* a 1 bit allows the operations in flags, 0 denies */
221};
222
223#define KVM_MSR_FILTER_MAX_RANGES 16
224struct kvm_msr_filter {
225#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)
226#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)
227 __u32 flags;
228 struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];
229};
230
231struct kvm_cpuid_entry {
232 __u32 function;
233 __u32 eax;
234 __u32 ebx;
235 __u32 ecx;
236 __u32 edx;
237 __u32 padding;
238};
239
240/* for KVM_SET_CPUID */
241struct kvm_cpuid {
242 __u32 nent;
243 __u32 padding;
244 struct kvm_cpuid_entry entries[0];
245};
246
247struct kvm_cpuid_entry2 {
248 __u32 function;
249 __u32 index;
250 __u32 flags;
251 __u32 eax;
252 __u32 ebx;
253 __u32 ecx;
254 __u32 edx;
255 __u32 padding[3];
256};
257
258#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0)
259#define KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1)
260#define KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2)
261
262/* for KVM_SET_CPUID2 */
263struct kvm_cpuid2 {
264 __u32 nent;
265 __u32 padding;
266 struct kvm_cpuid_entry2 entries[0];
267};
268
269/* for KVM_GET_PIT and KVM_SET_PIT */
270struct kvm_pit_channel_state {
271 __u32 count; /* can be 65536 */
272 __u16 latched_count;
273 __u8 count_latched;
274 __u8 status_latched;
275 __u8 status;
276 __u8 read_state;
277 __u8 write_state;
278 __u8 write_latch;
279 __u8 rw_mode;
280 __u8 mode;
281 __u8 bcd;
282 __u8 gate;
283 __s64 count_load_time;
284};
285
286struct kvm_debug_exit_arch {
287 __u32 exception;
288 __u32 pad;
289 __u64 pc;
290 __u64 dr6;
291 __u64 dr7;
292};
293
294#define KVM_GUESTDBG_USE_SW_BP 0x00010000
295#define KVM_GUESTDBG_USE_HW_BP 0x00020000
296#define KVM_GUESTDBG_INJECT_DB 0x00040000
297#define KVM_GUESTDBG_INJECT_BP 0x00080000
298#define KVM_GUESTDBG_BLOCKIRQ 0x00100000
299
300/* for KVM_SET_GUEST_DEBUG */
301struct kvm_guest_debug_arch {
302 __u64 debugreg[8];
303};
304
305struct kvm_pit_state {
306 struct kvm_pit_channel_state channels[3];
307};
308
309#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
310
311struct kvm_pit_state2 {
312 struct kvm_pit_channel_state channels[3];
313 __u32 flags;
314 __u32 reserved[9];
315};
316
317struct kvm_reinject_control {
318 __u8 pit_reinject;
319 __u8 reserved[31];
320};
321
322/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */
323#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001
324#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
325#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
326#define KVM_VCPUEVENT_VALID_SMM 0x00000008
327#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
328
329/* Interrupt shadow states */
330#define KVM_X86_SHADOW_INT_MOV_SS 0x01
331#define KVM_X86_SHADOW_INT_STI 0x02
332
333/* for KVM_GET/SET_VCPU_EVENTS */
334struct kvm_vcpu_events {
335 struct {
336 __u8 injected;
337 __u8 nr;
338 __u8 has_error_code;
339 __u8 pending;
340 __u32 error_code;
341 } exception;
342 struct {
343 __u8 injected;
344 __u8 nr;
345 __u8 soft;
346 __u8 shadow;
347 } interrupt;
348 struct {
349 __u8 injected;
350 __u8 pending;
351 __u8 masked;
352 __u8 pad;
353 } nmi;
354 __u32 sipi_vector;
355 __u32 flags;
356 struct {
357 __u8 smm;
358 __u8 pending;
359 __u8 smm_inside_nmi;
360 __u8 latched_init;
361 } smi;
362 __u8 reserved[27];
363 __u8 exception_has_payload;
364 __u64 exception_payload;
365};
366
367/* for KVM_GET/SET_DEBUGREGS */
368struct kvm_debugregs {
369 __u64 db[4];
370 __u64 dr6;
371 __u64 dr7;
372 __u64 flags;
373 __u64 reserved[9];
374};
375
376/* for KVM_CAP_XSAVE */
377struct kvm_xsave {
378 __u32 region[1024];
379};
380
381#define KVM_MAX_XCRS 16
382
383struct kvm_xcr {
384 __u32 xcr;
385 __u32 reserved;
386 __u64 value;
387};
388
389struct kvm_xcrs {
390 __u32 nr_xcrs;
391 __u32 flags;
392 struct kvm_xcr xcrs[KVM_MAX_XCRS];
393 __u64 padding[16];
394};
395
396#define KVM_SYNC_X86_REGS (1UL << 0)
397#define KVM_SYNC_X86_SREGS (1UL << 1)
398#define KVM_SYNC_X86_EVENTS (1UL << 2)
399
400#define KVM_SYNC_X86_VALID_FIELDS \
401 (KVM_SYNC_X86_REGS| \
402 KVM_SYNC_X86_SREGS| \
403 KVM_SYNC_X86_EVENTS)
404
405/* kvm_sync_regs struct included by kvm_run struct */
406struct kvm_sync_regs {
407 /* Members of this structure are potentially malicious.
408 * Care must be taken by code reading, esp. interpreting,
409 * data fields from them inside KVM to prevent TOCTOU and
410 * double-fetch types of vulnerabilities.
411 */
412 struct kvm_regs regs;
413 struct kvm_sregs sregs;
414 struct kvm_vcpu_events events;
415};
416
417#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
418#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
419#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
420#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
421#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
422
423#define KVM_STATE_NESTED_FORMAT_VMX 0
424#define KVM_STATE_NESTED_FORMAT_SVM 1
425
426#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
427#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
428#define KVM_STATE_NESTED_EVMCS 0x00000004
429#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
430#define KVM_STATE_NESTED_GIF_SET 0x00000100
431
432#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
433#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
434
435#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
436
437#define KVM_STATE_NESTED_SVM_VMCB_SIZE 0x1000
438
439#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
440
441struct kvm_vmx_nested_state_data {
442 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
443 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
444};
445
446struct kvm_vmx_nested_state_hdr {
447 __u64 vmxon_pa;
448 __u64 vmcs12_pa;
449
450 struct {
451 __u16 flags;
452 } smm;
453
454 __u16 pad;
455
456 __u32 flags;
457 __u64 preemption_timer_deadline;
458};
459
460struct kvm_svm_nested_state_data {
461 /* Save area only used if KVM_STATE_NESTED_RUN_PENDING. */
462 __u8 vmcb12[KVM_STATE_NESTED_SVM_VMCB_SIZE];
463};
464
465struct kvm_svm_nested_state_hdr {
466 __u64 vmcb_pa;
467};
468
469/* for KVM_CAP_NESTED_STATE */
470struct kvm_nested_state {
471 __u16 flags;
472 __u16 format;
473 __u32 size;
474
475 union {
476 struct kvm_vmx_nested_state_hdr vmx;
477 struct kvm_svm_nested_state_hdr svm;
478
479 /* Pad the header to 128 bytes. */
480 __u8 pad[120];
481 } hdr;
482
483 /*
484 * Define data region as 0 bytes to preserve backwards-compatability
485 * to old definition of kvm_nested_state in order to avoid changing
486 * KVM_{GET,PUT}_NESTED_STATE ioctl values.
487 */
488 union {
489 struct kvm_vmx_nested_state_data vmx[0];
490 struct kvm_svm_nested_state_data svm[0];
491 } data;
492};
493
494/* for KVM_CAP_PMU_EVENT_FILTER */
495struct kvm_pmu_event_filter {
496 __u32 action;
497 __u32 nevents;
498 __u32 fixed_counter_bitmap;
499 __u32 flags;
500 __u32 pad[4];
501 __u64 events[0];
502};
503
504#define KVM_PMU_EVENT_ALLOW 0
505#define KVM_PMU_EVENT_DENY 1
506
507/* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
508#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
509#define KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */
510
511#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm_para.h created+153
...@@ -0,0 +1,153 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_PARA_H
3#define _ASM_X86_KVM_PARA_H
4
5#include <linux/types.h>
6
7/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
8 * should be used to determine that a VM is running under KVM.
9 */
10#define KVM_CPUID_SIGNATURE 0x40000000
11#define KVM_SIGNATURE "KVMKVMKVM\0\0\0"
12
13/* This CPUID returns two feature bitmaps in eax, edx. Before enabling
14 * a particular paravirtualization, the appropriate feature bit should
15 * be checked in eax. The performance hint feature bit should be checked
16 * in edx.
17 */
18#define KVM_CPUID_FEATURES 0x40000001
19#define KVM_FEATURE_CLOCKSOURCE 0
20#define KVM_FEATURE_NOP_IO_DELAY 1
21#define KVM_FEATURE_MMU_OP 2
22/* This indicates that the new set of kvmclock msrs
23 * are available. The use of 0x11 and 0x12 is deprecated
24 */
25#define KVM_FEATURE_CLOCKSOURCE2 3
26#define KVM_FEATURE_ASYNC_PF 4
27#define KVM_FEATURE_STEAL_TIME 5
28#define KVM_FEATURE_PV_EOI 6
29#define KVM_FEATURE_PV_UNHALT 7
30#define KVM_FEATURE_PV_TLB_FLUSH 9
31#define KVM_FEATURE_ASYNC_PF_VMEXIT 10
32#define KVM_FEATURE_PV_SEND_IPI 11
33#define KVM_FEATURE_POLL_CONTROL 12
34#define KVM_FEATURE_PV_SCHED_YIELD 13
35#define KVM_FEATURE_ASYNC_PF_INT 14
36#define KVM_FEATURE_MSI_EXT_DEST_ID 15
37#define KVM_FEATURE_HC_MAP_GPA_RANGE 16
38#define KVM_FEATURE_MIGRATION_CONTROL 17
39
40#define KVM_HINTS_REALTIME 0
41
42/* The last 8 bits are used to indicate how to interpret the flags field
43 * in pvclock structure. If no bits are set, all flags are ignored.
44 */
45#define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 24
46
47#define MSR_KVM_WALL_CLOCK 0x11
48#define MSR_KVM_SYSTEM_TIME 0x12
49
50#define KVM_MSR_ENABLED 1
51/* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
52#define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00
53#define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
54#define MSR_KVM_ASYNC_PF_EN 0x4b564d02
55#define MSR_KVM_STEAL_TIME 0x4b564d03
56#define MSR_KVM_PV_EOI_EN 0x4b564d04
57#define MSR_KVM_POLL_CONTROL 0x4b564d05
58#define MSR_KVM_ASYNC_PF_INT 0x4b564d06
59#define MSR_KVM_ASYNC_PF_ACK 0x4b564d07
60#define MSR_KVM_MIGRATION_CONTROL 0x4b564d08
61
62struct kvm_steal_time {
63 __u64 steal;
64 __u32 version;
65 __u32 flags;
66 __u8 preempted;
67 __u8 u8_pad[3];
68 __u32 pad[11];
69};
70
71#define KVM_VCPU_PREEMPTED (1 << 0)
72#define KVM_VCPU_FLUSH_TLB (1 << 1)
73
74#define KVM_CLOCK_PAIRING_WALLCLOCK 0
75struct kvm_clock_pairing {
76 __s64 sec;
77 __s64 nsec;
78 __u64 tsc;
79 __u32 flags;
80 __u32 pad[9];
81};
82
83#define KVM_STEAL_ALIGNMENT_BITS 5
84#define KVM_STEAL_VALID_BITS ((-1ULL << (KVM_STEAL_ALIGNMENT_BITS + 1)))
85#define KVM_STEAL_RESERVED_MASK (((1 << KVM_STEAL_ALIGNMENT_BITS) - 1 ) << 1)
86
87#define KVM_MAX_MMU_OP_BATCH 32
88
89#define KVM_ASYNC_PF_ENABLED (1 << 0)
90#define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1)
91#define KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT (1 << 2)
92#define KVM_ASYNC_PF_DELIVERY_AS_INT (1 << 3)
93
94/* MSR_KVM_ASYNC_PF_INT */
95#define KVM_ASYNC_PF_VEC_MASK GENMASK(7, 0)
96
97/* MSR_KVM_MIGRATION_CONTROL */
98#define KVM_MIGRATION_READY (1 << 0)
99
100/* KVM_HC_MAP_GPA_RANGE */
101#define KVM_MAP_GPA_RANGE_PAGE_SZ_4K 0
102#define KVM_MAP_GPA_RANGE_PAGE_SZ_2M (1 << 0)
103#define KVM_MAP_GPA_RANGE_PAGE_SZ_1G (1 << 1)
104#define KVM_MAP_GPA_RANGE_ENC_STAT(n) (n << 4)
105#define KVM_MAP_GPA_RANGE_ENCRYPTED KVM_MAP_GPA_RANGE_ENC_STAT(1)
106#define KVM_MAP_GPA_RANGE_DECRYPTED KVM_MAP_GPA_RANGE_ENC_STAT(0)
107
108/* Operations for KVM_HC_MMU_OP */
109#define KVM_MMU_OP_WRITE_PTE 1
110#define KVM_MMU_OP_FLUSH_TLB 2
111#define KVM_MMU_OP_RELEASE_PT 3
112
113/* Payload for KVM_HC_MMU_OP */
114struct kvm_mmu_op_header {
115 __u32 op;
116 __u32 pad;
117};
118
119struct kvm_mmu_op_write_pte {
120 struct kvm_mmu_op_header header;
121 __u64 pte_phys;
122 __u64 pte_val;
123};
124
125struct kvm_mmu_op_flush_tlb {
126 struct kvm_mmu_op_header header;
127};
128
129struct kvm_mmu_op_release_pt {
130 struct kvm_mmu_op_header header;
131 __u64 pt_phys;
132};
133
134#define KVM_PV_REASON_PAGE_NOT_PRESENT 1
135#define KVM_PV_REASON_PAGE_READY 2
136
137struct kvm_vcpu_pv_apf_data {
138 /* Used for 'page not present' events delivered via #PF */
139 __u32 flags;
140
141 /* Used for 'page ready' events delivered via interrupt notification */
142 __u32 token;
143
144 __u8 pad[56];
145 __u32 enabled;
146};
147
148#define KVM_PV_EOI_BIT 0
149#define KVM_PV_EOI_MASK (0x1 << KVM_PV_EOI_BIT)
150#define KVM_PV_EOI_ENABLED KVM_PV_EOI_MASK
151#define KVM_PV_EOI_DISABLED 0x0
152
153#endif /* _ASM_X86_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm_perf.h created+17
...@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_PERF_H
3#define _ASM_X86_KVM_PERF_H
4
5#include <asm/svm.h>
6#include <asm/vmx.h>
7#include <asm/kvm.h>
8
9#define DECODE_STR_LEN 20
10
11#define VCPU_ID "vcpu_id"
12
13#define KVM_ENTRY_TRACE "kvm:kvm_entry"
14#define KVM_EXIT_TRACE "kvm:kvm_exit"
15#define KVM_EXIT_REASON "exit_reason"
16
17#endif /* _ASM_X86_KVM_PERF_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ldt.h created+48
...@@ -0,0 +1,48 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * ldt.h
4 *
5 * Definitions of structures used with the modify_ldt system call.
6 */
7#ifndef _ASM_X86_LDT_H
8#define _ASM_X86_LDT_H
9
10/* Maximum number of LDT entries supported. */
11#define LDT_ENTRIES 8192
12/* The size of each LDT entry. */
13#define LDT_ENTRY_SIZE 8
14
15#ifndef __ASSEMBLY__
16/*
17 * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
18 * not to the default values if you still want to do syscalls. This
19 * call is more for 32bit mode therefore.
20 */
21struct user_desc {
22 unsigned int entry_number;
23 unsigned int base_addr;
24 unsigned int limit;
25 unsigned int seg_32bit:1;
26 unsigned int contents:2;
27 unsigned int read_exec_only:1;
28 unsigned int limit_in_pages:1;
29 unsigned int seg_not_present:1;
30 unsigned int useable:1;
31#ifdef __x86_64__
32 /*
33 * Because this bit is not present in 32-bit user code, user
34 * programs can pass uninitialized values here. Therefore, in
35 * any context in which a user_desc comes from a 32-bit program,
36 * the kernel must act as though lm == 0, regardless of the
37 * actual value.
38 */
39 unsigned int lm:1;
40#endif
41};
42
43#define MODIFY_LDT_CONTENTS_DATA 0
44#define MODIFY_LDT_CONTENTS_STACK 1
45#define MODIFY_LDT_CONTENTS_CODE 2
46
47#endif /* !__ASSEMBLY__ */
48#endif /* _ASM_X86_LDT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/mce.h created+45
...@@ -0,0 +1,45 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MCE_H
3#define _ASM_X86_MCE_H
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8/*
9 * Fields are zero when not available. Also, this struct is shared with
10 * userspace mcelog and thus must keep existing fields at current offsets.
11 * Only add new fields to the end of the structure
12 */
13struct mce {
14 __u64 status; /* Bank's MCi_STATUS MSR */
15 __u64 misc; /* Bank's MCi_MISC MSR */
16 __u64 addr; /* Bank's MCi_ADDR MSR */
17 __u64 mcgstatus; /* Machine Check Global Status MSR */
18 __u64 ip; /* Instruction Pointer when the error happened */
19 __u64 tsc; /* CPU time stamp counter */
20 __u64 time; /* Wall time_t when error was detected */
21 __u8 cpuvendor; /* Kernel's X86_VENDOR enum */
22 __u8 inject_flags; /* Software inject flags */
23 __u8 severity; /* Error severity */
24 __u8 pad;
25 __u32 cpuid; /* CPUID 1 EAX */
26 __u8 cs; /* Code segment */
27 __u8 bank; /* Machine check bank reporting the error */
28 __u8 cpu; /* CPU number; obsoleted by extcpu */
29 __u8 finished; /* Entry is valid */
30 __u32 extcpu; /* Linux CPU number that detected the error */
31 __u32 socketid; /* CPU socket ID */
32 __u32 apicid; /* CPU initial APIC ID */
33 __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
34 __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */
35 __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
36 __u64 ppin; /* Protected Processor Inventory Number */
37 __u32 microcode; /* Microcode revision */
38 __u64 kflags; /* Internal kernel use */
39};
40
41#define MCE_GET_RECORD_LEN _IOR('M', 1, int)
42#define MCE_GET_LOG_LEN _IOR('M', 2, int)
43#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
44
45#endif /* _ASM_X86_MCE_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/mman.h created+31
...@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MMAN_H
3#define _ASM_X86_MMAN_H
4
5#define MAP_32BIT 0x40 /* only give out 32bit addresses */
6
7#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8/*
9 * Take the 4 protection key bits out of the vma->vm_flags
10 * value and turn them in to the bits that we can put in
11 * to a pte.
12 *
13 * Only override these if Protection Keys are available
14 * (which is only on 64-bit).
15 */
16#define arch_vm_get_page_prot(vm_flags) __pgprot( \
17 ((vm_flags) & VM_PKEY_BIT0 ? _PAGE_PKEY_BIT0 : 0) | \
18 ((vm_flags) & VM_PKEY_BIT1 ? _PAGE_PKEY_BIT1 : 0) | \
19 ((vm_flags) & VM_PKEY_BIT2 ? _PAGE_PKEY_BIT2 : 0) | \
20 ((vm_flags) & VM_PKEY_BIT3 ? _PAGE_PKEY_BIT3 : 0))
21
22#define arch_calc_vm_prot_bits(prot, key) ( \
23 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
24 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
25 ((key) & 0x4 ? VM_PKEY_BIT2 : 0) | \
26 ((key) & 0x8 ? VM_PKEY_BIT3 : 0))
27#endif
28
29#include <asm-generic/mman.h>
30
31#endif /* _ASM_X86_MMAN_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/msgbuf.h created+35
...@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X64_MSGBUF_H
3#define __ASM_X64_MSGBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/msgbuf.h>
7#else
8
9#include <asm/ipcbuf.h>
10
11/*
12 * The msqid64_ds structure for x86 architecture with x32 ABI.
13 *
14 * On x86-32 and x86-64 we can just use the generic definition, but
15 * x32 uses the same binary layout as x86_64, which is different
16 * from other 32-bit architectures.
17 */
18
19struct msqid64_ds {
20 struct ipc64_perm msg_perm;
21 __kernel_long_t msg_stime; /* last msgsnd time */
22 __kernel_long_t msg_rtime; /* last msgrcv time */
23 __kernel_long_t msg_ctime; /* last change time */
24 __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */
25 __kernel_ulong_t msg_qnum; /* number of messages in queue */
26 __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */
27 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
28 __kernel_pid_t msg_lrpid; /* last receive pid */
29 __kernel_ulong_t __unused4;
30 __kernel_ulong_t __unused5;
31};
32
33#endif
34
35#endif /* __ASM_GENERIC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/msr.h created+14
...@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MSR_H
3#define _ASM_X86_MSR_H
4
5#ifndef __ASSEMBLY__
6
7#include <linux/types.h>
8#include <linux/ioctl.h>
9
10#define X86_IOC_RDMSR_REGS _IOWR('c', 0xA0, __u32[8])
11#define X86_IOC_WRMSR_REGS _IOWR('c', 0xA1, __u32[8])
12
13#endif /* __ASSEMBLY__ */
14#endif /* _ASM_X86_MSR_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/mtrr.h created+124
...@@ -0,0 +1,124 @@
1/* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */
2/* Generic MTRR (Memory Type Range Register) ioctls.
3
4 Copyright (C) 1997-1999 Richard Gooch
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the Free
18 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 Richard Gooch may be reached by email at rgooch@atnf.csiro.au
21 The postal address is:
22 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
23*/
24#ifndef _ASM_X86_MTRR_H
25#define _ASM_X86_MTRR_H
26
27#include <linux/types.h>
28#include <linux/ioctl.h>
29#include <linux/errno.h>
30
31#define MTRR_IOCTL_BASE 'M'
32
33/* Warning: this structure has a different order from i386
34 on x86-64. The 32bit emulation code takes care of that.
35 But you need to use this for 64bit, otherwise your X server
36 will break. */
37
38#ifdef __i386__
39struct mtrr_sentry {
40 unsigned long base; /* Base address */
41 unsigned int size; /* Size of region */
42 unsigned int type; /* Type of region */
43};
44
45struct mtrr_gentry {
46 unsigned int regnum; /* Register number */
47 unsigned long base; /* Base address */
48 unsigned int size; /* Size of region */
49 unsigned int type; /* Type of region */
50};
51
52#else /* __i386__ */
53
54struct mtrr_sentry {
55 __u64 base; /* Base address */
56 __u32 size; /* Size of region */
57 __u32 type; /* Type of region */
58};
59
60struct mtrr_gentry {
61 __u64 base; /* Base address */
62 __u32 size; /* Size of region */
63 __u32 regnum; /* Register number */
64 __u32 type; /* Type of region */
65 __u32 _pad; /* Unused */
66};
67
68#endif /* !__i386__ */
69
70struct mtrr_var_range {
71 __u32 base_lo;
72 __u32 base_hi;
73 __u32 mask_lo;
74 __u32 mask_hi;
75};
76
77/* In the Intel processor's MTRR interface, the MTRR type is always held in
78 an 8 bit field: */
79typedef __u8 mtrr_type;
80
81#define MTRR_NUM_FIXED_RANGES 88
82#define MTRR_MAX_VAR_RANGES 256
83
84struct mtrr_state_type {
85 struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
86 mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
87 unsigned char enabled;
88 unsigned char have_fixed;
89 mtrr_type def_type;
90};
91
92#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
93#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
94
95/* These are the various ioctls */
96#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
97#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)
98#define MTRRIOC_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry)
99#define MTRRIOC_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry)
100#define MTRRIOC_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry)
101#define MTRRIOC_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry)
102#define MTRRIOC_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry)
103#define MTRRIOC_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry)
104#define MTRRIOC_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry)
105#define MTRRIOC_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry)
106
107/* MTRR memory types, which are defined in SDM */
108#define MTRR_TYPE_UNCACHABLE 0
109#define MTRR_TYPE_WRCOMB 1
110/*#define MTRR_TYPE_ 2*/
111/*#define MTRR_TYPE_ 3*/
112#define MTRR_TYPE_WRTHROUGH 4
113#define MTRR_TYPE_WRPROT 5
114#define MTRR_TYPE_WRBACK 6
115#define MTRR_NUM_TYPES 7
116
117/*
118 * Invalid MTRR memory type. mtrr_type_lookup() returns this value when
119 * MTRRs are disabled. Note, this value is allocated from the reserved
120 * values (0x7-0xff) of the MTRR memory types.
121 */
122#define MTRR_TYPE_INVALID 0xff
123
124#endif /* _ASM_X86_MTRR_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/perf_regs.h created+58
...@@ -0,0 +1,58 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PERF_REGS_H
3#define _ASM_X86_PERF_REGS_H
4
5enum perf_event_x86_regs {
6 PERF_REG_X86_AX,
7 PERF_REG_X86_BX,
8 PERF_REG_X86_CX,
9 PERF_REG_X86_DX,
10 PERF_REG_X86_SI,
11 PERF_REG_X86_DI,
12 PERF_REG_X86_BP,
13 PERF_REG_X86_SP,
14 PERF_REG_X86_IP,
15 PERF_REG_X86_FLAGS,
16 PERF_REG_X86_CS,
17 PERF_REG_X86_SS,
18 PERF_REG_X86_DS,
19 PERF_REG_X86_ES,
20 PERF_REG_X86_FS,
21 PERF_REG_X86_GS,
22 PERF_REG_X86_R8,
23 PERF_REG_X86_R9,
24 PERF_REG_X86_R10,
25 PERF_REG_X86_R11,
26 PERF_REG_X86_R12,
27 PERF_REG_X86_R13,
28 PERF_REG_X86_R14,
29 PERF_REG_X86_R15,
30 /* These are the limits for the GPRs. */
31 PERF_REG_X86_32_MAX = PERF_REG_X86_GS + 1,
32 PERF_REG_X86_64_MAX = PERF_REG_X86_R15 + 1,
33
34 /* These all need two bits set because they are 128bit */
35 PERF_REG_X86_XMM0 = 32,
36 PERF_REG_X86_XMM1 = 34,
37 PERF_REG_X86_XMM2 = 36,
38 PERF_REG_X86_XMM3 = 38,
39 PERF_REG_X86_XMM4 = 40,
40 PERF_REG_X86_XMM5 = 42,
41 PERF_REG_X86_XMM6 = 44,
42 PERF_REG_X86_XMM7 = 46,
43 PERF_REG_X86_XMM8 = 48,
44 PERF_REG_X86_XMM9 = 50,
45 PERF_REG_X86_XMM10 = 52,
46 PERF_REG_X86_XMM11 = 54,
47 PERF_REG_X86_XMM12 = 56,
48 PERF_REG_X86_XMM13 = 58,
49 PERF_REG_X86_XMM14 = 60,
50 PERF_REG_X86_XMM15 = 62,
51
52 /* These include both GPRs and XMMX registers */
53 PERF_REG_X86_XMM_MAX = PERF_REG_X86_XMM15 + 2,
54};
55
56#define PERF_REG_EXTENDED_MASK (~((1ULL << PERF_REG_X86_XMM0) - 1))
57
58#endif /* _ASM_X86_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/posix_types.h created+8
...@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2# ifdef __i386__
3# include <asm/posix_types_32.h>
4# elif defined(__ILP32__)
5# include <asm/posix_types_x32.h>
6# else
7# include <asm/posix_types_64.h>
8# endif
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/posix_types_32.h created+26
...@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_32_H
3#define _ASM_X86_POSIX_TYPES_32_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11typedef unsigned short __kernel_mode_t;
12#define __kernel_mode_t __kernel_mode_t
13
14typedef unsigned short __kernel_ipc_pid_t;
15#define __kernel_ipc_pid_t __kernel_ipc_pid_t
16
17typedef unsigned short __kernel_uid_t;
18typedef unsigned short __kernel_gid_t;
19#define __kernel_uid_t __kernel_uid_t
20
21typedef unsigned short __kernel_old_dev_t;
22#define __kernel_old_dev_t __kernel_old_dev_t
23
24#include <asm-generic/posix_types.h>
25
26#endif /* _ASM_X86_POSIX_TYPES_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/posix_types_64.h created+20
...@@ -0,0 +1,20 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_64_H
3#define _ASM_X86_POSIX_TYPES_64_H
4
5/*
6 * This file is generally used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 */
10
11typedef unsigned short __kernel_old_uid_t;
12typedef unsigned short __kernel_old_gid_t;
13#define __kernel_old_uid_t __kernel_old_uid_t
14
15typedef unsigned long __kernel_old_dev_t;
16#define __kernel_old_dev_t __kernel_old_dev_t
17
18#include <asm-generic/posix_types.h>
19
20#endif /* _ASM_X86_POSIX_TYPES_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/posix_types_x32.h created+20
...@@ -0,0 +1,20 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_POSIX_TYPES_X32_H
3#define _ASM_X86_POSIX_TYPES_X32_H
4
5/*
6 * This file is only used by user-level software, so you need to
7 * be a little careful about namespace pollution etc. Also, we cannot
8 * assume GCC is being used.
9 *
10 * These types should generally match the ones used by the 64-bit kernel,
11 *
12 */
13
14typedef long long __kernel_long_t;
15typedef unsigned long long __kernel_ulong_t;
16#define __kernel_long_t __kernel_long_t
17
18#include <asm/posix_types_64.h>
19
20#endif /* _ASM_X86_POSIX_TYPES_X32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/prctl.h created+21
...@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PRCTL_H
3#define _ASM_X86_PRCTL_H
4
5#define ARCH_SET_GS 0x1001
6#define ARCH_SET_FS 0x1002
7#define ARCH_GET_FS 0x1003
8#define ARCH_GET_GS 0x1004
9
10#define ARCH_GET_CPUID 0x1011
11#define ARCH_SET_CPUID 0x1012
12
13#define ARCH_GET_XCOMP_SUPP 0x1021
14#define ARCH_GET_XCOMP_PERM 0x1022
15#define ARCH_REQ_XCOMP_PERM 0x1023
16
17#define ARCH_MAP_VDSO_X32 0x2001
18#define ARCH_MAP_VDSO_32 0x2002
19#define ARCH_MAP_VDSO_64 0x2003
20
21#endif /* _ASM_X86_PRCTL_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/processor-flags.h created+166
...@@ -0,0 +1,166 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PROCESSOR_FLAGS_H
3#define _ASM_X86_PROCESSOR_FLAGS_H
4/* Various flags defined: can be included from assembler. */
5
6#include <linux/const.h>
7
8/*
9 * EFLAGS bits
10 */
11#define X86_EFLAGS_CF_BIT 0 /* Carry Flag */
12#define X86_EFLAGS_CF _BITUL(X86_EFLAGS_CF_BIT)
13#define X86_EFLAGS_FIXED_BIT 1 /* Bit 1 - always on */
14#define X86_EFLAGS_FIXED _BITUL(X86_EFLAGS_FIXED_BIT)
15#define X86_EFLAGS_PF_BIT 2 /* Parity Flag */
16#define X86_EFLAGS_PF _BITUL(X86_EFLAGS_PF_BIT)
17#define X86_EFLAGS_AF_BIT 4 /* Auxiliary carry Flag */
18#define X86_EFLAGS_AF _BITUL(X86_EFLAGS_AF_BIT)
19#define X86_EFLAGS_ZF_BIT 6 /* Zero Flag */
20#define X86_EFLAGS_ZF _BITUL(X86_EFLAGS_ZF_BIT)
21#define X86_EFLAGS_SF_BIT 7 /* Sign Flag */
22#define X86_EFLAGS_SF _BITUL(X86_EFLAGS_SF_BIT)
23#define X86_EFLAGS_TF_BIT 8 /* Trap Flag */
24#define X86_EFLAGS_TF _BITUL(X86_EFLAGS_TF_BIT)
25#define X86_EFLAGS_IF_BIT 9 /* Interrupt Flag */
26#define X86_EFLAGS_IF _BITUL(X86_EFLAGS_IF_BIT)
27#define X86_EFLAGS_DF_BIT 10 /* Direction Flag */
28#define X86_EFLAGS_DF _BITUL(X86_EFLAGS_DF_BIT)
29#define X86_EFLAGS_OF_BIT 11 /* Overflow Flag */
30#define X86_EFLAGS_OF _BITUL(X86_EFLAGS_OF_BIT)
31#define X86_EFLAGS_IOPL_BIT 12 /* I/O Privilege Level (2 bits) */
32#define X86_EFLAGS_IOPL (_AC(3,UL) << X86_EFLAGS_IOPL_BIT)
33#define X86_EFLAGS_NT_BIT 14 /* Nested Task */
34#define X86_EFLAGS_NT _BITUL(X86_EFLAGS_NT_BIT)
35#define X86_EFLAGS_RF_BIT 16 /* Resume Flag */
36#define X86_EFLAGS_RF _BITUL(X86_EFLAGS_RF_BIT)
37#define X86_EFLAGS_VM_BIT 17 /* Virtual Mode */
38#define X86_EFLAGS_VM _BITUL(X86_EFLAGS_VM_BIT)
39#define X86_EFLAGS_AC_BIT 18 /* Alignment Check/Access Control */
40#define X86_EFLAGS_AC _BITUL(X86_EFLAGS_AC_BIT)
41#define X86_EFLAGS_VIF_BIT 19 /* Virtual Interrupt Flag */
42#define X86_EFLAGS_VIF _BITUL(X86_EFLAGS_VIF_BIT)
43#define X86_EFLAGS_VIP_BIT 20 /* Virtual Interrupt Pending */
44#define X86_EFLAGS_VIP _BITUL(X86_EFLAGS_VIP_BIT)
45#define X86_EFLAGS_ID_BIT 21 /* CPUID detection */
46#define X86_EFLAGS_ID _BITUL(X86_EFLAGS_ID_BIT)
47
48/*
49 * Basic CPU control in CR0
50 */
51#define X86_CR0_PE_BIT 0 /* Protection Enable */
52#define X86_CR0_PE _BITUL(X86_CR0_PE_BIT)
53#define X86_CR0_MP_BIT 1 /* Monitor Coprocessor */
54#define X86_CR0_MP _BITUL(X86_CR0_MP_BIT)
55#define X86_CR0_EM_BIT 2 /* Emulation */
56#define X86_CR0_EM _BITUL(X86_CR0_EM_BIT)
57#define X86_CR0_TS_BIT 3 /* Task Switched */
58#define X86_CR0_TS _BITUL(X86_CR0_TS_BIT)
59#define X86_CR0_ET_BIT 4 /* Extension Type */
60#define X86_CR0_ET _BITUL(X86_CR0_ET_BIT)
61#define X86_CR0_NE_BIT 5 /* Numeric Error */
62#define X86_CR0_NE _BITUL(X86_CR0_NE_BIT)
63#define X86_CR0_WP_BIT 16 /* Write Protect */
64#define X86_CR0_WP _BITUL(X86_CR0_WP_BIT)
65#define X86_CR0_AM_BIT 18 /* Alignment Mask */
66#define X86_CR0_AM _BITUL(X86_CR0_AM_BIT)
67#define X86_CR0_NW_BIT 29 /* Not Write-through */
68#define X86_CR0_NW _BITUL(X86_CR0_NW_BIT)
69#define X86_CR0_CD_BIT 30 /* Cache Disable */
70#define X86_CR0_CD _BITUL(X86_CR0_CD_BIT)
71#define X86_CR0_PG_BIT 31 /* Paging */
72#define X86_CR0_PG _BITUL(X86_CR0_PG_BIT)
73
74/*
75 * Paging options in CR3
76 */
77#define X86_CR3_PWT_BIT 3 /* Page Write Through */
78#define X86_CR3_PWT _BITUL(X86_CR3_PWT_BIT)
79#define X86_CR3_PCD_BIT 4 /* Page Cache Disable */
80#define X86_CR3_PCD _BITUL(X86_CR3_PCD_BIT)
81
82#define X86_CR3_PCID_BITS 12
83#define X86_CR3_PCID_MASK (_AC((1UL << X86_CR3_PCID_BITS) - 1, UL))
84
85#define X86_CR3_PCID_NOFLUSH_BIT 63 /* Preserve old PCID */
86#define X86_CR3_PCID_NOFLUSH _BITULL(X86_CR3_PCID_NOFLUSH_BIT)
87
88/*
89 * Intel CPU features in CR4
90 */
91#define X86_CR4_VME_BIT 0 /* enable vm86 extensions */
92#define X86_CR4_VME _BITUL(X86_CR4_VME_BIT)
93#define X86_CR4_PVI_BIT 1 /* virtual interrupts flag enable */
94#define X86_CR4_PVI _BITUL(X86_CR4_PVI_BIT)
95#define X86_CR4_TSD_BIT 2 /* disable time stamp at ipl 3 */
96#define X86_CR4_TSD _BITUL(X86_CR4_TSD_BIT)
97#define X86_CR4_DE_BIT 3 /* enable debugging extensions */
98#define X86_CR4_DE _BITUL(X86_CR4_DE_BIT)
99#define X86_CR4_PSE_BIT 4 /* enable page size extensions */
100#define X86_CR4_PSE _BITUL(X86_CR4_PSE_BIT)
101#define X86_CR4_PAE_BIT 5 /* enable physical address extensions */
102#define X86_CR4_PAE _BITUL(X86_CR4_PAE_BIT)
103#define X86_CR4_MCE_BIT 6 /* Machine check enable */
104#define X86_CR4_MCE _BITUL(X86_CR4_MCE_BIT)
105#define X86_CR4_PGE_BIT 7 /* enable global pages */
106#define X86_CR4_PGE _BITUL(X86_CR4_PGE_BIT)
107#define X86_CR4_PCE_BIT 8 /* enable performance counters at ipl 3 */
108#define X86_CR4_PCE _BITUL(X86_CR4_PCE_BIT)
109#define X86_CR4_OSFXSR_BIT 9 /* enable fast FPU save and restore */
110#define X86_CR4_OSFXSR _BITUL(X86_CR4_OSFXSR_BIT)
111#define X86_CR4_OSXMMEXCPT_BIT 10 /* enable unmasked SSE exceptions */
112#define X86_CR4_OSXMMEXCPT _BITUL(X86_CR4_OSXMMEXCPT_BIT)
113#define X86_CR4_UMIP_BIT 11 /* enable UMIP support */
114#define X86_CR4_UMIP _BITUL(X86_CR4_UMIP_BIT)
115#define X86_CR4_LA57_BIT 12 /* enable 5-level page tables */
116#define X86_CR4_LA57 _BITUL(X86_CR4_LA57_BIT)
117#define X86_CR4_VMXE_BIT 13 /* enable VMX virtualization */
118#define X86_CR4_VMXE _BITUL(X86_CR4_VMXE_BIT)
119#define X86_CR4_SMXE_BIT 14 /* enable safer mode (TXT) */
120#define X86_CR4_SMXE _BITUL(X86_CR4_SMXE_BIT)
121#define X86_CR4_FSGSBASE_BIT 16 /* enable RDWRFSGS support */
122#define X86_CR4_FSGSBASE _BITUL(X86_CR4_FSGSBASE_BIT)
123#define X86_CR4_PCIDE_BIT 17 /* enable PCID support */
124#define X86_CR4_PCIDE _BITUL(X86_CR4_PCIDE_BIT)
125#define X86_CR4_OSXSAVE_BIT 18 /* enable xsave and xrestore */
126#define X86_CR4_OSXSAVE _BITUL(X86_CR4_OSXSAVE_BIT)
127#define X86_CR4_SMEP_BIT 20 /* enable SMEP support */
128#define X86_CR4_SMEP _BITUL(X86_CR4_SMEP_BIT)
129#define X86_CR4_SMAP_BIT 21 /* enable SMAP support */
130#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT)
131#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */
132#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
133
134/*
135 * x86-64 Task Priority Register, CR8
136 */
137#define X86_CR8_TPR _AC(0x0000000f,UL) /* task priority register */
138
139/*
140 * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>
141 */
142
143/*
144 * NSC/Cyrix CPU configuration register indexes
145 */
146#define CX86_PCR0 0x20
147#define CX86_GCR 0xb8
148#define CX86_CCR0 0xc0
149#define CX86_CCR1 0xc1
150#define CX86_CCR2 0xc2
151#define CX86_CCR3 0xc3
152#define CX86_CCR4 0xe8
153#define CX86_CCR5 0xe9
154#define CX86_CCR6 0xea
155#define CX86_CCR7 0xeb
156#define CX86_PCR1 0xf0
157#define CX86_DIR0 0xfe
158#define CX86_DIR1 0xff
159#define CX86_ARR_BASE 0xc4
160#define CX86_RCR_BASE 0xdc
161
162#define CR0_STATE (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
163 X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
164 X86_CR0_PG)
165
166#endif /* _ASM_X86_PROCESSOR_FLAGS_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ptrace-abi.h created+94
...@@ -0,0 +1,94 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PTRACE_ABI_H
3#define _ASM_X86_PTRACE_ABI_H
4
5#ifdef __i386__
6
7#define EBX 0
8#define ECX 1
9#define EDX 2
10#define ESI 3
11#define EDI 4
12#define EBP 5
13#define EAX 6
14#define DS 7
15#define ES 8
16#define FS 9
17#define GS 10
18#define ORIG_EAX 11
19#define EIP 12
20#define CS 13
21#define EFL 14
22#define UESP 15
23#define SS 16
24#define FRAME_SIZE 17
25
26#else /* __i386__ */
27
28#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
29/*
30 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
31 * unless syscall needs a complete, fully filled "struct pt_regs".
32 */
33#define R15 0
34#define R14 8
35#define R13 16
36#define R12 24
37#define RBP 32
38#define RBX 40
39/* These regs are callee-clobbered. Always saved on kernel entry. */
40#define R11 48
41#define R10 56
42#define R9 64
43#define R8 72
44#define RAX 80
45#define RCX 88
46#define RDX 96
47#define RSI 104
48#define RDI 112
49/*
50 * On syscall entry, this is syscall#. On CPU exception, this is error code.
51 * On hw interrupt, it's IRQ number:
52 */
53#define ORIG_RAX 120
54/* Return frame for iretq */
55#define RIP 128
56#define CS 136
57#define EFLAGS 144
58#define RSP 152
59#define SS 160
60#endif /* __ASSEMBLY__ */
61
62/* top of stack page */
63#define FRAME_SIZE 168
64
65#endif /* !__i386__ */
66
67/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
68#define PTRACE_GETREGS 12
69#define PTRACE_SETREGS 13
70#define PTRACE_GETFPREGS 14
71#define PTRACE_SETFPREGS 15
72#define PTRACE_GETFPXREGS 18
73#define PTRACE_SETFPXREGS 19
74
75#define PTRACE_OLDSETOPTIONS 21
76
77/* only useful for access 32bit programs / kernels */
78#define PTRACE_GET_THREAD_AREA 25
79#define PTRACE_SET_THREAD_AREA 26
80
81#ifdef __x86_64__
82# define PTRACE_ARCH_PRCTL 30
83#endif
84
85#define PTRACE_SYSEMU 31
86#define PTRACE_SYSEMU_SINGLESTEP 32
87
88#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
89
90#ifndef __ASSEMBLY__
91#include <linux/types.h>
92#endif
93
94#endif /* _ASM_X86_PTRACE_ABI_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ptrace.h created+82
...@@ -0,0 +1,82 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PTRACE_H
3#define _ASM_X86_PTRACE_H
4
5 /* For */
6#include <asm/ptrace-abi.h>
7#include <asm/processor-flags.h>
8
9
10#ifndef __ASSEMBLY__
11
12#ifdef __i386__
13/* this struct defines the way the registers are stored on the
14 stack during a system call. */
15
16
17struct pt_regs {
18 long ebx;
19 long ecx;
20 long edx;
21 long esi;
22 long edi;
23 long ebp;
24 long eax;
25 int xds;
26 int xes;
27 int xfs;
28 int xgs;
29 long orig_eax;
30 long eip;
31 int xcs;
32 long eflags;
33 long esp;
34 int xss;
35};
36
37
38#else /* __i386__ */
39
40
41struct pt_regs {
42/*
43 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
44 * unless syscall needs a complete, fully filled "struct pt_regs".
45 */
46 unsigned long r15;
47 unsigned long r14;
48 unsigned long r13;
49 unsigned long r12;
50 unsigned long rbp;
51 unsigned long rbx;
52/* These regs are callee-clobbered. Always saved on kernel entry. */
53 unsigned long r11;
54 unsigned long r10;
55 unsigned long r9;
56 unsigned long r8;
57 unsigned long rax;
58 unsigned long rcx;
59 unsigned long rdx;
60 unsigned long rsi;
61 unsigned long rdi;
62/*
63 * On syscall entry, this is syscall#. On CPU exception, this is error code.
64 * On hw interrupt, it's IRQ number:
65 */
66 unsigned long orig_rax;
67/* Return frame for iretq */
68 unsigned long rip;
69 unsigned long cs;
70 unsigned long eflags;
71 unsigned long rsp;
72 unsigned long ss;
73/* top of stack page */
74};
75
76#endif /* !__i386__ */
77
78
79
80#endif /* !__ASSEMBLY__ */
81
82#endif /* _ASM_X86_PTRACE_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/sembuf.h created+36
...@@ -0,0 +1,36 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SEMBUF_H
3#define _ASM_X86_SEMBUF_H
4
5#include <asm/ipcbuf.h>
6
7/*
8 * The semid64_ds structure for x86 architecture.
9 * Note extra padding because this structure is passed back and forth
10 * between kernel and user space.
11 *
12 * Pad space is left for:
13 * - 2 miscellaneous 32-bit values
14 *
15 * x86_64 and x32 incorrectly added padding here, so the structures
16 * are still incompatible with the padding on x86.
17 */
18struct semid64_ds {
19 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
20#ifdef __i386__
21 unsigned long sem_otime; /* last semop time */
22 unsigned long sem_otime_high;
23 unsigned long sem_ctime; /* last change time */
24 unsigned long sem_ctime_high;
25#else
26 __kernel_long_t sem_otime; /* last semop time */
27 __kernel_ulong_t __unused1;
28 __kernel_long_t sem_ctime; /* last change time */
29 __kernel_ulong_t __unused2;
30#endif
31 __kernel_ulong_t sem_nsems; /* no. of semaphores in array */
32 __kernel_ulong_t __unused3;
33 __kernel_ulong_t __unused4;
34};
35
36#endif /* _ASM_X86_SEMBUF_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/setup.h created+1
...@@ -0,0 +1 @@
1/* */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/sgx.h created+170
...@@ -0,0 +1,170 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2016-20 Intel Corporation.
4 */
5#ifndef _ASM_X86_SGX_H
6#define _ASM_X86_SGX_H
7
8#include <linux/types.h>
9#include <linux/ioctl.h>
10
11/**
12 * enum sgx_page_flags - page control flags
13 * %SGX_PAGE_MEASURE: Measure the page contents with a sequence of
14 * ENCLS[EEXTEND] operations.
15 */
16enum sgx_page_flags {
17 SGX_PAGE_MEASURE = 0x01,
18};
19
20#define SGX_MAGIC 0xA4
21
22#define SGX_IOC_ENCLAVE_CREATE \
23 _IOW(SGX_MAGIC, 0x00, struct sgx_enclave_create)
24#define SGX_IOC_ENCLAVE_ADD_PAGES \
25 _IOWR(SGX_MAGIC, 0x01, struct sgx_enclave_add_pages)
26#define SGX_IOC_ENCLAVE_INIT \
27 _IOW(SGX_MAGIC, 0x02, struct sgx_enclave_init)
28#define SGX_IOC_ENCLAVE_PROVISION \
29 _IOW(SGX_MAGIC, 0x03, struct sgx_enclave_provision)
30#define SGX_IOC_VEPC_REMOVE_ALL \
31 _IO(SGX_MAGIC, 0x04)
32
33/**
34 * struct sgx_enclave_create - parameter structure for the
35 * %SGX_IOC_ENCLAVE_CREATE ioctl
36 * @src: address for the SECS page data
37 */
38struct sgx_enclave_create {
39 __u64 src;
40};
41
42/**
43 * struct sgx_enclave_add_pages - parameter structure for the
44 * %SGX_IOC_ENCLAVE_ADD_PAGE ioctl
45 * @src: start address for the page data
46 * @offset: starting page offset
47 * @length: length of the data (multiple of the page size)
48 * @secinfo: address for the SECINFO data
49 * @flags: page control flags
50 * @count: number of bytes added (multiple of the page size)
51 */
52struct sgx_enclave_add_pages {
53 __u64 src;
54 __u64 offset;
55 __u64 length;
56 __u64 secinfo;
57 __u64 flags;
58 __u64 count;
59};
60
61/**
62 * struct sgx_enclave_init - parameter structure for the
63 * %SGX_IOC_ENCLAVE_INIT ioctl
64 * @sigstruct: address for the SIGSTRUCT data
65 */
66struct sgx_enclave_init {
67 __u64 sigstruct;
68};
69
70/**
71 * struct sgx_enclave_provision - parameter structure for the
72 * %SGX_IOC_ENCLAVE_PROVISION ioctl
73 * @fd: file handle of /dev/sgx_provision
74 */
75struct sgx_enclave_provision {
76 __u64 fd;
77};
78
79struct sgx_enclave_run;
80
81/**
82 * typedef sgx_enclave_user_handler_t - Exit handler function accepted by
83 * __vdso_sgx_enter_enclave()
84 * @run: The run instance given by the caller
85 *
86 * The register parameters contain the snapshot of their values at enclave
87 * exit. An invalid ENCLU function number will cause -EINVAL to be returned
88 * to the caller.
89 *
90 * Return:
91 * - <= 0: The given value is returned back to the caller.
92 * - > 0: ENCLU function to invoke, either EENTER or ERESUME.
93 */
94typedef int (*sgx_enclave_user_handler_t)(long rdi, long rsi, long rdx,
95 long rsp, long r8, long r9,
96 struct sgx_enclave_run *run);
97
98/**
99 * struct sgx_enclave_run - the execution context of __vdso_sgx_enter_enclave()
100 * @tcs: TCS used to enter the enclave
101 * @function: The last seen ENCLU function (EENTER, ERESUME or EEXIT)
102 * @exception_vector: The interrupt vector of the exception
103 * @exception_error_code: The exception error code pulled out of the stack
104 * @exception_addr: The address that triggered the exception
105 * @user_handler: User provided callback run on exception
106 * @user_data: Data passed to the user handler
107 * @reserved Reserved for future extensions
108 *
109 * If @user_handler is provided, the handler will be invoked on all return paths
110 * of the normal flow. The user handler may transfer control, e.g. via a
111 * longjmp() call or a C++ exception, without returning to
112 * __vdso_sgx_enter_enclave().
113 */
114struct sgx_enclave_run {
115 __u64 tcs;
116 __u32 function;
117 __u16 exception_vector;
118 __u16 exception_error_code;
119 __u64 exception_addr;
120 __u64 user_handler;
121 __u64 user_data;
122 __u8 reserved[216];
123};
124
125/**
126 * typedef vdso_sgx_enter_enclave_t - Prototype for __vdso_sgx_enter_enclave(),
127 * a vDSO function to enter an SGX enclave.
128 * @rdi: Pass-through value for RDI
129 * @rsi: Pass-through value for RSI
130 * @rdx: Pass-through value for RDX
131 * @function: ENCLU function, must be EENTER or ERESUME
132 * @r8: Pass-through value for R8
133 * @r9: Pass-through value for R9
134 * @run: struct sgx_enclave_run, must be non-NULL
135 *
136 * NOTE: __vdso_sgx_enter_enclave() does not ensure full compliance with the
137 * x86-64 ABI, e.g. doesn't handle XSAVE state. Except for non-volatile
138 * general purpose registers, EFLAGS.DF, and RSP alignment, preserving/setting
139 * state in accordance with the x86-64 ABI is the responsibility of the enclave
140 * and its runtime, i.e. __vdso_sgx_enter_enclave() cannot be called from C
141 * code without careful consideration by both the enclave and its runtime.
142 *
143 * All general purpose registers except RAX, RBX and RCX are passed as-is to the
144 * enclave. RAX, RBX and RCX are consumed by EENTER and ERESUME and are loaded
145 * with @function, asynchronous exit pointer, and @run.tcs respectively.
146 *
147 * RBP and the stack are used to anchor __vdso_sgx_enter_enclave() to the
148 * pre-enclave state, e.g. to retrieve @run.exception and @run.user_handler
149 * after an enclave exit. All other registers are available for use by the
150 * enclave and its runtime, e.g. an enclave can push additional data onto the
151 * stack (and modify RSP) to pass information to the optional user handler (see
152 * below).
153 *
154 * Most exceptions reported on ENCLU, including those that occur within the
155 * enclave, are fixed up and reported synchronously instead of being delivered
156 * via a standard signal. Debug Exceptions (#DB) and Breakpoints (#BP) are
157 * never fixed up and are always delivered via standard signals. On synchronously
158 * reported exceptions, -EFAULT is returned and details about the exception are
159 * recorded in @run.exception, the optional sgx_enclave_exception struct.
160 *
161 * Return:
162 * - 0: ENCLU function was successfully executed.
163 * - -EINVAL: Invalid ENCL number (neither EENTER nor ERESUME).
164 */
165typedef int (*vdso_sgx_enter_enclave_t)(unsigned long rdi, unsigned long rsi,
166 unsigned long rdx, unsigned int function,
167 unsigned long r8, unsigned long r9,
168 struct sgx_enclave_run *run);
169
170#endif /* _ASM_X86_SGX_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/shmbuf.h created+43
...@@ -0,0 +1,43 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_SHMBUF_H
3#define __ASM_X86_SHMBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/shmbuf.h>
7#else
8/*
9 * The shmid64_ds structure for x86 architecture with x32 ABI.
10 *
11 * On x86-32 and x86-64 we can just use the generic definition, but
12 * x32 uses the same binary layout as x86_64, which is different
13 * from other 32-bit architectures.
14 */
15
16struct shmid64_ds {
17 struct ipc64_perm shm_perm; /* operation perms */
18 size_t shm_segsz; /* size of segment (bytes) */
19 __kernel_long_t shm_atime; /* last attach time */
20 __kernel_long_t shm_dtime; /* last detach time */
21 __kernel_long_t shm_ctime; /* last change time */
22 __kernel_pid_t shm_cpid; /* pid of creator */
23 __kernel_pid_t shm_lpid; /* pid of last operator */
24 __kernel_ulong_t shm_nattch; /* no. of current attaches */
25 __kernel_ulong_t __unused4;
26 __kernel_ulong_t __unused5;
27};
28
29struct shminfo64 {
30 __kernel_ulong_t shmmax;
31 __kernel_ulong_t shmmin;
32 __kernel_ulong_t shmmni;
33 __kernel_ulong_t shmseg;
34 __kernel_ulong_t shmall;
35 __kernel_ulong_t __unused1;
36 __kernel_ulong_t __unused2;
37 __kernel_ulong_t __unused3;
38 __kernel_ulong_t __unused4;
39};
40
41#endif
42
43#endif /* __ASM_X86_SHMBUF_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/sigcontext.h created+380
...@@ -0,0 +1,380 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGCONTEXT_H
3#define _ASM_X86_SIGCONTEXT_H
4
5/*
6 * Linux signal context definitions. The sigcontext includes a complex
7 * hierarchy of CPU and FPU state, available to user-space (on the stack) when
8 * a signal handler is executed.
9 *
10 * As over the years this ABI grew from its very simple roots towards
11 * supporting more and more CPU state organically, some of the details (which
12 * were rather clever hacks back in the days) became a bit quirky by today.
13 *
14 * The current ABI includes flexible provisions for future extensions, so we
15 * won't have to grow new quirks for quite some time. Promise!
16 */
17
18
19#include <linux/types.h>
20
21#define FP_XSTATE_MAGIC1 0x46505853U
22#define FP_XSTATE_MAGIC2 0x46505845U
23#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
24
25/*
26 * Bytes 464..511 in the current 512-byte layout of the FXSAVE/FXRSTOR frame
27 * are reserved for SW usage. On CPUs supporting XSAVE/XRSTOR, these bytes are
28 * used to extend the fpstate pointer in the sigcontext, which now includes the
29 * extended state information along with fpstate information.
30 *
31 * If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then there's a
32 * sw_reserved.extended_size bytes large extended context area present. (The
33 * last 32-bit word of this extended area (at the
34 * fpstate+extended_size-FP_XSTATE_MAGIC2_SIZE address) is set to
35 * FP_XSTATE_MAGIC2 so that you can sanity check your size calculations.)
36 *
37 * This extended area typically grows with newer CPUs that have larger and
38 * larger XSAVE areas.
39 */
40struct _fpx_sw_bytes {
41 /*
42 * If set to FP_XSTATE_MAGIC1 then this is an xstate context.
43 * 0 if a legacy frame.
44 */
45 __u32 magic1;
46
47 /*
48 * Total size of the fpstate area:
49 *
50 * - if magic1 == 0 then it's sizeof(struct _fpstate)
51 * - if magic1 == FP_XSTATE_MAGIC1 then it's sizeof(struct _xstate)
52 * plus extensions (if any)
53 */
54 __u32 extended_size;
55
56 /*
57 * Feature bit mask (including FP/SSE/extended state) that is present
58 * in the memory layout:
59 */
60 __u64 xfeatures;
61
62 /*
63 * Actual XSAVE state size, based on the xfeatures saved in the layout.
64 * 'extended_size' is greater than 'xstate_size':
65 */
66 __u32 xstate_size;
67
68 /* For future use: */
69 __u32 padding[7];
70};
71
72/*
73 * As documented in the iBCS2 standard:
74 *
75 * The first part of "struct _fpstate" is just the normal i387 hardware setup,
76 * the extra "status" word is used to save the coprocessor status word before
77 * entering the handler.
78 *
79 * The FPU state data structure has had to grow to accommodate the extended FPU
80 * state required by the Streaming SIMD Extensions. There is no documented
81 * standard to accomplish this at the moment.
82 */
83
84/* 10-byte legacy floating point register: */
85struct _fpreg {
86 __u16 significand[4];
87 __u16 exponent;
88};
89
90/* 16-byte floating point register: */
91struct _fpxreg {
92 __u16 significand[4];
93 __u16 exponent;
94 __u16 padding[3];
95};
96
97/* 16-byte XMM register: */
98struct _xmmreg {
99 __u32 element[4];
100};
101
102#define X86_FXSR_MAGIC 0x0000
103
104/*
105 * The 32-bit FPU frame:
106 */
107struct _fpstate_32 {
108 /* Legacy FPU environment: */
109 __u32 cw;
110 __u32 sw;
111 __u32 tag;
112 __u32 ipoff;
113 __u32 cssel;
114 __u32 dataoff;
115 __u32 datasel;
116 struct _fpreg _st[8];
117 __u16 status;
118 __u16 magic; /* 0xffff: regular FPU data only */
119 /* 0x0000: FXSR FPU data */
120
121 /* FXSR FPU environment */
122 __u32 _fxsr_env[6]; /* FXSR FPU env is ignored */
123 __u32 mxcsr;
124 __u32 reserved;
125 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
126 struct _xmmreg _xmm[8]; /* First 8 XMM registers */
127 union {
128 __u32 padding1[44]; /* Second 8 XMM registers plus padding */
129 __u32 padding[44]; /* Alias name for old user-space */
130 };
131
132 union {
133 __u32 padding2[12];
134 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
135 };
136};
137
138/*
139 * The 64-bit FPU frame. (FXSAVE format and later)
140 *
141 * Note1: If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then the structure is
142 * larger: 'struct _xstate'. Note that 'struct _xstate' embeds
143 * 'struct _fpstate' so that you can always assume the _fpstate portion
144 * exists so that you can check the magic value.
145 *
146 * Note2: Reserved fields may someday contain valuable data. Always
147 * save/restore them when you change signal frames.
148 */
149struct _fpstate_64 {
150 __u16 cwd;
151 __u16 swd;
152 /* Note this is not the same as the 32-bit/x87/FSAVE twd: */
153 __u16 twd;
154 __u16 fop;
155 __u64 rip;
156 __u64 rdp;
157 __u32 mxcsr;
158 __u32 mxcsr_mask;
159 __u32 st_space[32]; /* 8x FP registers, 16 bytes each */
160 __u32 xmm_space[64]; /* 16x XMM registers, 16 bytes each */
161 __u32 reserved2[12];
162 union {
163 __u32 reserved3[12];
164 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
165 };
166};
167
168#ifdef __i386__
169# define _fpstate _fpstate_32
170#else
171# define _fpstate _fpstate_64
172#endif
173
174struct _header {
175 __u64 xfeatures;
176 __u64 reserved1[2];
177 __u64 reserved2[5];
178};
179
180struct _ymmh_state {
181 /* 16x YMM registers, 16 bytes each: */
182 __u32 ymmh_space[64];
183};
184
185/*
186 * Extended state pointed to by sigcontext::fpstate.
187 *
188 * In addition to the fpstate, information encoded in _xstate::xstate_hdr
189 * indicates the presence of other extended state information supported
190 * by the CPU and kernel:
191 */
192struct _xstate {
193 struct _fpstate fpstate;
194 struct _header xstate_hdr;
195 struct _ymmh_state ymmh;
196 /* New processor state extensions go here: */
197};
198
199/*
200 * The 32-bit signal frame:
201 */
202struct sigcontext_32 {
203 __u16 gs, __gsh;
204 __u16 fs, __fsh;
205 __u16 es, __esh;
206 __u16 ds, __dsh;
207 __u32 di;
208 __u32 si;
209 __u32 bp;
210 __u32 sp;
211 __u32 bx;
212 __u32 dx;
213 __u32 cx;
214 __u32 ax;
215 __u32 trapno;
216 __u32 err;
217 __u32 ip;
218 __u16 cs, __csh;
219 __u32 flags;
220 __u32 sp_at_signal;
221 __u16 ss, __ssh;
222
223 /*
224 * fpstate is really (struct _fpstate *) or (struct _xstate *)
225 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
226 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
227 * of extended memory layout. See comments at the definition of
228 * (struct _fpx_sw_bytes)
229 */
230 __u32 fpstate; /* Zero when no FPU/extended context */
231 __u32 oldmask;
232 __u32 cr2;
233};
234
235/*
236 * The 64-bit signal frame:
237 */
238struct sigcontext_64 {
239 __u64 r8;
240 __u64 r9;
241 __u64 r10;
242 __u64 r11;
243 __u64 r12;
244 __u64 r13;
245 __u64 r14;
246 __u64 r15;
247 __u64 di;
248 __u64 si;
249 __u64 bp;
250 __u64 bx;
251 __u64 dx;
252 __u64 ax;
253 __u64 cx;
254 __u64 sp;
255 __u64 ip;
256 __u64 flags;
257 __u16 cs;
258 __u16 gs;
259 __u16 fs;
260 __u16 ss;
261 __u64 err;
262 __u64 trapno;
263 __u64 oldmask;
264 __u64 cr2;
265
266 /*
267 * fpstate is really (struct _fpstate *) or (struct _xstate *)
268 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
269 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
270 * of extended memory layout. See comments at the definition of
271 * (struct _fpx_sw_bytes)
272 */
273 __u64 fpstate; /* Zero when no FPU/extended context */
274 __u64 reserved1[8];
275};
276
277/*
278 * Create the real 'struct sigcontext' type:
279 */
280
281/*
282 * The old user-space sigcontext definition, just in case user-space still
283 * relies on it. The kernel definition (in asm/sigcontext.h) has unified
284 * field names but otherwise the same layout.
285 */
286
287#define _fpstate_ia32 _fpstate_32
288#define sigcontext_ia32 sigcontext_32
289
290
291# ifdef __i386__
292struct sigcontext {
293 __u16 gs, __gsh;
294 __u16 fs, __fsh;
295 __u16 es, __esh;
296 __u16 ds, __dsh;
297 __u32 edi;
298 __u32 esi;
299 __u32 ebp;
300 __u32 esp;
301 __u32 ebx;
302 __u32 edx;
303 __u32 ecx;
304 __u32 eax;
305 __u32 trapno;
306 __u32 err;
307 __u32 eip;
308 __u16 cs, __csh;
309 __u32 eflags;
310 __u32 esp_at_signal;
311 __u16 ss, __ssh;
312 struct _fpstate *fpstate;
313 __u32 oldmask;
314 __u32 cr2;
315};
316# else /* __x86_64__: */
317struct sigcontext {
318 __u64 r8;
319 __u64 r9;
320 __u64 r10;
321 __u64 r11;
322 __u64 r12;
323 __u64 r13;
324 __u64 r14;
325 __u64 r15;
326 __u64 rdi;
327 __u64 rsi;
328 __u64 rbp;
329 __u64 rbx;
330 __u64 rdx;
331 __u64 rax;
332 __u64 rcx;
333 __u64 rsp;
334 __u64 rip;
335 __u64 eflags; /* RFLAGS */
336 __u16 cs;
337
338 /*
339 * Prior to 2.5.64 ("[PATCH] x86-64 updates for 2.5.64-bk3"),
340 * Linux saved and restored fs and gs in these slots. This
341 * was counterproductive, as fsbase and gsbase were never
342 * saved, so arch_prctl was presumably unreliable.
343 *
344 * These slots should never be reused without extreme caution:
345 *
346 * - Some DOSEMU versions stash fs and gs in these slots manually,
347 * thus overwriting anything the kernel expects to be preserved
348 * in these slots.
349 *
350 * - If these slots are ever needed for any other purpose,
351 * there is some risk that very old 64-bit binaries could get
352 * confused. I doubt that many such binaries still work,
353 * though, since the same patch in 2.5.64 also removed the
354 * 64-bit set_thread_area syscall, so it appears that there
355 * is no TLS API beyond modify_ldt that works in both pre-
356 * and post-2.5.64 kernels.
357 *
358 * If the kernel ever adds explicit fs, gs, fsbase, and gsbase
359 * save/restore, it will most likely need to be opt-in and use
360 * different context slots.
361 */
362 __u16 gs;
363 __u16 fs;
364 union {
365 __u16 ss; /* If UC_SIGCONTEXT_SS */
366 __u16 __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */
367 };
368 __u64 err;
369 __u64 trapno;
370 __u64 oldmask;
371 __u64 cr2;
372 struct _fpstate *fpstate; /* Zero when no FPU context */
373# ifdef __ILP32__
374 __u32 __fpstate_pad;
375# endif
376 __u64 reserved1[8];
377};
378# endif /* __x86_64__ */
379
380#endif /* _ASM_X86_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/sigcontext32.h created+9
...@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGCONTEXT32_H
3#define _ASM_X86_SIGCONTEXT32_H
4
5/* This is a legacy file - all the type definitions are in sigcontext.h: */
6
7#include <asm/sigcontext.h>
8
9#endif /* _ASM_X86_SIGCONTEXT32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/siginfo.h created+15
...@@ -0,0 +1,15 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGINFO_H
3#define _ASM_X86_SIGINFO_H
4
5#ifdef __x86_64__
6# ifdef __ILP32__ /* x32 */
7typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
8# define __ARCH_SI_CLOCK_T __kernel_si_clock_t
9# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
10# endif
11#endif
12
13#include <asm-generic/siginfo.h>
14
15#endif /* _ASM_X86_SIGINFO_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/signal.h created+108
...@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGNAL_H
3#define _ASM_X86_SIGNAL_H
4
5#ifndef __ASSEMBLY__
6#include <linux/types.h>
7#include <linux/time.h>
8
9
10/* Avoid too many header ordering problems. */
11struct siginfo;
12
13/* Here we must cater to libcs that poke about in kernel headers. */
14
15#define NSIG 32
16typedef unsigned long sigset_t;
17
18#endif /* __ASSEMBLY__ */
19
20
21#define SIGHUP 1
22#define SIGINT 2
23#define SIGQUIT 3
24#define SIGILL 4
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28#define SIGBUS 7
29#define SIGFPE 8
30#define SIGKILL 9
31#define SIGUSR1 10
32#define SIGSEGV 11
33#define SIGUSR2 12
34#define SIGPIPE 13
35#define SIGALRM 14
36#define SIGTERM 15
37#define SIGSTKFLT 16
38#define SIGCHLD 17
39#define SIGCONT 18
40#define SIGSTOP 19
41#define SIGTSTP 20
42#define SIGTTIN 21
43#define SIGTTOU 22
44#define SIGURG 23
45#define SIGXCPU 24
46#define SIGXFSZ 25
47#define SIGVTALRM 26
48#define SIGPROF 27
49#define SIGWINCH 28
50#define SIGIO 29
51#define SIGPOLL SIGIO
52/*
53#define SIGLOST 29
54*/
55#define SIGPWR 30
56#define SIGSYS 31
57#define SIGUNUSED 31
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63#define SA_RESTORER 0x04000000
64
65#define MINSIGSTKSZ 2048
66#define SIGSTKSZ 8192
67
68#include <asm-generic/signal-defs.h>
69
70#ifndef __ASSEMBLY__
71
72
73/* Here we must cater to libcs that poke about in kernel headers. */
74#ifdef __i386__
75
76struct sigaction {
77 union {
78 __sighandler_t _sa_handler;
79 void (*_sa_sigaction)(int, struct siginfo *, void *);
80 } _u;
81 sigset_t sa_mask;
82 unsigned long sa_flags;
83 void (*sa_restorer)(void);
84};
85
86#define sa_handler _u._sa_handler
87#define sa_sigaction _u._sa_sigaction
88
89#else /* __i386__ */
90
91struct sigaction {
92 __sighandler_t sa_handler;
93 unsigned long sa_flags;
94 __sigrestore_t sa_restorer;
95 sigset_t sa_mask; /* mask last for extensibility */
96};
97
98#endif /* !__i386__ */
99
100typedef struct sigaltstack {
101 void *ss_sp;
102 int ss_flags;
103 size_t ss_size;
104} stack_t;
105
106#endif /* __ASSEMBLY__ */
107
108#endif /* _ASM_X86_SIGNAL_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/stat.h created+138
...@@ -0,0 +1,138 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STAT_H
3#define _ASM_X86_STAT_H
4
5#include <asm/posix_types.h>
6
7#define STAT_HAVE_NSEC 1
8
9#ifdef __i386__
10struct stat {
11 unsigned long st_dev;
12 unsigned long st_ino;
13 unsigned short st_mode;
14 unsigned short st_nlink;
15 unsigned short st_uid;
16 unsigned short st_gid;
17 unsigned long st_rdev;
18 unsigned long st_size;
19 unsigned long st_blksize;
20 unsigned long st_blocks;
21 unsigned long st_atime;
22 unsigned long st_atime_nsec;
23 unsigned long st_mtime;
24 unsigned long st_mtime_nsec;
25 unsigned long st_ctime;
26 unsigned long st_ctime_nsec;
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31/* We don't need to memset the whole thing just to initialize the padding */
32#define INIT_STRUCT_STAT_PADDING(st) do { \
33 st.__unused4 = 0; \
34 st.__unused5 = 0; \
35} while (0)
36
37#define STAT64_HAS_BROKEN_ST_INO 1
38
39/* This matches struct stat64 in glibc2.1, hence the absolutely
40 * insane amounts of padding around dev_t's.
41 */
42struct stat64 {
43 unsigned long long st_dev;
44 unsigned char __pad0[4];
45
46 unsigned long __st_ino;
47
48 unsigned int st_mode;
49 unsigned int st_nlink;
50
51 unsigned long st_uid;
52 unsigned long st_gid;
53
54 unsigned long long st_rdev;
55 unsigned char __pad3[4];
56
57 long long st_size;
58 unsigned long st_blksize;
59
60 /* Number 512-byte blocks allocated. */
61 unsigned long long st_blocks;
62
63 unsigned long st_atime;
64 unsigned long st_atime_nsec;
65
66 unsigned long st_mtime;
67 unsigned int st_mtime_nsec;
68
69 unsigned long st_ctime;
70 unsigned long st_ctime_nsec;
71
72 unsigned long long st_ino;
73};
74
75/* We don't need to memset the whole thing just to initialize the padding */
76#define INIT_STRUCT_STAT64_PADDING(st) do { \
77 memset(&st.__pad0, 0, sizeof(st.__pad0)); \
78 memset(&st.__pad3, 0, sizeof(st.__pad3)); \
79} while (0)
80
81#else /* __i386__ */
82
83struct stat {
84 __kernel_ulong_t st_dev;
85 __kernel_ulong_t st_ino;
86 __kernel_ulong_t st_nlink;
87
88 unsigned int st_mode;
89 unsigned int st_uid;
90 unsigned int st_gid;
91 unsigned int __pad0;
92 __kernel_ulong_t st_rdev;
93 __kernel_long_t st_size;
94 __kernel_long_t st_blksize;
95 __kernel_long_t st_blocks; /* Number 512-byte blocks allocated. */
96
97 __kernel_ulong_t st_atime;
98 __kernel_ulong_t st_atime_nsec;
99 __kernel_ulong_t st_mtime;
100 __kernel_ulong_t st_mtime_nsec;
101 __kernel_ulong_t st_ctime;
102 __kernel_ulong_t st_ctime_nsec;
103 __kernel_long_t __unused[3];
104};
105
106/* We don't need to memset the whole thing just to initialize the padding */
107#define INIT_STRUCT_STAT_PADDING(st) do { \
108 st.__pad0 = 0; \
109 st.__unused[0] = 0; \
110 st.__unused[1] = 0; \
111 st.__unused[2] = 0; \
112} while (0)
113
114#endif
115
116/* for 32bit emulation and 32 bit kernels */
117struct __old_kernel_stat {
118 unsigned short st_dev;
119 unsigned short st_ino;
120 unsigned short st_mode;
121 unsigned short st_nlink;
122 unsigned short st_uid;
123 unsigned short st_gid;
124 unsigned short st_rdev;
125#ifdef __i386__
126 unsigned long st_size;
127 unsigned long st_atime;
128 unsigned long st_mtime;
129 unsigned long st_ctime;
130#else
131 unsigned int st_size;
132 unsigned int st_atime;
133 unsigned int st_mtime;
134 unsigned int st_ctime;
135#endif
136};
137
138#endif /* _ASM_X86_STAT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/statfs.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STATFS_H
3#define _ASM_X86_STATFS_H
4
5/*
6 * We need compat_statfs64 to be packed, because the i386 ABI won't
7 * add padding at the end to bring it to a multiple of 8 bytes, but
8 * the x86_64 ABI will.
9 */
10#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
11
12#include <asm-generic/statfs.h>
13#endif /* _ASM_X86_STATFS_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/svm.h created+224
...@@ -0,0 +1,224 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __SVM_H
3#define __SVM_H
4
5#define SVM_EXIT_READ_CR0 0x000
6#define SVM_EXIT_READ_CR2 0x002
7#define SVM_EXIT_READ_CR3 0x003
8#define SVM_EXIT_READ_CR4 0x004
9#define SVM_EXIT_READ_CR8 0x008
10#define SVM_EXIT_WRITE_CR0 0x010
11#define SVM_EXIT_WRITE_CR2 0x012
12#define SVM_EXIT_WRITE_CR3 0x013
13#define SVM_EXIT_WRITE_CR4 0x014
14#define SVM_EXIT_WRITE_CR8 0x018
15#define SVM_EXIT_READ_DR0 0x020
16#define SVM_EXIT_READ_DR1 0x021
17#define SVM_EXIT_READ_DR2 0x022
18#define SVM_EXIT_READ_DR3 0x023
19#define SVM_EXIT_READ_DR4 0x024
20#define SVM_EXIT_READ_DR5 0x025
21#define SVM_EXIT_READ_DR6 0x026
22#define SVM_EXIT_READ_DR7 0x027
23#define SVM_EXIT_WRITE_DR0 0x030
24#define SVM_EXIT_WRITE_DR1 0x031
25#define SVM_EXIT_WRITE_DR2 0x032
26#define SVM_EXIT_WRITE_DR3 0x033
27#define SVM_EXIT_WRITE_DR4 0x034
28#define SVM_EXIT_WRITE_DR5 0x035
29#define SVM_EXIT_WRITE_DR6 0x036
30#define SVM_EXIT_WRITE_DR7 0x037
31#define SVM_EXIT_EXCP_BASE 0x040
32#define SVM_EXIT_LAST_EXCP 0x05f
33#define SVM_EXIT_INTR 0x060
34#define SVM_EXIT_NMI 0x061
35#define SVM_EXIT_SMI 0x062
36#define SVM_EXIT_INIT 0x063
37#define SVM_EXIT_VINTR 0x064
38#define SVM_EXIT_CR0_SEL_WRITE 0x065
39#define SVM_EXIT_IDTR_READ 0x066
40#define SVM_EXIT_GDTR_READ 0x067
41#define SVM_EXIT_LDTR_READ 0x068
42#define SVM_EXIT_TR_READ 0x069
43#define SVM_EXIT_IDTR_WRITE 0x06a
44#define SVM_EXIT_GDTR_WRITE 0x06b
45#define SVM_EXIT_LDTR_WRITE 0x06c
46#define SVM_EXIT_TR_WRITE 0x06d
47#define SVM_EXIT_RDTSC 0x06e
48#define SVM_EXIT_RDPMC 0x06f
49#define SVM_EXIT_PUSHF 0x070
50#define SVM_EXIT_POPF 0x071
51#define SVM_EXIT_CPUID 0x072
52#define SVM_EXIT_RSM 0x073
53#define SVM_EXIT_IRET 0x074
54#define SVM_EXIT_SWINT 0x075
55#define SVM_EXIT_INVD 0x076
56#define SVM_EXIT_PAUSE 0x077
57#define SVM_EXIT_HLT 0x078
58#define SVM_EXIT_INVLPG 0x079
59#define SVM_EXIT_INVLPGA 0x07a
60#define SVM_EXIT_IOIO 0x07b
61#define SVM_EXIT_MSR 0x07c
62#define SVM_EXIT_TASK_SWITCH 0x07d
63#define SVM_EXIT_FERR_FREEZE 0x07e
64#define SVM_EXIT_SHUTDOWN 0x07f
65#define SVM_EXIT_VMRUN 0x080
66#define SVM_EXIT_VMMCALL 0x081
67#define SVM_EXIT_VMLOAD 0x082
68#define SVM_EXIT_VMSAVE 0x083
69#define SVM_EXIT_STGI 0x084
70#define SVM_EXIT_CLGI 0x085
71#define SVM_EXIT_SKINIT 0x086
72#define SVM_EXIT_RDTSCP 0x087
73#define SVM_EXIT_ICEBP 0x088
74#define SVM_EXIT_WBINVD 0x089
75#define SVM_EXIT_MONITOR 0x08a
76#define SVM_EXIT_MWAIT 0x08b
77#define SVM_EXIT_MWAIT_COND 0x08c
78#define SVM_EXIT_XSETBV 0x08d
79#define SVM_EXIT_RDPRU 0x08e
80#define SVM_EXIT_EFER_WRITE_TRAP 0x08f
81#define SVM_EXIT_CR0_WRITE_TRAP 0x090
82#define SVM_EXIT_CR1_WRITE_TRAP 0x091
83#define SVM_EXIT_CR2_WRITE_TRAP 0x092
84#define SVM_EXIT_CR3_WRITE_TRAP 0x093
85#define SVM_EXIT_CR4_WRITE_TRAP 0x094
86#define SVM_EXIT_CR5_WRITE_TRAP 0x095
87#define SVM_EXIT_CR6_WRITE_TRAP 0x096
88#define SVM_EXIT_CR7_WRITE_TRAP 0x097
89#define SVM_EXIT_CR8_WRITE_TRAP 0x098
90#define SVM_EXIT_CR9_WRITE_TRAP 0x099
91#define SVM_EXIT_CR10_WRITE_TRAP 0x09a
92#define SVM_EXIT_CR11_WRITE_TRAP 0x09b
93#define SVM_EXIT_CR12_WRITE_TRAP 0x09c
94#define SVM_EXIT_CR13_WRITE_TRAP 0x09d
95#define SVM_EXIT_CR14_WRITE_TRAP 0x09e
96#define SVM_EXIT_CR15_WRITE_TRAP 0x09f
97#define SVM_EXIT_INVPCID 0x0a2
98#define SVM_EXIT_NPF 0x400
99#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
100#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
101#define SVM_EXIT_VMGEXIT 0x403
102
103/* SEV-ES software-defined VMGEXIT events */
104#define SVM_VMGEXIT_MMIO_READ 0x80000001
105#define SVM_VMGEXIT_MMIO_WRITE 0x80000002
106#define SVM_VMGEXIT_NMI_COMPLETE 0x80000003
107#define SVM_VMGEXIT_AP_HLT_LOOP 0x80000004
108#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005
109#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0
110#define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1
111#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
112
113/* Exit code reserved for hypervisor/software use */
114#define SVM_EXIT_SW 0xf0000000
115
116#define SVM_EXIT_ERR -1
117
118#define SVM_EXIT_REASONS \
119 { SVM_EXIT_READ_CR0, "read_cr0" }, \
120 { SVM_EXIT_READ_CR2, "read_cr2" }, \
121 { SVM_EXIT_READ_CR3, "read_cr3" }, \
122 { SVM_EXIT_READ_CR4, "read_cr4" }, \
123 { SVM_EXIT_READ_CR8, "read_cr8" }, \
124 { SVM_EXIT_WRITE_CR0, "write_cr0" }, \
125 { SVM_EXIT_WRITE_CR2, "write_cr2" }, \
126 { SVM_EXIT_WRITE_CR3, "write_cr3" }, \
127 { SVM_EXIT_WRITE_CR4, "write_cr4" }, \
128 { SVM_EXIT_WRITE_CR8, "write_cr8" }, \
129 { SVM_EXIT_READ_DR0, "read_dr0" }, \
130 { SVM_EXIT_READ_DR1, "read_dr1" }, \
131 { SVM_EXIT_READ_DR2, "read_dr2" }, \
132 { SVM_EXIT_READ_DR3, "read_dr3" }, \
133 { SVM_EXIT_READ_DR4, "read_dr4" }, \
134 { SVM_EXIT_READ_DR5, "read_dr5" }, \
135 { SVM_EXIT_READ_DR6, "read_dr6" }, \
136 { SVM_EXIT_READ_DR7, "read_dr7" }, \
137 { SVM_EXIT_WRITE_DR0, "write_dr0" }, \
138 { SVM_EXIT_WRITE_DR1, "write_dr1" }, \
139 { SVM_EXIT_WRITE_DR2, "write_dr2" }, \
140 { SVM_EXIT_WRITE_DR3, "write_dr3" }, \
141 { SVM_EXIT_WRITE_DR4, "write_dr4" }, \
142 { SVM_EXIT_WRITE_DR5, "write_dr5" }, \
143 { SVM_EXIT_WRITE_DR6, "write_dr6" }, \
144 { SVM_EXIT_WRITE_DR7, "write_dr7" }, \
145 { SVM_EXIT_EXCP_BASE + DE_VECTOR, "DE excp" }, \
146 { SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" }, \
147 { SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" }, \
148 { SVM_EXIT_EXCP_BASE + OF_VECTOR, "OF excp" }, \
149 { SVM_EXIT_EXCP_BASE + BR_VECTOR, "BR excp" }, \
150 { SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" }, \
151 { SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" }, \
152 { SVM_EXIT_EXCP_BASE + DF_VECTOR, "DF excp" }, \
153 { SVM_EXIT_EXCP_BASE + TS_VECTOR, "TS excp" }, \
154 { SVM_EXIT_EXCP_BASE + NP_VECTOR, "NP excp" }, \
155 { SVM_EXIT_EXCP_BASE + SS_VECTOR, "SS excp" }, \
156 { SVM_EXIT_EXCP_BASE + GP_VECTOR, "GP excp" }, \
157 { SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" }, \
158 { SVM_EXIT_EXCP_BASE + MF_VECTOR, "MF excp" }, \
159 { SVM_EXIT_EXCP_BASE + AC_VECTOR, "AC excp" }, \
160 { SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" }, \
161 { SVM_EXIT_EXCP_BASE + XM_VECTOR, "XF excp" }, \
162 { SVM_EXIT_INTR, "interrupt" }, \
163 { SVM_EXIT_NMI, "nmi" }, \
164 { SVM_EXIT_SMI, "smi" }, \
165 { SVM_EXIT_INIT, "init" }, \
166 { SVM_EXIT_VINTR, "vintr" }, \
167 { SVM_EXIT_CR0_SEL_WRITE, "cr0_sel_write" }, \
168 { SVM_EXIT_IDTR_READ, "read_idtr" }, \
169 { SVM_EXIT_GDTR_READ, "read_gdtr" }, \
170 { SVM_EXIT_LDTR_READ, "read_ldtr" }, \
171 { SVM_EXIT_TR_READ, "read_rt" }, \
172 { SVM_EXIT_IDTR_WRITE, "write_idtr" }, \
173 { SVM_EXIT_GDTR_WRITE, "write_gdtr" }, \
174 { SVM_EXIT_LDTR_WRITE, "write_ldtr" }, \
175 { SVM_EXIT_TR_WRITE, "write_rt" }, \
176 { SVM_EXIT_RDTSC, "rdtsc" }, \
177 { SVM_EXIT_RDPMC, "rdpmc" }, \
178 { SVM_EXIT_PUSHF, "pushf" }, \
179 { SVM_EXIT_POPF, "popf" }, \
180 { SVM_EXIT_CPUID, "cpuid" }, \
181 { SVM_EXIT_RSM, "rsm" }, \
182 { SVM_EXIT_IRET, "iret" }, \
183 { SVM_EXIT_SWINT, "swint" }, \
184 { SVM_EXIT_INVD, "invd" }, \
185 { SVM_EXIT_PAUSE, "pause" }, \
186 { SVM_EXIT_HLT, "hlt" }, \
187 { SVM_EXIT_INVLPG, "invlpg" }, \
188 { SVM_EXIT_INVLPGA, "invlpga" }, \
189 { SVM_EXIT_IOIO, "io" }, \
190 { SVM_EXIT_MSR, "msr" }, \
191 { SVM_EXIT_TASK_SWITCH, "task_switch" }, \
192 { SVM_EXIT_FERR_FREEZE, "ferr_freeze" }, \
193 { SVM_EXIT_SHUTDOWN, "shutdown" }, \
194 { SVM_EXIT_VMRUN, "vmrun" }, \
195 { SVM_EXIT_VMMCALL, "hypercall" }, \
196 { SVM_EXIT_VMLOAD, "vmload" }, \
197 { SVM_EXIT_VMSAVE, "vmsave" }, \
198 { SVM_EXIT_STGI, "stgi" }, \
199 { SVM_EXIT_CLGI, "clgi" }, \
200 { SVM_EXIT_SKINIT, "skinit" }, \
201 { SVM_EXIT_RDTSCP, "rdtscp" }, \
202 { SVM_EXIT_ICEBP, "icebp" }, \
203 { SVM_EXIT_WBINVD, "wbinvd" }, \
204 { SVM_EXIT_MONITOR, "monitor" }, \
205 { SVM_EXIT_MWAIT, "mwait" }, \
206 { SVM_EXIT_XSETBV, "xsetbv" }, \
207 { SVM_EXIT_EFER_WRITE_TRAP, "write_efer_trap" }, \
208 { SVM_EXIT_CR0_WRITE_TRAP, "write_cr0_trap" }, \
209 { SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \
210 { SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \
211 { SVM_EXIT_INVPCID, "invpcid" }, \
212 { SVM_EXIT_NPF, "npf" }, \
213 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
214 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \
215 { SVM_EXIT_VMGEXIT, "vmgexit" }, \
216 { SVM_VMGEXIT_MMIO_READ, "vmgexit_mmio_read" }, \
217 { SVM_VMGEXIT_MMIO_WRITE, "vmgexit_mmio_write" }, \
218 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \
219 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \
220 { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \
221 { SVM_EXIT_ERR, "invalid_guest_state" }
222
223
224#endif /* __SVM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/swab.h created+37
...@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SWAB_H
3#define _ASM_X86_SWAB_H
4
5#include <linux/types.h>
6
7
8static __inline__ __u32 __arch_swab32(__u32 val)
9{
10 __asm__("bswapl %0" : "=r" (val) : "0" (val));
11 return val;
12}
13#define __arch_swab32 __arch_swab32
14
15static __inline__ __u64 __arch_swab64(__u64 val)
16{
17#ifdef __i386__
18 union {
19 struct {
20 __u32 a;
21 __u32 b;
22 } s;
23 __u64 u;
24 } v;
25 v.u = val;
26 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
27 : "=r" (v.s.a), "=r" (v.s.b)
28 : "0" (v.s.a), "1" (v.s.b));
29 return v.u;
30#else /* __i386__ */
31 __asm__("bswapq %0" : "=r" (val) : "0" (val));
32 return val;
33#endif
34}
35#define __arch_swab64 __arch_swab64
36
37#endif /* _ASM_X86_SWAB_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ucontext.h created+56
...@@ -0,0 +1,56 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UCONTEXT_H
3#define _ASM_X86_UCONTEXT_H
4
5/*
6 * Indicates the presence of extended state information in the memory
7 * layout pointed by the fpstate pointer in the ucontext's sigcontext
8 * struct (uc_mcontext).
9 */
10#define UC_FP_XSTATE 0x1
11
12#ifdef __x86_64__
13/*
14 * UC_SIGCONTEXT_SS will be set when delivering 64-bit or x32 signals on
15 * kernels that save SS in the sigcontext. All kernels that set
16 * UC_SIGCONTEXT_SS will correctly restore at least the low 32 bits of esp
17 * regardless of SS (i.e. they implement espfix).
18 *
19 * Kernels that set UC_SIGCONTEXT_SS will also set UC_STRICT_RESTORE_SS
20 * when delivering a signal that came from 64-bit code.
21 *
22 * Sigreturn restores SS as follows:
23 *
24 * if (saved SS is valid || UC_STRICT_RESTORE_SS is set ||
25 * saved CS is not 64-bit)
26 * new SS = saved SS (will fail IRET and signal if invalid)
27 * else
28 * new SS = a flat 32-bit data segment
29 *
30 * This behavior serves three purposes:
31 *
32 * - Legacy programs that construct a 64-bit sigcontext from scratch
33 * with zero or garbage in the SS slot (e.g. old CRIU) and call
34 * sigreturn will still work.
35 *
36 * - Old DOSEMU versions sometimes catch a signal from a segmented
37 * context, delete the old SS segment (with modify_ldt), and change
38 * the saved CS to a 64-bit segment. These DOSEMU versions expect
39 * sigreturn to send them back to 64-bit mode without killing them,
40 * despite the fact that the SS selector when the signal was raised is
41 * no longer valid. UC_STRICT_RESTORE_SS will be clear, so the kernel
42 * will fix up SS for these DOSEMU versions.
43 *
44 * - Old and new programs that catch a signal and return without
45 * modifying the saved context will end up in exactly the state they
46 * started in, even if they were running in a segmented context when
47 * the signal was raised.. Old kernels would lose track of the
48 * previous SS value.
49 */
50#define UC_SIGCONTEXT_SS 0x2
51#define UC_STRICT_RESTORE_SS 0x4
52#endif
53
54#include <asm-generic/ucontext.h>
55
56#endif /* _ASM_X86_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd.h created+23
...@@ -0,0 +1,23 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UNISTD_H
3#define _ASM_X86_UNISTD_H
4
5/*
6 * x32 syscall flag bit. Some user programs expect syscall NR macros
7 * and __X32_SYSCALL_BIT to have type int, even though syscall numbers
8 * are, for practical purposes, unsigned long.
9 *
10 * Fortunately, expressions like (nr & ~__X32_SYSCALL_BIT) do the right
11 * thing regardless.
12 */
13#define __X32_SYSCALL_BIT 0x40000000
14
15# ifdef __i386__
16# include <asm/unistd_32.h>
17# elif defined(__ILP32__)
18# include <asm/unistd_x32.h>
19# else
20# include <asm/unistd_64.h>
21# endif
22
23#endif /* _ASM_X86_UNISTD_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_32.h created+445
...@@ -0,0 +1,445 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_restart_syscall 0
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_waitpid 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_break 17
22#define __NR_oldstat 18
23#define __NR_lseek 19
24#define __NR_getpid 20
25#define __NR_mount 21
26#define __NR_umount 22
27#define __NR_setuid 23
28#define __NR_getuid 24
29#define __NR_stime 25
30#define __NR_ptrace 26
31#define __NR_alarm 27
32#define __NR_oldfstat 28
33#define __NR_pause 29
34#define __NR_utime 30
35#define __NR_stty 31
36#define __NR_gtty 32
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_ftime 35
40#define __NR_sync 36
41#define __NR_kill 37
42#define __NR_rename 38
43#define __NR_mkdir 39
44#define __NR_rmdir 40
45#define __NR_dup 41
46#define __NR_pipe 42
47#define __NR_times 43
48#define __NR_prof 44
49#define __NR_brk 45
50#define __NR_setgid 46
51#define __NR_getgid 47
52#define __NR_signal 48
53#define __NR_geteuid 49
54#define __NR_getegid 50
55#define __NR_acct 51
56#define __NR_umount2 52
57#define __NR_lock 53
58#define __NR_ioctl 54
59#define __NR_fcntl 55
60#define __NR_mpx 56
61#define __NR_setpgid 57
62#define __NR_ulimit 58
63#define __NR_oldolduname 59
64#define __NR_umask 60
65#define __NR_chroot 61
66#define __NR_ustat 62
67#define __NR_dup2 63
68#define __NR_getppid 64
69#define __NR_getpgrp 65
70#define __NR_setsid 66
71#define __NR_sigaction 67
72#define __NR_sgetmask 68
73#define __NR_ssetmask 69
74#define __NR_setreuid 70
75#define __NR_setregid 71
76#define __NR_sigsuspend 72
77#define __NR_sigpending 73
78#define __NR_sethostname 74
79#define __NR_setrlimit 75
80#define __NR_getrlimit 76
81#define __NR_getrusage 77
82#define __NR_gettimeofday 78
83#define __NR_settimeofday 79
84#define __NR_getgroups 80
85#define __NR_setgroups 81
86#define __NR_select 82
87#define __NR_symlink 83
88#define __NR_oldlstat 84
89#define __NR_readlink 85
90#define __NR_uselib 86
91#define __NR_swapon 87
92#define __NR_reboot 88
93#define __NR_readdir 89
94#define __NR_mmap 90
95#define __NR_munmap 91
96#define __NR_truncate 92
97#define __NR_ftruncate 93
98#define __NR_fchmod 94
99#define __NR_fchown 95
100#define __NR_getpriority 96
101#define __NR_setpriority 97
102#define __NR_profil 98
103#define __NR_statfs 99
104#define __NR_fstatfs 100
105#define __NR_ioperm 101
106#define __NR_socketcall 102
107#define __NR_syslog 103
108#define __NR_setitimer 104
109#define __NR_getitimer 105
110#define __NR_stat 106
111#define __NR_lstat 107
112#define __NR_fstat 108
113#define __NR_olduname 109
114#define __NR_iopl 110
115#define __NR_vhangup 111
116#define __NR_idle 112
117#define __NR_vm86old 113
118#define __NR_wait4 114
119#define __NR_swapoff 115
120#define __NR_sysinfo 116
121#define __NR_ipc 117
122#define __NR_fsync 118
123#define __NR_sigreturn 119
124#define __NR_clone 120
125#define __NR_setdomainname 121
126#define __NR_uname 122
127#define __NR_modify_ldt 123
128#define __NR_adjtimex 124
129#define __NR_mprotect 125
130#define __NR_sigprocmask 126
131#define __NR_create_module 127
132#define __NR_init_module 128
133#define __NR_delete_module 129
134#define __NR_get_kernel_syms 130
135#define __NR_quotactl 131
136#define __NR_getpgid 132
137#define __NR_fchdir 133
138#define __NR_bdflush 134
139#define __NR_sysfs 135
140#define __NR_personality 136
141#define __NR_afs_syscall 137
142#define __NR_setfsuid 138
143#define __NR_setfsgid 139
144#define __NR__llseek 140
145#define __NR_getdents 141
146#define __NR__newselect 142
147#define __NR_flock 143
148#define __NR_msync 144
149#define __NR_readv 145
150#define __NR_writev 146
151#define __NR_getsid 147
152#define __NR_fdatasync 148
153#define __NR__sysctl 149
154#define __NR_mlock 150
155#define __NR_munlock 151
156#define __NR_mlockall 152
157#define __NR_munlockall 153
158#define __NR_sched_setparam 154
159#define __NR_sched_getparam 155
160#define __NR_sched_setscheduler 156
161#define __NR_sched_getscheduler 157
162#define __NR_sched_yield 158
163#define __NR_sched_get_priority_max 159
164#define __NR_sched_get_priority_min 160
165#define __NR_sched_rr_get_interval 161
166#define __NR_nanosleep 162
167#define __NR_mremap 163
168#define __NR_setresuid 164
169#define __NR_getresuid 165
170#define __NR_vm86 166
171#define __NR_query_module 167
172#define __NR_poll 168
173#define __NR_nfsservctl 169
174#define __NR_setresgid 170
175#define __NR_getresgid 171
176#define __NR_prctl 172
177#define __NR_rt_sigreturn 173
178#define __NR_rt_sigaction 174
179#define __NR_rt_sigprocmask 175
180#define __NR_rt_sigpending 176
181#define __NR_rt_sigtimedwait 177
182#define __NR_rt_sigqueueinfo 178
183#define __NR_rt_sigsuspend 179
184#define __NR_pread64 180
185#define __NR_pwrite64 181
186#define __NR_chown 182
187#define __NR_getcwd 183
188#define __NR_capget 184
189#define __NR_capset 185
190#define __NR_sigaltstack 186
191#define __NR_sendfile 187
192#define __NR_getpmsg 188
193#define __NR_putpmsg 189
194#define __NR_vfork 190
195#define __NR_ugetrlimit 191
196#define __NR_mmap2 192
197#define __NR_truncate64 193
198#define __NR_ftruncate64 194
199#define __NR_stat64 195
200#define __NR_lstat64 196
201#define __NR_fstat64 197
202#define __NR_lchown32 198
203#define __NR_getuid32 199
204#define __NR_getgid32 200
205#define __NR_geteuid32 201
206#define __NR_getegid32 202
207#define __NR_setreuid32 203
208#define __NR_setregid32 204
209#define __NR_getgroups32 205
210#define __NR_setgroups32 206
211#define __NR_fchown32 207
212#define __NR_setresuid32 208
213#define __NR_getresuid32 209
214#define __NR_setresgid32 210
215#define __NR_getresgid32 211
216#define __NR_chown32 212
217#define __NR_setuid32 213
218#define __NR_setgid32 214
219#define __NR_setfsuid32 215
220#define __NR_setfsgid32 216
221#define __NR_pivot_root 217
222#define __NR_mincore 218
223#define __NR_madvise 219
224#define __NR_getdents64 220
225#define __NR_fcntl64 221
226#define __NR_gettid 224
227#define __NR_readahead 225
228#define __NR_setxattr 226
229#define __NR_lsetxattr 227
230#define __NR_fsetxattr 228
231#define __NR_getxattr 229
232#define __NR_lgetxattr 230
233#define __NR_fgetxattr 231
234#define __NR_listxattr 232
235#define __NR_llistxattr 233
236#define __NR_flistxattr 234
237#define __NR_removexattr 235
238#define __NR_lremovexattr 236
239#define __NR_fremovexattr 237
240#define __NR_tkill 238
241#define __NR_sendfile64 239
242#define __NR_futex 240
243#define __NR_sched_setaffinity 241
244#define __NR_sched_getaffinity 242
245#define __NR_set_thread_area 243
246#define __NR_get_thread_area 244
247#define __NR_io_setup 245
248#define __NR_io_destroy 246
249#define __NR_io_getevents 247
250#define __NR_io_submit 248
251#define __NR_io_cancel 249
252#define __NR_fadvise64 250
253#define __NR_exit_group 252
254#define __NR_lookup_dcookie 253
255#define __NR_epoll_create 254
256#define __NR_epoll_ctl 255
257#define __NR_epoll_wait 256
258#define __NR_remap_file_pages 257
259#define __NR_set_tid_address 258
260#define __NR_timer_create 259
261#define __NR_timer_settime 260
262#define __NR_timer_gettime 261
263#define __NR_timer_getoverrun 262
264#define __NR_timer_delete 263
265#define __NR_clock_settime 264
266#define __NR_clock_gettime 265
267#define __NR_clock_getres 266
268#define __NR_clock_nanosleep 267
269#define __NR_statfs64 268
270#define __NR_fstatfs64 269
271#define __NR_tgkill 270
272#define __NR_utimes 271
273#define __NR_fadvise64_64 272
274#define __NR_vserver 273
275#define __NR_mbind 274
276#define __NR_get_mempolicy 275
277#define __NR_set_mempolicy 276
278#define __NR_mq_open 277
279#define __NR_mq_unlink 278
280#define __NR_mq_timedsend 279
281#define __NR_mq_timedreceive 280
282#define __NR_mq_notify 281
283#define __NR_mq_getsetattr 282
284#define __NR_kexec_load 283
285#define __NR_waitid 284
286#define __NR_add_key 286
287#define __NR_request_key 287
288#define __NR_keyctl 288
289#define __NR_ioprio_set 289
290#define __NR_ioprio_get 290
291#define __NR_inotify_init 291
292#define __NR_inotify_add_watch 292
293#define __NR_inotify_rm_watch 293
294#define __NR_migrate_pages 294
295#define __NR_openat 295
296#define __NR_mkdirat 296
297#define __NR_mknodat 297
298#define __NR_fchownat 298
299#define __NR_futimesat 299
300#define __NR_fstatat64 300
301#define __NR_unlinkat 301
302#define __NR_renameat 302
303#define __NR_linkat 303
304#define __NR_symlinkat 304
305#define __NR_readlinkat 305
306#define __NR_fchmodat 306
307#define __NR_faccessat 307
308#define __NR_pselect6 308
309#define __NR_ppoll 309
310#define __NR_unshare 310
311#define __NR_set_robust_list 311
312#define __NR_get_robust_list 312
313#define __NR_splice 313
314#define __NR_sync_file_range 314
315#define __NR_tee 315
316#define __NR_vmsplice 316
317#define __NR_move_pages 317
318#define __NR_getcpu 318
319#define __NR_epoll_pwait 319
320#define __NR_utimensat 320
321#define __NR_signalfd 321
322#define __NR_timerfd_create 322
323#define __NR_eventfd 323
324#define __NR_fallocate 324
325#define __NR_timerfd_settime 325
326#define __NR_timerfd_gettime 326
327#define __NR_signalfd4 327
328#define __NR_eventfd2 328
329#define __NR_epoll_create1 329
330#define __NR_dup3 330
331#define __NR_pipe2 331
332#define __NR_inotify_init1 332
333#define __NR_preadv 333
334#define __NR_pwritev 334
335#define __NR_rt_tgsigqueueinfo 335
336#define __NR_perf_event_open 336
337#define __NR_recvmmsg 337
338#define __NR_fanotify_init 338
339#define __NR_fanotify_mark 339
340#define __NR_prlimit64 340
341#define __NR_name_to_handle_at 341
342#define __NR_open_by_handle_at 342
343#define __NR_clock_adjtime 343
344#define __NR_syncfs 344
345#define __NR_sendmmsg 345
346#define __NR_setns 346
347#define __NR_process_vm_readv 347
348#define __NR_process_vm_writev 348
349#define __NR_kcmp 349
350#define __NR_finit_module 350
351#define __NR_sched_setattr 351
352#define __NR_sched_getattr 352
353#define __NR_renameat2 353
354#define __NR_seccomp 354
355#define __NR_getrandom 355
356#define __NR_memfd_create 356
357#define __NR_bpf 357
358#define __NR_execveat 358
359#define __NR_socket 359
360#define __NR_socketpair 360
361#define __NR_bind 361
362#define __NR_connect 362
363#define __NR_listen 363
364#define __NR_accept4 364
365#define __NR_getsockopt 365
366#define __NR_setsockopt 366
367#define __NR_getsockname 367
368#define __NR_getpeername 368
369#define __NR_sendto 369
370#define __NR_sendmsg 370
371#define __NR_recvfrom 371
372#define __NR_recvmsg 372
373#define __NR_shutdown 373
374#define __NR_userfaultfd 374
375#define __NR_membarrier 375
376#define __NR_mlock2 376
377#define __NR_copy_file_range 377
378#define __NR_preadv2 378
379#define __NR_pwritev2 379
380#define __NR_pkey_mprotect 380
381#define __NR_pkey_alloc 381
382#define __NR_pkey_free 382
383#define __NR_statx 383
384#define __NR_arch_prctl 384
385#define __NR_io_pgetevents 385
386#define __NR_rseq 386
387#define __NR_semget 393
388#define __NR_semctl 394
389#define __NR_shmget 395
390#define __NR_shmctl 396
391#define __NR_shmat 397
392#define __NR_shmdt 398
393#define __NR_msgget 399
394#define __NR_msgsnd 400
395#define __NR_msgrcv 401
396#define __NR_msgctl 402
397#define __NR_clock_gettime64 403
398#define __NR_clock_settime64 404
399#define __NR_clock_adjtime64 405
400#define __NR_clock_getres_time64 406
401#define __NR_clock_nanosleep_time64 407
402#define __NR_timer_gettime64 408
403#define __NR_timer_settime64 409
404#define __NR_timerfd_gettime64 410
405#define __NR_timerfd_settime64 411
406#define __NR_utimensat_time64 412
407#define __NR_pselect6_time64 413
408#define __NR_ppoll_time64 414
409#define __NR_io_pgetevents_time64 416
410#define __NR_recvmmsg_time64 417
411#define __NR_mq_timedsend_time64 418
412#define __NR_mq_timedreceive_time64 419
413#define __NR_semtimedop_time64 420
414#define __NR_rt_sigtimedwait_time64 421
415#define __NR_futex_time64 422
416#define __NR_sched_rr_get_interval_time64 423
417#define __NR_pidfd_send_signal 424
418#define __NR_io_uring_setup 425
419#define __NR_io_uring_enter 426
420#define __NR_io_uring_register 427
421#define __NR_open_tree 428
422#define __NR_move_mount 429
423#define __NR_fsopen 430
424#define __NR_fsconfig 431
425#define __NR_fsmount 432
426#define __NR_fspick 433
427#define __NR_pidfd_open 434
428#define __NR_clone3 435
429#define __NR_close_range 436
430#define __NR_openat2 437
431#define __NR_pidfd_getfd 438
432#define __NR_faccessat2 439
433#define __NR_process_madvise 440
434#define __NR_epoll_pwait2 441
435#define __NR_mount_setattr 442
436#define __NR_quotactl_fd 443
437#define __NR_landlock_create_ruleset 444
438#define __NR_landlock_add_rule 445
439#define __NR_landlock_restrict_self 446
440#define __NR_memfd_secret 447
441#define __NR_process_mrelease 448
442#define __NR_futex_waitv 449
443
444
445#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h created+367
...@@ -0,0 +1,367 @@
1#ifndef _ASM_UNISTD_64_H
2#define _ASM_UNISTD_64_H
3
4#define __NR_read 0
5#define __NR_write 1
6#define __NR_open 2
7#define __NR_close 3
8#define __NR_stat 4
9#define __NR_fstat 5
10#define __NR_lstat 6
11#define __NR_poll 7
12#define __NR_lseek 8
13#define __NR_mmap 9
14#define __NR_mprotect 10
15#define __NR_munmap 11
16#define __NR_brk 12
17#define __NR_rt_sigaction 13
18#define __NR_rt_sigprocmask 14
19#define __NR_rt_sigreturn 15
20#define __NR_ioctl 16
21#define __NR_pread64 17
22#define __NR_pwrite64 18
23#define __NR_readv 19
24#define __NR_writev 20
25#define __NR_access 21
26#define __NR_pipe 22
27#define __NR_select 23
28#define __NR_sched_yield 24
29#define __NR_mremap 25
30#define __NR_msync 26
31#define __NR_mincore 27
32#define __NR_madvise 28
33#define __NR_shmget 29
34#define __NR_shmat 30
35#define __NR_shmctl 31
36#define __NR_dup 32
37#define __NR_dup2 33
38#define __NR_pause 34
39#define __NR_nanosleep 35
40#define __NR_getitimer 36
41#define __NR_alarm 37
42#define __NR_setitimer 38
43#define __NR_getpid 39
44#define __NR_sendfile 40
45#define __NR_socket 41
46#define __NR_connect 42
47#define __NR_accept 43
48#define __NR_sendto 44
49#define __NR_recvfrom 45
50#define __NR_sendmsg 46
51#define __NR_recvmsg 47
52#define __NR_shutdown 48
53#define __NR_bind 49
54#define __NR_listen 50
55#define __NR_getsockname 51
56#define __NR_getpeername 52
57#define __NR_socketpair 53
58#define __NR_setsockopt 54
59#define __NR_getsockopt 55
60#define __NR_clone 56
61#define __NR_fork 57
62#define __NR_vfork 58
63#define __NR_execve 59
64#define __NR_exit 60
65#define __NR_wait4 61
66#define __NR_kill 62
67#define __NR_uname 63
68#define __NR_semget 64
69#define __NR_semop 65
70#define __NR_semctl 66
71#define __NR_shmdt 67
72#define __NR_msgget 68
73#define __NR_msgsnd 69
74#define __NR_msgrcv 70
75#define __NR_msgctl 71
76#define __NR_fcntl 72
77#define __NR_flock 73
78#define __NR_fsync 74
79#define __NR_fdatasync 75
80#define __NR_truncate 76
81#define __NR_ftruncate 77
82#define __NR_getdents 78
83#define __NR_getcwd 79
84#define __NR_chdir 80
85#define __NR_fchdir 81
86#define __NR_rename 82
87#define __NR_mkdir 83
88#define __NR_rmdir 84
89#define __NR_creat 85
90#define __NR_link 86
91#define __NR_unlink 87
92#define __NR_symlink 88
93#define __NR_readlink 89
94#define __NR_chmod 90
95#define __NR_fchmod 91
96#define __NR_chown 92
97#define __NR_fchown 93
98#define __NR_lchown 94
99#define __NR_umask 95
100#define __NR_gettimeofday 96
101#define __NR_getrlimit 97
102#define __NR_getrusage 98
103#define __NR_sysinfo 99
104#define __NR_times 100
105#define __NR_ptrace 101
106#define __NR_getuid 102
107#define __NR_syslog 103
108#define __NR_getgid 104
109#define __NR_setuid 105
110#define __NR_setgid 106
111#define __NR_geteuid 107
112#define __NR_getegid 108
113#define __NR_setpgid 109
114#define __NR_getppid 110
115#define __NR_getpgrp 111
116#define __NR_setsid 112
117#define __NR_setreuid 113
118#define __NR_setregid 114
119#define __NR_getgroups 115
120#define __NR_setgroups 116
121#define __NR_setresuid 117
122#define __NR_getresuid 118
123#define __NR_setresgid 119
124#define __NR_getresgid 120
125#define __NR_getpgid 121
126#define __NR_setfsuid 122
127#define __NR_setfsgid 123
128#define __NR_getsid 124
129#define __NR_capget 125
130#define __NR_capset 126
131#define __NR_rt_sigpending 127
132#define __NR_rt_sigtimedwait 128
133#define __NR_rt_sigqueueinfo 129
134#define __NR_rt_sigsuspend 130
135#define __NR_sigaltstack 131
136#define __NR_utime 132
137#define __NR_mknod 133
138#define __NR_uselib 134
139#define __NR_personality 135
140#define __NR_ustat 136
141#define __NR_statfs 137
142#define __NR_fstatfs 138
143#define __NR_sysfs 139
144#define __NR_getpriority 140
145#define __NR_setpriority 141
146#define __NR_sched_setparam 142
147#define __NR_sched_getparam 143
148#define __NR_sched_setscheduler 144
149#define __NR_sched_getscheduler 145
150#define __NR_sched_get_priority_max 146
151#define __NR_sched_get_priority_min 147
152#define __NR_sched_rr_get_interval 148
153#define __NR_mlock 149
154#define __NR_munlock 150
155#define __NR_mlockall 151
156#define __NR_munlockall 152
157#define __NR_vhangup 153
158#define __NR_modify_ldt 154
159#define __NR_pivot_root 155
160#define __NR__sysctl 156
161#define __NR_prctl 157
162#define __NR_arch_prctl 158
163#define __NR_adjtimex 159
164#define __NR_setrlimit 160
165#define __NR_chroot 161
166#define __NR_sync 162
167#define __NR_acct 163
168#define __NR_settimeofday 164
169#define __NR_mount 165
170#define __NR_umount2 166
171#define __NR_swapon 167
172#define __NR_swapoff 168
173#define __NR_reboot 169
174#define __NR_sethostname 170
175#define __NR_setdomainname 171
176#define __NR_iopl 172
177#define __NR_ioperm 173
178#define __NR_create_module 174
179#define __NR_init_module 175
180#define __NR_delete_module 176
181#define __NR_get_kernel_syms 177
182#define __NR_query_module 178
183#define __NR_quotactl 179
184#define __NR_nfsservctl 180
185#define __NR_getpmsg 181
186#define __NR_putpmsg 182
187#define __NR_afs_syscall 183
188#define __NR_tuxcall 184
189#define __NR_security 185
190#define __NR_gettid 186
191#define __NR_readahead 187
192#define __NR_setxattr 188
193#define __NR_lsetxattr 189
194#define __NR_fsetxattr 190
195#define __NR_getxattr 191
196#define __NR_lgetxattr 192
197#define __NR_fgetxattr 193
198#define __NR_listxattr 194
199#define __NR_llistxattr 195
200#define __NR_flistxattr 196
201#define __NR_removexattr 197
202#define __NR_lremovexattr 198
203#define __NR_fremovexattr 199
204#define __NR_tkill 200
205#define __NR_time 201
206#define __NR_futex 202
207#define __NR_sched_setaffinity 203
208#define __NR_sched_getaffinity 204
209#define __NR_set_thread_area 205
210#define __NR_io_setup 206
211#define __NR_io_destroy 207
212#define __NR_io_getevents 208
213#define __NR_io_submit 209
214#define __NR_io_cancel 210
215#define __NR_get_thread_area 211
216#define __NR_lookup_dcookie 212
217#define __NR_epoll_create 213
218#define __NR_epoll_ctl_old 214
219#define __NR_epoll_wait_old 215
220#define __NR_remap_file_pages 216
221#define __NR_getdents64 217
222#define __NR_set_tid_address 218
223#define __NR_restart_syscall 219
224#define __NR_semtimedop 220
225#define __NR_fadvise64 221
226#define __NR_timer_create 222
227#define __NR_timer_settime 223
228#define __NR_timer_gettime 224
229#define __NR_timer_getoverrun 225
230#define __NR_timer_delete 226
231#define __NR_clock_settime 227
232#define __NR_clock_gettime 228
233#define __NR_clock_getres 229
234#define __NR_clock_nanosleep 230
235#define __NR_exit_group 231
236#define __NR_epoll_wait 232
237#define __NR_epoll_ctl 233
238#define __NR_tgkill 234
239#define __NR_utimes 235
240#define __NR_vserver 236
241#define __NR_mbind 237
242#define __NR_set_mempolicy 238
243#define __NR_get_mempolicy 239
244#define __NR_mq_open 240
245#define __NR_mq_unlink 241
246#define __NR_mq_timedsend 242
247#define __NR_mq_timedreceive 243
248#define __NR_mq_notify 244
249#define __NR_mq_getsetattr 245
250#define __NR_kexec_load 246
251#define __NR_waitid 247
252#define __NR_add_key 248
253#define __NR_request_key 249
254#define __NR_keyctl 250
255#define __NR_ioprio_set 251
256#define __NR_ioprio_get 252
257#define __NR_inotify_init 253
258#define __NR_inotify_add_watch 254
259#define __NR_inotify_rm_watch 255
260#define __NR_migrate_pages 256
261#define __NR_openat 257
262#define __NR_mkdirat 258
263#define __NR_mknodat 259
264#define __NR_fchownat 260
265#define __NR_futimesat 261
266#define __NR_newfstatat 262
267#define __NR_unlinkat 263
268#define __NR_renameat 264
269#define __NR_linkat 265
270#define __NR_symlinkat 266
271#define __NR_readlinkat 267
272#define __NR_fchmodat 268
273#define __NR_faccessat 269
274#define __NR_pselect6 270
275#define __NR_ppoll 271
276#define __NR_unshare 272
277#define __NR_set_robust_list 273
278#define __NR_get_robust_list 274
279#define __NR_splice 275
280#define __NR_tee 276
281#define __NR_sync_file_range 277
282#define __NR_vmsplice 278
283#define __NR_move_pages 279
284#define __NR_utimensat 280
285#define __NR_epoll_pwait 281
286#define __NR_signalfd 282
287#define __NR_timerfd_create 283
288#define __NR_eventfd 284
289#define __NR_fallocate 285
290#define __NR_timerfd_settime 286
291#define __NR_timerfd_gettime 287
292#define __NR_accept4 288
293#define __NR_signalfd4 289
294#define __NR_eventfd2 290
295#define __NR_epoll_create1 291
296#define __NR_dup3 292
297#define __NR_pipe2 293
298#define __NR_inotify_init1 294
299#define __NR_preadv 295
300#define __NR_pwritev 296
301#define __NR_rt_tgsigqueueinfo 297
302#define __NR_perf_event_open 298
303#define __NR_recvmmsg 299
304#define __NR_fanotify_init 300
305#define __NR_fanotify_mark 301
306#define __NR_prlimit64 302
307#define __NR_name_to_handle_at 303
308#define __NR_open_by_handle_at 304
309#define __NR_clock_adjtime 305
310#define __NR_syncfs 306
311#define __NR_sendmmsg 307
312#define __NR_setns 308
313#define __NR_getcpu 309
314#define __NR_process_vm_readv 310
315#define __NR_process_vm_writev 311
316#define __NR_kcmp 312
317#define __NR_finit_module 313
318#define __NR_sched_setattr 314
319#define __NR_sched_getattr 315
320#define __NR_renameat2 316
321#define __NR_seccomp 317
322#define __NR_getrandom 318
323#define __NR_memfd_create 319
324#define __NR_kexec_file_load 320
325#define __NR_bpf 321
326#define __NR_execveat 322
327#define __NR_userfaultfd 323
328#define __NR_membarrier 324
329#define __NR_mlock2 325
330#define __NR_copy_file_range 326
331#define __NR_preadv2 327
332#define __NR_pwritev2 328
333#define __NR_pkey_mprotect 329
334#define __NR_pkey_alloc 330
335#define __NR_pkey_free 331
336#define __NR_statx 332
337#define __NR_io_pgetevents 333
338#define __NR_rseq 334
339#define __NR_pidfd_send_signal 424
340#define __NR_io_uring_setup 425
341#define __NR_io_uring_enter 426
342#define __NR_io_uring_register 427
343#define __NR_open_tree 428
344#define __NR_move_mount 429
345#define __NR_fsopen 430
346#define __NR_fsconfig 431
347#define __NR_fsmount 432
348#define __NR_fspick 433
349#define __NR_pidfd_open 434
350#define __NR_clone3 435
351#define __NR_close_range 436
352#define __NR_openat2 437
353#define __NR_pidfd_getfd 438
354#define __NR_faccessat2 439
355#define __NR_process_madvise 440
356#define __NR_epoll_pwait2 441
357#define __NR_mount_setattr 442
358#define __NR_quotactl_fd 443
359#define __NR_landlock_create_ruleset 444
360#define __NR_landlock_add_rule 445
361#define __NR_landlock_restrict_self 446
362#define __NR_memfd_secret 447
363#define __NR_process_mrelease 448
364#define __NR_futex_waitv 449
365
366
367#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h created+356
...@@ -0,0 +1,356 @@
1#ifndef _ASM_UNISTD_X32_H
2#define _ASM_UNISTD_X32_H
3
4#define __NR_read (__X32_SYSCALL_BIT + 0)
5#define __NR_write (__X32_SYSCALL_BIT + 1)
6#define __NR_open (__X32_SYSCALL_BIT + 2)
7#define __NR_close (__X32_SYSCALL_BIT + 3)
8#define __NR_stat (__X32_SYSCALL_BIT + 4)
9#define __NR_fstat (__X32_SYSCALL_BIT + 5)
10#define __NR_lstat (__X32_SYSCALL_BIT + 6)
11#define __NR_poll (__X32_SYSCALL_BIT + 7)
12#define __NR_lseek (__X32_SYSCALL_BIT + 8)
13#define __NR_mmap (__X32_SYSCALL_BIT + 9)
14#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
15#define __NR_munmap (__X32_SYSCALL_BIT + 11)
16#define __NR_brk (__X32_SYSCALL_BIT + 12)
17#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
18#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
19#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
20#define __NR_access (__X32_SYSCALL_BIT + 21)
21#define __NR_pipe (__X32_SYSCALL_BIT + 22)
22#define __NR_select (__X32_SYSCALL_BIT + 23)
23#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
24#define __NR_mremap (__X32_SYSCALL_BIT + 25)
25#define __NR_msync (__X32_SYSCALL_BIT + 26)
26#define __NR_mincore (__X32_SYSCALL_BIT + 27)
27#define __NR_madvise (__X32_SYSCALL_BIT + 28)
28#define __NR_shmget (__X32_SYSCALL_BIT + 29)
29#define __NR_shmat (__X32_SYSCALL_BIT + 30)
30#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
31#define __NR_dup (__X32_SYSCALL_BIT + 32)
32#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
33#define __NR_pause (__X32_SYSCALL_BIT + 34)
34#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
35#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
36#define __NR_alarm (__X32_SYSCALL_BIT + 37)
37#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
38#define __NR_getpid (__X32_SYSCALL_BIT + 39)
39#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
40#define __NR_socket (__X32_SYSCALL_BIT + 41)
41#define __NR_connect (__X32_SYSCALL_BIT + 42)
42#define __NR_accept (__X32_SYSCALL_BIT + 43)
43#define __NR_sendto (__X32_SYSCALL_BIT + 44)
44#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
45#define __NR_bind (__X32_SYSCALL_BIT + 49)
46#define __NR_listen (__X32_SYSCALL_BIT + 50)
47#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
48#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
49#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
50#define __NR_clone (__X32_SYSCALL_BIT + 56)
51#define __NR_fork (__X32_SYSCALL_BIT + 57)
52#define __NR_vfork (__X32_SYSCALL_BIT + 58)
53#define __NR_exit (__X32_SYSCALL_BIT + 60)
54#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
55#define __NR_kill (__X32_SYSCALL_BIT + 62)
56#define __NR_uname (__X32_SYSCALL_BIT + 63)
57#define __NR_semget (__X32_SYSCALL_BIT + 64)
58#define __NR_semop (__X32_SYSCALL_BIT + 65)
59#define __NR_semctl (__X32_SYSCALL_BIT + 66)
60#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
61#define __NR_msgget (__X32_SYSCALL_BIT + 68)
62#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
63#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
64#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
65#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
66#define __NR_flock (__X32_SYSCALL_BIT + 73)
67#define __NR_fsync (__X32_SYSCALL_BIT + 74)
68#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
69#define __NR_truncate (__X32_SYSCALL_BIT + 76)
70#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
71#define __NR_getdents (__X32_SYSCALL_BIT + 78)
72#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
73#define __NR_chdir (__X32_SYSCALL_BIT + 80)
74#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
75#define __NR_rename (__X32_SYSCALL_BIT + 82)
76#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
77#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
78#define __NR_creat (__X32_SYSCALL_BIT + 85)
79#define __NR_link (__X32_SYSCALL_BIT + 86)
80#define __NR_unlink (__X32_SYSCALL_BIT + 87)
81#define __NR_symlink (__X32_SYSCALL_BIT + 88)
82#define __NR_readlink (__X32_SYSCALL_BIT + 89)
83#define __NR_chmod (__X32_SYSCALL_BIT + 90)
84#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
85#define __NR_chown (__X32_SYSCALL_BIT + 92)
86#define __NR_fchown (__X32_SYSCALL_BIT + 93)
87#define __NR_lchown (__X32_SYSCALL_BIT + 94)
88#define __NR_umask (__X32_SYSCALL_BIT + 95)
89#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
90#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
91#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
92#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
93#define __NR_times (__X32_SYSCALL_BIT + 100)
94#define __NR_getuid (__X32_SYSCALL_BIT + 102)
95#define __NR_syslog (__X32_SYSCALL_BIT + 103)
96#define __NR_getgid (__X32_SYSCALL_BIT + 104)
97#define __NR_setuid (__X32_SYSCALL_BIT + 105)
98#define __NR_setgid (__X32_SYSCALL_BIT + 106)
99#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
100#define __NR_getegid (__X32_SYSCALL_BIT + 108)
101#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
102#define __NR_getppid (__X32_SYSCALL_BIT + 110)
103#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
104#define __NR_setsid (__X32_SYSCALL_BIT + 112)
105#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
106#define __NR_setregid (__X32_SYSCALL_BIT + 114)
107#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
108#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
109#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
110#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
111#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
112#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
113#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
114#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
115#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
116#define __NR_getsid (__X32_SYSCALL_BIT + 124)
117#define __NR_capget (__X32_SYSCALL_BIT + 125)
118#define __NR_capset (__X32_SYSCALL_BIT + 126)
119#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
120#define __NR_utime (__X32_SYSCALL_BIT + 132)
121#define __NR_mknod (__X32_SYSCALL_BIT + 133)
122#define __NR_personality (__X32_SYSCALL_BIT + 135)
123#define __NR_ustat (__X32_SYSCALL_BIT + 136)
124#define __NR_statfs (__X32_SYSCALL_BIT + 137)
125#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
126#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
127#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
128#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
129#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
130#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
131#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
132#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
133#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
134#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
135#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
136#define __NR_mlock (__X32_SYSCALL_BIT + 149)
137#define __NR_munlock (__X32_SYSCALL_BIT + 150)
138#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
139#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
140#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
141#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
142#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
143#define __NR_prctl (__X32_SYSCALL_BIT + 157)
144#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
145#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
146#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
147#define __NR_chroot (__X32_SYSCALL_BIT + 161)
148#define __NR_sync (__X32_SYSCALL_BIT + 162)
149#define __NR_acct (__X32_SYSCALL_BIT + 163)
150#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
151#define __NR_mount (__X32_SYSCALL_BIT + 165)
152#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
153#define __NR_swapon (__X32_SYSCALL_BIT + 167)
154#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
155#define __NR_reboot (__X32_SYSCALL_BIT + 169)
156#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
157#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
158#define __NR_iopl (__X32_SYSCALL_BIT + 172)
159#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
160#define __NR_init_module (__X32_SYSCALL_BIT + 175)
161#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
162#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
163#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
164#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
165#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
166#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
167#define __NR_security (__X32_SYSCALL_BIT + 185)
168#define __NR_gettid (__X32_SYSCALL_BIT + 186)
169#define __NR_readahead (__X32_SYSCALL_BIT + 187)
170#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
171#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
172#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
173#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
174#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
175#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
176#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
177#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
178#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
179#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
180#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
181#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
182#define __NR_tkill (__X32_SYSCALL_BIT + 200)
183#define __NR_time (__X32_SYSCALL_BIT + 201)
184#define __NR_futex (__X32_SYSCALL_BIT + 202)
185#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
186#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
187#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
188#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
189#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
190#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
191#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
192#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
193#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
194#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
195#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
196#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
197#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
198#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
199#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
200#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
201#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
202#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
203#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
204#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
205#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
206#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
207#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
208#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
209#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
210#define __NR_utimes (__X32_SYSCALL_BIT + 235)
211#define __NR_mbind (__X32_SYSCALL_BIT + 237)
212#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
213#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
214#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
215#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
216#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
217#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
218#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
219#define __NR_add_key (__X32_SYSCALL_BIT + 248)
220#define __NR_request_key (__X32_SYSCALL_BIT + 249)
221#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
222#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
223#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
224#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
225#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
226#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
227#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
228#define __NR_openat (__X32_SYSCALL_BIT + 257)
229#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
230#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
231#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
232#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
233#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
234#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
235#define __NR_renameat (__X32_SYSCALL_BIT + 264)
236#define __NR_linkat (__X32_SYSCALL_BIT + 265)
237#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
238#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
239#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
240#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
241#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
242#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
243#define __NR_unshare (__X32_SYSCALL_BIT + 272)
244#define __NR_splice (__X32_SYSCALL_BIT + 275)
245#define __NR_tee (__X32_SYSCALL_BIT + 276)
246#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
247#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
248#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
249#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
250#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
251#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
252#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
253#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
254#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
255#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
256#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
257#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
258#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
259#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
260#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
261#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
262#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
263#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
264#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
265#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
266#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
267#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
268#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
269#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
270#define __NR_setns (__X32_SYSCALL_BIT + 308)
271#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
272#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
273#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
274#define __NR_sched_setattr (__X32_SYSCALL_BIT + 314)
275#define __NR_sched_getattr (__X32_SYSCALL_BIT + 315)
276#define __NR_renameat2 (__X32_SYSCALL_BIT + 316)
277#define __NR_seccomp (__X32_SYSCALL_BIT + 317)
278#define __NR_getrandom (__X32_SYSCALL_BIT + 318)
279#define __NR_memfd_create (__X32_SYSCALL_BIT + 319)
280#define __NR_kexec_file_load (__X32_SYSCALL_BIT + 320)
281#define __NR_bpf (__X32_SYSCALL_BIT + 321)
282#define __NR_userfaultfd (__X32_SYSCALL_BIT + 323)
283#define __NR_membarrier (__X32_SYSCALL_BIT + 324)
284#define __NR_mlock2 (__X32_SYSCALL_BIT + 325)
285#define __NR_copy_file_range (__X32_SYSCALL_BIT + 326)
286#define __NR_pkey_mprotect (__X32_SYSCALL_BIT + 329)
287#define __NR_pkey_alloc (__X32_SYSCALL_BIT + 330)
288#define __NR_pkey_free (__X32_SYSCALL_BIT + 331)
289#define __NR_statx (__X32_SYSCALL_BIT + 332)
290#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
291#define __NR_rseq (__X32_SYSCALL_BIT + 334)
292#define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424)
293#define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425)
294#define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426)
295#define __NR_io_uring_register (__X32_SYSCALL_BIT + 427)
296#define __NR_open_tree (__X32_SYSCALL_BIT + 428)
297#define __NR_move_mount (__X32_SYSCALL_BIT + 429)
298#define __NR_fsopen (__X32_SYSCALL_BIT + 430)
299#define __NR_fsconfig (__X32_SYSCALL_BIT + 431)
300#define __NR_fsmount (__X32_SYSCALL_BIT + 432)
301#define __NR_fspick (__X32_SYSCALL_BIT + 433)
302#define __NR_pidfd_open (__X32_SYSCALL_BIT + 434)
303#define __NR_clone3 (__X32_SYSCALL_BIT + 435)
304#define __NR_close_range (__X32_SYSCALL_BIT + 436)
305#define __NR_openat2 (__X32_SYSCALL_BIT + 437)
306#define __NR_pidfd_getfd (__X32_SYSCALL_BIT + 438)
307#define __NR_faccessat2 (__X32_SYSCALL_BIT + 439)
308#define __NR_process_madvise (__X32_SYSCALL_BIT + 440)
309#define __NR_epoll_pwait2 (__X32_SYSCALL_BIT + 441)
310#define __NR_mount_setattr (__X32_SYSCALL_BIT + 442)
311#define __NR_quotactl_fd (__X32_SYSCALL_BIT + 443)
312#define __NR_landlock_create_ruleset (__X32_SYSCALL_BIT + 444)
313#define __NR_landlock_add_rule (__X32_SYSCALL_BIT + 445)
314#define __NR_landlock_restrict_self (__X32_SYSCALL_BIT + 446)
315#define __NR_memfd_secret (__X32_SYSCALL_BIT + 447)
316#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)
317#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)
318#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
319#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
320#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
321#define __NR_readv (__X32_SYSCALL_BIT + 515)
322#define __NR_writev (__X32_SYSCALL_BIT + 516)
323#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
324#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
325#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
326#define __NR_execve (__X32_SYSCALL_BIT + 520)
327#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
328#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
329#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
330#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
331#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
332#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
333#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
334#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
335#define __NR_waitid (__X32_SYSCALL_BIT + 529)
336#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
337#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
338#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
339#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
340#define __NR_preadv (__X32_SYSCALL_BIT + 534)
341#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
342#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
343#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
344#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
345#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
346#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
347#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
348#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
349#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
350#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
351#define __NR_execveat (__X32_SYSCALL_BIT + 545)
352#define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
353#define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
354
355
356#endif /* _ASM_UNISTD_X32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/vm86.h created+130
...@@ -0,0 +1,130 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_VM86_H
3#define _ASM_X86_VM86_H
4
5/*
6 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
7 * the Pentium uses them. Linux will return from vm86 mode when both
8 * VIF and VIP is set.
9 *
10 * On a Pentium, we could probably optimize the virtual flags directly
11 * in the eflags register instead of doing it "by hand" in vflags...
12 *
13 * Linus
14 */
15
16#include <asm/processor-flags.h>
17
18#define BIOSSEG 0x0f000
19
20#define CPU_086 0
21#define CPU_186 1
22#define CPU_286 2
23#define CPU_386 3
24#define CPU_486 4
25#define CPU_586 5
26
27/*
28 * Return values for the 'vm86()' system call
29 */
30#define VM86_TYPE(retval) ((retval) & 0xff)
31#define VM86_ARG(retval) ((retval) >> 8)
32
33#define VM86_SIGNAL 0 /* return due to signal */
34#define VM86_UNKNOWN 1 /* unhandled GP fault
35 - IO-instruction or similar */
36#define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
37#define VM86_STI 3 /* sti/popf/iret instruction enabled
38 virtual interrupts */
39
40/*
41 * Additional return values when invoking new vm86()
42 */
43#define VM86_PICRETURN 4 /* return due to pending PIC request */
44#define VM86_TRAP 6 /* return due to DOS-debugger request */
45
46/*
47 * function codes when invoking new vm86()
48 */
49#define VM86_PLUS_INSTALL_CHECK 0
50#define VM86_ENTER 1
51#define VM86_ENTER_NO_BYPASS 2
52#define VM86_REQUEST_IRQ 3
53#define VM86_FREE_IRQ 4
54#define VM86_GET_IRQ_BITS 5
55#define VM86_GET_AND_RESET_IRQ 6
56
57/*
58 * This is the stack-layout seen by the user space program when we have
59 * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
60 * is 'kernel_vm86_regs' (see below).
61 */
62
63struct vm86_regs {
64/*
65 * normal regs, with special meaning for the segment descriptors..
66 */
67 long ebx;
68 long ecx;
69 long edx;
70 long esi;
71 long edi;
72 long ebp;
73 long eax;
74 long __null_ds;
75 long __null_es;
76 long __null_fs;
77 long __null_gs;
78 long orig_eax;
79 long eip;
80 unsigned short cs, __csh;
81 long eflags;
82 long esp;
83 unsigned short ss, __ssh;
84/*
85 * these are specific to v86 mode:
86 */
87 unsigned short es, __esh;
88 unsigned short ds, __dsh;
89 unsigned short fs, __fsh;
90 unsigned short gs, __gsh;
91};
92
93struct revectored_struct {
94 unsigned long __map[8]; /* 256 bits */
95};
96
97struct vm86_struct {
98 struct vm86_regs regs;
99 unsigned long flags;
100 unsigned long screen_bitmap; /* unused, preserved by vm86() */
101 unsigned long cpu_type;
102 struct revectored_struct int_revectored;
103 struct revectored_struct int21_revectored;
104};
105
106/*
107 * flags masks
108 */
109#define VM86_SCREEN_BITMAP 0x0001 /* no longer supported */
110
111struct vm86plus_info_struct {
112 unsigned long force_return_for_pic:1;
113 unsigned long vm86dbg_active:1; /* for debugger */
114 unsigned long vm86dbg_TFpendig:1; /* for debugger */
115 unsigned long unused:28;
116 unsigned long is_vm86pus:1; /* for vm86 internal use */
117 unsigned char vm86dbg_intxxtab[32]; /* for debugger */
118};
119struct vm86plus_struct {
120 struct vm86_regs regs;
121 unsigned long flags;
122 unsigned long screen_bitmap;
123 unsigned long cpu_type;
124 struct revectored_struct int_revectored;
125 struct revectored_struct int21_revectored;
126 struct vm86plus_info_struct vm86plus;
127};
128
129
130#endif /* _ASM_X86_VM86_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/vmx.h created+165
...@@ -0,0 +1,165 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * vmx.h: VMX Architecture related definitions
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 *
19 * A few random additions are:
20 * Copyright (C) 2006 Qumranet
21 * Avi Kivity <avi@qumranet.com>
22 * Yaniv Kamay <yaniv@qumranet.com>
23 *
24 */
25#ifndef VMX_H
26#define VMX_H
27
28
29#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
30#define VMX_EXIT_REASONS_SGX_ENCLAVE_MODE 0x08000000
31
32#define EXIT_REASON_EXCEPTION_NMI 0
33#define EXIT_REASON_EXTERNAL_INTERRUPT 1
34#define EXIT_REASON_TRIPLE_FAULT 2
35#define EXIT_REASON_INIT_SIGNAL 3
36#define EXIT_REASON_SIPI_SIGNAL 4
37
38#define EXIT_REASON_INTERRUPT_WINDOW 7
39#define EXIT_REASON_NMI_WINDOW 8
40#define EXIT_REASON_TASK_SWITCH 9
41#define EXIT_REASON_CPUID 10
42#define EXIT_REASON_HLT 12
43#define EXIT_REASON_INVD 13
44#define EXIT_REASON_INVLPG 14
45#define EXIT_REASON_RDPMC 15
46#define EXIT_REASON_RDTSC 16
47#define EXIT_REASON_VMCALL 18
48#define EXIT_REASON_VMCLEAR 19
49#define EXIT_REASON_VMLAUNCH 20
50#define EXIT_REASON_VMPTRLD 21
51#define EXIT_REASON_VMPTRST 22
52#define EXIT_REASON_VMREAD 23
53#define EXIT_REASON_VMRESUME 24
54#define EXIT_REASON_VMWRITE 25
55#define EXIT_REASON_VMOFF 26
56#define EXIT_REASON_VMON 27
57#define EXIT_REASON_CR_ACCESS 28
58#define EXIT_REASON_DR_ACCESS 29
59#define EXIT_REASON_IO_INSTRUCTION 30
60#define EXIT_REASON_MSR_READ 31
61#define EXIT_REASON_MSR_WRITE 32
62#define EXIT_REASON_INVALID_STATE 33
63#define EXIT_REASON_MSR_LOAD_FAIL 34
64#define EXIT_REASON_MWAIT_INSTRUCTION 36
65#define EXIT_REASON_MONITOR_TRAP_FLAG 37
66#define EXIT_REASON_MONITOR_INSTRUCTION 39
67#define EXIT_REASON_PAUSE_INSTRUCTION 40
68#define EXIT_REASON_MCE_DURING_VMENTRY 41
69#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
70#define EXIT_REASON_APIC_ACCESS 44
71#define EXIT_REASON_EOI_INDUCED 45
72#define EXIT_REASON_GDTR_IDTR 46
73#define EXIT_REASON_LDTR_TR 47
74#define EXIT_REASON_EPT_VIOLATION 48
75#define EXIT_REASON_EPT_MISCONFIG 49
76#define EXIT_REASON_INVEPT 50
77#define EXIT_REASON_RDTSCP 51
78#define EXIT_REASON_PREEMPTION_TIMER 52
79#define EXIT_REASON_INVVPID 53
80#define EXIT_REASON_WBINVD 54
81#define EXIT_REASON_XSETBV 55
82#define EXIT_REASON_APIC_WRITE 56
83#define EXIT_REASON_RDRAND 57
84#define EXIT_REASON_INVPCID 58
85#define EXIT_REASON_VMFUNC 59
86#define EXIT_REASON_ENCLS 60
87#define EXIT_REASON_RDSEED 61
88#define EXIT_REASON_PML_FULL 62
89#define EXIT_REASON_XSAVES 63
90#define EXIT_REASON_XRSTORS 64
91#define EXIT_REASON_UMWAIT 67
92#define EXIT_REASON_TPAUSE 68
93#define EXIT_REASON_BUS_LOCK 74
94
95#define VMX_EXIT_REASONS \
96 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
97 { EXIT_REASON_EXTERNAL_INTERRUPT, "EXTERNAL_INTERRUPT" }, \
98 { EXIT_REASON_TRIPLE_FAULT, "TRIPLE_FAULT" }, \
99 { EXIT_REASON_INIT_SIGNAL, "INIT_SIGNAL" }, \
100 { EXIT_REASON_SIPI_SIGNAL, "SIPI_SIGNAL" }, \
101 { EXIT_REASON_INTERRUPT_WINDOW, "INTERRUPT_WINDOW" }, \
102 { EXIT_REASON_NMI_WINDOW, "NMI_WINDOW" }, \
103 { EXIT_REASON_TASK_SWITCH, "TASK_SWITCH" }, \
104 { EXIT_REASON_CPUID, "CPUID" }, \
105 { EXIT_REASON_HLT, "HLT" }, \
106 { EXIT_REASON_INVD, "INVD" }, \
107 { EXIT_REASON_INVLPG, "INVLPG" }, \
108 { EXIT_REASON_RDPMC, "RDPMC" }, \
109 { EXIT_REASON_RDTSC, "RDTSC" }, \
110 { EXIT_REASON_VMCALL, "VMCALL" }, \
111 { EXIT_REASON_VMCLEAR, "VMCLEAR" }, \
112 { EXIT_REASON_VMLAUNCH, "VMLAUNCH" }, \
113 { EXIT_REASON_VMPTRLD, "VMPTRLD" }, \
114 { EXIT_REASON_VMPTRST, "VMPTRST" }, \
115 { EXIT_REASON_VMREAD, "VMREAD" }, \
116 { EXIT_REASON_VMRESUME, "VMRESUME" }, \
117 { EXIT_REASON_VMWRITE, "VMWRITE" }, \
118 { EXIT_REASON_VMOFF, "VMOFF" }, \
119 { EXIT_REASON_VMON, "VMON" }, \
120 { EXIT_REASON_CR_ACCESS, "CR_ACCESS" }, \
121 { EXIT_REASON_DR_ACCESS, "DR_ACCESS" }, \
122 { EXIT_REASON_IO_INSTRUCTION, "IO_INSTRUCTION" }, \
123 { EXIT_REASON_MSR_READ, "MSR_READ" }, \
124 { EXIT_REASON_MSR_WRITE, "MSR_WRITE" }, \
125 { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \
126 { EXIT_REASON_MSR_LOAD_FAIL, "MSR_LOAD_FAIL" }, \
127 { EXIT_REASON_MWAIT_INSTRUCTION, "MWAIT_INSTRUCTION" }, \
128 { EXIT_REASON_MONITOR_TRAP_FLAG, "MONITOR_TRAP_FLAG" }, \
129 { EXIT_REASON_MONITOR_INSTRUCTION, "MONITOR_INSTRUCTION" }, \
130 { EXIT_REASON_PAUSE_INSTRUCTION, "PAUSE_INSTRUCTION" }, \
131 { EXIT_REASON_MCE_DURING_VMENTRY, "MCE_DURING_VMENTRY" }, \
132 { EXIT_REASON_TPR_BELOW_THRESHOLD, "TPR_BELOW_THRESHOLD" }, \
133 { EXIT_REASON_APIC_ACCESS, "APIC_ACCESS" }, \
134 { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \
135 { EXIT_REASON_GDTR_IDTR, "GDTR_IDTR" }, \
136 { EXIT_REASON_LDTR_TR, "LDTR_TR" }, \
137 { EXIT_REASON_EPT_VIOLATION, "EPT_VIOLATION" }, \
138 { EXIT_REASON_EPT_MISCONFIG, "EPT_MISCONFIG" }, \
139 { EXIT_REASON_INVEPT, "INVEPT" }, \
140 { EXIT_REASON_RDTSCP, "RDTSCP" }, \
141 { EXIT_REASON_PREEMPTION_TIMER, "PREEMPTION_TIMER" }, \
142 { EXIT_REASON_INVVPID, "INVVPID" }, \
143 { EXIT_REASON_WBINVD, "WBINVD" }, \
144 { EXIT_REASON_XSETBV, "XSETBV" }, \
145 { EXIT_REASON_APIC_WRITE, "APIC_WRITE" }, \
146 { EXIT_REASON_RDRAND, "RDRAND" }, \
147 { EXIT_REASON_INVPCID, "INVPCID" }, \
148 { EXIT_REASON_VMFUNC, "VMFUNC" }, \
149 { EXIT_REASON_ENCLS, "ENCLS" }, \
150 { EXIT_REASON_RDSEED, "RDSEED" }, \
151 { EXIT_REASON_PML_FULL, "PML_FULL" }, \
152 { EXIT_REASON_XSAVES, "XSAVES" }, \
153 { EXIT_REASON_XRSTORS, "XRSTORS" }, \
154 { EXIT_REASON_UMWAIT, "UMWAIT" }, \
155 { EXIT_REASON_TPAUSE, "TPAUSE" }, \
156 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }
157
158#define VMX_EXIT_REASON_FLAGS \
159 { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }
160
161#define VMX_ABORT_SAVE_GUEST_MSR_FAIL 1
162#define VMX_ABORT_LOAD_HOST_PDPTE_FAIL 2
163#define VMX_ABORT_LOAD_HOST_MSR_FAIL 4
164
165#endif /* VMX_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/vsyscall.h created+13
...@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_VSYSCALL_H
3#define _ASM_X86_VSYSCALL_H
4
5enum vsyscall_num {
6 __NR_vgettimeofday,
7 __NR_vtime,
8 __NR_vgetcpu,
9};
10
11#define VSYSCALL_ADDR (-10UL << 20)
12
13#endif /* _ASM_X86_VSYSCALL_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/auxvec.h deleted-20
...@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_AUXVEC_H
3#define _ASM_X86_AUXVEC_H
4/*
5 * Architecture-neutral AT_ values in 0-17, leave some room
6 * for more of them, start the x86-specific ones at 32.
7 */
8#ifdef __i386__
9#define AT_SYSINFO 32
10#endif
11#define AT_SYSINFO_EHDR 33
12
13/* entries in ARCH_DLINFO: */
14#if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64)
15# define AT_VECTOR_SIZE_ARCH 2
16#else /* else it's non-compat x86-64 */
17# define AT_VECTOR_SIZE_ARCH 1
18#endif
19
20#endif /* _ASM_X86_AUXVEC_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/bitsperlong.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_BITSPERLONG_H
3#define __ASM_X86_BITSPERLONG_H
4
5#if defined(__x86_64__) && !defined(__ILP32__)
6# define __BITS_PER_LONG 64
7#else
8# define __BITS_PER_LONG 32
9#endif
10
11#include <asm-generic/bitsperlong.h>
12
13#endif /* __ASM_X86_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/byteorder.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_BYTEORDER_H
3#define _ASM_X86_BYTEORDER_H
4
5#include <linux/byteorder/little_endian.h>
6
7#endif /* _ASM_X86_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/kvm.h deleted-419
...@@ -1,419 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_H
3#define _ASM_X86_KVM_H
4
5/*
6 * KVM x86 specific structures and definitions
7 *
8 */
9
10#include <linux/types.h>
11#include <linux/ioctl.h>
12
13#define KVM_PIO_PAGE_OFFSET 1
14#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
15
16#define DE_VECTOR 0
17#define DB_VECTOR 1
18#define BP_VECTOR 3
19#define OF_VECTOR 4
20#define BR_VECTOR 5
21#define UD_VECTOR 6
22#define NM_VECTOR 7
23#define DF_VECTOR 8
24#define TS_VECTOR 10
25#define NP_VECTOR 11
26#define SS_VECTOR 12
27#define GP_VECTOR 13
28#define PF_VECTOR 14
29#define MF_VECTOR 16
30#define AC_VECTOR 17
31#define MC_VECTOR 18
32#define XM_VECTOR 19
33#define VE_VECTOR 20
34
35/* Select x86 specific features in <linux/kvm.h> */
36#define __KVM_HAVE_PIT
37#define __KVM_HAVE_IOAPIC
38#define __KVM_HAVE_IRQ_LINE
39#define __KVM_HAVE_MSI
40#define __KVM_HAVE_USER_NMI
41#define __KVM_HAVE_GUEST_DEBUG
42#define __KVM_HAVE_MSIX
43#define __KVM_HAVE_MCE
44#define __KVM_HAVE_PIT_STATE2
45#define __KVM_HAVE_XEN_HVM
46#define __KVM_HAVE_VCPU_EVENTS
47#define __KVM_HAVE_DEBUGREGS
48#define __KVM_HAVE_XSAVE
49#define __KVM_HAVE_XCRS
50#define __KVM_HAVE_READONLY_MEM
51
52/* Architectural interrupt line count. */
53#define KVM_NR_INTERRUPTS 256
54
55struct kvm_memory_alias {
56 __u32 slot; /* this has a different namespace than memory slots */
57 __u32 flags;
58 __u64 guest_phys_addr;
59 __u64 memory_size;
60 __u64 target_phys_addr;
61};
62
63/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
64struct kvm_pic_state {
65 __u8 last_irr; /* edge detection */
66 __u8 irr; /* interrupt request register */
67 __u8 imr; /* interrupt mask register */
68 __u8 isr; /* interrupt service register */
69 __u8 priority_add; /* highest irq priority */
70 __u8 irq_base;
71 __u8 read_reg_select;
72 __u8 poll;
73 __u8 special_mask;
74 __u8 init_state;
75 __u8 auto_eoi;
76 __u8 rotate_on_auto_eoi;
77 __u8 special_fully_nested_mode;
78 __u8 init4; /* true if 4 byte init */
79 __u8 elcr; /* PIIX edge/trigger selection */
80 __u8 elcr_mask;
81};
82
83#define KVM_IOAPIC_NUM_PINS 24
84struct kvm_ioapic_state {
85 __u64 base_address;
86 __u32 ioregsel;
87 __u32 id;
88 __u32 irr;
89 __u32 pad;
90 union {
91 __u64 bits;
92 struct {
93 __u8 vector;
94 __u8 delivery_mode:3;
95 __u8 dest_mode:1;
96 __u8 delivery_status:1;
97 __u8 polarity:1;
98 __u8 remote_irr:1;
99 __u8 trig_mode:1;
100 __u8 mask:1;
101 __u8 reserve:7;
102 __u8 reserved[4];
103 __u8 dest_id;
104 } fields;
105 } redirtbl[KVM_IOAPIC_NUM_PINS];
106};
107
108#define KVM_IRQCHIP_PIC_MASTER 0
109#define KVM_IRQCHIP_PIC_SLAVE 1
110#define KVM_IRQCHIP_IOAPIC 2
111#define KVM_NR_IRQCHIPS 3
112
113#define KVM_RUN_X86_SMM (1 << 0)
114
115/* for KVM_GET_REGS and KVM_SET_REGS */
116struct kvm_regs {
117 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
118 __u64 rax, rbx, rcx, rdx;
119 __u64 rsi, rdi, rsp, rbp;
120 __u64 r8, r9, r10, r11;
121 __u64 r12, r13, r14, r15;
122 __u64 rip, rflags;
123};
124
125/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
126#define KVM_APIC_REG_SIZE 0x400
127struct kvm_lapic_state {
128 char regs[KVM_APIC_REG_SIZE];
129};
130
131struct kvm_segment {
132 __u64 base;
133 __u32 limit;
134 __u16 selector;
135 __u8 type;
136 __u8 present, dpl, db, s, l, g, avl;
137 __u8 unusable;
138 __u8 padding;
139};
140
141struct kvm_dtable {
142 __u64 base;
143 __u16 limit;
144 __u16 padding[3];
145};
146
147
148/* for KVM_GET_SREGS and KVM_SET_SREGS */
149struct kvm_sregs {
150 /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
151 struct kvm_segment cs, ds, es, fs, gs, ss;
152 struct kvm_segment tr, ldt;
153 struct kvm_dtable gdt, idt;
154 __u64 cr0, cr2, cr3, cr4, cr8;
155 __u64 efer;
156 __u64 apic_base;
157 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
158};
159
160/* for KVM_GET_FPU and KVM_SET_FPU */
161struct kvm_fpu {
162 __u8 fpr[8][16];
163 __u16 fcw;
164 __u16 fsw;
165 __u8 ftwx; /* in fxsave format */
166 __u8 pad1;
167 __u16 last_opcode;
168 __u64 last_ip;
169 __u64 last_dp;
170 __u8 xmm[16][16];
171 __u32 mxcsr;
172 __u32 pad2;
173};
174
175struct kvm_msr_entry {
176 __u32 index;
177 __u32 reserved;
178 __u64 data;
179};
180
181/* for KVM_GET_MSRS and KVM_SET_MSRS */
182struct kvm_msrs {
183 __u32 nmsrs; /* number of msrs in entries */
184 __u32 pad;
185
186 struct kvm_msr_entry entries[0];
187};
188
189/* for KVM_GET_MSR_INDEX_LIST */
190struct kvm_msr_list {
191 __u32 nmsrs; /* number of msrs in entries */
192 __u32 indices[0];
193};
194
195
196struct kvm_cpuid_entry {
197 __u32 function;
198 __u32 eax;
199 __u32 ebx;
200 __u32 ecx;
201 __u32 edx;
202 __u32 padding;
203};
204
205/* for KVM_SET_CPUID */
206struct kvm_cpuid {
207 __u32 nent;
208 __u32 padding;
209 struct kvm_cpuid_entry entries[0];
210};
211
212struct kvm_cpuid_entry2 {
213 __u32 function;
214 __u32 index;
215 __u32 flags;
216 __u32 eax;
217 __u32 ebx;
218 __u32 ecx;
219 __u32 edx;
220 __u32 padding[3];
221};
222
223#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0)
224#define KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1)
225#define KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2)
226
227/* for KVM_SET_CPUID2 */
228struct kvm_cpuid2 {
229 __u32 nent;
230 __u32 padding;
231 struct kvm_cpuid_entry2 entries[0];
232};
233
234/* for KVM_GET_PIT and KVM_SET_PIT */
235struct kvm_pit_channel_state {
236 __u32 count; /* can be 65536 */
237 __u16 latched_count;
238 __u8 count_latched;
239 __u8 status_latched;
240 __u8 status;
241 __u8 read_state;
242 __u8 write_state;
243 __u8 write_latch;
244 __u8 rw_mode;
245 __u8 mode;
246 __u8 bcd;
247 __u8 gate;
248 __s64 count_load_time;
249};
250
251struct kvm_debug_exit_arch {
252 __u32 exception;
253 __u32 pad;
254 __u64 pc;
255 __u64 dr6;
256 __u64 dr7;
257};
258
259#define KVM_GUESTDBG_USE_SW_BP 0x00010000
260#define KVM_GUESTDBG_USE_HW_BP 0x00020000
261#define KVM_GUESTDBG_INJECT_DB 0x00040000
262#define KVM_GUESTDBG_INJECT_BP 0x00080000
263
264/* for KVM_SET_GUEST_DEBUG */
265struct kvm_guest_debug_arch {
266 __u64 debugreg[8];
267};
268
269struct kvm_pit_state {
270 struct kvm_pit_channel_state channels[3];
271};
272
273#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
274
275struct kvm_pit_state2 {
276 struct kvm_pit_channel_state channels[3];
277 __u32 flags;
278 __u32 reserved[9];
279};
280
281struct kvm_reinject_control {
282 __u8 pit_reinject;
283 __u8 reserved[31];
284};
285
286/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */
287#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001
288#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
289#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
290#define KVM_VCPUEVENT_VALID_SMM 0x00000008
291
292/* Interrupt shadow states */
293#define KVM_X86_SHADOW_INT_MOV_SS 0x01
294#define KVM_X86_SHADOW_INT_STI 0x02
295
296/* for KVM_GET/SET_VCPU_EVENTS */
297struct kvm_vcpu_events {
298 struct {
299 __u8 injected;
300 __u8 nr;
301 __u8 has_error_code;
302 __u8 pad;
303 __u32 error_code;
304 } exception;
305 struct {
306 __u8 injected;
307 __u8 nr;
308 __u8 soft;
309 __u8 shadow;
310 } interrupt;
311 struct {
312 __u8 injected;
313 __u8 pending;
314 __u8 masked;
315 __u8 pad;
316 } nmi;
317 __u32 sipi_vector;
318 __u32 flags;
319 struct {
320 __u8 smm;
321 __u8 pending;
322 __u8 smm_inside_nmi;
323 __u8 latched_init;
324 } smi;
325 __u32 reserved[9];
326};
327
328/* for KVM_GET/SET_DEBUGREGS */
329struct kvm_debugregs {
330 __u64 db[4];
331 __u64 dr6;
332 __u64 dr7;
333 __u64 flags;
334 __u64 reserved[9];
335};
336
337/* for KVM_CAP_XSAVE */
338struct kvm_xsave {
339 __u32 region[1024];
340};
341
342#define KVM_MAX_XCRS 16
343
344struct kvm_xcr {
345 __u32 xcr;
346 __u32 reserved;
347 __u64 value;
348};
349
350struct kvm_xcrs {
351 __u32 nr_xcrs;
352 __u32 flags;
353 struct kvm_xcr xcrs[KVM_MAX_XCRS];
354 __u64 padding[16];
355};
356
357#define KVM_SYNC_X86_REGS (1UL << 0)
358#define KVM_SYNC_X86_SREGS (1UL << 1)
359#define KVM_SYNC_X86_EVENTS (1UL << 2)
360
361#define KVM_SYNC_X86_VALID_FIELDS \
362 (KVM_SYNC_X86_REGS| \
363 KVM_SYNC_X86_SREGS| \
364 KVM_SYNC_X86_EVENTS)
365
366/* kvm_sync_regs struct included by kvm_run struct */
367struct kvm_sync_regs {
368 /* Members of this structure are potentially malicious.
369 * Care must be taken by code reading, esp. interpreting,
370 * data fields from them inside KVM to prevent TOCTOU and
371 * double-fetch types of vulnerabilities.
372 */
373 struct kvm_regs regs;
374 struct kvm_sregs sregs;
375 struct kvm_vcpu_events events;
376};
377
378#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
379#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
380#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
381
382#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
383#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
384
385#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
386#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
387
388struct kvm_vmx_nested_state {
389 __u64 vmxon_pa;
390 __u64 vmcs_pa;
391
392 struct {
393 __u16 flags;
394 } smm;
395};
396
397/* for KVM_CAP_NESTED_STATE */
398struct kvm_nested_state {
399 /* KVM_STATE_* flags */
400 __u16 flags;
401
402 /* 0 for VMX, 1 for SVM. */
403 __u16 format;
404
405 /* 128 for SVM, 128 + VMCS size for VMX. */
406 __u32 size;
407
408 union {
409 /* VMXON, VMCS */
410 struct kvm_vmx_nested_state vmx;
411
412 /* Pad the header to 128 bytes. */
413 __u8 pad[120];
414 };
415
416 __u8 data[0];
417};
418
419#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/kvm_para.h deleted-122
...@@ -1,122 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_KVM_PARA_H
3#define _ASM_X86_KVM_PARA_H
4
5#include <linux/types.h>
6
7/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
8 * should be used to determine that a VM is running under KVM.
9 */
10#define KVM_CPUID_SIGNATURE 0x40000000
11
12/* This CPUID returns two feature bitmaps in eax, edx. Before enabling
13 * a particular paravirtualization, the appropriate feature bit should
14 * be checked in eax. The performance hint feature bit should be checked
15 * in edx.
16 */
17#define KVM_CPUID_FEATURES 0x40000001
18#define KVM_FEATURE_CLOCKSOURCE 0
19#define KVM_FEATURE_NOP_IO_DELAY 1
20#define KVM_FEATURE_MMU_OP 2
21/* This indicates that the new set of kvmclock msrs
22 * are available. The use of 0x11 and 0x12 is deprecated
23 */
24#define KVM_FEATURE_CLOCKSOURCE2 3
25#define KVM_FEATURE_ASYNC_PF 4
26#define KVM_FEATURE_STEAL_TIME 5
27#define KVM_FEATURE_PV_EOI 6
28#define KVM_FEATURE_PV_UNHALT 7
29#define KVM_FEATURE_PV_TLB_FLUSH 9
30#define KVM_FEATURE_ASYNC_PF_VMEXIT 10
31#define KVM_FEATURE_PV_SEND_IPI 11
32
33#define KVM_HINTS_REALTIME 0
34
35/* The last 8 bits are used to indicate how to interpret the flags field
36 * in pvclock structure. If no bits are set, all flags are ignored.
37 */
38#define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 24
39
40#define MSR_KVM_WALL_CLOCK 0x11
41#define MSR_KVM_SYSTEM_TIME 0x12
42
43#define KVM_MSR_ENABLED 1
44/* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
45#define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00
46#define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
47#define MSR_KVM_ASYNC_PF_EN 0x4b564d02
48#define MSR_KVM_STEAL_TIME 0x4b564d03
49#define MSR_KVM_PV_EOI_EN 0x4b564d04
50
51struct kvm_steal_time {
52 __u64 steal;
53 __u32 version;
54 __u32 flags;
55 __u8 preempted;
56 __u8 u8_pad[3];
57 __u32 pad[11];
58};
59
60#define KVM_VCPU_PREEMPTED (1 << 0)
61#define KVM_VCPU_FLUSH_TLB (1 << 1)
62
63#define KVM_CLOCK_PAIRING_WALLCLOCK 0
64struct kvm_clock_pairing {
65 __s64 sec;
66 __s64 nsec;
67 __u64 tsc;
68 __u32 flags;
69 __u32 pad[9];
70};
71
72#define KVM_STEAL_ALIGNMENT_BITS 5
73#define KVM_STEAL_VALID_BITS ((-1ULL << (KVM_STEAL_ALIGNMENT_BITS + 1)))
74#define KVM_STEAL_RESERVED_MASK (((1 << KVM_STEAL_ALIGNMENT_BITS) - 1 ) << 1)
75
76#define KVM_MAX_MMU_OP_BATCH 32
77
78#define KVM_ASYNC_PF_ENABLED (1 << 0)
79#define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1)
80#define KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT (1 << 2)
81
82/* Operations for KVM_HC_MMU_OP */
83#define KVM_MMU_OP_WRITE_PTE 1
84#define KVM_MMU_OP_FLUSH_TLB 2
85#define KVM_MMU_OP_RELEASE_PT 3
86
87/* Payload for KVM_HC_MMU_OP */
88struct kvm_mmu_op_header {
89 __u32 op;
90 __u32 pad;
91};
92
93struct kvm_mmu_op_write_pte {
94 struct kvm_mmu_op_header header;
95 __u64 pte_phys;
96 __u64 pte_val;
97};
98
99struct kvm_mmu_op_flush_tlb {
100 struct kvm_mmu_op_header header;
101};
102
103struct kvm_mmu_op_release_pt {
104 struct kvm_mmu_op_header header;
105 __u64 pt_phys;
106};
107
108#define KVM_PV_REASON_PAGE_NOT_PRESENT 1
109#define KVM_PV_REASON_PAGE_READY 2
110
111struct kvm_vcpu_pv_apf_data {
112 __u32 reason;
113 __u8 pad[60];
114 __u32 enabled;
115};
116
117#define KVM_PV_EOI_BIT 0
118#define KVM_PV_EOI_MASK (0x1 << KVM_PV_EOI_BIT)
119#define KVM_PV_EOI_ENABLED KVM_PV_EOI_MASK
120#define KVM_PV_EOI_DISABLED 0x0
121
122#endif /* _ASM_X86_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/mman.h deleted-31
...@@ -1,31 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_MMAN_H
3#define _ASM_X86_MMAN_H
4
5#define MAP_32BIT 0x40 /* only give out 32bit addresses */
6
7#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8/*
9 * Take the 4 protection key bits out of the vma->vm_flags
10 * value and turn them in to the bits that we can put in
11 * to a pte.
12 *
13 * Only override these if Protection Keys are available
14 * (which is only on 64-bit).
15 */
16#define arch_vm_get_page_prot(vm_flags) __pgprot( \
17 ((vm_flags) & VM_PKEY_BIT0 ? _PAGE_PKEY_BIT0 : 0) | \
18 ((vm_flags) & VM_PKEY_BIT1 ? _PAGE_PKEY_BIT1 : 0) | \
19 ((vm_flags) & VM_PKEY_BIT2 ? _PAGE_PKEY_BIT2 : 0) | \
20 ((vm_flags) & VM_PKEY_BIT3 ? _PAGE_PKEY_BIT3 : 0))
21
22#define arch_calc_vm_prot_bits(prot, key) ( \
23 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
24 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
25 ((key) & 0x4 ? VM_PKEY_BIT2 : 0) | \
26 ((key) & 0x8 ? VM_PKEY_BIT3 : 0))
27#endif
28
29#include <asm-generic/mman.h>
30
31#endif /* _ASM_X86_MMAN_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/msgbuf.h deleted-32
...@@ -1,32 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X64_MSGBUF_H
3#define __ASM_X64_MSGBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/msgbuf.h>
7#else
8/*
9 * The msqid64_ds structure for x86 architecture with x32 ABI.
10 *
11 * On x86-32 and x86-64 we can just use the generic definition, but
12 * x32 uses the same binary layout as x86_64, which is differnet
13 * from other 32-bit architectures.
14 */
15
16struct msqid64_ds {
17 struct ipc64_perm msg_perm;
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */
22 __kernel_ulong_t msg_qnum; /* number of messages in queue */
23 __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */
24 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25 __kernel_pid_t msg_lrpid; /* last receive pid */
26 __kernel_ulong_t __unused4;
27 __kernel_ulong_t __unused5;
28};
29
30#endif
31
32#endif /* __ASM_GENERIC_MSGBUF_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/perf_regs.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PERF_REGS_H
3#define _ASM_X86_PERF_REGS_H
4
5enum perf_event_x86_regs {
6 PERF_REG_X86_AX,
7 PERF_REG_X86_BX,
8 PERF_REG_X86_CX,
9 PERF_REG_X86_DX,
10 PERF_REG_X86_SI,
11 PERF_REG_X86_DI,
12 PERF_REG_X86_BP,
13 PERF_REG_X86_SP,
14 PERF_REG_X86_IP,
15 PERF_REG_X86_FLAGS,
16 PERF_REG_X86_CS,
17 PERF_REG_X86_SS,
18 PERF_REG_X86_DS,
19 PERF_REG_X86_ES,
20 PERF_REG_X86_FS,
21 PERF_REG_X86_GS,
22 PERF_REG_X86_R8,
23 PERF_REG_X86_R9,
24 PERF_REG_X86_R10,
25 PERF_REG_X86_R11,
26 PERF_REG_X86_R12,
27 PERF_REG_X86_R13,
28 PERF_REG_X86_R14,
29 PERF_REG_X86_R15,
30
31 PERF_REG_X86_32_MAX = PERF_REG_X86_GS + 1,
32 PERF_REG_X86_64_MAX = PERF_REG_X86_R15 + 1,
33};
34#endif /* _ASM_X86_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/posix_types.h deleted-8
...@@ -1,8 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2# ifdef __i386__
3# include <asm/posix_types_32.h>
4# elif defined(__ILP32__)
5# include <asm/posix_types_x32.h>
6# else
7# include <asm/posix_types_64.h>
8# endif
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/ptrace.h deleted-82
...@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_PTRACE_H
3#define _ASM_X86_PTRACE_H
4
5 /* For */
6#include <asm/ptrace-abi.h>
7#include <asm/processor-flags.h>
8
9
10#ifndef __ASSEMBLY__
11
12#ifdef __i386__
13/* this struct defines the way the registers are stored on the
14 stack during a system call. */
15
16
17struct pt_regs {
18 long ebx;
19 long ecx;
20 long edx;
21 long esi;
22 long edi;
23 long ebp;
24 long eax;
25 int xds;
26 int xes;
27 int xfs;
28 int xgs;
29 long orig_eax;
30 long eip;
31 int xcs;
32 long eflags;
33 long esp;
34 int xss;
35};
36
37
38#else /* __i386__ */
39
40
41struct pt_regs {
42/*
43 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
44 * unless syscall needs a complete, fully filled "struct pt_regs".
45 */
46 unsigned long r15;
47 unsigned long r14;
48 unsigned long r13;
49 unsigned long r12;
50 unsigned long rbp;
51 unsigned long rbx;
52/* These regs are callee-clobbered. Always saved on kernel entry. */
53 unsigned long r11;
54 unsigned long r10;
55 unsigned long r9;
56 unsigned long r8;
57 unsigned long rax;
58 unsigned long rcx;
59 unsigned long rdx;
60 unsigned long rsi;
61 unsigned long rdi;
62/*
63 * On syscall entry, this is syscall#. On CPU exception, this is error code.
64 * On hw interrupt, it's IRQ number:
65 */
66 unsigned long orig_rax;
67/* Return frame for iretq */
68 unsigned long rip;
69 unsigned long cs;
70 unsigned long eflags;
71 unsigned long rsp;
72 unsigned long ss;
73/* top of stack page */
74};
75
76#endif /* !__i386__ */
77
78
79
80#endif /* !__ASSEMBLY__ */
81
82#endif /* _ASM_X86_PTRACE_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/sembuf.h deleted-34
...@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SEMBUF_H
3#define _ASM_X86_SEMBUF_H
4
5/*
6 * The semid64_ds structure for x86 architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for:
11 * - 2 miscellaneous 32-bit values
12 *
13 * x86_64 and x32 incorrectly added padding here, so the structures
14 * are still incompatible with the padding on x86.
15 */
16struct semid64_ds {
17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
18#ifdef __i386__
19 unsigned long sem_otime; /* last semop time */
20 unsigned long sem_otime_high;
21 unsigned long sem_ctime; /* last change time */
22 unsigned long sem_ctime_high;
23#else
24 __kernel_time_t sem_otime; /* last semop time */
25 __kernel_ulong_t __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 __kernel_ulong_t __unused2;
28#endif
29 __kernel_ulong_t sem_nsems; /* no. of semaphores in array */
30 __kernel_ulong_t __unused3;
31 __kernel_ulong_t __unused4;
32};
33
34#endif /* _ASM_X86_SEMBUF_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/setup.h deleted-1
...@@ -1 +0,0 @@
1/* */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/shmbuf.h deleted-43
...@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_X86_SHMBUF_H
3#define __ASM_X86_SHMBUF_H
4
5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/shmbuf.h>
7#else
8/*
9 * The shmid64_ds structure for x86 architecture with x32 ABI.
10 *
11 * On x86-32 and x86-64 we can just use the generic definition, but
12 * x32 uses the same binary layout as x86_64, which is differnet
13 * from other 32-bit architectures.
14 */
15
16struct shmid64_ds {
17 struct ipc64_perm shm_perm; /* operation perms */
18 size_t shm_segsz; /* size of segment (bytes) */
19 __kernel_time_t shm_atime; /* last attach time */
20 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
22 __kernel_pid_t shm_cpid; /* pid of creator */
23 __kernel_pid_t shm_lpid; /* pid of last operator */
24 __kernel_ulong_t shm_nattch; /* no. of current attaches */
25 __kernel_ulong_t __unused4;
26 __kernel_ulong_t __unused5;
27};
28
29struct shminfo64 {
30 __kernel_ulong_t shmmax;
31 __kernel_ulong_t shmmin;
32 __kernel_ulong_t shmmni;
33 __kernel_ulong_t shmseg;
34 __kernel_ulong_t shmall;
35 __kernel_ulong_t __unused1;
36 __kernel_ulong_t __unused2;
37 __kernel_ulong_t __unused3;
38 __kernel_ulong_t __unused4;
39};
40
41#endif
42
43#endif /* __ASM_X86_SHMBUF_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/sigcontext.h deleted-380
...@@ -1,380 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGCONTEXT_H
3#define _ASM_X86_SIGCONTEXT_H
4
5/*
6 * Linux signal context definitions. The sigcontext includes a complex
7 * hierarchy of CPU and FPU state, available to user-space (on the stack) when
8 * a signal handler is executed.
9 *
10 * As over the years this ABI grew from its very simple roots towards
11 * supporting more and more CPU state organically, some of the details (which
12 * were rather clever hacks back in the days) became a bit quirky by today.
13 *
14 * The current ABI includes flexible provisions for future extensions, so we
15 * won't have to grow new quirks for quite some time. Promise!
16 */
17
18
19#include <linux/types.h>
20
21#define FP_XSTATE_MAGIC1 0x46505853U
22#define FP_XSTATE_MAGIC2 0x46505845U
23#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
24
25/*
26 * Bytes 464..511 in the current 512-byte layout of the FXSAVE/FXRSTOR frame
27 * are reserved for SW usage. On CPUs supporting XSAVE/XRSTOR, these bytes are
28 * used to extend the fpstate pointer in the sigcontext, which now includes the
29 * extended state information along with fpstate information.
30 *
31 * If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then there's a
32 * sw_reserved.extended_size bytes large extended context area present. (The
33 * last 32-bit word of this extended area (at the
34 * fpstate+extended_size-FP_XSTATE_MAGIC2_SIZE address) is set to
35 * FP_XSTATE_MAGIC2 so that you can sanity check your size calculations.)
36 *
37 * This extended area typically grows with newer CPUs that have larger and
38 * larger XSAVE areas.
39 */
40struct _fpx_sw_bytes {
41 /*
42 * If set to FP_XSTATE_MAGIC1 then this is an xstate context.
43 * 0 if a legacy frame.
44 */
45 __u32 magic1;
46
47 /*
48 * Total size of the fpstate area:
49 *
50 * - if magic1 == 0 then it's sizeof(struct _fpstate)
51 * - if magic1 == FP_XSTATE_MAGIC1 then it's sizeof(struct _xstate)
52 * plus extensions (if any)
53 */
54 __u32 extended_size;
55
56 /*
57 * Feature bit mask (including FP/SSE/extended state) that is present
58 * in the memory layout:
59 */
60 __u64 xfeatures;
61
62 /*
63 * Actual XSAVE state size, based on the xfeatures saved in the layout.
64 * 'extended_size' is greater than 'xstate_size':
65 */
66 __u32 xstate_size;
67
68 /* For future use: */
69 __u32 padding[7];
70};
71
72/*
73 * As documented in the iBCS2 standard:
74 *
75 * The first part of "struct _fpstate" is just the normal i387 hardware setup,
76 * the extra "status" word is used to save the coprocessor status word before
77 * entering the handler.
78 *
79 * The FPU state data structure has had to grow to accommodate the extended FPU
80 * state required by the Streaming SIMD Extensions. There is no documented
81 * standard to accomplish this at the moment.
82 */
83
84/* 10-byte legacy floating point register: */
85struct _fpreg {
86 __u16 significand[4];
87 __u16 exponent;
88};
89
90/* 16-byte floating point register: */
91struct _fpxreg {
92 __u16 significand[4];
93 __u16 exponent;
94 __u16 padding[3];
95};
96
97/* 16-byte XMM register: */
98struct _xmmreg {
99 __u32 element[4];
100};
101
102#define X86_FXSR_MAGIC 0x0000
103
104/*
105 * The 32-bit FPU frame:
106 */
107struct _fpstate_32 {
108 /* Legacy FPU environment: */
109 __u32 cw;
110 __u32 sw;
111 __u32 tag;
112 __u32 ipoff;
113 __u32 cssel;
114 __u32 dataoff;
115 __u32 datasel;
116 struct _fpreg _st[8];
117 __u16 status;
118 __u16 magic; /* 0xffff: regular FPU data only */
119 /* 0x0000: FXSR FPU data */
120
121 /* FXSR FPU environment */
122 __u32 _fxsr_env[6]; /* FXSR FPU env is ignored */
123 __u32 mxcsr;
124 __u32 reserved;
125 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
126 struct _xmmreg _xmm[8]; /* First 8 XMM registers */
127 union {
128 __u32 padding1[44]; /* Second 8 XMM registers plus padding */
129 __u32 padding[44]; /* Alias name for old user-space */
130 };
131
132 union {
133 __u32 padding2[12];
134 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
135 };
136};
137
138/*
139 * The 64-bit FPU frame. (FXSAVE format and later)
140 *
141 * Note1: If sw_reserved.magic1 == FP_XSTATE_MAGIC1 then the structure is
142 * larger: 'struct _xstate'. Note that 'struct _xstate' embedds
143 * 'struct _fpstate' so that you can always assume the _fpstate portion
144 * exists so that you can check the magic value.
145 *
146 * Note2: Reserved fields may someday contain valuable data. Always
147 * save/restore them when you change signal frames.
148 */
149struct _fpstate_64 {
150 __u16 cwd;
151 __u16 swd;
152 /* Note this is not the same as the 32-bit/x87/FSAVE twd: */
153 __u16 twd;
154 __u16 fop;
155 __u64 rip;
156 __u64 rdp;
157 __u32 mxcsr;
158 __u32 mxcsr_mask;
159 __u32 st_space[32]; /* 8x FP registers, 16 bytes each */
160 __u32 xmm_space[64]; /* 16x XMM registers, 16 bytes each */
161 __u32 reserved2[12];
162 union {
163 __u32 reserved3[12];
164 struct _fpx_sw_bytes sw_reserved; /* Potential extended state is encoded here */
165 };
166};
167
168#ifdef __i386__
169# define _fpstate _fpstate_32
170#else
171# define _fpstate _fpstate_64
172#endif
173
174struct _header {
175 __u64 xfeatures;
176 __u64 reserved1[2];
177 __u64 reserved2[5];
178};
179
180struct _ymmh_state {
181 /* 16x YMM registers, 16 bytes each: */
182 __u32 ymmh_space[64];
183};
184
185/*
186 * Extended state pointed to by sigcontext::fpstate.
187 *
188 * In addition to the fpstate, information encoded in _xstate::xstate_hdr
189 * indicates the presence of other extended state information supported
190 * by the CPU and kernel:
191 */
192struct _xstate {
193 struct _fpstate fpstate;
194 struct _header xstate_hdr;
195 struct _ymmh_state ymmh;
196 /* New processor state extensions go here: */
197};
198
199/*
200 * The 32-bit signal frame:
201 */
202struct sigcontext_32 {
203 __u16 gs, __gsh;
204 __u16 fs, __fsh;
205 __u16 es, __esh;
206 __u16 ds, __dsh;
207 __u32 di;
208 __u32 si;
209 __u32 bp;
210 __u32 sp;
211 __u32 bx;
212 __u32 dx;
213 __u32 cx;
214 __u32 ax;
215 __u32 trapno;
216 __u32 err;
217 __u32 ip;
218 __u16 cs, __csh;
219 __u32 flags;
220 __u32 sp_at_signal;
221 __u16 ss, __ssh;
222
223 /*
224 * fpstate is really (struct _fpstate *) or (struct _xstate *)
225 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
226 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
227 * of extended memory layout. See comments at the definition of
228 * (struct _fpx_sw_bytes)
229 */
230 __u32 fpstate; /* Zero when no FPU/extended context */
231 __u32 oldmask;
232 __u32 cr2;
233};
234
235/*
236 * The 64-bit signal frame:
237 */
238struct sigcontext_64 {
239 __u64 r8;
240 __u64 r9;
241 __u64 r10;
242 __u64 r11;
243 __u64 r12;
244 __u64 r13;
245 __u64 r14;
246 __u64 r15;
247 __u64 di;
248 __u64 si;
249 __u64 bp;
250 __u64 bx;
251 __u64 dx;
252 __u64 ax;
253 __u64 cx;
254 __u64 sp;
255 __u64 ip;
256 __u64 flags;
257 __u16 cs;
258 __u16 gs;
259 __u16 fs;
260 __u16 ss;
261 __u64 err;
262 __u64 trapno;
263 __u64 oldmask;
264 __u64 cr2;
265
266 /*
267 * fpstate is really (struct _fpstate *) or (struct _xstate *)
268 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
269 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
270 * of extended memory layout. See comments at the definition of
271 * (struct _fpx_sw_bytes)
272 */
273 __u64 fpstate; /* Zero when no FPU/extended context */
274 __u64 reserved1[8];
275};
276
277/*
278 * Create the real 'struct sigcontext' type:
279 */
280
281/*
282 * The old user-space sigcontext definition, just in case user-space still
283 * relies on it. The kernel definition (in asm/sigcontext.h) has unified
284 * field names but otherwise the same layout.
285 */
286
287#define _fpstate_ia32 _fpstate_32
288#define sigcontext_ia32 sigcontext_32
289
290
291# ifdef __i386__
292struct sigcontext {
293 __u16 gs, __gsh;
294 __u16 fs, __fsh;
295 __u16 es, __esh;
296 __u16 ds, __dsh;
297 __u32 edi;
298 __u32 esi;
299 __u32 ebp;
300 __u32 esp;
301 __u32 ebx;
302 __u32 edx;
303 __u32 ecx;
304 __u32 eax;
305 __u32 trapno;
306 __u32 err;
307 __u32 eip;
308 __u16 cs, __csh;
309 __u32 eflags;
310 __u32 esp_at_signal;
311 __u16 ss, __ssh;
312 struct _fpstate *fpstate;
313 __u32 oldmask;
314 __u32 cr2;
315};
316# else /* __x86_64__: */
317struct sigcontext {
318 __u64 r8;
319 __u64 r9;
320 __u64 r10;
321 __u64 r11;
322 __u64 r12;
323 __u64 r13;
324 __u64 r14;
325 __u64 r15;
326 __u64 rdi;
327 __u64 rsi;
328 __u64 rbp;
329 __u64 rbx;
330 __u64 rdx;
331 __u64 rax;
332 __u64 rcx;
333 __u64 rsp;
334 __u64 rip;
335 __u64 eflags; /* RFLAGS */
336 __u16 cs;
337
338 /*
339 * Prior to 2.5.64 ("[PATCH] x86-64 updates for 2.5.64-bk3"),
340 * Linux saved and restored fs and gs in these slots. This
341 * was counterproductive, as fsbase and gsbase were never
342 * saved, so arch_prctl was presumably unreliable.
343 *
344 * These slots should never be reused without extreme caution:
345 *
346 * - Some DOSEMU versions stash fs and gs in these slots manually,
347 * thus overwriting anything the kernel expects to be preserved
348 * in these slots.
349 *
350 * - If these slots are ever needed for any other purpose,
351 * there is some risk that very old 64-bit binaries could get
352 * confused. I doubt that many such binaries still work,
353 * though, since the same patch in 2.5.64 also removed the
354 * 64-bit set_thread_area syscall, so it appears that there
355 * is no TLS API beyond modify_ldt that works in both pre-
356 * and post-2.5.64 kernels.
357 *
358 * If the kernel ever adds explicit fs, gs, fsbase, and gsbase
359 * save/restore, it will most likely need to be opt-in and use
360 * different context slots.
361 */
362 __u16 gs;
363 __u16 fs;
364 union {
365 __u16 ss; /* If UC_SIGCONTEXT_SS */
366 __u16 __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */
367 };
368 __u64 err;
369 __u64 trapno;
370 __u64 oldmask;
371 __u64 cr2;
372 struct _fpstate *fpstate; /* Zero when no FPU context */
373# ifdef __ILP32__
374 __u32 __fpstate_pad;
375# endif
376 __u64 reserved1[8];
377};
378# endif /* __x86_64__ */
379
380#endif /* _ASM_X86_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/siginfo.h deleted-17
...@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGINFO_H
3#define _ASM_X86_SIGINFO_H
4
5#ifdef __x86_64__
6# ifdef __ILP32__ /* x32 */
7typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
8# define __ARCH_SI_CLOCK_T __kernel_si_clock_t
9# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
10# else /* x86-64 */
11# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
12# endif
13#endif
14
15#include <asm-generic/siginfo.h>
16
17#endif /* _ASM_X86_SIGINFO_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/signal.h deleted-132
...@@ -1,132 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SIGNAL_H
3#define _ASM_X86_SIGNAL_H
4
5#ifndef __ASSEMBLY__
6#include <linux/types.h>
7#include <linux/time.h>
8
9
10/* Avoid too many header ordering problems. */
11struct siginfo;
12
13/* Here we must cater to libcs that poke about in kernel headers. */
14
15#define NSIG 32
16typedef unsigned long sigset_t;
17
18#endif /* __ASSEMBLY__ */
19
20
21#define SIGHUP 1
22#define SIGINT 2
23#define SIGQUIT 3
24#define SIGILL 4
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28#define SIGBUS 7
29#define SIGFPE 8
30#define SIGKILL 9
31#define SIGUSR1 10
32#define SIGSEGV 11
33#define SIGUSR2 12
34#define SIGPIPE 13
35#define SIGALRM 14
36#define SIGTERM 15
37#define SIGSTKFLT 16
38#define SIGCHLD 17
39#define SIGCONT 18
40#define SIGSTOP 19
41#define SIGTSTP 20
42#define SIGTTIN 21
43#define SIGTTOU 22
44#define SIGURG 23
45#define SIGXCPU 24
46#define SIGXFSZ 25
47#define SIGVTALRM 26
48#define SIGPROF 27
49#define SIGWINCH 28
50#define SIGIO 29
51#define SIGPOLL SIGIO
52/*
53#define SIGLOST 29
54*/
55#define SIGPWR 30
56#define SIGSYS 31
57#define SIGUNUSED 31
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK indicates that a registered stack_t will be used.
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_NOCLDSTOP 0x00000001u
77#define SA_NOCLDWAIT 0x00000002u
78#define SA_SIGINFO 0x00000004u
79#define SA_ONSTACK 0x08000000u
80#define SA_RESTART 0x10000000u
81#define SA_NODEFER 0x40000000u
82#define SA_RESETHAND 0x80000000u
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000
88
89#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192
91
92#include <asm-generic/signal-defs.h>
93
94#ifndef __ASSEMBLY__
95
96
97/* Here we must cater to libcs that poke about in kernel headers. */
98#ifdef __i386__
99
100struct sigaction {
101 union {
102 __sighandler_t _sa_handler;
103 void (*_sa_sigaction)(int, struct siginfo *, void *);
104 } _u;
105 sigset_t sa_mask;
106 unsigned long sa_flags;
107 void (*sa_restorer)(void);
108};
109
110#define sa_handler _u._sa_handler
111#define sa_sigaction _u._sa_sigaction
112
113#else /* __i386__ */
114
115struct sigaction {
116 __sighandler_t sa_handler;
117 unsigned long sa_flags;
118 __sigrestore_t sa_restorer;
119 sigset_t sa_mask; /* mask last for extensibility */
120};
121
122#endif /* !__i386__ */
123
124typedef struct sigaltstack {
125 void *ss_sp;
126 int ss_flags;
127 size_t ss_size;
128} stack_t;
129
130#endif /* __ASSEMBLY__ */
131
132#endif /* _ASM_X86_SIGNAL_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/stat.h deleted-138
...@@ -1,138 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STAT_H
3#define _ASM_X86_STAT_H
4
5#include <asm/posix_types.h>
6
7#define STAT_HAVE_NSEC 1
8
9#ifdef __i386__
10struct stat {
11 unsigned long st_dev;
12 unsigned long st_ino;
13 unsigned short st_mode;
14 unsigned short st_nlink;
15 unsigned short st_uid;
16 unsigned short st_gid;
17 unsigned long st_rdev;
18 unsigned long st_size;
19 unsigned long st_blksize;
20 unsigned long st_blocks;
21 unsigned long st_atime;
22 unsigned long st_atime_nsec;
23 unsigned long st_mtime;
24 unsigned long st_mtime_nsec;
25 unsigned long st_ctime;
26 unsigned long st_ctime_nsec;
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31/* We don't need to memset the whole thing just to initialize the padding */
32#define INIT_STRUCT_STAT_PADDING(st) do { \
33 st.__unused4 = 0; \
34 st.__unused5 = 0; \
35} while (0)
36
37#define STAT64_HAS_BROKEN_ST_INO 1
38
39/* This matches struct stat64 in glibc2.1, hence the absolutely
40 * insane amounts of padding around dev_t's.
41 */
42struct stat64 {
43 unsigned long long st_dev;
44 unsigned char __pad0[4];
45
46 unsigned long __st_ino;
47
48 unsigned int st_mode;
49 unsigned int st_nlink;
50
51 unsigned long st_uid;
52 unsigned long st_gid;
53
54 unsigned long long st_rdev;
55 unsigned char __pad3[4];
56
57 long long st_size;
58 unsigned long st_blksize;
59
60 /* Number 512-byte blocks allocated. */
61 unsigned long long st_blocks;
62
63 unsigned long st_atime;
64 unsigned long st_atime_nsec;
65
66 unsigned long st_mtime;
67 unsigned int st_mtime_nsec;
68
69 unsigned long st_ctime;
70 unsigned long st_ctime_nsec;
71
72 unsigned long long st_ino;
73};
74
75/* We don't need to memset the whole thing just to initialize the padding */
76#define INIT_STRUCT_STAT64_PADDING(st) do { \
77 memset(&st.__pad0, 0, sizeof(st.__pad0)); \
78 memset(&st.__pad3, 0, sizeof(st.__pad3)); \
79} while (0)
80
81#else /* __i386__ */
82
83struct stat {
84 __kernel_ulong_t st_dev;
85 __kernel_ulong_t st_ino;
86 __kernel_ulong_t st_nlink;
87
88 unsigned int st_mode;
89 unsigned int st_uid;
90 unsigned int st_gid;
91 unsigned int __pad0;
92 __kernel_ulong_t st_rdev;
93 __kernel_long_t st_size;
94 __kernel_long_t st_blksize;
95 __kernel_long_t st_blocks; /* Number 512-byte blocks allocated. */
96
97 __kernel_ulong_t st_atime;
98 __kernel_ulong_t st_atime_nsec;
99 __kernel_ulong_t st_mtime;
100 __kernel_ulong_t st_mtime_nsec;
101 __kernel_ulong_t st_ctime;
102 __kernel_ulong_t st_ctime_nsec;
103 __kernel_long_t __unused[3];
104};
105
106/* We don't need to memset the whole thing just to initialize the padding */
107#define INIT_STRUCT_STAT_PADDING(st) do { \
108 st.__pad0 = 0; \
109 st.__unused[0] = 0; \
110 st.__unused[1] = 0; \
111 st.__unused[2] = 0; \
112} while (0)
113
114#endif
115
116/* for 32bit emulation and 32 bit kernels */
117struct __old_kernel_stat {
118 unsigned short st_dev;
119 unsigned short st_ino;
120 unsigned short st_mode;
121 unsigned short st_nlink;
122 unsigned short st_uid;
123 unsigned short st_gid;
124 unsigned short st_rdev;
125#ifdef __i386__
126 unsigned long st_size;
127 unsigned long st_atime;
128 unsigned long st_mtime;
129 unsigned long st_ctime;
130#else
131 unsigned int st_size;
132 unsigned int st_atime;
133 unsigned int st_mtime;
134 unsigned int st_ctime;
135#endif
136};
137
138#endif /* _ASM_X86_STAT_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/statfs.h deleted-13
...@@ -1,13 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_STATFS_H
3#define _ASM_X86_STATFS_H
4
5/*
6 * We need compat_statfs64 to be packed, because the i386 ABI won't
7 * add padding at the end to bring it to a multiple of 8 bytes, but
8 * the x86_64 ABI will.
9 */
10#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
11
12#include <asm-generic/statfs.h>
13#endif /* _ASM_X86_STATFS_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/swab.h deleted-37
...@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SWAB_H
3#define _ASM_X86_SWAB_H
4
5#include <linux/types.h>
6
7
8static __inline__ __u32 __arch_swab32(__u32 val)
9{
10 __asm__("bswapl %0" : "=r" (val) : "0" (val));
11 return val;
12}
13#define __arch_swab32 __arch_swab32
14
15static __inline__ __u64 __arch_swab64(__u64 val)
16{
17#ifdef __i386__
18 union {
19 struct {
20 __u32 a;
21 __u32 b;
22 } s;
23 __u64 u;
24 } v;
25 v.u = val;
26 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
27 : "=r" (v.s.a), "=r" (v.s.b)
28 : "0" (v.s.a), "1" (v.s.b));
29 return v.u;
30#else /* __i386__ */
31 __asm__("bswapq %0" : "=r" (val) : "0" (val));
32 return val;
33#endif
34}
35#define __arch_swab64 __arch_swab64
36
37#endif /* _ASM_X86_SWAB_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/types.h deleted-7
...@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_TYPES_H
3#define _ASM_X86_TYPES_H
4
5#include <asm-generic/types.h>
6
7#endif /* _ASM_X86_TYPES_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/ucontext.h deleted-56
...@@ -1,56 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UCONTEXT_H
3#define _ASM_X86_UCONTEXT_H
4
5/*
6 * Indicates the presence of extended state information in the memory
7 * layout pointed by the fpstate pointer in the ucontext's sigcontext
8 * struct (uc_mcontext).
9 */
10#define UC_FP_XSTATE 0x1
11
12#ifdef __x86_64__
13/*
14 * UC_SIGCONTEXT_SS will be set when delivering 64-bit or x32 signals on
15 * kernels that save SS in the sigcontext. All kernels that set
16 * UC_SIGCONTEXT_SS will correctly restore at least the low 32 bits of esp
17 * regardless of SS (i.e. they implement espfix).
18 *
19 * Kernels that set UC_SIGCONTEXT_SS will also set UC_STRICT_RESTORE_SS
20 * when delivering a signal that came from 64-bit code.
21 *
22 * Sigreturn restores SS as follows:
23 *
24 * if (saved SS is valid || UC_STRICT_RESTORE_SS is set ||
25 * saved CS is not 64-bit)
26 * new SS = saved SS (will fail IRET and signal if invalid)
27 * else
28 * new SS = a flat 32-bit data segment
29 *
30 * This behavior serves three purposes:
31 *
32 * - Legacy programs that construct a 64-bit sigcontext from scratch
33 * with zero or garbage in the SS slot (e.g. old CRIU) and call
34 * sigreturn will still work.
35 *
36 * - Old DOSEMU versions sometimes catch a signal from a segmented
37 * context, delete the old SS segment (with modify_ldt), and change
38 * the saved CS to a 64-bit segment. These DOSEMU versions expect
39 * sigreturn to send them back to 64-bit mode without killing them,
40 * despite the fact that the SS selector when the signal was raised is
41 * no longer valid. UC_STRICT_RESTORE_SS will be clear, so the kernel
42 * will fix up SS for these DOSEMU versions.
43 *
44 * - Old and new programs that catch a signal and return without
45 * modifying the saved context will end up in exactly the state they
46 * started in, even if they were running in a segmented context when
47 * the signal was raised.. Old kernels would lose track of the
48 * previous SS value.
49 */
50#define UC_SIGCONTEXT_SS 0x2
51#define UC_STRICT_RESTORE_SS 0x4
52#endif
53
54#include <asm-generic/ucontext.h>
55
56#endif /* _ASM_X86_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-any/asm/unistd.h deleted-16
...@@ -1,16 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_UNISTD_H
3#define _ASM_X86_UNISTD_H
4
5/* x32 syscall flag bit */
6#define __X32_SYSCALL_BIT 0x40000000
7
8# ifdef __i386__
9# include <asm/unistd_32.h>
10# elif defined(__ILP32__)
11# include <asm/unistd_x32.h>
12# else
13# include <asm/unistd_64.h>
14# endif
15
16#endif /* _ASM_X86_UNISTD_H */
\ No newline at end of file
src/Compilation.zig+2-1
...@@ -3886,10 +3886,11 @@ fn detectLibCIncludeDirs(...@@ -3886,10 +3886,11 @@ fn detectLibCIncludeDirs(
3886 "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "generic-{s}",3886 "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "generic-{s}",
3887 .{ zig_lib_dir, generic_name },3887 .{ zig_lib_dir, generic_name },
3888 );3888 );
3889 const generic_arch_name = target_util.osArchName(target);
3889 const arch_os_include_dir = try std.fmt.allocPrint(3890 const arch_os_include_dir = try std.fmt.allocPrint(
3890 arena,3891 arena,
3891 "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "{s}-{s}-any",3892 "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "{s}-{s}-any",
3892 .{ zig_lib_dir, @tagName(target.cpu.arch), os_name },3893 .{ zig_lib_dir, generic_arch_name, os_name },
3893 );3894 );
3894 const generic_os_include_dir = try std.fmt.allocPrint(3895 const generic_os_include_dir = try std.fmt.allocPrint(
3895 arena,3896 arena,
src/glibc.zig+2-1
...@@ -555,9 +555,10 @@ fn add_include_dirs(comp: *Compilation, arena: *Allocator, args: *std.ArrayList(...@@ -555,9 +555,10 @@ fn add_include_dirs(comp: *Compilation, arena: *Allocator, args: *std.ArrayList(
555 try args.append("-I");555 try args.append("-I");
556 try args.append(try lib_path(comp, arena, lib_libc ++ "include" ++ s ++ "generic-glibc"));556 try args.append(try lib_path(comp, arena, lib_libc ++ "include" ++ s ++ "generic-glibc"));
557557
558 const arch_name = target_util.osArchName(target);
558 try args.append("-I");559 try args.append("-I");
559 try args.append(try std.fmt.allocPrint(arena, "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "{s}-linux-any", .{560 try args.append(try std.fmt.allocPrint(arena, "{s}" ++ s ++ "libc" ++ s ++ "include" ++ s ++ "{s}-linux-any", .{
560 comp.zig_lib_directory.path.?, @tagName(arch),561 comp.zig_lib_directory.path.?, arch_name,
561 }));562 }));
562563
563 try args.append("-I");564 try args.append("-I");
src/target.zig+16
...@@ -106,6 +106,22 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {...@@ -106,6 +106,22 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {
106 }106 }
107}107}
108108
109pub fn osArchName(target: std.Target) [:0]const u8 {
110 return switch (target.os.tag) {
111 .linux => switch (target.cpu.arch) {
112 .arm, .armeb, .thumb, .thumbeb => "arm",
113 .aarch64, .aarch64_be, .aarch64_32 => "arm64",
114 .mips, .mipsel, .mips64, .mips64el => "mips",
115 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",
116 .riscv32, .riscv64 => "riscv",
117 .sparc, .sparcel, .sparcv9 => "sparc",
118 .i386, .x86_64 => "x86",
119 else => @tagName(target.cpu.arch),
120 },
121 else => @tagName(target.cpu.arch),
122 };
123}
124
109pub fn canBuildLibC(target: std.Target) bool {125pub fn canBuildLibC(target: std.Target) bool {
110 for (available_libcs) |libc| {126 for (available_libcs) |libc| {
111 if (target.cpu.arch == libc.arch and target.os.tag == libc.os and target.abi == libc.abi) {127 if (target.cpu.arch == libc.arch and target.os.tag == libc.os and target.abi == libc.abi) {
tools/update-linux-headers.zig created+305
...@@ -0,0 +1,305 @@
1//! To get started, run this tool with no args and read the help message.
2//!
3//! The build system of Linux requires specifying a single target
4//! architecture. Meanwhile, Zig supports out-of-the-box cross compilation for
5//! every target. So the process to create libc headers that Zig ships is to use
6//! this tool.
7//!
8//! First, use the Linux build systems to create installations of all the
9//! targets in the `linux_targets` variable.
10//!
11//! Next, run this tool to create a new directory which puts .h files into
12//! <arch> subdirectories, with `any-linux-any` being files that apply to
13//! all architectures.
14//!
15//! You'll then have to manually update Zig source repo with these new files.
16
17const std = @import("std");
18const Arch = std.Target.Cpu.Arch;
19const Abi = std.Target.Abi;
20const assert = std.debug.assert;
21const Blake3 = std.crypto.hash.Blake3;
22
23const LibCTarget = struct {
24 name: []const u8,
25 arch: MultiArch,
26};
27
28const MultiArch = union(enum) {
29 arm,
30 arm64,
31 mips,
32 powerpc,
33 riscv,
34 sparc,
35 x86,
36 specific: Arch,
37
38 fn eql(a: MultiArch, b: MultiArch) bool {
39 if (@enumToInt(a) != @enumToInt(b))
40 return false;
41 if (a != .specific)
42 return true;
43 return a.specific == b.specific;
44 }
45};
46
47const linux_targets = [_]LibCTarget{
48 LibCTarget{
49 .name = "arc",
50 .arch = MultiArch{ .specific = Arch.arc },
51 },
52 LibCTarget{
53 .name = "arm",
54 .arch = .arm,
55 },
56 LibCTarget{
57 .name = "arm64",
58 .arch = .arm64,
59 },
60 LibCTarget{
61 .name = "csky",
62 .arch = .{ .specific = .csky },
63 },
64 LibCTarget{
65 .name = "hexagon",
66 .arch = .{ .specific = .hexagon },
67 },
68 LibCTarget{
69 .name = "m68k",
70 .arch = .{ .specific = .m68k },
71 },
72 LibCTarget{
73 .name = "mips",
74 .arch = .mips,
75 },
76 LibCTarget{
77 .name = "powerpc",
78 .arch = .powerpc,
79 },
80 LibCTarget{
81 .name = "riscv",
82 .arch = .riscv,
83 },
84 LibCTarget{
85 .name = "s390",
86 .arch = .{ .specific = .s390x },
87 },
88 LibCTarget{
89 .name = "sparc",
90 .arch = .{ .specific = .sparc },
91 },
92 LibCTarget{
93 .name = "x86",
94 .arch = .x86,
95 },
96};
97
98const DestTarget = struct {
99 arch: MultiArch,
100
101 const HashContext = struct {
102 pub fn hash(self: @This(), a: DestTarget) u32 {
103 _ = self;
104 var hasher = std.hash.Wyhash.init(0);
105 std.hash.autoHash(&hasher, a.arch);
106 return @truncate(u32, hasher.final());
107 }
108
109 pub fn eql(self: @This(), a: DestTarget, b: DestTarget) bool {
110 _ = self;
111 return a.arch.eql(b.arch);
112 }
113 };
114};
115
116const Contents = struct {
117 bytes: []const u8,
118 hit_count: usize,
119 hash: []const u8,
120 is_generic: bool,
121
122 fn hitCountLessThan(context: void, lhs: *const Contents, rhs: *const Contents) bool {
123 _ = context;
124 return lhs.hit_count < rhs.hit_count;
125 }
126};
127
128const HashToContents = std.StringHashMap(Contents);
129const TargetToHash = std.ArrayHashMap(DestTarget, []const u8, DestTarget.HashContext, true);
130const PathTable = std.StringHashMap(*TargetToHash);
131
132pub fn main() !void {
133 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
134 const allocator = &arena.allocator;
135 const args = try std.process.argsAlloc(allocator);
136 var search_paths = std.ArrayList([]const u8).init(allocator);
137 var opt_out_dir: ?[]const u8 = null;
138
139 var arg_i: usize = 1;
140 while (arg_i < args.len) : (arg_i += 1) {
141 if (std.mem.eql(u8, args[arg_i], "--help"))
142 usageAndExit(args[0]);
143 if (arg_i + 1 >= args.len) {
144 std.debug.warn("expected argument after '{s}'\n", .{args[arg_i]});
145 usageAndExit(args[0]);
146 }
147
148 if (std.mem.eql(u8, args[arg_i], "--search-path")) {
149 try search_paths.append(args[arg_i + 1]);
150 } else if (std.mem.eql(u8, args[arg_i], "--out")) {
151 assert(opt_out_dir == null);
152 opt_out_dir = args[arg_i + 1];
153 } else {
154 std.debug.warn("unrecognized argument: {s}\n", .{args[arg_i]});
155 usageAndExit(args[0]);
156 }
157
158 arg_i += 1;
159 }
160
161 const out_dir = opt_out_dir orelse usageAndExit(args[0]);
162 const generic_name = "any-linux-any";
163
164 var path_table = PathTable.init(allocator);
165 var hash_to_contents = HashToContents.init(allocator);
166 var max_bytes_saved: usize = 0;
167 var total_bytes: usize = 0;
168
169 var hasher = Blake3.init(.{});
170
171 for (linux_targets) |linux_target| {
172 const dest_target = DestTarget{
173 .arch = linux_target.arch,
174 };
175 search: for (search_paths.items) |search_path| {
176 const target_include_dir = try std.fs.path.join(allocator, &.{
177 search_path, linux_target.name, "include",
178 });
179 var dir_stack = std.ArrayList([]const u8).init(allocator);
180 try dir_stack.append(target_include_dir);
181
182 while (dir_stack.popOrNull()) |full_dir_name| {
183 var dir = std.fs.cwd().openDir(full_dir_name, .{ .iterate = true }) catch |err| switch (err) {
184 error.FileNotFound => continue :search,
185 error.AccessDenied => continue :search,
186 else => return err,
187 };
188 defer dir.close();
189
190 var dir_it = dir.iterate();
191
192 while (try dir_it.next()) |entry| {
193 const full_path = try std.fs.path.join(allocator, &[_][]const u8{ full_dir_name, entry.name });
194 switch (entry.kind) {
195 .Directory => try dir_stack.append(full_path),
196 .File => {
197 const rel_path = try std.fs.path.relative(allocator, target_include_dir, full_path);
198 const max_size = 2 * 1024 * 1024 * 1024;
199 const raw_bytes = try std.fs.cwd().readFileAlloc(allocator, full_path, max_size);
200 const trimmed = std.mem.trim(u8, raw_bytes, " \r\n\t");
201 total_bytes += raw_bytes.len;
202 const hash = try allocator.alloc(u8, 32);
203 hasher = Blake3.init(.{});
204 hasher.update(rel_path);
205 hasher.update(trimmed);
206 hasher.final(hash);
207 const gop = try hash_to_contents.getOrPut(hash);
208 if (gop.found_existing) {
209 max_bytes_saved += raw_bytes.len;
210 gop.value_ptr.hit_count += 1;
211 std.debug.warn("duplicate: {s} {s} ({:2})\n", .{
212 linux_target.name,
213 rel_path,
214 std.fmt.fmtIntSizeDec(raw_bytes.len),
215 });
216 } else {
217 gop.value_ptr.* = Contents{
218 .bytes = trimmed,
219 .hit_count = 1,
220 .hash = hash,
221 .is_generic = false,
222 };
223 }
224 const path_gop = try path_table.getOrPut(rel_path);
225 const target_to_hash = if (path_gop.found_existing) path_gop.value_ptr.* else blk: {
226 const ptr = try allocator.create(TargetToHash);
227 ptr.* = TargetToHash.init(allocator);
228 path_gop.value_ptr.* = ptr;
229 break :blk ptr;
230 };
231 try target_to_hash.putNoClobber(dest_target, hash);
232 },
233 else => std.debug.warn("warning: weird file: {s}\n", .{full_path}),
234 }
235 }
236 }
237 break;
238 } else {
239 std.debug.warn("warning: libc target not found: {s}\n", .{linux_target.name});
240 }
241 }
242 std.debug.warn("summary: {:2} could be reduced to {:2}\n", .{
243 std.fmt.fmtIntSizeDec(total_bytes),
244 std.fmt.fmtIntSizeDec(total_bytes - max_bytes_saved),
245 });
246 try std.fs.cwd().makePath(out_dir);
247
248 var missed_opportunity_bytes: usize = 0;
249 // iterate path_table. for each path, put all the hashes into a list. sort by hit_count.
250 // the hash with the highest hit_count gets to be the "generic" one. everybody else
251 // gets their header in a separate arch directory.
252 var path_it = path_table.iterator();
253 while (path_it.next()) |path_kv| {
254 var contents_list = std.ArrayList(*Contents).init(allocator);
255 {
256 var hash_it = path_kv.value_ptr.*.iterator();
257 while (hash_it.next()) |hash_kv| {
258 const contents = hash_to_contents.getPtr(hash_kv.value_ptr.*).?;
259 try contents_list.append(contents);
260 }
261 }
262 std.sort.sort(*Contents, contents_list.items, {}, Contents.hitCountLessThan);
263 const best_contents = contents_list.popOrNull().?;
264 if (best_contents.hit_count > 1) {
265 // worth it to make it generic
266 const full_path = try std.fs.path.join(allocator, &[_][]const u8{ out_dir, generic_name, path_kv.key_ptr.* });
267 try std.fs.cwd().makePath(std.fs.path.dirname(full_path).?);
268 try std.fs.cwd().writeFile(full_path, best_contents.bytes);
269 best_contents.is_generic = true;
270 while (contents_list.popOrNull()) |contender| {
271 if (contender.hit_count > 1) {
272 const this_missed_bytes = contender.hit_count * contender.bytes.len;
273 missed_opportunity_bytes += this_missed_bytes;
274 std.debug.warn("Missed opportunity ({:2}): {s}\n", .{
275 std.fmt.fmtIntSizeDec(this_missed_bytes),
276 path_kv.key_ptr.*,
277 });
278 } else break;
279 }
280 }
281 var hash_it = path_kv.value_ptr.*.iterator();
282 while (hash_it.next()) |hash_kv| {
283 const contents = hash_to_contents.get(hash_kv.value_ptr.*).?;
284 if (contents.is_generic) continue;
285
286 const dest_target = hash_kv.key_ptr.*;
287 const arch_name = switch (dest_target.arch) {
288 .specific => |a| @tagName(a),
289 else => @tagName(dest_target.arch),
290 };
291 const out_subpath = try std.fmt.allocPrint(allocator, "{s}-linux-any", .{arch_name});
292 const full_path = try std.fs.path.join(allocator, &[_][]const u8{ out_dir, out_subpath, path_kv.key_ptr.* });
293 try std.fs.cwd().makePath(std.fs.path.dirname(full_path).?);
294 try std.fs.cwd().writeFile(full_path, contents.bytes);
295 }
296 }
297}
298
299fn usageAndExit(arg0: []const u8) noreturn {
300 std.debug.warn("Usage: {s} [--search-path <dir>] --out <dir> --abi <name>\n", .{arg0});
301 std.debug.warn("--search-path can be used any number of times.\n", .{});
302 std.debug.warn(" subdirectories of search paths look like, e.g. x86_64-linux-gnu\n", .{});
303 std.debug.warn("--out is a dir that will be created, and populated with the results\n", .{});
304 std.process.exit(1);
305}