Skip to content

Commit 274b09e

Browse files
committed
Merge #599
599: Support powerpc64 r=Susurrus The test_ioctl values are computed using ioctl-test.c
2 parents 96f26db + a5130ac commit 274b09e

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ matrix:
3535
rust: 1.13.0
3636
- env: TARGET=powerpc-unknown-linux-gnu
3737
rust: 1.13.0
38-
# - env: TARGET=powerpc64-unknown-linux-gnu
39-
# - env: TARGET=powerpc64le-unknown-linux-gnu
38+
- env: TARGET=powerpc64-unknown-linux-gnu
39+
rust: 1.13.0
40+
- env: TARGET=powerpc64le-unknown-linux-gnu
41+
rust: 1.13.0
4042
# - env: TARGET=s390x-unknown-linux-gnu
4143
- env: TARGET=x86_64-unknown-linux-gnu
4244
rust: 1.13.0

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Tier 1:
5555
* arm-unknown-linux-gnueabi
5656
* x86_64-unknown-freebsd
5757
* powerpc-unknown-linux-gnu
58+
* powerpc64-unknown-linux-gnu
59+
* powerpc64le-unknown-linux-gnu
5860
* mips-unknown-linux-gnu
5961
* mipsel-unknown-linux-gnu
6062
* i686-unknown-linux-musl

src/sys/ioctl/platform/linux.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub const NRBITS: u32 = 8;
22
pub const TYPEBITS: u32 = 8;
33

4-
#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
4+
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "powerpc64"))]
55
mod consts {
66
pub const NONE: u8 = 1;
77
pub const READ: u8 = 2;
@@ -15,6 +15,7 @@ mod consts {
1515
target_arch = "x86",
1616
target_arch = "arm",
1717
target_arch = "x86_64",
18+
target_arch = "powerpc64",
1819
target_arch = "aarch64")))]
1920
use this_arch_not_supported;
2021

src/sys/syscall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod arch {
5454
pub static MEMFD_CREATE: Syscall = 354;
5555
}
5656

57-
#[cfg(target_arch = "powerpc")]
57+
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
5858
mod arch {
5959
use libc::c_long;
6060

test/sys/test_ioctl.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ioctl!(readwrite buf readwritebuf_test with 0, 0; u32);
2020
mod linux {
2121
#[test]
2222
fn test_op_none() {
23-
if cfg!(any(target_arch = "mips", target_arch="powerpc")){
23+
if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
2424
assert_eq!(io!(b'q', 10), 0x2000710A);
2525
assert_eq!(io!(b'a', 255), 0x200061FF);
2626
} else {
@@ -31,7 +31,7 @@ mod linux {
3131

3232
#[test]
3333
fn test_op_write() {
34-
if cfg!(any(target_arch = "mips", target_arch="powerpc")){
34+
if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
3535
assert_eq!(iow!(b'z', 10, 1), 0x80017A0A);
3636
assert_eq!(iow!(b'z', 10, 512), 0x82007A0A);
3737
} else {
@@ -43,12 +43,17 @@ mod linux {
4343
#[cfg(target_pointer_width = "64")]
4444
#[test]
4545
fn test_op_write_64() {
46-
assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
46+
if cfg!(any(target_arch="powerpc64")){
47+
assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
48+
} else {
49+
assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
50+
}
51+
4752
}
4853

4954
#[test]
5055
fn test_op_read() {
51-
if cfg!(any(target_arch = "mips", target_arch="powerpc")){
56+
if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
5257
assert_eq!(ior!(b'z', 10, 1), 0x40017A0A);
5358
assert_eq!(ior!(b'z', 10, 512), 0x42007A0A);
5459
} else {
@@ -60,7 +65,11 @@ mod linux {
6065
#[cfg(target_pointer_width = "64")]
6166
#[test]
6267
fn test_op_read_64() {
63-
assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
68+
if cfg!(any(target_arch="powerpc64")){
69+
assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
70+
} else {
71+
assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
72+
}
6473
}
6574

6675
#[test]

0 commit comments

Comments
 (0)