File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/aero_kernel/src/drivers Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ impl<'a> Msix<'a> {
124
124
message_control. set_bit ( 15 , true ) ; // enable MSI-X
125
125
message_control. set_bit ( 14 , false ) ; // function mask
126
126
127
+ header. disable_legacy_irq ( ) ;
127
128
header. write :: < u16 > ( offset + 2 , message_control as u32 ) ;
128
129
}
129
130
@@ -649,6 +650,15 @@ impl PciHeader {
649
650
unsafe { self . write :: < u16 > ( 0x04 , command | ( 1 << 2 ) ) }
650
651
}
651
652
653
+ pub fn disable_legacy_irq ( & self ) {
654
+ // Set the Interrupt Disable bit, which is bit 10 of the Command register
655
+ // (at Configuration Space offset 0x4) to disable legacy interrupts.
656
+ let mut command = unsafe { self . read :: < u16 > ( 0x04 ) } ;
657
+ command. set_bit ( 10 , true ) ;
658
+
659
+ unsafe { self . write :: < u16 > ( 0x04 , command) }
660
+ }
661
+
652
662
/// Returns the value stored in the PCI vendor ID register which is used to identify
653
663
/// the manufacturer of the PCI device.
654
664
pub fn get_vendor ( & self ) -> Vendor {
You can’t perform that action at this time.
0 commit comments