c26e08a51f
Added parameter to CBPRINTF_STATIC_PACKAGE which indicates buffer alignment offset compared to CBPRINTF_PACKAGE_ALIGNMENT. When offset is set to 0, macro assumes that input buffer is aligned to CBPRINTF_PACKAGE_ALIGNMENT. When offset is positive, macro assumes that buffer address is shifted by given number of bytes to CBPRINTF_PACKAGE_ALIGNMENT alignment. Extended cbprintf_package to use len argument as alignment offset indicator when calculating length only (package pointer is null). Features are not available for xtensa platform which seems to require 16 byte alignment from the package. It is only an assumption due to lack of the documentation and may be fixed in the future. Feature allows to avoid unnecessary padding when package is part of a message and preceeded by a header of a known size. For example, message header on 32 bit architecture has 12 bytes, long doubles are not used so cbprintf requires 8 byte alignment. Without alignment offset indicator, package containing just a string with one argument would need 4 byte padding after the header and 4 byte padding after the package. Message would be 32 bytes long. With alignment offset indication both paddings are not needed and message is only 24 bytes long. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no> |
||
---|---|---|
.. | ||
assert.c | ||
base64.c | ||
cbprintf.c | ||
cbprintf_complete.c | ||
cbprintf_nano.c | ||
cbprintf_packaged.c | ||
CMakeLists.txt | ||
crc7_sw.c | ||
crc8_sw.c | ||
crc16_sw.c | ||
crc32_sw.c | ||
crc32c_sw.c | ||
dec.c | ||
fdtable.c | ||
heap-validate.c | ||
heap.c | ||
heap.h | ||
hex.c | ||
json.c | ||
Kconfig | ||
Kconfig.cbprintf | ||
mutex.c | ||
notify.c | ||
onoff.c | ||
p4wq.c | ||
printk.c | ||
rb.c | ||
ring_buffer.c | ||
sem.c | ||
thread_entry.c | ||
timeutil.c | ||
user_work.c | ||
work_q.c |