Move definition of MAX_CPUS from vl.c to architecture specific cpu.h header file. This reduces #ifdef clutter and allows for other files to define array sizes based on MAX_CPUS, which is needed for KVM and probably other places. Signed-off-by: Jes Sorensen --- hw/ppc_mac.h | 3 --- target-alpha/cpu.h | 2 ++ target-arm/cpu.h | 2 ++ target-cris/cpu.h | 2 ++ target-i386/cpu.h | 2 ++ target-m68k/cpu.h | 2 ++ target-mips/cpu.h | 2 ++ target-ppc/cpu.h | 2 ++ target-sh4/cpu.h | 2 ++ target-sparc/cpu.h | 2 ++ vl.c | 7 ------- 11 files changed, 18 insertions(+), 10 deletions(-) Index: qemu/hw/ppc_mac.h =================================================================== --- qemu.orig/hw/ppc_mac.h +++ qemu/hw/ppc_mac.h @@ -25,9 +25,6 @@ #if !defined(__PPC_MAC_H__) #define __PPC_MAC_H__ -/* SMP is not enabled, for now */ -#define MAX_CPUS 1 - #define BIOS_FILENAME "ppc_rom.bin" #define VGABIOS_FILENAME "video.x" #define NVRAM_SIZE 0x2000 Index: qemu/target-alpha/cpu.h =================================================================== --- qemu.orig/target-alpha/cpu.h +++ qemu/target-alpha/cpu.h @@ -25,6 +25,8 @@ #define TARGET_LONG_BITS 64 +#define MAX_CPUS 1 + #include "cpu-defs.h" #include Index: qemu/target-arm/cpu.h =================================================================== --- qemu.orig/target-arm/cpu.h +++ qemu/target-arm/cpu.h @@ -22,6 +22,8 @@ #define TARGET_LONG_BITS 32 +#define MAX_CPUS 1 + #define ELF_MACHINE EM_ARM #include "cpu-defs.h" Index: qemu/target-cris/cpu.h =================================================================== --- qemu.orig/target-cris/cpu.h +++ qemu/target-cris/cpu.h @@ -23,6 +23,8 @@ #define TARGET_LONG_BITS 32 +#define MAX_CPUS 1 + #include "cpu-defs.h" #define TARGET_HAS_ICE 1 Index: qemu/target-i386/cpu.h =================================================================== --- qemu.orig/target-i386/cpu.h +++ qemu/target-i386/cpu.h @@ -22,6 +22,8 @@ #include "config.h" +#define MAX_CPUS 255 + #ifdef TARGET_X86_64 #define TARGET_LONG_BITS 64 #else Index: qemu/target-m68k/cpu.h =================================================================== --- qemu.orig/target-m68k/cpu.h +++ qemu/target-m68k/cpu.h @@ -23,6 +23,8 @@ #define TARGET_LONG_BITS 32 +#define MAX_CPUS 1 + #include "cpu-defs.h" #include "softfloat.h" Index: qemu/target-mips/cpu.h =================================================================== --- qemu.orig/target-mips/cpu.h +++ qemu/target-mips/cpu.h @@ -3,6 +3,8 @@ #define TARGET_HAS_ICE 1 +#define MAX_CPUS 1 + #define ELF_MACHINE EM_MIPS #include "config.h" Index: qemu/target-ppc/cpu.h =================================================================== --- qemu.orig/target-ppc/cpu.h +++ qemu/target-ppc/cpu.h @@ -23,6 +23,8 @@ #include "config.h" #include +#define MAX_CPUS 1 + //#define PPC_EMULATE_32BITS_HYPV #if defined (TARGET_PPC64) Index: qemu/target-sh4/cpu.h =================================================================== --- qemu.orig/target-sh4/cpu.h +++ qemu/target-sh4/cpu.h @@ -22,6 +22,8 @@ #include "config.h" +#define MAX_CPUS 1 + #define TARGET_LONG_BITS 32 #define TARGET_HAS_ICE 1 Index: qemu/target-sparc/cpu.h =================================================================== --- qemu.orig/target-sparc/cpu.h +++ qemu/target-sparc/cpu.h @@ -3,6 +3,8 @@ #include "config.h" +#define MAX_CPUS 16 + #if !defined(TARGET_SPARC64) #define TARGET_LONG_BITS 32 #define TARGET_FPREGS 32 Index: qemu/vl.c =================================================================== --- qemu.orig/vl.c +++ qemu/vl.c @@ -209,13 +209,6 @@ int usb_enabled = 0; static VLANState *first_vlan; int smp_cpus = 1; const char *vnc_display; -#if defined(TARGET_SPARC) -#define MAX_CPUS 16 -#elif defined(TARGET_I386) -#define MAX_CPUS 255 -#else -#define MAX_CPUS 1 -#endif int acpi_enabled = 1; int fd_bootchk = 1; int no_reboot = 0;