]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
semihosting: Move ARM semihosting code to shared directories
authorKeith Packard <keithp@keithp.com>
Fri, 8 Jan 2021 22:42:48 +0000 (22:42 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 18 Jan 2021 10:05:06 +0000 (10:05 +0000)
This commit renames two files which provide ARM semihosting support so
that they can be shared by other architectures:

 1. target/arm/arm-semi.c     -> hw/semihosting/common-semi.c
 2. linux-user/arm/semihost.c -> linux-user/semihost.c

The build system was modified use a new config variable,
CONFIG_ARM_COMPATIBLE_SEMIHOSTING, which has been added to the ARM
softmmu and linux-user default configs. The contents of the source
files has not been changed in this patch.

Signed-off-by: Keith Packard <keithp@keithp.com>
[AJB: rename arm-compat-semi, select SEMIHOSTING]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210107170717.2098982-2-keithp@keithp.com>
Message-Id: <20210108224256.2321-13-alex.bennee@linaro.org>

12 files changed:
default-configs/devices/arm-softmmu.mak
default-configs/targets/aarch64-linux-user.mak
default-configs/targets/aarch64_be-linux-user.mak
default-configs/targets/arm-linux-user.mak
default-configs/targets/armeb-linux-user.mak
hw/semihosting/Kconfig
hw/semihosting/arm-compat-semi.c [moved from target/arm/arm-semi.c with 100% similarity]
hw/semihosting/meson.build
linux-user/arm/meson.build
linux-user/meson.build
linux-user/semihost.c [moved from linux-user/arm/semihost.c with 100% similarity]
target/arm/meson.build

index 08a32123b4c9b71f5e149b684c3662835def4c42..0500156a0c7b6bc37a869142be3225fb5d5bf260 100644 (file)
@@ -42,4 +42,5 @@ CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
 CONFIG_SEMIHOSTING=y
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
index 163c9209f45d6731c24f24198c99c08dc4d0ab85..4713253709f96f24ca84bb6dcebe97d9fd39fe44 100644 (file)
@@ -2,3 +2,4 @@ TARGET_ARCH=aarch64
 TARGET_BASE_ARCH=arm
 TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
 TARGET_HAS_BFLT=y
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
index 4c953cf8c5939d581957523246e6cdcecda9de1e..fae831558dac0d0b92ba9c05910dd05a8c75f671 100644 (file)
@@ -3,3 +3,4 @@ TARGET_BASE_ARCH=arm
 TARGET_WORDS_BIGENDIAN=y
 TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
 TARGET_HAS_BFLT=y
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
index c7cd872e8600efbae4656789ebce283ad49d2ecd..e741ffd4d309f3d1500cd0c7c081d962ef8bdcbe 100644 (file)
@@ -3,3 +3,4 @@ TARGET_SYSTBL_ABI=common,oabi
 TARGET_SYSTBL=syscall.tbl
 TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
 TARGET_HAS_BFLT=y
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
index 79bf10e99b46e1227c821518da53b973dac02f5c..255e44e8b0a9efaf6a29aae8a0164dffb98503d4 100644 (file)
@@ -4,3 +4,4 @@ TARGET_SYSTBL=syscall.tbl
 TARGET_WORDS_BIGENDIAN=y
 TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
 TARGET_HAS_BFLT=y
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
index efe0a30734c09f2179c0ddd654767bed235684fa..eaf3a20ef5b21223036f2234ff20b103658b158a 100644 (file)
@@ -1,3 +1,7 @@
 
 config SEMIHOSTING
        bool
+
+config ARM_COMPATIBLE_SEMIHOSTING
+       bool
+       select SEMIHOSTING
index f40ac574c440d2dce2dc244ecbfe9e7370c09fe7..ea8090abe34c6315196e7efc47104daf7d607eb4 100644 (file)
@@ -2,3 +2,6 @@ specific_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files(
   'config.c',
   'console.c',
 ))
+
+specific_ss.add(when: ['CONFIG_ARM_COMPATIBLE_SEMIHOSTING'],
+               if_true: files('arm-compat-semi.c'))
index 432984b58e01bebbfaf65e6a0a61840bdd963b59..5a93c925cf7ea06b25ab9d00425200db3a9b2853 100644 (file)
@@ -1,6 +1,3 @@
-linux_user_ss.add(when: 'TARGET_AARCH64', if_true: files('semihost.c'))
-linux_user_ss.add(when: 'TARGET_ARM', if_true: files('semihost.c'))
-
 subdir('nwfpe')
 
 syscall_nr_generators += {
index 2b94e4ba24a218007af540ae99243a08bdde02d0..7fe28d659eff2da2309ca8c98f6c9404496ec189 100644 (file)
@@ -16,6 +16,7 @@ linux_user_ss.add(rt)
 
 linux_user_ss.add(when: 'TARGET_HAS_BFLT', if_true: files('flatload.c'))
 linux_user_ss.add(when: 'TARGET_I386', if_true: files('vm86.c'))
+linux_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('semihost.c'))
 
 
 syscall_nr_generators = {}
index f5de2a77b89f30ef1203ee943a82be90747368e9..15b936c1010066e0f33beb4c551a1803981d7cb2 100644 (file)
@@ -32,8 +32,6 @@ arm_ss.add(files(
 ))
 arm_ss.add(zlib)
 
-arm_ss.add(when: 'CONFIG_TCG', if_true: files('arm-semi.c'))
-
 arm_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c', 'kvm64.c'), if_false: files('kvm-stub.c'))
 
 arm_ss.add(when: 'TARGET_AARCH64', if_true: files(