diff options
Diffstat (limited to 'src/arch/operands/register-int.h')
-rw-r--r-- | src/arch/operands/register-int.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/arch/operands/register-int.h b/src/arch/operands/register-int.h index c728be7..bf3e9d4 100644 --- a/src/arch/operands/register-int.h +++ b/src/arch/operands/register-int.h @@ -29,19 +29,63 @@ #include "../operand-int.h" +#include "../../glibext/objhole.h" +/* Informations glissées dans la structure GObject de GArchInstruction */ +typedef union _regop_obj_extra +{ + struct + { + bool is_written; /* Changement de contenu */ + + }; + + gint lock; /* Gestion d'accès aux fanions */ + +} regop_obj_extra; + /* Définition d'un opérande visant un registre (instance) */ struct _GRegisterOperand { GArchOperand parent; /* Instance parente */ GArchRegister *reg; /* Registre représenté */ - bool is_written; /* Changement de 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. + */ + + regop_obj_extra extra; /* Externalisation embarquée */ + +#endif }; +/** + * Accès aux informations éventuellement déportées. + */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + +# define INIT_REG_OP_EXTRA(op) op->extra.lock = 0 + +# define GET_REG_OP_EXTRA(op) &op->extra + +#else + +# define INIT_REG_OP_EXTRA(op) INIT_GOBJECT_EXTRA(G_OBJECT(op)) + +# define GET_REG_OP_EXTRA(op) GET_GOBJECT_EXTRA(G_OBJECT(op), regop_obj_extra) + +#endif + /* Définition d'un opérande visant un registre (classe) */ struct _GRegisterOperandClass { |