summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/intelmetool/intelmetool.c4
-rw-r--r--util/intelmetool/mmap.c18
-rw-r--r--util/intelmetool/mmap.h4
3 files changed, 13 insertions, 13 deletions
diff --git a/util/intelmetool/intelmetool.c b/util/intelmetool/intelmetool.c
index aec0715212..7ffd5359b3 100644
--- a/util/intelmetool/intelmetool.c
+++ b/util/intelmetool/intelmetool.c
@@ -82,7 +82,7 @@ static void dump_me_memory() {
uint32_t me_clone = 0x60000000;
uint8_t *dump;
- dump = map_physical_exact(me_clone, me_clone, 0x2000000);
+ dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000);
zeroit(dump, 0x2000000);
printf("Send magic command for memory clone\n");
@@ -206,7 +206,7 @@ static int activate_me() {
pci_fill_info(sb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_SIZES | PCI_FILL_CLASS);
rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
- rcba = map_physical(rcba_phys, size);
+ rcba = map_physical((off_t)rcba_phys, size);
//printf("RCBA at 0x%08" PRIx32 "\n", (uint32_t)rcba_phys);
fd2 = *(uint32_t *)(rcba + FD2);
diff --git a/util/intelmetool/mmap.c b/util/intelmetool/mmap.c
index da36eaac08..041aac9c81 100644
--- a/util/intelmetool/mmap.c
+++ b/util/intelmetool/mmap.c
@@ -19,33 +19,33 @@
#ifndef __DARWIN__
int fd_mem;
-void *map_physical_exact(uint64_t phys_addr, uint64_t mapto, size_t len) {
+void *map_physical_exact(off_t phys_addr, void *mapto, size_t len) {
void *virt_addr;
int err;
- virt_addr = mmap((void*)mapto, len, PROT_WRITE | PROT_READ,
- MAP_SHARED | MAP_FIXED, fd_mem, (off_t) phys_addr);
+ virt_addr = mmap(mapto, len, PROT_WRITE | PROT_READ,
+ MAP_SHARED | MAP_FIXED, fd_mem, phys_addr);
if (virt_addr == MAP_FAILED) {
err = errno;
- printf("Error mapping physical memory 0x%016" PRIx64 "[0x%zx] ERRNO=%d\n",
- phys_addr, len, err);
+ printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d\n",
+ (intmax_t)phys_addr, len, err);
return NULL;
}
return virt_addr;
}
-void *map_physical(uint64_t phys_addr, size_t len) {
+void *map_physical(off_t phys_addr, size_t len) {
void *virt_addr;
int err;
- virt_addr = mmap(NULL, len, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, (off_t) phys_addr);
+ virt_addr = mmap(NULL, len, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, phys_addr);
if (virt_addr == MAP_FAILED) {
err = errno;
- printf("Error mapping physical memory 0x%016" PRIx64 "[0x%zx] ERRNO=%d\n",
- phys_addr, len, err);
+ printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d\n",
+ (intmax_t)phys_addr, len, err);
return NULL;
}
diff --git a/util/intelmetool/mmap.h b/util/intelmetool/mmap.h
index 109ceff498..2a7fa05308 100644
--- a/util/intelmetool/mmap.h
+++ b/util/intelmetool/mmap.h
@@ -21,7 +21,7 @@
#ifndef __DARWIN__
extern int fd_mem;
-extern void *map_physical(uint64_t phys_addr, size_t len);
+extern void *map_physical(off_t phys_addr, size_t len);
extern void unmap_physical(void *virt_addr, size_t len);
-extern void *map_physical_exact(uint64_t phys_addr, uint64_t mapto, size_t len);
+extern void *map_physical_exact(off_t phys_addr, void *mapto, size_t len);
#endif