summaryrefslogtreecommitdiff
path: root/plugins/arm/v7/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/arm/v7/helpers.h')
-rw-r--r--plugins/arm/v7/helpers.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/plugins/arm/v7/helpers.h b/plugins/arm/v7/helpers.h
index d41f6e8..ad23bc7 100644
--- a/plugins/arm/v7/helpers.h
+++ b/plugins/arm/v7/helpers.h
@@ -31,12 +31,14 @@
#include "pseudo.h"
#include "operands/estate.h"
+#include "operands/iflags.h"
#include "operands/it.h"
#include "operands/maccess.h"
#include "operands/register.h"
#include "operands/reglist.h"
#include "operands/rotation.h"
#include "operands/shift.h"
+#include "registers/banked.h"
#include "registers/basic.h"
#include "registers/coproc.h"
#include "registers/special.h"
@@ -72,6 +74,19 @@
})
+#define BankedRegister(r, sysm) \
+ ({ \
+ GArchOperand *__result; \
+ GArchRegister *__reg; \
+ __reg = g_armv7_banked_register_new(r, sysm); \
+ if (__reg == NULL) \
+ __result = NULL; \
+ else \
+ __result = g_armv7_register_operand_new(G_ARMV7_REGISTER(__reg)); \
+ __result; \
+ })
+
+
#define BitDiff(msb, lsb) \
({ \
GArchOperand *__result; \
@@ -154,6 +169,13 @@
})
+#define IFlagsDefinition(a, i, f) \
+ ({ \
+ GArchOperand *__result; \
+ __result = g_armv7_iflags_operand_new(a, i, f); \
+ __result; \
+ })
+
#define ITCond(firstcond, mask) \
({ \
GArchOperand *__result; \
@@ -273,6 +295,48 @@
})
+#define RegListWithoutPC(mask) \
+ ({ \
+ GArchOperand *__result; \
+ GArmV7Register *__pc; \
+ GArmV7RegListOperand *__list; \
+ __result = RegList(mask); \
+ if (__result != NULL) \
+ { \
+ __pc = G_ARMV7_REGISTER(g_armv7_basic_register_new(15)); \
+ __list = G_ARMV7_REGLIST_OPERAND(result); \
+ if (g_armv7_reglist_operand_has_register(__list, __pc)) \
+ { \
+ g_object_unref(G_OBJECT(__result)); \
+ __result = NULL; \
+ } \
+ g_object_unref(G_OBJECT(__pc)); \
+ } \
+ __result; \
+ })
+
+
+#define RegListWithPC(mask) \
+ ({ \
+ GArchOperand *__result; \
+ GArmV7Register *__pc; \
+ GArmV7RegListOperand *__list; \
+ __result = RegList(mask); \
+ if (__result != NULL) \
+ { \
+ __pc = G_ARMV7_REGISTER(g_armv7_basic_register_new(15)); \
+ __list = G_ARMV7_REGLIST_OPERAND(result); \
+ if (!g_armv7_reglist_operand_has_register(__list, __pc)) \
+ { \
+ g_object_unref(G_OBJECT(__result)); \
+ __result = NULL; \
+ } \
+ g_object_unref(G_OBJECT(__pc)); \
+ } \
+ __result; \
+ })
+
+
#define Rotation(val5) \
({ \
GArchOperand *__result; \