From: Jes Sorensen <jes@sgi.com>
To: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [patch] move MAX_CPUS to cpu.h
Date: Tue, 23 Sep 2008 13:44:20 +0200 [thread overview]
Message-ID: <48D8D694.1000609@sgi.com> (raw)
[-- 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;
next reply other threads:[~2008-09-23 11:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 11:44 Jes Sorensen [this message]
2008-09-23 12:08 ` [Qemu-devel] [patch] move MAX_CPUS to cpu.h 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48D8D694.1000609@sgi.com \
--to=jes@sgi.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).