summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/instruction-int.h18
-rw-r--r--src/arch/instruction.c32
2 files changed, 16 insertions, 34 deletions
diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h
index fcb5453..f53f2f6 100644
--- a/src/arch/instruction-int.h
+++ b/src/arch/instruction-int.h
@@ -74,24 +74,6 @@ typedef union _instr_obj_extra
} instr_obj_extra;
-/**
- * Choix du bit de verrou pour le champ "lock".
- */
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-# define INSTR_EXTRA_LOCK_BIT 31
-
-#elif __BYTE_ORDER == __BIG_ENDIAN
-
-# define INSTR_EXTRA_LOCK_BIT 0
-
-#else
-
-# error "Unknown byte order"
-
-#endif
-
/* Définition générique d'une instruction d'architecture (instance) */
struct _GArchInstruction
{
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 1090138..b9f9e29 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -287,13 +287,13 @@ bool g_arch_instruction_set_flag(GArchInstruction *instr, ArchInstrFlag flag)
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
extra->flags |= flag;
result = true;
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
return result;
@@ -322,13 +322,13 @@ bool g_arch_instruction_unset_flag(GArchInstruction *instr, ArchInstrFlag flag)
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
extra->flags &= ~flag;
result = true;
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
return result;
@@ -357,11 +357,11 @@ bool g_arch_instruction_has_flag(const GArchInstruction *instr, ArchInstrFlag fl
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
result = (extra->flags & flag);
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
return result;
@@ -387,11 +387,11 @@ ArchInstrFlag g_arch_instruction_get_flags(const GArchInstruction *instr)
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
result = extra->flags;
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
return result;
@@ -417,11 +417,11 @@ void g_arch_instruction_set_unique_id(GArchInstruction *instr, itid_t uid)
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
extra->uid = uid;
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}
@@ -445,11 +445,11 @@ itid_t g_arch_instruction_get_unique_id(const GArchInstruction *instr)
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
result = extra->uid;
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
return result;
@@ -1598,14 +1598,14 @@ static bool g_arch_instruction_unserialize(GArchInstruction *instr, GAsmStorage
{
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
result = extract_packed_buffer(pbuf, &extra->uid, sizeof(itid_t), true);
if (result)
result = extract_packed_buffer(pbuf, &extra->flags, sizeof(ArchInstrFlag), true);
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}
@@ -1780,14 +1780,14 @@ static bool g_arch_instruction_serialize(GArchInstruction *instr, GAsmStorage *s
{
extra = GET_ARCH_INSTR_EXTRA(instr);
- g_bit_lock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
result = extend_packed_buffer(pbuf, &extra->uid, sizeof(itid_t), true);
if (result)
result = extend_packed_buffer(pbuf, &extra->flags, sizeof(ArchInstrFlag), true);
- g_bit_unlock(&extra->lock, INSTR_EXTRA_LOCK_BIT);
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}