]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/arm: Move GTimer definitions to new 'gtimer.h' header
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 18 Jan 2024 20:06:40 +0000 (21:06 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Jan 2024 11:30:49 +0000 (11:30 +0000)
Move Arm A-class Generic Timer definitions to the new
"target/arm/gtimer.h" header so units in hw/ which don't
need access to ARMCPU internals can use them without
having to include the huge "cpu.h".

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240118200643.29037-20-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15 files changed:
hw/arm/allwinner-h3.c
hw/arm/allwinner-r40.c
hw/arm/bcm2836.c
hw/arm/sbsa-ref.c
hw/arm/virt.c
hw/arm/xlnx-versal.c
hw/arm/xlnx-zynqmp.c
hw/cpu/a15mpcore.c
target/arm/cpu.c
target/arm/cpu.h
target/arm/gtimer.h [new file with mode: 0644]
target/arm/helper.c
target/arm/hvf/hvf.c
target/arm/kvm.c
target/arm/machine.c

index 2d684b5287b46ca3e38420a739542994a5338a2f..380e0ec11d6f17fd6b53e91ae476aa3b14ebaca2 100644 (file)
@@ -31,6 +31,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/arm/allwinner-h3.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 /* Memory map */
 const hwaddr allwinner_h3_memmap[] = {
index 79976b0b54dfca638f39370aa31af858ed4ca827..eef1fc196e504cd8e021daf78a3277fd174074fd 100644 (file)
@@ -34,6 +34,7 @@
 #include "hw/arm/allwinner-r40.h"
 #include "hw/misc/allwinner-r40-dramc.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 /* Memory map */
 const hwaddr allwinner_r40_memmap[] = {
index 58a78780d2bb136a2ac50bc4b191db6031b3d8d8..e3ba18a8ec15b9ab73bc338b16320d81137903fd 100644 (file)
@@ -16,6 +16,7 @@
 #include "hw/arm/raspi_platform.h"
 #include "hw/sysbus.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 struct BCM283XClass {
     /*< private >*/
index d6081bfc41f043302416ae8f25425a06089fbd84..85cb68d546388e2c9cc96bc0bc6534848c7da802 100644 (file)
@@ -51,6 +51,7 @@
 #include "qapi/qmp/qlist.h"
 #include "qom/object.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 #define RAMLIMIT_GB 8192
 #define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB)
index 64802446cb13a4dcee18bdd647c26a1414eed762..e6ead2c5c896bf39e43628340f0ee7f9784557fc 100644 (file)
@@ -76,6 +76,7 @@
 #include "target/arm/cpu-qom.h"
 #include "target/arm/internals.h"
 #include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
 #include "hw/acpi/generic_event_device.h"
index 87fdb39d43005259f9e3d0ee43bcf31c8920963e..2798df3730d2e78c9f7b5244784abca80a2138c5 100644 (file)
@@ -24,6 +24,7 @@
 #include "hw/arm/xlnx-versal.h"
 #include "qemu/log.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")
 #define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")
index 38cb34942f8480a613f0fed15c9891aa63b7bd95..65901c6e74bf1d1edcd11df2bd4f6d58f8d095ba 100644 (file)
@@ -26,6 +26,7 @@
 #include "sysemu/sysemu.h"
 #include "kvm_arm.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 #define GIC_NUM_SPI_INTR 160
 
index bfd8aa564484ac9d35f8fe76a860f235137e06f1..967d8d3dd50305a3e4ea39ef39037ff64365c23d 100644 (file)
@@ -26,6 +26,7 @@
 #include "hw/qdev-properties.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
+#include "target/arm/gtimer.h"
 
 static void a15mp_priv_set_irq(void *opaque, int irq, int level)
 {
index 4807a4fea0df7e559be001210d6105ab7a7c1b1b..b60e1030469bfcd1f5965e7e4af6642aac0e3f24 100644 (file)
@@ -49,6 +49,7 @@
 #include "fpu/softfloat.h"
 #include "cpregs.h"
 #include "target/arm/cpu-qom.h"
+#include "target/arm/gtimer.h"
 
 static void arm_cpu_set_pc(CPUState *cs, vaddr value)
 {
index e8df41d642e792dc91b2478b181c75ac0329e386..d3477b16018fe0183672fdc8d33cbd3f175482f2 100644 (file)
@@ -27,6 +27,7 @@
 #include "exec/cpu-defs.h"
 #include "qapi/qapi-types-common.h"
 #include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
 
 /* ARM processors have a weak memory model */
 #define TCG_GUEST_DEFAULT_MO      (0)
@@ -140,13 +141,6 @@ typedef struct ARMGenericTimer {
     uint64_t ctl; /* Timer Control register */
 } ARMGenericTimer;
 
-#define GTIMER_PHYS     0
-#define GTIMER_VIRT     1
-#define GTIMER_HYP      2
-#define GTIMER_SEC      3
-#define GTIMER_HYPVIRT  4
-#define NUM_GTIMERS     5
-
 #define VTCR_NSW (1u << 29)
 #define VTCR_NSA (1u << 30)
 #define VSTCR_SW VTCR_NSW
diff --git a/target/arm/gtimer.h b/target/arm/gtimer.h
new file mode 100644 (file)
index 0000000..b992941
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ARM generic timer definitions for Arm A-class CPU
+ *
+ *  Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef TARGET_ARM_GTIMER_H
+#define TARGET_ARM_GTIMER_H
+
+enum {
+    GTIMER_PHYS     = 0,
+    GTIMER_VIRT     = 1,
+    GTIMER_HYP      = 2,
+    GTIMER_SEC      = 3,
+    GTIMER_HYPVIRT  = 4,
+#define NUM_GTIMERS   5
+};
+
+#endif
index e07b2af8a3d85a8f80536bda671ab16fd19b0c82..945d8571a61959a5284bdb5db81e886aba3859b9 100644 (file)
@@ -30,6 +30,7 @@
 #include "semihosting/common-semi.h"
 #endif
 #include "cpregs.h"
+#include "target/arm/gtimer.h"
 
 #define ARM_CPU_FREQ 1000000000 /* FIXME: 1 GHz, should be configurable */
 
index 71a26db1886fbf6582e0f187fdaea49b34cf186e..e5f0f60093e1fb7ac302bb67ebb479c7efa1490c 100644 (file)
@@ -29,6 +29,7 @@
 #include "target/arm/cpu.h"
 #include "target/arm/internals.h"
 #include "target/arm/multiprocessing.h"
+#include "target/arm/gtimer.h"
 #include "trace/trace-target_arm_hvf.h"
 #include "migration/vmstate.h"
 
index 8f52b211f9ac917e2e80f11f7c3136be2a3e65bb..81813030a5a0dae3270b249d1a7f5892eea36e1c 100644 (file)
@@ -38,6 +38,7 @@
 #include "qemu/log.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/ghes.h"
+#include "target/arm/gtimer.h"
 
 const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
     KVM_CAP_LAST_INFO
index 542be14bec2c9a27eeb2894b501698e33f9f52eb..9d7dbaea54c0c012c29e0147c95fab68059ddb5d 100644 (file)
@@ -7,6 +7,7 @@
 #include "internals.h"
 #include "cpu-features.h"
 #include "migration/cpu.h"
+#include "target/arm/gtimer.h"
 
 static bool vfp_needed(void *opaque)
 {