diff options
Diffstat (limited to 'src/arch/operands/target.c')
-rw-r--r-- | src/arch/operands/target.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/src/arch/operands/target.c b/src/arch/operands/target.c index 6450834..068d060 100644 --- a/src/arch/operands/target.c +++ b/src/arch/operands/target.c @@ -45,6 +45,9 @@ +/* ------------------------- POINTAGE D'UN SYMBOLE EXISTANT ------------------------- */ + + /* Initialise la classe des opérandes ciblant des symboles. */ static void g_target_operand_class_init(GTargetOperandClass *); @@ -60,6 +63,11 @@ static void g_target_operand_dispose(GTargetOperand *); /* Procède à la libération totale de la mémoire. */ static void g_target_operand_finalize(GTargetOperand *); + + +/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */ + + /* Compare un opérande avec un autre. */ static int g_target_operand_compare(const GTargetOperand *, const GTargetOperand *, bool); @@ -72,16 +80,11 @@ static char *g_target_operand_build_tooltip(const GTargetOperand *, const GLoade /* Fournit l'empreinte d'un candidat à une centralisation. */ static guint g_target_operand_hash(const GTargetOperand *, bool); +/* Charge un contenu depuis une mémoire tampon. */ +static bool g_target_operand_load(GTargetOperand *, GObjectStorage *, packed_buffer_t *); - -/* --------------------- TRANSPOSITIONS VIA CACHE DES OPERANDES --------------------- */ - - -/* Charge un opérande depuis une mémoire tampon. */ -static bool g_target_operand_unserialize(GTargetOperand *, GAsmStorage *, GBinFormat *, packed_buffer_t *); - -/* Sauvegarde un opérande dans une mémoire tampon. */ -static bool g_target_operand_serialize(const GTargetOperand *, GAsmStorage *, packed_buffer_t *); +/* Sauvegarde un contenu dans une mémoire tampon. */ +static bool g_target_operand_store(GTargetOperand *, GObjectStorage *, packed_buffer_t *); @@ -93,6 +96,11 @@ static bool g_target_operand_get_addr(const GTargetOperand *, const vmpa2t *, GB +/* ---------------------------------------------------------------------------------- */ +/* POINTAGE D'UN SYMBOLE EXISTANT */ +/* ---------------------------------------------------------------------------------- */ + + /* Indique le type défini pour un opérande de valeur numérique. */ G_DEFINE_TYPE_WITH_CODE(GTargetOperand, g_target_operand, G_TYPE_ARCH_OPERAND, G_IMPLEMENT_INTERFACE(G_TYPE_TARGETABLE_OPERAND, g_target_operand_targetable_interface_init)); @@ -128,8 +136,8 @@ static void g_target_operand_class_init(GTargetOperandClass *klass) operand->hash = (operand_hash_fc)g_target_operand_hash; - operand->unserialize = (unserialize_operand_fc)g_target_operand_unserialize; - operand->serialize = (serialize_operand_fc)g_target_operand_serialize; + operand->load = (load_operand_fc)g_target_operand_load; + operand->store = (store_operand_fc)g_target_operand_store; } @@ -636,20 +644,13 @@ static guint g_target_operand_hash(const GTargetOperand *operand, bool lock) } - -/* ---------------------------------------------------------------------------------- */ -/* TRANSPOSITIONS VIA CACHE DES OPERANDES */ -/* ---------------------------------------------------------------------------------- */ - - /****************************************************************************** * * -* Paramètres : operand = opérande d'assemblage à constituer. * -* storage = mécanisme de sauvegarde à manipuler. * -* format = format binaire chargé associé à l'architecture. * -* pbuf = zone tampon à remplir. * +* Paramètres : operand = élément GLib à constuire. * +* storage = conservateur de données à manipuler ou NULL. * +* pbuf = zone tampon à lire. * * * -* Description : Charge un opérande depuis une mémoire tampon. * +* Description : Charge un contenu depuis une mémoire tampon. * * * * Retour : Bilan de l'opération. * * * @@ -657,7 +658,7 @@ static guint g_target_operand_hash(const GTargetOperand *operand, bool lock) * * ******************************************************************************/ -static bool g_target_operand_unserialize(GTargetOperand *operand, GAsmStorage *storage, GBinFormat *format, packed_buffer_t *pbuf) +static bool g_target_operand_load(GTargetOperand *operand, GObjectStorage *storage, packed_buffer_t *pbuf) { bool result; /* Bilan à retourner */ @@ -684,11 +685,11 @@ static bool g_target_operand_unserialize(GTargetOperand *operand, GAsmStorage *s /****************************************************************************** * * -* Paramètres : operand = opérande d'assemblage à consulter. * -* storage = mécanisme de sauvegarde à manipuler. * +* Paramètres : operand = élément GLib à consulter. * +* storage = conservateur de données à manipuler ou NULL. * * pbuf = zone tampon à remplir. * * * -* Description : Sauvegarde un opérande dans une mémoire tampon. * +* Description : Sauvegarde un contenu dans une mémoire tampon. * * * * Retour : Bilan de l'opération. * * * @@ -696,7 +697,7 @@ static bool g_target_operand_unserialize(GTargetOperand *operand, GAsmStorage *s * * ******************************************************************************/ -static bool g_target_operand_serialize(const GTargetOperand *operand, GAsmStorage *storage, packed_buffer_t *pbuf) +static bool g_target_operand_store(GTargetOperand *operand, GObjectStorage *storage, packed_buffer_t *pbuf) { bool result; /* Bilan à retourner */ MemoryDataSize size; /* Taille retenue */ @@ -714,7 +715,7 @@ static bool g_target_operand_serialize(const GTargetOperand *operand, GAsmStorag else original = g_imm_operand_new_from_value(size, get_phy_addr(&operand->addr)); - result = g_arch_operand_store(original, storage, pbuf); + result = g_object_storage_pack_object(storage, "operands", G_SERIALIZABLE_OBJECT(original), pbuf); g_object_unref(G_OBJECT(original)); |