Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afs / LINUX / osi_flush.s
CommitLineData
805e021f
CE
1/* Taken from linux-2.6/arch/ppc64/boot/string.S
2 *
3 * Copyright (C) Paul Mackerras 1997.
4 *
5 * Copyright 2000, International Business Machines Corporation and others.
6 * All Rights Reserved.
7 *
8 * This software has been released under the terms of the IBM Public
9 * License. For details, see the LICENSE file in the top-level source
10 * directory or online at http://www.openafs.org/dl/license10.html
11 *
12 * Flush the dcache and invalidate the icache for a range of addresses.
13 *
14 * flush_cache(addr, len)
15 */
16 .section ".text"
17 .align 2
18 .globl flush_cache
19 .section ".opd","aw"
20 .align 3
21flush_cache:
22 .quad .flush_cache,.TOC.@tocbase,0
23 .previous
24 .size flush_cache,24
25 .globl .flush_cache
26.flush_cache:
27 addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
28 rlwinm. 4,4,27,5,31
29 mtctr 4
30 beqlr
311: dcbf 0,3
32 icbi 0,3
33 addi 3,3,0x20
34 bdnz 1b
35 sync
36 isync
37 blr
38 .long 0
39 .byte 0,12,0,0,0,0,0,0
40 .type .flush_cache,@function
41 .size .flush_cache,.-.flush_cache