-
Notifications
You must be signed in to change notification settings - Fork 349
userspace: remove cache primitive usage from audio code #10232
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,8 @@ | |||||
| #include <rtos/alloc.h> | ||||||
| #include <ipc/topology.h> | ||||||
|
|
||||||
| #include <zephyr/syscall.h> | ||||||
|
|
||||||
| LOG_MODULE_REGISTER(ring_buffer, CONFIG_SOF_LOG_LEVEL); | ||||||
|
|
||||||
| SOF_DEFINE_REG_UUID(ring_buffer); | ||||||
|
|
@@ -53,6 +55,14 @@ static inline void ring_buffer_invalidate_shared(struct ring_buffer *ring_buffer | |||||
| if (!ring_buffer_is_shared(ring_buffer)) | ||||||
| return; | ||||||
|
|
||||||
| #if CONFIG_USERSPACE | ||||||
| /* user-space shared buffers are allocated as uncached */ | ||||||
| if (k_is_user_context()) { | ||||||
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(ptr) == false); | ||||||
|
||||||
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(ptr) == false); | |
| __ASSERT_NO_MSG(!sys_cache_is_ptr_cached(ptr)); |
Copilot
AI
Sep 19, 2025
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.
[nitpick] Consider using !sys_cache_is_ptr_cached(ptr) instead of == false for better readability and consistency with C conventions.
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(ptr) == false); | |
| __ASSERT_NO_MSG(!sys_cache_is_ptr_cached(ptr)); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |||||
| #include <ipc/stream.h> | ||||||
| #include <ipc4/base-config.h> | ||||||
| #include <module/audio/audio_stream.h> | ||||||
| #include <zephyr/syscall.h> | ||||||
|
|
||||||
| #include <stdbool.h> | ||||||
| #include <stdint.h> | ||||||
|
|
@@ -733,6 +734,14 @@ static inline void audio_stream_invalidate(struct audio_stream *buffer, uint32_t | |||||
| tail_size = bytes - head_size; | ||||||
| } | ||||||
|
|
||||||
| #if CONFIG_USERSPACE | ||||||
| /* user-space shared buffers are allocated as uncached */ | ||||||
| if (k_is_user_context()) { | ||||||
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(buffer->addr) == false); | ||||||
|
||||||
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(buffer->addr) == false); | |
| __ASSERT_NO_MSG(!sys_cache_is_ptr_cached(buffer->addr)); |
Copilot
AI
Sep 19, 2025
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.
[nitpick] Consider using !sys_cache_is_ptr_cached(buffer->addr) instead of == false for better readability and consistency with C conventions.
| __ASSERT_NO_MSG(sys_cache_is_ptr_cached(buffer->addr) == false); | |
| __ASSERT_NO_MSG(!sys_cache_is_ptr_cached(buffer->addr)); |
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.
Lets not do this as performance impact is quite large, in this case it may be a lot faster to have a SOF syscall for buffer WB and INV.