mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: Tune Vaia trait to work with fdt setup
Previous `Vaia` implementation uses types as it is, thus the property string generated for fdt setup requires additional type conversion. Change the types used in the methods of `Vaia` trait to provide a concise fdt setup process. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -26,11 +26,9 @@ pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VaiaConfig {
|
||||
pub vcpu_count: u64,
|
||||
pub vcpu_count: u32,
|
||||
pub aplic_addr: u64,
|
||||
pub aplic_size: u64,
|
||||
pub imsic_addr: u64,
|
||||
pub imsic_size: u64,
|
||||
pub nr_irqs: u32,
|
||||
}
|
||||
|
||||
@@ -40,16 +38,16 @@ pub trait Vaia: Send + Sync {
|
||||
fn aplic_compatibility(&self) -> &str;
|
||||
|
||||
/// Returns an array with APLIC device properties
|
||||
fn aplic_properties(&self) -> [u64; 4];
|
||||
fn aplic_properties(&self) -> [u32; 4];
|
||||
|
||||
/// Returns the compatibility property of IMSIC
|
||||
fn imsic_compatibility(&self) -> &str;
|
||||
|
||||
/// Returns an array with IMSIC device properties
|
||||
fn imsic_properties(&self) -> [u64; 4];
|
||||
fn imsic_properties(&self) -> [u32; 4];
|
||||
|
||||
/// Returns the number of vCPUs this AIA handles
|
||||
fn vcpu_count(&self) -> u64;
|
||||
fn vcpu_count(&self) -> u32;
|
||||
|
||||
/// Returns whether the AIA device is MSI compatible or not
|
||||
fn msi_compatible(&self) -> bool;
|
||||
|
||||
Reference in New Issue
Block a user