From c43d3eddd9a0e756f241ad1ea83ca4747b7a5f81 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 18 Jun 2026 18:39:44 +0300 Subject: [PATCH] fix(redox-driver-sys): restore redox_syscall alias in io.rs and fix Result type io.rs uses redox_syscall::dup, ::CallFlags, ::ProcSchemeVerb but was missing the 'use syscall as redox_syscall' alias (was removed earlier because cargo check passed locally without it, but actual build needs it). Also fixed: the non-redox arm of acquire_iopl was using crate::Result which is a 1-generic type alias; std::result::Result with 2 generics is what's needed here. Removed leftover cfg attribute and duplicate use crate::Result. --- .../drivers/redox-driver-sys/source/src/io.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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;