summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-01-02 22:09:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-01-02 22:09:09 (GMT)
commit2f0c162313fa7272bfec7eb674b71e5e15c4ec7c (patch)
treeee6b7b25ebd83b709cb7644edb660f94d38e0f1f /src/arch
parent836e4ca6053594ceba7b78b8407d8a1f03491cd2 (diff)
Unlinked instructions to save memory.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/instruction-int.h10
-rw-r--r--src/arch/instruction.c139
-rw-r--r--src/arch/instruction.h21
3 files changed, 0 insertions, 170 deletions
diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h
index 8679589..2d829c0 100644
--- a/src/arch/instruction-int.h
+++ b/src/arch/instruction-int.h
@@ -52,8 +52,6 @@ struct _GArchInstruction
{
GObject parent; /* A laisser en premier */
- DL_LIST_ITEM(flow); /* Maillon de liste chaînée */
-
phys_t max_displayed_len; /* Quantité de code affichée */
const instr_hook_fc *hooks; /* Traitements complémentaires */
@@ -96,13 +94,5 @@ struct _GArchInstructionClass
};
-#define ainstr_list_last(head) dl_list_last(head, GArchInstruction, flow)
-#define ainstr_list_prev_iter(iter, head) dl_list_prev_iter(iter, head, GArchInstruction, flow)
-#define ainstr_list_next_iter(iter, head) dl_list_next_iter(iter, head, GArchInstruction, flow)
-#define ainstr_list_add_tail(new, head) dl_list_add_tail(new, head, GArchInstruction, flow)
-#define ainstr_list_merge(head1, head2) dl_list_merge(head1, head2, GArchInstruction, flow)
-#define ainstr_list_for_each(pos, head) dl_list_for_each(pos, head, GArchInstruction, flow)
-
-
#endif /* _ARCH_INSTRUCTION_INT_H */
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 70b2819..db37bf7 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -122,8 +122,6 @@ static void g_arch_instruction_class_init(GArchInstructionClass *klass)
static void g_arch_instruction_init(GArchInstruction *instr)
{
- DL_LIST_ITEM_INIT(&instr->flow);
-
instr->max_displayed_len = VMPA_NO_PHYSICAL;
g_rw_lock_init(&instr->link_access);
@@ -942,143 +940,6 @@ void g_arch_instruction_set_displayed_max_length(GArchInstruction *instr, phys_t
/* ---------------------------------------------------------------------------------- */
-/* TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à compléter, ou NULL. *
-* instr = nouvelle instruction à intégrer à l'ensemble. *
-* *
-* Description : Ajoute une instruction à un ensemble existant. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_arch_instruction_add_to_list(GArchInstruction **list, GArchInstruction *instr)
-{
- ainstr_list_add_tail(instr, list);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list1 = première liste à traiter. *
-* list2 = seconde liste à traiter. *
-* *
-* Description : Fusionne deux listes d'instructions. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_arch_instruction_merge_lists(GArchInstruction **list1, GArchInstruction **list2)
-{
- ainstr_list_merge(list1, list2);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à consulter. *
-* : iter = position actuelle dans la liste. *
-* *
-* Description : Fournit l'élement suivant un autre pour un parcours. *
-* *
-* Retour : Elément suivant ou NULL si aucun. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *g_arch_instruction_get_prev_iter(const GArchInstruction *list, const GArchInstruction *iter)
-{
- GArchInstruction *result; /* Elément suivant à renvoyer */
-
- result = ainstr_list_prev_iter(iter, list);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à consulter. *
-* : iter = position actuelle dans la liste. *
-* max = adresse marquant la limite (exclue) du parcours. *
-* *
-* Description : Fournit l'élement suivant un autre pour un parcours. *
-* *
-* Retour : Elément suivant ou NULL si aucun. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *g_arch_instruction_get_next_iter(const GArchInstruction *list, const GArchInstruction *iter, vmpa_t max)
-{
- GArchInstruction *result; /* Elément suivant à renvoyer */
-
- result = ainstr_list_next_iter(iter, list);
-
- /* FIXME : utiliser les nouvelles adresses !
-
- if (result != NULL && result->address >= max)
- result = NULL;
-
- */
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste de lignes à parcourir. *
-* addr = position en mémoire ou physique à chercher. *
-* strict = définit la considération à porter à l'adresse. *
-* *
-* Description : Recherche une instruction d'après son adresse. *
-* *
-* Retour : Instruction trouvée à l'adresse donnée, NULL si aucune. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *g_arch_instruction_find_by_address(GArchInstruction *list, const vmpa2t *addr, bool strict)
-{
- GArchInstruction *result; /* Trouvaille à retourner */
- bool found; /* Bilan de comparaisons */
-
- ainstr_list_for_each(result, list)
- {
- if (strict)
- found = (cmp_vmpa(get_mrange_addr(&result->range), addr) == 0);
- else
- found = mrange_contains_addr(&result->range, addr);
-
- if (found) break;
-
- }
-
- return result;
-
-}
-
-
-
-/* ---------------------------------------------------------------------------------- */
/* OFFRE DE CAPACITES DE GENERATION */
/* ---------------------------------------------------------------------------------- */
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index 6c88e66..ffebaf3 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -223,25 +223,4 @@ void g_arch_instruction_set_displayed_max_length(GArchInstruction *, phys_t);
-/* -------------------- TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE -------------------- */
-
-
-/* Ajoute une instruction à un ensemble existant. */
-void g_arch_instruction_add_to_list(GArchInstruction **, GArchInstruction *);
-
-/* Fusionne deux listes d'instructions. */
-void g_arch_instruction_merge_lists(GArchInstruction **, GArchInstruction **);
-
-/* Fournit l'élement suivant un autre pour un parcours. */
-GArchInstruction *g_arch_instruction_get_prev_iter(const GArchInstruction *, const GArchInstruction *);
-
-/* Fournit l'élement suivant un autre pour un parcours. */
-GArchInstruction *g_arch_instruction_get_next_iter(const GArchInstruction *, const GArchInstruction *, vmpa_t);
-
-/* Recherche une instruction d'après son adresse. */
-GArchInstruction *g_arch_instruction_find_by_address(GArchInstruction *, const vmpa2t *, bool) __attribute__ ((deprecated));
-/* -> g_arch_processor_find_instr_by_address */
-
-
-
#endif /* _ARCH_INSTRUCTION_H */