[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 15/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an en
From: |
BALATON Zoltan |
Subject: |
[PATCH v4 15/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum |
Date: |
Tue, 25 Oct 2022 18:44:50 +0200 (CEST) |
This might allow the compiler to check values.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/mac_newworld.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 4f5876670f..bcd6566ead 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -95,15 +95,17 @@ typedef struct Core99MachineState Core99MachineState;
DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE,
TYPE_CORE99_MACHINE)
-#define CORE99_VIA_CONFIG_CUDA 0x0
-#define CORE99_VIA_CONFIG_PMU 0x1
-#define CORE99_VIA_CONFIG_PMU_ADB 0x2
+typedef enum {
+ CORE99_VIA_CONFIG_CUDA = 0,
+ CORE99_VIA_CONFIG_PMU,
+ CORE99_VIA_CONFIG_PMU_ADB
+} Core99ViaConfig;
struct Core99MachineState {
/*< private >*/
MachineState parent;
- uint8_t via_config;
+ Core99ViaConfig via_config;
};
static void fw_cfg_boot_set(void *opaque, const char *boot_device,
--
2.30.4
- [PATCH v4 01/19] mac_newworld: Drop some variables, (continued)
- [PATCH v4 01/19] mac_newworld: Drop some variables, BALATON Zoltan, 2022/10/25
- [PATCH v4 03/19] mac_{old|new}world: Set tbfreq at declaration, BALATON Zoltan, 2022/10/25
- [PATCH v4 05/19] mac_{old|new}world: Simplify cmdline_base calculation, BALATON Zoltan, 2022/10/25
- [PATCH v4 08/19] hw/ppc/mac.h: Move newworld specific parts out from shared header, BALATON Zoltan, 2022/10/25
- [PATCH v4 06/19] mac_newworld: Clean up creation of Uninorth devices, BALATON Zoltan, 2022/10/25
- [PATCH v4 07/19] mac_{old|new}world: Reduce number of QOM casts, BALATON Zoltan, 2022/10/25
- [PATCH v4 09/19] hw/ppc/mac.h: Move macio specific parts out from shared header, BALATON Zoltan, 2022/10/25
- [PATCH v4 10/19] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header, BALATON Zoltan, 2022/10/25
- [PATCH v4 11/19] hw/ppc/mac.h: Move PROM and KERNEL defines to board code, BALATON Zoltan, 2022/10/25
- [PATCH v4 13/19] mac_nvram: Use NVRAM_SIZE constant, BALATON Zoltan, 2022/10/25
- [PATCH v4 15/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum,
BALATON Zoltan <=
- [PATCH v4 12/19] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h, BALATON Zoltan, 2022/10/25
- [PATCH v4 16/19] mac_newworld: Add machine types for different mac99 configs, BALATON Zoltan, 2022/10/25
[PATCH v4 18/19] mac_newworld: Deprecate mac99 "via" option, BALATON Zoltan, 2022/10/25
[PATCH v4 19/19] mac_newworld: Document deprecation, BALATON Zoltan, 2022/10/25