aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2010-09-09 23:49:44 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-09-13 00:30:34 -0700
commit3b290c31efd96e5474f2b55b7fe1ca0250a5bb47 (patch)
tree85926a92cab46a4c76f0c8630c43618ef3b1bb39
parente81106dda32dcf982eff8d080cc194faf9851172 (diff)
downloadexternal_qemu-3b290c31efd96e5474f2b55b7fe1ca0250a5bb47.zip
external_qemu-3b290c31efd96e5474f2b55b7fe1ca0250a5bb47.tar.gz
external_qemu-3b290c31efd96e5474f2b55b7fe1ca0250a5bb47.tar.bz2
upstream: minor updates.
-rw-r--r--arm-semi.c1
-rw-r--r--bt-host.c4
-rw-r--r--cache-utils.c3
-rw-r--r--def-helper.h38
-rw-r--r--dyngen-exec.h1
-rw-r--r--gdbstub.h14
-rw-r--r--qemu-lock.h2
7 files changed, 47 insertions, 16 deletions
diff --git a/arm-semi.c b/arm-semi.c
index 5239ffc..de652c5 100644
--- a/arm-semi.c
+++ b/arm-semi.c
@@ -459,6 +459,7 @@ uint32_t do_arm_semihosting(CPUState *env)
return 0;
}
case SYS_EXIT:
+ //gdb_exit(env, 0);
exit(0);
default:
fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
diff --git a/bt-host.c b/bt-host.c
index 964ac11..e174e90 100644
--- a/bt-host.c
+++ b/bt-host.c
@@ -50,19 +50,19 @@ static void bt_host_send(struct HCIInfo *hci,
struct bt_host_hci_s *s = (struct bt_host_hci_s *) hci;
uint8_t pkt = type;
struct iovec iv[2];
- int ret;
iv[0].iov_base = (void *)&pkt;
iv[0].iov_len = 1;
iv[1].iov_base = (void *) data;
iv[1].iov_len = len;
- while ((ret = writev(s->fd, iv, 2)) < 0)
+ while (writev(s->fd, iv, 2) < 0) {
if (errno != EAGAIN && errno != EINTR) {
fprintf(stderr, "qemu: error %i writing bluetooth packet.\n",
errno);
return;
}
+ }
}
static void bt_host_cmd(struct HCIInfo *hci, const uint8_t *data, int len)
diff --git a/cache-utils.c b/cache-utils.c
index 8bbd680..b1f2097 100644
--- a/cache-utils.c
+++ b/cache-utils.c
@@ -58,7 +58,10 @@ static void ppc_init_cacheline_sizes(void)
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/sysctl.h>
diff --git a/def-helper.h b/def-helper.h
index 8a88c5b..8a822c7 100644
--- a/def-helper.h
+++ b/def-helper.h
@@ -81,9 +81,29 @@
#define dh_is_64bit_ptr (TCG_TARGET_REG_BITS == 64)
#define dh_is_64bit(t) glue(dh_is_64bit_, dh_alias(t))
+#define dh_is_signed_void 0
+#define dh_is_signed_i32 0
+#define dh_is_signed_s32 1
+#define dh_is_signed_i64 0
+#define dh_is_signed_s64 1
+#define dh_is_signed_f32 0
+#define dh_is_signed_f64 0
+#define dh_is_signed_tl 0
+#define dh_is_signed_int 1
+/* ??? This is highly specific to the host cpu. There are even special
+ extension instructions that may be required, e.g. ia64's addp4. But
+ for now we don't support any 64-bit targets with 32-bit pointers. */
+#define dh_is_signed_ptr 0
+#define dh_is_signed_env dh_is_signed_ptr
+#define dh_is_signed(t) dh_is_signed_##t
+
+#define dh_sizemask(t, n) \
+ sizemask |= dh_is_64bit(t) << (n*2); \
+ sizemask |= dh_is_signed(t) << (n*2+1)
+
#define dh_arg(t, n) \
args[n - 1] = glue(GET_TCGV_, dh_alias(t))(glue(arg, n)); \
- sizemask |= dh_is_64bit(t) << n
+ dh_sizemask(t, n)
#define dh_arg_decl(t, n) glue(TCGv_, dh_alias(t)) glue(arg, n)
@@ -138,8 +158,8 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret)) \
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1)) \
{ \
TCGArg args[1]; \
- int sizemask; \
- sizemask = dh_is_64bit(ret); \
+ int sizemask = 0; \
+ dh_sizemask(ret, 0); \
dh_arg(t1, 1); \
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 1, args); \
}
@@ -149,8 +169,8 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
dh_arg_decl(t2, 2)) \
{ \
TCGArg args[2]; \
- int sizemask; \
- sizemask = dh_is_64bit(ret); \
+ int sizemask = 0; \
+ dh_sizemask(ret, 0); \
dh_arg(t1, 1); \
dh_arg(t2, 2); \
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 2, args); \
@@ -161,8 +181,8 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
dh_arg_decl(t2, 2), dh_arg_decl(t3, 3)) \
{ \
TCGArg args[3]; \
- int sizemask; \
- sizemask = dh_is_64bit(ret); \
+ int sizemask = 0; \
+ dh_sizemask(ret, 0); \
dh_arg(t1, 1); \
dh_arg(t2, 2); \
dh_arg(t3, 3); \
@@ -174,8 +194,8 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), dh_arg_decl(t4, 4)) \
{ \
TCGArg args[4]; \
- int sizemask; \
- sizemask = dh_is_64bit(ret); \
+ int sizemask = 0; \
+ dh_sizemask(ret, 0); \
dh_arg(t1, 1); \
dh_arg(t2, 2); \
dh_arg(t3, 3); \
diff --git a/dyngen-exec.h b/dyngen-exec.h
index 0353f36..283c286 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -31,6 +31,7 @@
host headers do not allow that. */
#include <stddef.h>
#include <stdint.h>
+#include <stdbool.h>
#ifdef __OpenBSD__
#include <sys/types.h>
diff --git a/gdbstub.h b/gdbstub.h
index 5740041..219abda 100644
--- a/gdbstub.h
+++ b/gdbstub.h
@@ -10,21 +10,19 @@
#define GDB_WATCHPOINT_READ 3
#define GDB_WATCHPOINT_ACCESS 4
+#ifdef NEED_CPU_H
typedef void (*gdb_syscall_complete_cb)(CPUState *env,
target_ulong ret, target_ulong err);
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
int use_gdb_syscalls(void);
void gdb_set_stop_cpu(CPUState *env);
+void gdb_exit(CPUState *, int);
#ifdef CONFIG_USER_ONLY
int gdb_queuesig (void);
int gdb_handlesig (CPUState *, int);
-void gdb_exit(CPUState *, int);
void gdb_signalled(CPUState *, int);
-int gdbserver_start(int);
void gdbserver_fork(CPUState *);
-#else
-int gdbserver_start(const char *port);
#endif
/* Get or set a register. Returns the size of the register. */
typedef int (*gdb_reg_cb)(CPUState *env, uint8_t *buf, int reg);
@@ -33,3 +31,11 @@ void gdb_register_coprocessor(CPUState *env,
int num_regs, const char *xml, int g_pos);
#endif
+
+#ifdef CONFIG_USER_ONLY
+int gdbserver_start(int);
+#else
+int gdbserver_start(const char *port);
+#endif
+
+#endif
diff --git a/qemu-lock.h b/qemu-lock.h
index 49e2203..9a3e6ac 100644
--- a/qemu-lock.h
+++ b/qemu-lock.h
@@ -23,7 +23,7 @@
likely to release it soon. In environments where you have more threads
than physical CPUs (the extreme case being a single CPU host) a spinlock
simply wastes CPU until the OS decides to preempt it. */
-#if defined(USE_NPTL)
+#if defined(CONFIG_USE_NPTL)
#include <pthread.h>
#define spin_lock pthread_mutex_lock