From 79746d701b50072714c95bb53c6519d1ff6d6c80 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 10 Dec 2021 15:37:31 -0800 Subject: [PATCH] arch/xtensa: Make cache utilities ALWAYS_INLINE These are tiny functions always declared as "inline" per C99, but that's just a hint. In practice, they tend to be (c.f. intel_asdp) called from very early boot circumstances where main application symbols aren't yet available. That obviously doesn't work, or even link. Make them ALWAYS_INLINE. In practice they're so small that we don't want them called anyway just for stack space reasons. Signed-off-by: Andy Ross --- include/arch/xtensa/cache.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/arch/xtensa/cache.h b/include/arch/xtensa/cache.h index fc9038f29c4..b8510d88ac2 100644 --- a/include/arch/xtensa/cache.h +++ b/include/arch/xtensa/cache.h @@ -20,7 +20,7 @@ BUILD_ASSERT(Z_IS_POW2(XCHAL_DCACHE_LINESIZE)); BUILD_ASSERT(Z_IS_POW2(Z_DCACHE_MAX)); #endif -static inline void z_xtensa_cache_flush(void *addr, size_t bytes) +static ALWAYS_INLINE void z_xtensa_cache_flush(void *addr, size_t bytes) { #if XCHAL_DCACHE_SIZE size_t step = XCHAL_DCACHE_LINESIZE; @@ -34,7 +34,7 @@ static inline void z_xtensa_cache_flush(void *addr, size_t bytes) #endif } -static inline void z_xtensa_cache_flush_inv(void *addr, size_t bytes) +static ALWAYS_INLINE void z_xtensa_cache_flush_inv(void *addr, size_t bytes) { #if XCHAL_DCACHE_SIZE size_t step = XCHAL_DCACHE_LINESIZE; @@ -48,7 +48,7 @@ static inline void z_xtensa_cache_flush_inv(void *addr, size_t bytes) #endif } -static inline void z_xtensa_cache_inv(void *addr, size_t bytes) +static ALWAYS_INLINE void z_xtensa_cache_inv(void *addr, size_t bytes) { #if XCHAL_DCACHE_SIZE size_t step = XCHAL_DCACHE_LINESIZE; @@ -62,17 +62,17 @@ static inline void z_xtensa_cache_inv(void *addr, size_t bytes) #endif } -static inline void z_xtensa_cache_inv_all(void) +static ALWAYS_INLINE void z_xtensa_cache_inv_all(void) { z_xtensa_cache_inv(NULL, Z_DCACHE_MAX); } -static inline void z_xtensa_cache_flush_all(void) +static ALWAYS_INLINE void z_xtensa_cache_flush_all(void) { z_xtensa_cache_flush(NULL, Z_DCACHE_MAX); } -static inline void z_xtensa_cache_flush_inv_all(void) +static ALWAYS_INLINE void z_xtensa_cache_flush_inv_all(void) { z_xtensa_cache_flush_inv(NULL, Z_DCACHE_MAX); }