Skip to content

Commit 715b638

Browse files
committed
Creat DummyIrqChips GICDevice and AIADevice
Create missing devices for aarch64 and riscv64 Fixes: #439 Signed-off-by: Pepper Gray <[email protected]>
1 parent 246b3f7 commit 715b638

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/devices/src/legacy/irqchip.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,47 @@ pub mod test_utils {
166166
}
167167
}
168168

169+
#[cfg(target_arch = "aarch64")]
170+
impl GICDevice for DummyIrqChip {
171+
fn device_properties(&self) -> Vec<u64> {
172+
vec![]
173+
}
174+
fn vcpu_count(&self) -> u64 {
175+
0
176+
}
177+
fn fdt_compatibility(&self) -> String {
178+
"vendor,dummy-gic".into()
179+
}
180+
fn fdt_maint_irq(&self) -> u32 {
181+
0
182+
}
183+
fn version(&self) -> u32 {
184+
0
185+
}
186+
}
187+
188+
#[cfg(target_arch = "riscv64")]
189+
impl AIADevice for DummyIrqChip {
190+
fn aplic_compatibility(&self) -> &str {
191+
"riscv,aplic"
192+
}
193+
fn aplic_properties(&self) -> [u32; 4] {
194+
[0, 0, 0, 0]
195+
}
196+
fn imsic_compatibility(&self) -> &str {
197+
"riscv,imsics"
198+
}
199+
fn imsic_properties(&self) -> [u32; 4] {
200+
[0, 0, 0, 0]
201+
}
202+
fn vcpu_count(&self) -> u32 {
203+
0
204+
}
205+
fn msi_compatible(&self) -> bool {
206+
false
207+
}
208+
}
209+
169210
impl BusDevice for DummyIrqChip {}
170211

171212
impl IrqChipT for DummyIrqChip {

0 commit comments

Comments
 (0)