3 * (C) COPYRIGHT 2010-2011 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
8 * A copy of the licence is included with the program, and can also be obtained from Free Software
9 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 * Implementation of the OS abstraction layer for the kernel device driver
20 #ifndef _OSK_ARCH_TIME_H
21 #define _OSK_ARCH_TIME_H
24 #error "Include mali_osk.h directly"
27 OSK_STATIC_INLINE osk_ticks osk_time_now(void)
32 OSK_STATIC_INLINE u32 osk_time_mstoticks(u32 ms)
34 return msecs_to_jiffies(ms);
37 OSK_STATIC_INLINE u32 osk_time_elapsed(osk_ticks ticka, osk_ticks tickb)
39 return jiffies_to_msecs((long)tickb - (long)ticka);
42 OSK_STATIC_INLINE mali_bool osk_time_after(osk_ticks ticka, osk_ticks tickb)
44 return time_after(ticka, tickb);
47 OSK_STATIC_INLINE void osk_gettimeofday(osk_timeval *tv)
52 tv->tv_sec = ts.tv_sec;
53 tv->tv_usec = ts.tv_nsec/1000;
56 #endif /* _OSK_ARCH_TIME_H_ */