clock: rename z_tick_get_32 -> sys_clock_tick_get_32

Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2021-03-13 08:19:53 -05:00
commit 5c90ceb105
6 changed files with 27 additions and 27 deletions

View file

@ -175,7 +175,7 @@ extern void z_enable_sys_clock(void);
* @return the current system tick count
*
*/
uint32_t z_tick_get_32(void);
uint32_t sys_clock_tick_get_32(void);
/**
*
@ -188,7 +188,7 @@ int64_t z_tick_get(void);
#ifndef CONFIG_SYS_CLOCK_EXISTS
#define z_tick_get() (0)
#define z_tick_get_32() (0)
#define sys_clock_tick_get_32() (0)
#endif
uint64_t z_timeout_end_calc(k_timeout_t timeout);

View file

@ -1233,7 +1233,7 @@ static int32_t z_tick_sleep(k_ticks_t ticks)
k_timeout_t timeout = Z_TIMEOUT_TICKS(ticks);
expected_wakeup_ticks = ticks + z_tick_get_32();
expected_wakeup_ticks = ticks + sys_clock_tick_get_32();
k_spinlock_key_t key = k_spin_lock(&sched_spinlock);
@ -1248,7 +1248,7 @@ static int32_t z_tick_sleep(k_ticks_t ticks)
__ASSERT(!z_is_thread_state_set(_current, _THREAD_SUSPENDED), "");
ticks = (k_ticks_t)expected_wakeup_ticks - z_tick_get_32();
ticks = (k_ticks_t)expected_wakeup_ticks - sys_clock_tick_get_32();
if (ticks > 0) {
return ticks;
}

View file

@ -275,7 +275,7 @@ int64_t z_tick_get(void)
return t;
}
uint32_t z_tick_get_32(void)
uint32_t sys_clock_tick_get_32(void)
{
#ifdef CONFIG_TICKLESS_KERNEL
return (uint32_t)z_tick_get();

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <cmsis_os2.h>
extern uint32_t z_tick_get_32(void);
extern uint32_t sys_clock_tick_get_32(void);
/**
* @brief Get RTOS Kernel Information.
@ -89,7 +89,7 @@ int32_t osKernelRestoreLock(int32_t lock)
*/
uint32_t osKernelGetTickCount(void)
{
return z_tick_get_32();
return sys_clock_tick_get_32();
}
/**

View file

@ -442,15 +442,15 @@ static void _test_kernel_interrupts(disable_int_func disable_int,
int imask;
/* Align to a "tick boundary" */
tick = z_tick_get_32();
while (z_tick_get_32() == tick) {
tick = sys_clock_tick_get_32();
while (sys_clock_tick_get_32() == tick) {
#if defined(CONFIG_ARCH_POSIX)
k_busy_wait(1000);
#endif
}
tick++;
while (z_tick_get_32() == tick) {
while (sys_clock_tick_get_32() == tick) {
#if defined(CONFIG_ARCH_POSIX)
k_busy_wait(1000);
#endif
@ -467,15 +467,15 @@ static void _test_kernel_interrupts(disable_int_func disable_int,
count <<= 4;
imask = disable_int(irq);
tick = z_tick_get_32();
tick = sys_clock_tick_get_32();
for (i = 0; i < count; i++) {
z_tick_get_32();
sys_clock_tick_get_32();
#if defined(CONFIG_ARCH_POSIX)
k_busy_wait(1000);
#endif
}
tick2 = z_tick_get_32();
tick2 = sys_clock_tick_get_32();
/*
* Re-enable interrupts before returning (for both success and failure
@ -493,13 +493,13 @@ static void _test_kernel_interrupts(disable_int_func disable_int,
/* Now repeat with interrupts unlocked. */
for (i = 0; i < count; i++) {
z_tick_get_32();
sys_clock_tick_get_32();
#if defined(CONFIG_ARCH_POSIX)
k_busy_wait(1000);
#endif
}
tick2 = z_tick_get_32();
tick2 = sys_clock_tick_get_32();
zassert_not_equal(tick, tick2,
"tick didn't advance as expected");
}
@ -530,13 +530,13 @@ static void _test_kernel_interrupts(disable_int_func disable_int,
* -# Do action to align to a tick boundary.
* -# Left shift 4 bits for the value of counts.
* -# Call irq_lock() and restore its return value to imask.
* -# Call z_tick_get_32() and store its return value to tick.
* -# Repeat counts of calling z_tick_get_32().
* -# Call z_tick_get_32() and store its return value to tick2.
* -# Call sys_clock_tick_get_32() and store its return value to tick.
* -# Repeat counts of calling sys_clock_tick_get_32().
* -# Call sys_clock_tick_get_32() and store its return value to tick2.
* -# Call irq_unlock() with parameter imask.
* -# Check if tick is equal to tick2.
* -# Repeat counts of calling z_tick_get_32().
* -# Call z_tick_get_32() and store its return value to tick2.
* -# Repeat counts of calling sys_clock_tick_get_32().
* -# Call sys_clock_tick_get_32() and store its return value to tick2.
* -# Check if tick is NOT equal to tick2.
*
* Expected Test Result:
@ -588,13 +588,13 @@ static void test_kernel_interrupts(void)
* -# Do action to align to a tick boundary.
* -# Left shift 4 bit for the value of counts.
* -# Call irq_disable() and restore its return value to imask.
* -# Call z_tick_get_32() and store its return value to tick.
* -# Repeat counts of calling z_tick_get_32().
* -# Call z_tick_get_32() and store its return value to tick2.
* -# Call sys_clock_tick_get_32() and store its return value to tick.
* -# Repeat counts of calling sys_clock_tick_get_32().
* -# Call sys_clock_tick_get_32() and store its return value to tick2.
* -# Call irq_enable() with parameter imask.
* -# Check if tick is equal to tick2.
* -# Repeat counts of calling z_tick_get_32().
* -# Call z_tick_get_32() and store its return value to tick2.
* -# Repeat counts of calling sys_clock_tick_get_32().
* -# Call sys_clock_tick_get_32() and store its return value to tick2.
* -# Check if tick is NOT equal to tick2.
*
* Expected Test Result:

View file

@ -136,10 +136,10 @@ static void load_store_low(void)
* thread an opportunity to run when the low priority thread is
* using the floating point registers.
*
* IMPORTANT: This logic requires that z_tick_get_32() not
* IMPORTANT: This logic requires that sys_clock_tick_get_32() not
* perform any floating point operations!
*/
while ((z_tick_get_32() % 5) != 0) {
while ((sys_clock_tick_get_32() % 5) != 0) {
/*
* Use a volatile variable to prevent compiler
* optimizing out the spin loop.