Skip to content

Commit c760e02

Browse files
povikmarcan
authored andcommitted
hv: Insert attached virtios into ADT
Signed-off-by: Martin Povišer <[email protected]>
1 parent d94f918 commit c760e02

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

proxyclient/m1n1/hv/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,21 @@ def attach_virtio(self, dev, base=None, irq=None, verbose=False):
10221022
config_base = self.u.heap.malloc(len(config))
10231023
self.iface.writemem(config_base, config)
10241024

1025+
name = None
1026+
for i in range(16):
1027+
n = "/arm-io/virtio%d" % i
1028+
if n not in self.adt:
1029+
name = n
1030+
break
1031+
if name is None:
1032+
raise ValueError("Too many virtios in ADT")
1033+
1034+
node = self.adt.create_node(name)
1035+
node.reg = [Container(addr=node.to_bus_addr(base), size=0x1000)]
1036+
node.interrupt_parent = getattr(self.adt["/arm-io/aic"], "AAPL,phandle")
1037+
node.interrupts = (irq,)
1038+
node.compatible = ["virtio,mmio"]
1039+
10251040
self.p.hv_map_virtio(base, config_base)
10261041
self.add_tracer(irange(base, 0x1000), "VIRTIO", TraceMode.RESERVED)
10271042

0 commit comments

Comments
 (0)