diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2025-03-19 19:31:09 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-03-20 09:23:18 +0100 |
commit | f88c9cd804804360fa4b3586d7d2f84505ab8c26 (patch) | |
tree | 31d2d5abab0fd6e7b4b52da40670764be530cc19 /hw/char | |
parent | 1dae461a913f9da88df05de6e2020d3134356f2e (diff) | |
download | qemu-f88c9cd804804360fa4b3586d7d2f84505ab8c26.zip qemu-f88c9cd804804360fa4b3586d7d2f84505ab8c26.tar.gz qemu-f88c9cd804804360fa4b3586d7d2f84505ab8c26.tar.bz2 |
rust: Kconfig: Factor out whether PL011 is Rust or C
Currently every board that uses the PL011 duplicates the logic that
selects the Rust implementation if Rust was enabled and the C
implementation if it does not. Factor this out into a separate
Kconfig stanza, so that boards can go back to simply doing "select
PL011" and get whichever implementation is correct for the build.
This fixes a compilation failure if CONFIG_VMAPPLE is enabled
in a Rust build, because hw/vmapple/Kconfig didn't have the
"pick the Rust PL011 if Rust is enabled" logic in it.
Fixes: 59f4d65584bd33 ("hw/vmapple/vmapple: Add vmapple machine type")
Reported-by: Tanish Desai <tanishdesai37@gmail.com>
Analyzed-by: Tanish Desai <tanishdesai37@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20250319193110.1565578-2-peter.maydell@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char')
-rw-r--r-- | hw/char/Kconfig | 6 | ||||
-rw-r--r-- | hw/char/meson.build | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/hw/char/Kconfig b/hw/char/Kconfig index 3f70256..9d517f3 100644 --- a/hw/char/Kconfig +++ b/hw/char/Kconfig @@ -11,6 +11,12 @@ config PARALLEL config PL011 bool + # The PL011 has both a Rust and a C implementation + select PL011_C if !HAVE_RUST + select X_PL011_RUST if HAVE_RUST + +config PL011_C + bool config SERIAL bool diff --git a/hw/char/meson.build b/hw/char/meson.build index 86ee808..4e439da 100644 --- a/hw/char/meson.build +++ b/hw/char/meson.build @@ -9,7 +9,7 @@ system_ss.add(when: 'CONFIG_ISA_BUS', if_true: files('parallel-isa.c')) system_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugcon.c')) system_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_uart.c')) system_ss.add(when: 'CONFIG_PARALLEL', if_true: files('parallel.c')) -system_ss.add(when: 'CONFIG_PL011', if_true: files('pl011.c')) +system_ss.add(when: 'CONFIG_PL011_C', if_true: files('pl011.c')) system_ss.add(when: 'CONFIG_SCLPCONSOLE', if_true: files('sclpconsole.c', 'sclpconsole-lm.c')) system_ss.add(when: 'CONFIG_SERIAL', if_true: files('serial.c')) system_ss.add(when: 'CONFIG_SERIAL_ISA', if_true: files('serial-isa.c')) |