stdlib/tst-strtod-overflow: Bump timeout up yet
[platform/upstream/glibc.git] / sysdeps / powerpc / powerpc32 / hp-timing.h
1 /* High precision, low overhead timing functions.  Linux/PPC32 version.
2    Copyright (C) 2005-2014 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #ifndef _HP_TIMING_H
20 #define _HP_TIMING_H    1
21
22
23 /* There are no generic definitions for the times.  We could write something
24    using the `gettimeofday' system call where available but the overhead of
25    the system call might be too high.
26
27    In case a platform supports timers in the hardware the following macros
28    and types must be defined:
29
30    - HP_TIMING_AVAIL: test for availability.
31
32    - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
33      implemented using function calls but instead uses some inlined code
34      which might simply consist of a few assembler instructions.  We have to
35      know this since we might want to use the macros here in places where we
36      cannot make function calls.
37
38    - hp_timing_t: This is the type for variables used to store the time
39      values.
40
41    - HP_TIMING_ZERO: clear `hp_timing_t' object.
42
43    - HP_TIMING_NOW: place timestamp for current time in variable given as
44      parameter.
45
46    - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
47      HP_TIMING_DIFF macro.
48
49    - HP_TIMING_DIFF: compute difference between two times and store it
50      in a third.  Source and destination might overlap.
51
52    - HP_TIMING_ACCUM: add time difference to another variable.  This might
53      be a bit more complicated to implement for some platforms as the
54      operation should be thread-safe and 64bit arithmetic on 32bit platforms
55      is not.
56
57    - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
58      there are no threads involved.
59
60    - HP_TIMING_PRINT: write decimal representation of the timing value into
61      the given string.  This operation need not be inline even though
62      HP_TIMING_INLINE is specified.
63
64 */
65
66 /* Provide dummy definitions.  */
67 #define HP_TIMING_AVAIL         (0)
68 #define HP_TIMING_INLINE        (0)
69 typedef unsigned long long int hp_timing_t;
70 #define HP_TIMING_ZERO(Var)
71 #define HP_TIMING_NOW(var)
72 #define HP_TIMING_DIFF_INIT()
73 #define HP_TIMING_DIFF(Diff, Start, End)
74 #define HP_TIMING_ACCUM(Sum, Diff)
75 #define HP_TIMING_ACCUM_NT(Sum, Diff)
76 #define HP_TIMING_PRINT(Buf, Len, Val)
77
78 /* Since this implementation is not available we tell the user about it.  */
79 #define HP_TIMING_NONAVAIL      1
80
81 #endif /* hp-timing.h */