[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v1 4/8] memory-device: new functions to handle resou
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v1 4/8] memory-device: new functions to handle resource assignment |
Date: |
Thu, 3 May 2018 17:49:32 +0200 |
We will need a handful of new functions:
- set_addr(): To set the calculated address
- get_memory_region(): To add it to the memory region container
- get_addr(): If the device has any specific alignment requirements
Using these and the existing functions, we can properly assign resources
to memory devices.
Signed-off-by: David Hildenbrand <address@hidden>
---
include/hw/mem/memory-device.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h
index 2853b084b5..e43ce1c8d3 100644
--- a/include/hw/mem/memory-device.h
+++ b/include/hw/mem/memory-device.h
@@ -32,11 +32,17 @@ typedef struct MemoryDeviceState {
typedef struct MemoryDeviceClass {
InterfaceClass parent_class;
+ /* required functions that have to be implemented */
uint64_t (*get_addr)(const MemoryDeviceState *md);
+ uint64_t (*set_addr)(MemoryDeviceState *md);
+ MemoryRegion * (*get_memory_region)(MemoryDeviceState *md);
uint64_t (*get_plugged_size)(const MemoryDeviceState *md);
uint64_t (*get_region_size)(const MemoryDeviceState *md);
void (*fill_device_info)(const MemoryDeviceState *md,
MemoryDeviceInfo *info);
+
+ /* optional functions that can be implemented */
+ uint64_t (*get_align)(const MemoryDeviceState *md);
} MemoryDeviceClass;
MemoryDeviceInfoList *qmp_memory_device_list(void);
--
2.14.3
- [qemu-s390x] [PATCH v1 0/8] MemoryDevice: introduce and use ResourceHandler, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 1/8] memory-device: always compile support for memory devices for SOFTMMU, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 2/8] qdev: introduce ResourceHandler as a first-stage hotplug handler, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 3/8] machine: provide default resource handler, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 4/8] memory-device: new functions to handle resource assignment,
David Hildenbrand <=
- [qemu-s390x] [PATCH v1 5/8] pc-dimm: implement new memory device functions, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 6/8] machine: introduce enforce_memory_device_align() and add it for pc, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 7/8] memory-device: factor out pre-assign into default resource handler, David Hildenbrand, 2018/05/03
- [qemu-s390x] [PATCH v1 8/8] memory-device: factor out (un)assign into default resource handler, David Hildenbrand, 2018/05/03
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 0/8] MemoryDevice: introduce and use ResourceHandler, Igor Mammedov, 2018/05/04
- Re: [qemu-s390x] [PATCH v1 0/8] MemoryDevice: introduce and use ResourceHandler, David Hildenbrand, 2018/05/09