zephyr/kernel
Andy Ross b8ffd9acd6 sys_clock: Make clock_always_on true by default
This flag is an indication to the timer driver that the OS doesn't
care about rollover conditions of the tick count while idling, so the
system doesn't need to wake up once per counter flip[1].  Obviously in
that circumstance values returned from k_uptime_get_32() are going to
be wrong, so the implementation had an assert to check for misuse.

But no one understood that from the docs, so the only place these APIs
were used in practice were as "guards" around code that needed to call
k_uptime_get_32(), even though that's 100% wrong per docs!

Clarify the docs.  Remove the incorrect guards.  Change the flag to
initialize to true so that uptime isn't broken-by-default in tickless
mode.  Also move the implemenations of the functions out of the
header, as there's no good reason for these to need to be inlined.

[1] Which can be significant.  A 100MHz ARM using the 24 bit SysTick
    counter rolls over at about 6 Hz, and if it had to come out of
    idle at that rate it would be a significant power issue that would
    swamp the gains from tickless.  Obviously systems with slow
    counters like nRF or 64 bit ones like RISC-V or x86's TSC aren't
    as affected.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
..
include kernel: Fix overflow test problem introduced in 92ea2f9 2018-10-04 05:20:29 -07:00
alert.c kernel: Using boolean constants instead of 0 or 1 2018-09-18 13:57:15 -04:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
CMakeLists.txt kernel: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for kernel files. 2018-05-15 17:48:18 +03:00
compiler_stack_protect.c kernel: add CODE_UNREACHABLE in _StackCheckHandler 2018-04-17 10:50:12 -07:00
device.c kernel; Checking functions return 2018-09-14 16:55:37 -04:00
errno.c kernel: userspace: reserve stack space to store local data 2018-08-17 09:40:52 -07:00
idle.c kernel: Using boolean types for boolean constants 2018-09-28 06:28:41 +05:30
init.c kernel: move to new logger 2018-10-08 17:49:12 -04:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig clock: Remove CONFIG_TICKLESS_KERNEL_TIME_UNIT_IN_MICRO_SECS 2018-10-16 15:03:10 -04:00
Kconfig.power_mgmt clock: Remove CONFIG_TICKLESS_KERNEL_TIME_UNIT_IN_MICRO_SECS 2018-10-16 15:03:10 -04:00
mailbox.c kernel: Sanitize if else statement according with MISRA-C 2018-09-28 07:58:19 +05:30
mem_domain.c kernel: Using boolean expression on ASSERT macros 2018-09-28 06:28:41 +05:30
mem_slab.c kernel: Explicitly comparing pointer with NULL 2018-09-28 06:28:41 +05:30
mempool.c kernel: mempool: Remove unnecessary condition check 2018-09-28 07:58:19 +05:30
msg_q.c kernel: Explicitly comparing pointer with NULL 2018-09-28 06:28:41 +05:30
mutex.c kernel: Using boolean types for boolean constants 2018-09-28 06:28:41 +05:30
pipes.c portability: Avoid void* arithmetics which is a GNU extension 2018-09-28 07:57:28 +05:30
poll.c kernel: Fix overflow test problem introduced in 92ea2f9 2018-10-04 05:20:29 -07:00
queue.c kernel: Compare pointers with NULL in while statements 2018-09-18 13:57:15 -04:00
sched.c kernel: sched: Change boolean APIs to return bool 2018-09-28 06:28:41 +05:30
sem.c kernel: Explicitly comparing pointer with NULL 2018-09-28 06:28:41 +05:30
smp.c kernel; Checking functions return 2018-09-14 16:55:37 -04:00
stack.c kernel: Explicitly comparing pointer with NULL 2018-09-28 06:28:41 +05:30
sys_clock.c sys_clock: Make clock_always_on true by default 2018-10-16 15:03:10 -04:00
system_work_q.c kernel: introduce stack definition macros 2017-06-09 18:53:28 -04:00
thread.c sys_clock.h: Make "global variable" APIs into proper functions 2018-10-16 15:03:10 -04:00
thread_abort.c kernel: Using boolean expression on ASSERT macros 2018-09-28 06:28:41 +05:30
timer.c kernel: Make If statement have essentially Boolean type 2018-09-18 13:57:15 -04:00
userspace.c kernel: move to new logger 2018-10-08 17:49:12 -04:00
userspace_handler.c kernel: Calling Z_SYSCALL_VERIFY_MSG with boolean expressions 2018-09-28 06:28:41 +05:30
version.c kernel: version: no need to store version in RAM 2017-09-07 16:34:50 -07:00
work_q.c kernel: add a new API for setting thread names 2018-09-27 08:58:55 +05:30