summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--Makefile.objs7
-rw-r--r--Makefile.target2
-rw-r--r--Makefile.user4
-rw-r--r--audio/wavaudio.c46
-rw-r--r--audio/wavcapture.c79
-rw-r--r--block/vvfat.c2
-rw-r--r--bswap.h3
-rwxr-xr-xconfigure1
-rw-r--r--console.c13
-rw-r--r--darwin-user/machload.c4
-rw-r--r--docs/tracing.txt5
-rw-r--r--hw/bonito.c24
-rw-r--r--hw/fmopl.c2
-rw-r--r--hw/hpet.c8
-rw-r--r--hw/integratorcp.c16
-rw-r--r--hw/loader.c4
-rw-r--r--hw/mips_fulong2e.c2
-rw-r--r--hw/mst_fpga.c4
-rw-r--r--hw/qdev.c6
-rw-r--r--hw/sun4u.c1
-rw-r--r--hw/vga.c8
-rw-r--r--hw/virtio.c10
-rw-r--r--hw/virtio.h9
-rw-r--r--hw/vt82c686.c12
-rw-r--r--linux-user/syscall.c2
-rw-r--r--mips-dis.c2
-rw-r--r--qemu-io.c2
-rwxr-xr-xscripts/tracetool20
-rw-r--r--slirp/tcp_input.c8
-rw-r--r--slirp/tcp_subr.c2
-rw-r--r--target-i386/ops_sse.h36
-rw-r--r--target-ppc/helper.c2
-rw-r--r--tcg/i386/tcg-target.c4
-rw-r--r--tcg/ia64/tcg-target.c5
-rw-r--r--tcg/ppc64/tcg-target.c2
-rw-r--r--tcg/s390/tcg-target.c4
-rw-r--r--tcg/sparc/tcg-target.c6
-rw-r--r--tests/test-i386.c2
-rw-r--r--trace-events37
-rw-r--r--vl.c1
41 files changed, 254 insertions, 158 deletions
diff --git a/Makefile b/Makefile
index 7e9382f101..a211158e2d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
# Makefile for QEMU.
+# Always point to the root of the build tree (needs GNU make).
+BUILD_DIR=$(CURDIR)
+
GENERATED_HEADERS = config-host.h trace.h qemu-options.def
ifeq ($(TRACE_BACKEND),dtrace)
GENERATED_HEADERS += trace-dtrace.h
@@ -37,7 +40,7 @@ else
DOCS=
endif
-SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
+SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
diff --git a/Makefile.objs b/Makefile.objs
index 62020d739c..1c65087ea7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -177,6 +177,7 @@ user-obj-y =
user-obj-y += envlist.o path.o
user-obj-y += tcg-runtime.o host-utils.o
user-obj-y += cutils.o cache-utils.o
+user-obj-y += $(trace-obj-y)
######################################################################
# libhw
@@ -340,12 +341,12 @@ trace.h: trace.h-timestamp trace-dtrace.h
else
trace.h: trace.h-timestamp
endif
-trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -h < $< > $@," GEN trace.h")
@cmp -s $@ trace.h || cp $@ trace.h
trace.c: trace.c-timestamp
-trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -c < $< > $@," GEN trace.c")
@cmp -s $@ trace.c || cp $@ trace.c
@@ -358,7 +359,7 @@ trace-dtrace.h: trace-dtrace.dtrace
# but that gets picked up by QEMU's Makefile as an external dependency
# rule file. So we use '.dtrace' instead
trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
-trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
+trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -d < $< > $@," GEN trace-dtrace.dtrace")
@cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
diff --git a/Makefile.target b/Makefile.target
index f7084532e6..88d2f1fb7e 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -383,6 +383,7 @@ obj-y += $(addprefix ../, $(common-obj-y))
obj-y += $(addprefix ../libdis/, $(libdis-y))
obj-y += $(libobj-y)
obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
+obj-y += $(addprefix ../, $(trace-obj-y))
endif # CONFIG_SOFTMMU
@@ -394,7 +395,6 @@ obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
endif # CONFIG_BSD_USER
endif # CONFIG_LINUX_USER
-obj-y += $(addprefix ../, $(trace-obj-y))
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
diff --git a/Makefile.user b/Makefile.user
index 024b7736b9..2b1e4d154e 100644
--- a/Makefile.user
+++ b/Makefile.user
@@ -17,7 +17,9 @@ all: $(user-obj-y)
@true
clean:
- rm -f *.o *.d *.a *~
+ for d in . trace; do \
+ rm -f $$d/*.o $$d/*.d $$d/*.a $$d/*~; \
+ done
# Include automatically generated dependency files
-include $(wildcard *.d */*.d)
diff --git a/audio/wavaudio.c b/audio/wavaudio.c
index aed18176ee..a449b5127e 100644
--- a/audio/wavaudio.c
+++ b/audio/wavaudio.c
@@ -30,7 +30,7 @@
typedef struct WAVVoiceOut {
HWVoiceOut hw;
- QEMUFile *f;
+ FILE *f;
int64_t old_ticks;
void *pcm_buf;
int total_samples;
@@ -76,7 +76,10 @@ static int wav_run_out (HWVoiceOut *hw, int live)
dst = advance (wav->pcm_buf, rpos << hw->info.shift);
hw->clip (dst, src, convert_samples);
- qemu_put_buffer (wav->f, dst, convert_samples << hw->info.shift);
+ if (fwrite (dst, convert_samples << hw->info.shift, 1, wav->f) != 1) {
+ dolog ("wav_run_out: fwrite of %d bytes failed\nReaons: %s\n",
+ convert_samples << hw->info.shift, strerror (errno));
+ }
rpos = (rpos + convert_samples) % hw->samples;
samples -= convert_samples;
@@ -152,7 +155,7 @@ static int wav_init_out (HWVoiceOut *hw, struct audsettings *as)
le_store (hdr + 28, hw->info.freq << (bits16 + stereo), 4);
le_store (hdr + 32, 1 << (bits16 + stereo), 2);
- wav->f = qemu_fopen (conf.wav_path, "wb");
+ wav->f = fopen (conf.wav_path, "wb");
if (!wav->f) {
dolog ("Failed to open wave file `%s'\nReason: %s\n",
conf.wav_path, strerror (errno));
@@ -161,7 +164,11 @@ static int wav_init_out (HWVoiceOut *hw, struct audsettings *as)
return -1;
}
- qemu_put_buffer (wav->f, hdr, sizeof (hdr));
+ if (fwrite (hdr, sizeof (hdr), 1, wav->f) != 1) {
+ dolog ("wav_init_out: failed to write header\nReason: %s\n",
+ strerror(errno));
+ return -1;
+ }
return 0;
}
@@ -180,13 +187,32 @@ static void wav_fini_out (HWVoiceOut *hw)
le_store (rlen, rifflen, 4);
le_store (dlen, datalen, 4);
- qemu_fseek (wav->f, 4, SEEK_SET);
- qemu_put_buffer (wav->f, rlen, 4);
-
- qemu_fseek (wav->f, 32, SEEK_CUR);
- qemu_put_buffer (wav->f, dlen, 4);
+ if (fseek (wav->f, 4, SEEK_SET)) {
+ dolog ("wav_fini_out: fseek to rlen failed\nReason: %s\n",
+ strerror(errno));
+ goto doclose;
+ }
+ if (fwrite (rlen, 4, 1, wav->f) != 1) {
+ dolog ("wav_fini_out: failed to write rlen\nReason: %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ if (fseek (wav->f, 32, SEEK_CUR)) {
+ dolog ("wav_fini_out: fseek to dlen failed\nReason: %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ if (fwrite (dlen, 4, 1, wav->f) != 1) {
+ dolog ("wav_fini_out: failed to write dlen\nReaons: %s\n",
+ strerror (errno));
+ goto doclose;
+ }
- qemu_fclose (wav->f);
+ doclose:
+ if (fclose (wav->f)) {
+ dolog ("wav_fini_out: fclose %p failed\nReason: %s\n",
+ wav->f, strerror (errno));
+ }
wav->f = NULL;
g_free (wav->pcm_buf);
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index c64f0ef075..4f785f5f49 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -3,7 +3,7 @@
#include "audio.h"
typedef struct {
- QEMUFile *f;
+ FILE *f;
int bytes;
char *path;
int freq;
@@ -35,17 +35,37 @@ static void wav_destroy (void *opaque)
uint8_t dlen[4];
uint32_t datalen = wav->bytes;
uint32_t rifflen = datalen + 36;
+ Monitor *mon = cur_mon;
if (wav->f) {
le_store (rlen, rifflen, 4);
le_store (dlen, datalen, 4);
- qemu_fseek (wav->f, 4, SEEK_SET);
- qemu_put_buffer (wav->f, rlen, 4);
-
- qemu_fseek (wav->f, 32, SEEK_CUR);
- qemu_put_buffer (wav->f, dlen, 4);
- qemu_fclose (wav->f);
+ if (fseek (wav->f, 4, SEEK_SET)) {
+ monitor_printf (mon, "wav_destroy: rlen fseek failed\nReason: %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ if (fwrite (rlen, 4, 1, wav->f) != 1) {
+ monitor_printf (mon, "wav_destroy: rlen fwrite failed\nReason %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ if (fseek (wav->f, 32, SEEK_CUR)) {
+ monitor_printf (mon, "wav_destroy: dlen fseek failed\nReason %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ if (fwrite (dlen, 1, 4, wav->f) != 4) {
+ monitor_printf (mon, "wav_destroy: dlen fwrite failed\nReason %s\n",
+ strerror (errno));
+ goto doclose;
+ }
+ doclose:
+ if (fclose (wav->f)) {
+ fprintf (stderr, "wav_destroy: fclose failed: %s",
+ strerror (errno));
+ }
}
g_free (wav->path);
@@ -55,7 +75,10 @@ static void wav_capture (void *opaque, void *buf, int size)
{
WAVState *wav = opaque;
- qemu_put_buffer (wav->f, buf, size);
+ if (fwrite (buf, size, 1, wav->f) != 1) {
+ monitor_printf (cur_mon, "wav_capture: fwrite error\nReason: %s",
+ strerror (errno));
+ }
wav->bytes += size;
}
@@ -71,9 +94,9 @@ static void wav_capture_info (void *opaque)
WAVState *wav = opaque;
char *path = wav->path;
- monitor_printf(cur_mon, "Capturing audio(%d,%d,%d) to %s: %d bytes\n",
- wav->freq, wav->bits, wav->nchannels,
- path ? path : "<not available>", wav->bytes);
+ monitor_printf (cur_mon, "Capturing audio(%d,%d,%d) to %s: %d bytes\n",
+ wav->freq, wav->bits, wav->nchannels,
+ path ? path : "<not available>", wav->bytes);
}
static struct capture_ops wav_capture_ops = {
@@ -98,13 +121,13 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
CaptureVoiceOut *cap;
if (bits != 8 && bits != 16) {
- monitor_printf(mon, "incorrect bit count %d, must be 8 or 16\n", bits);
+ monitor_printf (mon, "incorrect bit count %d, must be 8 or 16\n", bits);
return -1;
}
if (nchannels != 1 && nchannels != 2) {
- monitor_printf(mon, "incorrect channel count %d, must be 1 or 2\n",
- nchannels);
+ monitor_printf (mon, "incorrect channel count %d, must be 1 or 2\n",
+ nchannels);
return -1;
}
@@ -130,10 +153,10 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
le_store (hdr + 28, freq << shift, 4);
le_store (hdr + 32, 1 << shift, 2);
- wav->f = qemu_fopen (path, "wb");
+ wav->f = fopen (path, "wb");
if (!wav->f) {
- monitor_printf(mon, "Failed to open wave file `%s'\nReason: %s\n",
- path, strerror (errno));
+ monitor_printf (mon, "Failed to open wave file `%s'\nReason: %s\n",
+ path, strerror (errno));
g_free (wav);
return -1;
}
@@ -143,19 +166,29 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
wav->nchannels = nchannels;
wav->freq = freq;
- qemu_put_buffer (wav->f, hdr, sizeof (hdr));
+ if (fwrite (hdr, sizeof (hdr), 1, wav->f) != 1) {
+ monitor_printf (mon, "Failed to write header\nReason: %s\n",
+ strerror (errno));
+ goto error_free;
+ }
cap = AUD_add_capture (&as, &ops, wav);
if (!cap) {
- monitor_printf(mon, "Failed to add audio capture\n");
- g_free (wav->path);
- qemu_fclose (wav->f);
- g_free (wav);
- return -1;
+ monitor_printf (mon, "Failed to add audio capture\n");
+ goto error_free;
}
wav->cap = cap;
s->opaque = wav;
s->ops = wav_capture_ops;
return 0;
+
+error_free:
+ g_free (wav->path);
+ if (fclose (wav->f)) {
+ monitor_printf (mon, "Failed to close wave file\nReason: %s\n",
+ strerror (errno));
+ }
+ g_free (wav);
+ return -1;
}
diff --git a/block/vvfat.c b/block/vvfat.c
index 187ac96f25..f567c9adb9 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1789,7 +1789,7 @@ DLOG(fprintf(stderr, "read cluster %d (sector %d)\n", (int)cluster_num, (int)clu
for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) {
int cluster_count = 0;
-DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i));
+DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i));
if (is_volume_label(direntries + i) || is_dot(direntries + i) ||
is_free(direntries + i))
continue;
diff --git a/bswap.h b/bswap.h
index f41bebed83..cc7f84d30f 100644
--- a/bswap.h
+++ b/bswap.h
@@ -4,6 +4,7 @@
#include "config-host.h"
#include <inttypes.h>
+#include "softfloat.h"
#ifdef CONFIG_MACHINE_BSWAP_H
#include <sys/endian.h>
@@ -11,8 +12,6 @@
#include <machine/bswap.h>
#else
-#include "softfloat.h"
-
#ifdef CONFIG_BYTESWAP_H
#include <byteswap.h>
#else
diff --git a/configure b/configure
index 0875f95979..ad924c40a1 100755
--- a/configure
+++ b/configure
@@ -3669,6 +3669,7 @@ fi
d=libuser
mkdir -p $d
+mkdir -p $d/trace
symlink $source_path/Makefile.user $d/Makefile
if test "$static" = "no" -a "$user_pie" = "yes" ; then
echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
diff --git a/console.c b/console.c
index 5c7a93b655..6dfcc47940 100644
--- a/console.c
+++ b/console.c
@@ -115,6 +115,7 @@ typedef enum {
/* ??? This is mis-named.
It is used for both text and graphical consoles. */
struct TextConsole {
+ int index;
console_type_t console_type;
DisplayState *ds;
/* Graphic console state. */
@@ -177,12 +178,15 @@ void vga_hw_screen_dump(const char *filename)
TextConsole *previous_active_console;
previous_active_console = active_console;
- active_console = consoles[0];
+
/* There is currently no way of specifying which screen we want to dump,
so always dump the first one. */
- if (consoles[0] && consoles[0]->hw_screen_dump)
+ console_select(0);
+ if (consoles[0] && consoles[0]->hw_screen_dump) {
consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
- active_console = previous_active_console;
+ }
+
+ console_select(previous_active_console->index);
}
void vga_hw_text_update(console_ch_t *chardata)
@@ -1247,6 +1251,7 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
s->ds = ds;
s->console_type = console_type;
if (console_type != GRAPHIC_CONSOLE) {
+ s->index = nb_consoles;
consoles[nb_consoles++] = s;
} else {
/* HACK: Put graphical consoles before text consoles. */
@@ -1254,7 +1259,9 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
if (consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
break;
consoles[i] = consoles[i - 1];
+ consoles[i]->index = i;
}
+ s->index = i;
consoles[i] = s;
nb_consoles++;
}
diff --git a/darwin-user/machload.c b/darwin-user/machload.c
index 3bc3b65559..0aa828298b 100644
--- a/darwin-user/machload.c
+++ b/darwin-user/machload.c
@@ -865,11 +865,11 @@ unsigned long setup_arg_pages(void * mh, char ** argv, char ** env)
page_set_flags((int)argv[i], (int)(argv[i]+strlen(argv[i])), PROT_READ | PAGE_VALID);
}
- DPRINTF("pushing argc %d \n", argc);
+ DPRINTF("pushing argc %d\n", argc);
stl(stack, argc);
stack--;
- DPRINTF("pushing mh 0x%x \n", (int)mh);
+ DPRINTF("pushing mh 0x%x\n", (int)mh);
stl(stack, (int) mh);
/* Stack points on the mh */
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 4b27ab0c2a..d0171aabda 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -80,10 +80,7 @@ Trace events should use types as follows:
Format strings should reflect the types defined in the trace event. Take
special care to use PRId64 and PRIu64 for int64_t and uint64_t types,
-respectively. This ensures portability between 32- and 64-bit platforms. Note
-that format strings must begin and end with double quotes. When using
-portability macros, ensure they are preceded and followed by double quotes:
-"value %"PRIx64"".
+respectively. This ensures portability between 32- and 64-bit platforms.
=== Hints for adding new trace events ===
diff --git a/hw/bonito.c b/hw/bonito.c
index 8708e95688..fdb8198f62 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -241,7 +241,7 @@ static void bonito_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
saddr = (addr - BONITO_REGBASE) >> 2;
- DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x \n", addr, val, saddr);
+ DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr);
switch (saddr) {
case BONITO_BONPONCFG:
case BONITO_IODEVCFG:
@@ -287,10 +287,10 @@ static void bonito_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
break;
case BONITO_INTEN:
case BONITO_INTISR:
- DPRINTF("write to readonly bonito register %x \n", saddr);
+ DPRINTF("write to readonly bonito register %x\n", saddr);
break;
default:
- DPRINTF("write to unknown bonito register %x \n", saddr);
+ DPRINTF("write to unknown bonito register %x\n", saddr);
break;
}
}
@@ -302,7 +302,7 @@ static uint32_t bonito_readl(void *opaque, target_phys_addr_t addr)
saddr = (addr - BONITO_REGBASE) >> 2;
- DPRINTF("bonito_readl "TARGET_FMT_plx" \n", addr);
+ DPRINTF("bonito_readl "TARGET_FMT_plx"\n", addr);
switch (saddr) {
case BONITO_INTISR:
return s->regs[saddr];
@@ -328,7 +328,7 @@ static void bonito_pciconf_writel(void *opaque, target_phys_addr_t addr,
{
PCIBonitoState *s = opaque;
- DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x \n", addr, val);
+ DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x\n", addr, val);
s->dev.config_write(&s->dev, addr, val, 4);
}
@@ -443,7 +443,7 @@ static uint32_t bonito_sbridge_pciaddr(void *opaque, target_phys_addr_t addr)
exit(1);
}
pciaddr = PCI_ADDR(pci_bus_num(s->pcihost->bus), devno, funno, regno);
- DPRINTF("cfgaddr %x pciaddr %x busno %x devno %d funno %d regno %d \n",
+ DPRINTF("cfgaddr %x pciaddr %x busno %x devno %d funno %d regno %d\n",
cfgaddr, pciaddr, pci_bus_num(s->pcihost->bus), devno, funno, regno);
return pciaddr;
@@ -456,7 +456,7 @@ static void bonito_spciconf_writeb(void *opaque, target_phys_addr_t addr,
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_writeb "TARGET_FMT_plx" val %x \n", addr, val);
+ DPRINTF("bonito_spciconf_writeb "TARGET_FMT_plx" val %x\n", addr, val);
pciaddr = bonito_sbridge_pciaddr(s, addr);
if (pciaddr == 0xffffffff) {
@@ -480,7 +480,7 @@ static void bonito_spciconf_writew(void *opaque, target_phys_addr_t addr,
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_writew "TARGET_FMT_plx" val %x \n", addr, val);
+ DPRINTF("bonito_spciconf_writew "TARGET_FMT_plx" val %x\n", addr, val);
assert((addr&0x1)==0);
pciaddr = bonito_sbridge_pciaddr(s, addr);
@@ -506,7 +506,7 @@ static void bonito_spciconf_writel(void *opaque, target_phys_addr_t addr,
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_writel "TARGET_FMT_plx" val %x \n", addr, val);
+ DPRINTF("bonito_spciconf_writel "TARGET_FMT_plx" val %x\n", addr, val);
assert((addr&0x3)==0);
pciaddr = bonito_sbridge_pciaddr(s, addr);
@@ -531,7 +531,7 @@ static uint32_t bonito_spciconf_readb(void *opaque, target_phys_addr_t addr)
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_readb "TARGET_FMT_plx" \n", addr);
+ DPRINTF("bonito_spciconf_readb "TARGET_FMT_plx"\n", addr);
pciaddr = bonito_sbridge_pciaddr(s, addr);
if (pciaddr == 0xffffffff) {
@@ -555,7 +555,7 @@ static uint32_t bonito_spciconf_readw(void *opaque, target_phys_addr_t addr)
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_readw "TARGET_FMT_plx" \n", addr);
+ DPRINTF("bonito_spciconf_readw "TARGET_FMT_plx"\n", addr);
assert((addr&0x1)==0);
pciaddr = bonito_sbridge_pciaddr(s, addr);
@@ -581,7 +581,7 @@ static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr)
uint32_t pciaddr;
uint16_t status;
- DPRINTF("bonito_spciconf_readl "TARGET_FMT_plx" \n", addr);
+ DPRINTF("bonito_spciconf_readl "TARGET_FMT_plx"\n", addr);
assert((addr&0x3) == 0);
pciaddr = bonito_sbridge_pciaddr(s, addr);
diff --git a/hw/fmopl.c b/hw/fmopl.c
index d8a0f36b35..5ad52ab7d2 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -606,7 +606,7 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE )
}
#if 0
for (i = 0;i < 64 ;i++){ /* make for overflow area */
- LOG(LOG_WAR,("rate %2d , ar %f ms , dr %f ms \n",i,
+ LOG(LOG_WAR, ("rate %2d , ar %f ms , dr %f ms\n", i,
((double)(EG_ENT<<ENV_BITS) / OPL->AR_TABLE[i]) * (1000.0 / OPL->rate),
((double)(EG_ENT<<ENV_BITS) / OPL->DR_TABLE[i]) * (1000.0 / OPL->rate) ));
}
diff --git a/hw/hpet.c b/hw/hpet.c
index 4eda33d900..12bd64d8b1 100644
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -397,7 +397,7 @@ static uint32_t hpet_ram_readl(void *opaque, target_phys_addr_t addr)
case HPET_CFG:
return s->config;
case HPET_CFG + 4:
- DPRINTF("qemu: invalid HPET_CFG + 4 hpet_ram_readl \n");
+ DPRINTF("qemu: invalid HPET_CFG + 4 hpet_ram_readl\n");
return 0;
case HPET_COUNTER:
if (hpet_enabled(s)) {
@@ -458,7 +458,7 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr,
uint8_t timer_id = (addr - 0x100) / 0x20;
HPETTimer *timer = &s->timer[timer_id];
- DPRINTF("qemu: hpet_ram_writel timer_id = %#x \n", timer_id);
+ DPRINTF("qemu: hpet_ram_writel timer_id = %#x\n", timer_id);
if (timer_id > s->num_timers) {
DPRINTF("qemu: timer id out of range\n");
return;
@@ -485,7 +485,7 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr,
DPRINTF("qemu: invalid HPET_TN_CFG+4 write\n");
break;
case HPET_TN_CMP: // comparator register
- DPRINTF("qemu: hpet_ram_writel HPET_TN_CMP \n");
+ DPRINTF("qemu: hpet_ram_writel HPET_TN_CMP\n");
if (timer->config & HPET_TN_32BIT) {
new_val = (uint32_t)new_val;
}
@@ -570,7 +570,7 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr,
}
break;
case HPET_CFG + 4:
- DPRINTF("qemu: invalid HPET_CFG+4 write \n");
+ DPRINTF("qemu: invalid HPET_CFG+4 write\n");
break;
case HPET_STATUS:
val = new_val & s->isr;
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 3c8982ea29..9a289b4776 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -14,6 +14,7 @@
#include "arm-misc.h"
#include "net.h"
#include "exec-memory.h"
+#include "sysemu.h"
typedef struct {
SysBusDevice busdev;
@@ -126,15 +127,20 @@ static void integratorcm_do_remap(integratorcm_state *s, int flash)
static void integratorcm_set_ctrl(integratorcm_state *s, uint32_t value)
{
if (value & 8) {
- hw_error("Board reset\n");
+ qemu_system_reset_request();
}
- if ((s->cm_init ^ value) & 4) {
+ if ((s->cm_ctrl ^ value) & 4) {
integratorcm_do_remap(s, (value & 4) == 0);
}
- if ((s->cm_init ^ value) & 1) {
- printf("Green LED %s\n", (value & 1) ? "on" : "off");
+ if ((s->cm_ctrl ^ value) & 1) {
+ /* (value & 1) != 0 means the green "MISC LED" is lit.
+ * We don't have any nice place to display LEDs. printf is a bad
+ * idea because Linux uses the LED as a heartbeat and the output
+ * will swamp anything else on the terminal.
+ */
}
- s->cm_init = (s->cm_init & ~ 5) | (value ^ 5);
+ /* Note that the RESET bit [3] always reads as zero */
+ s->cm_ctrl = (s->cm_ctrl & ~5) | (value & 5);
}
static void integratorcm_update(integratorcm_state *s)
diff --git a/hw/loader.c b/hw/loader.c
index 8efb1466cd..5676c18214 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -779,13 +779,13 @@ void do_info_roms(Monitor *mon)
QTAILQ_FOREACH(rom, &roms, next) {
if (!rom->fw_file) {
monitor_printf(mon, "addr=" TARGET_FMT_plx
- " size=0x%06zx mem=%s name=\"%s\" \n",
+ " size=0x%06zx mem=%s name=\"%s\"\n",
rom->addr, rom->romsize,
rom->isrom ? "rom" : "ram",
rom->name);
} else {
monitor_printf(mon, "fw=%s/%s"
- " size=0x%06zx name=\"%s\" \n",
+ " size=0x%06zx name=\"%s\"\n",
rom->fw_dir,
rom->fw_file,
rom->romsize,
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index abe30569f2..f52b8c5083 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -343,7 +343,7 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
via_devfn = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0));
if (via_devfn < 0) {
- fprintf(stderr, "vt82c686b_init error \n");
+ fprintf(stderr, "vt82c686b_init error\n");
exit(1);
}
diff --git a/hw/mst_fpga.c b/hw/mst_fpga.c
index 4e47574b63..7bcd5d75e8 100644
--- a/hw/mst_fpga.c
+++ b/hw/mst_fpga.c
@@ -118,7 +118,7 @@ mst_fpga_readb(void *opaque, target_phys_addr_t addr)
return s->pcmcia1;
default:
printf("Mainstone - mst_fpga_readb: Bad register offset "
- "0x" TARGET_FMT_plx " \n", addr);
+ "0x" TARGET_FMT_plx "\n", addr);
}
return 0;
}
@@ -171,7 +171,7 @@ mst_fpga_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
break;
default:
printf("Mainstone - mst_fpga_writeb: Bad register offset "
- "0x" TARGET_FMT_plx " \n", addr);
+ "0x" TARGET_FMT_plx "\n", addr);
}
}
diff --git a/hw/qdev.c b/hw/qdev.c
index c463c52150..a223d41cd3 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -207,6 +207,12 @@ int qdev_device_help(QemuOpts *opts)
}
error_printf("%s.%s=%s\n", info->name, prop->name, prop->info->name);
}
+ for (prop = info->bus_info->props; prop && prop->name; prop++) {
+ if (!prop->info->parse) {
+ continue; /* no way to set it, don't show */
+ }
+ error_printf("%s.%s=%s\n", info->name, prop->name, prop->info->name);
+ }
return 1;
}
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 32e6ab9beb..6afb0e7158 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -763,7 +763,6 @@ static void sun4uv_init(ram_addr_t RAM_size,
irq = qemu_allocate_irqs(cpu_set_irq, env, MAX_PILS);
pci_bus = pci_apb_init(APB_SPECIAL_BASE, APB_MEM_BASE, irq, &pci_bus2,
&pci_bus3);
- isa_mem_base = APB_PCI_IO_BASE;
pci_vga_init(pci_bus);
// XXX Should be pci_bus3
diff --git a/hw/vga.c b/hw/vga.c
index 125fb293f2..f9a6014f4e 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -149,7 +149,7 @@ static uint16_t expand2[256];
static uint8_t expand4to8[16];
static void vga_screen_dump(void *opaque, const char *filename);
-static char *screen_dump_filename;
+static const char *screen_dump_filename;
static DisplayChangeListener *screen_dump_dcl;
static void vga_update_memory_access(VGACommonState *s)
@@ -181,6 +181,7 @@ static void vga_update_memory_access(VGACommonState *s)
size = 0x8000;
break;
}
+ base += isa_mem_base;
region = g_malloc(sizeof(*region));
memory_region_init_alias(region, "vga.chain4", &s->vram, offset, size);
memory_region_add_subregion_overlap(s->legacy_address_space, base,
@@ -2318,7 +2319,6 @@ static void vga_save_dpy_update(DisplayState *ds,
{
if (screen_dump_filename) {
ppm_save(screen_dump_filename, ds->surface);
- screen_dump_filename = NULL;
}
}
@@ -2396,8 +2396,8 @@ static void vga_screen_dump(void *opaque, const char *filename)
if (!screen_dump_dcl)
screen_dump_dcl = vga_screen_dump_init(s->ds);
- screen_dump_filename = (char *)filename;
+ screen_dump_filename = filename;
vga_invalidate_display(s);
vga_hw_update();
+ screen_dump_filename = NULL;
}
-
diff --git a/hw/virtio.c b/hw/virtio.c
index c577bbe483..d9bf266492 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -498,6 +498,16 @@ void virtio_update_irq(VirtIODevice *vdev)
virtio_notify_vector(vdev, VIRTIO_NO_VECTOR);
}
+void virtio_set_status(VirtIODevice *vdev, uint8_t val)
+{
+ trace_virtio_set_status(vdev, val);
+
+ if (vdev->set_status) {
+ vdev->set_status(vdev, val);
+ }
+ vdev->status = val;
+}
+
void virtio_reset(void *opaque)
{
VirtIODevice *vdev = opaque;
diff --git a/hw/virtio.h b/hw/virtio.h
index 4d20d9b8f4..2d18209fb2 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -135,14 +135,6 @@ struct VirtIODevice
VMChangeStateEntry *vmstate;
};
-static inline void virtio_set_status(VirtIODevice *vdev, uint8_t val)
-{
- if (vdev->set_status) {
- vdev->set_status(vdev, val);
- }
- vdev->status = val;
-}
-
VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
void (*handle_output)(VirtIODevice *,
VirtQueue *));
@@ -190,6 +182,7 @@ int virtio_queue_get_num(VirtIODevice *vdev, int n);
void virtio_queue_notify(VirtIODevice *vdev, int n);
uint16_t virtio_queue_vector(VirtIODevice *vdev, int n);
void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
+void virtio_set_status(VirtIODevice *vdev, uint8_t val);
void virtio_reset(void *opaque);
void virtio_update_irq(VirtIODevice *vdev);
diff --git a/hw/vt82c686.c b/hw/vt82c686.c
index 5c973ed507..b9fcc0e4ac 100644
--- a/hw/vt82c686.c
+++ b/hw/vt82c686.c
@@ -49,7 +49,7 @@ static void superio_ioport_writeb(void *opaque, uint32_t addr, uint32_t data)
int can_write;
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_writeb address 0x%x val 0x%x \n", addr, data);
+ DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
if (addr == 0x3f0) {
superio_conf->index = data & 0xff;
} else {
@@ -73,12 +73,12 @@ static void superio_ioport_writeb(void *opaque, uint32_t addr, uint32_t data)
switch (superio_conf->index) {
case 0xe7:
if ((data & 0xff) != 0xfe) {
- DPRINTF("chage uart 1 base. unsupported yet \n");
+ DPRINTF("chage uart 1 base. unsupported yet\n");
}
break;
case 0xe8:
if ((data & 0xff) != 0xbe) {
- DPRINTF("chage uart 2 base. unsupported yet \n");
+ DPRINTF("chage uart 2 base. unsupported yet\n");
}
break;
@@ -95,7 +95,7 @@ static uint32_t superio_ioport_readb(void *opaque, uint32_t addr)
{
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_readb address 0x%x \n", addr);
+ DPRINTF("superio_ioport_readb address 0x%x\n", addr);
return (superio_conf->config[superio_conf->index]);
}
@@ -133,7 +133,7 @@ static void vt82c686b_write_config(PCIDevice * d, uint32_t address,
{
VT82C686BState *vt686 = DO_UPCAST(VT82C686BState, dev, d);
- DPRINTF("vt82c686b_write_config address 0x%x val 0x%x len 0x%x \n",
+ DPRINTF("vt82c686b_write_config address 0x%x val 0x%x len 0x%x\n",
address, val, len);
pci_default_write_config(d, address, val, len);
@@ -285,7 +285,7 @@ static void pm_io_space_update(VT686PMState *s)
static void pm_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len)
{
- DPRINTF("pm_write_config address 0x%x val 0x%x len 0x%x \n",
+ DPRINTF("pm_write_config address 0x%x val 0x%x len 0x%x\n",
address, val, len);
pci_default_write_config(d, address, val, len);
}
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e87e17432e..6b73769c34 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1504,7 +1504,7 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
break;
default:
unimplemented:
- gemu_log("Unsupported setsockopt level=%d optname=%d \n", level, optname);
+ gemu_log("Unsupported setsockopt level=%d optname=%d\n", level, optname);
ret = -TARGET_ENOPROTOOPT;
}
return ret;
diff --git a/mips-dis.c b/mips-dis.c
index 4d8e85bd94..e3a6e0b49e 100644
--- a/mips-dis.c
+++ b/mips-dis.c
@@ -4841,7 +4841,7 @@ with the -M switch (multiple options should be separated by commas):\n"));
Default: based on binary being disassembled.\n"));
fprintf (stream, _("\n\
- hwr-names=ARCH Print HWR names according to specified \n\
+ hwr-names=ARCH Print HWR names according to specified\n\
architecture.\n\
Default: based on binary being disassembled.\n"));
diff --git a/qemu-io.c b/qemu-io.c
index 5e46213af1..e91af3747b 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -880,7 +880,7 @@ static void multiwrite_help(void)
" in a batch of requests that may be merged by qemu\n"
"\n"
" Example:\n"
-" 'multiwrite 512 1k 1k ; 4k 1k' \n"
+" 'multiwrite 512 1k 1k ; 4k 1k'\n"
" writes 2 kB at 512 bytes and 1 kB at 4 kB into the open file\n"
"\n"
" Writes into a segment of the currently open file, using a buffer\n"
diff --git a/scripts/tracetool b/scripts/tracetool
index 743d246289..4c9951d0aa 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -40,6 +40,15 @@ EOF
exit 1
}
+# Print a line without interpreting backslash escapes
+#
+# The built-in echo command may interpret backslash escapes without an option
+# to disable this behavior.
+puts()
+{
+ printf "%s\n" "$1"
+}
+
# Get the name of a trace event
get_name()
{
@@ -111,13 +120,10 @@ get_argc()
echo $argc
}
-# Get the format string for a trace event
+# Get the format string including double quotes for a trace event
get_fmt()
{
- local fmt
- fmt=${1#*\"}
- fmt=${fmt%\"*}
- echo "$fmt"
+ puts "${1#*)}"
}
linetoh_begin_nop()
@@ -266,7 +272,7 @@ linetoh_stderr()
static inline void trace_$name($args)
{
if (trace_list[$stderr_event_num].state != 0) {
- fprintf(stderr, "$name $fmt\n" $argnames);
+ fprintf(stderr, "$name " $fmt "\n" $argnames);
}
}
EOF
@@ -366,7 +372,7 @@ DEFINE_TRACE(ust_$name);
static void ust_${name}_probe($args)
{
- trace_mark(ust, $name, "$fmt"$argnames);
+ trace_mark(ust, $name, $fmt$argnames);
}
EOF
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index c1214c0659..8bbd70caf1 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -231,7 +231,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
Slirp *slirp;
DEBUG_CALL("tcp_input");
- DEBUG_ARGS((dfd," m = %8lx iphlen = %2d inso = %lx\n",
+ DEBUG_ARGS((dfd, " m = %8lx iphlen = %2d inso = %lx\n",
(long )m, iphlen, (long )inso ));
/*
@@ -580,7 +580,7 @@ findso:
if((tcp_fconnect(so) == -1) && (errno != EINPROGRESS) && (errno != EWOULDBLOCK)) {
u_char code=ICMP_UNREACH_NET;
- DEBUG_MISC((dfd," tcp fconnect errno = %d-%s\n",
+ DEBUG_MISC((dfd, " tcp fconnect errno = %d-%s\n",
errno,strerror(errno)));
if(errno == ECONNREFUSED) {
/* ACK the SYN, send RST to refuse the connection */
@@ -910,7 +910,7 @@ trimthenstep6:
if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- DEBUG_MISC((dfd," dup ack m = %lx so = %lx \n",
+ DEBUG_MISC((dfd, " dup ack m = %lx so = %lx\n",
(long )m, (long )so));
/*
* If we have outstanding data (other than
@@ -1293,7 +1293,7 @@ tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)
int opt, optlen;
DEBUG_CALL("tcp_dooptions");
- DEBUG_ARGS((dfd," tp = %lx cnt=%i \n", (long )tp, cnt));
+ DEBUG_ARGS((dfd, " tp = %lx cnt=%i\n", (long)tp, cnt));
for (; cnt > 0; cnt -= optlen, cp += optlen) {
opt = cp[0];
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 61079b1b2d..143a2383c8 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -902,7 +902,7 @@ int tcp_ctl(struct socket *so)
return 1;
}
do_pty = ex_ptr->ex_pty;
- DEBUG_MISC((dfd, " executing %s \n",ex_ptr->ex_exec));
+ DEBUG_MISC((dfd, " executing %s\n", ex_ptr->ex_exec));
return fork_exec(so, ex_ptr->ex_exec, do_pty);
}
}
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 703be99cd2..aa41d25968 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -859,51 +859,51 @@ void helper_insertq_i(XMMReg *d, int index, int length)
void helper_haddps(XMMReg *d, XMMReg *s)
{
XMMReg r;
- r.XMM_S(0) = d->XMM_S(0) + d->XMM_S(1);
- r.XMM_S(1) = d->XMM_S(2) + d->XMM_S(3);
- r.XMM_S(2) = s->XMM_S(0) + s->XMM_S(1);
- r.XMM_S(3) = s->XMM_S(2) + s->XMM_S(3);
+ r.XMM_S(0) = float32_add(d->XMM_S(0), d->XMM_S(1), &env->sse_status);
+ r.XMM_S(1) = float32_add(d->XMM_S(2), d->XMM_S(3), &env->sse_status);
+ r.XMM_S(2) = float32_add(s->XMM_S(0), s->XMM_S(1), &env->sse_status);
+ r.XMM_S(3) = float32_add(s->XMM_S(2), s->XMM_S(3), &env->sse_status);
*d = r;
}
void helper_haddpd(XMMReg *d, XMMReg *s)
{
XMMReg r;
- r.XMM_D(0) = d->XMM_D(0) + d->XMM_D(1);
- r.XMM_D(1) = s->XMM_D(0) + s->XMM_D(1);
+ r.XMM_D(0) = float64_add(d->XMM_D(0), d->XMM_D(1), &env->sse_status);
+ r.XMM_D(1) = float64_add(s->XMM_D(0), s->XMM_D(1), &env->sse_status);
*d = r;
}
void helper_hsubps(XMMReg *d, XMMReg *s)
{
XMMReg r;
- r.XMM_S(0) = d->XMM_S(0) - d->XMM_S(1);
- r.XMM_S(1) = d->XMM_S(2) - d->XMM_S(3);
- r.XMM_S(2) = s->XMM_S(0) - s->XMM_S(1);
- r.XMM_S(3) = s->XMM_S(2) - s->XMM_S(3);
+ r.XMM_S(0) = float32_sub(d->XMM_S(0), d->XMM_S(1), &env->sse_status);
+ r.XMM_S(1) = float32_sub(d->XMM_S(2), d->XMM_S(3), &env->sse_status);
+ r.XMM_S(2) = float32_sub(s->XMM_S(0), s->XMM_S(1), &env->sse_status);
+ r.XMM_S(3) = float32_sub(s->XMM_S(2), s->XMM_S(3), &env->sse_status);
*d = r;
}
void helper_hsubpd(XMMReg *d, XMMReg *s)
{
XMMReg r;
- r.XMM_D(0) = d->XMM_D(0) - d->XMM_D(1);
- r.XMM_D(1) = s->XMM_D(0) - s->XMM_D(1);
+ r.XMM_D(0) = float64_sub(d->XMM_D(0), d->XMM_D(1), &env->sse_status);
+ r.XMM_D(1) = float64_sub(s->XMM_D(0), s->XMM_D(1), &env->sse_status);
*d = r;
}
void helper_addsubps(XMMReg *d, XMMReg *s)
{
- d->XMM_S(0) = d->XMM_S(0) - s->XMM_S(0);
- d->XMM_S(1) = d->XMM_S(1) + s->XMM_S(1);
- d->XMM_S(2) = d->XMM_S(2) - s->XMM_S(2);
- d->XMM_S(3) = d->XMM_S(3) + s->XMM_S(3);
+ d->XMM_S(0) = float32_sub(d->XMM_S(0), s->XMM_S(0), &env->sse_status);
+ d->XMM_S(1) = float32_add(d->XMM_S(1), s->XMM_S(1), &env->sse_status);
+ d->XMM_S(2) = float32_sub(d->XMM_S(2), s->XMM_S(2), &env->sse_status);
+ d->XMM_S(3) = float32_add(d->XMM_S(3), s->XMM_S(3), &env->sse_status);
}
void helper_addsubpd(XMMReg *d, XMMReg *s)
{
- d->XMM_D(0) = d->XMM_D(0) - s->XMM_D(0);
- d->XMM_D(1) = d->XMM_D(1) + s->XMM_D(1);
+ d->XMM_D(0) = float64_sub(d->XMM_D(0), s->XMM_D(0), &env->sse_status);
+ d->XMM_D(1) = float64_add(d->XMM_D(1), s->XMM_D(1), &env->sse_status);
}
/* XXX: unordered */
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 5ec83f2c66..96ea46494a 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -553,7 +553,7 @@ static inline int get_bat(CPUState *env, mmu_ctx_t *ctx, target_ulong virtual,
BEPIl = *BATu & 0x0FFE0000;
bl = (*BATu & 0x00001FFC) << 15;
LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx
- " BATl " TARGET_FMT_lx " \n\t" TARGET_FMT_lx " "
+ " BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " "
TARGET_FMT_lx " " TARGET_FMT_lx "\n",
__func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual,
*BATu, *BATl, BEPIu, BEPIl, bl);
diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
index 7529677fe2..281f87d3c6 100644
--- a/tcg/i386/tcg-target.c
+++ b/tcg/i386/tcg-target.c
@@ -76,9 +76,11 @@ static const int tcg_target_call_iarg_regs[] = {
#endif
};
-static const int tcg_target_call_oarg_regs[2] = {
+static const int tcg_target_call_oarg_regs[] = {
TCG_REG_EAX,
+#if TCG_TARGET_REG_BITS == 32
TCG_REG_EDX
+#endif
};
static uint8_t *tb_ret_addr;
diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c
index 9db205d4cc..3803ab6bfa 100644
--- a/tcg/ia64/tcg-target.c
+++ b/tcg/ia64/tcg-target.c
@@ -172,9 +172,8 @@ static const int tcg_target_call_iarg_regs[8] = {
TCG_REG_R63,
};
-static const int tcg_target_call_oarg_regs[2] = {
- TCG_REG_R8,
- TCG_REG_R9
+static const int tcg_target_call_oarg_regs[] = {
+ TCG_REG_R8
};
/* maximum number of register used for input function arguments */
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index e3c63adc3e..3d24cd4da4 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -130,7 +130,7 @@ static const int tcg_target_call_iarg_regs[] = {
TCG_REG_R10
};
-static const int tcg_target_call_oarg_regs[2] = {
+static const int tcg_target_call_oarg_regs[] = {
TCG_REG_R3
};
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index 2fc5646400..b58df719a6 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -252,7 +252,9 @@ static const int tcg_target_call_iarg_regs[] = {
static const int tcg_target_call_oarg_regs[] = {
TCG_REG_R2,
- TCG_REG_R3,
+#if TCG_TARGET_REG_BITS == 32
+ TCG_REG_R3
+#endif
};
#define S390_CC_EQ 8
diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index ac76e1198d..fc3fd7ffce 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -84,9 +84,11 @@ static const int tcg_target_call_iarg_regs[6] = {
TCG_REG_O5,
};
-static const int tcg_target_call_oarg_regs[2] = {
+static const int tcg_target_call_oarg_regs[] = {
TCG_REG_O0,
- TCG_REG_O1,
+#if TCG_TARGET_REG_BITS == 32
+ TCG_REG_O1
+#endif
};
static inline int check_fit_tl(tcg_target_long val, unsigned int bits)
diff --git a/tests/test-i386.c b/tests/test-i386.c
index 9cb5b51b76..8e64bbaf38 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -802,7 +802,7 @@ void test_fcmp(double a, double b)
"fstsw %%ax\n"
: "=a" (fpus)
: "t" (a), "u" (b));
- printf("fcom(%f %f)=%04lx \n",
+ printf("fcom(%f %f)=%04lx\n",
a, b, fpus & (0x4500 | FPUS_EMASK));
fpu_clear_exceptions();
asm("fucom %2\n"
diff --git a/trace-events b/trace-events
index 8bed3bea7a..829dc927cf 100644
--- a/trace-events
+++ b/trace-events
@@ -42,6 +42,7 @@ virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int out_num) "
virtio_queue_notify(void *vdev, int n, void *vq) "vdev %p n %d vq %p"
virtio_irq(void *vq) "vq %p"
virtio_notify(void *vdev, void *vq) "vdev %p vq %p"
+virtio_set_status(void *vdev, uint8_t val) "vdev %p val %u"
# hw/virtio-serial-bus.c
virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
@@ -88,8 +89,8 @@ balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
# hw/apic.c
apic_local_deliver(int vector, uint32_t lvt) "vector %d delivery mode %d"
apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t trigger_mode) "dest %d dest_mode %d delivery_mode %d vector %d trigger_mode %d"
-cpu_set_apic_base(uint64_t val) "%016"PRIx64""
-cpu_get_apic_base(uint64_t val) "%016"PRIx64""
+cpu_set_apic_base(uint64_t val) "%016"PRIx64
+cpu_get_apic_base(uint64_t val) "%016"PRIx64
apic_mem_readl(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
apic_mem_writel(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
# coalescing
@@ -169,21 +170,21 @@ slavio_led_mem_readw(uint32_t ret) "Read diagnostic LED %04x"
# hw/slavio_timer.c
slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit %"PRIx64" count %x%08x"
slavio_timer_irq(uint32_t counthigh, uint32_t count) "callback: count %x%08x"
-slavio_timer_mem_readl_invalid(uint64_t addr) "invalid read address %"PRIx64""
+slavio_timer_mem_readl_invalid(uint64_t addr) "invalid read address %"PRIx64
slavio_timer_mem_readl(uint64_t addr, uint32_t ret) "read %"PRIx64" = %08x"
slavio_timer_mem_writel(uint64_t addr, uint32_t val) "write %"PRIx64" = %08x"
-slavio_timer_mem_writel_limit(unsigned int timer_index, uint64_t count) "processor %d user timer set to %016"PRIx64""
+slavio_timer_mem_writel_limit(unsigned int timer_index, uint64_t count) "processor %d user timer set to %016"PRIx64
slavio_timer_mem_writel_counter_invalid(void) "not user timer"
slavio_timer_mem_writel_status_start(unsigned int timer_index) "processor %d user timer started"
slavio_timer_mem_writel_status_stop(unsigned int timer_index) "processor %d user timer stopped"
slavio_timer_mem_writel_mode_user(unsigned int timer_index) "processor %d changed from counter to user timer"
slavio_timer_mem_writel_mode_counter(unsigned int timer_index) "processor %d changed from user timer to counter"
slavio_timer_mem_writel_mode_invalid(void) "not system timer"
-slavio_timer_mem_writel_invalid(uint64_t addr) "invalid write address %"PRIx64""
+slavio_timer_mem_writel_invalid(uint64_t addr) "invalid write address %"PRIx64
# hw/sparc32_dma.c
-ledma_memory_read(uint64_t addr) "DMA read addr 0x%"PRIx64""
-ledma_memory_write(uint64_t addr) "DMA write addr 0x%"PRIx64""
+ledma_memory_read(uint64_t addr) "DMA read addr 0x%"PRIx64
+ledma_memory_write(uint64_t addr) "DMA write addr 0x%"PRIx64
sparc32_dma_set_irq_raise(void) "Raise IRQ"
sparc32_dma_set_irq_lower(void) "Lower IRQ"
espdma_memory_read(uint32_t addr) "DMA read addr 0x%08x"
@@ -202,12 +203,12 @@ sun4m_cpu_set_irq_lower(int level) "Lower CPU IRQ %d"
# hw/sun4m_iommu.c
sun4m_iommu_mem_readl(uint64_t addr, uint32_t ret) "read reg[%"PRIx64"] = %x"
sun4m_iommu_mem_writel(uint64_t addr, uint32_t val) "write reg[%"PRIx64"] = %x"
-sun4m_iommu_mem_writel_ctrl(uint64_t iostart) "iostart = %"PRIx64""
+sun4m_iommu_mem_writel_ctrl(uint64_t iostart) "iostart = %"PRIx64
sun4m_iommu_mem_writel_tlbflush(uint32_t val) "tlb flush %x"
sun4m_iommu_mem_writel_pgflush(uint32_t val) "page flush %x"
sun4m_iommu_page_get_flags(uint64_t pa, uint64_t iopte, uint32_t ret) "get flags addr %"PRIx64" => pte %"PRIx64", *pte = %x"
sun4m_iommu_translate_pa(uint64_t addr, uint64_t pa, uint32_t iopte) "xlate dva %"PRIx64" => pa %"PRIx64" iopte = %x"
-sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64""
+sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64
# hw/usb-bus.c
usb_port_claim(int bus, const char *port) "bus %d, port %s"
@@ -278,7 +279,7 @@ scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d le
scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d"
scsi_req_continue(int target, int lun, int tag) "target %d lun %d tag %d"
scsi_req_parsed(int target, int lun, int tag, int cmd, int mode, int xfer) "target %d lun %d tag %d command %d dir %d length %d"
-scsi_req_parsed_lba(int target, int lun, int tag, int cmd, uint64_t lba) "target %d lun %d tag %d command %d lba %"PRIu64""
+scsi_req_parsed_lba(int target, int lun, int tag, int cmd, uint64_t lba) "target %d lun %d tag %d command %d lba %"PRIu64
scsi_req_parse_bad(int target, int lun, int tag, int cmd) "target %d lun %d tag %d command %d"
scsi_req_build_sense(int target, int lun, int tag, int key, int asc, int ascq) "target %d lun %d tag %d key %#02x asc %#02x ascq %#02x"
scsi_report_luns(int target, int lun, int tag) "target %d lun %d tag %d"
@@ -306,11 +307,11 @@ qed_start_need_check_timer(void *s) "s %p"
qed_cancel_need_check_timer(void *s) "s %p"
qed_aio_complete(void *s, void *acb, int ret) "s %p acb %p ret %d"
qed_aio_setup(void *s, void *acb, int64_t sector_num, int nb_sectors, void *opaque, int is_write) "s %p acb %p sector_num %"PRId64" nb_sectors %d opaque %p is_write %d"
-qed_aio_next_io(void *s, void *acb, int ret, uint64_t cur_pos) "s %p acb %p ret %d cur_pos %"PRIu64""
+qed_aio_next_io(void *s, void *acb, int ret, uint64_t cur_pos) "s %p acb %p ret %d cur_pos %"PRIu64
qed_aio_read_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
-qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
-qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
+qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
+qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
# hw/g364fb.c
@@ -327,10 +328,10 @@ grlib_gptimer_readl(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx
grlib_gptimer_writel(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx64" 0x%x"
# hw/grlib_irqmp.c
-grlib_irqmp_check_irqs(uint32_t pend, uint32_t force, uint32_t mask, uint32_t lvl1, uint32_t lvl2) "pend:0x%04x force:0x%04x mask:0x%04x lvl1:0x%04x lvl0:0x%04x\n"
+grlib_irqmp_check_irqs(uint32_t pend, uint32_t force, uint32_t mask, uint32_t lvl1, uint32_t lvl2) "pend:0x%04x force:0x%04x mask:0x%04x lvl1:0x%04x lvl0:0x%04x"
grlib_irqmp_ack(int intno) "interrupt:%d"
grlib_irqmp_set_irq(int irq) "Raise CPU IRQ %d"
-grlib_irqmp_readl_unknown(uint64_t addr) "addr 0x%"PRIx64""
+grlib_irqmp_readl_unknown(uint64_t addr) "addr 0x%"PRIx64
grlib_irqmp_writel_unknown(uint64_t addr, uint32_t value) "addr 0x%"PRIx64" value 0x%x"
# hw/grlib_apbuart.c
@@ -462,10 +463,10 @@ xen_ram_alloc(unsigned long ram_addr, unsigned long size) "requested: %#lx, size
xen_client_set_memory(uint64_t start_addr, unsigned long size, unsigned long phys_offset, bool log_dirty) "%#"PRIx64" size %#lx, offset %#lx, log_dirty %i"
# xen-mapcache.c
-xen_map_cache(uint64_t phys_addr) "want %#"PRIx64""
-xen_remap_bucket(uint64_t index) "index %#"PRIx64""
+xen_map_cache(uint64_t phys_addr) "want %#"PRIx64
+xen_remap_bucket(uint64_t index) "index %#"PRIx64
xen_map_cache_return(void* ptr) "%p"
-xen_map_block(uint64_t phys_addr, uint64_t size) "%#"PRIx64", size %#"PRIx64""
+xen_map_block(uint64_t phys_addr, uint64_t size) "%#"PRIx64", size %#"PRIx64
xen_unmap_block(void* addr, unsigned long size) "%p, size %#lx"
# exec.c
diff --git a/vl.c b/vl.c
index 08591c397b..bd4a5ce8a2 100644
--- a/vl.c
+++ b/vl.c
@@ -1408,6 +1408,7 @@ void qemu_system_killed(int signal, pid_t pid)
{
shutdown_signal = signal;
shutdown_pid = pid;
+ no_shutdown = 0;
qemu_system_shutdown_request();
}