annotate bfin/timer.h @ 1011:ec22b0df8cf6 libavutil

Cache detected CPU flags
author mru
date Thu, 09 Sep 2010 18:51:49 +0000
parents fa8c9944568f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
718
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
1 /*
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
2 * Copyright (C) 2007 Marc Hoffman
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
3 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
4 * This file is part of FFmpeg.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
5 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
10 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
14 * Lesser General Public License for more details.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
15 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
19 */
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
20
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
21 #ifndef AVUTIL_BFIN_TIMER_H
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
22 #define AVUTIL_BFIN_TIMER_H
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
23
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
24 #include <stdint.h>
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
25
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
26 #define AV_READ_TIME read_time
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
27
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
28 static inline uint64_t read_time(void)
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
29 {
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
30 union {
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
31 struct {
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
32 unsigned lo;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
33 unsigned hi;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
34 } p;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
35 unsigned long long c;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
36 } t;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
37 __asm__ volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi));
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
38 return t.c;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
39 }
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
40
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
41 #endif /* AVUTIL_BFIN_TIMER_H */