Skip to content

Commit

Permalink
coherent.h: assert(sizeof(struct coherent) <= DCACHE_LINE_SIZE)
Browse files Browse the repository at this point in the history
Supersedes the "best effort" use of `packed`, being removed by thesofproject#8528

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed Nov 27, 2023
1 parent 5c0f8bd commit c332385
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/include/sof/coherent.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ struct coherent {
struct list_item list; /* coherent list iteration */
} __coherent;

#if CONFIG_INCOHERENT
# ifdef __ZEPHYR__
BUILD_ASSERT(sizeof(struct coherent) <= DCACHE_LINE_SIZE, "DCACHE_LINE_SIZE too small");
# else
STATIC_ASSERT(sizeof(struct coherent) <= DCACHE_LINE_SIZE, DCACHE_LINE_SIZE_too_small);
# endif
#endif

/* debug address aliases */
#ifdef COHERENT_CHECK_ALIAS
#define ADDR_IS_INCOHERENT(_c) assert(!is_uncached(_c))
Expand Down

0 comments on commit c332385

Please sign in to comment.