zephyr/include/sys
Krzysztof Chruscinski 1e46bb3bb5 lib: os: ring_buffer: Allow using full buffer capacity
Previously, ring buffer had capacity of provided buffer size - 1. This
trick was used to distinguish between empty and full states. It had one
drawback: ring buffer could not be used as a pool of equal sized buffers
(using ring_buf_put_claim and ring_buf_get_claim).
Reworked internals to use non wrapping head and tail. Since they are
non wrapping, there is no issue with distinguishing between empty and
full. Since this appraoch would be vulnerable to wrapping on 32 bit
boundary, added a mechanism which periodically reduces all indexes to
avoid 32 bit wrapping.

After this rework, buffer has one byte more capacity. Simple test shows
slight performance improvement.

Updated tests to reflect increased capacity and added test to check if
it is possible to continuesly allocated 2 buffers of half ring buffer
size.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-11 13:17:49 +01:00
..
__assert.h
arch_interface.h arch_interface: update arch_mem_domain_thread_add 2020-10-22 16:47:07 -07:00
atomic.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
base64.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
byteorder.h sys: byteorder: Fix incorrect shift in sys_get_be48/le48 2020-09-21 11:17:59 +02:00
check.h
crc.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
device_mmio.h kernel: demote k_mem_map to z_mem_map 2020-09-03 14:24:38 -04:00
dlist.h
errno_private.h kernel: support using thread local storage for errno 2020-10-24 10:52:00 -07:00
fdtable.h net: getsockname: Call via vtable instead of ioctl 2020-08-14 09:47:51 -07:00
kobject.h kernel: move kernel object APIs to own header 2020-10-12 12:21:46 -04:00
libc-hooks.h arm: cortex_m: add support for thread local storage 2020-10-24 10:52:00 -07:00
list_gen.h
math_extras_impl.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
math_extras.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mem_manage.h kernel: demote k_mem_map to z_mem_map 2020-09-03 14:24:38 -04:00
mempool_base.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mempool.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
mutex.h include: sys: use C linkage 2020-10-22 07:49:07 -05:00
notify.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
onoff.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
printk.h
rb.h
ring_buffer.h lib: os: ring_buffer: Allow using full buffer capacity 2020-11-11 13:17:49 +01:00
sem.h linker: add iterable section macros 2020-06-24 17:09:22 -04:00
sflist.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
slist.h
speculation.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
sys_heap.h lib/os/heap: debugging facility to dump the heap structure to the cconsole 2020-06-26 11:41:43 -07:00
sys_io.h sys/sys_io.h: Memory mapped I/O APIs must be pointer-sized, not 32 bit! 2020-07-08 12:34:09 +02:00
thread_stack.h kernel: Add cache coherence management framework 2020-10-21 06:38:53 -04:00
time_units.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
timeutil.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
util_internal.h sys/util: fix macro support when building with C++ 2020-08-12 16:39:37 -05:00
util_macro.h doc: fix reference/util after sys/util.h split 2020-11-10 15:40:31 +01:00
util.h sys: util: Add clamp macro 2020-11-05 12:12:17 +01:00