[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v4 11/14] pc-dimm: implement new memory device funct
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v4 11/14] pc-dimm: implement new memory device functions |
Date: |
Thu, 17 May 2018 10:15:24 +0200 |
Implement the new functions, we don't have to care about alignment for
these DIMMs right now, so leave that function unimplemented.
Signed-off-by: David Hildenbrand <address@hidden>
---
hw/mem/pc-dimm.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 12da89d562..5e2e3263ab 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -244,6 +244,21 @@ static uint64_t pc_dimm_md_get_addr(const
MemoryDeviceState *md)
return dimm->addr;
}
+static void pc_dimm_md_set_addr(MemoryDeviceState *md, uint64_t addr)
+{
+ PCDIMMDevice *dimm = PC_DIMM(md);
+
+ dimm->addr = addr;
+}
+
+static MemoryRegion *pc_dimm_md_get_memory_region(MemoryDeviceState *md)
+{
+ const PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(md);
+ PCDIMMDevice *dimm = PC_DIMM(md);
+
+ return ddc->get_memory_region(dimm, &error_abort);
+}
+
static uint64_t pc_dimm_md_get_region_size(const MemoryDeviceState *md)
{
/* dropping const here is fine as we don't touch the memory region */
@@ -304,6 +319,8 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data)
ddc->get_vmstate_memory_region = pc_dimm_get_vmstate_memory_region;
mdc->get_addr = pc_dimm_md_get_addr;
+ mdc->set_addr = pc_dimm_md_set_addr;
+ mdc->get_memory_region = pc_dimm_md_get_memory_region;
/* for a dimm plugged_size == region_size */
mdc->get_plugged_size = pc_dimm_md_get_region_size;
mdc->get_region_size = pc_dimm_md_get_region_size;
--
2.14.3
- Re: [qemu-s390x] [PATCH v4 01/14] memory-device: drop assert related to align and start of address space, (continued)
- [qemu-s390x] [PATCH v4 08/14] spapr: handle pc-dimm unplug via hotplug handler chain, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 09/14] spapr: handle cpu core unplug via hotplug handler chain, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 11/14] pc-dimm: implement new memory device functions,
David Hildenbrand <=
- [qemu-s390x] [PATCH v4 12/14] memory-device: factor out pre-plug into hotplug handler, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 10/14] memory-device: new functions to handle plug/unplug, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 13/14] memory-device: factor out unplug into hotplug handler, David Hildenbrand, 2018/05/17
- [qemu-s390x] [PATCH v4 14/14] memory-device: factor out plug into hotplug handler, David Hildenbrand, 2018/05/17
- Re: [qemu-s390x] [PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers, David Hildenbrand, 2018/05/25