Merge systemz to the latest uc2 codebase

This commit is contained in:
mio
2021-12-26 22:58:32 +01:00
60 changed files with 28970 additions and 5 deletions

25
uc.c
View File

@ -23,6 +23,7 @@
#include "qemu/target/sparc/unicorn.h"
#include "qemu/target/ppc/unicorn.h"
#include "qemu/target/riscv/unicorn.h"
#include "qemu/target/s390x/unicorn.h"
#include "qemu/include/qemu/queue.h"
#include "qemu-common.h"
@ -131,6 +132,10 @@ bool uc_arch_supported(uc_arch arch)
#ifdef UNICORN_HAS_RISCV
case UC_ARCH_RISCV:
return true;
#endif
#ifdef UNICORN_HAS_S390X
case UC_ARCH_S390X:
return true;
#endif
/* Invalid or disabled arch */
default:
@ -341,6 +346,15 @@ uc_err uc_open(uc_arch arch, uc_mode mode, uc_engine **result)
return UC_ERR_MODE;
}
break;
#endif
#ifdef UNICORN_HAS_S390X
case UC_ARCH_S390X:
if ((mode & ~UC_MODE_S390X_MASK) || !(mode & UC_MODE_BIG_ENDIAN)) {
free(uc);
return UC_ERR_MODE;
}
uc->init_arch = s390_uc_init;
break;
#endif
}
@ -763,6 +777,11 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
case UC_ARCH_RISCV:
uc_reg_write(uc, UC_RISCV_REG_PC, &begin);
break;
#endif
#ifdef UNICORN_HAS_S390X
case UC_ARCH_S390X:
uc_reg_write(uc, UC_S390X_REG_PC, &begin);
break;
#endif
}
@ -1922,6 +1941,12 @@ static void find_context_reg_rw_function(uc_arch arch, uc_mode mode,
rw->context_reg_write = riscv64_context_reg_write;
}
break;
#endif
#ifdef UNICORN_HAS_S390X
case UC_ARCH_S390X:
rw->context_reg_read = s390_context_reg_read;
rw->context_reg_write = s390_context_reg_write;
break;
#endif
}