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 authored and dbaluta committed Dec 5, 2023
1 parent cff6a6b commit afa02db
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 afa02db

Please sign in to comment.