mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
pc,pc-dimm: Extract hotplug related fields in PCMachineState to a structure
Move hotplug_memory_base and hotplug_memory fields of PCMachineState into a separate structure so that the same can be made use of from other architectures supporing memory hotplug. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
35360642d0
commit
a7d69ff10b
4 changed files with 27 additions and 19 deletions
|
@ -15,14 +15,12 @@
|
|||
#include "hw/pci/pci.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/compat.h"
|
||||
#include "hw/mem/pc-dimm.h"
|
||||
|
||||
#define HPET_INTCAP "hpet-intcap"
|
||||
|
||||
/**
|
||||
* PCMachineState:
|
||||
* @hotplug_memory_base: address in guest RAM address space where hotplug memory
|
||||
* address space begins.
|
||||
* @hotplug_memory: hotplug memory addess space container
|
||||
* @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
|
||||
* @enforce_aligned_dimm: check that DIMM's address/size is aligned by
|
||||
* backend's alignment value if provided
|
||||
|
@ -32,8 +30,7 @@ struct PCMachineState {
|
|||
MachineState parent_obj;
|
||||
|
||||
/* <public> */
|
||||
ram_addr_t hotplug_memory_base;
|
||||
MemoryRegion hotplug_memory;
|
||||
MemoryHotplugState hotplug_memory;
|
||||
|
||||
HotplugHandler *acpi_dev;
|
||||
ISADevice *rtc;
|
||||
|
|
|
@ -70,6 +70,17 @@ typedef struct PCDIMMDeviceClass {
|
|||
MemoryRegion *(*get_memory_region)(PCDIMMDevice *dimm);
|
||||
} PCDIMMDeviceClass;
|
||||
|
||||
/**
|
||||
* MemoryHotplugState:
|
||||
* @base: address in guest RAM address space where hotplug memory
|
||||
* address space begins.
|
||||
* @mr: hotplug memory address space container
|
||||
*/
|
||||
typedef struct MemoryHotplugState {
|
||||
ram_addr_t base;
|
||||
MemoryRegion mr;
|
||||
} MemoryHotplugState;
|
||||
|
||||
uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
|
||||
uint64_t address_space_size,
|
||||
uint64_t *hint, uint64_t align, uint64_t size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue