sparse: add an address space and a __sparse_force annotation

We want to use a sparse address space to identify invalid conversions
between cached and uncached address aliases. This patch adds a
__sparse_cache sparse annotation for that. Where those conversions
must be done that has to be supported by using the __sparse_force
sparse attribute. To avoid compiler complains about unknown
attributes we add a -Wno-attributes flag when building with sparse
support.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-04-29 08:36:25 +02:00 committed by Carles Cufí
commit 17eb313a1b
3 changed files with 26 additions and 5 deletions

View file

@ -269,6 +269,8 @@ endif()
if("${SPARSE}" STREQUAL "y")
list(APPEND TOOLCHAIN_C_FLAGS -D__CHECKER__)
# Avoid compiler "attribute directive ignored" warnings
list(APPEND TOOLCHAIN_C_FLAGS -Wno-attributes)
endif()
zephyr_compile_options(