Skip to content

Commit

Permalink
DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinszkudlinski committed Sep 4, 2023
1 parent a8083d4 commit 476d565
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/include/sof/coherent.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,20 @@ struct coherent {
#define ADDR_IS_INCOHERENT(_c)
#define ADDR_IS_COHERENT(_c)
#endif

#define COHERENT_CHECK_NONSHARED_CORES
/* debug sharing amongst cores */
#ifdef COHERENT_CHECK_NONSHARED_CORES

#define assertx(X) if (!(X)) while(1);

#define CORE_CHECK_STRUCT_FIELD uint32_t __core; bool __is_shared
#define CORE_CHECK_STRUCT_INIT(_c, is_shared) { (_c)->__core = cpu_get_id(); \
(_c)->__is_shared = is_shared; }
#define CORE_CHECK_STRUCT(_c) { assert(!!(_c)->__is_shared == !!is_uncached(_c)); \
assert(cpu_get_id() == (_c)->__core || (_c)->__is_shared); }
#define CORE_CHECK_STRUCT(_c) { assertx(!!(_c)->__is_shared == !!is_uncached(_c)); \
assertx(cpu_get_id() == (_c)->__core || (_c)->__is_shared); }

#define CHECK_COHERENT_CORE(_c) assert((_c)->core == cpu_get_id())
#define CHECK_COHERENT_CORE(_c)
//assert((_c)->core == cpu_get_id())

#else

Expand Down

0 comments on commit 476d565

Please sign in to comment.