mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixes for armhf and aarch64 compatability
This commit is contained in:
parent
a59584dcf9
commit
4b54fec2ab
6 changed files with 10 additions and 16 deletions
|
@ -56,7 +56,7 @@
|
|||
#define LOG_HEIGHT 25
|
||||
|
||||
/* Hard-coded cache line size */
|
||||
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
|
||||
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
|
||||
#define CACHELINE_SIZE 64
|
||||
#else
|
||||
#error "Unsupported architecture"
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#if !(__x86_64__ || __i386__)
|
||||
#error this header is for x86 only
|
||||
#endif
|
||||
|
||||
#include <cpuid.h>
|
||||
#include <cinttypes>
|
||||
|
||||
|
@ -40,10 +44,6 @@
|
|||
#define bit_TSC_INVARIANT (1 << 8)
|
||||
#define bit_RDTSCP (1 << 27)
|
||||
|
||||
#if !(__x86_64__ || __i386__)
|
||||
#error this header is for x86 only
|
||||
#endif
|
||||
|
||||
struct tsc {
|
||||
uint64_t frequency;
|
||||
|
||||
|
|
|
@ -49,13 +49,7 @@ add_library(villas-common SHARED
|
|||
popen.cpp
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND uname -m
|
||||
COMMAND tr -d '\n'
|
||||
OUTPUT_VARIABLE ARCH
|
||||
)
|
||||
|
||||
if(ARCH STREQUAL "x86_64")
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
target_sources(villas-common PRIVATE tsc.cpp)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
|
||||
#ifdef __arm__
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
#define _LARGEFILE64_SOURCE 1
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
@ -491,7 +491,7 @@ VfioDevice::regionMap(size_t index)
|
|||
|
||||
int flags = MAP_SHARED;
|
||||
|
||||
#ifndef __arm__
|
||||
#if !(defined(__arm__) || defined(__aarch64__))
|
||||
flags |= MAP_SHARED;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ HostRam::HostRamAllocator::allocateBlock(size_t size)
|
|||
size &= size_t(~0xFFF);
|
||||
}
|
||||
|
||||
#if defined(__linux__) && !defined(__arm__)
|
||||
#if defined(__linux__) && !(defined(__arm__) || defined(__aarch64__))
|
||||
const int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT;
|
||||
#else
|
||||
const int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
|
||||
|
|
|
@ -34,7 +34,7 @@ add_executable(unit-tests-common
|
|||
popen.cpp
|
||||
)
|
||||
|
||||
if(ARCH STREQUAL "x86_64")
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
list(APPEND TEST_SRC tsc.cpp)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue