Compare commits
59 Commits
v2.0.0-rc1
...
pull-sdl-1
Author | SHA1 | Date | |
---|---|---|---|
|
2d968ffbae | ||
|
afbc0dd649 | ||
|
f516a5cc05 | ||
|
0a9077ea14 | ||
|
775478418a | ||
|
50329d3418 | ||
|
efcc87d9ae | ||
|
7dc176bce4 | ||
|
9bc1a1d817 | ||
|
f2ccc311df | ||
|
093de72b9c | ||
|
800b0e814b | ||
|
9a4fb6aa19 | ||
|
e792933ce1 | ||
|
06f6e12491 | ||
|
6a2b3d89fa | ||
|
05edc26c61 | ||
|
e81a982aa5 | ||
|
6cd7db3d92 | ||
|
d1dec5ef55 | ||
|
6bbad7a91e | ||
|
50fc89e7b1 | ||
|
bcb7652e8d | ||
|
d359db00e6 | ||
|
80189035de | ||
|
0453099b7d | ||
|
a13d448968 | ||
|
3636226ae4 | ||
|
6a450df9b8 | ||
|
9854202b57 | ||
|
577a67234d | ||
|
55519a4b24 | ||
|
f85e3457ce | ||
|
9c269f6d7b | ||
|
dffacd4654 | ||
|
20c50a955f | ||
|
bd7ce902ab | ||
|
e20c016e32 | ||
|
dc491cfc14 | ||
|
25eccc37ff | ||
|
ecce1929bc | ||
|
e61031cdd8 | ||
|
0d0e044dee | ||
|
466e6e9d13 | ||
|
8ae60ee85c | ||
|
54bee5c2b4 | ||
|
8c2664d869 | ||
|
4d1cb6e6f5 | ||
|
f187743acd | ||
|
b998875dcf | ||
|
bae2c27090 | ||
|
cd7ccc8351 | ||
|
d097696eba | ||
|
3b418d0c45 | ||
|
cd40890816 | ||
|
e3fa4bfa72 | ||
|
8885eadedd | ||
|
4c2e5f8f46 | ||
|
cbee81f6de |
@@ -717,7 +717,8 @@ F: hw/display/qxl*
|
||||
|
||||
Graphics
|
||||
M: Anthony Liguori <aliguori@amazon.com>
|
||||
S: Maintained
|
||||
M: Gerd Hoffmann <kraxel@redhat.com>
|
||||
S: Odd Fixes
|
||||
F: ui/
|
||||
|
||||
Cocoa graphics
|
||||
|
3
Makefile
3
Makefile
@@ -133,6 +133,7 @@ dummy := $(call unnest-vars,, \
|
||||
stub-obj-y \
|
||||
util-obj-y \
|
||||
qga-obj-y \
|
||||
qga-vss-dll-obj-y \
|
||||
block-obj-y \
|
||||
block-obj-m \
|
||||
common-obj-y \
|
||||
@@ -376,7 +377,7 @@ endif
|
||||
ifneq ($(CONFIG_MODULES),)
|
||||
$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
|
||||
for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
|
||||
$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$${s//\//-}"; \
|
||||
$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
|
||||
done
|
||||
endif
|
||||
ifneq ($(HELPERS-y),)
|
||||
|
161
block.c
161
block.c
@@ -767,6 +767,11 @@ static int bdrv_open_flags(BlockDriverState *bs, int flags)
|
||||
{
|
||||
int open_flags = flags | BDRV_O_CACHE_WB;
|
||||
|
||||
/* The backing file of a temporary snapshot is read-only */
|
||||
if (flags & BDRV_O_SNAPSHOT) {
|
||||
open_flags &= ~BDRV_O_RDWR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear flags that are internal to the block layer before opening the
|
||||
* image.
|
||||
@@ -968,7 +973,7 @@ static int bdrv_file_open(BlockDriverState *bs, const char *filename,
|
||||
{
|
||||
BlockDriver *drv;
|
||||
const char *drvname;
|
||||
bool allow_protocol_prefix = false;
|
||||
bool parse_filename = false;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
@@ -977,7 +982,7 @@ static int bdrv_file_open(BlockDriverState *bs, const char *filename,
|
||||
filename = qdict_get_try_str(*options, "filename");
|
||||
} else if (filename && !qdict_haskey(*options, "filename")) {
|
||||
qdict_put(*options, "filename", qstring_from_str(filename));
|
||||
allow_protocol_prefix = true;
|
||||
parse_filename = true;
|
||||
} else {
|
||||
error_setg(errp, "Can't specify 'file' and 'filename' options at the "
|
||||
"same time");
|
||||
@@ -994,7 +999,7 @@ static int bdrv_file_open(BlockDriverState *bs, const char *filename,
|
||||
}
|
||||
qdict_del(*options, "driver");
|
||||
} else if (filename) {
|
||||
drv = bdrv_find_protocol(filename, allow_protocol_prefix);
|
||||
drv = bdrv_find_protocol(filename, parse_filename);
|
||||
if (!drv) {
|
||||
error_setg(errp, "Unknown protocol");
|
||||
}
|
||||
@@ -1010,7 +1015,7 @@ static int bdrv_file_open(BlockDriverState *bs, const char *filename,
|
||||
}
|
||||
|
||||
/* Parse the filename and open it */
|
||||
if (drv->bdrv_parse_filename && filename) {
|
||||
if (drv->bdrv_parse_filename && parse_filename) {
|
||||
drv->bdrv_parse_filename(filename, *options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
@@ -1162,6 +1167,73 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
|
||||
{
|
||||
/* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
|
||||
char tmp_filename[PATH_MAX + 1];
|
||||
|
||||
int64_t total_size;
|
||||
BlockDriver *bdrv_qcow2;
|
||||
QEMUOptionParameter *create_options;
|
||||
QDict *snapshot_options;
|
||||
BlockDriverState *bs_snapshot;
|
||||
Error *local_err;
|
||||
int ret;
|
||||
|
||||
/* if snapshot, we create a temporary backing file and open it
|
||||
instead of opening 'filename' directly */
|
||||
|
||||
/* Get the required size from the image */
|
||||
total_size = bdrv_getlength(bs);
|
||||
if (total_size < 0) {
|
||||
error_setg_errno(errp, -total_size, "Could not get image size");
|
||||
return;
|
||||
}
|
||||
total_size &= BDRV_SECTOR_MASK;
|
||||
|
||||
/* Create the temporary image */
|
||||
ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Could not get temporary filename");
|
||||
return;
|
||||
}
|
||||
|
||||
bdrv_qcow2 = bdrv_find_format("qcow2");
|
||||
create_options = parse_option_parameters("", bdrv_qcow2->create_options,
|
||||
NULL);
|
||||
|
||||
set_option_parameter_int(create_options, BLOCK_OPT_SIZE, total_size);
|
||||
|
||||
ret = bdrv_create(bdrv_qcow2, tmp_filename, create_options, &local_err);
|
||||
free_option_parameters(create_options);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Could not create temporary overlay "
|
||||
"'%s': %s", tmp_filename,
|
||||
error_get_pretty(local_err));
|
||||
error_free(local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Prepare a new options QDict for the temporary file */
|
||||
snapshot_options = qdict_new();
|
||||
qdict_put(snapshot_options, "file.driver",
|
||||
qstring_from_str("file"));
|
||||
qdict_put(snapshot_options, "file.filename",
|
||||
qstring_from_str(tmp_filename));
|
||||
|
||||
bs_snapshot = bdrv_new("");
|
||||
bs_snapshot->is_temporary = 1;
|
||||
|
||||
ret = bdrv_open(&bs_snapshot, NULL, NULL, snapshot_options,
|
||||
bs->open_flags & ~BDRV_O_SNAPSHOT, bdrv_qcow2, &local_err);
|
||||
if (ret < 0) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
bdrv_append(bs_snapshot, bs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Opens a disk image (raw, qcow2, vmdk, ...)
|
||||
*
|
||||
@@ -1182,8 +1254,6 @@ int bdrv_open(BlockDriverState **pbs, const char *filename,
|
||||
BlockDriver *drv, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
/* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
|
||||
char tmp_filename[PATH_MAX + 1];
|
||||
BlockDriverState *file = NULL, *bs;
|
||||
const char *drvname;
|
||||
Error *local_err = NULL;
|
||||
@@ -1243,74 +1313,6 @@ int bdrv_open(BlockDriverState **pbs, const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
/* For snapshot=on, create a temporary qcow2 overlay */
|
||||
if (flags & BDRV_O_SNAPSHOT) {
|
||||
BlockDriverState *bs1;
|
||||
int64_t total_size;
|
||||
BlockDriver *bdrv_qcow2;
|
||||
QEMUOptionParameter *create_options;
|
||||
QDict *snapshot_options;
|
||||
|
||||
/* if snapshot, we create a temporary backing file and open it
|
||||
instead of opening 'filename' directly */
|
||||
|
||||
/* Get the required size from the image */
|
||||
QINCREF(options);
|
||||
bs1 = NULL;
|
||||
ret = bdrv_open(&bs1, filename, NULL, options, BDRV_O_NO_BACKING,
|
||||
drv, &local_err);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
}
|
||||
total_size = bdrv_getlength(bs1) & BDRV_SECTOR_MASK;
|
||||
|
||||
bdrv_unref(bs1);
|
||||
|
||||
/* Create the temporary image */
|
||||
ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Could not get temporary filename");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bdrv_qcow2 = bdrv_find_format("qcow2");
|
||||
create_options = parse_option_parameters("", bdrv_qcow2->create_options,
|
||||
NULL);
|
||||
|
||||
set_option_parameter_int(create_options, BLOCK_OPT_SIZE, total_size);
|
||||
|
||||
ret = bdrv_create(bdrv_qcow2, tmp_filename, create_options, &local_err);
|
||||
free_option_parameters(create_options);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Could not create temporary overlay "
|
||||
"'%s': %s", tmp_filename,
|
||||
error_get_pretty(local_err));
|
||||
error_free(local_err);
|
||||
local_err = NULL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Prepare a new options QDict for the temporary file, where user
|
||||
* options refer to the backing file */
|
||||
if (filename) {
|
||||
qdict_put(options, "file.filename", qstring_from_str(filename));
|
||||
}
|
||||
if (drv) {
|
||||
qdict_put(options, "driver", qstring_from_str(drv->format_name));
|
||||
}
|
||||
|
||||
snapshot_options = qdict_new();
|
||||
qdict_put(snapshot_options, "backing", options);
|
||||
qdict_flatten(snapshot_options);
|
||||
|
||||
bs->options = snapshot_options;
|
||||
options = qdict_clone_shallow(bs->options);
|
||||
|
||||
filename = tmp_filename;
|
||||
drv = bdrv_qcow2;
|
||||
bs->is_temporary = 1;
|
||||
}
|
||||
|
||||
/* Open image file without format layer */
|
||||
if (flags & BDRV_O_RDWR) {
|
||||
flags |= BDRV_O_ALLOW_RDWR;
|
||||
@@ -1372,6 +1374,17 @@ int bdrv_open(BlockDriverState **pbs, const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
/* For snapshot=on, create a temporary qcow2 overlay. bs points to the
|
||||
* temporary snapshot afterwards. */
|
||||
if (flags & BDRV_O_SNAPSHOT) {
|
||||
bdrv_append_temp_snapshot(bs, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
goto close_and_fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
/* Check if any unknown options were used */
|
||||
if (options && (qdict_size(options) != 0)) {
|
||||
|
@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
|
||||
return task;
|
||||
|
||||
fail:
|
||||
error_setg(errp, "iSCSI: Inquiry command failed : %s",
|
||||
iscsi_get_error(iscsi));
|
||||
if (!error_is_set(errp)) {
|
||||
error_setg(errp, "iSCSI: Inquiry command failed : %s",
|
||||
iscsi_get_error(iscsi));
|
||||
}
|
||||
if (task != NULL) {
|
||||
scsi_free_scsi_task(task);
|
||||
}
|
||||
|
@@ -491,6 +491,7 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
||||
break;
|
||||
case QCOW2_CLUSTER_ZERO:
|
||||
if (s->qcow_version < 3) {
|
||||
qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
|
||||
return -EIO;
|
||||
}
|
||||
c = count_contiguous_clusters(nb_clusters, s->cluster_size,
|
||||
|
@@ -269,12 +269,15 @@ static int qcow2_mark_clean(BlockDriverState *bs)
|
||||
BDRVQcowState *s = bs->opaque;
|
||||
|
||||
if (s->incompatible_features & QCOW2_INCOMPAT_DIRTY) {
|
||||
int ret = bdrv_flush(bs);
|
||||
int ret;
|
||||
|
||||
s->incompatible_features &= ~QCOW2_INCOMPAT_DIRTY;
|
||||
|
||||
ret = bdrv_flush(bs);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
s->incompatible_features &= ~QCOW2_INCOMPAT_DIRTY;
|
||||
return qcow2_update_header(bs);
|
||||
}
|
||||
return 0;
|
||||
@@ -900,11 +903,25 @@ static int qcow2_set_key(BlockDriverState *bs, const char *key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We have nothing to do for QCOW2 reopen, stubs just return
|
||||
* success */
|
||||
/* We have no actual commit/abort logic for qcow2, but we need to write out any
|
||||
* unwritten data if we reopen read-only. */
|
||||
static int qcow2_reopen_prepare(BDRVReopenState *state,
|
||||
BlockReopenQueue *queue, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((state->flags & BDRV_O_RDWR) == 0) {
|
||||
ret = bdrv_flush(state->bs);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = qcow2_mark_clean(state->bs);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
2
configure
vendored
2
configure
vendored
@@ -1448,7 +1448,7 @@ done
|
||||
if test "$stack_protector" != "no" ; then
|
||||
gcc_flags="-fstack-protector-strong -fstack-protector-all"
|
||||
for flag in $gcc_flags; do
|
||||
if compile_prog "-Werror $flag" "" ; then
|
||||
if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then
|
||||
QEMU_CFLAGS="$QEMU_CFLAGS $flag"
|
||||
LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
|
||||
break
|
||||
|
@@ -227,6 +227,8 @@ int cpu_exec(CPUArchState *env)
|
||||
TranslationBlock *tb;
|
||||
uint8_t *tc_ptr;
|
||||
uintptr_t next_tb;
|
||||
/* This must be volatile so it is not trashed by longjmp() */
|
||||
volatile bool have_tb_lock = false;
|
||||
|
||||
if (cpu->halted) {
|
||||
if (!cpu_has_work(cpu)) {
|
||||
@@ -600,6 +602,7 @@ int cpu_exec(CPUArchState *env)
|
||||
cpu_loop_exit(cpu);
|
||||
}
|
||||
spin_lock(&tcg_ctx.tb_ctx.tb_lock);
|
||||
have_tb_lock = true;
|
||||
tb = tb_find_fast(env);
|
||||
/* Note: we do it here to avoid a gcc bug on Mac OS X when
|
||||
doing it in tb_find_slow */
|
||||
@@ -621,6 +624,7 @@ int cpu_exec(CPUArchState *env)
|
||||
tb_add_jump((TranslationBlock *)(next_tb & ~TB_EXIT_MASK),
|
||||
next_tb & TB_EXIT_MASK, tb);
|
||||
}
|
||||
have_tb_lock = false;
|
||||
spin_unlock(&tcg_ctx.tb_ctx.tb_lock);
|
||||
|
||||
/* cpu_interrupt might be called while translating the
|
||||
@@ -692,6 +696,10 @@ int cpu_exec(CPUArchState *env)
|
||||
#ifdef TARGET_I386
|
||||
x86_cpu = X86_CPU(cpu);
|
||||
#endif
|
||||
if (have_tb_lock) {
|
||||
spin_unlock(&tcg_ctx.tb_ctx.tb_lock);
|
||||
have_tb_lock = false;
|
||||
}
|
||||
}
|
||||
} /* for(;;) */
|
||||
|
||||
|
@@ -213,6 +213,7 @@ BlockDriverAIOCB *dma_bdrv_io(
|
||||
dbs->sg_cur_index = 0;
|
||||
dbs->sg_cur_byte = 0;
|
||||
dbs->dir = dir;
|
||||
dbs->in_cancel = false;
|
||||
dbs->io_func = io_func;
|
||||
dbs->bh = NULL;
|
||||
qemu_iovec_init(&dbs->iov, sg->nsg);
|
||||
|
@@ -1626,6 +1626,26 @@ uint64 float32_to_uint64(float32 a STATUS_PARAM)
|
||||
return roundAndPackUint64(aSign, aSig64, aSigExtra STATUS_VAR);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns the result of converting the single-precision floating-point value
|
||||
| `a' to the 64-bit unsigned integer format. The conversion is
|
||||
| performed according to the IEC/IEEE Standard for Binary Floating-Point
|
||||
| Arithmetic, except that the conversion is always rounded toward zero. If
|
||||
| `a' is a NaN, the largest unsigned integer is returned. Otherwise, if the
|
||||
| conversion overflows, the largest unsigned integer is returned. If the
|
||||
| 'a' is negative, the result is rounded and zero is returned; values that do
|
||||
| not round to zero will raise the inexact flag.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
uint64 float32_to_uint64_round_to_zero(float32 a STATUS_PARAM)
|
||||
{
|
||||
signed char current_rounding_mode = STATUS(float_rounding_mode);
|
||||
set_float_rounding_mode(float_round_to_zero STATUS_VAR);
|
||||
int64_t v = float32_to_uint64(a STATUS_VAR);
|
||||
set_float_rounding_mode(current_rounding_mode STATUS_VAR);
|
||||
return v;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns the result of converting the single-precision floating-point value
|
||||
| `a' to the 64-bit two's complement integer format. The conversion is
|
||||
|
@@ -230,18 +230,23 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
|
||||
|
||||
for (n = 0; n < smp_cpus; n++) {
|
||||
ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
|
||||
Object *cpuobj;
|
||||
ARMCPU *cpu;
|
||||
Error *err = NULL;
|
||||
|
||||
cpu = ARM_CPU(object_new(object_class_get_name(oc)));
|
||||
|
||||
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
|
||||
&err);
|
||||
if (err) {
|
||||
error_report("%s", error_get_pretty(err));
|
||||
if (!oc) {
|
||||
error_report("Unable to find CPU definition");
|
||||
exit(1);
|
||||
}
|
||||
object_property_set_bool(OBJECT(cpu), true, "realized", &err);
|
||||
|
||||
cpuobj = object_new(object_class_get_name(oc));
|
||||
cpu = ARM_CPU(cpuobj);
|
||||
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
|
||||
"reset-cbar", &error_abort);
|
||||
}
|
||||
object_property_set_bool(cpuobj, true, "realized", &err);
|
||||
if (err) {
|
||||
error_report("%s", error_get_pretty(err));
|
||||
exit(1);
|
||||
|
@@ -192,10 +192,9 @@ static void init_cpus(const char *cpu_model, const char *privdev,
|
||||
Object *cpuobj = object_new(object_class_get_name(cpu_oc));
|
||||
Error *err = NULL;
|
||||
|
||||
object_property_set_int(cpuobj, periphbase, "reset-cbar", &err);
|
||||
if (err) {
|
||||
error_report("%s", error_get_pretty(err));
|
||||
exit(1);
|
||||
if (object_property_find(cpuobj, "reset-cbar", NULL)) {
|
||||
object_property_set_int(cpuobj, periphbase,
|
||||
"reset-cbar", &error_abort);
|
||||
}
|
||||
object_property_set_bool(cpuobj, true, "realized", &err);
|
||||
if (err) {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "virtio-blk.h"
|
||||
#include "block/aio.h"
|
||||
#include "hw/virtio/virtio-bus.h"
|
||||
#include "monitor/monitor.h" /* for object_add() */
|
||||
#include "qom/object_interfaces.h"
|
||||
|
||||
enum {
|
||||
SEG_MAX = 126, /* maximum number of I/O segments */
|
||||
@@ -59,7 +59,7 @@ struct VirtIOBlockDataPlane {
|
||||
* use it).
|
||||
*/
|
||||
IOThread *iothread;
|
||||
bool internal_iothread;
|
||||
IOThread internal_iothread_obj;
|
||||
AioContext *ctx;
|
||||
EventNotifier io_notifier; /* Linux AIO completion */
|
||||
EventNotifier host_notifier; /* doorbell */
|
||||
@@ -391,23 +391,19 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
|
||||
s->blk = blk;
|
||||
|
||||
if (blk->iothread) {
|
||||
s->internal_iothread = false;
|
||||
s->iothread = blk->iothread;
|
||||
object_ref(OBJECT(s->iothread));
|
||||
} else {
|
||||
/* Create per-device IOThread if none specified */
|
||||
Error *local_err = NULL;
|
||||
|
||||
s->internal_iothread = true;
|
||||
object_add(TYPE_IOTHREAD, vdev->name, NULL, NULL, &local_err);
|
||||
if (error_is_set(&local_err)) {
|
||||
error_propagate(errp, local_err);
|
||||
g_free(s);
|
||||
return;
|
||||
}
|
||||
s->iothread = iothread_find(vdev->name);
|
||||
assert(s->iothread);
|
||||
/* Create per-device IOThread if none specified. This is for
|
||||
* x-data-plane option compatibility. If x-data-plane is removed we
|
||||
* can drop this.
|
||||
*/
|
||||
object_initialize(&s->internal_iothread_obj,
|
||||
sizeof(s->internal_iothread_obj),
|
||||
TYPE_IOTHREAD);
|
||||
user_creatable_complete(OBJECT(&s->internal_iothread_obj), &error_abort);
|
||||
s->iothread = &s->internal_iothread_obj;
|
||||
}
|
||||
object_ref(OBJECT(s->iothread));
|
||||
s->ctx = iothread_get_aio_context(s->iothread);
|
||||
|
||||
/* Prevent block operations that conflict with data plane thread */
|
||||
@@ -426,9 +422,6 @@ void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s)
|
||||
virtio_blk_data_plane_stop(s);
|
||||
bdrv_set_in_use(s->blk->conf.bs, 0);
|
||||
object_unref(OBJECT(s->iothread));
|
||||
if (s->internal_iothread) {
|
||||
object_unparent(OBJECT(s->iothread));
|
||||
}
|
||||
g_free(s);
|
||||
}
|
||||
|
||||
|
@@ -225,8 +225,10 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
|
||||
|
||||
if (s->tsr_retry <= 0) {
|
||||
if (s->fcr & UART_FCR_FE) {
|
||||
s->tsr = fifo8_is_empty(&s->xmit_fifo) ?
|
||||
0 : fifo8_pop(&s->xmit_fifo);
|
||||
if (fifo8_is_empty(&s->xmit_fifo)) {
|
||||
return FALSE;
|
||||
}
|
||||
s->tsr = fifo8_pop(&s->xmit_fifo);
|
||||
if (!s->xmit_fifo.num) {
|
||||
s->lsr |= UART_LSR_THRE;
|
||||
}
|
||||
|
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 2 of the License.
|
||||
* the Free Software Foundation; either version 2 of the License,
|
||||
* or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
@@ -93,7 +93,7 @@ Scope(\_SB) {
|
||||
}
|
||||
|
||||
Device(CPU_HOTPLUG_RESOURCE_DEVICE) {
|
||||
Name(_HID, "ACPI0004")
|
||||
Name(_HID, EisaId("PNP0A06"))
|
||||
|
||||
Name(_CRS, ResourceTemplate() {
|
||||
IO(Decode16, CPU_STATUS_BASE, CPU_STATUS_BASE, 0, CPU_STATUS_LEN)
|
||||
|
@@ -3,12 +3,12 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x44,
|
||||
0x54,
|
||||
0x85,
|
||||
0x80,
|
||||
0x11,
|
||||
0x0,
|
||||
0x0,
|
||||
0x1,
|
||||
0x8b,
|
||||
0x60,
|
||||
0x42,
|
||||
0x58,
|
||||
0x50,
|
||||
@@ -31,8 +31,8 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x4e,
|
||||
0x54,
|
||||
0x4c,
|
||||
0x23,
|
||||
0x8,
|
||||
0x15,
|
||||
0x11,
|
||||
0x13,
|
||||
0x20,
|
||||
0x10,
|
||||
@@ -4010,7 +4010,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x1,
|
||||
0x10,
|
||||
0x47,
|
||||
0x42,
|
||||
0x11,
|
||||
0x5f,
|
||||
0x53,
|
||||
@@ -4243,7 +4243,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x60,
|
||||
0x5b,
|
||||
0x82,
|
||||
0x2e,
|
||||
0x29,
|
||||
0x50,
|
||||
0x52,
|
||||
0x45,
|
||||
@@ -4253,16 +4253,11 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x48,
|
||||
0x49,
|
||||
0x44,
|
||||
0xd,
|
||||
0xc,
|
||||
0x41,
|
||||
0x43,
|
||||
0x50,
|
||||
0x49,
|
||||
0x30,
|
||||
0x30,
|
||||
0x30,
|
||||
0x34,
|
||||
0x0,
|
||||
0xd0,
|
||||
0xa,
|
||||
0x6,
|
||||
0x8,
|
||||
0x5f,
|
||||
0x43,
|
||||
|
@@ -3,12 +3,12 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x44,
|
||||
0x54,
|
||||
0xd7,
|
||||
0xd2,
|
||||
0x1c,
|
||||
0x0,
|
||||
0x0,
|
||||
0x1,
|
||||
0x3e,
|
||||
0x13,
|
||||
0x42,
|
||||
0x58,
|
||||
0x50,
|
||||
@@ -31,8 +31,8 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x4e,
|
||||
0x54,
|
||||
0x4c,
|
||||
0x23,
|
||||
0x8,
|
||||
0x15,
|
||||
0x11,
|
||||
0x13,
|
||||
0x20,
|
||||
0x10,
|
||||
@@ -6959,7 +6959,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x1,
|
||||
0x10,
|
||||
0x47,
|
||||
0x42,
|
||||
0x11,
|
||||
0x5f,
|
||||
0x53,
|
||||
@@ -7192,7 +7192,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x60,
|
||||
0x5b,
|
||||
0x82,
|
||||
0x2e,
|
||||
0x29,
|
||||
0x50,
|
||||
0x52,
|
||||
0x45,
|
||||
@@ -7202,16 +7202,11 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x48,
|
||||
0x49,
|
||||
0x44,
|
||||
0xd,
|
||||
0xc,
|
||||
0x41,
|
||||
0x43,
|
||||
0x50,
|
||||
0x49,
|
||||
0x30,
|
||||
0x30,
|
||||
0x30,
|
||||
0x34,
|
||||
0x0,
|
||||
0xd0,
|
||||
0xa,
|
||||
0x6,
|
||||
0x8,
|
||||
0x5f,
|
||||
0x43,
|
||||
|
@@ -145,9 +145,9 @@ static uint64_t raven_io_read(void *opaque, hwaddr addr,
|
||||
if (size == 1) {
|
||||
return buf[0];
|
||||
} else if (size == 2) {
|
||||
return lduw_p(buf);
|
||||
return lduw_le_p(buf);
|
||||
} else if (size == 4) {
|
||||
return ldl_p(buf);
|
||||
return ldl_le_p(buf);
|
||||
} else {
|
||||
g_assert_not_reached();
|
||||
}
|
||||
@@ -164,9 +164,9 @@ static void raven_io_write(void *opaque, hwaddr addr,
|
||||
if (size == 1) {
|
||||
buf[0] = val;
|
||||
} else if (size == 2) {
|
||||
stw_p(buf, val);
|
||||
stw_le_p(buf, val);
|
||||
} else if (size == 4) {
|
||||
stl_p(buf, val);
|
||||
stl_le_p(buf, val);
|
||||
} else {
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
@@ -649,7 +649,7 @@ void ppce500_init(QEMUMachineInitArgs *args, PPCE500Params *params)
|
||||
input = (qemu_irq *)env->irq_inputs;
|
||||
irqs[i][OPENPIC_OUTPUT_INT] = input[PPCE500_INPUT_INT];
|
||||
irqs[i][OPENPIC_OUTPUT_CINT] = input[PPCE500_INPUT_CINT];
|
||||
env->spr[SPR_BOOKE_PIR] = cs->cpu_index = i;
|
||||
env->spr_cb[SPR_BOOKE_PIR].default_value = cs->cpu_index = i;
|
||||
env->mpic_iack = MPC8544_CCSRBAR_BASE +
|
||||
MPC8544_MPIC_REGS_OFFSET + 0xa0;
|
||||
|
||||
|
92
hw/ppc/ppc.c
92
hw/ppc/ppc.c
@@ -620,6 +620,13 @@ static void cpu_ppc_tb_start (CPUPPCState *env)
|
||||
}
|
||||
}
|
||||
|
||||
bool ppc_decr_clear_on_delivery(CPUPPCState *env)
|
||||
{
|
||||
ppc_tb_t *tb_env = env->tb_env;
|
||||
int flags = PPC_DECR_UNDERFLOW_TRIGGERED | PPC_DECR_UNDERFLOW_LEVEL;
|
||||
return ((tb_env->flags & flags) == PPC_DECR_UNDERFLOW_TRIGGERED);
|
||||
}
|
||||
|
||||
static inline uint32_t _cpu_ppc_load_decr(CPUPPCState *env, uint64_t next)
|
||||
{
|
||||
ppc_tb_t *tb_env = env->tb_env;
|
||||
@@ -677,6 +684,11 @@ static inline void cpu_ppc_decr_excp(PowerPCCPU *cpu)
|
||||
ppc_set_irq(cpu, PPC_INTERRUPT_DECR, 1);
|
||||
}
|
||||
|
||||
static inline void cpu_ppc_decr_lower(PowerPCCPU *cpu)
|
||||
{
|
||||
ppc_set_irq(cpu, PPC_INTERRUPT_DECR, 0);
|
||||
}
|
||||
|
||||
static inline void cpu_ppc_hdecr_excp(PowerPCCPU *cpu)
|
||||
{
|
||||
/* Raise it */
|
||||
@@ -684,11 +696,16 @@ static inline void cpu_ppc_hdecr_excp(PowerPCCPU *cpu)
|
||||
ppc_set_irq(cpu, PPC_INTERRUPT_HDECR, 1);
|
||||
}
|
||||
|
||||
static inline void cpu_ppc_hdecr_lower(PowerPCCPU *cpu)
|
||||
{
|
||||
ppc_set_irq(cpu, PPC_INTERRUPT_HDECR, 0);
|
||||
}
|
||||
|
||||
static void __cpu_ppc_store_decr(PowerPCCPU *cpu, uint64_t *nextp,
|
||||
QEMUTimer *timer,
|
||||
void (*raise_excp)(PowerPCCPU *),
|
||||
uint32_t decr, uint32_t value,
|
||||
int is_excp)
|
||||
void (*raise_excp)(void *),
|
||||
void (*lower_excp)(PowerPCCPU *),
|
||||
uint32_t decr, uint32_t value)
|
||||
{
|
||||
CPUPPCState *env = &cpu->env;
|
||||
ppc_tb_t *tb_env = env->tb_env;
|
||||
@@ -702,59 +719,74 @@ static void __cpu_ppc_store_decr(PowerPCCPU *cpu, uint64_t *nextp,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Going from 2 -> 1, 1 -> 0 or 0 -> -1 is the event to generate a DEC
|
||||
* interrupt.
|
||||
*
|
||||
* If we get a really small DEC value, we can assume that by the time we
|
||||
* handled it we should inject an interrupt already.
|
||||
*
|
||||
* On MSB level based DEC implementations the MSB always means the interrupt
|
||||
* is pending, so raise it on those.
|
||||
*
|
||||
* On MSB edge based DEC implementations the MSB going from 0 -> 1 triggers
|
||||
* an edge interrupt, so raise it here too.
|
||||
*/
|
||||
if ((value < 3) ||
|
||||
((tb_env->flags & PPC_DECR_UNDERFLOW_LEVEL) && (value & 0x80000000)) ||
|
||||
((tb_env->flags & PPC_DECR_UNDERFLOW_TRIGGERED) && (value & 0x80000000)
|
||||
&& !(decr & 0x80000000))) {
|
||||
(*raise_excp)(cpu);
|
||||
return;
|
||||
}
|
||||
|
||||
/* On MSB level based systems a 0 for the MSB stops interrupt delivery */
|
||||
if (!(value & 0x80000000) && (tb_env->flags & PPC_DECR_UNDERFLOW_LEVEL)) {
|
||||
(*lower_excp)(cpu);
|
||||
}
|
||||
|
||||
/* Calculate the next timer event */
|
||||
now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
|
||||
next = now + muldiv64(value, get_ticks_per_sec(), tb_env->decr_freq);
|
||||
if (is_excp) {
|
||||
next += *nextp - now;
|
||||
}
|
||||
if (next == now) {
|
||||
next++;
|
||||
}
|
||||
*nextp = next;
|
||||
|
||||
/* Adjust timer */
|
||||
timer_mod(timer, next);
|
||||
|
||||
/* If we set a negative value and the decrementer was positive, raise an
|
||||
* exception.
|
||||
*/
|
||||
if ((tb_env->flags & PPC_DECR_UNDERFLOW_TRIGGERED)
|
||||
&& (value & 0x80000000)
|
||||
&& !(decr & 0x80000000)) {
|
||||
(*raise_excp)(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void _cpu_ppc_store_decr(PowerPCCPU *cpu, uint32_t decr,
|
||||
uint32_t value, int is_excp)
|
||||
uint32_t value)
|
||||
{
|
||||
ppc_tb_t *tb_env = cpu->env.tb_env;
|
||||
|
||||
__cpu_ppc_store_decr(cpu, &tb_env->decr_next, tb_env->decr_timer,
|
||||
&cpu_ppc_decr_excp, decr, value, is_excp);
|
||||
tb_env->decr_timer->cb, &cpu_ppc_decr_lower, decr,
|
||||
value);
|
||||
}
|
||||
|
||||
void cpu_ppc_store_decr (CPUPPCState *env, uint32_t value)
|
||||
{
|
||||
PowerPCCPU *cpu = ppc_env_get_cpu(env);
|
||||
|
||||
_cpu_ppc_store_decr(cpu, cpu_ppc_load_decr(env), value, 0);
|
||||
_cpu_ppc_store_decr(cpu, cpu_ppc_load_decr(env), value);
|
||||
}
|
||||
|
||||
static void cpu_ppc_decr_cb(void *opaque)
|
||||
{
|
||||
PowerPCCPU *cpu = opaque;
|
||||
|
||||
_cpu_ppc_store_decr(cpu, 0x00000000, 0xFFFFFFFF, 1);
|
||||
cpu_ppc_decr_excp(cpu);
|
||||
}
|
||||
|
||||
static inline void _cpu_ppc_store_hdecr(PowerPCCPU *cpu, uint32_t hdecr,
|
||||
uint32_t value, int is_excp)
|
||||
uint32_t value)
|
||||
{
|
||||
ppc_tb_t *tb_env = cpu->env.tb_env;
|
||||
|
||||
if (tb_env->hdecr_timer != NULL) {
|
||||
__cpu_ppc_store_decr(cpu, &tb_env->hdecr_next, tb_env->hdecr_timer,
|
||||
&cpu_ppc_hdecr_excp, hdecr, value, is_excp);
|
||||
tb_env->hdecr_timer->cb, &cpu_ppc_hdecr_lower,
|
||||
hdecr, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,14 +794,14 @@ void cpu_ppc_store_hdecr (CPUPPCState *env, uint32_t value)
|
||||
{
|
||||
PowerPCCPU *cpu = ppc_env_get_cpu(env);
|
||||
|
||||
_cpu_ppc_store_hdecr(cpu, cpu_ppc_load_hdecr(env), value, 0);
|
||||
_cpu_ppc_store_hdecr(cpu, cpu_ppc_load_hdecr(env), value);
|
||||
}
|
||||
|
||||
static void cpu_ppc_hdecr_cb(void *opaque)
|
||||
{
|
||||
PowerPCCPU *cpu = opaque;
|
||||
|
||||
_cpu_ppc_store_hdecr(cpu, 0x00000000, 0xFFFFFFFF, 1);
|
||||
cpu_ppc_hdecr_excp(cpu);
|
||||
}
|
||||
|
||||
static void cpu_ppc_store_purr(PowerPCCPU *cpu, uint64_t value)
|
||||
@@ -792,8 +824,8 @@ static void cpu_ppc_set_tb_clk (void *opaque, uint32_t freq)
|
||||
* if a decrementer exception is pending when it enables msr_ee at startup,
|
||||
* it's not ready to handle it...
|
||||
*/
|
||||
_cpu_ppc_store_decr(cpu, 0xFFFFFFFF, 0xFFFFFFFF, 0);
|
||||
_cpu_ppc_store_hdecr(cpu, 0xFFFFFFFF, 0xFFFFFFFF, 0);
|
||||
_cpu_ppc_store_decr(cpu, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
_cpu_ppc_store_hdecr(cpu, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
cpu_ppc_store_purr(cpu, 0x0000000000000000ULL);
|
||||
}
|
||||
|
||||
@@ -806,6 +838,10 @@ clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq)
|
||||
tb_env = g_malloc0(sizeof(ppc_tb_t));
|
||||
env->tb_env = tb_env;
|
||||
tb_env->flags = PPC_DECR_UNDERFLOW_TRIGGERED;
|
||||
if (env->insns_flags & PPC_SEGMENT_64B) {
|
||||
/* All Book3S 64bit CPUs implement level based DEC logic */
|
||||
tb_env->flags |= PPC_DECR_UNDERFLOW_LEVEL;
|
||||
}
|
||||
/* Create new timer */
|
||||
tb_env->decr_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &cpu_ppc_decr_cb, cpu);
|
||||
if (0) {
|
||||
|
@@ -65,9 +65,9 @@ static void spin_reset(void *opaque)
|
||||
for (i = 0; i < MAX_CPUS; i++) {
|
||||
SpinInfo *info = &s->spin[i];
|
||||
|
||||
info->pir = i;
|
||||
info->r3 = i;
|
||||
info->addr = 1;
|
||||
stl_p(&info->pir, i);
|
||||
stq_p(&info->r3, i);
|
||||
stq_p(&info->addr, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -190,6 +190,7 @@ int bdrv_open_image(BlockDriverState **pbs, const char *filename,
|
||||
QDict *options, const char *bdref_key, int flags,
|
||||
bool allow_none, Error **errp);
|
||||
int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp);
|
||||
void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp);
|
||||
int bdrv_open(BlockDriverState **pbs, const char *filename,
|
||||
const char *reference, QDict *options, int flags,
|
||||
BlockDriver *drv, Error **errp);
|
||||
|
@@ -342,6 +342,7 @@ uint32 float32_to_uint32( float32 STATUS_PARAM );
|
||||
uint32 float32_to_uint32_round_to_zero( float32 STATUS_PARAM );
|
||||
int64 float32_to_int64( float32 STATUS_PARAM );
|
||||
uint64 float32_to_uint64(float32 STATUS_PARAM);
|
||||
uint64 float32_to_uint64_round_to_zero(float32 STATUS_PARAM);
|
||||
int64 float32_to_int64_round_to_zero( float32 STATUS_PARAM );
|
||||
float64 float32_to_float64( float32 STATUS_PARAM );
|
||||
floatx80 float32_to_floatx80( float32 STATUS_PARAM );
|
||||
|
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 2 of the License.
|
||||
* the Free Software Foundation; either version 2 of the License,
|
||||
* or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
@@ -44,6 +44,9 @@ struct ppc_tb_t {
|
||||
#define PPC_DECR_ZERO_TRIGGERED (1 << 3) /* Decr interrupt triggered when
|
||||
* the decrementer reaches zero.
|
||||
*/
|
||||
#define PPC_DECR_UNDERFLOW_LEVEL (1 << 4) /* Decr interrupt active when
|
||||
* the most significant bit is 1.
|
||||
*/
|
||||
|
||||
uint64_t cpu_ppc_get_tb(ppc_tb_t *tb_env, uint64_t vmclk, int64_t tb_offset);
|
||||
clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq);
|
||||
|
@@ -15,10 +15,20 @@
|
||||
#define IOTHREAD_H
|
||||
|
||||
#include "block/aio.h"
|
||||
#include "qemu/thread.h"
|
||||
|
||||
#define TYPE_IOTHREAD "iothread"
|
||||
|
||||
typedef struct IOThread IOThread;
|
||||
typedef struct {
|
||||
Object parent_obj;
|
||||
|
||||
QemuThread thread;
|
||||
AioContext *ctx;
|
||||
QemuMutex init_done_lock;
|
||||
QemuCond init_done_cond; /* is thread initialization done? */
|
||||
bool stopping;
|
||||
int thread_id;
|
||||
} IOThread;
|
||||
|
||||
#define IOTHREAD(obj) \
|
||||
OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD)
|
||||
|
11
iothread.c
11
iothread.c
@@ -14,7 +14,6 @@
|
||||
#include "qom/object.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/aio.h"
|
||||
#include "sysemu/iothread.h"
|
||||
#include "qmp-commands.h"
|
||||
@@ -22,16 +21,6 @@
|
||||
#define IOTHREADS_PATH "/objects"
|
||||
|
||||
typedef ObjectClass IOThreadClass;
|
||||
struct IOThread {
|
||||
Object parent_obj;
|
||||
|
||||
QemuThread thread;
|
||||
AioContext *ctx;
|
||||
QemuMutex init_done_lock;
|
||||
QemuCond init_done_cond; /* is thread initialization done? */
|
||||
bool stopping;
|
||||
int thread_id;
|
||||
};
|
||||
|
||||
#define IOTHREAD_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(IOThreadClass, obj, TYPE_IOTHREAD)
|
||||
|
@@ -17,7 +17,7 @@
|
||||
- SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
|
||||
implementation for certain IBM POWER hardware. The sources are at
|
||||
https://github.com/aik/SLOF, and the image currently in qemu is
|
||||
built from git tag qemu-slof-20140304.
|
||||
built from git tag qemu-slof-20140404.
|
||||
|
||||
- sgabios (the Serial Graphics Adapter option ROM) provides a means for
|
||||
legacy x86 software to communicate with an attached serial console as
|
||||
|
BIN
pc-bios/slof.bin
BIN
pc-bios/slof.bin
Binary file not shown.
@@ -75,10 +75,13 @@ static void errmsg_dialog(DWORD err, const char *text, const char *opt = "")
|
||||
|
||||
#define chk(status) _chk(hr, status, "Failed to " #status, out)
|
||||
|
||||
#if !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || \
|
||||
__MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301
|
||||
void __stdcall _com_issue_error(HRESULT hr)
|
||||
{
|
||||
errmsg(hr, "Unexpected error in COM");
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
HRESULT put_Value(ICatalogObject *pObj, LPCWSTR name, T val)
|
||||
|
Submodule roms/SLOF updated: af6b7bf587...c90b50b505
@@ -569,8 +569,8 @@ static const VMStateDescription vmstate_msr_hypercall_hypercall = {
|
||||
.minimum_version_id = 1,
|
||||
.minimum_version_id_old = 1,
|
||||
.fields = (VMStateField []) {
|
||||
VMSTATE_UINT64(env.msr_hv_hypercall, X86CPU),
|
||||
VMSTATE_UINT64(env.msr_hv_guest_os_id, X86CPU),
|
||||
VMSTATE_UINT64(env.msr_hv_hypercall, X86CPU),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
@@ -1133,6 +1133,7 @@ uint64_t cpu_ppc_load_atbl (CPUPPCState *env);
|
||||
uint32_t cpu_ppc_load_atbu (CPUPPCState *env);
|
||||
void cpu_ppc_store_atbl (CPUPPCState *env, uint32_t value);
|
||||
void cpu_ppc_store_atbu (CPUPPCState *env, uint32_t value);
|
||||
bool ppc_decr_clear_on_delivery(CPUPPCState *env);
|
||||
uint32_t cpu_ppc_load_decr (CPUPPCState *env);
|
||||
void cpu_ppc_store_decr (CPUPPCState *env, uint32_t value);
|
||||
uint32_t cpu_ppc_load_hdecr (CPUPPCState *env);
|
||||
|
@@ -723,7 +723,6 @@ void ppc_hw_interrupt(CPUPPCState *env)
|
||||
if ((msr_ee != 0 || msr_hv == 0 || msr_pr != 0) && hdice != 0) {
|
||||
/* Hypervisor decrementer exception */
|
||||
if (env->pending_interrupts & (1 << PPC_INTERRUPT_HDECR)) {
|
||||
env->pending_interrupts &= ~(1 << PPC_INTERRUPT_HDECR);
|
||||
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_HDECR);
|
||||
return;
|
||||
}
|
||||
@@ -767,7 +766,9 @@ void ppc_hw_interrupt(CPUPPCState *env)
|
||||
}
|
||||
/* Decrementer exception */
|
||||
if (env->pending_interrupts & (1 << PPC_INTERRUPT_DECR)) {
|
||||
env->pending_interrupts &= ~(1 << PPC_INTERRUPT_DECR);
|
||||
if (ppc_decr_clear_on_delivery(env)) {
|
||||
env->pending_interrupts &= ~(1 << PPC_INTERRUPT_DECR);
|
||||
}
|
||||
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_DECR);
|
||||
return;
|
||||
}
|
||||
|
@@ -1782,11 +1782,19 @@ typedef union _ppc_vsr_t {
|
||||
float64 f64[2];
|
||||
} ppc_vsr_t;
|
||||
|
||||
#if defined(HOST_WORDS_BIGENDIAN)
|
||||
#define VsrW(i) u32[i]
|
||||
#define VsrD(i) u64[i]
|
||||
#else
|
||||
#define VsrW(i) u32[3-(i)]
|
||||
#define VsrD(i) u64[1-(i)]
|
||||
#endif
|
||||
|
||||
static void getVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
|
||||
{
|
||||
if (n < 32) {
|
||||
vsr->f64[0] = env->fpr[n];
|
||||
vsr->u64[1] = env->vsr[n];
|
||||
vsr->VsrD(0) = env->fpr[n];
|
||||
vsr->VsrD(1) = env->vsr[n];
|
||||
} else {
|
||||
vsr->u64[0] = env->avr[n-32].u64[0];
|
||||
vsr->u64[1] = env->avr[n-32].u64[1];
|
||||
@@ -1796,8 +1804,8 @@ static void getVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
|
||||
static void putVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
|
||||
{
|
||||
if (n < 32) {
|
||||
env->fpr[n] = vsr->f64[0];
|
||||
env->vsr[n] = vsr->u64[1];
|
||||
env->fpr[n] = vsr->VsrD(0);
|
||||
env->vsr[n] = vsr->VsrD(1);
|
||||
} else {
|
||||
env->avr[n-32].u64[0] = vsr->u64[0];
|
||||
env->avr[n-32].u64[1] = vsr->u64[1];
|
||||
@@ -1812,7 +1820,7 @@ static void putVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
|
||||
* op - operation (add or sub)
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_ADD_SUB(name, op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -1829,44 +1837,44 @@ void helper_##name(CPUPPCState *env, uint32_t opcode) \
|
||||
for (i = 0; i < nels; i++) { \
|
||||
float_status tstat = env->fp_status; \
|
||||
set_float_exception_flags(0, &tstat); \
|
||||
xt.fld[i] = tp##_##op(xa.fld[i], xb.fld[i], &tstat); \
|
||||
xt.fld = tp##_##op(xa.fld, xb.fld, &tstat); \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if (tp##_is_infinity(xa.fld[i]) && tp##_is_infinity(xb.fld[i])) {\
|
||||
if (tp##_is_infinity(xa.fld) && tp##_is_infinity(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXISI, sfprf); \
|
||||
} else if (tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
} else if (tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
putVSR(xT(opcode), &xt, env); \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_ADD_SUB(xsadddp, add, 1, float64, f64, 1, 0)
|
||||
VSX_ADD_SUB(xsaddsp, add, 1, float64, f64, 1, 1)
|
||||
VSX_ADD_SUB(xvadddp, add, 2, float64, f64, 0, 0)
|
||||
VSX_ADD_SUB(xvaddsp, add, 4, float32, f32, 0, 0)
|
||||
VSX_ADD_SUB(xssubdp, sub, 1, float64, f64, 1, 0)
|
||||
VSX_ADD_SUB(xssubsp, sub, 1, float64, f64, 1, 1)
|
||||
VSX_ADD_SUB(xvsubdp, sub, 2, float64, f64, 0, 0)
|
||||
VSX_ADD_SUB(xvsubsp, sub, 4, float32, f32, 0, 0)
|
||||
VSX_ADD_SUB(xsadddp, add, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_ADD_SUB(xsaddsp, add, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_ADD_SUB(xvadddp, add, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_ADD_SUB(xvaddsp, add, 4, float32, VsrW(i), 0, 0)
|
||||
VSX_ADD_SUB(xssubdp, sub, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_ADD_SUB(xssubsp, sub, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_ADD_SUB(xvsubdp, sub, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_ADD_SUB(xvsubsp, sub, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_MUL - VSX floating point multiply
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_MUL(op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -1883,25 +1891,25 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
for (i = 0; i < nels; i++) { \
|
||||
float_status tstat = env->fp_status; \
|
||||
set_float_exception_flags(0, &tstat); \
|
||||
xt.fld[i] = tp##_mul(xa.fld[i], xb.fld[i], &tstat); \
|
||||
xt.fld = tp##_mul(xa.fld, xb.fld, &tstat); \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if ((tp##_is_infinity(xa.fld[i]) && tp##_is_zero(xb.fld[i])) || \
|
||||
(tp##_is_infinity(xb.fld[i]) && tp##_is_zero(xa.fld[i]))) { \
|
||||
if ((tp##_is_infinity(xa.fld) && tp##_is_zero(xb.fld)) || \
|
||||
(tp##_is_infinity(xb.fld) && tp##_is_zero(xa.fld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXIMZ, sfprf); \
|
||||
} else if (tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
} else if (tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -1909,16 +1917,16 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_MUL(xsmuldp, 1, float64, f64, 1, 0)
|
||||
VSX_MUL(xsmulsp, 1, float64, f64, 1, 1)
|
||||
VSX_MUL(xvmuldp, 2, float64, f64, 0, 0)
|
||||
VSX_MUL(xvmulsp, 4, float32, f32, 0, 0)
|
||||
VSX_MUL(xsmuldp, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_MUL(xsmulsp, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_MUL(xvmuldp, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_MUL(xvmulsp, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_DIV - VSX floating point divide
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_DIV(op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -1935,27 +1943,27 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
for (i = 0; i < nels; i++) { \
|
||||
float_status tstat = env->fp_status; \
|
||||
set_float_exception_flags(0, &tstat); \
|
||||
xt.fld[i] = tp##_div(xa.fld[i], xb.fld[i], &tstat); \
|
||||
xt.fld = tp##_div(xa.fld, xb.fld, &tstat); \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if (tp##_is_infinity(xa.fld[i]) && tp##_is_infinity(xb.fld[i])) { \
|
||||
if (tp##_is_infinity(xa.fld) && tp##_is_infinity(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXIDI, sfprf); \
|
||||
} else if (tp##_is_zero(xa.fld[i]) && \
|
||||
tp##_is_zero(xb.fld[i])) { \
|
||||
} else if (tp##_is_zero(xa.fld) && \
|
||||
tp##_is_zero(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXZDZ, sfprf); \
|
||||
} else if (tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
} else if (tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -1963,16 +1971,16 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_DIV(xsdivdp, 1, float64, f64, 1, 0)
|
||||
VSX_DIV(xsdivsp, 1, float64, f64, 1, 1)
|
||||
VSX_DIV(xvdivdp, 2, float64, f64, 0, 0)
|
||||
VSX_DIV(xvdivsp, 4, float32, f32, 0, 0)
|
||||
VSX_DIV(xsdivdp, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_DIV(xsdivsp, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_DIV(xvdivdp, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_DIV(xvdivsp, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_RE - VSX floating point reciprocal estimate
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_RE(op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -1986,17 +1994,17 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_reset_fpstatus(env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
if (unlikely(tp##_is_signaling_nan(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_signaling_nan(xb.fld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
xt.fld[i] = tp##_div(tp##_one, xb.fld[i], &env->fp_status); \
|
||||
xt.fld = tp##_div(tp##_one, xb.fld, &env->fp_status); \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[0], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -2004,16 +2012,16 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_RE(xsredp, 1, float64, f64, 1, 0)
|
||||
VSX_RE(xsresp, 1, float64, f64, 1, 1)
|
||||
VSX_RE(xvredp, 2, float64, f64, 0, 0)
|
||||
VSX_RE(xvresp, 4, float32, f32, 0, 0)
|
||||
VSX_RE(xsredp, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_RE(xsresp, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_RE(xvredp, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_RE(xvresp, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_SQRT - VSX floating point square root
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_SQRT(op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -2029,23 +2037,23 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
for (i = 0; i < nels; i++) { \
|
||||
float_status tstat = env->fp_status; \
|
||||
set_float_exception_flags(0, &tstat); \
|
||||
xt.fld[i] = tp##_sqrt(xb.fld[i], &tstat); \
|
||||
xt.fld = tp##_sqrt(xb.fld, &tstat); \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if (tp##_is_neg(xb.fld[i]) && !tp##_is_zero(xb.fld[i])) { \
|
||||
if (tp##_is_neg(xb.fld) && !tp##_is_zero(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSQRT, sfprf); \
|
||||
} else if (tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
} else if (tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -2053,16 +2061,16 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_SQRT(xssqrtdp, 1, float64, f64, 1, 0)
|
||||
VSX_SQRT(xssqrtsp, 1, float64, f64, 1, 1)
|
||||
VSX_SQRT(xvsqrtdp, 2, float64, f64, 0, 0)
|
||||
VSX_SQRT(xvsqrtsp, 4, float32, f32, 0, 0)
|
||||
VSX_SQRT(xssqrtdp, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_SQRT(xssqrtsp, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_SQRT(xvsqrtdp, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_SQRT(xvsqrtsp, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_RSQRTE - VSX floating point reciprocal square root estimate
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_RSQRTE(op, nels, tp, fld, sfprf, r2sp) \
|
||||
@@ -2078,24 +2086,24 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
for (i = 0; i < nels; i++) { \
|
||||
float_status tstat = env->fp_status; \
|
||||
set_float_exception_flags(0, &tstat); \
|
||||
xt.fld[i] = tp##_sqrt(xb.fld[i], &tstat); \
|
||||
xt.fld[i] = tp##_div(tp##_one, xt.fld[i], &tstat); \
|
||||
xt.fld = tp##_sqrt(xb.fld, &tstat); \
|
||||
xt.fld = tp##_div(tp##_one, xt.fld, &tstat); \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if (tp##_is_neg(xb.fld[i]) && !tp##_is_zero(xb.fld[i])) { \
|
||||
if (tp##_is_neg(xb.fld) && !tp##_is_zero(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSQRT, sfprf); \
|
||||
} else if (tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
} else if (tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt.fld[i] = helper_frsp(env, xt.fld[i]); \
|
||||
xt.fld = helper_frsp(env, xt.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -2103,16 +2111,16 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_RSQRTE(xsrsqrtedp, 1, float64, f64, 1, 0)
|
||||
VSX_RSQRTE(xsrsqrtesp, 1, float64, f64, 1, 1)
|
||||
VSX_RSQRTE(xvrsqrtedp, 2, float64, f64, 0, 0)
|
||||
VSX_RSQRTE(xvrsqrtesp, 4, float32, f32, 0, 0)
|
||||
VSX_RSQRTE(xsrsqrtedp, 1, float64, VsrD(0), 1, 0)
|
||||
VSX_RSQRTE(xsrsqrtesp, 1, float64, VsrD(0), 1, 1)
|
||||
VSX_RSQRTE(xvrsqrtedp, 2, float64, VsrD(i), 0, 0)
|
||||
VSX_RSQRTE(xvrsqrtesp, 4, float32, VsrW(i), 0, 0)
|
||||
|
||||
/* VSX_TDIV - VSX floating point test for divide
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* emin - minimum unbiased exponent
|
||||
* emax - maximum unbiased exponent
|
||||
* nbits - number of fraction bits
|
||||
@@ -2129,28 +2137,28 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xB(opcode), &xb, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
if (unlikely(tp##_is_infinity(xa.fld[i]) || \
|
||||
tp##_is_infinity(xb.fld[i]) || \
|
||||
tp##_is_zero(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_infinity(xa.fld) || \
|
||||
tp##_is_infinity(xb.fld) || \
|
||||
tp##_is_zero(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
fg_flag = 1; \
|
||||
} else { \
|
||||
int e_a = ppc_##tp##_get_unbiased_exp(xa.fld[i]); \
|
||||
int e_b = ppc_##tp##_get_unbiased_exp(xb.fld[i]); \
|
||||
int e_a = ppc_##tp##_get_unbiased_exp(xa.fld); \
|
||||
int e_b = ppc_##tp##_get_unbiased_exp(xb.fld); \
|
||||
\
|
||||
if (unlikely(tp##_is_any_nan(xa.fld[i]) || \
|
||||
tp##_is_any_nan(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_any_nan(xa.fld) || \
|
||||
tp##_is_any_nan(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
} else if ((e_b <= emin) || (e_b >= (emax-2))) { \
|
||||
fe_flag = 1; \
|
||||
} else if (!tp##_is_zero(xa.fld[i]) && \
|
||||
} else if (!tp##_is_zero(xa.fld) && \
|
||||
(((e_a - e_b) >= emax) || \
|
||||
((e_a - e_b) <= (emin+1)) || \
|
||||
(e_a <= (emin+nbits)))) { \
|
||||
fe_flag = 1; \
|
||||
} \
|
||||
\
|
||||
if (unlikely(tp##_is_zero_or_denormal(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_zero_or_denormal(xb.fld))) { \
|
||||
/* XB is not zero because of the above check and */ \
|
||||
/* so must be denormalized. */ \
|
||||
fg_flag = 1; \
|
||||
@@ -2161,15 +2169,15 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
env->crf[BF(opcode)] = 0x8 | (fg_flag ? 4 : 0) | (fe_flag ? 2 : 0); \
|
||||
}
|
||||
|
||||
VSX_TDIV(xstdivdp, 1, float64, f64, -1022, 1023, 52)
|
||||
VSX_TDIV(xvtdivdp, 2, float64, f64, -1022, 1023, 52)
|
||||
VSX_TDIV(xvtdivsp, 4, float32, f32, -126, 127, 23)
|
||||
VSX_TDIV(xstdivdp, 1, float64, VsrD(0), -1022, 1023, 52)
|
||||
VSX_TDIV(xvtdivdp, 2, float64, VsrD(i), -1022, 1023, 52)
|
||||
VSX_TDIV(xvtdivsp, 4, float32, VsrW(i), -126, 127, 23)
|
||||
|
||||
/* VSX_TSQRT - VSX floating point test for square root
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* emin - minimum unbiased exponent
|
||||
* emax - maximum unbiased exponent
|
||||
* nbits - number of fraction bits
|
||||
@@ -2186,25 +2194,25 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xB(opcode), &xb, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
if (unlikely(tp##_is_infinity(xb.fld[i]) || \
|
||||
tp##_is_zero(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_infinity(xb.fld) || \
|
||||
tp##_is_zero(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
fg_flag = 1; \
|
||||
} else { \
|
||||
int e_b = ppc_##tp##_get_unbiased_exp(xb.fld[i]); \
|
||||
int e_b = ppc_##tp##_get_unbiased_exp(xb.fld); \
|
||||
\
|
||||
if (unlikely(tp##_is_any_nan(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_any_nan(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
} else if (unlikely(tp##_is_zero(xb.fld[i]))) { \
|
||||
} else if (unlikely(tp##_is_zero(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
} else if (unlikely(tp##_is_neg(xb.fld[i]))) { \
|
||||
} else if (unlikely(tp##_is_neg(xb.fld))) { \
|
||||
fe_flag = 1; \
|
||||
} else if (!tp##_is_zero(xb.fld[i]) && \
|
||||
} else if (!tp##_is_zero(xb.fld) && \
|
||||
(e_b <= (emin+nbits))) { \
|
||||
fe_flag = 1; \
|
||||
} \
|
||||
\
|
||||
if (unlikely(tp##_is_zero_or_denormal(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_zero_or_denormal(xb.fld))) { \
|
||||
/* XB is not zero because of the above check and */ \
|
||||
/* therefore must be denormalized. */ \
|
||||
fg_flag = 1; \
|
||||
@@ -2215,15 +2223,15 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
env->crf[BF(opcode)] = 0x8 | (fg_flag ? 4 : 0) | (fe_flag ? 2 : 0); \
|
||||
}
|
||||
|
||||
VSX_TSQRT(xstsqrtdp, 1, float64, f64, -1022, 52)
|
||||
VSX_TSQRT(xvtsqrtdp, 2, float64, f64, -1022, 52)
|
||||
VSX_TSQRT(xvtsqrtsp, 4, float32, f32, -126, 23)
|
||||
VSX_TSQRT(xstsqrtdp, 1, float64, VsrD(0), -1022, 52)
|
||||
VSX_TSQRT(xvtsqrtdp, 2, float64, VsrD(i), -1022, 52)
|
||||
VSX_TSQRT(xvtsqrtsp, 4, float32, VsrW(i), -126, 23)
|
||||
|
||||
/* VSX_MADD - VSX floating point muliply/add variations
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* maddflgs - flags for the float*muladd routine that control the
|
||||
* various forms (madd, msub, nmadd, nmsub)
|
||||
* afrm - A form (1=A, 0=M)
|
||||
@@ -2259,43 +2267,43 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
/* Avoid double rounding errors by rounding the intermediate */ \
|
||||
/* result to odd. */ \
|
||||
set_float_rounding_mode(float_round_to_zero, &tstat); \
|
||||
xt_out.fld[i] = tp##_muladd(xa.fld[i], b->fld[i], c->fld[i], \
|
||||
xt_out.fld = tp##_muladd(xa.fld, b->fld, c->fld, \
|
||||
maddflgs, &tstat); \
|
||||
xt_out.fld[i] |= (get_float_exception_flags(&tstat) & \
|
||||
xt_out.fld |= (get_float_exception_flags(&tstat) & \
|
||||
float_flag_inexact) != 0; \
|
||||
} else { \
|
||||
xt_out.fld[i] = tp##_muladd(xa.fld[i], b->fld[i], c->fld[i], \
|
||||
xt_out.fld = tp##_muladd(xa.fld, b->fld, c->fld, \
|
||||
maddflgs, &tstat); \
|
||||
} \
|
||||
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
|
||||
\
|
||||
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
|
||||
if (tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(b->fld[i]) || \
|
||||
tp##_is_signaling_nan(c->fld[i])) { \
|
||||
if (tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(b->fld) || \
|
||||
tp##_is_signaling_nan(c->fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \
|
||||
tstat.float_exception_flags &= ~float_flag_invalid; \
|
||||
} \
|
||||
if ((tp##_is_infinity(xa.fld[i]) && tp##_is_zero(b->fld[i])) || \
|
||||
(tp##_is_zero(xa.fld[i]) && tp##_is_infinity(b->fld[i]))) { \
|
||||
xt_out.fld[i] = float64_to_##tp(fload_invalid_op_excp(env, \
|
||||
if ((tp##_is_infinity(xa.fld) && tp##_is_zero(b->fld)) || \
|
||||
(tp##_is_zero(xa.fld) && tp##_is_infinity(b->fld))) { \
|
||||
xt_out.fld = float64_to_##tp(fload_invalid_op_excp(env, \
|
||||
POWERPC_EXCP_FP_VXIMZ, sfprf), &env->fp_status); \
|
||||
tstat.float_exception_flags &= ~float_flag_invalid; \
|
||||
} \
|
||||
if ((tstat.float_exception_flags & float_flag_invalid) && \
|
||||
((tp##_is_infinity(xa.fld[i]) || \
|
||||
tp##_is_infinity(b->fld[i])) && \
|
||||
tp##_is_infinity(c->fld[i]))) { \
|
||||
((tp##_is_infinity(xa.fld) || \
|
||||
tp##_is_infinity(b->fld)) && \
|
||||
tp##_is_infinity(c->fld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXISI, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (r2sp) { \
|
||||
xt_out.fld[i] = helper_frsp(env, xt_out.fld[i]); \
|
||||
xt_out.fld = helper_frsp(env, xt_out.fld); \
|
||||
} \
|
||||
\
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt_out.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt_out.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
putVSR(xT(opcode), &xt_out, env); \
|
||||
@@ -2307,41 +2315,41 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
#define NMADD_FLGS float_muladd_negate_result
|
||||
#define NMSUB_FLGS (float_muladd_negate_c | float_muladd_negate_result)
|
||||
|
||||
VSX_MADD(xsmaddadp, 1, float64, f64, MADD_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsmaddmdp, 1, float64, f64, MADD_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsmsubadp, 1, float64, f64, MSUB_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsmsubmdp, 1, float64, f64, MSUB_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsnmaddadp, 1, float64, f64, NMADD_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsnmaddmdp, 1, float64, f64, NMADD_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsnmsubadp, 1, float64, f64, NMSUB_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsnmsubmdp, 1, float64, f64, NMSUB_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsmaddadp, 1, float64, VsrD(0), MADD_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsmaddmdp, 1, float64, VsrD(0), MADD_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsmsubadp, 1, float64, VsrD(0), MSUB_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsmsubmdp, 1, float64, VsrD(0), MSUB_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsnmaddadp, 1, float64, VsrD(0), NMADD_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsnmaddmdp, 1, float64, VsrD(0), NMADD_FLGS, 0, 1, 0)
|
||||
VSX_MADD(xsnmsubadp, 1, float64, VsrD(0), NMSUB_FLGS, 1, 1, 0)
|
||||
VSX_MADD(xsnmsubmdp, 1, float64, VsrD(0), NMSUB_FLGS, 0, 1, 0)
|
||||
|
||||
VSX_MADD(xsmaddasp, 1, float64, f64, MADD_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsmaddmsp, 1, float64, f64, MADD_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsmsubasp, 1, float64, f64, MSUB_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsmsubmsp, 1, float64, f64, MSUB_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsnmaddasp, 1, float64, f64, NMADD_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsnmaddmsp, 1, float64, f64, NMADD_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsnmsubasp, 1, float64, f64, NMSUB_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsnmsubmsp, 1, float64, f64, NMSUB_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsmaddasp, 1, float64, VsrD(0), MADD_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsmaddmsp, 1, float64, VsrD(0), MADD_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsmsubasp, 1, float64, VsrD(0), MSUB_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsmsubmsp, 1, float64, VsrD(0), MSUB_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsnmaddasp, 1, float64, VsrD(0), NMADD_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsnmaddmsp, 1, float64, VsrD(0), NMADD_FLGS, 0, 1, 1)
|
||||
VSX_MADD(xsnmsubasp, 1, float64, VsrD(0), NMSUB_FLGS, 1, 1, 1)
|
||||
VSX_MADD(xsnmsubmsp, 1, float64, VsrD(0), NMSUB_FLGS, 0, 1, 1)
|
||||
|
||||
VSX_MADD(xvmaddadp, 2, float64, f64, MADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmaddmdp, 2, float64, f64, MADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmsubadp, 2, float64, f64, MSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmsubmdp, 2, float64, f64, MSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmaddadp, 2, float64, f64, NMADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmaddmdp, 2, float64, f64, NMADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmsubadp, 2, float64, f64, NMSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmsubmdp, 2, float64, f64, NMSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmaddadp, 2, float64, VsrD(i), MADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmaddmdp, 2, float64, VsrD(i), MADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmsubadp, 2, float64, VsrD(i), MSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmsubmdp, 2, float64, VsrD(i), MSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmaddadp, 2, float64, VsrD(i), NMADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmaddmdp, 2, float64, VsrD(i), NMADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmsubadp, 2, float64, VsrD(i), NMSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmsubmdp, 2, float64, VsrD(i), NMSUB_FLGS, 0, 0, 0)
|
||||
|
||||
VSX_MADD(xvmaddasp, 4, float32, f32, MADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmaddmsp, 4, float32, f32, MADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmsubasp, 4, float32, f32, MSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmsubmsp, 4, float32, f32, MSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmaddasp, 4, float32, f32, NMADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmaddmsp, 4, float32, f32, NMADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmsubasp, 4, float32, f32, NMSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmsubmsp, 4, float32, f32, NMSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmaddasp, 4, float32, VsrW(i), MADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmaddmsp, 4, float32, VsrW(i), MADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvmsubasp, 4, float32, VsrW(i), MSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvmsubmsp, 4, float32, VsrW(i), MSUB_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmaddasp, 4, float32, VsrW(i), NMADD_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmaddmsp, 4, float32, VsrW(i), NMADD_FLGS, 0, 0, 0)
|
||||
VSX_MADD(xvnmsubasp, 4, float32, VsrW(i), NMSUB_FLGS, 1, 0, 0)
|
||||
VSX_MADD(xvnmsubmsp, 4, float32, VsrW(i), NMSUB_FLGS, 0, 0, 0)
|
||||
|
||||
#define VSX_SCALAR_CMP(op, ordered) \
|
||||
void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
@@ -2352,10 +2360,10 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xA(opcode), &xa, env); \
|
||||
getVSR(xB(opcode), &xb, env); \
|
||||
\
|
||||
if (unlikely(float64_is_any_nan(xa.f64[0]) || \
|
||||
float64_is_any_nan(xb.f64[0]))) { \
|
||||
if (float64_is_signaling_nan(xa.f64[0]) || \
|
||||
float64_is_signaling_nan(xb.f64[0])) { \
|
||||
if (unlikely(float64_is_any_nan(xa.VsrD(0)) || \
|
||||
float64_is_any_nan(xb.VsrD(0)))) { \
|
||||
if (float64_is_signaling_nan(xa.VsrD(0)) || \
|
||||
float64_is_signaling_nan(xb.VsrD(0))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
} \
|
||||
if (ordered) { \
|
||||
@@ -2363,9 +2371,10 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
} \
|
||||
cc = 1; \
|
||||
} else { \
|
||||
if (float64_lt(xa.f64[0], xb.f64[0], &env->fp_status)) { \
|
||||
if (float64_lt(xa.VsrD(0), xb.VsrD(0), &env->fp_status)) { \
|
||||
cc = 8; \
|
||||
} else if (!float64_le(xa.f64[0], xb.f64[0], &env->fp_status)) { \
|
||||
} else if (!float64_le(xa.VsrD(0), xb.VsrD(0), \
|
||||
&env->fp_status)) { \
|
||||
cc = 4; \
|
||||
} else { \
|
||||
cc = 2; \
|
||||
@@ -2390,7 +2399,7 @@ VSX_SCALAR_CMP(xscmpudp, 0)
|
||||
* op - operation (max or min)
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
*/
|
||||
#define VSX_MAX_MIN(name, op, nels, tp, fld) \
|
||||
void helper_##name(CPUPPCState *env, uint32_t opcode) \
|
||||
@@ -2403,9 +2412,9 @@ void helper_##name(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xT(opcode), &xt, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
xt.fld[i] = tp##_##op(xa.fld[i], xb.fld[i], &env->fp_status); \
|
||||
if (unlikely(tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(xb.fld[i]))) { \
|
||||
xt.fld = tp##_##op(xa.fld, xb.fld, &env->fp_status); \
|
||||
if (unlikely(tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(xb.fld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
} \
|
||||
} \
|
||||
@@ -2414,18 +2423,18 @@ void helper_##name(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_MAX_MIN(xsmaxdp, maxnum, 1, float64, f64)
|
||||
VSX_MAX_MIN(xvmaxdp, maxnum, 2, float64, f64)
|
||||
VSX_MAX_MIN(xvmaxsp, maxnum, 4, float32, f32)
|
||||
VSX_MAX_MIN(xsmindp, minnum, 1, float64, f64)
|
||||
VSX_MAX_MIN(xvmindp, minnum, 2, float64, f64)
|
||||
VSX_MAX_MIN(xvminsp, minnum, 4, float32, f32)
|
||||
VSX_MAX_MIN(xsmaxdp, maxnum, 1, float64, VsrD(0))
|
||||
VSX_MAX_MIN(xvmaxdp, maxnum, 2, float64, VsrD(i))
|
||||
VSX_MAX_MIN(xvmaxsp, maxnum, 4, float32, VsrW(i))
|
||||
VSX_MAX_MIN(xsmindp, minnum, 1, float64, VsrD(0))
|
||||
VSX_MAX_MIN(xvmindp, minnum, 2, float64, VsrD(i))
|
||||
VSX_MAX_MIN(xvminsp, minnum, 4, float32, VsrW(i))
|
||||
|
||||
/* VSX_CMP - VSX floating point compare
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* cmp - comparison operation
|
||||
* svxvc - set VXVC bit
|
||||
*/
|
||||
@@ -2442,23 +2451,23 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xT(opcode), &xt, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
if (unlikely(tp##_is_any_nan(xa.fld[i]) || \
|
||||
tp##_is_any_nan(xb.fld[i]))) { \
|
||||
if (tp##_is_signaling_nan(xa.fld[i]) || \
|
||||
tp##_is_signaling_nan(xb.fld[i])) { \
|
||||
if (unlikely(tp##_is_any_nan(xa.fld) || \
|
||||
tp##_is_any_nan(xb.fld))) { \
|
||||
if (tp##_is_signaling_nan(xa.fld) || \
|
||||
tp##_is_signaling_nan(xb.fld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
} \
|
||||
if (svxvc) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXVC, 0); \
|
||||
} \
|
||||
xt.fld[i] = 0; \
|
||||
xt.fld = 0; \
|
||||
all_true = 0; \
|
||||
} else { \
|
||||
if (tp##_##cmp(xb.fld[i], xa.fld[i], &env->fp_status) == 1) { \
|
||||
xt.fld[i] = -1; \
|
||||
if (tp##_##cmp(xb.fld, xa.fld, &env->fp_status) == 1) { \
|
||||
xt.fld = -1; \
|
||||
all_false = 0; \
|
||||
} else { \
|
||||
xt.fld[i] = 0; \
|
||||
xt.fld = 0; \
|
||||
all_true = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -2471,18 +2480,12 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_CMP(xvcmpeqdp, 2, float64, f64, eq, 0)
|
||||
VSX_CMP(xvcmpgedp, 2, float64, f64, le, 1)
|
||||
VSX_CMP(xvcmpgtdp, 2, float64, f64, lt, 1)
|
||||
VSX_CMP(xvcmpeqsp, 4, float32, f32, eq, 0)
|
||||
VSX_CMP(xvcmpgesp, 4, float32, f32, le, 1)
|
||||
VSX_CMP(xvcmpgtsp, 4, float32, f32, lt, 1)
|
||||
|
||||
#if defined(HOST_WORDS_BIGENDIAN)
|
||||
#define JOFFSET 0
|
||||
#else
|
||||
#define JOFFSET 1
|
||||
#endif
|
||||
VSX_CMP(xvcmpeqdp, 2, float64, VsrD(i), eq, 0)
|
||||
VSX_CMP(xvcmpgedp, 2, float64, VsrD(i), le, 1)
|
||||
VSX_CMP(xvcmpgtdp, 2, float64, VsrD(i), lt, 1)
|
||||
VSX_CMP(xvcmpeqsp, 4, float32, VsrW(i), eq, 0)
|
||||
VSX_CMP(xvcmpgesp, 4, float32, VsrW(i), le, 1)
|
||||
VSX_CMP(xvcmpgtsp, 4, float32, VsrW(i), lt, 1)
|
||||
|
||||
/* VSX_CVT_FP_TO_FP - VSX floating point/floating point conversion
|
||||
* op - instruction mnemonic
|
||||
@@ -2503,7 +2506,6 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xT(opcode), &xt, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
int j = 2*i + JOFFSET; \
|
||||
xt.tfld = stp##_to_##ttp(xb.sfld, &env->fp_status); \
|
||||
if (unlikely(stp##_is_signaling_nan(xb.sfld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
@@ -2519,10 +2521,10 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_CVT_FP_TO_FP(xscvdpsp, 1, float64, float32, f64[i], f32[j], 1)
|
||||
VSX_CVT_FP_TO_FP(xscvspdp, 1, float32, float64, f32[j], f64[i], 1)
|
||||
VSX_CVT_FP_TO_FP(xvcvdpsp, 2, float64, float32, f64[i], f32[j], 0)
|
||||
VSX_CVT_FP_TO_FP(xvcvspdp, 2, float32, float64, f32[j], f64[i], 0)
|
||||
VSX_CVT_FP_TO_FP(xscvdpsp, 1, float64, float32, VsrD(0), VsrW(0), 1)
|
||||
VSX_CVT_FP_TO_FP(xscvspdp, 1, float32, float64, VsrW(0), VsrD(0), 1)
|
||||
VSX_CVT_FP_TO_FP(xvcvdpsp, 2, float64, float32, VsrD(i), VsrW(2*i), 0)
|
||||
VSX_CVT_FP_TO_FP(xvcvspdp, 2, float32, float64, VsrW(2*i), VsrD(i), 0)
|
||||
|
||||
uint64_t helper_xscvdpspn(CPUPPCState *env, uint64_t xb)
|
||||
{
|
||||
@@ -2547,10 +2549,9 @@ uint64_t helper_xscvspdpn(CPUPPCState *env, uint64_t xb)
|
||||
* ttp - target type (int32, uint32, int64 or uint64)
|
||||
* sfld - source vsr_t field
|
||||
* tfld - target vsr_t field
|
||||
* jdef - definition of the j index (i or 2*i)
|
||||
* rnan - resulting NaN
|
||||
*/
|
||||
#define VSX_CVT_FP_TO_INT(op, nels, stp, ttp, sfld, tfld, jdef, rnan) \
|
||||
#define VSX_CVT_FP_TO_INT(op, nels, stp, ttp, sfld, tfld, rnan) \
|
||||
void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
{ \
|
||||
ppc_vsr_t xt, xb; \
|
||||
@@ -2560,7 +2561,6 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xT(opcode), &xt, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
int j = jdef; \
|
||||
if (unlikely(stp##_is_any_nan(xb.sfld))) { \
|
||||
if (stp##_is_signaling_nan(xb.sfld)) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
@@ -2568,7 +2568,8 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXCVI, 0); \
|
||||
xt.tfld = rnan; \
|
||||
} else { \
|
||||
xt.tfld = stp##_to_##ttp(xb.sfld, &env->fp_status); \
|
||||
xt.tfld = stp##_to_##ttp##_round_to_zero(xb.sfld, \
|
||||
&env->fp_status); \
|
||||
if (env->fp_status.float_exception_flags & float_flag_invalid) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXCVI, 0); \
|
||||
} \
|
||||
@@ -2579,27 +2580,23 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_CVT_FP_TO_INT(xscvdpsxds, 1, float64, int64, f64[j], u64[i], i, \
|
||||
VSX_CVT_FP_TO_INT(xscvdpsxds, 1, float64, int64, VsrD(0), VsrD(0), \
|
||||
0x8000000000000000ULL)
|
||||
VSX_CVT_FP_TO_INT(xscvdpsxws, 1, float64, int32, f64[i], u32[j], \
|
||||
2*i + JOFFSET, 0x80000000U)
|
||||
VSX_CVT_FP_TO_INT(xscvdpuxds, 1, float64, uint64, f64[j], u64[i], i, 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xscvdpuxws, 1, float64, uint32, f64[i], u32[j], \
|
||||
2*i + JOFFSET, 0U)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpsxds, 2, float64, int64, f64[j], u64[i], i, \
|
||||
0x8000000000000000ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpsxws, 2, float64, int32, f64[i], u32[j], \
|
||||
2*i + JOFFSET, 0x80000000U)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpuxds, 2, float64, uint64, f64[j], u64[i], i, 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpuxws, 2, float64, uint32, f64[i], u32[j], \
|
||||
2*i + JOFFSET, 0U)
|
||||
VSX_CVT_FP_TO_INT(xvcvspsxds, 2, float32, int64, f32[j], u64[i], \
|
||||
2*i + JOFFSET, 0x8000000000000000ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvspsxws, 4, float32, int32, f32[j], u32[j], i, \
|
||||
VSX_CVT_FP_TO_INT(xscvdpsxws, 1, float64, int32, VsrD(0), VsrW(1), \
|
||||
0x80000000U)
|
||||
VSX_CVT_FP_TO_INT(xvcvspuxds, 2, float32, uint64, f32[j], u64[i], \
|
||||
2*i + JOFFSET, 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvspuxws, 4, float32, uint32, f32[j], u32[i], i, 0U)
|
||||
VSX_CVT_FP_TO_INT(xscvdpuxds, 1, float64, uint64, VsrD(0), VsrD(0), 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xscvdpuxws, 1, float64, uint32, VsrD(0), VsrW(1), 0U)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpsxds, 2, float64, int64, VsrD(i), VsrD(i), \
|
||||
0x8000000000000000ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpsxws, 2, float64, int32, VsrD(i), VsrW(2*i), \
|
||||
0x80000000U)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpuxds, 2, float64, uint64, VsrD(i), VsrD(i), 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvdpuxws, 2, float64, uint32, VsrD(i), VsrW(2*i), 0U)
|
||||
VSX_CVT_FP_TO_INT(xvcvspsxds, 2, float32, int64, VsrW(2*i), VsrD(i), \
|
||||
0x8000000000000000ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvspsxws, 4, float32, int32, VsrW(i), VsrW(i), 0x80000000U)
|
||||
VSX_CVT_FP_TO_INT(xvcvspuxds, 2, float32, uint64, VsrW(2*i), VsrD(i), 0ULL)
|
||||
VSX_CVT_FP_TO_INT(xvcvspuxws, 4, float32, uint32, VsrW(i), VsrW(i), 0U)
|
||||
|
||||
/* VSX_CVT_INT_TO_FP - VSX integer to floating point conversion
|
||||
* op - instruction mnemonic
|
||||
@@ -2611,7 +2608,7 @@ VSX_CVT_FP_TO_INT(xvcvspuxws, 4, float32, uint32, f32[j], u32[i], i, 0U)
|
||||
* jdef - definition of the j index (i or 2*i)
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
#define VSX_CVT_INT_TO_FP(op, nels, stp, ttp, sfld, tfld, jdef, sfprf, r2sp) \
|
||||
#define VSX_CVT_INT_TO_FP(op, nels, stp, ttp, sfld, tfld, sfprf, r2sp) \
|
||||
void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
{ \
|
||||
ppc_vsr_t xt, xb; \
|
||||
@@ -2621,7 +2618,6 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
getVSR(xT(opcode), &xt, env); \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
int j = jdef; \
|
||||
xt.tfld = stp##_to_##ttp(xb.sfld, &env->fp_status); \
|
||||
if (r2sp) { \
|
||||
xt.tfld = helper_frsp(env, xt.tfld); \
|
||||
@@ -2635,22 +2631,18 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_CVT_INT_TO_FP(xscvsxddp, 1, int64, float64, u64[j], f64[i], i, 1, 0)
|
||||
VSX_CVT_INT_TO_FP(xscvuxddp, 1, uint64, float64, u64[j], f64[i], i, 1, 0)
|
||||
VSX_CVT_INT_TO_FP(xscvsxdsp, 1, int64, float64, u64[j], f64[i], i, 1, 1)
|
||||
VSX_CVT_INT_TO_FP(xscvuxdsp, 1, uint64, float64, u64[j], f64[i], i, 1, 1)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxddp, 2, int64, float64, u64[j], f64[i], i, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxddp, 2, uint64, float64, u64[j], f64[i], i, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxwdp, 2, int32, float64, u32[j], f64[i], \
|
||||
2*i + JOFFSET, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxwdp, 2, uint64, float64, u32[j], f64[i], \
|
||||
2*i + JOFFSET, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxdsp, 2, int64, float32, u64[i], f32[j], \
|
||||
2*i + JOFFSET, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxdsp, 2, uint64, float32, u64[i], f32[j], \
|
||||
2*i + JOFFSET, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxwsp, 4, int32, float32, u32[j], f32[i], i, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxwsp, 4, uint32, float32, u32[j], f32[i], i, 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xscvsxddp, 1, int64, float64, VsrD(0), VsrD(0), 1, 0)
|
||||
VSX_CVT_INT_TO_FP(xscvuxddp, 1, uint64, float64, VsrD(0), VsrD(0), 1, 0)
|
||||
VSX_CVT_INT_TO_FP(xscvsxdsp, 1, int64, float64, VsrD(0), VsrD(0), 1, 1)
|
||||
VSX_CVT_INT_TO_FP(xscvuxdsp, 1, uint64, float64, VsrD(0), VsrD(0), 1, 1)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxddp, 2, int64, float64, VsrD(i), VsrD(i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxddp, 2, uint64, float64, VsrD(i), VsrD(i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxwdp, 2, int32, float64, VsrW(2*i), VsrD(i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxwdp, 2, uint64, float64, VsrW(2*i), VsrD(i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxdsp, 2, int64, float32, VsrD(i), VsrW(2*i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxdsp, 2, uint64, float32, VsrD(i), VsrW(2*i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvsxwsp, 4, int32, float32, VsrW(i), VsrW(i), 0, 0)
|
||||
VSX_CVT_INT_TO_FP(xvcvuxwsp, 4, uint32, float32, VsrW(i), VsrW(i), 0, 0)
|
||||
|
||||
/* For "use current rounding mode", define a value that will not be one of
|
||||
* the existing rounding model enums.
|
||||
@@ -2662,7 +2654,7 @@ VSX_CVT_INT_TO_FP(xvcvuxwsp, 4, uint32, float32, u32[j], f32[i], i, 0, 0)
|
||||
* op - instruction mnemonic
|
||||
* nels - number of elements (1, 2 or 4)
|
||||
* tp - type (float32 or float64)
|
||||
* fld - vsr_t field (f32 or f64)
|
||||
* fld - vsr_t field (VsrD(*) or VsrW(*))
|
||||
* rmode - rounding mode
|
||||
* sfprf - set FPRF
|
||||
*/
|
||||
@@ -2679,14 +2671,14 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
} \
|
||||
\
|
||||
for (i = 0; i < nels; i++) { \
|
||||
if (unlikely(tp##_is_signaling_nan(xb.fld[i]))) { \
|
||||
if (unlikely(tp##_is_signaling_nan(xb.fld))) { \
|
||||
fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0); \
|
||||
xt.fld[i] = tp##_snan_to_qnan(xb.fld[i]); \
|
||||
xt.fld = tp##_snan_to_qnan(xb.fld); \
|
||||
} else { \
|
||||
xt.fld[i] = tp##_round_to_int(xb.fld[i], &env->fp_status); \
|
||||
xt.fld = tp##_round_to_int(xb.fld, &env->fp_status); \
|
||||
} \
|
||||
if (sfprf) { \
|
||||
helper_compute_fprf(env, xt.fld[i], sfprf); \
|
||||
helper_compute_fprf(env, xt.fld, sfprf); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
@@ -2702,23 +2694,23 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
|
||||
helper_float_check_status(env); \
|
||||
}
|
||||
|
||||
VSX_ROUND(xsrdpi, 1, float64, f64, float_round_nearest_even, 1)
|
||||
VSX_ROUND(xsrdpic, 1, float64, f64, FLOAT_ROUND_CURRENT, 1)
|
||||
VSX_ROUND(xsrdpim, 1, float64, f64, float_round_down, 1)
|
||||
VSX_ROUND(xsrdpip, 1, float64, f64, float_round_up, 1)
|
||||
VSX_ROUND(xsrdpiz, 1, float64, f64, float_round_to_zero, 1)
|
||||
VSX_ROUND(xsrdpi, 1, float64, VsrD(0), float_round_nearest_even, 1)
|
||||
VSX_ROUND(xsrdpic, 1, float64, VsrD(0), FLOAT_ROUND_CURRENT, 1)
|
||||
VSX_ROUND(xsrdpim, 1, float64, VsrD(0), float_round_down, 1)
|
||||
VSX_ROUND(xsrdpip, 1, float64, VsrD(0), float_round_up, 1)
|
||||
VSX_ROUND(xsrdpiz, 1, float64, VsrD(0), float_round_to_zero, 1)
|
||||
|
||||
VSX_ROUND(xvrdpi, 2, float64, f64, float_round_nearest_even, 0)
|
||||
VSX_ROUND(xvrdpic, 2, float64, f64, FLOAT_ROUND_CURRENT, 0)
|
||||
VSX_ROUND(xvrdpim, 2, float64, f64, float_round_down, 0)
|
||||
VSX_ROUND(xvrdpip, 2, float64, f64, float_round_up, 0)
|
||||
VSX_ROUND(xvrdpiz, 2, float64, f64, float_round_to_zero, 0)
|
||||
VSX_ROUND(xvrdpi, 2, float64, VsrD(i), float_round_nearest_even, 0)
|
||||
VSX_ROUND(xvrdpic, 2, float64, VsrD(i), FLOAT_ROUND_CURRENT, 0)
|
||||
VSX_ROUND(xvrdpim, 2, float64, VsrD(i), float_round_down, 0)
|
||||
VSX_ROUND(xvrdpip, 2, float64, VsrD(i), float_round_up, 0)
|
||||
VSX_ROUND(xvrdpiz, 2, float64, VsrD(i), float_round_to_zero, 0)
|
||||
|
||||
VSX_ROUND(xvrspi, 4, float32, f32, float_round_nearest_even, 0)
|
||||
VSX_ROUND(xvrspic, 4, float32, f32, FLOAT_ROUND_CURRENT, 0)
|
||||
VSX_ROUND(xvrspim, 4, float32, f32, float_round_down, 0)
|
||||
VSX_ROUND(xvrspip, 4, float32, f32, float_round_up, 0)
|
||||
VSX_ROUND(xvrspiz, 4, float32, f32, float_round_to_zero, 0)
|
||||
VSX_ROUND(xvrspi, 4, float32, VsrW(i), float_round_nearest_even, 0)
|
||||
VSX_ROUND(xvrspic, 4, float32, VsrW(i), FLOAT_ROUND_CURRENT, 0)
|
||||
VSX_ROUND(xvrspim, 4, float32, VsrW(i), float_round_down, 0)
|
||||
VSX_ROUND(xvrspip, 4, float32, VsrW(i), float_round_up, 0)
|
||||
VSX_ROUND(xvrspiz, 4, float32, VsrW(i), float_round_to_zero, 0)
|
||||
|
||||
uint64_t helper_xsrsp(CPUPPCState *env, uint64_t xb)
|
||||
{
|
||||
|
@@ -101,7 +101,7 @@ static inline int hreg_store_msr(CPUPPCState *env, target_ulong value,
|
||||
hreg_compute_hflags(env);
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
if (unlikely(msr_pow == 1)) {
|
||||
if ((*env->check_pow)(env)) {
|
||||
if (!env->pending_interrupts && (*env->check_pow)(env)) {
|
||||
cs->halted = 1;
|
||||
excp = EXCP_HALTED;
|
||||
}
|
||||
|
@@ -6699,6 +6699,8 @@ POWERPC_FAMILY(970)(ObjectClass *oc, void *data)
|
||||
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
||||
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
||||
POWERPC_FLAG_BUS_CLK;
|
||||
pcc->l1_dcache_size = 0x8000;
|
||||
pcc->l1_icache_size = 0x10000;
|
||||
}
|
||||
|
||||
static int check_pow_970FX (CPUPPCState *env)
|
||||
@@ -6791,6 +6793,8 @@ POWERPC_FAMILY(970FX)(ObjectClass *oc, void *data)
|
||||
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
||||
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
||||
POWERPC_FLAG_BUS_CLK;
|
||||
pcc->l1_dcache_size = 0x8000;
|
||||
pcc->l1_icache_size = 0x10000;
|
||||
}
|
||||
|
||||
static int check_pow_970MP (CPUPPCState *env)
|
||||
@@ -6877,6 +6881,8 @@ POWERPC_FAMILY(970MP)(ObjectClass *oc, void *data)
|
||||
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
||||
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
||||
POWERPC_FLAG_BUS_CLK;
|
||||
pcc->l1_dcache_size = 0x8000;
|
||||
pcc->l1_icache_size = 0x10000;
|
||||
}
|
||||
|
||||
static void init_proc_power5plus(CPUPPCState *env)
|
||||
@@ -6967,6 +6973,8 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data)
|
||||
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
||||
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
||||
POWERPC_FLAG_BUS_CLK;
|
||||
pcc->l1_dcache_size = 0x8000;
|
||||
pcc->l1_icache_size = 0x10000;
|
||||
}
|
||||
|
||||
static void init_proc_POWER7 (CPUPPCState *env)
|
||||
|
@@ -394,7 +394,8 @@ check-block: $(patsubst %,check-%, $(check-block-y))
|
||||
check: check-qapi-schema check-unit check-qtest
|
||||
check-clean:
|
||||
$(MAKE) -C tests/tcg clean
|
||||
rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
|
||||
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
|
||||
rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)))
|
||||
|
||||
clean: check-clean
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -131,6 +131,26 @@ ulimit -c "$old_ulimit"
|
||||
./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
||||
_check_test_img
|
||||
|
||||
echo
|
||||
echo "== Committing to a backing file with lazy_refcounts=on =="
|
||||
|
||||
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
||||
TEST_IMG="$TEST_IMG".base _make_test_img $size
|
||||
|
||||
IMGOPTS="compat=1.1,lazy_refcounts=on,backing_file=$TEST_IMG.base"
|
||||
_make_test_img $size
|
||||
|
||||
$QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io
|
||||
$QEMU_IMG commit "$TEST_IMG"
|
||||
|
||||
# The dirty bit must not be set
|
||||
./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
||||
./qcow2.py "$TEST_IMG".base dump-header | grep incompatible_features
|
||||
|
||||
_check_test_img
|
||||
TEST_IMG="$TEST_IMG".base _check_test_img
|
||||
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
rm -f $seq.full
|
||||
|
@@ -54,4 +54,15 @@ wrote 512/512 bytes at offset 0
|
||||
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
incompatible_features 0x0
|
||||
No errors were found on the image.
|
||||
|
||||
== Committing to a backing file with lazy_refcounts=on ==
|
||||
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.base'
|
||||
wrote 512/512 bytes at offset 0
|
||||
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
Image committed.
|
||||
incompatible_features 0x0
|
||||
incompatible_features 0x0
|
||||
No errors were found on the image.
|
||||
No errors were found on the image.
|
||||
*** done
|
||||
|
@@ -204,6 +204,10 @@ run_qemu -hda foo:bar
|
||||
run_qemu -drive file=foo:bar
|
||||
run_qemu -drive file.filename=foo:bar
|
||||
|
||||
run_qemu -hda "file:$TEST_IMG"
|
||||
run_qemu -drive file="file:$TEST_IMG"
|
||||
run_qemu -drive file.filename="file:$TEST_IMG"
|
||||
|
||||
echo
|
||||
echo === Snapshot mode ===
|
||||
echo
|
||||
@@ -214,6 +218,14 @@ echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG"
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
|
||||
|
||||
# Opening a read-only file r/w with snapshot=on
|
||||
chmod u-w "$TEST_IMG"
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
|
||||
echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
|
||||
chmod u+w "$TEST_IMG"
|
||||
|
||||
$QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
|
||||
|
||||
|
@@ -44,11 +44,11 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open disk image TE
|
||||
=== Overriding backing file ===
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig -nodefaults
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) i[K[Din[K[D[Dinf[K[D[D[Dinfo[K[D[D[D[Dinfo [K[D[D[D[D[Dinfo b[K[D[D[D[D[D[Dinfo bl[K[D[D[D[D[D[D[Dinfo blo[K[D[D[D[D[D[D[D[Dinfo bloc[K[D[D[D[D[D[D[D[D[Dinfo block[K
|
||||
ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
|
||||
Backing file: TEST_DIR/t.qcow2.orig (chain depth: 1)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) i[K[Din[K[D[Dinf[K[D[D[Dinfo[K[D[D[D[Dinfo [K[D[D[D[D[Dinfo b[K[D[D[D[D[D[Dinfo bl[K[D[D[D[D[D[D[Dinfo blo[K[D[D[D[D[D[D[D[Dinfo bloc[K[D[D[D[D[D[D[D[D[Dinfo block[K
|
||||
ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
|
||||
Backing file: TEST_DIR/t.qcow2.orig (chain depth: 1)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
|
||||
=== Enable and disable lazy refcounting on the command line, plus some invalid values ===
|
||||
@@ -275,6 +275,17 @@ QEMU_PROG: -drive file=foo:bar: could not open disk image foo:bar: Unknown proto
|
||||
Testing: -drive file.filename=foo:bar
|
||||
QEMU_PROG: -drive file.filename=foo:bar: could not open disk image ide0-hd0: Could not open 'foo:bar': No such file or directory
|
||||
|
||||
Testing: -hda file:TEST_DIR/t.qcow2
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file=file:TEST_DIR/t.qcow2
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file.filename=file:TEST_DIR/t.qcow2
|
||||
QEMU_PROG: -drive file.filename=file:TEST_DIR/t.qcow2: could not open disk image ide0-hd0: Could not open 'file:TEST_DIR/t.qcow2': No such file or directory
|
||||
|
||||
|
||||
=== Snapshot mode ===
|
||||
|
||||
@@ -308,6 +319,34 @@ wrote 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqe[K[D[Dqem[K[D[D[Dqemu[K[D[D[D[Dqemu-[K[D[D[D[D[Dqemu-i[K[D[D[D[D[D[Dqemu-io[K[D[D[D[D[D[D[Dqemu-io [K[D[D[D[D[D[D[D[Dqemu-io i[K[D[D[D[D[D[D[D[D[Dqemu-io id[K[D[D[D[D[D[D[D[D[D[Dqemu-io ide[K[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0[K[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-[K[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-h[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "w[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wr[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wri[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "writ[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x2[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k"[K
|
||||
wrote 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqe[K[D[Dqem[K[D[D[Dqemu[K[D[D[D[Dqemu-[K[D[D[D[D[Dqemu-i[K[D[D[D[D[D[Dqemu-io[K[D[D[D[D[D[D[Dqemu-io [K[D[D[D[D[D[D[D[Dqemu-io i[K[D[D[D[D[D[D[D[D[Dqemu-io id[K[D[D[D[D[D[D[D[D[D[Dqemu-io ide[K[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0[K[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-[K[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-h[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "w[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wr[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wri[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "writ[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x2[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k"[K
|
||||
wrote 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqe[K[D[Dqem[K[D[D[Dqemu[K[D[D[D[Dqemu-[K[D[D[D[D[Dqemu-i[K[D[D[D[D[D[Dqemu-io[K[D[D[D[D[D[D[Dqemu-io [K[D[D[D[D[D[D[D[Dqemu-io i[K[D[D[D[D[D[D[D[D[Dqemu-io id[K[D[D[D[D[D[D[D[D[D[Dqemu-io ide[K[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0[K[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-[K[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-h[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "w[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wr[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wri[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "writ[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x2[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k"[K
|
||||
wrote 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqe[K[D[Dqem[K[D[D[Dqemu[K[D[D[D[Dqemu-[K[D[D[D[D[Dqemu-i[K[D[D[D[D[D[Dqemu-io[K[D[D[D[D[D[D[Dqemu-io [K[D[D[D[D[D[D[D[Dqemu-io i[K[D[D[D[D[D[D[D[D[Dqemu-io id[K[D[D[D[D[D[D[D[D[D[Dqemu-io ide[K[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0[K[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-[K[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-h[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "w[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wr[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "wri[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "writ[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x2[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 [K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k[K[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dqemu-io ide0-hd0 "write -P 0x22 0 4k"[K
|
||||
wrote 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
|
||||
read 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
|
||||
|
@@ -1777,7 +1777,6 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
65
ui/gtk.c
65
ui/gtk.c
@@ -156,8 +156,11 @@ typedef struct GtkDisplayState
|
||||
DisplayChangeListener dcl;
|
||||
DisplaySurface *ds;
|
||||
int button_mask;
|
||||
gboolean last_set;
|
||||
int last_x;
|
||||
int last_y;
|
||||
int grab_x_root;
|
||||
int grab_y_root;
|
||||
|
||||
double scale_x;
|
||||
double scale_y;
|
||||
@@ -473,8 +476,15 @@ static void gd_change_runstate(void *opaque, int running, RunState state)
|
||||
|
||||
static void gd_mouse_mode_change(Notifier *notify, void *data)
|
||||
{
|
||||
gd_update_cursor(container_of(notify, GtkDisplayState, mouse_mode_notifier),
|
||||
FALSE);
|
||||
GtkDisplayState *s;
|
||||
|
||||
s = container_of(notify, GtkDisplayState, mouse_mode_notifier);
|
||||
/* release the grab at switching to absolute mode */
|
||||
if (qemu_input_is_absolute() && gd_is_grab_active(s)) {
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
|
||||
FALSE);
|
||||
}
|
||||
gd_update_cursor(s, FALSE);
|
||||
}
|
||||
|
||||
/** GTK Events **/
|
||||
@@ -616,25 +626,25 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
|
||||
x = (motion->x - mx) / s->scale_x;
|
||||
y = (motion->y - my) / s->scale_y;
|
||||
|
||||
if (x < 0 || y < 0 ||
|
||||
x >= surface_width(s->ds) ||
|
||||
y >= surface_height(s->ds)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (qemu_input_is_absolute()) {
|
||||
if (x < 0 || y < 0 ||
|
||||
x >= surface_width(s->ds) ||
|
||||
y >= surface_height(s->ds)) {
|
||||
return TRUE;
|
||||
}
|
||||
qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_X, x,
|
||||
surface_width(s->ds));
|
||||
qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_Y, y,
|
||||
surface_height(s->ds));
|
||||
qemu_input_event_sync();
|
||||
} else if (s->last_x != -1 && s->last_y != -1 && gd_is_grab_active(s)) {
|
||||
} else if (s->last_set && gd_is_grab_active(s)) {
|
||||
qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_X, x - s->last_x);
|
||||
qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_Y, y - s->last_y);
|
||||
qemu_input_event_sync();
|
||||
}
|
||||
s->last_x = x;
|
||||
s->last_y = y;
|
||||
s->last_set = TRUE;
|
||||
|
||||
if (!qemu_input_is_absolute() && gd_is_grab_active(s)) {
|
||||
GdkScreen *screen = gtk_widget_get_screen(s->drawing_area);
|
||||
@@ -669,8 +679,7 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
|
||||
GdkDisplay *display = gtk_widget_get_display(widget);
|
||||
gdk_display_warp_pointer(display, screen, x, y);
|
||||
#endif
|
||||
s->last_x = -1;
|
||||
s->last_y = -1;
|
||||
s->last_set = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -683,6 +692,14 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
|
||||
GtkDisplayState *s = opaque;
|
||||
InputButton btn;
|
||||
|
||||
/* implicitly grab the input at the first click in the relative mode */
|
||||
if (button->button == 1 && button->type == GDK_BUTTON_PRESS &&
|
||||
!qemu_input_is_absolute() && !gd_is_grab_active(s)) {
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
|
||||
TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (button->button == 1) {
|
||||
btn = INPUT_BUTTON_LEFT;
|
||||
} else if (button->button == 2) {
|
||||
@@ -765,6 +782,14 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean gd_event(GtkWidget *widget, GdkEvent *event, void *opaque)
|
||||
{
|
||||
if (event->type == GDK_MOTION_NOTIFY) {
|
||||
return gd_motion_event(widget, &event->motion, opaque);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/** Window Menu Actions **/
|
||||
|
||||
static void gd_menu_pause(GtkMenuItem *item, void *opaque)
|
||||
@@ -963,8 +988,8 @@ static void gd_ungrab_keyboard(GtkDisplayState *s)
|
||||
|
||||
static void gd_grab_pointer(GtkDisplayState *s)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
|
||||
GList *devices = gdk_device_manager_list_devices(mgr,
|
||||
GDK_DEVICE_TYPE_MASTER);
|
||||
@@ -988,6 +1013,8 @@ static void gd_grab_pointer(GtkDisplayState *s)
|
||||
tmp = tmp->next;
|
||||
}
|
||||
g_list_free(devices);
|
||||
gdk_device_get_position(gdk_device_manager_get_client_pointer(mgr),
|
||||
NULL, &s->grab_x_root, &s->grab_y_root);
|
||||
#else
|
||||
gdk_pointer_grab(gtk_widget_get_window(s->drawing_area),
|
||||
FALSE, /* All events to come to our window directly */
|
||||
@@ -999,13 +1026,15 @@ static void gd_grab_pointer(GtkDisplayState *s)
|
||||
NULL, /* Allow cursor to move over entire desktop */
|
||||
s->null_cursor,
|
||||
GDK_CURRENT_TIME);
|
||||
gdk_display_get_pointer(display, NULL,
|
||||
&s->grab_x_root, &s->grab_y_root, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gd_ungrab_pointer(GtkDisplayState *s)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
|
||||
GList *devices = gdk_device_manager_list_devices(mgr,
|
||||
GDK_DEVICE_TYPE_MASTER);
|
||||
@@ -1019,8 +1048,14 @@ static void gd_ungrab_pointer(GtkDisplayState *s)
|
||||
tmp = tmp->next;
|
||||
}
|
||||
g_list_free(devices);
|
||||
gdk_device_warp(gdk_device_manager_get_client_pointer(mgr),
|
||||
gtk_widget_get_screen(s->drawing_area),
|
||||
s->grab_x_root, s->grab_y_root);
|
||||
#else
|
||||
gdk_pointer_ungrab(GDK_CURRENT_TIME);
|
||||
gdk_display_warp_pointer(display,
|
||||
gtk_widget_get_screen(s->drawing_area),
|
||||
s->grab_x_root, s->grab_y_root);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1267,8 +1302,8 @@ static void gd_connect_signals(GtkDisplayState *s)
|
||||
g_signal_connect(s->drawing_area, "expose-event",
|
||||
G_CALLBACK(gd_expose_event), s);
|
||||
#endif
|
||||
g_signal_connect(s->drawing_area, "motion-notify-event",
|
||||
G_CALLBACK(gd_motion_event), s);
|
||||
g_signal_connect(s->drawing_area, "event",
|
||||
G_CALLBACK(gd_event), s);
|
||||
g_signal_connect(s->drawing_area, "button-press-event",
|
||||
G_CALLBACK(gd_button_event), s);
|
||||
g_signal_connect(s->drawing_area, "button-release-event",
|
||||
|
21
ui/sdl2.c
21
ui/sdl2.c
@@ -278,7 +278,7 @@ static void sdl_hide_cursor(void)
|
||||
SDL_ShowCursor(1);
|
||||
SDL_SetCursor(sdl_cursor_hidden);
|
||||
} else {
|
||||
SDL_ShowCursor(0);
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ static void sdl_show_cursor(void)
|
||||
}
|
||||
|
||||
if (!qemu_input_is_absolute()) {
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
SDL_ShowCursor(1);
|
||||
if (guest_cursor &&
|
||||
(gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
|
||||
@@ -403,13 +404,17 @@ static void sdl_send_mouse_event(struct sdl2_state *scon, int dx, int dy,
|
||||
}
|
||||
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, max_w);
|
||||
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, max_h);
|
||||
} else if (guest_cursor) {
|
||||
x -= guest_x;
|
||||
y -= guest_y;
|
||||
guest_x += x;
|
||||
guest_y += y;
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, x);
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, y);
|
||||
} else {
|
||||
if (guest_cursor) {
|
||||
x -= guest_x;
|
||||
y -= guest_y;
|
||||
guest_x += x;
|
||||
guest_y += y;
|
||||
dx = x;
|
||||
dy = y;
|
||||
}
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, dx);
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, dy);
|
||||
}
|
||||
qemu_input_event_sync();
|
||||
}
|
||||
|
@@ -549,6 +549,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
|
||||
QemuUIInfo info;
|
||||
int rc;
|
||||
|
||||
if (!mc) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: multihead is tricky due to the way
|
||||
* spice has multihead implemented.
|
||||
|
Reference in New Issue
Block a user