Skip to content

Commit d400c80

Browse files
committed
redox_hwio: Build from crates.io on non-FreeBSD
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent aa515f2 commit d400c80

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

Cargo.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

framework_lib/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ guid-create = { version = "0.5.0", default-features = false }
4040
uefi = { version = "0.20", features = ["alloc"] }
4141
uefi-services = "0.17"
4242
plain = "0.2.3"
43-
redox_hwio = { git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd", default-features = false }
43+
redox_hwio = { version = "0.1.6", default-features = false }
4444
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std", default-features = false }
4545

4646
[target.'cfg(windows)'.dependencies]
@@ -56,13 +56,18 @@ winreg = "0.55.0"
5656
[target.'cfg(unix)'.dependencies]
5757
libc = "0.2.155"
5858
nix = { version = "0.29.0", features = ["ioctl", "user"] }
59-
redox_hwio = { git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd" }
6059
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std" }
6160
env_logger = "0.11"
6261
clap = { version = "4.5", features = ["derive", "cargo"] }
6362
clap-num = { version = "1.2.0" }
6463
clap-verbosity-flag = { version = "2.2.1" }
6564

65+
[target.'cfg(target_os="linux")'.dependencies]
66+
redox_hwio = "0.1.6"
67+
68+
[target.'cfg(target_os="freebsd")'.dependencies]
69+
redox_hwio_freebsd = { package = "redox_hwio", git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd" }
70+
6671
[target.'cfg(windows)'.dependencies.windows]
6772
version = "0.59.0"
6873
features = [

framework_lib/src/chromium_ec/portio.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use alloc::string::ToString;
44
use alloc::vec;
55
use alloc::vec::Vec;
66
use core::convert::TryInto;
7-
#[cfg(not(windows))]
7+
#[cfg(all(not(windows), not(target_os = "freebsd")))]
88
use hwio::{Io, Pio};
9+
#[cfg(target_os = "freebsd")]
10+
use hwio_freebsd::{Io, Pio};
911
#[cfg(target_os = "linux")]
1012
use libc::ioperm;
1113
use log::Level;

framework_lib/src/chromium_ec/portio_mec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use alloc::vec::Vec;
44

55
use log::Level;
66

7+
#[cfg(all(not(windows), not(target_os = "freebsd")))]
78
use hwio::{Io, Pio};
9+
#[cfg(target_os = "freebsd")]
10+
use hwio_freebsd::{Io, Pio};
811
#[cfg(target_os = "linux")]
912
use libc::ioperm;
1013

0 commit comments

Comments
 (0)