3 /*****************************************************************************
5 (c) Cambridge Silicon Radio Limited 2010
6 All rights reserved and confidential information of CSR
8 Refer to LICENSE.txt included with this source for details
11 *****************************************************************************/
13 #include <linux/types.h>
15 /*******************************************************************************
21 Returns the current system time in a low and a high part. The low part
22 is expressed in microseconds. The high part is incremented when the low
23 part wraps to provide an extended range.
25 The caller may provide a NULL pointer as the high parameter.
26 In this case the function just returns the low part and ignores the
29 Although the time is expressed in microseconds the actual resolution is
30 platform dependent and can be less. It is recommended that the
31 resolution is at least 10 milliseconds.
34 high - Pointer to variable that will receive the high part of the
35 current system time. Passing NULL is valid.
38 Low part of current system time in microseconds.
40 *******************************************************************************/
41 u32 CsrTimeGet(u32 *high);
44 /*------------------------------------------------------------------*/
46 /*------------------------------------------------------------------*/
48 /*----------------------------------------------------------------------------*
53 * Add two time values. Adding the numbers can overflow the range of a
54 * CsrTime, so the user must be cautious.
57 * CsrTime - the sum of "t1" and "t2".
59 *----------------------------------------------------------------------------*/
60 #define CsrTimeAdd(t1, t2) ((t1) + (t2))
62 /*----------------------------------------------------------------------------*
67 * Subtract two time values. Subtracting the numbers can provoke an
68 * underflow, so the user must be cautious.
71 * CsrTime - "t1" - "t2".
73 *----------------------------------------------------------------------------*/
74 #define CsrTimeSub(t1, t2) ((s32) (t1) - (s32) (t2))