zephyr/include/zephyr/debug/sparse.h
Guennadi Liakhovetski 17eb313a1b 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>
2022-05-03 09:37:08 +02:00

19 lines
368 B
C

/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DEBUG_SPARSE_H
#define ZEPHYR_INCLUDE_DEBUG_SPARSE_H
#if defined(__CHECKER__)
#define __sparse_cache __attribute__((address_space(__cache)))
#define __sparse_force __attribute__((force))
#else
#define __sparse_cache
#define __sparse_force
#endif
#endif