Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes
[pandora-kernel.git] / drivers / staging / csr / csr_time.c
1 /*****************************************************************************
2
3             (c) Cambridge Silicon Radio Limited 2010
4             All rights reserved and confidential information of CSR
5
6             Refer to LICENSE.txt included with this source for details
7             on the license terms.
8
9 *****************************************************************************/
10
11 #include <linux/kernel.h>
12 #include <linux/version.h>
13 #include <linux/time.h>
14 #include <linux/module.h>
15
16 #include "csr_time.h"
17
18 CsrTime CsrTimeGet(CsrTime *high)
19 {
20         struct timespec ts;
21         u64 time;
22         CsrTime low;
23
24         ts = current_kernel_time();
25         time = (u64) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
26
27         if (high != NULL)
28                 *high = (CsrTime) ((time >> 32) & 0xFFFFFFFF);
29
30         low = (CsrTime) (time & 0xFFFFFFFF);
31
32         return low;
33 }
34 EXPORT_SYMBOL_GPL(CsrTimeGet);