blob: 256a3c01ed98f1b571582421db8c8462a449c62f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Anton Staaf49d351b2011-10-17 16:46:12 -07002/*
3 * Copyright (c) 2011 The Chromium OS Authors.
Anton Staaf49d351b2011-10-17 16:46:12 -07004 */
5
6#ifndef __X86_CACHE_H__
7#define __X86_CACHE_H__
8
9/*
Tom Rini3ef67ae2021-08-26 11:47:59 -040010 * Use CONFIG_SYS_CACHELINE_SIZE (which is set to 64-bytes) for DMA alignment.
Anton Staaf49d351b2011-10-17 16:46:12 -070011 */
Stefan Roese1daf4772016-07-18 12:53:31 +020012#define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
13
Stefan Reinauer2acf8482012-12-02 04:49:50 +000014static inline void wbinvd(void)
15{
16 asm volatile ("wbinvd" : : : "memory");
17}
18
19static inline void invd(void)
20{
21 asm volatile("invd" : : : "memory");
22}
23
24/* Enable caches and write buffer */
25void enable_caches(void);
26
27/* Disable caches and write buffer */
28void disable_caches(void);
29
Anton Staaf49d351b2011-10-17 16:46:12 -070030#endif /* __X86_CACHE_H__ */