1/*
2 * bcmseclib_nucleus_timer.c -- nucleus platform dependent timer stuff
3 *
4 * Copyright (C) 2014, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
11 *
12 * $Id: bcmseclib_nucleus_timer.c,v 1.1 2010-12-11 00:53:59 $
13 */
14
15#include <bcmseclib_timer.h>
16#include <bcmseclib_timer_os.h>
17#include <osl.h>
18
19
20int
21bcmseclib_os_get_time(bcmseclib_time_t *time)
22{
23	unsigned int	ticks;
24	unsigned int	msec;
25
26	OSL_GETCYCLES(ticks);
27        msec = (unsigned int) ((1000.0 * (ticks)) / BWL_NU_TICKS_PER_SECOND);
28
29	time->sec = (msec / 1000);
30	time->usec = ((msec % 1000) * 1000);
31
32	return (0);
33}
34