1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * vDSO provided cache flush routines
8 #include <asm/processor.h>
9 #include <asm/ppc_asm.h>
11 #include <asm/vdso_datapage.h>
12 #include <asm/asm-offsets.h>
17 * Default "generic" version of __kernel_sync_dicache.
19 * void __kernel_sync_dicache(unsigned long start, unsigned long end)
21 * Flushes the data cache & invalidate the instruction cache for the
22 * provided range [start, end[
24 V_FUNCTION_BEGIN(__kernel_sync_dicache)
31 lwz r7,CFG_DCACHE_BLOCKSZ(r10)
33 andc r6,r3,r5 /* round low to line bdy */
34 subf r8,r6,r4 /* compute length */
35 add r8,r8,r5 /* ensure we get enough */
36 lwz r9,CFG_DCACHE_LOGBLOCKSZ(r10)
37 srd. r8,r8,r9 /* compute line count */
39 beqlr /* nothing to do? */
46 /* Now invalidate the instruction cache */
48 lwz r7,CFG_ICACHE_BLOCKSZ(r10)
50 andc r6,r3,r5 /* round low to line bdy */
51 subf r8,r6,r4 /* compute length */
53 lwz r9,CFG_ICACHE_LOGBLOCKSZ(r10)
54 srd. r8,r8,r9 /* compute line count */
56 beqlr /* nothing to do? */
65 V_FUNCTION_END(__kernel_sync_dicache)
69 * POWER5 version of __kernel_sync_dicache
71 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
79 V_FUNCTION_END(__kernel_sync_dicache_p5)