zephyr/include/sys
Daniel Leung cae8bd7408 sys: util: cast input of KB() to size_t for large number
Numbers in C macros are treated as signed integer. This causes
issues when using macro KB(x). If the result is larger than
(2^31 - 1), it is treated as a negative number downstream.
For example, the RAM size of up_squared is 2GB. The result of
KB(CONFIG_SRAM_SIZE) should be 2147483648, but due to being
casted as signed, the result is instead -2147483648. Any
calculations using this would be incorrectly. Fix it by
casting x in KB(x) to size_t first.

Fixes #27164

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-04 17:45:22 +02:00
..
__assert.h
arch_interface.h kernel: introduce supervisor-only stacks 2020-07-30 21:11:14 -04:00
atomic.h
base64.h
byteorder.h
check.h
crc.h
device_mmio.h kernel: add macros for device MMIO management 2020-07-17 11:38:18 +02:00
dlist.h
errno_private.h
fdtable.h
libc-hooks.h include: libc-hooks: add comments 2020-07-23 11:01:42 +02:00
list_gen.h
math_extras_impl.h
math_extras.h
mem_manage.h kernel: add k_mem_map() and related defines 2020-07-17 11:38:18 +02:00
mempool_base.h
mempool.h
mutex.h
notify.h
onoff.h
printk.h
rb.h
ring_buffer.h
sem.h linker: add iterable section macros 2020-06-24 17:09:22 -04:00
sflist.h
slist.h
speculation.h
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: introduce supervisor-only stacks 2020-07-30 21:11:14 -04:00
time_units.h
timeutil.h
util_internal.h sys: util: Add GET_ARG_N and GET_ARGS_LESS_N macros 2020-06-22 15:18:07 +02:00
util.h sys: util: cast input of KB() to size_t for large number 2020-08-04 17:45:22 +02:00