native: added posix_get_hw_cycle()

Added function (for all ARCH_POSIX boards) to get the
the current clock cycle of the CPU

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
Alberto Escolar Piedras 2018-02-06 14:23:32 +01:00 committed by Anas Nashif
commit a99a14c3b7
2 changed files with 5 additions and 0 deletions

View file

@ -23,6 +23,7 @@ extern "C" {
void posix_irq_handler(void);
void posix_exit(int exit_code);
u64_t posix_get_hw_cycle(void);
#if defined(CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT)
void k_busy_wait(u32_t usec_to_wait);

View file

@ -167,6 +167,10 @@ u64_t hwm_get_time(void)
return device_time;
}
u64_t posix_get_hw_cycle(void)
{
return hwm_get_time();
}
/**
* Function to initialize the HW models