summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/helpers.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-11-24 06:49:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-11-24 06:49:23 (GMT)
commit96eee784837e6ed4cf9ce5f1cb2e0f8bff8bd9bf (patch)
treec7fd1108066e6359766bc18f8883b67b2b7f082f /src/arch/arm/v7/helpers.h
parent2d833afa673b63a1a61e22ea2cdde59ed60b5ad1 (diff)
Update the list of handled ARM instructions
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@423 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/arm/v7/helpers.h')
-rw-r--r--src/arch/arm/v7/helpers.h57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/arch/arm/v7/helpers.h b/src/arch/arm/v7/helpers.h
index 087b2e7..66a98f6 100644
--- a/src/arch/arm/v7/helpers.h
+++ b/src/arch/arm/v7/helpers.h
@@ -25,20 +25,73 @@
#define _ARCH_ARM_V7_HELPERS_H
-#include <stdbool.h>
-#include <stdint.h>
+#include <libio.h>
+#include "pseudo.h"
#include "../../operand.h"
+
+
+#define ARMExpandImm_C(imm12, c) \
+ ({ \
+ uint32_t __val; \
+ __val = armv7_arm_expand_imm_c(imm12, (bool []) { c }); \
+ g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \
+ })
+
+#define ARMExpandImm(imm12) \
+ ({ \
+ uint32_t __val; \
+ __val = armv7_arm_expand_imm_c(imm12, NULL); \
+ g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \
+ })
+
+
+
+
+
+#define ZeroExtend(x, n, i) \
+ ({ \
+ MemoryDataSize __mds; \
+ uint ## i ## _t __val; \
+ mds = MDS_ ## sz ## _BITS_UNSIGNED; \
+ __val = armv7_zero_extend(x, n, i); \
+ g_imm_operand_new_from_value(__mds, __val); \
+ })
+
+
+
+#define Zeros(i) \
+ ({ \
+ MemoryDataSize __mds; \
+ uint ## i ## _t __val; \
+ mds = MDS_ ## sz ## _BITS_UNSIGNED; \
+ __val = 0; \
+ g_imm_operand_new_from_value(__mds, __val); \
+ })
+
+
+
+
+
+/* Effectue une rotation vers la droit d'une valeur. */
+GArchOperand *ror_armv7_imm(uint32_t, unsigned int);
+
/* Crée un opérande de valeur immédiate avec extension de signe. */
GArchOperand *sign_extend_armv7_imm(uint32_t, bool, unsigned int);
+/* Etend une valeur immédiate en mode 'Thumb' ARMv7. */
+GArchOperand *thumb_expand_armv7_imm(uint32_t);
+
/* Crée un opérande représentant un registre ARMv7. */
GArchOperand *translate_armv7_register(uint8_t);
+/* Réalise un simple transtypage de valeur entière. */
+GArchOperand *zero_extend_armv7_imm(uint32_t, unsigned int);
+
#endif /* _ARCH_ARM_V7_HELPERS_H */