File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed
Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,10 @@ else()
259259 endwhile (TRUE )
260260 endif ()
261261
262+ if (UNICORN_INTERPRETER)
263+ set (UNICORN_TARGET_ARCH "tci" )
264+ endif ()
265+
262266 set (EXTRA_CFLAGS "--extra-cflags=" )
263267 if (UNICORN_HAS_X86)
264268 set (EXTRA_CFLAGS "${EXTRA_CFLAGS} -DUNICORN_HAS_X86 " )
@@ -496,6 +500,10 @@ set(UNICORN_ARCH_COMMON
496500 qemu/softmmu/unicorn_vtlb.c
497501)
498502
503+ if (UNICORN_INTERPRETER)
504+ list (APPEND UNICORN_ARCH_COMMON qemu/tcg/tci.c)
505+ endif ()
506+
499507if (UNICORN_HAS_X86)
500508add_library (x86_64-softmmu STATIC
501509 ${UNICORN_ARCH_COMMON}
Original file line number Diff line number Diff line change @@ -695,6 +695,7 @@ struct TCGContext {
695695 struct jit_code_entry * one_entry ;
696696 /* qemu/tcg/tcg-common.c */
697697 TCGOpDef * tcg_op_defs ;
698+ size_t tcg_op_defs_max ;
698699
699700 // Unicorn engine variables
700701 struct uc_struct * uc ;
Original file line number Diff line number Diff line change 6262
6363#include <uc_priv.h>
6464
65+ #if CONFIG_TCG_INTERPRETER
66+ #include "tcg/tcg.h"
67+ #endif
68+
6569/* Forward declarations for functions declared in tcg-target.inc.c and
6670 used here. */
6771static void tcg_target_init (TCGContext * s );
@@ -659,6 +663,7 @@ static const TCGOpDef tcg_op_defs_org[] = {
659663#include "tcg/tcg-opc.h"
660664#undef DEF
661665};
666+ static const size_t tcg_op_defs_max_org = ARRAY_SIZE (tcg_op_defs_org );
662667
663668static void process_op_defs (TCGContext * s );
664669static TCGTemp * tcg_global_reg_new_internal (TCGContext * s , TCGType type ,
@@ -727,6 +732,7 @@ void tcg_context_init(TCGContext *s)
727732 // copy original tcg_op_defs_org for private usage
728733 s -> tcg_op_defs = g_malloc0 (sizeof (tcg_op_defs_org ));
729734 memcpy (s -> tcg_op_defs , tcg_op_defs_org , sizeof (tcg_op_defs_org ));
735+ s -> tcg_op_defs_max = tcg_op_defs_max_org ;
730736
731737 /* Count total number of arguments and allocate the corresponding
732738 space */
Original file line number Diff line number Diff line change @@ -871,14 +871,14 @@ static void tcg_target_init(TCGContext *s)
871871#endif
872872
873873 /* The current code uses uint8_t for tcg operations. */
874- tcg_debug_assert (tcg_op_defs_max <= UINT8_MAX );
874+ tcg_debug_assert (s -> tcg_op_defs_max <= UINT8_MAX );
875875
876876 /* Registers available for 32 bit operations. */
877- tcg_target_available_regs [TCG_TYPE_I32 ] = BIT (TCG_TARGET_NB_REGS ) - 1 ;
877+ s -> tcg_target_available_regs [TCG_TYPE_I32 ] = BIT (TCG_TARGET_NB_REGS ) - 1 ;
878878 /* Registers available for 64 bit operations. */
879- tcg_target_available_regs [TCG_TYPE_I64 ] = BIT (TCG_TARGET_NB_REGS ) - 1 ;
879+ s -> tcg_target_available_regs [TCG_TYPE_I64 ] = BIT (TCG_TARGET_NB_REGS ) - 1 ;
880880 /* TODO: Which registers should be set here? */
881- tcg_target_call_clobber_regs = BIT (TCG_TARGET_NB_REGS ) - 1 ;
881+ s -> tcg_target_call_clobber_regs = BIT (TCG_TARGET_NB_REGS ) - 1 ;
882882
883883 s -> reserved_regs = 0 ;
884884 tcg_regset_set_reg (s -> reserved_regs , TCG_REG_CALL_STACK );
You can’t perform that action at this time.
0 commit comments