forked from waninkoko/es-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.s
More file actions
66 lines (52 loc) · 835 Bytes
/
Copy pathtools.s
File metadata and controls
66 lines (52 loc) · 835 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.text
.align 4
.code 32
/* Direct syscalls */
.global DCInvalidateRange
DCInvalidateRange:
mcr p15, 0, r0, c7, c6, 1
add r0, #0x20
subs r1, #1
bne DCInvalidateRange
bx lr
.global DCFlushRange
DCFlushRange:
mcr p15, 0, r0, c7, c10, 1
add r0, #0x20
subs r1, #1
bne DCFlushRange
bx lr
.global ICInvalidate
ICInvalidate:
mov r0, #0
mcr p15, 0, r0, c7, c5, 0
bx lr
/* MLoad syscalls */
.global Swi_MLoad
Swi_MLoad:
svc 0xcc
bx lr
/* ARM permissions */
.global Perms_Read
Perms_Read:
mrc p15, 0, r0, c3, c0
bx lr
.global Perms_Write
Perms_Write:
mcr p15, 0, r0, c3, c0
bx lr
/* MEM2 routines */
.global MEM2_Prot
MEM2_Prot:
ldr r1, =0xD8B420A
strh r0, [r1]
bx lr
/* Tools */
.global VirtToPhys
VirtToPhys:
and r0, #0x7fffffff
bx lr
.global PhysToVirt
PhysToVirt:
orr r0, #0x80000000
bx lr