unified: move basic ticks-to-ms conversion to kernel.h

The basic conversion, i.e. not handling the TICKS_UNLIMITED case, is
useful internally since the kernel is still tick-based.

Change-Id: I00a01047ec48dad6834dd8ea5dc831eb8c0c2501
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-09-21 11:05:56 -04:00
commit a9604bd895
2 changed files with 11 additions and 3 deletions

View file

@ -237,6 +237,16 @@ extern void *k_thread_custom_data_get(void);
* kernel timing
*/
#include <sys_clock.h>
/* private internal time manipulation (users should never play with ticks) */
static int64_t __ticks_to_ms(int64_t ticks)
{
return (MSEC_PER_SEC * (uint64_t)ticks) / sys_clock_ticks_per_sec;
}
/* timeouts */
struct _timeout;