Compare commits
45 Commits
qemu-1.5.3
...
v0.15.1
Author | SHA1 | Date | |
---|---|---|---|
|
82b2b32a32 | ||
|
4a81ab81e4 | ||
|
68e3508eaf | ||
|
fb524042db | ||
|
336398391a | ||
|
672aefeb5e | ||
|
6a10ccca80 | ||
|
7095e71576 | ||
|
91b31d6158 | ||
|
b89f4a7d2a | ||
|
fbdd7c8bd5 | ||
|
e19a4e89ae | ||
|
ff5acedd8f | ||
|
2af86a2ff7 | ||
|
e62ad8314a | ||
|
76e4e1d237 | ||
|
4fbe5233fd | ||
|
4bea41dbaa | ||
|
e2f775205a | ||
|
51dd7a94c7 | ||
|
9096de69ff | ||
|
09afeef1ab | ||
|
01825a8ddf | ||
|
ae2dd33693 | ||
|
a80f53aee3 | ||
|
88ca9f047b | ||
|
898517b0bc | ||
|
9dc9f2b820 | ||
|
ef942b795a | ||
|
868aa386b8 | ||
|
7e10be8c74 | ||
|
9843621e3b | ||
|
ab640dbfc0 | ||
|
eaa8b2778c | ||
|
7ec7f28019 | ||
|
31b1308046 | ||
|
4ec648dd6e | ||
|
e961d129e1 | ||
|
8959459386 | ||
|
e2b40e003a | ||
|
1a39b0fcff | ||
|
4a97e18b87 | ||
|
f1ee0a0ebd | ||
|
3583bc031e | ||
|
2798b5e174 |
4
Makefile
4
Makefile
@@ -192,8 +192,10 @@ test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types
|
|||||||
test-qmp-commands: test-qmp-commands.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
|
test-qmp-commands: test-qmp-commands.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
|
||||||
|
|
||||||
QGALIB=qga/guest-agent-command-state.o qga/guest-agent-commands.o
|
QGALIB=qga/guest-agent-command-state.o qga/guest-agent-commands.o
|
||||||
|
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c)
|
||||||
|
|
||||||
qemu-ga.o: $(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c) $(qapi-obj-y)
|
$(QGALIB_GEN): $(GENERATED_HEADERS)
|
||||||
|
$(QGALIB) qemu-ga.o: $(QGALIB_GEN) $(qapi-obj-y)
|
||||||
qemu-ga$(EXESUF): qemu-ga.o $(QGALIB) qemu-tool.o qemu-error.o error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) $(qapi-obj-y) qemu-timer-common.o qemu-sockets.o module.o qapi/qmp-dispatch.o qapi/qmp-registry.o $(qapi-dir)/qga-qapi-visit.o $(qapi-dir)/qga-qapi-types.o $(qapi-dir)/qga-qmp-marshal.o
|
qemu-ga$(EXESUF): qemu-ga.o $(QGALIB) qemu-tool.o qemu-error.o error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) $(qapi-obj-y) qemu-timer-common.o qemu-sockets.o module.o qapi/qmp-dispatch.o qapi/qmp-registry.o $(qapi-dir)/qga-qapi-visit.o $(qapi-dir)/qga-qapi-types.o $(qapi-dir)/qga-qmp-marshal.o
|
||||||
|
|
||||||
QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
|
QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
|
||||||
|
12
arm.ld
12
arm.ld
@@ -71,23 +71,23 @@ SECTIONS
|
|||||||
.data1 : { *(.data1) }
|
.data1 : { *(.data1) }
|
||||||
.preinit_array :
|
.preinit_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array))
|
KEEP (*(.preinit_array))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE (__preinit_array_end = .);
|
||||||
}
|
}
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array))
|
KEEP (*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE (__init_array_end = .);
|
||||||
}
|
}
|
||||||
.fini_array :
|
.fini_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE (__fini_array_start = .);
|
||||||
KEEP (*(.fini_array))
|
KEEP (*(.fini_array))
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
61
balloon.c
61
balloon.c
@@ -1,7 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* QEMU System Emulator
|
* Generic Balloon handlers and management
|
||||||
*
|
*
|
||||||
* Copyright (c) 2003-2008 Fabrice Bellard
|
* Copyright (c) 2003-2008 Fabrice Bellard
|
||||||
|
* Copyright (C) 2011 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2011 Amit Shah <amit.shah@redhat.com>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -30,44 +32,53 @@
|
|||||||
#include "balloon.h"
|
#include "balloon.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
|
static QEMUBalloonEvent *balloon_event_fn;
|
||||||
|
static QEMUBalloonStatus *balloon_stat_fn;
|
||||||
|
static void *balloon_opaque;
|
||||||
|
|
||||||
static QEMUBalloonEvent *qemu_balloon_event;
|
int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
|
||||||
void *qemu_balloon_event_opaque;
|
QEMUBalloonStatus *stat_func, void *opaque)
|
||||||
|
|
||||||
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque)
|
|
||||||
{
|
{
|
||||||
qemu_balloon_event = func;
|
if (balloon_event_fn || balloon_stat_fn || balloon_opaque) {
|
||||||
qemu_balloon_event_opaque = opaque;
|
/* We're already registered one balloon handler. How many can
|
||||||
|
* a guest really have?
|
||||||
|
*/
|
||||||
|
error_report("Another balloon device already registered");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
balloon_event_fn = event_func;
|
||||||
|
balloon_stat_fn = stat_func;
|
||||||
|
balloon_opaque = opaque;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque)
|
static int qemu_balloon(ram_addr_t target)
|
||||||
{
|
{
|
||||||
if (qemu_balloon_event) {
|
if (!balloon_event_fn) {
|
||||||
trace_balloon_event(qemu_balloon_event_opaque, target);
|
|
||||||
qemu_balloon_event(qemu_balloon_event_opaque, target, cb, opaque);
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
trace_balloon_event(balloon_opaque, target);
|
||||||
|
balloon_event_fn(balloon_opaque, target);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemu_balloon_status(MonitorCompletion cb, void *opaque)
|
static int qemu_balloon_status(MonitorCompletion cb, void *opaque)
|
||||||
{
|
{
|
||||||
if (qemu_balloon_event) {
|
if (!balloon_stat_fn) {
|
||||||
qemu_balloon_event(qemu_balloon_event_opaque, 0, cb, opaque);
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
balloon_stat_fn(balloon_opaque, cb, opaque);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_balloon_stat(const char *key, QObject *obj, void *opaque)
|
static void print_balloon_stat(const char *key, QObject *obj, void *opaque)
|
||||||
{
|
{
|
||||||
Monitor *mon = opaque;
|
Monitor *mon = opaque;
|
||||||
|
|
||||||
if (strcmp(key, "actual"))
|
if (strcmp(key, "actual")) {
|
||||||
monitor_printf(mon, ",%s=%" PRId64, key,
|
monitor_printf(mon, ",%s=%" PRId64, key,
|
||||||
qint_get_int(qobject_to_qint(obj)));
|
qint_get_int(qobject_to_qint(obj)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void monitor_print_balloon(Monitor *mon, const QObject *data)
|
void monitor_print_balloon(Monitor *mon, const QObject *data)
|
||||||
@@ -75,9 +86,9 @@ void monitor_print_balloon(Monitor *mon, const QObject *data)
|
|||||||
QDict *qdict;
|
QDict *qdict;
|
||||||
|
|
||||||
qdict = qobject_to_qdict(data);
|
qdict = qobject_to_qdict(data);
|
||||||
if (!qdict_haskey(qdict, "actual"))
|
if (!qdict_haskey(qdict, "actual")) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
monitor_printf(mon, "balloon: actual=%" PRId64,
|
monitor_printf(mon, "balloon: actual=%" PRId64,
|
||||||
qdict_get_int(qdict, "actual") >> 20);
|
qdict_get_int(qdict, "actual") >> 20);
|
||||||
qdict_iter(qdict, print_balloon_stat, mon);
|
qdict_iter(qdict, print_balloon_stat, mon);
|
||||||
@@ -129,6 +140,7 @@ int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque)
|
|||||||
int do_balloon(Monitor *mon, const QDict *params,
|
int do_balloon(Monitor *mon, const QDict *params,
|
||||||
MonitorCompletion cb, void *opaque)
|
MonitorCompletion cb, void *opaque)
|
||||||
{
|
{
|
||||||
|
int64_t target;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (kvm_enabled() && !kvm_has_sync_mmu()) {
|
if (kvm_enabled() && !kvm_has_sync_mmu()) {
|
||||||
@@ -136,7 +148,12 @@ int do_balloon(Monitor *mon, const QDict *params,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qemu_balloon(qdict_get_int(params, "value"), cb, opaque);
|
target = qdict_get_int(params, "value");
|
||||||
|
if (target <= 0) {
|
||||||
|
qerror_report(QERR_INVALID_PARAMETER_VALUE, "target", "a size");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ret = qemu_balloon(target);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
qerror_report(QERR_DEVICE_NOT_ACTIVE, "balloon");
|
qerror_report(QERR_DEVICE_NOT_ACTIVE, "balloon");
|
||||||
return -1;
|
return -1;
|
||||||
|
12
balloon.h
12
balloon.h
@@ -16,14 +16,12 @@
|
|||||||
|
|
||||||
#include "monitor.h"
|
#include "monitor.h"
|
||||||
|
|
||||||
typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target,
|
typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
|
||||||
MonitorCompletion cb, void *cb_data);
|
typedef void (QEMUBalloonStatus)(void *opaque, MonitorCompletion cb,
|
||||||
|
void *cb_data);
|
||||||
|
|
||||||
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque);
|
int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
|
||||||
|
QEMUBalloonStatus *stat_func, void *opaque);
|
||||||
int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque);
|
|
||||||
|
|
||||||
int qemu_balloon_status(MonitorCompletion cb, void *opaque);
|
|
||||||
|
|
||||||
void monitor_print_balloon(Monitor *mon, const QObject *data);
|
void monitor_print_balloon(Monitor *mon, const QObject *data);
|
||||||
int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque);
|
int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque);
|
||||||
|
@@ -317,7 +317,8 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
|
|||||||
{
|
{
|
||||||
BDRVQcowState *s = bs->opaque;
|
BDRVQcowState *s = bs->opaque;
|
||||||
QCowSnapshot *sn;
|
QCowSnapshot *sn;
|
||||||
int i, snapshot_index, l1_size2;
|
int i, snapshot_index;
|
||||||
|
int cur_l1_bytes, sn_l1_bytes;
|
||||||
|
|
||||||
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
|
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
|
||||||
if (snapshot_index < 0)
|
if (snapshot_index < 0)
|
||||||
@@ -330,14 +331,19 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
|
|||||||
if (qcow2_grow_l1_table(bs, sn->l1_size, true) < 0)
|
if (qcow2_grow_l1_table(bs, sn->l1_size, true) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
s->l1_size = sn->l1_size;
|
cur_l1_bytes = s->l1_size * sizeof(uint64_t);
|
||||||
l1_size2 = s->l1_size * sizeof(uint64_t);
|
sn_l1_bytes = sn->l1_size * sizeof(uint64_t);
|
||||||
|
|
||||||
|
if (cur_l1_bytes > sn_l1_bytes) {
|
||||||
|
memset(s->l1_table + sn->l1_size, 0, cur_l1_bytes - sn_l1_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
/* copy the snapshot l1 table to the current l1 table */
|
/* copy the snapshot l1 table to the current l1 table */
|
||||||
if (bdrv_pread(bs->file, sn->l1_table_offset,
|
if (bdrv_pread(bs->file, sn->l1_table_offset,
|
||||||
s->l1_table, l1_size2) != l1_size2)
|
s->l1_table, sn_l1_bytes) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (bdrv_pwrite_sync(bs->file, s->l1_table_offset,
|
if (bdrv_pwrite_sync(bs->file, s->l1_table_offset,
|
||||||
s->l1_table, l1_size2) < 0)
|
s->l1_table, cur_l1_bytes) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
for(i = 0;i < s->l1_size; i++) {
|
for(i = 0;i < s->l1_size; i++) {
|
||||||
be64_to_cpus(&s->l1_table[i]);
|
be64_to_cpus(&s->l1_table[i]);
|
||||||
|
@@ -230,21 +230,21 @@ static void qed_read_l2_table_cb(void *opaque, int ret)
|
|||||||
QEDRequest *request = read_l2_table_cb->request;
|
QEDRequest *request = read_l2_table_cb->request;
|
||||||
BDRVQEDState *s = read_l2_table_cb->s;
|
BDRVQEDState *s = read_l2_table_cb->s;
|
||||||
CachedL2Table *l2_table = request->l2_table;
|
CachedL2Table *l2_table = request->l2_table;
|
||||||
|
uint64_t l2_offset = read_l2_table_cb->l2_offset;
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* can't trust loaded L2 table anymore */
|
/* can't trust loaded L2 table anymore */
|
||||||
qed_unref_l2_cache_entry(l2_table);
|
qed_unref_l2_cache_entry(l2_table);
|
||||||
request->l2_table = NULL;
|
request->l2_table = NULL;
|
||||||
} else {
|
} else {
|
||||||
l2_table->offset = read_l2_table_cb->l2_offset;
|
l2_table->offset = l2_offset;
|
||||||
|
|
||||||
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
|
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
|
||||||
|
|
||||||
/* This is guaranteed to succeed because we just committed the entry
|
/* This is guaranteed to succeed because we just committed the entry
|
||||||
* to the cache.
|
* to the cache.
|
||||||
*/
|
*/
|
||||||
request->l2_table = qed_find_l2_cache_entry(&s->l2_cache,
|
request->l2_table = qed_find_l2_cache_entry(&s->l2_cache, l2_offset);
|
||||||
l2_table->offset);
|
|
||||||
assert(request->l2_table != NULL);
|
assert(request->l2_table != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -915,14 +915,14 @@ static void qed_commit_l2_update(void *opaque, int ret)
|
|||||||
QEDAIOCB *acb = opaque;
|
QEDAIOCB *acb = opaque;
|
||||||
BDRVQEDState *s = acb_to_s(acb);
|
BDRVQEDState *s = acb_to_s(acb);
|
||||||
CachedL2Table *l2_table = acb->request.l2_table;
|
CachedL2Table *l2_table = acb->request.l2_table;
|
||||||
|
uint64_t l2_offset = l2_table->offset;
|
||||||
|
|
||||||
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
|
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
|
||||||
|
|
||||||
/* This is guaranteed to succeed because we just committed the entry to the
|
/* This is guaranteed to succeed because we just committed the entry to the
|
||||||
* cache.
|
* cache.
|
||||||
*/
|
*/
|
||||||
acb->request.l2_table = qed_find_l2_cache_entry(&s->l2_cache,
|
acb->request.l2_table = qed_find_l2_cache_entry(&s->l2_cache, l2_offset);
|
||||||
l2_table->offset);
|
|
||||||
assert(acb->request.l2_table != NULL);
|
assert(acb->request.l2_table != NULL);
|
||||||
|
|
||||||
qed_aio_next_io(opaque, ret);
|
qed_aio_next_io(opaque, ret);
|
||||||
|
@@ -856,9 +856,6 @@ int main(int argc, char **argv)
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (optind >= argc)
|
|
||||||
usage();
|
|
||||||
filename = argv[optind];
|
|
||||||
|
|
||||||
/* init debug */
|
/* init debug */
|
||||||
cpu_set_log_filename(log_file);
|
cpu_set_log_filename(log_file);
|
||||||
@@ -877,6 +874,11 @@ int main(int argc, char **argv)
|
|||||||
cpu_set_log(mask);
|
cpu_set_log(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optind >= argc) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
filename = argv[optind];
|
||||||
|
|
||||||
/* Zero out regs */
|
/* Zero out regs */
|
||||||
memset(regs, 0, sizeof(struct target_pt_regs));
|
memset(regs, 0, sizeof(struct target_pt_regs));
|
||||||
|
|
||||||
|
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
|
|||||||
{ "\"\\n\"", "\n" },
|
{ "\"\\n\"", "\n" },
|
||||||
{ "\"\\r\"", "\r" },
|
{ "\"\\r\"", "\r" },
|
||||||
{ "\"\\t\"", "\t" },
|
{ "\"\\t\"", "\t" },
|
||||||
{ "\"\\/\"", "\\/" },
|
{ "\"/\"", "/" },
|
||||||
|
{ "\"\\/\"", "/", .skip = 1 },
|
||||||
{ "\"\\\\\"", "\\" },
|
{ "\"\\\\\"", "\\" },
|
||||||
{ "\"\\\"\"", "\"" },
|
{ "\"\\\"\"", "\"" },
|
||||||
{ "\"hello world \\\"embedded string\\\"\"",
|
{ "\"hello world \\\"embedded string\\\"\"",
|
||||||
|
89
configure
vendored
89
configure
vendored
@@ -179,6 +179,7 @@ smartcard=""
|
|||||||
smartcard_nss=""
|
smartcard_nss=""
|
||||||
usb_redir=""
|
usb_redir=""
|
||||||
opengl=""
|
opengl=""
|
||||||
|
guest_agent="yes"
|
||||||
|
|
||||||
# parse CC options first
|
# parse CC options first
|
||||||
for opt do
|
for opt do
|
||||||
@@ -408,6 +409,7 @@ SunOS)
|
|||||||
make="${MAKE-gmake}"
|
make="${MAKE-gmake}"
|
||||||
install="${INSTALL-ginstall}"
|
install="${INSTALL-ginstall}"
|
||||||
ld="gld"
|
ld="gld"
|
||||||
|
smbd="${SMBD-/usr/sfw/sbin/smbd}"
|
||||||
needs_libsunmath="no"
|
needs_libsunmath="no"
|
||||||
solarisrev=`uname -r | cut -f2 -d.`
|
solarisrev=`uname -r | cut -f2 -d.`
|
||||||
# have to select again, because `uname -m` returns i86pc
|
# have to select again, because `uname -m` returns i86pc
|
||||||
@@ -476,6 +478,7 @@ fi
|
|||||||
: ${make=${MAKE-make}}
|
: ${make=${MAKE-make}}
|
||||||
: ${install=${INSTALL-install}}
|
: ${install=${INSTALL-install}}
|
||||||
: ${python=${PYTHON-python}}
|
: ${python=${PYTHON-python}}
|
||||||
|
: ${smbd=${SMBD-/usr/sbin/smbd}}
|
||||||
|
|
||||||
if test "$mingw32" = "yes" ; then
|
if test "$mingw32" = "yes" ; then
|
||||||
EXESUF=".exe"
|
EXESUF=".exe"
|
||||||
@@ -519,6 +522,8 @@ for opt do
|
|||||||
;;
|
;;
|
||||||
--python=*) python="$optarg"
|
--python=*) python="$optarg"
|
||||||
;;
|
;;
|
||||||
|
--smbd=*) smbd="$optarg"
|
||||||
|
;;
|
||||||
--extra-cflags=*)
|
--extra-cflags=*)
|
||||||
;;
|
;;
|
||||||
--extra-ldflags=*)
|
--extra-ldflags=*)
|
||||||
@@ -751,6 +756,10 @@ for opt do
|
|||||||
;;
|
;;
|
||||||
--enable-usb-redir) usb_redir="yes"
|
--enable-usb-redir) usb_redir="yes"
|
||||||
;;
|
;;
|
||||||
|
--enable-guest-agent) guest_agent="yes"
|
||||||
|
;;
|
||||||
|
--disable-guest-agent) guest_agent="no"
|
||||||
|
;;
|
||||||
*) echo "ERROR: unknown option $opt"; show_help="yes"
|
*) echo "ERROR: unknown option $opt"; show_help="yes"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -840,7 +849,6 @@ if [ "$softmmu" = "yes" ] ; then
|
|||||||
default_target_list="\
|
default_target_list="\
|
||||||
i386-softmmu \
|
i386-softmmu \
|
||||||
x86_64-softmmu \
|
x86_64-softmmu \
|
||||||
alpha-softmmu \
|
|
||||||
arm-softmmu \
|
arm-softmmu \
|
||||||
cris-softmmu \
|
cris-softmmu \
|
||||||
lm32-softmmu \
|
lm32-softmmu \
|
||||||
@@ -928,6 +936,7 @@ echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS"
|
|||||||
echo " --make=MAKE use specified make [$make]"
|
echo " --make=MAKE use specified make [$make]"
|
||||||
echo " --install=INSTALL use specified install [$install]"
|
echo " --install=INSTALL use specified install [$install]"
|
||||||
echo " --python=PYTHON use specified python [$python]"
|
echo " --python=PYTHON use specified python [$python]"
|
||||||
|
echo " --smbd=SMBD use specified smbd [$smbd]"
|
||||||
echo " --static enable static build [$static]"
|
echo " --static enable static build [$static]"
|
||||||
echo " --mandir=PATH install man pages in PATH"
|
echo " --mandir=PATH install man pages in PATH"
|
||||||
echo " --datadir=PATH install firmware in PATH"
|
echo " --datadir=PATH install firmware in PATH"
|
||||||
@@ -1029,6 +1038,8 @@ echo " --disable-smartcard-nss disable smartcard nss support"
|
|||||||
echo " --enable-smartcard-nss enable smartcard nss support"
|
echo " --enable-smartcard-nss enable smartcard nss support"
|
||||||
echo " --disable-usb-redir disable usb network redirection support"
|
echo " --disable-usb-redir disable usb network redirection support"
|
||||||
echo " --enable-usb-redir enable usb network redirection support"
|
echo " --enable-usb-redir enable usb network redirection support"
|
||||||
|
echo " --disable-guest-agent disable building of the QEMU Guest Agent"
|
||||||
|
echo " --enable-guest-agent enable building of the QEMU Guest Agent"
|
||||||
echo ""
|
echo ""
|
||||||
echo "NOTE: The object files are built at the place where configure is launched"
|
echo "NOTE: The object files are built at the place where configure is launched"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1088,11 +1099,13 @@ if test "$solaris" = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if has $python; then
|
if test "$guest_agent" != "no" ; then
|
||||||
:
|
if has $python; then
|
||||||
else
|
:
|
||||||
echo "Python not found. Use --python=/path/to/python"
|
else
|
||||||
exit 1
|
echo "Python not found. Use --python=/path/to/python"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$target_list" ; then
|
if test -z "$target_list" ; then
|
||||||
@@ -1505,11 +1518,17 @@ int main(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
if $pkg_config libpng --modversion >/dev/null 2>&1; then
|
||||||
|
vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null`
|
||||||
|
vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null`
|
||||||
|
else
|
||||||
vnc_png_cflags=""
|
vnc_png_cflags=""
|
||||||
vnc_png_libs="-lpng"
|
vnc_png_libs="-lpng"
|
||||||
|
fi
|
||||||
if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
|
if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
|
||||||
vnc_png=yes
|
vnc_png=yes
|
||||||
libs_softmmu="$vnc_png_libs $libs_softmmu"
|
libs_softmmu="$vnc_png_libs $libs_softmmu"
|
||||||
|
QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags"
|
||||||
else
|
else
|
||||||
if test "$vnc_png" = "yes" ; then
|
if test "$vnc_png" = "yes" ; then
|
||||||
feature_not_found "vnc-png"
|
feature_not_found "vnc-png"
|
||||||
@@ -1822,19 +1841,21 @@ fi
|
|||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# glib support probe
|
# glib support probe
|
||||||
if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
|
if test "$guest_agent" != "no" ; then
|
||||||
glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
|
if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
|
||||||
glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
|
glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
|
||||||
libs_softmmu="$glib_libs $libs_softmmu"
|
glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
|
||||||
libs_tools="$glib_libs $libs_tools"
|
libs_softmmu="$glib_libs $libs_softmmu"
|
||||||
else
|
libs_tools="$glib_libs $libs_tools"
|
||||||
echo "glib-2.0 required to compile QEMU"
|
else
|
||||||
exit 1
|
echo "glib-2.0 required to compile QEMU"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# pthread probe
|
# pthread probe
|
||||||
PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
|
PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2"
|
||||||
|
|
||||||
pthread=no
|
pthread=no
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
@@ -2509,6 +2530,29 @@ if test "$trace_backend" = "dtrace"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# __sync_fetch_and_and requires at least -march=i486. Many toolchains
|
||||||
|
# use i686 as default anyway, but for those that don't, an explicit
|
||||||
|
# specification is necessary
|
||||||
|
if test $vhost_net = "yes" && test $cpu = "i386"; then
|
||||||
|
cat > $TMPC << EOF
|
||||||
|
int sfaa(unsigned *ptr)
|
||||||
|
{
|
||||||
|
return __sync_fetch_and_and(ptr, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int val = 42;
|
||||||
|
sfaa(&val);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
if ! compile_prog "" "" ; then
|
||||||
|
CFLAGS+="-march=i486"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# End of CC checks
|
# End of CC checks
|
||||||
# After here, no more $cc or $ld runs
|
# After here, no more $cc or $ld runs
|
||||||
@@ -2566,7 +2610,9 @@ if test "$softmmu" = yes ; then
|
|||||||
tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
|
tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
|
||||||
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
|
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
|
||||||
tools="qemu-nbd\$(EXESUF) $tools"
|
tools="qemu-nbd\$(EXESUF) $tools"
|
||||||
|
if [ "$guest_agent" = "yes" ]; then
|
||||||
tools="qemu-ga\$(EXESUF) $tools"
|
tools="qemu-ga\$(EXESUF) $tools"
|
||||||
|
fi
|
||||||
if [ "$check_utests" = "yes" ]; then
|
if [ "$check_utests" = "yes" ]; then
|
||||||
tools="check-qint check-qstring check-qdict check-qlist $tools"
|
tools="check-qint check-qstring check-qdict check-qlist $tools"
|
||||||
tools="check-qfloat check-qjson $tools"
|
tools="check-qfloat check-qjson $tools"
|
||||||
@@ -2603,6 +2649,9 @@ echo "LDFLAGS $LDFLAGS"
|
|||||||
echo "make $make"
|
echo "make $make"
|
||||||
echo "install $install"
|
echo "install $install"
|
||||||
echo "python $python"
|
echo "python $python"
|
||||||
|
if test "$slirp" = "yes" ; then
|
||||||
|
echo "smbd $smbd"
|
||||||
|
fi
|
||||||
echo "host CPU $cpu"
|
echo "host CPU $cpu"
|
||||||
echo "host big endian $bigendian"
|
echo "host big endian $bigendian"
|
||||||
echo "target list $target_list"
|
echo "target list $target_list"
|
||||||
@@ -2667,6 +2716,7 @@ echo "xfsctl support $xfs"
|
|||||||
echo "nss used $smartcard_nss"
|
echo "nss used $smartcard_nss"
|
||||||
echo "usb net redir $usb_redir"
|
echo "usb net redir $usb_redir"
|
||||||
echo "OpenGL support $opengl"
|
echo "OpenGL support $opengl"
|
||||||
|
echo "build guest agent $guest_agent"
|
||||||
|
|
||||||
if test $sdl_too_old = "yes"; then
|
if test $sdl_too_old = "yes"; then
|
||||||
echo "-> Your SDL version is too old - please upgrade to have SDL support"
|
echo "-> Your SDL version is too old - please upgrade to have SDL support"
|
||||||
@@ -2760,6 +2810,7 @@ if test $profiler = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
if test "$slirp" = "yes" ; then
|
if test "$slirp" = "yes" ; then
|
||||||
echo "CONFIG_SLIRP=y" >> $config_host_mak
|
echo "CONFIG_SLIRP=y" >> $config_host_mak
|
||||||
|
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
|
||||||
QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
|
QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
|
||||||
fi
|
fi
|
||||||
if test "$vde" = "yes" ; then
|
if test "$vde" = "yes" ; then
|
||||||
@@ -3012,9 +3063,9 @@ echo "TOOLS=$tools" >> $config_host_mak
|
|||||||
echo "ROMS=$roms" >> $config_host_mak
|
echo "ROMS=$roms" >> $config_host_mak
|
||||||
echo "MAKE=$make" >> $config_host_mak
|
echo "MAKE=$make" >> $config_host_mak
|
||||||
echo "INSTALL=$install" >> $config_host_mak
|
echo "INSTALL=$install" >> $config_host_mak
|
||||||
echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
|
echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak
|
||||||
echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
|
echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak
|
||||||
echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
|
echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
|
||||||
echo "PYTHON=$python" >> $config_host_mak
|
echo "PYTHON=$python" >> $config_host_mak
|
||||||
echo "CC=$cc" >> $config_host_mak
|
echo "CC=$cc" >> $config_host_mak
|
||||||
echo "CC_I386=$cc_i386" >> $config_host_mak
|
echo "CC_I386=$cc_i386" >> $config_host_mak
|
||||||
@@ -3530,7 +3581,7 @@ DIRS="$DIRS roms/seabios roms/vgabios"
|
|||||||
DIRS="$DIRS fsdev ui"
|
DIRS="$DIRS fsdev ui"
|
||||||
DIRS="$DIRS qapi"
|
DIRS="$DIRS qapi"
|
||||||
DIRS="$DIRS qga"
|
DIRS="$DIRS qga"
|
||||||
FILES="Makefile tests/Makefile"
|
FILES="Makefile tests/Makefile qdict-test-data.txt"
|
||||||
FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
|
FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
|
||||||
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
|
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
|
||||||
FILES="$FILES pc-bios/spapr-rtas/Makefile"
|
FILES="$FILES pc-bios/spapr-rtas/Makefile"
|
||||||
|
@@ -809,9 +809,6 @@ int main(int argc, char **argv)
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (optind >= argc)
|
|
||||||
usage();
|
|
||||||
filename = argv[optind];
|
|
||||||
|
|
||||||
/* init debug */
|
/* init debug */
|
||||||
cpu_set_log_filename(log_file);
|
cpu_set_log_filename(log_file);
|
||||||
@@ -830,6 +827,11 @@ int main(int argc, char **argv)
|
|||||||
cpu_set_log(mask);
|
cpu_set_log(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optind >= argc) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
filename = argv[optind];
|
||||||
|
|
||||||
/* Zero out regs */
|
/* Zero out regs */
|
||||||
memset(regs, 0, sizeof(struct target_pt_regs));
|
memset(regs, 0, sizeof(struct target_pt_regs));
|
||||||
|
|
||||||
|
18
hppa.ld
18
hppa.ld
@@ -75,36 +75,34 @@ SECTIONS
|
|||||||
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
||||||
.PARISC.unwind : { *(.PARISC.unwind) }
|
.PARISC.unwind : { *(.PARISC.unwind) }
|
||||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
|
||||||
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
|
|
||||||
/* Adjust the address for the data segment. We want to adjust up to
|
/* Adjust the address for the data segment. We want to adjust up to
|
||||||
the same address within the page on the next page up. */
|
the same address within the page on the next page up. */
|
||||||
. = ALIGN(0x10000) + (. & (0x10000 - 1));
|
. = ALIGN(0x10000) + (. & (0x10000 - 1));
|
||||||
/* Exception handling */
|
/* Exception handling */
|
||||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||||
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
|
.gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
|
||||||
/* Thread Local Storage sections */
|
/* Thread Local Storage sections */
|
||||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||||
.preinit_array :
|
.preinit_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array))
|
KEEP (*(.preinit_array))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE (__preinit_array_end = .);
|
||||||
}
|
}
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array))
|
KEEP (*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE (__init_array_end = .);
|
||||||
}
|
}
|
||||||
.fini_array :
|
.fini_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE (__fini_array_start = .);
|
||||||
KEEP (*(.fini_array))
|
KEEP (*(.fini_array))
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
51
hw/fdc.c
51
hw/fdc.c
@@ -36,7 +36,6 @@
|
|||||||
#include "qdev-addr.h"
|
#include "qdev-addr.h"
|
||||||
#include "blockdev.h"
|
#include "blockdev.h"
|
||||||
#include "sysemu.h"
|
#include "sysemu.h"
|
||||||
#include "block_int.h"
|
|
||||||
|
|
||||||
/********************************************************/
|
/********************************************************/
|
||||||
/* debug Floppy devices */
|
/* debug Floppy devices */
|
||||||
@@ -83,7 +82,6 @@ typedef struct FDrive {
|
|||||||
uint8_t max_track; /* Nb of tracks */
|
uint8_t max_track; /* Nb of tracks */
|
||||||
uint16_t bps; /* Bytes per sector */
|
uint16_t bps; /* Bytes per sector */
|
||||||
uint8_t ro; /* Is read-only */
|
uint8_t ro; /* Is read-only */
|
||||||
uint8_t media_changed; /* Is media changed */
|
|
||||||
} FDrive;
|
} FDrive;
|
||||||
|
|
||||||
static void fd_init(FDrive *drv)
|
static void fd_init(FDrive *drv)
|
||||||
@@ -535,63 +533,16 @@ static CPUWriteMemoryFunc * const fdctrl_mem_write_strict[3] = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void fdrive_media_changed_pre_save(void *opaque)
|
|
||||||
{
|
|
||||||
FDrive *drive = opaque;
|
|
||||||
|
|
||||||
drive->media_changed = drive->bs->media_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int fdrive_media_changed_post_load(void *opaque, int version_id)
|
|
||||||
{
|
|
||||||
FDrive *drive = opaque;
|
|
||||||
|
|
||||||
if (drive->bs != NULL) {
|
|
||||||
drive->bs->media_changed = drive->media_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* User ejected the floppy when drive->bs == NULL */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool fdrive_media_changed_needed(void *opaque)
|
|
||||||
{
|
|
||||||
FDrive *drive = opaque;
|
|
||||||
|
|
||||||
return (drive->bs != NULL && drive->bs->media_changed != 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const VMStateDescription vmstate_fdrive_media_changed = {
|
|
||||||
.name = "fdrive/media_changed",
|
|
||||||
.version_id = 1,
|
|
||||||
.minimum_version_id = 1,
|
|
||||||
.minimum_version_id_old = 1,
|
|
||||||
.pre_save = fdrive_media_changed_pre_save,
|
|
||||||
.post_load = fdrive_media_changed_post_load,
|
|
||||||
.fields = (VMStateField[]) {
|
|
||||||
VMSTATE_UINT8(media_changed, FDrive),
|
|
||||||
VMSTATE_END_OF_LIST()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const VMStateDescription vmstate_fdrive = {
|
static const VMStateDescription vmstate_fdrive = {
|
||||||
.name = "fdrive",
|
.name = "fdrive",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
.minimum_version_id_old = 1,
|
.minimum_version_id_old = 1,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField []) {
|
||||||
VMSTATE_UINT8(head, FDrive),
|
VMSTATE_UINT8(head, FDrive),
|
||||||
VMSTATE_UINT8(track, FDrive),
|
VMSTATE_UINT8(track, FDrive),
|
||||||
VMSTATE_UINT8(sect, FDrive),
|
VMSTATE_UINT8(sect, FDrive),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
},
|
|
||||||
.subsections = (VMStateSubsection[]) {
|
|
||||||
{
|
|
||||||
.vmsd = &vmstate_fdrive_media_changed,
|
|
||||||
.needed = &fdrive_media_changed_needed,
|
|
||||||
} , {
|
|
||||||
/* empty */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -310,10 +310,12 @@ static int milkymist_softusb_init(SysBusDevice *dev)
|
|||||||
usb_bus_new(&s->usbbus, &softusb_bus_ops, NULL);
|
usb_bus_new(&s->usbbus, &softusb_bus_ops, NULL);
|
||||||
|
|
||||||
/* our two ports */
|
/* our two ports */
|
||||||
|
/* FIXME: claim to support full speed devices. qemu mouse and keyboard
|
||||||
|
* report themselves as full speed devices. */
|
||||||
usb_register_port(&s->usbbus, &s->usbport[0], NULL, 0, &softusb_ops,
|
usb_register_port(&s->usbbus, &s->usbport[0], NULL, 0, &softusb_ops,
|
||||||
USB_SPEED_MASK_LOW);
|
USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
|
||||||
usb_register_port(&s->usbbus, &s->usbport[1], NULL, 1, &softusb_ops,
|
usb_register_port(&s->usbbus, &s->usbport[1], NULL, 1, &softusb_ops,
|
||||||
USB_SPEED_MASK_LOW);
|
USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
|
||||||
|
|
||||||
/* and finally create an usb keyboard */
|
/* and finally create an usb keyboard */
|
||||||
s->usbdev = usb_create_simple(&s->usbbus, "usb-kbd");
|
s->usbdev = usb_create_simple(&s->usbbus, "usb-kbd");
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Virtio Block Device
|
* Virtio Balloon Device
|
||||||
*
|
*
|
||||||
* Copyright IBM, Corp. 2008
|
* Copyright IBM, Corp. 2008
|
||||||
|
* Copyright (C) 2011 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2011 Amit Shah <amit.shah@redhat.com>
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Anthony Liguori <aliguori@us.ibm.com>
|
* Anthony Liguori <aliguori@us.ibm.com>
|
||||||
@@ -43,6 +45,7 @@ typedef struct VirtIOBalloon
|
|||||||
size_t stats_vq_offset;
|
size_t stats_vq_offset;
|
||||||
MonitorCompletion *stats_callback;
|
MonitorCompletion *stats_callback;
|
||||||
void *stats_opaque_callback_data;
|
void *stats_opaque_callback_data;
|
||||||
|
DeviceState *qdev;
|
||||||
} VirtIOBalloon;
|
} VirtIOBalloon;
|
||||||
|
|
||||||
static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
|
static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
|
||||||
@@ -199,36 +202,44 @@ static uint32_t virtio_balloon_get_features(VirtIODevice *vdev, uint32_t f)
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_balloon_to_target(void *opaque, ram_addr_t target,
|
static void virtio_balloon_stat(void *opaque, MonitorCompletion cb,
|
||||||
MonitorCompletion cb, void *cb_data)
|
void *cb_data)
|
||||||
{
|
{
|
||||||
VirtIOBalloon *dev = opaque;
|
VirtIOBalloon *dev = opaque;
|
||||||
|
|
||||||
if (target > ram_size)
|
/* For now, only allow one request at a time. This restriction can be
|
||||||
target = ram_size;
|
* removed later by queueing callback and data pairs.
|
||||||
|
*/
|
||||||
|
if (dev->stats_callback != NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dev->stats_callback = cb;
|
||||||
|
dev->stats_opaque_callback_data = cb_data;
|
||||||
|
|
||||||
|
if (ENABLE_GUEST_STATS
|
||||||
|
&& (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ))) {
|
||||||
|
virtqueue_push(dev->svq, &dev->stats_vq_elem, dev->stats_vq_offset);
|
||||||
|
virtio_notify(&dev->vdev, dev->svq);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stats are not supported. Clear out any stale values that might
|
||||||
|
* have been set by a more featureful guest kernel.
|
||||||
|
*/
|
||||||
|
reset_stats(dev);
|
||||||
|
complete_stats_request(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void virtio_balloon_to_target(void *opaque, ram_addr_t target)
|
||||||
|
{
|
||||||
|
VirtIOBalloon *dev = opaque;
|
||||||
|
|
||||||
|
if (target > ram_size) {
|
||||||
|
target = ram_size;
|
||||||
|
}
|
||||||
if (target) {
|
if (target) {
|
||||||
dev->num_pages = (ram_size - target) >> VIRTIO_BALLOON_PFN_SHIFT;
|
dev->num_pages = (ram_size - target) >> VIRTIO_BALLOON_PFN_SHIFT;
|
||||||
virtio_notify_config(&dev->vdev);
|
virtio_notify_config(&dev->vdev);
|
||||||
} else {
|
|
||||||
/* For now, only allow one request at a time. This restriction can be
|
|
||||||
* removed later by queueing callback and data pairs.
|
|
||||||
*/
|
|
||||||
if (dev->stats_callback != NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dev->stats_callback = cb;
|
|
||||||
dev->stats_opaque_callback_data = cb_data;
|
|
||||||
if (ENABLE_GUEST_STATS && (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ))) {
|
|
||||||
virtqueue_push(dev->svq, &dev->stats_vq_elem, dev->stats_vq_offset);
|
|
||||||
virtio_notify(&dev->vdev, dev->svq);
|
|
||||||
} else {
|
|
||||||
/* Stats are not supported. Clear out any stale values that might
|
|
||||||
* have been set by a more featureful guest kernel.
|
|
||||||
*/
|
|
||||||
reset_stats(dev);
|
|
||||||
complete_stats_request(dev);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,6 +270,7 @@ static int virtio_balloon_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
VirtIODevice *virtio_balloon_init(DeviceState *dev)
|
VirtIODevice *virtio_balloon_init(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIOBalloon *s;
|
VirtIOBalloon *s;
|
||||||
|
int ret;
|
||||||
|
|
||||||
s = (VirtIOBalloon *)virtio_common_init("virtio-balloon",
|
s = (VirtIOBalloon *)virtio_common_init("virtio-balloon",
|
||||||
VIRTIO_ID_BALLOON,
|
VIRTIO_ID_BALLOON,
|
||||||
@@ -268,15 +280,29 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
|
|||||||
s->vdev.set_config = virtio_balloon_set_config;
|
s->vdev.set_config = virtio_balloon_set_config;
|
||||||
s->vdev.get_features = virtio_balloon_get_features;
|
s->vdev.get_features = virtio_balloon_get_features;
|
||||||
|
|
||||||
|
ret = qemu_add_balloon_handler(virtio_balloon_to_target,
|
||||||
|
virtio_balloon_stat, s);
|
||||||
|
if (ret < 0) {
|
||||||
|
virtio_cleanup(&s->vdev);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
s->ivq = virtio_add_queue(&s->vdev, 128, virtio_balloon_handle_output);
|
s->ivq = virtio_add_queue(&s->vdev, 128, virtio_balloon_handle_output);
|
||||||
s->dvq = virtio_add_queue(&s->vdev, 128, virtio_balloon_handle_output);
|
s->dvq = virtio_add_queue(&s->vdev, 128, virtio_balloon_handle_output);
|
||||||
s->svq = virtio_add_queue(&s->vdev, 128, virtio_balloon_receive_stats);
|
s->svq = virtio_add_queue(&s->vdev, 128, virtio_balloon_receive_stats);
|
||||||
|
|
||||||
reset_stats(s);
|
reset_stats(s);
|
||||||
qemu_add_balloon_handler(virtio_balloon_to_target, s);
|
|
||||||
|
|
||||||
|
s->qdev = dev;
|
||||||
register_savevm(dev, "virtio-balloon", -1, 1,
|
register_savevm(dev, "virtio-balloon", -1, 1,
|
||||||
virtio_balloon_save, virtio_balloon_load, s);
|
virtio_balloon_save, virtio_balloon_load, s);
|
||||||
|
|
||||||
return &s->vdev;
|
return &s->vdev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void virtio_balloon_exit(VirtIODevice *vdev)
|
||||||
|
{
|
||||||
|
VirtIOBalloon *s = DO_UPCAST(VirtIOBalloon, vdev, vdev);
|
||||||
|
unregister_savevm(s->qdev, "virtio-balloon", s);
|
||||||
|
virtio_cleanup(vdev);
|
||||||
|
}
|
||||||
|
@@ -788,10 +788,22 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev)
|
|||||||
VirtIODevice *vdev;
|
VirtIODevice *vdev;
|
||||||
|
|
||||||
vdev = virtio_balloon_init(&pci_dev->qdev);
|
vdev = virtio_balloon_init(&pci_dev->qdev);
|
||||||
|
if (!vdev) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
virtio_init_pci(proxy, vdev);
|
virtio_init_pci(proxy, vdev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int virtio_balloon_exit_pci(PCIDevice *pci_dev)
|
||||||
|
{
|
||||||
|
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
|
||||||
|
|
||||||
|
virtio_pci_stop_ioeventfd(proxy);
|
||||||
|
virtio_balloon_exit(proxy->vdev);
|
||||||
|
return virtio_exit_pci(pci_dev);
|
||||||
|
}
|
||||||
|
|
||||||
static PCIDeviceInfo virtio_info[] = {
|
static PCIDeviceInfo virtio_info[] = {
|
||||||
{
|
{
|
||||||
.qdev.name = "virtio-blk-pci",
|
.qdev.name = "virtio-blk-pci",
|
||||||
@@ -866,7 +878,7 @@ static PCIDeviceInfo virtio_info[] = {
|
|||||||
.qdev.alias = "virtio-balloon",
|
.qdev.alias = "virtio-balloon",
|
||||||
.qdev.size = sizeof(VirtIOPCIProxy),
|
.qdev.size = sizeof(VirtIOPCIProxy),
|
||||||
.init = virtio_balloon_init_pci,
|
.init = virtio_balloon_init_pci,
|
||||||
.exit = virtio_exit_pci,
|
.exit = virtio_balloon_exit_pci,
|
||||||
.vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET,
|
.vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET,
|
||||||
.device_id = PCI_DEVICE_ID_VIRTIO_BALLOON,
|
.device_id = PCI_DEVICE_ID_VIRTIO_BALLOON,
|
||||||
.revision = VIRTIO_PCI_ABI_VERSION,
|
.revision = VIRTIO_PCI_ABI_VERSION,
|
||||||
|
@@ -213,6 +213,7 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf);
|
|||||||
void virtio_net_exit(VirtIODevice *vdev);
|
void virtio_net_exit(VirtIODevice *vdev);
|
||||||
void virtio_blk_exit(VirtIODevice *vdev);
|
void virtio_blk_exit(VirtIODevice *vdev);
|
||||||
void virtio_serial_exit(VirtIODevice *vdev);
|
void virtio_serial_exit(VirtIODevice *vdev);
|
||||||
|
void virtio_balloon_exit(VirtIODevice *vdev);
|
||||||
|
|
||||||
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
|
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
|
||||||
DEFINE_PROP_BIT("indirect_desc", _state, _field, \
|
DEFINE_PROP_BIT("indirect_desc", _state, _field, \
|
||||||
|
8
i386.ld
8
i386.ld
@@ -42,16 +42,16 @@ SECTIONS
|
|||||||
.rel.plt :
|
.rel.plt :
|
||||||
{
|
{
|
||||||
*(.rel.plt)
|
*(.rel.plt)
|
||||||
PROVIDE_HIDDEN (__rel_iplt_start = .);
|
PROVIDE (__rel_iplt_start = .);
|
||||||
*(.rel.iplt)
|
*(.rel.iplt)
|
||||||
PROVIDE_HIDDEN (__rel_iplt_end = .);
|
PROVIDE (__rel_iplt_end = .);
|
||||||
}
|
}
|
||||||
.rela.plt :
|
.rela.plt :
|
||||||
{
|
{
|
||||||
*(.rela.plt)
|
*(.rela.plt)
|
||||||
PROVIDE_HIDDEN (__rela_iplt_start = .);
|
PROVIDE (__rela_iplt_start = .);
|
||||||
*(.rela.iplt)
|
*(.rela.iplt)
|
||||||
PROVIDE_HIDDEN (__rela_iplt_end = .);
|
PROVIDE (__rela_iplt_end = .);
|
||||||
}
|
}
|
||||||
.init : { *(.init) } =0x47ff041f
|
.init : { *(.init) } =0x47ff041f
|
||||||
.text :
|
.text :
|
||||||
|
@@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp)
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (optind >= argc)
|
|
||||||
usage();
|
|
||||||
filename = argv[optind];
|
|
||||||
exec_path = argv[optind];
|
|
||||||
|
|
||||||
/* init debug */
|
/* init debug */
|
||||||
cpu_set_log_filename(log_file);
|
cpu_set_log_filename(log_file);
|
||||||
if (log_mask) {
|
if (log_mask) {
|
||||||
@@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp)
|
|||||||
cpu_set_log(mask);
|
cpu_set_log(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optind >= argc) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
filename = argv[optind];
|
||||||
|
exec_path = argv[optind];
|
||||||
|
|
||||||
/* Zero out regs */
|
/* Zero out regs */
|
||||||
memset(regs, 0, sizeof(struct target_pt_regs));
|
memset(regs, 0, sizeof(struct target_pt_regs));
|
||||||
|
|
||||||
|
18
mips.ld
18
mips.ld
@@ -79,36 +79,34 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
||||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
|
||||||
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
|
|
||||||
/* Adjust the address for the data segment. We want to adjust up to
|
/* Adjust the address for the data segment. We want to adjust up to
|
||||||
the same address within the page on the next page up. */
|
the same address within the page on the next page up. */
|
||||||
. = ALIGN (0x40000) - ((0x40000 - .) & (0x40000 - 1)); . = DATA_SEGMENT_ALIGN (0x40000, 0x1000);
|
. = ALIGN (0x40000) - ((0x40000 - .) & (0x40000 - 1)); . = DATA_SEGMENT_ALIGN (0x40000, 0x1000);
|
||||||
/* Exception handling */
|
/* Exception handling */
|
||||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||||
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
|
.gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
|
||||||
/* Thread Local Storage sections */
|
/* Thread Local Storage sections */
|
||||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||||
.preinit_array :
|
.preinit_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array))
|
KEEP (*(.preinit_array))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE (__preinit_array_end = .);
|
||||||
}
|
}
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array))
|
KEEP (*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE (__init_array_end = .);
|
||||||
}
|
}
|
||||||
.fini_array :
|
.fini_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE (__fini_array_start = .);
|
||||||
KEEP (*(.fini_array))
|
KEEP (*(.fini_array))
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
@@ -1189,7 +1189,6 @@ static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_d
|
|||||||
{
|
{
|
||||||
const char *protocol = qdict_get_str(qdict, "protocol");
|
const char *protocol = qdict_get_str(qdict, "protocol");
|
||||||
const char *fdname = qdict_get_str(qdict, "fdname");
|
const char *fdname = qdict_get_str(qdict, "fdname");
|
||||||
int skipauth = qdict_get_try_bool(qdict, "skipauth", 0);
|
|
||||||
CharDriverState *s;
|
CharDriverState *s;
|
||||||
|
|
||||||
if (strcmp(protocol, "spice") == 0) {
|
if (strcmp(protocol, "spice") == 0) {
|
||||||
@@ -1200,10 +1199,13 @@ static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_d
|
|||||||
}
|
}
|
||||||
qerror_report(QERR_ADD_CLIENT_FAILED);
|
qerror_report(QERR_ADD_CLIENT_FAILED);
|
||||||
return -1;
|
return -1;
|
||||||
|
#ifdef CONFIG_VNC
|
||||||
} else if (strcmp(protocol, "vnc") == 0) {
|
} else if (strcmp(protocol, "vnc") == 0) {
|
||||||
int fd = monitor_get_fd(mon, fdname);
|
int fd = monitor_get_fd(mon, fdname);
|
||||||
|
int skipauth = qdict_get_try_bool(qdict, "skipauth", 0);
|
||||||
vnc_display_add_client(NULL, fd, skipauth);
|
vnc_display_add_client(NULL, fd, skipauth);
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
} else if ((s = qemu_chr_find(protocol)) != NULL) {
|
} else if ((s = qemu_chr_find(protocol)) != NULL) {
|
||||||
int fd = monitor_get_fd(mon, fdname);
|
int fd = monitor_get_fd(mon, fdname);
|
||||||
if (qemu_chr_add_client(s, fd) < 0) {
|
if (qemu_chr_add_client(s, fd) < 0) {
|
||||||
|
5
net.h
5
net.h
@@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
|
|||||||
|
|
||||||
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
|
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
|
||||||
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
|
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
|
||||||
#ifdef __sun__
|
|
||||||
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
|
|
||||||
#else
|
|
||||||
#define SMBD_COMMAND "/usr/sbin/smbd"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
|
void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
|
||||||
|
|
||||||
|
@@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
|
snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
|
||||||
SMBD_COMMAND, smb_conf);
|
CONFIG_SMBD_COMMAND, smb_conf);
|
||||||
|
|
||||||
if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
|
if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
|
||||||
slirp_smb_cleanup(s);
|
slirp_smb_cleanup(s);
|
||||||
|
10
net/socket.c
10
net/socket.c
@@ -154,6 +154,12 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr
|
|||||||
struct ip_mreq imr;
|
struct ip_mreq imr;
|
||||||
int fd;
|
int fd;
|
||||||
int val, ret;
|
int val, ret;
|
||||||
|
#ifdef __OpenBSD__
|
||||||
|
unsigned char loop;
|
||||||
|
#else
|
||||||
|
int loop;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) {
|
if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) {
|
||||||
fprintf(stderr, "qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain a multicast address\n",
|
fprintf(stderr, "qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain a multicast address\n",
|
||||||
inet_ntoa(mcastaddr->sin_addr),
|
inet_ntoa(mcastaddr->sin_addr),
|
||||||
@@ -197,9 +203,9 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Force mcast msgs to loopback (eg. several QEMUs in same host */
|
/* Force mcast msgs to loopback (eg. several QEMUs in same host */
|
||||||
val = 1;
|
loop = 1;
|
||||||
ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
|
ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||||
(const char *)&val, sizeof(val));
|
(const char *)&loop, sizeof(loop));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)");
|
perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
18
ppc.ld
18
ppc.ld
@@ -79,36 +79,34 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
||||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
|
||||||
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
|
|
||||||
/* Adjust the address for the data segment. We want to adjust up to
|
/* Adjust the address for the data segment. We want to adjust up to
|
||||||
the same address within the page on the next page up. */
|
the same address within the page on the next page up. */
|
||||||
. = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
. = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
||||||
/* Exception handling */
|
/* Exception handling */
|
||||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||||
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
|
.gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
|
||||||
/* Thread Local Storage sections */
|
/* Thread Local Storage sections */
|
||||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||||
.preinit_array :
|
.preinit_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array))
|
KEEP (*(.preinit_array))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE (__preinit_array_end = .);
|
||||||
}
|
}
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array))
|
KEEP (*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE (__init_array_end = .);
|
||||||
}
|
}
|
||||||
.fini_array :
|
.fini_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE (__fini_array_start = .);
|
||||||
KEEP (*(.fini_array))
|
KEEP (*(.fini_array))
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
6
ppc64.ld
6
ppc64.ld
@@ -81,14 +81,12 @@ SECTIONS
|
|||||||
.sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
|
.sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
|
||||||
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
|
||||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
|
||||||
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table))
|
|
||||||
*(.gcc_except_table.*) } /* Adjust the address for the data segment. We want to
|
*(.gcc_except_table.*) } /* Adjust the address for the data segment. We want to
|
||||||
adjust up to + the same address within the page on the next page up. */
|
adjust up to + the same address within the page on the next page up. */
|
||||||
. = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN
|
. = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN
|
||||||
(0x10000, 0x1000); /* Exception handling */
|
(0x10000, 0x1000); /* Exception handling */
|
||||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||||
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table))
|
.gcc_except_table : { KEEP (*(.gcc_except_table))
|
||||||
*(.gcc_except_table.*) } /* Thread Local Storage sections */
|
*(.gcc_except_table.*) } /* Thread Local Storage sections */
|
||||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||||
|
@@ -1256,9 +1256,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
|
|||||||
|
|
||||||
Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
|
Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
|
||||||
|
|
||||||
Note that a SAMBA server must be installed on the host OS in
|
Note that a SAMBA server must be installed on the host OS.
|
||||||
@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
|
QEMU was tested successfully with smbd versions from Red Hat 9,
|
||||||
Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
|
Fedora Core 3 and OpenSUSE 11.x.
|
||||||
|
|
||||||
@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
|
@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
|
||||||
Redirect incoming TCP or UDP connections to the host port @var{hostport} to
|
Redirect incoming TCP or UDP connections to the host port @var{hostport} to
|
||||||
|
12
sparc.ld
12
sparc.ld
@@ -67,23 +67,23 @@ SECTIONS
|
|||||||
.tbss : { *(.tbss) }
|
.tbss : { *(.tbss) }
|
||||||
.preinit_array :
|
.preinit_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array))
|
KEEP (*(.preinit_array))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE (__preinit_array_end = .);
|
||||||
}
|
}
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array))
|
KEEP (*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE (__init_array_end = .);
|
||||||
}
|
}
|
||||||
.fini_array :
|
.fini_array :
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE (__fini_array_start = .);
|
||||||
KEEP (*(.fini_array))
|
KEEP (*(.fini_array))
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
@@ -374,6 +374,7 @@ enum arm_features {
|
|||||||
ARM_FEATURE_V4T,
|
ARM_FEATURE_V4T,
|
||||||
ARM_FEATURE_V5,
|
ARM_FEATURE_V5,
|
||||||
ARM_FEATURE_STRONGARM,
|
ARM_FEATURE_STRONGARM,
|
||||||
|
ARM_FEATURE_VAPA, /* cp15 VA to PA lookups */
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int arm_feature(CPUARMState *env, int feature)
|
static inline int arm_feature(CPUARMState *env, int feature)
|
||||||
|
@@ -70,13 +70,24 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
|
|||||||
env->cp15.c0_cachetype = 0x1dd20d2;
|
env->cp15.c0_cachetype = 0x1dd20d2;
|
||||||
env->cp15.c1_sys = 0x00090078;
|
env->cp15.c1_sys = 0x00090078;
|
||||||
break;
|
break;
|
||||||
case ARM_CPUID_ARM1136_R2:
|
|
||||||
case ARM_CPUID_ARM1136:
|
case ARM_CPUID_ARM1136:
|
||||||
|
/* This is the 1136 r1, which is a v6K core */
|
||||||
|
set_feature(env, ARM_FEATURE_V6K);
|
||||||
|
/* Fall through */
|
||||||
|
case ARM_CPUID_ARM1136_R2:
|
||||||
|
/* What qemu calls "arm1136_r2" is actually the 1136 r0p2, ie an
|
||||||
|
* older core than plain "arm1136". In particular this does not
|
||||||
|
* have the v6K features.
|
||||||
|
*/
|
||||||
set_feature(env, ARM_FEATURE_V4T);
|
set_feature(env, ARM_FEATURE_V4T);
|
||||||
set_feature(env, ARM_FEATURE_V5);
|
set_feature(env, ARM_FEATURE_V5);
|
||||||
set_feature(env, ARM_FEATURE_V6);
|
set_feature(env, ARM_FEATURE_V6);
|
||||||
set_feature(env, ARM_FEATURE_VFP);
|
set_feature(env, ARM_FEATURE_VFP);
|
||||||
set_feature(env, ARM_FEATURE_AUXCR);
|
set_feature(env, ARM_FEATURE_AUXCR);
|
||||||
|
/* These ID register values are correct for 1136 but may be wrong
|
||||||
|
* for 1136_r2 (in particular r0p2 does not actually implement most
|
||||||
|
* of the ID registers).
|
||||||
|
*/
|
||||||
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
|
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
|
||||||
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
|
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
|
||||||
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
|
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
|
||||||
@@ -92,6 +103,7 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
|
|||||||
set_feature(env, ARM_FEATURE_V6K);
|
set_feature(env, ARM_FEATURE_V6K);
|
||||||
set_feature(env, ARM_FEATURE_VFP);
|
set_feature(env, ARM_FEATURE_VFP);
|
||||||
set_feature(env, ARM_FEATURE_AUXCR);
|
set_feature(env, ARM_FEATURE_AUXCR);
|
||||||
|
set_feature(env, ARM_FEATURE_VAPA);
|
||||||
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
|
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
|
||||||
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
|
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
|
||||||
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
|
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
|
||||||
@@ -222,6 +234,11 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
|
|||||||
cpu_abort(env, "Bad CPU ID: %x\n", id);
|
cpu_abort(env, "Bad CPU ID: %x\n", id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Some features automatically imply others: */
|
||||||
|
if (arm_feature(env, ARM_FEATURE_V7)) {
|
||||||
|
set_feature(env, ARM_FEATURE_VAPA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_reset(CPUARMState *env)
|
void cpu_reset(CPUARMState *env)
|
||||||
@@ -1502,7 +1519,7 @@ void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val)
|
|||||||
goto bad_reg;
|
goto bad_reg;
|
||||||
}
|
}
|
||||||
/* No cache, so nothing to do except VA->PA translations. */
|
/* No cache, so nothing to do except VA->PA translations. */
|
||||||
if (arm_feature(env, ARM_FEATURE_V6K)) {
|
if (arm_feature(env, ARM_FEATURE_VAPA)) {
|
||||||
switch (crm) {
|
switch (crm) {
|
||||||
case 4:
|
case 4:
|
||||||
if (arm_feature(env, ARM_FEATURE_V7)) {
|
if (arm_feature(env, ARM_FEATURE_V7)) {
|
||||||
|
@@ -2498,12 +2498,6 @@ static int cp15_user_ok(CPUState *env, uint32_t insn)
|
|||||||
if (op == 2 || (op == 3 && (insn & ARM_CP_RW_BIT)))
|
if (op == 2 || (op == 3 && (insn & ARM_CP_RW_BIT)))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (cpn == 7) {
|
|
||||||
/* ISB, DSB, DMB. */
|
|
||||||
if ((cpm == 5 && op == 4)
|
|
||||||
|| (cpm == 10 && (op == 4 || op == 5)))
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2579,39 +2573,60 @@ static int disas_cp15_insn(CPUState *env, DisasContext *s, uint32_t insn)
|
|||||||
/* cdp */
|
/* cdp */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (IS_USER(s) && !cp15_user_ok(env, insn)) {
|
/* We special case a number of cp15 instructions which were used
|
||||||
return 1;
|
* for things which are real instructions in ARMv7. This allows
|
||||||
}
|
* them to work in linux-user mode which doesn't provide functional
|
||||||
|
* get_cp15/set_cp15 helpers, and is more efficient anyway.
|
||||||
/* Pre-v7 versions of the architecture implemented WFI via coprocessor
|
|
||||||
* instructions rather than a separate instruction.
|
|
||||||
*/
|
*/
|
||||||
if ((insn & 0x0fff0fff) == 0x0e070f90) {
|
switch ((insn & 0x0fff0fff)) {
|
||||||
|
case 0x0e070f90:
|
||||||
/* 0,c7,c0,4: Standard v6 WFI (also used in some pre-v6 cores).
|
/* 0,c7,c0,4: Standard v6 WFI (also used in some pre-v6 cores).
|
||||||
* In v7, this must NOP.
|
* In v7, this must NOP.
|
||||||
*/
|
*/
|
||||||
|
if (IS_USER(s)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (!arm_feature(env, ARM_FEATURE_V7)) {
|
if (!arm_feature(env, ARM_FEATURE_V7)) {
|
||||||
/* Wait for interrupt. */
|
/* Wait for interrupt. */
|
||||||
gen_set_pc_im(s->pc);
|
gen_set_pc_im(s->pc);
|
||||||
s->is_jmp = DISAS_WFI;
|
s->is_jmp = DISAS_WFI;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case 0x0e070f58:
|
||||||
|
|
||||||
if ((insn & 0x0fff0fff) == 0x0e070f58) {
|
|
||||||
/* 0,c7,c8,2: Not all pre-v6 cores implemented this WFI,
|
/* 0,c7,c8,2: Not all pre-v6 cores implemented this WFI,
|
||||||
* so this is slightly over-broad.
|
* so this is slightly over-broad.
|
||||||
*/
|
*/
|
||||||
if (!arm_feature(env, ARM_FEATURE_V6)) {
|
if (!IS_USER(s) && !arm_feature(env, ARM_FEATURE_V6)) {
|
||||||
/* Wait for interrupt. */
|
/* Wait for interrupt. */
|
||||||
gen_set_pc_im(s->pc);
|
gen_set_pc_im(s->pc);
|
||||||
s->is_jmp = DISAS_WFI;
|
s->is_jmp = DISAS_WFI;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Otherwise fall through to handle via helper function.
|
/* Otherwise continue to handle via helper function.
|
||||||
* In particular, on v7 and some v6 cores this is one of
|
* In particular, on v7 and some v6 cores this is one of
|
||||||
* the VA-PA registers.
|
* the VA-PA registers.
|
||||||
*/
|
*/
|
||||||
|
break;
|
||||||
|
case 0x0e070f3d:
|
||||||
|
/* 0,c7,c13,1: prefetch-by-MVA in v6, NOP in v7 */
|
||||||
|
if (arm_feature(env, ARM_FEATURE_V6)) {
|
||||||
|
return IS_USER(s) ? 1 : 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x0e070f95: /* 0,c7,c5,4 : ISB */
|
||||||
|
case 0x0e070f9a: /* 0,c7,c10,4: DSB */
|
||||||
|
case 0x0e070fba: /* 0,c7,c10,5: DMB */
|
||||||
|
/* Barriers in both v6 and v7 */
|
||||||
|
if (arm_feature(env, ARM_FEATURE_V6)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_USER(s) && !cp15_user_ok(env, insn)) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rd = (insn >> 12) & 0xf;
|
rd = (insn >> 12) & 0xf;
|
||||||
@@ -3056,6 +3071,17 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
/* Source and destination the same. */
|
/* Source and destination the same. */
|
||||||
gen_mov_F0_vreg(dp, rd);
|
gen_mov_F0_vreg(dp, rd);
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
/* VCVTB, VCVTT: only present with the halfprec extension,
|
||||||
|
* UNPREDICTABLE if bit 8 is set (we choose to UNDEF)
|
||||||
|
*/
|
||||||
|
if (dp || !arm_feature(env, ARM_FEATURE_VFP_FP16)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/* Otherwise fall through */
|
||||||
default:
|
default:
|
||||||
/* One source operand. */
|
/* One source operand. */
|
||||||
gen_mov_F0_vreg(dp, rm);
|
gen_mov_F0_vreg(dp, rm);
|
||||||
@@ -3152,24 +3178,18 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
gen_vfp_sqrt(dp);
|
gen_vfp_sqrt(dp);
|
||||||
break;
|
break;
|
||||||
case 4: /* vcvtb.f32.f16 */
|
case 4: /* vcvtb.f32.f16 */
|
||||||
if (!arm_feature(env, ARM_FEATURE_VFP_FP16))
|
|
||||||
return 1;
|
|
||||||
tmp = gen_vfp_mrs();
|
tmp = gen_vfp_mrs();
|
||||||
tcg_gen_ext16u_i32(tmp, tmp);
|
tcg_gen_ext16u_i32(tmp, tmp);
|
||||||
gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp, cpu_env);
|
gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp, cpu_env);
|
||||||
tcg_temp_free_i32(tmp);
|
tcg_temp_free_i32(tmp);
|
||||||
break;
|
break;
|
||||||
case 5: /* vcvtt.f32.f16 */
|
case 5: /* vcvtt.f32.f16 */
|
||||||
if (!arm_feature(env, ARM_FEATURE_VFP_FP16))
|
|
||||||
return 1;
|
|
||||||
tmp = gen_vfp_mrs();
|
tmp = gen_vfp_mrs();
|
||||||
tcg_gen_shri_i32(tmp, tmp, 16);
|
tcg_gen_shri_i32(tmp, tmp, 16);
|
||||||
gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp, cpu_env);
|
gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp, cpu_env);
|
||||||
tcg_temp_free_i32(tmp);
|
tcg_temp_free_i32(tmp);
|
||||||
break;
|
break;
|
||||||
case 6: /* vcvtb.f16.f32 */
|
case 6: /* vcvtb.f16.f32 */
|
||||||
if (!arm_feature(env, ARM_FEATURE_VFP_FP16))
|
|
||||||
return 1;
|
|
||||||
tmp = tcg_temp_new_i32();
|
tmp = tcg_temp_new_i32();
|
||||||
gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, cpu_env);
|
gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, cpu_env);
|
||||||
gen_mov_F0_vreg(0, rd);
|
gen_mov_F0_vreg(0, rd);
|
||||||
@@ -3180,8 +3200,6 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
gen_vfp_msr(tmp);
|
gen_vfp_msr(tmp);
|
||||||
break;
|
break;
|
||||||
case 7: /* vcvtt.f16.f32 */
|
case 7: /* vcvtt.f16.f32 */
|
||||||
if (!arm_feature(env, ARM_FEATURE_VFP_FP16))
|
|
||||||
return 1;
|
|
||||||
tmp = tcg_temp_new_i32();
|
tmp = tcg_temp_new_i32();
|
||||||
gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, cpu_env);
|
gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, cpu_env);
|
||||||
tcg_gen_shli_i32(tmp, tmp, 16);
|
tcg_gen_shli_i32(tmp, tmp, 16);
|
||||||
@@ -3382,17 +3400,18 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
VFP_DREG_D(rd, insn);
|
VFP_DREG_D(rd, insn);
|
||||||
else
|
else
|
||||||
rd = VFP_SREG_D(insn);
|
rd = VFP_SREG_D(insn);
|
||||||
if (s->thumb && rn == 15) {
|
|
||||||
addr = tcg_temp_new_i32();
|
|
||||||
tcg_gen_movi_i32(addr, s->pc & ~2);
|
|
||||||
} else {
|
|
||||||
addr = load_reg(s, rn);
|
|
||||||
}
|
|
||||||
if ((insn & 0x01200000) == 0x01000000) {
|
if ((insn & 0x01200000) == 0x01000000) {
|
||||||
/* Single load/store */
|
/* Single load/store */
|
||||||
offset = (insn & 0xff) << 2;
|
offset = (insn & 0xff) << 2;
|
||||||
if ((insn & (1 << 23)) == 0)
|
if ((insn & (1 << 23)) == 0)
|
||||||
offset = -offset;
|
offset = -offset;
|
||||||
|
if (s->thumb && rn == 15) {
|
||||||
|
/* This is actually UNPREDICTABLE */
|
||||||
|
addr = tcg_temp_new_i32();
|
||||||
|
tcg_gen_movi_i32(addr, s->pc & ~2);
|
||||||
|
} else {
|
||||||
|
addr = load_reg(s, rn);
|
||||||
|
}
|
||||||
tcg_gen_addi_i32(addr, addr, offset);
|
tcg_gen_addi_i32(addr, addr, offset);
|
||||||
if (insn & (1 << 20)) {
|
if (insn & (1 << 20)) {
|
||||||
gen_vfp_ld(s, dp, addr);
|
gen_vfp_ld(s, dp, addr);
|
||||||
@@ -3404,11 +3423,34 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
tcg_temp_free_i32(addr);
|
tcg_temp_free_i32(addr);
|
||||||
} else {
|
} else {
|
||||||
/* load/store multiple */
|
/* load/store multiple */
|
||||||
|
int w = insn & (1 << 21);
|
||||||
if (dp)
|
if (dp)
|
||||||
n = (insn >> 1) & 0x7f;
|
n = (insn >> 1) & 0x7f;
|
||||||
else
|
else
|
||||||
n = insn & 0xff;
|
n = insn & 0xff;
|
||||||
|
|
||||||
|
if (w && !(((insn >> 23) ^ (insn >> 24)) & 1)) {
|
||||||
|
/* P == U , W == 1 => UNDEF */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (n == 0 || (rd + n) > 32 || (dp && n > 16)) {
|
||||||
|
/* UNPREDICTABLE cases for bad immediates: we choose to
|
||||||
|
* UNDEF to avoid generating huge numbers of TCG ops
|
||||||
|
*/
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (rn == 15 && w) {
|
||||||
|
/* writeback to PC is UNPREDICTABLE, we choose to UNDEF */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->thumb && rn == 15) {
|
||||||
|
/* This is actually UNPREDICTABLE */
|
||||||
|
addr = tcg_temp_new_i32();
|
||||||
|
tcg_gen_movi_i32(addr, s->pc & ~2);
|
||||||
|
} else {
|
||||||
|
addr = load_reg(s, rn);
|
||||||
|
}
|
||||||
if (insn & (1 << 24)) /* pre-decrement */
|
if (insn & (1 << 24)) /* pre-decrement */
|
||||||
tcg_gen_addi_i32(addr, addr, -((insn & 0xff) << 2));
|
tcg_gen_addi_i32(addr, addr, -((insn & 0xff) << 2));
|
||||||
|
|
||||||
@@ -3428,7 +3470,7 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
|
|||||||
}
|
}
|
||||||
tcg_gen_addi_i32(addr, addr, offset);
|
tcg_gen_addi_i32(addr, addr, offset);
|
||||||
}
|
}
|
||||||
if (insn & (1 << 21)) {
|
if (w) {
|
||||||
/* writeback */
|
/* writeback */
|
||||||
if (insn & (1 << 24))
|
if (insn & (1 << 24))
|
||||||
offset = -offset * n;
|
offset = -offset * n;
|
||||||
|
4
ui/sdl.c
4
ui/sdl.c
@@ -672,8 +672,10 @@ static void sdl_refresh(DisplayState *ds)
|
|||||||
sdl_process_key(&ev->key);
|
sdl_process_key(&ev->key);
|
||||||
break;
|
break;
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
if (!no_quit)
|
if (!no_quit) {
|
||||||
|
no_shutdown = 0;
|
||||||
qemu_system_shutdown_request();
|
qemu_system_shutdown_request();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
if (gui_grab || kbd_mouse_is_absolute() ||
|
if (gui_grab || kbd_mouse_is_absolute() ||
|
||||||
|
1
vl.c
1
vl.c
@@ -1282,6 +1282,7 @@ void qemu_system_killed(int signal, pid_t pid)
|
|||||||
{
|
{
|
||||||
shutdown_signal = signal;
|
shutdown_signal = signal;
|
||||||
shutdown_pid = pid;
|
shutdown_pid = pid;
|
||||||
|
no_shutdown = 0;
|
||||||
qemu_system_shutdown_request();
|
qemu_system_shutdown_request();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
x86_64.ld
14
x86_64.ld
@@ -38,16 +38,16 @@ SECTIONS
|
|||||||
.rel.plt :
|
.rel.plt :
|
||||||
{
|
{
|
||||||
*(.rel.plt)
|
*(.rel.plt)
|
||||||
PROVIDE_HIDDEN (__rel_iplt_start = .);
|
PROVIDE (__rel_iplt_start = .);
|
||||||
*(.rel.iplt)
|
*(.rel.iplt)
|
||||||
PROVIDE_HIDDEN (__rel_iplt_end = .);
|
PROVIDE (__rel_iplt_end = .);
|
||||||
}
|
}
|
||||||
.rela.plt :
|
.rela.plt :
|
||||||
{
|
{
|
||||||
*(.rela.plt)
|
*(.rela.plt)
|
||||||
PROVIDE_HIDDEN (__rela_iplt_start = .);
|
PROVIDE (__rela_iplt_start = .);
|
||||||
*(.rela.iplt)
|
*(.rela.iplt)
|
||||||
PROVIDE_HIDDEN (__rela_iplt_end = .);
|
PROVIDE (__rela_iplt_end = .);
|
||||||
}
|
}
|
||||||
.init :
|
.init :
|
||||||
{
|
{
|
||||||
@@ -70,8 +70,6 @@ SECTIONS
|
|||||||
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
||||||
.rodata1 : { *(.rodata1) }
|
.rodata1 : { *(.rodata1) }
|
||||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||||
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
|
||||||
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table) }
|
|
||||||
/* Adjust the address for the data segment. We want to adjust up to
|
/* Adjust the address for the data segment. We want to adjust up to
|
||||||
the same address within the page on the next page up. */
|
the same address within the page on the next page up. */
|
||||||
. = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
|
. = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
|
||||||
@@ -97,8 +95,8 @@ SECTIONS
|
|||||||
.data1 : { *(.data1) }
|
.data1 : { *(.data1) }
|
||||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||||
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||||
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table) }
|
.gcc_except_table : { *(.gcc_except_table) }
|
||||||
.dynamic : { *(.dynamic) }
|
.dynamic : { *(.dynamic) }
|
||||||
.ctors :
|
.ctors :
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user