blob: 46c62c0b4461efb6b4b584cf7d721715be4cf58a [file] [log] [blame]
Heinrich Schuchardt47c5e192020-12-09 19:42:44 +01001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
4 */
5
6#include <common.h>
7#include <cpu_func.h>
8#include <asm/state.h>
9
10void flush_cache(unsigned long addr, unsigned long size)
11{
12 /* Clang uses (char *) parameters, GCC (void *) */
13 __builtin___clear_cache((void *)addr, (void *)(addr + size));
14}
15
16void invalidate_icache_all(void)
17{
18 struct sandbox_state *state = state_get_current();
19
20 /* Clang uses (char *) parameters, GCC (void *) */
21 __builtin___clear_cache((void *)state->ram_buf,
22 (void *)(state->ram_buf + state->ram_size));
23}