mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Remove GIC entity set/get from DeviceManager
Moved the set/get functions from vmm::DeviceManager to devices::Gic. Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
committed by
Rob Bradford
parent
195eba188a
commit
7932cd22ca
@@ -1261,6 +1261,11 @@ impl DeviceManager {
|
||||
Ok(interrupt_controller)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub fn get_interrupt_controller(&mut self) -> Option<&Arc<Mutex<gic::Gic>>> {
|
||||
self.interrupt_controller.as_ref()
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub fn set_gic_device_entity(&mut self, device_entity: Arc<Mutex<Box<dyn GicDevice>>>) {
|
||||
self.gic_device_entity = Some(device_entity);
|
||||
|
||||
@@ -1044,7 +1044,11 @@ impl Vm {
|
||||
self.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_gic_device_entity(Arc::new(Mutex::new(gic_device)));
|
||||
.get_interrupt_controller()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_gic_device(Arc::new(Mutex::new(gic_device)));
|
||||
|
||||
self.device_manager
|
||||
.lock()
|
||||
@@ -1865,7 +1869,11 @@ impl Vm {
|
||||
self.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_gic_device_entity()
|
||||
.get_interrupt_controller()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_gic_device()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
@@ -1898,7 +1906,11 @@ impl Vm {
|
||||
self.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_gic_device_entity(Arc::new(Mutex::new(gic_device)));
|
||||
.get_interrupt_controller()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_gic_device(Arc::new(Mutex::new(gic_device)));
|
||||
|
||||
// Here we prepare the GICR_TYPER registers from the restored vCPU states.
|
||||
self.device_manager
|
||||
@@ -1911,7 +1923,11 @@ impl Vm {
|
||||
self.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_gic_device_entity()
|
||||
.get_interrupt_controller()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_gic_device()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user