Skip to content

Commit b601cb4

Browse files
committed
lib: mailbox: add assert to catch mailbox_stream_write() use in IPC4
To prevent any accidental use in new code, add an assert to mailbox_stream_write() against use in IPC4 builds. The "stream mailbox" is not available in IPC4 mailbox layout, so it must not be used. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 4eb07c1 commit b601cb4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/include/sof/lib/mailbox.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ void mailbox_hostbox_read(void *dest, size_t dest_size,
100100
assert(!host_read_err);
101101
}
102102

103+
#if CONFIG_IPC_MAJOR_4
104+
static inline
105+
void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
106+
{
107+
/* in IPC4, the stream mailbox must not be used */
108+
assert(false);
109+
}
110+
#else
103111
static inline
104112
void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
105113
{
@@ -110,5 +118,6 @@ void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
110118
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_STREAM_BASE +
111119
offset), bytes);
112120
}
121+
#endif
113122

114123
#endif /* __SOF_LIB_MAILBOX_H__ */

0 commit comments

Comments
 (0)