arch/xtensa: Add non-HAL caching primitives
The Xtensa L1 cache layer has straightforward semantics accessible via single-instructions that operate on cache lines via physical addresses. These are very amenable to inlining. Unfortunately the Xtensa HAL layer requires function calls to do this, leading to significant code waste at the calling site, an extra frame on the stack and needless runtime instructions for situations where the call is over a constant region that could elide the loop. This is made even worse because the HAL library is not built with -ffunction-sections, so pulling in even one of these tiny cache functions has the effect of importing a 1500-byte object file into the link! Add our own tiny cache layer to include/arch/xtensa/cache.h and use that instead. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
d0c538e9a2
commit
64cf33952d
10 changed files with 105 additions and 19 deletions
|
@ -18,6 +18,7 @@
|
|||
LOG_MODULE_REGISTER(soc_mp, CONFIG_SOC_LOG_LEVEL);
|
||||
|
||||
#include <soc.h>
|
||||
#include <arch/xtensa/cache.h>
|
||||
#include <adsp/io.h>
|
||||
|
||||
#include <soc/shim.h>
|
||||
|
@ -125,7 +126,7 @@ void z_mp_entry(void)
|
|||
* isn't using yet. Manual inspection of generated code says
|
||||
* we're safe, but really we need a better solution here.
|
||||
*/
|
||||
xthal_dcache_all_writeback_inv();
|
||||
z_xtensa_cache_flush_inv_all();
|
||||
|
||||
/* Copy over VECBASE from the main CPU for an initial value
|
||||
* (will need to revisit this if we ever allow a user API to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue