Skip to content

Commit b3c5d5b

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

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
@@ -39,7 +39,7 @@ rusb = { version = "0.9.4", optional = true }
3939
uefi = { version = "0.20", features = ["alloc"] }
4040
uefi-services = "0.17"
4141
plain = "0.2.3"
42-
redox_hwio = { git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd", default-features = false }
42+
redox_hwio = { version = "0.1.6", default-features = false }
4343
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std", default-features = false }
4444
guid-create-no-std = { package = "guid-create", git = "https://github.com/FrameworkComputer/guid-create", branch = "no_std", default-features = false }
4545

@@ -56,14 +56,19 @@ guid-create = "0.4.1"
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
guid-create = "0.4.1"
6665

66+
[target.'cfg(target_os="linux")'.dependencies]
67+
redox_hwio = "0.1.6"
68+
69+
[target.'cfg(target_os="freebsd")'.dependencies]
70+
redox_hwio_freebsd = { package = "redox_hwio", git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd" }
71+
6772
[target.'cfg(windows)'.dependencies.windows]
6873
version = "0.59.0"
6974
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)