summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-28 20:02:43 +0300
committerAvi Kivity <avi@redhat.com>2009-07-28 20:02:43 +0300
commit02cdfb2f27a3ccdd009a7bced64a40a798e5474f (patch)
tree2d69d0ac9bf344bb6a631dff8e37c2fc9cee4094
parentMerge commit 'b8c0e7d7c4e9fe3ec00757053a33605eda1c5ac4' into upstream-merge (diff)
parentconfigure already knows what TARGET_BASE_ARCH we need, no need to put the log... (diff)
downloadqemu-kvm-02cdfb2f27a3ccdd009a7bced64a40a798e5474f.tar.gz
qemu-kvm-02cdfb2f27a3ccdd009a7bced64a40a798e5474f.tar.bz2
qemu-kvm-02cdfb2f27a3ccdd009a7bced64a40a798e5474f.zip
Merge commit '0ba99fc6a188988f11361cb41eba7c1afce346d4' into upstream-merge
* commit '0ba99fc6a188988f11361cb41eba7c1afce346d4': (46 commits) configure already knows what TARGET_BASE_ARCH we need, no need to put the logic in Makefile.target already defined several lines before in block-obj-y Remove unused Makefile variable use nwfpe-obj-y for consistence use block-nested-y for files inside block/ Remove duplicated definition fix sparc not solaris build fix XEN Build fix for bad macaddr of e1000 in Windows 2003 server with original MS driver qdev: es1370+ac97 description qdev/compat: virtio-net-pci 0.10 compatibility. qdev: print device id in "info pci". qdev/compat: virtio-console-pci 0.10 compatibility. qdev: add id= support for pci nics. qdev/compat: virtio-blk-pci 0.10 compatibility. qdev: add user-specified identifier to devices. qdev/compat: add pc-0.10 machine type. qdev: add no_user, alias and desc qdev/compat: compat property infrastructure. qdev: factor out driver search to qdev_find_info() ... Conflicts: Makefile.target Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--Makefile24
-rw-r--r--Makefile.hw2
-rw-r--r--Makefile.target41
-rw-r--r--alpha-dis.c5
-rw-r--r--arm-dis.c3
-rw-r--r--arm-semi.c4
-rw-r--r--block/raw-posix.c17
-rw-r--r--bsd-user/main.c4
-rw-r--r--bsd-user/mmap.c4
-rw-r--r--bsd-user/signal.c4
-rw-r--r--bsd-user/syscall.c4
-rw-r--r--bt-host.c3
-rw-r--r--bt-vhci.c3
-rw-r--r--cmd.c3
-rw-r--r--cmd.h3
-rwxr-xr-xconfigure14
-rw-r--r--cpu-all.h3
-rw-r--r--cpu-defs.h3
-rw-r--r--cpu-exec.c3
-rw-r--r--cris-dis.c7
-rw-r--r--darwin-user/commpage.c4
-rw-r--r--darwin-user/machload.c3
-rw-r--r--darwin-user/main.c4
-rw-r--r--darwin-user/mmap.c4
-rw-r--r--darwin-user/signal.c4
-rw-r--r--darwin-user/syscall.c4
-rw-r--r--dyngen-exec.h3
-rw-r--r--exec-all.h3
-rw-r--r--exec.c18
-rw-r--r--feature_to_c.sh4
-rw-r--r--gdbstub.c3
-rw-r--r--hostregs_helper.h3
-rw-r--r--hppa-dis.c11
-rw-r--r--hw/ac97.c1
-rw-r--r--hw/acpi.c3
-rw-r--r--hw/alpha_palcode.c3
-rw-r--r--hw/apic.c3
-rw-r--r--hw/arm_sysctl.c20
-rw-r--r--hw/armv7m.c22
-rw-r--r--hw/axis_dev88.c2
-rw-r--r--hw/blizzard.c3
-rw-r--r--hw/blizzard_template.h3
-rw-r--r--hw/boards.h3
-rw-r--r--hw/bt-hci-csr.c3
-rw-r--r--hw/bt-hci.c4
-rw-r--r--hw/bt-hid.c3
-rw-r--r--hw/bt-l2cap.c4
-rw-r--r--hw/bt-sdp.c3
-rw-r--r--hw/bt.c3
-rw-r--r--hw/bt.h4
-rw-r--r--hw/cbus.c3
-rw-r--r--hw/cs4231.c36
-rw-r--r--hw/dp8393x.c3
-rw-r--r--hw/e1000.c8
-rw-r--r--hw/e1000_hw.h3
-rw-r--r--hw/eccmemctl.c21
-rw-r--r--hw/eepro100.c3
-rw-r--r--hw/eeprom93xx.c3
-rw-r--r--hw/eeprom93xx.h3
-rw-r--r--hw/es1370.c1
-rw-r--r--hw/escc.c92
-rw-r--r--hw/esp.c14
-rw-r--r--hw/etraxfs.c2
-rw-r--r--hw/etraxfs_pic.c18
-rw-r--r--hw/fdc.c44
-rw-r--r--hw/fmopl.c3
-rw-r--r--hw/g364fb.c3
-rw-r--r--hw/hpet.c3
-rw-r--r--hw/i2c.c11
-rw-r--r--hw/i2c.h2
-rw-r--r--hw/integratorcp.c30
-rw-r--r--hw/ioapic.c3
-rw-r--r--hw/iommu.c58
-rw-r--r--hw/lm832x.c3
-rw-r--r--hw/m48t59.c39
-rw-r--r--hw/mips_malta.c4
-rw-r--r--hw/musicpal.c2
-rw-r--r--hw/nseries.c3
-rw-r--r--hw/omap.h3
-rw-r--r--hw/omap1.c3
-rw-r--r--hw/omap2.c3
-rw-r--r--hw/omap_clk.c3
-rw-r--r--hw/omap_dma.c3
-rw-r--r--hw/omap_dss.c3
-rw-r--r--hw/omap_i2c.c3
-rw-r--r--hw/omap_lcdc.c3
-rw-r--r--hw/omap_mmc.c3
-rw-r--r--hw/omap_sx1.c3
-rw-r--r--hw/onenand.c3
-rw-r--r--hw/palm.c3
-rw-r--r--hw/pc.c47
-rw-r--r--hw/pci.c20
-rw-r--r--hw/pcnet.c19
-rw-r--r--hw/pflash_cfi01.c3
-rw-r--r--hw/pflash_cfi02.c3
-rw-r--r--hw/ppc4xx_pci.c3
-rw-r--r--hw/ps2.c38
-rw-r--r--hw/qdev-addr.c32
-rw-r--r--hw/qdev-addr.h2
-rw-r--r--hw/qdev-properties.c269
-rw-r--r--hw/qdev.c185
-rw-r--r--hw/qdev.h88
-rw-r--r--hw/slavio_intctl.c154
-rw-r--r--hw/slavio_misc.c6
-rw-r--r--hw/slavio_timer.c31
-rw-r--r--hw/smbus_eeprom.c10
-rw-r--r--hw/smc91c111.c2
-rw-r--r--hw/soc_dma.c3
-rw-r--r--hw/soc_dma.h3
-rw-r--r--hw/sparc32_dma.c13
-rw-r--r--hw/stellaris.c2
-rw-r--r--hw/sun4m.c352
-rw-r--r--hw/sun4m.h11
-rw-r--r--hw/syborg.c4
-rw-r--r--hw/syborg_fb.c45
-rw-r--r--hw/syborg_interrupt.c21
-rw-r--r--hw/syborg_keyboard.c21
-rw-r--r--hw/syborg_pointer.c29
-rw-r--r--hw/syborg_serial.c21
-rw-r--r--hw/syborg_timer.c11
-rw-r--r--hw/sysbus.c3
-rw-r--r--hw/sysbus.h2
-rw-r--r--hw/tc6393xb_template.h3
-rw-r--r--hw/tcx.c119
-rw-r--r--hw/tmp105.c3
-rw-r--r--hw/tsc2005.c3
-rw-r--r--hw/tsc210x.c3
-rw-r--r--hw/tusb6010.c3
-rw-r--r--hw/twl92230.c3
-rw-r--r--hw/usb-bt.c3
-rw-r--r--hw/usb-musb.c3
-rw-r--r--hw/usb-ohci.c3
-rw-r--r--hw/virtio-pci.c67
-rw-r--r--hw/watchdog.c4
-rw-r--r--hw/watchdog.h4
-rw-r--r--hw/wdt_i6300esb.c4
-rw-r--r--hw/wdt_ib700.c4
-rw-r--r--hw/xen_backend.c3
-rw-r--r--hw/xen_console.c3
-rw-r--r--hw/xen_disk.c3
-rw-r--r--hw/xen_nic.c3
-rw-r--r--hw/xenfb.c3
-rw-r--r--hw/xilinx.h12
-rw-r--r--hw/xilinx_ethlite.c29
-rw-r--r--hw/xilinx_intc.c18
-rw-r--r--hw/xilinx_timer.c32
-rw-r--r--hw/zaurus.c3
-rw-r--r--i386-dis.c6
-rw-r--r--ioport-user.c31
-rw-r--r--ioport.c61
-rw-r--r--ioport.h24
-rw-r--r--kqemu.c3
-rw-r--r--libfdt_env.h3
-rw-r--r--linux-user/flatload.c4
-rw-r--r--linux-user/m68k-sim.c4
-rw-r--r--linux-user/main.c4
-rw-r--r--linux-user/mmap.c4
-rw-r--r--linux-user/ppc/syscall.h3
-rw-r--r--linux-user/signal.c4
-rw-r--r--linux-user/syscall.c4
-rw-r--r--linux-user/vm86.c4
-rw-r--r--loader.c3
-rw-r--r--m68k-dis.c20
-rw-r--r--m68k-semi.c4
-rw-r--r--microblaze-dis.c6
-rw-r--r--migration-exec.c2
-rw-r--r--migration-tcp.c3
-rw-r--r--mips-dis.c8
-rw-r--r--monitor.c19
-rw-r--r--nbd.c3
-rw-r--r--nbd.h3
-rw-r--r--net-checksum.c3
-rw-r--r--net.c5
-rw-r--r--net.h1
-rw-r--r--pc-bios/optionrom/Makefile9
-rw-r--r--pc-bios/optionrom/multiboot.S3
-rwxr-xr-xpc-bios/optionrom/signrom.sh3
-rw-r--r--ppc-dis.c13
-rw-r--r--qemu-io.c63
-rw-r--r--qemu-lock.h3
-rw-r--r--qemu-monitor.hx5
-rw-r--r--qemu-nbd.c3
-rw-r--r--s390-dis.c12
-rw-r--r--savevm.c4
-rw-r--r--sh4-dis.c4
-rw-r--r--softmmu_header.h149
-rw-r--r--softmmu_template.h3
-rw-r--r--sparc-dis.c14
-rw-r--r--tap-win32.c3
-rw-r--r--target-alpha/cpu.h3
-rw-r--r--target-alpha/exec.h3
-rw-r--r--target-alpha/helper.c3
-rw-r--r--target-alpha/op_helper.c3
-rw-r--r--target-alpha/translate.c3
-rw-r--r--target-arm/cpu.h3
-rw-r--r--target-arm/exec.h3
-rw-r--r--target-arm/iwmmxt_helper.c3
-rw-r--r--target-arm/op_helper.c3
-rw-r--r--target-arm/translate.c3
-rw-r--r--target-cris/cpu.h3
-rw-r--r--target-cris/crisv32-decode.h3
-rw-r--r--target-cris/exec.h3
-rw-r--r--target-cris/helper.c3
-rw-r--r--target-cris/mmu.c3
-rw-r--r--target-cris/op_helper.c3
-rw-r--r--target-cris/opcode-cris.h3
-rw-r--r--target-cris/translate.c3
-rw-r--r--target-i386/cpu.h3
-rw-r--r--target-i386/exec.h3
-rw-r--r--target-i386/helper.c6
-rw-r--r--target-i386/helper_template.h3
-rw-r--r--target-i386/op_helper.c3
-rw-r--r--target-i386/ops_sse.h3
-rw-r--r--target-i386/ops_sse_header.h3
-rw-r--r--target-i386/translate.c3
-rw-r--r--target-m68k/cpu.h3
-rw-r--r--target-m68k/exec.h3
-rw-r--r--target-m68k/helper.c3
-rw-r--r--target-m68k/op_helper.c3
-rw-r--r--target-m68k/translate.c3
-rw-r--r--target-microblaze/cpu.h3
-rw-r--r--target-microblaze/exec.h3
-rw-r--r--target-microblaze/helper.c3
-rw-r--r--target-microblaze/microblaze-decode.h3
-rw-r--r--target-microblaze/mmu.c3
-rw-r--r--target-microblaze/mmu.h3
-rw-r--r--target-microblaze/op_helper.c3
-rw-r--r--target-microblaze/translate.c3
-rw-r--r--target-mips/helper.c3
-rw-r--r--target-mips/op_helper.c3
-rw-r--r--target-mips/translate.c3
-rw-r--r--target-mips/translate_init.c3
-rw-r--r--target-ppc/cpu.h3
-rw-r--r--target-ppc/exec.h3
-rw-r--r--target-ppc/helper.c3
-rw-r--r--target-ppc/helper_regs.h3
-rw-r--r--target-ppc/op_helper.c3
-rw-r--r--target-ppc/translate.c3
-rw-r--r--target-ppc/translate_init.c3
-rw-r--r--target-sh4/cpu.h3
-rw-r--r--target-sh4/exec.h3
-rw-r--r--target-sh4/helper.c3
-rw-r--r--target-sh4/op_helper.c3
-rw-r--r--target-sh4/translate.c3
-rw-r--r--target-sparc/helper.c3
-rw-r--r--target-sparc/translate.c3
-rw-r--r--tests/linux-test.c4
-rw-r--r--tests/test-i386.c4
-rw-r--r--tests/test-mmap.c4
-rwxr-xr-xtexi2pod.pl5
-rw-r--r--thunk.c3
-rw-r--r--thunk.h3
-rw-r--r--translate-all.c3
-rw-r--r--uboot_image.h3
-rw-r--r--vl.c7
255 files changed, 1900 insertions, 1394 deletions
diff --git a/Makefile b/Makefile
index f5deae96b..e6b9553e2 100644
--- a/Makefile
+++ b/Makefile
@@ -79,23 +79,25 @@ recurse-all: $(SUBDIR_RULES)
# block-obj-y is code used by both qemu system emulation and qemu-img
block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
-block-obj-y += block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o
-block-obj-y += block/dmg.o block/bochs.o block/vpc.o block/vvfat.o
-block-obj-y += block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o
-block-obj-y += block/qcow2-snapshot.o
-block-obj-y += block/parallels.o block/nbd.o
-block-obj-y += nbd.o block.o aio.o
+block-obj-y += nbd.o block.o aio.o aes.o
+
+block-nested-y += cow.o qcow.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
+block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
+block-nested-y += parallels.o nbd.o
+
ifdef CONFIG_WIN32
-block-obj-y += block/raw-win32.o
+block-nested-y += raw-win32.o
else
ifdef CONFIG_AIO
block-obj-y += posix-aio-compat.o
endif
-block-obj-y += block/raw-posix.o
+block-nested-y += raw-posix.o
endif
-block-obj-$(CONFIG_CURL) += block/curl.o
+block-nested-$(CONFIG_CURL) += curl.o
+
+block-obj-y += $(addprefix block/, $(block-nested-y))
ifdef CONFIG_AIO
block-obj-y += compatfd.o
@@ -122,9 +124,9 @@ obj-y += sd.o ssi-sd.o
obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
obj-y += bt-hci-csr.o
obj-y += buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
-obj-y += qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
+obj-y += qemu-char.o aio.o net-checksum.o savevm.o
obj-y += msmouse.o ps2.o
-obj-y += qdev.o ssi.o
+obj-y += qdev.o qdev-properties.o ssi.o
obj-$(CONFIG_BRLAPI) += baum.o
diff --git a/Makefile.hw b/Makefile.hw
index f7a9507ea..571e5184f 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -26,7 +26,7 @@ obj-y += m48t59.o escc.o
# SCSI layer
obj-y += lsi53c895a.o esp.o
-obj-y += dma-helpers.o sysbus.o
+obj-y += dma-helpers.o sysbus.o qdev-addr.o
all: $(HWLIB)
# Dummy command so that make thinks it has done something
diff --git a/Makefile.target b/Makefile.target
index df1f32b0f..759821b30 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -5,31 +5,11 @@ include config.mak
include $(SRC_PATH)/rules.mak
LDFLAGS_BASE:=$(LDFLAGS)
+
+ifndef TARGET_BASE_ARCH
TARGET_BASE_ARCH:=$(TARGET_ARCH)
-ifeq ($(TARGET_ARCH), x86_64)
-TARGET_BASE_ARCH:=i386
-endif
-ifeq ($(TARGET_ARCH), mipsn32)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), mips64)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), ppc64)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppc64h)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppcemb)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), sparc64)
-TARGET_BASE_ARCH:=sparc
-endif
-ifeq ($(TARGET_ARCH), ia64)
-TARGET_BASE_ARCH:=ia64
endif
+
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
@@ -96,7 +76,7 @@ translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-tim
endif
ifeq ($(ARCH),sparc)
- ifneq ($(CONFIG_SOLARIS),yes)
+ ifneq ($(CONFIG_SOLARIS),y)
HELPER_CFLAGS+=-ffixed-i0
endif
endif
@@ -263,7 +243,7 @@ tcg/tcg.o: cpu.h
# HELPER_CFLAGS is used for all the code compiled with static register
# variables
-op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
+op_helper.o: CFLAGS += $(HELPER_CFLAGS)
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
@@ -381,9 +361,10 @@ ifeq ($(TARGET_ARCH), i386)
obj-y += vm86.o
endif
ifeq ($(TARGET_ARCH), arm)
-obj-y += nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
-nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
- nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
+nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
+nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
+obj-y += $(addprefix nwfpe/, $(nwfpe-obj-y))
+obj-y += arm-semi.o
endif
ifeq ($(TARGET_ARCH), m68k)
obj-y += m68k-sim.o m68k-semi.o
@@ -589,7 +570,7 @@ endif
# xen backend driver support
obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
-ifeq ($(CONFIG_XEN), yes)
+ifeq ($(CONFIG_XEN), y)
LIBS += $(XEN_LIBS)
endif
@@ -749,8 +730,6 @@ ifdef CONFIG_SLIRP
CPPFLAGS+=-I$(SRC_PATH)/slirp
endif
-LIBS+=$(PTHREADLIBS)
-LIBS+=$(CLOCKLIBS)
# specific flags are needed for non soft mmu emulator
ifdef CONFIG_STATIC
LDFLAGS+=-static
diff --git a/alpha-dis.c b/alpha-dis.c
index ee7bf66df..097f06b69 100644
--- a/alpha-dis.c
+++ b/alpha-dis.c
@@ -16,9 +16,8 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this file; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with this file; see the file COPYING. If not, see
+<http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include "dis-asm.h"
diff --git a/arm-dis.c b/arm-dis.c
index cc42576d3..5c736c190 100644
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -17,8 +17,7 @@
more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Start of qemu specific additions. Mostly this is stub definitions
for things we don't care about. */
diff --git a/arm-semi.c b/arm-semi.c
index a33b8e5c3..5239ffc8c 100644
--- a/arm-semi.c
+++ b/arm-semi.c
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/types.h>
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 55ac4f1df..994bf7b32 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -850,6 +850,7 @@ again:
static int raw_create(const char *filename, QEMUOptionParameter *options)
{
int fd;
+ int result = 0;
int64_t total_size = 0;
/* Read out options */
@@ -862,11 +863,17 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
0644);
- if (fd < 0)
- return -EIO;
- ftruncate(fd, total_size * 512);
- close(fd);
- return 0;
+ if (fd < 0) {
+ result = -errno;
+ } else {
+ if (ftruncate(fd, total_size * 512) != 0) {
+ result = -errno;
+ }
+ if (close(fd) != 0) {
+ result = -errno;
+ }
+ }
+ return result;
}
static void raw_flush(BlockDriverState *bs)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index e4a62554f..56c075aec 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index e916a6544..26f981ab2 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index 5fa2fe0f7..40313c808 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 15c70e3d2..4f713f2e8 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/bt-host.c b/bt-host.c
index 9a06578c9..964ac1163 100644
--- a/bt-host.c
+++ b/bt-host.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/bt-vhci.c b/bt-vhci.c
index ee90f1073..679c5e05d 100644
--- a/bt-vhci.c
+++ b/bt-vhci.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/cmd.c b/cmd.c
index 1dc5dbd68..f3f438564 100644
--- a/cmd.c
+++ b/cmd.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/cmd.h b/cmd.h
index c5be50f80..cbe954957 100644
--- a/cmd.h
+++ b/cmd.h
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COMMAND_H__
#define __COMMAND_H__
diff --git a/configure b/configure
index 9b744c51b..3c566e88b 100755
--- a/configure
+++ b/configure
@@ -34,6 +34,8 @@ ar="ar"
make="make"
install="install"
strip="strip"
+objcopy="objcopy"
+ld="ld"
# parse CC options first
for opt do
@@ -53,6 +55,8 @@ done
cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
strip="${cross_prefix}${strip}"
+objcopy="${cross_prefix}${objcopy}"
+ld="${cross_prefix}${ld}"
# check that the C compiler works.
cat > $TMPC <<EOF
@@ -1622,6 +1626,8 @@ echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak
echo "CC=$cc" >> $config_mak
echo "HOST_CC=$host_cc" >> $config_mak
echo "AR=$ar" >> $config_mak
+echo "OBJCOPY=$objcopy" >> $config_mak
+echo "LD=$ld" >> $config_mak
# XXX: only use CFLAGS and LDFLAGS ?
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
# compilation of dyngen tool (useful for win32 build on Linux host)
@@ -2173,6 +2179,7 @@ case "$target_arch2" in
;;
x86_64)
echo "TARGET_ARCH=x86_64" >> $config_mak
+ echo "TARGET_BASE_ARCH=i386" >> $config_mak
echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
echo "#define TARGET_I386 1" >> $config_h
echo "#define TARGET_X86_64 1" >> $config_h
@@ -2251,6 +2258,7 @@ case "$target_arch2" in
;;
mipsn32|mipsn32el)
echo "TARGET_ARCH=mipsn32" >> $config_mak
+ echo "TARGET_BASE_ARCH=mips" >> $config_mak
echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
echo "#define TARGET_MIPS 1" >> $config_h
echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
@@ -2258,6 +2266,7 @@ case "$target_arch2" in
;;
mips64|mips64el)
echo "TARGET_ARCH=mips64" >> $config_mak
+ echo "TARGET_BASE_ARCH=mips" >> $config_mak
echo "#define TARGET_ARCH \"mips64\"" >> $config_h
echo "#define TARGET_MIPS 1" >> $config_h
echo "#define TARGET_MIPS64 1" >> $config_h
@@ -2273,6 +2282,7 @@ case "$target_arch2" in
;;
ppcemb)
echo "TARGET_ARCH=ppcemb" >> $config_mak
+ echo "TARGET_BASE_ARCH=ppc" >> $config_mak
echo "TARGET_ABI_DIR=ppc" >> $config_mak
echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
echo "#define TARGET_PPC 1" >> $config_h
@@ -2289,6 +2299,7 @@ case "$target_arch2" in
;;
ppc64)
echo "TARGET_ARCH=ppc64" >> $config_mak
+ echo "TARGET_BASE_ARCH=ppc" >> $config_mak
echo "TARGET_ABI_DIR=ppc" >> $config_mak
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
echo "#define TARGET_PPC 1" >> $config_h
@@ -2298,6 +2309,7 @@ case "$target_arch2" in
;;
ppc64abi32)
echo "TARGET_ARCH=ppc64" >> $config_mak
+ echo "TARGET_BASE_ARCH=ppc" >> $config_mak
echo "TARGET_ABI_DIR=ppc" >> $config_mak
echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
@@ -2323,6 +2335,7 @@ case "$target_arch2" in
;;
sparc64)
echo "TARGET_ARCH=sparc64" >> $config_mak
+ echo "TARGET_BASE_ARCH=sparc" >> $config_mak
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
echo "#define TARGET_SPARC 1" >> $config_h
echo "#define TARGET_SPARC64 1" >> $config_h
@@ -2331,6 +2344,7 @@ case "$target_arch2" in
;;
sparc32plus)
echo "TARGET_ARCH=sparc64" >> $config_mak
+ echo "TARGET_BASE_ARCH=sparc" >> $config_mak
echo "TARGET_ABI_DIR=sparc" >> $config_mak
echo "TARGET_ARCH2=sparc32plus" >> $config_mak
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
diff --git a/cpu-all.h b/cpu-all.h
index 586a17042..3381125c8 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_ALL_H
#define CPU_ALL_H
diff --git a/cpu-defs.h b/cpu-defs.h
index c1a0f8e30..db17bd07b 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_DEFS_H
#define CPU_DEFS_H
diff --git a/cpu-exec.c b/cpu-exec.c
index 35c71bd0f..e6709dc3a 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "exec.h"
diff --git a/cris-dis.c b/cris-dis.c
index ba6990758..f6932a056 100644
--- a/cris-dis.c
+++ b/cris-dis.c
@@ -16,9 +16,7 @@
more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include "dis-asm.h"
//#include "sysdep.h"
@@ -51,8 +49,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef NULL
#define NULL (0)
diff --git a/darwin-user/commpage.c b/darwin-user/commpage.c
index 8961bef44..2b41bc5e3 100644
--- a/darwin-user/commpage.c
+++ b/darwin-user/commpage.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <fcntl.h>
#include <stdio.h>
diff --git a/darwin-user/machload.c b/darwin-user/machload.c
index 794aefa17..4bb5c7276 100644
--- a/darwin-user/machload.c
+++ b/darwin-user/machload.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <sys/types.h>
diff --git a/darwin-user/main.c b/darwin-user/main.c
index 27c7284eb..8e993da37 100644
--- a/darwin-user/main.c
+++ b/darwin-user/main.c
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/darwin-user/mmap.c b/darwin-user/mmap.c
index f803066aa..8ba61fb97 100644
--- a/darwin-user/mmap.c
+++ b/darwin-user/mmap.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/darwin-user/signal.c b/darwin-user/signal.c
index 851e85b60..48620184e 100644
--- a/darwin-user/signal.c
+++ b/darwin-user/signal.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/darwin-user/syscall.c b/darwin-user/syscall.c
index 0c6878777..d774ad353 100644
--- a/darwin-user/syscall.c
+++ b/darwin-user/syscall.c
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <fcntl.h>
#include <stdio.h>
diff --git a/dyngen-exec.h b/dyngen-exec.h
index c9841df15..c0077634e 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__DYNGEN_EXEC_H__)
#define __DYNGEN_EXEC_H__
diff --git a/exec-all.h b/exec-all.h
index f91e6460c..31ab7ad93 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EXEC_ALL_H_
diff --git a/exec.c b/exec.c
index f6d9ec9d8..f825fd158 100644
--- a/exec.c
+++ b/exec.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#ifdef _WIN32
@@ -1771,6 +1770,13 @@ static inline void tlb_flush_jmp_cache(CPUState *env, target_ulong addr)
TB_JMP_PAGE_SIZE * sizeof(TranslationBlock *));
}
+static CPUTLBEntry s_cputlb_empty_entry = {
+ .addr_read = -1,
+ .addr_write = -1,
+ .addr_code = -1,
+ .addend = -1,
+};
+
/* NOTE: if flush_global is true, also flush global entries (not
implemented yet) */
void tlb_flush(CPUState *env, int flush_global)
@@ -1787,9 +1793,7 @@ void tlb_flush(CPUState *env, int flush_global)
for(i = 0; i < CPU_TLB_SIZE; i++) {
int mmu_idx;
for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) {
- env->tlb_table[mmu_idx][i].addr_read = -1;
- env->tlb_table[mmu_idx][i].addr_write = -1;
- env->tlb_table[mmu_idx][i].addr_code = -1;
+ env->tlb_table[mmu_idx][i] = s_cputlb_empty_entry;
}
}
@@ -1811,9 +1815,7 @@ static inline void tlb_flush_entry(CPUTLBEntry *tlb_entry, target_ulong addr)
(TARGET_PAGE_MASK | TLB_INVALID_MASK)) ||
addr == (tlb_entry->addr_code &
(TARGET_PAGE_MASK | TLB_INVALID_MASK))) {
- tlb_entry->addr_read = -1;
- tlb_entry->addr_write = -1;
- tlb_entry->addr_code = -1;
+ *tlb_entry = s_cputlb_empty_entry;
}
}
diff --git a/feature_to_c.sh b/feature_to_c.sh
index bce77b6f5..53975ebca 100644
--- a/feature_to_c.sh
+++ b/feature_to_c.sh
@@ -17,9 +17,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
output=$1
shift
diff --git a/gdbstub.c b/gdbstub.c
index 9fa6fb816..dc6d39871 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "qemu-common.h"
diff --git a/hostregs_helper.h b/hostregs_helper.h
index c206baf7d..9f0872d0e 100644
--- a/hostregs_helper.h
+++ b/hostregs_helper.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* The GCC global register variable extension is used to reserve some
diff --git a/hppa-dis.c b/hppa-dis.c
index e7e680375..9d96d72a5 100644
--- a/hppa-dis.c
+++ b/hppa-dis.c
@@ -16,9 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include "dis-asm.h"
@@ -42,8 +40,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBHPPA_H
#define _LIBHPPA_H
@@ -555,8 +552,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GAS or GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with GAS or GDB; see the file COPYING.
+If not, see <http://www.gnu.org/licenses/>. */
#if !defined(__STDC__) && !defined(const)
#define const
diff --git a/hw/ac97.c b/hw/ac97.c
index f18fa524f..6c818c9cc 100644
--- a/hw/ac97.c
+++ b/hw/ac97.c
@@ -1366,6 +1366,7 @@ int ac97_init (PCIBus *bus)
static PCIDeviceInfo ac97_info = {
.qdev.name = "AC97",
+ .qdev.desc = "Intel 82801AA AC97 Audio",
.qdev.size = sizeof (PCIAC97LinkState),
.init = ac97_initfn,
};
diff --git a/hw/acpi.c b/hw/acpi.c
index d23abd1a3..9d6d78b3d 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -13,8 +13,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
*/
#include "hw.h"
#include "pc.h"
diff --git a/hw/alpha_palcode.c b/hw/alpha_palcode.c
index bfffb5d29..c48a2976b 100644
--- a/hw/alpha_palcode.c
+++ b/hw/alpha_palcode.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
diff --git a/hw/apic.c b/hw/apic.c
index cdb5972dd..3d641e07f 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
*/
#include "hw.h"
#include "pc.h"
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index c9d1e3ff1..bb005c801 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -194,7 +194,6 @@ static void arm_sysctl_init1(SysBusDevice *dev)
arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, dev);
int iomemtype;
- s->sys_id = qdev_get_prop_int(&dev->qdev, "sys_id", 0);
/* The MPcore bootloader uses these flags to start secondary CPUs.
We don't use a bootloader, so do this here. */
s->flags = 3;
@@ -210,15 +209,28 @@ void arm_sysctl_init(uint32_t base, uint32_t sys_id)
DeviceState *dev;
dev = qdev_create(NULL, "realview_sysctl");
- qdev_set_prop_int(dev, "sys_id", sys_id);
+ qdev_prop_set_uint32(dev, "sys_id", sys_id);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
}
+static SysBusDeviceInfo arm_sysctl_info = {
+ .init = arm_sysctl_init1,
+ .qdev.name = "realview_sysctl",
+ .qdev.size = sizeof(arm_sysctl_state),
+ .qdev.props = (Property[]) {
+ {
+ .name = "sys_id",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(arm_sysctl_state, sys_id),
+ },
+ {/* end of list */}
+ }
+};
+
static void arm_sysctl_register_devices(void)
{
- sysbus_register_dev("realview_sysctl", sizeof(arm_sysctl_state),
- arm_sysctl_init1);
+ sysbus_register_withprop(&arm_sysctl_info);
}
device_init(arm_sysctl_register_devices)
diff --git a/hw/armv7m.c b/hw/armv7m.c
index 297a3e1f0..2e66d7e93 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -127,7 +127,6 @@ static void bitband_init(SysBusDevice *dev)
BitBandState *s = FROM_SYSBUS(BitBandState, dev);
int iomemtype;
- s->base = qdev_get_prop_int(&dev->qdev, "base", 0);
iomemtype = cpu_register_io_memory(bitband_readfn, bitband_writefn,
&s->base);
sysbus_init_mmio(dev, 0x02000000, iomemtype);
@@ -138,12 +137,12 @@ static void armv7m_bitband_init(void)
DeviceState *dev;
dev = qdev_create(NULL, "ARM,bitband-memory");
- qdev_set_prop_int(dev, "base", 0x20000000);
+ qdev_prop_set_uint32(dev, "base", 0x20000000);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x22000000);
dev = qdev_create(NULL, "ARM,bitband-memory");
- qdev_set_prop_int(dev, "base", 0x40000000);
+ qdev_prop_set_uint32(dev, "base", 0x40000000);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x42000000);
}
@@ -238,10 +237,23 @@ qemu_irq *armv7m_init(int flash_size, int sram_size,
return pic;
}
+static SysBusDeviceInfo bitband_info = {
+ .init = bitband_init,
+ .qdev.name = "ARM,bitband-memory",
+ .qdev.size = sizeof(BitBandState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "base",
+ .info = &qdev_prop_hex32,
+ .offset = offsetof(BitBandState, base),
+ },
+ {/* end of list */}
+ }
+};
+
static void armv7m_register_devices(void)
{
- sysbus_register_dev("ARM,bitband-memory", sizeof(BitBandState),
- bitband_init);
+ sysbus_register_withprop(&bitband_info);
}
device_init(armv7m_register_devices)
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 79a4d7106..f93f43145 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -297,7 +297,7 @@ void axisdev88_init (ram_addr_t ram_size,
cpu_irq = cris_pic_init_cpu(env);
dev = qdev_create(NULL, "etraxfs,pic");
/* FIXME: Is there a proper way to signal vectors to the CPU core? */
- qdev_set_prop_ptr(dev, "interrupt_vector", &env->interrupt_vector);
+ qdev_prop_set_ptr(dev, "interrupt_vector", &env->interrupt_vector);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, 0x3001c000);
diff --git a/hw/blizzard.c b/hw/blizzard.c
index 40739d5e8..5f329ad13 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/blizzard_template.h b/hw/blizzard_template.h
index ae5152531..0ef27d1c4 100644
--- a/hw/blizzard_template.h
+++ b/hw/blizzard_template.h
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#define SKIP_PIXEL(to) to += deststep
diff --git a/hw/boards.h b/hw/boards.h
index f6733b7cc..11acb89fc 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -3,6 +3,8 @@
#ifndef HW_BOARDS_H
#define HW_BOARDS_H
+#include "qdev.h"
+
typedef void QEMUMachineInitFunc(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
@@ -17,6 +19,7 @@ typedef struct QEMUMachine {
int use_scsi;
int max_cpus;
int is_default;
+ CompatProperty *compat_props;
struct QEMUMachine *next;
} QEMUMachine;
diff --git a/hw/bt-hci-csr.c b/hw/bt-hci-csr.c
index 183441b02..19d23f536 100644
--- a/hw/bt-hci-csr.c
+++ b/hw/bt-hci-csr.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt-hci.c b/hw/bt-hci.c
index a5902b03f..6a7909406 100644
--- a/hw/bt-hci.c
+++ b/hw/bt-hci.c
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt-hid.c b/hw/bt-hid.c
index af0c3d5f2..e495dbf3f 100644
--- a/hw/bt-hid.c
+++ b/hw/bt-hid.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt-l2cap.c b/hw/bt-l2cap.c
index b22b7615a..4697f529d 100644
--- a/hw/bt-l2cap.c
+++ b/hw/bt-l2cap.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt-sdp.c b/hw/bt-sdp.c
index 992de0efd..b8732d062 100644
--- a/hw/bt-sdp.c
+++ b/hw/bt-sdp.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt.c b/hw/bt.c
index 3f886b436..34bf00457 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/bt.h b/hw/bt.h
index 726905f76..4a702adef 100644
--- a/hw/bt.h
+++ b/hw/bt.h
@@ -20,9 +20,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* BD Address */
diff --git a/hw/cbus.c b/hw/cbus.c
index ae8f57c57..8ae24e01d 100644
--- a/hw/cbus.c
+++ b/hw/cbus.c
@@ -17,8 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/cs4231.c b/hw/cs4231.c
index a981b094f..f13815b4e 100644
--- a/hw/cs4231.c
+++ b/hw/cs4231.c
@@ -21,8 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "hw.h"
+
#include "sun4m.h"
+#include "sysbus.h"
/* debug CS4231 */
//#define DEBUG_CS
@@ -36,9 +37,10 @@
#define CS_MAXDREG (CS_DREGS - 1)
typedef struct CSState {
+ SysBusDevice busdev;
+ qemu_irq irq;
uint32_t regs[CS_REGS];
uint8_t dregs[CS_DREGS];
- void *intctl;
} CSState;
#define CS_RAP(s) ((s)->regs[0] & CS_MAXDREG)
@@ -165,16 +167,32 @@ static int cs_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
-void cs_init(target_phys_addr_t base, int irq, void *intctl)
+static void cs4231_init1(SysBusDevice *dev)
{
- int cs_io_memory;
- CSState *s;
+ int io;
+ CSState *s = FROM_SYSBUS(CSState, dev);
- s = qemu_mallocz(sizeof(CSState));
+ io = cpu_register_io_memory(cs_mem_read, cs_mem_write, s);
+ sysbus_init_mmio(dev, CS_SIZE, io);
+ sysbus_init_irq(dev, &s->irq);
- cs_io_memory = cpu_register_io_memory(cs_mem_read, cs_mem_write, s);
- cpu_register_physical_memory(base, CS_SIZE, cs_io_memory);
- register_savevm("cs4231", base, 1, cs_save, cs_load, s);
+ register_savevm("cs4231", -1, 1, cs_save, cs_load, s);
qemu_register_reset(cs_reset, s);
cs_reset(s);
}
+
+static SysBusDeviceInfo cs4231_info = {
+ .init = cs4231_init1,
+ .qdev.name = "SUNW,CS4231",
+ .qdev.size = sizeof(CSState),
+ .qdev.props = (Property[]) {
+ {.name = NULL}
+ }
+};
+
+static void cs4231_register_devices(void)
+{
+ sysbus_register_withprop(&cs4231_info);
+}
+
+device_init(cs4231_register_devices)
diff --git a/hw/dp8393x.c b/hw/dp8393x.c
index e2f86b81d..b700d7eb0 100644
--- a/hw/dp8393x.c
+++ b/hw/dp8393x.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/e1000.c b/hw/e1000.c
index 4ac891859..9bc444248 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -18,8 +18,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
@@ -262,6 +261,11 @@ set_eecd(E1000State *s, int index, uint32_t val)
}
if (!(val & E1000_EECD_CS)) { // rising, no CS (EEPROM reset)
memset(&s->eecd_state, 0, sizeof s->eecd_state);
+ /*
+ * restore old_eecd's E1000_EECD_SK (known to be on)
+ * to avoid false detection of a clock edge
+ */
+ s->eecd_state.old_eecd = E1000_EECD_SK;
return;
}
s->eecd_state.val_in <<= 1;
diff --git a/hw/e1000_hw.h b/hw/e1000_hw.h
index 9993a7dec..9bd8a4bdf 100644
--- a/hw/e1000_hw.h
+++ b/hw/e1000_hw.h
@@ -13,8 +13,7 @@
more details.
You should have received a copy of the GNU General Public License along with
- this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ this program; if not, see <http://www.gnu.org/licenses/>.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c
index d05962b70..c5d644908 100644
--- a/hw/eccmemctl.c
+++ b/hw/eccmemctl.c
@@ -321,7 +321,6 @@ static void ecc_init1(SysBusDevice *dev)
ECCState *s = FROM_SYSBUS(ECCState, dev);
sysbus_init_irq(dev, &s->irq);
- s->version = qdev_get_prop_int(&dev->qdev, "version", -1);
s->regs[0] = s->version;
ecc_io_memory = cpu_register_io_memory(ecc_mem_read, ecc_mem_write, s);
sysbus_init_mmio(dev, ECC_SIZE, ecc_io_memory);
@@ -342,7 +341,7 @@ void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
SysBusDevice *s;
dev = qdev_create(NULL, "eccmemctl");
- qdev_set_prop_int(dev, "version", version);
+ qdev_prop_set_uint32(dev, "version", version);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -352,9 +351,25 @@ void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
}
}
+static SysBusDeviceInfo ecc_info = {
+ .init = ecc_init1,
+ .qdev.name = "eccmemctl",
+ .qdev.size = sizeof(ECCState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "version",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(ECCState, version),
+ .defval = (uint32_t[]) { -1 },
+ },
+ {/* end of list */}
+ }
+};
+
+
static void ecc_register_devices(void)
{
- sysbus_register_dev("eccmemctl", sizeof(ECCState), ecc_init1);
+ sysbus_register_withprop(&ecc_info);
}
device_init(ecc_register_devices)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index 85446ed69..ec31a6a9c 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -17,8 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Tested features (i82559):
* PXE boot (i386) no valid link
diff --git a/hw/eeprom93xx.c b/hw/eeprom93xx.c
index cf778b741..66dfc43d5 100644
--- a/hw/eeprom93xx.c
+++ b/hw/eeprom93xx.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* Emulation for serial EEPROMs:
diff --git a/hw/eeprom93xx.h b/hw/eeprom93xx.h
index 4e257f6e8..47282d381 100644
--- a/hw/eeprom93xx.h
+++ b/hw/eeprom93xx.h
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EEPROM93XX_H
diff --git a/hw/es1370.c b/hw/es1370.c
index 8d5a9f988..5c9af0e8e 100644
--- a/hw/es1370.c
+++ b/hw/es1370.c
@@ -1054,6 +1054,7 @@ int es1370_init (PCIBus *bus)
static PCIDeviceInfo es1370_info = {
.qdev.name = "ES1370",
+ .qdev.desc = "ENSONIQ AudioPCI ES1370",
.qdev.size = sizeof (PCIES1370State),
.init = es1370_initfn,
};
diff --git a/hw/escc.c b/hw/escc.c
index 93bc4bde3..9abd092ae 100644
--- a/hw/escc.c
+++ b/hw/escc.c
@@ -120,6 +120,8 @@ struct SerialState {
struct ChannelState chn[2];
int it_shift;
int mmio_index;
+ uint32_t disabled;
+ uint32_t frequency;
};
#define SERIAL_CTRL 0
@@ -732,13 +734,13 @@ int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB,
SerialState *d;
dev = qdev_create(NULL, "escc");
- qdev_set_prop_int(dev, "disabled", 0);
- qdev_set_prop_int(dev, "frequency", clock);
- qdev_set_prop_int(dev, "it_shift", it_shift);
- qdev_set_prop_ptr(dev, "chrB", chrB);
- qdev_set_prop_ptr(dev, "chrA", chrA);
- qdev_set_prop_int(dev, "chnBtype", ser);
- qdev_set_prop_int(dev, "chnAtype", ser);
+ qdev_prop_set_uint32(dev, "disabled", 0);
+ qdev_prop_set_uint32(dev, "frequency", clock);
+ qdev_prop_set_uint32(dev, "it_shift", it_shift);
+ qdev_prop_set_ptr(dev, "chrB", chrB);
+ qdev_prop_set_ptr(dev, "chrA", chrA);
+ qdev_prop_set_uint32(dev, "chnBtype", ser);
+ qdev_prop_set_uint32(dev, "chnAtype", ser);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irqA);
@@ -895,13 +897,13 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
SysBusDevice *s;
dev = qdev_create(NULL, "escc");
- qdev_set_prop_int(dev, "disabled", disabled);
- qdev_set_prop_int(dev, "frequency", clock);
- qdev_set_prop_int(dev, "it_shift", it_shift);
- qdev_set_prop_ptr(dev, "chrB", NULL);
- qdev_set_prop_ptr(dev, "chrA", NULL);
- qdev_set_prop_int(dev, "chnBtype", mouse);
- qdev_set_prop_int(dev, "chnAtype", kbd);
+ qdev_prop_set_uint32(dev, "disabled", disabled);
+ qdev_prop_set_uint32(dev, "frequency", clock);
+ qdev_prop_set_uint32(dev, "it_shift", it_shift);
+ qdev_prop_set_ptr(dev, "chrB", NULL);
+ qdev_prop_set_ptr(dev, "chrA", NULL);
+ qdev_prop_set_uint32(dev, "chnBtype", mouse);
+ qdev_prop_set_uint32(dev, "chnAtype", kbd);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -914,19 +916,13 @@ static void escc_init1(SysBusDevice *dev)
SerialState *s = FROM_SYSBUS(SerialState, dev);
int io;
unsigned int i;
- uint32_t clock, disabled;
-
- s->it_shift = qdev_get_prop_int(&dev->qdev, "it_shift", 0);
- clock = qdev_get_prop_int(&dev->qdev, "frequency", 0);
- s->chn[0].chr = qdev_get_prop_ptr(&dev->qdev, "chrB");
- s->chn[1].chr = qdev_get_prop_ptr(&dev->qdev, "chrA");
- disabled = qdev_get_prop_int(&dev->qdev, "disabled", 0);
- s->chn[0].disabled = disabled;
- s->chn[1].disabled = disabled;
+
+ s->chn[0].disabled = s->disabled;
+ s->chn[1].disabled = s->disabled;
for (i = 0; i < 2; i++) {
sysbus_init_irq(dev, &s->chn[i].irq);
s->chn[i].chn = 1 - i;
- s->chn[i].clock = clock / 2;
+ s->chn[i].clock = s->frequency / 2;
if (s->chn[i].chr) {
qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive,
serial_receive1, serial_event, &s->chn[i]);
@@ -934,8 +930,6 @@ static void escc_init1(SysBusDevice *dev)
}
s->chn[0].otherchn = &s->chn[1];
s->chn[1].otherchn = &s->chn[0];
- s->chn[0].type = qdev_get_prop_int(&dev->qdev, "chnBtype", 0);
- s->chn[1].type = qdev_get_prop_int(&dev->qdev, "chnAtype", 0);
io = cpu_register_io_memory(escc_mem_read, escc_mem_write, s);
sysbus_init_mmio(dev, ESCC_SIZE << s->it_shift, io);
@@ -957,15 +951,43 @@ static SysBusDeviceInfo escc_info = {
.init = escc_init1,
.qdev.name = "escc",
.qdev.size = sizeof(SerialState),
- .qdev.props = (DevicePropList[]) {
- {.name = "frequency", .type = PROP_TYPE_INT},
- {.name = "it_shift", .type = PROP_TYPE_INT},
- {.name = "disabled", .type = PROP_TYPE_INT},
- {.name = "chrB", .type = PROP_TYPE_PTR},
- {.name = "chrA", .type = PROP_TYPE_PTR},
- {.name = "chnBtype", .type = PROP_TYPE_INT},
- {.name = "chnAtype", .type = PROP_TYPE_INT},
- {.name = NULL}
+ .qdev.props = (Property[]) {
+ {
+ .name = "frequency",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SerialState, frequency),
+ },
+ {
+ .name = "it_shift",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SerialState, it_shift),
+ },
+ {
+ .name = "disabled",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SerialState, disabled),
+ },
+ {
+ .name = "chrB",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SerialState, chn[1].chr),
+ },
+ {
+ .name = "chrA",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SerialState, chn[0].chr),
+ },
+ {
+ .name = "chnBtype",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SerialState, chn[1].type),
+ },
+ {
+ .name = "chnAtype",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SerialState, chn[0].type),
+ },
+ {/* end of list */}
}
};
diff --git a/hw/esp.c b/hw/esp.c
index 88d42a14f..9eacccbf8 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -650,12 +650,14 @@ void esp_init(target_phys_addr_t espaddr, int it_shift,
{
DeviceState *dev;
SysBusDevice *s;
+ ESPState *esp;
dev = qdev_create(NULL, "esp");
- qdev_set_prop_ptr(dev, "dma_memory_read", dma_memory_read);
- qdev_set_prop_ptr(dev, "dma_memory_write", dma_memory_write);
- qdev_set_prop_ptr(dev, "dma_opaque", dma_opaque);
- qdev_set_prop_int(dev, "it_shift", it_shift);
+ esp = DO_UPCAST(ESPState, busdev.qdev, dev);
+ esp->dma_memory_read = dma_memory_read;
+ esp->dma_memory_write = dma_memory_write;
+ esp->dma_opaque = dma_opaque;
+ esp->it_shift = it_shift;
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -668,11 +670,7 @@ static void esp_init1(SysBusDevice *dev)
int esp_io_memory;
sysbus_init_irq(dev, &s->irq);
- s->it_shift = qdev_get_prop_int(&dev->qdev, "it_shift", -1);
assert(s->it_shift != -1);
- s->dma_memory_read = qdev_get_prop_ptr(&dev->qdev, "dma_memory_read");
- s->dma_memory_write = qdev_get_prop_ptr(&dev->qdev, "dma_memory_write");
- s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma_opaque");
esp_io_memory = cpu_register_io_memory(esp_mem_read, esp_mem_write, s);
sysbus_init_mmio(dev, ESP_REGS << s->it_shift, esp_io_memory);
diff --git a/hw/etraxfs.c b/hw/etraxfs.c
index 94cd6bc81..c2eca5275 100644
--- a/hw/etraxfs.c
+++ b/hw/etraxfs.c
@@ -88,7 +88,7 @@ void bareetraxfs_init (ram_addr_t ram_size,
cpu_irq = cris_pic_init_cpu(env);
dev = qdev_create(NULL, "etraxfs,pic");
/* FIXME: Is there a proper way to signal vectors to the CPU core? */
- qdev_set_prop_ptr(dev, "interrupt_vector", &env->interrupt_vector);
+ qdev_prop_set_ptr(dev, "interrupt_vector", &env->interrupt_vector);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, 0x3001c000);
diff --git a/hw/etraxfs_pic.c b/hw/etraxfs_pic.c
index 1c6742795..e6272189b 100644
--- a/hw/etraxfs_pic.c
+++ b/hw/etraxfs_pic.c
@@ -140,7 +140,6 @@ static void etraxfs_pic_init(SysBusDevice *dev)
struct etrax_pic *s = FROM_SYSBUS(typeof (*s), dev);
int intr_vect_regs;
- s->interrupt_vector = qdev_get_prop_ptr(&dev->qdev, "interrupt_vector");
qdev_init_gpio_in(&dev->qdev, irq_handler, 32);
sysbus_init_irq(dev, &s->parent_irq);
sysbus_init_irq(dev, &s->parent_nmi);
@@ -149,10 +148,23 @@ static void etraxfs_pic_init(SysBusDevice *dev)
sysbus_init_mmio(dev, R_MAX * 4, intr_vect_regs);
}
+static SysBusDeviceInfo etraxfs_pic_info = {
+ .init = etraxfs_pic_init,
+ .qdev.name = "etraxfs,pic",
+ .qdev.size = sizeof(struct etrax_pic),
+ .qdev.props = (Property[]) {
+ {
+ .name = "interrupt_vector",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(struct etrax_pic, interrupt_vector),
+ },
+ {/* end of list */}
+ }
+};
+
static void etraxfs_pic_register(void)
{
- sysbus_register_dev("etraxfs,pic", sizeof (struct etrax_pic),
- etraxfs_pic_init);
+ sysbus_register_withprop(&etraxfs_pic_info);
}
device_init(etraxfs_pic_register)
diff --git a/hw/fdc.c b/hw/fdc.c
index 3959b112e..fa154a30c 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -511,6 +511,8 @@ struct fdctrl_t {
/* Floppy drives */
fdrive_t drives[MAX_FD];
int reset_sensei;
+ uint32_t strict_io;
+ uint32_t mem_mapped;
};
static uint32_t fdctrl_read (void *opaque, uint32_t reg)
@@ -1898,9 +1900,9 @@ fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
fdctrl_t *fdctrl;
dev = qdev_create(NULL, "fdc");
- qdev_set_prop_int(dev, "strict_io", 0);
- qdev_set_prop_int(dev, "mem_mapped", mem_mapped);
- qdev_set_prop_int(dev, "sun4m", 0);
+ qdev_prop_set_uint32(dev, "strict_io", 0);
+ qdev_prop_set_uint32(dev, "mem_mapped", mem_mapped);
+ qdev_prop_set_uint32(dev, "sun4m", 0);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -1931,9 +1933,9 @@ fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,
fdctrl_t *fdctrl;
dev = qdev_create(NULL, "fdc");
- qdev_set_prop_int(dev, "strict_io", 1);
- qdev_set_prop_int(dev, "mem_mapped", 1);
- qdev_set_prop_int(dev, "sun4m", 1);
+ qdev_prop_set_uint32(dev, "strict_io", 1);
+ qdev_prop_set_uint32(dev, "mem_mapped", 1);
+ qdev_prop_set_uint32(dev, "sun4m", 1);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -1953,7 +1955,7 @@ static void fdc_init1(SysBusDevice *dev)
sysbus_init_irq(dev, &s->irq);
qdev_init_gpio_in(&dev->qdev, fdctrl_handle_tc, 1);
- if (qdev_get_prop_int(&dev->qdev, "strict_io", 0)) {
+ if (s->strict_io) {
io = cpu_register_io_memory(fdctrl_mem_read_strict,
fdctrl_mem_write_strict, s);
} else {
@@ -1967,12 +1969,28 @@ static SysBusDeviceInfo fdc_info = {
.init = fdc_init1,
.qdev.name = "fdc",
.qdev.size = sizeof(fdctrl_t),
- .qdev.props = (DevicePropList[]) {
- {.name = "io_base", .type = PROP_TYPE_INT},
- {.name = "strict_io", .type = PROP_TYPE_INT},
- {.name = "mem_mapped", .type = PROP_TYPE_INT},
- {.name = "sun4m", .type = PROP_TYPE_INT},
- {.name = NULL}
+ .qdev.props = (Property[]) {
+ {
+ .name = "io_base",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(fdctrl_t, io_base),
+ },
+ {
+ .name = "strict_io",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(fdctrl_t, strict_io),
+ },
+ {
+ .name = "mem_mapped",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(fdctrl_t, mem_mapped),
+ },
+ {
+ .name = "sun4m",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(fdctrl_t, sun4m),
+ },
+ {/* end of properties */}
}
};
diff --git a/hw/fmopl.c b/hw/fmopl.c
index 52cf35e3f..d1161f848 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -27,8 +27,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define INLINE static inline
diff --git a/hw/g364fb.c b/hw/g364fb.c
index 933765051..6aaca7a32 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/hpet.c b/hw/hpet.c
index 2bb205730..41d9af4ca 100644
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* *****************************************************************
*
diff --git a/hw/i2c.c b/hw/i2c.c
index 98aa7fcd2..42a5d7a6b 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -20,6 +20,14 @@ struct i2c_bus
static struct BusInfo i2c_bus_info = {
.name = "I2C",
.size = sizeof(i2c_bus),
+ .props = (Property[]) {
+ {
+ .name = "address",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct i2c_slave, address),
+ },
+ {/* end of list */}
+ }
};
static void i2c_bus_save(QEMUFile *f, void *opaque)
@@ -151,7 +159,6 @@ static void i2c_slave_qdev_init(DeviceState *dev, DeviceInfo *base)
i2c_slave *s = I2C_SLAVE_FROM_QDEV(dev);
s->info = info;
- s->address = qdev_get_prop_int(dev, "address", 0);
info->init(s);
}
@@ -169,7 +176,7 @@ DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, int addr)
DeviceState *dev;
dev = qdev_create(&bus->qbus, name);
- qdev_set_prop_int(dev, "address", addr);
+ qdev_prop_set_uint32(dev, "address", addr);
qdev_init(dev);
return dev;
}
diff --git a/hw/i2c.h b/hw/i2c.h
index c4df39988..479ff4b9f 100644
--- a/hw/i2c.h
+++ b/hw/i2c.h
@@ -40,7 +40,7 @@ struct i2c_slave
I2CSlaveInfo *info;
/* Remaining fields for internal use by the I2C code. */
- int address;
+ uint32_t address;
};
i2c_bus *i2c_init_bus(DeviceState *parent, const char *name);
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 50eae0c34..ddc8d8556 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -17,6 +17,7 @@
typedef struct {
SysBusDevice busdev;
+ uint32_t memsz;
uint32_t flash_offset;
uint32_t cm_osc;
uint32_t cm_ctrl;
@@ -230,23 +231,21 @@ static void integratorcm_init(SysBusDevice *dev)
{
int iomemtype;
integratorcm_state *s = FROM_SYSBUS(integratorcm_state, dev);
- int memsz;
- memsz = qdev_get_prop_int(&dev->qdev, "memsz", 0);
s->cm_osc = 0x01000048;
/* ??? What should the high bits of this value be? */
s->cm_auxosc = 0x0007feff;
s->cm_sdram = 0x00011122;
- if (memsz >= 256) {
+ if (s->memsz >= 256) {
integrator_spd[31] = 64;
s->cm_sdram |= 0x10;
- } else if (memsz >= 128) {
+ } else if (s->memsz >= 128) {
integrator_spd[31] = 32;
s->cm_sdram |= 0x0c;
- } else if (memsz >= 64) {
+ } else if (s->memsz >= 64) {
integrator_spd[31] = 16;
s->cm_sdram |= 0x08;
- } else if (memsz >= 32) {
+ } else if (s->memsz >= 32) {
integrator_spd[31] = 4;
s->cm_sdram |= 0x04;
} else {
@@ -475,7 +474,7 @@ static void integratorcp_init(ram_addr_t ram_size,
cpu_register_physical_memory(0x80000000, ram_size, ram_offset | IO_MEM_RAM);
dev = qdev_create(NULL, "integrator_core");
- qdev_set_prop_int(dev, "memsz", ram_size >> 20);
+ qdev_prop_set_uint32(dev, "memsz", ram_size >> 20);
qdev_init(dev);
sysbus_mmio_map((SysBusDevice *)dev, 0, 0x10000000);
@@ -522,11 +521,24 @@ static void integratorcp_machine_init(void)
machine_init(integratorcp_machine_init);
+static SysBusDeviceInfo core_info = {
+ .init = integratorcm_init,
+ .qdev.name = "integrator_core",
+ .qdev.size = sizeof(integratorcm_state),
+ .qdev.props = (Property[]) {
+ {
+ .name = "memsz",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(integratorcm_state, memsz),
+ },
+ {/* end of list */}
+ }
+};
+
static void integratorcp_register_devices(void)
{
sysbus_register_dev("integrator_pic", sizeof(icp_pic_state), icp_pic_init);
- sysbus_register_dev("integrator_core", sizeof(integratorcm_state),
- integratorcm_init);
+ sysbus_register_withprop(&core_info);
}
device_init(integratorcp_register_devices)
diff --git a/hw/ioapic.c b/hw/ioapic.c
index efd418d9d..32019de66 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/iommu.c b/hw/iommu.c
index 0af6d32ac..abf517f1d 100644
--- a/hw/iommu.c
+++ b/hw/iommu.c
@@ -21,8 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "hw.h"
+
#include "sun4m.h"
+#include "sysbus.h"
/* debug iommu */
//#define DEBUG_IOMMU
@@ -127,6 +128,7 @@
#define IOMMU_PAGE_MASK ~(IOMMU_PAGE_SIZE - 1)
typedef struct IOMMUState {
+ SysBusDevice busdev;
uint32_t regs[IOMMU_NREGS];
target_phys_addr_t iostart;
uint32_t version;
@@ -366,20 +368,54 @@ static void iommu_reset(void *opaque)
void *iommu_init(target_phys_addr_t addr, uint32_t version, qemu_irq irq)
{
- IOMMUState *s;
- int iommu_io_memory;
+ DeviceState *dev;
+ SysBusDevice *s;
+ IOMMUState *d;
+
+ dev = qdev_create(NULL, "iommu");
+ qdev_prop_set_uint32(dev, "version", version);
+ qdev_init(dev);
+ s = sysbus_from_qdev(dev);
+ sysbus_connect_irq(s, 0, irq);
+ sysbus_mmio_map(s, 0, addr);
- s = qemu_mallocz(sizeof(IOMMUState));
+ d = FROM_SYSBUS(IOMMUState, s);
- s->version = version;
- s->irq = irq;
+ return d;
+}
- iommu_io_memory = cpu_register_io_memory(iommu_mem_read,
- iommu_mem_write, s);
- cpu_register_physical_memory(addr, IOMMU_NREGS * 4, iommu_io_memory);
+static void iommu_init1(SysBusDevice *dev)
+{
+ IOMMUState *s = FROM_SYSBUS(IOMMUState, dev);
+ int io;
- register_savevm("iommu", addr, 2, iommu_save, iommu_load, s);
+ sysbus_init_irq(dev, &s->irq);
+
+ io = cpu_register_io_memory(iommu_mem_read, iommu_mem_write, s);
+ sysbus_init_mmio(dev, IOMMU_NREGS * sizeof(uint32_t), io);
+
+ register_savevm("iommu", -1, 2, iommu_save, iommu_load, s);
qemu_register_reset(iommu_reset, s);
iommu_reset(s);
- return s;
}
+
+static SysBusDeviceInfo iommu_info = {
+ .init = iommu_init1,
+ .qdev.name = "iommu",
+ .qdev.size = sizeof(IOMMUState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "version",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(IOMMUState, version),
+ },
+ {/* end of property list */}
+ }
+};
+
+static void iommu_register_devices(void)
+{
+ sysbus_register_withprop(&iommu_info);
+}
+
+device_init(iommu_register_devices)
diff --git a/hw/lm832x.c b/hw/lm832x.c
index 460f21a69..197fe7db9 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/m48t59.c b/hw/m48t59.c
index 798d29285..7e53dceb3 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -43,11 +43,11 @@
struct m48t59_t {
SysBusDevice busdev;
/* Model parameters */
- int type; // 2 = m48t02, 8 = m48t08, 59 = m48t59
+ uint32_t type; // 2 = m48t02, 8 = m48t08, 59 = m48t59
/* Hardware parameters */
qemu_irq IRQ;
uint32_t io_base;
- uint16_t size;
+ uint32_t size;
/* RTC management */
time_t time_offset;
time_t stop_time;
@@ -623,9 +623,9 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
m48t59_t *d;
dev = qdev_create(NULL, "m48t59");
- qdev_set_prop_int(dev, "type", type);
- qdev_set_prop_int(dev, "size", size);
- qdev_set_prop_int(dev, "io_base", io_base);
+ qdev_prop_set_uint32(dev, "type", type);
+ qdev_prop_set_uint32(dev, "size", size);
+ qdev_prop_set_uint32(dev, "io_base", io_base);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, IRQ);
@@ -647,11 +647,8 @@ static void m48t59_init1(SysBusDevice *dev)
m48t59_t *s = FROM_SYSBUS(m48t59_t, dev);
int mem_index;
- s->size = qdev_get_prop_int(&dev->qdev, "size", -1);
s->buffer = qemu_mallocz(s->size);
sysbus_init_irq(dev, &s->IRQ);
- s->io_base = qdev_get_prop_int(&dev->qdev, "io_base", 0);
- s->type = qdev_get_prop_int(&dev->qdev, "type", -1);
mem_index = cpu_register_io_memory(nvram_read, nvram_write, s);
sysbus_init_mmio(dev, s->size, mem_index);
@@ -666,9 +663,33 @@ static void m48t59_init1(SysBusDevice *dev)
register_savevm("m48t59", -1, 1, m48t59_save, m48t59_load, s);
}
+static SysBusDeviceInfo m48t59_info = {
+ .init = m48t59_init1,
+ .qdev.name = "m48t59",
+ .qdev.size = sizeof(m48t59_t),
+ .qdev.props = (Property[]) {
+ {
+ .name = "size",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(m48t59_t, size),
+ .defval = (uint32_t[]) { -1 },
+ },{
+ .name = "type",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(m48t59_t, type),
+ .defval = (uint32_t[]) { -1 },
+ },{
+ .name = "io_base",
+ .info = &qdev_prop_hex32,
+ .offset = offsetof(m48t59_t, io_base),
+ },
+ {/* end of list */}
+ }
+};
+
static void m48t59_register_devices(void)
{
- sysbus_register_dev("m48t59", sizeof(m48t59_t), m48t59_init1);
+ sysbus_register_withprop(&m48t59_info);
}
device_init(m48t59_register_devices)
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 853ec2b8d..7728e58c5 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -914,8 +914,8 @@ void mips_malta_init (ram_addr_t ram_size,
/* TODO: Populate SPD eeprom data. */
DeviceState *eeprom;
eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
- qdev_set_prop_int(eeprom, "address", 0x50 + i);
- qdev_set_prop_ptr(eeprom, "data", eeprom_buf + (i * 256));
+ qdev_prop_set_uint32(eeprom, "address", 0x50 + i);
+ qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
qdev_init(eeprom);
}
pit = pit_init(0x40, i8259[0]);
diff --git a/hw/musicpal.c b/hw/musicpal.c
index 10be69be8..e6367919f 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1578,7 +1578,7 @@ static void musicpal_init(ram_addr_t ram_size,
qemu_check_nic_model(&nd_table[0], "mv88w8618");
dev = qdev_create(NULL, "mv88w8618_eth");
- qdev_set_netdev(dev, &nd_table[0]);
+ dev->nd = &nd_table[0];
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, MP_ETH_BASE);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, pic[MP_ETH_IRQ]);
diff --git a/hw/nseries.c b/hw/nseries.c
index c219bfe40..e9b68a7f1 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/omap.h b/hw/omap.h
index e25904c8b..a484c8206 100644
--- a/hw/omap.h
+++ b/hw/omap.h
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef hw_omap_h
# define hw_omap_h "omap.h"
diff --git a/hw/omap1.c b/hw/omap1.c
index 5af2d9f59..14d7a829c 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "arm-misc.h"
diff --git a/hw/omap2.c b/hw/omap2.c
index f91d678c5..8cbc4b5ea 100644
--- a/hw/omap2.c
+++ b/hw/omap2.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "arm-misc.h"
diff --git a/hw/omap_clk.c b/hw/omap_clk.c
index fc86cf172..a2da17fc1 100644
--- a/hw/omap_clk.c
+++ b/hw/omap_clk.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "omap.h"
diff --git a/hw/omap_dma.c b/hw/omap_dma.c
index e31a14b83..3122f4203 100644
--- a/hw/omap_dma.c
+++ b/hw/omap_dma.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
#include "qemu-timer.h"
diff --git a/hw/omap_dss.c b/hw/omap_dss.c
index c69b91b9d..b6aad4f09 100644
--- a/hw/omap_dss.c
+++ b/hw/omap_dss.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "console.h"
diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c
index 60da5745c..9e59005e8 100644
--- a/hw/omap_i2c.c
+++ b/hw/omap_i2c.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "i2c.h"
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index 5458f2ab1..2dfffad04 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "console.h"
diff --git a/hw/omap_mmc.c b/hw/omap_mmc.c
index 93dbff612..9aadfc904 100644
--- a/hw/omap_mmc.c
+++ b/hw/omap_mmc.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "omap.h"
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index 0f6ed9ef6..1ba42f6cd 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -23,8 +23,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "sysemu.h"
diff --git a/hw/onenand.c b/hw/onenand.c
index 7388e7c79..870cfd990 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/palm.c b/hw/palm.c
index 8b3a2ba04..7c812a303 100644
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "audio/audio.h"
diff --git a/hw/pc.c b/hw/pc.c
index 7d8475ca1..223a3c226 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -831,6 +831,7 @@ static void load_linux(void *fw_cfg,
uint8_t header[8192];
target_phys_addr_t real_addr, prot_addr, cmdline_addr, initrd_addr = 0;
FILE *f, *fi;
+ char *vmode;
/* Align to 16 bytes as a paranoia measure */
cmdline_size = (strlen(kernel_cmdline)+16) & ~15;
@@ -906,6 +907,24 @@ static void load_linux(void *fw_cfg,
stw_p(header+0x22, cmdline_addr-real_addr);
}
+ /* handle vga= parameter */
+ vmode = strstr(kernel_cmdline, "vga=");
+ if (vmode) {
+ unsigned int video_mode;
+ /* skip "vga=" */
+ vmode += 4;
+ if (!strncmp(vmode, "normal", 6)) {
+ video_mode = 0xffff;
+ } else if (!strncmp(vmode, "ext", 3)) {
+ video_mode = 0xfffe;
+ } else if (!strncmp(vmode, "ask", 3)) {
+ video_mode = 0xfffd;
+ } else {
+ video_mode = strtol(vmode, NULL, 0);
+ }
+ stw_p(header+0x1fa, video_mode);
+ }
+
/* loader type */
/* High nybble = B reserved for Qemu; low nybble is revision number.
If this code is substantially changed, you may want to consider
@@ -1405,8 +1424,8 @@ static void pc_init1(ram_addr_t ram_size,
for (i = 0; i < 8; i++) {
DeviceState *eeprom;
eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
- qdev_set_prop_int(eeprom, "address", 0x50 + i);
- qdev_set_prop_ptr(eeprom, "data", eeprom_buf + (i * 256));
+ qdev_prop_set_uint32(eeprom, "address", 0x50 + i);
+ qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
qdev_init(eeprom);
}
}
@@ -1541,6 +1560,29 @@ static QEMUMachine pc_machine = {
.is_default = 1,
};
+static QEMUMachine pc_machine_v0_10 = {
+ .name = "pc-0.10",
+ .desc = "Standard PC, qemu 0.10",
+ .init = pc_init_pci,
+ .max_cpus = 255,
+ .compat_props = (CompatProperty[]) {
+ {
+ .driver = "virtio-blk-pci",
+ .property = "class",
+ .value = stringify(PCI_CLASS_STORAGE_OTHER),
+ },{
+ .driver = "virtio-console-pci",
+ .property = "class",
+ .value = stringify(PCI_CLASS_DISPLAY_OTHER),
+ },{
+ .driver = "virtio-net-pci",
+ .property = "vectors",
+ .value = stringify(0),
+ },
+ { /* end of list */ }
+ },
+};
+
static QEMUMachine isapc_machine = {
.name = "isapc",
.desc = "ISA-only PC",
@@ -1558,6 +1600,7 @@ static QEMUMachine pc_0_10_machine = {
static void pc_machine_init(void)
{
qemu_register_machine(&pc_machine);
+ qemu_register_machine(&pc_machine_v0_10);
qemu_register_machine(&isapc_machine);
/* For compatibility with 0.10.x */
diff --git a/hw/pci.c b/hw/pci.c
index 3ef26fc5e..a575d4a97 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -62,6 +62,15 @@ static struct BusInfo pci_bus_info = {
.name = "PCI",
.size = sizeof(PCIBus),
.print_dev = pcibus_dev_print,
+ .props = (Property[]) {
+ {
+ .name = "devfn",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(PCIDevice, devfn),
+ .defval = (uint32_t[]) { -1 },
+ },
+ {/* end of list */}
+ }
};
static void pci_update_mappings(PCIDevice *d);
@@ -849,6 +858,7 @@ static void pci_info_device(PCIDevice *d)
}
}
}
+ monitor_printf(mon, " id \"%s\"\n", d->qdev.id ? d->qdev.id : "");
if (class == 0x0604 && d->config[0x19] != 0) {
pci_for_each_device(d->config[0x19], pci_info_device);
}
@@ -890,7 +900,7 @@ PCIDevice *pci_create(const char *name, const char *devaddr)
}
dev = qdev_create(&bus->qbus, name);
- qdev_set_prop_int(dev, "devfn", devfn);
+ qdev_prop_set_uint32(dev, "devfn", devfn);
return (PCIDevice *)dev;
}
@@ -933,7 +943,9 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
if (strcmp(nd->model, pci_nic_models[i]) == 0) {
pci_dev = pci_create(pci_nic_names[i], devaddr);
dev = &pci_dev->qdev;
- qdev_set_netdev(dev, nd);
+ if (nd->id)
+ dev->id = qemu_strdup(nd->id);
+ dev->nd = nd;
qdev_init(dev);
nd->private = dev;
return pci_dev;
@@ -1011,7 +1023,7 @@ static void pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
int devfn;
bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev));
- devfn = qdev_get_prop_int(qdev, "devfn", -1);
+ devfn = pci_dev->devfn;
pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn,
info->config_read, info->config_write);
assert(pci_dev);
@@ -1038,7 +1050,7 @@ PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name)
DeviceState *dev;
dev = qdev_create(&bus->qbus, name);
- qdev_set_prop_int(dev, "devfn", devfn);
+ qdev_prop_set_uint32(dev, "devfn", devfn);
qdev_init(dev);
return (PCIDevice *)dev;
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 4519780cf..22ab6beaf 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2128,8 +2128,6 @@ static void lance_init(SysBusDevice *dev)
s->mmio_index =
cpu_register_io_memory(lance_mem_read, lance_mem_write, d);
- s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma");
-
qdev_init_gpio_in(&dev->qdev, parent_lance_reset, 1);
sysbus_init_mmio(dev, 4, s->mmio_index);
@@ -2141,6 +2139,21 @@ static void lance_init(SysBusDevice *dev)
pcnet_common_init(&dev->qdev, s, lance_cleanup);
}
+
+static SysBusDeviceInfo lance_info = {
+ .init = lance_init,
+ .qdev.name = "lance",
+ .qdev.size = sizeof(SysBusPCNetState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "dma",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SysBusPCNetState, state.dma_opaque),
+ },
+ {/* end of list */}
+ }
+};
+
#endif /* TARGET_SPARC */
static PCIDeviceInfo pcnet_info = {
@@ -2153,7 +2166,7 @@ static void pcnet_register_devices(void)
{
pci_qdev_register(&pcnet_info);
#if defined (TARGET_SPARC) && !defined(TARGET_SPARC64)
- sysbus_register_dev("lance", sizeof(SysBusPCNetState), lance_init);
+ sysbus_register_withprop(&lance_info);
#endif
}
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index 53ed97e64..bfa2bdd97 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index 4b963643b..a62d60955 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/hw/ppc4xx_pci.c b/hw/ppc4xx_pci.c
index 87c44f80d..077ae7094 100644
--- a/hw/ppc4xx_pci.c
+++ b/hw/ppc4xx_pci.c
@@ -9,8 +9,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright IBM Corp. 2008
*
diff --git a/hw/ps2.c b/hw/ps2.c
index fb7700523..0915b9faf 100644
--- a/hw/ps2.c
+++ b/hw/ps2.c
@@ -488,9 +488,8 @@ void ps2_write_mouse(void *opaque, int val)
}
}
-static void ps2_reset(void *opaque)
+static void ps2_common_reset(PS2State *s)
{
- PS2State *s = (PS2State *)opaque;
PS2Queue *q;
s->write_cmd = -1;
q = &s->queue;
@@ -500,6 +499,33 @@ static void ps2_reset(void *opaque)
s->update_irq(s->update_arg, 0);
}
+static void ps2_kbd_reset(void *opaque)
+{
+ PS2KbdState *s = (PS2KbdState *) opaque;
+
+ ps2_common_reset(&s->common);
+ s->scan_enabled = 0;
+ s->translate = 0;
+ s->scancode_set = 0;
+}
+
+static void ps2_mouse_reset(void *opaque)
+{
+ PS2MouseState *s = (PS2MouseState *) opaque;
+
+ ps2_common_reset(&s->common);
+ s->mouse_status = 0;
+ s->mouse_resolution = 0;
+ s->mouse_sample_rate = 0;
+ s->mouse_wrap = 0;
+ s->mouse_type = 0;
+ s->mouse_detect_state = 0;
+ s->mouse_dx = 0;
+ s->mouse_dy = 0;
+ s->mouse_dz = 0;
+ s->mouse_buttons = 0;
+}
+
static void ps2_common_save (QEMUFile *f, PS2State *s)
{
qemu_put_be32 (f, s->write_cmd);
@@ -590,10 +616,10 @@ void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg)
s->common.update_irq = update_irq;
s->common.update_arg = update_arg;
s->scancode_set = 2;
- ps2_reset(&s->common);
+ ps2_kbd_reset(s);
register_savevm("ps2kbd", 0, 3, ps2_kbd_save, ps2_kbd_load, s);
qemu_add_kbd_event_handler(ps2_put_keycode, s);
- qemu_register_reset(ps2_reset, &s->common);
+ qemu_register_reset(ps2_kbd_reset, s);
return s;
}
@@ -603,9 +629,9 @@ void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg)
s->common.update_irq = update_irq;
s->common.update_arg = update_arg;
- ps2_reset(&s->common);
+ ps2_mouse_reset(s);
register_savevm("ps2mouse", 0, 2, ps2_mouse_save, ps2_mouse_load, s);
qemu_add_mouse_event_handler(ps2_mouse_event, s, 0, "QEMU PS/2 Mouse");
- qemu_register_reset(ps2_reset, &s->common);
+ qemu_register_reset(ps2_mouse_reset, s);
return s;
}
diff --git a/hw/qdev-addr.c b/hw/qdev-addr.c
new file mode 100644
index 000000000..305c2d37b
--- /dev/null
+++ b/hw/qdev-addr.c
@@ -0,0 +1,32 @@
+#include "qdev.h"
+#include "qdev-addr.h"
+#include "targphys.h"
+
+/* --- target physical address --- */
+
+static int parse_taddr(DeviceState *dev, Property *prop, const char *str)
+{
+ target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop);
+
+ *ptr = strtoull(str, NULL, 16);
+ return 0;
+}
+
+static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr);
+}
+
+PropertyInfo qdev_prop_taddr = {
+ .name = "taddr",
+ .type = PROP_TYPE_TADDR,
+ .size = sizeof(target_phys_addr_t),
+ .parse = parse_taddr,
+ .print = print_taddr,
+};
+
+void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value)
+{
+ qdev_prop_set(dev, name, &value, PROP_TYPE_TADDR);
+}
diff --git a/hw/qdev-addr.h b/hw/qdev-addr.h
new file mode 100644
index 000000000..f02bd7af1
--- /dev/null
+++ b/hw/qdev-addr.h
@@ -0,0 +1,2 @@
+extern PropertyInfo qdev_prop_taddr;
+void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value);
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
new file mode 100644
index 000000000..06c25aff7
--- /dev/null
+++ b/hw/qdev-properties.c
@@ -0,0 +1,269 @@
+#include "qdev.h"
+
+void *qdev_get_prop_ptr(DeviceState *dev, Property *prop)
+{
+ void *ptr = dev;
+ ptr += prop->offset;
+ return ptr;
+}
+
+/* --- 16bit integer --- */
+
+static int parse_uint16(DeviceState *dev, Property *prop, const char *str)
+{
+ uint16_t *ptr = qdev_get_prop_ptr(dev, prop);
+ const char *fmt;
+
+ /* accept both hex and decimal */
+ fmt = strncasecmp(str, "0x",2) == 0 ? "%" PRIx16 : "%" PRIu16;
+ if (sscanf(str, fmt, ptr) != 1)
+ return -1;
+ return 0;
+}
+
+static int print_uint16(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ uint16_t *ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "%" PRIu16, *ptr);
+}
+
+PropertyInfo qdev_prop_uint16 = {
+ .name = "uint16",
+ .type = PROP_TYPE_UINT16,
+ .size = sizeof(uint16_t),
+ .parse = parse_uint16,
+ .print = print_uint16,
+};
+
+/* --- 32bit integer --- */
+
+static int parse_uint32(DeviceState *dev, Property *prop, const char *str)
+{
+ uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
+ const char *fmt;
+
+ /* accept both hex and decimal */
+ fmt = strncasecmp(str, "0x",2) == 0 ? "%" PRIx32 : "%" PRIu32;
+ if (sscanf(str, fmt, ptr) != 1)
+ return -1;
+ return 0;
+}
+
+static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "%" PRIu32, *ptr);
+}
+
+PropertyInfo qdev_prop_uint32 = {
+ .name = "uint32",
+ .type = PROP_TYPE_UINT32,
+ .size = sizeof(uint32_t),
+ .parse = parse_uint32,
+ .print = print_uint32,
+};
+
+/* --- 32bit hex value --- */
+
+static int parse_hex32(DeviceState *dev, Property *prop, const char *str)
+{
+ uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
+
+ if (sscanf(str, "%" PRIx32, ptr) != 1)
+ return -1;
+ return 0;
+}
+
+static int print_hex32(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "0x%" PRIx32, *ptr);
+}
+
+PropertyInfo qdev_prop_hex32 = {
+ .name = "hex32",
+ .type = PROP_TYPE_UINT32,
+ .size = sizeof(uint32_t),
+ .parse = parse_hex32,
+ .print = print_hex32,
+};
+
+/* --- pointer --- */
+
+static int print_ptr(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ void **ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "<%p>", *ptr);
+}
+
+PropertyInfo qdev_prop_ptr = {
+ .name = "ptr",
+ .type = PROP_TYPE_PTR,
+ .size = sizeof(void*),
+ .print = print_ptr,
+};
+
+/* --- mac address --- */
+
+/*
+ * accepted syntax versions:
+ * 01:02:03:04:05:06
+ * 01-02-03-04-05-06
+ */
+static int parse_mac(DeviceState *dev, Property *prop, const char *str)
+{
+ uint8_t *mac = qdev_get_prop_ptr(dev, prop);
+ int i, pos;
+ char *p;
+
+ for (i = 0, pos = 0; i < 6; i++, pos += 3) {
+ if (!isxdigit(str[pos]))
+ return -1;
+ if (!isxdigit(str[pos+1]))
+ return -1;
+ if (i == 5 && str[pos+2] != '\0')
+ return -1;
+ if (str[pos+2] != ':' && str[pos+2] != '-')
+ return -1;
+ mac[i] = strtol(str+pos, &p, 16);
+ }
+ return 0;
+}
+
+static int print_mac(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ uint8_t *mac = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "%02x:%02x:%02x:%02x:%02x:%02x",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+}
+
+PropertyInfo qdev_prop_macaddr = {
+ .name = "mac-addr",
+ .type = PROP_TYPE_MACADDR,
+ .size = 6,
+ .parse = parse_mac,
+ .print = print_mac,
+};
+
+/* --- public helpers --- */
+
+static Property *qdev_prop_walk(Property *props, const char *name)
+{
+ if (!props)
+ return NULL;
+ while (props->name) {
+ if (strcmp(props->name, name) == 0)
+ return props;
+ props++;
+ }
+ return NULL;
+}
+
+static Property *qdev_prop_find(DeviceState *dev, const char *name)
+{
+ Property *prop;
+
+ /* device properties */
+ prop = qdev_prop_walk(dev->info->props, name);
+ if (prop)
+ return prop;
+
+ /* bus properties */
+ prop = qdev_prop_walk(dev->parent_bus->info->props, name);
+ if (prop)
+ return prop;
+
+ return NULL;
+}
+
+int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
+{
+ Property *prop;
+
+ prop = qdev_prop_find(dev, name);
+ if (!prop) {
+ fprintf(stderr, "property \"%s.%s\" not found\n",
+ dev->info->name, name);
+ return -1;
+ }
+ if (!prop->info->parse) {
+ fprintf(stderr, "property \"%s.%s\" has no parser\n",
+ dev->info->name, name);
+ return -1;
+ }
+ return prop->info->parse(dev, prop, value);
+}
+
+void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type)
+{
+ Property *prop;
+ void *dst;
+
+ prop = qdev_prop_find(dev, name);
+ if (!prop) {
+ fprintf(stderr, "%s: property \"%s.%s\" not found\n",
+ __FUNCTION__, dev->info->name, name);
+ abort();
+ }
+ if (prop->info->type != type) {
+ fprintf(stderr, "%s: property \"%s.%s\" type mismatch\n",
+ __FUNCTION__, dev->info->name, name);
+ abort();
+ }
+ dst = qdev_get_prop_ptr(dev, prop);
+ memcpy(dst, src, prop->info->size);
+}
+
+void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value)
+{
+ qdev_prop_set(dev, name, &value, PROP_TYPE_UINT16);
+}
+
+void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value)
+{
+ qdev_prop_set(dev, name, &value, PROP_TYPE_UINT32);
+}
+
+void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value)
+{
+ qdev_prop_set(dev, name, &value, PROP_TYPE_PTR);
+}
+
+void qdev_prop_set_defaults(DeviceState *dev, Property *props)
+{
+ char *dst;
+
+ if (!props)
+ return;
+ while (props->name) {
+ if (props->defval) {
+ dst = qdev_get_prop_ptr(dev, props);
+ memcpy(dst, props->defval, props->info->size);
+ }
+ props++;
+ }
+}
+
+static CompatProperty *compat_props;
+
+void qdev_prop_register_compat(CompatProperty *props)
+{
+ compat_props = props;
+}
+
+void qdev_prop_set_compat(DeviceState *dev)
+{
+ CompatProperty *prop;
+
+ if (!compat_props) {
+ return;
+ }
+ for (prop = compat_props; prop->driver != NULL; prop++) {
+ if (strcmp(dev->info->name, prop->driver) != 0) {
+ continue;
+ }
+ if (qdev_prop_parse(dev, prop->property, prop->value) != 0) {
+ abort();
+ }
+ }
+}
diff --git a/hw/qdev.c b/hw/qdev.c
index 83e98bf3e..001c74ce0 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* The theory here is that it should be possible to create a machine without
@@ -31,16 +30,6 @@
#include "sysemu.h"
#include "monitor.h"
-struct DeviceProperty {
- const char *name;
- DevicePropType type;
- union {
- uint64_t i;
- void *ptr;
- } value;
- DeviceProperty *next;
-};
-
/* This is a nasty hack to allow passing a NULL bus to qdev_create. */
static BusState *main_system_bus;
extern struct BusInfo system_bus_info;
@@ -57,6 +46,32 @@ void qdev_register(DeviceInfo *info)
device_info_list = info;
}
+static DeviceInfo *qdev_find_info(BusInfo *bus_info, const char *name)
+{
+ DeviceInfo *info;
+
+ /* first check device names */
+ for (info = device_info_list; info != NULL; info = info->next) {
+ if (bus_info && info->bus_info != bus_info)
+ continue;
+ if (strcmp(info->name, name) != 0)
+ continue;
+ return info;
+ }
+
+ /* failing that check the aliases */
+ for (info = device_info_list; info != NULL; info = info->next) {
+ if (bus_info && info->bus_info != bus_info)
+ continue;
+ if (!info->alias)
+ continue;
+ if (strcmp(info->alias, name) != 0)
+ continue;
+ return info;
+ }
+ return NULL;
+}
+
/* Create a new device. This only initializes the device state structure
and allows properties to be set. qdev_init should be called to
initialize the actual device emulation. */
@@ -72,13 +87,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
bus = main_system_bus;
}
- for (info = device_info_list; info != NULL; info = info->next) {
- if (info->bus_info != bus->info)
- continue;
- if (strcmp(info->name, name) != 0)
- continue;
- break;
- }
+ info = qdev_find_info(bus->info, name);
if (!info) {
hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);
}
@@ -86,6 +95,9 @@ DeviceState *qdev_create(BusState *bus, const char *name)
dev = qemu_mallocz(info->size);
dev->info = info;
dev->parent_bus = bus;
+ qdev_prop_set_defaults(dev, dev->info->props);
+ qdev_prop_set_defaults(dev, dev->parent_bus->info->props);
+ qdev_prop_set_compat(dev);
LIST_INSERT_HEAD(&bus->children, dev, sibling);
return dev;
}
@@ -102,55 +114,10 @@ void qdev_init(DeviceState *dev)
void qdev_free(DeviceState *dev)
{
LIST_REMOVE(dev, sibling);
- free(dev);
-}
-
-static DeviceProperty *create_prop(DeviceState *dev, const char *name,
- DevicePropType type)
-{
- DeviceProperty *prop;
-
- /* TODO: Check for duplicate properties. */
- prop = qemu_mallocz(sizeof(*prop));
- prop->name = qemu_strdup(name);
- prop->type = type;
- prop->next = dev->props;
- dev->props = prop;
-
- return prop;
-}
-
-void qdev_set_prop_int(DeviceState *dev, const char *name, uint64_t value)
-{
- DeviceProperty *prop;
-
- prop = create_prop(dev, name, PROP_TYPE_INT);
- prop->value.i = value;
-}
-
-void qdev_set_prop_dev(DeviceState *dev, const char *name, DeviceState *value)
-{
- DeviceProperty *prop;
-
- prop = create_prop(dev, name, PROP_TYPE_DEV);
- prop->value.ptr = value;
-}
-
-void qdev_set_prop_ptr(DeviceState *dev, const char *name, void *value)
-{
- DeviceProperty *prop;
-
- prop = create_prop(dev, name, PROP_TYPE_PTR);
- prop->value.ptr = value;
-}
-
-void qdev_set_netdev(DeviceState *dev, NICInfo *nd)
-{
- assert(!dev->nd);
- dev->nd = nd;
+ qemu_free(dev->id);
+ qemu_free(dev);
}
-
/* Get a character (serial) device interface. */
CharDriverState *qdev_init_chardev(DeviceState *dev)
{
@@ -169,52 +136,6 @@ BusState *qdev_get_parent_bus(DeviceState *dev)
return dev->parent_bus;
}
-static DeviceProperty *find_prop(DeviceState *dev, const char *name,
- DevicePropType type)
-{
- DeviceProperty *prop;
-
- for (prop = dev->props; prop; prop = prop->next) {
- if (strcmp(prop->name, name) == 0) {
- assert (prop->type == type);
- return prop;
- }
- }
- return NULL;
-}
-
-uint64_t qdev_get_prop_int(DeviceState *dev, const char *name, uint64_t def)
-{
- DeviceProperty *prop;
-
- prop = find_prop(dev, name, PROP_TYPE_INT);
- if (!prop) {
- return def;
- }
-
- return prop->value.i;
-}
-
-void *qdev_get_prop_ptr(DeviceState *dev, const char *name)
-{
- DeviceProperty *prop;
-
- prop = find_prop(dev, name, PROP_TYPE_PTR);
- assert(prop);
- return prop->value.ptr;
-}
-
-DeviceState *qdev_get_prop_dev(DeviceState *dev, const char *name)
-{
- DeviceProperty *prop;
-
- prop = find_prop(dev, name, PROP_TYPE_DEV);
- if (!prop) {
- return NULL;
- }
- return prop->value.ptr;
-}
-
void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n)
{
assert(dev->num_gpio_in == 0);
@@ -327,11 +248,27 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
#define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__)
static void qbus_print(Monitor *mon, BusState *bus, int indent);
+static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
+ const char *prefix, int indent)
+{
+ char buf[64];
+
+ if (!props)
+ return;
+ while (props->name) {
+ if (props->info->print) {
+ props->info->print(dev, props, buf, sizeof(buf));
+ qdev_printf("%s-prop: %s = %s\n", prefix, props->name, buf);
+ }
+ props++;
+ }
+}
+
static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
{
- DeviceProperty *prop;
BusState *child;
- qdev_printf("dev: %s\n", dev->info->name);
+ qdev_printf("dev: %s, id \"%s\"\n", dev->info->name,
+ dev->id ? dev->id : "");
indent += 2;
if (dev->num_gpio_in) {
qdev_printf("gpio-in %d\n", dev->num_gpio_in);
@@ -339,24 +276,8 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
if (dev->num_gpio_out) {
qdev_printf("gpio-out %d\n", dev->num_gpio_out);
}
- for (prop = dev->props; prop; prop = prop->next) {
- switch (prop->type) {
- case PROP_TYPE_INT:
- qdev_printf("prop-int %s 0x%" PRIx64 "\n", prop->name,
- prop->value.i);
- break;
- case PROP_TYPE_PTR:
- qdev_printf("prop-ptr %s\n", prop->name);
- break;
- case PROP_TYPE_DEV:
- qdev_printf("prop-dev %s %s\n", prop->name,
- ((DeviceState *)prop->value.ptr)->info->name);
- break;
- default:
- qdev_printf("prop-unknown%d %s\n", prop->type, prop->name);
- break;
- }
- }
+ qdev_print_props(mon, dev, dev->info->props, "dev", indent);
+ qdev_print_props(mon, dev, dev->parent_bus->info->props, "bus", indent);
if (dev->parent_bus->info->print_dev)
dev->parent_bus->info->print_dev(mon, dev, indent);
LIST_FOREACH(child, &dev->child_bus, sibling) {
diff --git a/hw/qdev.h b/hw/qdev.h
index b18dbf91d..11744fa53 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -4,9 +4,13 @@
#include "hw.h"
#include "sys-queue.h"
-typedef struct DeviceInfo DeviceInfo;
+typedef struct Property Property;
+
+typedef struct PropertyInfo PropertyInfo;
-typedef struct DeviceProperty DeviceProperty;
+typedef struct CompatProperty CompatProperty;
+
+typedef struct DeviceInfo DeviceInfo;
typedef struct BusState BusState;
@@ -15,9 +19,9 @@ typedef struct BusInfo BusInfo;
/* This structure should not be accessed directly. We declare it here
so that it can be embedded in individual device state structures. */
struct DeviceState {
+ char *id;
DeviceInfo *info;
BusState *parent_bus;
- DeviceProperty *props;
int num_gpio_out;
qemu_irq *gpio_out;
int num_gpio_in;
@@ -32,6 +36,7 @@ struct BusInfo {
const char *name;
size_t size;
bus_dev_printfn print_dev;
+ Property *props;
};
struct BusState {
@@ -42,18 +47,42 @@ struct BusState {
LIST_ENTRY(BusState) sibling;
};
+struct Property {
+ const char *name;
+ PropertyInfo *info;
+ int offset;
+ void *defval;
+};
+
+enum PropertyType {
+ PROP_TYPE_UNSPEC = 0,
+ PROP_TYPE_UINT16,
+ PROP_TYPE_UINT32,
+ PROP_TYPE_TADDR,
+ PROP_TYPE_MACADDR,
+ PROP_TYPE_PTR,
+};
+
+struct PropertyInfo {
+ const char *name;
+ size_t size;
+ enum PropertyType type;
+ int (*parse)(DeviceState *dev, Property *prop, const char *str);
+ int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
+};
+
+struct CompatProperty {
+ const char *driver;
+ const char *property;
+ const char *value;
+};
+
/*** Board API. This should go away once we have a machine config file. ***/
DeviceState *qdev_create(BusState *bus, const char *name);
void qdev_init(DeviceState *dev);
void qdev_free(DeviceState *dev);
-/* Set properties between creation and init. */
-void qdev_set_prop_int(DeviceState *dev, const char *name, uint64_t value);
-void qdev_set_prop_dev(DeviceState *dev, const char *name, DeviceState *value);
-void qdev_set_prop_ptr(DeviceState *dev, const char *name, void *value);
-void qdev_set_netdev(DeviceState *dev, NICInfo *nd);
-
qemu_irq qdev_get_gpio_in(DeviceState *dev, int n);
void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
@@ -61,25 +90,17 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name);
/*** Device API. ***/
-typedef enum {
- PROP_TYPE_INT,
- PROP_TYPE_PTR,
- PROP_TYPE_DEV
-} DevicePropType;
-
-typedef struct {
- const char *name;
- DevicePropType type;
-} DevicePropList;
-
typedef void (*qdev_initfn)(DeviceState *dev, DeviceInfo *info);
typedef void (*SCSIAttachFn)(DeviceState *host, BlockDriverState *bdrv,
int unit);
struct DeviceInfo {
const char *name;
+ const char *alias;
+ const char *desc;
size_t size;
- DevicePropList *props;
+ Property *props;
+ int no_user;
/* Private to qdev / bus. */
qdev_initfn init;
@@ -99,10 +120,6 @@ void scsi_bus_new(DeviceState *host, SCSIAttachFn attach);
CharDriverState *qdev_init_chardev(DeviceState *dev);
BusState *qdev_get_parent_bus(DeviceState *dev);
-uint64_t qdev_get_prop_int(DeviceState *dev, const char *name, uint64_t def);
-DeviceState *qdev_get_prop_dev(DeviceState *dev, const char *name);
-/* FIXME: Remove opaque pointer properties. */
-void *qdev_get_prop_ptr(DeviceState *dev, const char *name);
/* Convery from a base type to a parent type, with compile time checking. */
#ifdef __GNUC__
@@ -124,4 +141,25 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name);
void do_info_qtree(Monitor *mon);
+/*** qdev-properties.c ***/
+
+extern PropertyInfo qdev_prop_uint16;
+extern PropertyInfo qdev_prop_uint32;
+extern PropertyInfo qdev_prop_hex32;
+extern PropertyInfo qdev_prop_ptr;
+extern PropertyInfo qdev_prop_macaddr;
+
+/* Set properties between creation and init. */
+void *qdev_get_prop_ptr(DeviceState *dev, Property *prop);
+int qdev_prop_parse(DeviceState *dev, const char *name, const char *value);
+void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type);
+void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value);
+void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value);
+/* FIXME: Remove opaque pointer properties. */
+void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value);
+void qdev_prop_set_defaults(DeviceState *dev, Property *props);
+
+void qdev_prop_register_compat(CompatProperty *props);
+void qdev_prop_set_compat(DeviceState *dev);
+
#endif
diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c
index a46d926eb..188511e84 100644
--- a/hw/slavio_intctl.c
+++ b/hw/slavio_intctl.c
@@ -21,9 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "hw.h"
+
#include "sun4m.h"
#include "monitor.h"
+#include "sysbus.h"
//#define DEBUG_IRQ_COUNT
//#define DEBUG_IRQ
@@ -49,28 +50,30 @@
#define MAX_CPUS 16
#define MAX_PILS 16
-struct SLAVIO_CPUINTCTLState;
+struct SLAVIO_INTCTLState;
+
+typedef struct SLAVIO_CPUINTCTLState {
+ uint32_t intreg_pending;
+ struct SLAVIO_INTCTLState *master;
+ uint32_t cpu;
+} SLAVIO_CPUINTCTLState;
typedef struct SLAVIO_INTCTLState {
+ SysBusDevice busdev;
uint32_t intregm_pending;
uint32_t intregm_disabled;
uint32_t target_cpu;
#ifdef DEBUG_IRQ_COUNT
uint64_t irq_count[32];
#endif
- qemu_irq *cpu_irqs[MAX_CPUS];
+ qemu_irq cpu_irqs[MAX_CPUS][MAX_PILS];
const uint32_t *intbit_to_level;
uint32_t cputimer_lbit, cputimer_mbit;
+ uint32_t cputimer_bit;
uint32_t pil_out[MAX_CPUS];
- struct SLAVIO_CPUINTCTLState *slaves[MAX_CPUS];
+ SLAVIO_CPUINTCTLState slaves[MAX_CPUS];
} SLAVIO_INTCTLState;
-typedef struct SLAVIO_CPUINTCTLState {
- uint32_t intreg_pending;
- SLAVIO_INTCTLState *master;
- uint32_t cpu;
-} SLAVIO_CPUINTCTLState;
-
#define INTCTL_MAXADDR 0xf
#define INTCTL_SIZE (INTCTL_MAXADDR + 1)
#define INTCTLM_SIZE 0x14
@@ -225,7 +228,7 @@ void slavio_pic_info(Monitor *mon, void *opaque)
for (i = 0; i < MAX_CPUS; i++) {
monitor_printf(mon, "per-cpu %d: pending 0x%08x\n", i,
- s->slaves[i]->intreg_pending);
+ s->slaves[i].intreg_pending);
}
monitor_printf(mon, "master: pending 0x%08x, disabled 0x%08x\n",
s->intregm_pending, s->intregm_disabled);
@@ -266,7 +269,7 @@ static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
pil_pending |= 1 << s->intbit_to_level[j];
}
}
- pil_pending |= (s->slaves[i]->intreg_pending & CPU_SOFTIRQ_MASK) >> 16;
+ pil_pending |= (s->slaves[i].intreg_pending & CPU_SOFTIRQ_MASK) >> 16;
if (set_irqs) {
for (j = 0; j < MAX_PILS; j++) {
@@ -303,10 +306,10 @@ static void slavio_set_irq(void *opaque, int irq, int level)
s->irq_count[pil]++;
#endif
s->intregm_pending |= mask;
- s->slaves[s->target_cpu]->intreg_pending |= 1 << pil;
+ s->slaves[s->target_cpu].intreg_pending |= 1 << pil;
} else {
s->intregm_pending &= ~mask;
- s->slaves[s->target_cpu]->intreg_pending &= ~(1 << pil);
+ s->slaves[s->target_cpu].intreg_pending &= ~(1 << pil);
}
slavio_check_interrupts(s, 1);
}
@@ -320,22 +323,31 @@ static void slavio_set_timer_irq_cpu(void *opaque, int cpu, int level)
if (level) {
s->intregm_pending |= s->cputimer_mbit;
- s->slaves[cpu]->intreg_pending |= s->cputimer_lbit;
+ s->slaves[cpu].intreg_pending |= s->cputimer_lbit;
} else {
s->intregm_pending &= ~s->cputimer_mbit;
- s->slaves[cpu]->intreg_pending &= ~s->cputimer_lbit;
+ s->slaves[cpu].intreg_pending &= ~s->cputimer_lbit;
}
slavio_check_interrupts(s, 1);
}
+static void slavio_set_irq_all(void *opaque, int irq, int level)
+{
+ if (irq < 32) {
+ slavio_set_irq(opaque, irq, level);
+ } else {
+ slavio_set_timer_irq_cpu(opaque, irq - 32, level);
+ }
+}
+
static void slavio_intctl_save(QEMUFile *f, void *opaque)
{
SLAVIO_INTCTLState *s = opaque;
int i;
for (i = 0; i < MAX_CPUS; i++) {
- qemu_put_be32s(f, &s->slaves[i]->intreg_pending);
+ qemu_put_be32s(f, &s->slaves[i].intreg_pending);
}
qemu_put_be32s(f, &s->intregm_pending);
qemu_put_be32s(f, &s->intregm_disabled);
@@ -351,7 +363,7 @@ static int slavio_intctl_load(QEMUFile *f, void *opaque, int version_id)
return -EINVAL;
for (i = 0; i < MAX_CPUS; i++) {
- qemu_get_be32s(f, &s->slaves[i]->intreg_pending);
+ qemu_get_be32s(f, &s->slaves[i].intreg_pending);
}
qemu_get_be32s(f, &s->intregm_pending);
qemu_get_be32s(f, &s->intregm_disabled);
@@ -366,7 +378,7 @@ static void slavio_intctl_reset(void *opaque)
int i;
for (i = 0; i < MAX_CPUS; i++) {
- s->slaves[i]->intreg_pending = 0;
+ s->slaves[i].intreg_pending = 0;
}
s->intregm_disabled = ~MASTER_IRQ_MASK;
s->intregm_pending = 0;
@@ -374,47 +386,87 @@ static void slavio_intctl_reset(void *opaque)
slavio_check_interrupts(s, 0);
}
-void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,
- const uint32_t *intbit_to_level,
- qemu_irq **irq, qemu_irq **cpu_irq,
- qemu_irq **parent_irq, unsigned int cputimer)
+static void slavio_intctl_init1(SysBusDevice *dev)
{
- int slavio_intctl_io_memory, slavio_intctlm_io_memory, i;
- SLAVIO_INTCTLState *s;
- SLAVIO_CPUINTCTLState *slave;
+ SLAVIO_INTCTLState *s = FROM_SYSBUS(SLAVIO_INTCTLState, dev);
+ int io_memory;
+ unsigned int i, j;
- s = qemu_mallocz(sizeof(SLAVIO_INTCTLState));
+ qdev_init_gpio_in(&dev->qdev, slavio_set_irq_all, 32 + MAX_CPUS);
+ io_memory = cpu_register_io_memory(slavio_intctlm_mem_read,
+ slavio_intctlm_mem_write, s);
+ sysbus_init_mmio(dev, INTCTLM_SIZE, io_memory);
+ s->cputimer_mbit = 1 << s->cputimer_bit;
+ s->cputimer_lbit = 1 << s->intbit_to_level[s->cputimer_bit];
- s->intbit_to_level = intbit_to_level;
for (i = 0; i < MAX_CPUS; i++) {
- slave = qemu_mallocz(sizeof(SLAVIO_CPUINTCTLState));
+ for (j = 0; j < MAX_PILS; j++) {
+ sysbus_init_irq(dev, &s->cpu_irqs[i][j]);
+ }
+ io_memory = cpu_register_io_memory(slavio_intctl_mem_read,
+ slavio_intctl_mem_write,
+ &s->slaves[i]);
+ sysbus_init_mmio(dev, INTCTL_SIZE, io_memory);
+ s->slaves[i].cpu = i;
+ s->slaves[i].master = s;
+ }
+ register_savevm("slavio_intctl", -1, 1, slavio_intctl_save,
+ slavio_intctl_load, s);
+ qemu_register_reset(slavio_intctl_reset, s);
+ slavio_intctl_reset(s);
+}
+
+DeviceState *slavio_intctl_init(target_phys_addr_t addr,
+ target_phys_addr_t addrg,
+ const uint32_t *intbit_to_level,
+ qemu_irq **parent_irq, unsigned int cputimer)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+ unsigned int i, j;
- slave->cpu = i;
- slave->master = s;
+ dev = qdev_create(NULL, "slavio_intctl");
+ qdev_prop_set_ptr(dev, "intbit_to_level", (void *)intbit_to_level);
+ qdev_prop_set_uint32(dev, "cputimer_bit", cputimer);
+ qdev_init(dev);
- slavio_intctl_io_memory = cpu_register_io_memory(slavio_intctl_mem_read,
- slavio_intctl_mem_write,
- slave);
- cpu_register_physical_memory(addr + i * TARGET_PAGE_SIZE, INTCTL_SIZE,
- slavio_intctl_io_memory);
+ s = sysbus_from_qdev(dev);
- s->slaves[i] = slave;
- s->cpu_irqs[i] = parent_irq[i];
+ for (i = 0; i < MAX_CPUS; i++) {
+ for (j = 0; j < MAX_PILS; j++) {
+ sysbus_connect_irq(s, i * MAX_PILS + j, parent_irq[i][j]);
+ }
+ }
+ sysbus_mmio_map(s, 0, addrg);
+ for (i = 0; i < MAX_CPUS; i++) {
+ sysbus_mmio_map(s, i + 1, addr + i * TARGET_PAGE_SIZE);
}
- slavio_intctlm_io_memory = cpu_register_io_memory(slavio_intctlm_mem_read,
- slavio_intctlm_mem_write,
- s);
- cpu_register_physical_memory(addrg, INTCTLM_SIZE, slavio_intctlm_io_memory);
+ return dev;
+}
- register_savevm("slavio_intctl", addr, 1, slavio_intctl_save,
- slavio_intctl_load, s);
- qemu_register_reset(slavio_intctl_reset, s);
- *irq = qemu_allocate_irqs(slavio_set_irq, s, 32);
+static SysBusDeviceInfo slavio_intctl_info = {
+ .init = slavio_intctl_init1,
+ .qdev.name = "slavio_intctl",
+ .qdev.size = sizeof(SLAVIO_INTCTLState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "intbit_to_level",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SLAVIO_INTCTLState, intbit_to_level),
+ },
+ {
+ .name = "cputimer_bit",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SLAVIO_INTCTLState, cputimer_bit),
+ },
+ {/* end of property list */}
+ }
+};
- *cpu_irq = qemu_allocate_irqs(slavio_set_timer_irq_cpu, s, MAX_CPUS);
- s->cputimer_mbit = 1 << cputimer;
- s->cputimer_lbit = 1 << intbit_to_level[cputimer];
- slavio_intctl_reset(s);
- return s;
+static void slavio_intctl_register_devices(void)
+{
+ sysbus_register_withprop(&slavio_intctl_info);
}
+
+device_init(slavio_intctl_register_devices)
diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c
index 3d246eea2..23012a36d 100644
--- a/hw/slavio_misc.c
+++ b/hw/slavio_misc.c
@@ -564,18 +564,12 @@ static SysBusDeviceInfo slavio_misc_info = {
.init = slavio_misc_init1,
.qdev.name = "slavio_misc",
.qdev.size = sizeof(MiscState),
- .qdev.props = (DevicePropList[]) {
- {.name = NULL}
- }
};
static SysBusDeviceInfo apc_info = {
.init = apc_init1,
.qdev.name = "apc",
.qdev.size = sizeof(MiscState),
- .qdev.props = (DevicePropList[]) {
- {.name = NULL}
- }
};
static void slavio_misc_register_devices(void)
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c
index df9afb0ee..21924f871 100644
--- a/hw/slavio_timer.c
+++ b/hw/slavio_timer.c
@@ -374,9 +374,9 @@ static SLAVIO_TIMERState *slavio_timer_init(target_phys_addr_t addr,
SLAVIO_TIMERState *d;
dev = qdev_create(NULL, "slavio_timer");
- qdev_set_prop_int(dev, "slave_index", slave_index);
- qdev_set_prop_int(dev, "num_slaves", num_slaves);
- qdev_set_prop_ptr(dev, "master", master);
+ qdev_prop_set_uint32(dev, "slave_index", slave_index);
+ qdev_prop_set_uint32(dev, "num_slaves", num_slaves);
+ qdev_prop_set_ptr(dev, "master", master);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -394,9 +394,6 @@ static void slavio_timer_init1(SysBusDevice *dev)
QEMUBH *bh;
sysbus_init_irq(dev, &s->irq);
- s->num_slaves = qdev_get_prop_int(&dev->qdev, "num_slaves", 0);
- s->slave_index = qdev_get_prop_int(&dev->qdev, "slave_index", 0);
- s->master = qdev_get_prop_ptr(&dev->qdev, "master");
if (!s->master || s->slave_index < s->master->num_slaves) {
bh = qemu_bh_new(slavio_timer_irq, s);
@@ -438,11 +435,23 @@ static SysBusDeviceInfo slavio_timer_info = {
.init = slavio_timer_init1,
.qdev.name = "slavio_timer",
.qdev.size = sizeof(SLAVIO_TIMERState),
- .qdev.props = (DevicePropList[]) {
- {.name = "num_slaves", .type = PROP_TYPE_INT},
- {.name = "slave_index", .type = PROP_TYPE_INT},
- {.name = "master", .type = PROP_TYPE_PTR},
- {.name = NULL}
+ .qdev.props = (Property[]) {
+ {
+ .name = "num_slaves",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SLAVIO_TIMERState, num_slaves),
+ },
+ {
+ .name = "slave_index",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SLAVIO_TIMERState, slave_index),
+ },
+ {
+ .name = "master",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SLAVIO_TIMERState, master),
+ },
+ {/* end of property list */}
}
};
diff --git a/hw/smbus_eeprom.c b/hw/smbus_eeprom.c
index 05a70d9b1..c071fb1e1 100644
--- a/hw/smbus_eeprom.c
+++ b/hw/smbus_eeprom.c
@@ -99,14 +99,20 @@ static void smbus_eeprom_init(SMBusDevice *dev)
{
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *)dev;
- /* FIXME: Should be a blob rather than a ptr. */
- eeprom->data = qdev_get_prop_ptr(&dev->i2c.qdev, "data");
eeprom->offset = 0;
}
static SMBusDeviceInfo smbus_eeprom_info = {
.i2c.qdev.name = "smbus-eeprom",
.i2c.qdev.size = sizeof(SMBusEEPROMDevice),
+ .i2c.qdev.props = (Property[]) {
+ {
+ .name = "data",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(SMBusEEPROMDevice, data),
+ },
+ {/* end of list */}
+ },
.init = smbus_eeprom_init,
.quick_cmd = eeprom_quick_cmd,
.send_byte = eeprom_send_byte,
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index cf8d864e5..5f6956a66 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -733,7 +733,7 @@ void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
qemu_check_nic_model(nd, "smc91c111");
dev = qdev_create(NULL, "smc91c111");
- qdev_set_netdev(dev, nd);
+ dev->nd = nd;
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, base);
diff --git a/hw/soc_dma.c b/hw/soc_dma.c
index 2967b5223..e116e6373 100644
--- a/hw/soc_dma.c
+++ b/hw/soc_dma.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
#include "qemu-timer.h"
diff --git a/hw/soc_dma.h b/hw/soc_dma.h
index 34b01d909..c0ebb8d71 100644
--- a/hw/soc_dma.h
+++ b/hw/soc_dma.h
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
struct soc_dma_s;
diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c
index a0678b5db..7633905af 100644
--- a/hw/sparc32_dma.c
+++ b/hw/sparc32_dma.c
@@ -252,7 +252,7 @@ void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
DMAState *d;
dev = qdev_create(NULL, "sparc32_dma");
- qdev_set_prop_ptr(dev, "iommu_opaque", iommu);
+ qdev_prop_set_ptr(dev, "iommu_opaque", iommu);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, parent_irq);
@@ -271,7 +271,6 @@ static void sparc32_dma_init1(SysBusDevice *dev)
int dma_io_memory;
sysbus_init_irq(dev, &s->irq);
- s->iommu = qdev_get_prop_ptr(&dev->qdev, "iommu_opaque");
dma_io_memory = cpu_register_io_memory(dma_mem_read, dma_mem_write, s);
sysbus_init_mmio(dev, DMA_SIZE, dma_io_memory);
@@ -286,9 +285,13 @@ static SysBusDeviceInfo sparc32_dma_info = {
.init = sparc32_dma_init1,
.qdev.name = "sparc32_dma",
.qdev.size = sizeof(DMAState),
- .qdev.props = (DevicePropList[]) {
- {.name = "iommu_opaque", .type = PROP_TYPE_PTR},
- {.name = NULL}
+ .qdev.props = (Property[]) {
+ {
+ .name = "iommu_opaque",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(DMAState, iommu),
+ },
+ {/* end of property list */}
}
};
diff --git a/hw/stellaris.c b/hw/stellaris.c
index 5f44bff5d..d9434ca29 100644
--- a/hw/stellaris.c
+++ b/hw/stellaris.c
@@ -1378,7 +1378,7 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
qemu_check_nic_model(&nd_table[0], "stellaris");
enet = qdev_create(NULL, "stellaris_enet");
- qdev_set_netdev(enet, &nd_table[0]);
+ enet->nd = &nd_table[0];
qdev_init(enet);
sysbus_mmio_map(sysbus_from_qdev(enet), 0, 0x40048000);
sysbus_connect_irq(sysbus_from_qdev(enet), 0, pic[42]);
diff --git a/hw/sun4m.c b/hw/sun4m.c
index f9ef29851..4954ba37d 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -373,8 +373,7 @@ static void lance_init(NICInfo *nd, target_phys_addr_t leaddr,
qemu_check_nic_model(&nd_table[0], "lance");
dev = qdev_create(NULL, "lance");
- qdev_set_netdev(dev, nd);
- qdev_set_prop_ptr(dev, "dma", dma_opaque);
+ dev->nd = nd;
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, leaddr);
@@ -410,9 +409,6 @@ static SysBusDeviceInfo idreg_info = {
.init = idreg_init1,
.qdev.name = "macio_idreg",
.qdev.size = sizeof(SysBusDevice),
- .qdev.props = (DevicePropList[]) {
- {.name = NULL}
- }
};
static void idreg_register_devices(void)
@@ -422,100 +418,202 @@ static void idreg_register_devices(void)
device_init(idreg_register_devices);
+/* Boot PROM (OpenBIOS) */
+static void prom_init(target_phys_addr_t addr, const char *bios_name)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+ char *filename;
+ int ret;
+
+ dev = qdev_create(NULL, "openprom");
+ qdev_init(dev);
+ s = sysbus_from_qdev(dev);
+
+ sysbus_mmio_map(s, 0, addr);
+
+ /* load boot prom */
+ if (bios_name == NULL) {
+ bios_name = PROM_FILENAME;
+ }
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ if (filename) {
+ ret = load_elf(filename, addr - PROM_VADDR, NULL, NULL, NULL);
+ if (ret < 0 || ret > PROM_SIZE_MAX) {
+ ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
+ }
+ qemu_free(filename);
+ } else {
+ ret = -1;
+ }
+ if (ret < 0 || ret > PROM_SIZE_MAX) {
+ fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name);
+ exit(1);
+ }
+}
+
+static void prom_init1(SysBusDevice *dev)
+{
+ ram_addr_t prom_offset;
+
+ prom_offset = qemu_ram_alloc(PROM_SIZE_MAX);
+ sysbus_init_mmio(dev, PROM_SIZE_MAX, prom_offset | IO_MEM_ROM);
+}
+
+static SysBusDeviceInfo prom_info = {
+ .init = prom_init1,
+ .qdev.name = "openprom",
+ .qdev.size = sizeof(SysBusDevice),
+ .qdev.props = (Property[]) {
+ {/* end of property list */}
+ }
+};
+
+static void prom_register_devices(void)
+{
+ sysbus_register_withprop(&prom_info);
+}
+
+device_init(prom_register_devices);
+
+typedef struct RamDevice
+{
+ SysBusDevice busdev;
+ uint32_t size;
+} RamDevice;
+
+/* System RAM */
+static void ram_init1(SysBusDevice *dev)
+{
+ ram_addr_t RAM_size, ram_offset;
+ RamDevice *d = FROM_SYSBUS(RamDevice, dev);
+
+ RAM_size = d->size;
+
+ ram_offset = qemu_ram_alloc(RAM_size);
+ sysbus_init_mmio(dev, RAM_size, ram_offset);
+}
+
+static void ram_init(target_phys_addr_t addr, ram_addr_t RAM_size,
+ uint64_t max_mem)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+ RamDevice *d;
+
+ /* allocate RAM */
+ if ((uint64_t)RAM_size > max_mem) {
+ fprintf(stderr,
+ "qemu: Too much memory for this machine: %d, maximum %d\n",
+ (unsigned int)(RAM_size / (1024 * 1024)),
+ (unsigned int)(max_mem / (1024 * 1024)));
+ exit(1);
+ }
+ dev = qdev_create(NULL, "memory");
+ qdev_init(dev);
+ s = sysbus_from_qdev(dev);
+
+ d = FROM_SYSBUS(RamDevice, s);
+ d->size = RAM_size;
+
+ sysbus_mmio_map(s, 0, addr);
+}
+
+static SysBusDeviceInfo ram_info = {
+ .init = ram_init1,
+ .qdev.name = "memory",
+ .qdev.size = sizeof(RamDevice),
+ .qdev.props = (Property[]) {
+ {
+ .name = "size",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(RamDevice, size),
+ },
+ {/* end of property list */}
+ }
+};
+
+static void ram_register_devices(void)
+{
+ sysbus_register_withprop(&ram_info);
+}
+
+device_init(ram_register_devices);
+
+static CPUState *cpu_devinit(const char *cpu_model, unsigned int id,
+ uint64_t prom_addr, qemu_irq **cpu_irqs)
+{
+ CPUState *env;
+
+ env = cpu_init(cpu_model);
+ if (!env) {
+ fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
+ exit(1);
+ }
+
+ cpu_sparc_set_id(env, id);
+ if (id == 0) {
+ qemu_register_reset(main_cpu_reset, env);
+ } else {
+ qemu_register_reset(secondary_cpu_reset, env);
+ env->halted = 1;
+ }
+ *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, env, MAX_PILS);
+ env->prom_addr = prom_addr;
+
+ return env;
+}
+
static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
-
{
- CPUState *env, *envs[MAX_CPUS];
+ CPUState *envs[MAX_CPUS];
unsigned int i;
void *iommu, *espdma, *ledma, *nvram;
- qemu_irq *cpu_irqs[MAX_CPUS], *slavio_irq, *slavio_cpu_irq,
+ qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS],
espdma_irq, ledma_irq;
qemu_irq *esp_reset, *le_reset;
qemu_irq fdc_tc;
qemu_irq *cpu_halt;
- ram_addr_t ram_offset, prom_offset;
unsigned long kernel_size;
- int ret;
- char *filename;
BlockDriverState *fd[MAX_FD];
int drive_index;
void *fw_cfg;
+ DeviceState *dev;
/* init CPUs */
if (!cpu_model)
cpu_model = hwdef->default_cpu_model;
for(i = 0; i < smp_cpus; i++) {
- env = cpu_init(cpu_model);
- if (!env) {
- fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
- exit(1);
- }
- cpu_sparc_set_id(env, i);
- envs[i] = env;
- if (i == 0) {
- qemu_register_reset(main_cpu_reset, env);
- } else {
- qemu_register_reset(secondary_cpu_reset, env);
- env->halted = 1;
- }
- cpu_irqs[i] = qemu_allocate_irqs(cpu_set_irq, envs[i], MAX_PILS);
- env->prom_addr = hwdef->slavio_base;
+ envs[i] = cpu_devinit(cpu_model, i, hwdef->slavio_base, &cpu_irqs[i]);
}
for (i = smp_cpus; i < MAX_CPUS; i++)
cpu_irqs[i] = qemu_allocate_irqs(dummy_cpu_set_irq, NULL, MAX_PILS);
- /* allocate RAM */
- if ((uint64_t)RAM_size > hwdef->max_mem) {
- fprintf(stderr,
- "qemu: Too much memory for this machine: %d, maximum %d\n",
- (unsigned int)(RAM_size / (1024 * 1024)),
- (unsigned int)(hwdef->max_mem / (1024 * 1024)));
- exit(1);
- }
- ram_offset = qemu_ram_alloc(RAM_size);
- cpu_register_physical_memory(0, RAM_size, ram_offset);
+ /* set up devices */
+ ram_init(0, RAM_size, hwdef->max_mem);
- /* load boot prom */
- prom_offset = qemu_ram_alloc(PROM_SIZE_MAX);
- cpu_register_physical_memory(hwdef->slavio_base,
- (PROM_SIZE_MAX + TARGET_PAGE_SIZE - 1) &
- TARGET_PAGE_MASK,
- prom_offset | IO_MEM_ROM);
+ prom_init(hwdef->slavio_base, bios_name);
- if (bios_name == NULL)
- bios_name = PROM_FILENAME;
- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
- if (filename) {
- ret = load_elf(filename, hwdef->slavio_base - PROM_VADDR,
- NULL, NULL, NULL);
- if (ret < 0 || ret > PROM_SIZE_MAX)
- ret = load_image_targphys(filename, hwdef->slavio_base,
- PROM_SIZE_MAX);
- qemu_free(filename);
- } else {
- ret = -1;
+ dev = slavio_intctl_init(hwdef->intctl_base,
+ hwdef->intctl_base + 0x10000ULL,
+ &hwdef->intbit_to_level[0],
+ cpu_irqs,
+ hwdef->clock_irq);
+
+ for (i = 0; i < 32; i++) {
+ slavio_irq[i] = qdev_get_gpio_in(dev, i);
}
- if (ret < 0 || ret > PROM_SIZE_MAX) {
- fprintf(stderr, "qemu: could not load prom '%s'\n",
- bios_name);
- exit(1);
+ for (i = 0; i < MAX_CPUS; i++) {
+ slavio_cpu_irq[i] = qdev_get_gpio_in(dev, 32 + i);
}
- /* set up devices */
- slavio_intctl = slavio_intctl_init(hwdef->intctl_base,
- hwdef->intctl_base + 0x10000ULL,
- &hwdef->intbit_to_level[0],
- &slavio_irq, &slavio_cpu_irq,
- cpu_irqs,
- hwdef->clock_irq);
-
if (hwdef->idreg_base) {
idreg_init(hwdef->idreg_base);
}
@@ -580,8 +678,10 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
espdma_memory_read, espdma_memory_write,
espdma, espdma_irq, esp_reset);
- if (hwdef->cs_base)
- cs_init(hwdef->cs_base, hwdef->cs_irq, slavio_intctl);
+ if (hwdef->cs_base) {
+ sysbus_create_simple("SUNW,CS4231", hwdef->cs_base,
+ slavio_irq[hwdef->cs_irq]);
+ }
kernel_size = sun4m_load_kernel(kernel_filename, initrd_filename,
RAM_size);
@@ -1219,81 +1319,31 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
- CPUState *env, *envs[MAX_CPUS];
+ CPUState *envs[MAX_CPUS];
unsigned int i;
void *iounits[MAX_IOUNITS], *espdma, *ledma, *nvram, *sbi;
qemu_irq *cpu_irqs[MAX_CPUS], *sbi_irq, *sbi_cpu_irq,
espdma_irq, ledma_irq;
qemu_irq *esp_reset, *le_reset;
- ram_addr_t ram_offset, prom_offset;
unsigned long kernel_size;
- int ret;
- char *filename;
void *fw_cfg;
/* init CPUs */
if (!cpu_model)
cpu_model = hwdef->default_cpu_model;
- for (i = 0; i < smp_cpus; i++) {
- env = cpu_init(cpu_model);
- if (!env) {
- fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
- exit(1);
- }
- cpu_sparc_set_id(env, i);
- envs[i] = env;
- if (i == 0) {
- qemu_register_reset(main_cpu_reset, env);
- } else {
- qemu_register_reset(secondary_cpu_reset, env);
- env->halted = 1;
- }
- cpu_irqs[i] = qemu_allocate_irqs(cpu_set_irq, envs[i], MAX_PILS);
- env->prom_addr = hwdef->slavio_base;
+ for(i = 0; i < smp_cpus; i++) {
+ envs[i] = cpu_devinit(cpu_model, i, hwdef->slavio_base, &cpu_irqs[i]);
}
for (i = smp_cpus; i < MAX_CPUS; i++)
cpu_irqs[i] = qemu_allocate_irqs(dummy_cpu_set_irq, NULL, MAX_PILS);
- /* allocate RAM */
- if ((uint64_t)RAM_size > hwdef->max_mem) {
- fprintf(stderr,
- "qemu: Too much memory for this machine: %d, maximum %d\n",
- (unsigned int)(RAM_size / (1024 * 1024)),
- (unsigned int)(hwdef->max_mem / (1024 * 1024)));
- exit(1);
- }
- ram_offset = qemu_ram_alloc(RAM_size);
- cpu_register_physical_memory(0, RAM_size, ram_offset);
-
- /* load boot prom */
- prom_offset = qemu_ram_alloc(PROM_SIZE_MAX);
- cpu_register_physical_memory(hwdef->slavio_base,
- (PROM_SIZE_MAX + TARGET_PAGE_SIZE - 1) &
- TARGET_PAGE_MASK,
- prom_offset | IO_MEM_ROM);
+ /* set up devices */
+ ram_init(0, RAM_size, hwdef->max_mem);
- if (bios_name == NULL)
- bios_name = PROM_FILENAME;
- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
- if (filename) {
- ret = load_elf(filename, hwdef->slavio_base - PROM_VADDR,
- NULL, NULL, NULL);
- if (ret < 0 || ret > PROM_SIZE_MAX)
- ret = load_image_targphys(filename, hwdef->slavio_base,
- PROM_SIZE_MAX);
- qemu_free(filename);
- } else {
- ret = -1;
- }
- if (ret < 0 || ret > PROM_SIZE_MAX) {
- fprintf(stderr, "qemu: could not load prom '%s'\n",
- bios_name);
- exit(1);
- }
+ prom_init(hwdef->slavio_base, bios_name);
- /* set up devices */
sbi = sbi_init(hwdef->sbi_base, &sbi_irq, &sbi_cpu_irq, cpu_irqs);
for (i = 0; i < MAX_IOUNITS; i++)
@@ -1446,10 +1496,7 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
qemu_irq *cpu_irqs, *slavio_irq, espdma_irq, ledma_irq;
qemu_irq *esp_reset, *le_reset;
qemu_irq fdc_tc;
- ram_addr_t ram_offset, prom_offset;
unsigned long kernel_size;
- int ret;
- char *filename;
BlockDriverState *fd[MAX_FD];
int drive_index;
void *fw_cfg;
@@ -1458,56 +1505,13 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
if (!cpu_model)
cpu_model = hwdef->default_cpu_model;
- env = cpu_init(cpu_model);
- if (!env) {
- fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
- exit(1);
- }
-
- cpu_sparc_set_id(env, 0);
+ env = cpu_devinit(cpu_model, 0, hwdef->slavio_base, &cpu_irqs);
- qemu_register_reset(main_cpu_reset, env);
- cpu_irqs = qemu_allocate_irqs(cpu_set_irq, env, MAX_PILS);
- env->prom_addr = hwdef->slavio_base;
-
- /* allocate RAM */
- if ((uint64_t)RAM_size > hwdef->max_mem) {
- fprintf(stderr,
- "qemu: Too much memory for this machine: %d, maximum %d\n",
- (unsigned int)(RAM_size / (1024 * 1024)),
- (unsigned int)(hwdef->max_mem / (1024 * 1024)));
- exit(1);
- }
- ram_offset = qemu_ram_alloc(RAM_size);
- cpu_register_physical_memory(0, RAM_size, ram_offset);
+ /* set up devices */
+ ram_init(0, RAM_size, hwdef->max_mem);
- /* load boot prom */
- prom_offset = qemu_ram_alloc(PROM_SIZE_MAX);
- cpu_register_physical_memory(hwdef->slavio_base,
- (PROM_SIZE_MAX + TARGET_PAGE_SIZE - 1) &
- TARGET_PAGE_MASK,
- prom_offset | IO_MEM_ROM);
+ prom_init(hwdef->slavio_base, bios_name);
- if (bios_name == NULL)
- bios_name = PROM_FILENAME;
- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
- if (filename) {
- ret = load_elf(filename, hwdef->slavio_base - PROM_VADDR,
- NULL, NULL, NULL);
- if (ret < 0 || ret > PROM_SIZE_MAX)
- ret = load_image_targphys(filename, hwdef->slavio_base,
- PROM_SIZE_MAX);
- qemu_free(filename);
- } else {
- ret = -1;
- }
- if (ret < 0 || ret > PROM_SIZE_MAX) {
- fprintf(stderr, "qemu: could not load prom '%s'\n",
- filename);
- exit(1);
- }
-
- /* set up devices */
slavio_intctl = sun4c_intctl_init(hwdef->intctl_base,
&slavio_irq, cpu_irqs);
diff --git a/hw/sun4m.h b/hw/sun4m.h
index 1dda117d8..d818fb184 100644
--- a/hw/sun4m.h
+++ b/hw/sun4m.h
@@ -28,10 +28,10 @@ void tcx_init(target_phys_addr_t addr, int vram_size, int width, int height,
int depth);
/* slavio_intctl.c */
-void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,
- const uint32_t *intbit_to_level,
- qemu_irq **irq, qemu_irq **cpu_irq,
- qemu_irq **parent_irq, unsigned int cputimer);
+DeviceState *slavio_intctl_init(target_phys_addr_t addr,
+ target_phys_addr_t addrg,
+ const uint32_t *intbit_to_level,
+ qemu_irq **parent_irq, unsigned int cputimer);
void slavio_pic_info(Monitor *mon, void *opaque);
void slavio_irq_info(Monitor *mon, void *opaque);
@@ -57,9 +57,6 @@ void *slavio_misc_init(target_phys_addr_t base,
void slavio_set_power_fail(void *opaque, int power_failing);
void apc_init(target_phys_addr_t power_base, qemu_irq cpu_halt);
-/* cs4231.c */
-void cs_init(target_phys_addr_t base, int irq, void *intctl);
-
/* sparc32_dma.c */
#include "sparc32_dma.h"
diff --git a/hw/syborg.c b/hw/syborg.c
index 5ca9977b2..d8d38d48e 100644
--- a/hw/syborg.c
+++ b/hw/syborg.c
@@ -64,7 +64,7 @@ static void syborg_init(ram_addr_t ram_size,
sysbus_create_simple("syborg,rtc", 0xC0001000, NULL);
dev = qdev_create(NULL, "syborg,timer");
- qdev_set_prop_int(dev, "frequency", 1000000);
+ qdev_prop_set_uint32(dev, "frequency", 1000000);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0xC0002000);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, pic[1]);
@@ -83,7 +83,7 @@ static void syborg_init(ram_addr_t ram_size,
qemu_check_nic_model(&nd_table[0], "virtio");
dev = qdev_create(NULL, "syborg,virtio-net");
- qdev_set_netdev(dev, &nd_table[0]);
+ dev->nd = &nd_table[0];
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, 0xc000c000);
diff --git a/hw/syborg_fb.c b/hw/syborg_fb.c
index 42c62744c..2929ffd0b 100644
--- a/hw/syborg_fb.c
+++ b/hw/syborg_fb.c
@@ -76,8 +76,8 @@ typedef struct {
uint32_t base;
uint32_t pitch;
- int rows;
- int cols;
+ uint32_t rows;
+ uint32_t cols;
int blank;
int bpp;
int rgb; /* 0 = BGR, 1 = RGB */
@@ -507,41 +507,50 @@ static void syborg_fb_init(SysBusDevice *dev)
{
SyborgFBState *s = FROM_SYSBUS(SyborgFBState, dev);
int iomemtype;
- int width;
- int height;
sysbus_init_irq(dev, &s->irq);
iomemtype = cpu_register_io_memory(syborg_fb_readfn,
syborg_fb_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
- width = qdev_get_prop_int(&dev->qdev, "width", 0);
- height = qdev_get_prop_int(&dev->qdev, "height", 0);
-
s->ds = graphic_console_init(syborg_fb_update_display,
syborg_fb_invalidate_display,
NULL, NULL, s);
- if (width != 0 && height != 0) {
- qemu_console_resize(s->ds, width, height);
+ if (s->cols != 0 && s->rows != 0) {
+ qemu_console_resize(s->ds, s->cols, s->rows);
}
- if (!width)
- width = ds_get_width(s->ds);
- if (!height)
- height = ds_get_height(s->ds);
-
- s->cols = width;
- s->rows = height;
+ if (!s->cols)
+ s->cols = ds_get_width(s->ds);
+ if (!s->rows)
+ s->rows = ds_get_height(s->ds);
register_savevm("syborg_framebuffer", -1, 1,
syborg_fb_save, syborg_fb_load, s);
}
+static SysBusDeviceInfo syborg_fb_info = {
+ .init = syborg_fb_init,
+ .qdev.name = "syborg,framebuffer",
+ .qdev.size = sizeof(SyborgFBState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "width",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgFBState, cols),
+ },{
+ .name = "height",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgFBState, rows),
+ },
+ {/* end of list */}
+ }
+};
+
static void syborg_fb_register_devices(void)
{
- sysbus_register_dev("syborg,framebuffer", sizeof(SyborgFBState),
- syborg_fb_init);
+ sysbus_register_withprop(&syborg_fb_info);
}
device_init(syborg_fb_register_devices)
diff --git a/hw/syborg_interrupt.c b/hw/syborg_interrupt.c
index 569c7f61c..a372ec1dd 100644
--- a/hw/syborg_interrupt.c
+++ b/hw/syborg_interrupt.c
@@ -56,7 +56,7 @@ typedef struct {
typedef struct {
SysBusDevice busdev;
int pending_count;
- int num_irqs;
+ uint32_t num_irqs;
syborg_int_flags *flags;
qemu_irq parent_irq;
} SyborgIntState;
@@ -208,7 +208,6 @@ static void syborg_int_init(SysBusDevice *dev)
int iomemtype;
sysbus_init_irq(dev, &s->parent_irq);
- s->num_irqs = qdev_get_prop_int(&dev->qdev, "num-interrupts", 64);
qdev_init_gpio_in(&dev->qdev, syborg_int_set_irq, s->num_irqs);
iomemtype = cpu_register_io_memory(syborg_int_readfn,
syborg_int_writefn, s);
@@ -218,10 +217,24 @@ static void syborg_int_init(SysBusDevice *dev)
register_savevm("syborg_int", -1, 1, syborg_int_save, syborg_int_load, s);
}
+static SysBusDeviceInfo syborg_int_info = {
+ .init = syborg_int_init,
+ .qdev.name = "syborg,interrupt",
+ .qdev.size = sizeof(SyborgIntState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "num-interrupts",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgIntState, num_irqs),
+ .defval = (uint32_t[]) { 64 },
+ },
+ {/* end of list */}
+ }
+};
+
static void syborg_interrupt_register_devices(void)
{
- sysbus_register_dev("syborg,interrupt", sizeof(SyborgIntState),
- syborg_int_init);
+ sysbus_register_withprop(&syborg_int_info);
}
device_init(syborg_interrupt_register_devices)
diff --git a/hw/syborg_keyboard.c b/hw/syborg_keyboard.c
index 84a099ed0..ffc85a56a 100644
--- a/hw/syborg_keyboard.c
+++ b/hw/syborg_keyboard.c
@@ -53,7 +53,7 @@ typedef struct {
SysBusDevice busdev;
int int_enabled;
int extension_bit;
- int fifo_size;
+ uint32_t fifo_size;
uint32_t *key_fifo;
int read_pos, read_count;
qemu_irq irq;
@@ -212,7 +212,6 @@ static void syborg_keyboard_init(SysBusDevice *dev)
iomemtype = cpu_register_io_memory(syborg_keyboard_readfn,
syborg_keyboard_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
- s->fifo_size = qdev_get_prop_int(&dev->qdev, "fifo-size", 16);
if (s->fifo_size <= 0) {
fprintf(stderr, "syborg_keyboard: fifo too small\n");
s->fifo_size = 16;
@@ -225,10 +224,24 @@ static void syborg_keyboard_init(SysBusDevice *dev)
syborg_keyboard_save, syborg_keyboard_load, s);
}
+static SysBusDeviceInfo syborg_keyboard_info = {
+ .init = syborg_keyboard_init,
+ .qdev.name = "syborg,keyboard",
+ .qdev.size = sizeof(SyborgKeyboardState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "fifo-size",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgKeyboardState, fifo_size),
+ .defval = (uint32_t[]) { 16 },
+ },
+ {/* end of list */}
+ }
+};
+
static void syborg_keyboard_register_devices(void)
{
- sysbus_register_dev("syborg,keyboard", sizeof(SyborgKeyboardState),
- syborg_keyboard_init);
+ sysbus_register_withprop(&syborg_keyboard_info);
}
device_init(syborg_keyboard_register_devices)
diff --git a/hw/syborg_pointer.c b/hw/syborg_pointer.c
index e0a892d00..edd1f2229 100644
--- a/hw/syborg_pointer.c
+++ b/hw/syborg_pointer.c
@@ -45,11 +45,11 @@ typedef struct {
typedef struct {
SysBusDevice busdev;
int int_enabled;
- int fifo_size;
+ uint32_t fifo_size;
event_data *event_fifo;
int read_pos, read_count;
qemu_irq irq;
- int absolute;
+ uint32_t absolute;
} SyborgPointerState;
static void syborg_pointer_update(SyborgPointerState *s)
@@ -209,8 +209,6 @@ static void syborg_pointer_init(SysBusDevice *dev)
syborg_pointer_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
- s->absolute = qdev_get_prop_int(&dev->qdev, "absolute", 1);
- s->fifo_size = qdev_get_prop_int(&dev->qdev, "fifo-size", 16);
if (s->fifo_size <= 0) {
fprintf(stderr, "syborg_pointer: fifo too small\n");
s->fifo_size = 16;
@@ -224,10 +222,29 @@ static void syborg_pointer_init(SysBusDevice *dev)
syborg_pointer_save, syborg_pointer_load, s);
}
+static SysBusDeviceInfo syborg_pointer_info = {
+ .init = syborg_pointer_init,
+ .qdev.name = "syborg,pointer",
+ .qdev.size = sizeof(SyborgPointerState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "fifo-size",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgPointerState, fifo_size),
+ .defval = (uint32_t[]) { 16 },
+ },{
+ .name = "absolute",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgPointerState, absolute),
+ .defval = (uint32_t[]) { 1 },
+ },
+ {/* end of list */}
+ }
+};
+
static void syborg_pointer_register_devices(void)
{
- sysbus_register_dev("syborg,pointer", sizeof(SyborgPointerState),
- syborg_pointer_init);
+ sysbus_register_withprop(&syborg_pointer_info);
}
device_init(syborg_pointer_register_devices)
diff --git a/hw/syborg_serial.c b/hw/syborg_serial.c
index f43050801..f69342154 100644
--- a/hw/syborg_serial.c
+++ b/hw/syborg_serial.c
@@ -59,7 +59,7 @@ enum {
typedef struct {
SysBusDevice busdev;
uint32_t int_enable;
- int fifo_size;
+ uint32_t fifo_size;
uint32_t *read_fifo;
int read_pos;
int read_count;
@@ -329,7 +329,6 @@ static void syborg_serial_init(SysBusDevice *dev)
qemu_chr_add_handlers(s->chr, syborg_serial_can_receive,
syborg_serial_receive, syborg_serial_event, s);
}
- s->fifo_size = qdev_get_prop_int(&dev->qdev, "fifo-size", 16);
if (s->fifo_size <= 0) {
fprintf(stderr, "syborg_serial: fifo too small\n");
s->fifo_size = 16;
@@ -340,10 +339,24 @@ static void syborg_serial_init(SysBusDevice *dev)
syborg_serial_save, syborg_serial_load, s);
}
+static SysBusDeviceInfo syborg_serial_info = {
+ .init = syborg_serial_init,
+ .qdev.name = "syborg,serial",
+ .qdev.size = sizeof(SyborgSerialState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "fifo-size",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgSerialState, fifo_size),
+ .defval = (uint32_t[]) { 16 },
+ },
+ {/* end of list */}
+ }
+};
+
static void syborg_serial_register_devices(void)
{
- sysbus_register_dev("syborg,serial", sizeof(SyborgSerialState),
- syborg_serial_init);
+ sysbus_register_withprop(&syborg_serial_info);
}
device_init(syborg_serial_register_devices)
diff --git a/hw/syborg_timer.c b/hw/syborg_timer.c
index 4f5e3a178..cf96c5fff 100644
--- a/hw/syborg_timer.c
+++ b/hw/syborg_timer.c
@@ -209,7 +209,6 @@ static void syborg_timer_init(SysBusDevice *dev)
QEMUBH *bh;
int iomemtype;
- s->freq = qdev_get_prop_int(&dev->qdev, "frequency", 0);
if (s->freq == 0) {
fprintf(stderr, "syborg_timer: Zero/unset frequency\n");
exit(1);
@@ -230,9 +229,13 @@ static SysBusDeviceInfo syborg_timer_info = {
.init = syborg_timer_init,
.qdev.name = "syborg,timer",
.qdev.size = sizeof(SyborgTimerState),
- .qdev.props = (DevicePropList[]) {
- {.name = "frequency", .type = PROP_TYPE_INT},
- {.name = NULL}
+ .qdev.props = (Property[]) {
+ {
+ .name = "frequency",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(SyborgTimerState, freq),
+ },
+ {/* end of list */}
}
};
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 08f15e42f..814d34703 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "sysbus.h"
diff --git a/hw/sysbus.h b/hw/sysbus.h
index 9b2553dba..d48ca8ca3 100644
--- a/hw/sysbus.h
+++ b/hw/sysbus.h
@@ -6,7 +6,7 @@
#include "qdev.h"
#define QDEV_MAX_MMIO 32
-#define QDEV_MAX_IRQ 32
+#define QDEV_MAX_IRQ 256
typedef struct SysBusDevice SysBusDevice;
typedef void (*mmio_mapfunc)(SysBusDevice *dev, target_phys_addr_t addr);
diff --git a/hw/tc6393xb_template.h b/hw/tc6393xb_template.h
index 2c5fb674e..37bf8336b 100644
--- a/hw/tc6393xb_template.h
+++ b/hw/tc6393xb_template.h
@@ -18,8 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#if BITS == 8
diff --git a/hw/tcx.c b/hw/tcx.c
index d9b07cc8d..c5925240b 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -26,6 +26,7 @@
#include "console.h"
#include "pixel_ops.h"
#include "sysbus.h"
+#include "qdev-addr.h"
#define MAXX 1024
#define MAXY 768
@@ -41,6 +42,7 @@ typedef struct TCXState {
uint8_t *vram;
uint32_t *vram24, *cplane;
ram_addr_t vram_offset, vram24_offset, cplane_offset;
+ uint32_t vram_size;
uint16_t width, height, depth;
uint8_t r[256], g[256], b[256];
uint32_t palette[256];
@@ -49,8 +51,25 @@ typedef struct TCXState {
static void tcx_screen_dump(void *opaque, const char *filename);
static void tcx24_screen_dump(void *opaque, const char *filename);
-static void tcx_invalidate_display(void *opaque);
-static void tcx24_invalidate_display(void *opaque);
+
+static void tcx_set_dirty(TCXState *s)
+{
+ unsigned int i;
+
+ for (i = 0; i < MAXX * MAXY; i += TARGET_PAGE_SIZE) {
+ cpu_physical_memory_set_dirty(s->vram_offset + i);
+ }
+}
+
+static void tcx24_set_dirty(TCXState *s)
+{
+ unsigned int i;
+
+ for (i = 0; i < MAXX * MAXY * 4; i += TARGET_PAGE_SIZE) {
+ cpu_physical_memory_set_dirty(s->vram24_offset + i);
+ cpu_physical_memory_set_dirty(s->cplane_offset + i);
+ }
+}
static void update_palette_entries(TCXState *s, int start, int end)
{
@@ -75,10 +94,11 @@ static void update_palette_entries(TCXState *s, int start, int end)
break;
}
}
- if (s->depth == 24)
- tcx24_invalidate_display(s);
- else
- tcx_invalidate_display(s);
+ if (s->depth == 24) {
+ tcx24_set_dirty(s);
+ } else {
+ tcx_set_dirty(s);
+ }
}
static void tcx_draw_line32(TCXState *s1, uint8_t *d,
@@ -344,23 +364,18 @@ static void tcx24_update_display(void *opaque)
static void tcx_invalidate_display(void *opaque)
{
TCXState *s = opaque;
- int i;
- for (i = 0; i < MAXX*MAXY; i += TARGET_PAGE_SIZE) {
- cpu_physical_memory_set_dirty(s->vram_offset + i);
- }
+ tcx_set_dirty(s);
+ qemu_console_resize(s->ds, s->width, s->height);
}
static void tcx24_invalidate_display(void *opaque)
{
TCXState *s = opaque;
- int i;
- tcx_invalidate_display(s);
- for (i = 0; i < MAXX*MAXY * 4; i += TARGET_PAGE_SIZE) {
- cpu_physical_memory_set_dirty(s->vram24_offset + i);
- cpu_physical_memory_set_dirty(s->cplane_offset + i);
- }
+ tcx_set_dirty(s);
+ tcx24_set_dirty(s);
+ qemu_console_resize(s->ds, s->width, s->height);
}
static void tcx_save(QEMUFile *f, void *opaque)
@@ -399,10 +414,11 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_8s(f, &s->dac_index);
qemu_get_8s(f, &s->dac_state);
update_palette_entries(s, 0, 256);
- if (s->depth == 24)
- tcx24_invalidate_display(s);
- else
- tcx_invalidate_display(s);
+ if (s->depth == 24) {
+ tcx24_set_dirty(s);
+ } else {
+ tcx_set_dirty(s);
+ }
return 0;
}
@@ -506,11 +522,11 @@ void tcx_init(target_phys_addr_t addr, int vram_size, int width, int height,
SysBusDevice *s;
dev = qdev_create(NULL, "SUNW,tcx");
- qdev_set_prop_int(dev, "addr", addr);
- qdev_set_prop_int(dev, "vram_size", vram_size);
- qdev_set_prop_int(dev, "width", width);
- qdev_set_prop_int(dev, "height", height);
- qdev_set_prop_int(dev, "depth", depth);
+ qdev_prop_set_taddr(dev, "addr", addr);
+ qdev_prop_set_uint32(dev, "vram_size", vram_size);
+ qdev_prop_set_uint16(dev, "width", width);
+ qdev_prop_set_uint16(dev, "height", height);
+ qdev_prop_set_uint16(dev, "depth", depth);
qdev_init(dev);
s = sysbus_from_qdev(dev);
/* 8-bit plane */
@@ -537,22 +553,16 @@ static void tcx_init1(SysBusDevice *dev)
TCXState *s = FROM_SYSBUS(TCXState, dev);
int io_memory, dummy_memory;
ram_addr_t vram_offset;
- int size, vram_size;
+ int size;
uint8_t *vram_base;
- vram_size = qdev_get_prop_int(&dev->qdev, "vram_size", -1);
-
- vram_offset = qemu_ram_alloc(vram_size * (1 + 4 + 4));
+ vram_offset = qemu_ram_alloc(s->vram_size * (1 + 4 + 4));
vram_base = qemu_get_ram_ptr(vram_offset);
- s->addr = qdev_get_prop_int(&dev->qdev, "addr", -1);
s->vram_offset = vram_offset;
- s->width = qdev_get_prop_int(&dev->qdev, "width", -1);
- s->height = qdev_get_prop_int(&dev->qdev, "height", -1);
- s->depth = qdev_get_prop_int(&dev->qdev, "depth", -1);
/* 8-bit plane */
s->vram = vram_base;
- size = vram_size;
+ size = s->vram_size;
sysbus_init_mmio(dev, size, s->vram_offset);
vram_offset += size;
vram_base += size;
@@ -570,7 +580,7 @@ static void tcx_init1(SysBusDevice *dev)
if (s->depth == 24) {
/* 24-bit plane */
- size = vram_size * 4;
+ size = s->vram_size * 4;
s->vram24 = (uint32_t *)vram_base;
s->vram24_offset = vram_offset;
sysbus_init_mmio(dev, size, vram_offset);
@@ -578,7 +588,7 @@ static void tcx_init1(SysBusDevice *dev)
vram_base += size;
/* Control plane */
- size = vram_size * 4;
+ size = s->vram_size * 4;
s->cplane = (uint32_t *)vram_base;
s->cplane_offset = vram_offset;
sysbus_init_mmio(dev, size, vram_offset);
@@ -664,9 +674,44 @@ static void tcx24_screen_dump(void *opaque, const char *filename)
return;
}
+static SysBusDeviceInfo tcx_info = {
+ .init = tcx_init1,
+ .qdev.name = "SUNW,tcx",
+ .qdev.size = sizeof(TCXState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "addr",
+ .info = &qdev_prop_taddr,
+ .offset = offsetof(TCXState, addr),
+ .defval = (target_phys_addr_t[]) { -1 },
+ },{
+ .name = "vram_size",
+ .info = &qdev_prop_hex32,
+ .offset = offsetof(TCXState, vram_size),
+ .defval = (uint32_t[]) { -1 },
+ },{
+ .name = "width",
+ .info = &qdev_prop_uint16,
+ .offset = offsetof(TCXState, width),
+ .defval = (uint16_t[]) { -1 },
+ },{
+ .name = "height",
+ .info = &qdev_prop_uint16,
+ .offset = offsetof(TCXState, height),
+ .defval = (uint16_t[]) { -1 },
+ },{
+ .name = "depth",
+ .info = &qdev_prop_uint16,
+ .offset = offsetof(TCXState, depth),
+ .defval = (uint16_t[]) { -1 },
+ },
+ {/* end of list */}
+ }
+};
+
static void tcx_register_devices(void)
{
- sysbus_register_dev("SUNW,tcx", sizeof(TCXState), tcx_init1);
+ sysbus_register_withprop(&tcx_info);
}
device_init(tcx_register_devices)
diff --git a/hw/tmp105.c b/hw/tmp105.c
index 5381b7d66..c9756c5e9 100644
--- a/hw/tmp105.c
+++ b/hw/tmp105.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/tsc2005.c b/hw/tsc2005.c
index 2e71b8e79..efc63c045 100644
--- a/hw/tsc2005.c
+++ b/hw/tsc2005.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/tsc210x.c b/hw/tsc210x.c
index 16874e060..004e60764 100644
--- a/hw/tsc210x.c
+++ b/hw/tsc210x.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/tusb6010.c b/hw/tusb6010.c
index 622de81d5..3fb0cf749 100644
--- a/hw/tusb6010.c
+++ b/hw/tusb6010.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
#include "qemu-timer.h"
diff --git a/hw/twl92230.c b/hw/twl92230.c
index 9960acc8c..519a5838b 100644
--- a/hw/twl92230.c
+++ b/hw/twl92230.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
diff --git a/hw/usb-bt.c b/hw/usb-bt.c
index 53ad9a869..72245f64b 100644
--- a/hw/usb-bt.c
+++ b/hw/usb-bt.c
@@ -15,8 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/hw/usb-musb.c b/hw/usb-musb.c
index 451bc8dbd..d015d2492 100644
--- a/hw/usb-musb.c
+++ b/hw/usb-musb.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Only host-mode and non-DMA accesses are currently supported.
*/
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 83d1a5c93..28ab3a915 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* TODO:
* o Isochronous transfers
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index d605b5fb1..1f922c283 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -19,6 +19,7 @@
#include "pci.h"
//#include "sysemu.h"
#include "msix.h"
+#include "net.h"
/* from Linux's linux/virtio_pci.h */
@@ -86,12 +87,8 @@ typedef struct {
PCIDevice pci_dev;
VirtIODevice *vdev;
uint32_t addr;
-
- uint16_t vendor;
- uint16_t device;
- uint16_t subvendor;
- uint16_t class_code;
- uint8_t pif;
+ uint32_t class_code;
+ uint32_t nvectors;
} VirtIOPCIProxy;
/* virtio device */
@@ -441,7 +438,13 @@ static void virtio_blk_init_pci_with_class(PCIDevice *pci_dev,
static void virtio_blk_init_pci(PCIDevice *pci_dev)
{
- virtio_blk_init_pci_with_class(pci_dev, PCI_CLASS_STORAGE_SCSI);
+ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
+
+ if (proxy->class_code != PCI_CLASS_STORAGE_SCSI &&
+ proxy->class_code != PCI_CLASS_STORAGE_OTHER)
+ proxy->class_code = PCI_CLASS_STORAGE_SCSI;
+
+ virtio_blk_init_pci_with_class(pci_dev, proxy->class_code);
}
static void virtio_blk_init_pci_0_10(PCIDevice *pci_dev)
@@ -464,7 +467,14 @@ static void virtio_console_init_pci_with_class(PCIDevice *pci_dev,
static void virtio_console_init_pci(PCIDevice *pci_dev)
{
- virtio_console_init_pci_with_class(pci_dev, PCI_CLASS_SERIAL_OTHER);
+ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
+
+ if (proxy->class_code != PCI_CLASS_COMMUNICATION_OTHER &&
+ proxy->class_code != PCI_CLASS_DISPLAY_OTHER && /* qemu 0.10 */
+ proxy->class_code != PCI_CLASS_OTHERS) /* qemu-kvm */
+ proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER;
+
+ virtio_console_init_pci_with_class(pci_dev, proxy->class_code);
}
static void virtio_console_init_pci_0_10(PCIDevice *pci_dev)
@@ -478,11 +488,21 @@ static void virtio_net_init_pci(PCIDevice *pci_dev)
VirtIODevice *vdev;
vdev = virtio_net_init(&pci_dev->qdev);
+
+ /* set nvectors from property, unless the user specified something
+ * via -net nic,model=virtio,vectors=n command line option */
+ if (pci_dev->qdev.nd->nvectors == NIC_NVECTORS_UNSPECIFIED)
+ if (proxy->nvectors != NIC_NVECTORS_UNSPECIFIED)
+ vdev->nvectors = proxy->nvectors;
+
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_NET,
PCI_CLASS_NETWORK_ETHERNET,
0x00);
+
+ /* make the actual value visible */
+ proxy->nvectors = vdev->nvectors;
}
static void virtio_balloon_init_pci(PCIDevice *pci_dev)
@@ -503,14 +523,39 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.name = "virtio-blk-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_blk_init_pci,
+ .qdev.props = (Property[]) {
+ {
+ .name = "class",
+ .info = &qdev_prop_hex32,
+ .offset = offsetof(VirtIOPCIProxy, class_code),
+ },
+ {/* end of list */}
+ },
},{
- .qdev.name = "virtio-net-pci",
- .qdev.size = sizeof(VirtIOPCIProxy),
- .init = virtio_net_init_pci,
+ .qdev.name = "virtio-net-pci",
+ .qdev.size = sizeof(VirtIOPCIProxy),
+ .init = virtio_net_init_pci,
+ .qdev.props = (Property[]) {
+ {
+ .name = "vectors",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(VirtIOPCIProxy, nvectors),
+ .defval = (uint32_t[]) { NIC_NVECTORS_UNSPECIFIED },
+ },
+ {/* end of list */}
+ },
},{
.qdev.name = "virtio-console-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_console_init_pci,
+ .qdev.props = (Property[]) {
+ {
+ .name = "class",
+ .info = &qdev_prop_hex32,
+ .offset = offsetof(VirtIOPCIProxy, class_code),
+ },
+ {/* end of list */}
+ },
},{
.qdev.name = "virtio-balloon-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
diff --git a/hw/watchdog.c b/hw/watchdog.c
index c64868d2c..fde2f1b3d 100644
--- a/hw/watchdog.c
+++ b/hw/watchdog.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* By Richard W.M. Jones (rjones@redhat.com).
*/
diff --git a/hw/watchdog.h b/hw/watchdog.h
index c2b2b3687..ad1fcfce5 100644
--- a/hw/watchdog.h
+++ b/hw/watchdog.h
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* By Richard W.M. Jones (rjones@redhat.com).
*/
diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c
index 42642c77f..5e9fd7c78 100644
--- a/hw/wdt_i6300esb.c
+++ b/hw/wdt_i6300esb.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* By Richard W.M. Jones (rjones@redhat.com).
*/
diff --git a/hw/wdt_ib700.c b/hw/wdt_ib700.c
index d32aaf13f..7b54bde70 100644
--- a/hw/wdt_ib700.c
+++ b/hw/wdt_ib700.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* By Richard W.M. Jones (rjones@redhat.com).
*/
diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 76d07ecd3..efafd2fa5 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/hw/xen_console.c b/hw/xen_console.c
index 27a0083d2..d2261f413 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 659a839f9..7ed6c33aa 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index 4377ed15d..c9e91999e 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/hw/xenfb.c b/hw/xenfb.c
index ad3e8eea5..795a32626 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -21,8 +21,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
diff --git a/hw/xilinx.h b/hw/xilinx.h
index 9707a0e0b..070679c24 100644
--- a/hw/xilinx.h
+++ b/hw/xilinx.h
@@ -8,7 +8,7 @@ xilinx_intc_create(target_phys_addr_t base, qemu_irq irq, int kind_of_intr)
DeviceState *dev;
dev = qdev_create(NULL, "xilinx,intc");
- qdev_set_prop_int(dev, "kind-of-intr", kind_of_intr);
+ qdev_prop_set_uint32(dev, "kind-of-intr", kind_of_intr);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -22,8 +22,8 @@ xilinx_timer_create(target_phys_addr_t base, qemu_irq irq, int nr, int freq)
DeviceState *dev;
dev = qdev_create(NULL, "xilinx,timer");
- qdev_set_prop_int(dev, "nr-timers", nr);
- qdev_set_prop_int(dev, "frequency", freq);
+ qdev_prop_set_uint32(dev, "nr-timers", nr);
+ qdev_prop_set_uint32(dev, "frequency", freq);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -40,9 +40,9 @@ xilinx_ethlite_create(NICInfo *nd, target_phys_addr_t base, qemu_irq irq,
qemu_check_nic_model(nd, "xilinx-ethlite");
dev = qdev_create(NULL, "xilinx,ethlite");
- qdev_set_netdev(dev, nd);
- qdev_set_prop_int(dev, "txpingpong", txpingpong);
- qdev_set_prop_int(dev, "rxpingpong", rxpingpong);
+ dev->nd = nd;
+ qdev_prop_set_uint32(dev, "txpingpong", txpingpong);
+ qdev_prop_set_uint32(dev, "rxpingpong", rxpingpong);
qdev_init(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index f4b40c7b7..b3fd25bb4 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -53,8 +53,8 @@ struct xlx_ethlite
qemu_irq irq;
VLANClientState *vc;
- unsigned int c_tx_pingpong;
- unsigned int c_rx_pingpong;
+ uint32_t c_tx_pingpong;
+ uint32_t c_rx_pingpong;
unsigned int txbuf;
unsigned int rxbuf;
@@ -213,8 +213,6 @@ static void xilinx_ethlite_init(SysBusDevice *dev)
int regs;
sysbus_init_irq(dev, &s->irq);
- s->c_tx_pingpong = qdev_get_prop_int(&dev->qdev, "txpingpong", 1);
- s->c_rx_pingpong = qdev_get_prop_int(&dev->qdev, "rxpingpong", 1);
s->rxbuf = 0;
regs = cpu_register_io_memory(eth_read, eth_write, s);
@@ -225,10 +223,29 @@ static void xilinx_ethlite_init(SysBusDevice *dev)
eth_can_rx, eth_rx, NULL, eth_cleanup, s);
}
+static SysBusDeviceInfo xilinx_ethlite_info = {
+ .init = xilinx_ethlite_init,
+ .qdev.name = "xilinx,ethlite",
+ .qdev.size = sizeof(struct xlx_ethlite),
+ .qdev.props = (Property[]) {
+ {
+ .name = "txpingpong",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct xlx_ethlite, c_tx_pingpong),
+ .defval = (uint32_t[]) { 1 },
+ },{
+ .name = "rxpingpong",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct xlx_ethlite, c_rx_pingpong),
+ .defval = (uint32_t[]) { 1 },
+ },
+ {/* end of list */}
+ }
+};
+
static void xilinx_ethlite_register(void)
{
- sysbus_register_dev("xilinx,ethlite", sizeof (struct xlx_ethlite),
- xilinx_ethlite_init);
+ sysbus_register_withprop(&xilinx_ethlite_info);
}
device_init(xilinx_ethlite_register)
diff --git a/hw/xilinx_intc.c b/hw/xilinx_intc.c
index 0540f52d0..3f08bf81b 100644
--- a/hw/xilinx_intc.c
+++ b/hw/xilinx_intc.c
@@ -150,7 +150,6 @@ static void xilinx_intc_init(SysBusDevice *dev)
struct xlx_pic *p = FROM_SYSBUS(typeof (*p), dev);
int pic_regs;
- p->c_kind_of_intr = qdev_get_prop_int(&dev->qdev, "kind-of-intr", 0);
qdev_init_gpio_in(&dev->qdev, irq_handler, 32);
sysbus_init_irq(dev, &p->parent_irq);
@@ -158,10 +157,23 @@ static void xilinx_intc_init(SysBusDevice *dev)
sysbus_init_mmio(dev, R_MAX * 4, pic_regs);
}
+static SysBusDeviceInfo xilinx_intc_info = {
+ .init = xilinx_intc_init,
+ .qdev.name = "xilinx,intc",
+ .qdev.size = sizeof(struct xlx_pic),
+ .qdev.props = (Property[]) {
+ {
+ .name = "kind-of-intr",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct xlx_pic, c_kind_of_intr),
+ },
+ {/* end of list */}
+ }
+};
+
static void xilinx_intc_register(void)
{
- sysbus_register_dev("xilinx,intc", sizeof (struct xlx_pic),
- xilinx_intc_init);
+ sysbus_register_withprop(&xilinx_intc_info);
}
device_init(xilinx_intc_register)
diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c
index a64ad2d80..efb6a04fb 100644
--- a/hw/xilinx_timer.c
+++ b/hw/xilinx_timer.c
@@ -61,7 +61,8 @@ struct timerblock
{
SysBusDevice busdev;
qemu_irq irq;
- unsigned int nr_timers;
+ uint32_t nr_timers;
+ uint32_t freq_hz;
struct xlx_timer *timers;
};
@@ -192,14 +193,12 @@ static void xilinx_timer_init(SysBusDevice *dev)
{
struct timerblock *t = FROM_SYSBUS(typeof (*t), dev);
unsigned int i;
- int timer_regs, freq_hz;
+ int timer_regs;
/* All timers share a single irq line. */
sysbus_init_irq(dev, &t->irq);
/* Init all the ptimers. */
- freq_hz = qdev_get_prop_int(&dev->qdev, "frequency", 2);
- t->nr_timers = qdev_get_prop_int(&dev->qdev, "nr-timers", 2);
t->timers = qemu_mallocz(sizeof t->timers[0] * t->nr_timers);
for (i = 0; i < t->nr_timers; i++) {
struct xlx_timer *xt = &t->timers[i];
@@ -208,17 +207,36 @@ static void xilinx_timer_init(SysBusDevice *dev)
xt->nr = i;
xt->bh = qemu_bh_new(timer_hit, xt);
xt->ptimer = ptimer_init(xt->bh);
- ptimer_set_freq(xt->ptimer, freq_hz);
+ ptimer_set_freq(xt->ptimer, t->freq_hz);
}
timer_regs = cpu_register_io_memory(timer_read, timer_write, t);
sysbus_init_mmio(dev, R_MAX * 4 * t->nr_timers, timer_regs);
}
+static SysBusDeviceInfo xilinx_timer_info = {
+ .init = xilinx_timer_init,
+ .qdev.name = "xilinx,timer",
+ .qdev.size = sizeof(struct timerblock),
+ .qdev.props = (Property[]) {
+ {
+ .name = "frequency",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct timerblock, freq_hz),
+ .defval = (uint32_t[]) { 2 },
+ },{
+ .name = "nr-timers",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(struct timerblock, nr_timers),
+ .defval = (uint32_t[]) { 2 },
+ },
+ {/* end of list */}
+ }
+};
+
static void xilinx_timer_register(void)
{
- sysbus_register_dev("xilinx,timer", sizeof (struct timerblock),
- xilinx_timer_init);
+ sysbus_register_withprop(&xilinx_timer_info);
}
device_init(xilinx_timer_register)
diff --git a/hw/zaurus.c b/hw/zaurus.c
index 53191ef9e..e52f29b57 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "pxa.h"
diff --git a/i386-dis.c b/i386-dis.c
index 87c8b9dff..b2af03371 100644
--- a/i386-dis.c
+++ b/i386-dis.c
@@ -16,8 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
July 1988
@@ -54,8 +53,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* The SystemV/386 SVR3.2 assembler, and probably all AT&T derived
ix86 Unix assemblers, generate floating point instructions with
diff --git a/ioport-user.c b/ioport-user.c
index fe8567f46..11c76c763 100644
--- a/ioport-user.c
+++ b/ioport-user.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
@@ -25,35 +23,38 @@
#include "qemu-common.h"
#include "ioport.h"
-void cpu_outb(CPUState *env, int addr, int val)
+void cpu_outb(CPUState *env, pio_addr_t addr, uint8_t val)
{
- fprintf(stderr, "outb: port=0x%04x, data=%02x\n", addr, val);
+ fprintf(stderr, "outb: port=0x%04"FMT_pioaddr", data=%02"PRIx8"\n",
+ addr, val);
}
-void cpu_outw(CPUState *env, int addr, int val)
+void cpu_outw(CPUState *env, pio_addr_t addr, uint16_t val)
{
- fprintf(stderr, "outw: port=0x%04x, data=%04x\n", addr, val);
+ fprintf(stderr, "outw: port=0x%04"FMT_pioaddr", data=%04"PRIx16"\n",
+ addr, val);
}
-void cpu_outl(CPUState *env, int addr, int val)
+void cpu_outl(CPUState *env, pio_addr_t addr, uint32_t val)
{
- fprintf(stderr, "outl: port=0x%04x, data=%08x\n", addr, val);
+ fprintf(stderr, "outl: port=0x%04"FMT_pioaddr", data=%08"PRIx32"\n",
+ addr, val);
}
-int cpu_inb(CPUState *env, int addr)
+uint8_t cpu_inb(CPUState *env, pio_addr_t addr)
{
- fprintf(stderr, "inb: port=0x%04x\n", addr);
+ fprintf(stderr, "inb: port=0x%04"FMT_pioaddr"\n", addr);
return 0;
}
-int cpu_inw(CPUState *env, int addr)
+uint16_t cpu_inw(CPUState *env, pio_addr_t addr)
{
- fprintf(stderr, "inw: port=0x%04x\n", addr);
+ fprintf(stderr, "inw: port=0x%04"FMT_pioaddr"\n", addr);
return 0;
}
-int cpu_inl(CPUState *env, int addr)
+uint32_t cpu_inl(CPUState *env, pio_addr_t addr)
{
- fprintf(stderr, "inl: port=0x%04x\n", addr);
+ fprintf(stderr, "inl: port=0x%04"FMT_pioaddr"\n", addr);
return 0;
}
diff --git a/ioport.c b/ioport.c
index 01cfaf706..13183a2f0 100644
--- a/ioport.c
+++ b/ioport.c
@@ -33,6 +33,12 @@
//#define DEBUG_UNUSED_IOPORT
//#define DEBUG_IOPORT
+#ifdef DEBUG_UNUSED_IOPORT
+# define LOG_UNUSED_IOPORT(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
+#else
+# define LOG_UNUSED_IOPORT(fmt, ...) do{ } while (0)
+#endif
+
#ifdef DEBUG_IOPORT
# define LOG_IOPORT(...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
#else
@@ -76,17 +82,14 @@ static void ioport_write(int index, uint32_t address, uint32_t data)
static uint32_t default_ioport_readb(void *opaque, uint32_t address)
{
-#ifdef DEBUG_UNUSED_IOPORT
- fprintf(stderr, "unused inb: port=0x%04x\n", address);
-#endif
+ LOG_UNUSED_IOPORT("unused inb: port=0x%04"PRIx32"\n", address);
return 0xff;
}
static void default_ioport_writeb(void *opaque, uint32_t address, uint32_t data)
{
-#ifdef DEBUG_UNUSED_IOPORT
- fprintf(stderr, "unused outb: port=0x%04x data=0x%02x\n", address, data);
-#endif
+ LOG_UNUSED_IOPORT("unused outb: port=0x%04"PRIx32" data=0x%02"PRIx32"\n",
+ address, data);
}
/* default is to make two byte accesses */
@@ -108,17 +111,14 @@ static void default_ioport_writew(void *opaque, uint32_t address, uint32_t data)
static uint32_t default_ioport_readl(void *opaque, uint32_t address)
{
-#ifdef DEBUG_UNUSED_IOPORT
- fprintf(stderr, "unused inl: port=0x%04x\n", address);
-#endif
+ LOG_UNUSED_IOPORT("unused inl: port=0x%04"PRIx32"\n", address);
return 0xffffffff;
}
static void default_ioport_writel(void *opaque, uint32_t address, uint32_t data)
{
-#ifdef DEBUG_UNUSED_IOPORT
- fprintf(stderr, "unused outl: port=0x%04x data=0x%02x\n", address, data);
-#endif
+ LOG_UNUSED_IOPORT("unused outl: port=0x%04"PRIx32" data=0x%02"PRIx32"\n",
+ address, data);
}
static int ioport_bsize(int size, int *bsize)
@@ -136,7 +136,7 @@ static int ioport_bsize(int size, int *bsize)
}
/* size is the word size in byte */
-int register_ioport_read(int start, int length, int size,
+int register_ioport_read(pio_addr_t start, int length, int size,
IOPortReadFunc *func, void *opaque)
{
int i, bsize;
@@ -155,7 +155,7 @@ int register_ioport_read(int start, int length, int size,
}
/* size is the word size in byte */
-int register_ioport_write(int start, int length, int size,
+int register_ioport_write(pio_addr_t start, int length, int size,
IOPortWriteFunc *func, void *opaque)
{
int i, bsize;
@@ -173,7 +173,7 @@ int register_ioport_write(int start, int length, int size,
return 0;
}
-void isa_unassign_ioport(int start, int length)
+void isa_unassign_ioport(pio_addr_t start, int length)
{
int i;
@@ -192,9 +192,9 @@ void isa_unassign_ioport(int start, int length)
/***********************************************************/
-void cpu_outb(CPUState *env, int addr, int val)
+void cpu_outb(CPUState *env, pio_addr_t addr, uint8_t val)
{
- LOG_IOPORT("outb: %04x %02x\n", addr, val);
+ LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val);
ioport_write(0, addr, val);
#ifdef CONFIG_KQEMU
if (env)
@@ -202,9 +202,9 @@ void cpu_outb(CPUState *env, int addr, int val)
#endif
}
-void cpu_outw(CPUState *env, int addr, int val)
+void cpu_outw(CPUState *env, pio_addr_t addr, uint16_t val)
{
- LOG_IOPORT("outw: %04x %04x\n", addr, val);
+ LOG_IOPORT("outw: %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);
ioport_write(1, addr, val);
#ifdef CONFIG_KQEMU
if (env)
@@ -212,9 +212,9 @@ void cpu_outw(CPUState *env, int addr, int val)
#endif
}
-void cpu_outl(CPUState *env, int addr, int val)
+void cpu_outl(CPUState *env, pio_addr_t addr, uint32_t val)
{
- LOG_IOPORT("outl: %04x %08x\n", addr, val);
+ LOG_IOPORT("outl: %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
ioport_write(2, addr, val);
#ifdef CONFIG_KQEMU
if (env)
@@ -222,11 +222,11 @@ void cpu_outl(CPUState *env, int addr, int val)
#endif
}
-int cpu_inb(CPUState *env, int addr)
+uint8_t cpu_inb(CPUState *env, pio_addr_t addr)
{
- int val;
+ uint8_t val;
val = ioport_read(0, addr);
- LOG_IOPORT("inb : %04x %02x\n", addr, val);
+ LOG_IOPORT("inb : %04"FMT_pioaddr" %02"PRIx8"\n", addr, val);
#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
@@ -234,11 +234,11 @@ int cpu_inb(CPUState *env, int addr)
return val;
}
-int cpu_inw(CPUState *env, int addr)
+uint16_t cpu_inw(CPUState *env, pio_addr_t addr)
{
- int val;
+ uint16_t val;
val = ioport_read(1, addr);
- LOG_IOPORT("inw : %04x %04x\n", addr, val);
+ LOG_IOPORT("inw : %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);
#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
@@ -246,15 +246,14 @@ int cpu_inw(CPUState *env, int addr)
return val;
}
-int cpu_inl(CPUState *env, int addr)
+uint32_t cpu_inl(CPUState *env, pio_addr_t addr)
{
- int val;
+ uint32_t val;
val = ioport_read(2, addr);
- LOG_IOPORT("inl : %04x %08x\n", addr, val);
+ LOG_IOPORT("inl : %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
return val;
}
-
diff --git a/ioport.h b/ioport.h
index 4cb59e951..f981e8c47 100644
--- a/ioport.h
+++ b/ioport.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/**************************************************************************
@@ -27,6 +26,9 @@
#include "qemu-common.h"
+typedef uint32_t pio_addr_t;
+#define FMT_pioaddr PRIx32
+
#define MAX_IOPORTS (64 * 1024)
#define IOPORTS_MASK (MAX_IOPORTS - 1)
@@ -34,22 +36,22 @@
typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
-int register_ioport_read(int start, int length, int size,
+int register_ioport_read(pio_addr_t start, int length, int size,
IOPortReadFunc *func, void *opaque);
-int register_ioport_write(int start, int length, int size,
+int register_ioport_write(pio_addr_t start, int length, int size,
IOPortWriteFunc *func, void *opaque);
-void isa_unassign_ioport(int start, int length);
+void isa_unassign_ioport(pio_addr_t start, int length);
/* NOTE: as these functions may be even used when there is an isa
brige on non x86 targets, we always defined them */
#if !defined(NO_CPU_IO_DEFS) && defined(NEED_CPU_H)
-void cpu_outb(CPUState *env, int addr, int val);
-void cpu_outw(CPUState *env, int addr, int val);
-void cpu_outl(CPUState *env, int addr, int val);
-int cpu_inb(CPUState *env, int addr);
-int cpu_inw(CPUState *env, int addr);
-int cpu_inl(CPUState *env, int addr);
+void cpu_outb(CPUState *env, pio_addr_t addr, uint8_t val);
+void cpu_outw(CPUState *env, pio_addr_t addr, uint16_t val);
+void cpu_outl(CPUState *env, pio_addr_t addr, uint32_t val);
+uint8_t cpu_inb(CPUState *env, pio_addr_t addr);
+uint16_t cpu_inw(CPUState *env, pio_addr_t addr);
+uint32_t cpu_inl(CPUState *env, pio_addr_t addr);
#endif
#endif /* IOPORT_H */
diff --git a/kqemu.c b/kqemu.c
index ef0abb53d..825c0f13f 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#ifdef _WIN32
diff --git a/libfdt_env.h b/libfdt_env.h
index e154b8ef1..ee0419f7c 100644
--- a/libfdt_env.h
+++ b/libfdt_env.h
@@ -9,8 +9,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright IBM Corp. 2008
* Authors: Hollis Blanchard <hollisb@us.ibm.com>
diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index 8eba5a819..6a2c3f959 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -13,9 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2006 CodeSourcery.
* Copyright (C) 2000-2003 David McCullough <davidm@snapgear.com>
diff --git a/linux-user/m68k-sim.c b/linux-user/m68k-sim.c
index 8a2b1d872..64d3b23d6 100644
--- a/linux-user/m68k-sim.c
+++ b/linux-user/m68k-sim.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/types.h>
diff --git a/linux-user/main.c b/linux-user/main.c
index 1e95f0212..9038b58e7 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index aa22006ff..79cb4e605 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h
index d789911e8..481047b2d 100644
--- a/linux-user/ppc/syscall.h
+++ b/linux-user/ppc/syscall.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* XXX: ABSOLUTELY BUGGY:
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 6ee61a918..93c2ebe1e 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 000962328..8b0a5fa3f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#define _ATFILE_SOURCE
#include <stdlib.h>
diff --git a/linux-user/vm86.c b/linux-user/vm86.c
index cc6c8c99d..0b2439dfa 100644
--- a/linux-user/vm86.c
+++ b/linux-user/vm86.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/loader.c b/loader.c
index 9350c541d..54580e4c5 100644
--- a/loader.c
+++ b/loader.c
@@ -39,8 +39,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
diff --git a/m68k-dis.c b/m68k-dis.c
index 9978caac5..d38d5a259 100644
--- a/m68k-dis.c
+++ b/m68k-dis.c
@@ -24,8 +24,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
#if !defined (FLOATFORMAT_H)
#define FLOATFORMAT_H 1
@@ -159,9 +158,8 @@ floatformat_is_valid (const struct floatformat *fmt, const char *from);
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this file; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this file; see the file COPYING. If not,
+ see <http://www.gnu.org/licenses/>. */
/* These are used as bit flags for the arch field in the m68k_opcode
structure. */
@@ -540,9 +538,7 @@ extern const int m68k_numopcodes, m68k_numaliases;
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Local function prototypes. */
@@ -2047,9 +2043,8 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this file; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this file; see the file COPYING. If not,
+ see <http://www.gnu.org/licenses/>. */
#define one(x) ((unsigned int) (x) << 16)
#define two(x, y) (((unsigned int) (x) << 16) + (y))
@@ -4471,8 +4466,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This is needed to pick up the NAN macro on some systems. */
//#define _GNU_SOURCE
diff --git a/m68k-semi.c b/m68k-semi.c
index 3c7699515..48e3bd38b 100644
--- a/m68k-semi.c
+++ b/m68k-semi.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/types.h>
diff --git a/microblaze-dis.c b/microblaze-dis.c
index 0caacc0bc..6144334e6 100644
--- a/microblaze-dis.c
+++ b/microblaze-dis.c
@@ -12,8 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
* Copyright (c) 2001 Xilinx, Inc. All rights reserved.
@@ -55,8 +54,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
* Copyright (c) 2001 Xilinx, Inc. All rights reserved.
diff --git a/migration-exec.c b/migration-exec.c
index 0dd5aff31..e472979d8 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -109,7 +109,6 @@ static void exec_accept_incoming_migration(void *opaque)
QEMUFile *f = opaque;
int ret;
- vm_stop(0); /* just in case */
ret = qemu_loadvm_state(f);
if (ret < 0) {
fprintf(stderr, "load of migration failed\n");
@@ -119,7 +118,6 @@ static void exec_accept_incoming_migration(void *opaque)
dprintf("successfully loaded vm state\n");
/* we've successfully migrated, close the fd */
qemu_set_fd_handler2(qemu_popen_fd(f), NULL, NULL, NULL, NULL);
- vm_start();
err:
qemu_fclose(f);
diff --git a/migration-tcp.c b/migration-tcp.c
index 1f4358ee5..7a87a1eda 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -155,7 +155,6 @@ static void tcp_accept_incoming_migration(void *opaque)
goto out;
}
- vm_stop(0); /* just in case */
ret = qemu_loadvm_state(f);
if (ret < 0) {
fprintf(stderr, "load of migration failed\n");
@@ -168,8 +167,6 @@ static void tcp_accept_incoming_migration(void *opaque)
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
close(s);
- vm_start();
-
out_fopen:
qemu_fclose(f);
out:
diff --git a/mips-dis.c b/mips-dis.c
index 500aab90a..169169ca3 100644
--- a/mips-dis.c
+++ b/mips-dis.c
@@ -17,9 +17,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-MA 02110-1301, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include "dis-asm.h"
@@ -42,8 +40,8 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this file; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this file; see the file COPYING. If not,
+see <http://www.gnu.org/licenses/>. */
/* These are bit masks and shift counts to use to access the various
fields of an instruction. To retrieve the X field of an
diff --git a/monitor.c b/monitor.c
index 23725c1fc..fec9a19a8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1206,6 +1206,25 @@ static void do_ioport_read(Monitor *mon, int count, int format, int size,
suffix, addr, size * 2, val);
}
+static void do_ioport_write(Monitor *mon, int count, int format, int size,
+ int addr, int val)
+{
+ addr &= IOPORTS_MASK;
+
+ switch (size) {
+ default:
+ case 1:
+ cpu_outb(NULL, addr, val);
+ break;
+ case 2:
+ cpu_outw(NULL, addr, val);
+ break;
+ case 4:
+ cpu_outl(NULL, addr, val);
+ break;
+ }
+}
+
static void do_boot_set(Monitor *mon, const char *bootdevice)
{
int res;
diff --git a/nbd.c b/nbd.c
index b397a5f48..337eeba87 100644
--- a/nbd.c
+++ b/nbd.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "nbd.h"
diff --git a/nbd.h b/nbd.h
index eb77cce21..5deac2915 100644
--- a/nbd.h
+++ b/nbd.h
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NBD_H
diff --git a/net-checksum.c b/net-checksum.c
index fac065134..4956c5cef 100644
--- a/net-checksum.c
+++ b/net-checksum.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw/hw.h"
diff --git a/net.c b/net.c
index df6691cc0..35a5fa904 100644
--- a/net.c
+++ b/net.c
@@ -2593,7 +2593,7 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
}
if (!strcmp(device, "nic")) {
static const char * const nic_params[] = {
- "vlan", "name", "macaddr", "model", "addr", "vectors", NULL
+ "vlan", "name", "macaddr", "model", "addr", "id", "vectors", NULL
};
NICInfo *nd;
uint8_t *macaddr;
@@ -2631,6 +2631,9 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
if (get_param_value(buf, sizeof(buf), "addr", p)) {
nd->devaddr = strdup(buf);
}
+ if (get_param_value(buf, sizeof(buf), "id", p)) {
+ nd->id = strdup(buf);
+ }
nd->nvectors = NIC_NVECTORS_UNSPECIFIED;
if (get_param_value(buf, sizeof(buf), "vectors", p)) {
char *endptr;
diff --git a/net.h b/net.h
index fc5fc172e..2d4723d32 100644
--- a/net.h
+++ b/net.h
@@ -103,6 +103,7 @@ struct NICInfo {
const char *model;
const char *name;
const char *devaddr;
+ const char *id;
VLANState *vlan;
VLANClientState *vc;
void *private;
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 40ce0a366..4cc3dae33 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -3,7 +3,6 @@ all: build-all
include ../../config-host.mak
VPATH=$(SRC_PATH)/pc-bios/optionrom
-OBJCOPY=objcopy
# from kernel sources - scripts/Kbuild.include
# try-run
@@ -35,11 +34,13 @@ build-all: multiboot.bin extboot.bin
$(CC) $(CFLAGS) -o $@ -c $<
%.img: %.o
- $(LD) --oformat binary -Ttext 0 -o $@ $<
+ $(LD) -Ttext 0 -e _start -s -o $@ $<
-%.bin: %.img
+%.raw: %.img
+ $(OBJCOPY) -O binary -j .text $< $@
+
+%.bin: %.raw
$(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@
- cp $@ $(SRC_PATH)/pc-bios/
clean:
$(RM) *.o *.img *.bin *~
diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
index e04cd0337..93beb51b6 100644
--- a/pc-bios/optionrom/multiboot.S
+++ b/pc-bios/optionrom/multiboot.S
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright Novell Inc, 2009
* Authors: Alexander Graf <agraf@suse.de>
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
index 4273d1f0e..263ba5ffc 100755
--- a/pc-bios/optionrom/signrom.sh
+++ b/pc-bios/optionrom/signrom.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# Copyright Novell Inc, 2009
# Authors: Alexander Graf <agraf@suse.de>
diff --git a/ppc-dis.c b/ppc-dis.c
index e3bc1704b..ca5765a60 100644
--- a/ppc-dis.c
+++ b/ppc-dis.c
@@ -16,8 +16,8 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this file; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this file; see the file COPYING. If not,
+see <http://www.gnu.org/licenses/>. */
#include "dis-asm.h"
#define BFD_DEFAULT_TARGET_SIZE 64
@@ -39,8 +39,8 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this file; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this file; see the file COPYING. If not,
+see <http://www.gnu.org/licenses/>. */
/* The opcode table is an array of struct powerpc_opcode. */
@@ -361,9 +361,8 @@ extern const int powerpc_num_macros;
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this file; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this file; see the file COPYING.
+ If not, see <http://www.gnu.org/licenses/>. */
/* This file holds the PowerPC opcode table. The opcode table
includes almost all of the extended instruction mnemonics. This
diff --git a/qemu-io.c b/qemu-io.c
index 076984a94..6c35a071c 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -187,6 +187,22 @@ static int do_pwrite(char *buf, int64_t offset, int count, int *total)
return 1;
}
+static int do_load_vmstate(char *buf, int64_t offset, int count, int *total)
+{
+ *total = bdrv_load_vmstate(bs, (uint8_t *)buf, offset, count);
+ if (*total < 0)
+ return *total;
+ return 1;
+}
+
+static int do_save_vmstate(char *buf, int64_t offset, int count, int *total)
+{
+ *total = bdrv_save_vmstate(bs, (uint8_t *)buf, offset, count);
+ if (*total < 0)
+ return *total;
+ return 1;
+}
+
#define NOT_DONE 0x7fffffff
static void aio_rw_done(void *opaque, int ret)
{
@@ -242,6 +258,7 @@ read_help(void)
"\n"
" Reads a segment of the currently open file, optionally dumping it to the\n"
" standard output stream (with -v option) for subsequent inspection.\n"
+" -b, -- read from the VM state rather than the virtual disk\n"
" -C, -- report statistics in a machine parsable format\n"
" -l, -- length for pattern verification (only with -P)\n"
" -p, -- use bdrv_pread to read the file\n"
@@ -257,7 +274,7 @@ read_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, pflag = 0, qflag = 0, vflag = 0;
- int Pflag = 0, sflag = 0, lflag = 0;
+ int Pflag = 0, sflag = 0, lflag = 0, bflag = 0;
int c, cnt;
char *buf;
int64_t offset;
@@ -266,8 +283,11 @@ read_f(int argc, char **argv)
int total = 0;
int pattern = 0, pattern_offset = 0, pattern_count = 0;
- while ((c = getopt(argc, argv, "Cl:pP:qs:v")) != EOF) {
+ while ((c = getopt(argc, argv, "bCl:pP:qs:v")) != EOF) {
switch (c) {
+ case 'b':
+ bflag = 1;
+ break;
case 'C':
Cflag = 1;
break;
@@ -308,6 +328,11 @@ read_f(int argc, char **argv)
if (optind != argc - 2)
return command_usage(&read_cmd);
+ if (bflag && pflag) {
+ printf("-b and -p cannot be specified at the same time\n");
+ return 0;
+ }
+
offset = cvtnum(argv[optind]);
if (offset < 0) {
printf("non-numeric length argument -- %s\n", argv[optind]);
@@ -352,6 +377,8 @@ read_f(int argc, char **argv)
gettimeofday(&t1, NULL);
if (pflag)
cnt = do_pread(buf, offset, count, &total);
+ else if (bflag)
+ cnt = do_load_vmstate(buf, offset, count, &total);
else
cnt = do_read(buf, offset, count, &total);
gettimeofday(&t2, NULL);
@@ -394,7 +421,7 @@ static const cmdinfo_t read_cmd = {
.cfunc = read_f,
.argmin = 2,
.argmax = -1,
- .args = "[-aCpqv] [-P pattern [-s off] [-l len]] off len",
+ .args = "[-abCpqv] [-P pattern [-s off] [-l len]] off len",
.oneline = "reads a number of bytes at a specified offset",
.help = read_help,
};
@@ -534,6 +561,7 @@ write_help(void)
"\n"
" Writes into a segment of the currently open file, using a buffer\n"
" filled with a set pattern (0xcdcdcdcd).\n"
+" -b, -- write to the VM state rather than the virtual disk\n"
" -p, -- use bdrv_pwrite to write the file\n"
" -P, -- use different pattern to fill file\n"
" -C, -- report statistics in a machine parsable format\n"
@@ -545,7 +573,7 @@ static int
write_f(int argc, char **argv)
{
struct timeval t1, t2;
- int Cflag = 0, pflag = 0, qflag = 0;
+ int Cflag = 0, pflag = 0, qflag = 0, bflag = 0;
int c, cnt;
char *buf;
int64_t offset;
@@ -554,8 +582,11 @@ write_f(int argc, char **argv)
int total = 0;
int pattern = 0xcd;
- while ((c = getopt(argc, argv, "CpP:q")) != EOF) {
+ while ((c = getopt(argc, argv, "bCpP:q")) != EOF) {
switch (c) {
+ case 'b':
+ bflag = 1;
+ break;
case 'C':
Cflag = 1;
break;
@@ -576,6 +607,11 @@ write_f(int argc, char **argv)
if (optind != argc - 2)
return command_usage(&write_cmd);
+ if (bflag && pflag) {
+ printf("-b and -p cannot be specified at the same time\n");
+ return 0;
+ }
+
offset = cvtnum(argv[optind]);
if (offset < 0) {
printf("non-numeric length argument -- %s\n", argv[optind]);
@@ -608,6 +644,8 @@ write_f(int argc, char **argv)
gettimeofday(&t1, NULL);
if (pflag)
cnt = do_pwrite(buf, offset, count, &total);
+ else if (bflag)
+ cnt = do_save_vmstate(buf, offset, count, &total);
else
cnt = do_write(buf, offset, count, &total);
gettimeofday(&t2, NULL);
@@ -636,7 +674,7 @@ static const cmdinfo_t write_cmd = {
.cfunc = write_f,
.argmin = 2,
.argmax = -1,
- .args = "[-aCpq] [-P pattern ] off len",
+ .args = "[-abCpq] [-P pattern ] off len",
.oneline = "writes a number of bytes at a specified offset",
.help = write_help,
};
@@ -1199,23 +1237,19 @@ static int openfile(char *name, int flags, int growable)
if (!bs)
return 1;
+ if (growable) {
+ flags |= BDRV_O_FILE;
+ }
+
if (bdrv_open(bs, name, flags) == -1) {
fprintf(stderr, "%s: can't open device %s\n", progname, name);
bs = NULL;
return 1;
}
-
if (growable) {
- if (!bs->drv || !bs->drv->protocol_name) {
- fprintf(stderr,
- "%s: only protocols can be opened growable\n",
- progname);
- return 1;
- }
bs->growable = 1;
}
-
return 0;
}
@@ -1327,6 +1361,7 @@ static void usage(const char *name)
" -r, --read-only export read-only\n"
" -s, --snapshot use snapshot file\n"
" -n, --nocache disable host cache\n"
+" -g, --growable allow file to grow (only applies to protocols)\n"
" -m, --misalign misalign allocations for O_DIRECT\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
diff --git a/qemu-lock.h b/qemu-lock.h
index b912e79a5..029fae00c 100644
--- a/qemu-lock.h
+++ b/qemu-lock.h
@@ -12,8 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
*/
/* Locking primitives. Most of this code should be redundant -
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 1b0a6ef62..8e4443de9 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -306,6 +306,11 @@ STEXI
Read I/O port.
ETEXI
+ { "o", "/ii", do_ioport_write,
+ "/fmt addr value", "I/O port write" },
+STEXI
+Write to I/O port.
+ETEXI
{ "sendkey", "si?", do_sendkey,
"keys [hold_ms]", "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)" },
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 910148712..7eed6424b 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <qemu-common.h>
diff --git a/s390-dis.c b/s390-dis.c
index fa2479216..86dd84f34 100644
--- a/s390-dis.c
+++ b/s390-dis.c
@@ -15,9 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include "dis-asm.h"
@@ -39,9 +37,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef S390_H
#define S390_H
@@ -413,9 +409,7 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
diff --git a/savevm.c b/savevm.c
index 113f2207c..181c08849 100644
--- a/savevm.c
+++ b/savevm.c
@@ -556,7 +556,9 @@ int qemu_file_rate_limit(QEMUFile *f)
size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate)
{
- if (f->set_rate_limit)
+ /* any failed or completed migration keeps its state to allow probing of
+ * migration data, but has no associated file anymore */
+ if (f && f->set_rate_limit)
return f->set_rate_limit(f->opaque, new_rate);
return 0;
diff --git a/sh4-dis.c b/sh4-dis.c
index eb4245e00..d183176e1 100644
--- a/sh4-dis.c
+++ b/sh4-dis.c
@@ -13,9 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include "dis-asm.h"
diff --git a/softmmu_header.h b/softmmu_header.h
index a1b380849..6a36e01dc 100644
--- a/softmmu_header.h
+++ b/softmmu_header.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if DATA_SIZE == 8
#define SUFFIX q
@@ -70,150 +69,6 @@
#define ADDR_READ addr_read
#endif
-#if (DATA_SIZE <= 4) && (TARGET_LONG_BITS == 32) && defined(__i386__) && \
- (ACCESS_TYPE < NB_MMU_MODES) && defined(ASM_SOFTMMU)
-
-static inline RES_TYPE glue(glue(ld, USUFFIX), MEMSUFFIX)(target_ulong ptr)
-{
- int res;
-
- asm volatile ("movl %1, %%edx\n"
- "movl %1, %%eax\n"
- "shrl %3, %%edx\n"
- "andl %4, %%eax\n"
- "andl %2, %%edx\n"
- "leal %5(%%edx, %%ebp), %%edx\n"
- "cmpl (%%edx), %%eax\n"
- "movl %1, %%eax\n"
- "je 1f\n"
- "movl %6, %%edx\n"
- "call %7\n"
- "movl %%eax, %0\n"
- "jmp 2f\n"
- "1:\n"
- "addl 12(%%edx), %%eax\n"
-#if DATA_SIZE == 1
- "movzbl (%%eax), %0\n"
-#elif DATA_SIZE == 2
- "movzwl (%%eax), %0\n"
-#elif DATA_SIZE == 4
- "movl (%%eax), %0\n"
-#else
-#error unsupported size
-#endif
- "2:\n"
- : "=r" (res)
- : "r" (ptr),
- "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_read)),
- "i" (CPU_MMU_INDEX),
- "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))
- : "%eax", "%ecx", "%edx", "memory", "cc");
- return res;
-}
-
-#if DATA_SIZE <= 2
-static inline int glue(glue(lds, SUFFIX), MEMSUFFIX)(target_ulong ptr)
-{
- int res;
-
- asm volatile ("movl %1, %%edx\n"
- "movl %1, %%eax\n"
- "shrl %3, %%edx\n"
- "andl %4, %%eax\n"
- "andl %2, %%edx\n"
- "leal %5(%%edx, %%ebp), %%edx\n"
- "cmpl (%%edx), %%eax\n"
- "movl %1, %%eax\n"
- "je 1f\n"
- "movl %6, %%edx\n"
- "call %7\n"
-#if DATA_SIZE == 1
- "movsbl %%al, %0\n"
-#elif DATA_SIZE == 2
- "movswl %%ax, %0\n"
-#else
-#error unsupported size
-#endif
- "jmp 2f\n"
- "1:\n"
- "addl 12(%%edx), %%eax\n"
-#if DATA_SIZE == 1
- "movsbl (%%eax), %0\n"
-#elif DATA_SIZE == 2
- "movswl (%%eax), %0\n"
-#else
-#error unsupported size
-#endif
- "2:\n"
- : "=r" (res)
- : "r" (ptr),
- "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_read)),
- "i" (CPU_MMU_INDEX),
- "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))
- : "%eax", "%ecx", "%edx", "memory", "cc");
- return res;
-}
-#endif
-
-static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE v)
-{
- asm volatile ("movl %0, %%edx\n"
- "movl %0, %%eax\n"
- "shrl %3, %%edx\n"
- "andl %4, %%eax\n"
- "andl %2, %%edx\n"
- "leal %5(%%edx, %%ebp), %%edx\n"
- "cmpl (%%edx), %%eax\n"
- "movl %0, %%eax\n"
- "je 1f\n"
-#if DATA_SIZE == 1
- "movzbl %b1, %%edx\n"
-#elif DATA_SIZE == 2
- "movzwl %w1, %%edx\n"
-#elif DATA_SIZE == 4
- "movl %1, %%edx\n"
-#else
-#error unsupported size
-#endif
- "movl %6, %%ecx\n"
- "call %7\n"
- "jmp 2f\n"
- "1:\n"
- "addl 8(%%edx), %%eax\n"
-#if DATA_SIZE == 1
- "movb %b1, (%%eax)\n"
-#elif DATA_SIZE == 2
- "movw %w1, (%%eax)\n"
-#elif DATA_SIZE == 4
- "movl %1, (%%eax)\n"
-#else
-#error unsupported size
-#endif
- "2:\n"
- :
- : "r" (ptr),
-#if DATA_SIZE == 1
- "q" (v),
-#else
- "r" (v),
-#endif
- "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
- "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_write)),
- "i" (CPU_MMU_INDEX),
- "m" (*(uint8_t *)&glue(glue(__st, SUFFIX), MMUSUFFIX))
- : "%eax", "%ecx", "%edx", "memory", "cc");
-}
-
-#else
-
/* generic load/store macros */
static inline RES_TYPE glue(glue(ld, USUFFIX), MEMSUFFIX)(target_ulong ptr)
@@ -284,8 +139,6 @@ static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE
#endif /* ACCESS_TYPE != (NB_MMU_MODES + 1) */
-#endif /* !asm */
-
#if ACCESS_TYPE != (NB_MMU_MODES + 1)
#if DATA_SIZE == 8
diff --git a/softmmu_template.h b/softmmu_template.h
index 4b33aef5f..018d7fe75 100644
--- a/softmmu_template.h
+++ b/softmmu_template.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define DATA_SIZE (1 << SHIFT)
diff --git a/sparc-dis.c b/sparc-dis.c
index f88efe66c..a71404fe6 100644
--- a/sparc-dis.c
+++ b/sparc-dis.c
@@ -23,9 +23,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS or GDB; see the file COPYING. If not, write to
- the Free Software Foundation, 51 Franklin Street - Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with GAS or GDB; see the file COPYING. If not,
+ see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include "dis-asm.h"
@@ -256,9 +255,8 @@ static const char *sparc_decode_sparclet_cpreg (int);
for more details.
You should have received a copy of the GNU General Public License
- along with this software; see the file COPYING. If not, write to
- the Free Software Foundation, 51 Franklin Street - Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this software; see the file COPYING. If not,
+ see <http://www.gnu.org/licenses/>. */
/* FIXME-someday: perhaps the ,a's and such should be embedded in the
instruction's name rather than the args. This would make gas faster, pinsn
@@ -2258,9 +2256,7 @@ sparc_decode_sparclet_cpreg (int value)
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Bitmask of v9 architectures. */
#define MASK_V9 ((1 << SPARC_OPCODE_ARCH_V9) \
diff --git a/tap-win32.c b/tap-win32.c
index ba93355a7..44f96e537 100644
--- a/tap-win32.c
+++ b/tap-win32.c
@@ -23,8 +23,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING included with this
- * distribution); if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * distribution); if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-common.h"
#include "net.h"
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 8c64def76..975d65b65 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__CPU_ALPHA_H__)
diff --git a/target-alpha/exec.h b/target-alpha/exec.h
index 77eaf53c1..35d6a1677 100644
--- a/target-alpha/exec.h
+++ b/target-alpha/exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__ALPHA_EXEC_H__)
diff --git a/target-alpha/helper.c b/target-alpha/helper.c
index fc68a7e0b..fcd5841e0 100644
--- a/target-alpha/helper.c
+++ b/target-alpha/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index 82cb2d9f1..22812ca46 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "exec.h"
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 4cd24d847..1fc5119cb 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index f98655f80..194f16cc7 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_ARM_H
#define CPU_ARM_H
diff --git a/target-arm/exec.h b/target-arm/exec.h
index 710a2f988..325c3ee27 100644
--- a/target-arm/exec.h
+++ b/target-arm/exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "dyngen-exec.h"
diff --git a/target-arm/iwmmxt_helper.c b/target-arm/iwmmxt_helper.c
index 2e4193ecf..3332f708c 100644
--- a/target-arm/iwmmxt_helper.c
+++ b/target-arm/iwmmxt_helper.c
@@ -16,8 +16,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index f71162bc4..d4ae4ae7e 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "exec.h"
#include "helpers.h"
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 64956e4d2..4db8d0e26 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -16,8 +16,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 7c4e2576d..5717fa780 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_CRIS_H
#define CPU_CRIS_H
diff --git a/target-cris/crisv32-decode.h b/target-cris/crisv32-decode.h
index a8042ab49..ed141de0b 100644
--- a/target-cris/crisv32-decode.h
+++ b/target-cris/crisv32-decode.h
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* Convenient binary macros. */
diff --git a/target-cris/exec.h b/target-cris/exec.h
index 5f3cc0017..0b6c5ebf2 100644
--- a/target-cris/exec.h
+++ b/target-cris/exec.h
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "dyngen-exec.h"
diff --git a/target-cris/helper.c b/target-cris/helper.c
index 405454f50..c0e11d1aa 100644
--- a/target-cris/helper.c
+++ b/target-cris/helper.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/target-cris/mmu.c b/target-cris/mmu.c
index 1f3d48322..bc5b7105d 100644
--- a/target-cris/mmu.c
+++ b/target-cris/mmu.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_ONLY
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index edfaf41a8..b44b9325f 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "exec.h"
diff --git a/target-cris/opcode-cris.h b/target-cris/opcode-cris.h
index 76fbc2f3c..8d4749deb 100644
--- a/target-cris/opcode-cris.h
+++ b/target-cris/opcode-cris.h
@@ -17,8 +17,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef __CRIS_H_INCLUDED_
#define __CRIS_H_INCLUDED_
diff --git a/target-cris/translate.c b/target-cris/translate.c
index fd9380cf6..bd3ae3d76 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 33555f832..08200edaf 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_I386_H
#define CPU_I386_H
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 42b471a26..3e998d24f 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "dyngen-exec.h"
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 2a155d303..c819ef2c0 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
@@ -136,8 +135,7 @@ static x86_def_t x86_defs[] = {
CPUID_PSE36,
.ext_features = CPUID_EXT_SSE3,
.ext2_features = (PPRO_FEATURES & 0x0183F3FF) |
- CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX |
- CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT,
+ CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
.ext3_features = CPUID_EXT3_SVM,
.xlevel = 0x8000000A,
.model_id = "QEMU Virtual CPU version " QEMU_VERSION,
diff --git a/target-i386/helper_template.h b/target-i386/helper_template.h
index c1087ac98..afc41fb98 100644
--- a/target-i386/helper_template.h
+++ b/target-i386/helper_template.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define DATA_BITS (1 << (3 + SHIFT))
#define SHIFT_MASK (DATA_BITS - 1)
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index ed22c7a65..6808a3596 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define CPU_NO_GLOBAL_REGS
#include "exec.h"
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 35ac2117f..47a01d40f 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if SHIFT == 0
#define Reg MMXReg
diff --git a/target-i386/ops_sse_header.h b/target-i386/ops_sse_header.h
index 03e9b1727..53add99f9 100644
--- a/target-i386/ops_sse_header.h
+++ b/target-i386/ops_sse_header.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if SHIFT == 0
#define Reg MMXReg
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 472600937..380009e39 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index feffb6bf7..d071a0bbd 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_M68K_H
#define CPU_M68K_H
diff --git a/target-m68k/exec.h b/target-m68k/exec.h
index 3a86b1f89..9aad5fa1e 100644
--- a/target-m68k/exec.h
+++ b/target-m68k/exec.h
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "dyngen-exec.h"
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index af9ce229e..9f30a7479 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index a339a179c..07111073f 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "exec.h"
#include "helpers.h"
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 422f0a46e..b37578baf 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -15,8 +15,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 97f708c5a..436bcd2ca 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -14,8 +14,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_MICROBLAZE_H
#define CPU_MICROBLAZE_H
diff --git a/target-microblaze/exec.h b/target-microblaze/exec.h
index 55045bb92..552f6224d 100644
--- a/target-microblaze/exec.h
+++ b/target-microblaze/exec.h
@@ -14,8 +14,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "dyngen-exec.h"
diff --git a/target-microblaze/helper.c b/target-microblaze/helper.c
index 00936594d..d9a952389 100644
--- a/target-microblaze/helper.c
+++ b/target-microblaze/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/target-microblaze/microblaze-decode.h b/target-microblaze/microblaze-decode.h
index 27b01288c..2c975d667 100644
--- a/target-microblaze/microblaze-decode.h
+++ b/target-microblaze/microblaze-decode.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* Convenient binary macros. */
diff --git a/target-microblaze/mmu.c b/target-microblaze/mmu.c
index d14373ce4..adf11c839 100644
--- a/target-microblaze/mmu.c
+++ b/target-microblaze/mmu.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/target-microblaze/mmu.h b/target-microblaze/mmu.h
index 975933396..814c33cc7 100644
--- a/target-microblaze/mmu.h
+++ b/target-microblaze/mmu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define MMU_R_PID 0
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c
index 1a0776d2c..f86b1c78c 100644
--- a/target-microblaze/op_helper.c
+++ b/target-microblaze/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 33fff9c2c..9c8631dc2 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
diff --git a/target-mips/helper.c b/target-mips/helper.c
index fecbcb2f1..736902576 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index b4c98fc05..194414c74 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include "exec.h"
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 2eee11bd6..6a1273f03 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -16,8 +16,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c
index d7617f602..eb35dbad3 100644
--- a/target-mips/translate_init.c
+++ b/target-mips/translate_init.c
@@ -15,8 +15,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* CPU / CPU family specific config register values. */
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index fe6688d1a..d697bd286 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__CPU_PPC_H__)
#define __CPU_PPC_H__
diff --git a/target-ppc/exec.h b/target-ppc/exec.h
index f6b9ee6c8..0481eb235 100644
--- a/target-ppc/exec.h
+++ b/target-ppc/exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__PPC_H__)
#define __PPC_H__
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 3629c9928..91bdaf3d1 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
index 15392393e..2a1f541d1 100644
--- a/target-ppc/helper_regs.h
+++ b/target-ppc/helper_regs.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__HELPER_REGS_H__)
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 94e530327..c352aa71b 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "exec.h"
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 8fbcf760f..da3d7de8a 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 96ba2e55b..3b6e2d504 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* A lot of PowerPC definition have been included here.
diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index e597f653a..91c080fd8 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CPU_SH4_H
#define _CPU_SH4_H
diff --git a/target-sh4/exec.h b/target-sh4/exec.h
index d2926750b..1c08eafa6 100644
--- a/target-sh4/exec.h
+++ b/target-sh4/exec.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EXEC_SH4_H
#define _EXEC_SH4_H
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index 94be136fa..088d36a5f 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index 616b4f9a4..6dc8503a0 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <stdlib.h>
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 1f461b7a4..b272f4c06 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index 5f9ad409e..04513f82d 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 6de40791b..a372ecab1 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -15,8 +15,7 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
diff --git a/tests/linux-test.c b/tests/linux-test.c
index 934b7eeef..9986e299b 100644
--- a/tests/linux-test.c
+++ b/tests/linux-test.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/tests/test-i386.c b/tests/test-i386.c
index e0dfa6c8b..b28b257f8 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -14,9 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
#include <stdlib.h>
diff --git a/tests/test-mmap.c b/tests/test-mmap.c
index 1e85ce850..fcb365f40 100644
--- a/tests/test-mmap.c
+++ b/tests/test-mmap.c
@@ -19,9 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/texi2pod.pl b/texi2pod.pl
index 5d28a056d..9ed056ad1 100755
--- a/texi2pod.pl
+++ b/texi2pod.pl
@@ -15,9 +15,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING. If not, write to
-# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-# Boston MA 02110-1301, USA.
+# along with GCC; see the file COPYING. If not,
+# see <http://www.gnu.org/licenses/>.
# This does trivial (and I mean _trivial_) conversion of Texinfo
# markup to Perl POD format. It's intended to be used to extract
diff --git a/thunk.c b/thunk.c
index 6813c9ffa..06571889a 100644
--- a/thunk.c
+++ b/thunk.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
diff --git a/thunk.h b/thunk.h
index 597d753c7..109c541f0 100644
--- a/thunk.h
+++ b/thunk.h
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef THUNK_H
#define THUNK_H
diff --git a/translate-all.c b/translate-all.c
index 4bdf2c99d..8ef8a0b2f 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -14,8 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
diff --git a/uboot_image.h b/uboot_image.h
index b6d49bee2..9fc2760b5 100644
--- a/uboot_image.h
+++ b/uboot_image.h
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*
********************************************************************
* NOTE: This header file defines an interface to U-Boot. Including
diff --git a/vl.c b/vl.c
index fcdc42f07..39e96a779 100644
--- a/vl.c
+++ b/vl.c
@@ -6067,6 +6067,9 @@ int main(int argc, char **argv, char **envp)
module_call_init(MODULE_INIT_DEVICE);
+ if (machine->compat_props) {
+ qdev_prop_register_compat(machine->compat_props);
+ }
machine->init(ram_size, boot_devices,
kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
@@ -6191,10 +6194,8 @@ int main(int argc, char **argv, char **envp)
if (loadvm)
do_loadvm(cur_mon, loadvm);
- if (incoming) {
- autostart = 0; /* fixme how to deal with -daemonize */
+ if (incoming)
qemu_start_incoming_migration(incoming);
- }
if (autostart)
vm_start();