zephyr/tests/kernel
Andy Ross 317178b88f sys_clock: Fix unsafe tick count usage
The system tick count is a 64 bit quantity that gets updated from
interrupt context, meaning that it's dangerously non-atomic and has to
be locked.  The core kernel clock code did this right.

But the value was also exposed to the rest of the universe as a global
variable, and virtually nothing else was doing this correctly.  Even
in the timer ISRs themselves, the interrupts may be themselves
preempted (most of our architectures support nested interrupts) by
code that wants to set timeouts and inspect system uptime.

Define a z_tick_{get,set}() API, eliminate the old variable, and make
sure everyone uses the right mechanism.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
..
alert/alert_api cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
arm_irq_vector_table Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's 2018-10-10 11:28:27 -05:00
arm_runtime_nmi cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
boot_page_table cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
common sys_clock: Make sys_clock_hw_cycles_per_tick() a proper API 2018-10-16 15:03:10 -04:00
context sys_clock: Fix unsafe tick count usage 2018-10-16 15:03:10 -04:00
critical tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
device cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
early_sleep sys_clock: Make sys_clock_hw_cycles_per_tick() a proper API 2018-10-16 15:03:10 -04:00
errno tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
fatal tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
fifo tests/kernel: fifo_timeout: Remove wake-up order checking 2018-10-02 14:06:50 -07:00
fp_sharing sys_clock: Fix unsafe tick count usage 2018-10-16 15:03:10 -04:00
gen_isr_table tests: gen_isr_table: Add barriers after triggering the irq 2018-08-29 18:48:42 -04:00
init tests: kernel: init: Fix integer overflow issue 2018-08-26 18:47:08 -07:00
interrupt tests: add tests to validate interrupt nesting feature 2018-10-10 19:59:47 -04:00
irq_offload cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
lifo cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
mbox coccicnelle: Ignore return of memset 2018-09-14 16:55:37 -04:00
mem_heap/mheap_api_concept cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
mem_pool sys_clock.h: Make "global variable" APIs into proper functions 2018-10-16 15:03:10 -04:00
mem_protect sys_clock: Fix unsafe tick count usage 2018-10-16 15:03:10 -04:00
mem_slab tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
mp cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
msgq/msgq_api cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
mutex tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
obj_tracing tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
pending tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
pipe tests: kernel: pipe : Update the stack size. 2018-09-20 20:35:25 -04:00
poll tests: k_poll: Add testcase to poll fifo which gets k_fifo_cancel_wait 2018-08-30 09:28:29 -04:00
profiling/profiling_api cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
queue cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
sched tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
semaphore cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
sleep tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
smp tests: smp: Modify test to verify thread delay 2018-08-20 17:51:07 -07:00
spinlock cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
stack cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
static_idt cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
threads tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
tickless cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
timer sys_clock: Make sys_clock_hw_cycles_per_tick() a proper API 2018-10-16 15:03:10 -04:00
workq tests: remove bat_commit, replace core with kernel 2018-10-16 09:17:51 -04:00
xip cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00