aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/vdso32/cacheflush.S
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/ppc64/kernel/vdso32/cacheflush.S
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/ppc64/kernel/vdso32/cacheflush.S')
-rw-r--r--arch/ppc64/kernel/vdso32/cacheflush.S65
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/vdso32/cacheflush.S b/arch/ppc64/kernel/vdso32/cacheflush.S
new file mode 100644
index 000000000000..c74fddb6afd4
--- /dev/null
+++ b/arch/ppc64/kernel/vdso32/cacheflush.S
@@ -0,0 +1,65 @@
1/*
2 * vDSO provided cache flush routines
3 *
4 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org),
5 * IBM Corp.
6 *
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.
11 */
12#include <linux/config.h>
13#include <asm/processor.h>
14#include <asm/ppc_asm.h>
15#include <asm/vdso.h>
16#include <asm/offsets.h>
17
18 .text
19
20/*
21 * Default "generic" version of __kernel_sync_dicache.
22 *
23 * void __kernel_sync_dicache(unsigned long start, unsigned long end)
24 *
25 * Flushes the data cache & invalidate the instruction cache for the
26 * provided range [start, end[
27 *
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
30 */
31V_FUNCTION_BEGIN(__kernel_sync_dicache)
32 .cfi_startproc
33 li r5,127
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? */
39 mtctr r8
40 mr r3,r6
411: dcbst 0,r3
42 addi r3,r3,128
43 bdnz 1b
44 sync
45 mtctr r8
461: icbi 0,r6
47 addi r6,r6,128
48 bdnz 1b
49 isync
50 blr
51 .cfi_endproc
52V_FUNCTION_END(__kernel_sync_dicache)
53
54
55/*
56 * POWER5 version of __kernel_sync_dicache
57 */
58V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
59 .cfi_startproc
60 sync
61 isync
62 blr
63 .cfi_endproc
64V_FUNCTION_END(__kernel_sync_dicache_p5)
65