1
2
3
4
5
6
7
8 #include <asm/processor.h>
9 #include <asm/ppc_asm.h>
10 #include <asm/vdso.h>
11 #include <asm/asm-offsets.h>
12
13 .text
14
15
16
17
18
19
20
21
22
23 V_FUNCTION_BEGIN(__kernel_sync_dicache)
24 .cfi_startproc
25 mflr r12
26 .cfi_register lr,r12
27 mr r11,r3
28 bl __get_datapage@local
29 mtlr r12
30 mr r10,r3
31
32 lwz r7,CFG_DCACHE_BLOCKSZ(r10)
33 addi r5,r7,-1
34 andc r6,r11,r5
35 subf r8,r6,r4
36 add r8,r8,r5
37 lwz r9,CFG_DCACHE_LOGBLOCKSZ(r10)
38 srw. r8,r8,r9
39 crclr cr0*4+so
40 beqlr
41 mtctr r8
42 1: dcbst 0,r6
43 add r6,r6,r7
44 bdnz 1b
45 sync
46
47
48
49 lwz r7,CFG_ICACHE_BLOCKSZ(r10)
50 addi r5,r7,-1
51 andc r6,r11,r5
52 subf r8,r6,r4
53 add r8,r8,r5
54 lwz r9,CFG_ICACHE_LOGBLOCKSZ(r10)
55 srw. r8,r8,r9
56 crclr cr0*4+so
57 beqlr
58 mtctr r8
59 2: icbi 0,r6
60 add r6,r6,r7
61 bdnz 2b
62 isync
63 li r3,0
64 blr
65 .cfi_endproc
66 V_FUNCTION_END(__kernel_sync_dicache)
67
68
69
70
71
72 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
73 .cfi_startproc
74 crclr cr0*4+so
75 sync
76 isync
77 li r3,0
78 blr
79 .cfi_endproc
80 V_FUNCTION_END(__kernel_sync_dicache_p5)
81