2 * Copyright (c) 2011 The Chromium OS Authors.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __X86_CACHE_H__
8 #define __X86_CACHE_H__
11 * If CONFIG_SYS_CACHELINE_SIZE is defined use it for DMA alignment. Otherwise
12 * use 64-bytes, a safe default for x86.
14 #ifdef CONFIG_SYS_CACHELINE_SIZE
15 #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
17 #define ARCH_DMA_MINALIGN 64
20 static inline void wbinvd(void)
22 asm volatile ("wbinvd" : : : "memory");
25 static inline void invd(void)
27 asm volatile("invd" : : : "memory");
30 /* Enable caches and write buffer */
31 void enable_caches(void);
33 /* Disable caches and write buffer */
34 void disable_caches(void);
36 #endif /* __X86_CACHE_H__ */