summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/include/arch/cache.h
blob: 5333c61e1fab7c03f3833b3eca235bd648936aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* SPDX-License-Identifier: BSD-3-Clause */
/* This file is part of the coreboot project. */

#ifndef ARCH_CACHE_H
#define ARCH_CACHE_H

#include <cpu/x86/cache.h>

/* Executing WBINVD when running out of CAR would not be good, prevent that. */
static inline void dcache_clean_invalidate_all(void)
{
	if (!ENV_CACHE_AS_RAM)
		wbinvd();
}
static inline void dcache_clean_all(void)
{
	/* x86 doesn't have a "clean without invalidate", fall back to both. */
	dcache_clean_invalidate_all();
}
static inline void dcache_invalidate_all(void)
{
	if (!ENV_CACHE_AS_RAM)
		invd();
}

#endif /* ARCH_CACHE_H */