diff --git a/qemu/s390x.h b/qemu/s390x.h index ffa6c59e..b14ea4cf 100644 --- a/qemu/s390x.h +++ b/qemu/s390x.h @@ -4,6 +4,9 @@ #ifndef UNICORN_ARCH_POSTFIX #define UNICORN_ARCH_POSTFIX _s390x #endif +#define uc_add_inline_hook uc_add_inline_hook_s390x +#define uc_del_inline_hook uc_del_inline_hook_s390x +#define tb_invalidate_phys_range tb_invalidate_phys_range_s390x #define use_idiv_instructions use_idiv_instructions_s390x #define arm_arch arm_arch_s390x #define tb_target_set_jmp_target tb_target_set_jmp_target_s390x @@ -48,7 +51,7 @@ #define address_space_dispatch_compact address_space_dispatch_compact_s390x #define flatview_translate flatview_translate_s390x #define address_space_translate_for_iotlb address_space_translate_for_iotlb_s390x -//#define qemu_get_cpu qemu_get_cpu_s390x +#define qemu_get_cpu qemu_get_cpu_s390x #define cpu_address_space_init cpu_address_space_init_s390x #define cpu_get_address_space cpu_get_address_space_s390x #define cpu_exec_unrealizefn cpu_exec_unrealizefn_s390x diff --git a/qemu/target/s390x/cpu.c b/qemu/target/s390x/cpu.c index 9f2fbf34..9573cb27 100644 --- a/qemu/target/s390x/cpu.c +++ b/qemu/target/s390x/cpu.c @@ -27,6 +27,7 @@ #include "sysemu/sysemu.h" #include "sysemu/tcg.h" #include "fpu/softfloat-helpers.h" +#include "exec/exec-all.h" #define CR0_RESET 0xE0UL #define CR14_RESET 0xC2000000UL; diff --git a/qemu/target/s390x/helper.h b/qemu/target/s390x/helper.h index 43eabb81..2ab70698 100644 --- a/qemu/target/s390x/helper.h +++ b/qemu/target/s390x/helper.h @@ -1,4 +1,5 @@ DEF_HELPER_4(uc_tracecode, void, i32, i32, ptr, i64) +DEF_HELPER_6(uc_traceopcode, void, ptr, i64, i64, i32, ptr, i64) DEF_HELPER_2(exception, noreturn, env, i32) DEF_HELPER_2(data_exception, noreturn, env, i32) diff --git a/qemu/target/s390x/translate.c b/qemu/target/s390x/translate.c index 5ec72e3f..79b83b0b 100644 --- a/qemu/target/s390x/translate.c +++ b/qemu/target/s390x/translate.c @@ -6844,7 +6844,7 @@ static void s390x_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) DisasContext *dc = container_of(dcbase, DisasContext, base); // Unicorn: end address tells us to stop emulation - if (dcbase->pc_next == dc->uc->addr_end) { + if (uc_addr_is_exit(dc->uc, dcbase->pc_next)) { // imitate PGM exception to halt emulation dcbase->is_jmp = DISAS_UNICORN_HALT; } else {