Fix cargo check for aarch64

This commit is contained in:
Wildan M
2025-12-11 18:47:46 +07:00
parent 713e40fba7
commit 04d5c5fee8
7 changed files with 57 additions and 7 deletions
+7
View File
@@ -15,12 +15,14 @@ use redox_scheme::wrappers::ReadinessBased;
use redox_scheme::Socket;
use std::cell::RefCell;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub mod device;
fn main() {
pcid_interface::pci_daemon(daemon);
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
let pci_config = pcid_handle.config();
@@ -135,3 +137,8 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
std::process::exit(0);
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
unimplemented!()
}
+7
View File
@@ -8,12 +8,14 @@ use std::{env, usize};
use event::{user_data, EventQueue};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub mod device;
fn main() {
daemon::Daemon::new(daemon);
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn daemon(daemon: daemon::Daemon) -> ! {
let mut args = env::args().skip(1);
@@ -113,3 +115,8 @@ fn daemon(daemon: daemon::Daemon) -> ! {
std::process::exit(0);
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
fn daemon(daemon: daemon::Daemon) -> ! {
unimplemented!()
}
+22 -1
View File
@@ -1,7 +1,14 @@
use common::{
io::{Io, Pio, ReadOnly, WriteOnly},
io::{Io, ReadOnly, WriteOnly},
timeout::Timeout,
};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
use common::io::Pio;
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
use common::io::Mmio;
use log::{debug, error, trace};
use std::fmt;
@@ -102,13 +109,22 @@ const DEFAULT_TIMEOUT: u64 = 50_000;
// Reset timeout in microseconds
const RESET_TIMEOUT: u64 = 500_000;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub struct Ps2 {
data: Pio<u8>,
status: ReadOnly<Pio<u8>>,
command: WriteOnly<Pio<u8>>,
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct Ps2 {
data: Mmio<u8>,
status: ReadOnly<Mmio<u8>>,
command: WriteOnly<Mmio<u8>>,
}
impl Ps2 {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn new() -> Self {
Ps2 {
data: Pio::new(0x60),
@@ -117,6 +133,11 @@ impl Ps2 {
}
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
pub fn new() -> Self {
unimplemented!()
}
fn status(&mut self) -> StatusFlags {
StatusFlags::from_bits_truncate(self.status.read())
}
+6
View File
@@ -29,6 +29,7 @@ pub const LEFT_BUTTON: u32 = 0x20;
pub const RIGHT_BUTTON: u32 = 0x10;
pub const MIDDLE_BUTTON: u32 = 0x08;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub unsafe fn cmd(cmd: u32, arg: u32) -> (u32, u32, u32, u32) {
let a: u32;
let b: u32;
@@ -62,6 +63,11 @@ pub unsafe fn cmd(cmd: u32, arg: u32) -> (u32, u32, u32, u32) {
(a, b, c, d)
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
pub unsafe fn cmd(cmd: u32, arg: u32) -> (u32, u32, u32, u32) {
unimplemented!()
}
pub fn enable(relative: bool) -> bool {
trace!("ps2d: Enable vmmouse");
+1 -1
View File
@@ -1,4 +1,4 @@
#![cfg_attr(target_arch = "aarch64", feature(stdsimd))] // Required for yield instruction
// #![cfg_attr(target_arch = "aarch64", feature(stdsimd))] // Required for yield instruction
use std::io::{Read, Write};
use std::os::fd::AsRawFd;
+8
View File
@@ -13,14 +13,17 @@ use std::{
time::Duration,
};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
use crate::ide::{AtaCommand, AtaDisk, Channel};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub mod ide;
fn main() {
pcid_interface::pci_daemon(daemon);
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
let pci_config = pcid_handle.config();
@@ -294,3 +297,8 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
std::process::exit(0);
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
unimplemented!()
}
+6 -5
View File
@@ -6,13 +6,12 @@ use std::io::{Read, Write};
use std::os::unix::io::AsRawFd;
use std::{iter, mem};
use common::io::{Io, Mmio, Pio};
use common::io::{Io, Mmio};
use pcid_interface::PciFunctionHandle;
use common::dma::Dma;
use crate::bga::Bga;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod bga;
const VBOX_REQUEST_HEADER_VERSION: u32 = 0x10001;
@@ -236,9 +235,11 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let mut irq_file = irq.irq_handle("vboxd");
let mut port = Pio::<u32>::new(bar0 as u16);
let address = unsafe { pcid_handle.map_bar(1) }.ptr.as_ptr();
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
{
let mut port = common::io::Pio::<u32>::new(bar0 as u16);
let vmmdev = unsafe { &mut *(address as *mut VboxVmmDev) };
let mut guest_info = VboxGuestInfo::new().expect("vboxd: failed to map GuestInfo");
@@ -278,7 +279,7 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
libredox::call::setrens(0, 0).expect("vboxd: failed to enter null namespace");
let mut bga = Bga::new();
let mut bga = crate::bga::Bga::new();
let get_mouse = VboxGetMouse::new().expect("vboxd: failed to map GetMouse");
let display_change = VboxDisplayChange::new().expect("vboxd: failed to map DisplayChange");
let ack_events = VboxAckEvents::new().expect("vboxd: failed to map AckEvents");