summaryrefslogtreecommitdiff
path: root/src/arch/instruction.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
commit59f319d9a6961a7424c7b32f49aa7ac1045a1d4c (patch)
treee9d62c684dd8d8f5e141b9332994041bd2371f9a /src/arch/instruction.h
parent8962a4e61411c8362d5f4be63496977164b886a8 (diff)
Protected all concurrent accesses to sources and destinations of instructions.
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r--src/arch/instruction.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index 95d2e22..f26a240 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -189,12 +189,30 @@ void g_arch_instruction_link_with(GArchInstruction *, GArchInstruction *, Instru
/* Change la nature d'un lien entre deux instructions. */
bool g_arch_instruction_change_link(GArchInstruction *, GArchInstruction *, InstructionLinkType, InstructionLinkType);
+/* Met à disposition un encadrement des accès aux sources. */
+void g_arch_instruction_lock_unlock_sources(GArchInstruction *, bool, bool);
+
+#define g_arch_instruction_wlock_src(ins) g_arch_instruction_lock_unlock_sources(ins, true, true)
+#define g_arch_instruction_wunlock_src(ins) g_arch_instruction_lock_unlock_sources(ins, true, false)
+
+#define g_arch_instruction_rlock_src(ins) g_arch_instruction_lock_unlock_sources(ins, false, true)
+#define g_arch_instruction_runlock_src(ins) g_arch_instruction_lock_unlock_sources(ins, false, false)
+
/* Indique si l'instruction a une ou plusieurs origines. */
bool g_arch_instruction_has_sources(const GArchInstruction *);
/* Fournit les origines d'une instruction donnée. */
size_t g_arch_instruction_get_sources(const GArchInstruction *, GArchInstruction ***, InstructionLinkType **);
+/* Met à disposition un encadrement des accès aux destinations. */
+void g_arch_instruction_lock_unlock_destinations(GArchInstruction *, bool, bool);
+
+#define g_arch_instruction_wlock_dest(ins) g_arch_instruction_lock_unlock_destinations(ins, true, true)
+#define g_arch_instruction_wunlock_dest(ins) g_arch_instruction_lock_unlock_destinations(ins, true, false)
+
+#define g_arch_instruction_rlock_dest(ins) g_arch_instruction_lock_unlock_destinations(ins, false, true)
+#define g_arch_instruction_runlock_dest(ins) g_arch_instruction_lock_unlock_destinations(ins, false, false)
+
/* Indique si l'instruction a une suite autre que la suivante. */
bool g_arch_instruction_has_destinations(const GArchInstruction *);