arch/x86: Fix compilation error

arch_dcache_range() function does not exist anymore, nor K_CACHE_WB
macro. Removing it entirely.

arch_dcache_flush_range() signature changed, so relevantly applying
these.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2023-01-10 12:17:17 +01:00 committed by Fabio Baltieri
commit c9ef674f0e

View file

@ -19,22 +19,20 @@
#include <stdbool.h> #include <stdbool.h>
/** /**
* @brief Flush cache lines to main memory
*
* No alignment is required for either <virt> or <size>, but since * No alignment is required for either <virt> or <size>, but since
* sys_cache_flush() iterates on the cache lines, a cache line alignment for * sys_cache_flush() iterates on the cache lines, a cache line alignment for
* both is optimal. * both is optimal.
* *
* The cache line size is specified via the d-cache-line-size DTS property. * The cache line size is specified via the d-cache-line-size DTS property.
*/ */
static void arch_dcache_flush(void *start_addr, size_t size) int arch_dcache_flush_range(void *start_addr, size_t size)
{ {
size_t line_size = sys_cache_data_line_size_get(); size_t line_size = sys_cache_data_line_size_get();
uintptr_t start = (uintptr_t)start_addr; uintptr_t start = (uintptr_t)start_addr;
uintptr_t end = start + size; uintptr_t end = start + size;
if (line_size == 0U) { if (line_size == 0U) {
return; return -ENOTSUP;
} }
end = ROUND_UP(end, line_size); end = ROUND_UP(end, line_size);
@ -49,14 +47,5 @@ static void arch_dcache_flush(void *start_addr, size_t size)
#else #else
__asm__ volatile("lock; addl $0,-4(%%esp);\n\t":::"memory", "cc"); __asm__ volatile("lock; addl $0,-4(%%esp);\n\t":::"memory", "cc");
#endif #endif
} return 0;
int arch_dcache_range(void *addr, size_t size, int op)
{
if (op & K_CACHE_WB) {
arch_dcache_flush(addr, size);
return 0;
}
return -ENOTSUP;
} }