2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2011-10-17 23:46:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011 The Chromium OS Authors.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __X86_CACHE_H__
|
|
|
|
#define __X86_CACHE_H__
|
|
|
|
|
|
|
|
/*
|
2021-08-26 15:47:59 +00:00
|
|
|
* Use CONFIG_SYS_CACHELINE_SIZE (which is set to 64-bytes) for DMA alignment.
|
2011-10-17 23:46:12 +00:00
|
|
|
*/
|
2016-07-18 10:53:31 +00:00
|
|
|
#define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
|
|
|
|
|
2012-12-02 04:49:50 +00:00
|
|
|
static inline void wbinvd(void)
|
|
|
|
{
|
|
|
|
asm volatile ("wbinvd" : : : "memory");
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void invd(void)
|
|
|
|
{
|
|
|
|
asm volatile("invd" : : : "memory");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Enable caches and write buffer */
|
|
|
|
void enable_caches(void);
|
|
|
|
|
|
|
|
/* Disable caches and write buffer */
|
|
|
|
void disable_caches(void);
|
|
|
|
|
2011-10-17 23:46:12 +00:00
|
|
|
#endif /* __X86_CACHE_H__ */
|