]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 18 Jan 2024 20:06:31 +0000 (21:06 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Jan 2024 11:30:48 +0000 (11:30 +0000)
Declare arm_cpu_mp_affinity() prototype in the new
 "target/arm/multiprocessing.h" header so units in
hw/arm/ can use it without having to include the huge
target-specific "cpu.h".

File list to include the new header generated using:

  $ git grep -lw arm_cpu_mp_affinity

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240118200643.29037-11-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt-acpi-build.c
hw/arm/virt.c
hw/arm/xlnx-versal-virt.c
hw/misc/xlnx-versal-crl.c
target/arm/arm-powerctl.c
target/arm/cpu.c
target/arm/cpu.h
target/arm/hvf/hvf.c
target/arm/multiprocessing.h [new file with mode: 0644]
target/arm/tcg/psci.c

index 2127778c1ea80d8d2d40687165e4c6690a843a2d..43ccc60f43c89fb671e3985b6d7c4148c07143a5 100644 (file)
@@ -59,6 +59,7 @@
 #include "hw/acpi/ghes.h"
 #include "hw/acpi/viot.h"
 #include "hw/virtio/virtio-acpi.h"
+#include "target/arm/multiprocessing.h"
 
 #define ARM_SPI_BASE 32
 
index b3592798ea9a8b1459651a948ef780d1e8b1544b..1e0df6ea3ad9cf192b69028031a06594d6c85e9e 100644 (file)
@@ -74,6 +74,7 @@
 #include "hw/arm/smmuv3.h"
 #include "hw/acpi/acpi.h"
 #include "target/arm/internals.h"
+#include "target/arm/multiprocessing.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
 #include "hw/acpi/generic_event_device.h"
index 841ef69df66ef7fccbf59e1d7a9a329a4d4f9650..29f4d2c2dce1066247bfb721cf794a5db47c42b3 100644 (file)
@@ -20,6 +20,7 @@
 #include "hw/qdev-properties.h"
 #include "hw/arm/xlnx-versal.h"
 #include "hw/arm/boot.h"
+#include "target/arm/multiprocessing.h"
 #include "qom/object.h"
 
 #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
index 9bfa9baa157dc8f2020aa26ab0a3ff069a78968e..1f1762ef1633fc83530808b4daca29badc37f638 100644 (file)
@@ -19,6 +19,7 @@
 #include "hw/resettable.h"
 
 #include "target/arm/arm-powerctl.h"
+#include "target/arm/multiprocessing.h"
 #include "hw/misc/xlnx-versal-crl.h"
 
 #ifndef XLNX_VERSAL_CRL_ERR_DEBUG
index 6c86e90102871290b0090a7a844cf4551bbb3201..2b2055c6accb75b811140683d32a0288ffc37a46 100644 (file)
@@ -16,6 +16,7 @@
 #include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "sysemu/tcg.h"
+#include "target/arm/multiprocessing.h"
 
 #ifndef DEBUG_ARM_POWERCTL
 #define DEBUG_ARM_POWERCTL 0
index 5b5af7d4e1e0e77ef9b90220c4074f5d9b3a68f5..04296f2928ff2025641897c1981292cbfad9e267 100644 (file)
@@ -1314,6 +1314,11 @@ uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz)
     return (Aff1 << ARM_AFF1_SHIFT) | Aff0;
 }
 
+uint64_t arm_cpu_mp_affinity(ARMCPU *cpu)
+{
+    return cpu->mp_affinity;
+}
+
 static void arm_cpu_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
index d1584bdb3b5865c1fbb1965e73ece7f982924c4c..cecac4c0a1271b17182a6e1435fb2218bfa2b05b 100644 (file)
@@ -26,6 +26,7 @@
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
 #include "qapi/qapi-types-common.h"
+#include "target/arm/multiprocessing.h"
 
 /* ARM processors have a weak memory model */
 #define TCG_GUEST_DEFAULT_MO      (0)
@@ -1173,11 +1174,6 @@ void arm_cpu_post_init(Object *obj);
 
 uint64_t arm_build_mp_affinity(int idx, uint8_t clustersz);
 
-static inline uint64_t arm_cpu_mp_affinity(ARMCPU *cpu)
-{
-    return cpu->mp_affinity;
-}
-
 #ifndef CONFIG_USER_ONLY
 extern const VMStateDescription vmstate_arm_cpu;
 
index 659401e12c7da070e3957a4e4f65e37e519d3268..71a26db1886fbf6582e0f187fdaea49b34cf186e 100644 (file)
@@ -28,6 +28,7 @@
 #include "arm-powerctl.h"
 #include "target/arm/cpu.h"
 #include "target/arm/internals.h"
+#include "target/arm/multiprocessing.h"
 #include "trace/trace-target_arm_hvf.h"
 #include "migration/vmstate.h"
 
diff --git a/target/arm/multiprocessing.h b/target/arm/multiprocessing.h
new file mode 100644 (file)
index 0000000..81715d3
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * ARM multiprocessor CPU helpers
+ *
+ *  Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef TARGET_ARM_MULTIPROCESSING_H
+#define TARGET_ARM_MULTIPROCESSING_H
+
+#include "target/arm/cpu-qom.h"
+
+uint64_t arm_cpu_mp_affinity(ARMCPU *cpu);
+
+#endif
index 50d4b23d26b233cfa330422b5f285561547846a7..51d2ca3d30d8a1b98c7bb62fb71ab52bef40818d 100644 (file)
@@ -24,6 +24,7 @@
 #include "sysemu/runstate.h"
 #include "internals.h"
 #include "arm-powerctl.h"
+#include "target/arm/multiprocessing.h"
 
 bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
 {