提交 b9a90a6e 编写于 作者: H Hanjun Guo 提交者: Chen Jun

arm64: cache: Export and add cache invalidation and clean ABIs for module use

hulk inclusion
category: feature
bugzilla: 46503
CVE: NA

---------------------------

Adding more invalidation and clean ABIs for kernel and kernel module
use.

For now we have 7 functions for module:

void flush_icache_range(unsigned long start, unsigned long end);
void inval_dcache_area(void *addr, size_t len);
void clean_dcache_area(void *addr, size_t len);
void flush_dcache_area(void *addr, size_t len);
void inval_dcache_range(unsigned long start, unsigned long end);
void clean_dcache_range(unsigned long start, unsigned long end);
void flush_dcache_range(unsigned long start, unsigned long end);
Signed-off-by: NHanjun Guo <guohanjun@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
上级 095de3a5
...@@ -96,12 +96,57 @@ static inline void flush_icache_range(unsigned long start, unsigned long end) ...@@ -96,12 +96,57 @@ static inline void flush_icache_range(unsigned long start, unsigned long end)
} }
#define flush_icache_range flush_icache_range #define flush_icache_range flush_icache_range
/*
* Ensure that any D-cache lines for the interval [addr, addr+len)
* are invalidated.
*
* addr: kernel address
* len: size of the address
*/
static inline void inval_dcache_area(void *addr, size_t len)
{
__inval_dcache_area(addr, len);
}
/* Ensure that any D-cache lines for the interval [addr, addr+len)
* are cleaned to the PoC.
*
* addr: kernel address
* len: size of the address
*/
static inline void clean_dcache_area(void *addr, size_t len)
{
__clean_dcache_area_poc(addr, len);
}
/* Ensure that any D-cache lines for the interval [addr, addr+len)
* are cleaned and invalidated to the PoC.
*
* addr: kernel address
* len: size of the address
*/
static inline void flush_dcache_area(void *addr, size_t len) static inline void flush_dcache_area(void *addr, size_t len)
{ {
__flush_dcache_area(addr, len); __flush_dcache_area(addr, len);
} }
#define flush_dcache_area flush_dcache_area #define flush_dcache_area flush_dcache_area
/* start and end are kernel addresses */
static inline void inval_dcache_range(unsigned long start, unsigned long end)
{
__inval_dcache_area((void *)start, end - start);
}
static inline void clean_dcache_range(unsigned long start, unsigned long end)
{
__clean_dcache_area_poc((void *)start, end - start);
}
static inline void flush_dcache_range(unsigned long start, unsigned long end)
{
__flush_dcache_area((void *)start, end - start);
}
/* /*
* Cache maintenance functions used by the DMA API. No to be used directly. * Cache maintenance functions used by the DMA API. No to be used directly.
*/ */
......
...@@ -76,6 +76,8 @@ EXPORT_SYMBOL(flush_dcache_page); ...@@ -76,6 +76,8 @@ EXPORT_SYMBOL(flush_dcache_page);
* Additional functions defined in assembly. * Additional functions defined in assembly.
*/ */
EXPORT_SYMBOL(__flush_icache_range); EXPORT_SYMBOL(__flush_icache_range);
EXPORT_SYMBOL(__inval_dcache_area);
EXPORT_SYMBOL(__clean_dcache_area_poc);
EXPORT_SYMBOL(__flush_dcache_area); EXPORT_SYMBOL(__flush_dcache_area);
#ifdef CONFIG_ARCH_HAS_PMEM_API #ifdef CONFIG_ARCH_HAS_PMEM_API
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册