mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-25 01:43:30 +00:00
PCI设备中断重构,删去USB相关代码 (#285)
* 修复ecam无法获取MCFG table的问题 * 完善pcie * 完善irq的错误检测机制
This commit is contained in:
23
kernel/src/arch/x86_64/msi.rs
Normal file
23
kernel/src/arch/x86_64/msi.rs
Normal file
@ -0,0 +1,23 @@
|
||||
use crate::driver::pci::pci_irq::TriggerMode;
|
||||
/// @brief 获得MSI Message Address
|
||||
/// @param processor 目标CPU ID号
|
||||
/// @return MSI Message Address
|
||||
pub fn ia64_pci_get_arch_msi_message_address(processor: u16) -> u32 {
|
||||
0xfee00000 as u32 | ((processor as u32) << 12)
|
||||
}
|
||||
/// @brief 获得MSI Message Data
|
||||
/// @param vector 分配的中断向量号
|
||||
/// @param processor 目标CPU ID号
|
||||
/// @param trigger 申请中断的触发模式,MSI默认为边沿触发
|
||||
/// @return MSI Message Address
|
||||
pub fn ia64_pci_get_arch_msi_message_data(
|
||||
vector: u16,
|
||||
processor: u16,
|
||||
trigger: TriggerMode,
|
||||
) -> u32 {
|
||||
match trigger {
|
||||
TriggerMode::EdgeTrigger => vector as u32,
|
||||
TriggerMode::AssertHigh => vector as u32 | 1 << 15 | 1 << 14,
|
||||
TriggerMode::AssertLow => vector as u32 | 1 << 15,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user