From 66f07911d44650f17375192d85cc32d3d50f14c5 Mon Sep 17 00:00:00 2001
Message-Id: <66f07911d44650f17375192d85cc32d3d50f14c5.1301178270.git.blauwirbel@gmail.com>
In-Reply-To: <1ae00000c153f56f45a62e9520a773bbfa3d185c.1301178269.git.blauwirbel@gmail.com>
References: <1ae00000c153f56f45a62e9520a773bbfa3d185c.1301178269.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 26 Mar 2011 18:41:36 +0000
Subject: [PATCH 3/4] Introduce machine state
Move generic machine state to machine-state.h, adjust
users.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
cpus.c | 1 +
hw/acpi_piix4.c | 2 +-
hw/apb_pci.c | 2 +-
hw/arm_boot.c | 2 +-
hw/arm_sysctl.c | 2 +-
hw/bonito.c | 2 +-
hw/cbus.c | 2 +-
hw/cuda.c | 2 +-
hw/e1000.c | 2 +-
hw/eepro100.c | 2 +-
hw/etraxfs_dma.c | 2 +-
hw/etraxfs_timer.c | 2 +-
hw/fdc.c | 2 +-
hw/fw_cfg.c | 2 +-
hw/ide/core.c | 2 +-
hw/ide/qdev.c | 2 +-
hw/leon3.c | 2 +-
hw/lm32_sys.c | 2 +-
hw/loader.c | 2 +-
hw/m48t59.c | 2 +-
hw/mac_nvram.c | 2 +-
hw/mc146818rtc.c | 2 +-
hw/mcf5206.c | 2 +-
hw/mcf5208.c | 2 +-
hw/mips_fulong2e.c | 2 +-
hw/mips_jazz.c | 2 +-
hw/mips_malta.c | 2 +-
hw/mips_mipssim.c | 2 +-
hw/mips_r4k.c | 2 +-
hw/multiboot.c | 2 +-
hw/musicpal.c | 2 +-
hw/ne2000.c | 2 +-
hw/nseries.c | 2 +-
hw/omap1.c | 2 +-
hw/omap2.c | 2 +-
hw/palm.c | 2 +-
hw/parallel.c | 2 +-
hw/pc.c | 1 +
hw/pc_piix.c | 2 +-
hw/pci-hotplug.c | 1 +
hw/pci-stub.c | 1 +
hw/pci.c | 2 +-
hw/pcie_aer.c | 2 +-
hw/pckbd.c | 2 +-
hw/pcnet.c | 2 +-
hw/petalogix_ml605_mmu.c | 2 +-
hw/ppc.c | 2 +-
hw/ppc405_boards.c | 2 +-
hw/ppc405_uc.c | 2 +-
hw/ppc440.c | 2 +-
hw/ppc_newworld.c | 2 +-
hw/ppc_oldworld.c | 2 +-
hw/ppc_prep.c | 2 +-
hw/ppce500_mpc8544ds.c | 2 +-
hw/pxa2xx.c | 2 +-
hw/pxa2xx_lcd.c | 4 +-
hw/pxa2xx_timer.c | 2 +-
hw/qdev.c | 2 +-
hw/r2d.c | 2 +-
hw/realview.c | 2 +-
hw/rtl8139.c | 2 +-
hw/scsi-disk.c | 2 +-
hw/serial.c | 2 +-
hw/sh7750.c | 2 +-
hw/shix.c | 2 +-
hw/slavio_misc.c | 2 +-
hw/smbios.c | 4 +-
hw/spitz.c | 3 +-
hw/sun4m.c | 2 +-
hw/sun4u.c | 2 +-
hw/usb-msd.c | 2 +-
hw/usb-net.c | 2 +-
hw/versatilepb.c | 2 +-
hw/virtex_ml507.c | 2 +-
hw/virtio-blk.c | 1 +
hw/virtio-net.c | 1 +
hw/vt82c686.c | 2 +-
hw/watchdog.c | 1 +
hw/xen_console.c | 2 +-
hw/xen_domainbuild.c | 1 +
hw/xen_machine_pv.c | 2 +-
input.c | 2 +-
kvm-all.c | 2 +-
machine-state.h | 100 ++++++++++++++++++++++++++++++++++++++++++++++
monitor.c | 1 +
qemu-common.h | 5 ++
qemu-timer.c | 1 +
sysemu.h | 92 ------------------------------------------
target-i386/helper.c | 2 +-
target-i386/kvm.c | 2 +-
target-sparc/op_helper.c | 2 +-
ui/sdl.c | 1 +
vl.c | 1 +
93 files changed, 199 insertions(+), 171 deletions(-)
create mode 100644 machine-state.h
@@ -36,6 +36,7 @@
#include "cpus.h"
#include "compatfd.h"
#include "vm-state.h"
+#include "machine-state.h"
#ifdef SIGRTMIN
#define SIG_IPI (SIGRTMIN+4)
@@ -21,8 +21,8 @@
#include "pm_smbus.h"
#include "pci.h"
#include "acpi.h"
-#include "sysemu.h"
#include "range.h"
+#include "machine-state.h"
//#define DEBUG
@@ -33,7 +33,7 @@
#include "pci_internals.h"
#include "rwhandler.h"
#include "apb_pci.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* debug APB */
//#define DEBUG_APB
@@ -9,9 +9,9 @@
#include "hw.h"
#include "arm-misc.h"
-#include "sysemu.h"
#include "loader.h"
#include "elf.h"
+#include "machine-state.h"
#define KERNEL_ARGS_ADDR 0x100
#define KERNEL_LOAD_ADDR 0x00010000
@@ -11,7 +11,7 @@
#include "qemu-timer.h"
#include "sysbus.h"
#include "primecell.h"
-#include "sysemu.h"
+#include "machine-state.h"
#define LOCK_VALUE 0xa05f
@@ -41,7 +41,7 @@
#include "pc.h"
#include "mips.h"
#include "pci_host.h"
-#include "sysemu.h"
+#include "machine-state.h"
//#define DEBUG_BONITO
@@ -23,7 +23,7 @@
#include "qemu-common.h"
#include "irq.h"
#include "devices.h"
-#include "sysemu.h"
+#include "machine-state.h"
//#define DEBUG
@@ -25,7 +25,7 @@
#include "hw.h"
#include "ppc_mac.h"
#include "qemu-timer.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* XXX: implement all timer modes */
@@ -30,7 +30,7 @@
#include "net.h"
#include "net/checksum.h"
#include "loader.h"
-#include "sysemu.h"
+#include "machine-state.h"
#include "e1000_hw.h"
@@ -46,7 +46,7 @@
#include "pci.h"
#include "net.h"
#include "eeprom93xx.h"
-#include "sysemu.h"
+#include "machine-state.h"
#define KiB 1024
@@ -25,7 +25,7 @@
#include <sys/time.h>
#include "hw.h"
#include "qemu-common.h"
-#include "sysemu.h"
+#include "vm-state.h"
#include "etraxfs_dma.h"
@@ -22,8 +22,8 @@
* THE SOFTWARE.
*/
#include "sysbus.h"
-#include "sysemu.h"
#include "qemu-timer.h"
+#include "machine-state.h"
#define D(x)
@@ -35,7 +35,7 @@
#include "sysbus.h"
#include "qdev-addr.h"
#include "blockdev.h"
-#include "sysemu.h"
+#include "machine-state.h"
/********************************************************/
/* debug Floppy devices */
@@ -22,12 +22,12 @@
* THE SOFTWARE.
*/
#include "hw.h"
-#include "sysemu.h"
#include "isa.h"
#include "fw_cfg.h"
#include "sysbus.h"
#include "host-state.h"
#include "vm-state.h"
+#include "machine-state.h"
/* debug firmware config */
//#define DEBUG_FW_CFG
@@ -28,12 +28,12 @@
#include <hw/scsi.h>
#include "qemu-error.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "dma.h"
#include "blockdev.h"
#include <hw/ide/internal.h>
#include "vm-state.h"
+#include "machine-state.h"
/* These values were based on a Seagate ST3500418AS but have been modified
to make more sense in QEMU */
@@ -21,7 +21,7 @@
#include "qemu-error.h"
#include <hw/ide/internal.h>
#include "blockdev.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* --------------------------------- */
@@ -24,11 +24,11 @@
#include "hw.h"
#include "qemu-timer.h"
#include "qemu-char.h"
-#include "sysemu.h"
#include "boards.h"
#include "loader.h"
#include "elf.h"
#include "trace.h"
+#include "machine-state.h"
#include "grlib.h"
@@ -33,8 +33,8 @@
#include "trace.h"
#include "qemu-log.h"
#include "qemu-error.h"
-#include "sysemu.h"
#include "qemu-log.h"
+#include "machine-state.h"
enum {
R_CTRL = 0,
@@ -45,10 +45,10 @@
#include "hw.h"
#include "disas.h"
#include "monitor.h"
-#include "sysemu.h"
#include "uboot_image.h"
#include "loader.h"
#include "fw_cfg.h"
+#include "machine-state.h"
#include <zlib.h>
@@ -24,9 +24,9 @@
#include "hw.h"
#include "nvram.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "sysbus.h"
#include "isa.h"
+#include "machine-state.h"
//#define DEBUG_NVRAM
@@ -24,8 +24,8 @@
*/
#include "hw.h"
#include "firmware_abi.h"
-#include "sysemu.h"
#include "ppc_mac.h"
+#include "machine-state.h"
/* debug NVR */
//#define DEBUG_NVR
@@ -23,11 +23,11 @@
*/
#include "hw.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "pc.h"
#include "apic.h"
#include "isa.h"
#include "mc146818rtc.h"
+#include "machine-state.h"
//#define DEBUG_CMOS
//#define DEBUG_COALESCED
@@ -8,7 +8,7 @@
#include "hw.h"
#include "mcf.h"
#include "qemu-timer.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* General purpose timer module. */
typedef struct {
@@ -8,11 +8,11 @@
#include "hw.h"
#include "mcf.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "net.h"
#include "boards.h"
#include "loader.h"
#include "elf.h"
+#include "machine-state.h"
#define SYS_FREQ 66000000
@@ -28,7 +28,6 @@
#include "pci.h"
#include "usb-uhci.h"
#include "qemu-char.h"
-#include "sysemu.h"
#include "audio/audio.h"
#include "qemu-log.h"
#include "loader.h"
@@ -38,6 +37,7 @@
#include "vt82c686.h"
#include "mc146818rtc.h"
#include "blockdev.h"
+#include "machine-state.h"
#define DEBUG_FULONG2E_INIT
@@ -28,7 +28,6 @@
#include "pc.h"
#include "isa.h"
#include "fdc.h"
-#include "sysemu.h"
#include "arch_init.h"
#include "boards.h"
#include "net.h"
@@ -37,6 +36,7 @@
#include "loader.h"
#include "mc146818rtc.h"
#include "blockdev.h"
+#include "machine-state.h"
enum jazz_model_e
{
@@ -36,7 +36,6 @@
#include "usb-uhci.h"
#include "vmware_vga.h"
#include "qemu-char.h"
-#include "sysemu.h"
#include "arch_init.h"
#include "boards.h"
#include "qemu-log.h"
@@ -46,6 +45,7 @@
#include "elf.h"
#include "mc146818rtc.h"
#include "blockdev.h"
+#include "machine-state.h"
//#define DEBUG_BOARD_INIT
@@ -30,11 +30,11 @@
#include "pc.h"
#include "isa.h"
#include "net.h"
-#include "sysemu.h"
#include "boards.h"
#include "mips-bios.h"
#include "loader.h"
#include "elf.h"
+#include "machine-state.h"
static struct _loaderparams {
int ram_size;
@@ -13,7 +13,6 @@
#include "pc.h"
#include "isa.h"
#include "net.h"
-#include "sysemu.h"
#include "boards.h"
#include "flash.h"
#include "qemu-log.h"
@@ -23,6 +22,7 @@
#include "elf.h"
#include "mc146818rtc.h"
#include "blockdev.h"
+#include "machine-state.h"
#define MAX_IDE_BUS 2
@@ -27,7 +27,7 @@
#include "multiboot.h"
#include "loader.h"
#include "elf.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* Show multiboot debug output */
//#define DEBUG_MULTIBOOT
@@ -10,7 +10,6 @@
#include "arm-misc.h"
#include "devices.h"
#include "net.h"
-#include "sysemu.h"
#include "boards.h"
#include "pc.h"
#include "qemu-timer.h"
@@ -19,6 +18,7 @@
#include "console.h"
#include "i2c.h"
#include "blockdev.h"
+#include "machine-state.h"
#define MP_MISC_BASE 0x80002000
#define MP_MISC_SIZE 0x00001000
@@ -26,7 +26,7 @@
#include "net.h"
#include "ne2000.h"
#include "loader.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* debug NE2000 card */
//#define DEBUG_NE2000
@@ -19,7 +19,6 @@
*/
#include "qemu-common.h"
-#include "sysemu.h"
#include "omap.h"
#include "arm-misc.h"
#include "irq.h"
@@ -31,6 +30,7 @@
#include "hw.h"
#include "bt.h"
#include "loader.h"
+#include "machine-state.h"
/* Nokia N8x0 support */
struct n800_s {
@@ -19,7 +19,6 @@
#include "hw.h"
#include "arm-misc.h"
#include "omap.h"
-#include "sysemu.h"
#include "qemu-timer.h"
#include "qemu-char.h"
#include "soc_dma.h"
@@ -27,6 +26,7 @@
#include "pc.h"
#include "blockdev.h"
#include "range.h"
+#include "machine-state.h"
/* Should signal the TCMI/GPMC */
uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr)
@@ -22,12 +22,12 @@
#include "hw.h"
#include "arm-misc.h"
#include "omap.h"
-#include "sysemu.h"
#include "qemu-timer.h"
#include "qemu-char.h"
#include "flash.h"
#include "soc_dma.h"
#include "audio/audio.h"
+#include "machine-state.h"
/* Enhanced Audio Controller (CODEC only) */
struct omap_eac_s {
@@ -18,13 +18,13 @@
*/
#include "hw.h"
#include "audio/audio.h"
-#include "sysemu.h"
#include "console.h"
#include "omap.h"
#include "boards.h"
#include "arm-misc.h"
#include "devices.h"
#include "loader.h"
+#include "machine-state.h"
static uint32_t static_readb(void *opaque, target_phys_addr_t offset)
{
@@ -26,7 +26,7 @@
#include "qemu-char.h"
#include "isa.h"
#include "pc.h"
-#include "sysemu.h"
+#include "machine-state.h"
//#define DEBUG_PARALLEL
@@ -41,6 +41,7 @@
#include "sysemu.h"
#include "blockdev.h"
#include "ui/qemu-spice.h"
+#include "machine-state.h"
/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -33,10 +33,10 @@
#include "ide.h"
#include "kvm.h"
#include "kvmclock.h"
-#include "sysemu.h"
#include "sysbus.h"
#include "arch_init.h"
#include "blockdev.h"
+#include "machine-state.h"
#define MAX_IDE_BUS 2
@@ -32,6 +32,7 @@
#include "virtio-blk.h"
#include "qemu-config.h"
#include "blockdev.h"
+#include "machine-state.h"
#if defined(TARGET_I386)
static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
@@ -21,6 +21,7 @@
#include "sysemu.h"
#include "monitor.h"
#include "pci.h"
+#include "machine-state.h"
static void pci_error_message(Monitor *mon)
{
@@ -27,10 +27,10 @@
#include "pci_internals.h"
#include "monitor.h"
#include "net.h"
-#include "sysemu.h"
#include "loader.h"
#include "qemu-objects.h"
#include "range.h"
+#include "machine-state.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -18,7 +18,6 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "sysemu.h"
#include "qemu-objects.h"
#include "monitor.h"
#include "pci_bridge.h"
@@ -27,6 +26,7 @@
#include "msi.h"
#include "pci_internals.h"
#include "pcie_regs.h"
+#include "machine-state.h"
//#define DEBUG_PCIE
#ifdef DEBUG_PCIE
@@ -25,7 +25,7 @@
#include "isa.h"
#include "pc.h"
#include "ps2.h"
-#include "sysemu.h"
+#include "machine-state.h"
/* debug PC keyboard */
//#define DEBUG_KBD
@@ -39,7 +39,7 @@
#include "net.h"
#include "qemu-timer.h"
#include "qemu_socket.h"
-#include "sysemu.h"
+#include "machine-state.h"
#include "pcnet.h"
@@ -29,7 +29,6 @@
#include "hw.h"
#include "net.h"
#include "flash.h"
-#include "sysemu.h"
#include "devices.h"
#include "boards.h"
#include "device_tree.h"
@@ -38,6 +37,7 @@
#include "elf.h"
#include "blockdev.h"
#include "pc.h"
+#include "machine-state.h"
#include "xilinx_axidma.h"
@@ -24,12 +24,12 @@
#include "hw.h"
#include "ppc.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "nvram.h"
#include "qemu-log.h"
#include "loader.h"
#include "kvm.h"
#include "kvm_ppc.h"
+#include "machine-state.h"
//#define PPC_DEBUG_IRQ
//#define PPC_DEBUG_TB
@@ -26,12 +26,12 @@
#include "ppc405.h"
#include "nvram.h"
#include "flash.h"
-#include "sysemu.h"
#include "block.h"
#include "boards.h"
#include "qemu-log.h"
#include "loader.h"
#include "blockdev.h"
+#include "machine-state.h"
#define BIOS_FILENAME "ppc405_rom.bin"
#define BIOS_SIZE (2048 * 1024)
@@ -26,8 +26,8 @@
#include "ppc405.h"
#include "pc.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "qemu-log.h"
+#include "machine-state.h"
#define DEBUG_OPBA
#define DEBUG_SDRAM
@@ -18,8 +18,8 @@
#include "ppc4xx.h"
#include "ppc440.h"
#include "ppc405.h"
-#include "sysemu.h"
#include "kvm.h"
+#include "machine-state.h"
#define PPC440EP_PCI_CONFIG 0xeec00000
#define PPC440EP_PCI_INTACK 0xeed00000
@@ -55,7 +55,6 @@
#include "pci.h"
#include "usb-ohci.h"
#include "net.h"
-#include "sysemu.h"
#include "boards.h"
#include "fw_cfg.h"
#include "escc.h"
@@ -67,6 +66,7 @@
#include "kvm_ppc.h"
#include "hw/usb.h"
#include "blockdev.h"
+#include "machine-state.h"
#define MAX_IDE_BUS 2
#define CFG_ADDR 0xf0000510
@@ -29,7 +29,6 @@
#include "mac_dbdma.h"
#include "nvram.h"
#include "pc.h"
-#include "sysemu.h"
#include "net.h"
#include "isa.h"
#include "pci.h"
@@ -43,6 +42,7 @@
#include "kvm.h"
#include "kvm_ppc.h"
#include "blockdev.h"
+#include "machine-state.h"
#define MAX_IDE_BUS 2
#define CFG_ADDR 0xf0000510
@@ -26,7 +26,6 @@
#include "pc.h"
#include "fdc.h"
#include "net.h"
-#include "sysemu.h"
#include "isa.h"
#include "pci.h"
#include "prep_pci.h"
@@ -38,6 +37,7 @@
#include "loader.h"
#include "mc146818rtc.h"
#include "blockdev.h"
+#include "machine-state.h"
//#define HARD_DEBUG_PPC_IO
//#define DEBUG_PPC_IO
@@ -23,7 +23,6 @@
#include "pc.h"
#include "pci.h"
#include "boards.h"
-#include "sysemu.h"
#include "kvm.h"
#include "kvm_ppc.h"
#include "device_tree.h"
@@ -31,6 +30,7 @@
#include "ppce500.h"
#include "loader.h"
#include "elf.h"
+#include "machine-state.h"
#define BINARY_DEVICE_TREE_FILE "mpc8544ds.dtb"
#define UIMAGE_LOAD_BASE 0
@@ -9,12 +9,12 @@
#include "sysbus.h"
#include "pxa.h"
-#include "sysemu.h"
#include "pc.h"
#include "i2c.h"
#include "ssi.h"
#include "qemu-char.h"
#include "blockdev.h"
+#include "machine-state.h"
static struct {
target_phys_addr_t io_base;
@@ -11,9 +11,9 @@
#include "console.h"
#include "pxa.h"
#include "pixel_ops.h"
-/* FIXME: For graphic_rotate. Should probably be done in common code. */
-#include "sysemu.h"
#include "framebuffer.h"
+/* FIXME: For graphic_rotate. Should probably be done in common code. */
+#include "machine-state.h"
struct PXA2xxLCDState {
qemu_irq irq;
@@ -9,9 +9,9 @@
#include "hw.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "pxa.h"
#include "sysbus.h"
+#include "machine-state.h"
#define OSMR0 0x00
#define OSMR1 0x04
@@ -27,8 +27,8 @@
#include "net.h"
#include "qdev.h"
-#include "sysemu.h"
#include "monitor.h"
+#include "machine-state.h"
static int qdev_hotplug = 0;
static bool qdev_hot_added = false;
@@ -27,7 +27,6 @@
#include "hw.h"
#include "sh.h"
#include "devices.h"
-#include "sysemu.h"
#include "boards.h"
#include "pci.h"
#include "net.h"
@@ -37,6 +36,7 @@
#include "usb.h"
#include "flash.h"
#include "blockdev.h"
+#include "machine-state.h"
#define FLASH_BASE 0x00000000
#define FLASH_SIZE 0x02000000
@@ -14,11 +14,11 @@
#include "pci.h"
#include "usb-ohci.h"
#include "net.h"
-#include "sysemu.h"
#include "boards.h"
#include "bitbang_i2c.h"
#include "sysbus.h"
#include "blockdev.h"
+#include "machine-state.h"
#define SMP_BOOT_ADDR 0xe0000000
@@ -56,8 +56,8 @@
#include "qemu-timer.h"
#include "net.h"
#include "loader.h"
-#include "sysemu.h"
#include "iov.h"
+#include "machine-state.h"
/* debug RTL8139 card */
//#define DEBUG_RTL8139 1
@@ -35,9 +35,9 @@ do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
#include "qemu-error.h"
#include "scsi.h"
#include "scsi-defs.h"
-#include "sysemu.h"
#include "blockdev.h"
#include "vm-state.h"
+#include "machine-state.h"
#define SCSI_DMA_BUF_SIZE 131072
#define SCSI_MAX_INQUIRY_LEN 256
@@ -27,7 +27,7 @@
#include "isa.h"
#include "pc.h"
#include "qemu-timer.h"
-#include "sysemu.h"
+#include "machine-state.h"
//#define DEBUG_SERIAL
@@ -25,12 +25,12 @@
#include <stdio.h>
#include "hw.h"
#include "sh.h"
-#include "sysemu.h"
#include "sh7750_regs.h"
#include "sh7750_regnames.h"
#include "sh_intc.h"
#include "exec-all.h"
#include "cpu.h"
+#include "machine-state.h"
#define NB_DEVICES 4
@@ -30,9 +30,9 @@
#include "hw.h"
#include "pc.h"
#include "sh.h"
-#include "sysemu.h"
#include "boards.h"
#include "loader.h"
+#include "machine-state.h"
#define BIOS_FILENAME "shix_bios.bin"
#define BIOS_ADDRESS 0xA0000000
@@ -22,9 +22,9 @@
* THE SOFTWARE.
*/
-#include "sysemu.h"
#include "sysbus.h"
#include "trace.h"
+#include "machine-state.h"
/*
* This is the auxio port, chip control and system control part of
@@ -11,10 +11,12 @@
*
*/
-#include "sysemu.h"
+#include "qemu-common.h"
+#include "qemu-option.h"
#include "smbios.h"
#include "loader.h"
#include "vm-state.h"
+#include "machine-state.h"
/*
* Structures shared with the BIOS
@@ -10,7 +10,6 @@
#include "hw.h"
#include "pxa.h"
#include "arm-misc.h"
-#include "sysemu.h"
#include "pcmcia.h"
#include "i2c.h"
#include "ssi.h"
@@ -24,6 +23,8 @@
#include "boards.h"
#include "blockdev.h"
#include "sysbus.h"
+/* FIXME: For graphic_rotate. Should probably be done in common code. */
+#include "machine-state.h"
#undef REG_FMT
#define REG_FMT "0x%02lx"
@@ -27,7 +27,6 @@
#include "nvram.h"
#include "sparc32_dma.h"
#include "fdc.h"
-#include "sysemu.h"
#include "net.h"
#include "boards.h"
#include "firmware_abi.h"
@@ -43,6 +42,7 @@
#include "blockdev.h"
#include "trace.h"
#include "host-state.h"
+#include "machine-state.h"
/*
* Sun4m architecture was used in the following machines:
@@ -29,7 +29,6 @@
#include "fdc.h"
#include "net.h"
#include "qemu-timer.h"
-#include "sysemu.h"
#include "boards.h"
#include "firmware_abi.h"
#include "fw_cfg.h"
@@ -38,6 +37,7 @@
#include "loader.h"
#include "elf.h"
#include "blockdev.h"
+#include "machine-state.h"
//#define DEBUG_IRQ
//#define DEBUG_EBUS
@@ -15,9 +15,9 @@
#include "scsi.h"
#include "console.h"
#include "monitor.h"
-#include "sysemu.h"
#include "blockdev.h"
#include "vm-state.h"
+#include "machine-state.h"
//#define DEBUG_MSD
@@ -28,7 +28,7 @@
#include "usb-desc.h"
#include "net.h"
#include "qemu-queue.h"
-#include "sysemu.h"
+#include "machine-state.h"
/*#define TRAFFIC_DEBUG*/
/* Thanks to NetChip Technologies for donating this product ID.
@@ -12,11 +12,11 @@
#include "primecell.h"
#include "devices.h"
#include "net.h"
-#include "sysemu.h"
#include "pci.h"
#include "usb-ohci.h"
#include "boards.h"
#include "blockdev.h"
+#include "machine-state.h"
/* Primary interrupt controller. */
@@ -27,13 +27,13 @@
#include "pc.h"
#include "net.h"
#include "flash.h"
-#include "sysemu.h"
#include "devices.h"
#include "boards.h"
#include "device_tree.h"
#include "loader.h"
#include "elf.h"
#include "qemu-log.h"
+#include "machine-state.h"
#include "ppc.h"
#include "ppc4xx.h"
@@ -16,6 +16,7 @@
#include "trace.h"
#include "blockdev.h"
#include "virtio-blk.h"
+#include "machine-state.h"
#ifdef __linux__
# include <scsi/sg.h>
#endif
@@ -20,6 +20,7 @@
#include "qemu-timer.h"
#include "virtio-net.h"
#include "vhost_net.h"
+#include "machine-state.h"
#define VIRTIO_NET_VM_VERSION 11
@@ -19,8 +19,8 @@
#include "apm.h"
#include "acpi.h"
#include "pm_smbus.h"
-#include "sysemu.h"
#include "qemu-timer.h"
+#include "machine-state.h"
typedef uint32_t pci_addr_t;
#include "pci_host.h"
@@ -28,6 +28,7 @@
#include "sysemu.h"
#include "hw/watchdog.h"
#include "vm-state.h"
+#include "machine-state.h"
/* Possible values for action parameter. */
#define WDT_RESET 1 /* Hard reset. */
@@ -33,9 +33,9 @@
#include <xenctrl.h>
#include "hw.h"
-#include "sysemu.h"
#include "qemu-char.h"
#include "xen_backend.h"
+#include "machine-state.h"
struct buffer {
uint8_t *data;
@@ -5,6 +5,7 @@
#include "qemu-log.h"
#include "host-state.h"
#include "vm-state.h"
+#include "machine-state.h"
#include <xenguest.h>
@@ -24,11 +24,11 @@
#include "hw.h"
#include "pc.h"
-#include "sysemu.h"
#include "boards.h"
#include "xen_backend.h"
#include "xen_domainbuild.h"
#include "blockdev.h"
+#include "machine-state.h"
static void xen_init_pv(ram_addr_t ram_size,
const char *boot_device,
@@ -22,11 +22,11 @@
* THE SOFTWARE.
*/
-#include "sysemu.h"
#include "net.h"
#include "monitor.h"
#include "console.h"
#include "qjson.h"
+#include "machine-state.h"
static QEMUPutKBDEvent *qemu_put_kbd_event;
static void *qemu_put_kbd_event_opaque;
@@ -22,12 +22,12 @@
#include "qemu-common.h"
#include "qemu-barrier.h"
-#include "sysemu.h"
#include "hw/hw.h"
#include "gdbstub.h"
#include "kvm.h"
#include "bswap.h"
#include "vm-state.h"
+#include "machine-state.h"
/* This check must be after config-host.h is included */
#ifdef CONFIG_EVENTFD
new file mode 100644
@@ -0,0 +1,100 @@
+#ifndef QEMU_MACHINE_STATE_H
+#define QEMU_MACHINE_STATE_H
+/*
+ * Machine state: All generic machine state.
+ */
+
+#include "notify.h"
+#include "qemu-timer.h"
+#include "qdict.h"
+
+extern const char *bios_name;
+
+void qemu_system_reset_request(void);
+void qemu_system_shutdown_request(void);
+void qemu_system_powerdown_request(void);
+void qemu_system_debug_request(void);
+int qemu_shutdown_requested(void);
+int qemu_reset_requested(void);
+int qemu_powerdown_requested(void);
+extern qemu_irq qemu_system_powerdown;
+void qemu_system_reset(void);
+
+void qemu_add_machine_init_done_notifier(Notifier *notify);
+
+extern int bios_size;
+
+typedef enum {
+ VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
+} VGAInterfaceType;
+
+extern int vga_interface_type;
+#define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
+#define std_vga_enabled (vga_interface_type == VGA_STD)
+#define xenfb_enabled (vga_interface_type == VGA_XENFB)
+#define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
+#define qxl_enabled (vga_interface_type == VGA_QXL)
+
+extern int graphic_width;
+extern int graphic_height;
+extern int graphic_depth;
+extern uint8_t irq0override;
+extern int win2k_install_hack;
+extern int rtc_td_hack;
+extern int usb_enabled;
+extern int smp_cpus;
+extern int max_cpus;
+extern int graphic_rotate;
+extern int semihosting_enabled;
+extern int old_param;
+extern int boot_menu;
+
+extern QEMUClock *rtc_clock;
+
+#define MAX_NODES 64
+extern int nb_numa_nodes;
+extern uint64_t node_mem[MAX_NODES];
+extern uint64_t node_cpumask[MAX_NODES];
+
+#define MAX_OPTION_ROMS 16
+typedef struct QEMUOptionRom {
+ const char *name;
+ int32_t bootindex;
+} QEMUOptionRom;
+extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
+extern int nb_option_roms;
+
+#define MAX_PROM_ENVS 128
+extern const char *prom_envs[MAX_PROM_ENVS];
+extern unsigned int nb_prom_envs;
+
+/* pci-hotplug */
+void pci_device_hot_add(Monitor *mon, const QDict *qdict);
+void drive_hot_add(Monitor *mon, const QDict *qdict);
+void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
+
+/* pcie aer error injection */
+void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
+int do_pcie_aer_inejct_error(Monitor *mon,
+ const QDict *qdict, QObject **ret_data);
+
+/* serial ports */
+
+#define MAX_SERIAL_PORTS 4
+
+extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+
+/* parallel ports */
+
+#define MAX_PARALLEL_PORTS 3
+
+extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
+
+void rtc_change_mon_event(struct tm *tm);
+
+void register_devices(void);
+
+void add_boot_device_path(int32_t bootindex, DeviceState *dev,
+ const char *suffix);
+char *get_boot_devices_list(uint32_t *size);
+#endif
@@ -63,6 +63,7 @@
#include "ui/qemu-spice.h"
#include "host-state.h"
#include "vm-state.h"
+#include "machine-state.h"
//#define DEBUG
//#define DEBUG_COMPLETION
@@ -331,6 +331,11 @@ void qemu_iovec_memset(QEMUIOVector *qiov, int c, size_t count);
void qemu_iovec_memset_skip(QEMUIOVector *qiov, int c, size_t count,
size_t skip);
+#define QEMU_FILE_TYPE_BIOS 0
+#define QEMU_FILE_TYPE_KEYMAP 1
+char *qemu_find_file(int type, const char *name);
+
+
/* Convert a byte between binary and BCD. */
static inline uint8_t to_bcd(uint8_t val)
{
@@ -54,6 +54,7 @@
#endif
#include "vm-state.h"
+#include "machine-state.h"
#include "qemu-timer.h"
/* Conversion factor from emulated instructions to virtual clock ticks. */
@@ -18,28 +18,10 @@
#endif
/* vl.c */
-extern const char *bios_name;
-
-#define QEMU_FILE_TYPE_BIOS 0
-#define QEMU_FILE_TYPE_KEYMAP 1
-char *qemu_find_file(int type, const char *name);
-
int64_t cpu_get_ticks(void);
void cpu_enable_ticks(void);
void cpu_disable_ticks(void);
-void qemu_system_reset_request(void);
-void qemu_system_shutdown_request(void);
-void qemu_system_powerdown_request(void);
-void qemu_system_debug_request(void);
-int qemu_shutdown_requested(void);
-int qemu_reset_requested(void);
-int qemu_powerdown_requested(void);
-extern qemu_irq qemu_system_powerdown;
-void qemu_system_reset(void);
-
-void qemu_add_machine_init_done_notifier(Notifier *notify);
-
void cpu_synchronize_all_states(void);
void cpu_synchronize_all_post_reset(void);
void cpu_synchronize_all_post_init(void);
@@ -50,78 +32,4 @@ char *os_find_datadir(const char *argv0);
void os_parse_cmd_args(int index, const char *optarg);
void os_pidfile_error(void);
-extern int bios_size;
-
-typedef enum {
- VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
-} VGAInterfaceType;
-
-extern int vga_interface_type;
-#define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
-#define std_vga_enabled (vga_interface_type == VGA_STD)
-#define xenfb_enabled (vga_interface_type == VGA_XENFB)
-#define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
-#define qxl_enabled (vga_interface_type == VGA_QXL)
-
-extern int graphic_width;
-extern int graphic_height;
-extern int graphic_depth;
-extern uint8_t irq0override;
-extern int win2k_install_hack;
-extern int rtc_td_hack;
-extern int usb_enabled;
-extern int smp_cpus;
-extern int max_cpus;
-extern int graphic_rotate;
-extern int semihosting_enabled;
-extern int old_param;
-extern int boot_menu;
-extern QEMUClock *rtc_clock;
-
-#define MAX_NODES 64
-extern int nb_numa_nodes;
-extern uint64_t node_mem[MAX_NODES];
-extern uint64_t node_cpumask[MAX_NODES];
-
-#define MAX_OPTION_ROMS 16
-typedef struct QEMUOptionRom {
- const char *name;
- int32_t bootindex;
-} QEMUOptionRom;
-extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
-extern int nb_option_roms;
-
-#define MAX_PROM_ENVS 128
-extern const char *prom_envs[MAX_PROM_ENVS];
-extern unsigned int nb_prom_envs;
-
-/* pci-hotplug */
-void pci_device_hot_add(Monitor *mon, const QDict *qdict);
-void drive_hot_add(Monitor *mon, const QDict *qdict);
-void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
-
-/* pcie aer error injection */
-void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
-int do_pcie_aer_inejct_error(Monitor *mon,
- const QDict *qdict, QObject **ret_data);
-
-/* serial ports */
-
-#define MAX_SERIAL_PORTS 4
-
-extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
-
-/* parallel ports */
-
-#define MAX_PARALLEL_PORTS 3
-
-extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-
-void rtc_change_mon_event(struct tm *tm);
-
-void register_devices(void);
-
-void add_boot_device_path(int32_t bootindex, DeviceState *dev,
- const char *suffix);
-char *get_boot_devices_list(uint32_t *size);
#endif
@@ -28,8 +28,8 @@
#include "qemu-common.h"
#include "kvm.h"
#ifndef CONFIG_USER_ONLY
-#include "sysemu.h"
#include "monitor.h"
+#include "machine-state.h"
#endif
//#define DEBUG_MMU
@@ -20,7 +20,6 @@
#include <linux/kvm.h>
#include "qemu-common.h"
-#include "sysemu.h"
#include "kvm.h"
#include "cpu.h"
#include "gdbstub.h"
@@ -29,6 +28,7 @@
#include "hw/apic.h"
#include "ioport.h"
#include "vm-state.h"
+#include "machine-state.h"
#ifdef CONFIG_KVM_PARA
#include <linux/kvm_para.h>
@@ -1,7 +1,7 @@
#include "exec.h"
#include "host-utils.h"
#include "helper.h"
-#include "sysemu.h"
+#include "machine-state.h"
//#define DEBUG_MMU
//#define DEBUG_MXCC
@@ -39,6 +39,7 @@
#include "sdl_zoom.h"
#include "host-state.h"
#include "vm-state.h"
+#include "machine-state.h"
static DisplayChangeListener *dcl;
static SDL_Surface *real_screen;
@@ -162,6 +162,7 @@ int main(int argc, char **argv)
#include "arch_init.h"
#include "host-state.h"
#include "vm-state.h"
+#include "machine-state.h"
#include "ui/qemu-spice.h"
--
1.7.2.5
Move generic machine state to machine-state.h, adjust users. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> --- cpus.c | 1 + hw/acpi_piix4.c | 2 +- hw/apb_pci.c | 2 +- hw/arm_boot.c | 2 +- hw/arm_sysctl.c | 2 +- hw/bonito.c | 2 +- hw/cbus.c | 2 +- hw/cuda.c | 2 +- hw/e1000.c | 2 +- hw/eepro100.c | 2 +- hw/etraxfs_dma.c | 2 +- hw/etraxfs_timer.c | 2 +- hw/fdc.c | 2 +- hw/fw_cfg.c | 2 +- hw/ide/core.c | 2 +- hw/ide/qdev.c | 2 +- hw/leon3.c | 2 +- hw/lm32_sys.c | 2 +- hw/loader.c | 2 +- hw/m48t59.c | 2 +- hw/mac_nvram.c | 2 +- hw/mc146818rtc.c | 2 +- hw/mcf5206.c | 2 +- hw/mcf5208.c | 2 +- hw/mips_fulong2e.c | 2 +- hw/mips_jazz.c | 2 +- hw/mips_malta.c | 2 +- hw/mips_mipssim.c | 2 +- hw/mips_r4k.c | 2 +- hw/multiboot.c | 2 +- hw/musicpal.c | 2 +- hw/ne2000.c | 2 +- hw/nseries.c | 2 +- hw/omap1.c | 2 +- hw/omap2.c | 2 +- hw/palm.c | 2 +- hw/parallel.c | 2 +- hw/pc.c | 1 + hw/pc_piix.c | 2 +- hw/pci-hotplug.c | 1 + hw/pci-stub.c | 1 + hw/pci.c | 2 +- hw/pcie_aer.c | 2 +- hw/pckbd.c | 2 +- hw/pcnet.c | 2 +- hw/petalogix_ml605_mmu.c | 2 +- hw/ppc.c | 2 +- hw/ppc405_boards.c | 2 +- hw/ppc405_uc.c | 2 +- hw/ppc440.c | 2 +- hw/ppc_newworld.c | 2 +- hw/ppc_oldworld.c | 2 +- hw/ppc_prep.c | 2 +- hw/ppce500_mpc8544ds.c | 2 +- hw/pxa2xx.c | 2 +- hw/pxa2xx_lcd.c | 4 +- hw/pxa2xx_timer.c | 2 +- hw/qdev.c | 2 +- hw/r2d.c | 2 +- hw/realview.c | 2 +- hw/rtl8139.c | 2 +- hw/scsi-disk.c | 2 +- hw/serial.c | 2 +- hw/sh7750.c | 2 +- hw/shix.c | 2 +- hw/slavio_misc.c | 2 +- hw/smbios.c | 4 +- hw/spitz.c | 3 +- hw/sun4m.c | 2 +- hw/sun4u.c | 2 +- hw/usb-msd.c | 2 +- hw/usb-net.c | 2 +- hw/versatilepb.c | 2 +- hw/virtex_ml507.c | 2 +- hw/virtio-blk.c | 1 + hw/virtio-net.c | 1 + hw/vt82c686.c | 2 +- hw/watchdog.c | 1 + hw/xen_console.c | 2 +- hw/xen_domainbuild.c | 1 + hw/xen_machine_pv.c | 2 +- input.c | 2 +- kvm-all.c | 2 +- machine-state.h | 100 ++++++++++++++++++++++++++++++++++++++++++++++ monitor.c | 1 + qemu-common.h | 5 ++ qemu-timer.c | 1 + sysemu.h | 92 ------------------------------------------ target-i386/helper.c | 2 +- target-i386/kvm.c | 2 +- target-sparc/op_helper.c | 2 +- ui/sdl.c | 1 + vl.c | 1 + 93 files changed, 199 insertions(+), 171 deletions(-) create mode 100644 machine-state.h