summaryrefslogtreecommitdiff
path: root/src/arch/instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r--src/arch/instruction.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index 00e64ab..fed88a3 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -174,6 +174,17 @@ typedef enum _InstructionLinkType
} InstructionLinkType;
+/* Déscription d'une liaison entre deux instructions */
+typedef struct _instr_link_t
+{
+ GArchInstruction *linked; /* Autre instruction liée */
+ InstructionLinkType type; /* Type de liaison */
+
+} instr_link_t;
+
+
+/* Met à disposition un encadrement des accès aux liens. */
+void g_arch_instruction_lock_unlock_links(GArchInstruction *, bool, bool);
/* Etablit un lien entre deux instructions. */
void g_arch_instruction_link_with(GArchInstruction *, GArchInstruction *, InstructionLinkType);
@@ -181,35 +192,29 @@ 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_wlock_src(ins) g_arch_instruction_lock_unlock_links(ins, true, true)
+#define g_arch_instruction_wunlock_src(ins) g_arch_instruction_lock_unlock_links(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)
+#define g_arch_instruction_rlock_src(ins) g_arch_instruction_lock_unlock_links(ins, false, true)
+#define g_arch_instruction_runlock_src(ins) g_arch_instruction_lock_unlock_links(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);
+size_t g_arch_instruction_get_sources(const GArchInstruction *, instr_link_t **);
-#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_wlock_dest(ins) g_arch_instruction_lock_unlock_links(ins, true, true)
+#define g_arch_instruction_wunlock_dest(ins) g_arch_instruction_lock_unlock_links(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)
+#define g_arch_instruction_rlock_dest(ins) g_arch_instruction_lock_unlock_links(ins, false, true)
+#define g_arch_instruction_runlock_dest(ins) g_arch_instruction_lock_unlock_links(ins, false, false)
/* Indique si l'instruction a une suite autre que la suivante. */
bool g_arch_instruction_has_destinations(const GArchInstruction *);
/* Fournit les destinations d'une instruction donnée. */
-size_t g_arch_instruction_get_destinations(const GArchInstruction *, GArchInstruction ***, InstructionLinkType **);
+size_t g_arch_instruction_get_destinations(const GArchInstruction *, instr_link_t **);
/* Fournit la destination d'une instruction et d'un type donné. */
GArchInstruction *g_arch_instruction_get_given_destination(const GArchInstruction *, InstructionLinkType);