[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH-for-9.1? 2/2] hw/intc/arm_gic: Only provide query-gic-cap
From: |
Peter Maydell |
Subject: |
Re: [RFC PATCH-for-9.1? 2/2] hw/intc/arm_gic: Only provide query-gic-capabilities when GIC built-in |
Date: |
Wed, 7 Aug 2024 17:30:50 +0100 |
On Wed, 7 Aug 2024 at 12:10, Markus Armbruster <armbru@redhat.com> wrote:
> Having to manually include a configuration header like CONFIG_DEVICES
> wherever you use configuration symbols strikes me as unadvisable when
> uses include checking for definedness, such as #ifdef: silent miscompile
> when you forget to include.
>
> This is why Autoconf wants you to include config.h first in any .c: it
> makes #ifdef & friends safe.
>
> qemu/osdep.h does include some configuration headers:
>
> #include "config-host.h"
> #ifdef COMPILING_PER_TARGET
> #include CONFIG_TARGET
> #else
> #include "exec/poison.h"
> #endif
>
> Why not CONFIG_DEVICES?
The stuff in CONFIG_DEVICES is target-specific, so wanting
to include it should be rare (currently we include it in
only about 25 files). Any file that includes it has to be
a compile-per-target file, and generally we'd rather avoid that.
Plus it's a bit odd to need to change code based on whether
some other device was configured into the system, so I think
that's something worth restricting to only files that effectively
opt in to it.
thanks
-- PMM
- Re: [RFC PATCH-for-9.1? 1/2] target/arm: Move qmp_query_gic_capabilities() to hw/intc/, (continued)
[RFC PATCH-for-9.1? 2/2] hw/intc/arm_gic: Only provide query-gic-capabilities when GIC built-in, Philippe Mathieu-Daudé, 2024/08/06