[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/42] spapr: nvdimm: Forward declare and move the definitions
From: |
David Gibson |
Subject: |
[PULL 07/42] spapr: nvdimm: Forward declare and move the definitions |
Date: |
Thu, 3 Jun 2021 18:21:56 +1000 |
From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
The subsequent patches add definitions which tend to get
the compilation to cyclic dependency. So, prepare with
forward declarations, move the definitions and clean up.
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Message-Id: <162133925415.610.11584121797866216417.stgit@4f1e6f2bd33e>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_nvdimm.c | 12 ++++++++++++
include/hw/ppc/spapr_nvdimm.h | 14 ++------------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c
index 252204e25f..3f57a8b6fa 100644
--- a/hw/ppc/spapr_nvdimm.c
+++ b/hw/ppc/spapr_nvdimm.c
@@ -35,6 +35,18 @@
/* SCM device is unable to persist memory contents */
#define PAPR_PMEM_UNARMED PPC_BIT(0)
+/*
+ * The nvdimm size should be aligned to SCM block size.
+ * The SCM block size should be aligned to SPAPR_MEMORY_BLOCK_SIZE
+ * in order to have SCM regions not to overlap with dimm memory regions.
+ * The SCM devices can have variable block sizes. For now, fixing the
+ * block size to the minimum value.
+ */
+#define SPAPR_MINIMUM_SCM_BLOCK_SIZE SPAPR_MEMORY_BLOCK_SIZE
+
+/* Have an explicit check for alignment */
+QEMU_BUILD_BUG_ON(SPAPR_MINIMUM_SCM_BLOCK_SIZE % SPAPR_MEMORY_BLOCK_SIZE);
+
bool spapr_nvdimm_validate(HotplugHandler *hotplug_dev, NVDIMMDevice *nvdimm,
uint64_t size, Error **errp)
{
diff --git a/include/hw/ppc/spapr_nvdimm.h b/include/hw/ppc/spapr_nvdimm.h
index 73be250e2a..764f999f54 100644
--- a/include/hw/ppc/spapr_nvdimm.h
+++ b/include/hw/ppc/spapr_nvdimm.h
@@ -11,19 +11,9 @@
#define HW_SPAPR_NVDIMM_H
#include "hw/mem/nvdimm.h"
-#include "hw/ppc/spapr.h"
-/*
- * The nvdimm size should be aligned to SCM block size.
- * The SCM block size should be aligned to SPAPR_MEMORY_BLOCK_SIZE
- * inorder to have SCM regions not to overlap with dimm memory regions.
- * The SCM devices can have variable block sizes. For now, fixing the
- * block size to the minimum value.
- */
-#define SPAPR_MINIMUM_SCM_BLOCK_SIZE SPAPR_MEMORY_BLOCK_SIZE
-
-/* Have an explicit check for alignment */
-QEMU_BUILD_BUG_ON(SPAPR_MINIMUM_SCM_BLOCK_SIZE % SPAPR_MEMORY_BLOCK_SIZE);
+typedef struct SpaprDrc SpaprDrc;
+typedef struct SpaprMachineState SpaprMachineState;
int spapr_pmem_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
void *fdt, int *fdt_start_offset, Error **errp);
--
2.31.1
- [PULL 00/42] ppc-for-6.1 queue 20210603, David Gibson, 2021/06/03
- [PULL 02/42] target/ppc: moved ppc_store_lpcr and ppc_store_msr to cpu.c, David Gibson, 2021/06/03
- [PULL 03/42] target/ppc: reduce usage of fpscr_set_rounding_mode, David Gibson, 2021/06/03
- [PULL 01/42] target/ppc: cleaned error_report from ppc_store_sdr1, David Gibson, 2021/06/03
- [PULL 04/42] target/ppc: removed unnecessary inclusion of helper-proto.h, David Gibson, 2021/06/03
- [PULL 11/42] spapr: Set LPCR to current AIL mode when starting a new CPU, David Gibson, 2021/06/03
- [PULL 10/42] spapr: Remove stale comment about power-saving LPCR bits, David Gibson, 2021/06/03
- [PULL 07/42] spapr: nvdimm: Forward declare and move the definitions,
David Gibson <=
- [PULL 09/42] target/ppc: fold ppc_store_ptcr into it's only caller, David Gibson, 2021/06/03
- [PULL 06/42] spapr: Fix EEH capability issue on KVM guest for PCI passthru, David Gibson, 2021/06/03
- [PULL 05/42] spapr: Don't hijack current_machine->boot_order, David Gibson, 2021/06/03
- [PULL 12/42] target/ppc: used ternary operator when registering MAS, David Gibson, 2021/06/03
- [PULL 14/42] target/ppc: created tcg-stub.c file, David Gibson, 2021/06/03
- [PULL 13/42] target/ppc: added ifdefs around TCG-only code, David Gibson, 2021/06/03
- [PULL 20/42] hw/core/cpu: removed cpu_dump_statistics function, David Gibson, 2021/06/03
- [PULL 08/42] spapr: nvdimm: Fix the persistent-memory root node name in device tree, David Gibson, 2021/06/03
- [PULL 21/42] HMP: added info cpustats to removed_features.rst, David Gibson, 2021/06/03
- [PULL 22/42] target/ppc: removed GEN_OPCODE decision tree, David Gibson, 2021/06/03