summaryrefslogtreecommitdiff
path: root/src/arch/instruction-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/instruction-int.h')
-rw-r--r--src/arch/instruction-int.h80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h
index 6a3ccea..9a23bf2 100644
--- a/src/arch/instruction-int.h
+++ b/src/arch/instruction-int.h
@@ -59,26 +59,42 @@ typedef GBufferLine * (* print_instruction_fc) (const GArchInstruction *, GBuffe
typedef void (* get_instruction_rw_regs_fc) (const GArchInstruction *, GArchRegister ***, size_t *, GArchRegister ***, size_t *);
-/* Informations glissées dans la structure GObject de GArchInstruction */
-typedef union _instr_obj_extra
+/* Informations glissées dans la structure GObject de GArchOperand */
+typedef struct _instr_extra_data_t
{
- struct
- {
- itid_t uid; /* Identifiant unique du type */
+ itid_t uid; /* Identifiant unique du type */
+
+ ArchInstrFlag flags; /* Informations complémentaires*/
- ArchInstrFlag flags; /* Informations complémentaires*/
+} instr_extra_data_t;
- };
+/* Informations glissées dans la structure GObject de GArchInstruction */
+typedef union _instr_obj_extra_t
+{
+ instr_extra_data_t data; /* Données embarquées */
+ lockable_obj_extra_t lockable; /* Gestion d'accès aux fanions */
- gint lock; /* Gestion d'accès aux fanions */
+} instr_obj_extra_t;
-} instr_obj_extra;
/* Définition générique d'une instruction d'architecture (instance) */
struct _GArchInstruction
{
GObject parent; /* A laisser en premier */
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+ /**
+ * L'inclusion des informations suivantes dépend de l'architecture.
+ *
+ * Si la structure GObject possède un trou, on remplit de préférence
+ * ce dernier.
+ */
+
+ instr_obj_extra_t extra; /* Externalisation embarquée */
+
+#endif
+
mrange_t range; /* Emplacement en mémoire */
flat_array_t *operands; /* Liste des opérandes */
@@ -108,39 +124,8 @@ struct _GArchInstruction
flat_array_t *from; /* Origines des références */
flat_array_t *to; /* Instructions visées */
-#if __SIZEOF_INT__ == __SIZEOF_LONG__
-
- /**
- * L'inclusion des informations suivantes dépend de l'architecture.
- *
- * Si la structure GObject possède un trou, on remplit de préférence
- * ce dernier.
- */
-
- instr_obj_extra extra; /* Externalisation embarquée */
-
-#endif
-
};
-/**
- * Accès aux informations éventuellement déportées.
- */
-
-#if __SIZEOF_INT__ == __SIZEOF_LONG__
-
-# define INIT_ARCH_INSTR_EXTRA(ins) ins->extra.lock = 0
-
-# define GET_ARCH_INSTR_EXTRA(ins) &ins->extra
-
-#else
-
-# define INIT_ARCH_INSTR_EXTRA(ins) INIT_GOBJECT_EXTRA(G_OBJECT(ins))
-
-# define GET_ARCH_INSTR_EXTRA(ins) GET_GOBJECT_EXTRA(G_OBJECT(ins), instr_obj_extra)
-
-#endif
-
/* Définition générique d'une instruction d'architecture (classe) */
struct _GArchInstructionClass
{
@@ -163,6 +148,21 @@ struct _GArchInstructionClass
/**
+ * Accès aux informations éventuellement déportées.
+ */
+
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+# define GET_ARCH_INSTR_EXTRA(ins) (instr_extra_data_t *)&ins->extra
+
+#else
+
+# define GET_ARCH_INSTR_EXTRA(ins) GET_GOBJECT_EXTRA(G_OBJECT(ins), instr_extra_data_t)
+
+#endif
+
+
+/**
* Fournit une marge pour toutes les instructions particulières communes
* à l'ensemble des architectures (GRawInstruction, GUndefInstruction).
*/