2 * Copyright (C) 2010, 2013 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 * @file mali_osk_time.c
13 * Implementation of the OS abstraction layer for the kernel device driver
17 #include <linux/jiffies.h>
18 #include <linux/time.h>
19 #include <asm/delay.h>
21 int _mali_osk_time_after( u32 ticka, u32 tickb )
23 return time_after((unsigned long)ticka, (unsigned long)tickb);
26 u32 _mali_osk_time_mstoticks( u32 ms )
28 return msecs_to_jiffies(ms);
31 u32 _mali_osk_time_tickstoms( u32 ticks )
33 return jiffies_to_msecs(ticks);
36 u32 _mali_osk_time_tickcount( void )
41 void _mali_osk_time_ubusydelay( u32 usecs )
46 u64 _mali_osk_time_get_ns( void )
48 struct timespec tsval;
49 getnstimeofday(&tsval);
50 return (u64)timespec_to_ns(&tsval);