2019-04-16 23:24:35 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-10-24 15:40:25 +08:00
|
|
|
// Copyright (C) 2005-2017 Andes Technology Corporation
|
|
|
|
|
|
|
|
#ifndef __NDS32_CACHEFLUSH_H__
|
|
|
|
#define __NDS32_CACHEFLUSH_H__
|
|
|
|
|
|
|
|
#include <linux/mm.h>
|
|
|
|
|
|
|
|
#define PG_dcache_dirty PG_arch_1
|
|
|
|
|
2018-06-28 18:03:25 +08:00
|
|
|
void flush_icache_range(unsigned long start, unsigned long end);
|
asm-generic/nds32: don't redefine cacheflush primitives
The commit c296d4dc13ae ("asm-generic: fix a compilation warning") changed
asm-generic/cachflush.h to use static inlines instead of macros and as a
result the nds32 build with CONFIG_CPU_CACHE_ALIASING=n fails:
CC init/main.o
In file included from arch/nds32/include/asm/cacheflush.h:43,
from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
include/asm-generic/cacheflush.h:50:20: error: static declaration of 'flush_icache_range' follows non-static declaration
static inline void flush_icache_range(unsigned long start, unsigned long end)
^~~~~~~~~~~~~~~~~~
In file included from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
arch/nds32/include/asm/cacheflush.h:11:6: note: previous declaration of 'flush_icache_range' was here
void flush_icache_range(unsigned long start, unsigned long end);
^~~~~~~~~~~~~~~~~~
Surround the inline functions in asm-generic/cacheflush.h by ifdef's so
that architectures could override them and add the required overrides to
nds32.
Fixes: c296d4dc13ae ("asm-generic: fix a compilation warning")
Link: https://lore.kernel.org/lkml/201912212139.yptX8CsV%25lkp@intel.com/
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-23 19:00:03 +08:00
|
|
|
#define flush_icache_range flush_icache_range
|
|
|
|
|
2018-06-28 18:03:25 +08:00
|
|
|
void flush_icache_page(struct vm_area_struct *vma, struct page *page);
|
asm-generic/nds32: don't redefine cacheflush primitives
The commit c296d4dc13ae ("asm-generic: fix a compilation warning") changed
asm-generic/cachflush.h to use static inlines instead of macros and as a
result the nds32 build with CONFIG_CPU_CACHE_ALIASING=n fails:
CC init/main.o
In file included from arch/nds32/include/asm/cacheflush.h:43,
from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
include/asm-generic/cacheflush.h:50:20: error: static declaration of 'flush_icache_range' follows non-static declaration
static inline void flush_icache_range(unsigned long start, unsigned long end)
^~~~~~~~~~~~~~~~~~
In file included from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
arch/nds32/include/asm/cacheflush.h:11:6: note: previous declaration of 'flush_icache_range' was here
void flush_icache_range(unsigned long start, unsigned long end);
^~~~~~~~~~~~~~~~~~
Surround the inline functions in asm-generic/cacheflush.h by ifdef's so
that architectures could override them and add the required overrides to
nds32.
Fixes: c296d4dc13ae ("asm-generic: fix a compilation warning")
Link: https://lore.kernel.org/lkml/201912212139.yptX8CsV%25lkp@intel.com/
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-23 19:00:03 +08:00
|
|
|
#define flush_icache_page flush_icache_page
|
|
|
|
|
2017-10-24 15:40:25 +08:00
|
|
|
#ifdef CONFIG_CPU_CACHE_ALIASING
|
|
|
|
void flush_cache_mm(struct mm_struct *mm);
|
|
|
|
void flush_cache_dup_mm(struct mm_struct *mm);
|
|
|
|
void flush_cache_range(struct vm_area_struct *vma,
|
|
|
|
unsigned long start, unsigned long end);
|
|
|
|
void flush_cache_page(struct vm_area_struct *vma,
|
|
|
|
unsigned long addr, unsigned long pfn);
|
|
|
|
void flush_cache_kmaps(void);
|
|
|
|
void flush_cache_vmap(unsigned long start, unsigned long end);
|
|
|
|
void flush_cache_vunmap(unsigned long start, unsigned long end);
|
|
|
|
|
|
|
|
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
|
|
|
|
void flush_dcache_page(struct page *page);
|
2020-12-17 00:06:33 +08:00
|
|
|
void flush_dcache_folio(struct folio *folio);
|
2017-10-24 15:40:25 +08:00
|
|
|
void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
|
|
|
|
unsigned long vaddr, void *dst, void *src, int len);
|
|
|
|
void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
|
|
|
|
unsigned long vaddr, void *dst, void *src, int len);
|
|
|
|
|
|
|
|
#define ARCH_HAS_FLUSH_ANON_PAGE
|
|
|
|
void flush_anon_page(struct vm_area_struct *vma,
|
|
|
|
struct page *page, unsigned long vaddr);
|
|
|
|
|
2021-09-03 05:56:36 +08:00
|
|
|
#define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1
|
2018-04-19 15:38:58 +08:00
|
|
|
void flush_kernel_vmap_range(void *addr, int size);
|
|
|
|
void invalidate_kernel_vmap_range(void *addr, int size);
|
2018-04-11 07:36:56 +08:00
|
|
|
#define flush_dcache_mmap_lock(mapping) xa_lock_irq(&(mapping)->i_pages)
|
|
|
|
#define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
|
2017-10-24 15:40:25 +08:00
|
|
|
|
|
|
|
#else
|
2020-06-08 12:42:22 +08:00
|
|
|
void flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
|
2018-06-28 18:03:25 +08:00
|
|
|
unsigned long addr, int len);
|
2020-06-08 12:42:22 +08:00
|
|
|
#define flush_icache_user_page flush_icache_user_page
|
asm-generic/nds32: don't redefine cacheflush primitives
The commit c296d4dc13ae ("asm-generic: fix a compilation warning") changed
asm-generic/cachflush.h to use static inlines instead of macros and as a
result the nds32 build with CONFIG_CPU_CACHE_ALIASING=n fails:
CC init/main.o
In file included from arch/nds32/include/asm/cacheflush.h:43,
from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
include/asm-generic/cacheflush.h:50:20: error: static declaration of 'flush_icache_range' follows non-static declaration
static inline void flush_icache_range(unsigned long start, unsigned long end)
^~~~~~~~~~~~~~~~~~
In file included from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
arch/nds32/include/asm/cacheflush.h:11:6: note: previous declaration of 'flush_icache_range' was here
void flush_icache_range(unsigned long start, unsigned long end);
^~~~~~~~~~~~~~~~~~
Surround the inline functions in asm-generic/cacheflush.h by ifdef's so
that architectures could override them and add the required overrides to
nds32.
Fixes: c296d4dc13ae ("asm-generic: fix a compilation warning")
Link: https://lore.kernel.org/lkml/201912212139.yptX8CsV%25lkp@intel.com/
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-23 19:00:03 +08:00
|
|
|
|
|
|
|
#include <asm-generic/cacheflush.h>
|
2017-10-24 15:40:25 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __NDS32_CACHEFLUSH_H__ */
|