u-boot/arch/sandbox/cpu/cache.c
Tom Rini 460b2c068c sandbox: Audit config.h and common.h usage
Remove and replace common.h and config.h in sandbox when it's not needed
and add some explicit includes where needed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-12-21 08:54:37 -05:00

22 lines
568 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
*/
#include <cpu_func.h>
#include <asm/state.h>
void flush_cache(unsigned long addr, unsigned long size)
{
/* Clang uses (char *) parameters, GCC (void *) */
__builtin___clear_cache((void *)addr, (void *)(addr + size));
}
void invalidate_icache_all(void)
{
struct sandbox_state *state = state_get_current();
/* Clang uses (char *) parameters, GCC (void *) */
__builtin___clear_cache((void *)state->ram_buf,
(void *)(state->ram_buf + state->ram_size));
}