Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86_64 virtio:get irqnum support for x86_64 virtio dev #97

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions modules/axconfig/src/platform/pc-x86.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mmio-regions = [
["0xfec0_0000", "0x1000"], # IO APIC
["0xfed0_0000", "0x1000"], # HPET
["0xfee0_0000", "0x1000"], # Local APIC
["0xe_0000", "0x2_0000"], #ACPI
lklake marked this conversation as resolved.
Show resolved Hide resolved
]
# VirtIO MMIO regions with format (`base_paddr`, `size`).
virtio-mmio-regions = []
Expand Down
2 changes: 2 additions & 0 deletions modules/axhal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ x86 = "0.52"
x86_64 = "0.14"
x2apic = "0.4"
raw-cpuid = "11.0"
acpi = "4.1.1"
aml = "0.16.4"

[target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies]
riscv = "0.10"
Expand Down
3 changes: 2 additions & 1 deletion modules/axhal/src/arch/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod context;
mod gdt;
mod idt;

#[cfg(target_os = "none")]
// #[cfg(target_os = "none")]
mod trap;
lklake marked this conversation as resolved.
Show resolved Hide resolved

use core::arch::asm;
Expand All @@ -14,6 +14,7 @@ use x86_64::instructions::interrupts;
pub use self::context::{ExtendedState, FxsaveArea, TaskContext, TrapFrame};
pub use self::gdt::GdtStruct;
pub use self::idt::IdtStruct;
pub use self::trap::{IRQ_VECTOR_START, IRQ_VECTOR_END};
pub use x86_64::structures::tss::TaskStateSegment;

/// Allows the current CPU to respond to interrupts.
Expand Down
5 changes: 3 additions & 2 deletions modules/axhal/src/arch/x86_64/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use super::context::TrapFrame;

core::arch::global_asm!(include_str!("trap.S"));

const IRQ_VECTOR_START: u8 = 0x20;
const IRQ_VECTOR_END: u8 = 0xff;
pub const IRQ_VECTOR_START: u8 = 0x20;
pub const IRQ_VECTOR_END: u8 = 0xff;

#[no_mangle]
fn x86_trap_handler(tf: &mut TrapFrame) {
Expand Down Expand Up @@ -44,3 +44,4 @@ fn x86_trap_handler(tf: &mut TrapFrame) {
}
}
}

Loading