On 26/01/2024 11.44, Philippe Mathieu-Daudé wrote:
Hi Thomas,

On 26/1/24 09:39, Thomas Huth wrote:
Move the code to a separate file so that we do not have to compile
it anymore if CONFIG_ARM_V7M is not set.

Signed-off-by: Thomas Huth <th...@redhat.com>
---
  target/arm/tcg/cpu-v7m.c   | 292 +++++++++++++++++++++++++++++++++++++
  target/arm/tcg/cpu32.c     | 261 ---------------------------------
  target/arm/tcg/meson.build |   4 +
  3 files changed, 296 insertions(+), 261 deletions(-)
  create mode 100644 target/arm/tcg/cpu-v7m.c

diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c
new file mode 100644
index 0000000000..d61873ab6d
--- /dev/null
+++ b/target/arm/tcg/cpu-v7m.c
@@ -0,0 +1,292 @@
+/*
+ * QEMU ARM V7 TCG-only CPUs.

s/V7/v7M/

ok

+ *
+ * Copyright (c) 2012 SUSE LINUX Products GmbH
+ *
+ * This code is licensed under the GNU GPL v2 or later.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "hw/core/tcg-cpu-ops.h"
+#include "internals.h"
+#include "hw/intc/armv7m_nvic.h"
+
+/* CPU models. These are not needed for the AArch64 linux-user build. */
+#if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)

Could we do that in meson instead?

I don't think so... (see below)

diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build
index 6fca38f2cc..8c7f6b43f3 100644
--- a/target/arm/tcg/meson.build
+++ b/target/arm/tcg/meson.build
@@ -52,6 +52,10 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files(
    'sve_helper.c',
  ))
+arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files(

-> arm_system_ss

Don't we still need the code for the 32-bit qemu-arm binary? See:

$ ./qemu-arm -cpu help | grep cortex-m
  cortex-m0
  cortex-m3
  cortex-m33
  cortex-m4
  cortex-m55
  cortex-m7

So I don't think we should add this to arm_system_ss only, should we?

 Thomas


+  'cpu-v7m.c'
+))



Reply via email to