summaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-03-15 13:16:36 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-05-19 16:42:29 +0200
commit00f6da6a1a5d1ce085334eccbb50ec899ceed513 (patch)
treeb9d8d6e8a391be883b8e6537033fa5cf3c919efc /tcg
parent03dd024ff57733a55cd2e455f361d053c81b1b29 (diff)
downloadqemu-00f6da6a1a5d1ce085334eccbb50ec899ceed513.tar.gz
qemu-00f6da6a1a5d1ce085334eccbb50ec899ceed513.tar.bz2
qemu-00f6da6a1a5d1ce085334eccbb50ec899ceed513.zip
exec: extract exec/tb-context.h
TCG backends do not need most of exec-all.h; extract what they actually need to a separate file or move it directly to tcg.h. The next patch will stop including exec-all.h from everywhere. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/optimize.c2
-rw-r--r--tcg/tcg-common.c2
-rw-r--r--tcg/tcg.h22
3 files changed, 25 insertions, 1 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index def4ba6913..c0d975b3d9 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -25,7 +25,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-#include "cpu.h"
+#include "exec/cpu-common.h"
#include "tcg-op.h"
#define CASE_OP_32_64(x) \
diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
index 97305a3efc..2f139de802 100644
--- a/tcg/tcg-common.c
+++ b/tcg/tcg-common.c
@@ -23,6 +23,8 @@
*/
#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "exec/cpu-common.h"
#include "tcg/tcg.h"
#if defined(CONFIG_TCG_INTERPRETER)
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 8abf318343..909db3fc02 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -27,9 +27,31 @@
#include "qemu-common.h"
#include "cpu.h"
+#include "exec/tb-context.h"
#include "qemu/bitops.h"
#include "tcg-target.h"
+/* XXX: make safe guess about sizes */
+#define MAX_OP_PER_INSTR 266
+
+#if HOST_LONG_BITS == 32
+#define MAX_OPC_PARAM_PER_ARG 2
+#else
+#define MAX_OPC_PARAM_PER_ARG 1
+#endif
+#define MAX_OPC_PARAM_IARGS 5
+#define MAX_OPC_PARAM_OARGS 1
+#define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS)
+
+/* A Call op needs up to 4 + 2N parameters on 32-bit archs,
+ * and up to 4 + N parameters on 64-bit archs
+ * (N = number of input arguments + output arguments). */
+#define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS))
+#define OPC_BUF_SIZE 640
+#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR)
+
+#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM)
+
#define CPU_TEMP_BUF_NLONGS 128
/* Default target word size to pointer size. */