Skip to content

Commit

Permalink
Merge #599
Browse files Browse the repository at this point in the history
599: Support powerpc64 r=Susurrus

The test_ioctl values are computed using ioctl-test.c
  • Loading branch information
bors[bot] committed Jun 20, 2017
2 parents 96f26db + a5130ac commit 274b09e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/sys/ioctl/platform/linux.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/sys/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 14 additions & 5 deletions test/sys/test_ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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]
Expand Down

0 comments on commit 274b09e

Please sign in to comment.