From 8dbc84318cc5d2c3a1963c498cf75dfa409a1bbc Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 26 Feb 2020 17:32:55 +0100 Subject: [PATCH] vmm: acpi: Add PCNT method to invoke DVNT Create a small method that will perform both hotplug of all the devices identified by PCIU bitmap, and then perform the hotunplug of all the devices identified by the PCID bitmap. Signed-off-by: Sebastien Boeuf --- vmm/src/device_manager.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 887087502..03f81b746 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1635,7 +1635,28 @@ impl Aml for PciDevSlotMethods { device_notifies_refs.push(device_notify); } - aml::Method::new("DVNT".into(), 2, true, device_notifies_refs).to_aml_bytes() + let mut bytes = + aml::Method::new("DVNT".into(), 2, true, device_notifies_refs).to_aml_bytes(); + + bytes.extend_from_slice( + &aml::Method::new( + "PCNT".into(), + 0, + true, + vec![ + &aml::MethodCall::new( + "DVNT".into(), + vec![&aml::Path::new("\\_SB_.PHPR.PCIU"), &aml::ONE], + ), + &aml::MethodCall::new( + "DVNT".into(), + vec![&aml::Path::new("\\_SB_.PHPR.PCID"), &3usize], + ), + ], + ) + .to_aml_bytes(), + ); + bytes } }