-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
intel_adsp: bbzero/bmemcpy with picolibc fix #54314
intel_adsp: bbzero/bmemcpy with picolibc fix #54314
Conversation
When building with picolibc and gcc, the loops to do zeroing/copying get replaced by gcc with calls to memset/memcpy. This fails this early in the boot process and results in an illegal instruction exception. Marking the variables being manipulated in the calls as volatile prevents the compiler from optimizing the loops (replacing them with memset/memcpy). Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
cb9f49f
4eeeb2e
to
cb9f49f
Compare
Removed volatile on the loop indexes as recommended by @keith-packard and verfied this still works on cavs25 |
In general, the compiler optimizations which replace hand-coded memory copy/clear patterns with calls to memcpy or memset can be prevented with the GCC For this particular case, using volatile attributes on the pointers in the inline functions appears to generate fine code and will prevent replacement with inline functions as the type of the parameters isn't compatible (volatile uint32_t * vs void *). Adding |
When building with picolibc and gcc, the loops to do zeroing/copying get replaced by gcc with calls to memset/memcpy. This fails this early in the boot process and results in an illegal instruction exception.
Marking the variables being manipulated in the calls as volatile prevents the compiler from optimizing the loops (replacing them with memset/memcpy).
Fixes #54224 for me
Signed-off-by: Tom Burdick thomas.burdick@intel.com