summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/linux_raw
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /vendor/rustix/src/backend/linux_raw
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/linux_raw')
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs543
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs470
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs)2
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs)12
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/mod.rs16
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mips.s211
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s189
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs28
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs166
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s132
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs285
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/x86.s381
-rw-r--r--vendor/rustix/src/backend/linux_raw/c.rs14
-rw-r--r--vendor/rustix/src/backend/linux_raw/conv.rs80
-rw-r--r--vendor/rustix/src/backend/linux_raw/elf.rs7
-rw-r--r--vendor/rustix/src/backend/linux_raw/fs/syscalls.rs125
-rw-r--r--vendor/rustix/src/backend/linux_raw/fs/types.rs124
-rw-r--r--vendor/rustix/src/backend/linux_raw/io/syscalls.rs65
-rw-r--r--vendor/rustix/src/backend/linux_raw/mm/types.rs63
-rw-r--r--vendor/rustix/src/backend/linux_raw/mod.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/mod.rs2
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/syscalls.rs239
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/types.rs303
-rw-r--r--vendor/rustix/src/backend/linux_raw/net/syscalls.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/param/auxv.rs6
-rw-r--r--vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs20
-rw-r--r--vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/process/syscalls.rs1
-rw-r--r--vendor/rustix/src/backend/linux_raw/pty/syscalls.rs2
-rw-r--r--vendor/rustix/src/backend/linux_raw/reg.rs13
-rw-r--r--vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs12
-rw-r--r--vendor/rustix/src/backend/linux_raw/termios/syscalls.rs7
-rw-r--r--vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs56
41 files changed, 1903 insertions, 1683 deletions
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs
index 0f4465d51..0f4465d51 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs
index 9695c6028..9695c6028 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs
index b39a16847..b39a16847 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs
new file mode 100644
index 000000000..718e94fa7
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs
@@ -0,0 +1,543 @@
+//! mipsisa32r6el Linux system calls.
+//!
+//! On mipsisa32r6el, Linux indicates success or failure using `$a3` rather
+//! than by returning a negative error code as most other architectures do.
+//!
+//! Mips-family platforms have a special calling convention for `__NR_pipe`,
+//! however we use `__NR_pipe2` instead to avoid having to implement it.
+
+use crate::backend::reg::{
+ ArgReg, FromAsm, RetReg, SyscallNumber, ToAsm, A0, A1, A2, A3, A4, A5, A6, R0,
+};
+use core::arch::asm;
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall0_readonly(nr: SyscallNumber) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
+ asm!(
+ "syscall",
+ in("$2" /*$v0*/) nr.to_asm(),
+ in("$4" /*$a0*/) a0.to_asm(),
+ options(noreturn)
+ )
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall7_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+ a6: ArgReg<'_, A6>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "sw {}, 24($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ in(reg) a6.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs
index d3c7d341f..d3c7d341f 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs
new file mode 100644
index 000000000..0a2ebebce
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs
@@ -0,0 +1,470 @@
+//! mipsisa64r6el Linux system calls.
+//!
+//! On mipsisa64r6el, Linux indicates success or failure using `$a3` (`$7`)
+//! rather than by returning a negative error code as most other architectures
+//! do.
+//!
+//! Mips-family platforms have a special calling convention for `__NR_pipe`,
+//! however we use `__NR_pipe2` instead to avoid having to implement it.
+//!
+//! Note that MIPS R6 inline assembly currently doesn't differ from MIPS,
+//! because no explicit call of R6-only or R2-only instructions exist here.
+
+use crate::backend::reg::{
+ ArgReg, FromAsm, RetReg, SyscallNumber, ToAsm, A0, A1, A2, A3, A4, A5, R0,
+};
+use core::arch::asm;
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall0_readonly(nr: SyscallNumber) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
+ asm!(
+ "syscall",
+ in("$2" /*$v0*/) nr.to_asm(),
+ in("$4" /*$a0*/) a0.to_asm(),
+ options(noreturn)
+ )
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ inlateout("$9" /*$a5*/) a5.to_asm() => _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ inlateout("$9" /*$a5*/) a5.to_asm() => _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs
index 7c26e23a4..3ea8eb74d 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs
@@ -12,7 +12,9 @@
#[cfg_attr(all(target_arch = "arm", not(thumb_mode)), path = "arm.rs")]
#[cfg_attr(all(target_arch = "arm", thumb_mode), path = "thumb.rs")]
#[cfg_attr(target_arch = "mips", path = "mips.rs")]
+#[cfg_attr(target_arch = "mips32r6", path = "mips32r6.rs")]
#[cfg_attr(target_arch = "mips64", path = "mips64.rs")]
+#[cfg_attr(target_arch = "mips64r6", path = "mips64r6.rs")]
#[cfg_attr(target_arch = "powerpc64", path = "powerpc64.rs")]
#[cfg_attr(target_arch = "riscv64", path = "riscv64.rs")]
#[cfg_attr(target_arch = "x86", path = "x86.rs")]
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs
index 8cca7dca7..8cca7dca7 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs
index b1e306266..b1e306266 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs
index 398a73dfe..398a73dfe 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs
index 62947cb04..ddef4a854 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs
@@ -5,7 +5,10 @@
//! instruction.
//!
//! Most `rustix` syscalls use the vsyscall mechanism rather than going using
-//! `int 0x80` sequences.
+//! `int 0x80` sequences, as vsyscall is much faster.
+//!
+//! Syscalls made with `int 0x80` preserve the flags register, while syscalls
+//! made using vsyscall do not.
#![allow(dead_code)]
@@ -25,7 +28,6 @@ pub(in crate::backend) unsafe fn indirect_syscall0(
"call {callee}",
callee = in(reg) callee,
inlateout("eax") nr.to_asm() => r0,
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -42,7 +44,6 @@ pub(in crate::backend) unsafe fn indirect_syscall1(
callee = in(reg) callee,
inlateout("eax") nr.to_asm() => r0,
in("ebx") a0.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -76,7 +77,6 @@ pub(in crate::backend) unsafe fn indirect_syscall2(
inlateout("eax") nr.to_asm() => r0,
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -97,7 +97,6 @@ pub(in crate::backend) unsafe fn indirect_syscall3(
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -128,7 +127,6 @@ pub(in crate::backend) unsafe fn indirect_syscall4(
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -161,7 +159,6 @@ pub(in crate::backend) unsafe fn indirect_syscall5(
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
in("edi") a4.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -203,7 +200,6 @@ pub(in crate::backend) unsafe fn indirect_syscall6(
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
in("edi") a4.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs
index 084f5fee4..084f5fee4 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/mod.rs
index cc93fc2c4..31a8c11f9 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/mod.rs
@@ -1,28 +1,20 @@
//! Architecture-specific syscall code.
//!
-//! `rustix` has inline assembly sequences using `asm!`, but that requires
-//! Rust 1.59, so it also has out-of-line ("outline") assembly sequences in .s
-//! files. And 32-bit x86 is special (see comments below).
-//!
//! This module also has a `choose` submodule which chooses a scheme and is
//! what most of the `rustix` syscalls use.
//!
//! # Safety
//!
//! This contains the inline `asm` statements performing the syscall
-//! instructions and FFI declarations declaring the out-of-line ("outline")
-//! syscall instructions.
+//! instructions.
#![allow(unsafe_code)]
#![cfg_attr(not(feature = "all-apis"), allow(unused_imports))]
// We'll use as many arguments as syscalls need.
#![allow(clippy::too_many_arguments)]
-// When inline asm is available, use it. Otherwise, use out-of-line asm. These
-// functions always use the machine's syscall instruction, even when it isn't
-// the fastest option available.
-#[cfg_attr(asm, path = "inline/mod.rs")]
-#[cfg_attr(not(asm), path = "outline/mod.rs")]
+// These functions always use the machine's syscall instruction, even when it
+// isn't the fastest option available.
pub(in crate::backend) mod asm;
// On most architectures, the architecture syscall instruction is fast, so use
@@ -31,7 +23,9 @@ pub(in crate::backend) mod asm;
target_arch = "arm",
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "x86_64",
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s b/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s
deleted file mode 100644
index b016ae124..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s
+++ /dev/null
@@ -1,211 +0,0 @@
-# Assembly code for making mips64 syscalls.
-#
-# mips64 syscall argument register ordering is the same as the mips64
-# userspace argument register ordering except that the syscall number
-# (nr) is passed in v0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into v0.
-
- .file "mips.s"
- .section .mdebug.abi32
- .previous
- .abicalls
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall0_nr_last
-rustix_syscall0_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $4
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall0_nr_last
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_nr_last
-rustix_syscall1_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall1_nr_last
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_noreturn_nr_last
-rustix_syscall1_noreturn_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- teq $zero, $zero
- .end rustix_syscall1_noreturn_nr_last
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall2_nr_last
-rustix_syscall2_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $6
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall2_nr_last
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall3_nr_last
-rustix_syscall3_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $7
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall3_nr_last
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall4_nr_last
-rustix_syscall4_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 16($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall4_nr_last
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall5_nr_last
-rustix_syscall5_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 20($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall5_nr_last
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall6_nr_last
-rustix_syscall6_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 24($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall6_nr_last
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .text.rustix_syscall7_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall7_nr_last
- .hidden rustix_syscall7_nr_last
- .type rustix_syscall7_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall7_nr_last
-rustix_syscall7_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 28($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall7_nr_last
- .size rustix_syscall7_nr_last, .-rustix_syscall7_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s b/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s
deleted file mode 100644
index a6473990e..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s
+++ /dev/null
@@ -1,189 +0,0 @@
-# Assembly code for making mips64 syscalls.
-#
-# mips64 syscall argument register ordering is the same as the mips64
-# userspace argument register ordering except that the syscall number
-# (nr) is passed in v0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into v0.
-
- .file "mips64.s"
- .section .mdebug.abi64
- .previous
- .abicalls
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall0_nr_last
-rustix_syscall0_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $4
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall0_nr_last
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_nr_last
-rustix_syscall1_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall1_nr_last
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_noreturn_nr_last
-rustix_syscall1_noreturn_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- teq $0, $0
- .end rustix_syscall1_noreturn_nr_last
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall2_nr_last
-rustix_syscall2_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $6
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall2_nr_last
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall3_nr_last
-rustix_syscall3_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $7
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall3_nr_last
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall4_nr_last
-rustix_syscall4_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $8
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall4_nr_last
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall5_nr_last
-rustix_syscall5_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $9
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall5_nr_last
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall6_nr_last
-rustix_syscall6_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $10
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall6_nr_last
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs
deleted file mode 100644
index 202a2cce9..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//! Declare functions defined in out-of-line ("outline") asm files.
-//!
-//! Kernel calling conventions differ from userspace calling conventions, so we
-//! also define inline function wrappers which reorder the arguments so that
-//! they match with the kernel convention as closely as possible, to minimize
-//! the amount of out-of-line code we need.
-//!
-//! This is needed because as of our MSRV of 1.63, inline asm and naked
-//! functions are experimental.
-
-#[cfg(target_arch = "x86")]
-mod x86;
-// For these architectures, pass the `nr` argument last.
-#[cfg(any(
- target_arch = "mips",
- target_arch = "mips64",
- target_arch = "powerpc64",
-))]
-mod nr_last;
-
-#[cfg(any(
- target_arch = "mips",
- target_arch = "mips64",
- target_arch = "powerpc64",
-))]
-pub(in crate::backend) use nr_last::*;
-#[cfg(target_arch = "x86")]
-pub(in crate::backend) use x86::*;
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs
deleted file mode 100644
index 4af64d6c4..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs
+++ /dev/null
@@ -1,166 +0,0 @@
-//! Syscall wrappers for platforms which pass the syscall number specially.
-//!
-//! Rustix aims to minimize the amount of assembly code it needs. To that end,
-//! this code reorders syscall arguments as close as feasible to the actual
-//! syscall convention before calling the assembly functions.
-//!
-//! Many architectures use a convention where the syscall number is passed in a
-//! special register, with the regular syscall arguments passed in either the
-//! same or similar registers as the platform C convention. This code
-//! approximates that order by passing the regular syscall arguments first, and
-//! the syscall number last. That way, the outline assembly code typically just
-//! needs to move the syscall number to its special register, and leave the
-//! other arguments mostly as they are.
-
-#[cfg(target_arch = "mips")]
-use crate::backend::reg::A6;
-use crate::backend::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
-
-// First we declare the actual assembly routines with `*_nr_last` names and
-// reordered arguments. If the signatures or calling conventions are ever
-// changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-//
-// We don't define `_readonly` versions of these because we have no way to tell
-// Rust that calls to our outline assembly are readonly.
-extern "C" {
- fn rustix_syscall0_nr_last(nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_nr_last(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_noreturn_nr_last(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> !;
- fn rustix_syscall2_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall3_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall4_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall5_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall6_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- #[cfg(target_arch = "mips")]
- fn rustix_syscall7_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- a6: ArgReg<'_, A6>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn syscall0(nr: SyscallNumber<'_>) -> RetReg<R0> {
- rustix_syscall0_nr_last(nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
- rustix_syscall1_nr_last(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
- rustix_syscall1_noreturn_nr_last(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall2(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_syscall2_nr_last(a0, a1, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall3(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_syscall3_nr_last(a0, a1, a2, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall4(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_syscall4_nr_last(a0, a1, a2, a3, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall5(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_syscall5_nr_last(a0, a1, a2, a3, a4, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall6(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_syscall6_nr_last(a0, a1, a2, a3, a4, a5, nr)
-}
-#[cfg(target_arch = "mips")]
-#[inline]
-pub(in crate::backend) unsafe fn syscall7(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- a6: ArgReg<'_, A6>,
-) -> RetReg<R0> {
- rustix_syscall7_nr_last(a0, a1, a2, a3, a4, a5, a6, nr)
-}
-
-// Then we define the `_readonly` versions of the wrappers. We don't have
-// separate `_readonly` implementations, so these can just be aliases to
-// their non-`_readonly` counterparts.
-#[cfg(target_arch = "mips")]
-pub(in crate::backend) use syscall7 as syscall7_readonly;
-pub(in crate::backend) use {
- syscall0 as syscall0_readonly, syscall1 as syscall1_readonly, syscall2 as syscall2_readonly,
- syscall3 as syscall3_readonly, syscall4 as syscall4_readonly, syscall5 as syscall5_readonly,
- syscall6 as syscall6_readonly,
-};
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s b/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s
deleted file mode 100644
index 29d4c0a95..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s
+++ /dev/null
@@ -1,132 +0,0 @@
-# Assembly code for making powerpc64le syscalls.
-#
-# powerpc64le syscall argument register ordering is the same as the
-# powerpc64le userspace argument register ordering except that the syscall
-# number (nr) is passed in r0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into r0.
-
- .file "powerpc64le.s"
- .machine power8
- .abiversion 2
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
-rustix_syscall0_nr_last:
- .cfi_startproc
- mr 0, 3
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
-rustix_syscall1_nr_last:
- .cfi_startproc
- mr 0, 4
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
-rustix_syscall1_noreturn_nr_last:
- .cfi_startproc
- mr 0, 4
- sc
- trap
- .cfi_endproc
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
-rustix_syscall2_nr_last:
- .cfi_startproc
- mr 0, 5
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
-rustix_syscall3_nr_last:
- .cfi_startproc
- mr 0, 6
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
-rustix_syscall4_nr_last:
- .cfi_startproc
- mr 0, 7
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
-rustix_syscall5_nr_last:
- .cfi_startproc
- mr 0, 8
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
-rustix_syscall6_nr_last:
- .cfi_startproc
- mr 0, 9
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs
deleted file mode 100644
index e74b8d2aa..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs
+++ /dev/null
@@ -1,285 +0,0 @@
-//! Syscall wrappers for 32-bit x86.
-//!
-//! This module is similar to the `nr_last` module, except specialized for
-//! 32-bit x86.
-//!
-//! The syscall convention passes all arguments in registers. The closest we
-//! can easily get to that from Rust is to use the fastcall convention which
-//! passes the first two arguments in `ecx` and `edx`, which are the second
-//! and third Linux syscall arguments. To line them up, this function passes
-//! the second and third syscall argument as the first and second argument to
-//! the outline assembly, followed by the first syscall argument, and then the
-//! rest of the syscall arguments. The assembly code still has to do some work,
-//! but at least we can get up to two arguments into the right place for it.
-
-#![allow(dead_code, unused_imports)]
-
-use crate::backend::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
-use crate::backend::vdso_wrappers::SyscallType;
-
-// First we declare the actual assembly routines with `*_nr_last_fastcall`
-// names and reordered arguments. If the signatures or calling conventions are
-// ever changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-//
-// We don't define `_readonly` versions of these because we have no way to tell
-// Rust that calls to our outline assembly are readonly.
-extern "fastcall" {
- fn rustix_syscall0_nr_last_fastcall(nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_nr_last_fastcall(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_noreturn_nr_last_fastcall(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> !;
- fn rustix_syscall2_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall3_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall4_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall5_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall6_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn syscall0(nr: SyscallNumber<'_>) -> RetReg<R0> {
- rustix_syscall0_nr_last_fastcall(nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
- rustix_syscall1_nr_last_fastcall(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
- rustix_syscall1_noreturn_nr_last_fastcall(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall2(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_syscall2_nr_last_fastcall(a1, a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall3(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_syscall3_nr_last_fastcall(a1, a2, a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall4(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_syscall4_nr_last_fastcall(a1, a2, a0, a3, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall5(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_syscall5_nr_last_fastcall(a1, a2, a0, a3, a4, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall6(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_syscall6_nr_last_fastcall(a1, a2, a0, a3, a4, a5, nr)
-}
-
-// Then we define the `_readonly` versions of the wrappers. We don't have
-// separate `_readonly` implementations, so these can just be aliases to
-// their non-`_readonly` counterparts.
-pub(in crate::backend) use {
- syscall0 as syscall0_readonly, syscall1 as syscall1_readonly, syscall2 as syscall2_readonly,
- syscall3 as syscall3_readonly, syscall4 as syscall4_readonly, syscall5 as syscall5_readonly,
- syscall6 as syscall6_readonly,
-};
-
-// x86 prefers to route all syscalls through the vDSO, though this isn't
-// always possible, so it also has a special form for doing the dispatch.
-//
-// First we declare the actual assembly routines with `*_nr_last_fastcall`
-// names and reordered arguments. If the signatures or calling conventions are
-// ever changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-extern "fastcall" {
- fn rustix_indirect_syscall0_nr_last_fastcall(
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall1_nr_last_fastcall(
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall1_noreturn_nr_last_fastcall(
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> !;
- fn rustix_indirect_syscall2_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall3_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall4_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall5_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall6_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall0(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
-) -> RetReg<R0> {
- rustix_indirect_syscall0_nr_last_fastcall(nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall1(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
-) -> RetReg<R0> {
- rustix_indirect_syscall1_nr_last_fastcall(a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall1_noreturn(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
-) -> ! {
- rustix_indirect_syscall1_noreturn_nr_last_fastcall(a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall2(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_indirect_syscall2_nr_last_fastcall(a1, a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall3(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_indirect_syscall3_nr_last_fastcall(a1, a2, a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall4(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_indirect_syscall4_nr_last_fastcall(a1, a2, a0, a3, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall5(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_indirect_syscall5_nr_last_fastcall(a1, a2, a0, a3, a4, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall6(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_indirect_syscall6_nr_last_fastcall(a1, a2, a0, a3, a4, a5, nr, callee)
-}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s b/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s
deleted file mode 100644
index bda234e1a..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s
+++ /dev/null
@@ -1,381 +0,0 @@
-// Assembly code for making x86 syscalls.
-//
-// On x86 we use the "fastcall" convention which passes the first two
-// arguments in ecx and edx. Outline.rs reorders the arguments to put
-// a1 and a2 in those registers so they we don't have to move them to
-// set up the kernel convention.
-//
-// "fastcall" expects callee to pop argument stack space, so we use
-// `ret imm` instructions to clean up the stack. We don't need callee
-// cleanup per se, it just comes along with using "fastcall".
-
- .file "x86.s"
- .intel_syntax noprefix
-
- .section .text.rustix_indirect_syscall0_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall0_nr_last_fastcall
- .hidden rustix_indirect_syscall0_nr_last_fastcall
- .type rustix_indirect_syscall0_nr_last_fastcall, @function
-rustix_indirect_syscall0_nr_last_fastcall:
- .cfi_startproc
- mov eax,ecx
- call edx
- ret
- .cfi_endproc
- .size rustix_indirect_syscall0_nr_last_fastcall, .-rustix_indirect_syscall0_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall1_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall1_nr_last_fastcall
- .hidden rustix_indirect_syscall1_nr_last_fastcall
- .type rustix_indirect_syscall1_nr_last_fastcall, @function
-rustix_indirect_syscall1_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,ecx
- mov eax,edx
- call DWORD PTR [esp+0x8]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x4
- .cfi_endproc
- .size rustix_indirect_syscall1_nr_last_fastcall, .-rustix_indirect_syscall1_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall1_noreturn_nr_last_fastcall
- .hidden rustix_indirect_syscall1_noreturn_nr_last_fastcall
- .type rustix_indirect_syscall1_noreturn_nr_last_fastcall, @function
-rustix_indirect_syscall1_noreturn_nr_last_fastcall:
- .cfi_startproc
- mov ebx,ecx
- mov eax,edx
- call DWORD PTR [esp+0x4]
- ud2
- .cfi_endproc
- .size rustix_indirect_syscall1_noreturn_nr_last_fastcall, .-rustix_indirect_syscall1_noreturn_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall2_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall2_nr_last_fastcall
- .hidden rustix_indirect_syscall2_nr_last_fastcall
- .type rustix_indirect_syscall2_nr_last_fastcall, @function
-rustix_indirect_syscall2_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,edx
- mov eax,DWORD PTR [esp+0x8]
- call DWORD PTR [esp+0xc]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x8
- .cfi_endproc
- .size rustix_indirect_syscall2_nr_last_fastcall, .-rustix_indirect_syscall2_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall3_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall3_nr_last_fastcall
- .hidden rustix_indirect_syscall3_nr_last_fastcall
- .type rustix_indirect_syscall3_nr_last_fastcall, @function
-rustix_indirect_syscall3_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x8]
- mov eax,DWORD PTR [esp+0xc]
- call DWORD PTR [esp+0x10]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0xc
- .cfi_endproc
- .size rustix_indirect_syscall3_nr_last_fastcall, .-rustix_indirect_syscall3_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall4_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall4_nr_last_fastcall
- .hidden rustix_indirect_syscall4_nr_last_fastcall
- .type rustix_indirect_syscall4_nr_last_fastcall, @function
-rustix_indirect_syscall4_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0xc]
- mov esi,DWORD PTR [esp+0x10]
- mov eax,DWORD PTR [esp+0x14]
- call DWORD PTR [esp+0x18]
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x10
- .cfi_endproc
- .size rustix_indirect_syscall4_nr_last_fastcall, .-rustix_indirect_syscall4_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall5_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall5_nr_last_fastcall
- .hidden rustix_indirect_syscall5_nr_last_fastcall
- .type rustix_indirect_syscall5_nr_last_fastcall, @function
-rustix_indirect_syscall5_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- .cfi_offset edi, -16
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x10]
- mov esi,DWORD PTR [esp+0x14]
- mov edi,DWORD PTR [esp+0x18]
- mov eax,DWORD PTR [esp+0x1c]
- call DWORD PTR [esp+0x20]
- pop edi
- .cfi_def_cfa_offset 12
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x14
- .cfi_endproc
- .size rustix_indirect_syscall5_nr_last_fastcall, .-rustix_indirect_syscall5_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall6_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall6_nr_last_fastcall
- .hidden rustix_indirect_syscall6_nr_last_fastcall
- .type rustix_indirect_syscall6_nr_last_fastcall, @function
-rustix_indirect_syscall6_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- push ebp
- .cfi_def_cfa_offset 20
- .cfi_offset ebp, -20
- .cfi_offset edi, -16
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x14]
- mov esi,DWORD PTR [esp+0x18]
- mov edi,DWORD PTR [esp+0x1c]
- mov ebp,DWORD PTR [esp+0x20]
- mov eax,DWORD PTR [esp+0x24]
- call DWORD PTR [esp+0x28]
- pop ebp
- .cfi_def_cfa_offset 16
- pop edi
- .cfi_def_cfa_offset 12
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x18
- .cfi_endproc
- .size rustix_indirect_syscall6_nr_last_fastcall, .-rustix_indirect_syscall6_nr_last_fastcall
-
- .section .text.rustix_syscall0_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall0_nr_last_fastcall
- .hidden rustix_syscall0_nr_last_fastcall
- .type rustix_syscall0_nr_last_fastcall, @function
-rustix_syscall0_nr_last_fastcall:
- .cfi_startproc
- mov eax,ecx
- int 0x80
- ret
- .cfi_endproc
- .size rustix_syscall0_nr_last_fastcall, .-rustix_syscall0_nr_last_fastcall
-
- .section .text.rustix_syscall1_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall1_nr_last_fastcall
- .hidden rustix_syscall1_nr_last_fastcall
- .type rustix_syscall1_nr_last_fastcall, @function
-rustix_syscall1_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov eax,edx
- mov ebx,ecx
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret
- .cfi_endproc
- .size rustix_syscall1_nr_last_fastcall, .-rustix_syscall1_nr_last_fastcall
-
- .section .text.rustix_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall1_noreturn_nr_last_fastcall
- .hidden rustix_syscall1_noreturn_nr_last_fastcall
- .type rustix_syscall1_noreturn_nr_last_fastcall, @function
-rustix_syscall1_noreturn_nr_last_fastcall:
- .cfi_startproc
- mov eax,edx
- mov ebx,ecx
- int 0x80
- ud2
- .cfi_endproc
- .size rustix_syscall1_noreturn_nr_last_fastcall, .-rustix_syscall1_noreturn_nr_last_fastcall
-
- .section .text.rustix_syscall2_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall2_nr_last_fastcall
- .hidden rustix_syscall2_nr_last_fastcall
- .type rustix_syscall2_nr_last_fastcall, @function
-rustix_syscall2_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,edx
- mov eax,DWORD PTR [esp+0x8]
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x4
- .cfi_endproc
- .size rustix_syscall2_nr_last_fastcall, .-rustix_syscall2_nr_last_fastcall
-
- .section .text.rustix_syscall3_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall3_nr_last_fastcall
- .hidden rustix_syscall3_nr_last_fastcall
- .type rustix_syscall3_nr_last_fastcall, @function
-rustix_syscall3_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x8]
- mov eax,DWORD PTR [esp+0xc]
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x8
- .cfi_endproc
- .size rustix_syscall3_nr_last_fastcall, .-rustix_syscall3_nr_last_fastcall
-
- .section .text.rustix_syscall4_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall4_nr_last_fastcall
- .hidden rustix_syscall4_nr_last_fastcall
- .type rustix_syscall4_nr_last_fastcall, @function
-rustix_syscall4_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0xc]
- mov esi,DWORD PTR [esp+0x10]
- mov eax,DWORD PTR [esp+0x14]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0xc
- .cfi_endproc
- .size rustix_syscall4_nr_last_fastcall, .-rustix_syscall4_nr_last_fastcall
-
- .section .text.rustix_syscall5_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall5_nr_last_fastcall
- .hidden rustix_syscall5_nr_last_fastcall
- .type rustix_syscall5_nr_last_fastcall, @function
-rustix_syscall5_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push edi
- .cfi_def_cfa_offset 12
- push esi
- .cfi_def_cfa_offset 16
- .cfi_offset esi, -16
- .cfi_offset edi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x10]
- mov esi,DWORD PTR [esp+0x14]
- mov edi,DWORD PTR [esp+0x18]
- mov eax,DWORD PTR [esp+0x1c]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 12
- pop edi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x10
- .cfi_endproc
- .size rustix_syscall5_nr_last_fastcall, .-rustix_syscall5_nr_last_fastcall
-
- .section .text.rustix_syscall6_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall6_nr_last_fastcall
- .hidden rustix_syscall6_nr_last_fastcall
- .type rustix_syscall6_nr_last_fastcall, @function
-rustix_syscall6_nr_last_fastcall:
- .cfi_startproc
- push ebp
- .cfi_def_cfa_offset 8
- push ebx
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- push esi
- .cfi_def_cfa_offset 20
- .cfi_offset esi, -20
- .cfi_offset edi, -16
- .cfi_offset ebx, -12
- .cfi_offset ebp, -8
- mov ebx,DWORD PTR [esp+0x14]
- mov esi,DWORD PTR [esp+0x18]
- mov edi,DWORD PTR [esp+0x1c]
- mov ebp,DWORD PTR [esp+0x20]
- mov eax,DWORD PTR [esp+0x24]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 16
- pop edi
- .cfi_def_cfa_offset 12
- pop ebx
- .cfi_def_cfa_offset 8
- pop ebp
- .cfi_def_cfa_offset 4
- ret 0x14
- .cfi_endproc
- .size rustix_syscall6_nr_last_fastcall, .-rustix_syscall6_nr_last_fastcall
-
- .section .text.rustix_int_0x80,"ax",@progbits
- .p2align 4
- .weak rustix_int_0x80
- .hidden rustix_int_0x80
- .type rustix_int_0x80, @function
-rustix_int_0x80:
- .cfi_startproc
- int 0x80
- ret
- .cfi_endproc
- .size rustix_int_0x80, .-rustix_int_0x80
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/c.rs b/vendor/rustix/src/backend/linux_raw/c.rs
index 8e77c82d7..f336392bb 100644
--- a/vendor/rustix/src/backend/linux_raw/c.rs
+++ b/vendor/rustix/src/backend/linux_raw/c.rs
@@ -104,7 +104,15 @@ pub(crate) use linux_raw_sys::{
// On MIPS, `TCSANOW` et al have `TCSETS` added to them, so we need it to
// subtract it out.
-#[cfg(all(feature = "termios", any(target_arch = "mips", target_arch = "mips64")))]
+#[cfg(all(
+ feature = "termios",
+ any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+))]
pub(crate) use linux_raw_sys::ioctl::TCSETS;
// Define our own `uid_t` and `gid_t` if the kernel's versions are not 32-bit.
@@ -134,7 +142,9 @@ pub(crate) const SIGALRM: c_int = linux_raw_sys::general::SIGALRM as _;
pub(crate) const SIGTERM: c_int = linux_raw_sys::general::SIGTERM as _;
#[cfg(not(any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
)))]
@@ -156,7 +166,9 @@ pub(crate) const SIGPWR: c_int = linux_raw_sys::general::SIGPWR as _;
pub(crate) const SIGSYS: c_int = linux_raw_sys::general::SIGSYS as _;
#[cfg(any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
))]
diff --git a/vendor/rustix/src/backend/linux_raw/conv.rs b/vendor/rustix/src/backend/linux_raw/conv.rs
index 05d040204..c87136f8f 100644
--- a/vendor/rustix/src/backend/linux_raw/conv.rs
+++ b/vendor/rustix/src/backend/linux_raw/conv.rs
@@ -436,19 +436,79 @@ pub(crate) mod fs {
c_uint(access.bits())
}
}
+}
- impl<'a, Num: ArgNumber> From<crate::backend::fs::types::MountFlagsArg> for ArgReg<'a, Num> {
- #[inline]
- fn from(flags: crate::backend::fs::types::MountFlagsArg) -> Self {
- c_uint(flags.0)
- }
+#[cfg(any(feature = "fs", feature = "mount"))]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountFlagsArg> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MountFlagsArg) -> Self {
+ c_uint(flags.0)
}
+}
- impl<'a, Num: ArgNumber> From<crate::backend::fs::types::UnmountFlags> for ArgReg<'a, Num> {
- #[inline]
- fn from(flags: crate::backend::fs::types::UnmountFlags) -> Self {
- c_uint(flags.bits())
- }
+// When the deprecated "fs" aliases are removed, we can remove the "fs"
+// here too.
+#[cfg(any(feature = "fs", feature = "mount"))]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::UnmountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::UnmountFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::mount::FsConfigCmd> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(cmd: crate::mount::FsConfigCmd) -> Self {
+ c_uint(cmd as c::c_uint)
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsOpenFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsOpenFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsMountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsMountFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountAttrFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MountAttrFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::OpenTreeFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::OpenTreeFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsPickFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsPickFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MoveMountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MoveMountFlags) -> Self {
+ c_uint(flags.bits())
}
}
diff --git a/vendor/rustix/src/backend/linux_raw/elf.rs b/vendor/rustix/src/backend/linux_raw/elf.rs
index 7797f4e21..415f79f88 100644
--- a/vendor/rustix/src/backend/linux_raw/elf.rs
+++ b/vendor/rustix/src/backend/linux_raw/elf.rs
@@ -62,7 +62,12 @@ pub(super) const EM_CURRENT: u16 = 40; // EM_ARM
pub(super) const EM_CURRENT: u16 = 3; // EM_386
#[cfg(target_arch = "powerpc64")]
pub(super) const EM_CURRENT: u16 = 21; // EM_PPC64
-#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
+#[cfg(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
pub(super) const EM_CURRENT: u16 = 8; // EM_MIPS
#[cfg(target_arch = "x86_64")]
pub(super) const EM_CURRENT: u16 = 62; // EM_X86_64
diff --git a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
index 78a2088b2..b3d4cd66c 100644
--- a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
@@ -18,6 +18,7 @@ use crate::backend::conv::{loff_t, loff_t_from_u64, ret_u64};
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_pointer_width = "32",
))]
use crate::fd::AsFd;
@@ -32,7 +33,7 @@ use crate::fs::{
};
use crate::io;
use core::mem::{transmute, zeroed, MaybeUninit};
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
use linux_raw_sys::general::stat as linux_stat64;
use linux_raw_sys::general::{
__kernel_fsid_t, __kernel_timespec, open_how, statx, AT_EACCESS, AT_FDCWD, AT_REMOVEDIR,
@@ -206,9 +207,9 @@ pub(crate) fn seek(fd: BorrowedFd<'_>, pos: SeekFrom) -> io::Result<u64> {
}
SeekFrom::End(offset) => (SEEK_END, offset),
SeekFrom::Current(offset) => (SEEK_CUR, offset),
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ #[cfg(target_os = "linux")]
SeekFrom::Data(offset) => (SEEK_DATA, offset),
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ #[cfg(target_os = "linux")]
SeekFrom::Hole(offset) => (SEEK_HOLE, offset),
};
_seek(fd, offset, whence)
@@ -252,7 +253,12 @@ pub(crate) fn ftruncate(fd: BorrowedFd<'_>, length: u64) -> io::Result<()> {
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L81-L83>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ ),
))]
unsafe {
ret(syscall_readonly!(
@@ -265,7 +271,12 @@ pub(crate) fn ftruncate(fd: BorrowedFd<'_>, length: u64) -> io::Result<()> {
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ )),
))]
unsafe {
ret(syscall_readonly!(
@@ -348,7 +359,7 @@ pub(crate) fn fadvise(fd: BorrowedFd<'_>, pos: u64, len: u64, advice: Advice) ->
}
// On mips, the arguments are not reordered, and padding is inserted
// instead to ensure alignment.
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
unsafe {
ret(syscall_readonly!(
__NR_fadvise64,
@@ -363,7 +374,12 @@ pub(crate) fn fadvise(fd: BorrowedFd<'_>, pos: u64, len: u64, advice: Advice) ->
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ )),
))]
unsafe {
ret(syscall_readonly!(
@@ -427,7 +443,11 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
// And, some old platforms don't support `statx`, and some fail with a
// confusing error code, so we call `crate::fs::statx` to handle that. If
// `statx` isn't available, fall back to the buggy system call.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(fd, cstr!(""), AtFlags::EMPTY_PATH, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -436,7 +456,11 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6")
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(__NR_fstat, fd, &mut result))?;
@@ -444,11 +468,15 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6",
+))]
fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(__NR_fstat, fd, &mut result))?;
stat_to_stat(result.assume_init())
@@ -464,7 +492,11 @@ fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
#[inline]
pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(
crate::fs::CWD.as_fd(),
@@ -478,7 +510,11 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6"),
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(
@@ -492,11 +528,15 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn stat_old(path: &CStr) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(
__NR_newfstatat,
@@ -524,7 +564,11 @@ fn stat_old(path: &CStr) -> io::Result<Stat> {
#[inline]
pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(dirfd, path, flags, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -533,7 +577,11 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6"),
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(__NR_newfstatat, dirfd, path, &mut result, flags))?;
@@ -541,11 +589,15 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn statat_old(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(__NR_newfstatat, dirfd, path, &mut result, flags))?;
stat_to_stat(result.assume_init())
@@ -593,7 +645,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
fn lstat_old(path: &CStr) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(
__NR_newfstatat,
@@ -619,7 +671,11 @@ fn lstat_old(path: &CStr) -> io::Result<Stat> {
}
/// Convert from a Linux `statx` value to rustix's `Stat`.
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
Ok(Stat {
st_dev: crate::fs::makedev(x.stx_dev_major, x.stx_dev_minor),
@@ -686,7 +742,7 @@ fn stat_to_stat(s64: linux_raw_sys::general::stat64) -> io::Result<Stat> {
}
/// Convert from a Linux `stat` value to rustix's `Stat`.
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
fn stat_to_stat(s: linux_raw_sys::general::stat) -> io::Result<Stat> {
Ok(Stat {
st_dev: s.st_dev.try_into().map_err(|_| io::Errno::OVERFLOW)?,
@@ -1417,31 +1473,6 @@ pub(crate) fn sendfile(
}
#[inline]
-pub(crate) fn mount(
- source: Option<&CStr>,
- target: &CStr,
- file_system_type: Option<&CStr>,
- flags: super::types::MountFlagsArg,
- data: Option<&CStr>,
-) -> io::Result<()> {
- unsafe {
- ret(syscall_readonly!(
- __NR_mount,
- source,
- target,
- file_system_type,
- flags,
- data
- ))
- }
-}
-
-#[inline]
-pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
- unsafe { ret(syscall_readonly!(__NR_umount2, target, flags)) }
-}
-
-#[inline]
pub(crate) fn inotify_init1(flags: inotify::CreateFlags) -> io::Result<OwnedFd> {
unsafe { ret_owned_fd(syscall_readonly!(__NR_inotify_init1, flags)) }
}
diff --git a/vendor/rustix/src/backend/linux_raw/fs/types.rs b/vendor/rustix/src/backend/linux_raw/fs/types.rs
index df61cf721..e18dc0b4d 100644
--- a/vendor/rustix/src/backend/linux_raw/fs/types.rs
+++ b/vendor/rustix/src/backend/linux_raw/fs/types.rs
@@ -600,7 +600,11 @@ pub enum FlockOperation {
// On 32-bit, and mips64, Linux's `struct stat64` has a 32-bit `st_mtime` and
// friends, so we use our own struct, populated from `statx` where possible, to
// avoid the y2038 bug.
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(missing_docs)]
@@ -627,7 +631,11 @@ pub struct Stat {
///
/// [`statat`]: crate::fs::statat
/// [`fstat`]: crate::fs::fstat
-#[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+#[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6")
+))]
pub type Stat = linux_raw_sys::general::stat;
/// `struct statfs` for use with [`statfs`] and [`fstatfs`].
@@ -688,117 +696,9 @@ pub type RawMode = c::c_uint;
pub type Dev = u64;
/// `__fsword_t`
-#[cfg(not(target_arch = "mips64"))]
+#[cfg(not(any(target_arch = "mips64", target_arch = "mips64r6")))]
pub type FsWord = linux_raw_sys::general::__fsword_t;
/// `__fsword_t`
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
pub type FsWord = i64;
-
-bitflags! {
- /// `MS_*` constants for use with [`mount`].
- ///
- /// [`mount`]: crate::fs::mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountFlags: c::c_uint {
- /// `MS_BIND`
- const BIND = linux_raw_sys::general::MS_BIND;
-
- /// `MS_DIRSYNC`
- const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC;
-
- /// `MS_LAZYTIME`
- const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME;
-
- /// `MS_MANDLOCK`
- #[doc(alias = "MANDLOCK")]
- const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK;
-
- /// `MS_NOATIME`
- const NOATIME = linux_raw_sys::general::MS_NOATIME;
-
- /// `MS_NODEV`
- const NODEV = linux_raw_sys::general::MS_NODEV;
-
- /// `MS_NODIRATIME`
- const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME;
-
- /// `MS_NOEXEC`
- const NOEXEC = linux_raw_sys::general::MS_NOEXEC;
-
- /// `MS_NOSUID`
- const NOSUID = linux_raw_sys::general::MS_NOSUID;
-
- /// `MS_RDONLY`
- const RDONLY = linux_raw_sys::general::MS_RDONLY;
-
- /// `MS_REC`
- const REC = linux_raw_sys::general::MS_REC;
-
- /// `MS_RELATIME`
- const RELATIME = linux_raw_sys::general::MS_RELATIME;
-
- /// `MS_SILENT`
- const SILENT = linux_raw_sys::general::MS_SILENT;
-
- /// `MS_STRICTATIME`
- const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME;
-
- /// `MS_SYNCHRONOUS`
- const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS;
-
- /// `MS_NOSYMFOLLOW`
- const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW;
- }
-}
-
-bitflags! {
- /// `MS_*` constants for use with [`change_mount`].
- ///
- /// [`change_mount`]: crate::fs::mount::change_mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountPropagationFlags: c::c_uint {
- /// `MS_SHARED`
- const SHARED = linux_raw_sys::general::MS_SHARED;
- /// `MS_PRIVATE`
- const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
- /// `MS_SLAVE`
- const SLAVE = linux_raw_sys::general::MS_SLAVE;
- /// `MS_UNBINDABLE`
- const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
- /// `MS_REC`
- const REC = linux_raw_sys::general::MS_REC;
- }
-}
-
-bitflags! {
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub(crate) struct InternalMountFlags: c::c_uint {
- const REMOUNT = linux_raw_sys::general::MS_REMOUNT;
- const MOVE = linux_raw_sys::general::MS_MOVE;
- }
-}
-
-#[repr(transparent)]
-pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);
-
-bitflags! {
- /// `MNT_*` constants for use with [`unmount`].
- ///
- /// [`unmount`]: crate::fs::mount::unmount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct UnmountFlags: c::c_uint {
- /// `MNT_FORCE`
- const FORCE = linux_raw_sys::general::MNT_FORCE;
- /// `MNT_DETACH`
- const DETACH = linux_raw_sys::general::MNT_DETACH;
- /// `MNT_EXPIRE`
- const EXPIRE = linux_raw_sys::general::MNT_EXPIRE;
- /// `UMOUNT_NOFOLLOW`
- const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW;
- }
-}
diff --git a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
index 45e0dd647..88eed3d72 100644
--- a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
@@ -10,7 +10,12 @@
use crate::backend::conv::loff_t_from_u64;
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
use crate::backend::conv::zero;
use crate::backend::conv::{
@@ -26,8 +31,6 @@ use crate::io::{self, DupFlags, FdFlags, IoSlice, IoSliceMut, ReadWriteFlags};
use crate::net::{RecvFlags, SendFlags};
use core::cmp;
use core::mem::MaybeUninit;
-#[cfg(target_os = "espidf")]
-use linux_raw_sys::general::F_DUPFD;
use linux_raw_sys::general::{F_DUPFD_CLOEXEC, F_GETFD, F_SETFD};
use linux_raw_sys::ioctl::{FIONBIO, FIONREAD};
@@ -45,7 +48,12 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result<
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L75>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
unsafe {
ret_usize(syscall!(
@@ -60,7 +68,12 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result<
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "power")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ )),
))]
unsafe {
ret_usize(syscall!(
@@ -170,7 +183,12 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], pos: u64) -> io::Result<usi
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L81-L83>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
unsafe {
ret_usize(syscall_readonly!(
@@ -185,7 +203,12 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], pos: u64) -> io::Result<usi
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "power")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ )),
))]
unsafe {
ret_usize(syscall_readonly!(
@@ -339,10 +362,7 @@ pub(crate) fn is_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)> {
// the write side is shut down.
#[allow(unreachable_patterns)] // `EAGAIN` equals `EWOULDBLOCK`
match crate::backend::net::syscalls::send(fd, &[], SendFlags::DONTWAIT) {
- // TODO or-patterns when we don't need 1.51
- Err(io::Errno::AGAIN) => (),
- Err(io::Errno::WOULDBLOCK) => (),
- Err(io::Errno::NOTSOCK) => (),
+ Err(io::Errno::AGAIN | io::Errno::WOULDBLOCK | io::Errno::NOTSOCK) => (),
Err(io::Errno::PIPE) => write = false,
Err(err) => return Err(err),
Ok(_) => (),
@@ -403,29 +423,6 @@ pub(crate) fn fcntl_setfd(fd: BorrowedFd<'_>, flags: FdFlags) -> io::Result<()>
}
}
-#[cfg(target_os = "espidf")]
-#[inline]
-pub(crate) fn fcntl_dupfd(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
- #[cfg(target_pointer_width = "32")]
- unsafe {
- ret_owned_fd(syscall_readonly!(
- __NR_fcntl64,
- fd,
- c_uint(F_DUPFD),
- raw_fd(min)
- ))
- }
- #[cfg(target_pointer_width = "64")]
- unsafe {
- ret_owned_fd(syscall_readonly!(
- __NR_fcntl,
- fd,
- c_uint(F_DUPFD),
- raw_fd(min)
- ))
- }
-}
-
#[inline]
pub(crate) fn fcntl_dupfd_cloexec(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
#[cfg(target_pointer_width = "32")]
diff --git a/vendor/rustix/src/backend/linux_raw/mm/types.rs b/vendor/rustix/src/backend/linux_raw/mm/types.rs
index 576f08a3d..2d5eebc58 100644
--- a/vendor/rustix/src/backend/linux_raw/mm/types.rs
+++ b/vendor/rustix/src/backend/linux_raw/mm/types.rs
@@ -38,6 +38,20 @@ bitflags! {
const GROWSUP = linux_raw_sys::general::PROT_GROWSUP;
/// `PROT_GROWSDOWN`
const GROWSDOWN = linux_raw_sys::general::PROT_GROWSDOWN;
+ /// `PROT_SEM`
+ const SEM = linux_raw_sys::general::PROT_SEM;
+ /// `PROT_BTI`
+ #[cfg(target_arch = "aarch64")]
+ const BTI = linux_raw_sys::general::PROT_BTI;
+ /// `PROT_MTE`
+ #[cfg(target_arch = "aarch64")]
+ const MTE = linux_raw_sys::general::PROT_MTE;
+ /// `PROT_SAO`
+ #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
+ const SAO = linux_raw_sys::general::PROT_SAO;
+ /// `PROT_ADI`
+ #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
+ const ADI = linux_raw_sys::general::PROT_ADI;
}
}
@@ -80,10 +94,10 @@ bitflags! {
/// `MAP_STACK`
const STACK = linux_raw_sys::general::MAP_STACK;
/// `MAP_SYNC` (since Linux 4.15)
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))]
const SYNC = linux_raw_sys::general::MAP_SYNC;
/// `MAP_UNINITIALIZED`
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))]
const UNINITIALIZED = linux_raw_sys::general::MAP_UNINITIALIZED;
}
}
@@ -106,18 +120,6 @@ bitflags! {
}
bitflags! {
- /// `MLOCK_*` flags for use with [`mlock_with`].
- ///
- /// [`mlock_with`]: crate::io::mlock_with
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MlockFlags: u32 {
- /// `MLOCK_ONFAULT`
- const ONFAULT = linux_raw_sys::general::MLOCK_ONFAULT;
- }
-}
-
-bitflags! {
/// `MS_*` flags for use with [`msync`].
///
/// [`msync`]: crate::io::msync
@@ -137,16 +139,14 @@ bitflags! {
}
bitflags! {
- /// `O_*` flags for use with [`userfaultfd`].
+ /// `MLOCK_*` flags for use with [`mlock_with`].
///
- /// [`userfaultfd`]: crate::io::userfaultfd
+ /// [`mlock_with`]: crate::io::mlock_with
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct UserfaultfdFlags: c::c_uint {
- /// `O_CLOEXEC`
- const CLOEXEC = linux_raw_sys::general::O_CLOEXEC;
- /// `O_NONBLOCK`
- const NONBLOCK = linux_raw_sys::general::O_NONBLOCK;
+ pub struct MlockFlags: u32 {
+ /// `MLOCK_ONFAULT`
+ const ONFAULT = linux_raw_sys::general::MLOCK_ONFAULT;
}
}
@@ -183,7 +183,12 @@ pub enum Advice {
/// `MADV_HWPOISON`
LinuxHwPoison = linux_raw_sys::general::MADV_HWPOISON,
/// `MADV_SOFT_OFFLINE`
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )))]
LinuxSoftOffline = linux_raw_sys::general::MADV_SOFT_OFFLINE,
/// `MADV_MERGEABLE`
LinuxMergeable = linux_raw_sys::general::MADV_MERGEABLE,
@@ -222,3 +227,17 @@ impl Advice {
/// `LinuxDontNeed` for the Linux behavior.
pub const DontNeed: Self = Self::Normal;
}
+
+bitflags! {
+ /// `O_*` flags for use with [`userfaultfd`].
+ ///
+ /// [`userfaultfd`]: crate::io::userfaultfd
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct UserfaultfdFlags: c::c_uint {
+ /// `O_CLOEXEC`
+ const CLOEXEC = linux_raw_sys::general::O_CLOEXEC;
+ /// `O_NONBLOCK`
+ const NONBLOCK = linux_raw_sys::general::O_NONBLOCK;
+ }
+}
diff --git a/vendor/rustix/src/backend/linux_raw/mod.rs b/vendor/rustix/src/backend/linux_raw/mod.rs
index cd5805f88..c3018930f 100644
--- a/vendor/rustix/src/backend/linux_raw/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/mod.rs
@@ -51,6 +51,10 @@ pub(crate) mod io;
pub(crate) mod io_uring;
#[cfg(feature = "mm")]
pub(crate) mod mm;
+#[cfg(feature = "mount")]
+pub(crate) mod mount;
+#[cfg(all(feature = "fs", not(feature = "mount")))]
+pub(crate) mod mount; // for deprecated mount functions in "fs"
#[cfg(feature = "net")]
pub(crate) mod net;
#[cfg(any(
diff --git a/vendor/rustix/src/backend/linux_raw/mount/mod.rs b/vendor/rustix/src/backend/linux_raw/mount/mod.rs
new file mode 100644
index 000000000..1e0181a99
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/mod.rs
@@ -0,0 +1,2 @@
+pub(crate) mod syscalls;
+pub(crate) mod types;
diff --git a/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs
new file mode 100644
index 000000000..77c2a181d
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs
@@ -0,0 +1,239 @@
+//! linux_raw syscalls supporting `rustix::mount`.
+//!
+//! # Safety
+//!
+//! See the `rustix::backend` module documentation for details.
+#![allow(unsafe_code)]
+#![allow(clippy::undocumented_unsafe_blocks)]
+
+use crate::backend::conv::ret;
+#[cfg(feature = "mount")]
+use crate::backend::conv::{ret_owned_fd, slice, zero};
+#[cfg(feature = "mount")]
+use crate::fd::{BorrowedFd, OwnedFd};
+use crate::ffi::CStr;
+use crate::io;
+
+#[inline]
+pub(crate) fn mount(
+ source: Option<&CStr>,
+ target: &CStr,
+ file_system_type: Option<&CStr>,
+ flags: super::types::MountFlagsArg,
+ data: Option<&CStr>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_mount,
+ source,
+ target,
+ file_system_type,
+ flags,
+ data
+ ))
+ }
+}
+
+#[inline]
+pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
+ unsafe { ret(syscall_readonly!(__NR_umount2, target, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsopen(fs_name: &CStr, flags: super::types::FsOpenFlags) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_fsopen, fs_name, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsmount(
+ fs_fd: BorrowedFd<'_>,
+ flags: super::types::FsMountFlags,
+ attr_flags: super::types::MountAttrFlags,
+) -> io::Result<()> {
+ unsafe { ret(syscall_readonly!(__NR_fsmount, fs_fd, flags, attr_flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn move_mount(
+ from_dfd: BorrowedFd<'_>,
+ from_pathname: &CStr,
+ to_dfd: BorrowedFd<'_>,
+ to_pathname: &CStr,
+ flags: super::types::MoveMountFlags,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_move_mount,
+ from_dfd,
+ from_pathname,
+ to_dfd,
+ to_pathname,
+ flags
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn open_tree(
+ dfd: BorrowedFd<'_>,
+ filename: &CStr,
+ flags: super::types::OpenTreeFlags,
+) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_open_tree, dfd, filename, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fspick(
+ dfd: BorrowedFd<'_>,
+ path: &CStr,
+ flags: super::types::FsPickFlags,
+) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_fspick, dfd, path, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_flag(fs_fd: BorrowedFd<'_>, key: &CStr) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetFlag,
+ key,
+ zero(),
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_string(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &CStr,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetString,
+ key,
+ value,
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_binary(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &[u8],
+) -> io::Result<()> {
+ let (value_addr, value_len) = slice(value);
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetBinary,
+ key,
+ value_addr,
+ value_len
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_fd(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetFd,
+ key,
+ zero(),
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_path(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ path: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetPath,
+ key,
+ path,
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_path_empty(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetPathEmpty,
+ key,
+ cstr!(""),
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_create(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::Create,
+ zero(),
+ zero(),
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_reconfigure(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::Reconfigure,
+ zero(),
+ zero(),
+ zero()
+ ))
+ }
+}
diff --git a/vendor/rustix/src/backend/linux_raw/mount/types.rs b/vendor/rustix/src/backend/linux_raw/mount/types.rs
new file mode 100644
index 000000000..808710c13
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/types.rs
@@ -0,0 +1,303 @@
+use crate::backend::c;
+use bitflags::bitflags;
+
+bitflags! {
+ /// `MS_*` constants for use with [`mount`].
+ ///
+ /// [`mount`]: crate::mount::mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountFlags: c::c_uint {
+ /// `MS_BIND`
+ const BIND = linux_raw_sys::general::MS_BIND;
+
+ /// `MS_DIRSYNC`
+ const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC;
+
+ /// `MS_LAZYTIME`
+ const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME;
+
+ /// `MS_MANDLOCK`
+ #[doc(alias = "MANDLOCK")]
+ const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK;
+
+ /// `MS_NOATIME`
+ const NOATIME = linux_raw_sys::general::MS_NOATIME;
+
+ /// `MS_NODEV`
+ const NODEV = linux_raw_sys::general::MS_NODEV;
+
+ /// `MS_NODIRATIME`
+ const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME;
+
+ /// `MS_NOEXEC`
+ const NOEXEC = linux_raw_sys::general::MS_NOEXEC;
+
+ /// `MS_NOSUID`
+ const NOSUID = linux_raw_sys::general::MS_NOSUID;
+
+ /// `MS_RDONLY`
+ const RDONLY = linux_raw_sys::general::MS_RDONLY;
+
+ /// `MS_REC`
+ const REC = linux_raw_sys::general::MS_REC;
+
+ /// `MS_RELATIME`
+ const RELATIME = linux_raw_sys::general::MS_RELATIME;
+
+ /// `MS_SILENT`
+ const SILENT = linux_raw_sys::general::MS_SILENT;
+
+ /// `MS_STRICTATIME`
+ const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME;
+
+ /// `MS_SYNCHRONOUS`
+ const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS;
+
+ /// `MS_NOSYMFOLLOW`
+ const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW;
+ }
+}
+
+bitflags! {
+ /// `MNT_*` constants for use with [`unmount`].
+ ///
+ /// [`unmount`]: crate::mount::unmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct UnmountFlags: c::c_uint {
+ /// `MNT_FORCE`
+ const FORCE = linux_raw_sys::general::MNT_FORCE;
+ /// `MNT_DETACH`
+ const DETACH = linux_raw_sys::general::MNT_DETACH;
+ /// `MNT_EXPIRE`
+ const EXPIRE = linux_raw_sys::general::MNT_EXPIRE;
+ /// `UMOUNT_NOFOLLOW`
+ const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSOPEN_*` constants for use with [`fsopen`].
+ ///
+ /// [`fsopen`]: crate::mount::fsopen
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsOpenFlags: c::c_uint {
+
+ /// `FSOPEN_CLOEXEC`
+ const FSOPEN_CLOEXEC = linux_raw_sys::general::FSOPEN_CLOEXEC;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSMOUNT_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsMountFlags: c::c_uint {
+ /// `FSMOUNT_CLOEXEC`
+ const FSMOUNT_CLOEXEC = linux_raw_sys::general::FSMOUNT_CLOEXEC;
+ }
+}
+
+/// `FSCONFIG_*` constants for use with the `fsconfig` syscall.
+#[cfg(feature = "mount")]
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+#[repr(u32)]
+pub(crate) enum FsConfigCmd {
+ /// `FSCONFIG_SET_FLAG`
+ SetFlag = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FLAG as u32,
+
+ /// `FSCONFIG_SET_STRING`
+ SetString = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_STRING as u32,
+
+ /// `FSCONFIG_SET_BINARY`
+ SetBinary = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_BINARY as u32,
+
+ /// `FSCONFIG_SET_PATH`
+ SetPath = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH as u32,
+
+ /// `FSCONFIG_SET_PATH_EMPTY`
+ SetPathEmpty = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH_EMPTY as u32,
+
+ /// `FSCONFIG_SET_FD`
+ SetFd = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FD as u32,
+
+ /// `FSCONFIG_CMD_CREATE`
+ Create = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_CREATE as u32,
+
+ /// `FSCONFIG_CMD_RECONFIGURE`
+ Reconfigure = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_RECONFIGURE as u32,
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `MOUNT_ATTR_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountAttrFlags: c::c_uint {
+ /// `MOUNT_ATTR_RDONLY`
+ const MOUNT_ATTR_RDONLY = linux_raw_sys::general::MOUNT_ATTR_RDONLY;
+
+ /// `MOUNT_ATTR_NOSUID`
+ const MOUNT_ATTR_NOSUID = linux_raw_sys::general::MOUNT_ATTR_NOSUID;
+
+ /// `MOUNT_ATTR_NODEV`
+ const MOUNT_ATTR_NODEV = linux_raw_sys::general::MOUNT_ATTR_NODEV;
+
+ /// `MOUNT_ATTR_NOEXEC`
+ const MOUNT_ATTR_NOEXEC = linux_raw_sys::general::MOUNT_ATTR_NOEXEC;
+
+ /// `MOUNT_ATTR__ATIME`
+ const MOUNT_ATTR__ATIME = linux_raw_sys::general::MOUNT_ATTR__ATIME;
+
+ /// `MOUNT_ATTR_RELATIME`
+ const MOUNT_ATTR_RELATIME = linux_raw_sys::general::MOUNT_ATTR_RELATIME;
+
+ /// `MOUNT_ATTR_NOATIME`
+ const MOUNT_ATTR_NOATIME = linux_raw_sys::general::MOUNT_ATTR_NOATIME;
+
+ /// `MOUNT_ATTR_STRICTATIME`
+ const MOUNT_ATTR_STRICTATIME = linux_raw_sys::general::MOUNT_ATTR_STRICTATIME;
+
+ /// `MOUNT_ATTR_NODIRATIME`
+ const MOUNT_ATTR_NODIRATIME = linux_raw_sys::general::MOUNT_ATTR_NODIRATIME;
+
+ /// `MOUNT_ATTR_NOUSER`
+ const MOUNT_ATTR_IDMAP = linux_raw_sys::general::MOUNT_ATTR_IDMAP;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_NOSYMFOLLOW = linux_raw_sys::general::MOUNT_ATTR_NOSYMFOLLOW;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_SIZE_VER0 = linux_raw_sys::general::MOUNT_ATTR_SIZE_VER0;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `MOVE_MOUNT_*` constants for use with [`move_mount`].
+ ///
+ /// [`move_mount`]: crate::mount::move_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MoveMountFlags: c::c_uint {
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_F_SYMLINKS;
+
+ /// `MOVE_MOUNT_F_AUTOMOUNTS`
+ const MOVE_MOUNT_F_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_F_AUTOMOUNTS;
+
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_F_EMPTY_PATH;
+
+ /// `MOVE_MOUNT_T_SYMLINKS`
+ const MOVE_MOUNT_T_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_T_SYMLINKS;
+
+ /// `MOVE_MOUNT_T_AUTOMOUNTS`
+ const MOVE_MOUNT_T_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_T_AUTOMOUNTS;
+
+ /// `MOVE_MOUNT_T_EMPTY_PATH`
+ const MOVE_MOUNT_T_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_T_EMPTY_PATH;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT_SET_GROUP = linux_raw_sys::general::MOVE_MOUNT_SET_GROUP;
+
+ // TODO: add when linux 6.5 is released
+ // /// `MOVE_MOUNT_BENEATH`
+ // const MOVE_MOUNT_BENEATH = linux_raw_sys::general::MOVE_MOUNT_BENEATH;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT__MASK = linux_raw_sys::general::MOVE_MOUNT__MASK;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `OPENTREE_*` constants for use with [`open_tree`].
+ ///
+ /// [`open_tree`]: crate::mount::open_tree
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct OpenTreeFlags: c::c_uint {
+ /// `OPENTREE_CLONE`
+ const OPEN_TREE_CLONE = linux_raw_sys::general::OPEN_TREE_CLONE;
+
+ /// `OPENTREE_CLOEXEC`
+ const OPEN_TREE_CLOEXEC = linux_raw_sys::general::OPEN_TREE_CLOEXEC;
+
+ /// `AT_EMPTY_PATH`
+ const AT_EMPTY_PATH = linux_raw_sys::general::AT_EMPTY_PATH;
+
+ /// `AT_NO_AUTOMOUNT`
+ const AT_NO_AUTOMOUNT = linux_raw_sys::general::AT_NO_AUTOMOUNT;
+
+ /// `AT_RECURSIVE`
+ const AT_RECURSIVE = linux_raw_sys::general::AT_RECURSIVE;
+
+ /// `AT_SYMLINK_NOFOLLOW`
+ const AT_SYMLINK_NOFOLLOW = linux_raw_sys::general::AT_SYMLINK_NOFOLLOW;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSPICK_*` constants for use with [`fspick`].
+ ///
+ /// [`fspick`]: crate::mount::fspick
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsPickFlags: c::c_uint {
+ /// `FSPICK_CLOEXEC`
+ const FSPICK_CLOEXEC = linux_raw_sys::general::FSPICK_CLOEXEC;
+
+ /// `FSPICK_SYMLINK_NOFOLLOW`
+ const FSPICK_SYMLINK_NOFOLLOW = linux_raw_sys::general::FSPICK_SYMLINK_NOFOLLOW;
+
+ /// `FSPICK_NO_AUTOMOUNT`
+ const FSPICK_NO_AUTOMOUNT = linux_raw_sys::general::FSPICK_NO_AUTOMOUNT;
+
+ /// `FSPICK_EMPTY_PATH`
+ const FSPICK_EMPTY_PATH = linux_raw_sys::general::FSPICK_EMPTY_PATH;
+ }
+}
+
+bitflags! {
+ /// `MS_*` constants for use with [`change_mount`].
+ ///
+ /// [`change_mount`]: crate::mount::change_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountPropagationFlags: c::c_uint {
+ /// `MS_SILENT`
+ const SILENT = linux_raw_sys::general::MS_SILENT;
+ /// `MS_SHARED`
+ const SHARED = linux_raw_sys::general::MS_SHARED;
+ /// `MS_PRIVATE`
+ const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
+ /// `MS_SLAVE`
+ const SLAVE = linux_raw_sys::general::MS_SLAVE;
+ /// `MS_UNBINDABLE`
+ const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
+ /// `MS_REC`
+ const REC = linux_raw_sys::general::MS_REC;
+ }
+}
+
+bitflags! {
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub(crate) struct InternalMountFlags: c::c_uint {
+ const REMOUNT = linux_raw_sys::general::MS_REMOUNT;
+ const MOVE = linux_raw_sys::general::MS_MOVE;
+ }
+}
+
+#[repr(transparent)]
+pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);
diff --git a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
index dca331783..df35e63c8 100644
--- a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
@@ -430,6 +430,7 @@ pub(crate) fn send(fd: BorrowedFd<'_>, buf: &[u8], flags: SendFlags) -> io::Resu
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86",
target_arch = "x86_64",
@@ -440,6 +441,7 @@ pub(crate) fn send(fd: BorrowedFd<'_>, buf: &[u8], flags: SendFlags) -> io::Resu
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86_64",
))]
@@ -585,6 +587,7 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86",
target_arch = "x86_64",
@@ -595,6 +598,7 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86_64",
))]
diff --git a/vendor/rustix/src/backend/linux_raw/param/auxv.rs b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
index bf8935a0d..144ff10cd 100644
--- a/vendor/rustix/src/backend/linux_raw/param/auxv.rs
+++ b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
@@ -161,6 +161,7 @@ fn pr_get_auxv() -> crate::io::Result<Vec<u8>> {
/// On non-Mustang platforms, we read the aux vector via the `prctl`
/// `PR_GET_AUXV`, with a fallback to /proc/self/auxv for kernels that don't
/// support `PR_GET_AUXV`.
+#[cold]
fn init_auxv() {
match pr_get_auxv() {
Ok(buffer) => {
@@ -185,6 +186,7 @@ fn init_auxv() {
}
/// Process auxv entries from the open file `auxv`.
+#[cold]
fn init_from_auxv_file(auxv: OwnedFd) -> Option<()> {
let mut buffer = Vec::<u8>::with_capacity(512);
loop {
@@ -220,6 +222,7 @@ fn init_from_auxv_file(auxv: OwnedFd) -> Option<()> {
///
/// The buffer contains `Elf_aux_t` elements, though it need not be aligned;
/// function uses `read_unaligned` to read from it.
+#[cold]
unsafe fn init_from_auxp(mut auxp: *const Elf_auxv_t) -> Option<()> {
let mut pagesz = 0;
let mut clktck = 0;
@@ -272,6 +275,7 @@ unsafe fn init_from_auxp(mut auxp: *const Elf_auxv_t) -> Option<()> {
/// `base` is some value we got from a `AT_BASE` aux record somewhere,
/// which hopefully holds the value of the program interpreter in memory. Do a
/// series of checks to be as sure as we can that it's safe to use.
+#[cold]
unsafe fn check_interpreter_base(base: *const Elf_Ehdr) -> Option<()> {
check_elf_base(base)?;
Some(())
@@ -282,6 +286,7 @@ unsafe fn check_interpreter_base(base: *const Elf_Ehdr) -> Option<()> {
/// `base` is some value we got from a `AT_SYSINFO_EHDR` aux record somewhere,
/// which hopefully holds the value of the kernel-provided vDSO in memory. Do a
/// series of checks to be as sure as we can that it's safe to use.
+#[cold]
unsafe fn check_vdso_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
// In theory, we could check that we're not attempting to parse our own ELF
// image, as an additional check. However, older Linux toolchains don't
@@ -331,6 +336,7 @@ unsafe fn check_vdso_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
}
/// Check that `base` is a valid pointer to an ELF image.
+#[cold]
unsafe fn check_elf_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
// If we're reading a 64-bit auxv on a 32-bit platform, we'll see
// a zero `a_val` because `AT_*` values are never greater than
diff --git a/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs b/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
index d05a87e53..97739fcb5 100644
--- a/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
+++ b/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
@@ -41,27 +41,23 @@ extern "C" {
#[cfg(target_os = "android")]
const _SC_PAGESIZE: c::c_int = 39;
-#[cfg(target_os = "emscripten")]
-const _SC_PAGESIZE: c::c_int = 30;
#[cfg(target_os = "linux")]
const _SC_PAGESIZE: c::c_int = 30;
#[cfg(target_os = "android")]
const _SC_CLK_TCK: c::c_int = 6;
-#[cfg(target_os = "emscripten")]
-const _SC_CLK_TCK: c::c_int = 2;
#[cfg(target_os = "linux")]
const _SC_CLK_TCK: c::c_int = 2;
#[test]
fn test_abi() {
- assert_eq!(self::_SC_PAGESIZE, ::libc::_SC_PAGESIZE);
- assert_eq!(self::_SC_CLK_TCK, ::libc::_SC_CLK_TCK);
- assert_eq!(self::AT_PHDR, ::libc::AT_PHDR);
- assert_eq!(self::AT_PHNUM, ::libc::AT_PHNUM);
- assert_eq!(self::AT_HWCAP, ::libc::AT_HWCAP);
- assert_eq!(self::AT_HWCAP2, ::libc::AT_HWCAP2);
- assert_eq!(self::AT_EXECFN, ::libc::AT_EXECFN);
- assert_eq!(self::AT_SYSINFO_EHDR, ::libc::AT_SYSINFO_EHDR);
+ const_assert_eq!(self::_SC_PAGESIZE, ::libc::_SC_PAGESIZE);
+ const_assert_eq!(self::_SC_CLK_TCK, ::libc::_SC_CLK_TCK);
+ const_assert_eq!(self::AT_PHDR, ::libc::AT_PHDR);
+ const_assert_eq!(self::AT_PHNUM, ::libc::AT_PHNUM);
+ const_assert_eq!(self::AT_HWCAP, ::libc::AT_HWCAP);
+ const_assert_eq!(self::AT_HWCAP2, ::libc::AT_HWCAP2);
+ const_assert_eq!(self::AT_EXECFN, ::libc::AT_EXECFN);
+ const_assert_eq!(self::AT_SYSINFO_EHDR, ::libc::AT_SYSINFO_EHDR);
}
#[cfg(feature = "param")]
diff --git a/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs b/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
index ed121089d..e05094237 100644
--- a/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
@@ -23,7 +23,9 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
))]
{
@@ -32,7 +34,9 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
)))]
unsafe {
diff --git a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
index ac6e28901..5ec2755ff 100644
--- a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
@@ -33,7 +33,6 @@ use linux_raw_sys::general::{
RLIM64_INFINITY, RLIM_INFINITY,
};
use linux_raw_sys::ioctl::TIOCSCTTY;
-#[cfg(not(target_os = "wasi"))]
#[cfg(feature = "fs")]
use {crate::backend::conv::ret_c_uint_infallible, crate::fs::Mode};
diff --git a/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs b/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
index c2d1b07c1..529564c34 100644
--- a/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
@@ -13,12 +13,10 @@ use crate::ffi::CString;
use crate::io;
use crate::path::DecInt;
use crate::pty::OpenptFlags;
-#[cfg(any(apple, freebsdlike, linux_like, target_os = "fuchsia"))]
use alloc::vec::Vec;
use core::mem::MaybeUninit;
use linux_raw_sys::ioctl::{TIOCGPTN, TIOCGPTPEER, TIOCSPTLCK};
-#[cfg(any(apple, freebsdlike, linux_like, target_os = "fuchsia"))]
#[inline]
pub(crate) fn ptsname(fd: BorrowedFd, mut buffer: Vec<u8>) -> io::Result<CString> {
unsafe {
diff --git a/vendor/rustix/src/backend/linux_raw/reg.rs b/vendor/rustix/src/backend/linux_raw/reg.rs
index 206031dde..c4e495c52 100644
--- a/vendor/rustix/src/backend/linux_raw/reg.rs
+++ b/vendor/rustix/src/backend/linux_raw/reg.rs
@@ -1,9 +1,8 @@
//! Encapsulation for system call arguments and return values.
//!
-//! The inline-asm and outline-asm code paths do some amount of reordering
-//! of arguments; to ensure that we don't accidentally misroute an argument
-//! or return value, we use distinct types for each argument index and
-//! return value.
+//! The inline-asm code paths do some amount of reordering of arguments; to
+//! ensure that we don't accidentally misroute an argument or return value,
+//! we use distinct types for each argument index and return value.
//!
//! # Safety
//!
@@ -55,7 +54,7 @@ pub(super) struct A2(());
pub(super) struct A3(());
pub(super) struct A4(());
pub(super) struct A5(());
-#[cfg(target_arch = "mips")]
+#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub(super) struct A6(());
#[cfg(target_arch = "x86")]
pub(super) struct SocketArg;
@@ -67,7 +66,7 @@ impl ArgNumber for A2 {}
impl ArgNumber for A3 {}
impl ArgNumber for A4 {}
impl ArgNumber for A5 {}
-#[cfg(target_arch = "mips")]
+#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
impl ArgNumber for A6 {}
#[cfg(target_arch = "x86")]
impl ArgNumber for SocketArg {}
@@ -251,7 +250,7 @@ mod private {
impl Sealed for super::A3 {}
impl Sealed for super::A4 {}
impl Sealed for super::A5 {}
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
impl Sealed for super::A6 {}
#[cfg(target_arch = "x86")]
impl Sealed for super::SocketArg {}
diff --git a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
index b9814e731..f82e2187b 100644
--- a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
@@ -22,7 +22,7 @@ use crate::pid::Pid;
use crate::runtime::{How, Sigaction, Siginfo, Sigset, Stack};
use crate::signal::Signal;
use crate::timespec::Timespec;
-use crate::utils::optional_as_ptr;
+use crate::utils::option_as_ptr;
use core::mem::MaybeUninit;
#[cfg(target_pointer_width = "32")]
use linux_raw_sys::general::__kernel_old_timespec;
@@ -117,7 +117,7 @@ pub(crate) mod tls {
#[inline]
pub(crate) unsafe fn sigaction(signal: Signal, new: Option<Sigaction>) -> io::Result<Sigaction> {
let mut old = MaybeUninit::<Sigaction>::uninit();
- let new = optional_as_ptr(new.as_ref());
+ let new = option_as_ptr(new.as_ref());
ret(syscall!(
__NR_rt_sigaction,
signal,
@@ -131,7 +131,7 @@ pub(crate) unsafe fn sigaction(signal: Signal, new: Option<Sigaction>) -> io::Re
#[inline]
pub(crate) unsafe fn sigaltstack(new: Option<Stack>) -> io::Result<Stack> {
let mut old = MaybeUninit::<Stack>::uninit();
- let new = optional_as_ptr(new.as_ref());
+ let new = option_as_ptr(new.as_ref());
ret(syscall!(__NR_sigaltstack, new, &mut old))?;
Ok(old.assume_init())
}
@@ -144,7 +144,7 @@ pub(crate) unsafe fn tkill(tid: Pid, sig: Signal) -> io::Result<()> {
#[inline]
pub(crate) unsafe fn sigprocmask(how: How, new: Option<&Sigset>) -> io::Result<Sigset> {
let mut old = MaybeUninit::<Sigset>::uninit();
- let new = optional_as_ptr(new);
+ let new = option_as_ptr(new);
ret(syscall!(
__NR_rt_sigprocmask,
how,
@@ -189,7 +189,7 @@ pub(crate) fn sigwaitinfo(set: &Sigset) -> io::Result<Siginfo> {
#[inline]
pub(crate) fn sigtimedwait(set: &Sigset, timeout: Option<Timespec>) -> io::Result<Siginfo> {
let mut info = MaybeUninit::<Siginfo>::uninit();
- let timeout_ptr = optional_as_ptr(timeout.as_ref());
+ let timeout_ptr = option_as_ptr(timeout.as_ref());
// `rt_sigtimedwait_time64` was introduced in Linux 5.1. The old
// `rt_sigtimedwait` syscall is not y2038-compatible on 32-bit
@@ -237,7 +237,7 @@ unsafe fn sigtimedwait_old(
None => None,
};
- let old_timeout_ptr = optional_as_ptr(old_timeout.as_ref());
+ let old_timeout_ptr = option_as_ptr(old_timeout.as_ref());
let _signum = ret_c_int(syscall!(
__NR_rt_sigtimedwait,
diff --git a/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs b/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
index 5e21397bc..8f030e1c3 100644
--- a/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
@@ -63,7 +63,12 @@ pub(crate) fn tcsetattr(
// Translate from `optional_actions` into an ioctl request code. On MIPS,
// `optional_actions` already has `TCGETS` added to it.
let request = linux_raw_sys::ioctl::TCSETS2
- + if cfg!(any(target_arch = "mips", target_arch = "mips64")) {
+ + if cfg!(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )) {
optional_actions as u32 - linux_raw_sys::ioctl::TCSETS
} else {
optional_actions as u32
diff --git a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
index 422793690..316d26a1c 100644
--- a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
+++ b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
@@ -12,8 +12,8 @@
#[cfg(target_arch = "x86")]
use super::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
use super::vdso;
-#[cfg(all(asm, target_arch = "x86"))]
-use core::arch::asm;
+#[cfg(target_arch = "x86")]
+use core::arch::global_asm;
use core::mem::transmute;
use core::ptr::null_mut;
use core::sync::atomic::AtomicPtr;
@@ -45,6 +45,10 @@ pub(crate) fn clock_gettime(which_clock: ClockId) -> __kernel_timespec {
None => init_clock_gettime(),
};
let r0 = callee(which_clock as c::c_int, result.as_mut_ptr());
+ // The `ClockId` enum only contains clocks which never fail. It may be
+ // tempting to change this to `debug_assert_eq`, however they can still
+ // fail on uncommon kernel configs, so we leave this in place to ensure
+ // that we don't execute undefined behavior if they ever do fail.
assert_eq!(r0, 0);
result.assume_init()
}
@@ -227,6 +231,7 @@ pub(super) type SyscallType = unsafe extern "C" fn();
/// Initialize `CLOCK_GETTIME` and return its value.
#[cfg(feature = "time")]
+#[cold]
fn init_clock_gettime() -> ClockGettimeType {
init();
// SAFETY: Load the function address from static storage that we
@@ -236,6 +241,7 @@ fn init_clock_gettime() -> ClockGettimeType {
/// Initialize `SYSCALL` and return its value.
#[cfg(target_arch = "x86")]
+#[cold]
fn init_syscall() -> SyscallType {
init();
// SAFETY: Load the function address from static storage that we
@@ -310,21 +316,34 @@ unsafe fn _rustix_clock_gettime_via_syscall(
ret(syscall!(__NR_clock_gettime, c_int(clockid), res))
}
-/// A symbol pointing to an `int 0x80` instruction. This “function” is only
-/// called from assembly, and only with the x86 syscall calling convention,
-/// so its signature here is not its true signature.
-#[cfg(all(asm, target_arch = "x86"))]
-#[naked]
-unsafe extern "C" fn rustix_int_0x80() {
- asm!("int $$0x80", "ret", options(noreturn))
-}
-
-// The outline version of the `rustix_int_0x80` above.
-#[cfg(all(not(asm), target_arch = "x86"))]
+#[cfg(target_arch = "x86")]
extern "C" {
+ /// A symbol pointing to an `int 0x80` instruction. This “function” is only
+ /// called from assembly, and only with the x86 syscall calling convention.
+ /// so its signature here is not its true signature.
+ ///
+ /// This extern block and the `global_asm!` below can be replaced with
+ /// `#[naked]` if it's stabilized.
fn rustix_int_0x80();
}
+#[cfg(target_arch = "x86")]
+global_asm!(
+ r#"
+ .section .text.rustix_int_0x80,"ax",@progbits
+ .p2align 4
+ .weak rustix_int_0x80
+ .hidden rustix_int_0x80
+ .type rustix_int_0x80, @function
+rustix_int_0x80:
+ .cfi_startproc
+ int 0x80
+ ret
+ .cfi_endproc
+ .size rustix_int_0x80, .-rustix_int_0x80
+"#
+);
+
fn minimal_init() {
// SAFETY: Store default function addresses in static storage so that if we
// end up making any system calls while we read the vDSO, they'll work.
@@ -380,9 +399,9 @@ fn init() {
let ptr = vdso.sym(cstr!("LINUX_4.15"), cstr!("__vdso_clock_gettime"));
#[cfg(target_arch = "powerpc64")]
let ptr = vdso.sym(cstr!("LINUX_2.6.15"), cstr!("__kernel_clock_gettime"));
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
let ptr = vdso.sym(cstr!("LINUX_2.6"), cstr!("__vdso_clock_gettime64"));
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
let ptr = vdso.sym(cstr!("LINUX_2.6"), cstr!("__vdso_clock_gettime"));
// On all 64-bit platforms, the 64-bit `clock_gettime` symbols are
@@ -392,7 +411,12 @@ fn init() {
// On some 32-bit platforms, the 64-bit `clock_gettime` symbols are not
// available on older kernel versions.
- #[cfg(any(target_arch = "arm", target_arch = "mips", target_arch = "x86"))]
+ #[cfg(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "x86"
+ ))]
let ok = !ptr.is_null();
if ok {