summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index d3ac97e..1090138 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -283,6 +283,8 @@ bool g_arch_instruction_set_flag(GArchInstruction *instr, ArchInstrFlag flag)
bool result; /* Bilan à retourner */
instr_obj_extra *extra; /* Données insérées à modifier */
+ assert(flag <= AIF_HIGH_USER);
+
extra = GET_ARCH_INSTR_EXTRA(instr);
g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
@@ -300,6 +302,41 @@ bool g_arch_instruction_set_flag(GArchInstruction *instr, ArchInstrFlag flag)
/******************************************************************************
* *
+* Paramètres : instr = instruction quelconque à modifier. *
+* flag = drapeau d'information complémentaire à planter. *
+* *
+* Description : Retire une information complémentaire à une instruction. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_arch_instruction_unset_flag(GArchInstruction *instr, ArchInstrFlag flag)
+{
+ bool result; /* Bilan à retourner */
+ instr_obj_extra *extra; /* Données insérées à modifier */
+
+ assert(flag <= AIF_HIGH_USER);
+
+ extra = GET_ARCH_INSTR_EXTRA(instr);
+
+ g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+
+ extra->flags &= ~flag;
+
+ result = true;
+
+ g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instruction quelconque à consulter. *
* flag = drapeau d'information à rechercher. *
* *
@@ -316,6 +353,8 @@ bool g_arch_instruction_has_flag(const GArchInstruction *instr, ArchInstrFlag fl
bool result; /* Bilan à retourner */
instr_obj_extra *extra; /* Données insérées à consulter*/
+ assert(flag <= AIF_HIGH_USER);
+
extra = GET_ARCH_INSTR_EXTRA(instr);
g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);