mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added compatability for 32bit ARM platforms
This commit is contained in:
parent
fb68c375e6
commit
e4b0743cf2
2 changed files with 13 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue