diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index eeeac4e653..4f08014547 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 956693232a..f3305e28e9 100644 --- a/xen/arch/arm/arm32/mmu/mm.c +++ b/xen/arch/arm/arm32/mmu/mm.c @@ -6,9 +6,9 @@ #include #include #include +#include #include #include -#include #include 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 c1efa1348a..cded8f2787 100644 --- a/xen/arch/arm/arm64/mmu/mm.c +++ b/xen/arch/arm/arm64/mmu/mm.c @@ -4,9 +4,9 @@ #include #include #include +#include #include -#include #include /* 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 a49764f0ad..bcfd686a8b 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include #ifdef CONFIG_VGICV2 diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c index 21fd2c3cd4..2055b7be0f 100644 --- a/xen/arch/arm/static-shmem.c +++ b/xen/arch/arm/static-shmem.c @@ -5,9 +5,9 @@ #include #include #include +#include #include -#include #include typedef struct { diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile index 57b9e6ca00..ed11f2c3b4 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 39cb2cd5c7..c8c5a04f24 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -28,9 +28,7 @@ #include #include -#if __has_include() -# include -#endif +#include #if __has_include() # include @@ -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 e0f76afcd8..0774d06806 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 +#include #include -#include 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 a32a3c6553..e445aa8057 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 -#include #ifdef CONFIG_STATIC_MEMORY +#include + 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: