diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-06-20 01:30:39 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-06-20 01:30:39 +0000 |
commit | 274b09eee1cdac51ceea9238d2e584babae48720 (patch) | |
tree | 612c4f14467dfed04fe312b1166768e4ddb74b4c | |
parent | 96f26dbed61ce0a7c99a73e93fa06aea2d764727 (diff) | |
parent | a5130ace13a46309b4f5863c27c34a60bf2610ec (diff) | |
download | nix-274b09eee1cdac51ceea9238d2e584babae48720.zip |
Merge #599
599: Support powerpc64 r=Susurrus
The test_ioctl values are computed using ioctl-test.c
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/sys/ioctl/platform/linux.rs | 3 | ||||
-rw-r--r-- | src/sys/syscall.rs | 2 | ||||
-rw-r--r-- | test/sys/test_ioctl.rs | 19 |
5 files changed, 23 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml index afeeb72d..3c63f12a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,10 @@ matrix: rust: 1.13.0 - env: TARGET=powerpc-unknown-linux-gnu rust: 1.13.0 - # - env: TARGET=powerpc64-unknown-linux-gnu - # - env: TARGET=powerpc64le-unknown-linux-gnu + - env: TARGET=powerpc64-unknown-linux-gnu + rust: 1.13.0 + - env: TARGET=powerpc64le-unknown-linux-gnu + rust: 1.13.0 # - env: TARGET=s390x-unknown-linux-gnu - env: TARGET=x86_64-unknown-linux-gnu rust: 1.13.0 @@ -55,6 +55,8 @@ Tier 1: * arm-unknown-linux-gnueabi * x86_64-unknown-freebsd * powerpc-unknown-linux-gnu + * powerpc64-unknown-linux-gnu + * powerpc64le-unknown-linux-gnu * mips-unknown-linux-gnu * mipsel-unknown-linux-gnu * i686-unknown-linux-musl diff --git a/src/sys/ioctl/platform/linux.rs b/src/sys/ioctl/platform/linux.rs index aacea459..efdd17bb 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"))] +#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "powerpc64"))] mod consts { pub const NONE: u8 = 1; pub const READ: u8 = 2; @@ -15,6 +15,7 @@ mod consts { target_arch = "x86", target_arch = "arm", target_arch = "x86_64", + target_arch = "powerpc64", target_arch = "aarch64")))] use this_arch_not_supported; diff --git a/src/sys/syscall.rs b/src/sys/syscall.rs index 692b4cef..cff2cc99 100644 --- a/src/sys/syscall.rs +++ b/src/sys/syscall.rs @@ -54,7 +54,7 @@ mod arch { pub static MEMFD_CREATE: Syscall = 354; } -#[cfg(target_arch = "powerpc")] +#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] mod arch { use libc::c_long; diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs index b68622d1..55b61fd7 100644 --- a/test/sys/test_ioctl.rs +++ b/test/sys/test_ioctl.rs @@ -20,7 +20,7 @@ ioctl!(readwrite buf readwritebuf_test with 0, 0; u32); mod linux { #[test] fn test_op_none() { - if cfg!(any(target_arch = "mips", target_arch="powerpc")){ + if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(io!(b'q', 10), 0x2000710A); assert_eq!(io!(b'a', 255), 0x200061FF); } else { @@ -31,7 +31,7 @@ mod linux { #[test] fn test_op_write() { - if cfg!(any(target_arch = "mips", target_arch="powerpc")){ + if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(iow!(b'z', 10, 1), 0x80017A0A); assert_eq!(iow!(b'z', 10, 512), 0x82007A0A); } else { @@ -43,12 +43,17 @@ mod linux { #[cfg(target_pointer_width = "64")] #[test] fn test_op_write_64() { - assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A); + if cfg!(any(target_arch="powerpc64")){ + assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x80007A0A); + } else { + assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A); + } + } #[test] fn test_op_read() { - if cfg!(any(target_arch = "mips", target_arch="powerpc")){ + if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(ior!(b'z', 10, 1), 0x40017A0A); assert_eq!(ior!(b'z', 10, 512), 0x42007A0A); } else { @@ -60,7 +65,11 @@ mod linux { #[cfg(target_pointer_width = "64")] #[test] fn test_op_read_64() { - assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A); + if cfg!(any(target_arch="powerpc64")){ + assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x40007A0A); + } else { + assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A); + } } #[test] |