vm-allocator: Introduce RISC-V architecture

Provide implementation for GSI allocator to work on riscv64
architecture, and doc comment for riscv64 as well.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2024-12-04 16:23:15 +08:00
committed by Rob Bradford
parent 1e602bd9a6
commit 5b715f483d
2 changed files with 9 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ impl GsiAllocator {
allocator
}
#[cfg(target_arch = "aarch64")]
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
/// New GSI allocator
pub fn new() -> Self {
GsiAllocator {
@@ -97,7 +97,7 @@ impl GsiAllocator {
Ok(irq)
}
#[cfg(target_arch = "aarch64")]
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
/// Allocate an IRQ
pub fn allocate_irq(&mut self) -> Result<u32> {
let irq = self.next_irq;
@@ -106,7 +106,7 @@ impl GsiAllocator {
}
}
#[cfg(target_arch = "aarch64")]
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
impl Default for GsiAllocator {
fn default() -> Self {
GsiAllocator::new()