summaryrefslogtreecommitdiff
path: root/src/sched.rs
diff options
context:
space:
mode:
authorGabriele Svelto <gsvelto@mozilla.com>2016-03-07 16:05:06 +0100
committerGabriele Svelto <gsvelto@mozilla.com>2016-03-07 16:05:06 +0100
commit86b3cfabd9c8ac4eeee7d75afebaa69f57744854 (patch)
tree6061332a00f00a4e02ce642f65ee868003af9cfe /src/sched.rs
parent3f0c3e13a22379dccbe826336f1805a98cf6cecc (diff)
downloadnix-86b3cfabd9c8ac4eeee7d75afebaa69f57744854.zip
Add support for MIPS targets
Closes #300
Diffstat (limited to 'src/sched.rs')
-rw-r--r--src/sched.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/sched.rs b/src/sched.rs
index e59b8b05..30308446 100644
--- a/src/sched.rs
+++ b/src/sched.rs
@@ -87,7 +87,7 @@ mod cpuset_attribs {
}
}
-#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))]
+#[cfg(all(any(target_arch = "arm", target_arch = "mips"), target_os = "android"))]
mod cpuset_attribs {
use super::CpuMask;
// bionic only supports up to 32 independent CPUs, instead of 1024.
@@ -105,6 +105,22 @@ mod cpuset_attribs {
}
}
+#[cfg(all(any(target_arch = "arm", target_arch = "mips"), target_os = "linux"))]
+mod cpuset_attribs {
+ use super::CpuMask;
+ pub const CPU_SETSIZE: usize = 1024;
+ pub const CPU_MASK_BITS: usize = 32;
+
+ #[inline]
+ pub fn set_cpu_mask_flag(cur: CpuMask, bit: usize) -> CpuMask {
+ cur | (1u32 << bit)
+ }
+
+ #[inline]
+ pub fn clear_cpu_mask_flag(cur: CpuMask, bit: usize) -> CpuMask {
+ cur & !(1u32 << bit)
+ }
+}
pub type CloneCb<'a> = Box<FnMut() -> isize + 'a>;