diff --git a/local/recipes/drivers/redox-driver-sys/source/src/io.rs b/local/recipes/drivers/redox-driver-sys/source/src/io.rs index edc5be1c60..01b1ba477c 100644 --- a/local/recipes/drivers/redox-driver-sys/source/src/io.rs +++ b/local/recipes/drivers/redox-driver-sys/source/src/io.rs @@ -1,10 +1,11 @@ #[cfg(all(target_arch = "x86_64", target_os = "redox"))] +use syscall as redox_syscall; use crate::Result; #[cfg(all(target_arch = "x86_64", target_os = "redox"))] -pub fn acquire_iopl() -> Result<()> { +pub fn acquire_iopl() -> Result<(), crate::DriverError> { extern "C" { fn redox_cur_thrfd_v0() -> usize; } @@ -20,8 +21,9 @@ pub fn acquire_iopl() -> Result<()> { } #[cfg(all(target_arch = "x86_64", not(target_os = "redox")))] -pub fn acquire_iopl() -> Result<(), crate::DriverError> { - Err(crate::DriverError::Other(String::from( +pub fn acquire_iopl() -> std::result::Result<(), crate::DriverError> { + use crate::DriverError; + Err(DriverError::Other(String::from( "acquire_iopl: only available on Redox", ))) } @@ -67,8 +69,3 @@ pub fn inw(port: u16) -> u16 { pub fn outw(port: u16, val: u16) { unsafe { core::arch::asm!("outw {1:x}, {0:x}", in(reg) val, in(reg) port) }; } - -#[cfg(all(target_arch = "x86_64", target_os = "redox"))] - - -use crate::Result;