[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/acpi: Allow xen/acpi.h to be included on non-ACPI archs



commit c304bdf1e769830abc849721c05870352e919c2a
Author:     Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Fri Apr 5 13:20:31 2024 -0500
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Apr 11 14:16:36 2024 +0100

    xen/acpi: Allow xen/acpi.h to be included on non-ACPI archs
    
    Conditionalize xen/acpi.h's inclusion of acpi/acpi.h and asm/acpi.h on
    CONFIG_ACPI and import ARM's !CONFIG_ACPI stub for acpi_disabled() so
    that the header can be included on architectures without ACPI support,
    like ppc.
    
    This change revealed some missing #includes across the ARM tree, so fix
    those as well.
    
    Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
    [Fold Randconfig fix]
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/arm/arm32/mmu/mm.c     | 1 +
 xen/arch/arm/arm64/smpboot.c    | 3 ++-
 xen/arch/arm/domain_build.c     | 1 -
 xen/arch/arm/gic-v2.c           | 1 -
 xen/arch/arm/gic-v3.c           | 2 --
 xen/arch/arm/include/asm/acpi.h | 1 -
 xen/arch/arm/mmu/pt.c           | 1 +
 xen/arch/arm/mmu/setup.c        | 1 +
 xen/arch/arm/psci.c             | 1 +
 xen/arch/arm/smpboot.c          | 1 +
 xen/arch/arm/traps.c            | 3 ++-
 xen/common/sched/boot-cpupool.c | 2 +-
 xen/include/xen/acpi.h          | 8 ++++++--
 13 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index cb441ca87c..0ab6ae52a6 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -3,6 +3,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/libfdt/libfdt-xen.h>
+#include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/pfn.h>
 #include <asm/fixmap.h>
diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index bf81d018b3..a225fae64d 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -1,4 +1,6 @@
+#include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/device_tree.h>
 #include <xen/lib.h>
 #include <xen/init.h>
 #include <xen/errno.h>
@@ -7,7 +9,6 @@
 #include <xen/vmap.h>
 #include <asm/io.h>
 #include <asm/psci.h>
-#include <asm/acpi.h>
 
 struct smp_enable_ops {
         int             (*prepare_cpu)(int cpu);
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 085d88671e..54232ed4cb 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -18,7 +18,6 @@
 #include <xen/acpi.h>
 #include <xen/vmap.h>
 #include <xen/warning.h>
-#include <acpi/actables.h>
 #include <asm/device.h>
 #include <asm/kernel.h>
 #include <asm/setup.h>
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 5d6885e389..02043c0d4b 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -22,7 +22,6 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/sizes.h>
 #include <xen/acpi.h>
-#include <acpi/actables.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 #include <asm/platform.h>
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 1cb1360606..cd3e1acf79 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -25,8 +25,6 @@
 #include <xen/sched.h>
 #include <xen/sizes.h>
 
-#include <acpi/actables.h>
-
 #include <asm/cpufeature.h>
 #include <asm/device.h>
 #include <asm/gic.h>
diff --git a/xen/arch/arm/include/asm/acpi.h b/xen/arch/arm/include/asm/acpi.h
index e53973e054..13756dd341 100644
--- a/xen/arch/arm/include/asm/acpi.h
+++ b/xen/arch/arm/include/asm/acpi.h
@@ -74,7 +74,6 @@ static inline void enable_acpi(void)
     acpi_disabled = false;
 }
 #else
-#define acpi_disabled (true)
 #define disable_acpi()
 #define enable_acpi()
 #endif
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index a7755728ae..da28d669e7 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -11,6 +11,7 @@
 #include <xen/sizes.h>
 #include <xen/vmap.h>
 
+#include <asm/current.h>
 #include <asm/fixmap.h>
 
 #ifdef NDEBUG
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index 57f1b46499..c0cb17ca2e 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -10,6 +10,7 @@
 #include <xen/sizes.h>
 #include <xen/vmap.h>
 
+#include <asm/setup.h>
 #include <asm/fixmap.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 695d2fa1f1..b6860a7760 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -9,6 +9,7 @@
  */
 
 
+#include <xen/acpi.h>
 #include <xen/types.h>
 #include <xen/init.h>
 #include <xen/mm.h>
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index a84e706d77..6efed87678 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -7,6 +7,7 @@
  * Copyright (c) 2011 Citrix Systems.
  */
 
+#include <xen/acpi.h>
 #include <xen/cpu.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index a8039087c8..aac6c599f8 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -7,6 +7,7 @@
  * Copyright (c) 2011 Citrix Systems.
  */
 
+#include <xen/acpi.h>
 #include <xen/domain_page.h>
 #include <xen/errno.h>
 #include <xen/hypercall.h>
@@ -30,7 +31,6 @@
 #include <public/sched.h>
 #include <public/xen.h>
 
-#include <asm/acpi.h>
 #include <asm/cpuerrata.h>
 #include <asm/cpufeature.h>
 #include <asm/event.h>
@@ -38,6 +38,7 @@
 #include <asm/mem_access.h>
 #include <asm/mmio.h>
 #include <asm/regs.h>
+#include <asm/setup.h>
 #include <asm/smccc.h>
 #include <asm/traps.h>
 #include <asm/vgic.h>
diff --git a/xen/common/sched/boot-cpupool.c b/xen/common/sched/boot-cpupool.c
index 5955e6f9a9..feeac3b704 100644
--- a/xen/common/sched/boot-cpupool.c
+++ b/xen/common/sched/boot-cpupool.c
@@ -7,8 +7,8 @@
  * Copyright (C) 2022 Arm Ltd.
  */
 
+#include <xen/acpi.h>
 #include <xen/sched.h>
-#include <asm/acpi.h>
 
 /*
  * pool_cpu_map:   Index is logical cpu number, content is cpupool id, (-1) for
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 6a2f5983fd..e78e7e7852 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -37,10 +37,10 @@
 
 #ifndef __ASSEMBLY__
 
+#include <xen/errno.h>
 #include <xen/list.h>
 
-#include <acpi/acpi.h>
-#include <asm/acpi.h>
+#include <public/xen.h>
 
 #define ACPI_MADT_GET_(fld, x) (((x) & ACPI_MADT_##fld##_MASK) / \
        (ACPI_MADT_##fld##_MASK & -ACPI_MADT_##fld##_MASK))
@@ -54,6 +54,9 @@
 
 #ifdef CONFIG_ACPI
 
+#include <acpi/acpi.h>
+#include <asm/acpi.h>
+
 extern acpi_physical_address rsdp_hint;
 
 extern bool opt_acpi_verbose;
@@ -118,6 +121,7 @@ extern u32 pci_mmcfg_base_addr;
 #else  /*!CONFIG_ACPI*/
 
 #define acpi_mp_config 0
+#define acpi_disabled true
 
 static inline int acpi_boot_init(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.