File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,19 @@ impl EndpointHeader {
413413 let data = unsafe { access. read ( self . 0 , 0x3c ) } ;
414414 ( data. get_bits ( 8 ..16 ) as u8 , data. get_bits ( 0 ..8 ) as u8 )
415415 }
416+
417+ pub fn update_interrupt < F > ( & mut self , access : & impl ConfigRegionAccess , f : F )
418+ where
419+ F : FnOnce ( ( InterruptPin , InterruptLine ) ) -> ( InterruptPin , InterruptLine ) ,
420+ {
421+ let mut data = unsafe { access. read ( self . 0 , 0x3c ) } ;
422+ let ( new_pin, new_line) = f ( ( data. get_bits ( 8 ..16 ) as u8 , data. get_bits ( 0 ..8 ) as u8 ) ) ;
423+ data. set_bits ( 8 ..16 , new_pin. into ( ) ) ;
424+ data. set_bits ( 0 ..8 , new_line. into ( ) ) ;
425+ unsafe {
426+ access. write ( self . 0 , 0x3c , data) ;
427+ }
428+ }
416429}
417430
418431/// PCI-PCI Bridges have a Type-1 header, so the remainder of the header is of the form:
You can’t perform that action at this time.
0 commit comments