forked from gligli/xell
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcache.S
More file actions
49 lines (46 loc) · 726 Bytes
/
cache.S
File metadata and controls
49 lines (46 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#define CACHE_SIZE 0x80
.globl dcache_flush
dcache_flush:
lis %r5, 0xFFFF
ori %r5, %r5, 0xFFF1
and %r5, %r5, %r3
subf %r3, %r5, %r3
add %r4, %r4, %r3
1:
dcbst %r0, %r5
addic %r5, %r5, CACHE_SIZE
subic. %r4, %r4, CACHE_SIZE
bge 1b
isync
blr
.globl dcache_inv
dcache_inv:
lis %r5, 0xFFFF
ori %r5, %r5, 0xFFF1
and %r5, %r5, %r3
subf %r3, %r5, %r3
add %r4, %r4, %r3
1:
dcbf %r0, %r5
addic %r5, %r5, CACHE_SIZE
subic. %r4, %r4, CACHE_SIZE
bge 1b
isync
blr
.globl flush_code
flush_code:
lis %r5, 0xFFFF
ori %r5, %r5, 0xFFF1
and %r5, %r5, %r3
subf %r3, %r5, %r3
add %r4, %r4, %r3
1:
dcbst %r0, %r5
sync
icbi %r0, %r5
addic %r5, %r5, CACHE_SIZE
subic. %r4, %r4, CACHE_SIZE
bge 1b
sync
isync
blr