zephyr/kernel
Benjamin Walsh 6209218f40 kernel: optimize ms-to-ticks for certain tick frequencies
Some tick frequencies lend themselves to optimized conversions from ms
to ticks and vice-versa.

- 1000Hz which does not need any conversion
- 500Hz, 250Hz, 125Hz where the division/multiplication are a straight
  shift since they are power-of-two factors of 1000.

In addition, some more generally used values are made to use optimized
conversion equations rather than the generic one that uses 64-bit math,
and often results in calling compiler intrinsics.

These values are: 100Hz, 50Hz, 25Hz, 20Hz, 10Hz, 1Hz (the last one used
in some testing).

Avoiding the 64-bit math intrisics has the additional benefit, in
addition to increased performance, of using a significant lower amount
of stack space: 52 bytes on ARM Cortex-M and 80 bytes on x86.

Change-Id: I080eb338a2637d6b1c6838c119af1a9fa37fe869
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-21 19:50:07 +00:00
..
configs
include kernel: optimize ms-to-ticks for certain tick frequencies 2016-12-21 19:50:07 +00:00
alert.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
atomic_c.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
compiler_stack_protect.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
device.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
errno.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
event_logger.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
fifo.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
idle.c kernel: fix all nanokernel usage in comments 2016-12-21 18:45:03 +00:00
init.c kernel: fix all nanokernel usage in comments 2016-12-21 18:45:03 +00:00
int_latency_bench.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
Kconfig kernel: optimize ms-to-ticks for certain tick frequencies 2016-12-21 19:50:07 +00:00
Kconfig.event_logger
Kconfig.power_mgmt
kernel_event_logger.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
legacy_offload.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
legacy_timer.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
lifo.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
mailbox.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
Makefile kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
mem_pool.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
mem_slab.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
msg_q.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
mutex.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
pipes.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
sched.c kernel: optimize ms-to-ticks for certain tick frequencies 2016-12-21 19:50:07 +00:00
sem.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
stack.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
sys_clock.c kernel: optimize ms-to-ticks for certain tick frequencies 2016-12-21 19:50:07 +00:00
system_work_q.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
thread_abort.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
thread.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
timer.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
version.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
work_q.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00