Browse Source

arm/aarch64: Use mach_absolute_time as timer on apple platforms

This is much less precise than the cycle counter register, but
the cycle counter register is not available on apple platforms
(and on linux, it requires a kernel module for allowing user mode
access).

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n4.4
Martin Storsjö 4 years ago
parent
commit
ee040a7fc2
2 changed files with 14 additions and 2 deletions
  1. +7
    -1
      libavutil/aarch64/timer.h
  2. +7
    -1
      libavutil/arm/timer.h

+ 7
- 1
libavutil/aarch64/timer.h View File

@@ -24,7 +24,13 @@
#include <stdint.h>
#include "config.h"

#if HAVE_INLINE_ASM
#if defined(__APPLE__)

#include <mach/mach_time.h>

#define AV_READ_TIME mach_absolute_time

#elif HAVE_INLINE_ASM

#define AV_READ_TIME read_time



+ 7
- 1
libavutil/arm/timer.h View File

@@ -24,7 +24,13 @@
#include <stdint.h>
#include "config.h"

#if HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
#if defined(__APPLE__)

#include <mach/mach_time.h>

#define AV_READ_TIME mach_absolute_time

#elif HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)

#define AV_READ_TIME read_time



Loading…
Cancel
Save