summaryrefslogtreecommitdiff
path: root/src/arch/operand-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/operand-int.h')
-rw-r--r--src/arch/operand-int.h50
1 files changed, 46 insertions, 4 deletions
diff --git a/src/arch/operand-int.h b/src/arch/operand-int.h
index ca5204c..c348654 100644
--- a/src/arch/operand-int.h
+++ b/src/arch/operand-int.h
@@ -26,11 +26,12 @@
#include "operand.h"
+#include "../glibext/objhole.h"
/* Compare un opérande avec un autre. */
-typedef int (* operand_compare_fc) (const GArchOperand *, const GArchOperand *);
+typedef int (* operand_compare_fc) (const GArchOperand *, const GArchOperand *, bool);
/* Détermine le chemin conduisant à un opérande interne. */
typedef char * (* find_inner_operand_fc) (const GArchOperand *, const GArchOperand *);
@@ -51,7 +52,7 @@ typedef GArchOperand ** (* operand_list_inners_fc) (const GArchOperand *, size_t
typedef void (* operand_update_inners_fc) (GArchOperand *, GArchOperand **, size_t);
/* Fournit l'empreinte d'un candidat à une centralisation. */
-typedef guint (* operand_hash_fc) (const GArchOperand *);
+typedef guint (* operand_hash_fc) (const GArchOperand *, bool);
/* Charge un opérande depuis une mémoire tampon. */
typedef bool (* unserialize_operand_fc) (GArchOperand *, GAsmStorage *, GBinFormat *, packed_buffer_t *);
@@ -60,15 +61,41 @@ typedef bool (* unserialize_operand_fc) (GArchOperand *, GAsmStorage *, GBinForm
typedef bool (* serialize_operand_fc) (const GArchOperand *, GAsmStorage *, packed_buffer_t *);
+/* Informations glissées dans la structure GObject de GArchOperand */
+typedef struct _operand_extra_data_t
+{
+ ArchOperandFlag flags; /* Informations diverses */
+
+} operand_extra_data_t;
+
+/* Encapsulation avec un verrou d'accès */
+typedef union _operand_obj_extra_t
+{
+ operand_extra_data_t data; /* Données embarquées */
+ lockable_obj_extra_t lockable; /* Gestion d'accès aux fanions */
+
+} operand_obj_extra_t;
+
+
/* Définition générique d'un opérande d'architecture (instance) */
struct _GArchOperand
{
GObject parent; /* A laisser en premier */
- bool read_only; /* Verrouillage du contenu */
+#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.
+ */
+ operand_obj_extra_t extra; /* Externalisation embarquée */
+
+#endif
+
+};
/* Définition générique d'un opérande d'architecture (classe) */
struct _GArchOperandClass
@@ -92,5 +119,20 @@ struct _GArchOperandClass
};
+/**
+ * Accès aux informations éventuellement déportées.
+ */
+
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+# define GET_ARCH_OP_EXTRA(op) (operand_extra_data_t *)&op->extra
+
+#else
+
+# define GET_ARCH_OP_EXTRA(op) GET_GOBJECT_EXTRA(G_OBJECT(op), operand_extra_data_t)
+
+#endif
+
+
#endif /* _ARCH_OPERAND_INT_H */