diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-28 20:34:24 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-28 20:34:24 (GMT) |
commit | 5311a943dffcc410739509b9215ca464f6d1e54c (patch) | |
tree | 9c34b5176606aa7bb3dcfb5970a20e3f9b27f1c3 /plugins/arm/v7/helpers.h | |
parent | 9f5ed46de568d3db882c939c8ca9d0117bff3369 (diff) |
Included support for ARMv7 system instructions.
Diffstat (limited to 'plugins/arm/v7/helpers.h')
-rw-r--r-- | plugins/arm/v7/helpers.h | 64 |
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; \ |