summaryrefslogtreecommitdiff
path: root/src/arch/vmpa.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-04 23:09:45 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-04 23:09:45 (GMT)
commitb3efd0bbc506e701ea9872f50b8b4db974f35954 (patch)
tree11926fd4d0e39321b0da171e8d926868dd618475 /src/arch/vmpa.c
parent7d6d3acb65586ad9512a38b58c16b9a21cdf98e0 (diff)
Read ELF notes when requested.
Diffstat (limited to 'src/arch/vmpa.c')
-rw-r--r--src/arch/vmpa.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c
index fe159f6..8f550fe 100644
--- a/src/arch/vmpa.c
+++ b/src/arch/vmpa.c
@@ -281,6 +281,34 @@ void deminish_vmpa(vmpa2t *addr, phys_t qty)
/******************************************************************************
* *
+* Paramètres : addr = élément à modifier. *
+* bytes = nombre d'octets sur lequel aligner la position. *
+* *
+* Description : Aligne une localisation sur un nombre d'octets donné. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void align_vmpa(vmpa2t *addr, phys_t bytes)
+{
+ if (bytes > 1)
+ {
+ if (addr->physical != VMPA_NO_PHYSICAL)
+ addr->physical = (addr->physical + bytes - 1) & ~(bytes - 1);
+
+ if (addr->virtual != VMPA_NO_VIRTUAL)
+ addr->virtual = (addr->virtual + bytes - 1) & ~(bytes - 1);
+
+ }
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : a = première élément à venir consulter. *
* b = second élément à traiter en parallèle. *
* *