Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
csr_time.c
Go to the documentation of this file.
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 
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 }