This source file includes following definitions.
- my_restart
1 #include "../generic/check_compat.c"
2
3
4
5
6 extern long *blob_chdk_core;
7
8 extern long blob_chdk_core_size;
9
10
11
12
13 void __attribute__((noreturn)) my_restart()
14 {
15 {
16
17
18 long *dst = (long*)MEMISOSTART;
19 const long *src = blob_chdk_core;
20 long length = (blob_chdk_core_size + 3) >> 2;
21
22 core_copy(src, dst, length);
23
24 }
25
26
27 asm volatile (
28 "mrs r0, CPSR\n"
29 "bic r0, r0, #63\n"
30 "orr r0, r0, #211\n"
31 "msr CPSR, r0\n"
32 "ldr r1, =0xc0200000\n"
33 "mvn r0, #0\n"
34 "str r0, [r1, #268]\n"
35 "str r0, [r1, #12]\n"
36 "str r0, [r1, #28]\n"
37 "str r0, [r1, #44]\n"
38 "str r0, [r1, #60]\n"
39 "str r0, [r1, #76]\n"
40 "str r0, [r1, #92]\n"
41 "str r0, [r1, #108]\n"
42 "str r0, [r1, #124]\n"
43 "str r0, [r1, #140]\n"
44 "str r0, [r1, #156]\n"
45 "str r0, [r1, #172]\n"
46 "str r0, [r1, #188]\n"
47 "str r0, [r1, #204]\n"
48 "str r0, [r1, #220]\n"
49 "str r0, [r1, #236]\n"
50 "cmp r4, #7\n"
51 "str r0, [r1, #252]\n"
52 "popeq {r4, pc}\n"
53 "ldr r0, =0x78\n"
54 "mcr 15, 0, r0, cr1, cr0, 0\n"
55 "ldr r0, =0x0\n"
56 "mcr 15, 0, r0, cr7, cr10, 4\n"
57 "mcr 15, 0, r0, cr7, cr5, 0\n"
58 "mcr 15, 0, r0, cr7, cr6, 0\n"
59 "ldr r0, =0x80000006\n"
60 "mcr 15, 0, r0, cr9, cr1, 0\n"
61 "mcr 15, 0, r0, cr9, cr1, 1\n"
62 "mrc 15, 0, r0, cr1, cr0, 0\n"
63 "orr r0, r0, #327680\n"
64 "mcr 15, 0, r0, cr1, cr0, 0\n"
65 "ldr r0, =0x12345678\n"
66 "ldr r1, =0x80000000\n"
67 "str r0, [r1, #4092]\n"
68
69 "mov r0, %0\n"
70 "pop {r4, lr}\n"
71 "bx r0\n"
72 : : "r"(MEMISOSTART) : "memory","r0","r1","r2","r3","r4");
73
74 while(1);
75 }
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114