riscv: move flush_icache_{all,mm} to cacheflush.c
authorGary Guo <gary@garyguo.net>
Wed, 27 Mar 2019 00:41:25 +0000 (00:41 +0000)
committerPalmer Dabbelt <palmer@sifive.com>
Fri, 17 May 2019 03:42:12 +0000 (20:42 -0700)
commit58de77545e53b94cd6c816776197dade598632c5
tree2472a19173ceea0148de0e34c5de2fc2ecac6968
parentf91253a3d005796404ae0e578b3394459b5f9b71
riscv: move flush_icache_{all,mm} to cacheflush.c

Currently, flush_icache_all is macro-expanded into a SBI call, yet no
asm/sbi.h is included in asm/cacheflush.h. This could be moved to
mm/cacheflush.c instead (SBI call will dominate performance-wise and
there is no worry to not have it inlined.

Currently, flush_icache_mm stays in kernel/smp.c, which looks like a
hack to prevent it from being compiled when CONFIG_SMP=n. It should
also be in mm/cacheflush.c.

Signed-off-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/include/asm/cacheflush.h
arch/riscv/kernel/smp.c
arch/riscv/mm/cacheflush.c