summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/vmpa.c14
-rw-r--r--src/arch/vmpa.h3
2 files changed, 8 insertions, 9 deletions
diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c
index e2da876..25b01c3 100644
--- a/src/arch/vmpa.c
+++ b/src/arch/vmpa.c
@@ -299,10 +299,10 @@ phys_t compute_vmpa_diff(const vmpa2t *a, const vmpa2t *b)
result = VMPA_NO_PHYSICAL;
if (a->physical != VMPA_NO_PHYSICAL && b->physical != VMPA_NO_PHYSICAL)
- result = (b->physical > a->physical ? b->physical - a->physical : a->physical- b->physical);
+ result = (b->physical > a->physical ? b->physical - a->physical : a->physical - b->physical);
else if (a->virtual != VMPA_NO_VIRTUAL && b->virtual != VMPA_NO_VIRTUAL)
- result = (phys_t)(b->virtual > a->virtual ? b->virtual - a->virtual : a->virtual- b->virtual);
+ result = (phys_t)(b->virtual > a->virtual ? b->virtual - a->virtual : a->virtual - b->virtual);
return result;
@@ -398,23 +398,23 @@ static char *_phys_t_to_string(phys_t phys, MemoryDataSize msize, char buffer[VM
switch (msize)
{
case MDS_8_BITS:
- ret = snprintf(buffer, VMPA_MAX_LEN,"0x%02" PRIx64, (uint64_t)phys);
+ ret = snprintf(buffer, VMPA_MAX_LEN,"0x%02" PRIx64, phys);
break;
case MDS_16_BITS:
- ret = snprintf(buffer, VMPA_MAX_LEN, "0x%04" PRIx64, (uint64_t)phys);
+ ret = snprintf(buffer, VMPA_MAX_LEN, "0x%04" PRIx64, phys);
break;
case MDS_32_BITS:
- ret = snprintf(buffer, VMPA_MAX_LEN, "0x%08" PRIx64, (uint64_t)phys);
+ ret = snprintf(buffer, VMPA_MAX_LEN, "0x%08" PRIx64, phys);
break;
case MDS_64_BITS:
- ret = snprintf(buffer, VMPA_MAX_LEN, "0x%016" PRIx64, (uint64_t)phys);
+ ret = snprintf(buffer, VMPA_MAX_LEN, "0x%016" PRIx64, phys);
break;
default:
- ret = snprintf(buffer, VMPA_MAX_LEN, "0x%" PRIx64, (uint64_t)phys);
+ ret = snprintf(buffer, VMPA_MAX_LEN, "0x%" PRIx64, phys);
break;
}
diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h
index eb63324..cfb9ab5 100644
--- a/src/arch/vmpa.h
+++ b/src/arch/vmpa.h
@@ -29,7 +29,6 @@
#include <malloc.h>
#include <stdbool.h>
#include <stdint.h>
-#include <sys/types.h>
#include "archbase.h"
@@ -49,7 +48,7 @@
/* Types pour respectivement une position physique et une adresse virtuelle */
-#define phys_t off_t
+#define phys_t uint64_t
#define virt_t uint64_t
/* Equivalents pour GLib */