summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-17 22:06:54 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-17 22:06:54 (GMT)
commit3dc843b3f7991dcd738a30821ff56c7fe13f1094 (patch)
tree22b40ef7cd933a57942bd01d61c9e6a07fdd80c6 /src/arch
parent682159e73cfbf8ec61d2f2aba765be1016a30ded (diff)
Kept tracks of current active DB items.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/vmpa.c27
-rw-r--r--src/arch/vmpa.h3
2 files changed, 30 insertions, 0 deletions
diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c
index 70ea52b..bf97a37 100644
--- a/src/arch/vmpa.c
+++ b/src/arch/vmpa.c
@@ -172,6 +172,33 @@ void copy_vmpa(vmpa2t *dest, const vmpa2t *src)
/******************************************************************************
* *
+* Paramètres : addr = position à consulter. *
+* *
+* Description : Calcule une empreinte de localisation dans l'espace mémoire. *
+* *
+* Retour : Condensat déterminé pour la localisation. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+uint32_t hash_vmpa(const vmpa2t *addr)
+{
+ uint32_t result; /* Empreinte à retourner */
+
+ result = addr->physical;
+ result ^= (addr->physical >> 32);
+
+ result ^= addr->virtual;
+ result ^= (addr->virtual >> 32);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : a = première définition à analyser. *
* b = seconde définition à analyser. *
* *
diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h
index 8dfc646..66f8769 100644
--- a/src/arch/vmpa.h
+++ b/src/arch/vmpa.h
@@ -90,6 +90,9 @@ void delete_vmpa(vmpa2t *);
/* Copie la définition d'un adressage dans un autre. */
void copy_vmpa(vmpa2t *, const vmpa2t *);
+/* Calcule une empreinte de localisation dans l'espace mémoire. */
+uint32_t hash_vmpa(const vmpa2t *);
+
/* Compare entre elles deux adresses physiques. */
int cmp_vmpa_by_phy(const vmpa2t *, const vmpa2t *);