This source file includes following definitions.
- my_restart
1 #include "../generic/check_compat.c"
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 extern long *blob_chdk_core;
26
27 extern long blob_chdk_core_size;
28
29
30
31
32 void __attribute__((noreturn)) my_restart()
33 {
34 {
35
36
37 long *dst = (long*)MEMISOSTART;
38 const long *src = blob_chdk_core;
39 long length = (blob_chdk_core_size + 3) >> 2;
40
41 core_copy(src, dst, length);
42
43 }
44
45 asm volatile(
46 "MRS R1, CPSR\n"
47 "BIC R1, R1, #0x3F\n"
48 "ORR R1, R1, #0xD3\n"
49 "MSR CPSR_cf, R1\n"
50
51 "LDR R2, =0xC0200000\n"
52 "MOV R1, #0xFFFFFFFF\n"
53 "STR R1, [R2,#0x10C]\n"
54 "STR R1, [R2,#0xC]\n"
55 "STR R1, [R2,#0x1C]\n"
56 "STR R1, [R2,#0x2C]\n"
57 "STR R1, [R2,#0x3C]\n"
58 "STR R1, [R2,#0x4C]\n"
59 "STR R1, [R2,#0x5C]\n"
60 "STR R1, [R2,#0x6C]\n"
61 "STR R1, [R2,#0x7C]\n"
62 "STR R1, [R2,#0x8C]\n"
63 "STR R1, [R2,#0x9C]\n"
64 "STR R1, [R2,#0xAC]\n"
65 "STR R1, [R2,#0xBC]\n"
66 "STR R1, [R2,#0xCC]\n"
67 "STR R1, [R2,#0xDC]\n"
68 "STR R1, [R2,#0xEC]\n"
69 "STR R1, [R2,#0xFC]\n"
70
71 "MOV R1, #0x78\n"
72 "MCR p15, 0, R1,c1,c0\n"
73 "MOV R1, #0\n"
74 "MCR p15, 0, R1,c7,c10, 4\n"
75 "MCR p15, 0, R1,c7,c5\n"
76 "MCR p15, 0, R1,c7,c6\n"
77 "MOV R2, #0x40000000\n"
78 "ORR R1, R2, #6\n"
79 "MCR p15, 0, R1,c9,c1\n"
80 "ORR R1, R1, #6\n"
81 "MCR p15, 0, R1,c9,c1, 1\n"
82 "MRC p15, 0, R1,c1,c0\n"
83 "ORR R1, R1, #0x50000\n"
84 "MCR p15, 0, R1,c1,c0\n"
85
86 "MOV R3, #0xFF0\n"
87 "LDR R1, =0x12345678\n"
88 "ADD R3, R3, #0x4000000C\n"
89 "STR R1, [R3]\n"
90
91 "MOV SP, #0x1900\n"
92 "MOV LR, PC\n"
93 "MOV PC, %0\n"
94 : : "r"(MEMISOSTART) : "memory","r1","r2","r3");
95
96 while(1);
97 }
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138