2012-06-19 17:15:42 -06:00
|
|
|
/*****************************************************************************
|
|
|
|
|
2013-03-01 18:45:17 -07:00
|
|
|
(c) Cambridge Silicon Radio Limited 2010
|
|
|
|
All rights reserved and confidential information of CSR
|
2012-06-19 17:15:42 -06:00
|
|
|
|
2013-03-01 18:45:17 -07:00
|
|
|
Refer to LICENSE.txt included with this source for details
|
|
|
|
on the license terms.
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/time.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
|
|
|
#include "csr_time.h"
|
|
|
|
|
2012-10-24 00:33:57 -06:00
|
|
|
u32 CsrTimeGet(u32 *high)
|
2012-06-19 17:15:42 -06:00
|
|
|
{
|
2012-07-21 01:20:32 -06:00
|
|
|
struct timespec ts;
|
|
|
|
u64 time;
|
2012-10-24 00:33:57 -06:00
|
|
|
u32 low;
|
2012-06-19 17:15:42 -06:00
|
|
|
|
2012-07-21 01:20:32 -06:00
|
|
|
ts = current_kernel_time();
|
|
|
|
time = (u64) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
|
2012-06-19 17:15:42 -06:00
|
|
|
|
2012-07-21 01:20:32 -06:00
|
|
|
if (high != NULL)
|
2012-10-24 00:33:57 -06:00
|
|
|
*high = (u32) ((time >> 32) & 0xFFFFFFFF);
|
2012-06-19 17:15:42 -06:00
|
|
|
|
2012-10-24 00:33:57 -06:00
|
|
|
low = (u32) (time & 0xFFFFFFFF);
|
2012-06-19 17:15:42 -06:00
|
|
|
|
2012-07-21 01:20:32 -06:00
|
|
|
return low;
|
2012-06-19 17:15:42 -06:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(CsrTimeGet);
|