Aufgrund eines Versionsupdates wird GitLab am 01.04. zwischen 9:00 und 9:30 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a version upgrade, GitLab won't be accessible at 01.04. between 9:00 and 9:30 a.m.

Commit bf060238 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

fixes for armhf and aarch64 compatability

parent 04c94c4f
......@@ -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()
......
Markdown is supported
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