-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbpatch.S
More file actions
35 lines (29 loc) · 847 Bytes
/
Copy pathbpatch.S
File metadata and controls
35 lines (29 loc) · 847 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
/* bpatch.S */
.syntax unified
.cpu arm926ej-s
/* ----------------- Start ----------------- */
.thumb
.global _start
_start:
adr r0, arm_entry
bx r0
/* ---------------- ARM mode ---------------- */
.arm
arm_entry:
1: mrc p15, 0, r15, c7, c10, 3 /* test_clean_d_cache */
bne 1b
mov r0, #0 /* drain_write_buffer */
mcr p15, 0, r0, c7, c10, 4
mov r0, #0 /* invalidate_i_cache */
mcr p15, 0, r0, c7, c5, 0
adr r0, thumb_entry+1
bx r0
/* ---------------- Thumb mode --------------- */
.thumb
thumb_entry:
movs r0, r5
adds r0, r0, #0x10
movs r1, r6
adds r1, r1, #0x10
blx r1
nop