@@ -84,7 +84,7 @@ fn add_virtio_aml(
8484 len : u64 ,
8585 irq : u32 ,
8686) -> Result < ( ) , aml:: AmlError > {
87- let dev_id = irq - crate :: arch:: GSI_BASE ;
87+ let dev_id = irq - crate :: arch:: IRQ_BASE ;
8888 debug ! (
8989 "acpi: Building AML for VirtIO device _SB_.V{:03}. memory range: {:#010x}:{} irq: {}" ,
9090 dev_id, addr, len, irq
@@ -156,7 +156,7 @@ impl MMIODeviceManager {
156156 resource_allocator : & mut ResourceAllocator ,
157157 irq_count : u32 ,
158158 ) -> Result < MMIODeviceInfo , MmioError > {
159- let irq = match resource_allocator. allocate_gsi ( irq_count) ?[ ..] {
159+ let irq = match resource_allocator. allocate_irq ( irq_count) ?[ ..] {
160160 [ ] => None ,
161161 [ irq] => Some ( irq) ,
162162 _ => return Err ( MmioError :: InvalidIrqConfig ) ,
@@ -276,11 +276,11 @@ impl MMIODeviceManager {
276276 let device_info = if let Some ( device_info) = device_info_opt {
277277 device_info
278278 } else {
279- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
279+ let irq = vm. resource_allocator ( ) . allocate_irq ( 1 ) ?;
280280 MMIODeviceInfo {
281281 addr : SERIAL_MEM_START ,
282282 len : MMIO_LEN ,
283- irq : Some ( gsi [ 0 ] ) ,
283+ irq : Some ( irq [ 0 ] ) ,
284284 }
285285 } ;
286286
@@ -335,11 +335,11 @@ impl MMIODeviceManager {
335335 let device_info = if let Some ( device_info) = device_info_opt {
336336 device_info
337337 } else {
338- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
338+ let irq = vm. resource_allocator ( ) . allocate_irq ( 1 ) ?;
339339 MMIODeviceInfo {
340340 addr : RTC_MEM_START ,
341341 len : MMIO_LEN ,
342- irq : Some ( gsi [ 0 ] ) ,
342+ irq : Some ( irq [ 0 ] ) ,
343343 }
344344 } ;
345345
@@ -612,15 +612,15 @@ pub(crate) mod tests {
612612 let dev = device_manager. get_virtio_device ( 0 , "dummy" ) . unwrap ( ) ;
613613 assert_eq ! ( dev. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
614614 assert_eq ! ( dev. resources. len, MMIO_LEN ) ;
615- assert_eq ! ( dev. resources. irq, Some ( arch:: GSI_BASE ) ) ;
615+ assert_eq ! ( dev. resources. irq, Some ( arch:: IRQ_BASE ) ) ;
616616
617617 device_manager
618618 . for_each_virtio_device ( |virtio_type, device_id, mmio_device| {
619619 assert_eq ! ( * virtio_type, 0 ) ;
620620 assert_eq ! ( device_id, "dummy" ) ;
621621 assert_eq ! ( mmio_device. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
622622 assert_eq ! ( mmio_device. resources. len, MMIO_LEN ) ;
623- assert_eq ! ( mmio_device. resources. irq, Some ( arch:: GSI_BASE ) ) ;
623+ assert_eq ! ( mmio_device. resources. irq, Some ( arch:: IRQ_BASE ) ) ;
624624 Ok :: < ( ) , ( ) > ( ( ) )
625625 } )
626626 . unwrap ( ) ;
@@ -643,7 +643,7 @@ pub(crate) mod tests {
643643 #[ cfg( target_arch = "aarch64" ) ]
644644 vm. setup_irqchip ( 1 ) . unwrap ( ) ;
645645
646- for _i in crate :: arch:: GSI_BASE ..=crate :: arch:: GSI_MAX {
646+ for _i in crate :: arch:: IRQ_BASE ..=crate :: arch:: IRQ_MAX {
647647 device_manager
648648 . register_virtio_test_device (
649649 & vm,
@@ -711,7 +711,7 @@ pub(crate) mod tests {
711711 . addr
712712 ) ;
713713 assert_eq ! (
714- crate :: arch:: GSI_BASE ,
714+ crate :: arch:: IRQ_BASE ,
715715 device_manager. virtio_devices[ & ( type_id, id) ]
716716 . resources
717717 . irq
@@ -762,7 +762,7 @@ pub(crate) mod tests {
762762 let device_info = device_manager
763763 . allocate_mmio_resources ( & mut resource_allocator, 1 )
764764 . unwrap ( ) ;
765- assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: GSI_BASE ) ;
765+ assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: IRQ_BASE ) ;
766766 }
767767
768768 #[ test]
0 commit comments