aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/dis-main.inc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arm/dis-main.inc.h')
-rw-r--r--lib/arm/dis-main.inc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/arm/dis-main.inc.h b/lib/arm/dis-main.inc.h
new file mode 100644
index 0000000..bf2767e
--- /dev/null
+++ b/lib/arm/dis-main.inc.h
@@ -0,0 +1,16 @@
+#include "dis-thumb.inc.h"
+#include "dis-thumb2.inc.h"
+#include "dis-arm.inc.h"
+
+static INLINE void P(dis)(tdis_ctx ctx) {
+ if (ctx->arch.pc_low_bit) {
+ uint16_t op = *(uint16_t *) ctx->ptr;
+ bool is_32 = (op >> 13 & 7) == 7 && (op >> 11 & 3) != 0;
+ if (is_32)
+ return P(dis_thumb2)(ctx);
+ else
+ return P(dis_thumb)(ctx);
+ } else {
+ return P(dis_arm)(ctx);
+ }
+}