diff options
Diffstat (limited to 'vendor/rustix/src/backend/linux_raw/mm/types.rs')
-rw-r--r-- | vendor/rustix/src/backend/linux_raw/mm/types.rs | 63 |
1 files changed, 41 insertions, 22 deletions
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; + } +} |