qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 05/50] dino: add memory-as property containing a link to the m


From: Mark Cave-Ayland
Subject: [PATCH v2 05/50] dino: add memory-as property containing a link to the memory address space
Date: Wed, 4 May 2022 10:25:15 +0100

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
---
 hw/hppa/dino.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index bc27aad5dc..13b2210462 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -17,6 +17,7 @@
 #include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
+#include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 #include "hppa_sys.h"
 #include "trace.h"
@@ -124,6 +125,8 @@ struct DinoState {
     MemoryRegion pci_mem;
     MemoryRegion pci_mem_alias[32];
 
+    MemoryRegion *memory_as;
+
     AddressSpace bm_as;
     MemoryRegion bm;
     MemoryRegion bm_ram_alias;
@@ -521,6 +524,8 @@ PCIBus *dino_init(MemoryRegion *addr_space,
     PCIBus *b;
 
     dev = qdev_new(TYPE_DINO_PCI_HOST_BRIDGE);
+    object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space),
+                             &error_fatal);
     s = DINO_PCI_HOST_BRIDGE(dev);
     s->iar0 = s->iar1 = CPU_HPA + 3;
     s->toc_addr = 0xFFFA0030; /* IO_COMMAND of CPU */
@@ -603,10 +608,17 @@ static void dino_pcihost_init(Object *obj)
     sysbus_init_mmio(sbd, &s->this_mem);
 }
 
+static Property dino_pcihost_properties[] = {
+    DEFINE_PROP_LINK("memory-as", DinoState, memory_as, TYPE_MEMORY_REGION,
+                     MemoryRegion *),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void dino_pcihost_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
 
+    device_class_set_props(dc, dino_pcihost_properties);
     dc->vmsd = &vmstate_dino;
 }
 
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]