Commit cdc7ebb0 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

added compatability for 32bit ARM platforms

parent 5bc740e5
......@@ -24,6 +24,11 @@
#define _DEFAULT_SOURCE
#ifdef __arm__
#define _LARGEFILE64_SOURCE 1
#define _FILE_OFFSET_BITS 64
#endif
#include <algorithm>
#include <string>
#include <sstream>
......@@ -476,10 +481,15 @@ VfioDevice::regionMap(size_t index)
if (!(r->flags & VFIO_REGION_INFO_FLAG_MMAP))
return MAP_FAILED;
int flags = MAP_SHARED;
#ifndef __arm__
flags |= MAP_SHARED;
#endif
mappings[index] = mmap(nullptr, r->size,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_32BIT,
fd, r->offset);
flags, fd, r->offset);
return mappings[index];
}
......
......@@ -39,7 +39,7 @@ HostRam::HostRamAllocator::allocateBlock(size_t size)
size &= size_t(~0xFFF);
}
#ifdef __linux__
#if defined(__linux__) && !defined(__arm__)
const int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT;
#else
const int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment