File tree 4 files changed +19
-4
lines changed
4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,10 @@ else()
277
277
endwhile (TRUE )
278
278
endif ()
279
279
280
+ if (UNICORN_INTERPRETER)
281
+ set (UNICORN_TARGET_ARCH "tci" )
282
+ endif ()
283
+
280
284
set (EXTRA_CFLAGS "--extra-cflags=" )
281
285
if (UNICORN_HAS_X86)
282
286
set (EXTRA_CFLAGS "${EXTRA_CFLAGS} -DUNICORN_HAS_X86 " )
@@ -514,6 +518,10 @@ set(UNICORN_ARCH_COMMON
514
518
qemu/softmmu/unicorn_vtlb.c
515
519
)
516
520
521
+ if (UNICORN_INTERPRETER)
522
+ list (APPEND UNICORN_ARCH_COMMON qemu/tcg/tci.c)
523
+ endif ()
524
+
517
525
if (UNICORN_HAS_X86)
518
526
add_library (x86_64-softmmu STATIC
519
527
${UNICORN_ARCH_COMMON}
Original file line number Diff line number Diff line change @@ -695,6 +695,7 @@ struct TCGContext {
695
695
struct jit_code_entry * one_entry ;
696
696
/* qemu/tcg/tcg-common.c */
697
697
TCGOpDef * tcg_op_defs ;
698
+ size_t tcg_op_defs_max ;
698
699
699
700
// Unicorn engine variables
700
701
struct uc_struct * uc ;
Original file line number Diff line number Diff line change 62
62
63
63
#include <uc_priv.h>
64
64
65
+ #if CONFIG_TCG_INTERPRETER
66
+ #include "tcg/tcg.h"
67
+ #endif
68
+
65
69
/* Forward declarations for functions declared in tcg-target.inc.c and
66
70
used here. */
67
71
static void tcg_target_init (TCGContext * s );
@@ -659,6 +663,7 @@ static const TCGOpDef tcg_op_defs_org[] = {
659
663
#include "tcg/tcg-opc.h"
660
664
#undef DEF
661
665
};
666
+ static const size_t tcg_op_defs_max_org = ARRAY_SIZE (tcg_op_defs_org );
662
667
663
668
static void process_op_defs (TCGContext * s );
664
669
static TCGTemp * tcg_global_reg_new_internal (TCGContext * s , TCGType type ,
@@ -727,6 +732,7 @@ void tcg_context_init(TCGContext *s)
727
732
// copy original tcg_op_defs_org for private usage
728
733
s -> tcg_op_defs = g_malloc0 (sizeof (tcg_op_defs_org ));
729
734
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 ;
730
736
731
737
/* Count total number of arguments and allocate the corresponding
732
738
space */
Original file line number Diff line number Diff line change @@ -871,14 +871,14 @@ static void tcg_target_init(TCGContext *s)
871
871
#endif
872
872
873
873
/* 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 );
875
875
876
876
/* 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 ;
878
878
/* 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 ;
880
880
/* 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 ;
882
882
883
883
s -> reserved_regs = 0 ;
884
884
tcg_regset_set_reg (s -> reserved_regs , TCG_REG_CALL_STACK );
You can’t perform that action at this time.
0 commit comments