vmm: Split create_gic() from configure_system()

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao
2021-05-31 22:30:24 +08:00
committed by Rob Bradford
parent 9341cce8b3
commit 195eba188a
2 changed files with 13 additions and 17 deletions

View File

@@ -1021,17 +1021,22 @@ impl Vm {
);
}
// Call `configure_system` and pass the GIC devices out, so that
// we can register the GIC device to the device manager.
let gic_device = arch::configure_system(
let gic_device = create_gic(
&self.memory_manager.lock().as_ref().unwrap().vm,
self.cpu_manager.lock().unwrap().boot_vcpus() as u64,
)
.map_err(|e| {
Error::ConfigureSystem(arch::Error::AArch64Setup(arch::aarch64::Error::SetupGic(e)))
})?;
arch::configure_system(
&mem,
&cmdline_cstring,
self.cpu_manager.lock().unwrap().boot_vcpus() as u64,
vcpu_mpidrs,
device_info,
&initramfs_config,
&pci_space,
&*gic_device,
)
.map_err(Error::ConfigureSystem)?;