From 6dd3625e45d3eb4c29000b04ad8c029e37e109f9 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 8 Jul 2017 19:48:31 -0700 Subject: Enable ioctl on mips64 and s390x --- src/sys/ioctl/platform/linux.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sys') diff --git a/src/sys/ioctl/platform/linux.rs b/src/sys/ioctl/platform/linux.rs index efdd17bb..cdf5b20a 100644 --- a/src/sys/ioctl/platform/linux.rs +++ b/src/sys/ioctl/platform/linux.rs @@ -1,7 +1,7 @@ pub const NRBITS: u32 = 8; pub const TYPEBITS: u32 = 8; -#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "powerpc64"))] +#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64"))] mod consts { pub const NONE: u8 = 1; pub const READ: u8 = 2; @@ -12,16 +12,19 @@ mod consts { #[cfg(not(any(target_arch = "powerpc", target_arch = "mips", + target_arch = "mips64", target_arch = "x86", target_arch = "arm", target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "s390x", target_arch = "aarch64")))] use this_arch_not_supported; // "Generic" ioctl protocol #[cfg(any(target_arch = "x86", target_arch = "arm", + target_arch = "s390x", target_arch = "x86_64", target_arch = "aarch64"))] mod consts { -- cgit v1.2.3 From 38d0e55ae5a7f12bf2e84c435f8a00281d72d128 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 8 Jul 2017 20:47:28 -0700 Subject: SIGSTKFLT doesn't exist on Linux/GNU/mips(64) --- src/sys/signal.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sys') diff --git a/src/sys/signal.rs b/src/sys/signal.rs index ee952369..309919b7 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -32,7 +32,7 @@ pub enum Signal { SIGPIPE = libc::SIGPIPE, SIGALRM = libc::SIGALRM, SIGTERM = libc::SIGTERM, - #[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))] + #[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64"))))] SIGSTKFLT = libc::SIGSTKFLT, SIGCHLD = libc::SIGCHLD, SIGCONT = libc::SIGCONT, @@ -58,7 +58,7 @@ pub enum Signal { pub use self::Signal::*; -#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))] +#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64"))))] const SIGNALS: [Signal; 31] = [ SIGHUP, SIGINT, @@ -91,7 +91,7 @@ const SIGNALS: [Signal; 31] = [ SIGIO, SIGPWR, SIGSYS]; -#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), target_arch = "mips"))] +#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), any(target_arch = "mips", target_arch = "mips64")))] const SIGNALS: [Signal; 30] = [ SIGHUP, SIGINT, -- cgit v1.2.3 From e3594498c2e74482813642e023c1f126f7d74eb9 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 8 Jul 2017 21:38:26 -0700 Subject: Enable syscalls on s390x --- src/sys/syscall.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sys') diff --git a/src/sys/syscall.rs b/src/sys/syscall.rs index cff2cc99..f47d5126 100644 --- a/src/sys/syscall.rs +++ b/src/sys/syscall.rs @@ -64,6 +64,16 @@ mod arch { pub static MEMFD_CREATE: Syscall = 360; } +#[cfg(target_arch = "s390x")] +mod arch { + use libc::c_long; + + pub type Syscall = c_long; + + pub static SYSPIVOTROOT: Syscall = 217; + pub static MEMFD_CREATE: Syscall = 350; +} + extern { pub fn syscall(num: Syscall, ...) -> c_int; } -- cgit v1.2.3 From c83b33a2e527336aaadb90e636369ce2d64da942 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 8 Jul 2017 21:46:14 -0700 Subject: Support syscalls on mips64 --- src/sys/syscall.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/sys') diff --git a/src/sys/syscall.rs b/src/sys/syscall.rs index f47d5126..50866ca7 100644 --- a/src/sys/syscall.rs +++ b/src/sys/syscall.rs @@ -44,6 +44,7 @@ mod arch { pub static MEMFD_CREATE: Syscall = 385; } +// Rust on mips uses the N32 ABI #[cfg(target_arch = "mips")] mod arch { use libc::c_long; @@ -54,6 +55,17 @@ mod arch { pub static MEMFD_CREATE: Syscall = 354; } +// Rust on mips64 uses the N64 ABI +#[cfg(target_arch = "mips64")] +mod arch { + use libc::c_long; + + pub type Syscall = c_long; + + pub static SYSPIVOTROOT: Syscall = 151; + pub static MEMFD_CREATE: Syscall = 314; +} + #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] mod arch { use libc::c_long; -- cgit v1.2.3