2 * @ingroup adf_os_public
4 * This file abstracts time related functionality.
9 #include <adf_os_time_pvt.h>
12 * @brief count the number of ticks elapsed from the time when
17 static inline unsigned long
20 return __adf_os_ticks();
24 * @brief convert ticks to milliseconds
26 * @param[in] ticks number of ticks
27 * @return time in milliseconds
29 static inline a_uint32_t
30 adf_os_ticks_to_msecs(unsigned long ticks)
32 return (__adf_os_ticks_to_msecs(ticks));
36 * @brief convert milliseconds to ticks
38 * @param[in] time in milliseconds
39 * @return number of ticks
41 static inline unsigned long
42 adf_os_msecs_to_ticks(a_uint32_t msecs)
44 return (__adf_os_msecs_to_ticks(msecs));
48 * @brief Return a monotonically increasing time. This increments once per HZ ticks
50 static inline unsigned long
51 adf_os_getuptime(void)
53 return (__adf_os_getuptime());
57 * @brief Delay in microseconds
59 * @param[in] microseconds to delay
62 adf_os_udelay(int usecs)
64 __adf_os_udelay(usecs);
68 * @brief Delay in milliseconds.
70 * @param[in] milliseconds to delay
73 adf_os_mdelay(int msecs)
75 __adf_os_mdelay(msecs);
79 * @brief Check if _a is later than _b.
81 #define adf_os_time_after(_a, _b) __adf_os_time_after(_a, _b)
84 * @brief Check if _a is prior to _b.
86 #define adf_os_time_before(_a, _b) __adf_os_time_before(_a, _b)
89 * @brief Check if _a atleast as recent as _b, if not later.
91 #define adf_os_time_after_eq(_a, _b) __adf_os_time_after_eq(_a, _b)