zephyr: panic: switch to __ASSERT_NO_MSG() for assert()

Continue the changes done in commit bc39c0e912 ("Make Zephyr build
compatible with optional assert() with __unused") and switch
to use __ASSERT_NO_MSG() as implementation of assert() when SOF
is build with Zephyr.

This allows for build time control of asserts with standard
CONFIG_ASSERT option(s) and ensures same policy is used for asserts in
both Zephyr and SOF code.

This effectively disables assert checks in the default build for Zephyr,
improves performance of a typical single ll scheduled audio component by
0.08 MCPS. Performance was tested with the Intel Tiger Lake system,
build with XCC 12.0.8 as defined in sof/scripts/xtensa-build-zephyr.py.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2022-06-17 12:15:29 +03:00 committed by Liam Girdwood
parent 9300dbb789
commit 97b34a1869
1 changed files with 2 additions and 5 deletions

View File

@ -34,11 +34,8 @@ void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info,
#include <kernel.h>
#define panic(x) k_panic()
#define assert(x) \
do { \
if (!(x)) \
k_oops();\
} while (0)
#define assert(x) __ASSERT_NO_MSG(x)
/* To print the asserted expression on failure:
* #define assert(x) __ASSERT(x, #x)
*/