189cd1f4a2
The cache operations must be quick, optimized and possibly inlined. The current API is clunky, functions are not inlined and passing parameters around that are basically always known at compile time. In this patch we rework the cache functions to allow us to get rid of useless parameters and make inlining easier. In particular this changeset is doing three things: 1. `CONFIG_HAS_ARCH_CACHE` is now `CONFIG_ARCH_CACHE` and `CONFIG_HAS_EXTERNAL_CACHE` is now `CONFIG_EXTERNAL_CACHE` 2. The cache API has been reworked. 3. Comments are added. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
33 lines
887 B
C
33 lines
887 B
C
/*
|
|
* Copyright (c) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/cache.h>
|
|
#include <zephyr/syscall_handler.h>
|
|
|
|
static inline int z_vrfy_sys_cache_data_flush_range(void *addr, size_t size)
|
|
{
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
|
|
|
return z_impl_sys_cache_data_flush_range(addr, size);
|
|
}
|
|
#include <syscalls/sys_cache_data_flush_range_mrsh.c>
|
|
|
|
static inline int z_vrfy_sys_cache_data_invd_range(void *addr, size_t size)
|
|
{
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
|
|
|
return z_impl_sys_cache_data_invd_range(addr, size);
|
|
}
|
|
#include <syscalls/sys_cache_data_invd_range_mrsh.c>
|
|
|
|
static inline int z_vrfy_sys_cache_data_flush_and_invd_range(void *addr, size_t size)
|
|
{
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
|
|
|
return z_impl_sys_cache_data_flush_and_invd_range(addr, size);
|
|
}
|
|
#include <syscalls/sys_cache_data_flush_and_invd_range_mrsh.c>
|