2 * vDSO provided cache flush routines
4 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org),
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
12 #include <linux/config.h>
13 #include <asm/processor.h>
14 #include <asm/ppc_asm.h>
16 #include <asm/offsets.h>
21 * Default "generic" version of __kernel_sync_dicache.
23 * void __kernel_sync_dicache(unsigned long start, unsigned long end)
25 * Flushes the data cache & invalidate the instruction cache for the
26 * provided range [start, end[
28 * Note: all CPUs supported by this kernel have a 128 bytes cache
29 * line size so we don't have to peek that info from the datapage
31 V_FUNCTION_BEGIN(__kernel_sync_dicache)
34 andc r6,r3,r5 /* round low to line bdy */
35 subf r8,r6,r4 /* compute length */
36 add r8,r8,r5 /* ensure we get enough */
37 srwi. r8,r8,7 /* compute line count */
38 beqlr /* nothing to do? */
53 V_FUNCTION_END(__kernel_sync_dicache)
57 * POWER5 version of __kernel_sync_dicache
59 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
66 V_FUNCTION_END(__kernel_sync_dicache_p5)