From 553bf362adc263912fdeeef990ac85ab41b9456b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Apr 2019 09:21:14 -0400 Subject: [PATCH] uc: Restore armeb target This was accidentally removed --- Makefile | 3 +++ uc.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ab8574d7..01799946 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,11 @@ ifneq (,$(findstring x86,$(UNICORN_ARCHS))) endif ifneq (,$(findstring arm,$(UNICORN_ARCHS))) UC_TARGET_OBJ += $(call GENOBJ,arm-softmmu) + UC_TARGET_OBJ += $(call GENOBJ,armeb-softmmu) UNICORN_CFLAGS += -DUNICORN_HAS_ARM + UNICORN_CFLAGS += -DUNICORN_HAS_ARMEB UNICORN_TARGETS += arm-softmmu, + UNICORN_TARGETS += armeb-softmmu, endif ifneq (,$(findstring m68k,$(UNICORN_ARCHS))) UC_TARGET_OBJ += $(call GENOBJ,m68k-softmmu) diff --git a/uc.c b/uc.c index d8670a78..d20b7e52 100644 --- a/uc.c +++ b/uc.c @@ -199,7 +199,7 @@ uc_err uc_open(uc_arch arch, uc_mode mode, uc_engine **result) return UC_ERR_MODE; } if (mode & UC_MODE_BIG_ENDIAN) { - //uc->init_arch = armeb_uc_init; + uc->init_arch = armeb_uc_init; } else { uc->init_arch = arm_uc_init; } @@ -1244,7 +1244,7 @@ static size_t cpu_context_size(uc_arch arch, uc_mode mode) case UC_ARCH_X86: return X86_REGS_STORAGE_SIZE; #endif #ifdef UNICORN_HAS_ARM - case UC_ARCH_ARM: return ARM_REGS_STORAGE_SIZE_arm; + case UC_ARCH_ARM: return mode & UC_MODE_BIG_ENDIAN ? ARM_REGS_STORAGE_SIZE_armeb : ARM_REGS_STORAGE_SIZE_arm; #endif #ifdef UNICORN_HAS_ARM64 case UC_ARCH_ARM64: return mode & UC_MODE_BIG_ENDIAN ? ARM64_REGS_STORAGE_SIZE_aarch64eb : ARM64_REGS_STORAGE_SIZE_aarch64;