[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 11/18] pc-dimm: implement new memory device funct
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v3 11/18] pc-dimm: implement new memory device functions |
Date: |
Mon, 14 May 2018 12:00:16 +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] [Qemu-ppc] [PATCH v3 03/18] qdev: let machine hotplug handler to override bus hotplug handler, (continued)
- [qemu-s390x] [PATCH v3 06/18] spapr: prepare for multi stage hotplug handlers, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 04/18] pc: prepare for multi stage hotplug handlers, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 09/18] spapr: handle cpu core unplug via hotplug handler chain, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 08/18] spapr: handle pc-dimm unplug via hotplug handler chain, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 11/18] pc-dimm: implement new memory device functions,
David Hildenbrand <=
- [qemu-s390x] [PATCH v3 07/18] spapr: route all memory devices through the machine hotplug handler, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 10/18] memory-device: new functions to handle plug/unplug, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 14/18] memory-device: factor out plug into hotplug handler, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 13/18] memory-device: factor out unplug into hotplug handler, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 15/18] s390x/sclp: make sure ram_size and maxram_size stay in sync, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 17/18] s390x: initialize memory region for memory devices, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 12/18] memory-device: factor out pre-plug into hotplug handler, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 18/18] s390x: support memory devices, David Hildenbrand, 2018/05/14
- [qemu-s390x] [PATCH v3 16/18] s390x: prepare for multi stage hotplug handlers, David Hildenbrand, 2018/05/14