From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ki6Jg-0002BS-Iv for qemu-devel@nongnu.org; Tue, 23 Sep 2008 07:44:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ki6Je-0002A0-W3 for qemu-devel@nongnu.org; Tue, 23 Sep 2008 07:44:28 -0400 Received: from [199.232.76.173] (port=40686 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ki6Je-00029w-Nq for qemu-devel@nongnu.org; Tue, 23 Sep 2008 07:44:26 -0400 Received: from relay2.sgi.com ([192.48.171.30]:41859 helo=relay.sgi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ki6Je-0004qA-80 for qemu-devel@nongnu.org; Tue, 23 Sep 2008 07:44:26 -0400 Message-ID: <48D8D694.1000609@sgi.com> Date: Tue, 23 Sep 2008 13:44:20 +0200 From: Jes Sorensen MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010507060000060407050800" Subject: [Qemu-devel] [patch] move MAX_CPUS to cpu.h Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------010507060000060407050800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, In order to allow for other structs to be sized based on MAX_CPUS and get rid of some ifdef clutter, I'd like to suggest this patch. Cheers, Jes --------------010507060000060407050800 Content-Type: text/plain; name="1000-qemu-move-max-cpus.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="1000-qemu-move-max-cpus.patch" 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; --------------010507060000060407050800--