[FFmpeg-devel] [PATCH] read_time() for SPARC

Måns Rullgård mans
Tue Sep 7 23:21:56 CEST 2010


Michael Kostylev <michael.kostylev at gmail.com> writes:

> The attached patch provides access to a 63-bit tick counter which is
> available on the v9 cpus in the manner compatible with the v8+ abi.
>
> +#ifndef AVUTIL_SPARC_TIMER_H
> +#define AVUTIL_SPARC_TIMER_H
> +
> +#ifdef __sparc_v9__
> +
> +#include <stdint.h>
> +
> +#define AV_READ_TIME read_time
> +
> +static inline uint64_t read_time(void)
> +{
> +    uint64_t tc;
> +    __asm__ volatile("rd %%tick,%%g1\n\t"
> +                     "stx %%g1,%0\n\t"
> +                     : "=m" (tc) :: "g1");
> +    return tc;
> +}

Why can't you read the counter directly to whatever register 'tc'
lives in?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list