qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH for-8.0] hw/misc: Move some arm-related files from specific_s


From: Peter Maydell
Subject: Re: [PATCH for-8.0] hw/misc: Move some arm-related files from specific_ss into softmmu_ss
Date: Thu, 1 Dec 2022 11:55:14 +0000

On Wed, 30 Nov 2022 at 11:16, Thomas Huth <thuth@redhat.com> wrote:
>
> By removing #include "kvm-consts.h" from arm-powerctl.h (seems not to
> be required there) and adjusting the header includes in some files, we
> can move them from specific_ss into softmmu_ss, so that they only need
> to be compiled once and not for qemu-system-arm and qemu-system-aarch64
> individually.

> --- a/target/arm/arm-powerctl.h
> +++ b/target/arm/arm-powerctl.h
> @@ -11,8 +11,6 @@
>  #ifndef QEMU_ARM_POWERCTL_H
>  #define QEMU_ARM_POWERCTL_H
>
> -#include "kvm-consts.h"
> -
>  #define QEMU_ARM_POWERCTL_RET_SUCCESS QEMU_PSCI_RET_SUCCESS
>  #define QEMU_ARM_POWERCTL_INVALID_PARAM QEMU_PSCI_RET_INVALID_PARAMS
>  #define QEMU_ARM_POWERCTL_ALREADY_ON QEMU_PSCI_RET_ALREADY_ON

kvm-consts.h is where QEMU_PSCI_RET_SUCCESS etc are defined.
So while the #include isn't strictly needed for compilation to work
because arm-powerctl.h only creates the #define and doesn't use it,
it does mean that any source file that uses the QEMU_ARM_POWERCTL_*
now needs to include kvm-consts.h somehow itself. (Usually this is
going to happen implicitly via target/arm/cpu.h, I think.)

I guess this is worth living with for the benefit of not
compiling things twice. It could probably be untangled a little
by e.g. moving the PSCI constants into their own header rather
than defining them in kvm-consts.h, but I'm not sure if it's
worth the effort right now.

> diff --git a/hw/misc/meson.build b/hw/misc/meson.build
> index 95268eddc0..9ca6bf1d17 100644
> --- a/hw/misc/meson.build
> +++ b/hw/misc/meson.build
> @@ -84,8 +84,8 @@ softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files(
>  ))
>  softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_misc.c'))
>  softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c'))
> -specific_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: 
> files('xlnx-zynqmp-crf.c'))
> -specific_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: 
> files('xlnx-zynqmp-apu-ctrl.c'))
> +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: 
> files('xlnx-zynqmp-crf.c'))
> +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: 
> files('xlnx-zynqmp-apu-ctrl.c'))
>  specific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: 
> files('xlnx-versal-crl.c'))
>  softmmu_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files(
>    'xlnx-versal-xramc.c',
> @@ -126,8 +126,8 @@ softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: 
> files('grlib_ahb_apb_pnp.c'))
>
>  specific_ss.add(when: 'CONFIG_AVR_POWER', if_true: files('avr_power.c'))
>
> -specific_ss.add(when: 'CONFIG_IMX', if_true: files('imx6_src.c'))
> -specific_ss.add(when: 'CONFIG_IOTKIT_SYSCTL', if_true: 
> files('iotkit-sysctl.c'))
> +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx6_src.c'))

This file could now be listed in the
"softmmu_ss.add(when: 'CONFIG_IMX', if_true: files(...)" list earlier in
the file.

> +softmmu_ss.add(when: 'CONFIG_IOTKIT_SYSCTL', if_true: 
> files('iotkit-sysctl.c'))

This line could be moved up to next to the other CONFIG_IOTKIT_* lines.

>  specific_ss.add(when: 'CONFIG_MAC_VIA', if_true: files('mac_via.c'))

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]