|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/4] device-tree: Move Arm's static-memory feature to common
This feature is arch agnostic, thus move it to common.
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
xen/arch/arm/Makefile | 1 -
xen/arch/arm/arm32/mmu/mm.c | 2 +-
xen/arch/arm/arm64/mmu/mm.c | 2 +-
xen/arch/arm/dom0less-build.c | 2 +-
xen/arch/arm/static-shmem.c | 2 +-
xen/common/device-tree/Makefile | 1 +
xen/common/device-tree/dom0less-build.c | 6 +-----
xen/{arch/arm => common/device-tree}/static-memory.c | 2 +-
.../arm/include/asm => include/xen}/static-memory.h | 9 +++++----
9 files changed, 12 insertions(+), 15 deletions(-)
rename xen/{arch/arm => common/device-tree}/static-memory.c (99%)
rename xen/{arch/arm/include/asm => include/xen}/static-memory.h (93%)
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index eeeac4e653ec..4f080145478d 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -51,7 +51,6 @@ obj-y += setup.o
obj-y += shutdown.o
obj-y += smp.o
obj-y += smpboot.o
-obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
obj-y += sysctl.o
obj-y += time.o
diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 956693232a1b..f3305e28e9df 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -6,9 +6,9 @@
#include <xen/mm.h>
#include <xen/param.h>
#include <xen/pfn.h>
+#include <xen/static-memory.h>
#include <asm/fixmap.h>
#include <asm/setup.h>
-#include <asm/static-memory.h>
#include <asm/static-shmem.h>
static unsigned long opt_xenheap_megabytes __initdata;
diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index c1efa1348aee..cded8f2787f9 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -4,9 +4,9 @@
#include <xen/llc-coloring.h>
#include <xen/mm.h>
#include <xen/pfn.h>
+#include <xen/static-memory.h>
#include <asm/setup.h>
-#include <asm/static-memory.h>
#include <asm/static-shmem.h>
/* Override macros from asm/page.h to make them work with mfn_t */
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index a49764f0add9..bcfd686a8b7f 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -12,6 +12,7 @@
#include <xen/sched.h>
#include <xen/serial.h>
#include <xen/sizes.h>
+#include <xen/static-memory.h>
#include <xen/vmap.h>
#include <public/bootfdt.h>
@@ -22,7 +23,6 @@
#include <asm/domain_build.h>
#include <asm/grant_table.h>
#include <asm/setup.h>
-#include <asm/static-memory.h>
#include <asm/static-shmem.h>
#ifdef CONFIG_VGICV2
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index 21fd2c3cd4fd..2055b7be0f3f 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -5,9 +5,9 @@
#include <xen/libfdt/libfdt.h>
#include <xen/rangeset.h>
#include <xen/sched.h>
+#include <xen/static-memory.h>
#include <asm/setup.h>
-#include <asm/static-memory.h>
#include <asm/static-shmem.h>
typedef struct {
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 57b9e6ca008f..ed11f2c3b42c 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
obj-y += intc.o
obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o
obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
+obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
diff --git a/xen/common/device-tree/dom0less-build.c
b/xen/common/device-tree/dom0less-build.c
index 39cb2cd5c70e..c8c5a04f24cb 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -28,9 +28,7 @@
#include <asm/dom0less-build.h>
#include <asm/setup.h>
-#if __has_include(<asm/static-memory.h>)
-# include <asm/static-memory.h>
-#endif
+#include <xen/static-memory.h>
#if __has_include(<asm/static-shmem.h>)
# include <asm/static-shmem.h>
@@ -799,12 +797,10 @@ static int __init construct_domU(struct domain *d,
{
if ( !dt_find_property(node, "xen,static-mem", NULL) )
allocate_memory(d, &kinfo);
-#ifdef CONFIG_STATIC_MEMORY
else if ( !is_domain_direct_mapped(d) )
allocate_static_memory(d, &kinfo, node);
else
assign_static_memory_11(d, &kinfo, node);
-#endif
#ifdef CONFIG_STATIC_SHM
rc = process_shm(d, &kinfo, node);
diff --git a/xen/arch/arm/static-memory.c
b/xen/common/device-tree/static-memory.c
similarity index 99%
rename from xen/arch/arm/static-memory.c
rename to xen/common/device-tree/static-memory.c
index e0f76afcd8eb..0774d0680604 100644
--- a/xen/arch/arm/static-memory.c
+++ b/xen/common/device-tree/static-memory.c
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <xen/sched.h>
+#include <xen/static-memory.h>
#include <asm/setup.h>
-#include <asm/static-memory.h>
static bool __init append_static_memory_to_bank(struct domain *d,
struct membank *bank,
diff --git a/xen/arch/arm/include/asm/static-memory.h
b/xen/include/xen/static-memory.h
similarity index 93%
rename from xen/arch/arm/include/asm/static-memory.h
rename to xen/include/xen/static-memory.h
index a32a3c6553bc..e445aa80578c 100644
--- a/xen/arch/arm/include/asm/static-memory.h
+++ b/xen/include/xen/static-memory.h
@@ -1,13 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_STATIC_MEMORY_H_
-#define __ASM_STATIC_MEMORY_H_
+#ifndef XEN_STATIC_MEMORY_H
+#define XEN_STATIC_MEMORY_H
#include <xen/fdt-kernel.h>
-#include <xen/pfn.h>
#ifdef CONFIG_STATIC_MEMORY
+#include <xen/pfn.h>
+
static inline void init_staticmem_bank(const struct membank *bank)
{
mfn_t bank_start = _mfn(PFN_UP(bank->start));
@@ -46,7 +47,7 @@ static inline void init_staticmem_pages(void) {};
#endif /* CONFIG_STATIC_MEMORY */
-#endif /* __ASM_STATIC_MEMORY_H_ */
+#endif /* XEN_STATIC_MEMORY_H */
/*
* Local variables:
--
2.25.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |