-
Notifications
You must be signed in to change notification settings - Fork 349
audio: use zephyr/cache.h for cache flush/invalidate #10258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the audio subsystem to use Zephyr's native cache interface instead of the legacy rtos/cache.h. This change ensures the audio code can work in user-space contexts when enabled at build time.
Key changes include:
- Replacing legacy dcache_* functions with sys_cache_data_* equivalents
- Updating header includes to use zephyr/cache.h instead of rtos/cache.h
- Converting dcache_writeback_region to sys_cache_data_flush_range and dcache_invalidate_region to sys_cache_data_invd_range
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/include/sof/audio/audio_stream.h | Updates cache writeback calls in audio_stream_writeback function |
| src/audio/copier/copier_ipcgtw.c | Adds zephyr/cache.h include and converts cache invalidate calls |
| src/audio/buffers/ring_buffer.c | Adds zephyr/cache.h include and updates all cache operations in ring buffer functions |
| src/audio/buffers/comp_buffer.c | Replaces rtos/cache.h with zephyr/cache.h and updates buffer_zero function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| dcache_writeback_region((__sparse_force void __sparse_cache *)buffer->addr, | ||
| tail_size); | ||
| sys_cache_data_flush_range((__sparse_force void __sparse_cache *)buffer->addr, | ||
| tail_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we replace "rtos/cache.h" in this file too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh, missed that. V2 uploaded to fix this.
Use Zephyr native cache interface instead of legacy rtos/cache.h. This ensures audio code is using interfaces that supports use from user-space (if enabled at build time). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
059f903 to
b8e2456
Compare
tmleman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Use Zephyr native cache interface instead of legacy rtos/cache.h. This ensures audio code is using interfaces that supports use from user-space (if enabled at build time).