qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] move MAX_CPUS to cpu.h
@ 2008-09-23 11:44 Jes Sorensen
  2008-09-23 12:08 ` Paul Brook
  0 siblings, 1 reply; 16+ messages in thread
From: Jes Sorensen @ 2008-09-23 11:44 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

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


[-- Attachment #2: 1000-qemu-move-max-cpus.patch --]
[-- Type: text/plain, Size: 4046 bytes --]

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 <jes@sgi.com>

---
 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 <setjmp.h>
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 <inttypes.h>
 
+#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;

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-10-03  9:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 11:44 [Qemu-devel] [patch] move MAX_CPUS to cpu.h Jes Sorensen
2008-09-23 12:08 ` Paul Brook
2008-09-23 12:10   ` Jes Sorensen
2008-09-23 12:50     ` Paul Brook
2008-09-23 12:53       ` Jes Sorensen
2008-09-23 13:04         ` Paul Brook
2008-09-23 13:10           ` Jes Sorensen
2008-09-25 15:21           ` [Qemu-devel] [patch] Introduce per machine based max_cpu variable Jes Sorensen
2008-09-30 14:47             ` Anthony Liguori
2008-09-30 15:06               ` Jes Sorensen
2008-09-30 15:18                 ` Anthony Liguori
2008-10-01 13:22                   ` Jes Sorensen
2008-09-30 15:19               ` Jes Sorensen
2008-10-02 15:45             ` Paul Brook
2008-10-03  9:40               ` Jes Sorensen
2008-09-23 14:13       ` [Qemu-devel] [patch] move MAX_CPUS to cpu.h M. Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).