This source file includes following definitions.
- my_restart
1 #include "../generic/check_compat.c"
2
3 extern long *blob_chdk_core;
4 extern long blob_chdk_core_size;
5
6 #define DEBUG_LED ((volatile int *)0xC0220120 )
7 #define DELAY 500000
8
9 void __attribute__((noreturn)) my_restart()
10 {
11
12
13
14
15
16
17
18
19
20
21 long *dst = (long*)MEMISOSTART;
22 const long *src = blob_chdk_core;
23 long length = (blob_chdk_core_size + 3) >> 2;
24
25 core_copy(src, dst, length);
26
27
28
29
30 asm volatile (
31 "MRS R0, CPSR\n"
32 "BIC R0, R0, #0x3F\n"
33 "ORR R0, R0, #0xD3\n"
34 "MSR CPSR, R0\n"
35
36 "MOV R0, #0x78 \n"
37 "MCR p15, 0, R0, c1, c0 \n"
38 "MOV R0, #0 \n"
39 "MCR p15, 0, R0, c7, c10, 4 \n"
40 "MCR p15, 0, R0, c7, c5 \n"
41 "MCR p15, 0, R0, c7, c6 \n"
42 "MOV R0, #0x80000006 \n"
43 "MCR p15, 0, R0, c9, c1 \n"
44 "MCR p15, 0, R0, c9, c1, 1 \n"
45 "MRC p15, 0, R0, c1, c0 \n"
46 "ORR R0, R0, #0x50000 \n"
47 "MCR p15, 0, R0, c1, c0 \n"
48 "LDR R0, =0x12345678 \n"
49 "MOV R1, #0x80000000 \n"
50 "STR R0, [R1, #0xFFC] \n"
51
52 "MOV R0, %0\n"
53
54 "BX R0 \n"
55 : : "r"(MEMISOSTART) : "memory","r0","r1","r2","r3","r4");
56
57 while(1);
58 }
59