diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-04 23:44:42 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-11 20:03:26 +0100 |
commit | 5dc4337f7908606865f48e476e36482579e1183f (patch) | |
tree | e55913558635aad8c006374abc850e74bf0bea9f | |
parent | 3a11b653a63fee0e43f4ab84b93f068b961d8fe7 (diff) | |
download | qemu-5dc4337f7908606865f48e476e36482579e1183f.zip qemu-5dc4337f7908606865f48e476e36482579e1183f.tar.gz qemu-5dc4337f7908606865f48e476e36482579e1183f.tar.bz2 |
system: Extract target-specific globals to their own compilation unit
We shouldn't use target specific globals for machine properties.
These ones could be desugarized, as explained in [*]. While
certainly doable, not trivial nor my priority for now. Just move
them to a different file to clarify they are *globals*, like the
generic globals residing in system/globals.c.
Since arch_init.c was introduced using the MIT license (see commit
ad96090a01d), retain the same license for the new globals-target.c
file.
[*] https://lore.kernel.org/qemu-devel/e514d6db-781d-4afe-b057-9046c70044dc@redhat.com/
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250305005225.95051-2-philmd@linaro.org>
-rw-r--r-- | system/arch_init.c | 14 | ||||
-rw-r--r-- | system/globals-target.c | 24 | ||||
-rw-r--r-- | system/meson.build | 1 |
3 files changed, 25 insertions, 14 deletions
diff --git a/system/arch_init.c b/system/arch_init.c index b1baed1..b9147af 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -24,18 +24,4 @@ #include "qemu/osdep.h" #include "system/arch_init.h" -#ifdef TARGET_SPARC -int graphic_width = 1024; -int graphic_height = 768; -int graphic_depth = 8; -#elif defined(TARGET_M68K) -int graphic_width = 800; -int graphic_height = 600; -int graphic_depth = 8; -#else -int graphic_width = 800; -int graphic_height = 600; -int graphic_depth = 32; -#endif - const uint32_t arch_type = QEMU_ARCH; diff --git a/system/globals-target.c b/system/globals-target.c new file mode 100644 index 0000000..9897205 --- /dev/null +++ b/system/globals-target.c @@ -0,0 +1,24 @@ +/* + * Global variables that should not exist (target specific) + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "system/system.h" + +#ifdef TARGET_SPARC +int graphic_width = 1024; +int graphic_height = 768; +int graphic_depth = 8; +#elif defined(TARGET_M68K) +int graphic_width = 800; +int graphic_height = 600; +int graphic_depth = 8; +#else +int graphic_width = 800; +int graphic_height = 600; +int graphic_depth = 32; +#endif diff --git a/system/meson.build b/system/meson.build index c83d80f..eec07a9 100644 --- a/system/meson.build +++ b/system/meson.build @@ -1,6 +1,7 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', 'ioport.c', + 'globals-target.c', 'memory.c', 'physmem.c', )]) |