zephyr/kernel/cache_handlers.c
Carlo Caione e77c841023 cache: Expand the APIs for cache flushing
The only two supported operations for data caches in the cache framework
are currently arch_dcache_flush() and arch_dcache_invd().

This is quite restrictive because for some architectures we also want to
control i-cache and in general we want a finer control over what can be
flushed, invalidated or cleaned. To address these needs this patch
expands the set of operations that can be performed on data and
instruction caches, adding hooks for the operations on the whole cache,
a specific level or a specific address range.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-19 14:31:02 -05:00

37 lines
836 B
C

/*
* Copyright (c) 2020 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <cache.h>
#include <syscall_handler.h>
static inline int z_vrfy_sys_dcache_all(int op)
{
return z_impl_sys_dcache_all(op);
}
#include <syscalls/sys_dcache_all_mrsh.c>
static inline int z_vrfy_sys_dcache_range(void *addr, size_t size, int op)
{
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
return z_impl_sys_dcache_range(addr, size, op);
}
#include <syscalls/sys_dcache_range_mrsh.c>
static inline int z_vrfy_sys_icache_all(int op)
{
return z_impl_sys_icache_all(op);
}
#include <syscalls/sys_icache_all_mrsh.c>
static inline int z_vrfy_sys_icache_range(void *addr, size_t size, int op)
{
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
return z_impl_sys_icache_range(addr, size, op);
}
#include <syscalls/sys_icache_range_mrsh.c>